Qmmp
Public Slots | Signals | Public Member Functions | Static Public Member Functions
SoundCore Class Reference

#include <soundcore.h>

List of all members.

Public Slots

void setVolume (int left, int right)
void setMuted (bool mute)
void changeVolume (int delta)
void setVolume (int volume)
void volumeUp ()
void volumeDown ()
void setBalance (int balance)
bool play (const QString &source, bool queue=false, qint64 offset=-1)
void stop ()
void pause ()
void seek (qint64 pos)
const QString url () const

Signals

void bufferingProgress (int progress)
void elapsedChanged (qint64 time)
void bitrateChanged (int bitrate)
void frequencyChanged (quint32 frequency)
void sampleSizeChanged (int size)
void channelsChanged (int channels)
void metaDataChanged ()
void streamInfoChanged ()
void stateChanged (Qmmp::State newState)
void finished ()
void volumeChanged (int left, int right)
void mutedChanged (bool muted)
void volumeChanged (int volume)
void balanceChanged (int balance)
void eqSettingsChanged ()
void nextTrackRequest ()

Public Member Functions

 SoundCore (QObject *parent=0)
 ~SoundCore ()
qint64 totalTime () const
EqSettings eqSettings () const
void setEqSettings (const EqSettings &settings)
int leftVolume () const
int rightVolume () const
int volume () const
int balance () const
bool isMuted () const
qint64 elapsed ()
int bitrate ()
quint32 frequency ()
int sampleSize ()
int channels ()
Qmmp::State state () const
QMap< Qmmp::MetaData, QString > metaData () const
QString metaData (Qmmp::MetaData key) const
QHash< QString, QString > streamInfo () const
bool nextTrackAccepted () const

Static Public Member Functions

static SoundCoreinstance ()

Detailed Description

The SoundCore class provides a simple interface for audio playback.

Author:
Ilya Kotov <forkotov02@hotmail.ru>

Constructor & Destructor Documentation

SoundCore ( QObject *  parent = 0)

Object constructor.

Parameters:
parentParent object.
~SoundCore ( )

Destructor.


Member Function Documentation

int balance ( ) const

Returns the balance between left and right channels.

void balanceChanged ( int  balance) [signal]

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

Parameters:
balancenew balance value.
int bitrate ( )

Returns current bitrate (in kbps)

void bitrateChanged ( int  bitrate) [signal]

Emitted when bitrate has changed.

Parameters:
bitrateNew bitrate (in kbps)
void bufferingProgress ( int  progress) [signal]

This signal is emitted when the stream reader fills it's buffer. The argument progress indicates the current percentage of buffering completed.

void changeVolume ( int  delta) [slot]

Changes volume by delta percent

int channels ( )

Returns channels number.

void channelsChanged ( int  channels) [signal]

Emitted when channels number has changed.

Parameters:
channelsNew channels number.
qint64 elapsed ( )

Returns the current time (in milliseconds).

void elapsedChanged ( qint64  time) [signal]

Tracks elapesed time.

Parameters:
timeNew track position in milliseconds.

Returns equalizer settings

void eqSettingsChanged ( ) [signal]

Emitted when equalizer settings has changed.

void finished ( ) [signal]

Emitted when playback has finished.

quint32 frequency ( )

Returns current sample rate (in Hz).

void frequencyChanged ( quint32  frequency) [signal]

Emitted when samplerate has changed.

Parameters:
frequencyNew sample rate (in Hz)
static SoundCore* instance ( ) [static]

Returns a pointer to the SoundCore instance.

bool isMuted ( ) const

Returns true if volume is unmuted, otherwise returns false

int leftVolume ( ) const

Returns left volume level.

QMap<Qmmp::MetaData, QString> metaData ( ) const

Returns all meta data in map.

QString metaData ( Qmmp::MetaData  key) const

Returns the metdata string associated with the given key.

void metaDataChanged ( ) [signal]

Emitted when new metadata is available.

void mutedChanged ( bool  muted) [signal]

Emitted when volume has muted or restored

Parameters:
mutednew state of the volume (true - muted, false - unmuted)
bool nextTrackAccepted ( ) const

Indicates that the current active engine will be used for the next queued track. May be useful for some effect plugins.

void nextTrackRequest ( ) [signal]

Emitted before playback ends. Use this signal to append new url to the queue.

void pause ( ) [slot]

Pauses/resumes playback

bool play ( const QString &  source,
bool  queue = false,
qint64  offset = -1 
) [slot]

This function plays file or stream with the given path source. Returns true if playback has been started successful or source is not a local file, otherwise returns false. Useful for invalid files skipping.

int rightVolume ( ) const

Returns left volume level.

int sampleSize ( )

Returns sample size (in bits).

void sampleSizeChanged ( int  size) [signal]

Emitted when sample size has changed.

Parameters:
sizeNew sample size (in bits)
void seek ( qint64  pos) [slot]

This function sets the current play position to pos in milliseconds.

void setBalance ( int  balance) [slot]

Sets the balance between left and right channels.

Parameters:
balancebalance between left and right channels [-100..100].
void setEqSettings ( const EqSettings settings)

Chages equalizer settings to settings.

void setMuted ( bool  mute) [slot]

Mutes/Restores volume

Parameters:
mute- state of volume (true - mute, false - restore)
void setVolume ( int  left,
int  right 
) [slot]

Sets volume.

Parameters:
left- volume of the left channel [0..100].
right- volume of the right channel [0..100].
void setVolume ( int  volume) [slot]

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

Parameters:
volumevolume of the left and right channels [0..100].
Qmmp::State state ( ) const

Returns the current state.

void stateChanged ( Qmmp::State  newState) [signal]

This signal is emitted when the state of the SoundCore has changed.

void stop ( ) [slot]

Stops playback

QHash<QString, QString> streamInfo ( ) const

Returns a hash of stream information if available

void streamInfoChanged ( ) [signal]

Emitted when new stream information is available.

qint64 totalTime ( ) const

Returns length in milliseconds

const QString url ( ) const [slot]

This function returns file path or stream url.

int volume ( ) const

Returns the highest volume of the left and right channels.

void volumeChanged ( int  left,
int  right 
) [signal]

Emitted when volume has changed.

Parameters:
leftLeft channel volume level. It should be [0..100]
rightRight channel volume level. It should be [0..100]
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.
void volumeDown ( ) [slot]

Decreases volume by volume adjustment step.

void volumeUp ( ) [slot]

Increases volume by volume adjustment step.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Enumerator