mirror of https://github.com/AxioDL/boo.git
Add ability to unregister audio callback
This commit is contained in:
parent
d6b54a3718
commit
7bf2ad48a7
|
@ -38,6 +38,9 @@ struct IAudioVoiceEngine
|
|||
/** Client may optionally register a 200-virtual-updates each second callback for the stream */
|
||||
virtual void register5MsCallback(std::function<void(double dt)>&& callback)=0;
|
||||
|
||||
/** Unregister callback for stable cleanup */
|
||||
virtual void unregister5MsCallback()=0;
|
||||
|
||||
/** Client may use this to determine current speaker-setup */
|
||||
virtual AudioChannelSet getAvailableSet()=0;
|
||||
|
||||
|
|
|
@ -202,6 +202,11 @@ void BaseAudioVoiceEngine::register5MsCallback(std::function<void(double dt)>&&
|
|||
m_5msCallback = std::move(callback);
|
||||
}
|
||||
|
||||
void BaseAudioVoiceEngine::unregister5MsCallback()
|
||||
{
|
||||
m_5msCallback = {};
|
||||
}
|
||||
|
||||
void BaseAudioVoiceEngine::setVolume(float vol)
|
||||
{
|
||||
m_totalVol = vol;
|
||||
|
|
|
@ -69,6 +69,7 @@ public:
|
|||
std::unique_ptr<IAudioSubmix> allocateNewSubmix(bool mainOut, IAudioSubmixCallback* cb, int busId);
|
||||
|
||||
void register5MsCallback(std::function<void(double dt)>&& callback);
|
||||
void unregister5MsCallback();
|
||||
|
||||
void setVolume(float vol);
|
||||
const AudioVoiceEngineMixInfo& mixInfo() const;
|
||||
|
|
Loading…
Reference in New Issue