From 44ff0e46bae6ebbb4e3b4a971f5eecf24ac47213 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 8 Nov 2022 17:29:40 -0600 Subject: [PATCH] MixerScenes: show last-selected scene (libardour part) --- libs/ardour/ardour/session.h | 2 ++ libs/ardour/session.cc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index bca3970f08..0fb75a52ed 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1218,6 +1218,7 @@ public: bool apply_nth_mixer_scene (size_t, RouteList const&); void store_nth_mixer_scene (size_t); bool nth_mixer_scene_valid (size_t) const; + size_t last_touched_mixer_scene_idx () {return _last_touched_mixer_scene_idx;} boost::shared_ptr nth_mixer_scene (size_t, bool create_if_missing = false); std::vector> mixer_scenes () const; @@ -1437,6 +1438,7 @@ private: bool _session_range_is_free; bool _silent; samplecnt_t _remaining_latency_preroll; + size_t _last_touched_mixer_scene_idx; // varispeed playback -- TODO: move out of session to backend. double _engine_speed; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index f8de974212..b18e1f41f3 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -198,6 +198,7 @@ Session::Session (AudioEngine &eng, , _session_range_is_free (true) , _silent (false) , _remaining_latency_preroll (0) + , _last_touched_mixer_scene_idx (999) , _engine_speed (1.0) , _signalled_varispeed (0) , auto_play_legal (false) @@ -7537,6 +7538,8 @@ Session::apply_nth_mixer_scene (size_t nth) scene = _mixer_scenes[nth]; } assert (scene); + + _last_touched_mixer_scene_idx = nth; return scene->apply (); } @@ -7561,6 +7564,7 @@ Session::apply_nth_mixer_scene (size_t nth, RouteList const& rl) r->automatables (acs); } + _last_touched_mixer_scene_idx = nth; return scene->apply (acs); } @@ -7568,6 +7572,8 @@ void Session::store_nth_mixer_scene (size_t nth) { boost::shared_ptr scn = nth_mixer_scene (nth, true); + + _last_touched_mixer_scene_idx = nth; scn->snapshot (); //calling code is expected to set a name, but we need to initalize with 'something'