changeset 1053:2f8018eb1573 3.0-integration

Merge from branch recording
author Chris Cannam
date Thu, 20 Aug 2015 13:15:19 +0100 (2015-08-20)
parents 100b3fd8e171 (current diff) 7cda09a99a79 (diff)
children 6e5ad3e8bd49
files .hgsubstate main/MainWindow.cpp main/main.cpp sonic-visualiser.qrc
diffstat 5 files changed, 26 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Wed Aug 05 17:47:12 2015 +0100
+++ b/.hgsubstate	Thu Aug 20 13:15:19 2015 +0100
@@ -1,9 +1,9 @@
-250b1f9300cc33e94e7ecf371ebb5ce41baadd98 bqaudioio
+187d6a02a90e62f392b4ec6ca00947d346c9d6dc bqaudioio
 62c40e7f9231e459091c3352c5d4b6001be127ca bqresample
 94b6ebd5e8ab897e5b294fd77b4113e8d6d78b13 bqvec
 d16f0fd6db6104d87882bc43788a3bb1b0f8c528 dataquay
-06ed2d275a956fd1224376f74dfe170c19d3b2c2 icons/scalable
+3777c7bf171aa4e8600fabbacf0cfb7c9b18aedc icons/scalable
 55ece8862b6d3a54aad271a53f9c1615e5d3bcf8 sv-dependency-builds
-6ec35c1690c0a7b553d366a7edcbcb0f7a5b1c37 svapp
-fbc43d5dc3d108cf0cd906cc3934fca1ff6e941f svcore
+52c0aff69478e2fcb6a3ae9e7aaa56ee3f07c87a svapp
+efea94b04d5ab416aef63afb06abcae0347f5f38 svcore
 8588b97f1d1c324a9d2c14e646b07fc00442172f svgui
--- a/main/MainWindow.cpp	Wed Aug 05 17:47:12 2015 +0100
+++ b/main/MainWindow.cpp	Thu Aug 20 13:15:19 2015 +0100
@@ -58,6 +58,7 @@
 #include "widgets/ActivityLog.h"
 #include "widgets/UnitConverter.h"
 #include "audio/AudioCallbackPlaySource.h"
+#include "audio/AudioRecordTarget.h"
 #include "audio/PlaySpeedRangeMapper.h"
 #include "data/fileio/DataFileReaderFactory.h"
 #include "data/fileio/PlaylistFileReader.h"
@@ -129,8 +130,8 @@
 using std::set;
 
 
-MainWindow::MainWindow(bool withAudioOutput, bool withOSCSupport) :
-    MainWindowBase(withAudioOutput, true),
+MainWindow::MainWindow(SoundOptions options, bool withOSCSupport) :
+    MainWindowBase(options),
     m_overview(0),
     m_mainMenusCreated(false),
     m_paneMenu(0),
@@ -154,6 +155,7 @@
     m_ffwdSimilarAction(0),
     m_ffwdEndAction(0),
     m_playAction(0),
+    m_recordAction(0),
     m_playSelectionAction(0),
     m_playLoopAction(0),
     m_soloModified(false),
@@ -1980,6 +1982,17 @@
     connect(m_ffwdEndAction, SIGNAL(triggered()), this, SLOT(ffwdEnd()));
     connect(this, SIGNAL(canPlay(bool)), m_ffwdEndAction, SLOT(setEnabled(bool)));
 
+    m_recordAction = toolbar->addAction(il.load("record"),
+                                        tr("Record"));
+    m_recordAction->setCheckable(true);
+    m_recordAction->setShortcut(tr("Ctrl+Space"));
+    m_recordAction->setStatusTip(tr("Record a new audio file"));
+    connect(m_recordAction, SIGNAL(triggered()), this, SLOT(record()));
+    connect(m_recordTarget, SIGNAL(recordStatusChanged(bool)),
+	    m_recordAction, SLOT(setChecked(bool)));
+    connect(this, SIGNAL(canRecord(bool)),
+            m_recordAction, SLOT(setEnabled(bool)));
+
     toolbar = addToolBar(tr("Play Mode Toolbar"));
 
     m_playSelectionAction = toolbar->addAction(il.load("playselection"),
--- a/main/MainWindow.h	Wed Aug 05 17:47:12 2015 +0100
+++ b/main/MainWindow.h	Thu Aug 20 13:15:19 2015 +0100
@@ -32,8 +32,7 @@
     Q_OBJECT
 
 public:
-    MainWindow(bool withAudioOutput = true,
-               bool withOSCSupport = true);
+    MainWindow(SoundOptions options, bool withOSCSupport = true);
     virtual ~MainWindow();
 
 signals:
@@ -188,6 +187,7 @@
     QAction                 *m_ffwdSimilarAction;
     QAction                 *m_ffwdEndAction;
     QAction                 *m_playAction;
+    QAction                 *m_recordAction;
     QAction                 *m_playSelectionAction;
     QAction                 *m_playLoopAction;
     QAction                 *m_manageTemplatesAction;
--- a/main/main.cpp	Wed Aug 05 17:47:12 2015 +0100
+++ b/main/main.cpp	Thu Aug 20 13:15:19 2015 +0100
@@ -335,7 +335,10 @@
     // Permit size_t and PropertyName to be used as args in queued signal calls
     qRegisterMetaType<PropertyContainer::PropertyName>("PropertyContainer::PropertyName");
 
-    MainWindow *gui = new MainWindow(audioOutput, oscSupport);
+    MainWindow::SoundOptions options = MainWindow::WithEverything;
+    if (!audioOutput) options = 0;
+    
+    MainWindow *gui = new MainWindow(options, oscSupport);
     application.setMainWindow(gui);
     InteractiveFileFinder::setParentWidget(gui);
     TransformUserConfigurator::setParentWidget(gui);
--- a/sonic-visualiser.qrc	Wed Aug 05 17:47:12 2015 +0100
+++ b/sonic-visualiser.qrc	Thu Aug 20 13:15:19 2015 +0100
@@ -25,6 +25,7 @@
     <file>icons/scalable/playselection.svg</file>
     <file>icons/scalable/solo.svg</file>
     <file>icons/scalable/play.svg</file>
+    <file>icons/scalable/record.svg</file>
     <file>icons/scalable/rewind-start.svg</file>
     <file>icons/scalable/rewind.svg</file>
     <file>icons/scalable/undo.svg</file>