為媒體文件提供元數據。 更多...
| 頭: |
#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, …, HasHdrContent } |
| 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 ) |
| 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 ) |
注意: 並非所有平颱都支持所有標識符。
| 公共屬性 | ||
|---|---|---|
| 值 | 描述 | 類型 |
| Title | 媒體標題。 | QString |
| Author | 媒體作者。 | QStringList |
| 注釋 | 關於媒體的用戶評論。 | QString |
| 描述 | 媒體描述。 | QString |
| Genre | 媒體流派。 | QStringList |
| Date | 媒體的日期。 | QDateTime . |
| 語言 | 媒體的語言。 | QLocale::Language |
| Publisher | 媒體齣版商。 | QString |
| Copyright | 媒體的版權聲明。 | QString |
| Url | 指嚮媒體來源的 Url。 | QUrl |
| 媒體屬性 | ||
| MediaType | 媒體的類型 (音頻、視頻、等)。 | QString |
| FileFormat | 媒體的文件格式。 | QMediaFormat::FileFormat |
| Duration | The duration in milliseconds of the media. | 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 |
| HasHdrContent | True if video is intended for HDR display (FFmpeg and Darwin media backends only). | bool |
| 音樂屬性 | ||
| AlbumTitle | 媒體所屬的專輯標題。 | QString |
| AlbumArtist | 媒體所屬專輯的親代藝術傢。 | QString |
| ContributingArtist | 媒體的貢獻藝術傢。 | QStringList |
| TrackNumber | 媒體軌道編號。 | int |
| Composer | 媒體的作麯傢。 | QStringList |
| LeadPerformer | The lead performer in the media. | QStringList |
| ThumbnailImage | An embedded thumbnail image if present in metadata. | QImage |
| CoverArtImage | 嵌入的封麵藝術圖像。 | QImage |
| 圖像和視頻屬性 | ||
| 取嚮 | The rotation angle of an image or video. | int |
| Resolution | 圖像或視頻的尺度。 | QSize |
The following meta data keys can be used:
| 常量 | 值 | 描述 |
|---|---|---|
QMediaMetaData::Title
|
0
|
Media title |
QMediaMetaData::Author
|
1
|
Media author |
QMediaMetaData::Comment
|
2
|
注釋 |
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
|
文件格式 |
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 (if embedded in metadata) |
QMediaMetaData::CoverArtImage
|
25
|
Media cover art |
QMediaMetaData::Orientation
|
26
|
|
QMediaMetaData::Resolution
|
27
|
|
QMediaMetaData::HasHdrContent (since Qt 6.8)
|
28
|
Video may have HDR content (read only, FFmpeg and Darwin media backends only) |
[invokable]
void
QMediaMetaData::
clear
()
從元數據對象移除所有數據。
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
void
QMediaMetaData::
insert
(
QMediaMetaData::Key
k
, const
QVariant
&
value
)
插入 value 進鍵: k .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
bool
QMediaMetaData::
isEmpty
() const
返迴
true
若元數據不包含項:否則返迴
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
)
返迴字符串錶示為 key ,其可以被使用當嚮用戶呈現元數據時。
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
void
QMediaMetaData::
remove
(
QMediaMetaData::Key
k
)
移除元數據從鍵: k .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
QString
QMediaMetaData::
stringValue
(
QMediaMetaData::Key
key
) const
返迴元數據為鍵 key 作為 QString .
這主要意味著是將元數據嚮用戶呈現的簡化。
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
QVariant
QMediaMetaData::
value
(
QMediaMetaData::Key
key
) const
返迴元數據值為鍵 key ,或 null QVariant 若沒有可用的鍵元數據。
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
Returns data stored at the Key k .
QMediaMetaData rockBallad1; rockBalad[QMediaMetaData::Genre]="Rock"
此變量保持元數據。
注意:
this is a
protected
member of its class.
Compares two meta data objects
a
and
b
,並返迴
false
if they are identical or
true
若它們不同。
Compares two meta data objects
a
and
b
,並返迴
true
if they are identical or
false
若它們不同。