Selection of visible note range (full range vs fit contents, selectable from midi...
[ardour.git] / libs / ardour / midi_source.cc
index 1438b1fdbe6ec216715c6a1c68db1e68f376d285..a346bfd4f2b765385888f357a1896f06fbc3ad45 100644 (file)
@@ -42,15 +42,19 @@ using namespace PBD;
 
 sigc::signal<void,MidiSource *> MidiSource::MidiSourceCreated;
 
-MidiSource::MidiSource (string name)
-       : Source (name, DataType::MIDI)
+MidiSource::MidiSource (Session& s, string name)
+       : Source (s, name, DataType::MIDI)
+       , _model(new MidiModel())
+       , _model_loaded (false)
 {
        _read_data_count = 0;
        _write_data_count = 0;
 }
 
-MidiSource::MidiSource (const XMLNode& node) 
-       : Source (node)
+MidiSource::MidiSource (Session& s, const XMLNode& node) 
+       : Source (s, node)
+       , _model(new MidiModel())
+       , _model_loaded (false)
 {
        _read_data_count = 0;
        _write_data_count = 0;
@@ -62,6 +66,7 @@ MidiSource::MidiSource (const XMLNode& node)
 
 MidiSource::~MidiSource ()
 {
+       delete _model;
 }
 
 XMLNode&
@@ -90,15 +95,15 @@ MidiSource::set_state (const XMLNode& node)
        return 0;
 }
 
-jack_nframes_t
-MidiSource::read (MidiRingBuffer& dst, jack_nframes_t start, jack_nframes_t cnt) const
+nframes_t
+MidiSource::read (MidiRingBuffer& dst, nframes_t start, nframes_t cnt, nframes_t stamp_offset) const
 {
        Glib::Mutex::Lock lm (_lock);
-       return read_unlocked (dst, start, cnt);
+       return read_unlocked (dst, start, cnt, stamp_offset);
 }
 
-jack_nframes_t
-MidiSource::write (MidiRingBuffer& dst, jack_nframes_t cnt)
+nframes_t
+MidiSource::write (MidiRingBuffer& dst, nframes_t cnt)
 {
        Glib::Mutex::Lock lm (_lock);
        return write_unlocked (dst, cnt);