Add IdentityConverter for when no conversion is actually needed.
git-svn-id: svn://localhost/ardour2/branches/3.0@4595
d708f5d6-7413-0410-9779-
e7cbd77b26cf
virtual A from(B b) const = 0;
};
+
+/** A stub TimeConverter that simple statically casts between types. */
+template<typename A, typename B>
+class IdentityConverter : public TimeConverter<A,B> {
+ B to(A a) const { return static_cast<B>(a); }
+ A from(B b) const { return static_cast<A>(b); }
+};
+
+
} // namespace Evoral
#endif // EVORAL_TIME_CONVERTER_HPP
if (!_event || _event->size() == 0) {
DUMP(format("Starting at end @ %1%\n") % t);
- _is_end = true;
_type = NIL;
- if (_locked) {
- _seq->read_unlock();
- _locked = false;
- }
+ _is_end = true;
+ _locked = false;
+ _seq->read_unlock();
} else {
DUMP(format("New iterator = %1% : %2% @ %3%\n")
% (int)_event->event_type()
if (other._locked) {
other._seq->read_lock();
}
+ } else if (!_locked && other._locked) {
+ _seq->read_lock();
}
_seq = other._seq;
if (!midi_event_is_valid(ev.buffer(), ev.size())) {
cerr << "WARNING: Sequence ignoring illegal MIDI event" << endl;
+ write_unlock();
return;
}