[Amarok] Instant stop if not playing, rather than if paused

Mark Kretschmann kretschmann at kde.org
Sun Sep 27 19:31:01 CEST 2009


On Fri, Sep 18, 2009 at 10:27 PM, Alex Merry <kde at randomguy3.me.uk> wrote:
> commit 82802d9b29ea9de842065cd5909696495608e86d
> Author:     Alex Merry <kde at randomguy3.me.uk>
> AuthorDate: Tue Sep 15 15:49:52 2009 +0100
> Commit:     Alex Merry <kde at randomguy3.me.uk>
> CommitDate: Fri Sep 18 21:22:20 2009 +0100
>
>    Instant stop if not playing, rather than if paused.
>
> diff --git a/src/EngineController.cpp b/src/EngineController.cpp
> index 0351dcc..1ed85c8 100644
> --- a/src/EngineController.cpp
> +++ b/src/EngineController.cpp
> @@ -467,8 +467,8 @@ EngineController::stop( bool forceInstant ) //SLOT
>         trackChangedNotify( Meta::TrackPtr( 0 ) );
>     }
>
> -    // Stop instantly if fadeout is already running, or the media is paused (i.e. pressing Stop twice)
> -    if( m_fader || m_media->state() == Phonon::PausedState )
> +    // Stop instantly if fadeout is already running, or the media is not playing
> +    if( m_fader || m_media->state() != Phonon::PlayingState )

These EngineController commits that changed the fade-out behavior
introduced a regression: Fade-out no longer works at all. Instead it
stops immediately.

One thing that is definitely wrong is the "if( m_fader... )" above. As
the Phonon::VolumeFaderEffect is never destroyed with the new system,
the pointer m_fader is never 0, and so the condition always evaluates
to true. "forceInstant" then becomes true, which results in instant
stopping instead of fading out.

I've fixed this locally on my box, but even then the fading doesn't
work properly here with the xine backend. When starting to play a new
track, the volume is muted. I haven't yet figured out why that
happens.

-- 
Mark Kretschmann
Amarok Developer
www.kde.org - amarok.kde.org


More information about the Amarok-devel mailing list