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:
+18
-16
@@ -56,7 +56,7 @@ guint ownerID = 0;
|
|||||||
void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) void *userdata) {
|
void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) void *userdata) {
|
||||||
char response[100];
|
char response[100];
|
||||||
gboolean current_status, new_status;
|
gboolean current_status, new_status;
|
||||||
|
|
||||||
const char *th;
|
const char *th;
|
||||||
shairport_sync_advanced_remote_control_set_volume(shairportSyncAdvancedRemoteControlSkeleton,
|
shairport_sync_advanced_remote_control_set_volume(shairportSyncAdvancedRemoteControlSkeleton,
|
||||||
argc->speaker_volume);
|
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,
|
shairport_sync_remote_control_set_airplay_volume(shairportSyncRemoteControlSkeleton,
|
||||||
argc->airplay_volume);
|
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) {
|
if (argc->dacp_server_active) {
|
||||||
shairport_sync_remote_control_set_available(shairportSyncRemoteControlSkeleton, TRUE);
|
shairport_sync_remote_control_set_available(shairportSyncRemoteControlSkeleton, TRUE);
|
||||||
} else {
|
} else {
|
||||||
@@ -161,7 +163,7 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused))
|
|||||||
shairportSyncAdvancedRemoteControlSkeleton, response);
|
shairportSyncAdvancedRemoteControlSkeleton, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (argc->shuffle_status) {
|
switch (argc->shuffle_status) {
|
||||||
case SS_NOT_AVAILABLE:
|
case SS_NOT_AVAILABLE:
|
||||||
new_status = FALSE;
|
new_status = FALSE;
|
||||||
@@ -176,10 +178,10 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused))
|
|||||||
new_status = FALSE;
|
new_status = FALSE;
|
||||||
debug(1, "Unknown shuffle status -- this should never happen.");
|
debug(1, "Unknown shuffle status -- this should never happen.");
|
||||||
}
|
}
|
||||||
|
|
||||||
current_status = shairport_sync_advanced_remote_control_get_shuffle(
|
current_status = shairport_sync_advanced_remote_control_get_shuffle(
|
||||||
shairportSyncAdvancedRemoteControlSkeleton);
|
shairportSyncAdvancedRemoteControlSkeleton);
|
||||||
|
|
||||||
// only set this if it's different
|
// only set this if it's different
|
||||||
if (current_status != new_status) {
|
if (current_status != new_status) {
|
||||||
debug(3, "Shuffle State should be changed");
|
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);
|
// debug(1, "Set tracklength to %lu.", track_length_in_microseconds);
|
||||||
GVariant *tracklength = g_variant_new("x", track_length_in_microseconds);
|
GVariant *tracklength = g_variant_new("x", track_length_in_microseconds);
|
||||||
g_variant_builder_add(dict_builder, "{sv}", "mpris:length", tracklength);
|
g_variant_builder_add(dict_builder, "{sv}", "mpris:length", tracklength);
|
||||||
}
|
}
|
||||||
|
|
||||||
GVariant *dict = g_variant_builder_end(dict_builder);
|
GVariant *dict = g_variant_builder_end(dict_builder);
|
||||||
g_variant_builder_unref(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,
|
static gboolean on_handle_remote_command(ShairportSync *skeleton, GDBusMethodInvocation *invocation,
|
||||||
const gchar *command,
|
const gchar *command,
|
||||||
__attribute__((unused)) gpointer user_data) {
|
__attribute__((unused)) gpointer user_data) {
|
||||||
debug(1, "RemoteCommand with command \"%s\".", command);
|
debug(1, "RemoteCommand with command \"%s\".", command);
|
||||||
int reply = 0;
|
int reply = 0;
|
||||||
char *server_reply = NULL;
|
char *client_reply = NULL;
|
||||||
ssize_t reply_size = 0;
|
ssize_t reply_size = 0;
|
||||||
reply = dacp_send_command((const char *)command, &server_reply, &reply_size);
|
reply = dacp_send_command((const char *)command, &client_reply, &reply_size);
|
||||||
char *server_reply_hex = alloca(reply_size * 2 + 1);
|
char *client_reply_hex = alloca(reply_size * 2 + 1);
|
||||||
if (server_reply_hex) {
|
if (client_reply_hex) {
|
||||||
char *p = server_reply_hex;
|
char *p = client_reply_hex;
|
||||||
if (server_reply) {
|
if (client_reply) {
|
||||||
char *q = server_reply;
|
char *q = client_reply;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < reply_size; i++) {
|
for (i = 0; i < reply_size; i++) {
|
||||||
snprintf(p, 3, "%02X", *q);
|
snprintf(p, 3, "%02X", *q);
|
||||||
@@ -772,7 +774,7 @@ static gboolean on_handle_remote_command(ShairportSync *skeleton, GDBusMethodInv
|
|||||||
}
|
}
|
||||||
*p = '\0';
|
*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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,7 +976,7 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name
|
|||||||
// else
|
// else
|
||||||
// shairport_sync_set_convolution_impulse_response_file(SHAIRPORT_SYNC(shairportSyncSkeleton), NULL);
|
// shairport_sync_set_convolution_impulse_response_file(SHAIRPORT_SYNC(shairportSyncSkeleton), NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
shairport_sync_set_version(SHAIRPORT_SYNC(shairportSyncSkeleton), PACKAGE_VERSION);
|
shairport_sync_set_version(SHAIRPORT_SYNC(shairportSyncSkeleton), PACKAGE_VERSION);
|
||||||
char *vs = get_version_string();
|
char *vs = get_version_string();
|
||||||
shairport_sync_set_version_string(SHAIRPORT_SYNC(shairportSyncSkeleton), vs);
|
shairport_sync_set_version_string(SHAIRPORT_SYNC(shairportSyncSkeleton), vs);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<property name="DriftTolerance" type="d" access="readwrite" />
|
<property name="DriftTolerance" type="d" access="readwrite" />
|
||||||
<method name="RemoteCommand">
|
<method name="RemoteCommand">
|
||||||
<arg name="command" type="s" direction="in" />
|
<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" />
|
<arg name="response" type="s" direction="out" />
|
||||||
</method>
|
</method>
|
||||||
<property name="VolumeControlProfile" type="s" access="readwrite" />
|
<property name="VolumeControlProfile" type="s" access="readwrite" />
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<method name='VolumeDown'/>
|
<method name='VolumeDown'/>
|
||||||
<property name='PlayerState' type='s' access='read'/>
|
<property name='PlayerState' type='s' access='read'/>
|
||||||
<property name='ProgressString' 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'/>
|
<property name='AirplayVolume' type='d' access='read'/>
|
||||||
<method name="SetAirplayVolume">
|
<method name="SetAirplayVolume">
|
||||||
<arg name="volume" type="d" direction="in" />
|
<arg name="volume" type="d" direction="in" />
|
||||||
|
|||||||
Reference in New Issue
Block a user