This commit is contained in:
Jonathan Moore Liles 2010-01-16 21:51:14 -06:00
parent d0af570a36
commit 0042d8e531
5 changed files with 23 additions and 51 deletions

View File

@ -46,6 +46,8 @@
* optimized out. * optimized out.
*/ */
#include "const.h"
#include "Chain.H" #include "Chain.H"
#include "Module.H" #include "Module.H"
@ -77,12 +79,6 @@
#include <FL/Fl_Flip_Button.H> #include <FL/Fl_Flip_Button.H>
#include "const.h"
std::list <Chain*> Chain::chain;
void void
@ -190,8 +186,6 @@ Chain::Chain ( ) : Fl_Group( 0, 0, 100, 100, "")
end(); end();
chain.push_back( this );
log_create(); log_create();
} }
@ -199,10 +193,10 @@ Chain::~Chain ( )
{ {
DMESSAGE( "Destroying chain" ); DMESSAGE( "Destroying chain" );
chain.remove( this );
log_destroy(); log_destroy();
engine()->lock();
/* if we leave this up to FLTK, it will happen after we've /* if we leave this up to FLTK, it will happen after we've
already destroyed the engine */ already destroyed the engine */
modules_pack->clear(); modules_pack->clear();
@ -266,7 +260,7 @@ Chain::initialize_with_default ( void )
void Chain::cb_handle(Fl_Widget* o) { void Chain::cb_handle(Fl_Widget* o) {
if ( o = tab_button ) if ( o == tab_button )
{ {
Fl_Flip_Button *fb = (Fl_Flip_Button*)o; Fl_Flip_Button *fb = (Fl_Flip_Button*)o;
@ -326,7 +320,6 @@ Chain::remove ( Module *m )
void void
Chain::configure_ports ( void ) Chain::configure_ports ( void )
{ {
/* int old_outs = outs(); */
int nouts = 0; int nouts = 0;
engine()->lock(); engine()->lock();
@ -337,15 +330,7 @@ Chain::configure_ports ( void )
nouts = module( i )->noutputs(); nouts = module( i )->noutputs();
} }
/* outs( nouts ); */ unsigned int req_buffers = required_buffers();
int req_buffers = required_buffers();
/* if ( outs() != old_outs ) */
/* { */
/* if ( configure_outputs_callback() ) */
/* configure_outputs_callback()( this, _configure_outputs_userdata ); */
/* } */
DMESSAGE( "required_buffers = %i", req_buffers ); DMESSAGE( "required_buffers = %i", req_buffers );
@ -366,15 +351,6 @@ Chain::configure_ports ( void )
build_process_queue(); build_process_queue();
/* let the other chains know we mess with their buffers */
for ( std::list<Chain*>::iterator i = chain.begin();
i != chain.end();
++i )
{
if ( *i != this )
(*i)->build_process_queue();
}
engine()->unlock(); engine()->unlock();
parent()->redraw(); parent()->redraw();
@ -425,31 +401,23 @@ Chain::can_configure_outputs ( Module *m, int n ) const
return true; return true;
} }
/* return true if this chain can be converted to support /n/ input channels */
bool
Chain::can_support_input_channels ( int n )
{
/* FIXME: implement */
return true;
}
/* rename chain... we have to let our modules know our name has /* rename chain... we have to let our modules know our name has
* changed so they can take the appropriate action (in particular the * changed so they can take the appropriate action (in particular the
* JACK module). */ * JACK module). */
void void
Chain::name ( const char *name ) Chain::name ( const char *name )
{ {
char ename[512]; char ename[512];
snprintf( ename, sizeof(ename), "%s/%s", APP_NAME, name ); snprintf( ename, sizeof(ename), "%s/%s", APP_NAME, name );
DMESSAGE( "Renaming JACK client" );
_name = engine()->name( ename ); _name = engine()->name( ename );
/* FIXME: discarding the name jack picked is technically wrong! */ /* FIXME: discarding the name jack picked is technically wrong! */
_name = name; _name = name;
for ( int i = 0; i < modules(); ++i ) for ( int i = 0; i < modules(); ++i )
module( i )->handle_chain_name_changed(); module( i )->handle_chain_name_changed();
} }
@ -645,9 +613,9 @@ Chain::build_process_queue ( void )
/* DMESSAGE( "Process queue looks like:" ); */ /* DMESSAGE( "Process queue looks like:" ); */
for ( std::list<Module*>::const_iterator i = process_queue.begin(); i != process_queue.end(); ++i ) /* for ( std::list<Module*>::const_iterator i = process_queue.begin(); i != process_queue.end(); ++i ) */
{ /* { */
const Module* m = *i; /* const Module* m = *i; */
/* if ( m->audio_input.size() || m->audio_output.size() ) */ /* if ( m->audio_input.size() || m->audio_output.size() ) */
/* DMESSAGE( "\t%s", (*i)->name() ); */ /* DMESSAGE( "\t%s", (*i)->name() ); */
@ -656,14 +624,14 @@ Chain::build_process_queue ( void )
/* else if ( m->control_input.size() ) */ /* else if ( m->control_input.size() ) */
/* DMESSAGE( "\t%s <--", (*i)->name() ); */ /* DMESSAGE( "\t%s <--", (*i)->name() ); */
{ /* { */
char *s = m->get_parameters(); /* char *s = m->get_parameters(); */
/* DMESSAGE( "(%s)", s ); */ /* DMESSAGE( "(%s)", s ); */
delete[] s; /* delete[] s; */
} /* } */
} /* } */
} }
void void

View File

@ -68,7 +68,6 @@ class Chain : public Fl_Group, public Loggable {
void add_to_process_queue ( Module *m ); void add_to_process_queue ( Module *m );
std::vector <Module::Port> scratch_port; std::vector <Module::Port> scratch_port;
static std::list <Chain*> chain;
Engine *_engine; Engine *_engine;

View File

@ -20,6 +20,8 @@
/* Filter module. Can host LADPSA Plugins, or can be inherited from to make internal /* Filter module. Can host LADPSA Plugins, or can be inherited from to make internal
modules with special features and appearance. */ modules with special features and appearance. */
#include "const.h"
#include "Plugin_Module.H" #include "Plugin_Module.H"
#include <Fl/fl_draw.H> #include <Fl/fl_draw.H>

View File

@ -11,7 +11,7 @@ Mixer_OBJS:=$(Mixer_SRCS:.C=.o)
Mixer_LIBS := $(FLTK_LIBS) $(JACK_LIBS) $(LASH_LIBS) -llrdf Mixer_LIBS := $(FLTK_LIBS) $(JACK_LIBS) $(LASH_LIBS) -llrdf
Mixer/mixer: $(Mixer_OBJS) FL Mixer/mixer: $(Mixer_OBJS) FL nonlib
@ echo -n Linking mixer... @ echo -n Linking mixer...
@ $(CXX) $(CXXFLAGS) $(Mixer_LIBS) $(Mixer_OBJS) -o $@ -LFL -lfl_widgets -Lnonlib -lnonlib && echo $(DONE) @ $(CXX) $(CXXFLAGS) $(Mixer_LIBS) $(Mixer_OBJS) -o $@ -LFL -lfl_widgets -Lnonlib -lnonlib && echo $(DONE)

View File

@ -53,11 +53,12 @@ namespace JACK
_freezer = NULL; _freezer = NULL;
_client = client; _client = client;
_port = port; _port = port;
_name = strdup( jack_port_name( _port ) ); _name = strdup( jack_port_name( port ) );
} }
Port::Port ( JACK::Client *client, const char *name, type_e dir ) Port::Port ( JACK::Client *client, const char *name, type_e dir )
{ {
_name = NULL;
_freezer = NULL; _freezer = NULL;
_client = client; _client = client;
activate( name, dir ); activate( name, dir );
@ -65,6 +66,7 @@ namespace JACK
Port::Port ( JACK::Client *client, type_e dir, const char *base, int n, const char *type ) Port::Port ( JACK::Client *client, type_e dir, const char *base, int n, const char *type )
{ {
_name = NULL;
_freezer = NULL; _freezer = NULL;
_client = client; _client = client;
@ -75,6 +77,7 @@ namespace JACK
Port::Port ( JACK::Client *client, type_e dir, int n, const char *type ) Port::Port ( JACK::Client *client, type_e dir, int n, const char *type )
{ {
_name = NULL;
_freezer = NULL; _freezer = NULL;
_client = client; _client = client;