#include <glib.h>
#include <gconf/gconf-client.h>
#include <libosso.h>
+#include <dbus/dbus.h>
#define STATE_FILE "/sys/devices/platform/gpio-switch/headphone/state"
#define STATE_CONNECTED_STR "connected"
#define MEDIA_SERVER_PATH "/com/nokia/osso_media_server"
#define MEDIA_SERVER_INTF "com.nokia.osso_media_server.music"
+#define PANUCCI_SRVC "org.panucci.panucciInterface"
+#define PANUCCI_PATH "/panucciInterface"
+#define PANUCCI_INTF "org.panucci.panucciInterface"
+
// Volume control is currently broken, as something is messing
// with the controls from outside this process in GConf..
//#define ENABLE_VOLUME_CONTROL
typedef struct {
GConfClient* client;
+ DBusConnection* session_bus;
osso_context_t* osso;
guint state;
gint volume[STATE_COUNT];
gconf_client_notify_add(this->client, GCONF_VOLUME_CONTROL,
on_volume_changed, this, NULL, NULL);
#endif
+
+ this->session_bus = dbus_bus_get(DBUS_BUS_SESSION, NULL);
this->initial = TRUE;
return this;
headphoned->state = STATE_DISCONNECTED;
#ifdef ENABLE_PAUSE_ON_DISCONNECT
if (headphoned->initial == FALSE) {
+ /* Nokia Media Player */
osso_rpc_run(headphoned->osso,
MEDIA_SERVER_SRVC,
MEDIA_SERVER_PATH,
"pause",
NULL,
DBUS_TYPE_INVALID);
+
+ /* Panucci */
+ if (dbus_bus_name_has_owner(headphoned->session_bus,
+ PANUCCI_SRVC,
+ NULL)) {
+ osso_rpc_run(headphoned->osso,
+ PANUCCI_SRVC,
+ PANUCCI_PATH,
+ PANUCCI_INTF,
+ "pause",
+ NULL,
+ DBUS_TYPE_INVALID);
+ }
}
#endif
}