diff main/MainWindow.cpp @ 717:c2b9b781f006

Merge from branch "tony_integration"
author Chris Cannam
date Fri, 09 May 2014 17:54:16 +0100
parents d1c5444be23d
children b959148258a4
line wrap: on
line diff
--- a/main/MainWindow.cpp	Fri Apr 11 23:30:52 2014 -0700
+++ b/main/MainWindow.cpp	Fri May 09 17:54:16 2014 +0100
@@ -145,8 +145,6 @@
     m_rightButtonTransformsMenu(0),
     m_rightButtonPlaybackMenu(0),
     m_soloAction(0),
-    m_soloModified(false),
-    m_prevSolo(false),
     m_rwdStartAction(0),
     m_rwdSimilarAction(0),
     m_rwdAction(0),
@@ -156,6 +154,8 @@
     m_playAction(0),
     m_playSelectionAction(0),
     m_playLoopAction(0),
+    m_soloModified(false),
+    m_prevSolo(false),
     m_playControlsSpacer(0),
     m_playControlsWidth(0),
     m_preferencesDialog(0),
@@ -403,7 +403,7 @@
         m_scrollLeftAction, m_scrollRightAction, m_showPropertyBoxesAction
     };
 
-    for (int i = 0; i < sizeof(acts)/sizeof(acts[0]); ++i) {
+    for (int i = 0; i < int(sizeof(acts)/sizeof(acts[0])); ++i) {
         sc = new QShortcut(acts[i]->shortcut(), ps);
         connect(sc, SIGNAL(activated()), acts[i], SLOT(trigger()));
     }
@@ -454,6 +454,7 @@
     action->setShortcut(tr("Ctrl+O"));
     action->setStatusTip(tr("Open a session file, audio file, or layer"));
     connect(action, SIGNAL(triggered()), this, SLOT(openSomething()));
+    m_keyReference->registerShortcut(action);
     toolbar->addAction(action);
     menu->addAction(action);
 
@@ -946,7 +947,7 @@
     action->setStatusTip(tr("Show times and basic scale"));
     connect(action, SIGNAL(triggered()), this, SLOT(showMinimalOverlays()));
     action->setCheckable(true);
-    action->setChecked(mode == ViewManager::MinimalOverlays);
+    action->setChecked(mode == ViewManager::StandardOverlays);
     overlayGroup->addAction(action);
     m_keyReference->registerShortcut(action);
     menu->addAction(action);
@@ -2070,11 +2071,10 @@
     toolbar = addToolBar(tr("Edit Toolbar"));
     CommandHistory::getInstance()->registerToolbar(toolbar);
 
-    m_keyReference->setCategory(tr("Tool Selection"));
-
     toolbar = addToolBar(tr("Tools Toolbar"));
     QActionGroup *group = new QActionGroup(this);
 
+    m_keyReference->setCategory(tr("Tool Selection"));
     QAction *action = toolbar->addAction(il.load("navigate"),
                                          tr("Navigate"));
     action->setCheckable(true);
@@ -2086,7 +2086,23 @@
     group->addAction(action);
     m_keyReference->registerShortcut(action);
     m_toolActions[ViewManager::NavigateMode] = action;
-
+    
+    m_keyReference->setCategory
+        (tr("Navigate Tool Mouse Actions"));
+    m_keyReference->registerShortcut
+        (tr("Navigate"), tr("Left"), 
+         tr("Click left button and drag to move around"));
+    m_keyReference->registerShortcut
+        (tr("Zoom to Area"), tr("Shift+Left"), 
+         tr("Shift-click left button and drag to zoom to a rectangular area"));
+    m_keyReference->registerShortcut
+        (tr("Relocate"), tr("Double-Click Left"), 
+         tr("Double-click left button to jump to clicked location"));
+    m_keyReference->registerShortcut
+        (tr("Edit"), tr("Double-Click Left"), 
+         tr("Double-click left button on an item to edit it"));
+
+    m_keyReference->setCategory(tr("Tool Selection"));
     action = toolbar->addAction(il.load("select"),
 				tr("Select"));
     action->setCheckable(true);
@@ -2096,7 +2112,26 @@
     group->addAction(action);
     m_keyReference->registerShortcut(action);
     m_toolActions[ViewManager::SelectMode] = action;
-
+        
+    m_keyReference->setCategory
+        (tr("Select Tool Mouse Actions"));
+    m_keyReference->registerShortcut
+        (tr("Select"), tr("Left"), 
+         tr("Click left button and drag to select region; drag region edge to resize"));
+#ifdef Q_OS_MAC
+    m_keyReference->registerShortcut
+        (tr("Multi Select"), tr("Ctrl+Left"), 
+         tr("Cmd-click left button and drag to select an additional region"));
+#else
+    m_keyReference->registerShortcut
+        (tr("Multi Select"), tr("Ctrl+Left"), 
+         tr("Ctrl-click left button and drag to select an additional region"));
+#endif
+    m_keyReference->registerShortcut
+        (tr("Fine Select"), tr("Shift+Left"), 
+        tr("Shift-click left button and drag to select without snapping to items or grid"));
+
+    m_keyReference->setCategory(tr("Tool Selection"));
     action = toolbar->addAction(il.load("move"),
 				tr("Edit"));
     action->setCheckable(true);
@@ -2107,7 +2142,17 @@
     group->addAction(action);
     m_keyReference->registerShortcut(action);
     m_toolActions[ViewManager::EditMode] = action;
-
+    
+    m_keyReference->setCategory
+        (tr("Edit Tool Mouse Actions"));
+    m_keyReference->registerShortcut
+        (tr("Move"), tr("Left"), 
+        tr("Click left button on an item or selected region and drag to move"));
+    m_keyReference->registerShortcut
+        (tr("Edit"), tr("Double-Click Left"), 
+        tr("Double-click left button on an item to edit it"));
+
+    m_keyReference->setCategory(tr("Tool Selection"));
     action = toolbar->addAction(il.load("draw"),
 				tr("Draw"));
     action->setCheckable(true);
@@ -2119,6 +2164,13 @@
     m_keyReference->registerShortcut(action);
     m_toolActions[ViewManager::DrawMode] = action;
 
+    m_keyReference->setCategory
+        (tr("Draw Tool Mouse Actions"));
+    m_keyReference->registerShortcut
+        (tr("Draw"), tr("Left"), 
+        tr("Click left button and drag to create new item"));
+
+    m_keyReference->setCategory(tr("Tool Selection"));
     action = toolbar->addAction(il.load("erase"),
 				tr("Erase"));
     action->setCheckable(true);
@@ -2130,6 +2182,13 @@
     m_keyReference->registerShortcut(action);
     m_toolActions[ViewManager::EraseMode] = action;
 
+    m_keyReference->setCategory
+        (tr("Erase Tool Mouse Actions"));
+    m_keyReference->registerShortcut
+        (tr("Erase"), tr("Left"), 
+        tr("Click left button on an item to remove it from the layer"));
+
+    m_keyReference->setCategory(tr("Tool Selection"));
     action = toolbar->addAction(il.load("measure"), tr("Measure"));
     action->setCheckable(true);
     action->setShortcut(tr("6"));
@@ -2140,6 +2199,18 @@
     m_keyReference->registerShortcut(action);
     m_toolActions[ViewManager::MeasureMode] = action;
 
+    m_keyReference->setCategory
+        (tr("Measure Tool Mouse Actions"));
+    m_keyReference->registerShortcut
+        (tr("Measure Area"), tr("Left"), 
+        tr("Click left button and drag to measure a rectangular area"));
+    m_keyReference->registerShortcut
+        (tr("Measure Item"), tr("Double-Click Left"), 
+        tr("Click left button and drag to measure extents of an item or shape"));
+    m_keyReference->registerShortcut
+        (tr("Zoom to Area"), tr("Shift+Left"), 
+        tr("Shift-click left button and drag to zoom to a rectangular area"));
+
     toolNavigateSelected();
 
     Pane::registerShortcuts(*m_keyReference);
@@ -2650,7 +2721,7 @@
         if (!nm) {
             error = tr("Can't export non-note layers to MIDI");
         } else {
-            MIDIFileWriter writer(path, nm);
+            MIDIFileWriter writer(path, nm, nm->getSampleRate());
             writer.write();
             if (!writer.isOK()) {
                 error = writer.getError();