]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
fixed local microphone device selection
authorJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sat, 10 Sep 2016 10:22:35 +0000 (10:22 +0000)
committerJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sat, 10 Sep 2016 10:22:35 +0000 (10:22 +0000)
Makefile
main.c
menu.c
new_protocol.c
radio.c
splash.c
toolbar.c

index 9cd3db8c4a1a18100cafa865f749ef0ed0a7423a..f34fa6808c6f17c4d7efa913fc5d6a909614d82b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -97,10 +97,9 @@ endif
 GTKINCLUDES=`pkg-config --cflags gtk+-3.0`
 GTKLIBS=`pkg-config --libs gtk+-3.0`
 
-AUDIO_OPTIONS=-D ALSA
 AUDIO_LIBS=-lasound
 
-OPTIONS=-g -D $(UNAME_N) $(GPIO_OPTIONS) $(LIMESDR_OPTIONS) $(FREEDV_OPTIONS) $(PSK_OPTIONS) -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) $(AUDIO_OPTIONS) -O3
+OPTIONS=-g -D $(UNAME_N) $(GPIO_OPTIONS) $(LIMESDR_OPTIONS) $(FREEDV_OPTIONS) $(PSK_OPTIONS) -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3
 
 LIBS=-lrt -lm -lwdsp -lpthread $(AUDIO_LIBS) -lpulse $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS)
 INCLUDES=$(GTKINCLUDES)
diff --git a/main.c b/main.c
index 78b366aa7c38fabc8beba4bf05c4c8aade527d6a..dad0605705a93a40146a911344d6f16a46f1602c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -569,7 +569,8 @@ fprintf(stderr,"selected radio=%p device=%d\n",radio,radio->device);
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title (GTK_WINDOW (window), "pihpsdr");
-  gtk_container_set_border_width (GTK_CONTAINER (window), 0);
+  gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER_ALWAYS);
+  gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
   g_signal_connect (window, "delete-event", G_CALLBACK (main_delete), NULL);
 
   fixed=gtk_fixed_new();
