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 ); } } }
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 ) ); } } }
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 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(); }
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] ); }
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); }
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 ); }
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 ); }
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 ); } }
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; }
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 ) ); } } }
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(); }
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 ); } }
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(); }
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 ) ); } }