X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fdisk_reader.h;h=47139efd5b69d696c5bcff5243500d1bf6649566;hb=e4d3ebfb666e2c4e9cf134d8f3ed42152da343bf;hp=04e4ccb3a149006aff4220fa6de0cf2c8b77ed58;hpb=93d11d155c32af9eb397ccb30823f45e58958491;p=ardour.git diff --git a/libs/ardour/ardour/disk_reader.h b/libs/ardour/ardour/disk_reader.h index 04e4ccb3a1..47139efd5b 100644 --- a/libs/ardour/ardour/disk_reader.h +++ b/libs/ardour/ardour/disk_reader.h @@ -35,7 +35,7 @@ template class MidiRingBuffer; class LIBARDOUR_API DiskReader : public DiskIOProcessor { - public: +public: DiskReader (Session&, std::string const & name, DiskIOProcessor::Flag f = DiskIOProcessor::Flag (0)); ~DiskReader (); @@ -52,7 +52,6 @@ class LIBARDOUR_API DiskReader : public DiskIOProcessor int overwrite_existing_buffers (); void set_pending_overwrite (bool yn); - virtual XMLNode& state (bool full); int set_state (const XMLNode&, int version); PBD::Signal0 AlignmentStyleChanged; @@ -94,23 +93,39 @@ class LIBARDOUR_API DiskReader : public DiskIOProcessor void playlist_modified (); void reset_tracker (); + bool declick_in_progress () const { + return _declick_gain != 0; // declick-out + } + static void set_midi_readahead_samples (samplecnt_t samples_ahead) { midi_readahead = samples_ahead; } static void set_no_disk_output (bool yn); static bool no_disk_output() { return _no_disk_output; } - protected: +protected: friend class Track; friend class MidiTrack; + struct ReaderChannelInfo : public DiskIOProcessor::ChannelInfo { + ReaderChannelInfo (samplecnt_t buffer_size) + : DiskIOProcessor::ChannelInfo (buffer_size) + { + resize (buffer_size); + } + void resize (samplecnt_t); + }; + + XMLNode& state (); + void resolve_tracker (Evoral::EventSink& buffer, samplepos_t time); - boost::shared_ptr get_gui_feed_buffer () const; void playlist_changed (const PBD::PropertyChange&); int use_playlist (DataType, boost::shared_ptr); void playlist_ranges_moved (std::list< Evoral::RangeMove > const &, bool); - private: + int add_channel_to (boost::shared_ptr, uint32_t how_many); + +private: /** The number of samples by which this diskstream's output should be delayed with respect to the transport sample. This is used for latency compensation. */ @@ -121,20 +136,14 @@ class LIBARDOUR_API DiskReader : public DiskIOProcessor IOChange input_change_pending; samplepos_t file_sample[DataType::num_types]; + gain_t _declick_gain; + int _do_refill_with_alloc (bool partial_fill); static samplecnt_t _chunk_samples; static samplecnt_t midi_readahead; static bool _no_disk_output; - /* The MIDI stuff */ - - /** 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; - int audio_read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer, samplepos_t& start, samplecnt_t cnt, int channel, bool reversed);