diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-19 14:06:10 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-20 13:31:09 +0100 |
commit | 88485805a6cdc5b8cb5c785a836bdcc7753b23f0 (patch) | |
tree | e1f3755fd7012a0cdcd1dd1b966cc81a0ff433a2 /src/cachemanager.h | |
parent | 2534e4f930f821acc0fc4d5cbfce74325b9b5137 (diff) |
Make cachemanager behave as if it isn't there when CHUNK_MULTIPLIER is big enough to contain all data in an audio file. Add refcounted file handling in cachemanager.
Diffstat (limited to 'src/cachemanager.h')
-rw-r--r-- | src/cachemanager.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cachemanager.h b/src/cachemanager.h index d98d66c..a70af35 100644 --- a/src/cachemanager.h +++ b/src/cachemanager.h @@ -45,6 +45,7 @@ class AudioFile; typedef int cacheid_t; +class AFile; //TODO: @@ -139,13 +140,17 @@ private: sample_t *nodata; typedef struct { - AudioFile *file; + AFile *file; size_t channel; size_t pos; //< File possition volatile bool ready; sample_t *front; sample_t *back; size_t localpos; //< Intra buffer (front) position. + + sample_t* preloaded_samples; // NULL means not active. + size_t preloaded_samples_size; + } cache_t; typedef enum { @@ -163,11 +168,11 @@ private: size_t pos; sample_t *buffer; volatile bool *ready; - AudioFile *file; size_t channel; + AFile *file; } cevent_t; - cevent_t createLoadNextEvent(AudioFile *file, size_t channel, size_t pos, + cevent_t createLoadNextEvent(AFile *file, size_t channel, size_t pos, sample_t* buffer); cevent_t createCloseEvent(cacheid_t id); @@ -190,6 +195,8 @@ private: Semaphore sem; Semaphore sem_run; bool running; + + std::map<std::string, AFile*> files; }; #endif/*__DRUMGIZMO_CACHEMANAGER_H__*/ |