diff options
author | David Robillard <d@drobilla.net> | 2009-02-17 02:11:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-17 02:11:49 +0000 |
commit | 022818b4a796f52c0a91eea42e65aec0bc7bed43 (patch) | |
tree | f82bde33d44c7b3e16af7e837536665e17fe0189 /libs/ardour/ardour/silentfilesource.h | |
parent | 4565b73a3993b0cb5ccb9170e276180f2b5c1372 (diff) |
Fix the horrible mess that was anything related to sources and paths.
Most significant changes:
- Factor out FileSource from AudioFileSource, use for SMFSource too
- Explicitly pass embedded rather than mysterious name mangling or whatever
- Destroy a ton of duplicated or very-nearly-duplicated code
- Clean up and document all that weird source stuff in session.cc
git-svn-id: svn://localhost/ardour2/branches/3.0@4609 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/silentfilesource.h')
-rw-r--r-- | libs/ardour/ardour/silentfilesource.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h index cbb123139a..ad433e5f94 100644 --- a/libs/ardour/ardour/silentfilesource.h +++ b/libs/ardour/ardour/silentfilesource.h @@ -26,26 +26,27 @@ namespace ARDOUR { class SilentFileSource : public AudioFileSource { - public: - virtual ~SilentFileSource (); - +public: int update_header (nframes_t when, struct tm&, time_t) { return 0; } int flush_header () { return 0; } float sample_rate () const { return _sample_rate; } - void set_length (nframes_t len); + void set_length (nframes_t len) { _length = len; } bool destructive() const { return false; } bool can_be_analysed() const { return false; } - protected: - - float _sample_rate; - - SilentFileSource (Session&, const XMLNode&, nframes_t nframes, float sample_rate); - +protected: friend class SourceFactory; + SilentFileSource (Session& s, const XMLNode& x, nframes_t len, float srate) + : Source (s, x) + , AudioFileSource (s, x, false) + , _sample_rate(srate) + { + _length = len; + } + nframes_t read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const { memset (dst, 0, sizeof (Sample) * cnt); return cnt; @@ -55,11 +56,13 @@ class SilentFileSource : public AudioFileSource { void set_header_timeline_position () {} - int read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, double samples_per_unit, nframes_t fpp) const { + int read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, + double samples_per_unit, nframes_t fpp) const { memset (peaks, 0, sizeof (PeakData) * npeaks); return 0; } - + + float _sample_rate; }; } // namespace ARDOUR |