player/Control: use C++11 initializers

This commit is contained in:
Max Kellermann 2016-12-03 13:08:00 +01:00
parent 6cc1ff5eeb
commit 3d16f22135
2 changed files with 8 additions and 15 deletions

View File

@ -32,14 +32,7 @@ PlayerControl::PlayerControl(PlayerListener &_listener,
unsigned _buffered_before_play) unsigned _buffered_before_play)
:listener(_listener), outputs(_outputs), :listener(_listener), outputs(_outputs),
buffer_chunks(_buffer_chunks), buffer_chunks(_buffer_chunks),
buffered_before_play(_buffered_before_play), buffered_before_play(_buffered_before_play)
command(PlayerCommand::NONE),
state(PlayerState::STOP),
error_type(PlayerError::NONE),
tagged_song(nullptr),
next_song(nullptr),
total_play_time(0),
border_pause(false)
{ {
} }

View File

@ -127,10 +127,10 @@ struct PlayerControl {
*/ */
Cond client_cond; Cond client_cond;
PlayerCommand command; PlayerCommand command = PlayerCommand::NONE;
PlayerState state; PlayerState state = PlayerState::STOP;
PlayerError error_type; PlayerError error_type = PlayerError::NONE;
/** /**
* The error that occurred in the player thread. This * The error that occurred in the player thread. This
@ -150,7 +150,7 @@ struct PlayerControl {
* Protected by #mutex. Set by the PlayerThread and consumed * Protected by #mutex. Set by the PlayerThread and consumed
* by the main thread. * by the main thread.
*/ */
DetachedSong *tagged_song; DetachedSong *tagged_song = nullptr;
uint16_t bit_rate; uint16_t bit_rate;
AudioFormat audio_format; AudioFormat audio_format;
@ -163,7 +163,7 @@ struct PlayerControl {
* This is a duplicate, and must be freed when this attribute * This is a duplicate, and must be freed when this attribute
* is cleared. * is cleared.
*/ */
DetachedSong *next_song; DetachedSong *next_song = nullptr;
SongTime seek_time; SongTime seek_time;
@ -172,7 +172,7 @@ struct PlayerControl {
ReplayGainConfig replay_gain_config; ReplayGainConfig replay_gain_config;
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF; ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
double total_play_time; double total_play_time = 0;
/** /**
* If this flag is set, then the player will be auto-paused at * If this flag is set, then the player will be auto-paused at
@ -181,7 +181,7 @@ struct PlayerControl {
* This is a copy of the queue's "single" flag most of the * This is a copy of the queue's "single" flag most of the
* time. * time.
*/ */
bool border_pause; bool border_pause = false;
PlayerControl(PlayerListener &_listener, PlayerControl(PlayerListener &_listener,
MultipleOutputs &_outputs, MultipleOutputs &_outputs,