comparison main/MainWindow.cpp @ 323:cf4e9827968b

* add ffwd/rwd-similar to menu and add shortcuts for them (shift+pgup/down)
author Chris Cannam
date Mon, 30 Mar 2009 09:17:44 +0000
parents dfb586b4d50d
children b23dddea4a35
comparison
equal deleted inserted replaced
322:0fbfc9ade49d 323:cf4e9827968b
137 m_rightButtonPlaybackMenu(0), 137 m_rightButtonPlaybackMenu(0),
138 m_soloAction(0), 138 m_soloAction(0),
139 m_soloModified(false), 139 m_soloModified(false),
140 m_prevSolo(false), 140 m_prevSolo(false),
141 m_rwdStartAction(0), 141 m_rwdStartAction(0),
142 m_rwdSimilarAction(0),
142 m_rwdAction(0), 143 m_rwdAction(0),
143 m_ffwdAction(0), 144 m_ffwdAction(0),
145 m_ffwdSimilarAction(0),
144 m_ffwdEndAction(0), 146 m_ffwdEndAction(0),
145 m_playAction(0), 147 m_playAction(0),
146 m_playSelectionAction(0), 148 m_playSelectionAction(0),
147 m_playLoopAction(0), 149 m_playLoopAction(0),
148 m_playControlsSpacer(0), 150 m_playControlsSpacer(0),
1679 m_rwdAction->setShortcut(tr("PgUp")); 1681 m_rwdAction->setShortcut(tr("PgUp"));
1680 m_rwdAction->setStatusTip(tr("Rewind to the previous time instant or time ruler notch")); 1682 m_rwdAction->setStatusTip(tr("Rewind to the previous time instant or time ruler notch"));
1681 connect(m_rwdAction, SIGNAL(triggered()), this, SLOT(rewind())); 1683 connect(m_rwdAction, SIGNAL(triggered()), this, SLOT(rewind()));
1682 connect(this, SIGNAL(canRewind(bool)), m_rwdAction, SLOT(setEnabled(bool))); 1684 connect(this, SIGNAL(canRewind(bool)), m_rwdAction, SLOT(setEnabled(bool)));
1683 1685
1686 m_rwdSimilarAction = new QAction(tr("Rewind to Similar Point"), this);
1687 m_rwdSimilarAction->setShortcut(tr("Shift+PgUp"));
1688 m_rwdSimilarAction->setStatusTip(tr("Rewind to the previous similarly valued time instant"));
1689 connect(m_rwdSimilarAction, SIGNAL(triggered()), this, SLOT(rewindSimilar()));
1690 connect(this, SIGNAL(canRewind(bool)), m_rwdSimilarAction, SLOT(setEnabled(bool)));
1691
1684 m_playAction = toolbar->addAction(il.load("playpause"), 1692 m_playAction = toolbar->addAction(il.load("playpause"),
1685 tr("Play / Pause")); 1693 tr("Play / Pause"));
1686 m_playAction->setCheckable(true); 1694 m_playAction->setCheckable(true);
1687 m_playAction->setShortcut(tr("Space")); 1695 m_playAction->setShortcut(tr("Space"));
1688 m_playAction->setStatusTip(tr("Start or stop playback from the current position")); 1696 m_playAction->setStatusTip(tr("Start or stop playback from the current position"));
1698 m_ffwdAction->setShortcut(tr("PgDown")); 1706 m_ffwdAction->setShortcut(tr("PgDown"));
1699 m_ffwdAction->setStatusTip(tr("Fast-forward to the next time instant or time ruler notch")); 1707 m_ffwdAction->setStatusTip(tr("Fast-forward to the next time instant or time ruler notch"));
1700 connect(m_ffwdAction, SIGNAL(triggered()), this, SLOT(ffwd())); 1708 connect(m_ffwdAction, SIGNAL(triggered()), this, SLOT(ffwd()));
1701 connect(this, SIGNAL(canFfwd(bool)), m_ffwdAction, SLOT(setEnabled(bool))); 1709 connect(this, SIGNAL(canFfwd(bool)), m_ffwdAction, SLOT(setEnabled(bool)));
1702 1710
1711 m_ffwdSimilarAction = new QAction(tr("Fast Forward to Similar Point"), this);
1712 m_ffwdSimilarAction->setShortcut(tr("Shift+PgDown"));
1713 m_ffwdSimilarAction->setStatusTip(tr("Fast-forward to the next similarly valued time instant"));
1714 connect(m_ffwdSimilarAction, SIGNAL(triggered()), this, SLOT(ffwdSimilar()));
1715 connect(this, SIGNAL(canFfwd(bool)), m_ffwdSimilarAction, SLOT(setEnabled(bool)));
1716
1703 m_ffwdEndAction = toolbar->addAction(il.load("ffwd-end"), 1717 m_ffwdEndAction = toolbar->addAction(il.load("ffwd-end"),
1704 tr("Fast Forward to End")); 1718 tr("Fast Forward to End"));
1705 m_ffwdEndAction->setShortcut(tr("End")); 1719 m_ffwdEndAction->setShortcut(tr("End"));
1706 m_ffwdEndAction->setStatusTip(tr("Fast-forward to the end")); 1720 m_ffwdEndAction->setStatusTip(tr("Fast-forward to the end"));
1707 connect(m_ffwdEndAction, SIGNAL(triggered()), this, SLOT(ffwdEnd())); 1721 connect(m_ffwdEndAction, SIGNAL(triggered()), this, SLOT(ffwdEnd()));
1730 m_playLoopAction, SLOT(setChecked(bool))); 1744 m_playLoopAction, SLOT(setChecked(bool)));
1731 connect(m_playLoopAction, SIGNAL(triggered()), this, SLOT(playLoopToggled())); 1745 connect(m_playLoopAction, SIGNAL(triggered()), this, SLOT(playLoopToggled()));
1732 connect(this, SIGNAL(canPlay(bool)), m_playLoopAction, SLOT(setEnabled(bool))); 1746 connect(this, SIGNAL(canPlay(bool)), m_playLoopAction, SLOT(setEnabled(bool)));
1733 1747
1734 m_soloAction = toolbar->addAction(il.load("solo"), 1748 m_soloAction = toolbar->addAction(il.load("solo"),
1735 tr("Solo Current Pane")); 1749 tr("Solo Current Pane"));
1736 m_soloAction->setCheckable(true); 1750 m_soloAction->setCheckable(true);
1737 m_soloAction->setChecked(m_viewManager->getPlaySoloMode()); 1751 m_soloAction->setChecked(m_viewManager->getPlaySoloMode());
1738 m_prevSolo = m_viewManager->getPlaySoloMode(); 1752 m_prevSolo = m_viewManager->getPlaySoloMode();
1739 m_soloAction->setShortcut(tr("o")); 1753 m_soloAction->setShortcut(tr("o"));
1740 m_soloAction->setStatusTip(tr("Solo the current pane during playback")); 1754 m_soloAction->setStatusTip(tr("Solo the current pane during playback"));
1761 m_keyReference->registerShortcut(m_playLoopAction); 1775 m_keyReference->registerShortcut(m_playLoopAction);
1762 m_keyReference->registerShortcut(m_soloAction); 1776 m_keyReference->registerShortcut(m_soloAction);
1763 if (alAction) m_keyReference->registerShortcut(alAction); 1777 if (alAction) m_keyReference->registerShortcut(alAction);
1764 m_keyReference->registerShortcut(m_rwdAction); 1778 m_keyReference->registerShortcut(m_rwdAction);
1765 m_keyReference->registerShortcut(m_ffwdAction); 1779 m_keyReference->registerShortcut(m_ffwdAction);
1780 m_keyReference->registerShortcut(m_rwdSimilarAction);
1781 m_keyReference->registerShortcut(m_ffwdSimilarAction);
1766 m_keyReference->registerShortcut(m_rwdStartAction); 1782 m_keyReference->registerShortcut(m_rwdStartAction);
1767 m_keyReference->registerShortcut(m_ffwdEndAction); 1783 m_keyReference->registerShortcut(m_ffwdEndAction);
1768 1784
1769 menu->addAction(m_playAction); 1785 menu->addAction(m_playAction);
1770 menu->addAction(m_playSelectionAction); 1786 menu->addAction(m_playSelectionAction);
1772 menu->addAction(m_soloAction); 1788 menu->addAction(m_soloAction);
1773 if (alAction) menu->addAction(alAction); 1789 if (alAction) menu->addAction(alAction);
1774 menu->addSeparator(); 1790 menu->addSeparator();
1775 menu->addAction(m_rwdAction); 1791 menu->addAction(m_rwdAction);
1776 menu->addAction(m_ffwdAction); 1792 menu->addAction(m_ffwdAction);
1793 menu->addSeparator();
1794 menu->addAction(m_rwdSimilarAction);
1795 menu->addAction(m_ffwdSimilarAction);
1777 menu->addSeparator(); 1796 menu->addSeparator();
1778 menu->addAction(m_rwdStartAction); 1797 menu->addAction(m_rwdStartAction);
1779 menu->addAction(m_ffwdEndAction); 1798 menu->addAction(m_ffwdEndAction);
1780 menu->addSeparator(); 1799 menu->addSeparator();
1781 1800