fix: issue0a 修复音频事件ID碰撞,给AUDIO_MANAGER_OUTPUT_NOTIFY分配独立ID
This commit is contained in:
@@ -207,7 +207,7 @@ extern "C" {
|
||||
/* AudioManager family (handle: oakengine_audio_manager_handle(), see
|
||||
* oakengine/audio.h). Fired when the output device or format changes. */
|
||||
#define OAKENGINE_EVENT_AUDIO_MANAGER_OUTPUT_PARAMS_CHANGED 140 /**< no payload. */
|
||||
#define OAKENGINE_EVENT_AUDIO_MANAGER_OUTPUT_NOTIFY 141 /**< no payload; emitted after each notify interval of audio has been consumed. */
|
||||
#define OAKENGINE_EVENT_AUDIO_MANAGER_OUTPUT_NOTIFY 144 /**< no payload; emitted after each notify interval of audio has been consumed. */
|
||||
|
||||
/* ---- Playback cache / frame cache (B9c) ----------------------------------- */
|
||||
#define OAKENGINE_EVENT_PLAYBACK_CACHE_INVALIDATED 141
|
||||
|
||||
@@ -1111,6 +1111,26 @@ QVector<QMetaObject::Connection> connect_event(
|
||||
Qt::DirectConnection));
|
||||
break;
|
||||
}
|
||||
case OAKENGINE_EVENT_AUDIO_MANAGER_OUTPUT_NOTIFY: {
|
||||
auto *audio_manager = dynamic_cast<AudioManager *>(obj);
|
||||
if (!audio_manager) {
|
||||
break;
|
||||
}
|
||||
conns.append(QObject::connect(
|
||||
audio_manager, &AudioManager::output_notify, audio_manager,
|
||||
[fn, userdata, audio_manager]() {
|
||||
invoke(fn, userdata,
|
||||
OAKENGINE_EVENT_AUDIO_MANAGER_OUTPUT_NOTIFY,
|
||||
audio_manager, 0, 0, nullptr);
|
||||
},
|
||||
Qt::DirectConnection));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case OAKENGINE_EVENT_PLAYBACK_CACHE_INVALIDATED:
|
||||
case OAKENGINE_EVENT_PLAYBACK_CACHE_VALIDATED: {
|
||||
auto *cache = dynamic_cast<PlaybackCache *>(obj);
|
||||
|
||||
Reference in New Issue
Block a user