Beispiel #1
0
void
Module::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":chain" ) )
        {
            /* This trickiness is because we may need to know the name of
               our chain before we actually get added to it. */
            int i;
            sscanf( v, "%X", &i );
            Chain *t = (Chain*)Loggable::find( i );

            assert( t );

            chain( t );
        }
    }

    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

/*         if ( ! strcmp( s, ":name" ) ) */
/*             label( v ); */
        if ( ! strcmp( s, ":parameter_values" ) )
        {
            set_parameters( v );
        }
        else if ( ! ( strcmp( s, ":is_default" ) ) )
        {
            is_default( atoi( v ) );
        }
        else if ( ! ( strcmp( s, ":active" ) ) )
        {
            bypass( ! atoi( v ) );
        }
        else if ( ! strcmp( s, ":chain" ) )
        {
            int i;
            sscanf( v, "%X", &i );
            Chain *t = (Chain*)Loggable::find( i );

            assert( t );

            t->add( this );
        }
    }
}
Beispiel #2
0
void
Controller_Module::set ( Log_Entry &e )
{
    Module::set( e );

    int port = -1;
    Module *module = NULL;

    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":port" ) )
        {
            port = atoi( v );
        }
        else if ( ! strcmp( s, ":module" ) )
        {
            int i;
            sscanf( v, "%X", &i );
            Module *t = (Module*)Loggable::find( i );

            assert( t );

            module = t;
        }
    }

    if ( port >= 0 && module )
    {
        connect_to( &module->control_input[port] );
        module->chain()->add_control( this );
        label( module->control_input[port].name() );
    }

    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":mode" ) )
        {
            mode( (Mode)atoi( v ) );
        }
    }

}
Beispiel #3
0
void
Meter_Indicator_Module::set ( Log_Entry &e )
{
    Module::set( e );

    int port = -1;
    Module *module = NULL;

    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":port" ) )
        {
            port = atoi( v );
        }
        else if ( ! strcmp( s, ":module" ) )
        {
            int i;
            sscanf( v, "%X", &i );
            Module *t = (Module*)Loggable::find( i );

            assert( t );

            module = t;
        }
    }

    if ( port >= 0 && module )
        control_input[0].connect_to( &module->control_output[port] );
}
Beispiel #4
0
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 );
        }
    }
}
Beispiel #5
0
void
Cursor_Point::set ( Log_Entry &e )
{

    Sequence_Point::set( e );

    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":label" ) )
            label( v );
        else if ( ! strcmp( s, ":type" ))
        {
            type( v );

            timeline->add_cursor( this );
        }

/*         /\* FIXME: we need to add this to the time track on creation!!! *\/ */
/*         timeline->time_track->add( this ); */

    }

    sequence()->handle_widget_change( start(), length() );

//    _make_label();
}
Beispiel #6
0
void
AUX_Module::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! ( strcmp( s, ":number" ) ) )
        {
            number( atoi(v) );
        }
    }

    JACK_Module::set(e);
}
Beispiel #7
0
void
Sequence_Region::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":color" ) )
            _box_color = (Fl_Color)atoll( v );
        else if ( ! strcmp( s, ":length" ) )
            _r->length = atoll( v );

    }

    Sequence_Widget::set( e );
}
Beispiel #8
0
void
Loggable::log_create ( void ) const
{
    Locker lock( _lock );;

    set_dirty();

    if ( ! _fp )
        /* replaying, don't bother */
        return;

#ifndef NDEBUG
    if ( _snapshotting && _snapshot_count != _num_snapshot )
    {
        _num_snapshot_creates = 1;
        _num_snapshot = _snapshot_count;
    }
    else if ( _snapshotting && _snapshot_count == _num_snapshot )
    {
        _num_snapshot_creates++;

        ASSERT( _num_snapshot_creates < 2, "Attempt to log creation of same object twice in one snapshot! %s", class_name() );
    }
    else
    {
        _num_log_creates++;
        ASSERT( _num_log_creates < 2, "Attempt to log creation of same object twice in the journal! %s", class_name() );
    }
#endif

    log( "%s 0x%X create ", class_name(), _id );

    Log_Entry e;

    get( e );

    if ( e.size() )
        log_print( NULL, &e );
    else
        log( "\n" );

    if ( Loggable::_level == 0 )
        Loggable::flush();
}
Beispiel #9
0
void
Control_Point::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":y" ) )
            _y = atof( v );

        redraw();

        //          _make_label();
    }

    Sequence_Point::set( e );
}
Beispiel #10
0
void
Sequence_Widget::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":start" ) )
            _r->start = atoll( v );
