# HG changeset patch # User Chris Cannam # Date 1571236128 -3600 # Node ID 59b7fa58c0afdc2097fd7dfbb12fe37fe6ad970e # Parent 9ca6872a5d0fe5d8fc0a699c20d35317963c1d82 Use updated MainWindowBase API with ability to open playback device before record - hoping to fix #1946 Should ask for microphone permission only when first recording, not when first opening a file diff -r 9ca6872a5d0f -r 59b7fa58c0af main/MainWindow.cpp --- a/main/MainWindow.cpp Wed Oct 16 13:50:06 2019 +0100 +++ b/main/MainWindow.cpp Wed Oct 16 15:28:48 2019 +0100 @@ -135,8 +135,8 @@ using std::set; -MainWindow::MainWindow(SoundOptions options, bool withOSCSupport) : - MainWindowBase(options), +MainWindow::MainWindow(AudioMode audioMode, MIDIMode midiMode, bool withOSCSupport) : + MainWindowBase(audioMode, midiMode, int(PaneStack::Option::Default)), m_overview(nullptr), m_mainMenusCreated(false), m_paneMenu(nullptr), diff -r 9ca6872a5d0f -r 59b7fa58c0af main/MainWindow.h --- a/main/MainWindow.h Wed Oct 16 13:50:06 2019 +0100 +++ b/main/MainWindow.h Wed Oct 16 15:28:48 2019 +0100 @@ -32,7 +32,7 @@ Q_OBJECT public: - MainWindow(SoundOptions options, bool withOSCSupport = true); + MainWindow(AudioMode audioMode, MIDIMode midiMode, bool withOSCSupport); virtual ~MainWindow(); signals: diff -r 9ca6872a5d0f -r 59b7fa58c0af main/main.cpp --- a/main/main.cpp Wed Oct 16 13:50:06 2019 +0100 +++ b/main/main.cpp Wed Oct 16 15:28:48 2019 +0100 @@ -244,13 +244,6 @@ svSystemSpecificInitialisation(); -#ifdef Q_OS_MAC - if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_8) { - // Fix for OS/X 10.9 font problem - QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); - } -#endif - SVApplication application(argc, argv); QApplication::setOrganizationName("sonic-visualiser"); @@ -277,6 +270,9 @@ ("osc-script", QApplication::tr ("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."), "osc.txt")); + parser.addOption(QCommandLineOption + ("first-run", QApplication::tr + ("Clear any saved settings and reset to first-run behaviour."))); parser.addPositionalArgument ("[ ...]", QApplication::tr("One or more Sonic Visualiser (.sv) and audio files may be provided.")); @@ -293,6 +289,11 @@ parser.process(args); + if (parser.isSet("first-run")) { + QSettings settings; + settings.clear(); + } + bool audioOutput = !(parser.isSet("no-audio")); bool oscSupport = !(parser.isSet("no-osc")); bool showSplash = !(parser.isSet("no-splash")); @@ -396,11 +397,19 @@ qRegisterMetaType("PropertyContainer::PropertyName"); qRegisterMetaType("ZoomLevel"); - MainWindow::SoundOptions options = MainWindow::WithEverything; - if (!audioOutput) options = 0; + MainWindow::AudioMode audioMode = + MainWindow::AUDIO_PLAYBACK_NOW_RECORD_LATER; + MainWindow::MIDIMode midiMode = + MainWindow::MIDI_LISTEN; + + if (!audioOutput) { + audioMode = MainWindow::AUDIO_NONE; + midiMode = MainWindow::MIDI_NONE; + } - MainWindow *gui = new MainWindow(options, oscSupport); + MainWindow *gui = new MainWindow(audioMode, midiMode, oscSupport); application.setMainWindow(gui); + InteractiveFileFinder::setParentWidget(gui); TransformUserConfigurator::setParentWidget(gui); if (splash) {