]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Removed enum in sliders.h, consistently use members from "action" enum
authorc vw <dl1ycf@darc.de>
Wed, 21 Jul 2021 08:00:50 +0000 (10:00 +0200)
committerc vw <dl1ycf@darc.de>
Wed, 21 Jul 2021 08:00:50 +0000 (10:00 +0200)
sliders.c
sliders.h
zoompan.c

index b1e85db97df3fdb2640040c993f8b0ed9125612a..24ee99bd05996236e511f0aa87163889c3922b11 100644 (file)
--- a/sliders.c
+++ b/sliders.c
@@ -67,7 +67,7 @@ static int height;
 static GtkWidget *sliders;
 
 gint scale_timer;
-int scale_status=NO_FUNCTION;
+int scale_status=NO_ACTION;
 int scale_rx=0;
 GtkWidget *scale_dialog;
 
@@ -133,7 +133,7 @@ int sliders_active_receiver_changed(void *data) {
 
 int scale_timeout_cb(gpointer data) {
   gtk_widget_destroy(scale_dialog);
-  scale_status=NO_FUNCTION;
+  scale_status=NO_ACTION;
   return FALSE;
 }
 
@@ -162,13 +162,13 @@ void set_attenuation_value(double value) {
     }
   } else {
     if(scale_status!=ATTENUATION) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       char title[64];
       if (have_rx_gain) {
          sprintf(title,"RX GAIN - ADC-%d (dB)",active_receiver->adc);
@@ -296,13 +296,13 @@ void set_agc_gain(int rx,double value) {
     gtk_range_set_value (GTK_RANGE(agc_scale),receiver[rx]->agc_gain);
   } else {
     if(scale_status!=AGC_GAIN || scale_rx!=rx) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=AGC_GAIN;
       scale_rx=rx;
       char title[64];
@@ -355,13 +355,13 @@ void set_af_gain(int rx,double value) {
     gtk_range_set_value (GTK_RANGE(af_gain_scale),receiver[rx]->volume*100.0);
   } else {
     if(scale_status!=AF_GAIN || scale_rx!=rx) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=AF_GAIN;
       scale_rx=rx;
       char title[64];
@@ -415,13 +415,13 @@ void set_rf_gain(int rx,double value) {
     gtk_range_set_value (GTK_RANGE(rf_gain_scale),adc[receiver[rx]->id].gain);
   } else {
     if(scale_status!=RF_GAIN || scale_rx!=rx) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=RF_GAIN;
       scale_rx=rx;
       char title[64];
@@ -449,13 +449,13 @@ void set_rf_gain(int rx,double value) {
 void set_filter_width(int rx,int width) {
   g_print("%s\n",__FUNCTION__);
     if(scale_status!=IF_WIDTH || scale_rx!=rx) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=IF_WIDTH;
       scale_rx=rx;
       char title[64];
@@ -480,13 +480,13 @@ void set_filter_width(int rx,int width) {
 void set_filter_shift(int rx,int shift) {
   g_print("%s\n",__FUNCTION__);
     if(scale_status!=IF_SHIFT || scale_rx!=rx) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=IF_SHIFT;
       scale_rx=rx;
       char title[64];
@@ -526,13 +526,13 @@ void set_mic_gain(double value) {
       gtk_range_set_value (GTK_RANGE(mic_gain_scale),mic_gain);
     } else {
       if(scale_status!=MIC_GAIN) {
-        if(scale_status!=NO_FUNCTION) {
+        if(scale_status!=NO_ACTION) {
           g_source_remove(scale_timer);
           gtk_widget_destroy(scale_dialog);
-          scale_status=NO_FUNCTION;
+          scale_status=NO_ACTION;
         }
       }
-      if(scale_status==NO_FUNCTION) {
+      if(scale_status==NO_ACTION) {
         scale_status=MIC_GAIN;
         scale_dialog=gtk_dialog_new_with_buttons("Mic Gain",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL);
         GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog));
@@ -560,13 +560,13 @@ void set_linein_gain(int value) {
     gtk_range_set_value (GTK_RANGE(mic_gain_scale),linein_gain);
   } else {
     if(scale_status!=LINEIN_GAIN) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=LINEIN_GAIN;
       scale_dialog=gtk_dialog_new_with_buttons("Linein Gain",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL);
       GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog));
@@ -599,13 +599,13 @@ void set_drive(double value) {
     gtk_range_set_value (GTK_RANGE(drive_scale),value);
   } else {
     if(scale_status!=DRIVE) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=DRIVE;
       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));
@@ -684,13 +684,13 @@ void set_squelch() {
   } else {
 #endif
     if(scale_status!=SQUELCH) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=SQUELCH;
       char title[64];
       sprintf(title,"Squelch RX %d (Hz)",active_receiver->id);
@@ -724,13 +724,13 @@ void set_compression(TRANSMITTER* tx) {
   } else {
 #endif
     if(scale_status!=COMPRESSION) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=COMPRESSION;
       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));
@@ -755,13 +755,13 @@ void set_compression(TRANSMITTER* tx) {
 void show_diversity_gain() {
   g_print("%s\n",__FUNCTION__);
     if(scale_status!=DIV_GAIN) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=DIV_GAIN;
       scale_dialog=gtk_dialog_new_with_buttons("Diversity Gain",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL);
       GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog));
@@ -783,13 +783,13 @@ void show_diversity_gain() {
 void show_diversity_phase() {
   g_print("%s\n",__FUNCTION__);
     if(scale_status!=DIV_PHASE) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=DIV_PHASE;
       scale_dialog=gtk_dialog_new_with_buttons("Diversity Phase",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL);
       GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog));
index c532bdb96834e63b5bb728e69de12b26326b6dd0..877abf60622e935483591415813b5f9a3e6b3f4f 100644 (file)
--- a/sliders.h
+++ b/sliders.h
 #include "receiver.h"
 #include "transmitter.h"
 
-enum {
-  NO_FUNCTION=0,
-  SLIDER_AF_GAIN,
-  SLIDER_RF_GAIN,
-  SLIDER_MIC_GAIN,
-  SLIDER_LINEIN_GAIN,
-  SLIDER_AGC_GAIN,
-  SLIDER_DRIVE,
-  SLIDER_ATTENUATION,
-  SLIDER_SQUELCH,
-  SLIDER_COMP,
-  SLIDER_FILTER_WIDTH,
-  SLIDER_FILTER_SHIFT,
-  SLIDER_DIVERSITY_GAIN,
-  SLIDER_DIVERSITY_PHASE,
-  SLIDER_ZOOM,
-  SLIDER_PAN
-};
-
 extern gint scale_timer;
 extern gint scale_status;
 extern gint scale_rx;
index b9bfe0f915969b7c3a9d22ddee21373f1a922fc8..0e18ead3b70b44758998c8724f09d7689fd5d9b1 100644 (file)
--- a/zoompan.c
+++ b/zoompan.c
@@ -103,14 +103,14 @@ void set_zoom(int rx,double value) {
     gtk_range_set_value (GTK_RANGE(zoom_scale),receiver[rx]->zoom);
   } else {
     if(scale_status!=ZOOM || scale_rx!=rx) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
     receiver_change_zoom(active_receiver,value);
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=ZOOM;
       scale_rx=rx;
       char title[64];
@@ -175,14 +175,14 @@ g_print("set_pan: %f\n",value);
     gtk_range_set_value (GTK_RANGE(pan_scale),receiver[rx]->pan);
   } else {
     if(scale_status!=PAN || scale_rx!=rx) {
-      if(scale_status!=NO_FUNCTION) {
+      if(scale_status!=NO_ACTION) {
         g_source_remove(scale_timer);
         gtk_widget_destroy(scale_dialog);
-        scale_status=NO_FUNCTION;
+        scale_status=NO_ACTION;
       }
     }
     receiver_change_pan(active_receiver,value);
-    if(scale_status==NO_FUNCTION) {
+    if(scale_status==NO_ACTION) {
       scale_status=PAN;
       scale_rx=rx;
       char title[64];