From b4b891b6ab4741b132d306188f47a275e6119a5b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 9 Apr 2007 18:07:15 +0000 Subject: make region opacity work again; fix several other region context menu items that may have been messing with region state in unforeseen ways git-svn-id: svn://localhost/ardour2/trunk@1691 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 8e711a3905..0f3060e299 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1631,48 +1631,65 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr items.push_back (SeparatorElem()); - items.push_back (CheckMenuElem (_("Lock"), mem_fun(*this, &Editor::toggle_region_lock))); + sigc::connection fooc; + + items.push_back (CheckMenuElem (_("Lock"))); region_lock_item = static_cast(&items.back()); + fooc = region_lock_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_lock)); if (region->locked()) { + fooc.block (true); region_lock_item->set_active(); + fooc.block (false); } - items.push_back (CheckMenuElem (_("Mute"), mem_fun(*this, &Editor::toggle_region_mute))); + items.push_back (CheckMenuElem (_("Mute"))); region_mute_item = static_cast(&items.back()); + fooc = region_mute_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_mute)); if (region->muted()) { + fooc.block (true); region_mute_item->set_active(); + fooc.block (false); } - items.push_back (CheckMenuElem (_("Opaque"), mem_fun(*this, &Editor::toggle_region_opaque))); + + items.push_back (CheckMenuElem (_("Opaque"))); region_opaque_item = static_cast(&items.back()); + fooc = region_opaque_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_opaque)); if (region->opaque()) { + fooc.block (true); region_opaque_item->set_active(); + fooc.block (false); } - + items.push_back (CheckMenuElem (_("Original position"), mem_fun(*this, &Editor::naturalize))); if (region->at_natural_position()) { items.back().set_sensitive (false); } - + items.push_back (SeparatorElem()); - + if (ar) { RegionView* rv = sv->find_view (ar); AudioRegionView* arv = dynamic_cast(rv); - + items.push_back (MenuElem (_("Reset Envelope"), mem_fun(*this, &Editor::reset_region_gain_envelopes))); - items.push_back (CheckMenuElem (_("Envelope Visible"), mem_fun(*this, &Editor::toggle_gain_envelope_visibility))); + items.push_back (CheckMenuElem (_("Envelope Visible"))); region_envelope_visible_item = static_cast (&items.back()); - + fooc = region_envelope_visible_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_visibility)); if (arv->envelope_visible()) { + fooc.block (true); region_envelope_visible_item->set_active (true); + fooc.block (false); } - - items.push_back (CheckMenuElem (_("Envelope Active"), mem_fun(*this, &Editor::toggle_gain_envelope_active))); + + items.push_back (CheckMenuElem (_("Envelope Active"))); region_envelope_active_item = static_cast (&items.back()); - + fooc = region_envelope_active_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_active)); + if (ar->envelope_active()) { + fooc.block (true); region_envelope_active_item->set_active (true); + fooc.block (false); } items.push_back (SeparatorElem()); -- cgit v1.2.3