fix up marshall/unmarshall of note data for MidiModel::DiffCommand
[ardour.git] / libs / ardour / midi_diskstream.cc
index aa6d77b00070d9333c4b3850db6a8495b9899f9a..9c8c9e8620101683593ec0583b14fc899c7a46be 100644 (file)
@@ -314,7 +314,7 @@ MidiDiskstream::set_note_mode (NoteMode m)
 }
 
 void
-MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t nframes, bool can_record)
+MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nframes*/, bool can_record)
 {
        // FIXME: waaay too much code to duplicate (AudioDiskstream)
        
@@ -949,8 +949,8 @@ MidiDiskstream::read (nframes_t& start, nframes_t dur, bool reversed)
                                // Synthesize LoopEvent here, because the next events
                                // written will have non-monotonic timestamps.
                                _playback_buf->write(loop_end - 1, LoopEventType, 0, 0);
-                               //cout << "Pushing LoopEvent ts=" << loop_end-1 
-                               //     << " start+this_read " << start+this_read << endl;
+                               cout << "Pushing LoopEvent ts=" << loop_end-1 
+                                    << " start+this_read " << start+this_read << endl;
 
                                start = loop_start;
                        } else {
@@ -1029,7 +1029,7 @@ MidiDiskstream::do_refill ()
  * written at all unless @a force_flush is true.
  */
 int
-MidiDiskstream::do_flush (RunContext context, bool force_flush)
+MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
 {
        uint32_t to_write;
        int32_t ret = 0;
@@ -1084,7 +1084,7 @@ out:
 }
 
 void
-MidiDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_capture)
+MidiDiskstream::transport_stopped (struct tm& /*when*/, time_t /*twhen*/, bool abort_capture)
 {
        uint32_t buffer_position;
        bool more_work = true;
@@ -1257,7 +1257,7 @@ MidiDiskstream::transport_looped (nframes_t transport_frame)
 }
 
 void
-MidiDiskstream::finish_capture (bool rec_monitors_input)
+MidiDiskstream::finish_capture (bool /*rec_monitors_input*/)
 {
        was_recording = false;
        
@@ -1547,7 +1547,7 @@ MidiDiskstream::use_new_write_source (uint32_t n)
 }
 
 void
-MidiDiskstream::reset_write_sources (bool mark_write_complete, bool force)
+MidiDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
 {
        if (!recordable()) {
                return;
@@ -1575,7 +1575,7 @@ MidiDiskstream::rename_write_sources ()
 }
 
 void
-MidiDiskstream::set_block_size (nframes_t nframes)
+MidiDiskstream::set_block_size (nframes_t /*nframes*/)
 {
 }
 
@@ -1629,7 +1629,7 @@ MidiDiskstream::capture_buffer_load () const
 }
 
 int
-MidiDiskstream::use_pending_capture_data (XMLNode& node)
+MidiDiskstream::use_pending_capture_data (XMLNode& /*node*/)
 {
        return 0;
 }
@@ -1648,27 +1648,18 @@ MidiDiskstream::get_playback (MidiBuffer& dst, nframes_t start, nframes_t end)
                return;
        }
 
-       // Check only events added this offset cycle
-       MidiBuffer::iterator this_cycle_start = dst.end();
-       
        // Translates stamps to be relative to start
-       #if 1
-               _playback_buf->read(dst, start, end);
-       #else   
-               const size_t events_read = _playback_buf->read(dst, start, end);
-               cout << "MDS events read = " << events_read
-               << " start = " << start << " end = " << end
-               << " readspace " << _playback_buf->read_space()
-               << " writespace " << _playback_buf->write_space() << endl;
-       #endif
+
+       _playback_buf->read(dst, start, end);
+#if 0
+       const size_t events_read = _playback_buf->read(dst, start, end);
+       cout << _name << ": MDS events read = " << events_read
+            << " start = " << start << " end = " << end
+            << " readspace " << _playback_buf->read_space()
+            << " writespace " << _playback_buf->write_space() << endl;
+#endif
        
        gint32 frames_read = end - start;
        g_atomic_int_add(&_frames_read_from_ringbuffer, frames_read);
-       
-       // Feed the data through the MidiStateTracker
-       // If it detects a LoopEvent it will add necessary note offs
-       if (_midi_state_tracker.track(this_cycle_start, dst.end())) {
-               _midi_state_tracker.resolve_notes(dst, end-start - 1);
-       }
 }