KCompactDisc

Search for usage in LXR

#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 }
 
- Public Types inherited from QObject
typedef  QObjectList
 

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)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 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
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, 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 *context, Functor functor, 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)
 
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, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (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
 

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 Enumeration Documentation

◆ DiscCommand

enum KCompactDisc::DiscCommand

Definition at line 127 of file kcompactdisc.h.

◆ DiscInfo

enum KCompactDisc::DiscInfo

Definition at line 150 of file kcompactdisc.h.

◆ DiscStatus

enum KCompactDisc::DiscStatus

Definition at line 139 of file kcompactdisc.h.

◆ InformationMode

enum KCompactDisc::InformationMode

Definition at line 121 of file kcompactdisc.h.

Constructor & Destructor Documentation

◆ KCompactDisc()

KCompactDisc::KCompactDisc ( InformationMode infoMode = KCompactDisc::Synchronous)
explicit

Definition at line 194 of file kcompactdisc.cpp.

◆ ~KCompactDisc()

KCompactDisc::~KCompactDisc ( )
override

Definition at line 201 of file kcompactdisc.cpp.

Member Function Documentation

◆ audioSystems()

const QStringList KCompactDisc::audioSystems ( )
static

All installed audio backends.

Definition at line 130 of file kcompactdisc.cpp.

◆ balanceChanged

void KCompactDisc::balanceChanged ( unsigned int balance)
signal

New balance.

◆ cdromDeviceNames()

const QStringList KCompactDisc::cdromDeviceNames ( )
static

All present CDROM devices.

Definition at line 145 of file kcompactdisc.cpp.

◆ cdromDeviceUdi()

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.

◆ cdromDeviceUrl()

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.

◆ defaultCdromDeviceName()

const QString KCompactDisc::defaultCdromDeviceName ( )
static

The default CDROM device for this system.

Definition at line 150 of file kcompactdisc.cpp.

◆ defaultCdromDeviceUdi()

const QString KCompactDisc::defaultCdromDeviceUdi ( )
static

The Udi of default CDROM device for this system.

Definition at line 182 of file kcompactdisc.cpp.

◆ defaultCdromDeviceUrl()

const QUrl KCompactDisc::defaultCdromDeviceUrl ( )
static

The Url of default CDROM device for this system.

Definition at line 157 of file kcompactdisc.cpp.

◆ deviceModel()

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.

◆ deviceName()

const QString & KCompactDisc::deviceName ( )

Current CDROM device.

Returns
Null string if no usable device set.

Definition at line 225 of file kcompactdisc.cpp.

◆ deviceRevision()

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.

◆ deviceUrl()

const QUrl KCompactDisc::deviceUrl ( )

Current device as QUrl.

Definition at line 231 of file kcompactdisc.cpp.

◆ deviceVendor()

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.

◆ discArtist()

const QString & KCompactDisc::discArtist ( )

Artist for whole disc.

Returns
Disc artist or null string.

Definition at line 249 of file kcompactdisc.cpp.

◆ discChanged

void KCompactDisc::discChanged ( unsigned int tracks)
signal

A new Disc is inserted.

◆ discId()

unsigned KCompactDisc::discId ( )

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

Definition at line 237 of file kcompactdisc.cpp.

◆ discInformation

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

A new Disc information is arrived.

◆ discLength()

unsigned KCompactDisc::discLength ( )

Known length of disc.

Returns
Disc length in seconds.

Definition at line 265 of file kcompactdisc.cpp.

◆ discPosition()

unsigned KCompactDisc::discPosition ( )

Current position on the disc.

Returns
Position in seconds.

Definition at line 273 of file kcompactdisc.cpp.

◆ discSignature()

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.

◆ discStatus()

KCompactDisc::DiscStatus KCompactDisc::discStatus ( )

Current status.

Returns
Current status.

Definition at line 279 of file kcompactdisc.cpp.

◆ discStatusChanged

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

A Disc status changed.

◆ discStatusString()

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

Status as string.

Returns
Status as QString.

Definition at line 285 of file kcompactdisc.cpp.

◆ discTitle()

const QString & KCompactDisc::discTitle ( )

Title of disc.

Returns
Disc title or null string.

Definition at line 257 of file kcompactdisc.cpp.

◆ doCommand

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

Pipe GUI command.

Definition at line 438 of file kcompactdisc.cpp.

◆ eject

void KCompactDisc::eject ( )
slot

Open/close tray.

Definition at line 423 of file kcompactdisc.cpp.

◆ isAudio()

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

Definition at line 368 of file kcompactdisc.cpp.

◆ isNoDisc()

bool KCompactDisc::isNoDisc ( )

Is status no disc.

Definition at line 362 of file kcompactdisc.cpp.

◆ isPaused()

bool KCompactDisc::isPaused ( )

Is status pausing.

Definition at line 356 of file kcompactdisc.cpp.

◆ isPlaying()

bool KCompactDisc::isPlaying ( )

Is status playing.

Definition at line 350 of file kcompactdisc.cpp.

◆ loop

void KCompactDisc::loop ( )
slot

Switch endless playout on/off.

Definition at line 428 of file kcompactdisc.cpp.

◆ metadataLookup

void KCompactDisc::metadataLookup ( )
slot

Definition at line 500 of file kcompactdisc.cpp.

◆ next

void KCompactDisc::next ( )
slot

Start playout of next track.

Definition at line 403 of file kcompactdisc.cpp.

◆ pause

void KCompactDisc::pause ( )
slot

Pause/resume playout.

Definition at line 413 of file kcompactdisc.cpp.

◆ play

void KCompactDisc::play ( )
slot

Start playout.

Definition at line 398 of file kcompactdisc.cpp.

◆ playoutPositionChanged

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.

◆ playoutTrackChanged

void KCompactDisc::playoutTrackChanged ( unsigned int track)
signal

A new track is started.

Parameters
trackTrack number.

◆ playPosition

void KCompactDisc::playPosition ( unsigned int position)
slot

Start playout or seek to given position of track.

Definition at line 387 of file kcompactdisc.cpp.

◆ playTrack

void KCompactDisc::playTrack ( unsigned int track)
slot

Start playout of track.

Definition at line 376 of file kcompactdisc.cpp.

◆ prev

void KCompactDisc::prev ( )
slot

Start playout of previous track.

Definition at line 408 of file kcompactdisc.cpp.

◆ random

void KCompactDisc::random ( )
slot

Switch random playout on/off.

Definition at line 433 of file kcompactdisc.cpp.

◆ setAutoMetadataLookup

void KCompactDisc::setAutoMetadataLookup ( bool autoMetadata)
slot

Definition at line 521 of file kcompactdisc.cpp.

◆ setBalance

void KCompactDisc::setBalance ( unsigned int balance)
slot

Set balance.

Definition at line 552 of file kcompactdisc.cpp.

◆ setDevice()

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.

◆ setLoopPlaylist

void KCompactDisc::setLoopPlaylist ( bool loop)
slot

Definition at line 514 of file kcompactdisc.cpp.

◆ setRandomPlaylist

void KCompactDisc::setRandomPlaylist ( bool random)
slot

Definition at line 506 of file kcompactdisc.cpp.

◆ setVolume

void KCompactDisc::setVolume ( unsigned int volume)
slot

Set volume.

Definition at line 545 of file kcompactdisc.cpp.

◆ stop

void KCompactDisc::stop ( )
slot

Stop playout.

Definition at line 418 of file kcompactdisc.cpp.

◆ track()

unsigned KCompactDisc::track ( )

Current track.

Returns
Track number.

Definition at line 332 of file kcompactdisc.cpp.

◆ trackArtist() [1/2]

QString KCompactDisc::trackArtist ( )

Artist of current track.

Returns
Track artist or null string.

Definition at line 290 of file kcompactdisc.cpp.

◆ trackArtist() [2/2]

QString KCompactDisc::trackArtist ( unsigned track)

Artist of given track.

Returns
Track artist or null string.

Definition at line 296 of file kcompactdisc.cpp.

◆ trackLength() [1/2]

unsigned KCompactDisc::trackLength ( )

Length of current track.

Returns
Track length in seconds.

Definition at line 318 of file kcompactdisc.cpp.

◆ trackLength() [2/2]

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.

◆ trackPosition()

unsigned KCompactDisc::trackPosition ( )

Current track position.

Returns
Track position in seconds.

Definition at line 338 of file kcompactdisc.cpp.

◆ tracks()

unsigned KCompactDisc::tracks ( )

Number of tracks.

Definition at line 344 of file kcompactdisc.cpp.

◆ trackTitle() [1/2]

QString KCompactDisc::trackTitle ( )

Title of current track.

Returns
Track title or null string.

Definition at line 304 of file kcompactdisc.cpp.

◆ trackTitle() [2/2]

QString KCompactDisc::trackTitle ( unsigned track)

Title of given track.

Returns
Track title or null string.

Definition at line 310 of file kcompactdisc.cpp.

◆ urlToDevice()

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.

◆ volumeChanged

void KCompactDisc::volumeChanged ( unsigned int volume)
signal

New volume.

Member Data Documentation

◆ d_ptr

KCompactDiscPrivate* KCompactDisc::d_ptr
protected

Definition at line 526 of file kcompactdisc.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.