summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorJohn Anderson <ardour@semiosix.com>2007-08-09 19:53:57 +0000
committerJohn Anderson <ardour@semiosix.com>2007-08-09 19:53:57 +0000
commitf8b06e1f8d37dc8ae1f35e9388ccb8b40a6eec5f (patch)
treec7d70d5ac4ee78337ad666517e66083de964a3f5 /libs/surfaces
parentf914f67036098edd5f1f5b942fb11b9632d3f36a (diff)
Finally nailed the mysterious fader update bug, thanks to Giso Grimm. Also move Strip::add out to controls.cc from surface.cc
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2282 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/mackie/TODO4
-rw-r--r--libs/surfaces/mackie/controls.cc61
-rw-r--r--libs/surfaces/mackie/controls.h3
-rw-r--r--libs/surfaces/mackie/surface.cc62
4 files changed, 67 insertions, 63 deletions
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<Fader*>(&control);
+ }
+ else if ( control.name() == "vpot" )
+ {
+ _vpot = reinterpret_cast<Pot*>(&control);
+ }
+ else if ( control.name() == "recenable" )
+ {
+ _recenable = reinterpret_cast<Button*>(&control);
+ }
+ else if ( control.name() == "solo" )
+ {
+ _solo = reinterpret_cast<Button*>(&control);
+ }
+ else if ( control.name() == "mute" )
+ {
+ _mute = reinterpret_cast<Button*>(&control);
+ }
+ else if ( control.name() == "select" )
+ {
+ _select = reinterpret_cast<Button*>(&control);
+ }
+ else if ( control.name() == "vselect" )
+ {
+ _vselect = reinterpret_cast<Button*>(&control);
+ }
+ else if ( control.name() == "fader_touch" )
+ {
+ _fader_touch = reinterpret_cast<Button*>(&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<Fader*>(&control);
- }
- else if ( control.name() == "vpot" )
- {
- _vpot = reinterpret_cast<Pot*>(&control);
- }
- else if ( control.name() == "recenable" )
- {
- _recenable = reinterpret_cast<Button*>(&control);
- }
- else if ( control.name() == "solo" )
- {
- _solo = reinterpret_cast<Button*>(&control);
- }
- else if ( control.name() == "mute" )
- {
- _mute = reinterpret_cast<Button*>(&control);
- }
- else if ( control.name() == "select" )
- {
- _select = reinterpret_cast<Button*>(&control);
- }
- else if ( control.name() == "vselect" )
- {
- _vselect = reinterpret_cast<Button*>(&control);
- }
- else if ( control.name() == "fader_touch" )
- {
- _fader_touch = reinterpret_cast<Button*>(&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() );
- }
-}