KCompactDisc

#include <kcompactdisc.h>

Inheritance diagram for KCompactDisc:

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 }
 

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 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 ()
 

Public Member Functions

 KCompactDisc (InformationMode=KCompactDisc::Synchronous)
 
const QStringdeviceModel ()
 
const QStringdeviceName ()
 
const QStringdeviceRevision ()
 
const QUrl deviceUrl ()
 
const QStringdeviceVendor ()
 
const QStringdiscArtist ()
 
unsigned discId ()
 
unsigned discLength ()
 
unsigned discPosition ()
 
const QList< unsigned > & discSignature ()
 
KCompactDisc::DiscStatus discStatus ()
 
QString discStatusString (KCompactDisc::DiscStatus status)
 
const QStringdiscTitle ()
 
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)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static const QStringList audioSystems ()
 
static const QStringList cdromDeviceNames ()
 
static const QString cdromDeviceUdi (const QString &)
 
static const QUrl cdromDeviceUrl (const QString &)
 
static const QString defaultCdromDeviceName ()
 
static const QString defaultCdromDeviceUdi ()
 
static const QUrl defaultCdromDeviceUrl ()
 
static QString urlToDevice (const QUrl &url)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction 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
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

KCompactDiscPrivate * d_ptr
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

KCompactDisc - A CD drive interface for the KDE Project.

The disc interface is modelled by these slots:

