From: Mike Brady Date: Fri, 10 Jan 2020 17:21:55 +0000 (+0000) Subject: Change from talking about a server to talking about a client. Technically, e.g. iTune... X-Git-Tag: 3.3.7d12~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec665d9be45f8d655da1e444d8514a2da4e27106;p=thirdparty%2Fshairport-sync.git Change from talking about a server to talking about a client. Technically, e.g. iTunes is a client of Shairport Sync. --- diff --git a/dbus-service.c b/dbus-service.c index d9d6e95d..3efde8f1 100644 --- a/dbus-service.c +++ b/dbus-service.c @@ -56,7 +56,7 @@ guint ownerID = 0; void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) void *userdata) { char response[100]; gboolean current_status, new_status; - + const char *th; shairport_sync_advanced_remote_control_set_volume(shairportSyncAdvancedRemoteControlSkeleton, argc->speaker_volume); @@ -64,8 +64,10 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) shairport_sync_remote_control_set_airplay_volume(shairportSyncRemoteControlSkeleton, argc->airplay_volume); - shairport_sync_remote_control_set_server(shairportSyncRemoteControlSkeleton, argc->client_ip); + shairport_sync_remote_control_set_client(shairportSyncRemoteControlSkeleton, argc->client_ip); + + // although it's a DACP server, the server is in fact, part of the the AirPlay "client" (their term). if (argc->dacp_server_active) { shairport_sync_remote_control_set_available(shairportSyncRemoteControlSkeleton, TRUE); } else { @@ -161,7 +163,7 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) shairportSyncAdvancedRemoteControlSkeleton, response); } - + switch (argc->shuffle_status) { case SS_NOT_AVAILABLE: new_status = FALSE; @@ -176,10 +178,10 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) new_status = FALSE; debug(1, "Unknown shuffle status -- this should never happen."); } - + current_status = shairport_sync_advanced_remote_control_get_shuffle( shairportSyncAdvancedRemoteControlSkeleton); - + // only set this if it's different if (current_status != new_status) { debug(3, "Shuffle State should be changed"); @@ -243,7 +245,7 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) // debug(1, "Set tracklength to %lu.", track_length_in_microseconds); GVariant *tracklength = g_variant_new("x", track_length_in_microseconds); g_variant_builder_add(dict_builder, "{sv}", "mpris:length", tracklength); - } + } GVariant *dict = g_variant_builder_end(dict_builder); g_variant_builder_unref(dict_builder); @@ -753,16 +755,16 @@ static gboolean on_handle_quit(ShairportSync *skeleton, GDBusMethodInvocation *i static gboolean on_handle_remote_command(ShairportSync *skeleton, GDBusMethodInvocation *invocation, const gchar *command, __attribute__((unused)) gpointer user_data) { - debug(1, "RemoteCommand with command \"%s\".", command); + debug(1, "RemoteCommand with command \"%s\".", command); int reply = 0; - char *server_reply = NULL; + char *client_reply = NULL; ssize_t reply_size = 0; - reply = dacp_send_command((const char *)command, &server_reply, &reply_size); - char *server_reply_hex = alloca(reply_size * 2 + 1); - if (server_reply_hex) { - char *p = server_reply_hex; - if (server_reply) { - char *q = server_reply; + reply = dacp_send_command((const char *)command, &client_reply, &reply_size); + char *client_reply_hex = alloca(reply_size * 2 + 1); + if (client_reply_hex) { + char *p = client_reply_hex; + if (client_reply) { + char *q = client_reply; int i; for (i = 0; i < reply_size; i++) { snprintf(p, 3, "%02X", *q); @@ -772,7 +774,7 @@ static gboolean on_handle_remote_command(ShairportSync *skeleton, GDBusMethodInv } *p = '\0'; } - shairport_sync_complete_remote_command(skeleton, invocation, reply, server_reply_hex); + shairport_sync_complete_remote_command(skeleton, invocation, reply, client_reply_hex); return TRUE; } @@ -974,7 +976,7 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name // else // shairport_sync_set_convolution_impulse_response_file(SHAIRPORT_SYNC(shairportSyncSkeleton), NULL); #endif - + shairport_sync_set_version(SHAIRPORT_SYNC(shairportSyncSkeleton), PACKAGE_VERSION); char *vs = get_version_string(); shairport_sync_set_version_string(SHAIRPORT_SYNC(shairportSyncSkeleton), vs); diff --git a/org.gnome.ShairportSync.xml b/org.gnome.ShairportSync.xml index 91c31671..10eb5477 100644 --- a/org.gnome.ShairportSync.xml +++ b/org.gnome.ShairportSync.xml @@ -13,7 +13,7 @@ - + @@ -45,7 +45,7 @@ - +