[xiph-commits] r6914 - trunk/postfish

xiphmont at dactyl.lonelymoon.com xiphmont
Mon Jun 28 20:05:44 PDT 2004


Author: xiphmont
Date: Mon Jun 28 20:05:44 2004
New Revision: 6914

Modified:
trunk/postfish/Makefile
trunk/postfish/bessel.c
trunk/postfish/declip.c
trunk/postfish/input.c
trunk/postfish/main.c
trunk/postfish/mainpanel.c
trunk/postfish/mix.c
trunk/postfish/multibar.c
trunk/postfish/multibar.h
trunk/postfish/multicompand.c
trunk/postfish/outpanel.c
trunk/postfish/output.c
trunk/postfish/postfish-gtkrc
trunk/postfish/postfish.h
trunk/postfish/reconstruct.c
trunk/postfish/reverb.c
trunk/postfish/singlecomp.c
trunk/postfish/subband.c
trunk/postfish/version.h
Log:
So... this is a big patch from about a month ago, but I was afraid to
commit it because Jack would be angry and come steal me Lucky Charms.

Jack likes me again and me Lucky Charms are ssafely hidden, thus the
patch can now safely go into SVN.



Modified: trunk/postfish/Makefile
===================================================================
--- trunk/postfish/Makefile	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/Makefile	2004-06-29 03:05:41 UTC (rev 6914)
@@ -3,6 +3,7 @@
# and Fuck its little dog Libtool too


+# Use the below line to build for PowerPC
# The PPC build *must* use -maltivec, even if the target is a non-altivec machine

#ADD_DEF= -DUGLY_IEEE754_FLOAT32_HACK=1 -maltivec
@@ -36,8 +37,7 @@
bessel.o suppresspanel.o suppress.o singlecomp.o singlepanel.o \
limit.o limitpanel.o mute.o mixpanel.o mix.o reverb.o reverbpanel.o \
outpanel.o config.o
-#GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
-GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0`
+GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED

all:
$(MAKE) target CFLAGS="-O3 -ffast-math -fomit-frame-pointer $(GCF) $(ADD_DEF)"
@@ -76,7 +76,7 @@

target:  $(OBJ) postfish-wisdomrc
./touch-version
-	$(LD) $(OBJ) $(CFLAGS) -o postfish $(LIBS) `pkg-config --libs gtk+-2.0` -lpthread -lfftw3f -lm
+	$(LD) $(OBJ) $(CFLAGS) -o postfish $(LIBS) `pkg-config --libs gtk+-2.0` -lpthread -lfftw3f -lm

install: target
$(INSTALL) -d -m 0755 $(BINDIR)

Modified: trunk/postfish/bessel.c
===================================================================
--- trunk/postfish/bessel.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/bessel.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -196,6 +196,10 @@
int state=is->state;
int i=0;

+  if(zerome(y0) && zerome(y1)){
+    y0=y1=0.;
+  }
+
if(x[0]>y0)state=0;

while(i<n){
@@ -253,6 +257,10 @@
double y0=is->y[0];
int i=0;

+  if(zerome(y0)){
+    y0=0.;
+  }
+
while(i<n){
double yd;

@@ -281,6 +289,10 @@
double y1=is->y[1];
int i=0;

+  if(zerome(y0) && zerome(y1)){
+    y0=y1=0.;
+  }
+
while(i<n){
double yd;
if(y1<y0)y1=y0; // slope fixup
@@ -314,6 +326,10 @@
double y1=is->y[1];
int i=0;

+  if(zerome(y0) && zerome(y1)){
+    y0=y1=0.;
+  }
+
while(i<n){
double yd;

@@ -346,6 +362,10 @@
double x2=is->x[2],y2=is->y[2];
int i=0;

+  if(zerome(y0) && zerome(y1) && zerome(y2)){
+    y0=y1=y2=0.;
+  }
+
while(i<n){
double yd;
if(y1<y0)y1=y0; // slope fixup
@@ -381,6 +401,10 @@
double x3=is->x[3],y3=is->y[3];
int i=0;

+  if(zerome(y0) && zerome(y1) && zerome(y2) && zerome(y3)){
+    y0=y1=y2=y3=0.;
+  }
+
while(i<n){
double yd;
if(y1<y0)y1=y0; // slope fixup
@@ -419,6 +443,10 @@

int i=0;

+  if(zerome(y0) && zerome(y1)){
+    y0=y1=0.;
+  }
+
while(i<n){
double yd= (x[i]+x0*2.+x1)/g + y0*c0+y1*c1;
x1=x0;x0=x[i];
@@ -446,6 +474,10 @@

int i=0;

+  if(zerome(y0) && zerome(y1) && zerome(y2)){
+    y0=y1=y2=0.;
+  }
+
while(i<n){
double yd= (x[i]+(x0+x1)*3.+x2)/g + y0*c0+y1*c1+y2*c2;
x2=x1;x1=x0;x0=x[i];
@@ -474,6 +506,10 @@

int i=0;

+  if(zerome(y0) && zerome(y1) && zerome(y2) && zerome(y3)){
+    y0=y1=y2=y3=0.;
+  }
+
while(i<n){
double yd= (x[i]+(x0+x2)*4.+x1*6.+x3)/g +
y0*c0+y1*c1+y2*c2+y3*c3;

Modified: trunk/postfish/declip.c
===================================================================
--- trunk/postfish/declip.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/declip.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -201,10 +201,11 @@
return 0;
}

+int noisy=0;
static void sliding_bark_average(float *f,int n,float width){
int i=0;
-  float acc=0.,del=0.;
-  float sec[hipad+1];
+  double acc=0.,del=0.;
+  double sec[hipad+1];

memset(sec,0,sizeof(sec));

@@ -233,7 +234,6 @@
f[(i<<1)+1]=f[i<<1]=1./(acc*acc);
del+=sec[i+lopad];
acc+=del;
-
}
f[n+1]=f[n]=f[n-1];
}
@@ -244,7 +244,15 @@
int *runningtotal, int *runningcount){
float flag[blocksize*2];
int    iterbound,i,count=0;
-
+
+  /* too many apps screw up proper output scaling, so previously
+     clipped audio ends up getting rounded to just short of the rail
+     upon export.  To avoid users accidentally shooting themselves in
+     the foot, trigger clipping at -.05dB rather than 0dB even if 0dB
+     is selected. This corresponds to mis-rounding 8 bit audio by 1.5
+     steps.*/
+  if(trigger>.99426)trigger=.99426;
+
for(i=blocksize/2;i<blocksize*3/2;i++){
flag[i]=0.;
if(work[i]>=trigger || work[i]<=-trigger){
@@ -252,6 +260,7 @@
count++;
}
}
+

*runningtotal+=blocksize;
*runningcount+=count;
@@ -259,7 +268,6 @@
if(count){
for(i=0;i<blocksize/2;i++)flag[i]=0.;
for(i=blocksize*3/2;i<blocksize*2;i++)flag[i]=0.;
-
for(i=0;i<blocksize;i++)work[i+blocksize/2]*=window[i];

fftwf_execute(fftwf_weight);
@@ -268,10 +276,11 @@
if(iterbound<10)iterbound=10;

reconstruct(work,freq,flag,epsilon,iterbound);
-
+
for(i=0;i<blocksize;i++)work[i+blocksize/2]*=window[i];
}else
for(i=0;i<blocksize;i++)work[i+blocksize/2]*=window[i]*window[i];
+
}

/* called only by playback thread */
@@ -596,6 +605,5 @@
}

out.active=active;
-
return &out;
}

Modified: trunk/postfish/input.c
===================================================================
--- trunk/postfish/input.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/input.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -599,7 +599,7 @@
return 0;
}

-off_t input_seek_i(off_t pos,int ps){
+static off_t input_seek_i(off_t pos,int ps){
int i,k;
int flag=0;
off_t maxpos=0;
@@ -692,7 +692,6 @@
unsigned char *readbuf, int dataoff,
int ch,int bytes, int signp, int n){
int i,j,k=0;
-  int32_t val;
int32_t xor=(signp?0:0x80000000UL);
float scale=1./2147483648.;

@@ -702,8 +701,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=(readbuf[k]<<24)^xor;
-	data[j][i]=(val==0x7f000000?1.:val*scale);
+	data[j][i]=((readbuf[k]<<24)^xor)*scale;
k++;
}
break;
@@ -712,8 +710,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=((readbuf[k]<<16)|(readbuf[k+1]<<24))^xor;
-	data[j][i]=(val==0x7fff0000?1.:val*scale);
+	data[j][i]=(((readbuf[k]<<16)|(readbuf[k+1]<<24))^xor)*scale;
k+=2;
}
break;
@@ -722,8 +719,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=((readbuf[k]<<8)|(readbuf[k+1]<<16)|(readbuf[k+2]<<24))^xor;
-	data[j][i]=(val==0x7fffff00?1.:val*scale);
+	data[j][i]=(((readbuf[k]<<8)|(readbuf[k+1]<<16)|(readbuf[k+2]<<24))^xor)*scale;
k+=3;
}
break;
@@ -732,8 +728,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=((readbuf[k])|(readbuf[k+1]<<8)|(readbuf[k+2]<<16)|(readbuf[k+3]<<24))^xor;
-	data[j][i]=(val==0x7fffffff?1.:val*scale);
+	data[j][i]=(((readbuf[k])|(readbuf[k+1]<<8)|(readbuf[k+2]<<16)|(readbuf[k+3]<<24))^xor)*scale;
k+=4;
}
break;
@@ -744,7 +739,6 @@
unsigned char *readbuf, int dataoff,
int ch,int bytes, int signp, int n){
int i,j,k=0;
-  int32_t val;
int32_t xor=(signp?0:0x80000000UL);
float scale=1./2147483648.;

@@ -754,8 +748,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=(readbuf[k]<<24)^xor;
-	data[j][i]=(val==0x7f000000?1.:val*scale);
+	data[j][i]=((readbuf[k]<<24)^xor)*scale;
k++;
}
break;
@@ -764,8 +757,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=((readbuf[k+1]<<16)|(readbuf[k]<<24))^xor;
-	data[j][i]=(val==0x7fff0000?1.:val*scale);
+	data[j][i]=(((readbuf[k+1]<<16)|(readbuf[k]<<24))^xor)*scale;
k+=2;
}
break;
@@ -774,8 +766,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=((readbuf[k+2]<<8)|(readbuf[k+1]<<16)|(readbuf[k]<<24))^xor;
-	data[j][i]=(val==0x7fffff00?1.:val*scale);
+	data[j][i]=(((readbuf[k+2]<<8)|(readbuf[k+1]<<16)|(readbuf[k]<<24))^xor)*scale;
k+=3;
}
break;
@@ -784,8 +775,7 @@

for(i=dataoff;i<dataoff+n;i++)
for(j=0;j<ch;j++){
-	val=((readbuf[k+3])|(readbuf[k+2]<<8)|(readbuf[k+1]<<16)|(readbuf[k]<<24))^xor;
-	data[j][i]=(val==0x7fffffff?1.:val*scale);
+	data[j][i]=(((readbuf[k+3])|(readbuf[k+2]<<8)|(readbuf[k+1]<<16)|(readbuf[k]<<24))^xor)*scale;
k+=4;
}
break;

Modified: trunk/postfish/main.c
===================================================================
--- trunk/postfish/main.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/main.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -53,10 +53,6 @@
char *configfile="postfish-staterc";
char *version;

-static void cleanup(void){
-  save_state();
-}
-
void clean_exit(int sig){
signal(sig,SIG_IGN);
if(sig!=SIGINT){
@@ -72,18 +68,17 @@
"bug as quickly as possible.\n\n"
"-- monty at xiph.org, Postfish revision %s\n\n",sig,version);
configfile="postfish-staterc-crashsave";
-    cleanup();
-    exit(0);
-
+  }else{
+    output_halt_playback();
}

-  /* otherwise we want a clean SIGINT exit */
-  if(main_looping)
+  save_state();
+
+  if(main_looping){
+    main_looping=0;
gtk_main_quit();
-  else{
-    cleanup();
-    exit(0);
}
+  exit(0);
}

const char *optstring = "-c:gh";
@@ -243,9 +238,18 @@
/* We do not care about FPEs; rather, underflow is nominal case, and
its better to ignore other traps in production than to crash the
app.  Please inform the FPU of this. */
+
+#ifndef DEBUG
+  fedisableexcept(FE_INVALID);
fedisableexcept(FE_INEXACT);
fedisableexcept(FE_UNDERFLOW);
fedisableexcept(FE_OVERFLOW);
+#else
+  feenableexcept(FE_INVALID);
+  feenableexcept(FE_INEXACT);
+  feenableexcept(FE_UNDERFLOW);
+  feenableexcept(FE_OVERFLOW);
+#endif

/* Linux Altivec support has a very annoying problem; by default,
math on denormalized floats will simply crash the program.  FFTW3
@@ -317,6 +321,9 @@
}

/* probe outputs */
+  if(setvbuf(stdout, NULL, _IONBF , 0))
+    fprintf(stderr,"Unable to remove block buffering on stdout; continuing\n");
+
output_probe_stdout(STDOUT_FILENO);
output_probe_monitor();

@@ -355,9 +362,6 @@

mainpanel_go(argc,argv,input_ch);

-  output_halt_playback();
-
-  cleanup();
return(0);
}

@@ -365,3 +369,4 @@



+

Modified: trunk/postfish/mainpanel.c
===================================================================
--- trunk/postfish/mainpanel.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/mainpanel.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -36,6 +36,7 @@

static postfish_mainpanel p;
extern char *configfile;
+extern sig_atomic_t main_looping;

static void action_setb_to(postfish_mainpanel *p,const char *time);
static void action_seta_to(postfish_mainpanel *p,const char *time);
@@ -204,7 +205,7 @@
if(p->fishframe==0 && !playback_active){
/* reschedule to blink */
p->fishframe_timer=
-	gtk_timeout_add(rand()%1000*30,(GtkFunction)reanimate_fish,p);
+	g_timeout_add(rand()%1000*30,(GSourceFunc)reanimate_fish,p);
return FALSE;
}
}else{
@@ -220,13 +221,13 @@
if(p->fishframe==12){
/* reschedule to animate */
p->fishframe_timer=
-	gtk_timeout_add(10,(GtkFunction)reanimate_fish,p);
+	g_timeout_add(10,(GSourceFunc)reanimate_fish,p);
return FALSE;
}
if(p->fishframe==0){
/* reschedule to blink */
p->fishframe_timer=
-	gtk_timeout_add(rand()%1000*30,(GtkFunction)reanimate_fish,p);
+	g_timeout_add(rand()%1000*30,(GSourceFunc)reanimate_fish,p);
return FALSE;
}
}
@@ -235,13 +236,13 @@

static void animate_fish(postfish_mainpanel *p){
if(p->fishframe_init){
-    gtk_timeout_remove(p->fishframe_timer);
+    g_source_remove(p->fishframe_timer);
p->fishframe_timer=
-      gtk_timeout_add(80,(GtkFunction)reanimate_fish,p);
+      g_timeout_add(80,(GSourceFunc)reanimate_fish,p);
}else{
p->fishframe_init=1;
p->fishframe_timer=
-      gtk_timeout_add(rand()%1000*30,(GtkFunction)reanimate_fish,p);
+      g_timeout_add(rand()%1000*30,(GSourceFunc)reanimate_fish,p);
}
}

@@ -338,14 +339,17 @@
}

static void shutdown(void){
-  gtk_main_quit ();
+  output_halt_playback();
+  save_state();
+  main_looping=0;
+  gtk_main_quit();
}

static void masterdB_change(GtkWidget *dummy, gpointer in){
postfish_mainpanel *p=in;
char buf[80];
float val=multibar_get_value(MULTIBAR(p->masterdB_s),0);
-  sprintf(buf,"%.1fdB",val);
+  sprintf(buf,"%+5.1fdB",val);
readout_set(READOUT(p->masterdB_r),buf);

if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p->masterdB_a)))
@@ -1056,9 +1060,9 @@
}

mainpanel_chentry(panel,channeltable,"_Declip ",0,clippanel_create,0);
-  mainpanel_chentry(panel,channeltable,"_Multicomp ",1,0,compandpanel_create_channel);
-  mainpanel_chentry(panel,channeltable,"_Singlecomp ",2,0,singlepanel_create_channel);
-  mainpanel_chentry(panel,channeltable,"De_verb ",3,suppresspanel_create_channel,0);
+  mainpanel_chentry(panel,channeltable,"De_verb ",1,suppresspanel_create_channel,0);
+  mainpanel_chentry(panel,channeltable,"_Multicomp ",2,0,compandpanel_create_channel);
+  mainpanel_chentry(panel,channeltable,"_Singlecomp ",3,0,singlepanel_create_channel);
mainpanel_chentry(panel,channeltable,"_EQ ",4,0,eqpanel_create_channel);
mainpanel_chentry(panel,channeltable,"_Reverb ",5,0,reverbpanel_create_channel);
mainpanel_chentry(panel,channeltable,"Atten/Mi_x ",6,attenpanel_create,
@@ -1130,9 +1134,6 @@
g_signal_connect (G_OBJECT (panel->toplevel), "delete_event",
G_CALLBACK (shutdown), NULL);

-  g_signal_connect (G_OBJECT (panel->toplevel), "delete_event",
-		    G_CALLBACK (shutdown), NULL);
-

gtk_widget_show_all(panel->toplevel);
gtk_window_set_resizable(GTK_WINDOW(panel->toplevel),0);
@@ -1181,7 +1182,7 @@

}

-      multibar_set(MULTIBAR(panel->outbar),rms,peak,input_ch,current_p);
+      multibar_set(MULTIBAR(panel->outbar),rms,peak,OUTPUT_CHANNELS,current_p);

if(pull_input_feedback(peak,rms,&time_cursor)){
for(i=0;i<input_ch;i++){
@@ -1237,7 +1238,6 @@
}

#include <stdlib.h>
-extern sig_atomic_t main_looping;
void mainpanel_go(int argc,char *argv[], int ch){
char *homedir=getenv("HOME");
char *labels[33];

Modified: trunk/postfish/mix.c
===================================================================
--- trunk/postfish/mix.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/mix.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -268,9 +268,13 @@
/* fillstate here is only used for lazy initialization/reset */
if(ms.fillstate==0){
/* zero the cache */
-    for(i=0;i<input_ch;i++){
+    for(i=0;i<input_ch;i++){
memset(ms.cacheP[i],0,sizeof(**ms.cacheP)*input_size);
memset(ms.cachePP[i],0,sizeof(**ms.cachePP)*input_size);
+      memset(ms.cachePA[i],0,sizeof(**ms.cachePA)*input_size);
+      memset(ms.cachePPA[i],0,sizeof(**ms.cachePPA)*input_size);
+      memset(ms.cachePB[i],0,sizeof(**ms.cachePB)*input_size);
+      memset(ms.cachePPB[i],0,sizeof(**ms.cachePPB)*input_size);
}
memcpy(ms.prev,ms.curr,sizeof(*mix_set)*input_ch);
ms.fillstate=1;

Modified: trunk/postfish/multibar.c
===================================================================
--- trunk/postfish/multibar.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/multibar.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -552,7 +552,7 @@
gdk_draw_polygon(m->backing,gc,TRUE,p,7);
gdk_draw_lines(m->backing,dark_gc,d,3);

-	if(m->thumbfocus==j){
+	if(m->thumbfocus==j && m->widgetfocus){
if(x&1)
gdk_gc_set_stipple(black_gc,stipple);
else
@@ -632,6 +632,7 @@
int ret=TRUE;

if(m->thumbs==0)return FALSE;
+  if(!m->widgetfocus)m->thumbfocus=-1;

switch(direction){
case GTK_DIR_TAB_FORWARD:
@@ -666,15 +667,16 @@
ret=TRUE;
}else{
transition_thumbfocus=m->thumbfocus;
+      m->thumbfocus=-1;
ret=FALSE;
}
break;

default:
+    m->thumbfocus=-1;
ret=FALSE;
}

-  m->prev_thumbfocus=m->thumbfocus;
if(ret==TRUE) gtk_widget_grab_focus(widget);
draw_and_expose(widget);

@@ -683,40 +685,38 @@

static gint determine_thumb(Multibar *m,int ix, int iy){
GtkWidget *widget=GTK_WIDGET(m);
-  int height=widget->allocation.height;
+  int max=widget->allocation.height;
float distances[3]={-1,-1,-1};
int thumb=-1;

-  /* lower thumb */
+  /* center thumb */
if(m->thumbs==1 || m->thumbs>2){
int num=(m->thumbs==1?0:1);
-
-    int x= ix-m->thumbpixel[num];
-    int y= iy-(height*4/5-2);
-    distances[num]=sqrt(x*x + y*y);
+    int x= m->thumbpixel[num]-ix;
+    distances[num]=fabs(x);
}

/* left thumb */
if(m->thumbs>1){
-    int x= ix-(m->thumbpixel[0]-(height/2));
-    int y= iy-(height/2-3);
-    distances[0]=sqrt(x*x + y*y);
+    int x= m->thumbpixel[0]-ix;
+    distances[0]=fabs(x-.1);
}

/* right thumb */
if(m->thumbs>1){
int num=(m->thumbs==2?1:2);
-    int x= ix-(m->thumbpixel[num]+(height/2));
-    int y= iy-(height/2-3);
-    distances[num]=sqrt(x*x + y*y);
-  }
+    int x= m->thumbpixel[num]-ix;
+    distances[num]=fabs(x+.1);
+   }

-  if(m->thumbs && distances[0]<height)thumb=0;
-  if(m->thumbs>1 && distances[1]<height)
+  if(m->thumbs && distances[0]<max)thumb=0;
+  if(m->thumbs>1 && distances[1]<max)
if(thumb == -1 || distances[1]<distances[0])thumb=1;
-  if(m->thumbs>2 && distances[2]<height)
+  if(m->thumbs>2 && distances[2]<max)
if(thumb == -1 || (distances[2]<distances[0] &&
distances[2]<distances[1]))thumb=2;
+  if(m->thumbs>2 && distances[1]<max/2)thumb=1;
+
return thumb;
}

@@ -844,47 +844,60 @@
}
}
}
+}

+static gint lightme(GtkWidget *w,gint x,gint y){
+  Multibar *m=MULTIBAR(w);
+  int thumb=determine_thumb(m,x,y);
+  GtkStateType thumbstate[3];
+  thumbstate[0]=GTK_STATE_NORMAL;
+  thumbstate[1]=GTK_STATE_NORMAL;
+  thumbstate[2]=GTK_STATE_NORMAL;
+  if(thumb>=0)thumbstate[thumb]=GTK_STATE_PRELIGHT;
+
+  if(thumbstate[0]!=m->thumbstate[0] ||
+     thumbstate[1]!=m->thumbstate[1] ||
+     thumbstate[2]!=m->thumbstate[2]){
+    m->thumbstate[0]=thumbstate[0];
+    m->thumbstate[1]=thumbstate[1];
+    m->thumbstate[2]=thumbstate[2];
+
+    draw_and_expose(w);
+  }
+  return TRUE;
}

static gint multibar_motion(GtkWidget        *w,
GdkEventMotion   *event){
Multibar *m=MULTIBAR(w);
-
+
/* is a thumb already grabbed? */
if(m->thumbgrab>=0){

int x=event->x+m->thumbx;
float v;
-
+
x=pixel_bound(m,x);
m->thumbval[m->thumbgrab]=pixel_to_val(m,x);
vals_bound(m);
v=m->thumbval[m->thumbgrab];
x=m->thumbpixel[m->thumbgrab]=val_to_pixel(m,v);
-
+
if(m->callback)m->callback(GTK_WIDGET(m),m->callbackp);
draw_and_expose(w);
-
+
}else{
/* nothing grabbed right now; determine if we're in a a thumb's area */
-    int thumb=determine_thumb(m,event->x-m->xpad,event->y);
-    GtkStateType thumbstate[3];
-    thumbstate[0]=GTK_STATE_NORMAL;
-    thumbstate[1]=GTK_STATE_NORMAL;
-    thumbstate[2]=GTK_STATE_NORMAL;
-    if(thumb>=0)thumbstate[thumb]=GTK_STATE_PRELIGHT;
+    lightme(w,event->x-m->xpad,event->y);
+  }

-    if(thumbstate[0]!=m->thumbstate[0] ||
-       thumbstate[1]!=m->thumbstate[1] ||
-       thumbstate[2]!=m->thumbstate[2]){
-      m->thumbstate[0]=thumbstate[0];
-      m->thumbstate[1]=thumbstate[1];
-      m->thumbstate[2]=thumbstate[2];
+  return TRUE;
+}

-      draw_and_expose(w);
-    }
-  }
+static gint multibar_enter(GtkWidget        *w,
+			   GdkEventCrossing *event){
+  Multibar *m=MULTIBAR(w);
+  lightme(w,event->x-m->xpad,event->y);
return TRUE;
}

@@ -893,9 +906,9 @@
Multibar *m=MULTIBAR(widget);

if(m->thumbgrab<0){
-    if(0!=m->thumbstate[0] ||
-       0!=m->thumbstate[1] ||
-       0!=m->thumbstate[2]){
+    if(m->thumbstate[0] ||
+       m->thumbstate[1] ||
+       m->thumbstate[2]){
m->thumbstate[0]=0;
m->thumbstate[1]=0;
m->thumbstate[2]=0;
@@ -909,17 +922,19 @@
static gboolean button_press   (GtkWidget        *widget,
GdkEventButton   *event){
Multibar *m=MULTIBAR(widget);
-  if(m->thumbstate[0]){
+  int thumb=determine_thumb(m,event->x-m->xpad,event->y);
+
+  if(thumb==0){
gtk_widget_grab_focus(widget);
-    transition_thumbfocus=m->thumbgrab=m->thumbfocus=0;
+    m->thumbgrab=m->thumbfocus=0;
m->thumbx=m->thumbpixel[0]-event->x;
-  }else if(m->thumbstate[1]){
+  }else if(thumb==1){
gtk_widget_grab_focus(widget);
-    transition_thumbfocus=m->thumbgrab=m->thumbfocus=1;
+    m->thumbgrab=m->thumbfocus=1;
m->thumbx=m->thumbpixel[1]-event->x;
-  }else if(m->thumbstate[2]){
+  }else if(thumb==2){
gtk_widget_grab_focus(widget);
-    transition_thumbfocus=m->thumbgrab=m->thumbfocus=2;
+    m->thumbgrab=m->thumbfocus=2;
m->thumbx=m->thumbpixel[2]-event->x;
}
draw_and_expose(widget);
@@ -937,8 +952,7 @@
static gboolean unfocus(GtkWidget        *widget,
GdkEventFocus       *event){
Multibar *m=MULTIBAR(widget);
-  m->prev_thumbfocus=m->thumbfocus;
-  m->thumbfocus=-1;
+  m->widgetfocus=0;
draw_and_expose(widget);
return TRUE;
}
@@ -946,8 +960,7 @@
static gboolean refocus(GtkWidget        *widget,
GdkEventFocus       *event){
Multibar *m=MULTIBAR(widget);
-  transition_thumbfocus=m->thumbfocus=m->prev_thumbfocus;
-  m->thumbgrab=-1;
+  m->widgetfocus=1;
draw_and_expose(widget);
return TRUE;
}
@@ -1036,6 +1049,7 @@
widget_class->key_press_event = key_press;
widget_class->button_press_event = button_press;
widget_class->button_release_event = button_release;
+  widget_class->enter_notify_event = multibar_enter;
widget_class->leave_notify_event = multibar_leave;
widget_class->motion_notify_event = multibar_motion;
widget_class->focus_out_event = unfocus;

Modified: trunk/postfish/multibar.h
===================================================================
--- trunk/postfish/multibar.h	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/multibar.h	2004-06-29 03:05:41 UTC (rev 6914)
@@ -82,10 +82,12 @@
int    thumbs;
float  thumbval[3];
int    thumbpixel[3];
+
GtkStateType thumbstate[3];
int    thumbfocus;
-  int    prev_thumbfocus;
int    thumbgrab;
+  int    widgetfocus;
+
int    thumbx;
float  thumblo;
float  thumbhi;

Modified: trunk/postfish/multicompand.c
===================================================================
--- trunk/postfish/multicompand.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/multicompand.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -465,6 +465,7 @@
subband_window *wP=ss->wP[channel];
float adj[input_size];

+
if(w==&sw[0]){
bank=0;
}else if(w==&sw[1]){
@@ -567,7 +568,7 @@
currset->base_ratio,
(i>=w->freq_bands?0:adj));

-      if(ss->effect_activeC[channel]){
+      if(ss->effect_active1[channel]){
for(k=0;k<input_size;k++)
x[k]*=fromdB_a(adj[k]);
}
@@ -667,7 +668,7 @@
ms->rms[i][j]=-150;
}
}
-
+
for(i=0;i<ms->ch;i++){
int maxbands=find_maxbands(&ms->ss,i);
if(maxbands>maxmaxbands)maxmaxbands=maxbands;
@@ -707,18 +708,18 @@
float b_attackms=multi_master_set.base_attack*.1;
float b_decayms=multi_master_set.base_decay*.1;

-    if(o_attackms!=master_state.over_attack[0].ms)
-      filterbank_set(&master_state,o_attackms,master_state.over_attack,1);
-    if(o_decayms !=master_state.over_decay[0].ms)
-      filterbank_set(&master_state,o_decayms,master_state.over_decay,0);
-    if(u_attackms!=master_state.under_attack[0].ms)
-      filterbank_set(&master_state,u_attackms,master_state.under_attack,1);
-    if(u_decayms !=master_state.under_decay[0].ms)
-      filterbank_set(&master_state,u_decayms,master_state.under_decay,0);
-    if(b_attackms!=master_state.base_attack[0].ms)
-      filterbank_set(&master_state,b_attackms,master_state.base_attack,1);
-    if(b_decayms !=master_state.base_decay[0].ms)
-      filterbank_set(&master_state,b_decayms,master_state.base_decay,0);
+    if(o_attackms!=ms->over_attack[0].ms)
+      filterbank_set(ms,o_attackms,ms->over_attack,1);
+    if(o_decayms !=ms->over_decay[0].ms)
+      filterbank_set(ms,o_decayms,ms->over_decay,0);
+    if(u_attackms!=ms->under_attack[0].ms)
+      filterbank_set(ms,u_attackms,ms->under_attack,1);
+    if(u_decayms !=ms->under_decay[0].ms)
+      filterbank_set(ms,u_decayms,ms->under_decay,0);
+    if(b_attackms!=ms->base_attack[0].ms)
+      filterbank_set(ms,b_attackms,ms->base_attack,1);
+    if(b_decayms !=ms->base_decay[0].ms)
+      filterbank_set(ms,b_decayms,ms->base_decay,0);
}

return subband_read(in, &master_state.ss, w, visible,active,
@@ -742,18 +743,18 @@
float b_attackms=multi_channel_set[i].base_attack*.1;
float b_decayms=multi_channel_set[i].base_decay*.1;

-    if(o_attackms!=channel_state.over_attack[i].ms)
-      filter_set(&master_state,o_attackms,channel_state.over_attack+i,1);
-    if(o_decayms !=channel_state.over_decay[i].ms)
-      filter_set(&master_state,o_decayms,channel_state.over_decay+i,0);
-    if(u_attackms!=channel_state.under_attack[i].ms)
-      filter_set(&master_state,u_attackms,channel_state.under_attack+i,1);
-    if(u_decayms !=channel_state.under_decay[i].ms)
-      filter_set(&master_state,u_decayms,channel_state.under_decay+i,0);
-    if(b_attackms!=channel_state.base_attack[i].ms)
-      filter_set(&master_state,b_attackms,channel_state.base_attack+i,1);
-    if(b_decayms !=channel_state.base_decay[i].ms)
-      filter_set(&master_state,b_decayms,channel_state.base_decay+i,0);
+    if(o_attackms!=ms->over_attack[i].ms)
+      filter_set(ms,o_attackms,ms->over_attack+i,1);
+    if(o_decayms !=ms->over_decay[i].ms)
+      filter_set(ms,o_decayms,ms->over_decay+i,0);
+    if(u_attackms!=ms->under_attack[i].ms)
+      filter_set(ms,u_attackms,ms->under_attack+i,1);
+    if(u_decayms !=ms->under_decay[i].ms)
+      filter_set(ms,u_decayms,ms->under_decay+i,0);
+    if(b_attackms!=ms->base_attack[i].ms)
+      filter_set(ms,b_attackms,ms->base_attack+i,1);
+    if(b_decayms !=ms->base_decay[i].ms)
+      filter_set(ms,b_decayms,ms->base_decay+i,0);

w[i]=&sw[multi_channel_set[i].active_bank];
visible[i]=multi_channel_set[i].panel_visible;

Modified: trunk/postfish/outpanel.c
===================================================================
--- trunk/postfish/outpanel.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/outpanel.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -80,16 +80,16 @@

config_get_sigat("output_monitor_set",bank,0,0,0,0,&outset.monitor.device);
if(state.monitor.device)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.monitor.device),outset.monitor.device);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.monitor.device),outset.monitor.device);
config_get_sigat("output_monitor_set",bank,0,0,0,1,&outset.monitor.bytes);
if(state.monitor.depth)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.monitor.depth),outset.monitor.bytes);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.monitor.depth),outset.monitor.bytes);
config_get_sigat("output_monitor_set",bank,0,0,0,2,&outset.monitor.ch);
if(state.monitor.ch)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.monitor.ch),outset.monitor.ch);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.monitor.ch),outset.monitor.ch);
config_get_sigat("output_monitor_set",bank,0,0,0,3,&outset.monitor.format);
if(state.monitor.format)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.monitor.format),outset.monitor.format);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.monitor.format),outset.monitor.format);


config_get_vector("output_stdout_source",bank,0,0,0,OUTPUT_CHANNELS,outset.stdout.source);
@@ -99,16 +99,16 @@

config_get_sigat("output_stdout_set",bank,0,0,0,0,&outset.stdout.device);
if(state.stdout.device)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.stdout.device),outset.stdout.device);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.stdout.device),outset.stdout.device);
config_get_sigat("output_stdout_set",bank,0,0,0,1,&outset.stdout.bytes);
if(state.stdout.depth)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.stdout.depth),outset.stdout.bytes);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.stdout.depth),outset.stdout.bytes);
config_get_sigat("output_stdout_set",bank,0,0,0,2,&outset.stdout.ch);
if(state.stdout.ch)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.stdout.ch),outset.stdout.ch);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.stdout.ch),outset.stdout.ch);
config_get_sigat("output_stdout_set",bank,0,0,0,3,&outset.stdout.format);
if(state.stdout.format)
-    gtk_option_menu_set_history(GTK_OPTION_MENU(state.stdout.format),outset.stdout.format);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(state.stdout.format),outset.stdout.format);


}
@@ -116,7 +116,7 @@
static void menuchange(GtkWidget *w,gpointer in){
sig_atomic_t *var=(sig_atomic_t *)in;

-  *var=gtk_option_menu_get_history(GTK_OPTION_MENU(w));
+  *var=gtk_combo_box_get_active(GTK_COMBO_BOX(w));
}

static void buttonchange(GtkWidget *w,gpointer in){
@@ -171,7 +171,7 @@
b=gtk_toggle_button_new_with_label(buffer);

gtk_box_pack_start(GTK_BOX(b1),b,0,0,0);
-      // careful; this breaks (cosmetically) for OUTPUT_CHANNELS>8
+      // careful; this breaks (cosmetically) for OUTPUT_CHANNELS > 8
gtk_widget_add_accelerator (b, "activate", mp->group, GDK_1+i, 0, 0);
gtk_widget_set_sensitive(b,active);
g_signal_connect (G_OBJECT (b), "clicked",
@@ -186,25 +186,20 @@

{
int i;
-    GtkWidget *option_menu=gtk_option_menu_new();
-    GtkWidget *menu=gtk_menu_new();
+    GtkWidget *menu=gtk_combo_box_new_text();

if(devp){
/* device selection */
-      for(i=0;i<monitor_entries;i++){
-	GtkWidget *item=gtk_menu_item_new_with_label(monitor_list[i].name);
-	gtk_menu_shell_append (GTK_MENU_SHELL(menu),item);
-      }
+      for(i=0;i<monitor_entries;i++)
+	gtk_combo_box_append_text (GTK_COMBO_BOX (menu), monitor_list[i].name);

-      if(i==0){
-	GtkWidget *item=gtk_menu_item_new_with_label("stdout");
-	gtk_menu_shell_append (GTK_MENU_SHELL(menu),item);
-      }
+      if(i==0)
+	gtk_combo_box_append_text (GTK_COMBO_BOX (menu), "stdout");

-      g_signal_connect (G_OBJECT (option_menu), "changed",
+      g_signal_connect (G_OBJECT (menu), "changed",
G_CALLBACK (menuchange), &set->device);
-
-      os->device=option_menu;
+
+      os->device=menu;
os->format=0;
}else{

@@ -212,22 +207,19 @@
int i;
char *formats[]={"WAV","AIFF-C","raw (little endian)","raw (big endian)"};

-      for(i=0;i<4;i++){
-	GtkWidget *item=gtk_menu_item_new_with_label(formats[i]);
-	gtk_menu_shell_append (GTK_MENU_SHELL(menu),item);
-      }
-      g_signal_connect (G_OBJECT (option_menu), "changed",
+      for(i=0;i<4;i++)
+	gtk_combo_box_append_text (GTK_COMBO_BOX (menu), formats[i]);
+
+      g_signal_connect (G_OBJECT (menu), "changed",
G_CALLBACK (menuchange), &set->format);
-      os->format=option_menu;
+      os->format=menu;
os->device=0;
}

-    gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu),menu);
-    gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu),0);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(menu),0);

-    gtk_box_pack_start(GTK_BOX(b2),option_menu,1,1,0);
+    gtk_box_pack_start(GTK_BOX(b2),menu,1,1,0);

-    gtk_widget_set_sensitive(option_menu,active);
gtk_widget_set_sensitive(menu,active);

}
@@ -237,24 +229,19 @@
{
/* channels selection */
int i;
-    GtkWidget *option_menu=gtk_option_menu_new();
-    GtkWidget *menu=gtk_menu_new();
+    GtkWidget *menu=gtk_combo_box_new_text();
char *formats[]={"auto","1","2","4","6","8"};

-    for(i=0;i<6;i++){
-      GtkWidget *item=gtk_menu_item_new_with_label(formats[i]);
-      gtk_menu_shell_append (GTK_MENU_SHELL(menu),item);
-    }
+    for(i=0;i<6;i++)
+      gtk_combo_box_append_text (GTK_COMBO_BOX (menu), formats[i]);

-    gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu),menu);
-    gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu),0);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(menu),0);

-    gtk_box_pack_start(GTK_BOX(b3),option_menu,1,1,0);
-    gtk_widget_set_sensitive(option_menu,active);
+    gtk_box_pack_start(GTK_BOX(b3),menu,1,1,0);
gtk_widget_set_sensitive(menu,active);
-    g_signal_connect (G_OBJECT (option_menu), "changed",
+    g_signal_connect (G_OBJECT (menu), "changed",
G_CALLBACK (menuchange), &set->ch);
-    os->ch=option_menu;
+    os->ch=menu;
}
gtk_table_attach(GTK_TABLE(table),b3,1,2,2,3,GTK_FILL,0,0,0);

@@ -262,26 +249,21 @@
{
/* bit depth selection */
int i;
-    GtkWidget *option_menu=gtk_option_menu_new();
-    GtkWidget *menu=gtk_menu_new();
+    GtkWidget *menu=gtk_combo_box_new_text();
char *formats[]={"auto","8","16","24"};

-    for(i=0;i<4;i++){
-      GtkWidget *item=gtk_menu_item_new_with_label(formats[i]);
-      gtk_menu_shell_append (GTK_MENU_SHELL(menu),item);
-    }
+    for(i=0;i<4;i++)
+      gtk_combo_box_append_text (GTK_COMBO_BOX (menu), formats[i]);

-    gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu),menu);
-    gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu),0);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(menu),0);

-    gtk_box_pack_start(GTK_BOX(b4),option_menu,1,1,0);
-    gtk_widget_set_sensitive(option_menu,active);
+    gtk_box_pack_start(GTK_BOX(b4),menu,1,1,0);
gtk_widget_set_sensitive(menu,active);

-    g_signal_connect (G_OBJECT (option_menu), "changed",
+    g_signal_connect (G_OBJECT (menu), "changed",
G_CALLBACK (menuchange), &set->bytes);

-    os->depth=option_menu;
+    os->depth=menu;
}
gtk_table_attach(GTK_TABLE(table),b4,1,2,3,4,GTK_FILL,0,0,0);


Modified: trunk/postfish/output.c
===================================================================
--- trunk/postfish/output.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/output.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -474,12 +474,13 @@
/* try to lower the DSP delay; this ioctl may fail gracefully */
{

-      long bytesperframe=input_size*local_ch*2;
+      long bytesperframe=(local_bits+7)/8*local_ch*input_size;
int fraglog=ilog(bytesperframe);
-      int fragment=0x00040000|fraglog;
+      int fragment=0x00040000|fraglog,fragcheck;

+      fragcheck=fragment;
int ret=ioctl(fd,SNDCTL_DSP_SETFRAGMENT,&fragment);
-      if(ret){
+      if(ret || fragcheck!=fragment){
fprintf(stderr,"Could not set DSP fragment size; continuing.\n");
}
}
@@ -832,12 +833,12 @@
result|=link->samples;
link=declip_read(link);
result|=link->samples;
+    link=suppress_read_channel(link);
+    result|=link->samples;
link=multicompand_read_channel(link);
result|=link->samples;
link=singlecomp_read_channel(link);
result|=link->samples;
-    link=suppress_read_channel(link);
-    result|=link->samples;
link=eq_read_channel(link);
result|=link->samples;

@@ -915,11 +916,16 @@
fcntl(mfd,F_SETFL,0); /* unset non-blocking */
monitor_fd=fdopen(dup(mfd),"wb");
close(mfd);
+
if(monitor_fd==NULL){
fprintf(stderr,"unable to fdopen audio monitor device %s for playback.\n",
monitor_list[monitor_devicenum].file);
outpanel_monitor_off();
}else{
+		if(setvbuf(monitor_fd, NULL, _IONBF , 0)){
+		  fprintf(stderr,"Unable to remove block buffering on audio monitor; continuing\n");
+		}
+
if(output_startup(monitor_fd,monitor_list[monitor_devicenum].type,0,input_rate,
&monitor_ch,&monitor_endian,&monitor_bits,&monitor_signp)){
outpanel_monitor_off();

Modified: trunk/postfish/postfish-gtkrc
===================================================================
--- trunk/postfish/postfish-gtkrc	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/postfish-gtkrc	2004-06-29 03:05:41 UTC (rev 6914)
@@ -182,7 +182,7 @@
widget "*.GtkEntry" style "readout"
widget "*.GtkHScale" style "slider"
widget "*.GtkMenu*" style "button-poppy"
-widget "*.GtkOptionMenu*" style "button-poppy"
+widget "*.GtkComboBox*" style "button-poppy"
widget "*.GtkToggleButton*" style "button-poppy"
widget "*.GtkButton*" style "button-poppy"
widget "*.GtkCheckButton" style "check-poppy"
@@ -198,3 +198,4 @@

widget "*.clipbar*" style "clipbar"

+

Modified: trunk/postfish/postfish.h
===================================================================
--- trunk/postfish/postfish.h	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/postfish.h	2004-06-29 03:05:41 UTC (rev 6914)
@@ -57,10 +57,18 @@
return logf((x)*(x)+1e-30f)*4.34294480f;
}

+static inline double todBd(double x){
+  return log((x)*(x)+1e-30)*4.34294480;
+}
+
static inline float fromdB(float x){
return expf((x)*.11512925f);
}

+static inline int zerome(double x){
+  return (x*x < 1.e-30);
+}
+
#ifdef UGLY_IEEE754_FLOAT32_HACK

static inline float todB_a(const float *x){

Modified: trunk/postfish/reconstruct.c
===================================================================
--- trunk/postfish/reconstruct.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/reconstruct.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -42,7 +42,6 @@
static float *s;
static int blocksize=0;

-
void reconstruct_init(int minblock,int maxblock){
int i;

@@ -132,6 +131,7 @@
/* compute initial Atb */
for(j=0;j<n;j++)q[j]=x[j]*(flag[j]-1.);
AtWA(w,n);
+  res_new=res_0=inner_product(q,q,n);
for(j=0;j<n;j++)Atb[j]=q[j];

/* compute initial residue */
@@ -144,9 +144,9 @@
for(j=0;j<n;j++)q[j]=d[j]=s[j]*=flag[j];

phi_new=inner_product(r,d,n);
-  res_new=res_0=inner_product(Atb,Atb,n);

for(i=0;i<max && sqrt(res_new)/sqrt(res_0)>e;i++){
+
AtWA(w,n);
alpha=phi_new/inner_product(d,q,n);
for(j=0;j<n;j++)x[j]+=alpha*d[j];
@@ -172,4 +172,3 @@
}

}
-

Modified: trunk/postfish/reverb.c
===================================================================
--- trunk/postfish/reverb.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/reverb.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -43,7 +43,8 @@
Project maintainted by Steve Harris, Southampton UK.
steve at plugin.org.uk or swh at ecs.soton.ac.uk

-    Plugin website at http://plugin.org.uk/" */
+    Plugin website at http://plugin.org.uk/"
+*/

#include "postfish.h"
#include "reverb.h"
@@ -136,6 +137,10 @@

wg->dptr_pending = wg->ptr + wg->delay_pending;
if(wg->dptr_pending >= wg->size) wg->dptr_pending -= wg->size;
+  if(wg->dptr==-1){
+    wg->delay=wg->delay_pending;
+    wg->dptr=wg->dptr_pending;
+  }
}

static void waveguide_nl_set_fc(waveguide_nl *wg, float fc){

Modified: trunk/postfish/singlecomp.c
===================================================================
--- trunk/postfish/singlecomp.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/singlecomp.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -475,7 +475,7 @@

if(activeP) reset_filter(scs); /* just became inactive; reset all filters */

-      /* feedabck */
+      /* feedback */
if(scset[i]->panel_visible){
int k;
float rms=0.;

Modified: trunk/postfish/subband.c
===================================================================
--- trunk/postfish/subband.c	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/subband.c	2004-06-29 03:05:41 UTC (rev 6914)
@@ -346,14 +346,16 @@
int active_p1= f->effect_active1[i];
int active_p0= f->effect_active0[i];

+    int muted_pP= mute_channel_muted(f->mutemaskP,i);
int muted_p1= mute_channel_muted(f->mutemask1,i);
+    int muted_p0= mute_channel_muted(f->mutemask0,i);

int maxbands=f->wC[i]->freq_bands;
if(maxbands<f->w0[i]->freq_bands)maxbands=f->w0[i]->freq_bands;
if(maxbands<f->w1[i]->freq_bands)maxbands=f->w1[i]->freq_bands;

/* even if the lapping for a channel is active, we will draw
-       output from the cache is the effect is inactive; it saves
+       output from the cache if the effect is inactive; it saves
performing the summation across bands */

/*   OUTPUT PROCESSING
@@ -420,11 +422,11 @@
for(j=0;j<f->qblocksize;j++)
lo[j]*=lw[j]*scale;

-	} /* otherwise any transitions we need are already windowed as
-	     above by the lap handling code in subband_work */
+	} /* else any transitions we need are already windowed as
+             above by the lap handling code in subband_work */

/* d) window/add cache bits if needed */
-	if(!active_pP){
+	if(!active_pP && !muted_pP){
/* beginning transition */
float *lo=o+f->qblocksize;
float *lc=f->cache1[i]+f->qblocksize;
@@ -435,7 +437,7 @@
for(j=0;j<f->qblocksize;j++)
lo[j]+=lc[j]*lw[j]*scale;

-	}else if (!active_p0){
+	}else if (!active_p0 && !muted_p0){
/* end transition */
float *lo=o+input_size-f->qblocksize*2;
float *lc=f->cache1[i]+input_size-f->qblocksize*2;

Modified: trunk/postfish/version.h
===================================================================
--- trunk/postfish/version.h	2004-06-29 01:24:10 UTC (rev 6913)
+++ trunk/postfish/version.h	2004-06-29 03:05:41 UTC (rev 6914)
@@ -1,2 +1,2 @@
#define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Sat May 29 07:51:35 EDT 2004] */
+/* DO NOT EDIT: Automated versioning hack [Mon Jun 28 22:53:51 EDT 2004] */



More information about the commits mailing list