changeset 306:6c5df12a08da

Merge
author Chris Cannam
date Thu, 12 Jun 2014 17:23:23 +0100
parents 7777fa612a16 (current diff) 42b355b50e52 (diff)
children af77bfeaa159
files .hgsubstate
diffstat 2 files changed, 54 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Thu Jun 12 17:23:05 2014 +0100
+++ b/.hgsubstate	Thu Jun 12 17:23:23 2014 +0100
@@ -2,6 +2,6 @@
 236814e07bd07473958c1ff89103124536a0c3c8 dataquay
 63773a20ae22311e659fc7ddc2e340afecf21cae pyin
 553a5f65ef64811747a6613f759622d655db63c1 sv-dependency-builds
-42a5801da931d1c4c3b42aa1d62cd8de7636f5cf svapp
+337cdb5e5b06901d7971e9499a90fd167441fc46 svapp
 e88a15c25a4a5323be1b339c03218c9a1001d0f3 svcore
-488add397d34e6944f87a625689bbba5bffb5cf3 svgui
+bb1f2a20f7dbc860f7e9778c87315be3c2817b52 svgui
--- a/src/MainWindow.cpp	Thu Jun 12 17:23:05 2014 +0100
+++ b/src/MainWindow.cpp	Thu Jun 12 17:23:23 2014 +0100
@@ -660,10 +660,6 @@
     m_rightButtonMenu->addAction(m_showCandidatesAction);
     
     action = new QAction(tr("Remove Pitches"), this);
-    //!!! NB this keyboard shortcut does not work with Qt5 on OS/X
-    //!!! (none of the single-key shortcuts do). But it does work if
-    //!!! the action is added to a toolbar button:
-    // action = toolbar->addAction(il.load("editdelete"), tr("Remove Pitches"));
     action->setShortcut(tr("Backspace"));
     action->setStatusTip(tr("Remove all pitch estimates within the selected region, making it unvoiced"));
     m_keyReference->registerShortcut(action);
@@ -733,53 +729,21 @@
 
     QMenu *menu = menuBar()->addMenu(tr("&View"));
     menu->setTearOffEnabled(true);
-    action = new QAction(tr("Scroll &Left"), this);
-    action->setShortcut(tr("Left"));
-    action->setStatusTip(tr("Scroll the current pane to the left"));
+    action = new QAction(tr("Peek &Left"), this);
+    action->setShortcut(tr("Alt+Left"));
+    action->setStatusTip(tr("Scroll the current pane to the left without changing the play position"));
     connect(action, SIGNAL(triggered()), this, SLOT(scrollLeft()));
     connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
     m_keyReference->registerShortcut(action);
     menu->addAction(action);
     
-    action = new QAction(tr("Scroll &Right"), this);
-    action->setShortcut(tr("Right"));
-    action->setStatusTip(tr("Scroll the current pane to the right"));
+    action = new QAction(tr("Peek &Right"), this);
+    action->setShortcut(tr("Alt+Right"));
+    action->setStatusTip(tr("Scroll the current pane to the right without changing the play position"));
     connect(action, SIGNAL(triggered()), this, SLOT(scrollRight()));
     connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
     m_keyReference->registerShortcut(action);
     menu->addAction(action);
-    
-    action = new QAction(tr("&One Note Left"), this);
-    action->setShortcut(tr("Ctrl+Left"));
-    action->setStatusTip(tr("Move cursor to the preceding note (or silence) onset."));
-    connect(action, SIGNAL(triggered()), this, SLOT(moveOneNoteLeft()));
-    connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
-    m_keyReference->registerShortcut(action);
-    menu->addAction(action);
-    
-    action = new QAction(tr("O&ne Note Right"), this);
-    action->setShortcut(tr("Ctrl+Right"));
-    action->setStatusTip(tr("Move cursor to the succeeding note (or silence)."));
-    connect(action, SIGNAL(triggered()), this, SLOT(moveOneNoteRight()));
-    connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
-    m_keyReference->registerShortcut(action);
-    menu->addAction(action);
-
-    action = new QAction(tr("&Select One Note Left"), this);
-    action->setShortcut(tr("Ctrl+Shift+Left"));
-    action->setStatusTip(tr("Select to the preceding note (or silence) onset."));
-    connect(action, SIGNAL(triggered()), this, SLOT(selectOneNoteLeft()));
-    connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
-    m_keyReference->registerShortcut(action);
-    menu->addAction(action);
-    
-    action = new QAction(tr("S&elect One Note Right"), this);
-    action->setShortcut(tr("Ctrl+Shift+Right"));
-    action->setStatusTip(tr("Select to the succeeding note (or silence)."));
-    connect(action, SIGNAL(triggered()), this, SLOT(selectOneNoteRight()));
-    connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
-    m_keyReference->registerShortcut(action);
-    menu->addAction(action);
 
     menu->addSeparator();
 
@@ -906,10 +870,13 @@
 
     QAction *m_rwdAction = toolbar->addAction(il.load("rewind"),
                                               tr("Rewind"));
-    m_rwdAction->setStatusTip(tr("Rewind to the previous time instant or time ruler notch"));
+    m_rwdAction->setShortcut(tr("Left"));
+    m_rwdAction->setStatusTip(tr("Rewind to the previous one-second boundary"));
     connect(m_rwdAction, SIGNAL(triggered()), this, SLOT(rewind()));
     connect(this, SIGNAL(canRewind(bool)), m_rwdAction, SLOT(setEnabled(bool)));
 
+    setDefaultFfwdRwdStep(RealTime(1, 0));
+
     QAction *playAction = toolbar->addAction(il.load("playpause"),
                                              tr("Play / Pause"));
     playAction->setCheckable(true);
