From e7569eabe7cdcecad8a041bdc50a723051ee3d38 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Sun, 12 Dec 2021 11:32:16 -0600 Subject: [PATCH] Trigger Cues: implement master Stop button (libardour part) --- libs/ardour/ardour/route.h | 2 ++ libs/ardour/ardour/session.h | 3 +++ libs/ardour/route.cc | 8 ++++++++ libs/ardour/session_transport.cc | 11 +++++++++++ 4 files changed, 24 insertions(+) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 5dc7c9c388..32d31ac231 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -205,6 +205,8 @@ public: void set_disk_io_point (DiskIOPoint); DiskIOPoint disk_io_point() const { return _disk_io_point; } + void stop_trigger(bool now); + /* Processors */ boost::shared_ptr amp() const { return _amp; } diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 6dacf0a95c..8b5e9b3d9e 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -487,6 +487,9 @@ public: void start_transport_from_trigger (); void stop_transport_from_trigger (); + + void stop_all_triggers (bool now = true); + void request_transport_speed (double speed, TransportRequestSource origin = TRS_UI); void request_default_play_speed (double speed, TransportRequestSource origin = TRS_UI); void request_transport_speed_nonzero (double, TransportRequestSource origin = TRS_UI); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 41d3b97172..e453c8f41c 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1728,6 +1728,14 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams* return 0; } +void +Route::stop_trigger (bool now) +{ + if (_triggerbox) { + _triggerbox->request_stop_all(); //ToDo: stop now or at end of quant? + } +} + void Route::reset_instrument_info () { diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 6516cda67b..264e117cff 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -432,6 +432,17 @@ Session::set_transport_speed (double speed) } +/** Called from the gui thread */ +void +Session::stop_all_triggers (bool now) +{ + boost::shared_ptr rl = routes.reader(); + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { + (*i)->stop_trigger(now); + } +} + + /** Stop the transport. */ void Session::stop_transport (bool abort, bool clear_state)