summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-11-17 12:02:30 +0000
committerTim E. Real <termtech@rogers.com>2012-11-17 12:02:30 +0000
commit92800b0f31abb9182d717edd4e921cdb0c74464d (patch)
tree034642c799cb58514720583f4386f86c37f87b54 /muse2/muse
parent09ac0c4c9a32cdba453812c4ac1199414fcc2719 (diff)
Added: Auto-start Jack upon MusE startup. Command-line disable switch -J added.
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/driver/jack.cpp6
-rw-r--r--muse2/muse/globals.cpp1
-rw-r--r--muse2/muse/globals.h1
-rw-r--r--muse2/muse/main.cpp6
4 files changed, 12 insertions, 2 deletions
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;