diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-10-17 22:01:02 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-10-17 22:01:02 +0000 |
commit | bb9f8aabc4c11e39ae2f748f7ab6881e443afdb2 (patch) | |
tree | f97db9acb3d3510fe16710894a0001e4f44b46f6 /gtk2_ardour/rc_option_editor.cc | |
parent | fbc5571133ec1bd67d8a8595726732781e9e775c (diff) |
second half of forward-port of recent a2/mb control protocol changes, this time enabling the GUI to track protocol-active changes
git-svn-id: svn://localhost/ardour2/branches/3.0@13303 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/rc_option_editor.cc')
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 52ef644339..fed8041be9 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -670,7 +670,11 @@ public: _box->pack_start (*label, false, false); label->show (); - _store->signal_row_changed().connect (sigc::mem_fun (*this, &ControlSurfacesOptions::model_changed)); + ControlProtocolManager& m = ControlProtocolManager::instance (); + m.ProtocolStatusChange.connect (protocol_status_connection, MISSING_INVALIDATOR, + boost::bind (&ControlSurfacesOptions::protocol_status_changed, this, _1), gui_context()); + + _store->signal_row_changed().connect (sigc::mem_fun (*this, &ControlSurfacesOptions::view_changed)); _view.signal_button_press_event().connect_notify (sigc::mem_fun(*this, &ControlSurfacesOptions::edit_clicked)); } @@ -698,7 +702,18 @@ public: private: - void model_changed (TreeModel::Path const &, TreeModel::iterator const & i) + void protocol_status_changed (ControlProtocolInfo* cpi) { + /* find the row */ + TreeModel::Children rows = _store->children(); + for (TreeModel::Children::iterator x = rows.begin(); x != rows.end(); ++x) { + if ((*x)[_model.protocol_info] == cpi) { + (*x)[_model.enabled] = (cpi->protocol || cpi->requested); + break; + } + } + } + + void view_changed (TreeModel::Path const &, TreeModel::iterator const & i) { TreeModel::Row r = *i; @@ -794,6 +809,7 @@ private: ControlSurfacesModelColumns _model; TreeView _view; Gtk::Window& _parent; + PBD::ScopedConnection protocol_status_connection; }; /** A class which allows control of visibility of some editor components usign |