[MPlayer-dev-eng] [PATCH] GUI: Implement a true rotary potmeter
Hans-Dieter Kosch
hdkosch at kabelbw.de
Tue Apr 8 01:08:47 CEST 2014
Ingo Brückl wrote:
> Hans-Dieter Kosch wrote on Mon, 07 Apr 2014 03:27:22 +0200:
>
>> 'wsRLMouseButton' must regard the stop gap like 'wsMoveMouse' does,
>> otherwise the potmeter's position may jump away after dragging and
>> releasing (see my original patch).
>
> Please apply this patch additionally for testing (playbar will be
> accordingly).
It works :-)
> --- gui/ui/main.c 2014-04-07 19:47:42.000000000 +0200
> +++ gui/ui/main.c.new 2014-04-07 19:50:56.000000000 +0200
> @@ -141,7 +141,10 @@
> if ( itemtype == itRPotmeter )
> {
> last_point=appRadian( item, X - item->x, Y - item->y ) -
item->zeropoint;
> - endstop=False;
> + if ( last_point < 0.0 ) last_point+=M_2PI;
> + if ( last_point <= item->arclength ) endstop=False;
> + else if ( last_point < item->arclength / 2 + M_PI )
endstop=STOPPED_AT_100;
> + else endstop=STOPPED_AT_0;
> }
> break;
> case wsRLMouseButton:
A comment in the code about the purpose and the logic behind it would be nice ;-)
Hans-Dieter
More information about the MPlayer-dev-eng
mailing list