output/Multiple: add "noexcept"

This commit is contained in:
Max Kellermann 2017-12-29 16:29:49 +01:00
parent e31abe6d6b
commit c04aafb4e3
2 changed files with 28 additions and 28 deletions

View File

@ -35,12 +35,12 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
MultipleOutputs::MultipleOutputs(MixerListener &_mixer_listener) MultipleOutputs::MultipleOutputs(MixerListener &_mixer_listener) noexcept
:mixer_listener(_mixer_listener) :mixer_listener(_mixer_listener)
{ {
} }
MultipleOutputs::~MultipleOutputs() MultipleOutputs::~MultipleOutputs() noexcept
{ {
/* parallel destruction */ /* parallel destruction */
for (auto *i : outputs) for (auto *i : outputs)
@ -177,14 +177,14 @@ MultipleOutputs::WaitAll() noexcept
} }
void void
MultipleOutputs::AllowPlay() MultipleOutputs::AllowPlay() noexcept
{ {
for (auto *ao : outputs) for (auto *ao : outputs)
ao->LockAllowPlay(); ao->LockAllowPlay();
} }
bool bool
MultipleOutputs::Update(bool force) MultipleOutputs::Update(bool force) noexcept
{ {
bool ret = false; bool ret = false;
@ -199,7 +199,7 @@ MultipleOutputs::Update(bool force)
} }
void void
MultipleOutputs::SetReplayGainMode(ReplayGainMode mode) MultipleOutputs::SetReplayGainMode(ReplayGainMode mode) noexcept
{ {
for (auto *ao : outputs) for (auto *ao : outputs)
ao->SetReplayGainMode(mode); ao->SetReplayGainMode(mode);
@ -292,7 +292,7 @@ MultipleOutputs::IsChunkConsumed(const MusicChunk *chunk) const noexcept
inline void inline void
MultipleOutputs::ClearTailChunk(const MusicChunk *chunk, MultipleOutputs::ClearTailChunk(const MusicChunk *chunk,
bool *locked) bool *locked) noexcept
{ {
assert(chunk->next == nullptr); assert(chunk->next == nullptr);
assert(pipe->Contains(chunk)); assert(pipe->Contains(chunk));
@ -315,7 +315,7 @@ MultipleOutputs::ClearTailChunk(const MusicChunk *chunk,
} }
unsigned unsigned
MultipleOutputs::Check() MultipleOutputs::Check() noexcept
{ {
const MusicChunk *chunk; const MusicChunk *chunk;
bool is_tail; bool is_tail;
@ -363,7 +363,7 @@ MultipleOutputs::Check()
} }
void void
MultipleOutputs::Pause() MultipleOutputs::Pause() noexcept
{ {
Update(false); Update(false);
@ -374,7 +374,7 @@ MultipleOutputs::Pause()
} }
void void
MultipleOutputs::Drain() MultipleOutputs::Drain() noexcept
{ {
for (auto *ao : outputs) for (auto *ao : outputs)
ao->LockDrainAsync(); ao->LockDrainAsync();
@ -383,7 +383,7 @@ MultipleOutputs::Drain()
} }
void void
MultipleOutputs::Cancel() MultipleOutputs::Cancel() noexcept
{ {
/* send the cancel() command to all audio outputs */ /* send the cancel() command to all audio outputs */
@ -408,7 +408,7 @@ MultipleOutputs::Cancel()
} }
void void
MultipleOutputs::Close() MultipleOutputs::Close() noexcept
{ {
for (auto *ao : outputs) for (auto *ao : outputs)
ao->LockCloseWait(); ao->LockCloseWait();
@ -429,7 +429,7 @@ MultipleOutputs::Close()
} }
void void
MultipleOutputs::Release() MultipleOutputs::Release() noexcept
{ {
for (auto *ao : outputs) for (auto *ao : outputs)
ao->LockRelease(); ao->LockRelease();
@ -450,7 +450,7 @@ MultipleOutputs::Release()
} }
void void
MultipleOutputs::SongBorder() MultipleOutputs::SongBorder() noexcept
{ {
/* clear the elapsed_time pointer at the beginning of a new /* clear the elapsed_time pointer at the beginning of a new
song */ song */

View File

@ -73,8 +73,8 @@ public:
* Load audio outputs from the configuration file and * Load audio outputs from the configuration file and
* initialize them. * initialize them.
*/ */
MultipleOutputs(MixerListener &_mixer_listener); MultipleOutputs(MixerListener &_mixer_listener) noexcept;
~MultipleOutputs(); ~MultipleOutputs() noexcept;
void Configure(EventLoop &event_loop, void Configure(EventLoop &event_loop,
const ReplayGainConfig &replay_gain_config, const ReplayGainConfig &replay_gain_config,
@ -96,13 +96,13 @@ public:
/** /**
* Returns the "i"th audio output device. * Returns the "i"th audio output device.
*/ */
const AudioOutputControl &Get(unsigned i) const { const AudioOutputControl &Get(unsigned i) const noexcept {
assert(i < Size()); assert(i < Size());
return *outputs[i]; return *outputs[i];
} }
AudioOutputControl &Get(unsigned i) { AudioOutputControl &Get(unsigned i) noexcept {
assert(i < Size()); assert(i < Size());
return *outputs[i]; return *outputs[i];
@ -135,15 +135,15 @@ public:
/** /**
* Closes all audio outputs. * Closes all audio outputs.
*/ */
void Close(); void Close() noexcept;
/** /**
* Closes all audio outputs. Outputs with the "always_on" * Closes all audio outputs. Outputs with the "always_on"
* flag are put into pause mode. * flag are put into pause mode.
*/ */
void Release(); void Release() noexcept;
void SetReplayGainMode(ReplayGainMode mode); void SetReplayGainMode(ReplayGainMode mode) noexcept;
/** /**
* Enqueue a #MusicChunk object for playing, i.e. pushes it to a * Enqueue a #MusicChunk object for playing, i.e. pushes it to a
@ -161,28 +161,28 @@ public:
* *
* @return the number of chunks to play left in the #MusicPipe * @return the number of chunks to play left in the #MusicPipe
*/ */
unsigned Check(); unsigned Check() noexcept;
/** /**
* Puts all audio outputs into pause mode. Most implementations will * Puts all audio outputs into pause mode. Most implementations will
* simply close it then. * simply close it then.
*/ */
void Pause(); void Pause() noexcept;
/** /**
* Drain all audio outputs. * Drain all audio outputs.
*/ */
void Drain(); void Drain() noexcept;
/** /**
* Try to cancel data which may still be in the device's buffers. * Try to cancel data which may still be in the device's buffers.
*/ */
void Cancel(); void Cancel() noexcept;
/** /**
* Indicate that a new song will begin now. * Indicate that a new song will begin now.
*/ */
void SongBorder(); void SongBorder() noexcept;
/** /**
* Returns the "elapsed_time" stamp of the most recently finished * Returns the "elapsed_time" stamp of the most recently finished
@ -238,7 +238,7 @@ private:
/** /**
* Signals all audio outputs which are open. * Signals all audio outputs which are open.
*/ */
void AllowPlay(); void AllowPlay() noexcept;
/** /**
* Opens all output devices which are enabled, but closed. * Opens all output devices which are enabled, but closed.
@ -246,7 +246,7 @@ private:
* @return true if there is at least open output device which * @return true if there is at least open output device which
* is open * is open
*/ */
bool Update(bool force); bool Update(bool force) noexcept;
/** /**
* Has this chunk been consumed by all audio outputs? * Has this chunk been consumed by all audio outputs?
@ -258,7 +258,7 @@ private:
* audio outputs have consumed it already. Clear the * audio outputs have consumed it already. Clear the
* reference. * reference.
*/ */
void ClearTailChunk(const MusicChunk *chunk, bool *locked); void ClearTailChunk(const MusicChunk *chunk, bool *locked) noexcept;
}; };
#endif #endif