Commit 994c9a01 authored by Max Kellermann's avatar Max Kellermann

player/Control: reorder attributes to reduce padding

parent ad1d5e82
...@@ -141,11 +141,6 @@ struct PlayerControl final : AudioOutputClient { ...@@ -141,11 +141,6 @@ struct PlayerControl final : AudioOutputClient {
*/ */
Cond client_cond; Cond client_cond;
PlayerCommand command = PlayerCommand::NONE;
PlayerState state = PlayerState::STOP;
PlayerError error_type = PlayerError::NONE;
/** /**
* The error that occurred in the player thread. This * The error that occurred in the player thread. This
* attribute is only valid if #error_type is not * attribute is only valid if #error_type is not
...@@ -155,6 +150,14 @@ struct PlayerControl final : AudioOutputClient { ...@@ -155,6 +150,14 @@ struct PlayerControl final : AudioOutputClient {
std::exception_ptr error; std::exception_ptr error;
/** /**
* The next queued song.
*
* This is a duplicate, and must be freed when this attribute
* is cleared.
*/
std::unique_ptr<DetachedSong> next_song;
/**
* A copy of the current #DetachedSong after its tags have * A copy of the current #DetachedSong after its tags have
* been updated by the decoder (for example, a radio stream * been updated by the decoder (for example, a radio stream
* that has sent a new tag after switching to the next song). * that has sent a new tag after switching to the next song).
...@@ -166,28 +169,13 @@ struct PlayerControl final : AudioOutputClient { ...@@ -166,28 +169,13 @@ struct PlayerControl final : AudioOutputClient {
*/ */
std::unique_ptr<DetachedSong> tagged_song; std::unique_ptr<DetachedSong> tagged_song;
uint16_t bit_rate; PlayerCommand command = PlayerCommand::NONE;
AudioFormat audio_format; PlayerState state = PlayerState::STOP;
SignedSongTime total_time;
SongTime elapsed_time;
/**
* The next queued song.
*
* This is a duplicate, and must be freed when this attribute
* is cleared.
*/
std::unique_ptr<DetachedSong> next_song;
SongTime seek_time;
CrossFadeSettings cross_fade; PlayerError error_type = PlayerError::NONE;
const ReplayGainConfig replay_gain_config;
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF; ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
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
* the end of the song, before the next song starts to play. * the end of the song, before the next song starts to play.
...@@ -197,6 +185,20 @@ struct PlayerControl final : AudioOutputClient { ...@@ -197,6 +185,20 @@ struct PlayerControl final : AudioOutputClient {
*/ */
bool border_pause = false; bool border_pause = false;
AudioFormat audio_format;
uint16_t bit_rate;
SignedSongTime total_time;
SongTime elapsed_time;
SongTime seek_time;
CrossFadeSettings cross_fade;
const ReplayGainConfig replay_gain_config;
double total_play_time = 0;
PlayerControl(PlayerListener &_listener, PlayerControl(PlayerListener &_listener,
MultipleOutputs &_outputs, MultipleOutputs &_outputs,
unsigned buffer_chunks, unsigned buffer_chunks,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment