QMediaMetaData Class

Provides meta-data for media files. 更多...

頭: #include <QMediaMetaData>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia

公共類型

enum Key { Title, Author, Comment, Description, Genre, …, Resolution }

公共函數

void clear ()
void insert (QMediaMetaData::Key k , const QVariant & value )
bool isEmpty () const
QList<QMediaMetaData::Key> keys () const
void remove (QMediaMetaData::Key k )
QString stringValue (QMediaMetaData::Key key ) const
QVariant value (QMediaMetaData::Key key ) const
QVariant & operator[] (QMediaMetaData::Key k )

靜態公共成員

QString metaDataKeyToString (QMediaMetaData::Key key )

Protected Variables

QHash<QMediaMetaData::Key, QVariant> data

靜態保護成員

QMetaType keyType (QMediaMetaData::Key key )
bool operator!= (const QMediaMetaData & a , const QMediaMetaData & b )
bool operator== (const QMediaMetaData & a , const QMediaMetaData & b )

詳細描述

注意: Not all identifiers are supported on all platforms.

公共屬性
描述 類型
Title 媒體標題。 QString
Author 媒體作者。 QStringList
Comment 關於媒體的用戶評論。 QString
Description 媒體描述。 QString
Genre 媒體流派。 QStringList
Date 媒體的日期。 QDateTime .
Language The language of media. QLocale::Language
Publisher 媒體齣版商。 QString
Copyright 媒體的版權聲明。 QString
Url A Url pointing to the origin of the media. QUrl
媒體屬性
MediaType 媒體的類型 (音頻、視頻、等)。 QString
FileFormat The file format of the media. QMediaFormat::FileFormat
Duration 媒體的持續時間 (以毫秒為單位)。 qint64
音頻屬性
AudioBitRate 媒體音頻流的比特率 (以位每秒為單位)。 int
AudioCodec 媒體音頻流的編解碼器。 QMediaFormat::AudioCodec
視頻屬性
VideoFrameRate 媒體視頻流的幀速率。 qreal
VideoBitRate The bit rate of the media's video stream in bits per second. int
VideoCodec The codec of the media's video stream. QMediaFormat::VideoCodec
音樂屬性
AlbumTitle 媒體所屬的專輯標題。 QString
AlbumArtist 媒體所屬專輯的親代藝術傢。 QString
ContributingArtist 媒體的貢獻藝術傢。 QStringList
TrackNumber 媒體軌道編號。 int
Composer 媒體的作麯傢。 QStringList
LeadPerformer The lead performer in the media. QStringList
ThumbnailImage 嵌入縮略圖圖像。 QImage
CoverArtImage 嵌入的封麵藝術圖像。 QImage
圖像和視頻屬性
Orientation The rotation angle of an image or video. int
Resolution 圖像或視頻的尺度。 QSize

成員類型文檔編製

enum QMediaMetaData:: Key

The following meta data keys can be used:

常量 描述
QMediaMetaData::Title 0 Media title
QMediaMetaData::Author 1 Media author
QMediaMetaData::Comment 2 Comment
QMediaMetaData::Description 3 Brief desripttion
QMediaMetaData::Genre 4 Genre the media belongs to
QMediaMetaData::Date 5 Creation date
QMediaMetaData::Language 6 Media language
QMediaMetaData::Publisher 7 Media publisher info.
QMediaMetaData::Copyright 8 Media copyright info.
QMediaMetaData::Url 9 Publisher's website URL
QMediaMetaData::Duration 10 Media playback duration
QMediaMetaData::MediaType 11 Type of the media
QMediaMetaData::FileFormat 12 File format
QMediaMetaData::AudioBitRate 13
QMediaMetaData::AudioCodec 14
QMediaMetaData::VideoBitRate 15
QMediaMetaData::VideoCodec 16
QMediaMetaData::VideoFrameRate 17
QMediaMetaData::AlbumTitle 18 Album's title
QMediaMetaData::AlbumArtist 19 Artist's info.
QMediaMetaData::ContributingArtist 20
QMediaMetaData::TrackNumber 21
QMediaMetaData::Composer 22 Media composer's info.
QMediaMetaData::LeadPerformer 23
QMediaMetaData::ThumbnailImage 24 Media thumbnail image
QMediaMetaData::CoverArtImage 25 Media cover art
QMediaMetaData::Orientation 26
QMediaMetaData::Resolution 27

成員函數文檔編製

[invokable] void QMediaMetaData:: clear ()

Removes all data from the meta data object.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[invokable] void QMediaMetaData:: insert ( QMediaMetaData::Key k , const QVariant & value )

插入 value into a Key: k .

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[invokable] bool QMediaMetaData:: isEmpty () const

返迴 true if the meta data contains no items: otherwise returns false .

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[static protected] QMetaType QMediaMetaData:: keyType ( QMediaMetaData::Key key )

Returns the meta type used to store data for Key key .

[invokable] QList < QMediaMetaData::Key > QMediaMetaData:: keys () const

返迴 QList of QMediaMetaData::Keys.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[static invokable] QString QMediaMetaData:: metaDataKeyToString ( QMediaMetaData::Key key )

returns a string representation of key that can be used when presenting meta data to users.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[invokable] void QMediaMetaData:: remove ( QMediaMetaData::Key k )

Removes meta data from a Key: k .

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[invokable] QString QMediaMetaData:: stringValue ( QMediaMetaData::Key key ) const

Returns the meta data for key key 作為 QString .

This is mainly meant to simplify presenting the meta data to a user.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[invokable] QVariant QMediaMetaData:: value ( QMediaMetaData::Key key ) const

Returns the meta data value for Key key ,或 null QVariant if no meta data for the key is available.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

QVariant &QMediaMetaData:: operator[] ( QMediaMetaData::Key k )

Returns data stored at the Key k .

QMediaMetaData rockBallad1;
rockBalad[QMediaMetaData::Genre]="Rock"
					

成員變量文檔編製

QHash < QMediaMetaData::Key , QVariant > QMediaMetaData:: data

This variable holds the meta data.

注意: this is a protected member of its class.

相關非成員

bool operator!= (const QMediaMetaData & a , const QMediaMetaData & b )

Compares two meta data objects a and b ,並返迴 false if they are identical or true 若它們不同。

bool operator== (const QMediaMetaData & a , const QMediaMetaData & b )

Compares two meta data objects a and b ,並返迴 true if they are identical or false 若它們不同。