summaryrefslogtreecommitdiff
path: root/src/soundplayer.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-12-27 13:57:43 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2018-12-27 13:57:43 +0100
commit5864285c0b987f97b632d1acfcc7cc49439e985d (patch)
tree98b0647f856131b1889aeed86bd7c421fd1a21a9 /src/soundplayer.h
parent55e4e6a951ca2b5bb23cdc600c6661e76c70a50a (diff)
Add audio cache for the resampled/channel expanded sounds.
Diffstat (limited to 'src/soundplayer.h')
-rw-r--r--src/soundplayer.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/soundplayer.h b/src/soundplayer.h
index 8502e6e..d8ba929 100644
--- a/src/soundplayer.h
+++ b/src/soundplayer.h
@@ -31,13 +31,16 @@
#include <QString>
#include <QList>
#include <QMutex>
+#include <QMap>
+
+#include <cstdlib>
class QueueItem
{
public:
float *samples;
- size_t pos;
- size_t size;
+ std::size_t pos;
+ std::size_t size;
};
class SoundPlayer
@@ -57,4 +60,12 @@ private:
QList<QueueItem> queue;
QList<QueueItem> active;
+
+ struct Samples
+ {
+ float *data;
+ std::size_t size;
+ };
+ Samples getSampleData(QString file);
+ QMap<QString, Samples> cache;
};