Mixer: Cleanup.

pull/3/head
Jonathan Moore Liles 2010-01-24 20:12:10 -06:00
parent 89a833a33d
commit 209ece1264
17 changed files with 396 additions and 457 deletions

View File

@ -47,9 +47,11 @@
*/
#include "const.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "Chain.H"
#include "Module.H"
#include "Meter_Module.H"
#include "JACK_Module.H"
@ -60,62 +62,21 @@
#include <Fl/Fl_Box.H>
#include <FL/Fl_Menu.H>
#include <FL/fl_ask.H>
#include <stdlib.h>
#include "util/debug.h"
#include <stdio.h>
#include <FL/fl_draw.H>
#include "Engine/Engine.H"
#include <FL/Fl_Flip_Button.H>
#include <FL/Fl_Tabs.H>
#include "FL/Fl_Flowpack.H"
#include "FL/Fl_Scroll.H"
#include "FL/Fl_Packscroller.H"
#include <string.h>
#include <FL/fl_draw.H>
#include "FL/menu_popup.H"
#include "FL/test_press.H"
#include "util/debug.h"
#include "Engine/Engine.H"
#include "Mixer_Strip.H"
#include <dsp.h>
#include <FL/Fl_Flip_Button.H>
void
Chain::get ( Log_Entry &e ) const
{
e.add( ":strip", strip() );
e.add( ":tab", tab_button->value() ? "controls" : "chain" );
}
void
Chain::set ( Log_Entry &e )
{
for ( int i = 0; i < e.size(); ++i )
{
const char *s, *v;
e.get( i, &s, &v );
if ( ! strcmp( s, ":tab" ) )
{
tab_button->value( strcmp( v, "controls" ) == 0 );
tab_button->do_callback();
}
else if ( ! strcmp( s, ":strip" ) )
{
int i;
sscanf( v, "%X", &i );
Mixer_Strip *t = (Mixer_Strip*)Loggable::find( i );
assert( t );
t->chain( this );
}
}
}
@ -220,6 +181,42 @@ Chain::~Chain ( )
void
Chain::get ( Log_Entry &e ) const
{
e.add( ":strip", strip() );
e.add( ":tab", tab_button->value() ? "controls" : "chain" );
}
void
Chain::set ( Log_Entry &e )
{
for ( int i = 0; i < e.size(); ++i )
{
const char *s, *v;
e.get( i, &s, &v );
if ( ! strcmp( s, ":tab" ) )
{
tab_button->value( strcmp( v, "controls" ) == 0 );
tab_button->do_callback();
}
else if ( ! strcmp( s, ":strip" ) )
{
int i;
sscanf( v, "%X", &i );
Mixer_Strip *t = (Mixer_Strip*)Loggable::find( i );
assert( t );
t->chain( this );
}
}
}
void
Chain::log_children ( void )
{
@ -287,18 +284,6 @@ void Chain::cb_handle(Fl_Widget* o) {
control_tab->show();
}
}
/* if ( o == head_button ) */
/* { */
/* Module *m = Module::pick_plugin(); */
/* insert_before( (Module*)modules_pack->child( 0 ), m ); */
/* } */
/* else if ( o == tail_button ) */
/* { */
/* Module *m = Module::pick_plugin(); */
/* insert_before( 0, m ); */
/* } */
}
void Chain::cb_handle(Fl_Widget* o, void* v) {
@ -444,12 +429,6 @@ Chain::name ( const char *name )
module( i )->handle_chain_name_changed();
}
#include "FL/menu_popup.H"
bool
Chain::add ( Module *m )
{
@ -685,6 +664,14 @@ Chain::build_process_queue ( void )
/* } */
}
void
Chain::strip ( Mixer_Strip * ms )
{
_strip = ms;
}
void
Chain::draw ( void )
{
@ -705,8 +692,6 @@ Chain::resize ( int X, int Y, int W, int H )
controls_pack->size( W, controls_pack->h() );
}
#include "FL/test_press.H"
int
Chain::handle ( int m )
{
@ -778,12 +763,12 @@ Chain::handle ( int m )
return Fl_Group::handle( m );
}
void
Chain::strip ( Mixer_Strip * ms )
{
_strip = ms;
}
/**********/
/* Engine */
/**********/
void
Chain::process ( nframes_t nframes, void *v )

