From: c vw Date: Tue, 6 Aug 2019 17:22:11 +0000 (+0200) Subject: some corrections X-Git-Url: https://git.rkrishnan.org/%5B/listings/flags/status?a=commitdiff_plain;h=24f4e18811bfafec314aff8b41bdcecbc358d89f;p=pihpsdr.git some corrections --- diff --git a/MacOS/Info.plist b/MacOS/Info.plist index 09c46c3..f077b42 100644 --- a/MacOS/Info.plist +++ b/MacOS/Info.plist @@ -2,7 +2,7 @@ - CFBundleIdentifier + CFBundleIdentifier piHPSDR CFBundleExecutable pihpsdr @@ -10,9 +10,11 @@ hpsdr.icns CFBundlePackageType APPL - CFBundleSignature + CFBundleSignature BNDL - NSMicrophoneUsageDescription - Allow for using Sound input devices + NSMicrophoneUsageDescription + Allow for using Sound input devices + CFBundleInfoDictionaryVersion + 6.0 diff --git a/MacOS/hpsdr.png b/MacOS/hpsdr.png index ea96fd7..8ad5dd2 100755 Binary files a/MacOS/hpsdr.png and b/MacOS/hpsdr.png differ diff --git a/MacOS/pihpsdr.sh b/MacOS/pihpsdr.sh index 6008ba4..53ee295 100755 --- a/MacOS/pihpsdr.sh +++ b/MacOS/pihpsdr.sh @@ -14,9 +14,17 @@ this=`dirname $0` +# +# If the things below fail for some reason, stay in $HOME +# cd $HOME -mkdir .pihpsdr -cd .pihpsdr # if this fails, stay in $HOME + +localdir="$HOME/Library/Application Support/piHPSDR" + +echo $localdir > $HOME/test.out + +mkdir -p "$localdir" +cd "$localdir" cp $this/../Resources/hpsdr.png . exec $this/pihpsdr-bin diff --git a/discovery.c b/discovery.c index da5b866..5de6a0a 100644 --- a/discovery.c +++ b/discovery.c @@ -317,13 +317,13 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name); } GtkWidget *label=gtk_label_new(text); - gtk_widget_override_font(label, pango_font_description_from_string("FreeMono 12")); + gtk_widget_override_font(label, pango_font_description_from_string("Sans 11")); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_show(label); gtk_grid_attach(GTK_GRID(grid),label,0,i,3,1); GtkWidget *start_button=gtk_button_new_with_label("Start"); - gtk_widget_override_font(start_button, pango_font_description_from_string("FreeMono 18")); + gtk_widget_override_font(start_button, pango_font_description_from_string("Sans 16")); gtk_widget_show(start_button); gtk_grid_attach(GTK_GRID(grid),start_button,3,i,1,1); g_signal_connect(start_button,"button_press_event",G_CALLBACK(start_cb),(gpointer)d); @@ -347,8 +347,7 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name); gtk_widget_set_sensitive(start_button, FALSE); } else { apps_combobox[i] = gtk_combo_box_text_new(); - gtk_widget_override_font(apps_combobox[i], - pango_font_description_from_string("FreeMono 12")); + gtk_widget_override_font(apps_combobox[i], pango_font_description_from_string("Sans 11")); // We want the default selection priority for the STEMlab app to be // RP-Trx > HAMlab-Trx > Pavel-Trx > Pavel-Rx, so we add in decreasing order and // always set the newly added entry to be active. diff --git a/ext.c b/ext.c index fe33284..1379c5c 100644 --- a/ext.c +++ b/ext.c @@ -197,6 +197,11 @@ int ext_set_drive(void *data) { return 0; } +int ext_set_compression(void *data) { + set_compression(transmitter); + return 0; +} + int ext_vfo_a_swap_b(void *data) { vfo_a_swap_b(); return 0; diff --git a/ext.h b/ext.h index 98ae352..97ab829 100644 --- a/ext.h +++ b/ext.h @@ -66,3 +66,4 @@ int ext_vfo_b_to_a(void *data); int ext_update_att_preamp(void *data); int ext_set_alex_attenuation(void *data); int ext_set_attenuation_value(void *data); +int ext_set_compression(void *data); diff --git a/hpsdrsim.c b/hpsdrsim.c index 97e3820..90fb695 100644 --- a/hpsdrsim.c +++ b/hpsdrsim.c @@ -167,28 +167,6 @@ static double last_i_sample=0.0; static double last_q_sample=0.0; static int txptr=0; -// -// Unfortunately, the code number of the gear -// differes in old and new protocol -// - -#define DEVICE_ATLAS 0 -#define DEVICE_HERMES 1 -#define DEVICE_HERMES2 2 -#define DEVICE_ANGELIA 4 -#define DEVICE_ORION 5 -#define DEVICE_HERMES_LITE 6 -#define DEVICE_ORION2 10 -#define DEVICE_C25 100 - -#define NEW_DEVICE_ATLAS 0 -#define NEW_DEVICE_HERMES 1 -#define NEW_DEVICE_HERMES2 2 -#define NEW_DEVICE_ANGELIA 3 -#define NEW_DEVICE_ORION 4 -#define NEW_DEVICE_ORION2 5 -#define NEW_DEVICE_HERMES_LITE 6 - int main(int argc, char *argv[]) { int i, j, size; diff --git a/hpsdrsim.h b/hpsdrsim.h index 79e6e56..e89b041 100644 --- a/hpsdrsim.h +++ b/hpsdrsim.h @@ -11,6 +11,28 @@ // /////////////////////////////////////////////////////////////////////////// +// +// Unfortunately, the code number of the gear +// differes in old and new protocol +// + +#define DEVICE_ATLAS 0 +#define DEVICE_HERMES 1 +#define DEVICE_HERMES2 2 +#define DEVICE_ANGELIA 4 +#define DEVICE_ORION 5 +#define DEVICE_HERMES_LITE 6 +#define DEVICE_ORION2 10 +#define DEVICE_C25 100 + +#define NEW_DEVICE_ATLAS 0 +#define NEW_DEVICE_HERMES 1 +#define NEW_DEVICE_HERMES2 2 +#define NEW_DEVICE_ANGELIA 3 +#define NEW_DEVICE_ORION 4 +#define NEW_DEVICE_ORION2 5 +#define NEW_DEVICE_HERMES_LITE 6 + EXTERN int OLDDEVICE; EXTERN int NEWDEVICE; @@ -94,6 +116,8 @@ extern int clock_nanosleep(clockid_t __clock_id, int __flags, // // Constants defining the distortion of the TX signal +// These give about -24 dBc at full drive, that is +// about the value a reasonable amp gives. // #define IM3a 0.60 #define IM3b 0.20 diff --git a/meter.c b/meter.c index 137eb05..e154ad5 100644 --- a/meter.c +++ b/meter.c @@ -237,6 +237,13 @@ if(analog_meter) { if (rx->preamp) level -= 18.0; if (rx->dither) level -= 18.0; } + // + // Assume that alex_attenuation is set correctly if we have an ALEX board + // + if (filter_board == ALEX && rx->adc == 0) { + level += 10*rx->alex_attenuation; + } + offset=210.0; int i; @@ -543,6 +550,14 @@ if(analog_meter) { if (rx->preamp) level -= 18.0; if (rx->dither) level -= 18.0; } + + // + // Assume that alex_attenuation is set correctly if we have an ALEX board + // + if (filter_board == ALEX && rx->adc == 0) { + level += 10*rx->alex_attenuation; + } + if(meter_width>=114) { //int db=meter_width/114; // S9+60 (9*6)+60 //if(db>2) db=2; diff --git a/midi3.c b/midi3.c index 3fd2f94..7e035c7 100644 --- a/midi3.c +++ b/midi3.c @@ -214,10 +214,12 @@ void DoTheMidi(enum MIDIaction action, enum MIDItype type, int val) { case ATT: // Key for ALEX attenuator, wheel or knob for slider switch(type) { case MIDI_KEY: - new=active_receiver->alex_attenuation + 1; - if (new > 3) new=0; - g_idle_add(ext_set_alex_attenuation, (gpointer)(uintptr_t)new); - g_idle_add(ext_update_att_preamp, NULL); + if (filter_board == ALEX && active_receiver->adc == 0) { + new=active_receiver->alex_attenuation + 1; + if (new > 3) new=0; + g_idle_add(ext_set_alex_attenuation, (gpointer)(uintptr_t)new); + g_idle_add(ext_update_att_preamp, NULL); + } break; case MIDI_WHEEL: case MIDI_KNOB: @@ -250,7 +252,7 @@ void DoTheMidi(enum MIDIaction action, enum MIDItype type, int val) { transmitter->compressor_level=dnew; if (dnew < 0.5) transmitter->compressor=0; if (dnew > 0.5) transmitter->compressor=1; - g_idle_add(ext_vfo_update, NULL); + g_idle_add(ext_set_compression, NULL); break; case NB: // cycle through NoiseBlanker settings diff --git a/newhpsdrsim.c b/newhpsdrsim.c index bc4eaa1..ba72616 100644 --- a/newhpsdrsim.c +++ b/newhpsdrsim.c @@ -319,6 +319,7 @@ void *ddc_specific_thread(void *data) { if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { perror("***** ERROR: RX specific: bind"); + close(sock); return NULL; } @@ -437,6 +438,7 @@ void *duc_specific_thread(void *data) { if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { perror("***** ERROR: TXspec: bind"); + close(sock); return NULL; } @@ -548,6 +550,7 @@ void *highprio_thread(void *data) { if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { perror("***** ERROR: HP: bind"); + close(sock); return NULL; } @@ -702,9 +705,14 @@ void *highprio_thread(void *data) { rc=buffer[1443]; if (rc != stepatt0) { stepatt0=rc; - rxatt0_dbl=pow(10.0, -0.05*stepatt0); fprintf(stderr,"HP: StepAtt0 = %d\n", stepatt0); } + // rxatt0 depends both on ALEX att and Step Att, so re-calc. it each time + if (NEWDEVICE == NEW_DEVICE_ORION2) { + rxatt0_dbl=pow(10.0, -0.05*stepatt0); + } else { + rxatt0_dbl=pow(10.0, -0.05*(stepatt0+10*alex0[14]+20*alex0[13])); + } } return NULL; } @@ -804,7 +812,7 @@ void *rx_thread(void *data) { wait=238000000L/rxrate[myddc]; // time for these samples in nano-secs } // - // ADC0 RX: noise + 800Hz signal at -100 dBm + // ADC0 RX: noise + 800Hz signal at -73 dBm // ADC0 TX: noise + distorted TX signal // ADC1 RX: noise // ADC1 TX: HERMES only: original TX signal @@ -859,8 +867,8 @@ void *rx_thread(void *data) { i1sample = irsample * 0.2899; q1sample = qrsample * 0.2899; } else if (myadc == 0) { - i0sample += toneItab[tonept] * 0.00001 * rxatt0_dbl; - q0sample += toneQtab[tonept] * 0.00001 * rxatt0_dbl; + i0sample += toneItab[tonept] * 0.0002239 * rxatt0_dbl; + q0sample += toneQtab[tonept] * 0.0002239 * rxatt0_dbl; tonept += decimation; if (tonept >= LENTONE) tonept=0; } if (diversity && !sync && myadc == 0) { @@ -1026,6 +1034,7 @@ void *tx_thread(void * data) { } txlevel=sum * txdrv_dbl * txdrv_dbl * 0.0041667; } + close(sock); return NULL; } diff --git a/ps_menu.c b/ps_menu.c index fb80d26..acd90ad 100644 --- a/ps_menu.c +++ b/ps_menu.c @@ -306,7 +306,9 @@ static void resume_cb(GtkWidget *widget, gpointer data) { if(transmitter->auto_on) { transmitter->attenuation=0; } - SetPSControl(transmitter->id, 0, 0, 1, 0); + if (transmitter->puresignal) { + SetPSControl(transmitter->id, 0, 0, 1, 0); + } } static void feedback_cb(GtkWidget *widget, gpointer data) { @@ -320,7 +322,9 @@ static void feedback_cb(GtkWidget *widget, gpointer data) { } static void reset_cb(GtkWidget *widget, gpointer data) { - SetPSControl(transmitter->id, 1, 0, 0, 0); + if (transmitter->puresignal) { + SetPSControl(transmitter->id, 1, 0, 0, 0); + } } static void twotone_cb(GtkWidget *widget, gpointer data) { diff --git a/radio.c b/radio.c index d4acf84..94922ba 100644 --- a/radio.c +++ b/radio.c @@ -1147,6 +1147,15 @@ void set_alex_tx_antenna(int v) { } } +// +// There is an error here. +// The alex att should not be associated with a receiver, +// but with an ADC. *all* receivers bound to that ADC +// will experience the same attenuation. +// +// This means, alex_attenuation should not be stored in thre +// receiver, but separately (as is the case with adc_attenuation). +// void set_alex_attenuation(int v) { if(active_receiver->id==0) { active_receiver->alex_attenuation=v; diff --git a/rx_menu.c b/rx_menu.c index 6ac0d1f..66d262c 100644 --- a/rx_menu.c +++ b/rx_menu.c @@ -250,52 +250,45 @@ void rx_menu(GtkWidget *parent) { // The CHARLY25 board (with RedPitaya) has no support for dither or random, // so those are left out. For Charly25, PreAmps and Alex Attenuator are controlled via // the sliders menu. - // On SDRs other than CHARLY25, preamps or Alex attenuators may be present or not, and we - // do not try to find out whether they are. This would overload the code, and we then - // also must have a menu to check e.g. which ANAN model is actually present. - // Instead, we offer these checkboxes in either case. // - // NOTE: Preamps are not present on most current HPSDR models, and ALEX attenuators - // are not present e.g. in ANAN-7000. + // Preamps are not switchable on all SDR hardware I know of, so this is commented out + // + // We assume Alex attenuators are present if we have an ALEX board and no Orion2 + // (ANAN-7000/8000 do not have these), and if the RX is fed by the first ADC. // if (filter_board != CHARLY25) { - switch(protocol) { - case ORIGINAL_PROTOCOL: - case NEW_PROTOCOL: - { - GtkWidget *dither_b=gtk_check_button_new_with_label("Dither"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dither_b), active_receiver->dither); - gtk_grid_attach(GTK_GRID(grid),dither_b,x,2,1,1); - g_signal_connect(dither_b,"toggled",G_CALLBACK(dither_cb),NULL); - - GtkWidget *random_b=gtk_check_button_new_with_label("Random"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (random_b), active_receiver->random); - gtk_grid_attach(GTK_GRID(grid),random_b,x,3,1,1); - g_signal_connect(random_b,"toggled",G_CALLBACK(random_cb),NULL); - - GtkWidget *preamp_b=gtk_check_button_new_with_label("Preamp"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (preamp_b), active_receiver->preamp); - gtk_grid_attach(GTK_GRID(grid),preamp_b,x,4,1,1); - g_signal_connect(preamp_b,"toggled",G_CALLBACK(preamp_cb),NULL); - - GtkWidget *alex_att_label=gtk_label_new("Alex Attenuator"); - gtk_grid_attach(GTK_GRID(grid), alex_att_label, x, 5, 1, 1); - GtkWidget *last_alex_att_b = NULL; - for (i = 0; i <= 3; i++) { - gchar button_text[] = "xx dB"; - sprintf(button_text, "%d dB", i*10); - GtkWidget *alex_att_b=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(last_alex_att_b), button_text); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(alex_att_b), active_receiver->alex_attenuation == i); - gtk_grid_attach(GTK_GRID(grid), alex_att_b, x, 6 + i, 1, 1); - g_signal_connect(alex_att_b, "toggled", G_CALLBACK(alex_att_cb), (gpointer) (long) i); - last_alex_att_b = alex_att_b; - } + GtkWidget *dither_b=gtk_check_button_new_with_label("Dither"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dither_b), active_receiver->dither); + gtk_grid_attach(GTK_GRID(grid),dither_b,x,2,1,1); + g_signal_connect(dither_b,"toggled",G_CALLBACK(dither_cb),NULL); + + GtkWidget *random_b=gtk_check_button_new_with_label("Random"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (random_b), active_receiver->random); + gtk_grid_attach(GTK_GRID(grid),random_b,x,3,1,1); + g_signal_connect(random_b,"toggled",G_CALLBACK(random_cb),NULL); + + //GtkWidget *preamp_b=gtk_check_button_new_with_label("Preamp"); + //gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (preamp_b), active_receiver->preamp); + //gtk_grid_attach(GTK_GRID(grid),preamp_b,x,4,1,1); + //g_signal_connect(preamp_b,"toggled",G_CALLBACK(preamp_cb),NULL); + + if (filter_board == ALEX && active_receiver->adc == 0 + && ((protocol==ORIGINAL_PROTOCOL && device != DEVICE_ORION2) || (protocol==NEW_PROTOCOL && device != NEW_DEVICE_ORION2))) { + + GtkWidget *alex_att_label=gtk_label_new("Alex Attenuator"); + gtk_grid_attach(GTK_GRID(grid), alex_att_label, x, 5, 1, 1); + GtkWidget *last_alex_att_b = NULL; + for (i = 0; i <= 3; i++) { + gchar button_text[] = "xx dB"; + sprintf(button_text, "%d dB", i*10); + GtkWidget *alex_att_b=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(last_alex_att_b), button_text); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(alex_att_b), active_receiver->alex_attenuation == i); + gtk_grid_attach(GTK_GRID(grid), alex_att_b, x, 6 + i, 1, 1); + g_signal_connect(alex_att_b, "toggled", G_CALLBACK(alex_att_cb), (gpointer) (long) i); + last_alex_att_b = alex_att_b; } - x++; - break; - default: - break; } + x++; } // If there is more than one ADC, let the user associate an ADC diff --git a/rx_panadapter.c b/rx_panadapter.c index 7b91d92..ebad2a9 100644 --- a/rx_panadapter.c +++ b/rx_panadapter.c @@ -294,11 +294,13 @@ void rx_panadapter_update(RECEIVER *rx) { GetRXAAGCThresh(rx->id, &thresh, 4096.0, (double)rx->sample_rate); double knee_y=thresh+(double)adc_attenuation[rx->adc]; + if (filter_board == ALEX && rx->adc == 0) knee_y += (double)(10*rx->alex_attenuation); knee_y = floor((rx->panadapter_high - knee_y) * (double) display_height / (rx->panadapter_high - rx->panadapter_low)); double hang_y=hang+(double)adc_attenuation[rx->adc]; + if (filter_board == ALEX && rx->adc == 0) hang_y += (double)(10*rx->alex_attenuation); hang_y = floor((rx->panadapter_high - hang_y) * (double) display_height / (rx->panadapter_high - rx->panadapter_low)); @@ -353,12 +355,15 @@ void rx_panadapter_update(RECEIVER *rx) { samples[display_width-1]=-200.0; s1=(double)samples[0]+(double)adc_attenuation[rx->adc]; + if (filter_board == ALEX && rx->adc == 0) s1 += (double)(10*rx->alex_attenuation); + s1 = floor((rx->panadapter_high - s1) * (double) display_height / (rx->panadapter_high - rx->panadapter_low)); cairo_move_to(cr, 0.0, s1); for(i=1;iadc]; + if (filter_board == ALEX && rx->adc == 0) s2 += (double)(10*rx->alex_attenuation); s2 = floor((rx->panadapter_high - s2) * (double) display_height / (rx->panadapter_high - rx->panadapter_low)); diff --git a/sliders.c b/sliders.c index d1b7a1c..df7c384 100644 --- a/sliders.c +++ b/sliders.c @@ -191,7 +191,7 @@ void update_att_preamp(void) { // We should also set the attenuation for use in meter.c if (filter_board == CHARLY25) { char id[] = "x"; - if (active_receiver->id != 0) { + if (active_receiver->adc != 0) { active_receiver->alex_attenuation=0; active_receiver->preamp=0; active_receiver->dither=0; @@ -229,7 +229,7 @@ static gboolean load_att_type_cb(gpointer data) { static void c25_att_combobox_changed(GtkWidget *widget, gpointer data) { int val = atoi(gtk_combo_box_get_active_id(GTK_COMBO_BOX(widget))); - if (active_receiver->id == 0) { + if (active_receiver->adc == 0) { // this button is only valid for the first receiver // store attenuation, such that in meter.c the correct level is displayed adc_attenuation[active_receiver->adc] = 12*val; @@ -448,6 +448,7 @@ void set_drive(double value) { scale_dialog=gtk_dialog_new_with_buttons("Drive",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL); GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog)); drive_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.00); + //gtk_widget_override_font(drive_scale, pango_font_description_from_string("Sans 10")); gtk_widget_set_size_request (drive_scale, 400, 30); gtk_range_set_value (GTK_RANGE(drive_scale),value); gtk_widget_show(drive_scale); @@ -485,17 +486,25 @@ static void squelch_enable_cb(GtkWidget *widget, gpointer data) { static void compressor_value_changed_cb(GtkWidget *widget, gpointer data) { transmitter_set_compressor_level(transmitter,gtk_range_get_value(GTK_RANGE(widget))); + // This value is now also reflected in the VFO panel + g_idle_add(ext_vfo_update, NULL); + } static void compressor_enable_cb(GtkWidget *widget, gpointer data) { transmitter_set_compressor(transmitter,gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); + // This value is now also reflected in the VFO panel + g_idle_add(ext_vfo_update, NULL); + } void set_squelch() { setSquelch(active_receiver); +#ifndef COMPRESSION_SLIDER if(display_sliders) { gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch); } else { +#endif if(scale_status!=SQUELCH) { if(scale_status!=NONE) { g_source_remove(scale_timer); @@ -508,6 +517,7 @@ void set_squelch() { scale_dialog=gtk_dialog_new_with_buttons("Squelch",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL); GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog)); squelch_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.00); + //gtk_widget_override_font(squelch_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch); gtk_widget_set_size_request (squelch_scale, 400, 30); gtk_widget_show(squelch_scale); @@ -519,13 +529,17 @@ void set_squelch() { gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); } +#ifndef COMPRESSION_SLIDER } +#endif } void set_compression(TRANSMITTER* tx) { -// if(display_sliders) { -// gtk_range_set_value (GTK_RANGE(comp_scale),tx->compressor_level); -// } else { +#ifdef COMPRESSION_SLIDER + if(display_sliders) { + gtk_range_set_value (GTK_RANGE(comp_scale),tx->compressor_level); + } else { +#endif if(scale_status!=COMP) { if(scale_status!=NONE) { g_source_remove(scale_timer); @@ -538,6 +552,7 @@ void set_compression(TRANSMITTER* tx) { scale_dialog=gtk_dialog_new_with_buttons("COMP",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL); GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog)); comp_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 20.0, 1.00); + //gtk_widget_override_font(comp_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(comp_scale),tx->compressor_level); gtk_widget_set_size_request (comp_scale, 400, 30); gtk_widget_show(comp_scale); @@ -549,7 +564,11 @@ void set_compression(TRANSMITTER* tx) { gtk_range_set_value (GTK_RANGE(comp_scale),tx->compressor_level); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); } - //} +#ifdef COMPRESSION_SLIDER + } +#endif + // Now we are also displaying the TX compressor value in the VFO panel + g_idle_add(ext_vfo_update, NULL); } GtkWidget *sliders_init(int my_width, int my_height) { @@ -564,20 +583,24 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); gtk_grid_set_column_homogeneous(GTK_GRID(sliders),TRUE); af_gain_label=gtk_label_new("AF:"); + //gtk_widget_override_font(af_gain_label, pango_font_description_from_string("Sans 11")); gtk_widget_show(af_gain_label); gtk_grid_attach(GTK_GRID(sliders),af_gain_label,0,0,1,1); af_gain_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.00); + //gtk_widget_override_font(af_gain_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(af_gain_scale),active_receiver->volume*100.0); gtk_widget_show(af_gain_scale); gtk_grid_attach(GTK_GRID(sliders),af_gain_scale,1,0,2,1); g_signal_connect(G_OBJECT(af_gain_scale),"value_changed",G_CALLBACK(afgain_value_changed_cb),NULL); agc_gain_label=gtk_label_new("AGC:"); + //gtk_widget_override_font(agc_gain_label, pango_font_description_from_string("Sans 11")); gtk_widget_show(agc_gain_label); gtk_grid_attach(GTK_GRID(sliders),agc_gain_label,3,0,1,1); agc_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,-20.0, 120.0, 1.0); + //gtk_widget_override_font(agc_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(agc_scale),active_receiver->agc_gain); gtk_widget_show(agc_scale); gtk_grid_attach(GTK_GRID(sliders),agc_scale,4,0,2,1); @@ -590,6 +613,7 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); sprintf(title,"ATT (dB)"/*,active_receiver->adc*/); #endif attenuation_label=gtk_label_new(title); + //gtk_widget_override_font(attenuation_label, pango_font_description_from_string("Sans 11")); gtk_widget_show(attenuation_label); gtk_grid_attach(GTK_GRID(sliders),attenuation_label,6,0,1,1); @@ -600,15 +624,18 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); attenuation_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 31.0, 1.0); gtk_range_set_value (GTK_RANGE(attenuation_scale),adc_attenuation[active_receiver->adc]); #endif + //gtk_widget_override_font(attenuation_scale, pango_font_description_from_string("Sans 10")); gtk_widget_show(attenuation_scale); gtk_grid_attach(GTK_GRID(sliders),attenuation_scale,7,0,2,1); g_signal_connect(G_OBJECT(attenuation_scale),"value_changed",G_CALLBACK(attenuation_value_changed_cb),NULL); c25_att_preamp_label = gtk_label_new("Att/PreAmp"); + //gtk_widget_override_font(c25_att_preamp_label, pango_font_description_from_string("Sans 11")); gtk_grid_attach(GTK_GRID(sliders), c25_att_preamp_label, 6, 0, 1, 1); c25_att_combobox = gtk_combo_box_text_new(); + //gtk_widget_override_font(c25_att_combobox, pango_font_description_from_string("Sans 10")); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_att_combobox), "0", "0 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_att_combobox), "1", "-12 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_att_combobox), "2", "-24 dB"); @@ -617,6 +644,7 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); g_signal_connect(G_OBJECT(c25_att_combobox), "changed", G_CALLBACK(c25_att_combobox_changed), NULL); c25_preamp_combobox = gtk_combo_box_text_new(); + //gtk_widget_override_font(c25_preamp_combobox, pango_font_description_from_string("Sans 10")); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_preamp_combobox), "0", "0 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_preamp_combobox), "1", "18 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_preamp_combobox), "2", "36 dB"); @@ -626,27 +654,34 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); mic_gain_label=gtk_label_new(mic_linein?"Linein:":"Mic (dB):"); + //gtk_widget_override_font(mic_gain_label, pango_font_description_from_string("Sans 11")); gtk_grid_attach(GTK_GRID(sliders),mic_gain_label,0,1,1,1); mic_gain_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,mic_linein?0.0:-10.0,mic_linein?31.0:50.0, 1.0); + //gtk_widget_override_font(mic_gain_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(mic_gain_scale),mic_linein?linein_gain:mic_gain); gtk_grid_attach(GTK_GRID(sliders),mic_gain_scale,1,1,2,1); g_signal_connect(G_OBJECT(mic_gain_scale),"value_changed",G_CALLBACK(micgain_value_changed_cb),NULL); drive_label=gtk_label_new("Drive:"); + //gtk_widget_override_font(drive_label, pango_font_description_from_string("Sans 11")); gtk_grid_attach(GTK_GRID(sliders),drive_label,3,1,1,1); drive_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.0); + //gtk_widget_override_font(drive_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(drive_scale),getDrive()); gtk_widget_show(drive_scale); gtk_grid_attach(GTK_GRID(sliders),drive_scale,4,1,2,1); g_signal_connect(G_OBJECT(drive_scale),"value_changed",G_CALLBACK(drive_value_changed_cb),NULL); +#ifndef COMPRESSION_SLIDER squelch_label=gtk_label_new("Squelch:"); + //gtk_widget_override_font(squelch_label, pango_font_description_from_string("Sans 11")); gtk_widget_show(squelch_label); gtk_grid_attach(GTK_GRID(sliders),squelch_label,6,1,1,1); squelch_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.0); + //gtk_widget_override_font(squelch_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch); gtk_widget_show(squelch_scale); gtk_grid_attach(GTK_GRID(sliders),squelch_scale,7,1,2,1); @@ -657,6 +692,25 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); gtk_widget_show(squelch_enable); gtk_grid_attach(GTK_GRID(sliders),squelch_enable,9,1,1,1); g_signal_connect(squelch_enable,"toggled",G_CALLBACK(squelch_enable_cb),NULL); +#else + comp_label=gtk_label_new("TX Cmpr:"); + //gtk_widget_override_font(comp_label, pango_font_description_from_string("Sans 11")); + gtk_widget_show(comp_label); + gtk_grid_attach(GTK_GRID(sliders),comp_label,6,1,1,1); + + comp_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 20.0, 1.0); + //gtk_widget_override_font(comp_scale, pango_font_description_from_string("Sans 10")); + gtk_range_set_value (GTK_RANGE(comp_scale),transmitter->compressor_level); + gtk_widget_show(comp_scale); + gtk_grid_attach(GTK_GRID(sliders),comp_scale,7,1,2,1); + g_signal_connect(G_OBJECT(comp_scale),"value_changed",G_CALLBACK(compressor_value_changed_cb),NULL); + + comp_enable=gtk_check_button_new(); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(comp_enable),transmitter->compressor); + gtk_widget_show(comp_enable); + gtk_grid_attach(GTK_GRID(sliders),comp_enable,9,1,1,1); + g_signal_connect(comp_enable,"toggled",G_CALLBACK(compressor_enable_cb),NULL); +#endif return sliders; } diff --git a/step_menu.c b/step_menu.c index 9782cb3..5fb76a6 100644 --- a/step_menu.c +++ b/step_menu.c @@ -92,7 +92,7 @@ void step_menu(GtkWidget *parent) { } else { step_rb=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(step_rb),step_labels[i]); } - gtk_widget_override_font(step_rb, pango_font_description_from_string("FreeMono 18")); + gtk_widget_override_font(step_rb, pango_font_description_from_string("Sans 16")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (step_rb), steps[i]==step); gtk_widget_show(step_rb); gtk_grid_attach(GTK_GRID(grid),step_rb,i%5,1+(i/5),1,1); diff --git a/toolbar.c b/toolbar.c index 541e19a..4337118 100644 --- a/toolbar.c +++ b/toolbar.c @@ -652,50 +652,50 @@ GtkWidget *toolbar_init(int my_width, int my_height, GtkWidget* parent) { gtk_grid_set_column_homogeneous(GTK_GRID(toolbar),TRUE); sim_mox=gtk_button_new_with_label("Mox"); - //gtk_widget_override_font(sim_mox, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_mox, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_mox),"clicked",G_CALLBACK(sim_mox_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_mox,0,0,4,1); sim_s1=gtk_button_new_with_label("Band"); gtk_widget_set_size_request (sim_s1, button_width, 0); - //gtk_widget_override_font(sim_s1, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_s1, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_s1),"pressed",G_CALLBACK(sim_s1_pressed_cb),NULL); g_signal_connect(G_OBJECT(sim_s1),"released",G_CALLBACK(sim_s1_released_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_s1,4,0,4,1); sim_s2=gtk_button_new_with_label("BStack"); gtk_widget_set_size_request (sim_s2, button_width, 0); - //gtk_widget_override_font(sim_s2, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_s2, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_s2),"pressed",G_CALLBACK(sim_s2_pressed_cb),NULL); g_signal_connect(G_OBJECT(sim_s2),"released",G_CALLBACK(sim_s2_released_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_s2,8,0,4,1); sim_s3=gtk_button_new_with_label("Mode"); - //gtk_widget_override_font(sim_s3, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_s3, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_s3),"pressed",G_CALLBACK(sim_s3_pressed_cb),NULL); g_signal_connect(G_OBJECT(sim_s3),"released",G_CALLBACK(sim_s3_released_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_s3,12,0,4,1); sim_s4=gtk_button_new_with_label("Filter"); - //gtk_widget_override_font(sim_s4, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_s4, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_s4),"pressed",G_CALLBACK(sim_s4_pressed_cb),NULL); g_signal_connect(G_OBJECT(sim_s4),"released",G_CALLBACK(sim_s4_released_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_s4,16,0,4,1); sim_s5=gtk_button_new_with_label("Noise"); - //gtk_widget_override_font(sim_s5, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_s5, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_s5),"pressed",G_CALLBACK(sim_s5_pressed_cb),NULL); g_signal_connect(G_OBJECT(sim_s5),"released",G_CALLBACK(sim_s5_released_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_s5,20,0,4,1); sim_s6=gtk_button_new_with_label("AGC"); - //gtk_widget_override_font(sim_s6, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_s6, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_s6),"pressed",G_CALLBACK(sim_s6_pressed_cb),NULL); g_signal_connect(G_OBJECT(sim_s6),"released",G_CALLBACK(sim_s6_released_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_s6,24,0,4,1); sim_function=gtk_button_new_with_label("Function"); - //gtk_widget_override_font(sim_function, pango_font_description_from_string("Arial 16")); + //gtk_widget_override_font(sim_function, pango_font_description_from_string("Sans 11")); g_signal_connect(G_OBJECT(sim_function),"clicked",G_CALLBACK(sim_function_cb),NULL); gtk_grid_attach(GTK_GRID(toolbar),sim_function,28,0,4,1);