Re: Plugin Amarok
- From: Rafael Brundo Uriarte <rafael uriarte gmail com>
- To: Andreas Kotowicz <andreas kotowicz gmail com>
- Cc: kupfer-list gnome org
- Subject: Re: Plugin Amarok
- Date: Tue, 16 Nov 2010 22:42:46 -0200
Hi Andreas,
I am sorry, I ended up wasting time, yours is very good(I decided to
develop because I looked for it in google and in the list but did not
find any post or plugin for amarok). I am not sure whether we can
launch amarok from dbus, the best way would be to check if it is
running (ps aux ) and if not to start and send the play signal. What
do you think???
About the plugins, couldn't we have a wiki to post the plugins and
documentation? I've seems many reviews about missing docs but I did
not find any place to centralize it. A good example would be what
gnome-do do:
http://do.davebsd.com/wiki/Category:Plugins
It's a place to upload them and write some documentation about it...
Tomorrow I will start a volume control plugin and will be posting here
cheers
Rafael Brundo Uriarte
On 16 November 2010 22:12, Andreas Kotowicz <andreas kotowicz gmail com> wrote:
> Hi Rafael,
>
> I've only recently posted a similar plugin on this list (Oct 22nd).
> maybe we should try to combine the two?
>
> Here's a list of things that I haven't figured out so far:
>
> There are two things that I couldn't figure out:
> - start amarok if not running and user hits "play" (via dbus)
> - make sure Amarok does not show up twice in kupfer's menu. It shows
> up once with the "Launch" option (like every normal application), and
> a second time with the "Search Contents" option (that's my plugin).
>
>
>
> cheers,
> andreas
>
> On Wed, Nov 17, 2010 at 12:24 AM, Rafael Brundo Uriarte
> <rafael uriarte gmail com> wrote:
>> Folks,
>>
>> I've developed a very simple plugin to control amarok playback(based
>> on the audacious one, thanks folks). it has got only Play, Pause,
>> Stop, Next Song and Previous Song (amarok 2.X hasn't got yet and dbus
>> interface to manage collection). I am not sure if it's worth to put in
>> the official release but for those who use amarok and want to give a
>> try, here it go (just save as ~/.local/share/kupfer/plugins/amarok.py
>> ) :
>>
>> "
>> __kupfer_name__ = _("Amarok")
>> __kupfer_sources__ = ("AmarokSource", )
>> __description__ = _("Very Simple Plugin to Control Amarok(2.X)
>> Playback, it includes Play, Stop, Pause, Next Song and Previous Song.
>> Make sure that amarok is running")
>> __version__ = "2010-11-16"
>> __author__ = "Rafael Brundo Uriarte<rafael uriarte gmail com>"
>>
>> import subprocess
>>
>> from kupfer.objects import Leaf, Source, Action
>> from kupfer.objects import AppLeaf, RunnableLeaf, SourceLeaf
>> from kupfer.obj.apps import AppLeafContentMixin
>> from kupfer import objects, icons, utils
>> from kupfer import plugin_support
>> from kupfer import kupferstring
>>
>> class Play (RunnableLeaf):
>> def __init__(self):
>> RunnableLeaf.__init__(self, name=_("Play"))
>> def run(self):
>> utils.launch_commandline("qdbus org.mpris.amarok /Player Play",
>> in_terminal=False)
>> def get_description(self):
>> return _("Resume playback in Amarok")
>> def get_icon_name(self):
>> return "media-playback-start"
>>
>> class Stop (RunnableLeaf):
>> def __init__(self):
>> RunnableLeaf.__init__(self, name=_("Stop"))
>> def run(self):
>> utils.launch_commandline("qdbus org.mpris.amarok /Player Stop",
>> in_terminal=False)
>> def get_description(self):
>> return _("Stop playback in Amarok")
>> def get_icon_name(self):
>> return "media-playback-stop"
>>
>> class Pause (RunnableLeaf):
>> def __init__(self):
>> RunnableLeaf.__init__(self, name=_("Pause"))
>> def run(self):
>> utils.launch_commandline("qdbus org.mpris.amarok /Player Pause",
>> in_terminal=False)
>> def get_description(self):
>> return _("Pause playback in Amarok")
>> def get_icon_name(self):
>> return "media-playback-pause"
>>
>> class Next (RunnableLeaf):
>> def __init__(self):
>> RunnableLeaf.__init__(self, name=_("Next"))
>> def run(self):
>> utils.launch_commandline("qdbus org.mpris.amarok /Player Next",
>> in_terminal=False)
>> def get_description(self):
>> return _("Jump to next track in Amarok")
>> def get_icon_name(self):
>> return "media-skip-forward"
>>
>> class Previous (RunnableLeaf):
>> def __init__(self):
>> RunnableLeaf.__init__(self, name=_("Previous"))
>> def run(self):
>> utils.launch_commandline("qdbus org.mpris.amarok
>> /Player Prev", in_terminal=False)
>>
>> def get_description(self):
>> return _("Jump to previous track in Amarok")
>> def get_icon_name(self):
>> return "media-skip-backward"
>>
>>
>> class AmarokSource (AppLeafContentMixin, Source):
>> appleaf_content_id = "Amarok"
>> source_user_reloadable = True
>>
>> def __init__(self):
>> Source.__init__(self, _("Amarok"))
>> def get_items(self):
>> yield Play()
>> yield Stop()
>> yield Pause()
>> yield Next()
>> yield Previous()
>> def get_description(self):
>> return __description__
>> def get_icon_name(self):
>> return "Amarok"
>> def provides(self):
>> yield RunnableLeaf
>>
>> "
>>
>> The next one I am planning (apart from improving this one) is to
>> control the general volume (Mute, Volume Up....)
>>
>> any suggestion or critic is welcome...
>>
>> cheers
>> Rafael Brundo Uriarte
>> _______________________________________________
>> kupfer-list mailing list
>> kupfer-list gnome org
>> http://mail.gnome.org/mailman/listinfo/kupfer-list
>>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]