From a0e2b9398a06ca2ea164c2ffd6fd89f713b93598 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 3 Aug 2018 20:02:04 +0200 Subject: Add support for partial buffers in cache and rendering engine - fixes dropouts on framesize changes for example when looping. --- src/events.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/events.h') diff --git a/src/events.h b/src/events.h index b78dd79..c28283e 100644 --- a/src/events.h +++ b/src/events.h @@ -31,8 +31,6 @@ #include #include -#include - #include "audiofile.h" #include "audio.h" #include "audiocache.h" @@ -62,7 +60,8 @@ public: timepos_t offset; //< Global position (ie. not relative to buffer) }; -class EventSample : public Event +class EventSample + : public Event { public: EventSample(channel_t c, float g, AudioFile* af, @@ -91,10 +90,12 @@ public: cacheid_t cache_id; sample_t* buffer; - size_t buffer_size; + std::size_t buffer_size; + std::size_t buffer_ptr{0}; //< Internal pointer into the current buffer + std::size_t sample_size{0}; //< Total number of audio samples in this sample. float gain; - unsigned int t; + unsigned int t; //< Internal sample position. AudioFile* file; std::string group; void* instrument; @@ -118,4 +119,3 @@ private: std::multimap queue; std::mutex mutex; }; - -- cgit v1.2.3