comparison src/MainWindow.cpp @ 321:9b131c32fcb7

Merge
author Chris Cannam
date Fri, 13 Jun 2014 13:46:09 +0100
parents 68779eb910c7
children 8a884e1e3912 b3ed6e562ee5
comparison
equal deleted inserted replaced
316:7fa301a4f149 321:9b131c32fcb7
131 cdb->setUseDarkBackground(cdb->addColour(Qt::green, tr("Bright Green")), true); 131 cdb->setUseDarkBackground(cdb->addColour(Qt::green, tr("Bright Green")), true);
132 cdb->setUseDarkBackground(cdb->addColour(QColor(225, 74, 255), tr("Bright Purple")), true); 132 cdb->setUseDarkBackground(cdb->addColour(QColor(225, 74, 255), tr("Bright Purple")), true);
133 cdb->setUseDarkBackground(cdb->addColour(QColor(255, 188, 80), tr("Bright Orange")), true); 133 cdb->setUseDarkBackground(cdb->addColour(QColor(255, 188, 80), tr("Bright Orange")), true);
134 134
135 Preferences::getInstance()->setResampleOnLoad(true); 135 Preferences::getInstance()->setResampleOnLoad(true);
136 Preferences::getInstance()->setFixedSampleRate(44100);
136 Preferences::getInstance()->setSpectrogramSmoothing 137 Preferences::getInstance()->setSpectrogramSmoothing
137 (Preferences::SpectrogramInterpolated); 138 (Preferences::SpectrogramInterpolated);
138 139
139 QSettings settings; 140 QSettings settings;
140 141
412 } 413 }
413 414
414 setupFileMenu(); 415 setupFileMenu();
415 setupEditMenu(); 416 setupEditMenu();
416 setupViewMenu(); 417 setupViewMenu();
418 setupAnalysisMenu();
417 419
418 m_mainMenusCreated = true; 420 m_mainMenusCreated = true;
419 } 421 }
420 422
421 void 423 void
477 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionAs())); 479 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionAs()));
478 connect(this, SIGNAL(canSaveAs(bool)), action, SLOT(setEnabled(bool))); 480 connect(this, SIGNAL(canSaveAs(bool)), action, SLOT(setEnabled(bool)));
479 menu->addAction(action); 481 menu->addAction(action);
480 toolbar->addAction(action); 482 toolbar->addAction(action);
481 483
482 icon = il.load("filesave"); 484 action = new QAction(tr("Save Session to Audio &Path"), this);
483 icon.addPixmap(il.loadPixmap("filesave-22"));
484 action = new QAction(icon, tr("Save Session to Audio &Path"), this);
485 action->setShortcut(tr("Ctrl+Alt+S")); 485 action->setShortcut(tr("Ctrl+Alt+S"));
486 action->setStatusTip(tr("Save the current session into a %1 session file with the same filename as the audio but a .ton extension.").arg(QApplication::applicationName())); 486 action->setStatusTip(tr("Save the current session into a %1 session file with the same filename as the audio but a .ton extension.").arg(QApplication::applicationName()));
487 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionInAudioPath())); 487 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionInAudioPath()));
488 connect(this, SIGNAL(canSaveAs(bool)), action, SLOT(setEnabled(bool))); 488 connect(this, SIGNAL(canSaveAs(bool)), action, SLOT(setEnabled(bool)));
489 menu->addAction(action); 489 menu->addAction(action);
796 796
797 action = new QAction(tr("Set Displayed Fre&quency Range..."), this); 797 action = new QAction(tr("Set Displayed Fre&quency Range..."), this);
798 action->setStatusTip(tr("Set the minimum and maximum frequencies in the visible display")); 798 action->setStatusTip(tr("Set the minimum and maximum frequencies in the visible display"));
799 connect(action, SIGNAL(triggered()), this, SLOT(editDisplayExtents())); 799 connect(action, SIGNAL(triggered()), this, SLOT(editDisplayExtents()));
800 menu->addAction(action); 800 menu->addAction(action);
801 }
802
803 void
804 MainWindow::setupAnalysisMenu()
805 {
806 if (m_mainMenusCreated) return;
807
808 IconLoader il;
809
810 QAction *action = 0;
811
812 QMenu *menu = menuBar()->addMenu(tr("&Analysis"));
813 menu->setTearOffEnabled(true);
814
815 m_keyReference->setCategory(tr("Analysis"));
816
817 action = new QAction(tr("&Analyse now"), this);
818 action->setShortcut(tr("Ctrl+P"));
819 action->setStatusTip(tr("Analyse audio now to extract pitches and notes. (This will delete all existing pitches and notes.)"));
820 menu->addAction(action);
821 m_keyReference->registerShortcut(action);
822
823 menu->addSeparator();
824
825 action = new QAction(tr("Automatically Analyse &New Audio"), this);
826 action->setCheckable(true);
827 action->setChecked(true);
828 menu->addAction(action);
829
830 action = new QAction(tr("Analyse &Without Frequency-dependent Timing Bias (slow)"), this);
831 action->setCheckable(true);
832 action->setChecked(false);
833
834 menu->addAction(action);
835
801 } 836 }
802 837
803 void 838 void
804 MainWindow::setupHelpMenu() 839 MainWindow::setupHelpMenu()
805 { 840 {