changeset 364:f5a4c4283b93

adding no spectrogram and no sonification options
author matthiasm
date Tue, 15 Jul 2014 15:42:21 +0100
parents 3143b069c60a
children fec4dafd9093
files .hgsubstate src/MainWindow.cpp src/MainWindow.h src/main.cpp
diffstat 4 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Mon Jul 14 19:25:42 2014 +0100
+++ b/.hgsubstate	Tue Jul 15 15:42:21 2014 +0100
@@ -4,4 +4,4 @@
 553a5f65ef64811747a6613f759622d655db63c1 sv-dependency-builds
 1162c93e76880751100f7bf42969fa9b5176e13c svapp
 f960d67ce84237be28902f24d5c757a72dc8004b svcore
-b68af2be4545adf04eec58c50d8419dc574b8642 svgui
+a9731b49745a3ab73b5c5597004e6bc25f14f4dc svgui
--- a/src/MainWindow.cpp	Mon Jul 14 19:25:42 2014 +0100
+++ b/src/MainWindow.cpp	Tue Jul 15 15:42:21 2014 +0100
@@ -88,7 +88,7 @@
 using std::vector;
 
 
-MainWindow::MainWindow(bool withAudioOutput) :
+MainWindow::MainWindow(bool withAudioOutput, bool withSonification, bool withSpectrogram) :
     MainWindowBase(withAudioOutput, false),
     m_overview(0),
     m_mainMenusCreated(false),
@@ -102,7 +102,9 @@
     m_intelligentActionOn(true), //GF: !!! temporary
     m_activityLog(new ActivityLog()),
     m_keyReference(new KeyReference()),
-    m_selectionAnchor(0)
+    m_selectionAnchor(0),
+    m_withSonification(withSonification),
+    m_withSpectrogram(withSpectrogram)
 {
     setWindowTitle(QApplication::applicationName());
 
--- a/src/MainWindow.h	Mon Jul 14 19:25:42 2014 +0100
+++ b/src/MainWindow.h	Tue Jul 15 15:42:21 2014 +0100
@@ -27,7 +27,7 @@
     Q_OBJECT
 
 public:
-    MainWindow(bool withAudioOutput = true);
+    MainWindow(bool withAudioOutput = true,  bool withSonification = true, bool withSpectrogram = true);
     virtual ~MainWindow();
 
 signals:
@@ -233,6 +233,9 @@
 
     int m_selectionAnchor;
 
+    bool m_withSonification;
+    bool m_withSpectrogram;
+
     Analyser::FrequencyRange m_pendingConstraint;
 
     QString exportToSVL(QString path, Layer *layer);
--- a/src/main.cpp	Mon Jul 14 19:25:42 2014 +0100
+++ b/src/main.cpp	Tue Jul 15 15:42:21 2014 +0100
@@ -137,14 +137,7 @@
 
     TonyApplication application(argc, argv);
 
-    // For some weird reason, Mac builds are crashing on startup when
-    // this line is present. Eliminate it on that platform for now.
-#ifndef Q_OS_MAC
     QStringList args = application.arguments();
-#else
-    cerr << "NOTE: Command-line arguments are currently disabled on Mac, see comments in main.cpp" << endl;
-    QStringList args;
-#endif
 
     signal(SIGINT,  signalHandler);
     signal(SIGTERM, signalHandler);
@@ -155,15 +148,21 @@
 #endif
 
     bool audioOutput = true;
+    bool sonification = true;
+    bool spectrogram = true;
 
     if (args.contains("--help") || args.contains("-h") || args.contains("-?")) {
         std::cerr << QApplication::tr(
-            "\nTony is a program for interactive note and pitch analysis and annotation.\n\nUsage:\n\n  %1 [--no-audio] [--no-osc] [<file> ...]\n\n  --no-audio: Do not attempt to open an audio output device\n  <file>: One or more Tony (.ton) and audio files may be provided.\n").arg(argv[0]).toStdString() << std::endl;
+            "\nTony is a program for interactive note and pitch analysis and annotation.\n\nUsage:\n\n  %1 [--no-audio] [--no-sonification] [--no-spectrogram] [<file> ...]\n\n  --no-audio: Do not attempt to open an audio output device\n  <file>: One or more Tony (.ton) and audio files may be provided.\n --no-sonification: Disable and hide sonification of pitch tracks and notes.\n --no-spectrogram: Disable spectrogram.").arg(argv[0]).toStdString() << std::endl;
         exit(2);
     }
 
     if (args.contains("--no-audio")) audioOutput = false;
 
+    if (args.contains("--no-sonification")) sonification = false;
+
+    if (args.contains("--no-spectrogram")) spectrogram = false;
+
     QApplication::setOrganizationName("QMUL");
     QApplication::setOrganizationDomain("qmul.ac.uk");
     QApplication::setApplicationName("Tony");
@@ -204,7 +203,7 @@
     qRegisterMetaType<size_t>("size_t");
     qRegisterMetaType<PropertyContainer::PropertyName>("PropertyContainer::PropertyName");
 
-    MainWindow *gui = new MainWindow(audioOutput);
+    MainWindow *gui = new MainWindow(audioOutput, sonification, spectrogram);
     application.setMainWindow(gui);
     if (splash) {
         QObject::connect(gui, SIGNAL(hideSplash()), splash, SLOT(hide()));