Commit 637b80f1 authored by Monty Montgomery's avatar Monty Montgomery

Raft of small cosmetic bugfixes to mixdown feedback

Plate reverb is now linked in and working



git-svn-id: https://svn.xiph.org/trunk/postfish@6722 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent a1a9e00d
......@@ -23,12 +23,12 @@ 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 \
bessel.c suppresspanel.c suppress.c singlecomp.c singlepanel.c \
limit.c limitpanel.c mute.c mixpanel.c mix.c reverb.c
limit.c limitpanel.c mute.c mixpanel.c mix.c reverb.c reverbpanel.c
OBJ = main.o mainpanel.o multibar.o readout.o input.o output.o clippanel.o \
declip.o reconstruct.o multicompand.o windowbutton.o subpanel.o \
feedback.o freq.o eq.o eqpanel.o compandpanel.o subband.o lpc.o \
bessel.o suppresspanel.o suppress.o singlecomp.o singlepanel.o \
limit.o limitpanel.o mute.o mixpanel.o mix.o reverb.o
limit.o limitpanel.o mute.o mixpanel.o mix.o reverb.o reverbpanel.o
GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
all:
......
......@@ -40,6 +40,7 @@
#include "limit.h"
#include "mute.h"
#include "mix.h"
#include "reverb.h"
pthread_mutex_t master_mutex=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
......@@ -149,6 +150,7 @@ int main(int argc, char **argv){
if(limit_load(OUTPUT_CHANNELS))exit(1);
if(mute_load())exit(1);
if(mix_load(OUTPUT_CHANNELS))exit(1);
if(plate_load(OUTPUT_CHANNELS))exit(1);
/* look at stdout... do we have a file or device? */
if(!isatty(STDOUT_FILENO)){
......
......@@ -962,7 +962,7 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){
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,"_EQ ",4,0,eqpanel_create_channel);
mainpanel_chentry(panel,channeltable,"_Reverb ",5,0,0);
mainpanel_chentry(panel,channeltable,"_Reverb ",5,0,reverbpanel_create_channel);
mainpanel_chentry(panel,channeltable,"Atten/Mi_x ",6,attenpanel_create,
mixpanel_create_channel);
......@@ -989,17 +989,16 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){
mainpanel_masterentry(panel,mastertable,"_Multicomp "," m ",GDK_m,0,compandpanel_create_master);
mainpanel_masterentry(panel,mastertable,"_Singlecomp "," s ",GDK_s,1,singlepanel_create_master);
mainpanel_masterentry(panel,mastertable,"_Reverb "," r ",GDK_r,2,0);
mainpanel_masterentry(panel,mastertable,"_EQ "," e ",GDK_e,3,eqpanel_create_master);
mainpanel_masterentry(panel,mastertable,"_EQ "," e ",GDK_e,2,eqpanel_create_master);
mainpanel_masterentry(panel,mastertable,"_Reverb "," r ",GDK_r,3,reverbpanel_create_master);
mainpanel_masterentry(panel,mastertable,"_Limit "," l ",GDK_l,4,limitpanel_create);
/* output has three activity buttons not in the main grid */
{
GtkWidget *ww=windowbutton_new("_Output ");
GtkWidget *std=gtk_toggle_button_new_with_label("o");
GtkWidget *ply=gtk_toggle_button_new_with_label("p");
GtkWidget *fil=gtk_toggle_button_new_with_label("f");
GtkWidget *std=gtk_toggle_button_new_with_label(" o ");
GtkWidget *ply=gtk_toggle_button_new_with_label("play");
GtkWidget *box=gtk_hbox_new(0,0);
GtkWidget *box2=gtk_hbox_new(1,0);
......@@ -1011,12 +1010,10 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){
gtk_widget_add_accelerator (std, "activate", panel->group, GDK_o, 0, 0);
gtk_widget_add_accelerator (ply, "activate", panel->group, GDK_p, 0, 0);
gtk_widget_add_accelerator (fil, "activate", panel->group, GDK_f, 0, 0);
gtk_box_pack_start(GTK_BOX(box),ww,0,0,0);
gtk_box_pack_start(GTK_BOX(box),box2,1,1,2);
gtk_box_pack_start(GTK_BOX(box2),ply,1,1,0);
gtk_box_pack_start(GTK_BOX(box2),fil,1,1,0);
gtk_table_attach_defaults(GTK_TABLE(mastertable),fw,0,1,6,7);
......
......@@ -33,7 +33,7 @@ typedef struct postfish_mainpanel postfish_mainpanel;
#include "suppresspanel.h"
#include "limitpanel.h"
#include "mixpanel.h"
#include "mutedummy.h"
#include "reverbpanel.h"
struct postfish_mainpanel{
GtkWidget *twirlimage;
......
......@@ -279,12 +279,17 @@ time_linkage *mix_read(time_linkage *in,
/* eliminate asynch change possibility */
memcpy(ms.curr,mix_set,sizeof(*mix_set)*input_ch);
/* a bit of laziness that may actually save time by avoiding
/* a bit of laziness that may actually save CPU time by avoiding
special-cases later */
for(i=0;i<input_ch;i++)
for(i=0;i<input_ch;i++){
if(mute_channel_muted(in->active,i))
memset(in->data[i],0,sizeof(**in->data)*input_size);
if(mute_channel_muted(inA->active,i))
memset(inA->data[i],0,sizeof(**inA->data)*input_size);
if(mute_channel_muted(inB->active,i))
memset(inB->data[i],0,sizeof(**inB->data)*input_size);
}
/* input-by-input */
for(i=0;i<input_ch;i++){
int feedit=mixpanel_visible[i] && mixpanel_active[i];
......@@ -310,10 +315,10 @@ time_linkage *mix_read(time_linkage *in,
acc+=val;
}
peak[0][i]=peak[0][i];
rms[0][i]=acc/input_size;
}
acc=0.;
if(inA && !mute_channel_muted(inA->active,i)){
memset(mix,0,sizeof(mix));
mixwork(inA->data[i],ms.cacheP[i],ms.cachePP[i],
......@@ -322,14 +327,14 @@ time_linkage *mix_read(time_linkage *in,
bypass=0;
for(j=0;j<input_size;j++){
float val=mix[j]*mix[j];
if(val>peak[0][i])peak[0][i]=val;
if(val>peak[1][i])peak[1][i]=val;
acc+=val;
}
peak[1][i]=peak[0][i];
rms[1][i]=acc/input_size;
}
acc=0.;
if(inB && !mute_channel_muted(inB->active,i)){
memset(mix,0,sizeof(mix));
mixwork(inB->data[i],ms.cacheP[i],ms.cachePP[i],
......@@ -338,11 +343,10 @@ time_linkage *mix_read(time_linkage *in,
bypass=0;
for(j=0;j<input_size;j++){
float val=mix[j]*mix[j];
if(val>peak[0][i])peak[0][i]=val;
if(val>peak[2][i])peak[2][i]=val;
acc+=val;
}
peak[2][i]=peak[0][i];
rms[2][i]=acc/input_size;
}
}
......
......@@ -120,7 +120,8 @@ static float levels_del[6]={-50,-20,-10,-5,-1,0};
static mix_panelsave *mixpanel_create_helper(postfish_mainpanel *mp,
subpanel_generic *panel,
mix_settings *m){
mix_settings *m,
int thisch){
int i,j;
......@@ -177,9 +178,9 @@ static mix_panelsave *mixpanel_create_helper(postfish_mainpanel *mp,
multibar_callback(MULTIBAR(AB->s),AB_slider_change,AB);
multibar_thumb_set(MULTIBAR(AB->s),100,0);
multibar_callback(MULTIBAR(att->s),dB_slider_change,att);
multibar_thumb_set(MULTIBAR(att->s),0,0);
multibar_thumb_set(MULTIBAR(att->s),-3,0);
multibar_callback(MULTIBAR(del->s),ms_slider_change,del);
multibar_thumb_set(MULTIBAR(del->s),0,0);
multibar_thumb_set(MULTIBAR(del->s),-1,0);
ps->place[0]=multibar_new(6,labels_dBn,levels_dBn,0,
LO_ATTACK|LO_DECAY|HI_DECAY);
......@@ -316,7 +317,10 @@ static mix_panelsave *mixpanel_create_helper(postfish_mainpanel *mp,
G_CALLBACK (toggle_callback),
(gpointer)&m->insert_source[i][2]);
if(i==0){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bM),1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bA),1);
}
for(j=0;j<OUTPUT_CHANNELS;j++){
char buffer[80];
......@@ -329,6 +333,9 @@ static mix_panelsave *mixpanel_create_helper(postfish_mainpanel *mp,
G_CALLBACK (toggle_callback),
(gpointer)&m->insert_dest[i][j]);
if(thisch%2 == j && i == 0)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(b),1);
gtk_box_pack_start(GTK_BOX(boxB),b,1,1,0);
}
......@@ -385,7 +392,7 @@ void mixpanel_create_channel(postfish_mainpanel *mp,
&mixpanel_visible[i],
buffer,0,i,1);
mix_panels[i]=mixpanel_create_helper(mp,panel,mix_set+i);
mix_panels[i]=mixpanel_create_helper(mp,panel,mix_set+i,i);
}
}
......@@ -463,6 +470,8 @@ void attenpanel_create(postfish_mainpanel *mp,
GTK_FILL|GTK_EXPAND,0,0,0);
gtk_table_attach(GTK_TABLE(table),del->r,3,4,1+i*3,2+i*3,
GTK_FILL|GTK_EXPAND,0,0,0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(activebutton[i]),1);
}
gtk_box_pack_start(GTK_BOX(panel->subpanel_box),table,1,1,4);
......@@ -488,8 +497,8 @@ void mixpanel_feedback(int displayit){
if(pull_mix_feedback(peakfeed,rmsfeed)==1){
for(j=0;j<input_ch;j++){
for(i=0;i<(MIX_BLOCKS+3);i++){
float rms[input_ch];
float peak[input_ch];
float rms[input_ch+4];
float peak[input_ch+4];
memset(rms,0,sizeof(rms));
memset(peak,0,sizeof(peak));
......@@ -506,7 +515,7 @@ void mixpanel_feedback(int displayit){
peak[3]=todB(peakfeed[2][j])*.5;
multibar_set(MULTIBAR(atten_panel.master[j]),rms,peak,
3,(displayit && atten_visible));
4,(displayit && atten_visible));
break;
case 2:
......
......@@ -604,7 +604,7 @@ static void size_request (GtkWidget *widget,GtkRequisition *requisition){
int i,maxx=0,maxy=0,x,y,xpad;
Multibar *m=MULTIBAR(widget);
for(i=0;i<m->labels;i++){
for(i=0;i<=m->labels;i++){
pango_layout_get_pixel_size(m->layout[i],&x,&y);
if(x>maxx)maxx=x;
......
/*
*
* postfish
*
* Copyright (C) 2002-2004 Monty
*
* Postfish is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* Postfish is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Postfish; see the file COPYING. If not, write to the
* Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
*/
extern void mutedummy_create(postfish_mainpanel *mp,
GtkWidget **windowbutton,
GtkWidget **activebutton);
......@@ -36,6 +36,7 @@
#include "limit.h"
#include "mute.h"
#include "mix.h"
#include "reverb.h"
extern int input_size;
extern int input_rate;
......@@ -67,6 +68,7 @@ void pipeline_reset(){
limit_reset(); /* clear any persistent lapping state */
output_reset(); /* clear any persistent lapping state */
mix_reset();
plate_reset();
}
typedef struct output_feedback{
......@@ -250,8 +252,16 @@ void *playback_thread(void *dummy){
link=eq_read_channel(link);
result|=link->samples;
link=mix_read(link,0,0);
result|=link->samples;
/* per-channel plate reverb generates more channels than it takes;
these are swallowed and mixed immediately by mixdown */
{
time_linkage *reverbA;
time_linkage *reverbB;
link=plate_read_channel(link,&reverbA,&reverbB);
link=mix_read(link,reverbA,reverbB);
result|=link->samples;
}
link=multicompand_read_master(link);
result|=link->samples;
......@@ -259,11 +269,12 @@ void *playback_thread(void *dummy){
result|=link->samples;
link=eq_read_master(link);
result|=link->samples;
link=plate_read_master(link);
result|=link->samples;
if(!result)break;
/************/
/* master att */
if(link->samples>0){
float scale=fromdB(master_att/10.);
......
#define VERSION "$Id$ "
/* DO NOT EDIT: Automated versioning hack [Mon May 17 04:15:01 EDT 2004] */
/* DO NOT EDIT: Automated versioning hack [Mon May 17 17:49:56 EDT 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