summaryrefslogtreecommitdiff
path: root/src/audiocachefile.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-01-29 20:49:18 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-29 20:49:18 +0100
commitaa635eb8da9804488513d1f3d422e4810e611bb8 (patch)
tree35db06cfe32f360d974503ff8c7562d1ab75f322 /src/audiocachefile.h
parent67a23a559e9707f9caf46716df30a8bf71bba9a7 (diff)
parent9ebd9aa0c3429f896e6c41f279b570ba36aec674 (diff)
Merge branch 'diskstreaming_review_chaot' into diskstreaming
Diffstat (limited to 'src/audiocachefile.h')
-rw-r--r--src/audiocachefile.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/audiocachefile.h b/src/audiocachefile.h
index 9910563..8e40a2e 100644
--- a/src/audiocachefile.h
+++ b/src/audiocachefile.h
@@ -29,6 +29,7 @@
#include <string>
#include <list>
#include <map>
+#include <vector>
#include <mutex>
#include "mutex.h"
@@ -43,7 +44,7 @@ public:
size_t channel; //< Channel number
sample_t* samples; //< Sample buffer pointer.
size_t num_samples; //< Number of samples in the sample buffer
- volatile bool* ready; //< Is set to tru when the loading is done.
+ volatile bool* ready; //< Is set to true when the loading is done.
};
using CacheChannels = std::list<CacheChannel>;
@@ -56,7 +57,7 @@ class AudioCacheFile {
friend class TestableAudioCacheFiles;
public:
//! Create file handle for filename.
- AudioCacheFile(const std::string& filename);
+ AudioCacheFile(const std::string& filename, std::vector<sample_t>& read_buffer);
//! Closes file handle.
~AudioCacheFile();
@@ -78,6 +79,7 @@ private:
SNDFILE* fh{nullptr};
SF_INFO sf_info;
std::string filename;
+ std::vector<sample_t>& read_buffer;
};
class AudioCacheFiles {
@@ -95,4 +97,5 @@ public:
protected:
std::map<std::string, AudioCacheFile*> audiofiles;
std::mutex mutex;
+ std::vector<sample_t> read_buffer;
};