-/* Inside every class with a type in it's name is a template waiting to get out... */
-
-
-/** Buffer containing 32-bit floating point (audio) data. */
-class AudioBuffer : public Buffer
-{
-public:
- AudioBuffer(size_t capacity)
- : Buffer(DataType::AUDIO, capacity)
- , _data(NULL)
- {
- _size = capacity; // For audio buffers, size = capacity (always)
-#ifdef NO_POSIX_MEMALIGN
- _data = (Sample *) malloc(sizeof(Sample) * capacity);
-#else
- posix_memalign((void**)_data, 16, sizeof(Sample) * capacity);
-#endif
- assert(_data);
- memset(_data, 0, sizeof(Sample) * capacity);
- }
-
- const Sample* data() const { return _data; }
- Sample* data() { return _data; }
-
-private:
- // These are undefined (prevent copies)
- AudioBuffer(const AudioBuffer& copy);
- AudioBuffer& operator=(const AudioBuffer& copy);
-
- Sample* _data; ///< Actual buffer contents
-};
+ /** Clear (eg zero, or empty) buffer starting at TIME @a offset */
+ virtual void silence(nframes_t len, nframes_t offset=0) = 0;
+
+ /** Clear the entire buffer */
+ virtual void clear() { silence(_capacity, 0); }