track templates, backported from 2.X
[ardour.git] / libs / ardour / ardour / midi_port.h
index 48ebf31eef0fa2983c51c2bc1f3be670584f13c3..f27789da5f7e14dfbbea57e899bed1545f30757c 100644 (file)
 #ifndef __ardour_midi_port_h__
 #define __ardour_midi_port_h__
 
-#include <sigc++/signal.h>
-#include <pbd/failed_constructor.h>
-#include <ardour/ardour.h>
-#include <ardour/port.h>
-#include <ardour/midi_buffer.h>
+#include "ardour/port.h"
+#include "ardour/midi_buffer.h"
 
 namespace ARDOUR {
 
 class MidiEngine;
 
-class MidiPort : public virtual Port {
+class MidiPort : public Port {
    public:
-       virtual ~MidiPort();
-       
-       DataType type() const { return DataType::MIDI; }
+       ~MidiPort();
 
-       Buffer& get_buffer() {
-               return _buffer;
+       DataType type () const {
+               return DataType::MIDI;
        }
 
-       MidiBuffer& get_midi_buffer() {
-               return _buffer;
+       void cycle_start (nframes_t nframes, nframes_t offset);
+       void cycle_end (nframes_t nframes, nframes_t offset);
+       void flush_buffers (nframes_t nframes, nframes_t offset);
+
+       Buffer& get_buffer (nframes_t nframes, nframes_t offset) {
+               return get_midi_buffer (nframes, offset);
        }
        
-       size_t capacity() { return _buffer.capacity(); }
-       size_t size()     { return _buffer.size(); }
+       MidiBuffer& get_midi_buffer (nframes_t nframes, nframes_t offset);
 
   protected:
        friend class AudioEngine;
 
-       MidiPort (nframes_t bufsize);
-       
-       /* engine isn't supposed to access below here */
+       MidiPort (const std::string& name, Flags);
+  
+  private:
 
-       MidiBuffer     _buffer;
+       MidiBuffer* _buffer;
+       bool _has_been_mixed_down;
 };
  
 } // namespace ARDOUR