CopperSpice API  1.7.2
QAudioDecoderControl Class Referenceabstract

The QAudioDecoderControl class provides access to the audio decoding functionality of a QMediaService. More...

Inheritance diagram for QAudioDecoderControl:
QMediaControl QObject

Public Signals

void bufferAvailableChanged (bool available)
 
void bufferReady ()
 
void durationChanged (qint64 duration)
 
void error (int error, const QString &errorString)
 
void finished ()
 
void formatChanged (const QAudioFormat &format)
 
void positionChanged (qint64 position)
 
void sourceChanged ()
 
void stateChanged (QAudioDecoder::State newState)
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 

Public Methods

 ~QAudioDecoderControl ()
 
virtual QAudioFormat audioFormat () const = 0
 
virtual bool bufferAvailable () const = 0
 
virtual qint64 duration () const = 0
 
virtual qint64 position () const = 0
 
virtual QAudioBuffer read () = 0
 
virtual void setAudioFormat (const QAudioFormat &format) = 0
 
virtual void setSourceDevice (QIODevice *device) = 0
 
virtual void setSourceFilename (const QString &fileName) = 0
 
virtual QIODevicesourceDevice () const = 0
 
virtual QString sourceFilename () const = 0
 
virtual void start () = 0
 
virtual QAudioDecoder::State state () const = 0
 
virtual void stop () = 0
 
- Public Methods inherited from QMediaControl
 ~QMediaControl ()
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &objName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 

Protected Methods

 QAudioDecoderControl (QObject *parent=nullptr)
 
- Protected Methods inherited from QMediaControl
 QMediaControl (QObject *parent=nullptr)
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Related Functions

These are not member functions

 QAudioDecoderControl_iid
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The functionality provided by this control is exposed to application code through the QAudioDecoder class.

The interface name of QAudioDecoderControl is "com.copperspice.CS.audioDecoderControl/1.0" as defined in QAudioDecoderControl_iid.

See also
QMediaService::requestControl(), QAudioDecoder

Constructor & Destructor Documentation

QAudioDecoderControl::~QAudioDecoderControl ( )

Destroys an audio decoder control.

QAudioDecoderControl::QAudioDecoderControl ( QObject parent = nullptr)
explicitprotected

Constructs a new audio decoder control with the given parent.

Method Documentation

QAudioFormat QAudioDecoderControl::audioFormat ( ) const
pure virtual

Returns the current audio format of the decoded stream. Any buffers returned should have this format.

See also
setAudioFormat(), formatChanged()
bool QAudioDecoderControl::bufferAvailable ( ) const
pure virtual

Returns true if a buffer is available to be read, and false otherwise.

void QAudioDecoderControl::bufferAvailableChanged ( bool  available)
signal

Signals that the bufferAvailable property has changed to available.

void QAudioDecoderControl::bufferReady ( )
signal

Signals that a new buffer is ready for reading.

qint64 QAudioDecoderControl::duration ( ) const
pure virtual

Returns total duration (in milliseconds) of the audio stream or -1 if not available.

void QAudioDecoderControl::durationChanged ( qint64  duration)
signal

Signals that the estimated duration of the decoded data has changed.

See also
positionChanged()
void QAudioDecoderControl::error ( int  error,
const QString errorString 
)
signal

Signals that an error has occurred. The errorString provides a more detailed explanation.

void QAudioDecoderControl::finished ( )
signal

Signals that the decoding has finished successfully. If decoding fails, error signal is emitted instead.

See also
start(), stop(), error()
void QAudioDecoderControl::formatChanged ( const QAudioFormat format)
signal

Signals that the current audio format of the decoder has changed to format.

See also
audioFormat(), setAudioFormat()
qint64 QAudioDecoderControl::position ( ) const
pure virtual

Returns position (in milliseconds) of the last buffer read from the decoder or -1 if no buffers have been read.

void QAudioDecoderControl::positionChanged ( qint64  position)
signal

Signals that the current position of the decoder has changed.

See also
durationChanged()
QAudioBuffer QAudioDecoderControl::read ( )
pure virtual

Attempts to read a buffer from the decoder, without blocking. Returns invalid buffer if there are no decoded buffers available, or on error.

void QAudioDecoderControl::setAudioFormat ( const QAudioFormat format)
pure virtual

Set the desired audio format for decoded samples to format. If the decoder does not support this format, error() will be set to FormatError.

If you do not specify a format, the format of the decoded audio itself will be used. Otherwise, some format conversion will be applied.

If you wish to reset the decoded format to that of the original audio file, you can specify an invalid format.

void QAudioDecoderControl::setSourceDevice ( QIODevice device)
pure virtual

Sets the current source to device. Changing the source will stop any current decoding and discard any buffers.

Sources are exclusive, so only one can be set.

void QAudioDecoderControl::setSourceFilename ( const QString fileName)
pure virtual

Sets the current source to fileName. Changing the source will stop any current decoding and discard any buffers. Sources are exclusive, so only one can be set.

void QAudioDecoderControl::sourceChanged ( )
signal

Signals that the current source of the decoder has changed.

See also
sourceFilename(), sourceDevice()
QIODevice * QAudioDecoderControl::sourceDevice ( ) const
pure virtual

Returns the current media source QIODevice, or 0 if none (or a file).

QString QAudioDecoderControl::sourceFilename ( ) const
pure virtual

Returns the current media source filename, or a null QString if none (or a device)

void QAudioDecoderControl::start ( )
pure virtual

Starts decoding the current media. If successful the player control will immediately enter the QAudioDecoder::DecodingState state.

See also
state(), read()
QAudioDecoder::State QAudioDecoderControl::state ( ) const
pure virtual

Returns the state of a player control.

void QAudioDecoderControl::stateChanged ( QAudioDecoder::State  state)
signal

Signals that the state of a player control has changed.

See also
state()
void QAudioDecoderControl::stop ( )
pure virtual

Stops playback of the current media and discards any buffers.

If successful the player control will immediately enter the QAudioDecoder::StoppedState state.

Friends And Related Function Documentation

QAudioDecoderControl_iid ( )
related

Defines the interface name of the QAudioDecoderControl class to "com.copperspice.CS.audioDecoderControl/1.0".