Registered Member
|
Anyone knows how to set the rating of the song currently playing on Amarok via DBus?
The following,
doesn't return the actual song rating but something else. Likewise, ie,
doesn't seem to do anything as the 'Rate' property remains unchanged. No errors or warnings are produced though. I know that back when I was using the KDE DE I was once able to configure KRemote to set Amarok's song rating via DBus upon pressing a button on my remote control and, as such, I know it's doable. Unfortunately though I'm not using the KDE DE at the moment and don't have the System Settings's and KRemote's amazing GUI available to try and look for the the actual interface, method/property that does what I'm after. Anyone knows how, I wonder? |
Administrator
|
Moved to Amarok forum.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Manager
|
Did you have a look at the wiki here http://amarok.kde.org/wiki/Development/ ... _HowTo_2.0 ?
Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ... |
Registered Member
|
I did, yes. I read that particular page several pages and also the one on the MPRIS interface located here. [http://xmms2.org/wiki/MPRIS] But no luck so far! |
KDE Developer
|
Hmm, perhaps it's just not implemented on the Amarok side. Have you checked the code?
|
Registered Member
|
Not yet, no, but only because I'm fairly convinced (though with some doubts now lol) that it can be done via DBus. I know for a fact that back when I was using the KDE DE I had a setup whereby pressing the 1-5 numeric buttons on my remote control triggered song rating in Amarok. What I'm not now 100% sure is that the setup relied on signals sent via DBus, though that's the impression I'm under. |
Registered Member
|
Seems like it isn't supported via DBus after all!
Solved this by installing KDE System settings and KRemoteControl and then setting up workspace keypress events for each of the 1-5 keys on my remote control. For this to work, however, I had to also setup shortcuts in amarok to respond to the keypresses defined in KRemoteControl. Note that defining global shortcuts (instead of regular shortcuts) will not work. |
KDE Developer
|
Then please go and implement it, http://reviewboard.kde.org/ is your friend! |
Registered Member
|
I certainly would be willing to but I don't think a patch would ever be accepted since, to quote this page, "Amarok 2.0 interface implements MPRIS 1.0 DBus API. So I think first and foremost the devs or whoever is responsible for the project would have to agree to either extend or change the standard as implemented by Amarok. Anyway, I've found an even better and much more elegant solution for my little predicament. It involves using irexec (which I'm already using anyway) and a DBus call to invoke Amarok's shortcuts, as given:
So, in my .lircrc, I have, (the following toggles between 1 star or half rating)
Hope this helps someone! |
KDE Developer
|
Oh, the wiki page is hopelessly outdated (you could have told from the "Amarok 2.0"), we now support only MPRIS 2. I am an Amarok developer and I'll happily accept your patch! Anything that doesn't fix Amarok MPRIS 2 confomance is just a work-around. |
KDE Developer
|
I had a look at the DBus interface. I'm not sure what the org.mpris.MediaPlayer2.Player Rate property actually refers to, but the one you're interested in is in the org.mpris.MediaPlayer2.Player Metadata property as xesam:userRating. You should be able to change that.
|
Registered Member
|
Thank you for that, Sentynel. I had come across the metadata property before but was under the impression it was readonly. Will definitely be having a closer look now!
|
KDE Developer
|
Oh, I didn't check if it's read only. You might be out of luck (again) if it is.
|
Registered Member
|
I think it is:
It's alright though; I've got it working anyhow! Thank you for your help. |
Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]