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

#pragma once

#include "utility/setup.hpp"
#include <QString>

namespace Tray
{

/// @brief Setup
///
class Setup : public Utility::Setup
{
  public:
  // -- Public types

  enum Mixer_Device
  {
    MIXER_DEV_DEFAULT = 0,
    MIXER_DEV_CURRENT = 1,
    MIXER_DEV_USER = 2,
    MIXER_DEV_LAST = MIXER_DEV_USER
  };

  // -- Construction

  Setup ( Utility::Setup * parent_n );

  ~Setup ();

  // -- Mixer device mode

  Mixer_Device
  device_mode () const
  {
    return _device_mode;
  }

  bool
  set_device_mode ( Mixer_Device dev_n );

  // -- Mixer user device

  const QString &
  user_device () const
  {
    return _user_device;
  }

  bool
  set_user_device ( const QString & dev_n );

  // -- Balloon enabled

  bool
  balloon_enabled () const
  {
    return _balloon_enabled;
  }

  bool
  set_balloon_enabled ( bool flag_n );

  // -- Balloon lifetime

  unsigned int
  balloon_lifetime () const
  {
    return _balloon_lifetime;
  }

  bool
  set_balloon_lifetime ( unsigned int time_ms_n );

  // -- Wheel degrees

  unsigned int
  wheel_degrees () const
  {
    return _wheel_degrees;
  }

  bool
  set_wheel_degrees ( unsigned int degrees_n );

  // -- Show volume icon

  bool
  show_volume_icon () const
  {
    return _show_volume_icon;
  }

  bool
  set_show_volume_icon ( bool flag_n );

  private:
  // -- Attributes
  /// @brief Which device to use for the mixer
  Mixer_Device _device_mode = Mixer_Device::MIXER_DEV_DEFAULT;
  /// @brief User defined mixer device
  QString _user_device;

  /// @brief Whether to show the balloon
  bool _balloon_enabled = true;
  /// @brief Balloon lifetime in ms
  unsigned int _balloon_lifetime = 4000;

  /// @brief Mouse wheel degrees for a volume change to 100%
  unsigned int _wheel_degrees = 720;

  /// @brief Show volume icon
  bool _show_volume_icon = false;
};

} // namespace Tray
