comparison main/main.cpp @ 2361:2cd56528616a

OK, the old QCommandLineOption constructor didn't permit that usage - be more explicit
author Chris Cannam
date Thu, 10 Oct 2019 10:35:40 +0100
parents 7bed1c28b5e9
children 59b7fa58c0af
comparison
equal deleted inserted replaced
2360:7bed1c28b5e9 2361:2cd56528616a
262 QCommandLineParser parser; 262 QCommandLineParser parser;
263 parser.setApplicationDescription(QApplication::tr("\nSonic Visualiser is a program for viewing and exploring audio data\nfor semantic music analysis and annotation.")); 263 parser.setApplicationDescription(QApplication::tr("\nSonic Visualiser is a program for viewing and exploring audio data\nfor semantic music analysis and annotation."));
264 parser.addHelpOption(); 264 parser.addHelpOption();
265 parser.addVersionOption(); 265 parser.addVersionOption();
266 266
267 QList<QCommandLineOption> commandOptions { 267 parser.addOption(QCommandLineOption
268 { "no-audio", QApplication::tr 268 ("no-audio", QApplication::tr
269 ("Do not attempt to open an audio output device.") }, 269 ("Do not attempt to open an audio output device.")));
270 { "no-osc", QApplication::tr 270 parser.addOption(QCommandLineOption
271 ("Do not provide an Open Sound Control port for remote control.") }, 271 ("no-osc", QApplication::tr
272 { "no-splash", QApplication::tr 272 ("Do not provide an Open Sound Control port for remote control.")));
273 ("Do not show a splash screen.") }, 273 parser.addOption(QCommandLineOption
274 { "osc-script", QApplication::tr 274 ("no-splash", QApplication::tr
275 ("Batch run the Open Sound Control script found in the given file. Supply \"-\" as file to read from stdin. Scripts consist of /command arg1 arg2 ... OSC control lines, optionally interleaved with numbers to specify pauses in seconds."), 275 ("Do not show a splash screen.")));
276 "osc.txt" } 276 parser.addOption(QCommandLineOption
277 }; 277 ("osc-script", QApplication::tr
278 for (auto option: commandOptions) { // NB addOptions was added in 278 ("Batch run the Open Sound Control script found in the given file. Supply \"-\" as file to read from stdin. Scripts consist of /command arg1 arg2 ... OSC control lines, optionally interleaved with numbers to specify pauses in seconds."),
279 // Qt 5.4, slightly too new 279 "osc.txt"));
280 // for us at present
281 parser.addOption(option);
282 }
283 280
284 parser.addPositionalArgument 281 parser.addPositionalArgument
285 ("[<file> ...]", QApplication::tr("One or more Sonic Visualiser (.sv) and audio files may be provided.")); 282 ("[<file> ...]", QApplication::tr("One or more Sonic Visualiser (.sv) and audio files may be provided."));
286 283
287 QStringList args = application.arguments(); 284 QStringList args = application.arguments();