MPD: PcmVolume Class Reference

MPD 0.20.15

Public Member Functions
PcmVolume Class Reference

A class that converts samples from one format to another. More...

`#include <Volume.hxx>`

## Public Member Functions
| PcmVolume ()
unsigned | GetVolume () const
void | SetVolume (unsigned _volume)
void | Open (SampleFormat format)
| Opens the object, prepare for Apply(). More...
void | Close ()
| Closes the object. More...
gcc_pure ConstBuffer< void > | Apply (ConstBuffer< void > src) noexcept
| Apply the volume level. More...

## Detailed Description

A class that converts samples from one format to another.

Definition at line 63 of file Volume.hxx.

## Constructor & Destructor Documentation

## ◆ PcmVolume()

PcmVolume::PcmVolume | ( |  | ) |
| inline

Definition at line 72 of file Volume.hxx.

## Member Function Documentation

## ◆ Apply()

gcc_pure ConstBuffer<void> PcmVolume::Apply | ( | ConstBuffer< void > | src | ) |
| noexcept

Apply the volume level.

## ◆ Close()

void PcmVolume::Close | ( |  | ) |
| inline

Closes the object.

After that, you may call Open() again.

Definition at line 104 of file Volume.hxx.

## ◆ GetVolume()

unsigned PcmVolume::GetVolume | ( |  | ) | const
| inline

Definition at line 79 of file Volume.hxx.

## ◆ Open()

void PcmVolume::Open | ( | SampleFormat | format | ) |

Opens the object, prepare for Apply().

Throws std::runtime_error on error.

Parameters

  format | the sample format

## ◆ SetVolume()

void PcmVolume::SetVolume | ( | unsigned | _volume | ) |
| inline

Parameters

  _volume | the volume level in the range [0..PCM_VOLUME_1]; may be bigger than PCM_VOLUME_1, but then it will most likely clip a lot

Definition at line 88 of file Volume.hxx.

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

- pcm/Volume.hxx