载入中...
搜索中...
未找到
EventSink.cpp
浏览该文件的文档.
1// Drives streaming-source refills once per event pump.
2//
3// Audio::pump has nothing to do with platform events, but it does need a
4// per-frame tick and the event pump was the only one available -- so the event
5// module called into audio. Hanging it off the sink's end-of-pump hook keeps
6// the timing identical without the dependency.
7
8#include "audio/Audio.h"
9#include "common/Capability.h"
10#include "common/Module.h"
12
13namespace eve::audio {
14namespace {
15
16class AudioPumpSink : public eve::event::IPlatformEventSink {
17public:
18 void onPumpFinished() override {
19 if (auto *audio = eve::ModuleManager::getInstance<Audio>("Audio")) audio->pump();
20 }
21};
22
23struct Register {
24 Register() {
25 static AudioPumpSink sink;
27 }
28} g_register;
29
30} // namespace
31} // namespace eve::audio
I * query()
Definition Capability.h:77