Bug 60406 - Clicks on the slider do not seek the song enough
Summary: Clicks on the slider do not seek the song enough
Status: RESOLVED FIXED
Alias: None
Product: noatun
Classification: Miscellaneous
Component: hayes (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Neil Stevens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-27 04:22 UTC by shu
Modified: 2003-07-10 13:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Calls setSteps on the slider (351 bytes, patch)
2003-07-10 03:38 UTC, shu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shu 2003-06-27 04:22:46 UTC
Version:            (using KDE KDE 3.1.2)
Installed from:    Compiled From Sources

Clicks on empty locations don't seek enough.

On my system, clicks on the right side actually seeks backwards a little bit, though Neil says it works on his system as intended.
Comment 1 Carsten Pfeiffer 2003-06-27 12:32:10 UTC
Huh, indeed. Maybe a bug in this L33tSlider thing? Didn't investigate yet. 
Comment 2 shu 2003-07-10 03:38:27 UTC
Created attachment 1979 [details]
Calls setSteps on the slider

It's just a oneline patch that calls setSteps to set the pageStep of the
L33tSlider. The person who implemented the slider for Hayes used the (QObject
*, const char *) ctor instead of the one where you specify range and pageStep.
As a result, the pageSteps never got set? I don't know the workings of
L33tSlider, but this patch does what I want it to.

If length / 10 is okay with everyone for the pageStep, I'll close this bug.
Comment 3 Neil Stevens 2003-07-10 13:45:56 UTC
Subject: kdeaddons/noatun-plugins/hayes

CVS commit by neil: 

Set a range like Excellent does so that clicks will seek a decent amount.

CCMAIL: 60406-done@bugs.kde.org


  M +6 -3      window.cpp   1.38


--- kdeaddons/noatun-plugins/hayes/window.cpp  #1.37:1.38
@@ -99,5 +99,5 @@ Hayes::Window::Window()
         (void)new KAction(i18n("About Hayes..."), 0, this, SLOT(aboutHayes(void)), actionCollection(), "abouthayes");
 
-        slider = new L33tSlider(0, "seek-slider");
+        slider = new L33tSlider(0, 1000, 10, 0, L33tSlider::Horizontal, this, "seek-slider");
         slider->setOrientation(Horizontal);
         connect(slider, SIGNAL(userChanged(int)), SLOT(sliderChanged(int)));
@@ -191,5 +191,5 @@ void Hayes::Window::init(void)
 void Hayes::Window::sliderChanged(int value)
 {
-        napp->player()->skipTo(value);
+        napp->player()->skipTo(value * 1000);
 
         QToolTip::add(slider, i18n("Seek: %1").arg( napp->player()->lengthString()));
@@ -209,5 +209,8 @@ void Hayes::Window::updateSlider()
 {
         if (!napp->player()->isStopped())
-                slider->setValue(napp->player()->getTime());
+        {
+                slider->setRange(0, napp->player()->getLength() / 1000);
+                slider->setValue(napp->player()->getTime() / 1000);
+        }
 
         QToolTip::add(slider, i18n("Seek: %1").arg( napp->player()->lengthString()));