Jack_client_name added
This commit is contained in:
parent
031ca812ad
commit
067f552837
5 changed files with 46 additions and 0 deletions
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
**.o
|
||||
**/.deps
|
||||
src/FLTK/.dirstamp
|
||||
src/butt
|
||||
po/Makefile
|
||||
po/Makefile.in
|
||||
po/POTFILES
|
||||
src/Makefile
|
||||
stamp-h1
|
||||
Makefile
|
||||
config.status
|
||||
config.log
|
||||
10
src/butt.cpp
10
src/butt.cpp
|
|
@ -437,7 +437,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
// Parse command line parameters
|
||||
DEBUG_LOG("Parsing command line parameters");
|
||||
#ifndef WIN32
|
||||
while ((opt = getopt(argc, argv, ":vhc:AULxs:drtnqu:a:p:SM:m:O:o:j:")) != -1) {
|
||||
#else
|
||||
while ((opt = getopt(argc, argv, ":vhc:AULxs:drtnqu:a:p:SM:m:O:o:")) != -1) {
|
||||
#endif
|
||||
switch (opt) {
|
||||
#ifndef BUILD_CLIENT
|
||||
case 'A':
|
||||
|
|
@ -603,6 +607,12 @@ int main(int argc, char *argv[])
|
|||
printf(_("Option -%c requires an argument\n"), optopt);
|
||||
print_usage();
|
||||
return 1;
|
||||
#ifndef WIN32
|
||||
case 'j':
|
||||
jack_client_name = (char *)malloc((strlen(optarg) + 1) * sizeof(char));
|
||||
strcpy(jack_client_name, optarg);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
printf(_("Command line parsing failed\n"));
|
||||
print_usage();
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ const char *lang_array_old[] = {"system", "de", "en", "fr", "pt_BR"};
|
|||
|
||||
config_t cfg;
|
||||
char *cfg_path;
|
||||
#ifndef WIN32
|
||||
char *jack_client_name;
|
||||
#endif
|
||||
|
||||
int cfg_write_file(char *path)
|
||||
{
|
||||
|
|
@ -49,6 +52,11 @@ int cfg_write_file(char *path)
|
|||
if (path == NULL) {
|
||||
path = cfg_path;
|
||||
}
|
||||
#ifndef WIN32
|
||||
if (jack_client_name == NULL) {
|
||||
jack_client_name = strdup("butt");
|
||||
}
|
||||
#endif
|
||||
|
||||
cfg_fd = fl_fopen(path, "wb");
|
||||
if (cfg_fd == NULL) {
|
||||
|
|
|
|||
|
|
@ -391,6 +391,9 @@ typedef struct {
|
|||
} config_t;
|
||||
|
||||
extern char *cfg_path; // Path to config file
|
||||
#ifndef WIN32
|
||||
extern char *jack_client_name; // JACK client name
|
||||
#endif
|
||||
extern config_t cfg; // Holds config parameters
|
||||
|
||||
int cfg_write_file(char *path); // Writes current config_t struct to path or cfg_path if path is NULL
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <portaudio.h>
|
||||
#include <pa_jack.h>
|
||||
#endif
|
||||
|
||||
#include "gettext.h"
|
||||
|
|
@ -126,6 +129,16 @@ int snd_init(void)
|
|||
{
|
||||
char info_buf[256];
|
||||
|
||||
#ifndef WIN32
|
||||
// JACK: Set client name before Pa_Initialize
|
||||
if (jack_client_name && strlen(jack_client_name) > 0) {
|
||||
PaJack_SetClientName(jack_client_name);
|
||||
} else {
|
||||
jack_client_name = strdup("butt");
|
||||
PaJack_SetClientName(jack_client_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
PaError p_err;
|
||||
if ((p_err = Pa_Initialize()) != paNoError) {
|
||||
snprintf(info_buf, sizeof(info_buf), _("PortAudio init failed:\n%s\n"), Pa_GetErrorText(p_err));
|
||||
|
|
|
|||
Loading…
Reference in a new issue