google-code-export / xnoise

Automatically exported from code.google.com/p/xnoise
Other
1 stars 1 forks source link

mpris1 avaialble? #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In reading the history of xnoise, I noticed that you had originally started 
with mpris1 standards and updated it to mpris2 standards.

Do you still have the mpris1 plugin and if so can I have access to it?

I use python scripts for conky that utilize the mpris1 dbus standards and would 
like to use these..

Thanks

Original issue reported on code.google.com by vast...@gmail.com on 9 Sep 2011 at 8:09

GoogleCodeExporter commented 9 years ago
You can get the original mpris1 version from the source repo history.
I recommend doing a new mpris1plugin with using some old code.
This should be doable in a very short time.
Ask, if more help is needhed!

Original comment by shuerhaaken on 13 Sep 2011 at 7:20

GoogleCodeExporter commented 9 years ago
It is something I would like to be able to do but having looked at the source, 
I am lost..  I thought I would be able to replace the current mpris2 with the 
old but could not find the way

Is it something you could re enable since you are familiar with it?  I would 
really appreciate the help..

Original comment by vast...@gmail.com on 18 Sep 2011 at 12:44

GoogleCodeExporter commented 9 years ago
I did a quick adoption of the mpris (v2) plugin to a new mpris-one (mpris v1) 
plugin.
Apart from Play/Next/Quit I didn't test anything, yet. Please have a look at it 
and do implementations of other methods, if not available. You can copy some 
code from the mpris (v2) plugin.
Just checkout latest revision via mercurial. 
You can test using d-feet (at least for some of the methods).
The mpris v1 standard is described here: http://www.mpris.org/1.0/spec.html
Please send a patch if you correct/add code. 
hg diff > my.patch (in case you don't know how to do it)

This is not the original mpris v1 plugin but a GDBus version of it.

Original comment by shuerhaaken on 18 Sep 2011 at 9:28

GoogleCodeExporter commented 9 years ago
Thanks!  That is just the start I was looking for.. I really appreciate it

Original comment by vast...@gmail.com on 18 Sep 2011 at 4:37

GoogleCodeExporter commented 9 years ago
Loaded and running...

When I try to get GetMetadata using dfeet, I get the following segfault

(xnoise:15480): GLib-CRITICAL **: g_hash_table_iter_init: assertion `hash_table 
!= NULL' failed
Segmentation fault

same happens on a qbus call  

Original comment by vast...@gmail.com on 18 Sep 2011 at 5:38

GoogleCodeExporter commented 9 years ago
GetMetadata() is not implemented, yet: 

public HashTable<string, Variant?>? GetMetadata() {
    return null;
}

This is obviously not working. 
You can use the metadata like in mpris v2 plugin and pack it like described in 
the standard and [https://live.gnome.org/Vala/DBusServerSample#Type_Table 
Type_Table].  
You can fill the Hashtable with strings packed into Variants.
Variant s = "some string";
...
d-feet will most likely not be able to display that kind of dictionary. You 
have to test that from another application using the mpris v1 interface like 
your python scripts for conky.

Original comment by shuerhaaken on 18 Sep 2011 at 8:23

GoogleCodeExporter commented 9 years ago
shuerhaaken...  The GetMetaData is the pivotal piece in the mpris1 scripts..

I appreciate all your help on this and I will continue to try to work this with 
mpris1..

I spent the day learning the new dbus entries for mpris2 and have almost 
completed the exact same things...

Thanks!

Original comment by vast...@gmail.com on 18 Sep 2011 at 10:16

GoogleCodeExporter commented 9 years ago
Does that mean you are not using mpris v1 any more?

Original comment by shuerhaaken on 19 Sep 2011 at 8:32

GoogleCodeExporter commented 9 years ago
No.. I would use MPRIS1 over v2 because it has a tremendous amount more that 
you can access and control.  

I have created a 3 line python for v2 that is very limited...

If xnoise had v1... specifically the getmetadata functions of v1, the control 
capability for the desktop is unlimited.. 

I am confused on why so many apps are limiting the access to only v2.  I know 
there are benefits to control th eplayer from the Ubuntu Sound menu, but I have 
no need or desire for that being a Debian user..  Perhaps v2 is still being 
developed and some of these things will eventually get there, but right now it 
is useless for the scripting that I do...  (This is my opinion, take it for 
what it is worth)

Here is a link to the Clementine app that shows how the scripts work with V1..

http://ubuntuforums.org/showthread.php?t=1645481

There are a lot of Conky users who would look at xnoise because of these 
capabilities..  And, FWIW, I like xnoise!!!!

Original comment by vast...@gmail.com on 19 Sep 2011 at 8:53

GoogleCodeExporter commented 9 years ago
At least somebody likes xnoise ;)

Maybe I'll have a look at the getmetadata function again... 
I just hoped to get a new developer, because I have too less time.

Original comment by shuerhaaken on 19 Sep 2011 at 9:07

GoogleCodeExporter commented 9 years ago
I will take a look at it too... I cannot promise anything, but I am pretty
good at figuring stuff out..

If I have questions, I will shoot them to you..  I am going to try and tear
down every component of xnoise and understand the process...

Original comment by vast...@gmail.com on 19 Sep 2011 at 11:42

GoogleCodeExporter commented 9 years ago
ok. I did some more mpris v1 stuff. Including a basic version of getmetadata of 
the /Player dbus object.
Playback status also

Original comment by shuerhaaken on 20 Sep 2011 at 8:24

GoogleCodeExporter commented 9 years ago
Hey there!  I have tested the latest and have found it did not work but I have 
found the reason and fix but want to run it by you

When you run for clementine (and any other player I have ever used)

qdbus org.mpris.clementine /Player 

the return is

method int org.freedesktop.MediaPlayer.GetCaps()
method QVariantMap org.freedesktop.MediaPlayer.GetMetadata()
method void org.freedesktop.MediaPlayer.Mute()
method void org.freedesktop.MediaPlayer.Next()
method void org.freedesktop.MediaPlayer.Pause()
method void org.freedesktop.MediaPlayer.Play()
method int org.freedesktop.MediaPlayer.PositionGet()
method void org.freedesktop.MediaPlayer.PositionSet(int)
method void org.freedesktop.MediaPlayer.Prev()
method void org.freedesktop.MediaPlayer.Repeat(bool)
method void org.freedesktop.MediaPlayer.ShowOSD()
method void org.freedesktop.MediaPlayer.Stop()
method void org.freedesktop.MediaPlayer.VolumeDown(int)
method int org.freedesktop.MediaPlayer.VolumeGet()
method void org.freedesktop.MediaPlayer.VolumeSet(int)
method void org.freedesktop.MediaPlayer.VolumeUp(int)
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, 
QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString 
interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString 
property_name, QDBusVariant value)

Note that everything returns from

org.freedesktop.MediaPlayer

But in the xnoise v1 mpris when you run

$ qdbus org.mpris.xnoise /Player

method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, 
QString property_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString 
property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
signal void org.mpris.MediaPlayer.CapsChange(int Capabilities)
method int org.mpris.MediaPlayer.GetCaps()
method void org.mpris.MediaPlayer.Next()
method void org.mpris.MediaPlayer.Pause()
method void org.mpris.MediaPlayer.Play()
method int org.mpris.MediaPlayer.PositionGet()
method void org.mpris.MediaPlayer.PositionSet(int Position)
method void org.mpris.MediaPlayer.Prev()
method void org.mpris.MediaPlayer.Repeat(bool rpt)
method void org.mpris.MediaPlayer.Stop()
method int org.mpris.MediaPlayer.VolumeGet()
method void org.mpris.MediaPlayer.VolumeSet(int Volume)

Note that everything is returned from 

org.mpris.MediaPlayer

This was an easy script change but I wanted to make you aware of the 
differences..

Tank you for the work on this!

Original comment by vast...@gmail.com on 20 Sep 2011 at 5:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here is an image of what is ready now..

Missing is from mpris v1 is Length, current_position_percent and bit rate...

http://www.zimagez.com/zimage/screenshot-09202011-013432pm.php

Thank you!

Original comment by vast...@gmail.com on 20 Sep 2011 at 6:38

GoogleCodeExporter commented 9 years ago
Actually it is time that is missing not length and current position is a call 
based on time

Original comment by vast...@gmail.com on 20 Sep 2011 at 6:46

GoogleCodeExporter commented 9 years ago
Hello
But the screenshot looks like it is working for the other stuff, isn't it?

Is the only issue that Length, current_position_percent and bit rate are 
missing?

Concerning the interface naming issue: I will adjust the name. My fault.

Original comment by shuerhaaken on 21 Sep 2011 at 9:22

GoogleCodeExporter commented 9 years ago
Ok. Done. But current_position_percent is not available in the mpris v1 
standard, as far as I can see.
Length comes as metadata "mtime" and "time".
Bit rate still missing

Original comment by shuerhaaken on 21 Sep 2011 at 10:30

GoogleCodeExporter commented 9 years ago
Locked and loaded...

Everything works perfectly...

BitRate is not that big of a deal

http://en.zimagez.com/zimage/screenshot-09212011-063406pm.php

Thank you!!!!

Original comment by vast...@gmail.com on 21 Sep 2011 at 11:36

GoogleCodeExporter commented 9 years ago
Bitrate I will add later

Original comment by shuerhaaken on 22 Sep 2011 at 7:02