DragonIcyMetadata Class
ICY metadata from radio streams. More...
| Header: | #include <DragonIcyMetadata> |
| CMake: | find_package(DragonMediaBackend REQUIRED COMPONENTS DragonMediaBackend)target_link_libraries(mytarget PRIVATE DragonMediaBackend::DragonMediaBackend) |
| In QML: | dragonIcyMetadata |
Properties
- isNull : const bool
- streamTitle : QString
- streamUrl : QString
Public Functions
| DragonIcyMetadata() | |
| DragonIcyMetadata(const DragonIcyMetadata &other) | |
| void | clear() |
| QHash<QString, QString> | customFields() const |
| bool | hasStreamTitle() const |
| bool | hasStreamUrl() const |
| bool | isNull() const |
| void | setCustomFields(const QHash<QString, QString> &fields) |
| void | setStreamTitle(const QString &title) |
| void | setStreamUrl(const QString &url) |
| QString | streamTitle() const |
| QString | streamUrl() const |
| bool | operator!=(const DragonIcyMetadata &other) const |
| DragonIcyMetadata & | operator=(const DragonIcyMetadata &other) |
| bool | operator==(const DragonIcyMetadata &other) const |
Detailed Description
While an internet radio stream is played, the stream interleaves ICY metadata blocks with the audio. Dragon Media Backend extracts them and reports the currently playing track through DragonPlayer::currentPlayingForRadiosChanged().
The well-known fields streamTitle and streamUrl are exposed directly, all other fields are available through customFields(). The class is implicitly shared, so copying one is cheap.
See also DragonPlayer::currentPlayingForRadiosChanged().
Property Documentation
[read-only] isNull : const bool
Whether the object was default-constructed and no metadata was set.
Access functions:
| bool | isNull() const |
streamTitle : QString
The ICY stream title, typically the artist and track name of the song currently playing. Empty when the stream did not provide one; use hasStreamTitle() to distinguish that case.
Access functions:
| QString | streamTitle() const |
| void | setStreamTitle(const QString &title) |
streamUrl : QString
The ICY stream URL, usually the stream's home page. Empty when the stream did not provide one; use hasStreamUrl() to distinguish that case.
Access functions:
| QString | streamUrl() const |
| void | setStreamUrl(const QString &url) |
Member Function Documentation
DragonIcyMetadata::DragonIcyMetadata()
Constructs a null metadata object. isNull() returns true.
DragonIcyMetadata::DragonIcyMetadata(const DragonIcyMetadata &other)
Copies other. The underlying data is implicitly shared.
void DragonIcyMetadata::clear()
Clears all metadata, making this object null.
QHash<QString, QString> DragonIcyMetadata::customFields() const
Returns all custom ICY fields the stream provided, as a mapping of field name to value.
See also setCustomFields().
bool DragonIcyMetadata::hasStreamTitle() const
Returns true if the stream provided a stream title.
bool DragonIcyMetadata::hasStreamUrl() const
Returns true if the stream provided a stream URL.
bool DragonIcyMetadata::isNull() const
Returns true if this object was default-constructed and no metadata was set.
Note: Getter function for property isNull.
void DragonIcyMetadata::setCustomFields(const QHash<QString, QString> &fields)
Replaces the custom ICY fields with fields.
See also customFields().
void DragonIcyMetadata::setStreamTitle(const QString &title)
Sets the ICY stream title to title.
Note: Setter function for property streamTitle.
See also streamTitle().
void DragonIcyMetadata::setStreamUrl(const QString &url)
Sets the ICY stream URL to url.
Note: Setter function for property streamUrl.
See also streamUrl().
QString DragonIcyMetadata::streamTitle() const
Returns the ICY stream title, typically the artist and track name of the song currently playing.
Returns an empty string if the stream did not provide a title; use hasStreamTitle() to distinguish that case.
Note: Getter function for property streamTitle.
See also setStreamTitle().
QString DragonIcyMetadata::streamUrl() const
Returns the ICY stream URL, usually the stream's home page.
Returns an empty string if the stream did not provide a URL; use hasStreamUrl() to distinguish that case.
Note: Getter function for property streamUrl.
See also setStreamUrl().
bool DragonIcyMetadata::operator!=(const DragonIcyMetadata &other) const
Returns true if other holds different metadata.
DragonIcyMetadata &DragonIcyMetadata::operator=(const DragonIcyMetadata &other)
Assigns other to this object. The underlying data is implicitly shared.
bool DragonIcyMetadata::operator==(const DragonIcyMetadata &other) const
Returns true if other holds the same metadata.