mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 14:15:46 +01:00
Add API to restore mixer scenes for given set or Routes only
This commit is contained in:
parent
800d07a633
commit
aaddf5f385
5 changed files with 43 additions and 2 deletions
|
|
@ -40,6 +40,7 @@ public:
|
|||
|
||||
void snapshot ();
|
||||
bool apply () const;
|
||||
bool apply (AutomationControlSet const&) const;
|
||||
void clear ();
|
||||
bool empty () const { return _ctrl_map.empty (); }
|
||||
|
||||
|
|
|
|||
|
|
@ -1215,6 +1215,7 @@ public:
|
|||
boost::shared_ptr<PBD::Controllable> recently_touched_controllable () const;
|
||||
|
||||
bool apply_nth_mixer_scene (size_t);
|
||||
bool apply_nth_mixer_scene (size_t, RouteList const&);
|
||||
void store_nth_mixer_scene (size_t);
|
||||
bool nth_mixer_scene_valid (size_t) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -1846,7 +1846,8 @@ LuaBindings::common (lua_State* L)
|
|||
.endClass ()
|
||||
|
||||
.beginWSPtrClass <MixerScene> ("MixerScene")
|
||||
.addFunction ("apply", &MixerScene::apply)
|
||||
.addFunction ("apply", (bool (MixerScene::*)() const)&MixerScene::apply)
|
||||
.addFunction ("apply_to", (bool (MixerScene::*)(AutomationControlSet const&) const)&MixerScene::apply)
|
||||
.addFunction ("snapshot", &MixerScene::snapshot)
|
||||
.addFunction ("clear", &MixerScene::clear)
|
||||
.addFunction ("empty", &MixerScene::empty)
|
||||
|
|
@ -2809,7 +2810,8 @@ LuaBindings::common (lua_State* L)
|
|||
|
||||
.addFunction ("bundles", &Session::bundles)
|
||||
|
||||
.addFunction ("apply_nth_mixer_scene", &Session::apply_nth_mixer_scene)
|
||||
.addFunction ("apply_nth_mixer_scene", (bool (Session::*)(size_t))&Session::apply_nth_mixer_scene)
|
||||
.addFunction ("apply_nth_mixer_scene_to", (bool (Session::*)(size_t, RouteList const&))&Session::apply_nth_mixer_scene)
|
||||
.addFunction ("store_nth_mixer_scene", &Session::store_nth_mixer_scene)
|
||||
.addFunction ("nth_mixer_scene_valid", &Session::nth_mixer_scene_valid)
|
||||
.addFunction ("nth_mixer_scene", &Session::nth_mixer_scene)
|
||||
|
|
|
|||
|
|
@ -138,6 +138,19 @@ MixerScene::apply () const
|
|||
return rv;
|
||||
}
|
||||
|
||||
bool
|
||||
MixerScene::apply (AutomationControlSet const& acs) const
|
||||
{
|
||||
bool rv = false;
|
||||
std::set<PBD::ID> done;
|
||||
|
||||
for (auto const& c : acs) {
|
||||
rv |= recurse_to_master (c, done);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
MixerScene::get_state () const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7536,6 +7536,30 @@ Session::apply_nth_mixer_scene (size_t nth)
|
|||
return scene->apply ();
|
||||
}
|
||||
|
||||
bool
|
||||
Session::apply_nth_mixer_scene (size_t nth, RouteList const& rl)
|
||||
{
|
||||
boost::shared_ptr<MixerScene> scene;
|
||||
{
|
||||
Glib::Threads::RWLock::ReaderLock lm (_mixer_scenes_lock);
|
||||
if (_mixer_scenes.size () <= nth) {
|
||||
return false;
|
||||
}
|
||||
if (!_mixer_scenes[nth]) {
|
||||
return false;
|
||||
}
|
||||
scene = _mixer_scenes[nth];
|
||||
}
|
||||
assert (scene);
|
||||
|
||||
AutomationControlSet acs;
|
||||
for (auto const& r : rl) {
|
||||
r->automatables (acs);
|
||||
}
|
||||
|
||||
return scene->apply (acs);
|
||||
}
|
||||
|
||||
void
|
||||
Session::store_nth_mixer_scene (size_t nth)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue