kopia lustrzana https://github.com/windytan/slowrx
more sed renaming of variables + functions
rodzic
19de6d649d
commit
f7eed66052
12
common.c
12
common.c
|
@ -65,27 +65,27 @@ double deg2rad (double Deg) {
|
|||
|
||||
|
||||
// Quit
|
||||
void delete_event() {
|
||||
void evt_deletewindow() {
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
// Transform the NoiseAdapt toggle state into a variable
|
||||
void GetAdaptive() {
|
||||
void evt_GetAdaptive() {
|
||||
Adaptive = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(gui.tog_adapt));
|
||||
}
|
||||
|
||||
// Manual Start clicked
|
||||
void ManualStart() {
|
||||
void evt_ManualStart() {
|
||||
ManualActivated = true;
|
||||
}
|
||||
|
||||
// Abort clicked during rx
|
||||
void AbortRx() {
|
||||
void evt_AbortRx() {
|
||||
Abort = true;
|
||||
}
|
||||
|
||||
// Another device selected from list
|
||||
void changeDevices() {
|
||||
void evt_changeDevices() {
|
||||
|
||||
int status;
|
||||
|
||||
|
@ -121,7 +121,7 @@ void changeDevices() {
|
|||
}
|
||||
|
||||
// Clear received picture & metadata
|
||||
void clearPix() {
|
||||
void evt_clearPix() {
|
||||
gdk_pixbuf_fill (DispPixbuf, 0);
|
||||
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), DispPixbuf);
|
||||
gtk_label_set_markup (GTK_LABEL(gui.label_fskid), "");
|
||||
|
|
17
common.h
17
common.h
|
@ -49,6 +49,7 @@ struct _GuiObjs {
|
|||
GtkWidget *tog_fsk;
|
||||
GtkWidget *tog_rx;
|
||||
GtkWidget *tog_save;
|
||||
GtkWidget *tog_setedge;
|
||||
GtkWidget *tog_slant;
|
||||
GtkWidget *window_about;
|
||||
GtkWidget *window_main;
|
||||
|
@ -101,27 +102,27 @@ typedef struct ModeSpecDef {
|
|||
|
||||
extern ModeSpecDef ModeSpec[];
|
||||
|
||||
void AbortRx ();
|
||||
void changeDevices ();
|
||||
void chooseDir ();
|
||||
void clearPix ();
|
||||
void evt_AbortRx ();
|
||||
void evt_changeDevices ();
|
||||
void evt_chooseDir ();
|
||||
void evt_clearPix ();
|
||||
guchar clip (double a);
|
||||
void createGUI ();
|
||||
double deg2rad (double Deg);
|
||||
void delete_event ();
|
||||
void evt_deletewindow ();
|
||||
double FindSync (guchar Mode, double Rate, int *Skip);
|
||||
void GetAdaptive ();
|
||||
void evt_GetAdaptive ();
|
||||
void GetFSK (char *dest);
|
||||
bool GetVideo (guchar Mode, double Rate, int Skip, bool Redraw);
|
||||
guchar GetVIS ();
|
||||
guint GetBin (double Freq, guint FFTLen);
|
||||
int initPcmDevice ();
|
||||
void *Listen ();
|
||||
void ManualStart ();
|
||||
void evt_ManualStart ();
|
||||
void populateDeviceList ();
|
||||
void readPcm (gint numsamples);
|
||||
void setNewRxDir ();
|
||||
void setVU (short int PcmValue, double SNRdB);
|
||||
void show_window_about();
|
||||
void evt_show_about();
|
||||
|
||||
#endif
|
||||
|
|
51
gui.c
51
gui.c
|
@ -16,44 +16,45 @@ void createGUI() {
|
|||
gtk_builder_add_from_file(builder, "slowrx.ui", NULL);
|
||||
gtk_builder_add_from_file(builder, "window_about.ui", NULL);
|
||||
|
||||
gui.button_abort = GTK_WIDGET(gtk_builder_get_object(builder,"BtnAbort"));
|
||||
gui.button_abort = GTK_WIDGET(gtk_builder_get_object(builder,"button_abort"));
|
||||
gui.button_browse = GTK_WIDGET(gtk_builder_get_object(builder,"button_browse"));
|
||||
gui.button_clear = GTK_WIDGET(gtk_builder_get_object(builder,"BtnClear"));
|
||||
gui.button_start = GTK_WIDGET(gtk_builder_get_object(builder,"BtnStart"));
|
||||
gui.button_clear = GTK_WIDGET(gtk_builder_get_object(builder,"button_clear"));
|
||||
gui.button_start = GTK_WIDGET(gtk_builder_get_object(builder,"button_start"));
|
||||
gui.combo_card = GTK_WIDGET(gtk_builder_get_object(builder,"combo_card"));
|
||||
gui.combo_mode = GTK_WIDGET(gtk_builder_get_object(builder,"combo_mode"));
|
||||
gui.entry_picdir = GTK_WIDGET(gtk_builder_get_object(builder,"entry_picdir"));
|
||||
gui.frame_manual = GTK_WIDGET(gtk_builder_get_object(builder,"ManualFrame"));
|
||||
gui.frame_manual = GTK_WIDGET(gtk_builder_get_object(builder,"frame_manual"));
|
||||
gui.grid_vu = GTK_WIDGET(gtk_builder_get_object(builder,"grid_vu"));
|
||||
gui.iconview = GTK_WIDGET(gtk_builder_get_object(builder,"SavedIconView"));
|
||||
gui.image_devstatus = GTK_WIDGET(gtk_builder_get_object(builder,"image_devstatus"));
|
||||
gui.image_pwr = GTK_WIDGET(gtk_builder_get_object(builder,"PowerImage"));
|
||||
gui.image_pwr = GTK_WIDGET(gtk_builder_get_object(builder,"image_pwr"));
|
||||
gui.image_rx = GTK_WIDGET(gtk_builder_get_object(builder,"image_rx"));
|
||||
gui.image_snr = GTK_WIDGET(gtk_builder_get_object(builder,"SNRImage"));
|
||||
gui.label_fskid = GTK_WIDGET(gtk_builder_get_object(builder,"IDLabel"));
|
||||
gui.image_snr = GTK_WIDGET(gtk_builder_get_object(builder,"image_snr"));
|
||||
gui.label_fskid = GTK_WIDGET(gtk_builder_get_object(builder,"label_fskid"));
|
||||
gui.label_lastmode = GTK_WIDGET(gtk_builder_get_object(builder,"label_lastmode"));
|
||||
gui.label_utc = GTK_WIDGET(gtk_builder_get_object(builder,"label_utc"));
|
||||
gui.menuitem_quit = GTK_WIDGET(gtk_builder_get_object(builder,"menuitem_quit"));
|
||||
gui.menuitem_about = GTK_WIDGET(gtk_builder_get_object(builder,"menuitem_about"));
|
||||
gui.spin_shift = GTK_WIDGET(gtk_builder_get_object(builder,"ShiftSpin"));
|
||||
gui.spin_shift = GTK_WIDGET(gtk_builder_get_object(builder,"spin_shift"));
|
||||
gui.statusbar = GTK_WIDGET(gtk_builder_get_object(builder,"statusbar"));
|
||||
gui.tog_adapt = GTK_WIDGET(gtk_builder_get_object(builder,"TogAdapt"));
|
||||
gui.tog_fsk = GTK_WIDGET(gtk_builder_get_object(builder,"TogFSK"));
|
||||
gui.tog_rx = GTK_WIDGET(gtk_builder_get_object(builder,"TogRx"));
|
||||
gui.tog_save = GTK_WIDGET(gtk_builder_get_object(builder,"TogSave"));
|
||||
gui.tog_slant = GTK_WIDGET(gtk_builder_get_object(builder,"TogSlant"));
|
||||
gui.tog_adapt = GTK_WIDGET(gtk_builder_get_object(builder,"tog_adapt"));
|
||||
gui.tog_fsk = GTK_WIDGET(gtk_builder_get_object(builder,"tog_fsk"));
|
||||
gui.tog_rx = GTK_WIDGET(gtk_builder_get_object(builder,"tog_rx"));
|
||||
gui.tog_save = GTK_WIDGET(gtk_builder_get_object(builder,"tog_save"));
|
||||
gui.tog_setedge = GTK_WIDGET(gtk_builder_get_object(builder,"tog_setedge"));
|
||||
gui.tog_slant = GTK_WIDGET(gtk_builder_get_object(builder,"tog_slant"));
|
||||
gui.window_about = GTK_WIDGET(gtk_builder_get_object(builder,"window_about"));
|
||||
gui.window_main = GTK_WIDGET(gtk_builder_get_object(builder,"window_main"));
|
||||
gui.iconview = GTK_WIDGET(gtk_builder_get_object(builder,"SavedIconView"));
|
||||
|
||||
g_signal_connect (gui.menuitem_quit, "activate", G_CALLBACK(delete_event), NULL);
|
||||
g_signal_connect (gui.window_main, "delete-event", G_CALLBACK(delete_event), NULL);
|
||||
g_signal_connect (gui.menuitem_about,"activate", G_CALLBACK(show_window_about), NULL);
|
||||
g_signal_connect_swapped(gui.tog_adapt, "toggled", G_CALLBACK(GetAdaptive), NULL);
|
||||
g_signal_connect (gui.button_start, "clicked", G_CALLBACK(ManualStart), NULL);
|
||||
g_signal_connect (gui.button_abort, "clicked", G_CALLBACK(AbortRx), NULL);
|
||||
g_signal_connect (gui.combo_card, "changed", G_CALLBACK(changeDevices), NULL);
|
||||
g_signal_connect (gui.button_browse, "clicked", G_CALLBACK(chooseDir), NULL);
|
||||
g_signal_connect (gui.button_clear, "clicked", G_CALLBACK(clearPix), NULL);
|
||||
g_signal_connect (gui.button_abort, "clicked", G_CALLBACK(evt_AbortRx), NULL);
|
||||
g_signal_connect (gui.button_browse, "clicked", G_CALLBACK(evt_chooseDir), NULL);
|
||||
g_signal_connect (gui.button_clear, "clicked", G_CALLBACK(evt_clearPix), NULL);
|
||||
g_signal_connect (gui.button_start, "clicked", G_CALLBACK(evt_ManualStart), NULL);
|
||||
g_signal_connect (gui.combo_card, "changed", G_CALLBACK(evt_changeDevices), NULL);
|
||||
g_signal_connect (gui.menuitem_quit, "activate", G_CALLBACK(evt_deletewindow), NULL);
|
||||
g_signal_connect (gui.menuitem_about,"activate", G_CALLBACK(evt_show_about), NULL);
|
||||
g_signal_connect_swapped(gui.tog_adapt, "toggled", G_CALLBACK(evt_GetAdaptive), NULL);
|
||||
g_signal_connect (gui.window_main, "delete-event", G_CALLBACK(evt_deletewindow), NULL);
|
||||
|
||||
savedstore = GTK_LIST_STORE(gtk_icon_view_get_model(GTK_ICON_VIEW(gui.iconview)));
|
||||
|
||||
|
@ -132,7 +133,7 @@ void setVU (short int PcmValue, double SNRdB) {
|
|||
|
||||
}
|
||||
|
||||
void chooseDir() {
|
||||
void evt_chooseDir() {
|
||||
GtkWidget *dialog;
|
||||
dialog = gtk_file_chooser_dialog_new ("Select folder",
|
||||
GTK_WINDOW(gui.window_main),
|
||||
|
@ -149,7 +150,7 @@ void chooseDir() {
|
|||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
void show_window_about() {
|
||||
void evt_show_about() {
|
||||
gtk_dialog_run(GTK_DIALOG(gui.window_about));
|
||||
gtk_widget_hide(gui.window_about);
|
||||
}
|
||||
|
|
38
slowrx.ui
38
slowrx.ui
|
@ -2,7 +2,7 @@
|
|||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<object class="GtkAction" id="action1"/>
|
||||
<object class="GtkAdjustment" id="ShiftAdj">
|
||||
<object class="GtkAdjustment" id="adjust_shift">
|
||||
<property name="lower">-700</property>
|
||||
<property name="upper">1400</property>
|
||||
<property name="step_increment">10</property>
|
||||
|
@ -179,7 +179,7 @@
|
|||
<property name="left_padding">10</property>
|
||||
<property name="right_padding">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="IDLabel">
|
||||
<object class="GtkLabel" id="label_fskid">
|
||||
<property name="width_request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
|
@ -324,7 +324,7 @@
|
|||
<property name="valign">start</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="OptsFrame">
|
||||
<object class="GtkFrame" id="frame_rxcontrol">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="valign">start</property>
|
||||
|
@ -344,7 +344,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="column_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="TogSlant">
|
||||
<object class="GtkToggleButton" id="tog_slant">
|
||||
<property name="label" translatable="yes">AutoSlant</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
@ -364,7 +364,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="TogSave">
|
||||
<object class="GtkToggleButton" id="tog_save">
|
||||
<property name="label" translatable="yes">AutoSave</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
@ -384,7 +384,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="TogAdapt">
|
||||
<object class="GtkToggleButton" id="tog_adapt">
|
||||
<property name="label" translatable="yes">NoiseAdapt</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
@ -404,7 +404,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="BtnAbort">
|
||||
<object class="GtkButton" id="button_abort">
|
||||
<property name="label" translatable="yes">Abort</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
|
@ -423,7 +423,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="TogRx">
|
||||
<object class="GtkToggleButton" id="tog_rx">
|
||||
<property name="label" translatable="yes">AutoStart</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
@ -457,7 +457,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="TogFSK">
|
||||
<object class="GtkToggleButton" id="tog_fsk">
|
||||
<property name="label" translatable="yes">FSKID</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
@ -477,7 +477,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="BtnClear">
|
||||
<object class="GtkButton" id="button_clear">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
|
@ -528,7 +528,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="SlantFrame">
|
||||
<object class="GtkFrame" id="frame_slant">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
|
@ -543,7 +543,7 @@
|
|||
<property name="left_padding">10</property>
|
||||
<property name="right_padding">10</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="EdgeToggle">
|
||||
<object class="GtkToggleButton" id="tog_setedge">
|
||||
<property name="label" translatable="yes">Set left edge</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
@ -568,7 +568,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="ManualFrame">
|
||||
<object class="GtkFrame" id="frame_manual">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="valign">start</property>
|
||||
|
@ -650,7 +650,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="ShiftSpin">
|
||||
<object class="GtkSpinButton" id="spin_shift">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
|
@ -659,7 +659,7 @@
|
|||
<property name="has_frame">False</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="adjustment">ShiftAdj</property>
|
||||
<property name="adjustment">adjust_shift</property>
|
||||
<property name="snap_to_ticks">True</property>
|
||||
<property name="numeric">True</property>
|
||||
</object>
|
||||
|
@ -677,7 +677,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="BtnStart">
|
||||
<object class="GtkButton" id="button_start">
|
||||
<property name="label" translatable="yes">Start</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
@ -713,7 +713,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="LevelFrame">
|
||||
<object class="GtkFrame" id="frame_levels">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
|
@ -759,7 +759,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="PowerImage">
|
||||
<object class="GtkImage" id="image_pwr">
|
||||
<property name="width_request">100</property>
|
||||
<property name="height_request">20</property>
|
||||
<property name="visible">True</property>
|
||||
|
@ -774,7 +774,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="SNRImage">
|
||||
<object class="GtkImage" id="image_snr">
|
||||
<property name="width_request">100</property>
|
||||
<property name="height_request">20</property>
|
||||
<property name="visible">True</property>
|
||||
|
|
Ładowanie…
Reference in New Issue