diff --git a/libs/surfaces/mackie/TODO b/libs/surfaces/mackie/TODO index eec729289b..71b36c27ed 100644 --- a/libs/surfaces/mackie/TODO +++ b/libs/surfaces/mackie/TODO @@ -1,4 +1,3 @@ -* fader problem (reported by Giso Grimm). Also with P4 (hyperthread) * two bcf doesn't work * remappable buttons * 7/1 configurable to 8 @@ -13,6 +12,9 @@ MCU --- * if mackie wheel moves too fast, it's ignored. * timecode displays +* gain/panner display in second line +* metering on second line +* per-strip signal led * midi bandwidth? Later diff --git a/libs/surfaces/mackie/controls.cc b/libs/surfaces/mackie/controls.cc index 8ce513aa49..d73530f95b 100644 --- a/libs/surfaces/mackie/controls.cc +++ b/libs/surfaces/mackie/controls.cc @@ -45,11 +45,72 @@ Strip::Strip( const std::string & name, int index ) { } +/** + TODO could optimise this to use enum, but it's only + called during the protocol class instantiation. + + generated using + + irb -r controls.rb + sf=Surface.new + sf.parse + controls = sf.groups.find{|x| x[0] =~ /strip/}.each{|x| puts x[1]} + controls[1].each {|x| puts "\telse if ( control.name() == \"#{x.name}\" )\n\t{\n\t\t_#{x.name} = reinterpret_cast<#{x.class.name}*>(&control);\n\t}\n"} +*/ +void Strip::add( Control & control ) +{ + Group::add( control ); + if ( control.name() == "gain" ) + { + _gain = reinterpret_cast(&control); + } + else if ( control.name() == "vpot" ) + { + _vpot = reinterpret_cast(&control); + } + else if ( control.name() == "recenable" ) + { + _recenable = reinterpret_cast(&control); + } + else if ( control.name() == "solo" ) + { + _solo = reinterpret_cast(&control); + } + else if ( control.name() == "mute" ) + { + _mute = reinterpret_cast(&control); + } + else if ( control.name() == "select" ) + { + _select = reinterpret_cast(&control); + } + else if ( control.name() == "vselect" ) + { + _vselect = reinterpret_cast(&control); + } + else if ( control.name() == "fader_touch" ) + { + _fader_touch = reinterpret_cast(&control); + } + else if ( control.type() == Control::type_led || control.type() == Control::type_led_ring ) + { + // do nothing + cout << "Strip::add not adding " << control << endl; + } + else + { + ostringstream os; + os << "Strip::add: unknown control type " << control; + throw MackieControlException( os.str() ); + } +} + Control::Control( int id, int ordinal, std::string name, Group & group ) : _id( id ) , _ordinal( ordinal ) , _name( name ) , _group( group ) +, _in_use( false ) , _in_use_timeout( 250 ) { } diff --git a/libs/surfaces/mackie/controls.h b/libs/surfaces/mackie/controls.h index bcf869f12f..84283f3016 100644 --- a/libs/surfaces/mackie/controls.h +++ b/libs/surfaces/mackie/controls.h @@ -211,8 +211,7 @@ public: virtual type_t type() const = 0; - /// Return true if this control is the one and only - /// Jog Wheel + /// Return true if this control is the one and only Jog Wheel virtual bool is_jog() const { return false; } /** diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index ce0d9848df..e9eb5570ce 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -57,6 +57,8 @@ void Surface::init_strips( uint32_t max_strips, uint32_t unit_strips ) // shallow copy existing strip // which works because the controls // have the same ids across units + // TODO this needs to be a deep copy because + // controls hold state now - in_use Strip * strip = new Strip( *strips[i % unit_strips] ); // update the relevant values @@ -69,63 +71,3 @@ void Surface::init_strips( uint32_t max_strips, uint32_t unit_strips ) } } } - -/** - TODO could optimise this to use enum, but it's only - called during the protocol class instantiation. - - generated using - - irb -r controls.rb - sf=Surface.new - sf.parse - controls = sf.groups.find{|x| x[0] =~ /strip/}.each{|x| puts x[1]} - controls[1].each {|x| puts "\telse if ( control.name() == \"#{x.name}\" )\n\t{\n\t\t_#{x.name} = reinterpret_cast<#{x.class.name}*>(&control);\n\t}\n"} -*/ -void Strip::add( Control & control ) -{ - Group::add( control ); - if ( control.name() == "gain" ) - { - _gain = reinterpret_cast(&control); - } - else if ( control.name() == "vpot" ) - { - _vpot = reinterpret_cast(&control); - } - else if ( control.name() == "recenable" ) - { - _recenable = reinterpret_cast(&control); - } - else if ( control.name() == "solo" ) - { - _solo = reinterpret_cast(&control); - } - else if ( control.name() == "mute" ) - { - _mute = reinterpret_cast(&control); - } - else if ( control.name() == "select" ) - { - _select = reinterpret_cast(&control); - } - else if ( control.name() == "vselect" ) - { - _vselect = reinterpret_cast(&control); - } - else if ( control.name() == "fader_touch" ) - { - _fader_touch = reinterpret_cast(&control); - } - else if ( control.type() == Control::type_led || control.type() == Control::type_led_ring ) - { - // do nothing - cout << "Strip::add not adding " << control << endl; - } - else - { - ostringstream os; - os << "Strip::add: unknown control type " << control; - throw MackieControlException( os.str() ); - } -}