diff options
| author | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
| commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
| tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /drivers/xaudio2/audio_driver_xaudio2.h | |
| parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
| download | godot-5dbf180.tar.gz godot-5dbf180.tar.zst godot-5dbf180.zip | |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'drivers/xaudio2/audio_driver_xaudio2.h')
| -rw-r--r-- | drivers/xaudio2/audio_driver_xaudio2.h | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h index afafb84c2..9a37ba7a7 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.h +++ b/drivers/xaudio2/audio_driver_xaudio2.h @@ -29,15 +29,15 @@ #ifndef AUDIO_DRIVER_XAUDIO2_H #define AUDIO_DRIVER_XAUDIO2_H -#include "servers/audio_server.h" -#include "core/os/thread.h" #include "core/os/mutex.h" +#include "core/os/thread.h" +#include "servers/audio_server.h" -#include <windows.h> -#include <mmsystem.h> #include <mmreg.h> -#include <xaudio2.h> +#include <mmsystem.h> +#include <windows.h> #include <wrl/client.h> +#include <xaudio2.h> class AudioDriverXAudio2 : public AudioDriver { @@ -48,26 +48,28 @@ class AudioDriverXAudio2 : public AudioDriver { struct XAudio2DriverVoiceCallback : public IXAudio2VoiceCallback { HANDLE buffer_end_event; - XAudio2DriverVoiceCallback() : buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {} - void STDMETHODCALLTYPE OnBufferEnd(void* pBufferContext) { /*print_line("buffer ended");*/ SetEvent(buffer_end_event); } + XAudio2DriverVoiceCallback() + : buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {} + void STDMETHODCALLTYPE OnBufferEnd(void *pBufferContext) { /*print_line("buffer ended");*/ + SetEvent(buffer_end_event); + } //Unused methods are stubs void STDMETHODCALLTYPE OnStreamEnd() {} void STDMETHODCALLTYPE OnVoiceProcessingPassEnd() {} void STDMETHODCALLTYPE OnVoiceProcessingPassStart(UINT32 SamplesRequired) {} - void STDMETHODCALLTYPE OnBufferStart(void * pBufferContext) {} - void STDMETHODCALLTYPE OnLoopEnd(void * pBufferContext) {} - void STDMETHODCALLTYPE OnVoiceError(void * pBufferContext, HRESULT Error) {} - + void STDMETHODCALLTYPE OnBufferStart(void *pBufferContext) {} + void STDMETHODCALLTYPE OnLoopEnd(void *pBufferContext) {} + void STDMETHODCALLTYPE OnVoiceError(void *pBufferContext, HRESULT Error) {} }; - Thread* thread; - Mutex* mutex; + Thread *thread; + Mutex *mutex; - int32_t* samples_in; - int16_t* samples_out[AUDIO_BUFFERS]; + int32_t *samples_in; + int16_t *samples_out[AUDIO_BUFFERS]; - static void thread_func(void* p_udata); + static void thread_func(void *p_udata); int buffer_size; unsigned int mix_rate; @@ -83,14 +85,13 @@ class AudioDriverXAudio2 : public AudioDriver { WAVEFORMATEX wave_format; Microsoft::WRL::ComPtr<IXAudio2> xaudio; int current_buffer; - IXAudio2MasteringVoice* mastering_voice; + IXAudio2MasteringVoice *mastering_voice; XAUDIO2_BUFFER xaudio_buffer[AUDIO_BUFFERS]; - IXAudio2SourceVoice* source_voice; + IXAudio2SourceVoice *source_voice; XAudio2DriverVoiceCallback voice_callback; public: - - const char* get_name() const; + const char *get_name() const; virtual Error init(); virtual void start(); |
