diff --git a/gtk2_ardour/mixer_snapshot_dialog.cc b/gtk2_ardour/mixer_snapshot_dialog.cc index f4aa04b81d..f7a9eb06b0 100644 --- a/gtk2_ardour/mixer_snapshot_dialog.cc +++ b/gtk2_ardour/mixer_snapshot_dialog.cc @@ -291,13 +291,13 @@ void MixerSnapshotDialog::new_snapshot(bool global) string new_label; prompt.get_result(new_label); if (new_label.length() > 0) { - snap->label = new_label; + snap->set_label(new_label); string path = ""; if(global) { - path = Glib::build_filename(user_config_directory(-1), "mixer_snapshots/", snap->label + ".xml"); + path = Glib::build_filename(user_config_directory(-1), "mixer_snapshots/", snap->get_label() + ".xml"); } else { - path = Glib::build_filename(_session->session_directory().root_path(), "mixer_snapshots/", snap->label + ".xml"); + path = Glib::build_filename(_session->session_directory().root_path(), "mixer_snapshots/", snap->get_label() + ".xml"); } if(!rl.empty() && sel->get_active()) @@ -338,13 +338,13 @@ void MixerSnapshotDialog::new_snap_from_session(bool global) MixerSnapshot* snapshot = new MixerSnapshot(_session, session_path); - snapshot->label = basename_nosuffix(session_path); + snapshot->set_label(basename_nosuffix(session_path)); string path = ""; if(global) { - path = Glib::build_filename(user_config_directory(-1), "mixer_snapshots/", snapshot->label + ".xml"); + path = Glib::build_filename(user_config_directory(-1), "mixer_snapshots/", snapshot->get_label() + ".xml"); } else { - path = Glib::build_filename(_session->session_directory().root_path(), "mixer_snapshots/", snapshot->label + ".xml"); + path = Glib::build_filename(_session->session_directory().root_path(), "mixer_snapshots/", snapshot->get_label() + ".xml"); } snapshot->write(path); @@ -365,7 +365,7 @@ void MixerSnapshotDialog::refill() string name = basename_nosuffix(*(i)); MixerSnapshot* snap = new MixerSnapshot(_session, path); - snap->label = name; + snap->set_label(name); TreeModel::Row row = *(global_model->append()); if (name.length() > 48) { @@ -374,7 +374,7 @@ void MixerSnapshotDialog::refill() } row[_columns.name] = name; - row[_columns.favorite] = snap->favorite; + row[_columns.favorite] = snap->get_favorite(); row[_columns.version] = snap->get_last_modified_with(); row[_columns.n_tracks] = snap->get_routes().size(); row[_columns.n_vcas] = snap->get_vcas().size(); @@ -402,7 +402,7 @@ void MixerSnapshotDialog::refill() string name = basename_nosuffix(*(i)); MixerSnapshot* snap = new MixerSnapshot(_session, path); - snap->label = name; + snap->set_label(name); TreeModel::Row row = *(local_model->append()); if (name.length() > 48) { @@ -411,7 +411,7 @@ void MixerSnapshotDialog::refill() } row[_columns.name] = name; - row[_columns.favorite] = snap->favorite; + row[_columns.favorite] = snap->get_favorite(); row[_columns.version] = snap->get_last_modified_with(); row[_columns.n_tracks] = snap->get_routes().size(); row[_columns.n_vcas] = snap->get_vcas().size(); @@ -439,8 +439,8 @@ void MixerSnapshotDialog::fav_cell_action(const string& path, bool global) if(iter) { MixerSnapshot* snap = (*iter)[_columns.snapshot]; - snap->favorite = !snap->favorite; - (*iter)[_columns.favorite] = snap->favorite; + snap->set_favorite(!snap->get_favorite()); + (*iter)[_columns.favorite] = snap->get_favorite(); snap->write((*iter)[_columns.full_path]); } } \ No newline at end of file diff --git a/libs/ardour/ardour/mixer_snapshot.h b/libs/ardour/ardour/mixer_snapshot.h index 62c5bc69e4..6e6264b9ae 100644 --- a/libs/ardour/ardour/mixer_snapshot.h +++ b/libs/ardour/ardour/mixer_snapshot.h @@ -65,12 +65,21 @@ class LIBARDOUR_API MixerSnapshot std::vector get_routes() {return route_states;}; std::vector get_groups() {return group_states;}; std::vector get_vcas() {return vca_states;}; - std::string get_last_modified_with() {return last_modified_with;}; - int id; - std::string label; - std::time_t timestamp; - bool favorite; + unsigned int get_id() {return id;}; + void set_id(unsigned int new_id) {id = new_id;}; + + std::string get_label() {return label;}; + void set_label(std::string new_label) {label = new_label;}; + + bool get_favorite() {return timestamp;}; + void set_favorite(bool yn) {favorite = yn;}; + + std::time_t get_timestamp() {return timestamp;}; + void set_timestamp(std::time_t new_timestamp) {timestamp = new_timestamp;}; + + std::string get_last_modified_with() {return last_modified_with;}; + void set_last_modified_with(std::string new_modified_with) {last_modified_with = new_modified_with;}; private: ARDOUR::Session* _session; @@ -80,7 +89,12 @@ class LIBARDOUR_API MixerSnapshot void load_from_session(std::string); void load_from_session(XMLNode&); + unsigned int id; + bool favorite; + std::string label; + std::time_t timestamp; std::string last_modified_with; + std::vector route_states; std::vector group_states; std::vector vca_states; diff --git a/libs/ardour/mixer_snapshot.cc b/libs/ardour/mixer_snapshot.cc index 8dc0459144..d192dfba1a 100644 --- a/libs/ardour/mixer_snapshot.cc +++ b/libs/ardour/mixer_snapshot.cc @@ -22,9 +22,9 @@ using namespace ARDOUR; MixerSnapshot::MixerSnapshot(Session* s) : id(0) + , favorite(false) , label("snapshot") , timestamp(time(0)) - , favorite(false) , last_modified_with(string_compose("%1 %2", PROGRAM_NAME, revision)) { if(s) @@ -33,9 +33,9 @@ MixerSnapshot::MixerSnapshot(Session* s) MixerSnapshot::MixerSnapshot(Session* s, string file_path) : id(0) + , favorite(false) , label("snapshot") , timestamp(time(0)) - , favorite(false) , last_modified_with(string_compose("%1 %2", PROGRAM_NAME, revision)) { if(s)