Partition: add noexcept

This commit is contained in:
Max Kellermann 2019-05-31 13:54:52 +02:00
parent c3ccbfd407
commit 11ec7117ab
2 changed files with 27 additions and 27 deletions

View File

@ -30,7 +30,7 @@ Partition::Partition(Instance &_instance,
unsigned max_length,
unsigned buffer_chunks,
AudioFormat configured_audio_format,
const ReplayGainConfig &replay_gain_config)
const ReplayGainConfig &replay_gain_config) noexcept
:instance(_instance),
name(_name),
listener(new ClientListener(instance.event_loop, *this)),
@ -46,13 +46,13 @@ Partition::Partition(Instance &_instance,
Partition::~Partition() noexcept = default;
void
Partition::EmitIdle(unsigned mask)
Partition::EmitIdle(unsigned mask) noexcept
{
instance.EmitIdle(mask);
}
void
Partition::UpdateEffectiveReplayGainMode()
Partition::UpdateEffectiveReplayGainMode() noexcept
{
auto mode = replay_gain_mode;
if (mode == ReplayGainMode::AUTO)
@ -68,7 +68,7 @@ Partition::UpdateEffectiveReplayGainMode()
#ifdef ENABLE_DATABASE
const Database *
Partition::GetDatabase() const
Partition::GetDatabase() const noexcept
{
return instance.GetDatabase();
}
@ -80,7 +80,7 @@ Partition::GetDatabaseOrThrow() const
}
void
Partition::DatabaseModified(const Database &db)
Partition::DatabaseModified(const Database &db) noexcept
{
playlist.DatabaseModified(db);
EmitIdle(IDLE_DATABASE);
@ -89,7 +89,7 @@ Partition::DatabaseModified(const Database &db)
#endif
void
Partition::TagModified()
Partition::TagModified() noexcept
{
auto song = pc.LockReadTaggedSong();
if (song)
@ -103,13 +103,13 @@ Partition::TagModified(const char *uri, const Tag &tag) noexcept
}
void
Partition::SyncWithPlayer()
Partition::SyncWithPlayer() noexcept
{
playlist.SyncWithPlayer(pc);
}
void
Partition::BorderPause()
Partition::BorderPause() noexcept
{
playlist.BorderPause(pc);
}

View File

@ -71,17 +71,17 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
unsigned max_length,
unsigned buffer_chunks,
AudioFormat configured_audio_format,
const ReplayGainConfig &replay_gain_config);
const ReplayGainConfig &replay_gain_config) noexcept;
~Partition() noexcept;
void EmitGlobalEvent(unsigned mask) {
void EmitGlobalEvent(unsigned mask) noexcept {
global_events.OrMask(mask);
}
void EmitIdle(unsigned mask);
void EmitIdle(unsigned mask) noexcept;
void ClearQueue() {
void ClearQueue() noexcept {
playlist.Clear(pc);
}
@ -108,11 +108,11 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
playlist.DeleteRange(pc, start, end);
}
void StaleSong(const char *uri) {
void StaleSong(const char *uri) noexcept {
playlist.StaleSong(pc, uri);
}
void Shuffle(unsigned start, unsigned end) {
void Shuffle(unsigned start, unsigned end) noexcept {
playlist.Shuffle(pc, start, end);
}
@ -142,7 +142,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
playlist.SetPriorityId(pc, song_id, priority);
}
void Stop() {
void Stop() noexcept {
playlist.Stop(pc);
}
@ -174,27 +174,27 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
playlist.SeekCurrent(pc, seek_time, relative);
}
void SetRepeat(bool new_value) {
void SetRepeat(bool new_value) noexcept {
playlist.SetRepeat(pc, new_value);
}
bool GetRandom() const {
bool GetRandom() const noexcept {
return playlist.GetRandom();
}
void SetRandom(bool new_value) {
void SetRandom(bool new_value) noexcept {
playlist.SetRandom(pc, new_value);
}
void SetSingle(SingleMode new_value) {
void SetSingle(SingleMode new_value) noexcept {
playlist.SetSingle(pc, new_value);
}
void SetConsume(bool new_value) {
void SetConsume(bool new_value) noexcept {
playlist.SetConsume(new_value);
}
void SetReplayGainMode(ReplayGainMode mode) {
void SetReplayGainMode(ReplayGainMode mode) noexcept {
replay_gain_mode = mode;
UpdateEffectiveReplayGainMode();
}
@ -203,7 +203,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
* Publishes the effective #ReplayGainMode to all subsystems.
* #ReplayGainMode::AUTO is substituted.
*/
void UpdateEffectiveReplayGainMode();
void UpdateEffectiveReplayGainMode() noexcept;
#ifdef ENABLE_DATABASE
/**
@ -211,7 +211,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
* if this MPD configuration has no database (no
* music_directory was configured).
*/
const Database *GetDatabase() const;
const Database *GetDatabase() const noexcept;
const Database &GetDatabaseOrThrow() const;
@ -219,14 +219,14 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
* The database has been modified. Propagate the change to
* all subsystems.
*/
void DatabaseModified(const Database &db);
void DatabaseModified(const Database &db) noexcept;
#endif
/**
* A tag in the play queue has been modified by the player
* thread. Propagate the change to all subsystems.
*/
void TagModified();
void TagModified() noexcept;
/**
* The tag of the given song has been modified. Propagate the
@ -237,13 +237,13 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
/**
* Synchronize the player with the play queue.
*/
void SyncWithPlayer();
void SyncWithPlayer() noexcept;
/**
* Border pause has just been enabled. Change single mode to off
* if it was one-shot.
*/
void BorderPause();
void BorderPause() noexcept;
private:
/* virtual methods from class QueueListener */