Make MidiModel::write_section_to() more type-independant
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Tue, 19 Jul 2016 16:30:36 +0000 (18:30 +0200)
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Wed, 20 Jul 2016 00:01:40 +0000 (02:01 +0200)
Replace hard-coded Evoral::Beats by TimeType which is currently the same
thing but might change in the future.

libs/ardour/midi_model.cc

index 7f2b7fb863f31a6b55aa2f02f314b4667dd8d358..17b5b8a1cb8f6d9f79e9956ceeaa13dbebd14d83 100644 (file)
@@ -1482,8 +1482,8 @@ MidiModel::sync_to_source (const Glib::Threads::Mutex::Lock& source_lock)
 bool
 MidiModel::write_section_to (boost::shared_ptr<MidiSource>     source,
                              const Glib::Threads::Mutex::Lock& source_lock,
-                             Evoral::Beats                     begin_time,
-                             Evoral::Beats                     end_time)
+                             TimeType                          begin_time,
+                             TimeType                          end_time)
 {
        ReadLock lock(read_lock());
        MidiStateTracker mst;
@@ -1495,12 +1495,12 @@ MidiModel::write_section_to (boost::shared_ptr<MidiSource>     source,
        source->mark_streaming_midi_write_started (source_lock, note_mode());
 
        for (Evoral::Sequence<TimeType>::const_iterator i = begin(TimeType(), true); i != end(); ++i) {
-               const Evoral::Event<Evoral::Beats>& ev (*i);
+               const Evoral::Event<TimeType>& ev (*i);
 
                if (ev.time() >= begin_time && ev.time() < end_time) {
 
-                       const Evoral::MIDIEvent<Evoral::Beats>* mev =
-                               static_cast<const Evoral::MIDIEvent<Evoral::Beats>* > (&ev);
+                       const Evoral::MIDIEvent<TimeType>* mev =
+                               static_cast<const Evoral::MIDIEvent<TimeType>* > (&ev);
 
                        if (!mev) {
                                continue;