Browse Source

add jack_client_t* to metadata calls that need to contact the server to initiate a property change callback

tags/0.124.0
Paul Davis 12 years ago
parent
commit
9222d7a4ee
1 changed files with 10 additions and 20 deletions
  1. +10
    -20
      property.c

+ 10
- 20
property.c View File

@@ -156,25 +156,20 @@ int main (int argc, char* argv[])
}
}

if (delete_all) {
if ((client = jack_client_open ("jack-property", options, NULL)) == 0) {
fprintf (stderr, "Cannot connect to JACK server\n");
exit (1);
}

/* Don't need to be a JACK client to do this
(or several other things, actually, but the
need is hard to determine a priori).
*/
if (delete_all) {

if (jack_remove_all_properties () == 0) {
if (jack_remove_all_properties (client) == 0) {
printf ("JACK metadata successfully delete\n");
exit (0);
}
exit (1);
}

if ((client = jack_client_open ("jack-property", options, NULL)) == 0) {
fprintf (stderr, "Cannot connect to JACK server\n");
exit (1);
}

if (delete) {

int args_left = argc - optind;
@@ -196,7 +191,7 @@ int main (int argc, char* argv[])

key = argv[optind++];

if (jack_remove_property (uuid, key)) {
if (jack_remove_property (client, uuid, key)) {
fprintf (stderr, "\"%s\" property not removed for %s\n", key, subject);
exit (1);
}
@@ -207,7 +202,7 @@ int main (int argc, char* argv[])
return 1;
}
if (jack_remove_properties (uuid)) {
if (jack_remove_properties (client, uuid)) {
fprintf (stderr, "cannot remove properties for UUID %s\n", subject);
exit (1);
}
@@ -230,22 +225,17 @@ int main (int argc, char* argv[])
type = "";
}

if (jack_set_property (uuid, key, value, type)) {
if (jack_set_property (client, uuid, key, value, type)) {
fprintf (stderr, "cannot set value for key %s of %s\n", value, subject);
exit (1);
}
} else {

/* list */
/* list properties */
int args_left = argc - optind;

/* argc == 3: list all properties for a subject
argc == 4: list value of key for subject
argc == ?: list all
*/
if (args_left >= 2) {

/* list properties for a UUID/key pair */


Loading…
Cancel
Save