The Battle for Wesnoth  1.19.25+dev
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
sound::volume Class Reference

#include <sound.hpp>

Public Member Functions

constexpr volume (float factor)
 
constexpr float as_percent () const
 
constexpr operator float () const
 Implicit conversion for use with SDL. More...
 
constexpr auto operator* (const volume &other) const
 
constexpr auto operator/ (const volume &other) const
 
constexpr auto operator+ (const volume &other) const
 
constexpr auto operator- (const volume &other) const
 

Static Public Member Functions

constexpr static volume from_percent (float percentage)
 

Private Attributes

float gain {1.0}
 

Detailed Description

Definition at line 109 of file sound.hpp.

Constructor & Destructor Documentation

◆ volume()

constexpr sound::volume::volume ( float  factor)
inlineexplicitconstexpr

Definition at line 112 of file sound.hpp.

Member Function Documentation

◆ as_percent()

constexpr float sound::volume::as_percent ( ) const
inlineconstexpr

◆ from_percent()

constexpr static volume sound::volume::from_percent ( float  percentage)
inlinestaticconstexpr

◆ operator float()

constexpr sound::volume::operator float ( ) const
inlineconstexpr

Implicit conversion for use with SDL.

Definition at line 124 of file sound.hpp.

References gain.

◆ operator*()

constexpr auto sound::volume::operator* ( const volume other) const
inlineconstexpr

Definition at line 127 of file sound.hpp.

References gain.

◆ operator+()

constexpr auto sound::volume::operator+ ( const volume other) const
inlineconstexpr

Definition at line 133 of file sound.hpp.

References gain.

◆ operator-()

constexpr auto sound::volume::operator- ( const volume other) const
inlineconstexpr

Definition at line 136 of file sound.hpp.

References gain.

◆ operator/()

constexpr auto sound::volume::operator/ ( const volume other) const
inlineconstexpr

Definition at line 130 of file sound.hpp.

References gain.

Member Data Documentation

◆ gain

float sound::volume::gain {1.0}
private

Definition at line 140 of file sound.hpp.

Referenced by as_percent(), operator float(), operator*(), operator+(), operator-(), and operator/().


The documentation for this class was generated from the following file: