[xiph-cvs] cvs commit: postfish clippanel.c compandpanel.c eqpanel.c mainpanel.c multibar.c postfish-gtkrc version.h

Monty xiphmont at xiph.org
Thu Feb 19 22:06:01 PST 2004



xiphmont    04/02/20 01:06:01

  Modified:    .        clippanel.c compandpanel.c eqpanel.c mainpanel.c
                        multibar.c postfish-gtkrc version.h
  Log:
  Large chunk of the compander panel implemented; not yet active at all

Revision  Changes    Path
1.13      +8 -8      postfish/clippanel.c

Index: clippanel.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/clippanel.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- clippanel.c	20 Feb 2004 00:33:21 -0000	1.12
+++ clippanel.c	20 Feb 2004 06:06:00 -0000	1.13
@@ -63,7 +63,7 @@
   sprintf(buffer,"%1.2f",linear);
   readout_set(READOUT(p->readout),buffer);
 
-  sprintf(buffer,"%3.0f dB",todB(linear));
+  sprintf(buffer,"%3.0fdB",todB(linear));
   readout_set(READOUT(p->readoutdB),buffer);
 
   declip_settrigger(linear,p->number);
@@ -75,13 +75,13 @@
   int choice=rint(gtk_range_get_value(GTK_RANGE(w)));
   int blocksize=64<<choice;
 
-  sprintf(buffer,"%5d   ",blocksize);
+  sprintf(buffer,"%5d  ",blocksize);
   readout_set(READOUT(samplereadout),buffer);
 
-  sprintf(buffer,"%3.1f ms",blocksize*1000./input_rate);
+  sprintf(buffer,"%3.1fms",blocksize*1000./input_rate);
   readout_set(READOUT(msreadout),buffer);
 
-  sprintf(buffer,"%5d Hz",(int)rint(input_rate*2./blocksize));
+  sprintf(buffer,"%5dHz",(int)rint(input_rate*2./blocksize));
   readout_set(READOUT(hzreadout),buffer);
   
   declip_setblock(blocksize);
@@ -150,9 +150,9 @@
     GtkWidget *samplelabel=gtk_label_new("window sample width");
     GtkWidget *mslabel=gtk_label_new("window time width");
     GtkWidget *hzlabel=gtk_label_new("approximate lowest response");
-    samplereadout=readout_new("00000   ");
-    msreadout=readout_new("00000 ms");
-    hzreadout=readout_new("00000 Hz");
+    samplereadout=readout_new("00000  ");
+    msreadout=readout_new("00000ms");
+    hzreadout=readout_new("00000Hz");
 
     gtk_scale_set_draw_value(GTK_SCALE(slider),FALSE);
     gtk_misc_set_alignment(GTK_MISC(samplelabel),1,.5);
@@ -255,7 +255,7 @@
     GtkWidget *slider=multibar_new(8,slabels,slevels,1,
                                    HI_DECAY|ZERO_DAMP);
     GtkWidget *readout=readout_new("0.00");
-    GtkWidget *readoutdB=readout_new("-40 dB");
+    GtkWidget *readoutdB=readout_new("-40dB");
     GtkWidget *bar=multibar_new(2,labels,levels,0,
                                 HI_DECAY|ZERO_DAMP);
 

<p><p>1.3       +281 -14   postfish/compandpanel.c

Index: compandpanel.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/compandpanel.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- compandpanel.c	20 Feb 2004 02:09:39 -0000	1.2
+++ compandpanel.c	20 Feb 2004 06:06:00 -0000	1.3
@@ -39,6 +39,7 @@
 extern int input_size;
 extern int input_rate;
 
+
 typedef struct {
   GtkWidget *slider;
   GtkWidget *readoutg;
@@ -49,22 +50,110 @@
 
 static cbar bars[freqs];
 
+static void link_toggled(GtkToggleButton *b,gpointer in){
+  int active=gtk_toggle_button_get_active(b);
+  compand_set_link(active);    
+}
+
+static void suppressor_mode(GtkButton *b,gpointer in){
+  int mode=(int)in;
+
+  if(mode)
+    /* peak mode */
+    compand_s_peakmode();
+  else
+    /* rms mode */
+    compand_s_rmsmode();
+
+}
+
+static void suppress_bias_change(GtkWidget *w,gpointer in){
+  char buffer[80];
+  Readout *r=READOUT(in);
+  gdouble val=multibar_get_value(MULTIBAR(w),0);
+
+  sprintf(buffer,"%+2.0fdB",val);
+  readout_set(r,buffer);
+  compand_s_setbias(val);
+}
+
+static void suppress_decay_change(GtkWidget *w,gpointer in){
+  char buffer[80];
+  Readout *r=READOUT(in);
+  gdouble val=-multibar_get_value(MULTIBAR(w),0);
+
+  sprintf(buffer,"%.2f",val);
+
+  if(val==1.)
+    sprintf(buffer,"fast");
+
+  if(val==.01)
+    sprintf(buffer,"slow");
+
+  readout_set(r,buffer);
+  compand_s_setdecay(val);
+}
+
+static void suppress_ratio_change(GtkWidget *w,gpointer in){
+  char buffer[80];
+  Readout *r=READOUT(in);
+  gdouble val=-multibar_get_value(MULTIBAR(w),0);
+
+  sprintf(buffer,"%3.1f:1",1./val);
+
+  if(val==1.)
+    sprintf(buffer,"off");
+
+  if(val==.1)
+    sprintf(buffer,"gate");
+
+  readout_set(r,buffer);
+  compand_s_setratio(val);
+}
+
+static void suppress_depth_change(GtkWidget *w,gpointer in){
+  char buffer[80];
+  Readout *r=READOUT(in);
+  gdouble val=-140.-multibar_get_value(MULTIBAR(w),0);
+  
+  sprintf(buffer,"%3.0fdB",-val);
+
+  if(val==0.)
+    sprintf(buffer,"off");
+
+  if(val==-140)
+    sprintf(buffer,"deep");
+
+  readout_set(r,buffer);
+  compand_s_setdepth(val);
+}
+
+static void envelope_compander_change(GtkWidget *w,gpointer in){
+  char buffer[80];
+  Readout *r=READOUT(in);
+  gdouble val=multibar_get_value(MULTIBAR(w),0);
+
+  sprintf(buffer,"%3.1f%%",val);
+  readout_set(r,buffer);
+  compand_ec_set(val);
+}
+
 static void slider_change(GtkWidget *w,gpointer in){
   char buffer[80];
   cbar *b=(cbar *)in;
 
   gdouble val=multibar_get_value(MULTIBAR(b->slider),0);
-  sprintf(buffer,"%+4.0f dB",val);
+  sprintf(buffer,"%3.0fdB",val);
   readout_set(READOUT(b->readoutg),buffer);
   compand_g_set(b->number,val);
   
   val=multibar_get_value(MULTIBAR(b->slider),1);
-  sprintf(buffer,"%+4.0f dB",val);
+  sprintf(buffer,"%+4.0fdB",val);
   readout_set(READOUT(b->readoute),buffer);
   compand_e_set(b->number,val);
 
   val=multibar_get_value(MULTIBAR(b->slider),2);
-  sprintf(buffer,"%+4.0f dB",val);
+  sprintf(buffer,"%+4.0fdB",val);
   readout_set(READOUT(b->readoutc),buffer);
   compand_c_set(b->number,val);
 
@@ -84,7 +173,187 @@
                                           &compand_visible,
                                           "_Compander and Noise Gate"," [c] ");
   
-  GtkWidget *slidertable=gtk_table_new(freqs,5,0);
+  GtkWidget *hbox=gtk_hbox_new(0,0);
+  GtkWidget *staticbox=gtk_vbox_new(0,0);
+  GtkWidget *envelopeframe=gtk_frame_new(" Envelope Compander ");
+  GtkWidget *suppressframe=gtk_frame_new(" Suppressor ");
+
+  GtkWidget *envelopetable=gtk_table_new(2,3,0);
+  GtkWidget *suppresstable=gtk_table_new(5,3,0);
+
+  GtkWidget *slidertable=gtk_table_new(freqs+1,5,0);
+  
+
+  GtkWidget *link_box=gtk_hbox_new(0,0);
+  GtkWidget *link_check=gtk_check_button_new_with_mnemonic("_link channel envelopes");
+  gtk_box_pack_end(GTK_BOX(link_box),link_check,0,0,0);  
+  gtk_box_pack_end(GTK_BOX(staticbox),link_box,0,0,0);
+  gtk_container_set_border_width(GTK_CONTAINER(link_box),5);
+  g_signal_connect (G_OBJECT (link_check), "toggled",
+		    G_CALLBACK (link_toggled), (gpointer)0);
+  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(link_check),1);
+
+
+  gtk_box_pack_start(GTK_BOX(panel->subpanel_box),hbox,0,0,0);
+  gtk_box_pack_start(GTK_BOX(hbox),slidertable,0,0,0);
+  gtk_box_pack_start(GTK_BOX(hbox),staticbox,0,0,0);
+
+  gtk_box_pack_end(GTK_BOX(staticbox),suppressframe,0,0,0);
+  gtk_box_pack_end(GTK_BOX(staticbox),envelopeframe,0,0,0);
+  gtk_container_add(GTK_CONTAINER(envelopeframe),envelopetable);
+  gtk_container_add(GTK_CONTAINER(suppressframe),suppresstable);
+
+  gtk_container_set_border_width(GTK_CONTAINER(suppressframe),5);
+  gtk_container_set_border_width(GTK_CONTAINER(envelopeframe),5);
+  gtk_container_set_border_width(GTK_CONTAINER(envelopeframe),5);
+
+  /* envelope compand */
+  {
+    double levels[11]={-50,-40,-30,-20,-10,0,10,20,30,40,50};
+    char *labels[10]={"40%","30%","20%","10%","0%","10%","20%",
+		      "30%","40%","50%"};
+    GtkWidget *label1=gtk_label_new("compress");
+    GtkWidget *label2=gtk_label_new("expand");
+    GtkWidget *envelope_compress_readout=readout_new(" 0.0%");
+    GtkWidget *envelope_compress_slider=multibar_slider_new(10,labels,levels,1);
+    
+    gtk_container_set_border_width(GTK_CONTAINER(envelopetable),4);
+    multibar_callback(MULTIBAR(envelope_compress_slider),
+		      envelope_compander_change,
+		      envelope_compress_readout);
+    multibar_thumb_increment(MULTIBAR(envelope_compress_slider),.1,1.);
+
+    gtk_widget_set_name(label1,"smallmarker");
+    gtk_widget_set_name(label2,"smallmarker");
+    gtk_misc_set_alignment(GTK_MISC(label1),0,.5);
+    gtk_misc_set_alignment(GTK_MISC(label2),1,.5);
+
+    gtk_table_attach(GTK_TABLE(envelopetable),label1,0,1,1,2,GTK_FILL,0,2,0);
+    gtk_table_attach(GTK_TABLE(envelopetable),label2,1,2,1,2,GTK_FILL,0,2,0);
+    gtk_table_attach(GTK_TABLE(envelopetable),envelope_compress_slider,
+		     0,2,0,1,GTK_FILL|GTK_EXPAND,GTK_FILL|GTK_EXPAND,0,0);
+    gtk_table_attach(GTK_TABLE(envelopetable),envelope_compress_readout,
+		     2,3,0,1,GTK_FILL,0,0,2);
+
+  }
+
+  /* suppressor */
+  {
+
+    double bias_levels[7]={-30,-20,-10,0,10,20,30};
+    char  *bias_labels[6]={"20","10","0","10","20","30"};
+
+    double decay_levels[7]={-1.,-.5,-.2,-.1,-.05,-.02,-.01};
+    char  *decay_labels[6]={".5",".2",".1",".05",".02","slow"};
+
+    double ratio_levels[7]={-1.,-.67,-.5,-.33,-.25,-.17,-.1};
+    char  *ratio_labels[6]={"1.5:1","2:1","3:1","4:1","6:1","gate"};
+
+    double depth_levels[7]={-140,-130,-120,-110,-100,-80,-0};
+    char  *depth_labels[6]={"10","20","30","40","60","deep"};
+
+    GtkWidget *suppress_bias_slider=multibar_slider_new(6,bias_labels,bias_levels,1);
+    GtkWidget *suppress_decay_slider=multibar_slider_new(6,decay_labels,decay_levels,1);
+    GtkWidget *suppress_ratio_slider=multibar_slider_new(6,ratio_labels,ratio_levels,1);
+    GtkWidget *suppress_depth_slider=multibar_slider_new(6,depth_labels,depth_levels,1);
+    GtkWidget *suppress_bias_readout=readout_new(" +0dB");
+    GtkWidget *suppress_decay_readout=readout_new("fast");
+    GtkWidget *suppress_ratio_readout=readout_new("1.5:1");
+    GtkWidget *suppress_depth_readout=readout_new("gate");
+
+    GtkWidget *label1=gtk_label_new("mode:");
+    GtkWidget *label2=gtk_label_new("bias:");
+    GtkWidget *label3=gtk_label_new("decay:");
+    GtkWidget *label4=gtk_label_new("ratio:");
+    GtkWidget *label5=gtk_label_new("depth:");
+    
+    GtkWidget *envelopebox=gtk_hbox_new(0,0);
+    GtkWidget *suppress_rms_button=gtk_radio_button_new_with_label(NULL,"RMS");
+    GtkWidget *suppress_peak_button=
+      gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(suppress_rms_button),
+						  "peak");
+    gtk_box_pack_start(GTK_BOX(envelopebox),suppress_rms_button,0,0,5);
+    gtk_box_pack_start(GTK_BOX(envelopebox),suppress_peak_button,0,0,5);
+
+
+    g_signal_connect (G_OBJECT (suppress_rms_button), "clicked",
+		      G_CALLBACK (suppressor_mode), (gpointer)0); //To Hell I Go
+    g_signal_connect (G_OBJECT (suppress_peak_button), "clicked",
+		      G_CALLBACK (suppressor_mode), (gpointer)1);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(suppress_rms_button),1);
+
+
+    gtk_container_set_border_width(GTK_CONTAINER(suppresstable),4);
+
+    gtk_misc_set_alignment(GTK_MISC(label1),1,.5);
+    gtk_misc_set_alignment(GTK_MISC(label2),1,.5);
+    gtk_misc_set_alignment(GTK_MISC(label3),1,.5);
+    gtk_misc_set_alignment(GTK_MISC(label4),1,.5);
+    gtk_misc_set_alignment(GTK_MISC(label5),1,.5);
+
+
+    gtk_table_attach(GTK_TABLE(suppresstable),label1,0,1,0,1,GTK_FILL,0,0,0);
+    gtk_table_attach(GTK_TABLE(suppresstable),label2,0,1,1,2,GTK_FILL,0,0,0);
+    gtk_table_attach(GTK_TABLE(suppresstable),label3,0,1,2,3,GTK_FILL,0,0,0);
+    gtk_table_attach(GTK_TABLE(suppresstable),label4,0,1,3,4,GTK_FILL,0,0,0);
+    gtk_table_attach(GTK_TABLE(suppresstable),label5,0,1,4,5,GTK_FILL,0,0,0);
+
+    gtk_table_attach(GTK_TABLE(suppresstable),envelopebox,1,3,0,1,GTK_FILL,0,0,0);
+
+    multibar_callback(MULTIBAR(suppress_bias_slider),
+		      suppress_bias_change,
+		      suppress_bias_readout);
+    multibar_thumb_set(MULTIBAR(suppress_bias_slider),0.,0);
+
+    multibar_callback(MULTIBAR(suppress_decay_slider),
+		      suppress_decay_change,
+		      suppress_decay_readout);
+    multibar_thumb_set(MULTIBAR(suppress_decay_slider),-1.,0);
+
+    multibar_callback(MULTIBAR(suppress_ratio_slider),
+		      suppress_ratio_change,
+		      suppress_ratio_readout);
+    multibar_thumb_set(MULTIBAR(suppress_ratio_slider),-1.,0);
+
+    multibar_callback(MULTIBAR(suppress_depth_slider),
+		      suppress_depth_change,
+		      suppress_depth_readout);
+    multibar_thumb_set(MULTIBAR(suppress_depth_slider),0.,0);
+
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_bias_slider,1,2,1,2,GTK_FILL|GTK_EXPAND,
+		     GTK_FILL|GTK_EXPAND,2,0);
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_decay_slider,1,2,2,3,GTK_FILL|GTK_EXPAND,
+		     GTK_FILL|GTK_EXPAND,2,0);
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_ratio_slider,1,2,3,4,GTK_FILL|GTK_EXPAND,
+		     GTK_FILL|GTK_EXPAND,2,0);
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_depth_slider,1,2,4,5,GTK_FILL|GTK_EXPAND,
+		     GTK_FILL|GTK_EXPAND,2,0);
+
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_bias_readout,2,3,1,2,GTK_FILL,0,0,2);
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_decay_readout,2,3,2,3,GTK_FILL,0,0,2);
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_ratio_readout,2,3,3,4,GTK_FILL,0,0,2);
+    gtk_table_attach(GTK_TABLE(suppresstable),
+		     suppress_depth_readout,2,3,4,5,GTK_FILL,0,0,2);
+
+  }
+
+  {
+    GtkWidget *label2=gtk_label_new("gate");
+    GtkWidget *label3=gtk_label_new("expd");
+    GtkWidget *label4=gtk_label_new("cmpr");
+
+    gtk_table_attach(GTK_TABLE(slidertable),label2,2,3,0,1,GTK_FILL,0,10,0);
+    gtk_table_attach(GTK_TABLE(slidertable),label3,3,4,0,1,GTK_FILL,0,10,0);
+    gtk_table_attach(GTK_TABLE(slidertable),label4,4,5,0,1,GTK_FILL,0,10,0);
+    
+  }
 
   for(i=0;i<freqs;i++){
     const char *labeltext=freq_frequency_label(i);
@@ -92,9 +361,9 @@
     GtkWidget *label=gtk_label_new(labeltext);
     gtk_widget_set_name(label,"smallmarker");
 
-    bars[i].readoutg=readout_new("  +0 dB");
-    bars[i].readoute=readout_new("  +0 dB");
-    bars[i].readoutc=readout_new("  +0 dB");
+    bars[i].readoutg=readout_new("  +0dB");
+    bars[i].readoute=readout_new("  +0dB");
+    bars[i].readoutc=readout_new("  +0dB");
     bars[i].slider=multibar_new(14,labels,levels,3,
                                 LO_DECAY|HI_DECAY|LO_ATTACK|HI_ATTACK);
     bars[i].number=i;
@@ -108,20 +377,18 @@
 
     gtk_misc_set_alignment(GTK_MISC(label),1,.5);
 
-    gtk_table_attach(GTK_TABLE(slidertable),label,0,1,i,i+1,
+    gtk_table_attach(GTK_TABLE(slidertable),label,0,1,i+1,i+2,
                      GTK_FILL,0,10,0);
-    gtk_table_attach(GTK_TABLE(slidertable),bars[i].readoutg,2,3,i,i+1,
+    gtk_table_attach(GTK_TABLE(slidertable),bars[i].readoutg,2,3,i+1,i+2,
                      GTK_FILL,0,0,0);
-    gtk_table_attach(GTK_TABLE(slidertable),bars[i].readoute,3,4,i,i+1,
+    gtk_table_attach(GTK_TABLE(slidertable),bars[i].readoute,3,4,i+1,i+2,
                      GTK_FILL,0,0,0);
-    gtk_table_attach(GTK_TABLE(slidertable),bars[i].readoutc,4,5,i,i+1,
+    gtk_table_attach(GTK_TABLE(slidertable),bars[i].readoutc,4,5,i+1,i+2,
                      GTK_FILL,0,0,0);
-    gtk_table_attach(GTK_TABLE(slidertable),bars[i].slider,1,2,i,i+1,
+    gtk_table_attach(GTK_TABLE(slidertable),bars[i].slider,1,2,i+1,i+2,
                      GTK_FILL|GTK_EXPAND,GTK_FILL|GTK_EXPAND,0,0);
   }
 
-  gtk_box_pack_start(GTK_BOX(panel->subpanel_box),slidertable,1,1,4);
-
 }
 
 static double **peakfeed=0;

<p><p>1.5       +2 -2      postfish/eqpanel.c

Index: eqpanel.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/eqpanel.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- eqpanel.c	20 Feb 2004 02:09:39 -0000	1.4
+++ eqpanel.c	20 Feb 2004 06:06:00 -0000	1.5
@@ -51,7 +51,7 @@
   bar *b=(bar *)in;
   gdouble val=multibar_get_value(MULTIBAR(b->slider),0);
   
-  sprintf(buffer,"%+3.0f dB",val);
+  sprintf(buffer,"%+3.0fdB",val);
   readout_set(READOUT(b->readout),buffer);
   
   eq_set(b->number,val);
@@ -80,7 +80,7 @@
     GtkWidget *label=gtk_label_new(labeltext);
     gtk_widget_set_name(label,"smallmarker");
 
-    bars[i].readout=readout_new("+00 dB");
+    bars[i].readout=readout_new("+00dB");
     bars[i].slider=multibar_new(15,labels,levels,1,
                                 LO_DECAY|HI_DECAY|LO_ATTACK|HI_ATTACK);
     bars[i].number=i;

<p><p>1.33      +3 -3      postfish/mainpanel.c

Index: mainpanel.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/mainpanel.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- mainpanel.c	20 Feb 2004 02:09:39 -0000	1.32
+++ mainpanel.c	20 Feb 2004 06:06:00 -0000	1.33
@@ -262,7 +262,7 @@
   postfish_mainpanel *p=in;
   char buf[80];
   gdouble val=multibar_get_value(MULTIBAR(p->masterdB_s),0);
-  sprintf(buf,"%.1f dB",val);
+  sprintf(buf,"%.1fdB",val);
   readout_set(READOUT(p->masterdB_r),buf);
 
   if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p->masterdB_a)))
@@ -518,7 +518,7 @@
   }else{
     version="";
   }
-  snprintf(versionmarkup,240,"<span size=\"large\" weight=\"bold\" "
+  snprintf(versionmarkup,240," <span size=\"large\" weight=\"bold\" "
            "style=\"italic\" foreground=\"dark blue\">"
            "Postfish</span>  <span size=\"small\" foreground=\"#606060\">"
            "version %s</span> ",
@@ -662,7 +662,7 @@
 
       GtkWidget *masterlabel=gtk_label_new("master:");
       panel->masterdB_a=gtk_toggle_button_new_with_label("[m] active");
-      panel->masterdB_r=readout_new("  0.0 dB");
+      panel->masterdB_r=readout_new("  0.0dB");
       panel->masterdB_s=multibar_slider_new(10,sliderlabels,sliderlevels,1);
       
       multibar_thumb_set(MULTIBAR(panel->masterdB_s),0.,0);

<p><p>1.22      +44 -35    postfish/multibar.c

Index: multibar.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/multibar.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- multibar.c	20 Feb 2004 02:09:39 -0000	1.21
+++ multibar.c	20 Feb 2004 06:06:00 -0000	1.22
@@ -69,7 +69,7 @@
     xpad=2;
   }else{
     if(m->thumbs>1)
-      xpad=height+(height/2-1)/2-1;
+      xpad=height*3/4+6;
     else
       xpad=height/2+1;
   }
@@ -360,7 +360,7 @@
     int px,py;
     int gc=0;
     
-    if(m->levels[i]>=0)gc=1;
+    if(m->levels[i]>0.)gc=1;
     
     gdk_draw_line (m->backing,
                    widget->style->text_gc[gc],
@@ -381,8 +381,9 @@
 
   /* draw frame */
   {
-    int width=widget->allocation.width-xpad;
+    int width=widget->allocation.width;
     int height=widget->allocation.height;
+    int apad=(m->thumbs<2?-height/2+2:3-xpad);
     GdkGC *gc=parent->style->bg_gc[0];
     GdkGC *light_gc=parent->style->light_gc[0];
     GdkGC *dark_gc=parent->style->dark_gc[0];
@@ -390,28 +391,28 @@
 
     /* blank side padding to bg of parent */
     gdk_draw_rectangle(m->backing,gc,1,0,0,xpad,height);
-    gdk_draw_rectangle(m->backing,gc,1,width+1,0,xpad-1,height);
+    gdk_draw_rectangle(m->backing,gc,1,width-xpad+1,0,xpad-1,height);
 
 
     /* blank sides of trough */
     gdk_draw_rectangle(m->backing,gc,1,
                        0,height-lpad,
-		       m->thumblo_x+xpad-1,lpad);
+		       m->thumblo_x+xpad+apad-1,lpad);
     gdk_draw_rectangle(m->backing,gc,1,
-		       m->thumbhi_x+xpad,height-lpad,
-		       width-m->thumbhi_x,lpad);
+		       m->thumbhi_x+xpad-apad,height-lpad,
+		       width-xpad+apad-m->thumbhi_x,lpad);
     
     /* frame */
     if(m->readout){
-      gdk_draw_line(m->backing,dark_gc,xpad-1,0,width,0);
+      gdk_draw_line(m->backing,dark_gc,xpad-1,0,width-xpad,0);
       gdk_draw_line(m->backing,dark_gc,xpad-1,0,xpad-1,height-lpad);
-      gdk_draw_line(m->backing,dark_gc,xpad,height-lpad,width,height-lpad);
-      gdk_draw_line(m->backing,dark_gc,width,height-lpad,width,1);
+      gdk_draw_line(m->backing,dark_gc,xpad,height-lpad,width-xpad,height-lpad);
+      gdk_draw_line(m->backing,dark_gc,width-xpad,height-lpad,width-xpad,1);
       
       gdk_draw_line(m->backing,light_gc,xpad-1,height-lpad+1,
-		    width+1,height-lpad+1);
-      gdk_draw_line(m->backing,light_gc,width+1,0,width+1,height-lpad+1);
-      gdk_draw_line(m->backing,light_gc,xpad,1,width-1,1);
+		    width-xpad+1,height-lpad+1);
+      gdk_draw_line(m->backing,light_gc,width-xpad+1,0,width-xpad+1,height-lpad+1);
+      gdk_draw_line(m->backing,light_gc,xpad,1,width-xpad-1,1);
       gdk_draw_line(m->backing,light_gc,xpad,1,xpad,height-lpad-1);
     }
 
@@ -420,29 +421,29 @@
     if(lpad>2 || m->readout==0){
       if(lpad>2){
         gdk_draw_rectangle(m->backing,mid_gc,1,
-			   xpad+m->thumblo_x,height-lpad+1,
-			   m->thumbhi_x-m->thumblo_x+1,lpad-1);
+			   xpad+m->thumblo_x+apad,height-lpad+1,
+			   m->thumbhi_x-m->thumblo_x-apad*2+1,lpad-1);
         
         gdk_draw_line(m->backing,dark_gc,
-		      m->thumblo_x+xpad-1,height-lpad,
-		      m->thumblo_x+xpad-1,height-1);
+		      m->thumblo_x+xpad+apad-1,height-lpad,
+		      m->thumblo_x+xpad+apad-1,height-1);
         
       }
 
       gdk_draw_line(m->backing,light_gc,
-		    m->thumblo_x+xpad-1,height-1,
-		    m->thumbhi_x+xpad+1,height-1);
+		    m->thumblo_x+xpad+apad-1,height-1,
+		    m->thumbhi_x+xpad-apad+1,height-1);
 
       dark_gc=widget->style->dark_gc[GTK_STATE_ACTIVE];
 
       gdk_draw_line(m->backing,dark_gc,
-		    m->thumblo_x+xpad-1,height-lpad,
-		    m->thumbhi_x+xpad+1,height-lpad);
+		    m->thumblo_x+xpad+apad-1,height-lpad,
+		    m->thumbhi_x+xpad-apad+1,height-lpad);
       
       if(lpad>2)
         gdk_draw_line(m->backing,light_gc,
-		      m->thumbhi_x+xpad+1,height-1,
-		      m->thumbhi_x+xpad+1,height-lpad);
+		      m->thumbhi_x+xpad-apad+1,height-1,
+		      m->thumbhi_x+xpad-apad+1,height-lpad);
 
 
     }
@@ -644,6 +645,7 @@
 
 }
 
+static int transition_thumbfocus=0;
 static gboolean multibar_focus (GtkWidget         *widget,
                                 GtkDirectionType   direction){
   Multibar *m=MULTIBAR(widget);
@@ -652,7 +654,6 @@
   if(m->thumbs==0)return FALSE;
 
   switch(direction){
-  case GTK_DIR_DOWN:
   case GTK_DIR_TAB_FORWARD:
   case GTK_DIR_RIGHT:
     if(m->thumbfocus+1>=m->thumbs){
@@ -662,7 +663,6 @@
       m->thumbfocus++;
     break;
 
-  case GTK_DIR_UP:
   case GTK_DIR_TAB_BACKWARD:
   case GTK_DIR_LEFT:
     if(m->thumbfocus==-1)
@@ -675,6 +675,21 @@
         m->thumbfocus--;
     }
     break;
+
+  case GTK_DIR_UP:
+  case GTK_DIR_DOWN:
+    if(m->thumbfocus==-1){
+      if(transition_thumbfocus>=0 && transition_thumbfocus<m->thumbs)
+	m->thumbfocus=transition_thumbfocus;
+      else
+	m->thumbfocus=0;
+      ret=TRUE;
+    }else{
+      transition_thumbfocus=m->thumbfocus;
+      ret=FALSE;
+    }
+    break;
+
   default:
     ret=FALSE;
   }
@@ -916,18 +931,15 @@
   Multibar *m=MULTIBAR(widget);
   if(m->thumbstate[0]){
     gtk_widget_grab_focus(widget);
-    m->thumbgrab=0;
-    m->thumbfocus=0;
+    transition_thumbfocus=m->thumbgrab=m->thumbfocus=0;
     m->thumbx=m->thumbpixel[0]-event->x;
   }else if(m->thumbstate[1]){
     gtk_widget_grab_focus(widget);
-    m->thumbgrab=1;
-    m->thumbfocus=1;
+    transition_thumbfocus=m->thumbgrab=m->thumbfocus=1;
     m->thumbx=m->thumbpixel[1]-event->x;
   }else if(m->thumbstate[2]){
     gtk_widget_grab_focus(widget);
-    m->thumbgrab=2;
-    m->thumbfocus=2;
+    transition_thumbfocus=m->thumbgrab=m->thumbfocus=2;
     m->thumbx=m->thumbpixel[2]-event->x;
   }
   draw_and_expose(widget);
@@ -951,7 +963,7 @@
 static gboolean refocus(GtkWidget        *widget,
                         GdkEventFocus       *event){
   Multibar *m=MULTIBAR(widget);
-  m->thumbfocus=m->prev_thumbfocus;
+  transition_thumbfocus=m->thumbfocus=m->prev_thumbfocus;
   m->thumbgrab=-1;
   draw_and_expose(widget);
 }
@@ -1013,9 +1025,6 @@
 
     }
 
