Convert Snapshots into Versions of session

Added auto-snapshot on save to have an Iterative Saving mode, and change terminology of 'snapshots' to 'versions' management.
This commit is contained in:
Bruno Herbelin
2021-11-23 22:47:44 +01:00
parent ed7627af6f
commit 5ac7887360
8 changed files with 99 additions and 78 deletions

View File

@@ -202,7 +202,7 @@ void Action::restore(uint target)
void Action::snapshot(const std::string &label)
void Action::snapshot(const std::string &label, bool threaded)
{
// ignore if locked
if (locked_)
@@ -217,8 +217,11 @@ void Action::snapshot(const std::string &label)
Session *se = Mixer::manager().session();
se->snapshots()->keys_.push_back(id);
// threaded capture state of current session
std::thread(captureMixerSession, se->snapshots()->xmlDoc_, SNAPSHOT_NODE(id), snap_label).detach();
if (threaded)
// threaded capture state of current session
std::thread(captureMixerSession, se->snapshots()->xmlDoc_, SNAPSHOT_NODE(id), snap_label).detach();
else
captureMixerSession(se->snapshots()->xmlDoc_, SNAPSHOT_NODE(id), snap_label);
#ifdef ACTION_DEBUG
Log::Info("Snapshot stored %d '%s'", id, snap_label.c_str());
@@ -321,6 +324,12 @@ FrameBufferImage *Action::thumbnail(uint64_t snapshotid) const
return img;
}
void Action::clearSnapshots()
{
Session *se = Mixer::manager().session();
se->snapshots()->keys_.clear();
}
void Action::remove(uint64_t snapshotid)
{
if (snapshotid > 0)