summaryrefslogtreecommitdiff
path: root/libs/evoral/src
diff options
context:
space:
mode:
Diffstat (limited to 'libs/evoral/src')
-rw-r--r--libs/evoral/src/ControlSet.cpp6
-rw-r--r--libs/evoral/src/Sequence.cpp26
2 files changed, 32 insertions, 0 deletions
diff --git a/libs/evoral/src/ControlSet.cpp b/libs/evoral/src/ControlSet.cpp
index 29d3b40344..e19acf7689 100644
--- a/libs/evoral/src/ControlSet.cpp
+++ b/libs/evoral/src/ControlSet.cpp
@@ -31,6 +31,12 @@ ControlSet::ControlSet()
{
}
+ControlSet::ControlSet (const ControlSet& other)
+ : noncopyable ()
+{
+ /* derived class must copy controls */
+}
+
void
ControlSet::add_control(boost::shared_ptr<Control> ac)
{
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp
index 93eccb6cce..281aec514b 100644
--- a/libs/evoral/src/Sequence.cpp
+++ b/libs/evoral/src/Sequence.cpp
@@ -398,6 +398,32 @@ Sequence<Time>::Sequence(const TypeMap& type_map)
assert( ! _end_iter._lock);
}
+template<typename Time>
+Sequence<Time>::Sequence(const Sequence<Time>& other)
+ : ControlSet (other)
+ , _edited(false)
+ , _type_map(other._type_map)
+ , _writing(false)
+ , _end_iter(*this, DBL_MAX)
+ , _percussive(other._percussive)
+ , _lowest_note(other._lowest_note)
+ , _highest_note(other._highest_note)
+{
+ for (typename Notes::const_iterator i = other._notes.begin(); i != other._notes.end(); ++i) {
+ boost::shared_ptr<Note<Time> > n (new Note<Time> (**i));
+ _notes.insert (n);
+ }
+
+ for (typename SysExes::const_iterator i = other._sysexes.begin(); i != other._sysexes.end(); ++i) {
+ boost::shared_ptr<Event<Time> > n (new Event<Time> (**i, true));
+ _sysexes.push_back (n);
+ }
+
+ DUMP(format("Sequence copied: %1%\n") % this);
+ assert(_end_iter._is_end);
+ assert(! _end_iter._lock);
+}
+
/** Write the controller event pointed to by \a iter to \a ev.
* The buffer of \a ev will be allocated or resized as necessary.
* The event_type of \a ev should be set to the expected output type.