summaryrefslogtreecommitdiff
path: root/drivers/alsa/audio_driver_alsa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/alsa/audio_driver_alsa.cpp')
-rw-r--r--drivers/alsa/audio_driver_alsa.cpp45
1 files changed, 20 insertions, 25 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp
index a44a11a46d..2e3861f500 100644
--- a/drivers/alsa/audio_driver_alsa.cpp
+++ b/drivers/alsa/audio_driver_alsa.cpp
@@ -32,8 +32,8 @@
#ifdef ALSA_ENABLED
-#include "os/os.h"
-#include "project_settings.h"
+#include "core/os/os.h"
+#include "core/project_settings.h"
#include <errno.h>
@@ -116,9 +116,7 @@ Error AudioDriverALSA::init_device() {
status = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, &period_size, NULL);
CHECK_FAIL(status < 0);
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("audio buffer frames: " + itos(period_size) + " calculated latency: " + itos(period_size * 1000 / mix_rate) + "ms");
- }
+ print_verbose("Audio buffer frames: " + itos(period_size) + " calculated latency: " + itos(period_size * 1000 / mix_rate) + "ms");
status = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &periods, NULL);
CHECK_FAIL(status < 0);
@@ -161,7 +159,7 @@ Error AudioDriverALSA::init() {
}
return err;
-};
+}
void AudioDriverALSA::thread_func(void *p_udata) {
@@ -234,25 +232,25 @@ void AudioDriverALSA::thread_func(void *p_udata) {
ad->stop_counting_ticks();
ad->unlock();
- };
+ }
ad->thread_exited = true;
-};
+}
void AudioDriverALSA::start() {
active = true;
-};
+}
int AudioDriverALSA::get_mix_rate() const {
return mix_rate;
-};
+}
AudioDriver::SpeakerMode AudioDriverALSA::get_speaker_mode() const {
return speaker_mode;
-};
+}
Array AudioDriverALSA::get_device_list() {
@@ -304,14 +302,14 @@ void AudioDriverALSA::lock() {
if (!thread || !mutex)
return;
mutex->lock();
-};
+}
void AudioDriverALSA::unlock() {
if (!thread || !mutex)
return;
mutex->unlock();
-};
+}
void AudioDriverALSA::finish_device() {
@@ -339,18 +337,15 @@ void AudioDriverALSA::finish() {
finish_device();
}
-AudioDriverALSA::AudioDriverALSA() {
-
- mutex = NULL;
- thread = NULL;
- pcm_handle = NULL;
-
- device_name = "Default";
- new_device = "Default";
-};
-
-AudioDriverALSA::~AudioDriverALSA(){
+AudioDriverALSA::AudioDriverALSA() :
+ thread(NULL),
+ mutex(NULL),
+ pcm_handle(NULL),
+ device_name("Default"),
+ new_device("Default") {
+}
-};
+AudioDriverALSA::~AudioDriverALSA() {
+}
#endif