output/{Internal,Control}: add "noexcept"
This commit is contained in:
@@ -54,25 +54,25 @@ AudioOutputControl::Configure(const ConfigBlock &block)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
AudioOutputControl::GetName() const
|
AudioOutputControl::GetName() const noexcept
|
||||||
{
|
{
|
||||||
return output->GetName();
|
return output->GetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioOutputClient &
|
AudioOutputClient &
|
||||||
AudioOutputControl::GetClient()
|
AudioOutputControl::GetClient() noexcept
|
||||||
{
|
{
|
||||||
return *output->client;
|
return *output->client;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mixer *
|
Mixer *
|
||||||
AudioOutputControl::GetMixer() const
|
AudioOutputControl::GetMixer() const noexcept
|
||||||
{
|
{
|
||||||
return output->mixer;
|
return output->mixer;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AudioOutputControl::LockSetEnabled(bool new_value)
|
AudioOutputControl::LockSetEnabled(bool new_value) noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
|
||||||
@@ -84,20 +84,20 @@ AudioOutputControl::LockSetEnabled(bool new_value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AudioOutputControl::LockToggleEnabled()
|
AudioOutputControl::LockToggleEnabled() noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
return enabled = !enabled;
|
return enabled = !enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AudioOutputControl::IsOpen() const
|
AudioOutputControl::IsOpen() const noexcept
|
||||||
{
|
{
|
||||||
return output->IsOpen();
|
return output->IsOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::WaitForCommand()
|
AudioOutputControl::WaitForCommand() noexcept
|
||||||
{
|
{
|
||||||
while (!IsCommandFinished()) {
|
while (!IsCommandFinished()) {
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
@@ -107,7 +107,7 @@ AudioOutputControl::WaitForCommand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::CommandAsync(Command cmd)
|
AudioOutputControl::CommandAsync(Command cmd) noexcept
|
||||||
{
|
{
|
||||||
assert(IsCommandFinished());
|
assert(IsCommandFinished());
|
||||||
|
|
||||||
@@ -116,14 +116,14 @@ AudioOutputControl::CommandAsync(Command cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::CommandWait(Command cmd)
|
AudioOutputControl::CommandWait(Command cmd) noexcept
|
||||||
{
|
{
|
||||||
CommandAsync(cmd);
|
CommandAsync(cmd);
|
||||||
WaitForCommand();
|
WaitForCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockCommandWait(Command cmd)
|
AudioOutputControl::LockCommandWait(Command cmd) noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
CommandWait(cmd);
|
CommandWait(cmd);
|
||||||
@@ -148,7 +148,7 @@ AudioOutputControl::EnableAsync()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::DisableAsync()
|
AudioOutputControl::DisableAsync() noexcept
|
||||||
{
|
{
|
||||||
if (!thread.IsDefined()) {
|
if (!thread.IsDefined()) {
|
||||||
if (output->plugin.disable == nullptr)
|
if (output->plugin.disable == nullptr)
|
||||||
@@ -177,7 +177,8 @@ AudioOutputControl::EnableDisableAsync()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
AudioOutputControl::Open(const AudioFormat audio_format, const MusicPipe &mp)
|
AudioOutputControl::Open(const AudioFormat audio_format,
|
||||||
|
const MusicPipe &mp) noexcept
|
||||||
{
|
{
|
||||||
assert(allow_play);
|
assert(allow_play);
|
||||||
assert(audio_format.IsValid());
|
assert(audio_format.IsValid());
|
||||||
@@ -215,7 +216,7 @@ AudioOutputControl::Open(const AudioFormat audio_format, const MusicPipe &mp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::CloseWait()
|
AudioOutputControl::CloseWait() noexcept
|
||||||
{
|
{
|
||||||
assert(allow_play);
|
assert(allow_play);
|
||||||
|
|
||||||
@@ -233,7 +234,7 @@ AudioOutputControl::CloseWait()
|
|||||||
bool
|
bool
|
||||||
AudioOutputControl::LockUpdate(const AudioFormat audio_format,
|
AudioOutputControl::LockUpdate(const AudioFormat audio_format,
|
||||||
const MusicPipe &mp,
|
const MusicPipe &mp,
|
||||||
bool force)
|
bool force) noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
|
||||||
@@ -249,19 +250,19 @@ AudioOutputControl::LockUpdate(const AudioFormat audio_format,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AudioOutputControl::LockIsChunkConsumed(const MusicChunk &chunk) const
|
AudioOutputControl::LockIsChunkConsumed(const MusicChunk &chunk) const noexcept
|
||||||
{
|
{
|
||||||
return output->LockIsChunkConsumed(chunk);
|
return output->LockIsChunkConsumed(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::ClearTailChunk(const MusicChunk &chunk)
|
AudioOutputControl::ClearTailChunk(const MusicChunk &chunk) noexcept
|
||||||
{
|
{
|
||||||
output->ClearTailChunk(chunk);
|
output->ClearTailChunk(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockPlay()
|
AudioOutputControl::LockPlay() noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
|
||||||
@@ -274,7 +275,7 @@ AudioOutputControl::LockPlay()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockPauseAsync()
|
AudioOutputControl::LockPauseAsync() noexcept
|
||||||
{
|
{
|
||||||
if (output->mixer != nullptr && output->plugin.pause == nullptr)
|
if (output->mixer != nullptr && output->plugin.pause == nullptr)
|
||||||
/* the device has no pause mode: close the mixer,
|
/* the device has no pause mode: close the mixer,
|
||||||
@@ -290,7 +291,7 @@ AudioOutputControl::LockPauseAsync()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockDrainAsync()
|
AudioOutputControl::LockDrainAsync() noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
|
||||||
@@ -300,7 +301,7 @@ AudioOutputControl::LockDrainAsync()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockCancelAsync()
|
AudioOutputControl::LockCancelAsync() noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
|
||||||
@@ -311,7 +312,7 @@ AudioOutputControl::LockCancelAsync()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockAllowPlay()
|
AudioOutputControl::LockAllowPlay() noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
|
||||||
@@ -321,7 +322,7 @@ AudioOutputControl::LockAllowPlay()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockRelease()
|
AudioOutputControl::LockRelease() noexcept
|
||||||
{
|
{
|
||||||
if (always_on)
|
if (always_on)
|
||||||
LockPauseAsync();
|
LockPauseAsync();
|
||||||
@@ -330,7 +331,7 @@ AudioOutputControl::LockRelease()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::LockCloseWait()
|
AudioOutputControl::LockCloseWait() noexcept
|
||||||
{
|
{
|
||||||
assert(!output->open || !fail_timer.IsDefined());
|
assert(!output->open || !fail_timer.IsDefined());
|
||||||
|
|
||||||
@@ -339,13 +340,13 @@ AudioOutputControl::LockCloseWait()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::SetReplayGainMode(ReplayGainMode _mode)
|
AudioOutputControl::SetReplayGainMode(ReplayGainMode _mode) noexcept
|
||||||
{
|
{
|
||||||
return output->SetReplayGainMode(_mode);
|
return output->SetReplayGainMode(_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::StopThread()
|
AudioOutputControl::StopThread() noexcept
|
||||||
{
|
{
|
||||||
assert(thread.IsDefined());
|
assert(thread.IsDefined());
|
||||||
assert(allow_play);
|
assert(allow_play);
|
||||||
@@ -355,14 +356,14 @@ AudioOutputControl::StopThread()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutput::BeginDestroy()
|
AudioOutput::BeginDestroy() noexcept
|
||||||
{
|
{
|
||||||
if (mixer != nullptr)
|
if (mixer != nullptr)
|
||||||
mixer_auto_close(mixer);
|
mixer_auto_close(mixer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::BeginDestroy()
|
AudioOutputControl::BeginDestroy() noexcept
|
||||||
{
|
{
|
||||||
output->BeginDestroy();
|
output->BeginDestroy();
|
||||||
|
|
||||||
@@ -373,13 +374,13 @@ AudioOutputControl::BeginDestroy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutput::FinishDestroy()
|
AudioOutput::FinishDestroy() noexcept
|
||||||
{
|
{
|
||||||
audio_output_free(this);
|
audio_output_free(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::FinishDestroy()
|
AudioOutputControl::FinishDestroy() noexcept
|
||||||
{
|
{
|
||||||
if (thread.IsDefined())
|
if (thread.IsDefined())
|
||||||
thread.Join();
|
thread.Join();
|
||||||
|
@@ -183,72 +183,72 @@ public:
|
|||||||
void Configure(const ConfigBlock &block);
|
void Configure(const ConfigBlock &block);
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
const char *GetName() const;
|
const char *GetName() const noexcept;
|
||||||
|
|
||||||
AudioOutputClient &GetClient();
|
AudioOutputClient &GetClient() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
Mixer *GetMixer() const;
|
Mixer *GetMixer() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
bool IsEnabled() const {
|
bool IsEnabled() const noexcept {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the value has been modified
|
* @return true if the value has been modified
|
||||||
*/
|
*/
|
||||||
bool LockSetEnabled(bool new_value);
|
bool LockSetEnabled(bool new_value) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the new "enabled" value
|
* @return the new "enabled" value
|
||||||
*/
|
*/
|
||||||
bool LockToggleEnabled();
|
bool LockToggleEnabled() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
bool IsOpen() const;
|
bool IsOpen() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
bool IsBusy() const {
|
bool IsBusy() const noexcept {
|
||||||
return IsOpen() && !IsCommandFinished();
|
return IsOpen() && !IsCommandFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
const std::exception_ptr &GetLastError() const {
|
const std::exception_ptr &GetLastError() const noexcept {
|
||||||
return last_error;
|
return last_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartThread();
|
void StartThread();
|
||||||
void StopThread();
|
void StopThread() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
bool IsCommandFinished() const {
|
bool IsCommandFinished() const noexcept {
|
||||||
return command == Command::NONE;
|
return command == Command::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandFinished();
|
void CommandFinished() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for command completion.
|
* Waits for command completion.
|
||||||
*
|
*
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
void WaitForCommand();
|
void WaitForCommand() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a command, but does not wait for completion.
|
* Sends a command, but does not wait for completion.
|
||||||
*
|
*
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
void CommandAsync(Command cmd);
|
void CommandAsync(Command cmd) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a command to the #AudioOutput object and waits for
|
* Sends a command to the #AudioOutput object and waits for
|
||||||
@@ -256,16 +256,16 @@ public:
|
|||||||
*
|
*
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
void CommandWait(Command cmd);
|
void CommandWait(Command cmd) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lock the #AudioOutput object and execute the command
|
* Lock the #AudioOutput object and execute the command
|
||||||
* synchronously.
|
* synchronously.
|
||||||
*/
|
*/
|
||||||
void LockCommandWait(Command cmd);
|
void LockCommandWait(Command cmd) noexcept;
|
||||||
|
|
||||||
void BeginDestroy();
|
void BeginDestroy() noexcept;
|
||||||
void FinishDestroy();
|
void FinishDestroy() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables the device, but don't wait for completion.
|
* Enables the device, but don't wait for completion.
|
||||||
@@ -279,7 +279,7 @@ public:
|
|||||||
*
|
*
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
void DisableAsync();
|
void DisableAsync() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempt to enable or disable the device as specified by the
|
* Attempt to enable or disable the device as specified by the
|
||||||
@@ -289,23 +289,23 @@ public:
|
|||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
void EnableDisableAsync();
|
void EnableDisableAsync();
|
||||||
void LockPauseAsync();
|
void LockPauseAsync() noexcept;
|
||||||
|
|
||||||
void CloseWait();
|
void CloseWait() noexcept;
|
||||||
void LockCloseWait();
|
void LockCloseWait() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the audio output, but if the "always_on" flag is set, put it
|
* Closes the audio output, but if the "always_on" flag is set, put it
|
||||||
* into pause mode instead.
|
* into pause mode instead.
|
||||||
*/
|
*/
|
||||||
void LockRelease();
|
void LockRelease() noexcept;
|
||||||
|
|
||||||
void SetReplayGainMode(ReplayGainMode _mode);
|
void SetReplayGainMode(ReplayGainMode _mode) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
bool Open(const AudioFormat audio_format, const MusicPipe &mp);
|
bool Open(AudioFormat audio_format, const MusicPipe &mp) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens or closes the device, depending on the "enabled"
|
* Opens or closes the device, depending on the "enabled"
|
||||||
@@ -316,27 +316,27 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool LockUpdate(const AudioFormat audio_format,
|
bool LockUpdate(const AudioFormat audio_format,
|
||||||
const MusicPipe &mp,
|
const MusicPipe &mp,
|
||||||
bool force);
|
bool force) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
bool LockIsChunkConsumed(const MusicChunk &chunk) const;
|
bool LockIsChunkConsumed(const MusicChunk &chunk) const noexcept;
|
||||||
|
|
||||||
void ClearTailChunk(const MusicChunk &chunk);
|
void ClearTailChunk(const MusicChunk &chunk) noexcept;
|
||||||
|
|
||||||
void LockPlay();
|
void LockPlay() noexcept;
|
||||||
void LockDrainAsync();
|
void LockDrainAsync() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the "allow_play" flag and send the "CANCEL" command
|
* Clear the "allow_play" flag and send the "CANCEL" command
|
||||||
* asynchronously. To finish the operation, the caller has to
|
* asynchronously. To finish the operation, the caller has to
|
||||||
* call LockAllowPlay().
|
* call LockAllowPlay().
|
||||||
*/
|
*/
|
||||||
void LockCancelAsync();
|
void LockCancelAsync() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the "allow_play" and signal the thread.
|
* Set the "allow_play" and signal the thread.
|
||||||
*/
|
*/
|
||||||
void LockAllowPlay();
|
void LockAllowPlay() noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
@@ -351,11 +351,11 @@ private:
|
|||||||
* @return true if playback should be continued, false if a
|
* @return true if playback should be continued, false if a
|
||||||
* command was issued
|
* command was issued
|
||||||
*/
|
*/
|
||||||
bool WaitForDelay();
|
bool WaitForDelay() noexcept;
|
||||||
|
|
||||||
bool FillSourceOrClose();
|
bool FillSourceOrClose();
|
||||||
|
|
||||||
bool PlayChunk();
|
bool PlayChunk() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays all remaining chunks, until the tail of the pipe has
|
* Plays all remaining chunks, until the tail of the pipe has
|
||||||
@@ -365,9 +365,9 @@ private:
|
|||||||
* @return true if at least one chunk has been available,
|
* @return true if at least one chunk has been available,
|
||||||
* false if the tail of the pipe was already reached
|
* false if the tail of the pipe was already reached
|
||||||
*/
|
*/
|
||||||
bool Play();
|
bool Play() noexcept;
|
||||||
|
|
||||||
void Pause();
|
void Pause() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The OutputThread.
|
* The OutputThread.
|
||||||
|
@@ -38,7 +38,7 @@ AudioOutput::~AudioOutput()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
audio_output_free(AudioOutput *ao)
|
audio_output_free(AudioOutput *ao) noexcept
|
||||||
{
|
{
|
||||||
assert(!ao->IsOpen());
|
assert(!ao->IsOpen());
|
||||||
|
|
||||||
|
@@ -163,8 +163,8 @@ public:
|
|||||||
MixerListener &mixer_listener,
|
MixerListener &mixer_listener,
|
||||||
const ConfigBlock &block);
|
const ConfigBlock &block);
|
||||||
|
|
||||||
void BeginDestroy();
|
void BeginDestroy() noexcept;
|
||||||
void FinishDestroy();
|
void FinishDestroy() noexcept;
|
||||||
|
|
||||||
const char *GetName() const {
|
const char *GetName() const {
|
||||||
return name;
|
return name;
|
||||||
@@ -177,7 +177,7 @@ public:
|
|||||||
return open;
|
return open;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetReplayGainMode(ReplayGainMode _mode) {
|
void SetReplayGainMode(ReplayGainMode _mode) noexcept {
|
||||||
source.SetReplayGainMode(_mode);
|
source.SetReplayGainMode(_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,14 +204,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Enable();
|
void Enable();
|
||||||
|
|
||||||
void Disable();
|
void Disable() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws #std::runtime_error on error.
|
* Throws #std::runtime_error on error.
|
||||||
*/
|
*/
|
||||||
void Open(AudioFormat audio_format, const MusicPipe &pipe);
|
void Open(AudioFormat audio_format, const MusicPipe &pipe);
|
||||||
|
|
||||||
void Close(bool drain);
|
void Close(bool drain) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
@@ -229,18 +229,18 @@ private:
|
|||||||
*
|
*
|
||||||
* Mutex must not be locked.
|
* Mutex must not be locked.
|
||||||
*/
|
*/
|
||||||
void CloseOutput(bool drain);
|
void CloseOutput(bool drain) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mutex must not be locked.
|
* Mutex must not be locked.
|
||||||
*/
|
*/
|
||||||
void CloseFilter();
|
void CloseFilter() noexcept;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void BeginPause();
|
void BeginPause() noexcept;
|
||||||
bool IteratePause();
|
bool IteratePause() noexcept;
|
||||||
|
|
||||||
void EndPause() {
|
void EndPause() noexcept{
|
||||||
pause = false;
|
pause = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -262,6 +262,6 @@ audio_output_new(EventLoop &event_loop,
|
|||||||
AudioOutputClient &client);
|
AudioOutputClient &client);
|
||||||
|
|
||||||
void
|
void
|
||||||
audio_output_free(AudioOutput *ao);
|
audio_output_free(AudioOutput *ao) noexcept;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -32,7 +32,7 @@ ao_plugin_init(EventLoop &event_loop,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_finish(AudioOutput *ao)
|
ao_plugin_finish(AudioOutput *ao) noexcept
|
||||||
{
|
{
|
||||||
ao->plugin.finish(ao);
|
ao->plugin.finish(ao);
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ ao_plugin_enable(AudioOutput &ao)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_disable(AudioOutput &ao)
|
ao_plugin_disable(AudioOutput &ao) noexcept
|
||||||
{
|
{
|
||||||
if (ao.plugin.disable != nullptr)
|
if (ao.plugin.disable != nullptr)
|
||||||
ao.plugin.disable(&ao);
|
ao.plugin.disable(&ao);
|
||||||
@@ -58,7 +58,7 @@ ao_plugin_open(AudioOutput &ao, AudioFormat &audio_format)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_close(AudioOutput &ao)
|
ao_plugin_close(AudioOutput &ao) noexcept
|
||||||
{
|
{
|
||||||
ao.plugin.close(&ao);
|
ao.plugin.close(&ao);
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ ao_plugin_drain(AudioOutput &ao)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_cancel(AudioOutput &ao)
|
ao_plugin_cancel(AudioOutput &ao) noexcept
|
||||||
{
|
{
|
||||||
if (ao.plugin.cancel != nullptr)
|
if (ao.plugin.cancel != nullptr)
|
||||||
ao.plugin.cancel(&ao);
|
ao.plugin.cancel(&ao);
|
||||||
|
@@ -168,19 +168,19 @@ ao_plugin_init(EventLoop &event_loop,
|
|||||||
const ConfigBlock &block);
|
const ConfigBlock &block);
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_finish(AudioOutput *ao);
|
ao_plugin_finish(AudioOutput *ao) noexcept;
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_enable(AudioOutput &ao);
|
ao_plugin_enable(AudioOutput &ao);
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_disable(AudioOutput &ao);
|
ao_plugin_disable(AudioOutput &ao) noexcept;
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_open(AudioOutput &ao, AudioFormat &audio_format);
|
ao_plugin_open(AudioOutput &ao, AudioFormat &audio_format);
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_close(AudioOutput &ao);
|
ao_plugin_close(AudioOutput &ao) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
std::chrono::steady_clock::duration
|
std::chrono::steady_clock::duration
|
||||||
@@ -196,7 +196,7 @@ void
|
|||||||
ao_plugin_drain(AudioOutput &ao);
|
ao_plugin_drain(AudioOutput &ao);
|
||||||
|
|
||||||
void
|
void
|
||||||
ao_plugin_cancel(AudioOutput &ao);
|
ao_plugin_cancel(AudioOutput &ao) noexcept;
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ao_plugin_pause(AudioOutput &ao);
|
ao_plugin_pause(AudioOutput &ao);
|
||||||
|
@@ -119,7 +119,7 @@ class AudioOutputSource {
|
|||||||
ConstBuffer<uint8_t> pending_data;
|
ConstBuffer<uint8_t> pending_data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SetReplayGainMode(ReplayGainMode _mode) {
|
void SetReplayGainMode(ReplayGainMode _mode) noexcept {
|
||||||
replay_gain_mode = _mode;
|
replay_gain_mode = _mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutputControl::CommandFinished()
|
AudioOutputControl::CommandFinished() noexcept
|
||||||
{
|
{
|
||||||
assert(command != Command::NONE);
|
assert(command != Command::NONE);
|
||||||
command = Command::NONE;
|
command = Command::NONE;
|
||||||
@@ -75,7 +75,7 @@ AudioOutput::Enable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
AudioOutput::Disable()
|
AudioOutput::Disable() noexcept
|
||||||
{
|
{
|
||||||
if (open)
|
if (open)
|
||||||
Close(false);
|
Close(false);
|
||||||
@@ -89,7 +89,7 @@ AudioOutput::Disable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutput::CloseFilter()
|
AudioOutput::CloseFilter() noexcept
|
||||||
{
|
{
|
||||||
if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin))
|
if (mixer != nullptr && mixer->IsPlugin(software_mixer_plugin))
|
||||||
software_mixer_set_filter(*mixer, nullptr);
|
software_mixer_set_filter(*mixer, nullptr);
|
||||||
@@ -220,7 +220,7 @@ AudioOutputControl::InternalOpen(const AudioFormat audio_format,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioOutput::Close(bool drain)
|
AudioOutput::Close(bool drain) noexcept
|
||||||
{
|
{
|
||||||
assert(open);
|
assert(open);
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ AudioOutput::Close(bool drain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
AudioOutput::CloseOutput(bool drain)
|
AudioOutput::CloseOutput(bool drain) noexcept
|
||||||
{
|
{
|
||||||
if (drain)
|
if (drain)
|
||||||
ao_plugin_drain(*this);
|
ao_plugin_drain(*this);
|
||||||
@@ -253,7 +253,7 @@ AudioOutput::CloseOutput(bool drain)
|
|||||||
* was issued
|
* was issued
|
||||||
*/
|
*/
|
||||||
inline bool
|
inline bool
|
||||||
AudioOutputControl::WaitForDelay()
|
AudioOutputControl::WaitForDelay() noexcept
|
||||||
{
|
{
|
||||||
while (true) {
|
while (true) {
|
||||||
const auto delay = ao_plugin_delay(*output);
|
const auto delay = ao_plugin_delay(*output);
|
||||||
@@ -284,7 +284,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
AudioOutputControl::PlayChunk()
|
AudioOutputControl::PlayChunk() noexcept
|
||||||
{
|
{
|
||||||
if (tags) {
|
if (tags) {
|
||||||
const auto *tag = output->source.ReadTag();
|
const auto *tag = output->source.ReadTag();
|
||||||
@@ -340,7 +340,7 @@ AudioOutputControl::PlayChunk()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
AudioOutputControl::Play()
|
AudioOutputControl::Play() noexcept
|
||||||
{
|
{
|
||||||
if (!FillSourceOrClose())
|
if (!FillSourceOrClose())
|
||||||
/* no chunk available */
|
/* no chunk available */
|
||||||
@@ -380,7 +380,7 @@ AudioOutputControl::Play()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
AudioOutput::BeginPause()
|
AudioOutput::BeginPause() noexcept
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
const ScopeUnlock unlock(mutex);
|
const ScopeUnlock unlock(mutex);
|
||||||
@@ -391,7 +391,7 @@ AudioOutput::BeginPause()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
AudioOutput::IteratePause()
|
AudioOutput::IteratePause() noexcept
|
||||||
{
|
{
|
||||||
bool success;
|
bool success;
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ AudioOutput::IteratePause()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
AudioOutputControl::Pause()
|
AudioOutputControl::Pause() noexcept
|
||||||
{
|
{
|
||||||
output->BeginPause();
|
output->BeginPause();
|
||||||
CommandFinished();
|
CommandFinished();
|
||||||
|
Reference in New Issue
Block a user