Feature #706

make c-menu play/pause buttons into a toggle

Added by Liviu Andronic 4 months ago. Updated 3 months ago.

Status:New Start date:February 26, 2017
Priority:Minor Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Affects version:3.8.2

Description

Currently the systray c-menu has both a Play and a Pause button.

It would be neater if the two were combined into a single Play/Pause toggle, similarly to how this is already on the main toolbar.

Screenshot_2017-02-26_23-31-01.png (16.9 kB) Liviu Andronic, February 26, 2017 23:46

Screenshot_2017-03-06_15-16-18.png - Playback menu (52.8 kB) Liviu Andronic, March 06, 2017 15:19

History

#1 Updated by Liviu Andronic 4 months ago

I've just realized that this request would likely affect the Playback menu as well:

Playback menu

Overall this would make all the playback menus / buttons more consistent with each other.

#2 Updated by Liviu Andronic 3 months ago

I should mention that right now, inadvertently it seems, hitting the Pause button twice will have essentially the same effect as a Play/Pause toggle.

If I were to tackle this feature myself, how should I approach it? I looked already at `ui_gtk.cc` though it's not yet perfectly clear to me how the toggle is being achieved there (there is only `button_play` and no `button_pause` there). And I looked at `statusicon.cc`, but it's not obvious to me how to the Play and Pause buttons into a toggle...

#3 Updated by John Lindgren 3 months ago

Adding support for "dynamic" menus wouldn't be a good task for a new contributor since there will be some API design involved. If you're interested in contributing in other areas, there are still some missing features in the Qt UI that need to be ported. I would be thrilled to see pull requests for some of those.

#4 Updated by John Lindgren 3 months ago

Liviu Andronic wrote:

I should mention that right now, inadvertently it seems, hitting the Pause button twice will have essentially the same effect as a Play/Pause toggle.

That's intentional. The "Pause" command is really pause/unpause. And "Play" is not identical to unpause, so the two are not redundant.

#5 Updated by Liviu Andronic 3 months ago

John Lindgren wrote:

The "Pause" command is really pause/unpause. And "Play" is not identical to unpause, so the two are not redundant.

I think I understand now. From what I see, there are three possible 'initial' states:
- stopped
- playing
- paused

The current arrangement seems to work like this:
- Play will start playing the track from the beginning if 'stopped' or 'playing', and resume playing the track if 'paused'
- Pause will pause the track if 'playing', resume playing the track if 'paused', and do nothing if 'stopped'
- Stop will stop the track if 'playing' or 'paused', and do nothing if 'stopped'

For me the arrangement is still somewhat confusing, especially Pause acting as a Play/Pause toggle (with no dynamic icon change) and Pause being available when 'stopped'.

In principle 'playing' and 'paused' are mutually exclusive states, which is why having a Play/Pause toggle would make sense. So the proposed arrangement would work like this:
- Play will start playing the track from the beginning if 'stopped', and resume playing the track if 'paused'
- Pause will pause the track if 'playing'
- Stop will stop the track if 'playing' or 'paused', and do nothing if 'stopped' (same as before)

Overall this seems to greatly simplify the logic of the Play/Pause arrangement and make it more intuitive. If the user wants to start the track from the beginning when currently 'playing', we can reasonably expect them to first hit Stop then Play -- it seems like this would remain the only usecase that wouldn't be covered directly by a single menu item.

Also available in: Atom PDF