Qmmp
Loading...
Searching...
No Matches
VolumeHandler Class Reference

#include <qmmp/volumehandler.h>

Public Slots

void checkVolume ()
void reload ()

Signals

void volumeChanged (int volume)
void balanceChanged (int balance)
void mutedChanged (bool muted)

Public Member Functions

 VolumeHandler (QObject *parent=nullptr)
 ~VolumeHandler ()
void setVolume (int left, int right)
void changeVolume (int delta)
void setVolume (int volume)
void setBalance (int balance)
void setMuted (bool muted)
int left () const
int right () const
int volume () const
int balance () const
bool isMuted () const
void apply (Buffer *b, int chan)

Static Public Member Functions

static VolumeHandlerinstance ()

Detailed Description

The VolumeHandler class provides volume control access.

Author
Ilya Kotov forko.nosp@m.tov0.nosp@m.2@ya..nosp@m.ru

Constructor & Destructor Documentation

◆ VolumeHandler()

VolumeHandler ( QObject * parent = nullptr)

Object constructor.

Parameters
parentParent object.

◆ ~VolumeHandler()

Destructor.

Member Function Documentation

◆ apply()

void apply ( Buffer * b,
int chan )

Changes buffer volume (software mode only).

Parameters
bBuffer pointer.
chanNumber of channels.

◆ balance()

int balance ( ) const

Returns the balance between left and right channels.

◆ balanceChanged

void balanceChanged ( int balance)
signal

Emitted when the balance between left and right channels has changed.

Parameters
balanceNew balance value.

◆ changeVolume()

void changeVolume ( int delta)

Changes volume by delta percent

◆ checkVolume

void checkVolume ( )
slot

Forces the volumeChanged signal to emit.

◆ instance()

VolumeHandler * instance ( )
static

Returns a pointer to the global VolumeHandler instance.

◆ isMuted()

bool isMuted ( ) const

Returns true if volume is muted, otherwise returns false.

◆ left()

int left ( ) const

Returns left channel volume.

◆ mutedChanged

void mutedChanged ( bool muted)
signal

Emitted when volume mute state has changed

Parameters
mutedNew volume mute state.

◆ reload

void reload ( )
slot

Updates volume configuration

◆ right()

int right ( ) const

Returns right channel volume.

◆ setBalance()

void setBalance ( int balance)

Sets the balance between left and right channels.

Parameters
balancebalance between left and right channels [-100..100].

◆ setMuted()

void setMuted ( bool muted)

Sets volume mute state to muted.

◆ setVolume() [1/2]

void setVolume ( int left,
int right )

Setups volume level. Subclass should reimplement this fucntion.

Parameters
leftLeft channel volume level. It should be 0..100
rightRight channel volume level. It should be 0..100

◆ setVolume() [2/2]

void setVolume ( int volume)

Sets the volume of the left and right channels with keeping of the balance.

Parameters
volumevolume of the left and right channels [0..100].

◆ volume()

int volume ( ) const

Returns the maximum volume of the left and right channels.

◆ volumeChanged

void volumeChanged ( int volume)
signal

Emitted when the highest volume of the left and right channels has changed.

Parameters
volumeNew value of the highest volume of the left and right channels.

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