/**
- * headphoned for the Nokia N8x0
+ * headphoned for the Nokia N8x0 and the N900
*
* The headphone daemon watches the state of the headphone
* plug (connected, disconnected) and carries out actions
* * Send "pause" to the media player on disconnect
* * Maintain different volume settings for each state
*
- * Copyright (c) 2009-10-21 Thomas Perl <thpinfo.com>
+ * Initial working version: 2009-10-21
+ *
+ * Copyright (c) 2009-2010 Thomas Perl <thpinfo.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this package; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**/
#include <stdio.h>
#include <dbus/dbus.h>
#include <fcntl.h>
+#include "config.h"
+
#define STATE_FILE "/sys/devices/platform/gpio-switch/headphone/state"
#define STATE_CONNECTED_STR "connected"
#define STATE_DISCONNECTED_STR "disconnected"
#define GCONF_VOLUME_CONTROL "/apps/osso/sound/master_volume"
-#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"
+#ifdef DIABLO
+# 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"
+#else
+# define MEDIA_SERVER_SRVC "com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer"
+# define MEDIA_SERVER_PATH "/com/nokia/mafw/renderer/gstrenderer"
+# define MEDIA_SERVER_INTF "com.nokia.mafw.renderer"
+#endif
#define PANUCCI_SRVC "org.panucci.panucciInterface"
#define PANUCCI_PATH "/panucciInterface"
#define MPLAYER_FIFO "/etc/headphoned/mplayer-input"
-// 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
-
-
enum { STATE_UNKNOWN, STATE_CONNECTED, STATE_DISCONNECTED, STATE_COUNT };
typedef struct {