13
0

make faderport support report its port bundles as it should

This commit is contained in:
Paul Davis 2015-12-03 12:44:21 -05:00
parent 4f427c5f97
commit b07d86ac61
2 changed files with 39 additions and 1 deletions

View File

@ -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<boost::shared_ptr<ARDOUR::Bundle> >
FaderPort::bundles ()
{
list<boost::shared_ptr<ARDOUR::Bundle> > b;
if (_input_bundle) {
b.push_back (_input_bundle);
b.push_back (_output_bundle);
}
return b;
}
boost::shared_ptr<Port>
FaderPort::output_port()
{

View File

@ -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<FaderPortReq
void set_action (ButtonID, std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
std::string get_action (ButtonID, bool on_press, FaderPort::ButtonState = ButtonState (0));
std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
private:
boost::shared_ptr<ARDOUR::Route> _current_route;
boost::weak_ptr<ARDOUR::Route> pre_master_route;
@ -166,6 +169,11 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
boost::shared_ptr<ARDOUR::AsyncMIDIPort> _input_port;
boost::shared_ptr<ARDOUR::AsyncMIDIPort> _output_port;
// 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;
PBD::ScopedConnectionList midi_connections;
bool midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr<ARDOUR::AsyncMIDIPort> port);