changes required to operate with the Evoral::Beats ticktime commit
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 13 Sep 2017 22:48:16 +0000 (18:48 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 Sep 2017 15:40:53 +0000 (11:40 -0400)
libs/ardour/ardour/midi_model.h
libs/ardour/ardour/midi_source.h
libs/ardour/midi_source.cc
libs/ardour/session_state.cc

index fb71f69085148607c44ab417223ac0f0d864dcfc..8f8fd5c2cf371e7a85a84df279eaf547147bf1e4 100644 (file)
@@ -265,8 +265,8 @@ public:
 
        bool write_section_to(boost::shared_ptr<MidiSource>     source,
                              const Glib::Threads::Mutex::Lock& source_lock,
-                             Evoral::Beats                     begin = Evoral::MinBeats,
-                             Evoral::Beats                     end   = Evoral::MaxBeats,
+                             Evoral::Beats                     begin = Evoral::Beats(),
+                             Evoral::Beats                     end   = std::numeric_limits<Evoral::Beats>::max(),
                              bool                              offset_events = false);
 
        // MidiModel doesn't use the normal AutomationList serialisation code
index f8f1e429ac633f764cb4cc8cb2f5cda2975e7e0c..f1d9473a13ce4035da0fd4994a89b6b7422ab422 100644 (file)
@@ -62,8 +62,8 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha
         */
        int write_to (const Lock&                   lock,
                      boost::shared_ptr<MidiSource> newsrc,
-                     Evoral::Beats                 begin = Evoral::MinBeats,
-                     Evoral::Beats                 end   = Evoral::MaxBeats);
+                     Evoral::Beats                 begin = Evoral::Beats(),
+                     Evoral::Beats                 end   = std::numeric_limits<Evoral::Beats>::max());
 
        /** Export the midi data in the given time range to another MidiSource
         * \param newsrc MidiSource to which data will be written. Should be a
index ea0bd15b0c3a78caa3b059bff3565dfe79ddfc7d..9af3009a73f6e9b01dc9aec0c1b03244d2988e70 100644 (file)
@@ -408,7 +408,7 @@ MidiSource::write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Ev
        newsrc->copy_automation_state_from (this);
 
        if (_model) {
-               if (begin == Evoral::MinBeats && end == Evoral::MaxBeats) {
+               if (begin == Evoral::Beats() && end == std::numeric_limits<Evoral::Beats>::max()) {
                        _model->write_to (newsrc, newsrc_lock);
                } else {
                        _model->write_section_to (newsrc, newsrc_lock, begin, end);
@@ -422,7 +422,7 @@ MidiSource::write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Ev
 
        /* force a reload of the model if the range is partial */
 
-       if (begin != Evoral::MinBeats || end != Evoral::MaxBeats) {
+       if (begin != Evoral::Beats() || end != std::numeric_limits<Evoral::Beats>::max()) {
                newsrc->load_model (newsrc_lock, true);
        } else {
                newsrc->set_model (newsrc_lock, _model);
index 28a0725da845815f2a58ab1d620e9df630ca40b2..bc9104958904ee647304e4db06ade2282e9c413d 100644 (file)
@@ -1254,7 +1254,7 @@ Session::state (bool full_state, snapshot_t snapshot_type)
                                        if (!ms->model()) {
                                                ms->load_model (lm);
                                        }
-                                       if (ms->write_to (lm, newsrc, Evoral::MinBeats, Evoral::MaxBeats)) {
+                                       if (ms->write_to (lm, newsrc, Evoral::Beats(), std::numeric_limits<Evoral::Beats>::max())) {
                                                error << string_compose (_("Session-Save: Failed to copy MIDI Source '%1' for snapshot"), ancestor_name) << endmsg;
                                        } else {
                                                if (snapshot_type == SnapshotKeep) {