Refactoring Session saving

use Session::save static method to save a session from a thread (same mechanism as Session::load). It calls Action::takeSnapshot if saving version is required. Mixer is busy during saving, pops up info when done.
This commit is contained in:
Bruno Herbelin
2022-01-17 00:38:48 +01:00
parent e96444671e
commit 81e8d6d99c
7 changed files with 161 additions and 130 deletions

View File

@@ -39,6 +39,7 @@ public:
~Session();
static Session *load(const std::string& filename, uint recursion = 0);
static std::string save(const std::string& filename, Session *session, const std::string& snapshot_name = "");
// add given source into the session
SourceList::iterator addSource (Source *s);
@@ -148,11 +149,6 @@ public:
void removeFromPlayGroup(size_t i, Source *s);
std::vector<SourceIdList> getPlayGroups() { return play_groups_; }
// lock and unlock access (e.g. while saving)
void lock ();
void unlock ();
bool locked ();
protected:
bool active_;
float activation_threshold_;