]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Hook up the dbus metadata watcher and the dacp volume control stuff.
authorMike Brady <mikebrady@eircom.net>
Sun, 4 Mar 2018 17:43:43 +0000 (17:43 +0000)
committerMike Brady <mikebrady@eircom.net>
Sun, 4 Mar 2018 17:43:43 +0000 (17:43 +0000)
dbus-service.c

index f030bd8438e2e69c5a3084f7bb50b07845db76b2..524bbb3f4303fa4c03d458258ffa2ffdfbc78094 100644 (file)
 
 #include "dacp.h"
 
+#include "metadata_hub.h"
 #include "dbus-service.h"
 
+void dbus_metadata_watcher(struct metadata_bundle *argc, void *userdata) {
+   // debug(1, "DBUS metadata watcher called");
+   shairport_sync_set_volume(shairportSyncSkeleton, metadata_store.speaker_volume);
+}
+
+
 gboolean notify_loudness_filter_active_callback(ShairportSync *skeleton, gpointer user_data) {
   debug(1, "\"notify_loudness_filter_active_callback\" called.");
   if (shairport_sync_get_loudness_filter_active(skeleton)) {
@@ -177,6 +184,9 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name
                    NULL);
   g_signal_connect(shairportSyncSkeleton, "handle-remote-command",
                    G_CALLBACK(on_handle_remote_command), NULL);
+                   
+  add_metadata_watcher(dbus_metadata_watcher, NULL);
+  
   debug(1, "Shairport Sync native D-Bus service started at \"%s\" on the %s bus.", name, (config.dbus_service_bus_type == DBT_session) ? "session" : "system");
 }