diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-19 16:03:27 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-19 16:03:27 +0200 |
commit | cc9b5ff6d194dc8ead042c5d129ea07e8e68382d (patch) | |
tree | f5ce925df64cbf2e4b02b0a43577bae57fb0bee5 /src/cachemanager.h | |
parent | 7f19dfdba76e9d127f8f6c1e1c3c547755e7d7c1 (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; |