Move all beats <-> frames time conversion into a single object that can be passed...
[ardour.git] / libs / ardour / ardour / midi_model.h
index a1a0da7296b685e184edd827a1475d72e7f00fdb..16d972c3ccc6ef44101e220f9d8a0f0e4ea019e3 100644 (file)
@@ -30,7 +30,7 @@
 #include <ardour/types.h>
 #include <ardour/midi_buffer.h>
 #include <ardour/midi_ring_buffer.h>
-#include <ardour/automatable.h>
+#include <ardour/automatable_sequence.h>
 #include <ardour/types.h>
 #include <evoral/Note.hpp>
 #include <evoral/Sequence.hpp>
@@ -47,8 +47,10 @@ class MidiSource;
  * Because of this MIDI controllers and automatable controllers/widgets/etc
  * are easily interchangeable.
  */
-class MidiModel : public AutomatableSequence {
+class MidiModel : public AutomatableSequence<double> {
 public:
+       typedef double TimeType;
+
        MidiModel(MidiSource* s, size_t size=0);
        
        NoteMode note_mode() const { return (percussive() ? Percussive : Sustained); }
@@ -71,17 +73,17 @@ public:
                int set_state (const XMLNode&);
                XMLNode& get_state ();
 
-               void add(const boost::shared_ptr<Evoral::Note> note);
-               void remove(const boost::shared_ptr<Evoral::Note> note);
+               void add(const boost::shared_ptr< Evoral::Note<TimeType> > note);
+               void remove(const boost::shared_ptr< Evoral::Note<TimeType> > note);
 
        private:
-               XMLNode &marshal_note(const boost::shared_ptr<Evoral::Note> note);
-               boost::shared_ptr<Evoral::Note> unmarshal_note(XMLNode *xml_note);
+               XMLNode &marshal_note(const boost::shared_ptr< Evoral::Note<TimeType> > note);
+               boost::shared_ptr< Evoral::Note<TimeType> > unmarshal_note(XMLNode *xml_note);
                
                boost::shared_ptr<MidiModel> _model;
                const std::string            _name;
                
-               typedef std::list< boost::shared_ptr<Evoral::Note> > NoteList;
+               typedef std::list< boost::shared_ptr< Evoral::Note<TimeType> > > NoteList;
                
                NoteList _added_notes;
                NoteList _removed_notes;