From: John Melton - G0ORX/N6LYT Date: Sat, 10 Sep 2016 10:22:35 +0000 (+0000) Subject: fixed local microphone device selection X-Git-Url: https://git.rkrishnan.org/uri/%3C?a=commitdiff_plain;h=e246094ff694d61f182b44f3b540638f8ebd7055;p=pihpsdr.git fixed local microphone device selection --- diff --git a/Makefile b/Makefile index 9cd3db8..f34fa68 100644 --- 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 78b366a..dad0605 100644 --- 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 a8d2197..0fe4fc5 100644 --- 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>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 f655b87..2328d45 100644 --- 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 diff --git a/splash.c b/splash.c index c395989..59b48be 100644 --- 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); diff --git a/toolbar.c b/toolbar.c index af55075..95d87ba 100644 --- 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);