SoundCore Class Reference

The SoundCore class provides a simple interface for audio playback. More...

#include <soundcore.h>

List of all members.

Public Slots

void setVolume (int left, int right)
bool play (const QString &source, bool queue=false, qint64 offset=-1)
void stop ()
void pause ()
void seek (qint64 pos)
const QString url ()

Signals

void bufferingProgress (int progress)
void elapsedChanged (qint64 time)
void bitrateChanged (int bitrate)
void frequencyChanged (quint32 frequency)
void precisionChanged (int precision)
void channelsChanged (int channels)
void metaDataChanged ()
void stateChanged (Qmmp::State newState)
void finished ()
void volumeChanged (int left, int right)
void aboutToFinish ()

Public Member Functions

 SoundCore (QObject *parent=0)
 ~SoundCore ()
qint64 totalTime () const
void setEQ (double bands[10], double preamp)
void setEQEnabled (bool on)
int leftVolume ()
int rightVolume ()
qint64 elapsed ()
int bitrate ()
quint32 frequency ()
int precision ()
int channels ()
Qmmp::State state () const
QMap< Qmmp::MetaData, QString > metaData ()
QString metaData (Qmmp::MetaData key)

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::SoundCore ( QObject *  parent = 0  ) 

Object constructor.

Parameters:
parent Parent object.

SoundCore::~SoundCore (  ) 

Destructor.


Member Function Documentation

void SoundCore::aboutToFinish (  )  [signal]

Emitted before the playback ends.

int SoundCore::bitrate (  ) 

Returns current bitrate (in kbps)

void SoundCore::bitrateChanged ( int  bitrate  )  [signal]

Emitted when bitrate has changed.

Parameters:
bitrate New bitrate (in kbps)

void SoundCore::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.

int SoundCore::channels (  ) 

Returns channels number.

void SoundCore::channelsChanged ( int  channels  )  [signal]

Emitted when channels number has changed.

Parameters:
channels New channels number.

qint64 SoundCore::elapsed (  ) 

Returns the current time (in milliseconds).

void SoundCore::elapsedChanged ( qint64  time  )  [signal]

Tracks elapesed time.

Parameters:
time New track position in milliseconds.

void SoundCore::finished (  )  [signal]

Emitted when playback has finished.

quint32 SoundCore::frequency (  ) 

Returns current sample rate (in Hz).

void SoundCore::frequencyChanged ( quint32  frequency  )  [signal]

Emitted when samplerate has changed.

Parameters:
frequency New sample rate (in Hz)

static SoundCore* SoundCore::instance (  )  [static]

Returns a pointer to the SoundCore instance.

int SoundCore::leftVolume (  ) 

Returns left volume level.

QString SoundCore::metaData ( Qmmp::MetaData  key  ) 

Returns the metdata string associated with the given key.

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

Returns all meta data in map.

void SoundCore::metaDataChanged (  )  [signal]

Emitted when new metadata is available.

void SoundCore::pause (  )  [slot]

Pauses/resumes playback

bool SoundCore::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 SoundCore::precision (  ) 

Returns sample size (in bits).

void SoundCore::precisionChanged ( int  precision  )  [signal]

Emitted when sample size has changed.

Parameters:
precision New sample size (in bits)

int SoundCore::rightVolume (  ) 

Returns left volume level.

void SoundCore::seek ( qint64  pos  )  [slot]

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

void SoundCore::setEQ ( double  bands[10],
double  preamp 
)

Sets equalizer settings. Each item of bands[] and reamp should be -20.0..20.0

void SoundCore::setEQEnabled ( bool  on  ) 

Enables equalizer if on is true or disables it if on is false

void SoundCore::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].

Qmmp::State SoundCore::state (  )  const

Returns the current state.

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

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

void SoundCore::stop (  )  [slot]

Stops playback

qint64 SoundCore::totalTime (  )  const

Returns length in milliseconds

const QString SoundCore::url (  )  [slot]

This function returns file path or stream url.

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

Emitted when volume has changed.

Parameters:
left Left channel volume level. It should be [0..100]
right Right channel volume level. It should be [0..100]


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

Generated on Sat Mar 27 19:43:01 2010 for Qmmp by  doxygen 1.5.9