diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-19 14:06:10 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-19 14:06:10 +0200 |
commit | 7f19dfdba76e9d127f8f6c1e1c3c547755e7d7c1 (patch) | |
tree | 092f4511f027460df5d0e9189717d4a05ecfb1fe /src/cachemanager.h | |
parent | d35c16931056ec4b07706e3955f6198ce0e43cf7 (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__*/ |