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
This commit is contained in:
Paul Davis 2012-10-17 22:01:02 +00:00
parent fbc5571133
commit bb9f8aabc4
2 changed files with 19 additions and 3 deletions

View file

@ -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

View file

@ -75,7 +75,7 @@ class ControlProtocolManager : public PBD::Stateful, public ARDOUR::SessionHandl
int set_state (const XMLNode&, int version);
XMLNode& get_state (void);
sigc::signal<void,ControlProtocolInfo*> ProtocolStatusChange;
PBD::Signal1<void,ControlProtocolInfo*> ProtocolStatusChange;
private:
ControlProtocolManager ();