//        else if ( ! strcmp( s, ":offset" ) )
//            _r->offset = atoll( v );
//        else if ( ! strcmp( s, ":length" ) )
//            _r->length = atoll( v );
        else if ( ! strcmp( s, ":selected" ) )
        {
            if ( atoi( v ) )
                select();
            else
                deselect();
        }
        else if ( ! strcmp( s, ":sequence" ) )
        {
            int i;
            sscanf( v, "%X", &i );
            Sequence *t = (Sequence*)Loggable::find( i );

            ASSERT( t, "No such object ID (%s)", v );

            t->add( this );
        }
//                else
//                    e.erase( i );
    }

    if ( _sequence )
    {
        _sequence->handle_widget_change( _r->start, _r->length );
        _sequence->damage( FL_DAMAGE_USER1 );
    }
}
Beispiel #11
0
/** record this loggable's unjournaled state in memory */
void
Loggable::record_unjournaled ( void ) const
{
    Log_Entry *e = new Log_Entry();

    get_unjournaled( *e );

    Log_Entry **le = &_loggables[ _id ].unjournaled_state;

    if ( *le )
    {
        delete *le;
        *le = NULL;
    }

    if ( e->size() )
        *le = e;
    else
        delete e;
}
Beispiel #12
0
Datei: Module.C Projekt: 0mk/non
bool
Module::copy ( void ) const
{
    Module *m = clone_empty();

    if ( ! m )
    {
        DMESSAGE( "Module \"%s\" doesn't support cloning", name() );
        return false;
    }

    Log_Entry *ne = new Log_Entry();

    _copied_module_empty = m;

    {
        Log_Entry e;
        get( e );

        for ( int i = 0; i < e.size(); ++i )
        {
            const char *s, *v;

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

            /* we don't want this module to get added to the current
               chain... */
            if ( !( !strcmp( s, ":chain" ) ||
                    !strcmp( s, ":is_default" ) ) )
            {
                DMESSAGE( "%s = %s", s, v );
                ne->add_raw( s, v );
            }
        }
    }

    _copied_module_settings = ne->print();

    return true;
}
Beispiel #13
0
void
Control_Sequence::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( ":track", s ) )
        {
            int i;
            sscanf( v, "%X", &i );
            Track *t = (Track*)Loggable::find( i );

            assert( t );

            t->add( this );
        }
        else if ( ! strcmp( ":name", s ) )
        {
            name( v );
        }
        else if ( ! strcmp( ":interpolation", s ) )
        {
            interpolation( (Curve_Type)atoi( v ) );
        }
        else if ( ! strcmp( ":mode", s ) )
            mode( (Mode)atoi( v ) );
        else if ( ! strcmp( ":osc-output", s ) )
        {
            _persistent_osc_connections.push_back( strdup( v ) );
        }
        else if ( ! strcmp( ":color", s ) )
        {
            color( (Fl_Color)atol( v ) );
        }
    }
}
Beispiel #14
0
void
Cursor_Region::set ( Log_Entry &e )
{
    Sequence_Region::set( e );

    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":label" ) )
            label( v );
        if ( ! strcmp( s, ":type" ) )
        {
            type( v );
            timeline->add_cursor( this );
        }
    }

//            timeline->redraw();
}
Beispiel #15
0
void
Audio_Sequence::set ( Log_Entry &e )
{
    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( ":track", s ) )
        {
            int i;
            sscanf( v, "%X", &i );
            Track *t = (Track*)Loggable::find( i );

            assert( t );

            t->sequence( this );
        }
        else if ( ! strcmp( ":name", s ) )
            name( v );
    }
}
Beispiel #16
0
void
Tempo_Point::set ( Log_Entry &e )
{

    Sequence_Point::set( e );

    for ( int i = 0; i < e.size(); ++i )
    {
        const char *s, *v;

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

        if ( ! strcmp( s, ":tempo" ) )
            _tempo = atof( v );

/*         /\* FIXME: we need to add this to the time track on creation!!! *\/ */
/*         timeline->tempo_track->add( this ); */

    }

    sequence()->handle_widget_change( start(), length() );

    _make_label();
}
Beispiel #17
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 ) );
    }
}