diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-28 17:03:18 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-28 17:03:18 +0100 |
commit | 9f770629606ca58c78b411e73696eec275c328a5 (patch) | |
tree | 021a18e45119f221290b42a96ff6ee8a24797066 /src/audiocacheeventhandler.h | |
parent | 83e33a14f672c2d1f9f333703867959921d40ffb (diff) |
Conform to style guide.
Diffstat (limited to 'src/audiocacheeventhandler.h')
-rw-r--r-- | src/audiocacheeventhandler.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/audiocacheeventhandler.h b/src/audiocacheeventhandler.h index 733c80e..daf7bb9 100644 --- a/src/audiocacheeventhandler.h +++ b/src/audiocacheeventhandler.h @@ -43,7 +43,7 @@ class AudioCacheEventHandler : protected Thread { public: - AudioCacheEventHandler(AudioCacheIDManager& idManager); + AudioCacheEventHandler(AudioCacheIDManager& id_manager); ~AudioCacheEventHandler(); //! Start event handler thread. @@ -80,22 +80,26 @@ public: AudioCacheFile& openFile(const std::string& filename); protected: - AudioCacheFiles files; + void clearEvents(); - std::mutex mutex; + void handleLoadNextEvent(CacheEvent& cache_event); - void clearEvents(); + //! Lock the mutex and calls handleCloseCache + void handleCloseEvent(CacheEvent& cache_event); - void handleLoadNextEvent(CacheEvent& e); - void handleCloseEvent(CacheEvent& e); + //! Close decrease the file ref and release the cache id. void handleCloseCache(cacheid_t cacheid); - void handleEvent(CacheEvent& e); + void handleEvent(CacheEvent& cache_event); // From Thread void thread_main() override; - void pushEvent(CacheEvent& e); + void pushEvent(CacheEvent& cache_event); + + AudioCacheFiles files; + + std::mutex mutex; std::list<CacheEvent>* eventqueue; @@ -104,7 +108,7 @@ protected: Semaphore sem_run; bool running{false}; - AudioCacheIDManager& idManager; + AudioCacheIDManager& id_manager; size_t chunksize{1024}; }; |