# HG changeset patch # User Paula Stanciu # Date 1211048569 -10800 # Node ID 6fd8ca4b7b17949c43df940cfdf5c9dc7a571d36 # Parent 12aa69e560b28b791dc71c15bee52908d4eb36d9 add bluetooth plugin diff -r 12aa69e560b2 -r 6fd8ca4b7b17 configure.ac --- a/configure.ac Tue May 13 20:10:57 2008 +0200 +++ b/configure.ac Sat May 17 21:22:49 2008 +0300 @@ -1372,6 +1372,26 @@ AC_SUBST(MTP_LIBS) AC_SUBST(MTP_CFLAGS) +dnl *** Bluetooth audio suport + +AC_ARG_ENABLE(bluetooth, +[ --disable-bluetooth disable bluetooth audio support. (default=enabled)], +[have_bluetooth=$enableval], +[have_bluetooth=yes]) + +if test "x$have_bluetooth" = "xyes"; then + have_bluetooth=yes + PKG_CHECK_MODULES(BLUEZ, [bluez >= 2.22], + [GENERAL_PLUGINS="$GENERAL_PLUGINS bluetooth" ], [have_bluetooth="no"]) + BLUEZ_LIBS=`pkg-config --libs bluez` + BLUEZ_CFLAGS=`pkg-config --cflags bluez` +else + have_bluetooth=no + AC_MSG_RESULT([*** bluetooth audio suport plugin disabled by request ***]) +fi +AC_SUBST(BLUEZ_LIBS) +AC_SUBST(BLUEZ_CFLAGS) + dnl *** libparanormal checks AC_ARG_ENABLE(paranormal, @@ -1687,6 +1707,7 @@ echo " LIRC: $have_lirc" echo " AudioScrobbler Client: $scrobbler" echo " Upload to MTP device: $have_mtp_up" +echo " Bluetooth audio suport: $have_bluetooth" echo " MacOS Dock Album Art plugin: $have_dockalbumart" echo echo " Effect" diff -r 12aa69e560b2 -r 6fd8ca4b7b17 src/bluetooth/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/bluetooth/Makefile Sat May 17 21:22:49 2008 +0300 @@ -0,0 +1,11 @@ +PLUGIN = bluetooth${PLUGIN_SUFFIX} + +SRCS = bluetooth.c gui.c +include ../../buildsys.mk +include ../../extra.mk + +plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR} + +CFLAGS += ${PLUGIN_CFLAGS} +CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. ${BLUEZ_CFLAGS} +LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${BLUEZ_LIBS} diff -r 12aa69e560b2 -r 6fd8ca4b7b17 src/bluetooth/bluetooth.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/bluetooth/bluetooth.c Sat May 17 21:22:49 2008 +0300 @@ -0,0 +1,47 @@ +#include "bluetooth.h" +#define DEBUG 1 +static gboolean plugin_active = FALSE,exiting=FALSE; + +void bluetooth_init ( void ); +void bluetooth_cleanup ( void ); +void bt_cfg(void); +void bt_about(void); +GeneralPlugin bluetooth_gp = +{ + .description = "Bluetooth audio suport", + .init = bluetooth_init, + .about = bt_about, + .configure = bt_cfg, + .cleanup = bluetooth_cleanup +}; +GeneralPlugin *bluetooth_gplist[] = { &bluetooth_gp, NULL }; +DECLARE_PLUGIN(bluetooth_gp, NULL, NULL, NULL, NULL, NULL, bluetooth_gplist, NULL, NULL) + +void bluetooth_init ( void ) +{ + +} + +void bluetooth_cleanup ( void ) +{ + +} +/*void bt_cfg( void ) +{ + +} +*/ +void bt_about( void ) +{ + +} + + +void refresh_call(void){ + printf("refresh function called\n"); +} + +void connect_call(void){ + printf("connect function \n"); +} + diff -r 12aa69e560b2 -r 6fd8ca4b7b17 src/bluetooth/bluetooth.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/bluetooth/bluetooth.h Sat May 17 21:22:49 2008 +0300 @@ -0,0 +1,12 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include "gui.h" +void refresh_call(void); +void connect_call(void); diff -r 12aa69e560b2 -r 6fd8ca4b7b17 src/bluetooth/gui.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/bluetooth/gui.c Sat May 17 21:22:49 2008 +0300 @@ -0,0 +1,224 @@ +#include "gui.h" +#include "bluetooth.h" +#include +#include + +static GtkWidget *window = NULL; +static GtkTreeModel *model; +GtkWidget *mainbox; +GtkWidget *hbox_top; +GtkWidget *hbox_bottom; +GtkWidget *box_about; +GtkWidget *box_about_left; +GtkWidget *box_about_right; +GtkWidget *headset_frame; +GtkWidget *about_frame; +GtkWidget *refresh; +GtkWidget *connect_button; +GtkWidget *close_button; +GtkWidget *treeview; +GtkWidget *label_p; +GtkWidget *label_m; +GtkWidget *label_a; +GtkWidget *label_prod; +GtkWidget *label_model; +GtkWidget *label_address; + + +typedef struct +{ + gchar *producer; + gchar *model; +}Headset; + +enum{ + COLUMN_PRODUCER, + COLUMN_MODEL, + NUM_COLUMNS +}; + +static Headset test_data[]= +{ + {"Motorola", "S9"}, + {"Nokia", "BH-503"}, + {"Blueant","Stereo X5"} +}; + +static GtkTreeModel * create_model(void) +{ + gint i = 0; + GtkListStore *store; + GtkTreeIter iter; + /* create list store */ + store = gtk_list_store_new(NUM_COLUMNS, + G_TYPE_STRING, + G_TYPE_STRING); + /* add data to the list store */ + for(i = 0;i