diff --git a/menu.c b/menu.c
index a8d2197facc90b5841697c0f39f6ed5b13829082..0fe4fc5bd501e476071c1d069d30d17396a7dd8d 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -197,7 +197,6 @@ static void local_audio_cb(GtkWidget *widget, gpointer data) {
 
 static void local_output_changed_cb(GtkWidget *widget, gpointer data) {
   n_selected_output_device=(int)(long)data;
-fprintf(stderr,"local_output_changed: %d\n",n_selected_output_device);
 
   if(local_audio) {
     audio_close_output();
@@ -220,7 +219,6 @@ static void local_microphone_cb(GtkWidget *widget, gpointer data) {
 
 static void local_input_changed_cb(GtkWidget *widget, gpointer data) {
   n_selected_input_device=(int)(long)data;
-fprintf(stderr,"local_input_changed: %d\n",n_selected_input_device);
   if(local_microphone) {
     audio_close_input();
     if(audio_open_input()==0) {
@@ -812,12 +810,12 @@ static gboolean menu_pressed_event_cb (GtkWidget *widget,
   }
 
   if(n_input_devices>0) {
-    GtkWidget *local_audio_b=gtk_check_button_new_with_label("Microphone Audio");
-    //gtk_widget_override_font(local_audio_b, pango_font_description_from_string("Arial 18"));
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (local_audio_b), local_audio);
-    gtk_widget_show(local_audio_b);
-    gtk_grid_attach(GTK_GRID(audio_grid),local_audio_b,2,0,1,1);
-    g_signal_connect(local_audio_b,"toggled",G_CALLBACK(local_input_changed_cb),NULL);
+    GtkWidget *local_microphone_b=gtk_check_button_new_with_label("Microphone Audio");
+    //gtk_widget_override_font(local_microphone_b, pango_font_description_from_string("Arial 18"));
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (local_microphone_b), local_microphone);
+    gtk_widget_show(local_microphone_b);
+    gtk_grid_attach(GTK_GRID(audio_grid),local_microphone_b,2,0,1,1);
+    g_signal_connect(local_microphone_b,"toggled",G_CALLBACK(local_microphone_cb),NULL);
  
     for(i=0;i<n_input_devices;i++) {
       GtkWidget *input;
@@ -829,7 +827,7 @@ static gboolean menu_pressed_event_cb (GtkWidget *widget,
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (input), n_selected_input_device==i);
       gtk_widget_show(input);
       gtk_grid_attach(GTK_GRID(audio_grid),input,2,i+1,1,1);
-      g_signal_connect(input,"pressed",G_CALLBACK(local_microphone_cb),(gpointer *)i);
+      g_signal_connect(input,"pressed",G_CALLBACK(local_input_changed_cb),(gpointer *)i);
     }
   }
 
index 7fe67e1684c5ead376a7d137b65cd1e2125392d7..443b4911fe58f48b4f2eb7f9de3332dcab1922bb 100644 (file)
@@ -294,7 +294,6 @@ static void new_protocol_high_priority(int run) {
     unsigned char buffer[1444];
     BAND *band=band_get_current_band();
 
-fprintf(stderr,"new_protocol_high_priority: run=%d\n", run);
     memset(buffer, 0, sizeof(buffer));
 
     buffer[0]=high_priority_sequence>>24;
@@ -348,8 +347,6 @@ fprintf(stderr,"new_protocol_high_priority: run=%d\n", run);
     
     buffer[345]=power&0xFF;
 
-fprintf(stderr,"power=%d\n",power);
-
     if(isTransmitting()) {
       buffer[1401]=band->OCtx;
       if(tune) {
diff --git a/radio.c b/radio.c
index f655b87b117c1f818f1b214f0d6cae12960d1588..2328d45de0970ebdadde2826b5432bfb3efb767d 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -155,7 +155,7 @@ int cw_keyer_hang_time=300; // ms
 int cw_keyer_sidetone_frequency=400; // Hz
 int cw_breakin=1; // 0=disabled 1=enabled
 
-int vfo_encoder_divisor=25;
+int vfo_encoder_divisor=15;
 
 int protocol;
 int device;
@@ -552,6 +552,7 @@ void radioRestoreState() {
     value=getProperty("rx_preamp");
     if(value) rx_preamp=atoi(value);
 #ifdef FREEDV
+    strcpy(freedv_tx_text_data,"NO TEXT DATA");
     value=getProperty("freedv_tx_text_data");
     if(value) strcpy(freedv_tx_text_data,value);
 #endif
index c39598903d1d41be8d67768ce11af585dea2f2de..59b48be455ccd698c1d1798c28b61395a741d949 100644 (file)
--- a/splash.c
+++ b/splash.c
@@ -54,7 +54,6 @@ void splash_show(char* image_name,int width,int height,int full_screen)
     gtk_window_fullscreen(GTK_WINDOW(splash_window));
   }
   gtk_widget_set_size_request(splash_window, width, height);
-  gtk_window_set_decorated(GTK_WINDOW(splash_window), FALSE);
   gtk_window_set_position(GTK_WINDOW(splash_window),GTK_WIN_POS_CENTER_ALWAYS);
   gtk_window_set_resizable(GTK_WINDOW(splash_window), FALSE);
 
index af550753f76accb03a17a0728632918f2eedbe05..95d87ba91c355ee06c4f0fcde570414ef069c70d 100644 (file)
--- a/toolbar.c
+++ b/toolbar.c
@@ -289,7 +289,6 @@ void bandstack_cb(GtkWidget *widget, gpointer data) {
 }
 
 void function_cb(GtkWidget *widget, gpointer data) {
-  fprintf(stderr,"function_cb\n");
   function=function==1?0:1;
   update_toolbar_labels();
   vfo_update(NULL);
@@ -990,7 +989,6 @@ void lock_cb(GtkWidget *widget, gpointer data) {
 }
 
 void mox_cb(GtkWidget *widget, gpointer data) {
-fprintf(stderr,"mox_cb\n");
   if(getTune()==1) {
     setTune(0);
   }
@@ -1002,21 +1000,17 @@ fprintf(stderr,"mox_cb\n");
   } else if(canTransmit() || tx_out_of_band) {
     setMox(1);
   }
-fprintf(stderr,"mox_cb: mox now %d\n",mox);
   vfo_update(NULL);
 }
 
 int ptt_update(void *data) {
-fprintf(stderr,"ptt_update\n");
   if(protocol==NEW_PROTOCOL || (mode!=modeCWU && mode!=modeCWL)) {
     mox_cb(NULL,NULL);
   }
-fprintf(stderr,"ptt_update: mox=%d ptt=%d tune=%d\n",mox,ptt,tune);
   return 0;
 }
 
 void tune_cb(GtkWidget *widget, gpointer data) {
-fprintf(stderr,"tune_cb\n");
   if(getMox()==1) {
     setMox(0);
   }
@@ -1025,14 +1019,12 @@ fprintf(stderr,"tune_cb\n");
   } else if(canTransmit() || tx_out_of_band) {
     setTune(1);
   }
-fprintf(stderr,"tune_cb: calling vfo_update\n");
   vfo_update(NULL);
 }
 
 void sim_band_cb(GtkWidget *widget, gpointer data) {
   BAND* band;
   BANDSTACK_ENTRY *entry;
-fprintf(stderr,"sim_band_cb\n");
   if(toolbar_dialog_buttons) {
     band_cb(widget,data);
   } else {
@@ -1081,7 +1073,6 @@ fprintf(stderr,"sim_band_cb\n");
 
 void sim_bandstack_cb(GtkWidget *widget, gpointer data) {
   BANDSTACK_ENTRY *entry;
-  fprintf(stderr,"sim_bandstack_cb\n");
   if(toolbar_dialog_buttons) {
     bandstack_cb(widget,data);
   } else {
@@ -1103,7 +1094,6 @@ void sim_mode_cb(GtkWidget *widget, gpointer data) {
   BAND* band;
   BANDSTACK_ENTRY *entry;
 
-fprintf(stderr,"sim_mode_cb\n");
   if(toolbar_dialog_buttons) {
     mode_cb(widget,data);
   } else {
@@ -1122,7 +1112,6 @@ fprintf(stderr,"sim_mode_cb\n");
     }
     setMode(entry->mode);
 
-    fprintf(stderr,"sim_mode_cb: entry->mode=%d entry->filter=%d\n",entry->mode,entry->filter);
     FILTER* band_filters=filters[entry->mode];
     FILTER* band_filter=&band_filters[entry->filter];
     setFilter(band_filter->low,band_filter->high);
@@ -1135,7 +1124,6 @@ void sim_filter_cb(GtkWidget *widget, gpointer data) {
   BAND* band;
   BANDSTACK_ENTRY *entry;
 
-fprintf(stderr,"sim_filter_cb\n");
   if(toolbar_dialog_buttons) {
     filter_cb(widget,data);
   } else {
@@ -1154,7 +1142,6 @@ fprintf(stderr,"sim_filter_cb\n");
       }
     }
 
-  fprintf(stderr,"sim_filter_cb: entry->mode=%d entry->filter=%d\n",entry->mode,entry->filter);
     FILTER* band_filters=filters[entry->mode];
     FILTER* band_filter=&band_filters[entry->filter];
     setFilter(band_filter->low,band_filter->high);
@@ -1165,7 +1152,6 @@ fprintf(stderr,"sim_filter_cb\n");
 }
 
 void sim_agc_cb(GtkWidget *widget, gpointer data) {
-  fprintf(stderr,"sim_agc_cb\n");
   if(toolbar_dialog_buttons) {
     agc_cb(widget,data);
   } else {
@@ -1186,7 +1172,6 @@ void sim_agc_cb(GtkWidget *widget, gpointer data) {
 }
 
 void sim_noise_cb(GtkWidget *widget, gpointer data) {
-  fprintf(stderr,"sim_noise_cb\n");
   if(toolbar_dialog_buttons) {
     noise_cb(widget,data);
   } else {
@@ -1230,7 +1215,6 @@ void sim_noise_cb(GtkWidget *widget, gpointer data) {
 }
 
 void sim_mox_cb(GtkWidget *widget, gpointer data) {
-  fprintf(stderr,"sim_pressed\n");
   if(function) {
     tune_cb((GtkWidget *)NULL, (gpointer)NULL);
   } else {
@@ -1240,7 +1224,6 @@ void sim_mox_cb(GtkWidget *widget, gpointer data) {
 }
 
 void sim_function_cb(GtkWidget *widget, gpointer data) {
-  fprintf(stderr,"sim_function_cb\n");
   function=function==1?0:1;
   update_toolbar_labels();
   vfo_update(NULL);