[MPlayer-dev-eng] [PATCH] GUI: Implement a true rotary potmeter

Hans-Dieter Kosch hdkosch at kabelbw.de
Tue Apr 8 01:56:39 CEST 2014


Ingo Brückl wrote:

> Hans-Dieter Kosch wrote on Mon, 07 Apr 2014 03:27:22 +0200:

>> gui/skin/skin.c:
>> The syntax using "'" appears somewhat strange to me.
> 
> Yeah, I don't like it much either, but...

> ...I didn't want the rpotmeter to have more parameters than the other ones.
> (Well, it actually has to have and has more parameters, but I wanted to
> somehow hide it.)

It can't be really hidden, as the rpotmeter in fact has more parameters. It's 
simply not the same as a linear poti. So, I see no problem giving it a skin 
definition differing from the linear ones (but of course as consistent as possible).

> So, do you have any idea how to nicely slip the four extra parameters?

I'll think about and provide a suggestion.

>> The special case 'x0 == x1 && y0 == y1' to determine if 'zeropoint' and
>> 'stop' are the same seems not needed. There are more cases where this
>> happens: x0 == 0 and x1 == 0 and y0 and y1 are in the same quadrant or vice
>> versa.

>> So, simply calculate 'stop' and apply it.
> 
> Well, I did so at first, but I got a difference of something like 9E-17
> after calculation for two same points. (Must have been late in the night when
> I simply chose the current solution, but I should have investigated.)

I see, floating point precision issue. So, leave that trap and add traps for the 
cases where the points lie on the x/y axis. On the other hand, has such an 
inaccuracy a practical impact?

>> The stop gap doesn't work reliably for me. Seems to be dependent on speed
>> of mouse movement, i.e. dependent on the actually captured positions.
> 
> At which speed do you encounter problems?

I can't reproduce it anymore. My observation was, that the poti didn't always 
stop at 100% when dragging the mouse. For now, all is working perfectly.

Hans-Dieter


More information about the MPlayer-dev-eng mailing list