beginning to add a progress string item to the native dbus interface

This commit is contained in:
Mike Brady
2018-06-21 17:44:26 +01:00
parent 0d48a3d96a
commit 365843faa6
4 changed files with 23 additions and 0 deletions
+11
View File
@@ -43,6 +43,17 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused))
shairport_sync_advanced_remote_control_set_available(shairportSyncAdvancedRemoteControlSkeleton,
FALSE);
}
if (argc->progress_string) {
debug(1, "Check progress string");
th = shairport_sync_remote_control_get_progress_string(
shairportSyncRemoteControlSkeleton);
if ((th == NULL) || (strcasecmp(th, argc->progress_string) != 0)) {
debug(1, "Progress string should be changed");
shairport_sync_remote_control_set_progress_string(
shairportSyncRemoteControlSkeleton, argc->progress_string);
}
}
switch (argc->player_state) {
case PS_NOT_AVAILABLE:
+10
View File
@@ -517,6 +517,16 @@ void metadata_hub_process_metadata(uint32_t type, uint32_t code, char *data, uin
}
break;
*/
case 'prgr':
if ((metadata_store.progress_string == NULL) ||
(strncmp(metadata_store.progress_string, data, length) != 0)) {
metadata_hub_modify_prolog();
release_char_string(&metadata_store.progress_string);
metadata_store.progress_string = strndup(data, length);
debug(1, "MH Progress String set to: \"%s\"", metadata_store.progress_string);
metadata_hub_modify_epilog(1);
}
break;
case 'svip':
if ((metadata_store.server_ip == NULL) ||
(strncmp(metadata_store.server_ip, data, length) != 0)) {
+1
View File
@@ -56,6 +56,7 @@ typedef struct metadata_bundle {
char *client_ip; // IP number used by the audio source (i.e. the "client"), which is also the DACP
// server
char *server_ip; // IP number used by Shairport Sync
char *progress_string; // progress string, emitted by the source from time to time
int player_thread_active; // true if a play thread is running
int dacp_server_active; // true if there's a reachable DACP server (assumed to be the Airplay
// client) ; false otherwise
+1
View File
@@ -33,6 +33,7 @@
<method name='VolumeUp'/>
<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='AirplayVolume' type='d' access='read'/>
<property name='Metadata' type='a{sv}' access='read'>