basic architecture for Trigger selection
This is all done in the GUI, using GUI objects. THe primary goal here is to allow actions to be applied to selected triggers, so there's no real need for a trigger aspect to libardour (core) selection.
This commit is contained in:
parent
91a28b78c4
commit
a9949f20e6
|
@ -394,6 +394,7 @@ Selection::add (vector<RegionView*>& v)
|
|||
if (changed) {
|
||||
clear_time(); // enforce object/range exclusivity
|
||||
clear_tracks(); // enforce object/track exclusivity
|
||||
clear_triggers ();
|
||||
RegionsChanged ();
|
||||
}
|
||||
}
|
||||
|
@ -415,6 +416,7 @@ Selection::add (const RegionSelection& rs)
|
|||
if (changed) {
|
||||
clear_time(); // enforce object/range exclusivity
|
||||
clear_tracks(); // enforce object/track exclusivity
|
||||
clear_triggers ();
|
||||
RegionsChanged ();
|
||||
}
|
||||
}
|
||||
|
@ -427,6 +429,7 @@ Selection::add (RegionView* r)
|
|||
if (changed) {
|
||||
clear_time(); // enforce object/range exclusivity
|
||||
clear_tracks(); // enforce object/track exclusivity
|
||||
clear_triggers ();
|
||||
RegionsChanged ();
|
||||
}
|
||||
}
|
||||
|
@ -1647,3 +1650,57 @@ Selection::midi_regions ()
|
|||
|
||||
return ms;
|
||||
}
|
||||
|
||||
bool
|
||||
Selection::selected (TriggerEntry* te) const
|
||||
{
|
||||
return find (triggers.begin(), triggers.end(), te) != triggers.end();
|
||||
}
|
||||
|
||||
void
|
||||
Selection::set (TriggerEntry* te)
|
||||
{
|
||||
clear_triggers ();
|
||||
add (te);
|
||||
}
|
||||
|
||||
void
|
||||
Selection::add (TriggerEntry* te)
|
||||
{
|
||||
triggers.push_back (te);
|
||||
TriggersChanged ();
|
||||
}
|
||||
|
||||
void
|
||||
Selection::remove (TriggerEntry* te)
|
||||
{
|
||||
TriggerSelection::iterator e = find (triggers.begin(), triggers.end(), te);
|
||||
|
||||
if (e != triggers.end()) {
|
||||
triggers.erase (e);
|
||||
TriggersChanged ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Selection::toggle (TriggerEntry* te)
|
||||
{
|
||||
TriggerSelection::iterator e;
|
||||
|
||||
if ((e = find (triggers.begin(), triggers.end(), te)) != triggers.end()) {
|
||||
add (te);
|
||||
} else {
|
||||
triggers.erase (e);
|
||||
}
|
||||
TriggersChanged ();
|
||||
}
|
||||
|
||||
void
|
||||
Selection::clear_triggers ()
|
||||
{
|
||||
if (!triggers.empty()) {
|
||||
triggers.clear ();
|
||||
TriggersChanged ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "point_selection.h"
|
||||
#include "marker_selection.h"
|
||||
#include "midi_selection.h"
|
||||
#include "trigger_selection.h"
|
||||
|
||||
class TimeAxisView;
|
||||
class RegionView;
|
||||
|
@ -90,6 +91,7 @@ public:
|
|||
PlaylistSelection playlists;
|
||||
PointSelection points;
|
||||
MarkerSelection markers;
|
||||
TriggerSelection triggers;
|
||||
|
||||
/** only used when this class is used as a cut buffer */
|
||||
MidiNoteSelection midi_notes;
|
||||
|
@ -111,6 +113,7 @@ public:
|
|||
sigc::signal<void> PointsChanged;
|
||||
sigc::signal<void> MarkersChanged;
|
||||
sigc::signal<void> MidiNotesChanged;
|
||||
sigc::signal<void> TriggersChanged;
|
||||
|
||||
void clear ();
|
||||
|
||||
|
@ -126,6 +129,7 @@ public:
|
|||
bool selected (RegionView*) const;
|
||||
bool selected (ArdourMarker*) const;
|
||||
bool selected (ControlPoint*) const;
|
||||
bool selected (TriggerEntry*) const;
|
||||
|
||||
void set (std::list<Selectable*> const &);
|
||||
void add (std::list<Selectable*> const &);
|
||||
|
@ -144,6 +148,7 @@ public:
|
|||
void set (ControlPoint *);
|
||||
void set (ArdourMarker*);
|
||||
void set (const RegionSelection&);
|
||||
void set (TriggerEntry*);
|
||||
|
||||
void toggle (TimeAxisView*);
|
||||
void toggle (const TrackViewList&);
|
||||
|
@ -158,6 +163,7 @@ public:
|
|||
void toggle (ControlPoint *);
|
||||
void toggle (std::vector<ControlPoint*> const &);
|
||||
void toggle (ArdourMarker*);
|
||||
void toggle (TriggerEntry*);
|
||||
|
||||
void add (TimeAxisView*);
|
||||
void add (const TrackViewList&);
|
||||
|
@ -175,6 +181,8 @@ public:
|
|||
void add (const std::list<ArdourMarker*>&);
|
||||
void add (const RegionSelection&);
|
||||
void add (const PointSelection&);
|
||||
void add (TriggerEntry*);
|
||||
|
||||
void remove (TimeAxisView*);
|
||||
void remove (const TrackViewList&);
|
||||
void remove (const MidiNoteSelection&);
|
||||
|
@ -189,6 +197,7 @@ public:
|
|||
void remove (const std::list<Selectable*>&);
|
||||
void remove (ArdourMarker*);
|
||||
void remove (ControlPoint *);
|
||||
void remove (TriggerEntry*);
|
||||
|
||||
void remove_regions (TimeAxisView *);
|
||||
|
||||
|
@ -220,6 +229,9 @@ public:
|
|||
void clear_markers (bool with_signal = true);
|
||||
void clear_midi_notes (bool with_signal = true);
|
||||
|
||||
/* triggers are only mutually exclusive with regions */
|
||||
void clear_triggers ();
|
||||
|
||||
void foreach_region (void (ARDOUR::Region::*method)(void));
|
||||
void foreach_regionview (void (RegionView::*method)(void));
|
||||
void foreach_midi_regionview (void (MidiRegionView::*method)(void));
|
||||
|
|
Loading…
Reference in New Issue
Block a user