[xiph-commits] r18292 - trunk/spectrum

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu May 17 08:14:56 PDT 2012


Author: xiphmont
Date: 2012-05-17 08:14:56 -0700 (Thu, 17 May 2012)
New Revision: 18292

Modified:
   trunk/spectrum/spec_panel.c
   trunk/spectrum/spec_plot.c
   trunk/spectrum/version.h
Log:
Don't impose phase mode/markers when no phase channels are active



Modified: trunk/spectrum/spec_panel.c
===================================================================
--- trunk/spectrum/spec_panel.c	2012-05-17 12:21:43 UTC (rev 18291)
+++ trunk/spectrum/spec_panel.c	2012-05-17 15:14:56 UTC (rev 18292)
@@ -218,6 +218,7 @@
     ch+=channels[fi];
   }
   plot_set_active(PLOT(p->plot),active,bactive);  
+  gtk_alignment_set_padding(GTK_ALIGNMENT(p->plot_label_al),0,0,0,plot_get_right_pad(PLOT(p->plot)));
 }
 
 static void chlabels(GtkWidget *widget,struct panel *p){
@@ -384,7 +385,7 @@
     }
     break;
   }
-
+  gtk_alignment_set_padding(GTK_ALIGNMENT(p->plot_label_al),0,0,0,plot_get_right_pad(PLOT(p->plot)));
 }
 
 static void scalechange(GtkWidget *widget,struct panel *p){

Modified: trunk/spectrum/spec_plot.c
===================================================================
--- trunk/spectrum/spec_plot.c	2012-05-17 12:21:43 UTC (rev 18291)
+++ trunk/spectrum/spec_plot.c	2012-05-17 15:14:56 UTC (rev 18292)
@@ -76,10 +76,21 @@
 
 }
 
+int phase_active_p(Plot *p){
+  if(p->link == LINK_PHASE){
+    int cho=0;
+    int gi;
+    for(gi=0;gi<p->groups;gi++)
+      if(p->ch[gi]>1 && p->ch_active[cho+1])
+        return 1;
+  }
+  return 0;
+}
+
 static void compute_metadata(GtkWidget *widget){
   Plot *p=PLOT(widget);
-  int phase = (p->link == LINK_PHASE);
-  int width=widget->allocation.width-p->padx-(phase?p->phax:0);
+  int phase = phase_active_p(p);
+  int width = widget->allocation.width-p->padx-(phase?p->phax:0);
   int rate=p->maxrate;
   int nyq=p->maxrate/2.;
   int i;
@@ -220,7 +231,7 @@
 		   p->link == LINK_IMPEDENCE_1 ||
 		   p->link == LINK_IMPEDENCE_10);
 #endif
-  int phase = (p->link == LINK_PHASE);
+  int phase = phase_active_p(p);
   int padx = p->padx;
   int phax = phase ? p->phax : 0;
   int pwidth = width - padx - phax;
@@ -1028,7 +1039,7 @@
 
 void plot_refresh (Plot *p, int *process){
   float ymax,pmax,pmin;
-  int phase = (p->link == LINK_PHASE);
+  int phase = phase_active_p(p);
   int width=GTK_WIDGET(p)->allocation.width-p->padx-(phase ? p->phax : 0);
   int height=GTK_WIDGET(p)->allocation.height-p->pady;
   float **data;
@@ -1145,7 +1156,7 @@
 
   /* finally, align phase/response zeros on phase graphs */
   if(p->disp_ymax>-p->ymax_limit){
-    if(p->link == LINK_PHASE){
+    if(phase){
       /* In a phase/response graph, 0dB/0degrees are bound and always on-screen. */
       float pzero,mzero = (height-1)/p->disp_depth*p->disp_ymax;
 
@@ -1184,7 +1195,7 @@
 
 void plot_clear (Plot *p){
   GtkWidget *widget=GTK_WIDGET(p);
-  int phase = (p->link == LINK_PHASE);
+  int phase = phase_active_p(p);
   int width=GTK_WIDGET(p)->allocation.width-p->padx-(phase ? p->phax : 0);
   int i,j;
 
@@ -1255,5 +1266,5 @@
 }
 
 int plot_get_right_pad (Plot *m){
-  return (m->link==LINK_PHASE ? m->phax : 0);
+  return (phase_active_p(m) ? m->phax : 0);
 }

Modified: trunk/spectrum/version.h
===================================================================
--- trunk/spectrum/version.h	2012-05-17 12:21:43 UTC (rev 18291)
+++ trunk/spectrum/version.h	2012-05-17 15:14:56 UTC (rev 18292)
@@ -1,2 +1,2 @@
 #define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Thu May 17 08:16:16 EDT 2012] */
+/* DO NOT EDIT: Automated versioning hack [Thu May 17 11:14:32 EDT 2012] */



More information about the commits mailing list