View Issue Details

IDProjectCategoryView StatusLast Update
0001294ardourbugspublic2020-04-19 20:12
ReporterBenLoftis Assigned Topaul  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0001294: [PATCH] It is possible to have the punch range hidden, but be in punch mode which can be confusing
Description1) If you select "hide range" on the punch in/out ranges, the punch-in/punch-out still takes place if punch-in and punch-out are enabled. I think two behaviors are needed: A) if punch-in or punch-out is enabled, the range cannot be hidden. B) If a punch mode is enabled, then the range must be unhidden.


2) It is not possible to manually record if punch-in is enabled. This is OK in itself, but it can be confusing until you realize WHY Ardour won't go into record. I think the easiest solution is to allow the user to initiate and stop recording at any time, and in addition Ardour will do the automatic punch in and out.
TagsNo tags attached.

Activities

cth103

2009-08-24 23:21

administrator   ~0006600

When you talk about hiding, do you mean hiding the whole Loop/Punch Ranges ruler?

cth103

2009-10-20 19:29

administrator   ~0006780

Also, when you say we should "allow the user to initiate and stop recording at any time", how do you mean? When punch-in is enabled, the user must rec enable a track and enable the main record button, then start the transport. But no recording will take place until the punch in point is reached. How should the user specify that recording should take place anyway?

2009-10-20 21:47

 

1294.patch (3,123 bytes)   
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 317958d..6da3372 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -241,6 +241,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
 	bool ignore_dual_punch;
 	void toggle_punch_in ();
 	void toggle_punch_out ();
+	void show_loop_punch_ruler_and_disallow_hide ();
+	void reenable_hide_loop_punch_ruler_if_appropriate ();
 	void toggle_auto_return ();
 	void toggle_click ();
 
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 8923f5c..1661b9f 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -436,13 +436,86 @@ ARDOUR_UI::toggle_punch ()
 void
 ARDOUR_UI::toggle_punch_in ()
 {
-	ActionManager::toggle_config_state ("Transport", "TogglePunchIn", &Configuration::set_punch_in, &Configuration::get_punch_in);
+	Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchIn"));
+	if (!act) {
+		return;
+	}
+
+	Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+	if (!tact) {
+		return;
+	}
+
+	if (tact->get_active() != Config->get_punch_in()) {
+		Config->set_punch_in (tact->get_active ());
+	}
+
+	if (tact->get_active()) {
+		/* if punch-in is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
+		   to avoid confusing the user */
+		show_loop_punch_ruler_and_disallow_hide ();
+	}
+
+	reenable_hide_loop_punch_ruler_if_appropriate ();
 }
 
 void
 ARDOUR_UI::toggle_punch_out ()
 {
-	ActionManager::toggle_config_state ("Transport", "TogglePunchOut", &Configuration::set_punch_out, &Configuration::get_punch_out);
+	Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchOut"));
+	if (!act) {
+		return;
+	}
+
+	Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+	if (!tact) {
+		return;
+	}
+
+	if (tact->get_active() != Config->get_punch_out()) {
+		Config->set_punch_out (tact->get_active ());
+	}
+
+	if (tact->get_active()) {
+		/* if punch-out is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
+		   to avoid confusing the user */
+		show_loop_punch_ruler_and_disallow_hide ();
+	}
+
+	reenable_hide_loop_punch_ruler_if_appropriate ();
+}
+
+void
+ARDOUR_UI::show_loop_punch_ruler_and_disallow_hide ()
+{
+	Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
+	if (!act) {
+		return;
+	}
+
+	act->set_sensitive (false);
+	
+	Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+	if (!tact) {
+		return;
+	}
+	
+	if (!tact->get_active()) {
+		tact->set_active ();
+	}
+}
+
+/* This is a bit of a silly name for a method */
+void
+ARDOUR_UI::reenable_hide_loop_punch_ruler_if_appropriate ()
+{
+	if (!Config->get_punch_in() && !Config->get_punch_out()) {
+		/* if punch in/out are now both off, reallow hiding of the loop/punch ruler */
+		Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
+		if (act) {
+			act->set_sensitive (true);
+		}
+	}
 }
 
 void
1294.patch (3,123 bytes)   

cth103

2009-10-20 21:48

administrator   ~0006794

Attached a patch against 2.0 which shows the loop/punch ruler (and prevents it from being hidden) when punch in/out is enabled.

cth103

2009-10-20 21:58

administrator   ~0006795

Similar patch applied to 3.0 SVN.

BenLoftis

2009-10-21 19:10

developer   ~0006845

tested and committed patch to 2.8.3 SVN.

system

2020-04-19 20:12

developer   ~0021489

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
2006-11-03 21:05 BenLoftis New Issue
2009-08-24 23:21 cth103 Note Added: 0006600
2009-08-24 23:21 cth103 Status new => feedback
2009-10-20 19:29 cth103 Note Added: 0006780
2009-10-20 21:47 cth103 File Added: 1294.patch
2009-10-20 21:48 cth103 Note Added: 0006794
2009-10-20 21:58 cth103 Note Added: 0006795
2009-10-20 21:58 cth103 Status feedback => assigned
2009-10-20 21:58 cth103 Assigned To => paul
2009-10-20 21:59 cth103 cost => 0.00
2009-10-20 21:59 cth103 Summary It is possible to have the punch range hidden, but be in punch mode which can be confusing => [PATCH] It is possible to have the punch range hidden, but be in punch mode which can be confusing
2009-10-21 19:10 BenLoftis Note Added: 0006845
2009-10-22 01:54 cth103 Status assigned => resolved
2009-10-22 01:54 cth103 Resolution open => fixed
2020-04-19 20:12 system Note Added: 0021489
2020-04-19 20:12 system Status resolved => closed