comparison main/MainWindow.cpp @ 1055:40ff7c801fc2 3.0-integration

Check for audioIO as well as play target; + deployment bits
author Chris Cannam
date Thu, 20 Aug 2015 16:41:51 +0100
parents 2f8018eb1573
children 1f92fc7a6b05
comparison
equal deleted inserted replaced
1054:6e5ad3e8bd49 1055:40ff7c801fc2
91 #include <vamp-hostsdk/PluginBase.h> 91 #include <vamp-hostsdk/PluginBase.h>
92 #include "plugin/api/ladspa.h" 92 #include "plugin/api/ladspa.h"
93 #include "plugin/api/dssi.h" 93 #include "plugin/api/dssi.h"
94 94
95 #include <bqaudioio/SystemPlaybackTarget.h> 95 #include <bqaudioio/SystemPlaybackTarget.h>
96 #include <bqaudioio/SystemAudioIO.h>
96 97
97 #include <QApplication> 98 #include <QApplication>
98 #include <QMessageBox> 99 #include <QMessageBox>
99 #include <QGridLayout> 100 #include <QGridLayout>
100 #include <QLabel> 101 #include <QLabel>
2041 connect(alAction, SIGNAL(triggered()), this, SLOT(alignToggled())); 2042 connect(alAction, SIGNAL(triggered()), this, SLOT(alignToggled()));
2042 connect(this, SIGNAL(canAlign(bool)), alAction, SLOT(setEnabled(bool))); 2043 connect(this, SIGNAL(canAlign(bool)), alAction, SLOT(setEnabled(bool)));
2043 } 2044 }
2044 2045
2045 m_keyReference->registerShortcut(m_playAction); 2046 m_keyReference->registerShortcut(m_playAction);
2047 m_keyReference->registerShortcut(m_recordAction);
2046 m_keyReference->registerShortcut(m_playSelectionAction); 2048 m_keyReference->registerShortcut(m_playSelectionAction);
2047 m_keyReference->registerShortcut(m_playLoopAction); 2049 m_keyReference->registerShortcut(m_playLoopAction);
2048 m_keyReference->registerShortcut(m_soloAction); 2050 m_keyReference->registerShortcut(m_soloAction);
2049 if (alAction) m_keyReference->registerShortcut(alAction); 2051 if (alAction) m_keyReference->registerShortcut(alAction);
2050 m_keyReference->registerShortcut(m_rwdAction); 2052 m_keyReference->registerShortcut(m_rwdAction);
2067 menu->addAction(m_ffwdSimilarAction); 2069 menu->addAction(m_ffwdSimilarAction);
2068 menu->addSeparator(); 2070 menu->addSeparator();
2069 menu->addAction(m_rwdStartAction); 2071 menu->addAction(m_rwdStartAction);
2070 menu->addAction(m_ffwdEndAction); 2072 menu->addAction(m_ffwdEndAction);
2071 menu->addSeparator(); 2073 menu->addSeparator();
2074 menu->addAction(m_recordAction);
2075 menu->addSeparator();
2072 2076
2073 m_rightButtonPlaybackMenu->addAction(m_playAction); 2077 m_rightButtonPlaybackMenu->addAction(m_playAction);
2074 m_rightButtonPlaybackMenu->addAction(m_playSelectionAction); 2078 m_rightButtonPlaybackMenu->addAction(m_playSelectionAction);
2075 m_rightButtonPlaybackMenu->addAction(m_playLoopAction); 2079 m_rightButtonPlaybackMenu->addAction(m_playLoopAction);
2076 m_rightButtonPlaybackMenu->addAction(m_soloAction); 2080 m_rightButtonPlaybackMenu->addAction(m_soloAction);
2079 m_rightButtonPlaybackMenu->addAction(m_rwdAction); 2083 m_rightButtonPlaybackMenu->addAction(m_rwdAction);
2080 m_rightButtonPlaybackMenu->addAction(m_ffwdAction); 2084 m_rightButtonPlaybackMenu->addAction(m_ffwdAction);
2081 m_rightButtonPlaybackMenu->addSeparator(); 2085 m_rightButtonPlaybackMenu->addSeparator();
2082 m_rightButtonPlaybackMenu->addAction(m_rwdStartAction); 2086 m_rightButtonPlaybackMenu->addAction(m_rwdStartAction);
2083 m_rightButtonPlaybackMenu->addAction(m_ffwdEndAction); 2087 m_rightButtonPlaybackMenu->addAction(m_ffwdEndAction);
2088 m_rightButtonPlaybackMenu->addSeparator();
2089 m_rightButtonPlaybackMenu->addAction(m_recordAction);
2084 m_rightButtonPlaybackMenu->addSeparator(); 2090 m_rightButtonPlaybackMenu->addSeparator();
2085 2091
2086 QAction *fastAction = menu->addAction(tr("Speed Up")); 2092 QAction *fastAction = menu->addAction(tr("Speed Up"));
2087 fastAction->setShortcut(tr("Ctrl+PgUp")); 2093 fastAction->setShortcut(tr("Ctrl+PgUp"));
2088 fastAction->setStatusTip(tr("Time-stretch playback to speed it up without changing pitch")); 2094 fastAction->setStatusTip(tr("Time-stretch playback to speed it up without changing pitch"));
2286 (currentPane != 0); 2292 (currentPane != 0);
2287 bool haveCurrentLayer = 2293 bool haveCurrentLayer =
2288 (haveCurrentPane && 2294 (haveCurrentPane &&
2289 (currentLayer != 0)); 2295 (currentLayer != 0));
2290 bool havePlayTarget = 2296 bool havePlayTarget =
2291 (m_playTarget != 0); 2297 (m_playTarget != 0 || m_audioIO != 0);
2292 bool haveSelection = 2298 bool haveSelection =
2293 (m_viewManager && 2299 (m_viewManager &&
2294 !m_viewManager->getSelections().empty()); 2300 !m_viewManager->getSelections().empty());
2295 bool haveCurrentEditableLayer = 2301 bool haveCurrentEditableLayer =
2296 (haveCurrentLayer && 2302 (haveCurrentLayer &&
4243 { 4249 {
4244 m_panLayer->setModel(model); 4250 m_panLayer->setModel(model);
4245 4251
4246 MainWindowBase::mainModelChanged(model); 4252 MainWindowBase::mainModelChanged(model);
4247 4253
4248 if (m_playTarget) { 4254 if (m_playTarget || m_audioIO) {
4249 connect(m_fader, SIGNAL(valueChanged(float)), 4255 connect(m_fader, SIGNAL(valueChanged(float)),
4250 this, SLOT(mainModelGainChanged(float))); 4256 this, SLOT(mainModelGainChanged(float)));
4251 } 4257 }
4252 } 4258 }
4253 4259
4254 void 4260 void
4255 MainWindow::mainModelGainChanged(float gain) 4261 MainWindow::mainModelGainChanged(float gain)
4256 { 4262 {
4257 if (m_playTarget) { 4263 if (m_playTarget) {
4258 m_playTarget->setOutputGain(gain); 4264 m_playTarget->setOutputGain(gain);
4265 } else if (m_audioIO) {
4266 m_audioIO->setOutputGain(gain);
4259 } 4267 }
4260 } 4268 }
4261 4269
4262 void 4270 void
4263 MainWindow::modelAboutToBeDeleted(Model *model) 4271 MainWindow::modelAboutToBeDeleted(Model *model)