QMetaDataReaderControl Class | Qt Multimedia 5.12.7

Qt 5.12 | Qt Multimedia | C++ Classes | QMetaDataReaderControl

Qt 5.12.7 Reference Documentation

# QMetaDataReaderControl Class

The QMetaDataReaderControl class provides read access to the meta-data of a QMediaService's media. More...

Header: | #include <QMetaDataReaderControl>
qmake: | QT += multimedia
Inherits: | QMediaControl

- List of all members, including inherited members
- Obsolete members

## Public Functions

virtual | ~QMetaDataReaderControl()
virtual QStringList | availableMetaData() const = 0
virtual bool | isMetaDataAvailable() const = 0
virtual QVariant | metaData(const QString &key) const = 0

- 31 public functions inherited from QObject

## Signals

void | metaDataAvailableChanged(bool available)
void | metaDataChanged()
void | metaDataChanged(const QString &key, const QVariant &value)

- 2 signals inherited from QObject

## Static Public Members

const QMetaObject | staticMetaObject

- 9 static public members inherited from QObject

## Protected Functions

| QMetaDataReaderControl(QObject *parent = nullptr)

- 9 protected functions inherited from QObject

## Macros

| QMetaDataReaderControl_iid

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public slot inherited from QObject

## Detailed Description

The QMetaDataReaderControl class provides read access to the meta-data of a QMediaService's media.

If a QMediaService can provide read or write access to the meta-data of its current media it will implement QMetaDataReaderControl. This control provides functions for both retrieving and setting meta-data values. Meta-data may be addressed by the keys defined in the QMediaMetaData namespace.

The functionality provided by this control is exposed to application code by the meta-data members of QMediaObject, and so meta-data access is potentially available in any of the media object classes. Any media service may implement QMetaDataReaderControl.

The interface name of QMetaDataReaderControl is `org.qt-project.qt.metadatareadercontrol/5.0` as defined in QMetaDataReaderControl_iid.

See also QMediaService::requestControl() and QMediaObject.

## Member Function Documentation

### `[protected]` QMetaDataReaderControl::QMetaDataReaderControl(QObject *parent = nullptr)

Construct a QMetaDataReaderControl with parent. This class is meant as a base class for service specific meta data providers so this constructor is protected.

### `[virtual]` QMetaDataReaderControl::~QMetaDataReaderControl()

Destroy the meta-data object.

### `[pure virtual]` QStringList QMetaDataReaderControl::availableMetaData() const

Returns a list of keys there is meta-data available for.

### `[pure virtual]` bool QMetaDataReaderControl::isMetaDataAvailable() const

Identifies if meta-data is available from a media service.

Returns true if the meta-data is available and false otherwise.

### `[pure virtual]` QVariant QMetaDataReaderControl::metaData(const QString &key) const

Returns the meta-data for the given key.

### `[signal]` void QMetaDataReaderControl::metaDataAvailableChanged(bool available)

Signal the availability of meta-data has changed, available will be true if the multimedia object has meta-data.

### `[signal]` void QMetaDataReaderControl::metaDataChanged()

Signal the changes of meta-data.

If multiple meta-data elements are changed, metaDataChanged(const QString &key, const QVariant &value) signal is emitted for each of them with metaDataChanged() changed emitted once.

Note: Signal metaDataChanged is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

      connect(metaDataReaderControl, QOverload<>::of(&QMetaDataReaderControl::metaDataChanged),
          [=](){ /* ... */ });

### `[signal]` void QMetaDataReaderControl::metaDataChanged(const QString &key, const QVariant &value)

Signal the changes of one meta-data element value with the given key.

Note: Signal metaDataChanged is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

      connect(metaDataReaderControl, QOverload<const QString &, const QVariant &>::of(&QMetaDataReaderControl::metaDataChanged),
          [=](const QString &key, const QVariant &value){ /* ... */ });

## Macro Documentation

### QMetaDataReaderControl_iid

`org.qt-project.qt.metadatareadercontrol/5.0`

Defines the interface name of the QMetaDataReaderControl class.