Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 57:eb596ef12041
* Factor out uses of "Sonic Visualiser" in "common" code to applicationName()
* Add ability to show work title + artist in top-left of pane (thinking of Vect
but may be useful in SV in future)
* A few other generalisations useful for Vect
author | Chris Cannam |
---|---|
date | Fri, 09 Nov 2007 17:46:58 +0000 |
parents | 9fa273598830 |
children | 7b71da2d0631 89a689720ee9 |
comparison
equal
deleted
inserted
replaced
56:75ad3f8f65aa | 57:eb596ef12041 |
---|---|
150 connect(m_paneStack, SIGNAL(dropAccepted(Pane *, QString)), | 150 connect(m_paneStack, SIGNAL(dropAccepted(Pane *, QString)), |
151 this, SLOT(paneDropAccepted(Pane *, QString))); | 151 this, SLOT(paneDropAccepted(Pane *, QString))); |
152 connect(m_paneStack, SIGNAL(paneDeleteButtonClicked(Pane *)), | 152 connect(m_paneStack, SIGNAL(paneDeleteButtonClicked(Pane *)), |
153 this, SLOT(paneDeleteButtonClicked(Pane *))); | 153 this, SLOT(paneDeleteButtonClicked(Pane *))); |
154 | 154 |
155 m_playSource = new AudioCallbackPlaySource(m_viewManager); | 155 m_playSource = new AudioCallbackPlaySource(m_viewManager, |
156 QApplication::applicationName()); | |
156 | 157 |
157 connect(m_playSource, SIGNAL(sampleRateMismatch(size_t, size_t, bool)), | 158 connect(m_playSource, SIGNAL(sampleRateMismatch(size_t, size_t, bool)), |
158 this, SLOT(sampleRateMismatch(size_t, size_t, bool))); | 159 this, SLOT(sampleRateMismatch(size_t, size_t, bool))); |
159 connect(m_playSource, SIGNAL(audioOverloadPluginDisabled()), | 160 connect(m_playSource, SIGNAL(audioOverloadPluginDisabled()), |
160 this, SLOT(audioOverloadPluginDisabled())); | 161 this, SLOT(audioOverloadPluginDisabled())); |
422 | 423 |
423 Model *prevPlaybackModel = m_viewManager->getPlaybackModel(); | 424 Model *prevPlaybackModel = m_viewManager->getPlaybackModel(); |
424 | 425 |
425 View::ModelSet soloModels = p->getModels(); | 426 View::ModelSet soloModels = p->getModels(); |
426 | 427 |
428 View::ModelSet sources; | |
429 for (View::ModelSet::iterator mi = soloModels.begin(); | |
430 mi != soloModels.end(); ++mi) { | |
431 if (*mi && (*mi)->getSourceModel()) { | |
432 sources.insert((*mi)->getSourceModel()); | |
433 } | |
434 } | |
435 for (View::ModelSet::iterator mi = sources.begin(); | |
436 mi != sources.end(); ++mi) { | |
437 soloModels.insert(*mi); | |
438 } | |
439 | |
427 for (View::ModelSet::iterator mi = soloModels.begin(); | 440 for (View::ModelSet::iterator mi = soloModels.begin(); |
428 mi != soloModels.end(); ++mi) { | 441 mi != soloModels.end(); ++mi) { |
429 if (dynamic_cast<RangeSummarisableTimeValueModel *>(*mi)) { | 442 if (dynamic_cast<RangeSummarisableTimeValueModel *>(*mi)) { |
430 m_viewManager->setPlaybackModel(*mi); | 443 m_viewManager->setPlaybackModel(*mi); |
431 } | 444 } |
868 | 881 |
869 setupMenus(); | 882 setupMenus(); |
870 | 883 |
871 if (m_sessionFile == "") { | 884 if (m_sessionFile == "") { |
872 //!!! shouldn't be dealing directly with title from here -- call a method | 885 //!!! shouldn't be dealing directly with title from here -- call a method |
873 setWindowTitle(tr("Sonic Visualiser: %1") | 886 setWindowTitle(tr("%1: %2") |
887 .arg(QApplication::applicationName()) | |
874 .arg(source.getLocation())); | 888 .arg(source.getLocation())); |
875 CommandHistory::getInstance()->clear(); | 889 CommandHistory::getInstance()->clear(); |
876 CommandHistory::getInstance()->documentSaved(); | 890 CommandHistory::getInstance()->documentSaved(); |
877 m_documentModified = false; | 891 m_documentModified = false; |
878 } else { | 892 } else { |
879 setWindowTitle(tr("Sonic Visualiser: %1 [%2]") | 893 setWindowTitle(tr("%1: %2 [%3]") |
894 .arg(QApplication::applicationName()) | |
880 .arg(QFileInfo(m_sessionFile).fileName()) | 895 .arg(QFileInfo(m_sessionFile).fileName()) |
881 .arg(source.getLocation())); | 896 .arg(source.getLocation())); |
882 if (m_documentModified) { | 897 if (m_documentModified) { |
883 m_documentModified = false; | 898 m_documentModified = false; |
884 documentModified(); // so as to restore "(modified)" window title | 899 documentModified(); // so as to restore "(modified)" window title |
1178 | 1193 |
1179 bool ok = (error == ""); | 1194 bool ok = (error == ""); |
1180 | 1195 |
1181 if (ok) { | 1196 if (ok) { |
1182 | 1197 |
1183 setWindowTitle(tr("Sonic Visualiser: %1") | 1198 setWindowTitle(tr("%1: %2") |
1199 .arg(QApplication::applicationName()) | |
1184 .arg(source.getLocation())); | 1200 .arg(source.getLocation())); |
1185 | 1201 |
1186 if (!source.isRemote()) m_sessionFile = source.getLocalFilename(); | 1202 if (!source.isRemote()) m_sessionFile = source.getLocalFilename(); |
1187 | 1203 |
1188 setupMenus(); | 1204 setupMenus(); |
1199 registerLastOpenedFilePath(FileFinder::SessionFile, | 1215 registerLastOpenedFilePath(FileFinder::SessionFile, |
1200 source.getLocalFilename()); | 1216 source.getLocalFilename()); |
1201 } | 1217 } |
1202 | 1218 |
1203 } else { | 1219 } else { |
1204 setWindowTitle(tr("Sonic Visualiser")); | 1220 setWindowTitle(QApplication::applicationName()); |
1205 } | 1221 } |
1206 | 1222 |
1207 return ok ? FileOpenSucceeded : FileOpenFailed; | 1223 return ok ? FileOpenSucceeded : FileOpenFailed; |
1208 } | 1224 } |
1209 | 1225 |
1328 Pane * | 1344 Pane * |
1329 MainWindowBase::addPaneToStack() | 1345 MainWindowBase::addPaneToStack() |
1330 { | 1346 { |
1331 AddPaneCommand *command = new AddPaneCommand(this); | 1347 AddPaneCommand *command = new AddPaneCommand(this); |
1332 CommandHistory::getInstance()->addCommand(command); | 1348 CommandHistory::getInstance()->addCommand(command); |
1333 return command->getPane(); | 1349 Pane *pane = command->getPane(); |
1350 return pane; | |
1334 } | 1351 } |
1335 | 1352 |
1336 void | 1353 void |
1337 MainWindowBase::zoomIn() | 1354 MainWindowBase::zoomIn() |
1338 { | 1355 { |