13
0

MIDI port options now tracks dynamic port register/unregister

This commit is contained in:
Paul Davis 2016-10-20 10:21:44 -04:00
parent 138aa61366
commit 9acc282f65

View File

@ -1854,7 +1854,7 @@ private:
}; };
class MidiPortOptions : public OptionEditorBox class MidiPortOptions : public OptionEditorBox, public sigc::trackable
{ {
public: public:
MidiPortOptions() { MidiPortOptions() {
@ -1879,8 +1879,16 @@ class MidiPortOptions : public OptionEditorBox
void parameter_changed (string const&) {} void parameter_changed (string const&) {}
void set_state_from_config() {} void set_state_from_config() {}
void on_show () {
void on_show () {
refill ();
AudioEngine::instance()->PortRegisteredOrUnregistered.connect (port_connection,
invalidator (*this),
boost::bind (&MidiPortOptions::refill, this),
gui_context());
}
void refill () {
if (refill_midi_ports (true, midi_input_view)) { if (refill_midi_ports (true, midi_input_view)) {
input_label.show (); input_label.show ();
} else { } else {
@ -1894,6 +1902,7 @@ class MidiPortOptions : public OptionEditorBox
} }
private: private:
PBD::ScopedConnection port_connection;
/* MIDI port management */ /* MIDI port management */
struct MidiPortColumns : public Gtk::TreeModel::ColumnRecord { struct MidiPortColumns : public Gtk::TreeModel::ColumnRecord {