diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-03-31 17:28:14 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 11:40:52 -0400 |
commit | a4a87f56e9dc8e2351101439aeea7a87064fa146 (patch) | |
tree | 940715c29eb1fcdd478b1998a9e0caad5032c9df /libs/ardour/ardour/disk_writer.h | |
parent | 94604c6979be790a072c9d76566250a3aadf6e79 (diff) |
mega-commit to save state of first "it compilesand links" state for separated disk i/o changes.
THIS WILL NOT RUN. THIS REQUIRES MANY CHANGES
Diffstat (limited to 'libs/ardour/ardour/disk_writer.h')
-rw-r--r-- | libs/ardour/ardour/disk_writer.h | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/libs/ardour/ardour/disk_writer.h b/libs/ardour/ardour/disk_writer.h index 3eed3c6d99..d0f3672cbd 100644 --- a/libs/ardour/ardour/disk_writer.h +++ b/libs/ardour/ardour/disk_writer.h @@ -24,12 +24,14 @@ #include <vector> #include "ardour/disk_io.h" +#include "ardour/midi_buffer.h" namespace ARDOUR { class AudioFileSource; class SMFSource; +class MidiSource; class LIBARDOUR_API DiskWriter : public DiskIOProcessor { @@ -50,8 +52,6 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor virtual XMLNode& state (bool full); int set_state (const XMLNode&, int version); - virtual int use_new_write_source (uint32_t n=0) = 0; - std::string write_source_name () const { if (_write_source_name.empty()) { return name(); @@ -72,6 +72,8 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor boost::shared_ptr<SMFSource> midi_write_source () { return _midi_write_source; } virtual std::string steal_write_source_name () { return std::string(); } + int use_new_write_source (DataType, uint32_t n = 0); + void reset_write_sources (bool, bool force = false); AlignStyle alignment_style() const { return _alignment_style; } AlignChoice alignment_choice() const { return _alignment_choice; } @@ -87,8 +89,8 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor bool record_enabled() const { return g_atomic_int_get (const_cast<gint*>(&_record_enabled)); } bool record_safe () const { return g_atomic_int_get (const_cast<gint*>(&_record_safe)); } - virtual void set_record_enabled (bool yn) = 0; - virtual void set_record_safe (bool yn) = 0; + virtual void set_record_enabled (bool yn); + virtual void set_record_safe (bool yn); bool destructive() const { return _flags & Destructive; } int set_destructive (bool yn); @@ -109,16 +111,31 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor framecnt_t capture_offset() const { return _capture_offset; } virtual void set_capture_offset (); + int seek (framepos_t frame, bool complete_refill); + static PBD::Signal0<void> Overrun; + void set_note_mode (NoteMode m); + + /** Emitted when some MIDI data has been received for recording. + * Parameter is the source that it is destined for. + * A caller can get a copy of the data with get_gui_feed_buffer () + */ + PBD::Signal1<void, boost::weak_ptr<MidiSource> > DataRecorded; + PBD::Signal0<void> RecordEnableChanged; PBD::Signal0<void> RecordSafeChanged; + void check_record_status (framepos_t transport_frame, bool can_record); + + void transport_looped (framepos_t transport_frame); + void transport_stopped_wallclock (struct tm&, time_t, bool abort); + protected: - virtual int do_flush (RunContext context, bool force = false) = 0; + friend class Track; + int do_flush (RunContext context, bool force = false); void get_input_sources (); - void check_record_status (framepos_t transport_frame, bool can_record); void prepare_record_status (framepos_t /*capture_start_frame*/); void set_align_style_from_io(); void setup_destructive_playlist (); @@ -138,9 +155,6 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor framecnt_t& rec_nframes, framecnt_t& rec_offset ); - static framecnt_t disk_read_chunk_frames; - static framecnt_t disk_write_chunk_frames; - struct CaptureInfo { framepos_t start; framecnt_t frames; @@ -168,7 +182,7 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor std::list<boost::shared_ptr<Source> > _last_capture_sources; std::vector<boost::shared_ptr<AudioFileSource> > capturing_sources; - + static framecnt_t _chunk_frames; NoteMode _note_mode; @@ -176,6 +190,12 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor volatile gint _num_captured_loops; framepos_t _accumulated_capture_offset; + /** 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; + void finish_capture (boost::shared_ptr<ChannelList> c); }; |