X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fmidi_diskstream.h;h=1b1fcf54f35dfb1ca111b52a270095d710faa72d;hb=d2c6b00bdd8db1c91d04e27140e8922cf2a55145;hp=aea60dc3bfdb1857045d7fae30ee962e42be6215;hpb=73192bc1a7ea55fa1864dc3826845b15c00dd2ec;p=ardour.git diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h index aea60dc3bf..1b1fcf54f3 100644 --- a/libs/ardour/ardour/midi_diskstream.h +++ b/libs/ardour/ardour/midi_diskstream.h @@ -62,9 +62,12 @@ class MidiDiskstream : public Diskstream float playback_buffer_load() const; float capture_buffer_load() const; - void get_playback(MidiBuffer& dst, framepos_t start, framepos_t end); + void get_playback (MidiBuffer& dst, framecnt_t); + void flush_playback (framepos_t, framepos_t); void set_record_enabled (bool yn); + + void reset_tracker (); boost::shared_ptr midi_playlist () { return boost::dynamic_pointer_cast(_playlist); } @@ -72,11 +75,13 @@ class MidiDiskstream : public Diskstream int use_new_playlist (); int use_copy_playlist (); + bool set_name (std::string const &); + /* stateful */ XMLNode& get_state(void); int set_state(const XMLNode&, int version); - void monitor_input (bool); + void ensure_jack_monitors_input (bool); boost::shared_ptr write_source () { return _write_source; } @@ -100,18 +105,20 @@ class MidiDiskstream : public Diskstream ChannelMode get_channel_mode() { ChannelMode playback_mode = _playback_buf->get_channel_mode(); -#ifndef NDEBUG ChannelMode capture_mode = _capture_buf->get_channel_mode(); +#ifndef NDEBUG assert(playback_mode == capture_mode); #endif return playback_mode; } /** Emitted when some MIDI data has been received for recording. - * First parameter is the data. - * Second parameter is the source that it is destined for. + * Parameter is the source that it is destined for. + * A caller can get a copy of the data with get_gui_feed_buffer () */ - PBD::Signal2, boost::weak_ptr > DataRecorded; + PBD::Signal1 > DataRecorded; + + boost::shared_ptr get_gui_feed_buffer () const; protected: friend class Session; @@ -127,8 +134,7 @@ class MidiDiskstream : public Diskstream void set_block_size (pframes_t); int internal_playback_seek (framecnt_t distance); int can_internal_playback_seek (framecnt_t distance); - int rename_write_sources (); - std::list > steal_write_sources(); + std::list > steal_write_sources(); void reset_write_sources (bool, bool force = false); void non_realtime_input_change (); void non_realtime_locate (framepos_t location); @@ -141,7 +147,7 @@ class MidiDiskstream : public Diskstream protected: friend class MidiTrack; - int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler); + int process (framepos_t transport_frame, pframes_t nframes, framecnt_t &); bool commit (framecnt_t nframes); static framecnt_t midi_readahead; @@ -155,7 +161,7 @@ class MidiDiskstream : public Diskstream int read (framepos_t& start, framecnt_t cnt, bool reversed); - void finish_capture (bool rec_monitors_input); + void finish_capture (); void transport_stopped_wallclock (struct tm&, time_t, bool abort); void transport_looped (framepos_t transport_frame); @@ -172,23 +178,28 @@ class MidiDiskstream : public Diskstream void get_input_sources (); void set_align_style_from_io(); - /* fixed size buffers per instance of ardour for now (non-dynamic) - */ + /* fixed size buffers per instance of ardour for now (non-dynamic) + */ - void adjust_playback_buffering () {} - void adjust_capture_buffering () {} + void adjust_playback_buffering () {} + void adjust_capture_buffering () {} void engage_record_enable (); void disengage_record_enable (); MidiRingBuffer* _playback_buf; MidiRingBuffer* _capture_buf; - MidiPort* _source_port; + boost::weak_ptr _source_port; boost::shared_ptr _write_source; - framepos_t _last_flush_frame; NoteMode _note_mode; volatile gint _frames_written_to_ringbuffer; volatile gint _frames_read_from_ringbuffer; + + /** A buffer that we use to put newly-arrived MIDI data in for + the GUI to read (so that it can update itself). + */ + MidiBuffer _gui_feed_buffer; + mutable Glib::Threads::Mutex _gui_feed_buffer_mutex; }; }; /* namespace ARDOUR */