Mercurial > audlegacy-plugins
comparison src/bluetooth/bluetooth.c @ 2871:455e6e37feae
removed the warnings
| author | Paula Stanciu <paula.stanciu@gmail.com> |
|---|---|
| date | Thu, 07 Aug 2008 13:36:41 +0300 |
| parents | c3df7556d85a |
| children | a9917a9cde99 |
comparison
equal
deleted
inserted
replaced
| 2870:c3df7556d85a | 2871:455e6e37feae |
|---|---|
| 24 #include "gui.h" | 24 #include "gui.h" |
| 25 #include "scan_gui.h" | 25 #include "scan_gui.h" |
| 26 #include "agent.h" | 26 #include "agent.h" |
| 27 #include <audacious/plugin.h> | 27 #include <audacious/plugin.h> |
| 28 #define DEBUG 1 | 28 #define DEBUG 1 |
| 29 static gboolean plugin_active = FALSE,exiting=FALSE; | |
| 30 GList * current_device = NULL; | 29 GList * current_device = NULL; |
| 31 gint config = 0; | 30 gint config = 0; |
| 32 gint devices_no = 0; | 31 gint devices_no = 0; |
| 33 GStaticMutex mutex = G_STATIC_MUTEX_INIT; | 32 GStaticMutex mutex = G_STATIC_MUTEX_INIT; |
| 34 static gchar *current_address=NULL; | 33 static gchar *current_address=NULL; |
| 42 static void remote_name_updated(DBusGProxy *object, const char *address, char *name, gpointer user_data); | 41 static void remote_name_updated(DBusGProxy *object, const char *address, char *name, gpointer user_data); |
| 43 static void print_results(void); | 42 static void print_results(void); |
| 44 static void discovery_completed(DBusGProxy *object, gpointer user_data); | 43 static void discovery_completed(DBusGProxy *object, gpointer user_data); |
| 45 void discover_devices(void); | 44 void discover_devices(void); |
| 46 void disconnect_dbus_signals(void); | 45 void disconnect_dbus_signals(void); |
| 47 static void show_restart_dialog(void); | 46 /*static void show_restart_dialog(void); */ |
| 48 static void remove_bonding(); | 47 static void remove_bonding(); |
| 49 GeneralPlugin bluetooth_gp = | 48 GeneralPlugin bluetooth_gp = |
| 50 { | 49 { |
| 51 .description = "Bluetooth audio support", | 50 .description = "Bluetooth audio support", |
| 52 .init = bluetooth_init, | 51 .init = bluetooth_init, |
| 153 //I will have to enable the audio service if necessary | 152 //I will have to enable the audio service if necessary |
| 154 | 153 |
| 155 dbus_g_object_register_marshaller(marshal_VOID__STRING_UINT_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); | 154 dbus_g_object_register_marshaller(marshal_VOID__STRING_UINT_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); |
| 156 run_agents(); | 155 run_agents(); |
| 157 dbus_g_proxy_call(obj,"CreateBonding",NULL,G_TYPE_STRING,current_address,G_TYPE_INVALID,G_TYPE_INVALID); | 156 dbus_g_proxy_call(obj,"CreateBonding",NULL,G_TYPE_STRING,current_address,G_TYPE_INVALID,G_TYPE_INVALID); |
| 158 | 157 return NULL; |
| 159 } | 158 } |
| 160 void connect_call(void) | 159 void connect_call(void) |
| 161 { | 160 { |
| 162 current_address = g_strdup(((DeviceData*)(selected_dev->data))->address); | 161 current_address = g_strdup(((DeviceData*)(selected_dev->data))->address); |
| 163 connect_th = g_thread_create((GThreadFunc)connect_call_th,NULL,TRUE,NULL) ; | 162 connect_th = g_thread_create((GThreadFunc)connect_call_th,NULL,TRUE,NULL) ; |
| 172 | 171 |
| 173 FILE *file; | 172 FILE *file; |
| 174 FILE *temp_file; | 173 FILE *temp_file; |
| 175 gint prev=0; | 174 gint prev=0; |
| 176 char line[128]; | 175 char line[128]; |
| 177 gchar *home; | 176 const gchar *home; |
| 178 gchar *device_line; | 177 gchar *device_line; |
| 179 gchar *file_name=""; | 178 gchar *file_name=""; |
| 180 gchar *temp_file_name; | 179 gchar *temp_file_name; |
| 181 int ret = EOF+1; | |
| 182 home = g_get_home_dir(); | 180 home = g_get_home_dir(); |
| 183 file_name = g_strconcat(home,"/.asoundrc",NULL); | 181 file_name = g_strconcat(home,"/.asoundrc",NULL); |
| 184 temp_file_name = g_strconcat(home,"/temp_bt",NULL); | 182 temp_file_name = g_strconcat(home,"/temp_bt",NULL); |
| 185 file = fopen(file_name,"r"); | 183 file = fopen(file_name,"r"); |
| 186 temp_file = fopen(temp_file_name,"w"); | 184 temp_file = fopen(temp_file_name,"w"); |
| 227 audacious_drct_stop(); | 225 audacious_drct_stop(); |
| 228 audacious_drct_play(); | 226 audacious_drct_play(); |
| 229 | 227 |
| 230 | 228 |
| 231 } | 229 } |
| 232 static void show_restart_dialog() | 230 /*static void show_restart_dialog() |
| 233 { | 231 { |
| 234 static GtkWidget *window = NULL; | 232 static GtkWidget *window = NULL; |
| 235 GtkWidget *dialog; | 233 GtkWidget *dialog; |
| 236 dialog = gtk_message_dialog_new (GTK_WINDOW (window), | 234 dialog = gtk_message_dialog_new (GTK_WINDOW (window), |
| 237 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, | 235 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, |
| 239 GTK_BUTTONS_OK, | 237 GTK_BUTTONS_OK, |
| 240 "Please restart the player to apply the bluetooth audio settings!"); | 238 "Please restart the player to apply the bluetooth audio settings!"); |
| 241 gtk_dialog_run (GTK_DIALOG (dialog)); | 239 gtk_dialog_run (GTK_DIALOG (dialog)); |
| 242 gtk_widget_destroy (dialog); | 240 gtk_widget_destroy (dialog); |
| 243 } | 241 } |
| 244 | 242 */ |
| 245 static void remote_device_found(DBusGProxy *object, char *address, const unsigned int class, const int rssi, gpointer user_data) | 243 static void remote_device_found(DBusGProxy *object, char *address, const unsigned int class, const int rssi, gpointer user_data) |
| 246 { | 244 { |
| 247 int found_in_list=FALSE; | 245 int found_in_list=FALSE; |
| 248 g_static_mutex_lock(&mutex); | 246 g_static_mutex_lock(&mutex); |
| 249 current_device = audio_devices; | 247 current_device = audio_devices; |
