diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-19 16:03:27 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-20 13:31:09 +0100 |
commit | 116b8dbef22bf3245bcf6c8195bf8bb8c0ea91d3 (patch) | |
tree | d086dc4665395d74fb646f88506e1e20be8955d8 /src/cachemanager.h | |
parent | 88485805a6cdc5b8cb5c785a836bdcc7753b23f0 (diff) |
Collapse LOADNEXT events if they share filename and position.
Diffstat (limited to 'src/cachemanager.h')
-rw-r--r-- | src/cachemanager.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/cachemanager.h b/src/cachemanager.h index a70af35..4fe813e 100644 --- a/src/cachemanager.h +++ b/src/cachemanager.h @@ -135,12 +135,20 @@ public: ///! Internal thread main method - needs to be public. void thread_main(); + class Channel { + public: + size_t channel; + sample_t* samples; + size_t num_samples; + volatile bool* ready; + }; + private: size_t framesize; sample_t *nodata; typedef struct { - AFile *file; + AFile *afile; size_t channel; size_t pos; //< File possition volatile bool ready; @@ -166,21 +174,19 @@ private: // For load next event: size_t pos; - sample_t *buffer; - volatile bool *ready; - size_t channel; - AFile *file; + AFile *afile; + std::list<CacheManager::Channel> channels; } cevent_t; - cevent_t createLoadNextEvent(AFile *file, size_t channel, size_t pos, - sample_t* buffer); + cevent_t createLoadNextEvent(AFile *afile, size_t channel, size_t pos, + sample_t* buffer, volatile bool* ready); cevent_t createCloseEvent(cacheid_t id); - void handleLoadNextEvent(cevent_t &e); - void handleCloseEvent(cevent_t &e); + void handleLoadNextEvent(cevent_t& e); + void handleCloseEvent(cevent_t& e); - void handleEvent(cevent_t &e); - void pushEvent(cevent_t e); + void handleEvent(cevent_t& e); + void pushEvent(cevent_t& e); std::vector<cache_t> id2cache; |