From a3d92fe5a73628e16921b321dd039b8a4554fe1c Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Fri, 31 May 2024 09:27:41 -0500 Subject: [PATCH 1/3] fix paste error in context menu: show-other-ranges --- gtk2_ardour/editor_actions.cc | 2 +- gtk2_ardour/editor_rulers.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 03bfb2f1e3..5bdd8105cd 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -709,7 +709,7 @@ Editor::register_actions () session_range_action = Glib::RefPtr::cast_static (ActionManager::register_radio_action (ruler_actions, range_choice_group, X_("show-session-range"), _("Only Session Range"), sigc::bind (sigc::mem_fun(*this, &Editor::show_range_type), SessionRange))); punch_range_action = Glib::RefPtr::cast_static (ActionManager::register_radio_action (ruler_actions, range_choice_group, X_("show-punch-range"), _("Only Punch Range"), sigc::bind (sigc::mem_fun(*this, &Editor::show_range_type), PunchRange))); loop_range_action = Glib::RefPtr::cast_static (ActionManager::register_radio_action (ruler_actions, range_choice_group, X_("show-loop-range"), _("Only Loop Range"), sigc::bind (sigc::mem_fun(*this, &Editor::show_range_type), LoopRange))); - other_range_action = Glib::RefPtr::cast_static (ActionManager::register_radio_action (ruler_actions, range_choice_group, X_("show-other-ranges"), _("Only Other Ranges"), sigc::bind (sigc::mem_fun(*this, &Editor::show_range_type), OtherRange))); + other_range_action = Glib::RefPtr::cast_static (ActionManager::register_radio_action (ruler_actions, range_choice_group, X_("show-other-ranges"), _("Only Named Ranges"), sigc::bind (sigc::mem_fun(*this, &Editor::show_range_type), OtherRange))); ActionManager::register_action (editor_menu_actions, X_("VideoMonitorMenu"), _("Video Monitor")); diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 3121310d35..0696bb5f3f 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -353,7 +353,7 @@ Editor::popup_ruler_menu (timepos_t const & where, ItemType t) MAKE_ACTION_ITEM (rs_menu, rs_item, X_("Rulers"), X_("show-punch-range")); MAKE_ACTION_ITEM (rs_menu, rs_item, X_("Rulers"), X_("show-loop-range")); MAKE_ACTION_ITEM (rs_menu, rs_item, X_("Rulers"), X_("show-session-range")); - MAKE_ACTION_ITEM (rs_menu, rs_item, X_("Rulers"), X_("show-location-markers")); + MAKE_ACTION_ITEM (rs_menu, rs_item, X_("Rulers"), X_("show-other-ranges")); ruler_items.push_back (MenuElem (_("Show Ranges..."))); Gtk::MenuItem& range_show_menu = ruler_items.back(); From 4a99a40afd2f9608e397cc8b1f0f792f57e9f1e3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 31 May 2024 18:20:49 +0200 Subject: [PATCH 2/3] Add options to create and locate to scene markers --- libs/ardour/ardour/rc_configuration_vars.h | 3 +++ libs/ardour/midi_scene_changer.cc | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 9b3d4f6809..04722ff6af 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -231,6 +231,9 @@ CONFIG_VARIABLE (EditMode, edit_mode, "edit-mode", Slide) CONFIG_VARIABLE (RippleMode, ripple_mode, "ripple-mode", RippleSelected) CONFIG_VARIABLE (Temporal::TimeDomain, default_automation_time_domain, "default-automation-time-domain", Temporal::BeatTime) +CONFIG_VARIABLE (bool, mark_at_pgm_change, "mark-at-pgm-change", true) +CONFIG_VARIABLE (bool, locate_to_pgm_change, "locate-to-pgm-change", true) + /* plugin related */ CONFIG_VARIABLE (bool, new_plugins_active, "new-plugins-active", true) diff --git a/libs/ardour/midi_scene_changer.cc b/libs/ardour/midi_scene_changer.cc index d791c1275a..505c7fec8c 100644 --- a/libs/ardour/midi_scene_changer.cc +++ b/libs/ardour/midi_scene_changer.cc @@ -283,16 +283,22 @@ MIDISceneChanger::program_change_input (MIDI::Parser& parser, MIDI::byte program last_program_message_time = time; - if (!recording()) { + if (!recording ()) { + if (Config->get_locate_to_pgm_change ()) { + MIDIInputActivity (); /* EMIT SIGNAL */ - MIDIInputActivity (); /* EMIT SIGNAL */ + int bank = -1; + if (have_seen_bank_changes) { + bank = std::dynamic_pointer_cast(input_port)->channel (channel)->bank(); + } - int bank = -1; - if (have_seen_bank_changes) { - bank = std::dynamic_pointer_cast(input_port)->channel (channel)->bank(); + jump_to (bank, program); + return; } + } - jump_to (bank, program); + /* we are recording, do we need to create a marker */ + if (!Config->get_mark_at_pgm_change ()) { return; } From 8c1fddca14f6e515bea756da8a26f46bfcaafafb Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 31 May 2024 18:21:02 +0200 Subject: [PATCH 3/3] Expose scene marker preferences --- gtk2_ardour/rc_option_editor.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index ffaa8e3497..bc1c9ce370 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -3739,6 +3739,20 @@ These settings will only take effect after %1 is restarted.\n\ add_option (_("Transport"), psc); + bo = new BoolOption ("mark-at-pgm-change", + _("Create a marker when a MIDI program change is received (and RECORDING)"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_mark_at_pgm_change), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_mark_at_pgm_change) + ); + add_option (_("Transport"), bo); + + bo = new BoolOption ("locate-to-pgm-change", + _("Locate to the next matching scene marker when a MIDI program change is received (and NOT recording)"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_locate_to_pgm_change), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_locate_to_pgm_change) + ); + add_option (_("Transport"), bo); + add_option (_("Transport"), new OptionEditorHeading (_("Looping"))); bo = new BoolOption (