View Issue Details

IDProjectCategoryView StatusLast Update
0002024ardourbugspublic2020-04-19 20:12
Reporterstigge Assigned Topaul  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionSVN/2.0-ongoing 
Summary0002024: bugfix: region selection for mute, lock, opaque, etc. on several overlapped regions in one track
DescriptionIn Debian and ardour versions 2.1 and SVN/2.0-ongoing, there is the problem that when we have several overlapping regions in a track and want to mute, lock, opaque etc. a certain region, only the "last" on of them (in the context menu list) is handled correctly although we specified a certain other region.

The attached patch fixes it in this way: It takes the respective region_*_item out of editor.h and uses it only locally in editor.cc. In editor_ops.cc, it can be removed. There, it was only used for a consistency check which checked if the respective real option was in sync with the CheckMenuItem's state. Since there is no good reason for assuming the opposite (the items are always setup carefully), we can remove this here and just toggle the respective state. (Besides, if the old code actually detected a (never occuring) inconsistency, it silently ignored it.)

Works for me now. :)
TagsNo tags attached.

Activities

2008-01-11 17:34

 

ardour.patch (5,464 bytes)   
diff -ruN ardour-2.1.orig/gtk2_ardour/editor.cc ardour-2.1/gtk2_ardour/editor.cc
--- ardour-2.1.orig/gtk2_ardour/editor.cc	2007-09-27 15:39:10.000000000 +0200
+++ ardour-2.1/gtk2_ardour/editor.cc	2008-01-11 16:08:12.000000000 +0100
@@ -1713,7 +1713,7 @@
 	sigc::connection fooc;
 
 	items.push_back (CheckMenuElem (_("Lock")));
-	region_lock_item = static_cast<CheckMenuItem*>(&items.back());
+	CheckMenuItem* 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);
@@ -1721,7 +1721,7 @@
 		fooc.block (false);
 	}
 	items.push_back (CheckMenuElem (_("Mute")));
-	region_mute_item = static_cast<CheckMenuItem*>(&items.back());
+	CheckMenuItem* 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);
@@ -1731,7 +1731,7 @@
 	
 	if (!Profile->get_sae()) {
 		items.push_back (CheckMenuElem (_("Opaque")));
-		region_opaque_item = static_cast<CheckMenuItem*>(&items.back());
+		CheckMenuItem* 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);
@@ -1756,7 +1756,7 @@
 			items.push_back (MenuElem (_("Reset Envelope"), mem_fun(*this, &Editor::reset_region_gain_envelopes)));
 
 			items.push_back (CheckMenuElem (_("Envelope Visible")));
-			region_envelope_visible_item = static_cast<CheckMenuItem*> (&items.back());
+			CheckMenuItem* 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);
@@ -1765,7 +1765,7 @@
 			}
 		
 			items.push_back (CheckMenuElem (_("Envelope Active")));
-			region_envelope_active_item = static_cast<CheckMenuItem*> (&items.back());
+			CheckMenuItem* 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()) {
diff -ruN ardour-2.1.orig/gtk2_ardour/editor.h ardour-2.1/gtk2_ardour/editor.h
--- ardour-2.1.orig/gtk2_ardour/editor.h	2007-09-25 17:26:03.000000000 +0200
+++ ardour-2.1/gtk2_ardour/editor.h	2008-01-11 16:19:57.000000000 +0100
@@ -1885,12 +1885,6 @@
 	void toggle_gain_envelope_active ();
 	void reset_region_gain_envelopes ();
 
-	Gtk::CheckMenuItem* region_envelope_visible_item;
-	Gtk::CheckMenuItem* region_envelope_active_item;
-	Gtk::CheckMenuItem* region_mute_item;
-	Gtk::CheckMenuItem* region_lock_item;
-	Gtk::CheckMenuItem* region_opaque_item;
-	
 	bool on_key_press_event (GdkEventKey*);
 
 	void session_state_saved (string);
diff -ruN ardour-2.1.orig/gtk2_ardour/editor_ops.cc ardour-2.1/gtk2_ardour/editor_ops.cc
--- ardour-2.1.orig/gtk2_ardour/editor_ops.cc	2007-09-27 18:10:36.000000000 +0200
+++ ardour-2.1/gtk2_ardour/editor_ops.cc	2008-01-11 16:19:23.000000000 +0100
@@ -3400,10 +3400,7 @@
 	for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
 		AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
 		if (arv) {
-			bool x = region_envelope_visible_item->get_active();
-			if (x != arv->envelope_visible()) {
-				arv->set_envelope_visible (x);
-			}
+			arv->set_envelope_visible (!arv->envelope_visible());
 		}
 	}
 }
@@ -3414,10 +3411,7 @@
 	for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
 		AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
 		if (arv) {
-			bool x = region_envelope_active_item->get_active();
-			if (x != arv->audio_region()->envelope_active()) {
-				arv->audio_region()->set_envelope_active (x);
-			}
+			arv->audio_region()->set_envelope_active (!arv->audio_region()->envelope_active());
 		}
 	}
 }
@@ -3428,10 +3422,7 @@
 	for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
 		AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
 		if (arv) {
-			bool x = region_lock_item->get_active();
-			if (x != arv->audio_region()->locked()) {
-				arv->audio_region()->set_locked (x);
-			}
+			arv->audio_region()->set_locked (!arv->audio_region()->locked());
 		}
 	}
 }
@@ -3442,10 +3433,7 @@
 	for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
 		AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
 		if (arv) {
-			bool x = region_mute_item->get_active();
-			if (x != arv->audio_region()->muted()) {
-				arv->audio_region()->set_muted (x);
-			}
+			arv->audio_region()->set_muted (!arv->audio_region()->muted());
 		}
 	}
 }
@@ -3456,10 +3444,7 @@
 	for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
 		AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
 		if (arv) {
-			bool x = region_opaque_item->get_active();
-			if (x != arv->audio_region()->opaque()) {
-				arv->audio_region()->set_opaque (x);
-			}
+			arv->audio_region()->set_opaque (!arv->audio_region()->opaque());
 		}
 	}
 }
ardour.patch (5,464 bytes)   

nowhiskey

2008-01-11 18:06

reporter   ~0004645

...did not even recognized the bug you are introducing here, but the patch seems to work good!

cheers,
doc

paul

2008-01-13 14:21

administrator   ~0004651

patch applied and will be in 2.2 release. thanks!

system

2020-04-19 20:12

developer   ~0021606

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2008-01-11 17:34 stigge New Issue
2008-01-11 17:34 stigge File Added: ardour.patch
2008-01-11 18:06 nowhiskey Note Added: 0004645
2008-01-13 14:21 paul Status new => resolved
2008-01-13 14:21 paul Resolution open => fixed
2008-01-13 14:21 paul Assigned To => paul
2008-01-13 14:21 paul Note Added: 0004651
2020-04-19 20:12 system Note Added: 0021606
2020-04-19 20:12 system Status resolved => closed