changeset 1047:2aaeb77609cf recording

OK, we can record -- sort of
author Chris Cannam
date Tue, 18 Aug 2015 16:47:54 +0100
parents ecb0615e0ea0
children 2d710ea9259a
files .hgsubstate main/MainWindow.cpp main/MainWindow.h
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Tue Aug 18 15:00:34 2015 +0100
+++ b/.hgsubstate	Tue Aug 18 16:47:54 2015 +0100
@@ -3,6 +3,6 @@
 94b6ebd5e8ab897e5b294fd77b4113e8d6d78b13 bqvec
 d16f0fd6db6104d87882bc43788a3bb1b0f8c528 dataquay
 55ece8862b6d3a54aad271a53f9c1615e5d3bcf8 sv-dependency-builds
-f4d1fa41b94b2c761a2a3336fecfe311a6c244a3 svapp
+411e019474e5068a8dd10db6f0c6f8baf1964e19 svapp
 020277bfafcb99d636a13830dc72c237cf072b0c svcore
 7dcd035176851a9f13539d852ccec828a37d2863 svgui
--- a/main/MainWindow.cpp	Tue Aug 18 15:00:34 2015 +0100
+++ b/main/MainWindow.cpp	Tue Aug 18 16:47:54 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"
@@ -155,6 +156,7 @@
     m_ffwdSimilarAction(0),
     m_ffwdEndAction(0),
     m_playAction(0),
+    m_recordAction(0),
     m_playSelectionAction(0),
     m_playLoopAction(0),
     m_soloModified(false),
@@ -1985,6 +1987,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	Tue Aug 18 15:00:34 2015 +0100
+++ b/main/MainWindow.h	Tue Aug 18 16:47:54 2015 +0100
@@ -187,6 +187,7 @@
     QAction                 *m_ffwdSimilarAction;
     QAction                 *m_ffwdEndAction;
     QAction                 *m_playAction;
+    QAction                 *m_recordAction;
     QAction                 *m_playSelectionAction;
     QAction                 *m_playLoopAction;
     QAction                 *m_manageTemplatesAction;