Add headless-chicken session utility.
[ardour.git] / libs / ardour / ardour / midi_region.h
index 48706ee7d9b4634480af5d3877f085a3b753b3c9..0690306be4db3d24ca591aa6c3df220d4aeadff9 100644 (file)
@@ -24,6 +24,7 @@
 #include <vector>
 
 #include "evoral/Beats.hpp"
+#include "evoral/Range.hpp"
 
 #include "ardour/ardour.h"
 #include "ardour/region.h"
@@ -34,8 +35,6 @@ namespace ARDOUR {
        namespace Properties {
                LIBARDOUR_API extern PBD::PropertyDescriptor<Evoral::Beats> start_beats;
                LIBARDOUR_API extern PBD::PropertyDescriptor<Evoral::Beats> length_beats;
-               LIBARDOUR_API extern PBD::PropertyDescriptor<double> start_pulse;
-               LIBARDOUR_API extern PBD::PropertyDescriptor<double> length_pulse;
        }
 }
 
@@ -77,6 +76,7 @@ class LIBARDOUR_API MidiRegion : public Region
        framecnt_t read_at (Evoral::EventSink<framepos_t>& dst,
                            framepos_t position,
                            framecnt_t dur,
+                           Evoral::Range<framepos_t>* loop_range,
                            uint32_t  chan_n = 0,
                            NoteMode  mode = Sustained,
                            MidiStateTracker* tracker = 0,
@@ -85,6 +85,7 @@ class LIBARDOUR_API MidiRegion : public Region
        framecnt_t master_read_at (MidiRingBuffer<framepos_t>& dst,
                                   framepos_t position,
                                   framecnt_t dur,
+                                  Evoral::Range<framepos_t>* loop_range,
                                   uint32_t  chan_n = 0,
                                   NoteMode  mode = Sustained) const;
 
@@ -106,9 +107,12 @@ class LIBARDOUR_API MidiRegion : public Region
 
        void fix_negative_start ();
        Evoral::Beats start_beats () {return _start_beats.val(); }
+       void set_start_beats (const Evoral::Beats start_beats) {_start_beats = start_beats; }
        Evoral::Beats length_beats () {return _length_beats.val(); }
-       double start_pulse () const {return _start_pulse; }
-       double length_pulse () const {return _length_pulse; }
+       void set_length_beats (const Evoral::Beats length_beats) {_length_beats = length_beats; }
+
+       void clobber_sources (boost::shared_ptr<MidiSource> source);
+
   protected:
 
        virtual bool can_trim_start_before_source_start () const {
@@ -119,8 +123,6 @@ class LIBARDOUR_API MidiRegion : public Region
        friend class RegionFactory;
        PBD::Property<Evoral::Beats> _start_beats;
        PBD::Property<Evoral::Beats> _length_beats;
-       PBD::Property<double> _start_pulse;
-       PBD::Property<double> _length_pulse;
 
        MidiRegion (const SourceList&);
        MidiRegion (boost::shared_ptr<const MidiRegion>);
@@ -129,6 +131,7 @@ class LIBARDOUR_API MidiRegion : public Region
        framecnt_t _read_at (const SourceList&, Evoral::EventSink<framepos_t>& dst,
                             framepos_t position,
                             framecnt_t dur,
+                            Evoral::Range<framepos_t>* loop_range,
                             uint32_t chan_n = 0,
                             NoteMode mode = Sustained,
                             MidiStateTracker* tracker = 0,