Exemplo n.º 1
0
void
JACK_Module::handle_control_changed ( Port *p )
{
//    THREAD_ASSERT( UI );

    if ( 0 == strcmp( p->name(), "Inputs" ) )
    {
        DMESSAGE( "Adjusting number of inputs (JACK outputs)" );
        configure_inputs( p->control_value() );
        if ( chain() )
            chain()->configure_ports();
    }
    else if ( 0 == strcmp( p->name(), "Outputs" ) )
    {
        DMESSAGE( "Adjusting number of outputs (JACK inputs)" );

        if ( ! chain() )
        {
            configure_outputs( p->control_value() );
        }
        else if ( chain()->can_configure_outputs( this, p->control_value() ) )
        {
            configure_outputs( p->control_value() );
            chain()->configure_ports();
        }
        else
        {
            p->connected_port()->control_value( noutputs() );
        }
    }

    Module::handle_control_changed( p );
}
Exemplo n.º 2
0
Track::~Track ( )
{
    Loggable::block_start();

    /* must destroy sequences first to preserve proper log order */
    takes->clear();
    control->clear();
    annotation->clear();
    delete sequence();

    takes = NULL;
    control = NULL;
    annotation = NULL;

    log_destroy();

    /* ensure that soloing accounting is performed */
    solo( false );

    timeline->remove_track( this );

    /* give up our ports */
    configure_inputs( 0 );
    configure_outputs( 0 );

    _sequence = NULL;

    if ( _name )
        free( _name );

    Loggable::block_end();
}
Exemplo n.º 3
0
JACK_Module::~JACK_Module ( )
{
    log_destroy();
    configure_inputs( 0 );
    configure_outputs( 0 );
    if ( _prefix )
        free( _prefix );
}
Exemplo n.º 4
0
void
Track::command_configure_channels ( int n )
{
    /* due to locking this should only be invoked by direct user action */
    timeline->wrlock();
    configure_inputs( n );
    configure_outputs( n );
    timeline->unlock();
}
Exemplo n.º 5
0
bool
AUX_Module::configure_inputs ( int n )
{
    bool b = JACK_Module::configure_inputs( n );

    if ( b )
    {
        return configure_outputs( n );
    }

    return false;
}
Exemplo n.º 6
0
Track::Track ( const char *L, int channels ) :
    Fl_Group ( 0, 0, 0, 0, 0 )
{
    init();

    if ( L )
        name( L );

    color( random_color() );

    configure_inputs( channels );
    configure_outputs( channels );

    log_create();
}
Exemplo n.º 7
0
AUX_Module::~AUX_Module ( )
{
    configure_outputs(0);
    delete (float*)control_input[0].buffer();
}
Exemplo n.º 8
0
void
Track::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

        e.get( i, &s, &v );

        if ( ! strcmp( s, ":height" ) )
        {
            size( atoi( v ) );
            adjust_size();
        }
        else if ( ! strcmp( s, ":selected" ) )
            _selected = atoi( v );
//                else if ( ! strcmp( s, ":armed"
        else if ( ! strcmp( s, ":name" ) )
            name( v );
        else if ( ! strcmp( s, ":inputs" ) )
            configure_inputs( atoi( v ) );
        else if ( ! strcmp( s, ":outputs" ) )
            configure_outputs( atoi( v ) );
        else if ( ! strcmp( s, ":color" ) )
        {
            color( (Fl_Color)atoll( v ) );
            redraw();
        }
        else if ( ! strcmp( s, ":show-all-takes" ) )
            show_all_takes( atoi( v ) );
        else if ( ! strcmp( s, ":overlay-controls" ) )
            overlay_controls( atoi( v ) );
        else if ( ! strcmp( s, ":solo" ) )
            solo( atoi( v ) );
        else if ( ! strcmp( s, ":mute" ) )
            mute( atoi( v ) );
        else if ( ! strcmp( s, ":arm" ) )
            armed( atoi( v ) );
        else if ( ! strcmp( s, ":sequence" ) )
        {
            int i;
            sscanf( v, "%X", &i );

            if ( i )
            {
                Audio_Sequence *t = (Audio_Sequence*)Loggable::find( i );

                /* FIXME: our track might not have been
                 * defined yet... what should we do about this
                 * chicken/egg problem? */
                if ( t )
                {
//                        assert( t );

                    sequence( t );
                }

            }

        }
        else if ( ! strcmp( s, ":row" ) )
            row( atoi( v ) );
    }
}