summaryrefslogtreecommitdiff
path: root/drivers/alsa
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 13:23:58 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:54:55 +0200
commit0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch)
treea27e497da7104dd0a64f98a04fa3067668735e91 /drivers/alsa
parent710b34b70227becdc652b4ae027fe0ac47409642 (diff)
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
Diffstat (limited to 'drivers/alsa')
-rw-r--r--drivers/alsa/audio_driver_alsa.cpp13
-rw-r--r--drivers/alsa/audio_driver_alsa.h1
2 files changed, 0 insertions, 14 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp
index e394222d3a..895a746b20 100644
--- a/drivers/alsa/audio_driver_alsa.cpp
+++ b/drivers/alsa/audio_driver_alsa.cpp
@@ -147,7 +147,6 @@ Error AudioDriverALSA::init_device() {
}
Error AudioDriverALSA::init() {
-
active = false;
thread_exited = false;
exit_thread = false;
@@ -161,11 +160,9 @@ Error AudioDriverALSA::init() {
}
void AudioDriverALSA::thread_func(void *p_udata) {
-
AudioDriverALSA *ad = (AudioDriverALSA *)p_udata;
while (!ad->exit_thread) {
-
ad->lock();
ad->start_counting_ticks();
@@ -237,22 +234,18 @@ void AudioDriverALSA::thread_func(void *p_udata) {
}
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() {
-
Array list;
list.push_back("Default");
@@ -285,33 +278,28 @@ Array AudioDriverALSA::get_device_list() {
}
String AudioDriverALSA::get_device() {
-
return device_name;
}
void AudioDriverALSA::set_device(String device) {
-
lock();
new_device = device;
unlock();
}
void AudioDriverALSA::lock() {
-
if (!thread)
return;
mutex.lock();
}
void AudioDriverALSA::unlock() {
-
if (!thread)
return;
mutex.unlock();
}
void AudioDriverALSA::finish_device() {
-
if (pcm_handle) {
snd_pcm_close(pcm_handle);
pcm_handle = nullptr;
@@ -319,7 +307,6 @@ void AudioDriverALSA::finish_device() {
}
void AudioDriverALSA::finish() {
-
if (thread) {
exit_thread = true;
Thread::wait_to_finish(thread);
diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h
index d437993901..7aec0c4071 100644
--- a/drivers/alsa/audio_driver_alsa.h
+++ b/drivers/alsa/audio_driver_alsa.h
@@ -40,7 +40,6 @@
#include <alsa/asoundlib.h>
class AudioDriverALSA : public AudioDriver {
-
Thread *thread = nullptr;
Mutex mutex;