-
-
-
     if(m->callback)m->callback(GTK_WIDGET(m),m->callbackp);
 
     draw_and_expose(w);

<p><p>1.8       +1 -1      postfish/postfish-gtkrc

Index: postfish-gtkrc
===================================================================
RCS file: /usr/local/cvsroot/postfish/postfish-gtkrc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- postfish-gtkrc	19 Feb 2004 00:49:37 -0000	1.7
+++ postfish-gtkrc	20 Feb 2004 06:06:00 -0000	1.8
@@ -138,7 +138,7 @@
 }
 
 widget "*.GtkLabel" style "panel-text"
-widget "*.smallmarker" style "small-marker"
+widget "*.smallmarker*" style "small-marker"
 
 widget "*.color0" style "left"
 widget "*.color1" style "right"

<p><p>1.36      +2 -2      postfish/version.h

Index: version.h
===================================================================
RCS file: /usr/local/cvsroot/postfish/version.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- version.h	20 Feb 2004 02:09:39 -0000	1.35
+++ version.h	20 Feb 2004 06:06:00 -0000	1.36
@@ -1,2 +1,2 @@
-#define VERSION "$Id: version.h,v 1.35 2004/02/20 02:09:39 xiphmont Exp $ "
-/* DO NOT EDIT: Automated versioning hack [Thu Feb 19 21:08:12 EST 2004] */
+#define VERSION "$Id: version.h,v 1.36 2004/02/20 06:06:00 xiphmont Exp $ "
+/* DO NOT EDIT: Automated versioning hack [Fri Feb 20 01:04:55 EST 2004] */

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list