From 92800b0f31abb9182d717edd4e921cdb0c74464d Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Sat, 17 Nov 2012 12:02:30 +0000 Subject: Added: Auto-start Jack upon MusE startup. Command-line disable switch -J added. --- muse2/ChangeLog | 1 + muse2/muse/driver/jack.cpp | 6 +++++- muse2/muse/globals.cpp | 1 + muse2/muse/globals.h | 1 + muse2/muse/main.cpp | 6 +++++- 5 files changed, 13 insertions(+), 2 deletions(-) (limited to 'muse2') diff --git a/muse2/ChangeLog b/muse2/ChangeLog index a7806117..4522a165 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,6 +1,7 @@ 17.11.2012: * Improved: Deicsonze soft synthesizer: Fixed crash, bugs, added ladspa plugins. (Tim) TODO: No plugin control automation. Some oddities with log slider/entry ranges. Maybe add delay wet/dry. + * Added: Request from forums: Auto-start Jack upon MusE startup. Command-line disable switch -J added. (Tim) 15.11.2012: * Improved: Popup menus: Auto-breakup too-wide menus in class PopupMenu. (Tim) In some cases X/Qt was giving up if too wide AND/OR too many columns, menu would not appear. diff --git a/muse2/muse/driver/jack.cpp b/muse2/muse/driver/jack.cpp index 05d47955..f3e6be20 100644 --- a/muse2/muse/driver/jack.cpp +++ b/muse2/muse/driver/jack.cpp @@ -431,8 +431,12 @@ bool initJackAudio() // } //if (i == 5) // return true; + + int opts = JackNullOption; + if(MusEGlobal::noAutoStartJack) + opts |= JackNoStartServer; jack_status_t status; - jack_client_t* client = jack_client_open("MusE", JackNoStartServer, &status); + jack_client_t* client = jack_client_open("MusE", (jack_options_t)opts, &status); if (!client) { if (status & JackServerStarted) printf("jack server started...\n"); diff --git a/muse2/muse/globals.cpp b/muse2/muse/globals.cpp index ec9de587..b61cda6d 100644 --- a/muse2/muse/globals.cpp +++ b/muse2/muse/globals.cpp @@ -115,6 +115,7 @@ bool loadDSSI = true; bool usePythonBridge = false; bool useLASH = true; bool useAlsaWithJack = false; +bool noAutoStartJack = false; const char* midi_file_pattern[] = { QT_TRANSLATE_NOOP("file_patterns", "Midi/Kar (*.mid *.MID *.kar *.KAR *.mid.gz *.mid.bz2)"), diff --git a/muse2/muse/globals.h b/muse2/muse/globals.h index 915486e1..da8221b9 100644 --- a/muse2/muse/globals.h +++ b/muse2/muse/globals.h @@ -85,6 +85,7 @@ extern bool loadDSSI; extern bool usePythonBridge; extern bool useLASH; extern bool useAlsaWithJack; +extern bool noAutoStartJack; extern bool realTimeScheduling; extern int realTimePriority; diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp index 204bbcc6..2ee9b60c 100644 --- a/muse2/muse/main.cpp +++ b/muse2/muse/main.cpp @@ -228,6 +228,7 @@ static void usage(const char* prog, const char* txt) fprintf(stderr, " -h This help\n"); fprintf(stderr, " -v Print version\n"); fprintf(stderr, " -a No audio, use dummy audio driver, plus ALSA midi\n"); + fprintf(stderr, " -J Do not try to auto-start the Jack audio server\n"); fprintf(stderr, " -A Force inclusion of ALSA midi even if using Jack\n"); fprintf(stderr, " -P n Set audio driver real time priority to n\n"); fprintf(stderr, " (Dummy only, default 40. Else fixed by Jack.)\n"); @@ -347,7 +348,7 @@ int main(int argc, char* argv[]) MuseApplication app(argc, argv); MusEGui::Appearance::defaultStyle = app.style()->objectName(); // NOTE: May need alternate method, above. - QString optstr("aAhvdDumMsP:Y:l:py"); + QString optstr("aJAhvdDumMsP:Y:l:py"); #ifdef VST_SUPPORT optstr += QString("V"); #endif @@ -373,6 +374,9 @@ int main(int argc, char* argv[]) case 'a': noAudio = true; break; + case 'J': + MusEGlobal::noAutoStartJack = true; + break; case 'A': MusEGlobal::useAlsaWithJack = true; break; -- cgit v1.2.3