mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-27 08:57:41 +01:00
add ensure snapshot dir to SnapshotManager class... creating new snapshots with create_snapshot is broken as of this commit, will fix later
This commit is contained in:
parent
8411fd17db
commit
5a3017153e
2 changed files with 14 additions and 3 deletions
|
|
@ -49,7 +49,7 @@ public:
|
|||
void refresh();
|
||||
void clear() { _global_snapshots.clear(); _local_snapshots.clear(); };
|
||||
private:
|
||||
|
||||
void ensure_snapshot_dir(bool global);
|
||||
std::string _global_path;
|
||||
std::string _local_path;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include "pbd/basename.h"
|
||||
#include "pbd/file_utils.h"
|
||||
#include "pbd/gstdio_compat.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
using namespace std;
|
||||
|
|
@ -48,6 +49,14 @@ MixerSnapshotManager::MixerSnapshotManager (Session* s)
|
|||
refresh();
|
||||
}
|
||||
|
||||
void MixerSnapshotManager::ensure_snapshot_dir(bool global)
|
||||
{
|
||||
const string path = global ? _global_path : _local_path;
|
||||
if(!Glib::file_test(path.c_str(), Glib::FILE_TEST_EXISTS & Glib::FILE_TEST_IS_DIR)) {
|
||||
::g_mkdir(path.c_str(), 0775);
|
||||
}
|
||||
}
|
||||
|
||||
void MixerSnapshotManager::refresh()
|
||||
{
|
||||
clear();
|
||||
|
|
@ -96,7 +105,8 @@ void MixerSnapshotManager::refresh()
|
|||
|
||||
void MixerSnapshotManager::create_snapshot(std::string const& label, RouteList& rl, bool global)
|
||||
{
|
||||
const string path = global?_global_path:_local_path;
|
||||
ensure_snapshot_dir(global);
|
||||
const string path = global ? _global_path : _local_path;
|
||||
MixerSnapshot* snapshot = new MixerSnapshot(_session);
|
||||
snapshot->snap(rl);
|
||||
snapshot->set_label(label);
|
||||
|
|
@ -113,7 +123,8 @@ void MixerSnapshotManager::create_snapshot(std::string const& label, RouteList&
|
|||
|
||||
void MixerSnapshotManager::create_snapshot(std::string const& label, std::string const& from_path, bool global)
|
||||
{
|
||||
const string path = global?_global_path:_local_path;
|
||||
ensure_snapshot_dir(global);
|
||||
const string path = global ? _global_path : _local_path;
|
||||
MixerSnapshot* snapshot = new MixerSnapshot(_session, from_path);
|
||||
snapshot->set_label(label);
|
||||
snapshot->write(path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue