<commit_before>// This file is part of playd.
// playd is licensed under the MIT licence: see LICENSE.txt.

/**
* @file
* Declaration of the PlayerState class, and associated types.
* @see player/player_state.cpp
*/

#ifndef PLAYD_PLAYER_STATE_HPP
#define PLAYD_PLAYER_STATE_HPP

#include <cstdint>
#include <initializer_list>

#include "../io/io_response.hpp"

/**
 * An object holding and representing the current state of a Player.
 * @see Player
 * @see PlayerPosition
 */
class PlayerState : public ResponseSource {
public:
	/**
	 * Enumeration of states that the player can be in.
	 * The player is effectively a finite-state machine whose behaviour
	 * at any given time is dictated by the current state, which is
	 * represented by an instance of State.
	 */
	enum class State : std::uint8_t {
		STARTING, ///< The player has just initialised.
		EJECTED,  ///< The player has no song loaded.
		STOPPED,  ///< The player has a song loaded and not playing.
		PLAYING,  ///< The player has a song loaded and playing.
		QUITTING  ///< The player is about to terminate.
	};

	/// A list of states, used for IfIn.
	typedef std::initializer_list<State> List;

	/// List of states in which the player is playing something.
	const static List AUDIO_PLAYING_STATES;

	/// List of states in which some audio is loaded.
	const static List AUDIO_LOADED_STATES;

	/// Constructs a PlayerState.
	PlayerState();
<commit_msg>Update PlayerState::List comment.<commit_after>// This file is part of playd.
// playd is licensed under the MIT licence: see LICENSE.txt.

/**
* @file
* Declaration of the PlayerState class, and associated types.
* @see player/player_state.cpp
*/

#ifndef PLAYD_PLAYER_STATE_HPP
#define PLAYD_PLAYER_STATE_HPP

#include <cstdint>
#include <initializer_list>

#include "../io/io_response.hpp"

/**
 * An object holding and representing the current state of a Player.
 * @see Player
 * @see PlayerPosition
 */
class PlayerState : public ResponseSource {
public:
	/**
	 * Enumeration of states that the player can be in.
	 * The player is effectively a finite-state machine whose behaviour
	 * at any given time is dictated by the current state, which is
	 * represented by an instance of State.
	 */
	enum class State : std::uint8_t {
		STARTING, ///< The player has just initialised.
		EJECTED,  ///< The player has no song loaded.
		STOPPED,  ///< The player has a song loaded and not playing.
		PLAYING,  ///< The player has a song loaded and playing.
		QUITTING  ///< The player is about to terminate.
	};

	/// A list of states, used for In.
	typedef std::initializer_list<State> List;

	/// List of states in which the player is playing something.
	const static List AUDIO_PLAYING_STATES;

	/// List of states in which some audio is loaded.
	const static List AUDIO_LOADED_STATES;

	/// Constructs a PlayerState.
	PlayerState();

{'fraction_non_alphanumeric': 0.09228070175438596, 'fraction_numerical': 0.0007017543859649122, 'mean_word_length': 3.468652037617555, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1179362', 'n_tokens_mistral': 883, 'n_tokens_neox': 830, 'n_words': 356}