mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
add PromotedSnapshot signal to manager, and subscribe to this this in the global MixerSnapshotList
This commit is contained in:
parent
132e895b18
commit
4a085b91f5
4 changed files with 21 additions and 2 deletions
|
|
@ -149,8 +149,13 @@ void MixerSnapshotList::bootstrap_display_and_model()
|
|||
|
||||
void MixerSnapshotList::set_session (Session* s)
|
||||
{
|
||||
SessionHandlePtr::set_session (s);
|
||||
redisplay ();
|
||||
if(s) {
|
||||
SessionHandlePtr::set_session(s);
|
||||
redisplay ();
|
||||
if(_global) {
|
||||
s->snapshot_manager().PromotedSnapshot.connect(connections, invalidator(*this), boost::bind(&MixerSnapshotList::add_promoted_snapshot, this, _1), gui_context());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MixerSnapshotList::new_snapshot() {
|
||||
|
|
@ -342,6 +347,14 @@ void MixerSnapshotList::substitution_dialog_response(int response, MixerSnapshot
|
|||
snapshot->set_route_states(clean);
|
||||
}
|
||||
|
||||
void MixerSnapshotList::add_promoted_snapshot(MixerSnapshot* snapshot)
|
||||
{
|
||||
if(!snapshot) {
|
||||
return;
|
||||
}
|
||||
redisplay();
|
||||
}
|
||||
|
||||
|
||||
/* Pop up the snapshot display context menu.
|
||||
* @param button Button used to open the menu.
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ private:
|
|||
void promote_snapshot (Gtk::TreeModel::iterator&);
|
||||
Gtk::TreeModel::const_iterator get_row_by_name(const std::string&);
|
||||
bool remove_row(Gtk::TreeModel::const_iterator&);
|
||||
void add_promoted_snapshot(ARDOUR::MixerSnapshot*);
|
||||
};
|
||||
|
||||
#endif // __gtk_ardour_mixer_snapshots_h__
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
#include "ardour/mixer_snapshot.h"
|
||||
#include "ardour/session.h"
|
||||
|
||||
#include "pbd/signals.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
typedef std::set<MixerSnapshot*> SnapshotList;
|
||||
|
||||
|
|
@ -56,6 +58,8 @@ public:
|
|||
|
||||
void refresh();
|
||||
void clear() { _global_snapshots.clear(); _local_snapshots.clear(); };
|
||||
|
||||
PBD::Signal1<void, ARDOUR::MixerSnapshot*> PromotedSnapshot;
|
||||
private:
|
||||
void ensure_snapshot_dir(bool global);
|
||||
std::string _global_path;
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ bool MixerSnapshotManager::promote(MixerSnapshot* snapshot) {
|
|||
|
||||
//insert the new snapshot
|
||||
_global_snapshots.insert(new_snap);
|
||||
PromotedSnapshot(new_snap); /* EMIT SIGNAL */
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue