From: Thomas Perl Date: Wed, 21 Oct 2009 12:10:09 +0000 (+0200) Subject: Some style fixes + documentation X-Git-Tag: 1.1~1 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=8d64e1ba06f3b09346430f776a538a4640853a49;p=headphoned Some style fixes + documentation --- diff --git a/src/headphoned.c b/src/headphoned.c index 42f64da..0279237 100644 --- a/src/headphoned.c +++ b/src/headphoned.c @@ -1,3 +1,17 @@ +/** + * headphoned for the Nokia N8x0 + * + * The headphone daemon watches the state of the headphone + * plug (connected, disconnected) and carries out actions + * based on these events. + * + * Currently supported: + * * Send "pause" to the media player on disconnect + * * Maintain different volume settings for each state + * + * Copyright (c) 2009-10-21 Thomas Perl + **/ + #include #include #include @@ -13,8 +27,9 @@ #define MEDIA_SERVER_SRVC "com.nokia.osso_media_server" #define MEDIA_SERVER_PATH "/com/nokia/osso_media_server" #define MEDIA_SERVER_INTF "com.nokia.osso_media_server.music" -#define MEDIA_SERVER_METH "pause" +// Volume control is currently broken, as something is messing +// with the controls from outside this process in GConf.. //#define ENABLE_VOLUME_CONTROL #define ENABLE_PAUSE_ON_DISCONNECT @@ -34,7 +49,8 @@ on_volume_changed(GConfClient* client, guint gnxn_id, GConfEntry* entry, gpointer data) { Headphoned* headphoned = (Headphoned*)data; - headphoned->volume[headphoned->state] = gconf_value_get_int(entry->value); + headphoned->volume[headphoned->state] = + gconf_value_get_int(entry->value); } Headphoned* @@ -81,7 +97,7 @@ on_file_changed(GIOChannel* source, GIOCondition condition, gpointer data) MEDIA_SERVER_SRVC, MEDIA_SERVER_PATH, MEDIA_SERVER_INTF, - MEDIA_SERVER_METH, + "pause", NULL, DBUS_TYPE_INVALID); } @@ -93,8 +109,8 @@ on_file_changed(GIOChannel* source, GIOCondition condition, gpointer data) if (new_volume != volume) { gconf_client_set_int(headphoned->client, GCONF_VOLUME_CONTROL, new_volume, NULL); - gconf_client_suggest_sync(headphoned->client, NULL); - gconf_client_clear_cache(headphoned->client); + /*gconf_client_suggest_sync(headphoned->client, NULL); + gconf_client_clear_cache(headphoned->client);*/ } #endif headphoned->initial = FALSE;