Remove unused (and timestamp type nasty) last_event_time() from SMF.
[ardour.git] / libs / ardour / smf_source.cc
index ea558ea281416217336f1c3bef63545675032735..64bd6874189aace0353fecce440afade69f44cf9 100644 (file)
@@ -58,6 +58,7 @@ SMFSource::SMFSource (Session& s, std::string path, Flag flags)
        , Evoral::SMF<double> ()
        , _flags (Flag(flags | Writable)) // FIXME: this needs to be writable for now
        , _allow_remove_if_empty(true)
+       , _last_ev_time(0)
 {
        /* constructor used for new internal-to-session files. file cannot exist */
 
@@ -65,7 +66,7 @@ SMFSource::SMFSource (Session& s, std::string path, Flag flags)
                throw failed_constructor ();
        }
        
-       if (open(path)) {
+       if (create(path)) {
                throw failed_constructor ();
        }
 
@@ -76,6 +77,7 @@ SMFSource::SMFSource (Session& s, const XMLNode& node)
        : MidiSource (s, node)
        , _flags (Flag (Writable|CanRename))
        , _allow_remove_if_empty(true)
+       , _last_ev_time(0)
 {
        /* constructor used for existing internal-to-session files. file must exist */
 
@@ -248,7 +250,7 @@ SMFSource::write_unlocked (MidiRingBuffer<double>& src, nframes_t cnt)
        }
 
        if (_model) {
-               make_sure_controls_have_the_right_interpolation();
+               set_default_controls_interpolation();
        }
 
        Evoral::SMF<double>::flush();
@@ -302,6 +304,7 @@ SMFSource::append_event_unlocked(EventTimeUnit unit, const Evoral::Event<double>
        }
 
        Evoral::SMF<double>::append_event_delta(delta_time, ev);
+       _last_ev_time = ev.time();
 
        _write_data_count += ev.size();
 }
@@ -357,6 +360,7 @@ SMFSource::mark_streaming_midi_write_started (NoteMode mode, nframes_t start_fra
 {
        MidiSource::mark_streaming_midi_write_started (mode, start_frame);
        Evoral::SMF<double>::begin_write ();
+       _last_ev_time = 0;
 }
 
 void
@@ -669,7 +673,7 @@ SMFSource::load_model(bool lock, bool force_reload)
                }
        }
 
-       make_sure_controls_have_the_right_interpolation();
+       set_default_controls_interpolation();
        
        _model->end_write(false);
        _model->set_edited(false);
@@ -680,7 +684,7 @@ SMFSource::load_model(bool lock, bool force_reload)
 #define LINEAR_INTERPOLATION_MODE_WORKS_PROPERLY 0
 
 void
-SMFSource::make_sure_controls_have_the_right_interpolation()
+SMFSource::set_default_controls_interpolation()
 {
        // set interpolation style to defaults, can be changed by the GUI later
        Evoral::ControlSet::Controls controls = _model->controls();