Enabled MPRIS2 (WIP)

Simple play controls are working, but there seems to be quite a bit
missing still.
Proper signals are not triggered for the first track on startup.
This commit is contained in:
Bart De Vries 2021-04-12 10:59:56 +02:00
parent f626cee7af
commit 569c988962
3 changed files with 16 additions and 4 deletions

View File

@ -31,6 +31,7 @@
#include "queuemodel.h"
#include "datamanager.h"
#include "audiomanager.h"
#include "mpris2/mpris2.h"
#ifdef Q_OS_ANDROID
Q_DECL_EXPORT
@ -73,6 +74,7 @@ int main(int argc, char *argv[])
return &AudioManager::instance();
});*/
qmlRegisterType<AudioManager>("org.kde.alligator", 1, 0, "AudioManager");
qmlRegisterType<Mpris2>("org.kde.alligator", 1, 0, "Mpris2");
qRegisterMetaType<Entry*>("const Entry*"); // "hack" to make qml understand Entry*

View File

@ -272,8 +272,8 @@ void MediaPlayer2Player::OpenUri(const QString &uri)
void MediaPlayer2Player::playerSourceChanged()
{
// TODO: do we need to implement this??
//setCurrentTrack(m_audioPlayer->playListPosition());
// TODO: refactor this; too complicated for this player
setCurrentTrack(DataManager::instance().getQueue().indexOf(m_audioPlayer->entry()->id()));
}
void MediaPlayer2Player::playControlEnabledChanged()

View File

@ -82,8 +82,18 @@ Kirigami.ApplicationWindow {
AudioManager {
id: audio
playerOpen: false
//onPositionChanged: console.log("position changed to", position)
//onSeekableChanged: console.log("seekable changed to", seekable)
}
Mpris2 {
id: mpris2Interface
playerName: 'alligator'
audioPlayer: audio
onRaisePlayer:
{
// TODO: implement
}
}
footer: Loader {