Change from talking about a server to talking about a client. Technically, e.g. iTunes is a client of Shairport Sync.

This commit is contained in:
Mike Brady
2020-01-10 17:21:55 +00:00
parent 249a6deff9
commit ec665d9be4
2 changed files with 20 additions and 18 deletions
+18 -16
View File
@@ -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);
+2 -2
View File
@@ -13,7 +13,7 @@
<property name="DriftTolerance" type="d" access="readwrite" />
<method name="RemoteCommand">
<arg name="command" type="s" direction="in" />
<arg name="reply" type="i" direction="out" />
<arg name="reply" type="i" direction="out" />
<arg name="response" type="s" direction="out" />
</method>
<property name="VolumeControlProfile" type="s" access="readwrite" />
@@ -45,7 +45,7 @@
<method name='VolumeDown'/>
<property name='PlayerState' type='s' access='read'/>
<property name='ProgressString' type='s' access='read'/>
<property name='Server' type='s' access='read'/>
<property name='Client' type='s' access='read'/>
<property name='AirplayVolume' type='d' access='read'/>
<method name="SetAirplayVolume">
<arg name="volume" type="d" direction="in" />