Mercurial > hg > tony
diff src/main.cpp @ 364:f5a4c4283b93
adding no spectrogram and no sonification options
author | matthiasm |
---|---|
date | Tue, 15 Jul 2014 15:42:21 +0100 |
parents | aa576f9213bf |
children | fec4dafd9093 |
line wrap: on
line diff
--- 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()));