View File

@ -37,41 +37,33 @@ class Controller_Module;
class Chain : public Fl_Group, public Loggable {
Fl_Pack *modules_pack;
Fl_Flowpack *controls_pack;
Fl_Flip_Button *tab_button;
Fl_Flowpack *controls_pack;
Fl_Group *chain_tab;
Fl_Group *control_tab;
void cb_handle(Fl_Widget*);
static void cb_handle(Fl_Widget*, void*);
/* int _ins; */
/* int _outs; */
Fl_Pack *modules_pack;
Mixer_Strip *_strip;
// sample_t **_buffer;
// int _nbuffers;
Fl_Callback *_configure_outputs_callback;
void *_configure_outputs_userdata;
const char *_name;
void draw_connections ( Module *m );
std::list<Module*> process_queue;
void build_process_queue ( void );
void add_to_process_queue ( Module *m );
std::vector <Module::Port> scratch_port;
Engine *_engine;
Fl_Callback *_configure_outputs_callback;
void *_configure_outputs_userdata;
private:
void cb_handle(Fl_Widget*);
static void cb_handle(Fl_Widget*, void*);
void draw_connections ( Module *m );
void build_process_queue ( void );
void add_to_process_queue ( Module *m );
static void process ( nframes_t, void * );
void process ( nframes_t );
@ -80,11 +72,14 @@ protected:
void get ( Log_Entry &e ) const;
void set ( Log_Entry &e );
int handle ( int m );
void draw ( void );
public:
Chain ( int X, int Y, int W, int H, const char *L = 0 );
Chain ( );
virtual ~Chain ( );
int handle ( int m );
void draw ( void );
void resize ( int X, int Y, int W, int H );
Mixer_Strip *strip ( void ) const { return _strip; }
@ -95,17 +90,8 @@ public:
void configure_ports ( void );
int required_buffers ( void );
Chain ( int X, int Y, int W, int H, const char *L = 0 );
Chain ( );
virtual ~Chain ( );
bool can_support_input_channels ( int n );
/* void ins ( int i ) { _ins = i; } */
/* void outs ( int i ) { _outs = i; } */
/* int ins ( void ) const { return _ins; } */
/* int outs ( void ) const { return _outs; } */
int modules ( void ) const { return modules_pack->children(); }
Module *module ( int n ) const { return (Module*)modules_pack->child( n ); }
void remove ( Module *m );

View File

@ -17,21 +17,27 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include "const.h"
#include "Controller_Module.H"
#include <stdio.h>
#include <FL/Fl.H>
#include "FL/Fl_Value_SliderX.H"
#include <FL/Fl_Box.H>
#include <FL/Fl_Counter.H>
#include "FL/Fl_Arc_Dial.H"
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/Fl_Menu_.H>
#include "FL/Fl_Light_Button.H"
#include <FL/Fl_Light_Button.H>
#include "FL/Boxtypes.H"
#include <FL/fl_draw.H>
#include "FL/Fl_Arc_Dial.H"
#include "FL/Fl_Labelpad_Group.H"
#include <stdio.h>
#include "FL/Fl_Value_SliderX.H"
#include "FL/test_press.H"
#include "FL/menu_popup.H"
#include "Engine/Engine.H"
#include "Chain.H"
@ -41,6 +47,38 @@ const float CONTROL_UPDATE_FREQ = 0.1f;
Controller_Module::Controller_Module ( bool is_default ) : Module( is_default, 50, 100, name() )
{
// label( "" );
box( FL_NO_BOX );
_pad = true;
control = 0;
control_value =0.0f;
add_port( Port( this, Port::OUTPUT, Port::CONTROL ) );
_mode = GUI;
// mode( GUI );
// mode( CV );
// configure_inputs( 1 );
end();
Fl::add_timeout( CONTROL_UPDATE_FREQ, update_cb, this );
log_create();
}
Controller_Module::~Controller_Module ( )
{
Fl::remove_timeout( update_cb, this );
log_destroy();
}
void
Controller_Module::get ( Log_Entry &e ) const
{
@ -107,72 +145,39 @@ Controller_Module::set ( Log_Entry &e )
Controller_Module::Controller_Module ( bool is_default ) : Module( is_default, 50, 100, name() )
{
// label( "" );
box( FL_NO_BOX );
_pad = true;
control = 0;
control_value =0.0f;
add_port( Port( this, Port::OUTPUT, Port::CONTROL ) );
_mode = GUI;
// mode( GUI );
// mode( CV );
// configure_inputs( 1 );
end();
Fl::add_timeout( CONTROL_UPDATE_FREQ, update_cb, this );
log_create();
}
Controller_Module::~Controller_Module ( )
{
Fl::remove_timeout( update_cb, this );
log_destroy();
}
void
Controller_Module::update_cb ( void *v )
Controller_Module::mode ( Mode m )
{
((Controller_Module*)v)->update_cb();
}
void
Controller_Module::update_cb ( void )
{
Fl::repeat_timeout( CONTROL_UPDATE_FREQ, update_cb, this );
if ( control && control_output[0].connected() )
control->value(control_value);
}
void
Controller_Module::cb_handle ( Fl_Widget *w, void *v )
{
((Controller_Module*)v)->cb_handle( w );
}
void
Controller_Module::cb_handle ( Fl_Widget *w )
{
control_value = ((Fl_Valuator*)w)->value();
if ( control_output[0].connected() )
if( mode() != CV && m == CV )
{
control_output[0].control_value( control_value );
Port *p = control_output[0].connected_port();
Module *m = p->module();
if ( control_output[0].connected() )
{
chain()->engine()->lock();
m->handle_control_changed( p );
Port *p = control_output[0].connected_port();
JACK::Port po( chain()->engine(), JACK::Port::Input, p->name(), 0, "CV" );
if ( po.valid() )
{
jack_input.push_back( po );
}
chain()->engine()->unlock();
}
}
else if ( mode() == CV && m == GUI )
{
chain()->engine()->lock();
jack_input.back().shutdown();
jack_input.pop_back();
chain()->engine()->unlock();
}
_mode = m ;
}
void
@ -221,9 +226,6 @@ Controller_Module::connect_to ( Port *p )
o->value(1);
o->textsize(14);
// o->type( FL_VERTICAL );
// o->type(1);
if ( p->hints.ranged )
{
o->minimum( p->hints.maximum );
@ -244,8 +246,6 @@ Controller_Module::connect_to ( Port *p )
}
o->box( FL_BURNISHED_OVAL_BOX );
// o->box( FL_OVAL_BOX );
// o->type( FL_FILL_DIAL );
o->color( fl_darker( fl_darker( FL_GRAY ) ) );
o->selection_color( FL_WHITE );
o->value( p->control_value() );
@ -273,6 +273,8 @@ Controller_Module::connect_to ( Port *p )
}
}
void
Controller_Module::resize ( int X, int Y, int W, int H )
{
@ -284,6 +286,40 @@ Controller_Module::resize ( int X, int Y, int W, int H )
}
}
void
Controller_Module::update_cb ( void *v )
{
((Controller_Module*)v)->update_cb();
}
void
Controller_Module::update_cb ( void )
{
Fl::repeat_timeout( CONTROL_UPDATE_FREQ, update_cb, this );
if ( control && control_output[0].connected() )
control->value(control_value);
}
void
Controller_Module::cb_handle ( Fl_Widget *w, void *v )
{
((Controller_Module*)v)->cb_handle( w );
}
void
Controller_Module::cb_handle ( Fl_Widget *w )
{
control_value = ((Fl_Valuator*)w)->value();
if ( control_output[0].connected() )
{
control_output[0].control_value( control_value );
Port *p = control_output[0].connected_port();
Module *m = p->module();
m->handle_control_changed( p );
}
}
void
Controller_Module::menu_cb ( Fl_Widget *w, void *v )
@ -306,9 +342,6 @@ Controller_Module::menu_cb ( const Fl_Menu_ *m )
mode( CV );
}
#include "FL/test_press.H"
#include "FL/menu_popup.H"
/** build the context menu for this control */
Fl_Menu_Button &
Controller_Module::menu ( void )
@ -357,43 +390,9 @@ Controller_Module::handle ( int m )
void
Controller_Module::mode ( Mode m )
{
if( mode() != CV && m == CV )
{
if ( control_output[0].connected() )
{
chain()->engine()->lock();
// char name[256];
// snprintf( name, sizeof( name ), "%s-CV", p->name() );
Port *p = control_output[0].connected_port();
JACK::Port po( chain()->engine(), JACK::Port::Input, p->name(), 0, "CV" );
if ( po.valid() )
{
jack_input.push_back( po );
}
chain()->engine()->unlock();
}
}
else if ( mode() == CV && m == GUI )
{
chain()->engine()->lock();
jack_input.back().shutdown();
jack_input.pop_back();
chain()->engine()->unlock();
}
_mode = m ;
}
/**********/
/* Engine */
/**********/
void
Controller_Module::process ( void )