@@ -922,7 +889,8 @@
 
     m_ffwdAction = toolbar->addAction(il.load("ffwd"),
                                               tr("Fast Forward"));
-    m_ffwdAction->setStatusTip(tr("Fast-forward to the next time instant or time ruler notch"));
+    m_ffwdAction->setShortcut(tr("Right"));
+    m_ffwdAction->setStatusTip(tr("Fast-forward to the next one-second boundary"));
     connect(m_ffwdAction, SIGNAL(triggered()), this, SLOT(ffwd()));
     connect(this, SIGNAL(canFfwd(bool)), m_ffwdAction, SLOT(setEnabled(bool)));
 
@@ -957,6 +925,30 @@
     connect(plAction, SIGNAL(triggered()), this, SLOT(playLoopToggled()));
     connect(this, SIGNAL(canPlay(bool)), plAction, SLOT(setEnabled(bool)));
 
+    QAction *oneLeftAction = new QAction(tr("&One Note Left"), this);
+    oneLeftAction->setShortcut(tr("Ctrl+Left"));
+    oneLeftAction->setStatusTip(tr("Move cursor to the preceding note (or silence) onset."));
+    connect(oneLeftAction, SIGNAL(triggered()), this, SLOT(moveOneNoteLeft()));
+    connect(this, SIGNAL(canScroll(bool)), oneLeftAction, SLOT(setEnabled(bool)));
+    
+    QAction *oneRightAction = new QAction(tr("O&ne Note Right"), this);
+    oneRightAction->setShortcut(tr("Ctrl+Right"));
+    oneRightAction->setStatusTip(tr("Move cursor to the succeeding note (or silence)."));
+    connect(oneRightAction, SIGNAL(triggered()), this, SLOT(moveOneNoteRight()));
+    connect(this, SIGNAL(canScroll(bool)), oneRightAction, SLOT(setEnabled(bool)));
+
+    QAction *selectOneLeftAction = new QAction(tr("&Select One Note Left"), this);
+    selectOneLeftAction->setShortcut(tr("Ctrl+Shift+Left"));
+    selectOneLeftAction->setStatusTip(tr("Select to the preceding note (or silence) onset."));
+    connect(selectOneLeftAction, SIGNAL(triggered()), this, SLOT(selectOneNoteLeft()));
+    connect(this, SIGNAL(canScroll(bool)), selectOneLeftAction, SLOT(setEnabled(bool)));
+    
+    QAction *selectOneRightAction = new QAction(tr("S&elect One Note Right"), this);
+    selectOneRightAction->setShortcut(tr("Ctrl+Shift+Right"));
+    selectOneRightAction->setStatusTip(tr("Select to the succeeding note (or silence)."));
+    connect(selectOneRightAction, SIGNAL(triggered()), this, SLOT(selectOneNoteRight()));
+    connect(this, SIGNAL(canScroll(bool)), selectOneRightAction, SLOT(setEnabled(bool)));
+
     m_keyReference->registerShortcut(psAction);
     m_keyReference->registerShortcut(plAction);
     m_keyReference->registerShortcut(playAction);
@@ -964,6 +956,10 @@
     m_keyReference->registerShortcut(m_ffwdAction);
     m_keyReference->registerShortcut(rwdStartAction);
     m_keyReference->registerShortcut(ffwdEndAction);
+    m_keyReference->registerShortcut(oneLeftAction);
+    m_keyReference->registerShortcut(oneRightAction);
+    m_keyReference->registerShortcut(selectOneLeftAction);
+    m_keyReference->registerShortcut(selectOneRightAction);
 
     menu->addAction(playAction);
     menu->addAction(psAction);
@@ -975,6 +971,11 @@
     menu->addAction(rwdStartAction);
     menu->addAction(ffwdEndAction);
     menu->addSeparator();
+    menu->addAction(oneLeftAction);
+    menu->addAction(oneRightAction);
+    menu->addAction(selectOneLeftAction);
+    menu->addAction(selectOneRightAction);
+    menu->addSeparator();
 
     m_rightButtonPlaybackMenu->addAction(playAction);
     m_rightButtonPlaybackMenu->addAction(psAction);
@@ -986,6 +987,11 @@
     m_rightButtonPlaybackMenu->addAction(rwdStartAction);
     m_rightButtonPlaybackMenu->addAction(ffwdEndAction);
     m_rightButtonPlaybackMenu->addSeparator();
+    m_rightButtonPlaybackMenu->addAction(oneLeftAction);
+    m_rightButtonPlaybackMenu->addAction(oneRightAction);
+    m_rightButtonPlaybackMenu->addAction(selectOneLeftAction);
+    m_rightButtonPlaybackMenu->addAction(selectOneRightAction);
+    m_rightButtonPlaybackMenu->addSeparator();
 
     QAction *fastAction = menu->addAction(tr("Speed Up"));
     fastAction->setShortcut(tr("Ctrl+PgUp"));
@@ -1115,8 +1121,8 @@
 void
 MainWindow::moveByOneNote(bool right, bool doSelect)
 {
-    // cerr << "MainWindow::moveByOneNote" << endl;
     int frame = m_viewManager->getPlaybackFrame();
+    cerr << "MainWindow::moveByOneNote startframe: " << frame << endl;
     
     Pane *p = m_analyser->getPane();
 
@@ -1166,6 +1172,7 @@
         }
         m_viewManager->setSelection(sel);
     }
+    cerr << "MainWindow::moveByOneNote endframe: " << frame << endl;
 }
 
 void