decoder/Control: add "noexcept"
This commit is contained in:
@@ -177,20 +177,20 @@ struct DecoderControl {
|
||||
*/
|
||||
DecoderControl(Mutex &_mutex, Cond &_client_cond,
|
||||
const AudioFormat _configured_audio_format,
|
||||
const ReplayGainConfig &_replay_gain_config);
|
||||
~DecoderControl();
|
||||
const ReplayGainConfig &_replay_gain_config) noexcept;
|
||||
~DecoderControl() noexcept;
|
||||
|
||||
/**
|
||||
* Locks the object.
|
||||
*/
|
||||
void Lock() const {
|
||||
void Lock() const noexcept {
|
||||
mutex.lock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the object.
|
||||
*/
|
||||
void Unlock() const {
|
||||
void Unlock() const noexcept {
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ struct DecoderControl {
|
||||
* player thread. The object should be locked prior to
|
||||
* calling this function.
|
||||
*/
|
||||
void Signal() {
|
||||
void Signal() noexcept {
|
||||
cond.signal();
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ struct DecoderControl {
|
||||
* is only valid in the decoder thread. The object must be locked
|
||||
* prior to calling this function.
|
||||
*/
|
||||
void Wait() {
|
||||
void Wait() noexcept {
|
||||
cond.wait(mutex);
|
||||
}
|
||||
|
||||
@@ -219,9 +219,9 @@ struct DecoderControl {
|
||||
*
|
||||
* Caller must hold the lock.
|
||||
*/
|
||||
void WaitForDecoder();
|
||||
void WaitForDecoder() noexcept;
|
||||
|
||||
bool IsIdle() const {
|
||||
bool IsIdle() const noexcept {
|
||||
return state == DecoderState::STOP ||
|
||||
state == DecoderState::ERROR;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ struct DecoderControl {
|
||||
* Caller must lock the object.
|
||||
*/
|
||||
void SetReady(const AudioFormat audio_format,
|
||||
bool _seekable, SignedSongTime _duration);
|
||||
bool _seekable, SignedSongTime _duration) noexcept;
|
||||
|
||||
/**
|
||||
* Checks whether an error has occurred, and if so, rethrows
|
||||
@@ -290,7 +290,7 @@ struct DecoderControl {
|
||||
*
|
||||
* Caller must lock the object.
|
||||
*/
|
||||
void ClearError() {
|
||||
void ClearError() noexcept {
|
||||
if (state == DecoderState::ERROR) {
|
||||
error = std::exception_ptr();
|
||||
state = DecoderState::STOP;
|
||||
@@ -320,7 +320,7 @@ private:
|
||||
* To be called from the client thread. Caller must lock the
|
||||
* object.
|
||||
*/
|
||||
void WaitCommandLocked() {
|
||||
void WaitCommandLocked() noexcept {
|
||||
while (command != DecoderCommand::NONE)
|
||||
WaitForDecoder();
|
||||
}
|
||||
@@ -332,7 +332,7 @@ private:
|
||||
* To be called from the client thread. Caller must lock the
|
||||
* object.
|
||||
*/
|
||||
void SynchronousCommandLocked(DecoderCommand cmd) {
|
||||
void SynchronousCommandLocked(DecoderCommand cmd) noexcept {
|
||||
command = cmd;
|
||||
Signal();
|
||||
WaitCommandLocked();
|
||||
@@ -345,13 +345,13 @@ private:
|
||||
* To be called from the client thread. This method locks the
|
||||
* object.
|
||||
*/
|
||||
void LockSynchronousCommand(DecoderCommand cmd) {
|
||||
void LockSynchronousCommand(DecoderCommand cmd) noexcept {
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
ClearError();
|
||||
SynchronousCommandLocked(cmd);
|
||||
}
|
||||
|
||||
void LockAsynchronousCommand(DecoderCommand cmd) {
|
||||
void LockAsynchronousCommand(DecoderCommand cmd) noexcept {
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
command = cmd;
|
||||
Signal();
|
||||
@@ -365,7 +365,7 @@ public:
|
||||
* To be called from the decoder thread. Caller must lock the
|
||||
* mutex.
|
||||
*/
|
||||
void CommandFinishedLocked() {
|
||||
void CommandFinishedLocked() noexcept {
|
||||
assert(command != DecoderCommand::NONE);
|
||||
|
||||
command = DecoderCommand::NONE;
|
||||
@@ -383,30 +383,30 @@ public:
|
||||
* the caller)
|
||||
*/
|
||||
void Start(DetachedSong *song, SongTime start_time, SongTime end_time,
|
||||
MusicBuffer &buffer, MusicPipe &pipe);
|
||||
MusicBuffer &buffer, MusicPipe &pipe) noexcept;
|
||||
|
||||
void Stop();
|
||||
void Stop() noexcept;
|
||||
|
||||
/**
|
||||
* Throws #std::runtime_error on error.
|
||||
*/
|
||||
void Seek(SongTime t);
|
||||
|
||||
void Quit();
|
||||
void Quit() noexcept;
|
||||
|
||||
const char *GetMixRampStart() const {
|
||||
const char *GetMixRampStart() const noexcept {
|
||||
return mix_ramp.GetStart();
|
||||
}
|
||||
|
||||
const char *GetMixRampEnd() const {
|
||||
const char *GetMixRampEnd() const noexcept {
|
||||
return mix_ramp.GetEnd();
|
||||
}
|
||||
|
||||
const char *GetMixRampPreviousEnd() const {
|
||||
const char *GetMixRampPreviousEnd() const noexcept {
|
||||
return previous_mix_ramp.GetEnd();
|
||||
}
|
||||
|
||||
void SetMixRamp(MixRampInfo &&new_value) {
|
||||
void SetMixRamp(MixRampInfo &&new_value) noexcept {
|
||||
mix_ramp = std::move(new_value);
|
||||
}
|
||||
|
||||
@@ -414,10 +414,10 @@ public:
|
||||
* Move mixramp_end to mixramp_prev_end and clear
|
||||
* mixramp_start/mixramp_end.
|
||||
*/
|
||||
void CycleMixRamp();
|
||||
void CycleMixRamp() noexcept;
|
||||
|
||||
private:
|
||||
void RunThread();
|
||||
void RunThread() noexcept;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user