mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-28 09:27:39 +01:00
more work on getting TemplateManager to use the SnapshotManager:
Create hookup, and use RenamedSnapshot signal
This commit is contained in:
parent
ef3f3d0f47
commit
54cd8e6368
4 changed files with 11 additions and 0 deletions
|
|
@ -159,6 +159,7 @@ void MixerSnapshotList::set_session (Session* s)
|
|||
if(_global) {
|
||||
s->snapshot_manager().PromotedSnapshot.connect(connections, invalidator(*this), boost::bind(&MixerSnapshotList::add_promoted_snapshot, this, _1), gui_context());
|
||||
s->snapshot_manager().RemovedSnapshot.connect(connections, invalidator(*this), boost::bind(&MixerSnapshotList::redisplay, this), gui_context());
|
||||
s->snapshot_manager().RenamedSnapshot.connect(connections, invalidator(*this), boost::bind(&MixerSnapshotList::redisplay, this), gui_context());
|
||||
}
|
||||
redisplay();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -883,6 +883,14 @@ RouteTemplateManager::rename_template (TreeModel::iterator& item, const Glib::us
|
|||
|
||||
item->set_value (_template_columns.name, string (new_name));
|
||||
item->set_value (_template_columns.path, new_filepath);
|
||||
|
||||
SnapshotList sl = _session->snapshot_manager().get_global_snapshots();
|
||||
for(SnapshotList::const_iterator it = sl.begin(); it != sl.end(); it++) {
|
||||
if(old_name == (*it)->get_label()) {
|
||||
_session->snapshot_manager().rename_snapshot((*it), new_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public:
|
|||
PBD::Signal1<void, ARDOUR::MixerSnapshot*> PromotedSnapshot;
|
||||
PBD::Signal1<void, ARDOUR::MixerSnapshot*> CreatedSnapshot;
|
||||
PBD::Signal0<void> RemovedSnapshot;
|
||||
PBD::Signal0<void> RenamedSnapshot;
|
||||
private:
|
||||
void ensure_snapshot_dir(bool global);
|
||||
std::string _global_path;
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ bool MixerSnapshotManager::rename_snapshot(MixerSnapshot* snapshot, const string
|
|||
const string new_path = Glib::build_filename(dir, snapshot->get_label() + string(template_suffix));
|
||||
::g_rename(old_path.c_str(), new_path.c_str());
|
||||
snapshot->set_path(new_path);
|
||||
RenamedSnapshot(); /* EMIT SIGNAL */
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue