Commit 52b2fd84 authored by Monty Montgomery's avatar Monty Montgomery

Actually commit some of the compander tinkering.


git-svn-id: https://svn.xiph.org/trunk/postfish@5902 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 9ee0d754
......@@ -10,6 +10,16 @@ BINDIR=$PREFIX/bin
ETCDIR=/etc
MANDIR=$PREFIX/man
# is this a platform that uses IEEE 754/854 32 bit floats? The
# following is good for a speedup on most of these systems, otherwise
# comment it out. Using this define on a system where a 'float' is
# *not* an IEEE 32 bit float will destroy, destroy, destroy the audio.
IEEE=-DNASTY_IEEE_FLOAT32_HACK_IS_FASTER_THAN_LOG=1
SRC = main.c mainpanel.c multibar.c readout.c input.c output.c clippanel.c \
declip.c reconstruct.c multicompand.c windowbutton.c subpanel.c \
feedback.c freq.c eq.c eqpanel.c compandpanel.c subband.c lpc.c
......@@ -19,25 +29,27 @@ OBJ = main.o mainpanel.o multibar.o readout.o input.o output.o clippanel.o \
GCF = `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
all:
$(MAKE) target CFLAGS="-W -O3 -ffast-math $(GCF)"
$(MAKE) target CFLAGS="-W -O3 -ffast-math $(GCF) $(IEEE)"
debug:
$(MAKE) target CFLAGS="-g -W -D__NO_MATH_INLINES $(GCF)"
$(MAKE) target CFLAGS="-g -W -D__NO_MATH_INLINES $(GCF) $(IEEE)"
profile:
$(MAKE) target CFLAGS="-W -pg -g -O3 $(GCF)"
$(MAKE) target CFLAGS="-W -pg -g -O3 -ffast-math $(GCF) $(IEEE)" LIBS="-lgprof-helper"
clean:
rm -f $(OBJ) *.d
rm -f $(OBJ) *.d gmon.out
%.d: %.c
$(CC) -M $(GCF) $< > $@.$$$$; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$
ifneq ($(MAKECMDGOALS),clean)
include $(SRC:.c=.d)
endif
target: $(OBJ)
target: $(OBJ)
./touch-version
$(LD) $(OBJ) $(CFLAGS) -o postfish `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:
$(INSTALL) -d -m 0755 $(BINDIR)
......
......@@ -313,7 +313,7 @@ void clippanel_create(postfish_mainpanel *mp,
mainpanel_inbar=mp->inbar;
subpanel_show_all_but_toplevel(panel);
}
void clippanel_feedback(int displayit){
......
This diff is collapsed.
......@@ -27,5 +27,6 @@ extern void compandpanel_create(postfish_mainpanel *mp,
extern void compandpanel_feedback(int displayit);
extern void compandpanel_reset(void);
extern void compandpanel_set_play(int playp);
......@@ -43,7 +43,7 @@ int pull_eq_feedback(float **peak,float **rms){
/* called only by initial setup */
int eq_load(void){
return freq_load(&eq,eq_freq_list,eq_freqs,input_size);
return freq_load(&eq,eq_freq_list,eq_freqs);
}
/* called only in playback thread */
......
......@@ -101,6 +101,7 @@ void eqpanel_create(postfish_mainpanel *mp,
}
gtk_box_pack_start(GTK_BOX(panel->subpanel_box),slidertable,1,1,4);
subpanel_show_all_but_toplevel(panel);
}
......
This diff is collapsed.
......@@ -44,14 +44,14 @@ typedef struct {
float **cache;
int cache_samples;
int fillstate; /* 0: uninitialized
1: normal
2: eof processed */
1: half-primed
2: nominal
3: eof processed */
} freq_state;
extern void freq_transform_work(float *work,freq_state *f);
extern int pull_freq_feedback(freq_state *ff,float **peak,float **rms);
extern int freq_load(freq_state *f,float *frequencies, int bands,
int blocksize);
extern int freq_load(freq_state *f,float *frequencies, int bands);
extern int freq_reset(freq_state *f);
extern time_linkage *freq_read(time_linkage *in, freq_state *f,
void (*func)(freq_state *f,
......
......@@ -357,7 +357,7 @@ static gboolean mainpanel_keybinding(GtkWidget *widget,
switch(event->keyval){
case GDK_m:
case GDK_t:
/* trigger master dB */
gtk_widget_activate(p->masterdB_a);
break;
......@@ -380,24 +380,21 @@ static gboolean mainpanel_keybinding(GtkWidget *widget,
case GDK_d:
gtk_widget_activate(p->buttonactive[0]);
break;
case GDK_t:
case GDK_c:
gtk_widget_activate(p->buttonactive[1]);
break;
case GDK_n:
case GDK_m:
gtk_widget_activate(p->buttonactive[2]);
break;
case GDK_e:
case GDK_s:
gtk_widget_activate(p->buttonactive[3]);
break;
case GDK_c:
case GDK_e:
gtk_widget_activate(p->buttonactive[4]);
break;
case GDK_l:
gtk_widget_activate(p->buttonactive[5]);
break;
case GDK_o:
gtk_widget_activate(p->buttonactive[6]);
break;
case GDK_a:
gtk_widget_activate(p->cue_set[0]);
break;
......@@ -626,7 +623,7 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){
GtkWidget *box=gtk_hbox_new(0,0);
GtkWidget *masterlabel=gtk_label_new("master:");
panel->masterdB_a=gtk_toggle_button_new_with_label("[m] active");
panel->masterdB_a=gtk_toggle_button_new_with_label("a[t]ten");
panel->masterdB_r=readout_new(" 0.0dB");
panel->masterdB_s=multibar_slider_new(10,sliderlabels,sliderlevels,1);
......@@ -638,9 +635,9 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){
gtk_table_attach(GTK_TABLE(ttable),masterlabel,0,1,3,4,
GTK_FILL,GTK_FILL,0,0);
gtk_box_pack_start(GTK_BOX(box),panel->masterdB_a,0,0,2);
gtk_box_pack_start(GTK_BOX(box),panel->masterdB_s,1,1,0);
gtk_box_pack_start(GTK_BOX(box),panel->masterdB_r,0,0,0);
gtk_box_pack_start(GTK_BOX(box),panel->masterdB_a,0,0,0);
gtk_table_attach_defaults(GTK_TABLE(ttable),box,1,3,3,4);
......@@ -819,12 +816,11 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){
}
mainpanel_panelentry(panel,"_Declip ","[d]",0,clippanel_create);
mainpanel_panelentry(panel,"Cross_Talk ","[t]",1,0);
mainpanel_panelentry(panel,"_Compand/Gate ","[c]",2,compandpanel_create);
mainpanel_panelentry(panel,"_Equalizer ","[e]",3,eqpanel_create);
mainpanel_panelentry(panel,"_Limiter ","[l]",4,0);
mainpanel_panelentry(panel,"_Output Cal. ","[o]",5,0);
mainpanel_panelentry(panel,"_Crosstalk ","[c]",1,0);
mainpanel_panelentry(panel,"_Multicomp ","[m]",2,compandpanel_create);
mainpanel_panelentry(panel,"_Singlecomp ","[s]",3,0);
mainpanel_panelentry(panel,"_Equalizer ","[e]",4,eqpanel_create);
mainpanel_panelentry(panel,"_Limiter ","[l]",5,0);
g_signal_connect (G_OBJECT (panel->toplevel), "delete_event",
G_CALLBACK (shutdown), NULL);
......
......@@ -69,7 +69,7 @@ static void compute(Multibar *m,float *lowvals, float *highvals, int n){
xpad=2;
}else{
if(m->thumbs>1)
xpad=height*3/4+6;
xpad=((height+1)/2)+(height/2-3)*3/2+1;
else
xpad=height/2+1;
}
......@@ -582,7 +582,7 @@ static void draw(GtkWidget *widget,int n){
gdk_draw_line(m->backing,m->boxcolor,x,y+(y1-y)/2,x,0);
if(m->thumbfocus==num){
for(i=0;i<height/2;i++)
for(i=0;i<(height-1)/2;i++)
for(j=0;j<=i*2;j++)
if(!(j&1))
gdk_draw_point(m->backing,black_gc,x-i+j,y+i+2);
......@@ -636,7 +636,7 @@ static void size_request (GtkWidget *widget,GtkRequisition *requisition){
}else{
maxy+=3;
if(m->thumbs>1)
xpad=maxy+(maxy/2-1)/2-1+2;
xpad=((maxy+1)/2)+(maxy/2-3)*3/2+1;
else
xpad=maxy/2+1+2;
}
......
This diff is collapsed.
......@@ -23,42 +23,46 @@
#include "postfish.h"
#define multicomp_freqs 9
#define multicomp_freqs_max 30
#define multicomp_banks 3
static float multicomp_freq_list[multicomp_freqs+1]={
63,
125,
250,
500,
1000,
2000,
4000,
8000,
16000,9e10};
static int multicomp_freqs[multicomp_banks]={10,20,30};
static float multicomp_freq_list[multicomp_banks][multicomp_freqs_max+1]={
{31.5,63,125,250,500,1000,2000,4000,8000,16000,9e10},
{31.5,44,63,88,125,175,250,350,500,700,1000,1400,
2000,2800,4000,5600,8000,11000,16000,22000},
{25,31.5,40,50,63,80,100,125,160,200,250,315,
400,500,630,800,1000,1250,1600,2000,2500,3150,4000,5000,6300,
8000,10000,12500,16000,20000,9e10}
};
static char *multicomp_freq_labels[multicomp_freqs]={
"63",
"125",
"250",
"500",
"1k",
"2k",
"4k",
"8k",
"16k"
static char *multicomp_freq_labels[multicomp_banks][multicomp_freqs_max]={
{"31.5","63","125","250","500","1k","2k","4k","8k","16k"},
{"31.5","44","63","88","125","175","250","350","500","700","1k","1.4k",
"2k","2.8k","4k","5.6k","8k","11k","16k","22k"},
{"25","31.5","40","50","63","80","100","125","160","200","250","315",
"400","500","630","800","1k","1.2k","1.6k","2k","2.5k","3.1k","4k","5k",
"6.3k","8k","10k","12.5k","16k","20k"}
};
typedef struct {
sig_atomic_t static_g[multicomp_freqs_max];
sig_atomic_t static_e[multicomp_freqs_max];
sig_atomic_t static_c[multicomp_freqs_max];
} banked_compand_settings;
typedef struct {
sig_atomic_t link_mode;
sig_atomic_t static_mode;
sig_atomic_t static_trim;
sig_atomic_t static_decay;
sig_atomic_t static_c_trim;
sig_atomic_t static_e_trim;
sig_atomic_t static_g_trim;
sig_atomic_t static_c_decay;
sig_atomic_t static_e_decay;
sig_atomic_t static_g_decay;
sig_atomic_t static_c_ratio;
sig_atomic_t static_e_ratio;
sig_atomic_t static_g[multicomp_freqs];
sig_atomic_t static_e[multicomp_freqs];
sig_atomic_t static_c[multicomp_freqs];
sig_atomic_t envelope_mode;
sig_atomic_t envelope_c;
......@@ -66,13 +70,14 @@ typedef struct {
sig_atomic_t suppress_mode;
sig_atomic_t suppress_ratio;
sig_atomic_t suppress_decay;
sig_atomic_t suppress_bias;
sig_atomic_t suppress_depth;
} compand_settings;
} other_compand_settings;
extern void multicompand_reset();
extern int multicompand_load(void);
extern time_linkage *multicompand_read(time_linkage *in);
extern void multicompand_set_bank(int bank);
extern int pull_multicompand_feedback(float **peak,float **rms,int *bands);
......@@ -138,7 +138,7 @@ style "side" {
}
widget "*.GtkLabel" style "panel-text"
widget "*.smallmarker*" style "small-marker"
widget "*.smallmarker" style "small-marker"
widget "*.color0" style "left"
widget "*.color1" style "right"
......@@ -150,6 +150,8 @@ widget "*.winpanel" style "darkpanel"
widget "*.choiceframe.*" style "frame-text"
widget "*.GtkFrame.GtkLabel" style "frame-label"
widget "*.GtkFrame.GtkHBox.GtkLabel" style "frame-label"
widget "*.framelabel" style "frame-label"
widget "*.Readout*" style "readout"
widget "*.GtkEntry" style "readout"
......
......@@ -28,7 +28,7 @@
#include "windowbutton.h"
#include "subpanel.h"
static int clippanel_hide(GtkWidget *widget,
static int subpanel_hide(GtkWidget *widget,
GdkEvent *event,
gpointer in){
subpanel_generic *p=in;
......@@ -51,10 +51,10 @@ static int windowbutton_action(GtkWidget *widget,
if(active){
if(p->mappedvar)*p->mappedvar=1;
gtk_widget_show_all(p->subpanel_toplevel);
gtk_widget_show(p->subpanel_toplevel);
}else{
if(p->mappedvar)*p->mappedvar=0;
gtk_widget_hide_all(p->subpanel_toplevel);
gtk_widget_hide(p->subpanel_toplevel);
}
return FALSE;
......@@ -104,6 +104,10 @@ static gboolean forward_events(GtkWidget *widget,
return TRUE;
}
void subpanel_show_all_but_toplevel(subpanel_generic *s){
gtk_widget_show_all(s->subpanel_topframe);
}
subpanel_generic *subpanel_create(postfish_mainpanel *mp,
GtkWidget *windowbutton,
GtkWidget *activebutton,
......@@ -113,7 +117,6 @@ subpanel_generic *subpanel_create(postfish_mainpanel *mp,
subpanel_generic *panel=calloc(1,sizeof(*panel));
GdkWindow *root=gdk_get_default_root_window();
GtkWidget *topframe=gtk_frame_new (NULL);
GtkWidget *toplabelbox=gtk_event_box_new();
GtkWidget *toplabelframe=gtk_frame_new(NULL);
......@@ -124,6 +127,7 @@ subpanel_generic *subpanel_create(postfish_mainpanel *mp,
if(activebutton && activevar)
toplabelab=gtk_toggle_button_new_with_label(shortcut);
panel->subpanel_topframe=gtk_frame_new (NULL);
panel->subpanel_windowbutton=toplabelwb;
panel->subpanel_activebutton=toplabelab;
......@@ -146,12 +150,12 @@ subpanel_generic *subpanel_create(postfish_mainpanel *mp,
panel->subpanel_toplevel=gtk_window_new (GTK_WINDOW_TOPLEVEL);
panel->mainpanel=mp;
gtk_container_add (GTK_CONTAINER (panel->subpanel_toplevel), topframe);
gtk_container_add (GTK_CONTAINER (topframe), panel->subpanel_box);
gtk_container_set_border_width (GTK_CONTAINER (topframe), 3);
gtk_container_add (GTK_CONTAINER (panel->subpanel_toplevel), panel->subpanel_topframe);
gtk_container_add (GTK_CONTAINER (panel->subpanel_topframe), panel->subpanel_box);
gtk_container_set_border_width (GTK_CONTAINER (panel->subpanel_topframe), 3);
gtk_container_set_border_width (GTK_CONTAINER (panel->subpanel_box), 5);
gtk_frame_set_shadow_type(GTK_FRAME(topframe),GTK_SHADOW_NONE);
gtk_frame_set_label_widget(GTK_FRAME(topframe),toplabelbox);
gtk_frame_set_shadow_type(GTK_FRAME(panel->subpanel_topframe),GTK_SHADOW_NONE);
gtk_frame_set_label_widget(GTK_FRAME(panel->subpanel_topframe),toplabelbox);
/* space *always* means play/pause */
......@@ -165,7 +169,7 @@ subpanel_generic *subpanel_create(postfish_mainpanel *mp,
/* delete should == hide */
g_signal_connect (G_OBJECT (panel->subpanel_toplevel), "delete-event",
G_CALLBACK (clippanel_hide),
G_CALLBACK (subpanel_hide),
panel);
/* link the mainpanel and subpanel buttons */
......
......@@ -27,6 +27,7 @@ typedef struct{
GtkWidget *subpanel_windowbutton;
GtkWidget *subpanel_activebutton;
GtkWidget *subpanel_toplevel;
GtkWidget *subpanel_topframe;
GtkWidget *subpanel_box;
sig_atomic_t *activevar;
sig_atomic_t *mappedvar;
......@@ -40,3 +41,4 @@ extern subpanel_generic *subpanel_create(postfish_mainpanel *mp,
sig_atomic_t *activevar,
sig_atomic_t *mappedvar,
char *prompt,char *shortcut);
extern void subpanel_show_all_but_toplevel(subpanel_generic *s);
#define VERSION "$Id: version.h,v 1.39 2004/02/29 03:16:17 xiphmont Exp $ "
/* DO NOT EDIT: Automated versioning hack [Sat Feb 28 22:13:31 EST 2004] */
#define VERSION "$Id: version.h,v 1.40 2004/03/08 02:08:23 xiphmont Exp $ "
/* DO NOT EDIT: Automated versioning hack [Sun Mar 7 20:57:40 EST 2004] */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment