diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index 357823edf5..f7d15e17c4 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -39,6 +39,7 @@ #include "ardour/async_midi_port.h" #include "ardour/audioengine.h" #include "ardour/amp.h" +#include "ardour/bundle.h" #include "ardour/debug.h" #include "ardour/filesystem_paths.h" #include "ardour/midi_port.h" @@ -90,6 +91,22 @@ FaderPort::FaderPort (Session& s) throw failed_constructor(); } + _input_bundle.reset (new ARDOUR::Bundle (_("Faderport Support (Receive)"), true)); + _output_bundle.reset (new ARDOUR::Bundle (_("Faderport Support (Send) "), false)); + + _input_bundle->add_channel ( + inp->name(), + ARDOUR::DataType::MIDI, + session->engine().make_port_name_non_relative (inp->name()) + ); + + _output_bundle->add_channel ( + outp->name(), + ARDOUR::DataType::MIDI, + session->engine().make_port_name_non_relative (outp->name()) + ); + + TrackSelectionChanged.connect (selection_connection, MISSING_INVALIDATOR, boost::bind (&FaderPort::gui_track_selection_changed, this, _1), this); /* Catch port connections and disconnections */ @@ -1085,7 +1102,7 @@ FaderPort::map_auto () get_button (FP_Off).set_led_state (_output_port, true); break; } - + } @@ -1203,6 +1220,19 @@ FaderPort::map_route_state () } } +list > +FaderPort::bundles () +{ + list > b; + + if (_input_bundle) { + b.push_back (_input_bundle); + b.push_back (_output_bundle); + } + + return b; +} + boost::shared_ptr FaderPort::output_port() { diff --git a/libs/surfaces/faderport/faderport.h b/libs/surfaces/faderport/faderport.h index 0fac479c07..00259a58f9 100644 --- a/libs/surfaces/faderport/faderport.h +++ b/libs/surfaces/faderport/faderport.h @@ -55,6 +55,7 @@ namespace MIDI { namespace ARDOUR { class AsyncMIDIPort; + class Bundle; class Port; class Session; class MidiPort; @@ -158,6 +159,8 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI > bundles (); + private: boost::shared_ptr _current_route; boost::weak_ptr pre_master_route; @@ -166,6 +169,11 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI _input_port; boost::shared_ptr _output_port; + // Bundle to represent our input ports + boost::shared_ptr _input_bundle; + // Bundle to represent our output ports + boost::shared_ptr _output_bundle; + PBD::ScopedConnectionList midi_connections; bool midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr port);