- void write_chunk_header(char id[4], uint32_t length);
- void write_chunk(char id[4], uint32_t length, void* data);
- size_t write_var_len(uint32_t val);
- uint32_t read_var_len() const;
- int read_event(MidiEvent& ev) const;
-
- uint16_t _channel;
- string _path;
- Flag _flags;
- string _take_id;
- bool _allow_remove_if_empty;
- uint64_t _timeline_position;
- FILE* _fd;
- nframes_t _last_ev_time; // last frame time written, relative to source start
- uint32_t _track_size;
- uint32_t _header_size; // size of SMF header, including MTrk chunk header
-
- static string _search_path;
+ private:
+ int open_for_write ();
+
+ framecnt_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
+ framepos_t position,
+ framepos_t start,
+ framecnt_t cnt,
+ MidiStateTracker* tracker) const;
+
+ framecnt_t write_unlocked (MidiRingBuffer<framepos_t>& src,
+ framepos_t position,
+ framecnt_t cnt);
+
+ double _last_ev_time_beats;
+ framepos_t _last_ev_time_frames;
+ /** end time (start + duration) of last call to read_unlocked */
+ mutable framepos_t _smf_last_read_end;
+ /** time (in SMF ticks, 1 tick per _ppqn) of the last event read by read_unlocked */
+ mutable framepos_t _smf_last_read_time;