Bug 227312 - [PATCH] 2.1 -2.2: different behaviour of event Amarok.Engine.trackFinished
Summary: [PATCH] 2.1 -2.2: different behaviour of event Amarok.Engine.trackFinished
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Tools/Script Manager (show other bugs)
Version: 2.3-GIT
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 2.3.0
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-17 04:54 UTC by Michael MacDonald
Modified: 2010-03-17 08:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch from git master as of 02/27 (3.67 KB, patch)
2010-02-27 19:35 UTC, Michael MacDonald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael MacDonald 2010-02-17 04:54:56 UTC
I'm re-opening this bug (by cloning) because the trackFinished functionality as it stands is pretty useless and I think it should be fixed.  The bug was created with this check-in:

<<
commit 01da0b89d2c6ebe705e681110ff0c9abff931400
Author: Alex Merry <kde@randomguy3.me.uk>
Date:   Sun Jul 12 09:11:34 2009 +0000

    randomguy3 does housekeeping part 2c: remove the signals from EngineController
, and convert things that used them to EngineObserver.

    Also, make EngineObserver robust against the EngineSubject being deleted befor
e the EngineObserver.


    svn path=/trunk/extragear/multimedia/amarok/; revision=995177
>>

When the signals were removed from EngineController, some places where EngineController emitted a trackFinished were not replaced by an equivalent call to EngineObserver.

I'm not sure that the behavior prior to this for trackFinished was completely correct, which may have led to the confusion in the change of implementation.  I think the correct place to do a trackFinished emit is from EngineController::slowAboutToFinish

+++ This bug was initially created as a clone of Bug #211685 +++

Hi,
in amarok 2.1 the amarok event Amarok.Engine.trackFinished calls my function after the end of each track in the play list (like the name said).
Today I tried amarok-nightly, here only after the end of the play list my function will be called.

I just need the point at end of the play list for my needs, but would prefer to have a stable behaviour. Could you have a look please? 
Thanks in advance.
Best Regards Rico

PS: Script can be downloaded here:
http://www.kde-apps.org/content/show.php?content=114274&vote=good&tan=85693468&PHPSESSID=6a7d094101f59512f6d8f7315f9bcfcb
Comment 1 Michael MacDonald 2010-02-17 04:56:24 UTC
That would be EngineController::slotAboutToFinish, not slowAboutToFinish
Comment 2 Michael MacDonald 2010-02-27 19:35:14 UTC
Created attachment 41173 [details]
Patch from git master as of 02/27

Here is a patch that makes the change suggested.
Comment 3 Myriam Schweingruber 2010-02-28 10:24:06 UTC
Thank you for the patch. Please make a merge request on http://gitorious.org/amarok/amarok
Comment 4 Michael MacDonald 2010-03-02 04:52:30 UTC
Created Merge Request #135 on gitorious for this.

Since gitorious seems to be a little buggy, this took a few tries, but the
merge request 135 that exists now is correct.
Comment 5 Mark Kretschmann 2010-03-17 08:53:33 UTC
commit c45b37373f1e953e6b420d9ad64a27ae321f47d9
Author: Mark Kretschmann <kretschmann@kde.org>
Date:   Wed Mar 17 08:48:38 2010 +0100

    Add new "trackFinished" scripting function.
    
    Reviewed by Leo Franchi and me.
    Thanks for the patch go to Michael MacDonald <mars@antlersoft.com>.
    
    BUG: 227312

diff --git a/ChangeLog b/ChangeLog
index 76d54f4..a88e818 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ Amarok ChangeLog
 
 VERSION 2.3.1-Beta 1
   FEATURES:
+     * The scripting system now offers a new function for detecting that a 
+       track has finished. Patch by Michael MacDonald <mars@antlersoft.com>.
+       (BR 227312)
      * New "CoverBling" applet, which allows to browse your collection in an 
        animated 3D view. Thanks to Manu Wagner <manu.wagner@sfr.fr>.
      * Support for the new System Tray technology from KDE SC 4.4. This adds