diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-30 02:09:39 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-30 02:09:39 +0000 |
commit | 1f07948972ca1cac5854539268ca3b290b79c671 (patch) | |
tree | 4d507ec8a035894628a8f5b84486656fdff6d0e9 /libs/surfaces | |
parent | 66760a574a1fc0ccc8a798c2900a717c134838ea (diff) |
Put Mackie surface ports into the Ardour tab of the port matrix.
git-svn-id: svn://localhost/ardour2/branches/3.0@7522 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
4 files changed, 37 insertions, 0 deletions
diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index cf98b66b5e..3afd589ee7 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -354,3 +354,8 @@ ControlProtocol:: route_get_name (uint32_t table_index) return r->name(); } +list<boost::shared_ptr<Bundle> > +ControlProtocol::bundles () +{ + return list<boost::shared_ptr<Bundle> > (); +} diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h index 559da08d33..479ffe30cc 100644 --- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h +++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h @@ -33,6 +33,7 @@ namespace ARDOUR { class Route; class Session; +class Bundle; class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, public PBD::ScopedConnectionList, public BasicUI { public: @@ -98,6 +99,8 @@ class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, pu std::string route_get_name (uint32_t table_index); + virtual std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles (); + virtual bool has_editor () const { return false; } virtual void* get_gui() const { return 0; } virtual void tear_down_gui() { } diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 2e4f2ba214..e9f3223796 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -83,6 +83,8 @@ MackieControlProtocol::MackieControlProtocol (Session& session) , _surface (0) , _jog_wheel (*this) , _timecode_type (ARDOUR::AnyTime::BBT) + , _input_bundle (new ARDOUR::Bundle (_("Mackie Control In"), true)) + , _output_bundle (new ARDOUR::Bundle (_("Mackie Control Out"), false)) { DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::MackieControlProtocol\n"); } @@ -575,6 +577,18 @@ MackieControlProtocol::add_port (MIDI::Port & midi_input_port, MIDI::Port & midi sport->init_event.connect_same_thread (port_connections, boost::bind (&MackieControlProtocol::handle_port_init, this, sport)); sport->active_event.connect_same_thread (port_connections, boost::bind (&MackieControlProtocol::handle_port_active, this, sport)); sport->inactive_event.connect_same_thread (port_connections, boost::bind (&MackieControlProtocol::handle_port_inactive, this, sport)); + + _input_bundle->add_channel ( + midi_input_port.name(), + ARDOUR::DataType::MIDI, + session->engine().make_port_name_non_relative (midi_input_port.name()) + ); + + _output_bundle->add_channel ( + midi_output_port.name(), + ARDOUR::DataType::MIDI, + session->engine().make_port_name_non_relative (midi_output_port.name()) + ); } void @@ -1707,3 +1721,11 @@ MackieControlProtocol::timecode_beats_release (Button &) return off; } +list<boost::shared_ptr<ARDOUR::Bundle> > +MackieControlProtocol::bundles () +{ + list<boost::shared_ptr<ARDOUR::Bundle> > b; + b.push_back (_input_bundle); + b.push_back (_output_bundle); + return b; +} diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index f84530c733..3007df8f5a 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -85,6 +85,8 @@ class MackieControlProtocol Mackie::Surface & surface(); + std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles (); + // control events void handle_control_event(Mackie::SurfacePort & port, Mackie::Control & control, const Mackie::ControlState & state); @@ -337,6 +339,11 @@ class MackieControlProtocol // Which timecode are we displaying? BBT or Timecode ARDOUR::AnyTime::Type _timecode_type; + + // Bundle to represent our input ports + boost::shared_ptr<ARDOUR::Bundle> _input_bundle; + // Bundle to represent our output ports + boost::shared_ptr<ARDOUR::Bundle> _output_bundle; }; #endif // ardour_mackie_control_protocol_h |