Fwd: [Amarok] Added DBus functions Forward(int) and Backward(int

Dan Meltzer parallelgrapefruit at gmail.com
Tue Sep 8 14:09:56 CEST 2009


Forwarding this to amarok-devel to ensure it gets attention before
we're stuck with these methods for release.  I don't have any means of
doing it myself currently, or I would.

oh, and it should be named seekForward() and seekBackward (or preferably
seek() that takes a signed int, with negative numbers being seek
backwards.  Currently this is all sorts of messy.


---------- Forwarded message ----------
From: Dan Meltzer <parallelgrapefruit at gmail.com>
Date: Mon, Sep 7, 2009 at 4:28 PM
Subject: Re: [Amarok] Added DBus functions Forward(int) and Backward(int
To: kde-commits at kde.org, michael_zanetti at gmx.net


This needs some sort of indication (in the variable name, and
preferably in api docs as well) whether time should be in seconds or
milliseconds, currently it requires reading the source to figure it
out, that is unacceptable.

On Mon, Sep 7, 2009 at 2:03 PM, Michael Zanetti<michael_zanetti at gmx.net> wrote:
> commit 3bff88683f0abeba6a03909f05a130fb4871738c
> Author:     Michael Zanetti <michael_zanetti at gmx.net>
> AuthorDate: Mon Sep 7 12:19:42 2009 +0200
> Commit:     Michael Zanetti <michael_zanetti at gmx.net>
> CommitDate: Mon Sep 7 12:19:42 2009 +0200
>
>    Added DBus functions Forward(int) and Backward(int)to Player
>
> diff --git a/src/dbus/PlayerDBusHandler.cpp b/src/dbus/PlayerDBusHandler.cpp
> index 4c05888..6bbf910 100644
> --- a/src/dbus/PlayerDBusHandler.cpp
> +++ b/src/dbus/PlayerDBusHandler.cpp
> @@ -196,6 +196,18 @@ namespace Amarok
>     {
>         The::svgHandler()->setThemeFile( path );
>     }
> +
> +    void PlayerDBusHandler::Forward( int time )
> +    {
> +        if ( time > 0 && The::engineController()->state() != Phonon::StoppedState )
> +            The::engineController()->seek( The::engineController()->trackPosition() * 1000 + time );
> +    }
> +
> +    void PlayerDBusHandler::Backward( int time )
> +    {
> +        if ( time > 0 && The::engineController()->state() != Phonon::StoppedState )
> +            The::engineController()->seek( The::engineController()->trackPosition() * 1000 - time );
> +    }
>
>     QVariantMap PlayerDBusHandler::GetMetadata()
>     {
> diff --git a/src/dbus/PlayerDBusHandler.h b/src/dbus/PlayerDBusHandler.h
> index 7d22b33..279735c 100644
> --- a/src/dbus/PlayerDBusHandler.h
> +++ b/src/dbus/PlayerDBusHandler.h
> @@ -96,6 +96,9 @@ namespace Amarok
>
>             void LoadThemeFile( const QString &path ) const;
>
> +            void Forward( int time );
> +            void Backward( int time );
> +
>         signals:
>             void CapsChange( int );
>             void TrackChange( QVariantMap );
> diff --git a/src/dbus/org.freedesktop.MediaPlayer.player.xml b/src/dbus/org.freedesktop.MediaPlayer.player.xml
> index 10f9e35..309213d 100644
> --- a/src/dbus/org.freedesktop.MediaPlayer.player.xml
> +++ b/src/dbus/org.freedesktop.MediaPlayer.player.xml
> @@ -87,5 +87,13 @@
>         <arg type="s" direction="in"/>
>     </method>
>
> +    <method name="Forward">
> +        <arg type="i" direction="in"/>
> +    </method>
> +
> +    <method name="Backward">
> +        <arg type="i" direction="in"/>
> +    </method>
> +
>   </interface>
>  </node>
>
>
>


More information about the Amarok-devel mailing list