After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776668 - double click on seek bar pauses the song
double click on seek bar pauses the song
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.23.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
: 776667 (view as bug list)
Depends on:
Blocks: 777346 778870
 
 
Reported: 2017-01-01 04:27 UTC by Mohammed Sadiq
Modified: 2017-04-13 10:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Prevent pause on clicking progress scale multiple (1.85 KB, patch)
2017-01-16 13:11 UTC, Abhinav Singh
none Details | Review
player.py : Prevent pause when multiple click on progress (1.31 KB, patch)
2017-02-05 16:08 UTC, Abhinav Singh
none Details | Review
Prevent pause when seeking (1.52 KB, patch)
2017-02-16 15:58 UTC, Abhinav Singh
committed Details | Review
Simultaneously play music when seeking (2.00 KB, patch)
2017-02-16 15:58 UTC, Abhinav Singh
none Details | Review
player.py : Simultaneously play music when seeking (2.26 KB, patch)
2017-02-16 16:32 UTC, Abhinav Singh
none Details | Review
player.py: Simultaneously play music when seeking (2.30 KB, patch)
2017-02-16 21:16 UTC, Abhinav Singh
none Details | Review
player.py : Simultaneously play music when seeking (2.88 KB, patch)
2017-03-03 23:39 UTC, Abhinav Singh
committed Details | Review
player: Fix stuttering when seeking (1009 bytes, patch)
2017-03-27 10:56 UTC, Abhinav Singh
committed Details | Review

Description Mohammed Sadiq 2017-01-01 04:27:08 UTC
double clicking on the seek/progress bar pauses the playing song. I don't know if this is a feature or a bug. For me it seems more like a bug.
Comment 1 Abhinav Singh 2017-01-16 13:11:43 UTC
Created attachment 343553 [details] [review]
Prevent pause on clicking progress scale multiple

Progress scale's button press event was getting called multiple times before a single button release event was called. This messed up the last state of the player, and caused it to pause. This might be a bug with how gtk/gdk handles events.
Introduced a boolean to sync those event.


I think this surely is an inconvenience. Because many times user will press progress scale multiple times while moving it, and if the track gets paused, then user will have to play it again.
Comment 2 Abhinav Singh 2017-02-05 16:08:34 UTC
Created attachment 344982 [details] [review]
player.py : Prevent pause when multiple click on progress

Make sure the event is just a single click before pausing the song.

'button-press-event' gets called multiple times before a 'button-release-event' is called if the user has double/triple clicked.
Comment 3 Marinus Schraal 2017-02-13 16:31:46 UTC
Review of attachment 344982 [details] [review]:

This solution works and is much cleaner than the first patch: kudos.

However, I was actually looking at why we even have a callback for on_button_press event, apparently it is so the songs is paused otherwise the button will reset to it's state in the playing position (probably b/c of the progressbar being updated).

If I look at the same thing in eg. totem then we can just seek through the song and hear the sound at that point in time, the music keeps playing. I think this is much more desirable behaviour than pausing on seek. I think we need to investigate & go that route.
Comment 4 Marinus Schraal 2017-02-13 22:17:55 UTC
*** Bug 776667 has been marked as a duplicate of this bug. ***
Comment 5 Abhinav Singh 2017-02-16 15:58:14 UTC
Created attachment 345954 [details] [review]
Prevent pause when seeking

Removed lastState and prevent pause on seekbar button press event.
Comment 6 Abhinav Singh 2017-02-16 15:58:54 UTC
Created attachment 345955 [details] [review]
Simultaneously play music when seeking

Connect to 'change-value' of the progress bar.
Comment 7 Abhinav Singh 2017-02-16 16:32:22 UTC
Created attachment 345962 [details] [review]
player.py : Simultaneously play music when seeking

Patch over Prevent pause when seeking.

It instantly plays when seeking. Does not use time_out of button-press button-release events of progress bar.
Comment 8 Abhinav Singh 2017-02-16 21:16:23 UTC
Created attachment 346000 [details] [review]
player.py: Simultaneously play music when seeking

Connect to 'change-value' of the progress bar.

Along with smooth simultaneous playing, this patch also adds a minimum seek such that seeking with infinitesimal amounts does not stutter the song.
Comment 9 Marinus Schraal 2017-02-18 10:50:22 UTC
Review of attachment 345954 [details] [review]:

lgtm
Comment 10 Marinus Schraal 2017-02-18 11:18:21 UTC
Review of attachment 346000 [details] [review]:

I'm not 100% sure the code on removing the mini-stutter is really needed and not overcomplicating things.

Other than that and the comments it's looking good.

::: gnomemusic/player.py
@@ +81,3 @@
     nextTrack = None
     timeout = None
+    seek_timeout = None

_seek_timeout

Also I don't think this should be a class variable, but should be just declared in __init__.

@@ +827,3 @@
+        self._old_progress_scale_value = 0.0
+
+    def _on_progress_scale_seek(self, scale, scroll_type, value):

I think a docstring explaining what is going on in here is useful.

@@ +834,3 @@
+            self._old_progress_scale_value = self.progressScale.get_value()
+
+        def on_progress_scale_change_value():

Although this is internal, I don't think it's a good idea to name it the same as a main class function.
Comment 11 Abhinav Singh 2017-03-03 23:39:33 UTC
Created attachment 347178 [details] [review]
player.py : Simultaneously play music when seeking

Connect to 'change-value' of the progress bar. Only after a seek has
become stable, we play the song from its location.
Comment 12 Marinus Schraal 2017-03-04 12:21:32 UTC
Review of attachment 347178 [details] [review]:

lgtm

the only minor thing is that the calling arguments for functions aren't in the docstrings (see other docstrings in the project)..
Comment 13 Marinus Schraal 2017-03-13 21:17:35 UTC
Nice patch, thanks. Applied.
Comment 14 Abhinav Singh 2017-03-27 10:56:07 UTC
Created attachment 348787 [details] [review]
player: Fix stuttering when seeking

Old progress scale value was not updating causing minor stuttering.
Update its value when a seek is finished.

Marinus Schraal: I missed a line in the previous patch :x
Comment 15 Marinus Schraal 2017-04-13 10:18:53 UTC
Comment on attachment 348787 [details] [review]
player: Fix stuttering when seeking

My bad, missed this earlier.

Attachment 348787 [details] pushed as 14f0175 - player: Fix stuttering when seeking