载入中...
搜索中...
未找到
src
modules
audio
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
"
11
#include "
event/PlatformEventSink.h
"
12
13
namespace
eve::audio
{
14
namespace
{
15
16
class
AudioPumpSink :
public
eve::event::IPlatformEventSink
{
17
public
:
18
void
onPumpFinished()
override
{
19
if
(
auto
*audio = eve::ModuleManager::getInstance<Audio>(
"Audio"
)) audio->pump();
20
}
21
};
22
23
struct
Register {
24
Register() {
25
static
AudioPumpSink sink;
26
eve::cap::addListener<eve::event::IPlatformEventSink>
(&sink);
27
}
28
} g_register;
29
30
}
// namespace
31
}
// namespace eve::audio
Audio.h
Capability.h
Module.h
PlatformEventSink.h
eve::event::IPlatformEventSink
Definition
PlatformEventSink.h:30
eve::audio
Definition
Audio.cpp:18
eve::cap::query
I * query()
Definition
Capability.h:77