Bug 283601 - More intelligent scrolling heuristics for lyrics
Summary: More intelligent scrolling heuristics for lyrics
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Context View/Lyrics (show other bugs)
Version: 2.5.0
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: 2.6
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-08 13:58 UTC by Stephan Friedrichs
Modified: 2012-08-25 11:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.6


Attachments
screenshot: lyrics settings (47.92 KB, image/png)
2011-11-25 11:42 UTC, Mike Morris
Details
Screenshot of the Lyrics applet (44.38 KB, image/png)
2011-11-26 16:10 UTC, Myriam Schweingruber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Friedrichs 2011-10-08 13:58:20 UTC
Version:           2.4.3 (using KDE 4.7.1) 
OS:                Linux

Currently, amarok automatically scrolls the lyrics by a simple strategy: If the song has been played for x %, it sets the scrollbar to x % as well.

This already is a great feature and it works best at around 50%, but gets imprecise at the beginning and the end of a song. Why? Because after x %, you want to *center* the lyric-line that is at x %. Example:

Let's - for simplicity's sake - assume the song lasts 100 seconds and there are 100 lines of lyrics. Then you want to see line 1 in second 1, line 2 in second 2, and so forth. But that's not achieved by scrolling x % in second x, because line 1 already starts vanishing in second 2 (which currently happens).

I suggest fixing this by telling the scrolling widget to center line x in second x. By trying to center line 1 in second one, it would scroll up, and by centering line 2 in second 2, it would (assuming the display is not too small) stay right there. Only after the song has progressed for (displayheight / 2) seconds (still in my 100-example ;) ), it would start scrolling down. When the end of the song is reached, there is a similar situation.

This way, autoscrolling would be much more robust to intros, outros and instrumental parts.

Reproducible: Always

Steps to Reproduce:
Watch lyrics on long songs with instrumental intro and autoscroll activated.

Actual Results:  
Lyrics aren't scrolled very smart.

Expected Results:  
Lyrics should be scrolled a little smarter.

I tried to track down where changes in the source would have to be applied, and I found LyicsAppletPrivat::_trackPositionChanged(...). It appears to basically set the slider position to (position/trackLength)*maxPosition, while it should set it to sth. like

 max(0, (position/trackLength - (displayedPercentage/2))*maxPosition)

Unfortunately, I'm unfamiliar with Qt, KDE and Amarok programming, so I can't give it a try in reasonable time :(

But I hope you like the idea and can do this in a few minutes :)
(or give me a hint of what to do / where to start / how to test so I can try to write a patch)
Comment 1 Mike Morris 2011-11-21 10:33:15 UTC
Should also provide a preference to TURN OFF the auto-scrolling abomination.
Comment 2 Myriam Schweingruber 2011-11-21 15:17:50 UTC
(In reply to comment #1)
> Should also provide a preference to TURN OFF the auto-scrolling abomination.

Did you ever use it? You can disable it, check again :)
Comment 3 Mike Morris 2011-11-24 11:45:02 UTC
On 21/11/2011 17:17, Myriam Schweingruber wrote:

>> Should also provide a preference to TURN OFF the auto-scrolling abomination.
> 
> Did you ever use it? You can disable it, check again :)

Please tell me how. I have found nothing in the GUI, and nothing that
looks like "en/disable scrolling" for the lyrics applet in the rc files.

My guess is that it got switched on by a dist-upgrade :-(
Comment 4 Myriam Schweingruber 2011-11-25 08:12:18 UTC
(In reply to comment #3)
> On 21/11/2011 17:17, Myriam Schweingruber wrote:
> 
> >> Should also provide a preference to TURN OFF the auto-scrolling abomination.
> > 
> > Did you ever use it? You can disable it, check again :)
> 
> Please tell me how. I have found nothing in the GUI, and nothing that
> looks like "en/disable scrolling" for the lyrics applet in the rc files.

Check again, there is an icon for it with a tooltip to the left of the green refresh icon.
Comment 5 Mike Morris 2011-11-25 11:42:13 UTC
Created attachment 66061 [details]
screenshot: lyrics settings
Comment 6 Mike Morris 2011-11-25 11:43:27 UTC
Nothing to see there - see screenshot. Maybe something recent on a dev branch?

Amarok Version 2.4.3
Using KDE 4.7.2 (4.7.2)
(as delivered via Kubuntu 11.10)
Comment 7 Myriam Schweingruber 2011-11-26 16:10:36 UTC
Created attachment 66096 [details]
Screenshot of the Lyrics applet

Why do you look in the settings? Check the button left of the green refresh button.
Automatic Lyrics scrolling with this button is available since Amarok 2.4.3, nothing was changed in that code since.
Comment 8 Mike Morris 2011-11-27 10:16:30 UTC
On 26/11/2011 18:10, Myriam Schweingruber wrote:

> Why do you look in the settings? Check the button left of the green refresh
> button.

Because when I click on the button to the left of the green arrow
nothing happens. When I right-click that button the only menu option is
"Lyrics Settings". If I click the spanner button to the _right_ of the
green arrow all I get is "Lyrics Settings".

Do you think the Kubuntu distro has messed up something in the build? If
so I can take it up with them rather than annoying you-all with what
appears, after all, to now be a support issue... ;-) (But thanks for the
help, anyway! :)
Comment 9 Myriam Schweingruber 2011-11-27 20:09:08 UTC
I very much doubt that as I also use Kubuntu and that button works as it should. Maybe something is wrong in your installation, please check that all packages have the correct version.
Comment 10 kabud 2012-02-19 14:00:56 UTC
Returning to the originial report about improving the autoscroll - in which im highly interested myself - the status is NEEDSINFO as WAITINGFORINFO. What info is needed?
Comment 11 Myriam Schweingruber 2012-02-19 14:07:44 UTC
(In reply to comment #10)
> Returning to the originial report about improving the autoscroll - in which im
> highly interested myself - the status is NEEDSINFO as WAITINGFORINFO. What info
> is needed?

Please read comments #8 and #9
Comment 12 kabud 2012-02-19 14:43:30 UTC
uhm, maybe its just me, but i cant see anything relevant there.

the original report from Stephan Friedrichs was about improving the autoscroll in a way that attempts to keep the _current_ line of the lyrics in the _middle_ of the screen, as opposed to the current behaviour of scroll to x% of the lyrics after x% of the song has played. this current behaviour is ok in the middle of a song, but during the intro/outro of a song you can end up with the current line beeing invisible, because it has already scrolled off/not yet scrolled in.

from post #1 through post #9 happened a highjacked discussion between you and Mike Morris about turning off autoscroll.
Comment 13 Myriam Schweingruber 2012-02-20 09:34:08 UTC
You are right, changing status
Comment 14 Sam Lade 2012-05-14 01:09:46 UTC
Git commit c4386adf8963c65e5bee5dedb8536f1e6594fcb1 by Sam Lade.
Committed on 14/05/2012 at 03:02.
Pushed by lade into branch 'master'.

Lyrics applet scrolls more intelligently

Aim to keep the current position in the lyrics centred, rather than
directly moving the scroll bar based on the position in the song.
Patch by Alexander Potashev.
FIXED-IN:2.6
REVIEW:104935

M  +2    -0    ChangeLog
M  +7    -2    src/context/applets/lyrics/LyricsApplet.cpp

http://commits.kde.org/amarok/c4386adf8963c65e5bee5dedb8536f1e6594fcb1