Ejemplo n.º 1
0
void
Control_Sequence::get ( Log_Entry &e ) const
{
    e.add( ":track", _track );
    e.add( ":name", name() );
    e.add( ":color", color() );
}
Ejemplo n.º 2
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 );
        }
    }
}
Ejemplo n.º 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] );
}
Ejemplo n.º 4
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();
}
Ejemplo n.º 5
0
void
Track::get ( Log_Entry &e ) const
{
    e.add( ":name",            _name            );
    e.add( ":sequence",        sequence()       );
    e.add( ":selected",        _selected        );
    e.add( ":color",           (unsigned long)color());
}
Ejemplo n.º 6
0
void
Tempo_Point::get ( Log_Entry &e ) const
{
//    Sequence_Point::get( e );

    e.add( ":start", start() );
    e.add( ":tempo", _tempo );
}
Ejemplo n.º 7
0
void
Cursor_Region::get ( Log_Entry &e ) const
{
//    Sequence_Region::get( e );
    e.add( ":start", start() );
    e.add( ":length", length() );
    e.add( ":label", label() );
    e.add( ":type", type() );
}
Ejemplo n.º 8
0
void
Sequence_Widget::get ( Log_Entry &e ) const
{
    e.add( ":start", _r->start );
//    e.add( ":offset", _r->offset );
//    e.add( ":length", _r->length );
    e.add( ":sequence", _sequence );
    e.add( ":selected", selected() );
}
Ejemplo n.º 9
0
void
Cursor_Point::get ( Log_Entry &e ) const
{
//    Sequence_Point::get( e );

    e.add( ":start", start() );
    e.add( ":label", label() );
    e.add( ":type", type() );
}
Ejemplo n.º 10
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 );
        }
    }
}
Ejemplo n.º 11
0
void
Meter_Indicator_Module::get ( Log_Entry &e ) const
{

    Port *p = control_input[0].connected_port();
    Module *m = p->module();

    e.add( ":module", m );
    e.add( ":port", m->control_output_port_index( p ) );

    Module::get( e );
}
Ejemplo n.º 12
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 ) );
        }
    }

}
Ejemplo n.º 13
0
void
Module::get ( Log_Entry &e ) const
{
//    e.add( ":name",            label()           );
//    e.add( ":color",           (unsigned long)color());
    {
        char *s = get_parameters();
        if ( strlen( s ) )
            e.add( ":parameter_values", s );
        delete[] s;
    }
    e.add( ":is_default", is_default() );
    e.add( ":chain", chain() );
    e.add( ":active", ! bypass() );
}
Ejemplo n.º 14
0
void
Control_Point::get ( Log_Entry &e ) const
{
    Sequence_Point::get( e );

    e.add( ":y", _y );
}
Ejemplo n.º 15
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);
}
Ejemplo n.º 16
0
void
Sequence_Region::get ( Log_Entry &e ) const
{
    e.add( ":color",  _box_color );
    e.add( ":length", _r->length );

    Sequence_Widget::get( e );
}
Ejemplo n.º 17
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 );
}
Ejemplo n.º 18
0
Archivo: Loggable.C Proyecto: 0mk/non
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();
}
Ejemplo n.º 19
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 );
}
Ejemplo n.º 20
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 );
    }
}
Ejemplo n.º 21
0
Archivo: Loggable.C Proyecto: 0mk/non
/** 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;
}
Ejemplo n.º 22
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 ) );
        }
    }
}
Ejemplo n.º 23
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();
}
Ejemplo n.º 24
0
void
Controller_Module::get ( Log_Entry &e ) const
{
    Module::get( e );

    Port *p = control_output[0].connected_port();

    if ( !p )
    {
        e.add( ":module", "" );
        e.add( ":port", "" );
        e.add( ":mode", "" );
    }
    else
    {
        Module *m = p->module();
        
        e.add( ":module", m );
        e.add( ":port", m->control_input_port_index( p ) );
        e.add( ":mode", mode() );
    }
}
Ejemplo n.º 25
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 );
    }
}
Ejemplo n.º 26
0
void
Control_Sequence::get_unjournaled ( Log_Entry &e ) const
{
    e.add( ":interpolation", _interpolation );

    /* if ( _osc_output() && _osc_output()->connected() ) */
    /* { */
    /*     DMESSAGE( "OSC Output connections: %i", _osc_output()->noutput_connections() ); */

    /*     for ( int i = 0; i < _osc_output()->noutput_connections(); ++i ) */
    /*     { */
    /*         char *s; */

    /*         s = _osc_output()->get_output_connection_peer_name_and_path(i); */

    /*         e.add( ":osc-output", s ); */
        
    /*         free( s ); */
    /*     } */
    /* } */

    e.add( ":mode", mode() );
}
Ejemplo n.º 27
0
void
Track::get_unjournaled ( Log_Entry &e ) const
{
    e.add( ":height",          size()           );
    e.add( ":inputs",          input.size()     );
    e.add( ":outputs",         output.size()    );
    e.add( ":show-all-takes",  show_all_takes()  );
    e.add( ":overlay-controls", overlay_controls()  );    
    e.add( ":armed",           armed()          );
    e.add( ":mute",            mute()           );
    e.add( ":solo",            solo()           );
    e.add( ":row",             timeline->find_track( this ) );
}
Ejemplo n.º 28
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();
}
Ejemplo n.º 29
0
Archivo: Module.C Proyecto: 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;
}
Ejemplo n.º 30
0
void
Chain::get ( Log_Entry &e ) const
{
    e.add( ":strip", strip() );
    e.add( ":tab", tab_button->value() ? "controls" : "chain" );
}