View File

@ -50,7 +50,6 @@ public:
void mode ( Mode v );
Controller_Module ( bool is_default = false );
// Controller_Module ( int W, int H, const char *L=0 );
virtual ~Controller_Module ( );
const char *name ( void ) const { return "Controller"; }
@ -67,24 +66,21 @@ public:
LOG_CREATE_FUNC( Controller_Module );
void resize ( int, int, int, int );
void process ( void );
protected:
void get ( Log_Entry &e ) const;
void set ( Log_Entry &e );
// virtual void draw ( void );
virtual void process ( void );
virtual void draw ( void )
void draw ( void )
{
draw_box();
Fl_Group::draw();
}
virtual int handle ( int m );
int handle ( int m );
void resize ( int, int, int, int );
protected:
void get ( Log_Entry &e ) const;
void set ( Log_Entry &e );
private:

View File

@ -17,11 +17,13 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include "Gain_Module.H"
#include <math.h>
#include <dsp.h>
#include "Gain_Module.H"
Gain_Module::Gain_Module ( )
: Module ( 50, 24, name() )
{
@ -32,7 +34,6 @@ Gain_Module::Gain_Module ( )
p.hints.type = Port::Hints::LOGARITHMIC;
p.hints.ranged = true;
p.hints.minimum = -70.0f;
// p.hints.maximum = HUGE;
p.hints.maximum = 6.0f;
p.hints.default_value = 0.0f;
@ -41,8 +42,6 @@ Gain_Module::Gain_Module ( )
add_port( p );
// color( FL_BLACK );
end();
log_create();
@ -67,11 +66,6 @@ Gain_Module::configure_inputs ( int n )
{
add_port( Port( this, Port::INPUT, Port::AUDIO ) );
add_port( Port( this, Port::OUTPUT, Port::AUDIO ) );
// add_port( Port( this, Port::INPUT, Port::CONTROL ) );
/* Port p( Port::OUTPUT, Port::CONTROL, "dB level" ); */
/* p.hints.type = Port::Hints::LOGARITHMIC; */
/* add_port( p ); */
}
return true;
@ -79,6 +73,10 @@ Gain_Module::configure_inputs ( int n )
/**********/
/* Engine */
/**********/
void
Gain_Module::process ( void )
{

View File

@ -17,14 +17,17 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include "JACK_Module.H"
#include <FL/Fl_Single_Window.H>
#include "const.h"
#include <string.h>
#include "dsp.h"
#include "Engine/Engine.H"
#include "dsp.h"
#include <string.h>
#include "Chain.H"
#include "JACK_Module.H"
JACK_Module::JACK_Module ( )
@ -148,7 +151,6 @@ JACK_Module::configure_outputs ( int n )
bool
JACK_Module::initialize ( void )
{
// configure_inputs( 1 );
return true;
}
@ -196,6 +198,10 @@ JACK_Module::handle_chain_name_changed ( void )
/**********/
/* Engine */
/**********/
void
JACK_Module::process ( void )
{

View File

@ -19,29 +19,68 @@
#include "Meter_Indicator_Module.H"
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Counter.H>
#include "FL/Fl_Arc_Dial.H"
#include "FL/Fl_Light_Button.H"
#include "FL/Boxtypes.H"
#include <FL/fl_draw.H>
#include <FL/Fl_Counter.H>
#include <FL/Fl_Light_Button.H>
#include "FL/Boxtypes.H"
#include "FL/Fl_Arc_Dial.H"
#include "FL/Fl_Labelpad_Group.H"
#include <stdio.h>
#include "FL/Fl_Scalepack.H"
#include "Engine/Engine.H"
#include "Chain.H"
#include "DPM.H"
#include "FL/Fl_Scalepack.H"
const float CONTROL_UPDATE_FREQ = 0.1f;
#include "FL/test_press.H"
const float CONTROL_UPDATE_FREQ = 0.1f;
Meter_Indicator_Module::Meter_Indicator_Module ( bool is_default )
: Module ( is_default, 50, 100, name() )
{
box( FL_NO_BOX );
_pad = true;
control = 0;
control_value = 0;
add_port( Port( this, Port::INPUT, Port::CONTROL ) );
dpm_pack = new Fl_Scalepack( x(), y(), w(), h() );
dpm_pack->type( FL_HORIZONTAL );
control_value = new float[1];
*control_value = -70.0f;
end();
Fl::add_timeout( CONTROL_UPDATE_FREQ, update_cb, this );
}
Meter_Indicator_Module::~Meter_Indicator_Module ( )
{
if ( control_value )
{
delete[] control_value;
control_value = NULL;
}
Fl::remove_timeout( update_cb, this );
log_destroy();
}
void
Meter_Indicator_Module::get ( Log_Entry &e ) const
@ -92,43 +131,6 @@ Meter_Indicator_Module::set ( Log_Entry &e )
Meter_Indicator_Module::Meter_Indicator_Module ( bool is_default )
: Module ( is_default, 50, 100, name() )
{
box( FL_NO_BOX );
_pad = true;
control = 0;
control_value = 0;
add_port( Port( this, Port::INPUT, Port::CONTROL ) );
dpm_pack = new Fl_Scalepack( x(), y(), w(), h() );
dpm_pack->type( FL_HORIZONTAL );
control_value = new float[1];
*control_value = -70.0f;
end();
Fl::add_timeout( CONTROL_UPDATE_FREQ, update_cb, this );
}
Meter_Indicator_Module::~Meter_Indicator_Module ( )
{
if ( control_value )
{
delete[] control_value;
control_value = NULL;
}
Fl::remove_timeout( update_cb, this );
log_destroy();
}
void
Meter_Indicator_Module::update_cb ( void *v )
{
@ -186,17 +188,15 @@ Meter_Indicator_Module::connect_to ( Port *p )
{
control_input[0].connect_to( p );
/* else if ( p->hints.type == Module::Port::Hints::LOGARITHMIC ) */
/* { */
{
DPM *o = new DPM( x(), y(), this->w(), h() );
o->type( FL_VERTICAL );
align( (Fl_Align)(FL_ALIGN_CENTER | FL_ALIGN_INSIDE ) );
DPM *o = new DPM( x(), y(), this->w(), h() );
o->type( FL_VERTICAL );
align( (Fl_Align)(FL_ALIGN_CENTER | FL_ALIGN_INSIDE ) );
dpm_pack->add( o );
}
dpm_pack->add( o );
}
int
Meter_Indicator_Module::handle ( int m )
{
@ -251,6 +251,10 @@ Meter_Indicator_Module::handle_control_changed ( Port *p )
}
}
/**********/
/* Engine */
/**********/
void
Meter_Indicator_Module::process ( void )
{

View File

@ -17,15 +17,19 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include "Meter_Module.H"
#include "DPM.H"
#include "const.h"
#include <math.h>
#include <FL/Fl.H>
#include <FL/Fl_Single_Window.H>
#include <FL/Fl_Scalepack.H>
#include "JACK/Port.H"
#include <math.h>
#include "FL/Fl_Scalepack.H"
#include "FL/test_press.H"
#include "Meter_Module.H"
#include "DPM.H"
#include "JACK/Port.H"
const float METER_UPDATE_FREQ = 0.1f;
@ -152,6 +156,8 @@ Meter_Module::configure_inputs ( int n )
return true;
}
int
Meter_Module::handle ( int m )
{
@ -173,6 +179,10 @@ Meter_Module::handle ( int m )
/**********/
/* Engine */
/**********/
static float
get_peak_sample ( const sample_t* buf, nframes_t nframes )
{

View File

@ -372,7 +372,10 @@ Mixer::rows ( int n )
sh = (scroll->h() - 18) / n;
if ( sh < Mixer_Strip::min_h() )
{
rows( ( scroll->h() - 18 ) / Mixer_Strip::min_h() );
return;
}
int tw = 0;
@ -447,7 +450,7 @@ Mixer::snapshot ( void )
void
Mixer::new_strip ( void )
{
add( new Mixer_Strip( get_unique_track_name( "Unnamed" ), 1 ) );
add( new Mixer_Strip( get_unique_track_name( "Unnamed" ) ) );
}
bool

View File

@ -55,11 +55,54 @@ extern Mixer *mixer;
/* add a new mixer strip (with default configuration) */
Mixer_Strip::Mixer_Strip( const char *strip_name ) : Fl_Group( 0, 0, 120, 600 )
{
label( strdup( strip_name ) );
labeltype( FL_NO_LABEL );
init();
chain( new Chain() );
_chain->initialize_with_default();
_chain->configure_ports();
color( (Fl_Color)rand() );
// name( strdup( strip_name ) );
log_create();
}
/* virgin strip created from journal */
Mixer_Strip::Mixer_Strip() : Fl_Group( 0, 0, 120, 600 )
{
init();
log_create();
}
Mixer_Strip::~Mixer_Strip ( )
{
DMESSAGE( "Destroying mixer strip" );
delete _chain;
_chain = NULL;
log_destroy();
mixer->remove( this );
}
void
Mixer_Strip::get ( Log_Entry &e ) const
{
e.add( ":name", name() );
e.add( ":width", prepost_button->value() ? "wide" : "narrow" );
e.add( ":width", width_button->value() ? "wide" : "narrow" );
e.add( ":tab", tab_button->value() ? "signal" : "fader" );
e.add( ":color", (unsigned long)color());
}
@ -77,8 +120,8 @@ Mixer_Strip::set ( Log_Entry &e )
name( v );
else if ( ! strcmp( s, ":width" ) )
{
prepost_button->value( strcmp( v, "wide" ) == 0 );
prepost_button->do_callback();
width_button->value( strcmp( v, "wide" ) == 0 );
width_button->do_callback();
}
else if ( ! strcmp( s, ":tab" ) )
{
@ -145,46 +188,6 @@ Mixer_Strip::chain ( Chain *c )
meter_indicator->chain( c );
}
/* add a new mixer strip (with default configuration) */
Mixer_Strip::Mixer_Strip( const char *strip_name, int channels ) : Fl_Group( 0, 0, 120, 600 )
{
label( strdup( strip_name ) );
labeltype( FL_NO_LABEL );
init();
chain( new Chain() );
_chain->initialize_with_default();
_chain->configure_ports();
color( (Fl_Color)rand() );
// name( strdup( strip_name ) );
log_create();
}
/* virgin strip created from journal */
Mixer_Strip::Mixer_Strip() : Fl_Group( 0, 0, 120, 600 )
{
init();
log_create();
}
Mixer_Strip::~Mixer_Strip ( )
{
DMESSAGE( "Destroying mixer strip" );
delete _chain;
_chain = NULL;
log_destroy();
mixer->remove( this );
}
void Mixer_Strip::cb_handle(Fl_Widget* o) {
// parent()->parent()->damage( FL_DAMAGE_ALL, x(), y(), w(), h() );
@ -220,7 +223,7 @@ void Mixer_Strip::cb_handle(Fl_Widget* o) {
}
else if ( o == name_field )
name( name_field->value() );
else if ( o == prepost_button )
else if ( o == width_button )
{
if ( ((Fl_Button*)o)->value() )
size( 300, h() );
@ -352,7 +355,7 @@ Mixer_Strip::init ( )
o->end();
} // Fl_Group* o
{ Fl_Flip_Button* o = prepost_button = new Fl_Flip_Button(61, 183, 45, 22, "narrow/wide");
{ Fl_Flip_Button* o = width_button = new Fl_Flip_Button(61, 183, 45, 22, "narrow/wide");
o->type(1);
o->labelsize(14);
o->callback( ((Fl_Callback*)cb_handle), this );

View File

@ -54,8 +54,7 @@ public:
static int min_h ( void ) { return 250; }
Mixer_Strip(int X, int Y, int W, int H, const char *L = 0);
Mixer_Strip( const char *name, int channels );
Mixer_Strip( const char *strip_name );
Mixer_Strip(); /* for log create */
virtual ~Mixer_Strip();
@ -77,14 +76,12 @@ public:
void update ( void );
// int channels ( void ) const { return _in.size(); }
void name ( const char *name );
const char *name ( void ) const { return label(); }
private:
// Fl_Value_Slider *gain_slider;
Fl_Flip_Button *prepost_button;
Fl_Flip_Button *width_button;
Fl_Flip_Button *tab_button;
Fl_Button *close_button;
Fl_Button *left_button;

View File

@ -17,25 +17,28 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <FL/fl_draw.H>
#include <FL/Fl_Pack.H>
#include "FL/Fl_Value_SliderX.H"
#include <FL/Fl_Box.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/Fl_Counter.H>
#include "FL/Fl_Arc_Dial.H"
#include "FL/Boxtypes.H"
#include "FL/Fl_Flowpack.H"
#include "FL/Fl_Labelpad_Group.H"
#include "FL/Fl_Menu_Button.H"
#include "FL/Fl_Value_SliderX.H"
#include "FL/Fl_Arc_Dial.H"
#include "Module.H"
#include "Module_Parameter_Editor.H"
#include "Controller_Module.H"
#include "Chain.H"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <util/debug.h>
#include <math.h>
@ -298,7 +301,6 @@ Module_Parameter_Editor::bind_control ( int i )
_module->redraw();
}
void
Module_Parameter_Editor::set_value (int i, float value )
{

View File

@ -20,6 +20,7 @@
#pragma once
#include <FL/Fl_Double_Window.H>
class Fl_Pack;
class Fl_Flowpack;
class Module;
@ -53,8 +54,6 @@ class Module_Parameter_Editor : public Fl_Double_Window
Fl_Menu_Button *mode_choice;
bool _resized;
public:
Module_Parameter_Editor ( Module *module );

View File

@ -17,16 +17,19 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include "Mono_Pan_Module.H"
#include "const.h"
#include <math.h>
#include <dsp.h>
#include "Mono_Pan_Module.H"
Mono_Pan_Module::Mono_Pan_Module ( )
: Module ( 50, 24, name() )
{
Port p( this, Port::INPUT, Port::CONTROL, "Pan" );
// p.hints.type = Port::Hints::LOGARITHMIC;
p.hints.ranged = true;
p.hints.minimum = -1.0f;
p.hints.maximum = 1.0f;
@ -62,15 +65,15 @@ Mono_Pan_Module::configure_inputs ( int n )
/**********/
/* Engine */
/**********/
void
Mono_Pan_Module::process ( void )
{
const float g = control_input[0].control_value();
// this is obviously wrong, but it produces a strange false stereo effect.
// const float lg = (0.0f - g);
// const float rg = g;
const float lg = (0.0f - g) + 1.0f;
const float rg = g + 1.0f;

View File

@ -22,23 +22,24 @@
#include "const.h"
#include "Plugin_Module.H"
#include <Fl/fl_draw.H>
#include <FL/Fl_Group.H>
#include "util/debug.h"
#include <string.h>
#define HAVE_LIBLRDF 1
#include "LADSPAInfo.h"
#include <vector>
#include <string>
#include <ladspa.h>
#include <stdlib.h>
#include <math.h>
#include <Fl/fl_draw.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Menu_Button.H>
#include "Plugin_Module.H"
#include "util/debug.h"
#define HAVE_LIBLRDF 1
#include "LADSPAInfo.h"
#include "Engine/Engine.H"
@ -56,7 +57,6 @@ struct Plugin_Module::ImplementationData
Plugin_Module::Plugin_Module ( ) : Module( 50, 35, name() )
{
init();
@ -74,7 +74,6 @@ Plugin_Module::~Plugin_Module ( )
void
Plugin_Module::get ( Log_Entry &e ) const
{
@ -103,11 +102,8 @@ Plugin_Module::set ( Log_Entry &e )
Module::set( e );
}
#include <FL/Fl_Menu_Button.H>
void
Plugin_Module::add_plugins_to_menu ( Fl_Menu_Button *menu )
{
@ -181,46 +177,6 @@ Plugin_Module::init ( void )
bbox( tx, ty, tw, th );
}
#include "FL/test_press.H"
int
Plugin_Module::handle ( int m )
{
switch ( m )
{
case FL_ENTER:
case FL_LEAVE:
redraw();
return 1;
break;
default:
return Module::handle( m );
}
return 0;
}
/* There are two possible adaptations that can be made at Plugin_Module input to account for a mismatch
between channel configurations.
The two scenarios are as follows.
1. The preceding module has fewer outputs than this module has inputs. If
the preceding module has 1 output (MONO) then it will be duplicated
for this module's addition inputs. If the preceding module has more
than one output, then the chain is in error.
2. The preceding module has more outputs than this module has inputs
If this module has 1 output (MONO) then it will create the required number of
instances of its plugin.
Stereo plugins are never run with more than one instance. Mono
plugins will have their outputs brought up to stereo for plugins with
stereo input.
*/
int
Plugin_Module::can_support_inputs ( int n )
{
@ -721,6 +677,12 @@ Plugin_Module::handle_port_connection_change ( void )
set_output_buffer( i, audio_output[i].buffer() );
}
/**********/
/* Engine */
/**********/
void
Plugin_Module::process ( )
{

View File

@ -116,7 +116,6 @@ public:
protected:
virtual int handle ( int );
void get ( Log_Entry &e ) const;
void set ( Log_Entry &e );

View File

@ -17,29 +17,26 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Pack.H>
#include "Mixer_Strip.H"
#include <stdlib.h>
#include <unistd.h>
#include "DPM.H"
#include "Mixer.H"
#include "util/Thread.H"
#include "util/debug.h"
#include "Project.H"
Mixer *mixer;
#include <FL/Boxtypes.H>
#include "Loggable.H"
#include <FL/Fl_Tooltip.H>
#include <FL/fl_ask.H>
#include <FL/Fl_Pack.H>
#include <FL/Boxtypes.H>
#include "util/Thread.H"
#include "util/debug.h"
#include "Mixer.H"
#include "Project.H"
#include "Loggable.H"
/* for registration */
#include "Module.H"
@ -51,14 +48,14 @@ Mixer *mixer;
#include "Controller_Module.H"
#include "Mono_Pan_Module.H"
#include "Chain.H"
#include "Mixer_Strip.H"
#include <sys/types.h>
#include <sys/stat.h>
/* TODO: put these in a header */
#define USER_CONFIG_DIR ".non-mixer/"
char *user_config_dir;
Mixer *mixer;
#include <errno.h>
@ -111,10 +108,6 @@ main ( int argc, char **argv )
Fl::get_system_colors();
Fl::scheme( "plastic" );
// Fl::scheme( "gtk+" );
/* Fl::foreground( 0xFF, 0xFF, 0xFF ); */
/* Fl::background( 0x10, 0x10, 0x10 ); */
Plugin_Module::spawn_discover_thread();
@ -135,11 +128,6 @@ main ( int argc, char **argv )
{
if ( argc > 1 )
{
/* char name[1024]; */
/* snprintf( name, sizeof( name ), "%s/history", argv[1] ); */
/* Loggable::open( name ); */
MESSAGE( "Loading \"%s\"", argv[1] );
if ( int err = Project::open( argv[1] ) )
@ -159,5 +147,4 @@ main ( int argc, char **argv )
main_window = NULL;
MESSAGE( "Your fun is over" );
}