Mercurial > hg > tony
comparison 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 |
comparison
equal
deleted
inserted
replaced
363:3143b069c60a | 364:f5a4c4283b93 |
---|---|
135 } | 135 } |
136 #endif | 136 #endif |
137 | 137 |
138 TonyApplication application(argc, argv); | 138 TonyApplication application(argc, argv); |
139 | 139 |
140 // For some weird reason, Mac builds are crashing on startup when | |
141 // this line is present. Eliminate it on that platform for now. | |
142 #ifndef Q_OS_MAC | |
143 QStringList args = application.arguments(); | 140 QStringList args = application.arguments(); |
144 #else | |
145 cerr << "NOTE: Command-line arguments are currently disabled on Mac, see comments in main.cpp" << endl; | |
146 QStringList args; | |
147 #endif | |
148 | 141 |
149 signal(SIGINT, signalHandler); | 142 signal(SIGINT, signalHandler); |
150 signal(SIGTERM, signalHandler); | 143 signal(SIGTERM, signalHandler); |
151 | 144 |
152 #ifndef Q_OS_WIN32 | 145 #ifndef Q_OS_WIN32 |
153 signal(SIGHUP, signalHandler); | 146 signal(SIGHUP, signalHandler); |
154 signal(SIGQUIT, signalHandler); | 147 signal(SIGQUIT, signalHandler); |
155 #endif | 148 #endif |
156 | 149 |
157 bool audioOutput = true; | 150 bool audioOutput = true; |
151 bool sonification = true; | |
152 bool spectrogram = true; | |
158 | 153 |
159 if (args.contains("--help") || args.contains("-h") || args.contains("-?")) { | 154 if (args.contains("--help") || args.contains("-h") || args.contains("-?")) { |
160 std::cerr << QApplication::tr( | 155 std::cerr << QApplication::tr( |
161 "\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; | 156 "\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; |
162 exit(2); | 157 exit(2); |
163 } | 158 } |
164 | 159 |
165 if (args.contains("--no-audio")) audioOutput = false; | 160 if (args.contains("--no-audio")) audioOutput = false; |
161 | |
162 if (args.contains("--no-sonification")) sonification = false; | |
163 | |
164 if (args.contains("--no-spectrogram")) spectrogram = false; | |
166 | 165 |
167 QApplication::setOrganizationName("QMUL"); | 166 QApplication::setOrganizationName("QMUL"); |
168 QApplication::setOrganizationDomain("qmul.ac.uk"); | 167 QApplication::setOrganizationDomain("qmul.ac.uk"); |
169 QApplication::setApplicationName("Tony"); | 168 QApplication::setApplicationName("Tony"); |
170 | 169 |
202 | 201 |
203 // Permit size_t and PropertyName to be used as args in queued signal calls | 202 // Permit size_t and PropertyName to be used as args in queued signal calls |
204 qRegisterMetaType<size_t>("size_t"); | 203 qRegisterMetaType<size_t>("size_t"); |
205 qRegisterMetaType<PropertyContainer::PropertyName>("PropertyContainer::PropertyName"); | 204 qRegisterMetaType<PropertyContainer::PropertyName>("PropertyContainer::PropertyName"); |
206 | 205 |
207 MainWindow *gui = new MainWindow(audioOutput); | 206 MainWindow *gui = new MainWindow(audioOutput, sonification, spectrogram); |
208 application.setMainWindow(gui); | 207 application.setMainWindow(gui); |
209 if (splash) { | 208 if (splash) { |
210 QObject::connect(gui, SIGNAL(hideSplash()), splash, SLOT(hide())); | 209 QObject::connect(gui, SIGNAL(hideSplash()), splash, SLOT(hide())); |
211 } | 210 } |
212 | 211 |