Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 891:c62c3e4825ee
Start work on unit converter
| author | Chris Cannam |
|---|---|
| date | Mon, 01 Dec 2014 16:31:40 +0000 |
| parents | ce4d9e149086 |
| children | 509b4649b172 |
comparison
equal
deleted
inserted
replaced
| 890:34587a06f6f0 | 891:c62c3e4825ee |
|---|---|
| 53 #include "widgets/NotifyingPushButton.h" | 53 #include "widgets/NotifyingPushButton.h" |
| 54 #include "widgets/KeyReference.h" | 54 #include "widgets/KeyReference.h" |
| 55 #include "widgets/TransformFinder.h" | 55 #include "widgets/TransformFinder.h" |
| 56 #include "widgets/LabelCounterInputDialog.h" | 56 #include "widgets/LabelCounterInputDialog.h" |
| 57 #include "widgets/ActivityLog.h" | 57 #include "widgets/ActivityLog.h" |
| 58 #include "widgets/UnitConverter.h" | |
| 58 #include "audioio/AudioCallbackPlaySource.h" | 59 #include "audioio/AudioCallbackPlaySource.h" |
| 59 #include "audioio/AudioCallbackPlayTarget.h" | 60 #include "audioio/AudioCallbackPlayTarget.h" |
| 60 #include "audioio/AudioTargetFactory.h" | 61 #include "audioio/AudioTargetFactory.h" |
| 61 #include "audioio/PlaySpeedRangeMapper.h" | 62 #include "audioio/PlaySpeedRangeMapper.h" |
| 62 #include "data/fileio/DataFileReaderFactory.h" | 63 #include "data/fileio/DataFileReaderFactory.h" |
| 159 m_playControlsSpacer(0), | 160 m_playControlsSpacer(0), |
| 160 m_playControlsWidth(0), | 161 m_playControlsWidth(0), |
| 161 m_preferencesDialog(0), | 162 m_preferencesDialog(0), |
| 162 m_layerTreeDialog(0), | 163 m_layerTreeDialog(0), |
| 163 m_activityLog(new ActivityLog()), | 164 m_activityLog(new ActivityLog()), |
| 165 m_unitConverter(new UnitConverter()), | |
| 164 m_keyReference(new KeyReference()), | 166 m_keyReference(new KeyReference()), |
| 165 m_templateWatcher(0) | 167 m_templateWatcher(0) |
| 166 { | 168 { |
| 167 Profiler profiler("MainWindow::MainWindow"); | 169 Profiler profiler("MainWindow::MainWindow"); |
| 168 | 170 |
| 294 connect(this, SIGNAL(activity(QString)), | 296 connect(this, SIGNAL(activity(QString)), |
| 295 m_activityLog, SLOT(activityHappened(QString))); | 297 m_activityLog, SLOT(activityHappened(QString))); |
| 296 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced())); | 298 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced())); |
| 297 m_activityLog->hide(); | 299 m_activityLog->hide(); |
| 298 | 300 |
| 301 m_unitConverter->hide(); | |
| 302 | |
| 299 newSession(); | 303 newSession(); |
| 300 | 304 |
| 301 connect(m_midiInput, SIGNAL(eventsAvailable()), | 305 connect(m_midiInput, SIGNAL(eventsAvailable()), |
| 302 this, SLOT(midiEventsAvailable())); | 306 this, SLOT(midiEventsAvailable())); |
| 303 | 307 |
| 323 MainWindow::~MainWindow() | 327 MainWindow::~MainWindow() |
| 324 { | 328 { |
| 325 // SVDEBUG << "MainWindow::~MainWindow" << endl; | 329 // SVDEBUG << "MainWindow::~MainWindow" << endl; |
| 326 delete m_keyReference; | 330 delete m_keyReference; |
| 327 delete m_activityLog; | 331 delete m_activityLog; |
| 332 delete m_unitConverter; | |
| 328 delete m_preferencesDialog; | 333 delete m_preferencesDialog; |
| 329 delete m_layerTreeDialog; | 334 delete m_layerTreeDialog; |
| 330 delete m_versionTester; | 335 delete m_versionTester; |
| 331 delete m_surveyer; | 336 delete m_surveyer; |
| 332 Profiles::getInstance()->dump(); | 337 Profiles::getInstance()->dump(); |
| 1021 menu->addAction(action); | 1026 menu->addAction(action); |
| 1022 | 1027 |
| 1023 action = new QAction(tr("Show Acti&vity Log"), this); | 1028 action = new QAction(tr("Show Acti&vity Log"), this); |
| 1024 action->setStatusTip(tr("Open a window listing interactions and other events")); | 1029 action->setStatusTip(tr("Open a window listing interactions and other events")); |
| 1025 connect(action, SIGNAL(triggered()), this, SLOT(showActivityLog())); | 1030 connect(action, SIGNAL(triggered()), this, SLOT(showActivityLog())); |
| 1031 menu->addAction(action); | |
| 1032 | |
| 1033 action = new QAction(tr("Show &Unit Converter"), this); | |
| 1034 action->setStatusTip(tr("Open a window of pitch and timing conversion utilities")); | |
| 1035 connect(action, SIGNAL(triggered()), this, SLOT(showUnitConverter())); | |
| 1026 menu->addAction(action); | 1036 menu->addAction(action); |
| 1027 | 1037 |
| 1028 menu->addSeparator(); | 1038 menu->addSeparator(); |
| 1029 | 1039 |
| 1030 action = new QAction(tr("Go Full-Screen"), this); | 1040 action = new QAction(tr("Go Full-Screen"), this); |
| 2940 | 2950 |
| 2941 delete m_layerTreeDialog.data(); | 2951 delete m_layerTreeDialog.data(); |
| 2942 delete m_preferencesDialog.data(); | 2952 delete m_preferencesDialog.data(); |
| 2943 | 2953 |
| 2944 m_activityLog->hide(); | 2954 m_activityLog->hide(); |
| 2955 m_unitConverter->hide(); | |
| 2945 m_keyReference->hide(); | 2956 m_keyReference->hide(); |
| 2946 | 2957 |
| 2947 delete m_document; | 2958 delete m_document; |
| 2948 m_document = 0; | 2959 m_document = 0; |
| 2949 m_viewManager->clearSelections(); | 2960 m_viewManager->clearSelections(); |
| 4356 MainWindow::showActivityLog() | 4367 MainWindow::showActivityLog() |
| 4357 { | 4368 { |
| 4358 m_activityLog->show(); | 4369 m_activityLog->show(); |
| 4359 m_activityLog->raise(); | 4370 m_activityLog->raise(); |
| 4360 m_activityLog->scrollToEnd(); | 4371 m_activityLog->scrollToEnd(); |
| 4372 } | |
| 4373 | |
| 4374 void | |
| 4375 MainWindow::showUnitConverter() | |
| 4376 { | |
| 4377 m_unitConverter->show(); | |
| 4378 m_unitConverter->raise(); | |
| 4361 } | 4379 } |
| 4362 | 4380 |
| 4363 void | 4381 void |
| 4364 MainWindow::preferences() | 4382 MainWindow::preferences() |
| 4365 { | 4383 { |
