oc_menu.c \
xvtr_menu.c \
equalizer_menu.c \
+step_menu.c \
+meter_menu.c \
+band_menu.c \
+bandstack_menu.c \
+mode_menu.c \
+filter_menu.c \
+noise_menu.c \
+agc_menu.c \
rit.c \
meter.c \
mode.c \
version.c \
vfo.c \
waterfall.c \
-wdsp_init.c
+wdsp_init.c \
+button_text.c
HEADERS= \
oc_menu.h \
xvtr_menu.h \
equalizer_menu.h \
+step_menu.h \
+meter_menu.h \
+band_menu.h \
+bandstack_menu.h \
+mode_menu.h \
+filter_menu.h \
+noise_menu.h \
+agc_menu.h \
rit.h \
meter.h \
mode.h \
version.h \
vfo.h \
waterfall.h \
-wdsp_init.h
+wdsp_init.h \
+button_text.h
OBJS= \
oc_menu.o \
xvtr_menu.o \
equalizer_menu.o \
+step_menu.o \
+meter_menu.o \
+band_menu.o \
+bandstack_menu.o \
+mode_menu.o \
+filter_menu.o \
+noise_menu.o \
+agc_menu.o \
rit.o \
meter.o \
mode.o \
sliders.o \
vfo.o \
waterfall.o \
-wdsp_init.o
+wdsp_init.o \
+button_text.o
all: prebuild $(PROGRAM) $(HEADERS) $(LIMESDR_HEADERS) $(FREEDV_HEADERS) $(GPIO_HEADERS) $(PSK_HEADERS) $(SOURCES) $(LIMESDR_SOURCES) $(FREEDV_SOURCES) $(GPIO_SOURCES) $(PSK_SOURCES)
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+#include "agc_menu.h"
+#include "agc.h"
+#include "band.h"
+#include "channel.h"
+#include "radio.h"
+#include "button_text.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static gboolean agc_select_cb (GtkWidget *widget, gpointer data) {
+ agc=(int)data;
+ wdsp_set_agc(CHANNEL_RX0, agc);
+}
+
+void agc_menu(GtkWidget *parent) {
+ GtkWidget *b;
+ int i;
+ BAND *band;
+
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_column_spacing (GTK_GRID(grid),5);
+ gtk_grid_set_row_spacing (GTK_GRID(grid),5);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close AGC");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ GtkWidget *b_off=gtk_radio_button_new_with_label(NULL,"Off");
+ //gtk_widget_override_font(b_off, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_off), agc==AGC_OFF);
+ gtk_widget_show(b_off);
+ gtk_grid_attach(GTK_GRID(grid),b_off,0,1,2,1);
+ g_signal_connect(b_off,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_OFF);
+
+ GtkWidget *b_long=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_off),"Long");
+ //gtk_widget_override_font(b_long, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_long), agc==AGC_LONG);
+ gtk_widget_show(b_long);
+ gtk_grid_attach(GTK_GRID(grid),b_long,0,2,2,1);
+ g_signal_connect(b_long,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_LONG);
+
+ GtkWidget *b_slow=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_long),"Slow");
+ //gtk_widget_override_font(b_slow, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_slow), agc==AGC_SLOW);
+ gtk_widget_show(b_slow);
+ gtk_grid_attach(GTK_GRID(grid),b_slow,0,3,2,1);
+ g_signal_connect(b_slow,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_SLOW);
+
+ GtkWidget *b_medium=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_slow),"Medium");
+ //gtk_widget_override_font(b_medium, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_medium), agc==AGC_MEDIUM);
+ gtk_widget_show(b_medium);
+ gtk_grid_attach(GTK_GRID(grid),b_medium,0,4,2,1);
+ g_signal_connect(b_medium,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_MEDIUM);
+
+ GtkWidget *b_fast=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_medium),"Fast");
+ //gtk_widget_override_font(b_fast, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_fast), agc==AGC_FAST);
+ gtk_widget_show(b_fast);
+ gtk_grid_attach(GTK_GRID(grid),b_fast,0,5,2,1);
+ g_signal_connect(b_fast,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_FAST);
+
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+extern void agc_menu(GtkWidget *parent);
BAND bands[BANDS+XVTRS] =
- {{"160",&bandstack160,0,0,0,0,0,ALEX_ATTENUATION_0dB,42.0,1800000LL,1800000LL,0LL,0},
- {"80",&bandstack80,0,0,0,0,0,ALEX_ATTENUATION_0dB,42.5,3500000LL,3500000LL,0LL,0},
- {"60",&bandstack60,0,0,0,0,0,ALEX_ATTENUATION_0dB,42.5,5330500LL,5403500LL,0LL,0},
- {"40",&bandstack40,0,0,0,0,0,ALEX_ATTENUATION_0dB,42.5,7000000LL,7300000LL,0LL,0},
- {"30",&bandstack30,0,0,0,0,0,ALEX_ATTENUATION_0dB,41.3,10100000LL,10150000LL,0LL,0},
- {"20",&bandstack20,0,0,0,0,0,ALEX_ATTENUATION_0dB,40.5,14000000LL,14350000LL,0LL,0},
- {"18",&bandstack18,0,0,0,0,0,ALEX_ATTENUATION_0dB,40.0,18068000LL,18168000LL,0LL,0},
- {"15",&bandstack15,0,0,0,0,0,ALEX_ATTENUATION_0dB,39.6,21000000LL,21450000LL,0LL,0},
- {"12",&bandstack12,0,0,0,0,0,ALEX_ATTENUATION_0dB,39.0,24890000LL,24990000LL,0LL,0},
- {"10",&bandstack10,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,28000000LL,29700000LL,0LL,0},
- {"50",&bandstack50,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,50000000LL,54000000LL,0LL,0},
+ {{"160",&bandstack160,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,1800000LL,1800000LL,0LL,0},
+ {"80",&bandstack80,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,3500000LL,3500000LL,0LL,0},
+ {"60",&bandstack60,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,5330500LL,5403500LL,0LL,0},
+ {"40",&bandstack40,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,7000000LL,7300000LL,0LL,0},
+ {"30",&bandstack30,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,10100000LL,10150000LL,0LL,0},
+ {"20",&bandstack20,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,14000000LL,14350000LL,0LL,0},
+ {"18",&bandstack18,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,18068000LL,18168000LL,0LL,0},
+ {"15",&bandstack15,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,21000000LL,21450000LL,0LL,0},
+ {"12",&bandstack12,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,24890000LL,24990000LL,0LL,0},
+ {"10",&bandstack10,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,28000000LL,29700000LL,0LL,0},
+ {"50",&bandstack50,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,50000000LL,54000000LL,0LL,0},
#ifdef LIMESDR
- {"70",&bandstack70,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"144",&bandstack144,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,144000000LL,148000000LL,0LL,0},
- {"220",&bandstack144,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,222000000LL,224980000LL,0LL,0},
- {"430",&bandstack430,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,420000000LL,450000000LL,0LL,0},
- {"902",&bandstack430,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,902000000LL,928000000LL,0LL,0},
- {"1240",&bandstack1240,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,1240000000LL,1300000000LL,0LL,0},
- {"2300",&bandstack2300,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,2300000000LL,2450000000LL,0LL,0},
- {"3400",&bandstack3400,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,3400000000LL,3410000000LL,0LL,0},
- {"AIR",&bandstackAIR,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
+ {"70",&bandstack70,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"144",&bandstack144,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,144000000LL,148000000LL,0LL,0},
+ {"220",&bandstack144,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,222000000LL,224980000LL,0LL,0},
+ {"430",&bandstack430,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,420000000LL,450000000LL,0LL,0},
+ {"902",&bandstack430,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,902000000LL,928000000LL,0LL,0},
+ {"1240",&bandstack1240,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,1240000000LL,1300000000LL,0LL,0},
+ {"2300",&bandstack2300,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,2300000000LL,2450000000LL,0LL,0},
+ {"3400",&bandstack3400,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,3400000000LL,3410000000LL,0LL,0},
+ {"AIR",&bandstackAIR,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
#endif
- {"GEN",&bandstackGEN,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"WWV",&bandstackWWV,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"136kHz",&bandstack136,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,135700LL,137800LL,0LL,0},
- {"472kHz",&bandstack472,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,472000LL,479000LL,0LL,0},
+ {"GEN",&bandstackGEN,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"WWV",&bandstackWWV,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"136kHz",&bandstack136,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,135700LL,137800LL,0LL,0},
+ {"472kHz",&bandstack472,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,472000LL,479000LL,0LL,0},
// XVTRS
- {"",&bandstack_xvtr_0,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"",&bandstack_xvtr_1,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"",&bandstack_xvtr_2,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"",&bandstack_xvtr_3,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"",&bandstack_xvtr_4,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"",&bandstack_xvtr_5,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"",&bandstack_xvtr_6,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0},
- {"",&bandstack_xvtr_7,0,0,0,0,0,ALEX_ATTENUATION_0dB,38.8,0LL,0LL,0LL,0}
+ {"",&bandstack_xvtr_0,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"",&bandstack_xvtr_1,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"",&bandstack_xvtr_2,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"",&bandstack_xvtr_3,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"",&bandstack_xvtr_4,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"",&bandstack_xvtr_5,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"",&bandstack_xvtr_6,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0},
+ {"",&bandstack_xvtr_7,0,0,0,0,0,ALEX_ATTENUATION_0dB,53.0,0LL,0LL,0LL,0}
};
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+#include "band_menu.h"
+#include "band.h"
+#include "bandstack.h"
+#include "filter.h"
+#include "radio.h"
+#include "vfo.h"
+#include "button_text.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static GtkWidget *last_band;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static gboolean band_select_cb (GtkWidget *widget, gpointer data) {
+ GtkWidget *label;
+ int b=(int)data;
+ BANDSTACK_ENTRY *entry;
+ if(b==band_get_current()) {
+ entry=bandstack_entry_next();
+ } else {
+ BAND* band=band_set_current(b);
+ entry=bandstack_entry_get_current();
+ set_button_text_color(last_band,"black");
+ last_band=widget;
+ set_button_text_color(last_band,"orange");
+ }
+ setMode(entry->mode);
+ FILTER* band_filters=filters[entry->mode];
+ FILTER* band_filter=&band_filters[entry->filter];
+ setFilter(band_filter->low,band_filter->high);
+ setFrequency(entry->frequencyA);
+
+ BAND *band=band_get_current_band();
+ set_alex_rx_antenna(band->alexRxAntenna);
+ set_alex_tx_antenna(band->alexTxAntenna);
+ set_alex_attenuation(band->alexAttenuation);
+
+ vfo_update(NULL);
+
+ setFrequency(entry->frequencyA);
+
+ calcDriveLevel();
+ calcTuneDriveLevel();
+}
+
+void band_menu(GtkWidget *parent) {
+ GtkWidget *b;
+ int i;
+ BAND *band;
+
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_column_spacing (GTK_GRID(grid),5);
+ gtk_grid_set_row_spacing (GTK_GRID(grid),5);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close Band");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ for(i=0;i<BANDS+XVTRS;i++) {
+#ifdef LIMESDR
+ if(protocol!=LIMESDR_PROTOCOL) {
+ if(i>=band70 && i<=band3400) {
+ continue;
+ }
+ }
+#endif
+
+ band=(BAND*)band_get_band(i);
+ if(strlen(band->title)>0) {
+ GtkWidget *b=gtk_button_new_with_label(band->title);
+ set_button_text_color(b,"black");
+ if(i==band_get_current()) {
+ set_button_text_color(b,"orange");
+ last_band=b;
+ }
+ gtk_widget_show(b);
+ gtk_grid_attach(GTK_GRID(grid),b,i%5,1+(i/5),1,1);
+ g_signal_connect(b,"clicked",G_CALLBACK(band_select_cb),(gpointer *)i);
+ }
+ }
+
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+void band_menu(GtkWidget *parent);
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+#include "bandstack_menu.h"
+#include "band.h"
+#include "bandstack.h"
+#include "filter.h"
+#include "radio.h"
+#include "vfo.h"
+#include "button_text.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static GtkWidget *last_bandstack;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static gboolean bandstack_select_cb (GtkWidget *widget, gpointer data) {
+ int b=(int)data;
+ BAND *band=band_get_current_band();
+ BANDSTACK *bandstack=band->bandstack;
+
+ bandstack->current_entry=b;
+
+ set_button_text_color(last_bandstack,"black");
+ last_bandstack=widget;
+ set_button_text_color(last_bandstack,"orange");
+
+ BANDSTACK_ENTRY *entry;
+ entry=&(bandstack->entry[b]);
+
+ setMode(entry->mode);
+ FILTER* band_filters=filters[entry->mode];
+ FILTER* band_filter=&band_filters[entry->filter];
+ setFilter(band_filter->low,band_filter->high);
+ setFrequency(entry->frequencyA);
+
+ set_alex_rx_antenna(band->alexRxAntenna);
+ set_alex_tx_antenna(band->alexTxAntenna);
+ set_alex_attenuation(band->alexAttenuation);
+
+ vfo_update(NULL);
+
+ setFrequency(entry->frequencyA);
+}
+
+void bandstack_menu(GtkWidget *parent) {
+ GtkWidget *b;
+ int i;
+
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_column_spacing (GTK_GRID(grid),5);
+ gtk_grid_set_row_spacing (GTK_GRID(grid),5);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close Band Stack");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ char label[16];
+
+ BAND *band=band_get_current_band();
+ BANDSTACK *bandstack=band->bandstack;
+
+ for(i=0;i<bandstack->entries;i++) {
+ BANDSTACK_ENTRY *entry=&bandstack->entry[i];
+ sprintf(label,"%lld %s",entry->frequencyA,mode_string[entry->mode]);
+ GtkWidget *b=gtk_button_new_with_label(label);
+ set_button_text_color(b,"black");
+ //gtk_widget_override_font(b, pango_font_description_from_string("Arial 20"));
+ if(i==bandstack->current_entry) {
+ set_button_text_color(b,"orange");
+ last_bandstack=b;
+ }
+ gtk_widget_show(b);
+ gtk_grid_attach(GTK_GRID(grid),b,i/5,1+(i%5),1,1);
+ g_signal_connect(b,"clicked",G_CALLBACK(bandstack_select_cb),(gpointer *)i);
+ }
+
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+extern void bandstack_menu(GtkWidget *parent);
--- /dev/null
+#include <gtk/gtk.h>
+
+void set_button_text_color(GtkWidget *widget,char *color) {
+ GtkStyleContext *style_context;
+ GtkCssProvider *provider = gtk_css_provider_new ();
+ gchar tmp[64];
+ style_context = gtk_widget_get_style_context(widget);
+ gtk_style_context_add_provider(style_context, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_snprintf(tmp, sizeof tmp, "GtkButton, GtkLabel { color: %s; }", color);
+ gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(provider), tmp, -1, NULL);
+ g_object_unref (provider);
+}
+
--- /dev/null
+void set_button_text_color(GtkWidget *widget,char *color);
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+#include "filter_menu.h"
+#include "band.h"
+#include "bandstack.h"
+#include "filter.h"
+#include "mode.h"
+#include "radio.h"
+#include "vfo.h"
+#include "button_text.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static GtkWidget *last_filter;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static gboolean filter_select_cb (GtkWidget *widget, gpointer data) {
+ int f=(int)data;
+ BANDSTACK_ENTRY *entry;
+ entry=bandstack_entry_get_current();
+ entry->filter=f;
+ FILTER* band_filters=filters[entry->mode];
+ FILTER* band_filter=&band_filters[entry->filter];
+ setFilter(band_filter->low,band_filter->high);
+ set_button_text_color(last_filter,"black");
+ last_filter=widget;
+ set_button_text_color(last_filter,"orange");
+ vfo_update(NULL);
+}
+
+void filter_menu(GtkWidget *parent) {
+ GtkWidget *b;
+ int i;
+ BAND *band;
+
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_column_spacing (GTK_GRID(grid),5);
+ gtk_grid_set_row_spacing (GTK_GRID(grid),5);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close Filter");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ BANDSTACK_ENTRY *entry=bandstack_entry_get_current();
+ FILTER* band_filters=filters[entry->mode];
+
+ for(i=0;i<FILTERS;i++) {
+ FILTER* band_filter=&band_filters[i];
+ GtkWidget *b=gtk_button_new_with_label(band_filters[i].title);
+ if(i==entry->filter) {
+ set_button_text_color(b,"orange");
+ last_filter=b;
+ } else {
+ set_button_text_color(b,"black");
+ }
+ gtk_widget_show(b);
+ gtk_grid_attach(GTK_GRID(grid),b,i%5,1+(i/5),1,1);
+ g_signal_connect(b,"pressed",G_CALLBACK(filter_select_cb),(gpointer *)i);
+ }
+
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+extern void filter_menu(GtkWidget *parent);
}
}
+static void rit_cb(GtkWidget *widget,gpointer data) {
+ rit_increment=(int)data;
+}
+
void general_menu(GtkWidget *parent) {
parent_window=parent;
GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
GtkWidget *grid=gtk_grid_new();
- //gtk_grid_set_column_spacing (GTK_GRID(grid),10);
+ gtk_grid_set_column_spacing (GTK_GRID(grid),10);
//gtk_grid_set_row_spacing (GTK_GRID(grid),10);
//gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
//gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
#endif
+ GtkWidget *rit_label=gtk_label_new("RIT step: ");
+ gtk_grid_attach(GTK_GRID(grid),rit_label,5,1,1,1);
+
+ GtkWidget *rit_1=gtk_radio_button_new_with_label(NULL,"1 Hz");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rit_1), rit_increment==1);
+ gtk_grid_attach(GTK_GRID(grid),rit_1,5,2,1,1);
+ g_signal_connect(rit_1,"pressed",G_CALLBACK(rit_cb),(gpointer *)1);
+
+ GtkWidget *rit_10=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(rit_1),"10");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rit_10), rit_increment==10);
+ gtk_grid_attach(GTK_GRID(grid),rit_10,5,3,1,1);
+ g_signal_connect(rit_10,"pressed",G_CALLBACK(rit_cb),(gpointer *)10);
+
+ GtkWidget *rit_100=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(rit_10),"100");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rit_100), rit_increment==100);
+ gtk_grid_attach(GTK_GRID(grid),rit_100,5,4,1,1);
+ g_signal_connect(rit_100,"pressed",G_CALLBACK(rit_cb),(gpointer *)100);
+
gtk_container_add(GTK_CONTAINER(content),grid);
sub_menu=dialog;
#ifdef PSK
#include "psk.h"
#endif
+#include "new_menu.h"
static GtkWidget *parent_window;
return FALSE;
}
+/*
static void
smeter_select_cb (GtkWidget *widget,
gpointer data)
{
alc=(int)data;
}
+*/
static gboolean
meter_press_event_cb (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
+ start_meter();
+/*
GtkWidget *dialog=gtk_dialog_new_with_buttons("Meter",GTK_WINDOW(parent_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL);
//gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
dialog);
int result=gtk_dialog_run(GTK_DIALOG(dialog));
-
+*/
return TRUE;
}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <wdsp.h>
+
+#include "new_menu.h"
+#include "meter_menu.h"
+#include "meter.h"
+#include "radio.h"
+
+static GtkWidget *parent_window=NULL;
+static GtkWidget *dialog=NULL;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static void smeter_select_cb (GtkWidget *widget, gpointer data) {
+ smeter=(int)data;
+}
+
+static void alc_meter_select_cb (GtkWidget *widget, gpointer data) {
+ alc=(int)data;
+}
+
+void meter_menu (GtkWidget *parent) {
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close Meter");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ GtkWidget *smeter_peak=gtk_radio_button_new_with_label(NULL,"S Meter Peak");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (smeter_peak), smeter==RXA_S_PK);
+ gtk_widget_show(smeter_peak);
+ gtk_grid_attach(GTK_GRID(grid),smeter_peak,0,1,1,1);
+ g_signal_connect(smeter_peak,"pressed",G_CALLBACK(smeter_select_cb),(gpointer *)RXA_S_PK);
+
+ GtkWidget *smeter_average=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(smeter_peak),"S Meter Average");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (smeter_average), smeter==RXA_S_AV);
+ gtk_widget_show(smeter_average);
+ gtk_grid_attach(GTK_GRID(grid),smeter_average,0,2,1,1);
+ g_signal_connect(smeter_average,"pressed",G_CALLBACK(smeter_select_cb),(gpointer *)RXA_S_AV);
+
+ GtkWidget *alc_peak=gtk_radio_button_new_with_label(NULL,"ALC Peak");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (alc_peak), alc==TXA_ALC_PK);
+ gtk_widget_show(alc_peak);
+ gtk_grid_attach(GTK_GRID(grid),alc_peak,1,1,1,1);
+ g_signal_connect(alc_peak,"pressed",G_CALLBACK(alc_meter_select_cb),(gpointer *)TXA_ALC_PK);
+
+ GtkWidget *alc_average=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(alc_peak),"ALC Average");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (alc_average), alc==TXA_ALC_AV);
+ gtk_widget_show(alc_average);
+ gtk_grid_attach(GTK_GRID(grid),alc_average,1,2,1,1);
+ g_signal_connect(alc_average,"pressed",G_CALLBACK(alc_meter_select_cb),(gpointer *)TXA_ALC_AV);
+
+ GtkWidget *alc_gain=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(alc_average),"ALC Gain");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (alc_gain), alc==TXA_ALC_GAIN);
+ gtk_widget_show(alc_gain);
+ gtk_grid_attach(GTK_GRID(grid),alc_gain,1,3,1,1);
+ g_signal_connect(alc_gain,"pressed",G_CALLBACK(alc_meter_select_cb),(gpointer *)TXA_ALC_GAIN);
+
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+void meter_menu (GtkWidget *parent);
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+#include "band_menu.h"
+#include "band.h"
+#include "bandstack.h"
+#include "filter.h"
+#include "mode.h"
+#include "radio.h"
+#include "vfo.h"
+#include "button_text.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static GtkWidget *last_mode;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static gboolean mode_select_cb (GtkWidget *widget, gpointer data) {
+ int m=(int)data;
+ BANDSTACK_ENTRY *entry;
+ entry=bandstack_entry_get_current();
+ entry->mode=m;
+ setMode(entry->mode);
+ FILTER* band_filters=filters[entry->mode];
+ FILTER* band_filter=&band_filters[entry->filter];
+ setFilter(band_filter->low,band_filter->high);
+ set_button_text_color(last_mode,"black");
+ last_mode=widget;
+ set_button_text_color(last_mode,"orange");
+ vfo_update(NULL);
+}
+
+void mode_menu(GtkWidget *parent) {
+ GtkWidget *b;
+ int i;
+ BAND *band;
+
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_column_spacing (GTK_GRID(grid),5);
+ gtk_grid_set_row_spacing (GTK_GRID(grid),5);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close Mode");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ BANDSTACK_ENTRY *entry=bandstack_entry_get_current();
+
+ for(i=0;i<MODES;i++) {
+ GtkWidget *b=gtk_button_new_with_label(mode_string[i]);
+ if(i==entry->mode) {
+ set_button_text_color(b,"orange");
+ last_mode=b;
+ } else {
+ set_button_text_color(b,"black");
+ }
+ gtk_widget_show(b);
+ gtk_grid_attach(GTK_GRID(grid),b,i%5,1+(i/5),1,1);
+ g_signal_connect(b,"pressed",G_CALLBACK(mode_select_cb),(gpointer *)i);
+ }
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+extern void mode_menu(GtkWidget *parent);
#include "xvtr_menu.h"
#include "equalizer_menu.h"
#include "radio.h"
+#include "step_menu.h"
+#include "meter_menu.h"
+#include "band_menu.h"
+#include "bandstack_menu.h"
+#include "mode_menu.h"
+#include "filter_menu.h"
+#include "noise_menu.h"
+#include "agc_menu.h"
+
static GtkWidget *parent_window=NULL;
GtkWidget *sub_menu=NULL;
-static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+static cleanup() {
if(dialog!=NULL) {
gtk_widget_destroy(dialog);
dialog=NULL;
}
+ if(sub_menu!=NULL) {
+ gtk_widget_destroy(sub_menu);
+ sub_menu=NULL;
+ }
+}
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ cleanup();
return TRUE;
}
+
static gboolean exit_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
exit_menu(parent_window);
return TRUE;
}
static gboolean general_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
general_menu(parent_window);
return TRUE;
}
static gboolean audio_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
audio_menu(parent_window);
return TRUE;
}
static gboolean ant_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
ant_menu(parent_window);
return TRUE;
}
static gboolean display_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
display_menu(parent_window);
return TRUE;
}
static gboolean dsp_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
dsp_menu(parent_window);
return TRUE;
}
static gboolean pa_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
pa_menu(parent_window);
return TRUE;
}
static gboolean cw_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
cw_menu(parent_window);
return TRUE;
}
static gboolean oc_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
oc_menu(parent_window);
return TRUE;
}
#ifdef FREEDV
static gboolean freedv_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
freedv_menu(parent_window);
return TRUE;
}
#endif
static gboolean xvtr_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
xvtr_menu(parent_window);
return TRUE;
}
static gboolean equalizer_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
- gtk_widget_destroy(dialog);
- dialog=NULL;
+ cleanup();
equalizer_menu(parent_window);
return TRUE;
}
-static gboolean test_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
-fprintf(stderr,"test_cb\n");
- // some test code
+void start_step() {
+ cleanup();
+ step_menu(parent_window);
+}
+
+static gboolean step_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_step();
+ return TRUE;
+}
+
+void start_meter() {
+ cleanup();
+ meter_menu(parent_window);
+}
+
+static gboolean meter_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_meter();
+ return TRUE;
+}
+
+void start_band() {
+ cleanup();
+ band_menu(parent_window);
+}
+
+static gboolean band_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_band();
+ return TRUE;
+}
+
+void start_bandstack() {
+ cleanup();
+ bandstack_menu(parent_window);
+}
+
+static gboolean bandstack_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_bandstack();
+ return TRUE;
+}
+
+void start_mode() {
+ cleanup();
+ mode_menu(parent_window);
+}
+
+static gboolean mode_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_mode();
+ return TRUE;
+}
+
+void start_filter() {
+ cleanup();
+ filter_menu(parent_window);
+}
+
+static gboolean filter_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_filter();
+ return TRUE;
+}
+
+void start_noise() {
+ cleanup();
+ noise_menu(parent_window);
+}
+
+static gboolean noise_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_noise();
+ return TRUE;
+}
+
+void start_agc() {
+ cleanup();
+ agc_menu(parent_window);
+}
+
+static gboolean agc_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ start_agc();
return TRUE;
}
GtkWidget *exit_b=gtk_button_new_with_label("Exit piHPSDR");
g_signal_connect (exit_b, "button-press-event", G_CALLBACK(exit_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),exit_b,3,0,2,1);
+ gtk_grid_attach(GTK_GRID(grid),exit_b,4,0,2,1);
GtkWidget *general_b=gtk_button_new_with_label("General");
g_signal_connect (general_b, "button-press-event", G_CALLBACK(general_cb), NULL);
GtkWidget *pa_b=gtk_button_new_with_label("PA");
g_signal_connect (pa_b, "button-press-event", G_CALLBACK(pa_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),pa_b,0,2,1,1);
+ gtk_grid_attach(GTK_GRID(grid),pa_b,5,1,1,1);
GtkWidget *cw_b=gtk_button_new_with_label("CW");
g_signal_connect (cw_b, "button-press-event", G_CALLBACK(cw_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),cw_b,1,2,1,1);
+ gtk_grid_attach(GTK_GRID(grid),cw_b,0,2,1,1);
GtkWidget *oc_b=gtk_button_new_with_label("OC");
g_signal_connect (oc_b, "button-press-event", G_CALLBACK(oc_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),oc_b,2,2,1,1);
+ gtk_grid_attach(GTK_GRID(grid),oc_b,1,2,1,1);
#ifdef FREEDV
GtkWidget *freedv_b=gtk_button_new_with_label("FreeDV");
g_signal_connect (freedv_b, "button-press-event", G_CALLBACK(freedv_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),freedv_b,3,2,1,1);
+ gtk_grid_attach(GTK_GRID(grid),freedv_b,2,2,1,1);
#endif
GtkWidget *xvtr_b=gtk_button_new_with_label("XVTR");
g_signal_connect (xvtr_b, "button-press-event", G_CALLBACK(xvtr_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),xvtr_b,4,2,1,1);
+ gtk_grid_attach(GTK_GRID(grid),xvtr_b,3,2,1,1);
GtkWidget *equalizer_b=gtk_button_new_with_label("Equalizer");
g_signal_connect (equalizer_b, "button-press-event", G_CALLBACK(equalizer_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),equalizer_b,0,3,1,1);
+ gtk_grid_attach(GTK_GRID(grid),equalizer_b,4,2,1,1);
+
+ GtkWidget *step_b=gtk_button_new_with_label("Step");
+ g_signal_connect (step_b, "button-press-event", G_CALLBACK(step_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),step_b,0,3,1,1);
+
+ GtkWidget *meter_b=gtk_button_new_with_label("Meter");
+ g_signal_connect (meter_b, "button-press-event", G_CALLBACK(meter_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),meter_b,1,3,1,1);
+
+ GtkWidget *band_b=gtk_button_new_with_label("Band");
+ g_signal_connect (band_b, "button-press-event", G_CALLBACK(band_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),band_b,0,4,1,1);
+
+ GtkWidget *bandstack_b=gtk_button_new_with_label("Band Stack");
+ g_signal_connect (bandstack_b, "button-press-event", G_CALLBACK(bandstack_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),bandstack_b,1,4,1,1);
+
+ GtkWidget *mode_b=gtk_button_new_with_label("Mode");
+ g_signal_connect (mode_b, "button-press-event", G_CALLBACK(mode_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),mode_b,2,4,1,1);
+
+ GtkWidget *filter_b=gtk_button_new_with_label("Filter");
+ g_signal_connect (filter_b, "button-press-event", G_CALLBACK(filter_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),filter_b,3,4,1,1);
+
+ GtkWidget *noise_b=gtk_button_new_with_label("Noise");
+ g_signal_connect (noise_b, "button-press-event", G_CALLBACK(noise_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),noise_b,4,4,1,1);
+
+ GtkWidget *agc_b=gtk_button_new_with_label("AGC");
+ g_signal_connect (agc_b, "button-press-event", G_CALLBACK(agc_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),agc_b,5,4,1,1);
-/*
- GtkWidget *test_b=gtk_button_new_with_label("Test");
- g_signal_connect (test_b, "button-press-event", G_CALLBACK(test_cb), NULL);
- gtk_grid_attach(GTK_GRID(grid),test_b,1,3,1,1);
-*/
gtk_container_add(GTK_CONTAINER(content),grid);
GtkWidget *sub_menu;
GtkWidget* new_menu_init(int width,int height,GtkWidget *parent);
+
+void start_step();
+void start_meter();
+void start_band();
+void start_bandstack();
+void start_mode();
+void start_filter();
+void start_noise();
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+#include "noise_menu.h"
+#include "channel.h"
+#include "band.h"
+#include "bandstack.h"
+#include "filter.h"
+#include "mode.h"
+#include "radio.h"
+#include "vfo.h"
+#include "button_text.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static GtkWidget *last_filter;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static void update_noise() {
+ SetRXAANRRun(CHANNEL_RX0, nr);
+ SetRXAEMNRRun(CHANNEL_RX0, nr2);
+ SetRXAANFRun(CHANNEL_RX0, anf);
+ SetRXASNBARun(CHANNEL_RX0, snb);
+ vfo_update(NULL);
+}
+
+static void nr_none_cb(GtkWidget *widget, gpointer data) {
+ nr=0;
+ nr2=0;
+ nb=0;
+ nb2=0;
+ anf=0;
+ snb=0;
+ update_noise();
+}
+
+static void nr_cb(GtkWidget *widget, gpointer data) {
+ nr=1;
+ nr2=0;
+ nb=0;
+ nb2=0;
+ anf=0;
+ snb=0;
+ update_noise();
+}
+
+static void nr2_cb(GtkWidget *widget, gpointer data) {
+ nr=0;
+ nr2=1;
+ nb=0;
+ nb2=0;
+ anf=0;
+ snb=0;
+ update_noise();
+}
+
+static void nb_cb(GtkWidget *widget, gpointer data) {
+ nr=0;
+ nr2=0;
+ nb=1;
+ nb2=0;
+ anf=0;
+ snb=0;
+ update_noise();
+}
+
+static void nb2_cb(GtkWidget *widget, gpointer data) {
+ nr=0;
+ nr2=0;
+ nb=0;
+ nb2=1;
+ anf=0;
+ snb=0;
+ update_noise();
+}
+
+static void anf_cb(GtkWidget *widget, gpointer data) {
+ nr=0;
+ nr2=0;
+ nb=0;
+ nb2=0;
+ anf=1;
+ snb=0;
+ update_noise();
+}
+
+static void snb_cb(GtkWidget *widget, gpointer data) {
+ nr=0;
+ nr2=0;
+ nb=0;
+ nb2=0;
+ anf=0;
+ snb=1;
+ update_noise();
+}
+
+void noise_menu(GtkWidget *parent) {
+ GtkWidget *b;
+ int i;
+
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_column_spacing (GTK_GRID(grid),5);
+ gtk_grid_set_row_spacing (GTK_GRID(grid),5);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close Noise");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ GtkWidget *b_nr_none=gtk_radio_button_new_with_label(NULL,"None");
+ //gtk_widget_override_font(b_none, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_nr_none), nr_none==1);
+ gtk_widget_show(b_nr_none);
+ gtk_grid_attach(GTK_GRID(grid),b_nr_none,0,1,2,1);
+ g_signal_connect(b_nr_none,"pressed",G_CALLBACK(nr_none_cb),NULL);
+
+ GtkWidget *b_nr=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nr_none),"NR");
+ //gtk_widget_override_font(b_nr, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_nr), nr==1);
+ gtk_widget_show(b_nr);
+ gtk_grid_attach(GTK_GRID(grid),b_nr,0,2,2,1);
+ g_signal_connect(b_nr,"pressed",G_CALLBACK(nr_cb),NULL);
+
+ GtkWidget *b_nr2=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nr),"NR2");
+ //gtk_widget_override_font(b_nr2, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_nr2), nr2==1);
+ gtk_widget_show(b_nr2);
+ gtk_grid_attach(GTK_GRID(grid),b_nr2,0,3,2,1);
+ g_signal_connect(b_nr2,"pressed",G_CALLBACK(nr2_cb),NULL);
+
+/*
+ GtkWidget *b_nb=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nr2),"NB");
+ //gtk_widget_override_font(b_nb, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_nb), nb==1);
+ gtk_widget_show(b_nb);
+ gtk_grid_attach(GTK_GRID(grid),b_nb,0,4,2,1);
+ g_signal_connect(b_nb,"pressed",G_CALLBACK(nb_cb),NULL);
+
+ GtkWidget *b_nb2=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nb),"NB2");
+ //gtk_widget_override_font(b_nb2, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_nb2), nb2==1);
+ gtk_widget_show(b_nb2);
+ gtk_grid_attach(GTK_GRID(grid),b_nb2,0,5,2,1);
+ g_signal_connect(b_nb2,"pressed",G_CALLBACK(nb2_cb),NULL);
+*/
+
+ GtkWidget *b_anf=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nr2),"ANF");
+ //gtk_widget_override_font(b_anf, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_anf), anf==1);
+ gtk_widget_show(b_anf);
+ gtk_grid_attach(GTK_GRID(grid),b_anf,0,4,2,1);
+ g_signal_connect(b_anf,"pressed",G_CALLBACK(anf_cb),NULL);
+
+ GtkWidget *b_snb=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_anf),"SNB");
+ //gtk_widget_override_font(b_snb, pango_font_description_from_string("Arial 16"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_snb), snb==1);
+ gtk_widget_show(b_snb);
+ gtk_grid_attach(GTK_GRID(grid),b_snb,0,5,2,1);
+ g_signal_connect(b_snb,"pressed",G_CALLBACK(snb_cb),NULL);
+
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+extern void noise_menu(GtkWidget *parent);
#ifdef FREEDV
#include "freedv.h"
#endif
+#include "wdsp_init.h"
static GtkWidget *panadapter;
static cairo_surface_t *panadapter_surface = NULL;
int step=100;
int rit=0;
+int rit_increment=10;
int lt2208Dither = 0;
int lt2208Random = 0;
if(value) rx_equalizer[2]=atoi(value);
value=getProperty("rx_equalizer.3");
if(value) rx_equalizer[3]=atoi(value);
+ value=getProperty("rit_increment");
+ if(value) rit_increment=atoi(value);
bandRestoreState();
setProperty("rx_equalizer.2",value);
sprintf(value,"%d",rx_equalizer[3]);
setProperty("rx_equalizer.3",value);
+ sprintf(value,"%d",rit_increment);
+ setProperty("rit_increment",value);
bandSaveState();
extern int step;
extern int rit;
+extern int rit_increment;
extern int lt2208Dither;
extern int lt2208Random;
static gboolean rit_timer_cb(gpointer data) {
if((GtkWidget*)data==rit_plus_b) {
- rit++;
+ rit+=rit_increment;
} else {
- rit--;
+ rit-=rit_increment;
}
if(rit>1000) rit=1000;
if(rit<-1000) rit=-1000;
static gboolean rit_step_pressed_event_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
if(widget==rit_plus_b) {
- rit++;
+ rit+=rit_increment;
} else {
- rit--;
+ rit-=rit_increment;
}
if(rit>1000) rit=1000;
if(rit<-1000) rit=-1000;
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+#include "radio.h"
+#include "vfo.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ if(dialog!=NULL) {
+ gtk_widget_destroy(dialog);
+ dialog=NULL;
+ sub_menu=NULL;
+ }
+ return TRUE;
+}
+
+static gboolean step_select_cb (GtkWidget *widget, gpointer data) {
+ step=steps[(int)data];
+ vfo_update(NULL);
+}
+
+void step_menu(GtkWidget *parent) {
+
+ parent_window=parent;
+
+ dialog=gtk_dialog_new();
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+ gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+ GdkRGBA color;
+ color.red = 1.0;
+ color.green = 1.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+ gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+ GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ GtkWidget *grid=gtk_grid_new();
+
+ gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+ gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+
+ GtkWidget *close_b=gtk_button_new_with_label("Close Step");
+ g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+ gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+ GtkWidget *step_rb=NULL;
+ int i=0;
+ while(steps[i]!=0) {
+ if(i==0) {
+ step_rb=gtk_radio_button_new_with_label(NULL,step_labels[i]);
+ } 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_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);
+ g_signal_connect(step_rb,"pressed",G_CALLBACK(step_select_cb),(gpointer *)i);
+ i++;
+ }
+
+ gtk_container_add(GTK_CONTAINER(content),grid);
+
+ sub_menu=dialog;
+
+ gtk_widget_show_all(dialog);
+
+}
--- /dev/null
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+extern void step_menu(GtkWidget *parent);
#include "wdsp.h"
#include "radio.h"
#include "property.h"
+#include "new_menu.h"
int function=0;
last_dialog=NULL;
}
+/*
static void band_select_cb(GtkWidget *widget, gpointer data) {
GtkWidget *label;
int b=(int)data;
calcDriveLevel();
calcTuneDriveLevel();
}
+*/
void band_cb(GtkWidget *widget, gpointer data) {
+ start_band();
+/*
BAND* band;
int show=1;
if(last_dialog!=NULL) {
g_signal_connect(close_button,"clicked",G_CALLBACK(close_cb),(gpointer *)NULL);
gtk_widget_show_all(dialog);
-/*
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
-*/
last_dialog=dialog;
int result=gtk_dialog_run(GTK_DIALOG(dialog));
}
+*/
}
+/*
static void bandstack_select_cb(GtkWidget *widget, gpointer data) {
int b=(int)data;
BAND *band=band_get_current_band();
setFrequency(entry->frequencyA);
}
+*/
void bandstack_cb(GtkWidget *widget, gpointer data) {
+ start_bandstack();
+/*
int show=1;
if(last_dialog!=NULL) {
if(strcmp(gtk_window_get_title(GTK_WINDOW(last_dialog)),"Band Stack")==0) {
g_signal_connect(close_button,"clicked",G_CALLBACK(close_cb),(gpointer *)NULL);
gtk_widget_show_all(dialog);
-/*
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
-*/
last_dialog=dialog;
int result=gtk_dialog_run(GTK_DIALOG(dialog));
}
+*/
}
void function_cb(GtkWidget *widget, gpointer data) {
vfo_update(NULL);
}
+/*
static void mode_select_cb(GtkWidget *widget, gpointer data) {
int m=(int)data;
BANDSTACK_ENTRY *entry;
set_button_text_color(last_mode,"orange");
vfo_update(NULL);
}
+*/
void mode_cb(GtkWidget *widget, gpointer data) {
+ start_mode();
+/*
int show=1;
if(last_dialog!=NULL) {
if(strcmp(gtk_window_get_title(GTK_WINDOW(last_dialog)),"Mode")==0) {
g_signal_connect(close_button,"clicked",G_CALLBACK(close_cb),(gpointer *)NULL);
gtk_widget_show_all(dialog);
-/*
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
-*/
last_dialog=dialog;
int result=gtk_dialog_run(GTK_DIALOG(dialog));
}
+*/
}
+/*
static void filter_select_cb(GtkWidget *widget, gpointer data) {
int f=(int)data;
BANDSTACK_ENTRY *entry;
set_button_text_color(last_filter,"orange");
vfo_update(NULL);
}
-
+*/
void filter_cb(GtkWidget *widget, gpointer data) {
+ start_filter();
+/*
int show=1;
if(last_dialog!=NULL) {
if(strcmp(gtk_window_get_title(GTK_WINDOW(last_dialog)),"Filter")==0) {
g_signal_connect(close_button,"clicked",G_CALLBACK(close_cb),(gpointer *)NULL);
gtk_widget_show_all(dialog);
-/*
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
-*/
last_dialog=dialog;
int result=gtk_dialog_run(GTK_DIALOG(dialog));
}
+*/
}
+/*
static void agc_select_cb(GtkWidget *widget, gpointer data) {
agc=(int)data;
wdsp_set_agc(CHANNEL_RX0, agc);
//SetRXAAGCMode(CHANNEL_RX0, agc);
}
+*/
+/*
static void update_noise() {
SetRXAANRRun(CHANNEL_RX0, nr);
SetRXAEMNRRun(CHANNEL_RX0, nr2);
snb=1;
update_noise();
}
-
+*/
void agc_cb(GtkWidget *widget, gpointer data) {
+ start_agc();
+/*
int show=1;
if(last_dialog!=NULL) {
if(strcmp(gtk_window_get_title(GTK_WINDOW(last_dialog)),"AGC")==0) {
//gtk_widget_override_font(close_button, pango_font_description_from_string("Arial 16"));
g_signal_connect(close_button,"clicked",G_CALLBACK(close_cb),(gpointer *)NULL);
gtk_widget_show_all(dialog);
-/*
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
-*/
last_dialog=dialog;
int result=gtk_dialog_run(GTK_DIALOG(dialog));
}
+*/
}
void noise_cb(GtkWidget *widget, gpointer data) {
+ start_noise();
+/*
int show=1;
if(last_dialog!=NULL) {
if(strcmp(gtk_window_get_title(GTK_WINDOW(last_dialog)),"Noise")==0) {
gtk_grid_attach(GTK_GRID(grid),b_nr2,0,2,2,1);
g_signal_connect(b_nr2,"pressed",G_CALLBACK(nr2_cb),NULL);
-/*
- GtkWidget *b_nb=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nr2),"NB");
- //gtk_widget_override_font(b_nb, pango_font_description_from_string("Arial 16"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_nb), nb==1);
- gtk_widget_show(b_nb);
- gtk_grid_attach(GTK_GRID(grid),b_nb,0,3,2,1);
- g_signal_connect(b_nb,"pressed",G_CALLBACK(nb_cb),NULL);
-
- GtkWidget *b_nb2=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nb),"NB2");
- //gtk_widget_override_font(b_nb2, pango_font_description_from_string("Arial 16"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_nb2), nb2==1);
- gtk_widget_show(b_nb2);
- gtk_grid_attach(GTK_GRID(grid),b_nb2,0,4,2,1);
- g_signal_connect(b_nb2,"pressed",G_CALLBACK(nb2_cb),NULL);
-*/
-
GtkWidget *b_anf=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_nr2),"ANF");
//gtk_widget_override_font(b_anf, pango_font_description_from_string("Arial 16"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_anf), anf==1);
//gtk_widget_override_font(close_button, pango_font_description_from_string("Arial 16"));
g_signal_connect(close_button,"clicked",G_CALLBACK(close_cb),(gpointer *)NULL);
gtk_widget_show_all(dialog);
-/*
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- dialog);
-*/
+
last_dialog=dialog;
int result=gtk_dialog_run(GTK_DIALOG(dialog));
}
+*/
}
static void stop() {
#include "toolbar.h"
#include "wdsp.h"
#include "wdsp_init.h"
+#include "new_menu.h"
static GtkWidget *parent_window;
static int my_width;
static GtkWidget *vfo;
static cairo_surface_t *vfo_surface = NULL;
-static int steps[]={1,10,25,50,100,250,500,1000,2500,5000,6250,9000,10000,12500,15000,20000,25000,30000,50000,100000,0};
-static char *step_labels[]={"1Hz","10Hz","25Hz","50Hz","100Hz","250Hz","500Hz","1kHz","2.5kHz","5kHz","6.25kHz","9kHz","10kHz","12.5kHz","15kHz","20kHz","25kHz","30kHz","50kHz","100kHz",0};
+int steps[]={1,10,25,50,100,250,500,1000,2500,5000,6250,9000,10000,12500,15000,20000,25000,30000,50000,100000,0};
+char *step_labels[]={"1Hz","10Hz","25Hz","50Hz","100Hz","250Hz","500Hz","1kHz","2.5kHz","5kHz","6.25kHz","9kHz","10kHz","12.5kHz","15kHz","20kHz","25kHz","30kHz","50kHz","100kHz",0};
static GtkWidget* menu=NULL;
static GtkWidget* band_menu=NULL;
return 0;
}
+/*
static gboolean
vfo_step_select_cb (GtkWidget *widget,
gpointer data)
step=steps[(int)data];
vfo_update(NULL);
}
+*/
static gboolean
vfo_press_event_cb (GtkWidget *widget,
if((int)event->x < (my_width/2)) {
lock_cb(NULL,NULL);
} else {
+ start_step();
+/*
GtkWidget *dialog=gtk_dialog_new_with_buttons("Step",GTK_WINDOW(parent_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL);
GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
dialog);
int result=gtk_dialog_run(GTK_DIALOG(dialog));
+*/
}
return TRUE;
}
#ifndef _VFO_H
#define _VFO_H
-GtkWidget* vfo_init(int width,int height,GtkWidget *parent);
-void vfo_step(int steps);
-void vfo_move(int hz);
-int vfo_update(void*);
+extern int steps[];
+extern char *step_labels[];
+
+extern GtkWidget* vfo_init(int width,int height,GtkWidget *parent);
+extern void vfo_step(int steps);
+extern void vfo_move(int hz);
+extern int vfo_update(void*);
#endif