MPD: Mixer Class Reference

MPD 0.20.15

Public Member Functions | Data Fields
Mixer Class Referenceabstract

`#include <MixerInternal.hxx>`

Collaboration diagram for Mixer:
[legend]

## Public Member Functions
| Mixer (const MixerPlugin &_plugin, MixerListener &_listener)
| Mixer (const Mixer &)=delete
virtual | ~Mixer ()
bool | IsPlugin (const MixerPlugin &other) const
virtual void | Open ()=0
| Open mixer device. More...
virtual void | Close ()=0
| Close mixer device. More...
virtual int | GetVolume ()=0
| Reads the current volume. More...
virtual void | SetVolume (unsigned volume)=0
| Sets the volume. More...

## Data Fields
const MixerPlugin & | plugin
MixerListener & | listener
Mutex | mutex
| This mutex protects all of the mixer struct, including its implementation, so plugins don't have to deal with that. More...
bool | open
| Is the mixer device currently open? More...
bool | failed
| Has this mixer failed, and should not be reopened automatically? More...

## Detailed Description

Definition at line 30 of file MixerInternal.hxx.

## Constructor & Destructor Documentation

## ◆ Mixer() [1/2]

Mixer::Mixer | ( | const MixerPlugin & | _plugin,
|  | MixerListener & | _listener
| ) |  |
| inlineexplicit

Definition at line 54 of file MixerInternal.hxx.

## ◆ Mixer() [2/2]

Mixer::Mixer | ( | const Mixer & |  | ) |
| delete

## ◆ ~Mixer()

virtual Mixer::~Mixer | ( |  | ) |
| inlinevirtual

Definition at line 61 of file MixerInternal.hxx.

## Member Function Documentation

## ◆ Close()

virtual void Mixer::Close | ( |  | ) |
| pure virtual

Close mixer device.

## ◆ GetVolume()

virtual int Mixer::GetVolume | ( |  | ) |
| pure virtual

Reads the current volume.

Throws std::runtime_error on error.

Returns
  the current volume (0..100 including) or -1 if unavailable

## ◆ IsPlugin()

bool Mixer::IsPlugin | ( | const MixerPlugin & | other | ) | const
| inline

Definition at line 63 of file MixerInternal.hxx.

## ◆ Open()

virtual void Mixer::Open | ( |  | ) |
| pure virtual

Open mixer device.

Throws std::runtime_error on error.

## ◆ SetVolume()

virtual void Mixer::SetVolume | ( | unsigned | volume | ) |
| pure virtual

Sets the volume.

Throws std::runtime_error on error.

Parameters

  volume | the new volume (0..100 including)

## Field Documentation

## ◆ failed

bool Mixer::failed

Has this mixer failed, and should not be reopened automatically?

Definition at line 51 of file MixerInternal.hxx.

## ◆ listener

MixerListener& Mixer::listener

Definition at line 34 of file MixerInternal.hxx.

## ◆ mutex

Mutex Mixer::mutex

This mutex protects all of the mixer struct, including its implementation, so plugins don't have to deal with that.

Definition at line 40 of file MixerInternal.hxx.

## ◆ open

bool Mixer::open

Is the mixer device currently open?

Definition at line 45 of file MixerInternal.hxx.

## ◆ plugin

const MixerPlugin& Mixer::plugin

Definition at line 32 of file MixerInternal.hxx.

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

- mixer/MixerInternal.hxx