diff --git a/libs/ardour/ardour/audio_playlist_source.h b/libs/ardour/ardour/audio_playlist_source.h index e2eeb78a8d..7be61a30dc 100644 --- a/libs/ardour/ardour/audio_playlist_source.h +++ b/libs/ardour/ardour/audio_playlist_source.h @@ -40,7 +40,7 @@ public: bool clamped_at_unity () const { return false; } samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const; - samplecnt_t write_unlocked (Sample *src, samplecnt_t cnt); + samplecnt_t write_unlocked (Sample const * src, samplecnt_t cnt); float sample_rate () const; int setup_peakfile (); diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h index 96f4938e3f..6a6b36db47 100644 --- a/libs/ardour/ardour/audiosource.h +++ b/libs/ardour/ardour/audiosource.h @@ -55,7 +55,7 @@ class LIBARDOUR_API AudioSource : virtual public Source, public ARDOUR::AudioRea virtual samplecnt_t available_peaks (double zoom) const; virtual samplecnt_t read (Sample *dst, samplepos_t start, samplecnt_t cnt, int channel=0) const; - virtual samplecnt_t write (Sample *src, samplecnt_t cnt); + virtual samplecnt_t write (Sample const * src, samplecnt_t cnt); virtual float sample_rate () const = 0; @@ -117,21 +117,21 @@ class LIBARDOUR_API AudioSource : virtual public Source, public ARDOUR::AudioRea int initialize_peakfile (const std::string& path, const bool in_session = false); int build_peaks_from_scratch (); - int compute_and_write_peaks (Sample* buf, samplecnt_t first_sample, samplecnt_t cnt, + int compute_and_write_peaks (Sample const * buf, samplecnt_t first_sample, samplecnt_t cnt, bool force, bool intermediate_peaks_ready_signal); void truncate_peakfile(); mutable off_t _peak_byte_max; // modified in compute_and_write_peak() virtual samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const = 0; - virtual samplecnt_t write_unlocked (Sample *dst, samplecnt_t cnt) = 0; + virtual samplecnt_t write_unlocked (Sample const * dst, samplecnt_t cnt) = 0; virtual std::string construct_peak_filepath (const std::string& audio_path, const bool in_session = false, const bool old_peak_name = false) const = 0; virtual int read_peaks_with_fpp (PeakData *peaks, samplecnt_t npeaks, samplepos_t start, samplecnt_t cnt, double samples_per_visual_peak, samplecnt_t fpp) const; - int compute_and_write_peaks (Sample* buf, samplecnt_t first_sample, samplecnt_t cnt, + int compute_and_write_peaks (Sample const * buf, samplecnt_t first_sample, samplecnt_t cnt, bool force, bool intermediate_peaks_ready_signal, samplecnt_t samples_per_peak); diff --git a/libs/ardour/ardour/coreaudiosource.h b/libs/ardour/ardour/coreaudiosource.h index 2cc0dead0e..26130fd89a 100644 --- a/libs/ardour/ardour/coreaudiosource.h +++ b/libs/ardour/ardour/coreaudiosource.h @@ -55,7 +55,7 @@ class LIBARDOUR_API CoreAudioSource : public AudioFileSource { protected: void close (); samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const; - samplecnt_t write_unlocked (Sample *, samplecnt_t) { return 0; } + samplecnt_t write_unlocked (Sample const * src, samplecnt_t) { return 0; } private: #ifdef COREAUDIO105 diff --git a/libs/ardour/ardour/ffmpegfilesource.h b/libs/ardour/ardour/ffmpegfilesource.h index 6ff891fc69..e4a90273f6 100644 --- a/libs/ardour/ardour/ffmpegfilesource.h +++ b/libs/ardour/ardour/ffmpegfilesource.h @@ -49,7 +49,7 @@ protected: void close (); /* AudioSource API */ samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const; - samplecnt_t write_unlocked (Sample *, samplecnt_t) { return 0; } + samplecnt_t write_unlocked (Sample const *, samplecnt_t) { return 0; } private: mutable FFMPEGFileImportableSource _ffmpeg; diff --git a/libs/ardour/ardour/mp3filesource.h b/libs/ardour/ardour/mp3filesource.h index b423562cf7..3c829d5f5a 100644 --- a/libs/ardour/ardour/mp3filesource.h +++ b/libs/ardour/ardour/mp3filesource.h @@ -47,7 +47,7 @@ protected: void close (); /* AudioSource API */ samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const; - samplecnt_t write_unlocked (Sample *, samplecnt_t) { return 0; } + samplecnt_t write_unlocked (Sample const *, samplecnt_t) { return 0; } private: mutable Mp3FileImportableSource _mp3; diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h index 369fec496f..2bcbe68eca 100644 --- a/libs/ardour/ardour/silentfilesource.h +++ b/libs/ardour/ardour/silentfilesource.h @@ -58,7 +58,7 @@ protected: return cnt; } - samplecnt_t write_unlocked (Sample */*dst*/, samplecnt_t /*cnt*/) { return 0; } + samplecnt_t write_unlocked (Sample const * /*src*/, samplecnt_t /*cnt*/) { return 0; } void set_header_natural_position () {} diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index 33d372d4f9..77a0e5503b 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -83,8 +83,8 @@ class LIBARDOUR_API SndFileSource : public AudioFileSource { void set_header_natural_position (); samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const; - samplecnt_t write_unlocked (Sample *dst, samplecnt_t cnt); - samplecnt_t write_float (Sample* data, samplepos_t pos, samplecnt_t cnt); + samplecnt_t write_unlocked (Sample const * dst, samplecnt_t cnt); + samplecnt_t write_float (Sample const * data, samplepos_t pos, samplecnt_t cnt); private: SNDFILE* _sndfile; @@ -97,7 +97,7 @@ class LIBARDOUR_API SndFileSource : public AudioFileSource { void file_closed (); void set_natural_position (timepos_t const &); - samplecnt_t nondestructive_write_unlocked (Sample *dst, samplecnt_t cnt); + samplecnt_t nondestructive_write_unlocked (Sample const *src, samplecnt_t cnt); PBD::ScopedConnection header_position_connection; }; diff --git a/libs/ardour/ardour/srcfilesource.h b/libs/ardour/ardour/srcfilesource.h index f027f4b327..a5629ba031 100644 --- a/libs/ardour/ardour/srcfilesource.h +++ b/libs/ardour/ardour/srcfilesource.h @@ -51,7 +51,7 @@ public: protected: void close (); samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const; - samplecnt_t write_unlocked (Sample */*dst*/, samplecnt_t /*cnt*/) { return 0; } + samplecnt_t write_unlocked (Sample const */*src*/, samplecnt_t /*cnt*/) { return 0; } int read_peaks_with_fpp (PeakData *peaks, samplecnt_t npeaks, samplepos_t /*start*/, samplecnt_t /*cnt*/, double /*samples_per_unit*/, samplecnt_t /*fpp*/) const { diff --git a/libs/ardour/audio_playlist_source.cc b/libs/ardour/audio_playlist_source.cc index 08676a4cf9..e832dd2db3 100644 --- a/libs/ardour/audio_playlist_source.cc +++ b/libs/ardour/audio_playlist_source.cc @@ -151,7 +151,7 @@ AudioPlaylistSource::read_unlocked (Sample* dst, samplepos_t start, samplecnt_t } samplecnt_t -AudioPlaylistSource::write_unlocked (Sample *, samplecnt_t) +AudioPlaylistSource::write_unlocked (Sample const *, samplecnt_t) { fatal << string_compose (_("programming error: %1"), "AudioPlaylistSource::write() called - should be impossible") << endmsg; abort(); /*NOTREACHED*/ diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index 20f9eeaabf..e65b2eecac 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -327,12 +327,12 @@ AudioSource::read (Sample *dst, samplepos_t start, samplecnt_t cnt, int /*channe } samplecnt_t -AudioSource::write (Sample *dst, samplecnt_t cnt) +AudioSource::write (Sample const * src, samplecnt_t cnt) { WriterLock lm (_lock); /* any write makes the file not removable */ _flags = Flag (_flags & ~Removable); - return write_unlocked (dst, cnt); + return write_unlocked (src, cnt); } int @@ -918,14 +918,14 @@ AudioSource::done_with_peakfile_writes (bool done) * process. _lock MUST be held by caller. */ int -AudioSource::compute_and_write_peaks (Sample* buf, samplecnt_t first_sample, samplecnt_t cnt, +AudioSource::compute_and_write_peaks (Sample const * buf, samplecnt_t first_sample, samplecnt_t cnt, bool force, bool intermediate_peaks_ready) { return compute_and_write_peaks (buf, first_sample, cnt, force, intermediate_peaks_ready, _FPP); } int -AudioSource::compute_and_write_peaks (Sample* buf, samplecnt_t first_sample, samplecnt_t cnt, +AudioSource::compute_and_write_peaks (Sample const * buf, samplecnt_t first_sample, samplecnt_t cnt, bool force, bool intermediate_peaks_ready, samplecnt_t fpp) { samplecnt_t to_do; diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index f462b141a2..42dba9d36e 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -599,7 +599,7 @@ SndFileSource::read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) c } samplecnt_t -SndFileSource::write_unlocked (Sample *data, samplecnt_t cnt) +SndFileSource::write_unlocked (Sample const * data, samplecnt_t cnt) { if (open()) { return 0; // failure @@ -609,7 +609,7 @@ SndFileSource::write_unlocked (Sample *data, samplecnt_t cnt) } samplecnt_t -SndFileSource::nondestructive_write_unlocked (Sample *data, samplecnt_t cnt) +SndFileSource::nondestructive_write_unlocked (Sample const * data, samplecnt_t cnt) { if (!writable()) { warning << string_compose (_("attempt to write a non-writable audio file source (%1)"), _path) << endmsg; @@ -736,7 +736,7 @@ SndFileSource::set_header_natural_position () } samplecnt_t -SndFileSource::write_float (Sample* data, samplepos_t sample_pos, samplecnt_t cnt) +SndFileSource::write_float (Sample const * data, samplepos_t sample_pos, samplecnt_t cnt) { if ((_info.format & SF_FORMAT_TYPEMASK ) == SF_FORMAT_FLAC) { assert (_length == sample_pos);