Control

forum for discussing Control interface software

Register or log in - lost password?

Control » General

Slider - finger close enough

(4 posts) (4 voices)
  • Started 2 years ago by terry
  • Latest reply from admin

Tags:

  • blue christian louboutin
  • christian louboutin outlet store
  • dress bridesmaid
  • fake watches
  • Food & Drink Costumes
  • halloween costumes outlet
  • red pumps
  • Rolex Replica Watches
  • slider
  • summer dresses on sale
  • white dresses
  1. terry
    Member

    One of the frustrations I had with sliders is that if the current value was set low and I picked a high value it just jumped there. I wanted to only move if my touch was within a certain distance of the current value.

    I've come up this this change to changeValue for the Slider Widget.

    I've picked 0.1 i.e.,I have to be within a tenth (of the length of the slider) of the current value for it to recognise the change.

    If you will include this in the next version, I suggest that the ).1 becomes a settable property.

    this.changeValue = function(val) {
    var newv1,newv2,diff;
    if(!this.isVertical) {
    newv1 = 1 - ((this.x + this.width) - val) / (this.width);
    }else{
    newv1 = (((this.y + this.height) - val) / (this.height));
    }

    newv2=this.min + ( newv1 * ( this.max - this.min ) );
    diff=Math.abs((this.value-newv2)/(this.max-this.min));
    if (diff <0.1) {
    this.setValue( newv2);
    }
    }

    Best wishes
    Terry

    Posted 2 years ago #
  2. trueusername
    Member

    I wanted to only move if my touch was within a certain distance of the current value.Admin just checking in.

    Posted 1 year ago #
  3. bilderbuchi
    Member

    typically (with midi controllers) that problem is solved by an algorithm only sending values if you cross the currently set value. is it called "pick up"? "take up"? something like this.

    Posted 1 year ago #
  4. admin
    Key Master

    When the next version of Control comes out (as soon as I finish implementing the microphone widget to detect volume / pitch) there will be some -much- more convenient ways to customize widgets. You can read about them here:

    http://charlie-roberts.com/Control/forum/topic.php?id=296#post-847

    Changes made to the object prototypes will apply across interfaces. So if I don't get around to implementing this next version (which would take an hour or so to do both the iOS and Android versions, add a property, change the methods, update the docs etc.) at least there will be an easy way to add it in yourself.

    I do think it's a useful addition... just trying to budget my time. - Charlie

    Posted 1 year ago #

RSS feed for this topic

Control is proudly powered by bbPress.