libkcompactdisc
#include <kcompactdisc.h>
Public Types | |
enum | DiscCommand { Play, Pause, Next, Prev, Stop, Eject, Loop, Random } |
enum | DiscInfo { Cdtext, Cddb, PhononMetadata } |
enum | DiscStatus { Playing, Paused, Stopped, Ejected, NoDisc, NotReady, Error } |
enum | InformationMode { Synchronous, Asynchronous } |
Public Slots | |
void | doCommand (KCompactDisc::DiscCommand) |
void | eject () |
void | loop () |
void | metadataLookup () |
void | next () |
void | pause () |
void | play () |
void | playPosition (unsigned int position) |
void | playTrack (unsigned int track) |
void | prev () |
void | random () |
void | setAutoMetadataLookup (bool) |
void | setBalance (unsigned int balance) |
void | setLoopPlaylist (bool) |
void | setRandomPlaylist (bool) |
void | setVolume (unsigned int volume) |
void | stop () |
Signals | |
void | balanceChanged (unsigned int balance) |
void | discChanged (unsigned int tracks) |
void | discInformation (KCompactDisc::DiscInfo info) |
void | discStatusChanged (KCompactDisc::DiscStatus status) |
void | loopPlaylistChanged (bool) |
void | playoutPositionChanged (unsigned int position) |
void | playoutTrackChanged (unsigned int track) |
void | randomPlaylistChanged (bool) |
void | volumeChanged (unsigned int volume) |
Public Member Functions | |
KCompactDisc (InformationMode=KCompactDisc::Synchronous) | |
virtual | ~KCompactDisc () |
const QString & | deviceModel () |
const QString & | deviceName () |
const QString & | deviceRevision () |
const KUrl | deviceUrl () |
const QString & | deviceVendor () |
const QString & | discArtist () |
unsigned | discId () |
unsigned | discLength () |
unsigned | discPosition () |
const QList< unsigned > & | discSignature () |
KCompactDisc::DiscStatus | discStatus () |
QString | discStatusString (KCompactDisc::DiscStatus status) |
const QString & | discTitle () |
bool | isAudio (unsigned track) |
bool | isNoDisc () |
bool | isPaused () |
bool | isPlaying () |
bool | setDevice (const QString &device, unsigned volume=50, bool digitalPlayback=true, const QString &audioSystem=QString(), const QString &audioDevice=QString()) |
unsigned | track () |
QString | trackArtist () |
QString | trackArtist (unsigned track) |
unsigned | trackLength () |
unsigned | trackLength (unsigned track) |
unsigned | trackPosition () |
unsigned | tracks () |
QString | trackTitle () |
QString | trackTitle (unsigned track) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions | |
static const QStringList | audioSystems () |
static const QStringList | cdromDeviceNames () |
static const QString | cdromDeviceUdi (const QString &) |
static const KUrl | cdromDeviceUrl (const QString &) |
static const QString | defaultCdromDeviceName () |
static const QString | defaultCdromDeviceUdi () |
static const KUrl | defaultCdromDeviceUrl () |
static QString | urlToDevice (const KUrl &url) |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
KCompactDisc (KCompactDiscPrivate &dd, QObject *parent) | |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
KCompactDiscPrivate * | d_ptr |
Additional Inherited Members | |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
KCompactDisc - A CD drive interface for the KDE Project.
The disc interface is modelled by these slots:
- See also
- #playoutTrack(unsigned track): Play specified track.
- #playoutPosition(unsigned position): seek to specified position.
- #playNext(): Play next track in the playlist.
- #playPrev(): Play previous track in the playlist.
- #pauseResumePlayout(): Toggle between pause/resume.
- #stopPlayout(): Stop playout:
- eject(): Stop playout and eject disc or Close tray and try to read TOC from disc.
The progress of playout is modelled by these signals:
- See also
- #playoutPositionChanged(unsigned position): A position in a track.
- #playoutTrackChanged(unsigned track): A playout of this track is started.
The shape of playlist is controlled by these accessors.
- See also
- setRandomPlaylist(bool): Shuffle the playlist.
- setLoopPlaylist(bool): Couple begin and end of playlist.
The disc lifecycle is modelled by these signals:
- See also
- discChanged(...): A new disc was inserted.
- #discStatusChanged(KCompactDisc::Playing): A disc started playout.
- #discStatusChanged(KCompactDisc::Paused): A disc was paused.
- #discStatusChanged(KCompactDisc::Stopped): The disc stopped.
- #discStatusChanged(KCompactDisc::NoDisc): The disc is removed. No disc in tray or data disc.
- #discStatusChanged(KCompactDisc::NotReady): The disc is present. But playout is not possible.
- #discInformation(QStringList info): A content for disc information is arrived.
The volume control is modelled by these slots:
- See also
- #setVolume(unsigned): A new volume value.
- #setBalance(unsigned): A new balance value.
And these signals:
- See also
- #volumeChanged(unsigned): A current volume value.
- #balanceChanged(unsigned): A current balance value.
All times in this interface are in seconds. Valid track numbers are positive numbers; zero is not a valid track number.
Definition at line 102 of file kcompactdisc.h.
Member Enumeration Documentation
Enumerator | |
---|---|
Play | |
Pause | |
Next | |
Prev | |
Stop | |
Eject | |
Loop | |
Random |
Definition at line 143 of file kcompactdisc.h.
Enumerator | |
---|---|
Cdtext | |
Cddb | |
PhononMetadata |
Definition at line 166 of file kcompactdisc.h.
Enumerator | |
---|---|
Playing | |
Paused | |
Stopped | |
Ejected | |
NoDisc | |
NotReady | |
Error |
Definition at line 155 of file kcompactdisc.h.
Enumerator | |
---|---|
Synchronous | |
Asynchronous |
Definition at line 137 of file kcompactdisc.h.
Constructor & Destructor Documentation
KCompactDisc::KCompactDisc | ( | InformationMode | infoMode = KCompactDisc::Synchronous | ) |
Definition at line 193 of file kcompactdisc.cpp.
|
virtual |
Definition at line 200 of file kcompactdisc.cpp.
|
protected |
Member Function Documentation
|
static |
All installed audio backends.
Definition at line 128 of file kcompactdisc.cpp.
|
signal |
New balance.
|
static |
All present CDROM devices.
Definition at line 143 of file kcompactdisc.cpp.
The Udi of named CDROM device for this system.
Definition at line 188 of file kcompactdisc.cpp.
|
static |
The Url of named CDROM device for this system.
Definition at line 162 of file kcompactdisc.cpp.
|
static |
The default CDROM device for this system.
Definition at line 148 of file kcompactdisc.cpp.
|
static |
The Udi of default CDROM device for this system.
Definition at line 181 of file kcompactdisc.cpp.
|
static |
The Url of default CDROM device for this system.
Definition at line 155 of file kcompactdisc.cpp.
const QString & KCompactDisc::deviceModel | ( | ) |
SCSI parameter MODEL of current CDROM device.
- Returns
- Null string if no usable device set.
Definition at line 212 of file kcompactdisc.cpp.
const QString & KCompactDisc::deviceName | ( | ) |
Current CDROM device.
- Returns
- Null string if no usable device set.
Definition at line 224 of file kcompactdisc.cpp.
const QString & KCompactDisc::deviceRevision | ( | ) |
SCSI parameter REVISION of current CDROM device.
- Returns
- Null string if no usable device set.
Definition at line 218 of file kcompactdisc.cpp.
const KUrl KCompactDisc::deviceUrl | ( | ) |
Current device as Kurl.
Definition at line 230 of file kcompactdisc.cpp.
const QString & KCompactDisc::deviceVendor | ( | ) |
SCSI parameter VENDOR of current CDROM device.
- Returns
- Null string if no usable device set.
Definition at line 206 of file kcompactdisc.cpp.
const QString & KCompactDisc::discArtist | ( | ) |
Artist for whole disc.
- Returns
- Disc artist or null string.
Definition at line 248 of file kcompactdisc.cpp.
|
signal |
A new Disc is inserted.
unsigned KCompactDisc::discId | ( | ) |
Current disc, 0 if no disc or impossible to calculate id.
Definition at line 236 of file kcompactdisc.cpp.
|
signal |
A new Disc information is arrived.
unsigned KCompactDisc::discLength | ( | ) |
Known length of disc.
- Returns
- Disc length in seconds.
Definition at line 264 of file kcompactdisc.cpp.
unsigned KCompactDisc::discPosition | ( | ) |
Current position on the disc.
- Returns
- Position in seconds.
Definition at line 272 of file kcompactdisc.cpp.
const QList< unsigned > & KCompactDisc::discSignature | ( | ) |
CDDB signature of disc, empty if no disc or not possible to deliever.
Definition at line 242 of file kcompactdisc.cpp.
KCompactDisc::DiscStatus KCompactDisc::discStatus | ( | ) |
|
signal |
A Disc status changed.
QString KCompactDisc::discStatusString | ( | KCompactDisc::DiscStatus | status | ) |
const QString & KCompactDisc::discTitle | ( | ) |
|
slot |
Pipe GUI command.
Definition at line 437 of file kcompactdisc.cpp.
|
slot |
Open/close tray.
Definition at line 422 of file kcompactdisc.cpp.
bool KCompactDisc::isAudio | ( | unsigned | track | ) |
- Returns
- if the track is actually an audio track.
Definition at line 367 of file kcompactdisc.cpp.
bool KCompactDisc::isNoDisc | ( | ) |
Is status no disc.
Definition at line 361 of file kcompactdisc.cpp.
bool KCompactDisc::isPaused | ( | ) |
Is status pausing.
Definition at line 355 of file kcompactdisc.cpp.
bool KCompactDisc::isPlaying | ( | ) |
Is status playing.
Definition at line 349 of file kcompactdisc.cpp.
|
slot |
Switch endless playout on/off.
Definition at line 427 of file kcompactdisc.cpp.
|
signal |
|
slot |
Definition at line 499 of file kcompactdisc.cpp.
|
slot |
Start playout of next track.
Definition at line 402 of file kcompactdisc.cpp.
|
slot |
Pause/resume playout.
Definition at line 412 of file kcompactdisc.cpp.
|
slot |
Start playout.
Definition at line 397 of file kcompactdisc.cpp.
|
signal |
A new position in a track.
This signal is delivered at approximately 1 second intervals while a track is playing. At first sight, this might seem overzealous, but it is likely that any CD player UI will use this to track the second-by-second position, so we may as well do it for them.
- Parameters
-
position Position within track in seconds.
|
signal |
A new track is started.
- Parameters
-
track Track number.
|
slot |
Start playout or seek to given position of track.
Definition at line 386 of file kcompactdisc.cpp.
|
slot |
Start playout of track.
Definition at line 375 of file kcompactdisc.cpp.
|
slot |
Start playout of previous track.
Definition at line 407 of file kcompactdisc.cpp.
|
slot |
Switch random playout on/off.
Definition at line 432 of file kcompactdisc.cpp.
|
signal |
|
slot |
Definition at line 520 of file kcompactdisc.cpp.
|
slot |
Set balance.
Definition at line 551 of file kcompactdisc.cpp.
bool KCompactDisc::setDevice | ( | const QString & | device, |
unsigned | volume = 50 , |
||
bool | digitalPlayback = true , |
||
const QString & | audioSystem = QString() , |
||
const QString & | audioDevice = QString() |
||
) |
- Parameters
-
device Name of CD device, e.g. /dev/cdrom. digitalPlayback Select digital or analog playback. audioSystem For digital playback, system to use, e.g. "phonon". audioDevice For digital playback, device to use.
- Returns
- true if the device seemed usable.
Definition at line 528 of file kcompactdisc.cpp.
|
slot |
Definition at line 513 of file kcompactdisc.cpp.
|
slot |
Definition at line 505 of file kcompactdisc.cpp.
|
slot |
Set volume.
Definition at line 544 of file kcompactdisc.cpp.
|
slot |
Stop playout.
Definition at line 417 of file kcompactdisc.cpp.
unsigned KCompactDisc::track | ( | ) |
QString KCompactDisc::trackArtist | ( | ) |
Artist of current track.
- Returns
- Track artist or null string.
Definition at line 289 of file kcompactdisc.cpp.
QString KCompactDisc::trackArtist | ( | unsigned | track | ) |
Artist of given track.
- Returns
- Track artist or null string.
Definition at line 295 of file kcompactdisc.cpp.
unsigned KCompactDisc::trackLength | ( | ) |
Length of current track.
- Returns
- Track length in seconds.
Definition at line 317 of file kcompactdisc.cpp.
unsigned KCompactDisc::trackLength | ( | unsigned | track | ) |
Length of given track.
- Parameters
-
track Track number.
- Returns
- Track length in seconds.
Definition at line 323 of file kcompactdisc.cpp.
unsigned KCompactDisc::trackPosition | ( | ) |
Current track position.
- Returns
- Track position in seconds.
Definition at line 337 of file kcompactdisc.cpp.
unsigned KCompactDisc::tracks | ( | ) |
Number of tracks.
Definition at line 343 of file kcompactdisc.cpp.
QString KCompactDisc::trackTitle | ( | ) |
Title of current track.
- Returns
- Track title or null string.
Definition at line 303 of file kcompactdisc.cpp.
QString KCompactDisc::trackTitle | ( | unsigned | track | ) |
Title of given track.
- Returns
- Track title or null string.
Definition at line 309 of file kcompactdisc.cpp.
|
static |
If the url is a media:/ or system:/ URL returns the device it represents, otherwise returns device.
Definition at line 105 of file kcompactdisc.cpp.
|
signal |
New volume.
Member Data Documentation
|
protected |
Definition at line 541 of file kcompactdisc.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.