work "hide" button on VCA strip

This commit is contained in:
Paul Davis 2016-06-09 16:58:49 -04:00
parent 4d28df97fa
commit be42151c0d
3 changed files with 31 additions and 20 deletions

View File

@ -585,6 +585,7 @@ Mixer_UI::add_stripables (StripableList& slist)
strip->set_width_enum (_strip_width, this);
}
show_strip (strip);
TreeModel::Row row = *(track_model->insert (insert_iter));
@ -598,12 +599,13 @@ Mixer_UI::add_stripables (StripableList& slist)
_selection.add (strip);
}
route->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::strip_property_changed, this, _1, strip), gui_context());
strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed));
strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip));
}
}
(*s)->presentation_info().PropertyChanged.connect (*this, invalidator(*this), boost::bind (&Mixer_UI::stripable_property_changed, this, _1, boost::weak_ptr<Stripable>(*s)), gui_context());
(*s)->PropertyChanged.connect (*this, invalidator(*this), boost::bind (&Mixer_UI::stripable_property_changed, this, _1, boost::weak_ptr<Stripable>(*s)), gui_context());
}
} catch (const std::exception& e) {
error << string_compose (_("Error adding GUI elements for new tracks/busses %1"), e.what()) << endmsg;
@ -1485,20 +1487,35 @@ Mixer_UI::build_track_menu ()
}
void
Mixer_UI::strip_property_changed (const PropertyChange& what_changed, MixerStrip* mx)
Mixer_UI::stripable_property_changed (const PropertyChange& what_changed, boost::weak_ptr<Stripable> ws)
{
if (!what_changed.contains (ARDOUR::Properties::name)) {
if (!what_changed.contains (ARDOUR::Properties::hidden) && !what_changed.contains (ARDOUR::Properties::name)) {
return;
}
ENSURE_GUI_THREAD (*this, &Mixer_UI::strip_name_changed, what_changed, mx)
boost::shared_ptr<Stripable> s = ws.lock ();
if (!s) {
return;
}
TreeModel::Children rows = track_model->children();
TreeModel::Children::iterator i;
for (i = rows.begin(); i != rows.end(); ++i) {
if ((*i)[stripable_columns.strip] == mx) {
(*i)[stripable_columns.text] = mx->route()->name();
boost::shared_ptr<Stripable> ss = (*i)[stripable_columns.stripable];
if (s == ss) {
if (what_changed.contains (ARDOUR::Properties::name)) {
(*i)[stripable_columns.text] = s->name();
}
if (what_changed.contains (ARDOUR::Properties::hidden)) {
(*i)[stripable_columns.visible] = !s->presentation_info().hidden();
redisplay_track_list ();
}
return;
}
}

View File

@ -266,7 +266,7 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
MonitorSection* _monitor_section;
PluginSelector *_plugin_selector;
void strip_property_changed (const PBD::PropertyChange&, MixerStrip *);
void stripable_property_changed (const PBD::PropertyChange& what_changed, boost::weak_ptr<ARDOUR::Stripable> ws);
void route_group_property_changed (ARDOUR::RouteGroup *, const PBD::PropertyChange &);
/* various treeviews */

View File

@ -57,9 +57,6 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
, delete_dialog (0)
, control_slave_ui (s)
{
PresentationInfo::color_t c = _vca->presentation_info().color ();
/* set color for the VCA, if not already done. */
if (!_vca->presentation_info().color_set()) {
@ -231,14 +228,7 @@ VCAMasterStrip::name() const
void
VCAMasterStrip::hide_clicked ()
{
if (!delete_dialog) {
delete_dialog = new MessageDialog (_("Removing a Master will deassign all slaves. Remove it anyway?"),
true, MESSAGE_WARNING, BUTTONS_YES_NO, true);
delete_dialog->signal_response().connect (sigc::mem_fun (*this, &VCAMasterStrip::hide_confirmation));
}
delete_dialog->set_position (Gtk::WIN_POS_MOUSE);
delete_dialog->present ();
_vca->presentation_info().set_hidden (true);
}
void
@ -389,6 +379,10 @@ VCAMasterStrip::vca_property_changed (PropertyChange const & what_changed)
if (what_changed.contains (ARDOUR::Properties::color)) {
vertical_button.set_active_color (_vca->presentation_info().color ());
}
if (what_changed.contains (ARDOUR::Properties::hidden)) {
}
}
void