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 Slots | Signals | Public Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes | List of all members
MusicMPRISPlayerCore Class Reference

The class of the app mpris player object. More...

#include <musicmprisplayer.h>

+ Inheritance diagram for MusicMPRISPlayerCore:

Public Slots

void Next ()
 
void Previous ()
 
void OpenUri (const QString &uri)
 
void Pause ()
 
void Play ()
 
void PlayPause ()
 
void Stop ()
 
void Seek (qlonglong offset)
 
void SetPosition (const QDBusObjectPath &trackId, qlonglong position)
 

Signals

void Seeked (qlonglong position)
 

Public Member Functions

 MusicMPRISPlayerCore (QObject *parent=nullptr)
 
bool canControl () const
 
bool canGoNext () const
 
bool canGoPrevious () const
 
bool canPause () const
 
bool canPlay () const
 
bool canSeek () const
 
QString loopStatus () const
 
void setLoopStatus (const QString &value)
 
double maximumRate () const
 
QVariantMap metadata () const
 
double minimumRate () const
 
QString playbackStatus () const
 
qlonglong position () const
 
double rate () const
 
void setRate (double value)
 
bool shuffle () const
 
void setShuffle (bool value)
 
double volume () const
 
void setVolume (double value)
 

Properties

bool CanControl
 
bool CanGoNext
 
bool CanGoPrevious
 
bool CanPause
 
bool CanPlay
 
bool CanSeek
 
QString LoopStatus
 
double MaximumRate
 
QVariantMap Metadata
 
double MinimumRate
 
QString PlaybackStatus
 
qlonglong Position
 
double Rate
 
bool Shuffle
 
double Volume
 

Private Slots

void trackInfoChanged ()
 
void stateChanged ()
 
void volumeChanged ()
 
void elapsedChanged (qint64 elapsed)
 
void playbackModeChanged ()
 

Private Member Functions

void updateTrackID ()
 
void syncProperties ()
 
void sendProperties ()
 

Private Attributes

int m_prevTrack
 
qint64 m_prevPos
 
SoundCorem_core
 
MusicApplicationm_application
 
QDBusObjectPath m_trackID
 
TTKVariantMap m_properties
 

Detailed Description

The class of the app mpris player object.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 101 of file musicmprisplayer.h.

Constructor & Destructor Documentation

MusicMPRISPlayerCore::MusicMPRISPlayerCore ( QObject *  parent = nullptr)

Member Function Documentation

bool MusicMPRISPlayerCore::canControl ( ) const

Definition at line 118 of file musicmprisplayer.cpp.

bool MusicMPRISPlayerCore::canGoNext ( ) const
bool MusicMPRISPlayerCore::canGoPrevious ( ) const
bool MusicMPRISPlayerCore::canPause ( ) const
bool MusicMPRISPlayerCore::canPlay ( ) const
bool MusicMPRISPlayerCore::canSeek ( ) const

Definition at line 143 of file musicmprisplayer.cpp.

References SoundCore::duration(), and m_core.

Referenced by syncProperties().

void MusicMPRISPlayerCore::elapsedChanged ( qint64  elapsed)
privateslot

Tracks elapesed time.

Definition at line 385 of file musicmprisplayer.cpp.

References m_prevPos, Seeked(), and TTK_DN_S2MS.

Referenced by MusicMPRISPlayerCore().

QString MusicMPRISPlayerCore::loopStatus ( ) const

Definition at line 148 of file musicmprisplayer.cpp.

References TTK::ListLoop, m_application, TTK::OneLoop, and MusicApplication::playMode().

Referenced by syncProperties().

double MusicMPRISPlayerCore::maximumRate ( ) const

Definition at line 174 of file musicmprisplayer.cpp.

Referenced by syncProperties().

QVariantMap MusicMPRISPlayerCore::metadata ( ) const
double MusicMPRISPlayerCore::minimumRate ( ) const

Definition at line 249 of file musicmprisplayer.cpp.

Referenced by syncProperties().

void MusicMPRISPlayerCore::Next ( )
slot

Definition at line 307 of file musicmprisplayer.cpp.

References m_application, and MusicApplication::playNext().

void MusicMPRISPlayerCore::OpenUri ( const QString &  uri)
slot
void MusicMPRISPlayerCore::Pause ( )
slot

Definition at line 327 of file musicmprisplayer.cpp.

References m_application, and MusicApplication::switchToPlayState().

void MusicMPRISPlayerCore::Play ( )
slot

Definition at line 332 of file musicmprisplayer.cpp.

References m_application, and MusicApplication::switchToPlayState().

void MusicMPRISPlayerCore::playbackModeChanged ( )
privateslot

Current play mode changed.

Definition at line 394 of file musicmprisplayer.cpp.

References sendProperties().

Referenced by MusicMPRISPlayerCore().

QString MusicMPRISPlayerCore::playbackStatus ( ) const

Definition at line 254 of file musicmprisplayer.cpp.

References m_core, Qmmp::Paused, Qmmp::Playing, and SoundCore::state().

Referenced by syncProperties().

void MusicMPRISPlayerCore::PlayPause ( )
slot

Definition at line 337 of file musicmprisplayer.cpp.

References m_application, and MusicApplication::switchToPlayState().

qlonglong MusicMPRISPlayerCore::position ( ) const

Definition at line 267 of file musicmprisplayer.cpp.

References SoundCore::elapsed(), m_core, and TTK_DN_S2MS.

void MusicMPRISPlayerCore::Previous ( )
slot

Definition at line 302 of file musicmprisplayer.cpp.

References m_application, and MusicApplication::playPrevious().

double MusicMPRISPlayerCore::rate ( ) const

Definition at line 272 of file musicmprisplayer.cpp.

Referenced by syncProperties().

void MusicMPRISPlayerCore::Seek ( qlonglong  offset)
slot

Definition at line 347 of file musicmprisplayer.cpp.

References SoundCore::elapsed(), m_core, and SoundCore::seek().

void MusicMPRISPlayerCore::Seeked ( qlonglong  position)
signal

Referenced by elapsedChanged().

void MusicMPRISPlayerCore::sendProperties ( )
private
void MusicMPRISPlayerCore::setLoopStatus ( const QString &  value)
void MusicMPRISPlayerCore::SetPosition ( const QDBusObjectPath &  trackId,
qlonglong  position 
)
slot

Definition at line 352 of file musicmprisplayer.cpp.

References m_core, m_trackID, SoundCore::seek(), and TTK_WARN_STREAM.

void MusicMPRISPlayerCore::setRate ( double  value)

Definition at line 277 of file musicmprisplayer.cpp.

void MusicMPRISPlayerCore::setShuffle ( bool  value)
void MusicMPRISPlayerCore::setVolume ( double  value)
bool MusicMPRISPlayerCore::shuffle ( ) const

Definition at line 282 of file musicmprisplayer.cpp.

References m_application, MusicApplication::playMode(), and TTK::Random.

Referenced by syncProperties().

void MusicMPRISPlayerCore::stateChanged ( )
privateslot

When the state of the SoundCore has changed.

Definition at line 370 of file musicmprisplayer.cpp.

References m_core, m_prevPos, Qmmp::Playing, sendProperties(), SoundCore::state(), and updateTrackID().

Referenced by MusicMPRISPlayerCore().

void MusicMPRISPlayerCore::Stop ( )
slot

Definition at line 342 of file musicmprisplayer.cpp.

References m_application, and MusicApplication::switchToStopState().

void MusicMPRISPlayerCore::syncProperties ( )
private
void MusicMPRISPlayerCore::trackInfoChanged ( )
privateslot

When new track information is available.

Definition at line 364 of file musicmprisplayer.cpp.

References sendProperties(), and updateTrackID().

Referenced by MusicMPRISPlayerCore().

void MusicMPRISPlayerCore::updateTrackID ( )
private
double MusicMPRISPlayerCore::volume ( ) const

Definition at line 292 of file musicmprisplayer.cpp.

References m_application, MusicApplication::m_player, and MusicPlayer::volume().

Referenced by syncProperties().

void MusicMPRISPlayerCore::volumeChanged ( )
privateslot

When the highest volume of the left and right channels has changed.

Definition at line 380 of file musicmprisplayer.cpp.

References sendProperties().

Referenced by MusicMPRISPlayerCore().

Member Data Documentation

MusicApplication* MusicMPRISPlayerCore::m_application
private
SoundCore* MusicMPRISPlayerCore::m_core
private
qint64 MusicMPRISPlayerCore::m_prevPos
private

Definition at line 189 of file musicmprisplayer.h.

Referenced by elapsedChanged(), MusicMPRISPlayerCore(), and stateChanged().

int MusicMPRISPlayerCore::m_prevTrack
private

Definition at line 188 of file musicmprisplayer.h.

Referenced by MusicMPRISPlayerCore(), and updateTrackID().

TTKVariantMap MusicMPRISPlayerCore::m_properties
private

Definition at line 193 of file musicmprisplayer.h.

Referenced by sendProperties(), and syncProperties().

QDBusObjectPath MusicMPRISPlayerCore::m_trackID
private

Definition at line 192 of file musicmprisplayer.h.

Referenced by metadata(), SetPosition(), and updateTrackID().

Property Documentation

bool MusicMPRISPlayerCore::CanControl
read

Definition at line 105 of file musicmprisplayer.h.

bool MusicMPRISPlayerCore::CanGoNext
read

Definition at line 106 of file musicmprisplayer.h.

bool MusicMPRISPlayerCore::CanGoPrevious
read

Definition at line 107 of file musicmprisplayer.h.

bool MusicMPRISPlayerCore::CanPause
read

Definition at line 108 of file musicmprisplayer.h.

bool MusicMPRISPlayerCore::CanPlay
read

Definition at line 109 of file musicmprisplayer.h.

bool MusicMPRISPlayerCore::CanSeek
read

Definition at line 110 of file musicmprisplayer.h.

QString MusicMPRISPlayerCore::LoopStatus
readwrite

Definition at line 111 of file musicmprisplayer.h.

double MusicMPRISPlayerCore::MaximumRate
read

Definition at line 112 of file musicmprisplayer.h.

QVariantMap MusicMPRISPlayerCore::Metadata
read

Definition at line 113 of file musicmprisplayer.h.

double MusicMPRISPlayerCore::MinimumRate
read

Definition at line 114 of file musicmprisplayer.h.

QString MusicMPRISPlayerCore::PlaybackStatus
read

Definition at line 115 of file musicmprisplayer.h.

qlonglong MusicMPRISPlayerCore::Position
read

Definition at line 116 of file musicmprisplayer.h.

double MusicMPRISPlayerCore::Rate
readwrite

Definition at line 117 of file musicmprisplayer.h.

bool MusicMPRISPlayerCore::Shuffle
readwrite

Definition at line 118 of file musicmprisplayer.h.

double MusicMPRISPlayerCore::Volume
readwrite

Definition at line 119 of file musicmprisplayer.h.


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