TTKMusicPlayer
3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
The class of the app mpris player object. More...
#include <musicmprisplayer.h>
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 |
SoundCore * | m_core |
MusicApplication * | m_application |
QDBusObjectPath | m_trackID |
TTKVariantMap | m_properties |
The class of the app mpris player object.
Definition at line 101 of file musicmprisplayer.h.
MusicMPRISPlayerCore::MusicMPRISPlayerCore | ( | QObject * | parent = nullptr | ) |
Object constructor.
Definition at line 98 of file musicmprisplayer.cpp.
References elapsedChanged(), TTK::initRandom(), MusicApplication::instance(), SoundCore::instance(), m_application, m_core, MusicApplication::m_playlist, m_prevPos, m_prevTrack, playbackModeChanged(), stateChanged(), syncProperties(), trackInfoChanged(), updateTrackID(), and volumeChanged().
bool MusicMPRISPlayerCore::canControl | ( | ) | const |
Definition at line 118 of file musicmprisplayer.cpp.
bool MusicMPRISPlayerCore::canGoNext | ( | ) | const |
Definition at line 123 of file musicmprisplayer.cpp.
References MusicPlaylist::isEmpty(), m_application, and MusicApplication::m_playlist.
Referenced by syncProperties().
bool MusicMPRISPlayerCore::canGoPrevious | ( | ) | const |
Definition at line 128 of file musicmprisplayer.cpp.
References MusicPlaylist::isEmpty(), m_application, and MusicApplication::m_playlist.
Referenced by syncProperties().
bool MusicMPRISPlayerCore::canPause | ( | ) | const |
Definition at line 133 of file musicmprisplayer.cpp.
References MusicPlaylist::isEmpty(), m_application, and MusicApplication::m_playlist.
Referenced by syncProperties().
bool MusicMPRISPlayerCore::canPlay | ( | ) | const |
Definition at line 138 of file musicmprisplayer.cpp.
References MusicPlaylist::isEmpty(), m_application, and MusicApplication::m_playlist.
Referenced by syncProperties().
bool MusicMPRISPlayerCore::canSeek | ( | ) | const |
Definition at line 143 of file musicmprisplayer.cpp.
References SoundCore::duration(), and m_core.
Referenced by syncProperties().
|
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 |
Definition at line 179 of file musicmprisplayer.cpp.
References Qmmp::ALBUM, Qmmp::ALBUMARTIST, Qmmp::ARTIST, Qmmp::COMMENT, Qmmp::COMPOSER, Qmmp::DISCNUMBER, SoundCore::duration(), Qmmp::GENRE, MetaDataManager::getCoverPath(), MetaDataManager::instance(), m_core, m_trackID, TrackInfo::path(), SoundCore::path(), Qmmp::TITLE, TTK::toString(), Qmmp::TRACK, SoundCore::trackInfo(), TTK_DN_S2MS, TTK_SEPARATOR, TrackInfo::value(), and Qmmp::YEAR.
Referenced by syncProperties().
double MusicMPRISPlayerCore::minimumRate | ( | ) | const |
Definition at line 249 of file musicmprisplayer.cpp.
Referenced by syncProperties().
|
slot |
Definition at line 307 of file musicmprisplayer.cpp.
References m_application, and MusicApplication::playNext().
|
slot |
Definition at line 312 of file musicmprisplayer.cpp.
References MusicApplication::importSongsByOutside(), and m_application.
|
slot |
Definition at line 327 of file musicmprisplayer.cpp.
References m_application, and MusicApplication::switchToPlayState().
|
slot |
Definition at line 332 of file musicmprisplayer.cpp.
References m_application, and MusicApplication::switchToPlayState().
|
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().
|
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.
|
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().
|
slot |
Definition at line 347 of file musicmprisplayer.cpp.
References SoundCore::elapsed(), m_core, and SoundCore::seek().
|
signal |
Referenced by elapsedChanged().
|
private |
Definition at line 425 of file musicmprisplayer.cpp.
References m_properties, and syncProperties().
Referenced by playbackModeChanged(), stateChanged(), trackInfoChanged(), and volumeChanged().
void MusicMPRISPlayerCore::setLoopStatus | ( | const QString & | value | ) |
Definition at line 158 of file musicmprisplayer.cpp.
References m_application, MusicApplication::playlistLoop(), MusicApplication::playOneLoop(), and MusicApplication::playOrder().
|
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 | ) |
Definition at line 287 of file musicmprisplayer.cpp.
References m_application, MusicApplication::m_playlist, TTK::Order, TTK::Random, and MusicPlaylist::setPlaybackMode().
void MusicMPRISPlayerCore::setVolume | ( | double | value | ) |
Definition at line 297 of file musicmprisplayer.cpp.
References m_application, MusicApplication::m_player, and MusicPlayer::setVolume().
bool MusicMPRISPlayerCore::shuffle | ( | ) | const |
Definition at line 282 of file musicmprisplayer.cpp.
References m_application, MusicApplication::playMode(), and TTK::Random.
Referenced by syncProperties().
|
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().
|
slot |
Definition at line 342 of file musicmprisplayer.cpp.
References m_application, and MusicApplication::switchToStopState().
|
private |
Definition at line 408 of file musicmprisplayer.cpp.
References canGoNext(), canGoPrevious(), canPause(), canPlay(), canSeek(), loopStatus(), m_properties, maximumRate(), metadata(), minimumRate(), playbackStatus(), rate(), shuffle(), and volume().
Referenced by MusicMPRISPlayerCore(), and sendProperties().
|
privateslot |
When new track information is available.
Definition at line 364 of file musicmprisplayer.cpp.
References sendProperties(), and updateTrackID().
Referenced by MusicMPRISPlayerCore().
|
private |
Definition at line 399 of file musicmprisplayer.cpp.
References MusicPlaylist::currentIndex(), m_application, MusicApplication::m_playlist, m_prevTrack, m_trackID, and TTK::random().
Referenced by MusicMPRISPlayerCore(), stateChanged(), and trackInfoChanged().
double MusicMPRISPlayerCore::volume | ( | ) | const |
Definition at line 292 of file musicmprisplayer.cpp.
References m_application, MusicApplication::m_player, and MusicPlayer::volume().
Referenced by syncProperties().
|
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().
|
private |
Definition at line 191 of file musicmprisplayer.h.
Referenced by canGoNext(), canGoPrevious(), canPause(), canPlay(), loopStatus(), MusicMPRISPlayerCore(), Next(), OpenUri(), Pause(), Play(), PlayPause(), Previous(), setLoopStatus(), setShuffle(), setVolume(), shuffle(), Stop(), updateTrackID(), and volume().
|
private |
Definition at line 190 of file musicmprisplayer.h.
Referenced by canSeek(), metadata(), MusicMPRISPlayerCore(), playbackStatus(), position(), Seek(), SetPosition(), and stateChanged().
|
private |
Definition at line 189 of file musicmprisplayer.h.
Referenced by elapsedChanged(), MusicMPRISPlayerCore(), and stateChanged().
|
private |
Definition at line 188 of file musicmprisplayer.h.
Referenced by MusicMPRISPlayerCore(), and updateTrackID().
|
private |
Definition at line 193 of file musicmprisplayer.h.
Referenced by sendProperties(), and syncProperties().
|
private |
Definition at line 192 of file musicmprisplayer.h.
Referenced by metadata(), SetPosition(), and updateTrackID().
|
read |
Definition at line 105 of file musicmprisplayer.h.
|
read |
Definition at line 106 of file musicmprisplayer.h.
|
read |
Definition at line 107 of file musicmprisplayer.h.
|
read |
Definition at line 108 of file musicmprisplayer.h.
|
read |
Definition at line 109 of file musicmprisplayer.h.
|
read |
Definition at line 110 of file musicmprisplayer.h.
|
readwrite |
Definition at line 111 of file musicmprisplayer.h.
|
read |
Definition at line 112 of file musicmprisplayer.h.
|
read |
Definition at line 113 of file musicmprisplayer.h.
|
read |
Definition at line 114 of file musicmprisplayer.h.
|
read |
Definition at line 115 of file musicmprisplayer.h.
|
read |
Definition at line 116 of file musicmprisplayer.h.
|
readwrite |
Definition at line 117 of file musicmprisplayer.h.
|
readwrite |
Definition at line 118 of file musicmprisplayer.h.
|
readwrite |
Definition at line 119 of file musicmprisplayer.h.