See also
playTrack(unsigned int track): Play specified track.
playPosition(unsigned int position): seek to specified position.
next(): Play next track in the playlist.
prev(): Play previous track in the playlist.
pause(): Toggle between pause/resume.
stop(): 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 int position): A position in a track.
playoutTrackChanged(unsigned int 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.
discStatusString(KCompactDisc::Playing): A disc started playout.
discStatusString(KCompactDisc::Paused): A disc was paused.
discStatusString(KCompactDisc::Stopped): The disc stopped.
discStatusString(KCompactDisc::NoDisc): The disc is removed. No disc in tray or data disc.
discStatusString(KCompactDisc::NotReady): The disc is present. But playout is not possible.
discInformation(KCompactDisc::DiscInfo info): A content for disc information is arrived.

The volume control is modelled by these slots:

See also
setVolume(unsigned int volume): A new volume value.
setBalance(unsigned int balance): A new balance value.

And these signals:

See also
volumeChanged(unsigned int volume): A current volume value.
balanceChanged(unsigned int balance): 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 86 of file kcompactdisc.h.

Member Function Documentation

const QStringList KCompactDisc::audioSystems ( )
static

All installed audio backends.

Definition at line 130 of file kcompactdisc.cpp.

void KCompactDisc::balanceChanged ( unsigned int  balance)
signal

New balance.

const QStringList KCompactDisc::cdromDeviceNames ( )
static

All present CDROM devices.

Definition at line 145 of file kcompactdisc.cpp.

const QString KCompactDisc::cdromDeviceUdi ( const QString cdromDeviceName)
static

The Udi of named CDROM device for this system.

Definition at line 189 of file kcompactdisc.cpp.

const QUrl KCompactDisc::cdromDeviceUrl ( const QString cdromDeviceName)
static

The Url of named CDROM device for this system.

Definition at line 164 of file kcompactdisc.cpp.

const QString KCompactDisc::defaultCdromDeviceName ( )
static

The default CDROM device for this system.

Definition at line 150 of file kcompactdisc.cpp.

const QString KCompactDisc::defaultCdromDeviceUdi ( )
static

The Udi of default CDROM device for this system.

Definition at line 182 of file kcompactdisc.cpp.

const QUrl KCompactDisc::defaultCdromDeviceUrl ( )
static

The Url of default CDROM device for this system.

Definition at line 157 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 213 of file kcompactdisc.cpp.

const QString & KCompactDisc::deviceName ( )

Current CDROM device.

Returns
Null string if no usable device set.

Definition at line 225 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 219 of file kcompactdisc.cpp.

const QUrl KCompactDisc::deviceUrl ( )

Current device as QUrl.

Definition at line 231 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 207 of file kcompactdisc.cpp.

const QString & KCompactDisc::discArtist ( )

Artist for whole disc.

Returns
Disc artist or null string.

Definition at line 249 of file kcompactdisc.cpp.

void KCompactDisc::discChanged ( unsigned int  tracks)
signal

A new Disc is inserted.

unsigned KCompactDisc::discId ( )

Current disc, 0 if no disc or impossible to calculate id.

Definition at line 237 of file kcompactdisc.cpp.

void KCompactDisc::discInformation ( KCompactDisc::DiscInfo  info)
signal

A new Disc information is arrived.

unsigned KCompactDisc::discLength ( )

Known length of disc.

Returns
Disc length in seconds.

Definition at line 265 of file kcompactdisc.cpp.

unsigned KCompactDisc::discPosition ( )

Current position on the disc.

Returns
Position in seconds.

Definition at line 273 of file kcompactdisc.cpp.

const QList< unsigned > & KCompactDisc::discSignature ( )

CDDB signature of disc, empty if no disc or not possible to deliver.

Definition at line 243 of file kcompactdisc.cpp.

KCompactDisc::DiscStatus KCompactDisc::discStatus ( )

Current status.

Returns
Current status.

Definition at line 279 of file kcompactdisc.cpp.

void KCompactDisc::discStatusChanged ( KCompactDisc::DiscStatus  status)
signal

A Disc status changed.

QString KCompactDisc::discStatusString ( KCompactDisc::DiscStatus  status)

Status as string.

Returns
Status as QString.

Definition at line 285 of file kcompactdisc.cpp.

const QString & KCompactDisc::discTitle ( )

Title of disc.

Returns
Disc title or null string.

Definition at line 257 of file kcompactdisc.cpp.

void KCompactDisc::doCommand ( KCompactDisc::DiscCommand  cmd)
slot

Pipe GUI command.

Definition at line 438 of file kcompactdisc.cpp.

void KCompactDisc::eject ( )
slot

Open/close tray.

Definition at line 423 of file kcompactdisc.cpp.

bool KCompactDisc::isAudio ( unsigned  track)
Returns
if the track is actually an audio track.

Definition at line 368 of file kcompactdisc.cpp.

bool KCompactDisc::isNoDisc ( )

Is status no disc.

Definition at line 362 of file kcompactdisc.cpp.

bool KCompactDisc::isPaused ( )

Is status pausing.

Definition at line 356 of file kcompactdisc.cpp.

bool KCompactDisc::isPlaying ( )

Is status playing.

Definition at line 350 of file kcompactdisc.cpp.

void KCompactDisc::loop ( )
slot

Switch endless playout on/off.

Definition at line 428 of file kcompactdisc.cpp.

void KCompactDisc::next ( )
slot

Start playout of next track.

Definition at line 403 of file kcompactdisc.cpp.

void KCompactDisc::pause ( )
slot

Pause/resume playout.

Definition at line 413 of file kcompactdisc.cpp.

void KCompactDisc::play ( )
slot

Start playout.

Definition at line 398 of file kcompactdisc.cpp.

void KCompactDisc::playoutPositionChanged ( unsigned int  position)
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
positionPosition within track in seconds.
void KCompactDisc::playoutTrackChanged ( unsigned int  track)
signal

A new track is started.

Parameters
trackTrack number.
void KCompactDisc::playPosition ( unsigned int  position)
slot

Start playout or seek to given position of track.

Definition at line 387 of file kcompactdisc.cpp.

void KCompactDisc::playTrack ( unsigned int  track)
slot

Start playout of track.

Definition at line 376 of file kcompactdisc.cpp.

void KCompactDisc::prev ( )
slot

Start playout of previous track.

Definition at line 408 of file kcompactdisc.cpp.

void KCompactDisc::random ( )
slot

Switch random playout on/off.

Definition at line 433 of file kcompactdisc.cpp.

void KCompactDisc::setBalance ( unsigned int  balance)
slot

Set balance.

Definition at line 552 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
deviceName of CD device, e.g. /dev/cdrom.
volumePlayback volume.
digitalPlaybackSelect digital or analog playback.
audioSystemFor digital playback, system to use, e.g. "phonon".
audioDeviceFor digital playback, device to use.
Returns
true if the device seemed usable.

Definition at line 529 of file kcompactdisc.cpp.

void KCompactDisc::setVolume ( unsigned int  volume)
slot

Set volume.

Definition at line 545 of file kcompactdisc.cpp.

void KCompactDisc::stop ( )
slot

Stop playout.

Definition at line 418 of file kcompactdisc.cpp.

unsigned KCompactDisc::track ( )

Current track.

Returns
Track number.

Definition at line 332 of file kcompactdisc.cpp.

QString KCompactDisc::trackArtist ( )

Artist of current track.

Returns
Track artist or null string.

Definition at line 290 of file kcompactdisc.cpp.

QString KCompactDisc::trackArtist ( unsigned  track)

Artist of given track.

Returns
Track artist or null string.

Definition at line 296 of file kcompactdisc.cpp.

unsigned KCompactDisc::trackLength ( )

Length of current track.

Returns
Track length in seconds.

Definition at line 318 of file kcompactdisc.cpp.

unsigned KCompactDisc::trackLength ( unsigned  track)

Length of given track.

Parameters
trackTrack number.
Returns
Track length in seconds.

Definition at line 324 of file kcompactdisc.cpp.

unsigned KCompactDisc::trackPosition ( )

Current track position.

Returns
Track position in seconds.

Definition at line 338 of file kcompactdisc.cpp.

unsigned KCompactDisc::tracks ( )

Number of tracks.

Definition at line 344 of file kcompactdisc.cpp.

QString KCompactDisc::trackTitle ( )

Title of current track.

Returns
Track title or null string.

Definition at line 304 of file kcompactdisc.cpp.

QString KCompactDisc::trackTitle ( unsigned  track)

Title of given track.

Returns
Track title or null string.

Definition at line 310 of file kcompactdisc.cpp.

QString KCompactDisc::urlToDevice ( const QUrl url)
static

If the url is a media:/ or system:/ URL returns the device it represents, otherwise returns device.

Definition at line 107 of file kcompactdisc.cpp.

void KCompactDisc::volumeChanged ( unsigned int  volume)
signal

New volume.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 23:26:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.