Skip to content
Permalink
Browse files

Merge PR #3456: Add "--jackname" and "--jn" parameters to set a custo…

…m Jack client name
  • Loading branch information...
davidebeatrici committed Jul 8, 2018
2 parents e981c61 + 493e4a2 commit f6a6b6613c572929a311fba1bfb5542178c397b4
Showing with 10 additions and 2 deletions.
  1. +1 −1 src/mumble/JackAudio.cpp
  2. +1 −0 src/mumble/Settings.cpp
  3. +1 −1 src/mumble/Settings.h
  4. +7 −0 src/mumble/main.cpp
@@ -133,7 +133,7 @@ void JackAudioSystem::init_jack() {
int err = 0;

jack_options_t jack_option = g.s.bJackStartServer ? JackNullOption : JackNoStartServer;
client = jack_client_open("mumble", jack_option, &status);
client = jack_client_open(g.s.qsJackClientName.toStdString().c_str(), jack_option, &status);

if (client) {
qWarning("JackAudioSystem: client \"%s\" opened successfully", jack_get_client_name(client));
@@ -316,6 +316,7 @@ Settings::Settings() {
qsALSAInput=QLatin1String("default");
qsALSAOutput=QLatin1String("default");

qsJackClientName = QLatin1String("mumble");
qsJackAudioOutput = QLatin1String("1");
bJackStartServer = true;
bJackAutoConnect = true;
@@ -207,7 +207,7 @@ struct Settings {

QString qsALSAInput, qsALSAOutput;
QString qsPulseAudioInput, qsPulseAudioOutput;
QString qsJackAudioOutput;
QString qsJackClientName, qsJackAudioOutput;
bool bJackStartServer, bJackAutoConnect;
QString qsOSSInput, qsOSSOutput;
int iPortAudioInput, iPortAudioOutput;
@@ -130,6 +130,7 @@ int main(int argc, char **argv) {

bool bAllowMultiple = false;
bool suppressIdentity = false;
bool customJackClientName = false;
bool bRpcMode = false;
QString rpcCommand;
QUrl url;
@@ -157,6 +158,8 @@ int main(int argc, char **argv) {
" Allow multiple instances of the client to be started.\n"
" -n, --noidentity\n"
" Suppress loading of identity files (i.e., certificates.)\n"
" -jn, --jackname\n"
" Set custom Jack client name.\n"
" --license\n"
" Show the Mumble license.\n"
" --authors\n"
@@ -207,6 +210,9 @@ int main(int argc, char **argv) {
} else if (args.at(i) == QLatin1String("-n") || args.at(i) == QLatin1String("--noidentity")) {
suppressIdentity = true;
g.s.bSuppressIdentity = true;
} else if (args.at(i) == QLatin1String("-jn") || args.at(i) == QLatin1String("--jackname")) {
g.s.qsJackClientName = QString(args.at(i+1));
customJackClientName = true;
} else if (args.at(i) == QLatin1String("-license") || args.at(i) == QLatin1String("--license")) {
printf("%s\n", qPrintable(License::license()));
return 0;
@@ -627,6 +633,7 @@ int main(int argc, char **argv) {

if (bAllowMultiple) arguments << QLatin1String("--multiple");
if (suppressIdentity) arguments << QLatin1String("--noidentity");
if (customJackClientName) arguments << QLatin1String("--jackname ") + g.s.qsJackClientName;
if (!url.isEmpty()) arguments << url.toString();

qWarning() << "Triggering restart of Mumble with arguments: " << arguments;

0 comments on commit f6a6b66

Please sign in to comment.
You can’t perform that action at this time.