Merge remote-tracking branches 'neheb/1', 'neheb/2', 'neheb/3', 'neheb/4' and 'neheb/5'
This commit is contained in:
@@ -52,7 +52,7 @@ mixer_open(Mixer *mixer)
|
||||
{
|
||||
assert(mixer != nullptr);
|
||||
|
||||
const std::lock_guard<Mutex> protect(mixer->mutex);
|
||||
const std::scoped_lock<Mutex> protect(mixer->mutex);
|
||||
|
||||
if (mixer->open)
|
||||
return;
|
||||
@@ -82,7 +82,7 @@ mixer_close(Mixer *mixer)
|
||||
{
|
||||
assert(mixer != nullptr);
|
||||
|
||||
const std::lock_guard<Mutex> protect(mixer->mutex);
|
||||
const std::scoped_lock<Mutex> protect(mixer->mutex);
|
||||
|
||||
if (mixer->open)
|
||||
mixer_close_internal(mixer);
|
||||
@@ -119,7 +119,7 @@ mixer_get_volume(Mixer *mixer)
|
||||
if (mixer->plugin.global && !mixer->failed)
|
||||
mixer_open(mixer);
|
||||
|
||||
const std::lock_guard<Mutex> protect(mixer->mutex);
|
||||
const std::scoped_lock<Mutex> protect(mixer->mutex);
|
||||
|
||||
if (mixer->open) {
|
||||
try {
|
||||
@@ -143,7 +143,7 @@ mixer_set_volume(Mixer *mixer, unsigned volume)
|
||||
if (mixer->plugin.global && !mixer->failed)
|
||||
mixer_open(mixer);
|
||||
|
||||
const std::lock_guard<Mutex> protect(mixer->mutex);
|
||||
const std::scoped_lock<Mutex> protect(mixer->mutex);
|
||||
|
||||
if (mixer->open)
|
||||
mixer->SetVolume(volume);
|
||||
|
@@ -128,13 +128,13 @@ private:
|
||||
}
|
||||
|
||||
[[gnu::pure]]
|
||||
double GetNormalizedVolume() const noexcept {
|
||||
[[nodiscard]] double GetNormalizedVolume() const noexcept {
|
||||
return get_normalized_playback_volume(elem,
|
||||
SND_MIXER_SCHN_FRONT_LEFT);
|
||||
}
|
||||
|
||||
[[gnu::pure]]
|
||||
unsigned GetPercentVolume() const noexcept {
|
||||
[[nodiscard]] unsigned GetPercentVolume() const noexcept {
|
||||
return NormalizedToPercent(GetNormalizedVolume());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user