diff main/MainWindow.cpp @ 1056:25e1cc4f34eb recording

Add audio record mode (option to replace session) and support for browsing to record directory
author Chris Cannam
date Tue, 15 Sep 2015 16:34:08 +0100
parents 2aaeb77609cf
children 1f92fc7a6b05
line wrap: on
line diff
--- a/main/MainWindow.cpp	Thu Aug 20 12:22:17 2015 +0100
+++ b/main/MainWindow.cpp	Tue Sep 15 16:34:08 2015 +0100
@@ -303,6 +303,8 @@
     m_activityLog->hide();
 
     m_unitConverter->hide();
+
+    setAudioRecordMode(RecordCreateAdditionalModel);
     
     newSession();
 
@@ -589,6 +591,13 @@
 
     menu->addSeparator();
 
+    action = new QAction(tr("Browse Recorded Audio Folder"), this);
+    action->setStatusTip(tr("Open the Recorded Audio folder in the system file browser"));
+    connect(action, SIGNAL(triggered()), this, SLOT(browseRecordedAudio()));
+    menu->addAction(action);
+
+    menu->addSeparator();
+
     QString templatesMenuLabel = tr("Apply Session Template");
     m_templatesMenu = menu->addMenu(templatesMenuLabel);
     m_templatesMenu->setTearOffEnabled(true);
@@ -2048,6 +2057,7 @@
     }
 
     m_keyReference->registerShortcut(m_playAction);
+    m_keyReference->registerShortcut(m_recordAction);
     m_keyReference->registerShortcut(m_playSelectionAction);
     m_keyReference->registerShortcut(m_playLoopAction);
     m_keyReference->registerShortcut(m_soloAction);
@@ -2060,6 +2070,7 @@
     m_keyReference->registerShortcut(m_ffwdEndAction);
 
     menu->addAction(m_playAction);
+    menu->addAction(m_recordAction);
     menu->addAction(m_playSelectionAction);
     menu->addAction(m_playLoopAction);
     menu->addAction(m_soloAction);
@@ -2076,6 +2087,7 @@
     menu->addSeparator();
 
     m_rightButtonPlaybackMenu->addAction(m_playAction);
+    m_rightButtonPlaybackMenu->addAction(m_recordAction);
     m_rightButtonPlaybackMenu->addAction(m_playSelectionAction);
     m_rightButtonPlaybackMenu->addAction(m_playLoopAction);
     m_rightButtonPlaybackMenu->addAction(m_soloAction);
@@ -2895,6 +2907,17 @@
 }
 
 void
+MainWindow::browseRecordedAudio()
+{
+    if (!m_recordTarget) return;
+
+    QString path = m_recordTarget->getRecordFolder();
+    if (path == "") return;
+
+    openLocalFolder(path);
+}
+
+void
 MainWindow::newSession()
 {
     if (!checkSaveModified()) return;