From 2fa6caad95d81f058326d931532f687a157361be Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 16 Nov 2014 17:04:27 -0500 Subject: Support cut/copy/paste of several regions and lines at once. The idea here is to do the reasonable thing, and copy objects of some type (e.g. MIDI region, gain line) to tracks with a matching type. The user can override this with a track selection, which will be used straight-up. Lost: ability to copy/paste lines across types, e.g. gain to pan. This is often questionable, but sometimes useful, so we will need to implement some sort of "greedy mode" to make it possible. Implementation simple, but not sure what to do. Perhaps this should only be possible if one automation track is explicitly (i.e. via track selection) involved, and the types are at least compatible-ish? --- gtk2_ardour/automation_selection.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'gtk2_ardour/automation_selection.h') diff --git a/gtk2_ardour/automation_selection.h b/gtk2_ardour/automation_selection.h index 6f30c588e2..204f4f19be 100644 --- a/gtk2_ardour/automation_selection.h +++ b/gtk2_ardour/automation_selection.h @@ -22,10 +22,23 @@ #include -namespace ARDOUR { - class AutomationList; -} - -class AutomationSelection : public std::list > {}; +#include "ardour/automation_list.h" +#include "evoral/Parameter.hpp" + +class AutomationSelection : public std::list > { +public: + const_iterator + get_nth(const Evoral::Parameter& param, size_t nth) const { + size_t count = 0; + for (const_iterator l = begin(); l != end(); ++l) { + if ((*l)->parameter() == param) { + if (count++ == nth) { + return l; + } + } + } + return end(); + } +}; #endif /* __ardour_gtk_automation_selection_h__ */ -- cgit v1.2.3