[MPlayer-dev-eng] [PATCH] GUI: Activate potmeter
Hans-Dieter Kosch
hdkosch at kabelbw.de
Fri Feb 28 04:26:31 CET 2014
Ingo Brückl wrote:
> Hans-Dieter Kosch wrote on Wed, 19 Feb 2014 00:36:59 +0100:
>
>> Ingo Brückl wrote:
>>> Hans-Dieter Kosch wrote on Sun, 16 Feb 2014 23:04:35 +0100:
>>>
>>>> The 'pressed' state of a 'potmeter' item is not initialised.
>>> Agreed.
>>>
>>>> By default it's 0 ('btnDisabled'), and the item is inactive.
>>> A potmeter doesn't have a btnDisabled state. Actually,
>>> the pressed state of a potmeter is irrelevant, because
>>> they cannot be pressed.
>>>
>> Cf. gui/skin/skin.c: line 619: in function item_hpotmeter():
>> item->pressed = btnReleased;
>
> I know, but you can't compare to a hpotmeter. A hpotmeter has a button, a
> potmeter doesn't.
Ok, so far. But the form of a potmeter - horizontal, vertical or round -
shouldn't have influence on its operation, should it? Can the round knob image
of a pot not also be formally regarded as a button?
The point of confusion seems to me, that a pot basically can't have a 'pressed'
state like a button, but this struct element is tri-state and the third value
'btnDisabled' is used to disable a button, however it also affects a
[hv]*potmeter (as said in the quote below).
Perhaps, it would be nice to have another element 'enabled' for clarity, but it
would entail changes in several files.
>> The 'item->pressed' is used in gui/ui/main.c, line 102:
>> if ( ( guiApp.mainItems[i].pressed != btnDisabled )&&
>> to determine if an object under the mouse is enabled. If it's
>> 'btnDisabled', then the object is ignored and the window is moved instead
>> of shifting the pot when the mouse is pressed and dragged.
>
> Ok. So you want a potmeter to be shiftable by the mouse?
That would be intuitive from user's perspective, just like other elements on the
skin can be controlled by the mouse.
> Did you notice that you already can do so with the Blue skin you were
> referring to while a video is playing? (So where do you miss mouse
> shiftability?)
Hmm, I can't reproduce. Even while playing a video, the window moves instead of
the volume pot rotating when pressing and dragging the mouse over the pot (it's
clearly the 'btnDisabled' state).
> (Admittedly, not all potmeters act this way. Would it be an alternative
> solution to adjust their behaviour to a movie position potmeter?)
>
> Please keep in mind that (currently) potmeters aren't designed for user
> action. (Don't blame me, I did not invent them.)
Then, they'd make no sense appearing on the skin (no worry, I don't blame). But
it could be easily fixed by this simple patch and all would be fine (besides the
aforementioned coding pressed<->enabled); the other [hv]potmeters are already ok.
BTW. If you could decide to make it mouse-controllable by this patch or similar,
then my second patch sent "Implement a true rotary potmeter" would yield a
really beautyful pot like seen on other players...
Hans-Dieter
More information about the MPlayer-dev-eng
mailing list