summaryrefslogtreecommitdiff
path: root/gtk2_ardour/selection.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-19 00:47:49 +0000
committerDavid Robillard <d@drobilla.net>2008-09-19 00:47:49 +0000
commitd357eca668044badcb4bab318e2e74cfffa9a0b0 (patch)
treeeab9bf33b194f9e37c20f84375e5caa748ee994a /gtk2_ardour/selection.cc
parent3d976c5b727e4d55ce439b1d7c055a814477fa1a (diff)
Factor out sequencing related things into an independant new library: "evoral".
Anything related to the storage of events/values over a range of time lives in evoral. This includes MidiModel (Evoral::Sequence) and automation data (AutomationList (Evoral::ControlList), Automatable (Evoral::ControlSet), etc). libs/evoral synced with http://svn.drobilla.net/lad/trunk/evoral r1511. git-svn-id: svn://localhost/ardour2/branches/3.0@3754 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r--gtk2_ardour/selection.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc
index 910cebc7fe..2f9601fcec 100644
--- a/gtk2_ardour/selection.cc
+++ b/gtk2_ardour/selection.cc
@@ -389,10 +389,17 @@ Selection::replace (uint32_t sid, nframes_t start, nframes_t end)
}
void
-Selection::add (AutomationList* ac)
+Selection::add (boost::shared_ptr<Evoral::ControlList> cl)
{
- if (find (lines.begin(), lines.end(), ac) == lines.end()) {
- lines.push_back (ac);
+ boost::shared_ptr<ARDOUR::AutomationList> al
+ = boost::dynamic_pointer_cast<ARDOUR::AutomationList>(cl);
+ if (!al) {
+ warning << "Programming error: Selected list is not an ARDOUR::AutomationList" << endmsg;
+ return;
+ return;
+ }
+ if (find (lines.begin(), lines.end(), al) == lines.end()) {
+ lines.push_back (al);
LinesChanged();
}
}
@@ -493,9 +500,9 @@ Selection::remove (nframes_t start, nframes_t end)
}
void
-Selection::remove (AutomationList *ac)
+Selection::remove (boost::shared_ptr<ARDOUR::AutomationList> ac)
{
- list<AutomationList*>::iterator i;
+ AutomationSelection::iterator i;
if ((i = find (lines.begin(), lines.end(), ac)) != lines.end()) {
lines.erase (i);
LinesChanged();
@@ -595,7 +602,7 @@ Selection::set (TimeAxisView* track, nframes_t start, nframes_t end)
}
void
-Selection::set (AutomationList *ac)
+Selection::set (boost::shared_ptr<Evoral::ControlList> ac)
{
lines.clear();
add (ac);