mirror of https://github.com/KDE/kasts.git
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:
parent
f626cee7af
commit
569c988962
|
@ -31,6 +31,7 @@
|
||||||
#include "queuemodel.h"
|
#include "queuemodel.h"
|
||||||
#include "datamanager.h"
|
#include "datamanager.h"
|
||||||
#include "audiomanager.h"
|
#include "audiomanager.h"
|
||||||
|
#include "mpris2/mpris2.h"
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
Q_DECL_EXPORT
|
Q_DECL_EXPORT
|
||||||
|
@ -73,6 +74,7 @@ int main(int argc, char *argv[])
|
||||||
return &AudioManager::instance();
|
return &AudioManager::instance();
|
||||||
});*/
|
});*/
|
||||||
qmlRegisterType<AudioManager>("org.kde.alligator", 1, 0, "AudioManager");
|
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*
|
qRegisterMetaType<Entry*>("const Entry*"); // "hack" to make qml understand Entry*
|
||||||
|
|
||||||
|
|
|
@ -272,8 +272,8 @@ void MediaPlayer2Player::OpenUri(const QString &uri)
|
||||||
|
|
||||||
void MediaPlayer2Player::playerSourceChanged()
|
void MediaPlayer2Player::playerSourceChanged()
|
||||||
{
|
{
|
||||||
// TODO: do we need to implement this??
|
// TODO: refactor this; too complicated for this player
|
||||||
//setCurrentTrack(m_audioPlayer->playListPosition());
|
setCurrentTrack(DataManager::instance().getQueue().indexOf(m_audioPlayer->entry()->id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaPlayer2Player::playControlEnabledChanged()
|
void MediaPlayer2Player::playControlEnabledChanged()
|
||||||
|
|
|
@ -82,8 +82,18 @@ Kirigami.ApplicationWindow {
|
||||||
AudioManager {
|
AudioManager {
|
||||||
id: audio
|
id: audio
|
||||||
playerOpen: false
|
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 {
|
footer: Loader {
|
||||||
|
|
Loading…
Reference in New Issue