Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 465:b3b9cc8f5466 integration_library
Merge with the Kiosk branch
author | mathieub <mathieu.barthet@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Jul 2011 19:38:50 +0100 |
parents | 4bccf2014f80 d70890996156 |
children | 33d0632255b5 |
comparison
equal
deleted
inserted
replaced
463:0ef4943f55ae | 465:b3b9cc8f5466 |
---|---|
165 m_keyReference(new KeyReference()), | 165 m_keyReference(new KeyReference()), |
166 m_templateWatcher(0) | 166 m_templateWatcher(0) |
167 { | 167 { |
168 Profiler profiler("MainWindow::MainWindow"); | 168 Profiler profiler("MainWindow::MainWindow"); |
169 | 169 |
170 setWindowTitle(tr("Sonic Visualiser")); | 170 setWindowTitle(tr("Sonic Visualiser (Kiosk edition)")); |
171 | 171 |
172 UnitDatabase *udb = UnitDatabase::getInstance(); | 172 UnitDatabase *udb = UnitDatabase::getInstance(); |
173 udb->registerUnit("Hz"); | 173 udb->registerUnit("Hz"); |
174 udb->registerUnit("dB"); | 174 udb->registerUnit("dB"); |
175 udb->registerUnit("s"); | 175 udb->registerUnit("s"); |
468 */ | 468 */ |
469 | 469 |
470 // the Import action we made earlier | 470 // the Import action we made earlier |
471 menu->addAction(iaction); | 471 menu->addAction(iaction); |
472 | 472 |
473 /* //removes the Export Audio File functionnality from the File menu | |
473 action = new QAction(tr("&Export Audio File..."), this); | 474 action = new QAction(tr("&Export Audio File..."), this); |
474 action->setStatusTip(tr("Export selection as an audio file")); | 475 action->setStatusTip(tr("Export selection as an audio file")); |
475 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio())); | 476 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio())); |
476 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool))); | 477 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool))); |
477 menu->addAction(action); | 478 menu->addAction(action); |
478 | 479 |
479 menu->addSeparator(); | 480 menu->addSeparator(); |
481 */ | |
480 | 482 |
481 action = new QAction(tr("Import Annotation &Layer..."), this); | 483 action = new QAction(tr("Import Annotation &Layer..."), this); |
482 action->setShortcut(tr("Ctrl+L")); | 484 action->setShortcut(tr("Ctrl+L")); |
483 action->setStatusTip(tr("Import layer data from an existing file")); | 485 action->setStatusTip(tr("Import layer data from an existing file")); |
484 connect(action, SIGNAL(triggered()), this, SLOT(importLayer())); | 486 connect(action, SIGNAL(triggered()), this, SLOT(importLayer())); |
2253 tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path)); | 2255 tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path)); |
2254 } | 2256 } |
2255 } | 2257 } |
2256 } | 2258 } |
2257 | 2259 |
2260 /* | |
2258 void | 2261 void |
2259 MainWindow::exportAudio() | 2262 MainWindow::exportAudio() |
2260 { | 2263 { |
2261 if (!getMainModel()) return; | 2264 if (!getMainModel()) return; |
2262 | 2265 |
2422 } | 2425 } |
2423 } else { | 2426 } else { |
2424 QMessageBox::critical(this, tr("Failed to write file"), error); | 2427 QMessageBox::critical(this, tr("Failed to write file"), error); |
2425 } | 2428 } |
2426 } | 2429 } |
2430 */ | |
2427 | 2431 |
2428 void | 2432 void |
2429 MainWindow::importLayer() | 2433 MainWindow::importLayer() |
2430 { | 2434 { |
2431 Pane *pane = m_paneStack->getCurrentPane(); | 2435 Pane *pane = m_paneStack->getCurrentPane(); |
2717 m_document = 0; | 2721 m_document = 0; |
2718 m_viewManager->clearSelections(); | 2722 m_viewManager->clearSelections(); |
2719 m_timeRulerLayer = 0; // document owned this | 2723 m_timeRulerLayer = 0; // document owned this |
2720 | 2724 |
2721 m_sessionFile = ""; | 2725 m_sessionFile = ""; |
2722 setWindowTitle(tr("Sonic Visualiser")); | 2726 setWindowTitle(tr("Sonic Visualiser (Kiosk edition)")); |
2723 | 2727 |
2724 CommandHistory::getInstance()->clear(); | 2728 CommandHistory::getInstance()->clear(); |
2725 CommandHistory::getInstance()->documentSaved(); | 2729 CommandHistory::getInstance()->documentSaved(); |
2726 documentRestored(); | 2730 documentRestored(); |
2727 } | 2731 } |
3151 | 3155 |
3152 if (!saveSessionFile(path)) { | 3156 if (!saveSessionFile(path)) { |
3153 QMessageBox::critical(this, tr("Failed to save file"), | 3157 QMessageBox::critical(this, tr("Failed to save file"), |
3154 tr("<b>Save failed</b><p>Session file \"%1\" could not be saved.").arg(path)); | 3158 tr("<b>Save failed</b><p>Session file \"%1\" could not be saved.").arg(path)); |
3155 } else { | 3159 } else { |
3156 setWindowTitle(tr("Sonic Visualiser: %1") | 3160 setWindowTitle(tr("Sonic Visualiser (Kiosk edition): %1") |
3157 .arg(QFileInfo(path).fileName())); | 3161 .arg(QFileInfo(path).fileName())); |
3158 m_sessionFile = path; | 3162 m_sessionFile = path; |
3159 CommandHistory::getInstance()->documentSaved(); | 3163 CommandHistory::getInstance()->documentSaved(); |
3160 documentRestored(); | 3164 documentRestored(); |
3161 m_recentFiles.addFile(path); | 3165 m_recentFiles.addFile(path); |
4142 #endif // SVNREV | 4146 #endif // SVNREV |
4143 #endif // SV_VERSION | 4147 #endif // SV_VERSION |
4144 | 4148 |
4145 QString aboutText; | 4149 QString aboutText; |
4146 | 4150 |
4147 aboutText += tr("<h3>About Sonic Visualiser</h3>"); | 4151 aboutText += tr("<h3>About Sonic Visualiser (Kiosk edition)</h3>"); |
4148 aboutText += tr("<p>Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation.<br><a href=\"http://www.sonicvisualiser.org/\">http://www.sonicvisualiser.org/</a></p>"); | 4152 aboutText += tr("<p>Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation. The Kiosk edition provides all of the features of the full Sonic Visualiser, except that audio files cannot be saved from it. <br><a href=\"http://www.sonicvisualiser.org/\">http://www.sonicvisualiser.org/</a></p>"); |
4149 aboutText += tr("<p><small>%1 : %2 configuration</small></p>") | 4153 aboutText += tr("<p><small>%1 : %2 configuration</small></p>") |
4150 .arg(version) | 4154 .arg(version) |
4151 .arg(debug ? tr("Debug") : tr("Release")); | 4155 .arg(debug ? tr("Debug") : tr("Release")); |
4152 | 4156 |
4153 aboutText += "<small>"; | 4157 aboutText += "<small>"; |