Commit f41fbba8 authored by sletz's avatar sletz
Browse files

Use .jackdrc file (instead of .jackdmprc). Install script now creates a link jackd

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1582 0c269be4-1314-0410-8aa9-9f06e86f4224
parent a8d2dcdb
......@@ -13,6 +13,11 @@ Tom Szilagyi
Jackdmp changes log
---------------------------
2007-10-08 Stephane Letz <letz@grame.fr>
* Use .jackdrc file (instead of .jackdmprc). Install script now creates a link "jackd ==> jackdmp" so that automatic launch can work correctly.
* Paul Davis patch for -r (--replace-registry) feature.
2007-10-07 Stephane Letz <letz@grame.fr>
* Add missing timestamps.c and timestamps.h files. Correctly export public headers in OSX frameworks. Suppress JackEngine::ClientInternalCloseIm method.
......
......@@ -651,7 +651,7 @@ void JackGraphManager::GetConnectionsAux(JackConnectionManager* manager, const c
jack_int_t index;
int i;
for (i = 0; (i < CONNECTION_NUM) && ((index = connections[i]) != EMPTY) ; i++) {
for (i = 0; (i < CONNECTION_NUM) && ((index = connections[i]) != EMPTY); i++) {
JackPort* port = GetPort(index);
res[i] = port->fName;
}
......
......@@ -220,15 +220,15 @@ bool JackServerGlobals::Init()
int argc = 0;
char* argv[32];
snprintf(filename, 255, "%s/.jackdmprc", getenv("HOME"));
snprintf(filename, 255, "%s/.jackdrc", getenv("HOME"));
fp = fopen(filename, "r");
if (!fp) {
fp = fopen("/etc/jackdmprc", "r");
fp = fopen("/etc/jackdrc", "r");
}
// if still not found, check old config name for backwards compatability
if (!fp) {
fp = fopen("/etc/jackdmp.conf", "r");
fp = fopen("/etc/jackd.conf", "r");
}
argc = 0;
......@@ -355,7 +355,7 @@ bool JackServerGlobals::Init()
server_name = jack_default_server_name();
#endif
rc = jack_register_server(server_name);
rc = jack_register_server(server_name, false);
switch (rc) {
case EEXIST:
fprintf(stderr, "`%s' server already active\n", server_name);
......
......@@ -41,15 +41,15 @@ static void start_server_aux(const char* server_name)
int good = 0;
int ret;
snprintf(filename, 255, "%s/.jackdmprc", getenv("HOME"));
snprintf(filename, 255, "%s/.jackdrc", getenv("HOME"));
fp = fopen(filename, "r");
if (!fp) {
fp = fopen("/etc/jackdmprc", "r");
fp = fopen("/etc/jackdrc", "r");
}
/* if still not found, check old config name for backwards compatability */
if (!fp) {
fp = fopen("/etc/jackdmp.conf", "r");
fp = fopen("/etc/jackd.conf", "r");
}
if (fp) {
......@@ -67,8 +67,8 @@ static void start_server_aux(const char* server_name)
}
if (!good) {
command = JACK_LOCATION "/jackdmp";
strncpy(arguments, JACK_LOCATION "/jackdmp -T -d "JACK_DEFAULT_DRIVER, 255);
command = JACK_LOCATION "/jackd";
strncpy(arguments, JACK_LOCATION "/jackd -T -d "JACK_DEFAULT_DRIVER, 255);
} else {
result = strcspn(arguments, " ");
command = (char*)malloc(result + 1);
......@@ -97,7 +97,7 @@ static void start_server_aux(const char* server_name)
break;
}
argv[i] = (char*)malloc(result + 1);
strncpy(argv[i], arguments+pos, result);
strncpy(argv[i], arguments + pos, result);
argv[i][result] = '\0';
pos += result + 1;
++i;
......
......@@ -80,6 +80,7 @@ static void usage(FILE* file)
" [ --loopback OR -L loopback-port-number ]\n"
// " [ --port-max OR -p maximum-number-of-ports]\n"
" [ --verbose OR -v ]\n"
" [ --replace-registry OR -r ]\n"
" [ --silent OR -s ]\n"
" [ --sync OR -S ]\n"
" [ --temporary OR -T ]\n"
......@@ -245,7 +246,7 @@ int main(int argc, char* argv[])
int waiting;
jack_driver_desc_t* driver_desc;
const char *options = "-ad:P:uvshVRL:STFl:t:mn:p:";
const char *options = "-ad:P:uvrshVRL:STFl:t:mn:p:";
struct option long_options[] = {
{ "driver", 1, 0, 'd' },
{ "verbose", 0, 0, 'v' },
......@@ -255,6 +256,7 @@ int main(int argc, char* argv[])
{ "name", 0, 0, 'n' },
{ "unlock", 0, 0, 'u' },
{ "realtime", 0, 0, 'R' },
{ "replace-registry", 0, 0, 'r' },
{ "loopback", 0, 0, 'L' },
{ "realtime-priority", 1, 0, 'P' },
{ "timeout", 1, 0, 't' },
......@@ -272,6 +274,7 @@ int main(int argc, char* argv[])
JSList* driver_params;
int driver_nargs = 1;
int show_version = 0;
int replace_registry = 0;
int sync = 0;
int rc, i;
......@@ -313,7 +316,11 @@ int main(int argc, char* argv[])
case 'P':
realtime_priority = atoi(optarg);
break;
case 'r':
replace_registry = 1;
break;
case 'R':
realtime = 1;
break;
......@@ -404,7 +411,7 @@ int main(int argc, char* argv[])
copyright(stdout);
rc = jack_register_server(server_name);
rc = jack_register_server(server_name, replace_registry);
switch (rc) {
case EEXIST:
fprintf(stderr, "`%s' server already active\n", server_name);
......
......@@ -276,7 +276,7 @@ jack_set_server_prefix (const char *server_name)
* returns: 0 if successful
*/
static int
jack_server_initialize_shm (void)
jack_server_initialize_shm (int new_registry)
{
int rc;
......@@ -286,6 +286,11 @@ jack_server_initialize_shm (void)
jack_shm_lock_registry ();
rc = jack_access_registry (&registry_info);
if (new_registry) {
jack_remove_shm (&registry_id);
rc = ENOENT;
}
switch (rc) {
case ENOENT: /* registry does not exist */
......@@ -430,7 +435,7 @@ jack_release_shm_info (jack_shm_registry_index_t index)
* ENOMEM if unable to access shared memory registry
*/
EXPORT int
jack_register_server (const char *server_name)
jack_register_server (const char *server_name, int new_registry)
{
int i, res = 0;
......@@ -442,7 +447,7 @@ jack_register_server (const char *server_name)
jack_set_server_prefix (server_name);
if (jack_server_initialize_shm ())
if (jack_server_initialize_shm (new_registry))
return ENOMEM;
jack_shm_lock_registry ();
......@@ -770,7 +775,7 @@ jack_shmalloc (const char *shm_name, jack_shmsize_t size, jack_shm_info_t* si)
* registry index for uniqueness and ignore the shm_name
* parameter. Bah!
*/
snprintf (name, sizeof (name), "/jack-%d", registry->index);
snprintf (name, sizeof (name), "/jackmp-%d", registry->index);
if (strlen (name) >= sizeof (registry->id)) {
jack_error ("shm segment name too long %s", name);
......
......@@ -134,7 +134,7 @@ extern "C"
/* here beginneth the API */
EXPORT extern int jack_register_server (const char *server_name);
EXPORT extern int jack_register_server (const char *server_name, int new_registry);
EXPORT extern void jack_unregister_server (const char *server_name);
extern int jack_initialize_shm (const char *server_name);
......
......@@ -113,9 +113,11 @@ install:
cp jack_dummy.so $(prefix)/lib/jackmp
[ -f jack_freebob.so ] && cp jack_freebob.so $(prefix)/lib/jackmp || echo "freebob driver not installed"
cd $(prefix)/lib && [ -f libjack.so.0.0.23 ] && mv -f libjack.so.0.0.23 tmp_libjack.so.0.0.23 || echo "Jack not found, continue..."
cd $(prefix)/bin && [ -f jackd ] && mv -f jackd tmp_jackd
cd $(prefix)/lib && rm -f libjack.so*
cd $(prefix)/lib && ln -s libjackmp.so libjack.so
cd $(prefix)/lib && ln -s libjackmp.so libjack.so.0
cd $(prefix)/bin && ln -s jackdmp jackd
/sbin/ldconfig
# Remove jackdmp and tries to restore jack
......@@ -129,6 +131,7 @@ remove:
cd $(prefix)/lib && rm -f libjack.so*
cd $(prefix)/lib && [ -f tmp_libjack.so.0.0.23 ] && mv -f tmp_libjack.so.0.0.23 libjack.so.0.0.23 \
&& ln -s libjack.so.0.0.23 libjack.so && ln -s libjack.so.0.0.23 libjack.so.0 || echo "Jack not restored"
cd $(prefix)/bin && [ -f tmp_jackd ] && mv -f tmp_jackd jackd
/sbin/ldconfig
......
# Install jackdmp and owerwrite jack installation
# Plug-ins
sudo cp -r Panda.framework /Library/Frameworks
sudo cp -r JackRouterMP.plugin /Library/Audio/Plug-Ins/HAL/
# Copy libraries and exe
sudo cp -r Jackmp.framework /Library/Frameworks/
sudo cp -r Jackdmp.framework /Library/Frameworks/
sudo install -d /usr/local/bin
sudo cp jackdmp /usr/local/bin
# Copy drivers
sudo install -d /usr/local/lib/jackmp
sudo cp jack_coreaudio.so /usr/local/lib/jackmp
sudo cp jack_dummy.so /usr/local/lib/jackmp
# Create links to jackmp ressources
cd /usr/local/lib && [ -f libjack.0.dylib ] && sudo mv -f libjack.0.dylib tmp_libjack.0.dylib
cd /usr/local/lib && [ -f jackd ] && sudo mv -f jackd tmp_jackd
cd /usr/local/lib && [ -f libjack.dylib ] && sudo rm libjack.dylib
cd /usr/local/bin && [ -f jackd ] && sudo rm jackd
cd /usr/local/lib && sudo ln -s /Library/Frameworks/Jackmp.framework/Jackmp libjack.dylib
cd /usr/local/lib && sudo ln -s /Library/Frameworks/Jackmp.framework/Jackmp libjack.0.dylib
cd /usr/local/bin && sudo ln -s jackdmp jackd
# Remove jackdmp and tries to restore jack
# Remove jackdmp resources
sudo rm -r "/usr/local/lib/jackmp"
sudo rm "/usr/local/bin/jackdmp"
sudo rm -r "/usr/local/lib/jackd"
sudo rm "/usr/local/lib/libjackmp.dylib"
sudo rm -r "/Library/Frameworks/Jackmp.framework"
sudo rm -r "/Library/Frameworks/Jackdmp.framework"
sudo rm -r "/Library/Audio/Plug-Ins/HAL/JackRouterMP.plugin"
# Tries to restore jack
cd /usr/local/lib && sudo rm -r libjack.0.dylib
cd /usr/local/lib && [ -f tmp_libjack.0.dylib ] && sudo mv -f tmp_libjack.0.dylib libjack.0.dylib
cd /usr/local/lib && ln -s libjack.0.dylib libjack.dylib
cd /usr/local/bin && [ -f tmp_jackd ] && sudo mv -f tmp_jackd jackd
......@@ -79,6 +79,7 @@ static void usage (FILE *file)
" [ --loopback OR -L loopback-port-number ]\n"
// " [ --port-max OR -p maximum-number-of-ports]\n"
" [ --verbose OR -v ]\n"
" [ --replace-registry OR -r ]\n"
" [ --silent OR -s ]\n"
" [ --sync OR -S ]\n"
" [ --version OR -V ]\n"
......@@ -262,6 +263,7 @@ int main(int argc, char* argv[])
{ "name", 0, 0, 'n' },
{ "unlock", 0, 0, 'u' },
{ "realtime", 0, 0, 'R' },
{ "replace-registry", 0, 0, 'r' },
{ "loopback", 0, 0, 'L' },
{ "realtime-priority", 1, 0, 'P' },
{ "timeout", 1, 0, 't' },
......@@ -279,6 +281,7 @@ int main(int argc, char* argv[])
JSList * driver_params;
int driver_nargs = 1;
int show_version = 0;
int replace_registry = 0;
int sync = 0;
int i;
int rc;
......@@ -329,6 +332,10 @@ int main(int argc, char* argv[])
case 'P':
realtime_priority = atoi(optarg);
break;
case 'r':
replace_registry = 1;
break;
case 'R':
realtime = 1;
......@@ -414,7 +421,7 @@ int main(int argc, char* argv[])
copyright (stdout);
rc = jack_register_server (server_name);
rc = jack_register_server (server_name, replace_registry);
switch (rc) {
case EEXIST:
fprintf (stderr, "`%s' server already active\n", server_name);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment