Mercurial > hg > sonic-visualiser
comparison 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 |
comparison
equal
deleted
inserted
replaced
1052:7cda09a99a79 | 1056:25e1cc4f34eb |
---|---|
301 m_activityLog, SLOT(activityHappened(QString))); | 301 m_activityLog, SLOT(activityHappened(QString))); |
302 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced())); | 302 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced())); |
303 m_activityLog->hide(); | 303 m_activityLog->hide(); |
304 | 304 |
305 m_unitConverter->hide(); | 305 m_unitConverter->hide(); |
306 | |
307 setAudioRecordMode(RecordCreateAdditionalModel); | |
306 | 308 |
307 newSession(); | 309 newSession(); |
308 | 310 |
309 connect(m_midiInput, SIGNAL(eventsAvailable()), | 311 connect(m_midiInput, SIGNAL(eventsAvailable()), |
310 this, SLOT(midiEventsAvailable())); | 312 this, SLOT(midiEventsAvailable())); |
583 | 585 |
584 action = new QAction(tr("Export Image File..."), this); | 586 action = new QAction(tr("Export Image File..."), this); |
585 action->setStatusTip(tr("Export a single pane to an image file")); | 587 action->setStatusTip(tr("Export a single pane to an image file")); |
586 connect(action, SIGNAL(triggered()), this, SLOT(exportImage())); | 588 connect(action, SIGNAL(triggered()), this, SLOT(exportImage())); |
587 connect(this, SIGNAL(canExportImage(bool)), action, SLOT(setEnabled(bool))); | 589 connect(this, SIGNAL(canExportImage(bool)), action, SLOT(setEnabled(bool))); |
590 menu->addAction(action); | |
591 | |
592 menu->addSeparator(); | |
593 | |
594 action = new QAction(tr("Browse Recorded Audio Folder"), this); | |
595 action->setStatusTip(tr("Open the Recorded Audio folder in the system file browser")); | |
596 connect(action, SIGNAL(triggered()), this, SLOT(browseRecordedAudio())); | |
588 menu->addAction(action); | 597 menu->addAction(action); |
589 | 598 |
590 menu->addSeparator(); | 599 menu->addSeparator(); |
591 | 600 |
592 QString templatesMenuLabel = tr("Apply Session Template"); | 601 QString templatesMenuLabel = tr("Apply Session Template"); |
2046 connect(alAction, SIGNAL(triggered()), this, SLOT(alignToggled())); | 2055 connect(alAction, SIGNAL(triggered()), this, SLOT(alignToggled())); |
2047 connect(this, SIGNAL(canAlign(bool)), alAction, SLOT(setEnabled(bool))); | 2056 connect(this, SIGNAL(canAlign(bool)), alAction, SLOT(setEnabled(bool))); |
2048 } | 2057 } |
2049 | 2058 |
2050 m_keyReference->registerShortcut(m_playAction); | 2059 m_keyReference->registerShortcut(m_playAction); |
2060 m_keyReference->registerShortcut(m_recordAction); | |
2051 m_keyReference->registerShortcut(m_playSelectionAction); | 2061 m_keyReference->registerShortcut(m_playSelectionAction); |
2052 m_keyReference->registerShortcut(m_playLoopAction); | 2062 m_keyReference->registerShortcut(m_playLoopAction); |
2053 m_keyReference->registerShortcut(m_soloAction); | 2063 m_keyReference->registerShortcut(m_soloAction); |
2054 if (alAction) m_keyReference->registerShortcut(alAction); | 2064 if (alAction) m_keyReference->registerShortcut(alAction); |
2055 m_keyReference->registerShortcut(m_rwdAction); | 2065 m_keyReference->registerShortcut(m_rwdAction); |
2058 m_keyReference->registerShortcut(m_ffwdSimilarAction); | 2068 m_keyReference->registerShortcut(m_ffwdSimilarAction); |
2059 m_keyReference->registerShortcut(m_rwdStartAction); | 2069 m_keyReference->registerShortcut(m_rwdStartAction); |
2060 m_keyReference->registerShortcut(m_ffwdEndAction); | 2070 m_keyReference->registerShortcut(m_ffwdEndAction); |
2061 | 2071 |
2062 menu->addAction(m_playAction); | 2072 menu->addAction(m_playAction); |
2073 menu->addAction(m_recordAction); | |
2063 menu->addAction(m_playSelectionAction); | 2074 menu->addAction(m_playSelectionAction); |
2064 menu->addAction(m_playLoopAction); | 2075 menu->addAction(m_playLoopAction); |
2065 menu->addAction(m_soloAction); | 2076 menu->addAction(m_soloAction); |
2066 if (alAction) menu->addAction(alAction); | 2077 if (alAction) menu->addAction(alAction); |
2067 menu->addSeparator(); | 2078 menu->addSeparator(); |
2074 menu->addAction(m_rwdStartAction); | 2085 menu->addAction(m_rwdStartAction); |
2075 menu->addAction(m_ffwdEndAction); | 2086 menu->addAction(m_ffwdEndAction); |
2076 menu->addSeparator(); | 2087 menu->addSeparator(); |
2077 | 2088 |
2078 m_rightButtonPlaybackMenu->addAction(m_playAction); | 2089 m_rightButtonPlaybackMenu->addAction(m_playAction); |
2090 m_rightButtonPlaybackMenu->addAction(m_recordAction); | |
2079 m_rightButtonPlaybackMenu->addAction(m_playSelectionAction); | 2091 m_rightButtonPlaybackMenu->addAction(m_playSelectionAction); |
2080 m_rightButtonPlaybackMenu->addAction(m_playLoopAction); | 2092 m_rightButtonPlaybackMenu->addAction(m_playLoopAction); |
2081 m_rightButtonPlaybackMenu->addAction(m_soloAction); | 2093 m_rightButtonPlaybackMenu->addAction(m_soloAction); |
2082 if (alAction) m_rightButtonPlaybackMenu->addAction(alAction); | 2094 if (alAction) m_rightButtonPlaybackMenu->addAction(alAction); |
2083 m_rightButtonPlaybackMenu->addSeparator(); | 2095 m_rightButtonPlaybackMenu->addSeparator(); |
2890 QMessageBox::critical(this, tr("Failed to save image file"), | 2902 QMessageBox::critical(this, tr("Failed to save image file"), |
2891 tr("Failed to save image file %1").arg(path)); | 2903 tr("Failed to save image file %1").arg(path)); |
2892 } | 2904 } |
2893 | 2905 |
2894 delete image; | 2906 delete image; |
2907 } | |
2908 | |
2909 void | |
2910 MainWindow::browseRecordedAudio() | |
2911 { | |
2912 if (!m_recordTarget) return; | |
2913 | |
2914 QString path = m_recordTarget->getRecordFolder(); | |
2915 if (path == "") return; | |
2916 | |
2917 openLocalFolder(path); | |
2895 } | 2918 } |
2896 | 2919 |
2897 void | 2920 void |
2898 MainWindow::newSession() | 2921 MainWindow::newSession() |
2899 { | 2922 { |