/// QasTools: Desktop toolset for the Linux sound system ALSA.
/// \copyright See COPYING file.

#pragma once

#include "mstate/mixer/controls.hpp"
#include "utility/setup.hpp"
#include <QList>
#include <array>

namespace MState::Mixer
{

/// @brief State
///
class State : public Utility::Setup
{
  public:
  // -- Construction

  State ( Utility::Setup * parent_n );

  ~State ();

  // -- Splitter

  const QList< int > &
  splitter_sizes () const
  {
    return _splitter_sizes;
  }

  bool
  set_splitter_sizes ( const QList< int > & list_n );

  // -- Show stream

  bool
  show_stream ( std::size_t snd_dir_n ) const
  {
    return _show_stream.at ( snd_dir_n );
  }

  bool
  set_show_stream ( std::size_t snd_dir_n, bool flag_n );

  // -- Sorting

  /// @brief Sort by stream direction (playback,capture)
  bool
  sort_stream_dir () const
  {
    return _sort_stream_dir;
  }

  bool
  set_sort_stream_dir ( bool flag_n );

  // -- Sliders

  Controls &
  sliders ()
  {
    return _sliders;
  }

  const Controls &
  sliders () const
  {
    return _sliders;
  }

  // -- Switches

  Controls &
  switches ()
  {
    return _switches;
  }

  const Controls &
  switches () const
  {
    return _switches;
  }

  private:
  // -- Attributes
  QList< int > _splitter_sizes;
  std::array< bool, 2 > _show_stream;
  bool _sort_stream_dir = false;
  Controls _sliders;
  Controls _switches;
};

} // namespace MState::Mixer
