summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-04-09 18:07:15 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-04-09 18:07:15 +0000
commitb4b891b6ab4741b132d306188f47a275e6119a5b (patch)
treeb72ff459ef330e8f0752f41f9592290fee889b28 /gtk2_ardour
parenta3741ccac8946e5e69810e614e5ef28ab86ed548 (diff)
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.cc41
1 files changed, 29 insertions, 12 deletions
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<Region>
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<CheckMenuItem*>(&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<CheckMenuItem*>(&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<CheckMenuItem*>(&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<AudioRegionView*>(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<CheckMenuItem*> (&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<CheckMenuItem*> (&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());