summaryrefslogtreecommitdiff
path: root/drivers/xaudio2
diff options
context:
space:
mode:
authorWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2018-12-08 15:07:33 -0500
committerWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2018-12-11 18:33:01 -0500
commit08f22f1cf0e0d133b7ea763dc3886cf462c6fcb2 (patch)
tree5f4321fb0e3150ca159598b6badcf1a90d1fdcd6 /drivers/xaudio2
parent41d1dba35fc851258d5aabad819d09f6a43e324c (diff)
Moved member variables to initializer list
Diffstat (limited to 'drivers/xaudio2')
-rw-r--r--drivers/xaudio2/audio_driver_xaudio2.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp
index 452a1105ca..ce2f0db0fc 100644
--- a/drivers/xaudio2/audio_driver_xaudio2.cpp
+++ b/drivers/xaudio2/audio_driver_xaudio2.cpp
@@ -91,7 +91,7 @@ Error AudioDriverXAudio2::init() {
thread = Thread::create(AudioDriverXAudio2::thread_func, this);
return OK;
-};
+}
void AudioDriverXAudio2::thread_func(void *p_udata) {
@@ -131,10 +131,10 @@ void AudioDriverXAudio2::thread_func(void *p_udata) {
WaitForSingleObject(ad->voice_callback.buffer_end_event, INFINITE);
}
}
- };
+ }
ad->thread_exited = true;
-};
+}
void AudioDriverXAudio2::start() {
@@ -144,17 +144,17 @@ void AudioDriverXAudio2::start() {
ERR_EXPLAIN("XAudio2 start error " + itos(hr));
ERR_FAIL();
}
-};
+}
int AudioDriverXAudio2::get_mix_rate() const {
return mix_rate;
-};
+}
AudioDriver::SpeakerMode AudioDriverXAudio2::get_speaker_mode() const {
return speaker_mode;
-};
+}
float AudioDriverXAudio2::get_latency() {
@@ -172,13 +172,13 @@ void AudioDriverXAudio2::lock() {
if (!thread || !mutex)
return;
mutex->lock();
-};
+}
void AudioDriverXAudio2::unlock() {
if (!thread || !mutex)
return;
mutex->unlock();
-};
+}
void AudioDriverXAudio2::finish() {
@@ -195,12 +195,12 @@ void AudioDriverXAudio2::finish() {
if (samples_in) {
memdelete_arr(samples_in);
- };
+ }
if (samples_out[0]) {
for (int i = 0; i < AUDIO_BUFFERS; i++) {
memdelete_arr(samples_out[i]);
}
- };
+ }
mastering_voice->DestroyVoice();
@@ -208,20 +208,18 @@ void AudioDriverXAudio2::finish() {
if (mutex)
memdelete(mutex);
thread = NULL;
-};
-
-AudioDriverXAudio2::AudioDriverXAudio2() {
+}
- mutex = NULL;
- thread = NULL;
+AudioDriverXAudio2::AudioDriverXAudio2() :
+ thread(NULL),
+ mutex(NULL),
+ current_buffer(0) {
wave_format = { 0 };
for (int i = 0; i < AUDIO_BUFFERS; i++) {
xaudio_buffer[i] = { 0 };
samples_out[i] = 0;
}
- current_buffer = 0;
-};
-
-AudioDriverXAudio2::~AudioDriverXAudio2(){
+}
-};
+AudioDriverXAudio2::~AudioDriverXAudio2() {
+}