summaryrefslogtreecommitdiff
path: root/src/events.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-08-03 20:02:04 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-05 16:19:57 +0200
commita0e2b9398a06ca2ea164c2ffd6fd89f713b93598 (patch)
treef070de47673f32903eae30ddbc57232e2b13db4e /src/events.h
parentea743668192e0921ab46d5e863df5b754ce82656 (diff)
Add support for partial buffers in cache and rendering engine - fixes dropouts on framesize changes for example when looping.
Diffstat (limited to 'src/events.h')
-rw-r--r--src/events.h12
1 files changed, 6 insertions, 6 deletions
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 <string>
#include <mutex>
-#include <sndfile.h>
-
#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<timepos_t, Event*> queue;
std::mutex mutex;
};
-