From 3f9fe81da989ddfb99254b90f6e9273b6bc6d7aa Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 6 Jan 2026 21:20:49 +0100 Subject: [PATCH] Extend ctrl surface API to be more flexible when creating markers --- libs/ctrl-interface/control_protocol/basic_ui.cc | 4 ++-- .../control_protocol/control_protocol/basic_ui.h | 3 ++- libs/surfaces/faderport/faderport.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/ctrl-interface/control_protocol/basic_ui.cc b/libs/ctrl-interface/control_protocol/basic_ui.cc index 07955844af..fb2e1c1034 100644 --- a/libs/ctrl-interface/control_protocol/basic_ui.cc +++ b/libs/ctrl-interface/control_protocol/basic_ui.cc @@ -152,10 +152,10 @@ BasicUI::goto_end () } void -BasicUI::add_marker (const std::string& markername) +BasicUI::add_marker (const std::string& markername, Location::Flags flags) { timepos_t where (session->audible_sample()); - Location *location = new Location (*session, where, where, markername, Location::IsMark); + Location *location = new Location (*session, where, where, markername, flags); session->begin_reversible_command (_("add marker")); XMLNode &before = session->locations()->get_state(); session->locations()->add (location, true); diff --git a/libs/ctrl-interface/control_protocol/control_protocol/basic_ui.h b/libs/ctrl-interface/control_protocol/control_protocol/basic_ui.h index a1a0f0c436..39912754ba 100644 --- a/libs/ctrl-interface/control_protocol/control_protocol/basic_ui.h +++ b/libs/ctrl-interface/control_protocol/control_protocol/basic_ui.h @@ -30,6 +30,7 @@ #include "temporal/timeline.h" +#include "ardour/location.h" #include "ardour/types.h" #include "ardour/presentation_info.h" @@ -49,7 +50,7 @@ class LIBCONTROLCP_API BasicUI { BasicUI (ARDOUR::Session&); virtual ~BasicUI (); - void add_marker (const std::string& = std::string()); + void add_marker (const std::string& = std::string(), ARDOUR::Location::Flags flags = ARDOUR::Location::IsMark); void remove_marker_at_playhead (); // void mark_in(); diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index e9d569768b..bae6578488 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -145,7 +145,7 @@ FaderPort::FaderPort (Session& s) get_button (Punch).set_action (std::bind (&FaderPort::punch, this), true); get_button (Loop).set_action (std::bind (&BasicUI::loop_toggle, this), true); - get_button (Loop).set_action (std::bind (&BasicUI::add_marker, this, string()), true, ShiftDown); + get_button (Loop).set_action (std::bind (&BasicUI::add_marker, this, string(), Location::IsMark), true, ShiftDown); get_button (Punch).set_action (std::bind (&BasicUI::prev_marker, this), true, ShiftDown); get_button (User).set_action (std::bind (&BasicUI::next_marker, this), true, ShiftDown);