# HG changeset patch # User Chris Cannam # Date 1440083135 -3600 # Node ID 25c1cb97dd484202bcaaffcc87c77ce933e5dc00 # Parent 1a7bffbd971bb2b7ca0ab4209d7c44ad017c87de# Parent ba9d14b3e71449ec87d5cafd4cb5b8452ebf2a1c Merge from branch 2.0-integration diff -r ba9d14b3e714 -r 25c1cb97dd48 src/MainWindow.cpp --- a/src/MainWindow.cpp Thu Aug 20 16:05:15 2015 +0100 +++ b/src/MainWindow.cpp Thu Aug 20 16:05:35 2015 +0100 @@ -67,6 +67,7 @@ #include "plugin/api/dssi.h" #include +#include #include #include @@ -1020,6 +1021,17 @@ connect(ffwdEndAction, SIGNAL(triggered()), this, SLOT(ffwdEnd())); connect(this, SIGNAL(canPlay(bool)), ffwdEndAction, SLOT(setEnabled(bool))); + QAction *recordAction = toolbar->addAction(il.load("record"), + tr("Record")); + recordAction->setCheckable(true); + recordAction->setShortcut(tr("Ctrl+Space")); + recordAction->setStatusTip(tr("Record a new audio file")); + connect(recordAction, SIGNAL(triggered()), this, SLOT(record())); + connect(m_recordTarget, SIGNAL(recordStatusChanged(bool)), + recordAction, SLOT(setChecked(bool))); + connect(this, SIGNAL(canRecord(bool)), + recordAction, SLOT(setEnabled(bool))); + toolbar = addToolBar(tr("Play Mode Toolbar")); QAction *psAction = toolbar->addAction(il.load("playselection"), @@ -1071,10 +1083,12 @@ m_keyReference->registerShortcut(psAction); m_keyReference->registerShortcut(plAction); m_keyReference->registerShortcut(playAction); + m_keyReference->registerShortcut(recordAction); m_keyReference->registerShortcut(m_rwdAction); m_keyReference->registerShortcut(m_ffwdAction); m_keyReference->registerShortcut(rwdStartAction); m_keyReference->registerShortcut(ffwdEndAction); + m_keyReference->registerShortcut(recordAction); m_keyReference->registerShortcut(oneLeftAction); m_keyReference->registerShortcut(oneRightAction); m_keyReference->registerShortcut(selectOneLeftAction); @@ -1095,6 +1109,8 @@ menu->addAction(selectOneLeftAction); menu->addAction(selectOneRightAction); menu->addSeparator(); + menu->addAction(recordAction); + menu->addSeparator(); m_rightButtonPlaybackMenu->addAction(playAction); m_rightButtonPlaybackMenu->addAction(psAction); @@ -1111,6 +1127,8 @@ m_rightButtonPlaybackMenu->addAction(selectOneLeftAction); m_rightButtonPlaybackMenu->addAction(selectOneRightAction); m_rightButtonPlaybackMenu->addSeparator(); + m_rightButtonPlaybackMenu->addAction(recordAction); + m_rightButtonPlaybackMenu->addSeparator(); QAction *fastAction = menu->addAction(tr("Speed Up")); fastAction->setShortcut(tr("Ctrl+PgUp")); @@ -1361,7 +1379,7 @@ bool haveMainModel = (getMainModel() != 0); bool havePlayTarget = - (m_playTarget != 0); + (m_playTarget != 0 || m_audioIO != 0); bool haveCurrentPane = (currentPane != 0); bool haveCurrentLayer = @@ -1400,6 +1418,10 @@ emit canExportNotes(haveNotes); emit canSnapNotes(haveSelection && haveNotes); + cerr << "haveWaveform = " << haveWaveform << endl; + cerr << "haveMainModel = " << haveMainModel << endl; + cerr << "havePlayTarget = " << havePlayTarget << endl; + emit canPlayWaveform(haveWaveform && haveMainModel && havePlayTarget); emit canPlayPitch(havePitchTrack && haveMainModel && havePlayTarget); emit canPlayNotes(haveNotes && haveMainModel && havePlayTarget); @@ -2917,7 +2939,7 @@ MainWindowBase::mainModelChanged(model); - if (m_playTarget) { + if (m_playTarget || m_audioIO) { connect(m_fader, SIGNAL(valueChanged(float)), this, SLOT(mainModelGainChanged(float))); } @@ -2928,6 +2950,8 @@ { if (m_playTarget) { m_playTarget->setOutputGain(gain); + } else if (m_audioIO) { + m_audioIO->setOutputGain(gain); } }