Closed matiasdelellis closed 12 years ago
That should already work. There is an MPRIS handler that you can select from the listening to extension that allows you to set an mpris player in the preferences on the plugin tab. That could be done in a better way though, so I'm doing that.
:S I can not find the settings..
Uhmm.. from scratch.. (And last git of emesene) Login, Option, Preferences, Complements, (Update list), select Music, Activate this, so, activate mpris on "listened to" of extensions. There should work? Nop here. I think it works only with applications mpris1. but tested with clementine that has mpris1 and mpris2.
Selecting directly pragha (With the above plugin), or clementine, work well.
Now with MPRIS selected.. Return to complements, select music plugin, click on preferences, and return this: "Traceback (most recent call last): File "/home/matias/Proyectos/Linux/Aplicaciones/emesene/emesene/gui/gtkui/PluginWindow.py", line 124, in on_config pluginmanager.plugin_config(name, self.session) File "/home/matias/Proyectos/Linux/Aplicaciones/emesene/emesene/pluginmanager.py", line 229, in plugin_config return self._plugins[name].config(session) File "/home/matias/Proyectos/Linux/Aplicaciones/emesene/emesene/pluginmanager.py", line 138, in config self._instance.config(session) File "/home/matias/.config/emesene2/plugins/music/plugin.py", line 45, in config player.preferences() File "/home/matias/.config/emesene2/plugins/music/songretriever.py", line 113, in preferences config_dialog = self.config_dialog_class(self.config) File "/home/matias/.config/emesene2/plugins/music/handler_mpris.py", line 16, in init self.append_entry_default('Player', 'config.mpris_player', player_default) TypeError: append_entry_default() takes exactly 5 arguments (4 given)"
Regards.
Another crazy idea.. In terminal.. dbus-send --session --print-reply --reply-timeout=2000 --type=method_call --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames
This return a list with all dbus names in session dbus.Well.. Viewing the list, you know that player is turned on.
mm.. Psudocde ¿C?: [THIS ONLY WHEN HAS SELECTED MPRIS/2]
list = Get_list(); While (List->next) { if ( list->data HAS_THE_PREFIX "org.mpris.MediaPlayer2." ) { Reproductor_actual = REMOVE_PREFIX "org.mpris.MediaPlayer2." in list->data break; } list = list->next; } So, configure player with MPRIS2 and Reproductor_actual.
Understood? Also, If more than one player, you can show a list with them and that the user selects it. Or test the playback status of each.
Do not know much python, to the contrary would make the patches. Soory.
Could you try this: 0fbb3317d7082cbe899c8f6c93fd327e8b4e054f
And see if the handlers I changed still work?
The changes are only mpris1. So, the changes work with clementine and amarok. :) Both players support mpris1 and mpris2.
Pragha use only mpris2, and no have guayadeque to test.
Why not prefer Mpris2 instead?. Since the ubuntu sound-menu only supports mpris2 (Sinse 10.4), almost all players use this protocol, and little by little mpris1 is deprecated.
p.s.: Preferences return the same error.
Well.. Here other version using mpris2 that only add support to Pragha.
http://dl.dropbox.com/u/9606612/handler_mpris2.py
But you can also appends amarok, rhyntombox, clementine, and xnoise to the same file.
To mpris1, can add radiotray, exaile that only has mpris1 support.
Regards.
Since you seem to know a lot more about this than me, you could maybe just make a pull request. Then I'll pull the changes from you to this repo.
Nop. :(
I know mpris and mpris2 because as of today I am struggling with mpris2 in Pragha. Such mpris2 only utilized by the Sound menu of ubuntu, and all players boarded to the mpris2 Fashion ¿?, i learned dbus and mpris to make a plugin for the xfce panel. (http://code.google.com/p/dissonance/downloads/detail?name=xfce4-soundmenu-plugin-0.2.4.2.tar.bz2).
But I know very little python. This was some trial and error. And git know the basics, therefore never move Pragha to github. :S Otherwise would change many things, like listening dbus (adding matchers) to know if change the status of the player. (MPRIS2, emit the signal "PropertiesChanged" on the interface "org.freedesktop.DBus.Properties" with the base name org.mpris.MediaPlayer2.PLAYER_NAME ) every time that change a player status. Now seems that make a polling checking the status of the player, and it is not good.
Regards. And sorry for my bad English if not understand.. =)
It's understandable. It 's a pity that you can't work on this though, because when mpris works for Pragha, I have more important things to do. Maybe someone else can pick this up though.
I'll take a look at this when have some free time.
Wow. Thanks for the changes pepeleproso.
Work fine!. =)
Regards.
Based on last Pull "MusicPlugin: Add support for rhythmbox3" write it
http://dl.dropbox.com/u/9606612/handler_pragha.py
Both use mpris2.. So, is exactly the same, and just change "rhythmbox" by "pragha" and work. :)
This makes me think.. mpris2/mpris plugin should not be more generic? The configuration of this plugin is just select the name of the player (With a gtk entry?), and configure dbus address correctly (iface_name = 'org.mpris.MediaPlayer2.' & PLAYER_NAME).
How it works xfce4-soundmenu-plugin.
Uhmm. For example.. If we want to set xnoise (has mpris2 support)? (Or clementine, exaile, amarok, Quod Libet, Guayadeque, almost all use mpris2) => iface_name = 'org.mpris.MediaPlayer2.' & PLAYER_NAME So: iface_name = 'org.mpris.MediaPlayer2.xnoise'
The rest of the code is exactly the same! !.
So, do not write a new file for each player..
Regards