TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Types | Public Member Functions | Private Attributes | List of all members
TrackInfo Class Reference

The TrackInfo class stores metadata and other information about track. More...

#include <trackinfo.h>

Public Types

enum  Part { MetaData = 0x1, Properties = 0x2, ReplayGainInfo = 0x4, AllParts = MetaData | Properties | ReplayGainInfo }
 

Public Member Functions

 TrackInfo ()=default
 
 TrackInfo (const QString &path)
 
 TrackInfo (const TrackInfo &other)
 
TrackInfooperator= (const TrackInfo &info)
 
bool operator== (const TrackInfo &info) const
 
bool operator!= (const TrackInfo &info) const
 
qint64 duration () const
 
bool isEmpty () const
 
const QString & path () const
 
const QString value (Qmmp::MetaData key) const
 
const QString value (Qmmp::TrackProperty key) const
 
double value (Qmmp::ReplayGainKey key) const
 
const QMap< Qmmp::MetaData, QString > & metaData () const
 
const QMap< Qmmp::TrackProperty, QString > & properties () const
 
const QMap< Qmmp::ReplayGainKey, double > & replayGainInfo () const
 
Parts parts () const
 
void setDuration (qint64 duration)
 
void setValue (Qmmp::MetaData key, const QVariant &value)
 
void setValue (Qmmp::TrackProperty key, const QVariant &value)
 
void setValue (Qmmp::ReplayGainKey key, double value)
 
void setValue (Qmmp::ReplayGainKey key, const QString &value)
 
void setValues (const QMap< Qmmp::MetaData, QString > &metaData)
 
void setValues (const QMap< Qmmp::TrackProperty, QString > &properties)
 
void setValues (const QMap< Qmmp::ReplayGainKey, double > &replayGainInfo)
 
void updateValues (const QMap< Qmmp::MetaData, QString > &metaData)
 
void updateValues (const QMap< Qmmp::TrackProperty, QString > &properties)
 
void updateValues (const QMap< Qmmp::ReplayGainKey, double > &replayGainInfo)
 
void setPath (const QString &path)
 
void clear (Parts parts)
 
void clear ()
 

Private Attributes

QMap< Qmmp::MetaData, QString > m_metaData
 
QMap< Qmmp::TrackProperty, QString > m_properties
 
QMap< Qmmp::ReplayGainKey, double > m_replayGainInfo
 
Parts m_parts = Parts()
 
QString m_path
 
qint64 m_duration = 0
 

Detailed Description

The TrackInfo class stores metadata and other information about track.

Author
Ilya Kotov forko.nosp@m.tov0.nosp@m.2@ya..nosp@m.ru

Definition at line 32 of file trackinfo.h.

Member Enumeration Documentation

This enum describes stored parts of track information.

Enumerator
MetaData 

Metadata (artist, album, etc).

Properties 

File/Stream properties.

ReplayGainInfo 

ReplayGain information.

AllParts 

All parts.

Definition at line 51 of file trackinfo.h.

Constructor & Destructor Documentation

TrackInfo::TrackInfo ( )
default

Constructs a new empty TrackInfo object.

TrackInfo::TrackInfo ( const QString &  path)
explicit

Constructs a new empty TrackInfo that with file path (local path or URL).

TrackInfo::TrackInfo ( const TrackInfo other)

Constructs a new TrackInfo that is a copy of the given other

Member Function Documentation

void TrackInfo::clear ( Parts  parts)

Removes specified parts parts of the stored track information.

void TrackInfo::clear ( )

Removes all track information including path.

qint64 TrackInfo::duration ( ) const

Returnds file duration in milliseconds.

bool TrackInfo::isEmpty ( ) const

Returns true if stream/file has no infomation and empty path, otherwise returns false.

const QMap<Qmmp::MetaData, QString>& TrackInfo::metaData ( ) const

Returns the track metadata map.

bool TrackInfo::operator!= ( const TrackInfo info) const

Returns false if this FileInfo object refers to info; otherwise returns true.

TrackInfo& TrackInfo::operator= ( const TrackInfo info)

Makes a copy of the given info

bool TrackInfo::operator== ( const TrackInfo info) const

Returns true if this FileInfo object refers to info; otherwise returns false.

Parts TrackInfo::parts ( ) const

Returns parts of the stored track information.

const QString& TrackInfo::path ( ) const

Returns file path or stream URL.

Referenced by MusicMPRISPlayerCore::metadata().

const QMap<Qmmp::TrackProperty, QString>& TrackInfo::properties ( ) const

Returns the track property map.

Referenced by MusicQualityWidget::updateQuality().

const QMap<Qmmp::ReplayGainKey, double>& TrackInfo::replayGainInfo ( ) const

Returns the ReplayGain information.

void TrackInfo::setDuration ( qint64  duration)

Sets file duration to duration in milliseconds.

void TrackInfo::setPath ( const QString &  path)

Sets file path or stream URL to path.

void TrackInfo::setValue ( Qmmp::MetaData  key,
const QVariant &  value 
)

Sets metadata key to value.

void TrackInfo::setValue ( Qmmp::TrackProperty  key,
const QVariant &  value 
)

Sets track property key to value.

void TrackInfo::setValue ( Qmmp::ReplayGainKey  key,
double  value 
)

Sets ReplayGain value key to value.

void TrackInfo::setValue ( Qmmp::ReplayGainKey  key,
const QString &  value 
)

Sets ReplayGain value key to value (string is converted to double).

void TrackInfo::setValues ( const QMap< Qmmp::MetaData, QString > &  metaData)

Sets metadata to metaData.

void TrackInfo::setValues ( const QMap< Qmmp::TrackProperty, QString > &  properties)

Sets track properties to properties.

void TrackInfo::setValues ( const QMap< Qmmp::ReplayGainKey, double > &  replayGainInfo)

Sets ReplayGain information to replayGainInfo.

void TrackInfo::updateValues ( const QMap< Qmmp::MetaData, QString > &  metaData)

Updates existing metadata using values from metaData.

void TrackInfo::updateValues ( const QMap< Qmmp::TrackProperty, QString > &  properties)

Updates existing track properties using values from properties.

void TrackInfo::updateValues ( const QMap< Qmmp::ReplayGainKey, double > &  replayGainInfo)

Updates existing ReplayGain information using values from replayGainInfo.

const QString TrackInfo::value ( Qmmp::MetaData  key) const

Returns the metdata string associated with the given key.

Referenced by MusicMPRISPlayerCore::metadata().

const QString TrackInfo::value ( Qmmp::TrackProperty  key) const

Returns the track property string associated with the given key.

double TrackInfo::value ( Qmmp::ReplayGainKey  key) const

Returns the ReplayGain value associated with the given key.

Member Data Documentation

qint64 TrackInfo::m_duration = 0
private

Definition at line 175 of file trackinfo.h.

QMap<Qmmp::MetaData, QString> TrackInfo::m_metaData
private

Definition at line 170 of file trackinfo.h.

Parts TrackInfo::m_parts = Parts()
private

Definition at line 173 of file trackinfo.h.

QString TrackInfo::m_path
private

Definition at line 174 of file trackinfo.h.

QMap<Qmmp::TrackProperty, QString> TrackInfo::m_properties
private

Definition at line 171 of file trackinfo.h.

QMap<Qmmp::ReplayGainKey, double> TrackInfo::m_replayGainInfo
private

Definition at line 172 of file trackinfo.h.


The documentation for this class was generated from the following file: