[gmpi] Re: lost-n-found #3 parameter stuff

On Sat, Nov 06, 2004 at 01:58:22AM +0100, Koen Tanghe wrote:
> Could you please still spell out the steps involved in the case I described,
> if you still feel like it or have the time? I think I need to see it to be
> completely reassured ;-)
> - spin control in host UI for frequency displayed in Hz with single
> - "up arrow" click
> - step either in semi-tones or in Hz according to second parameter

How about something like:

* Assume a plugin without a custom GUI
* Assume said plugin has a frequency control, which is a float between 0.0
  and 48000.0.
* Assume said plugin has a granularity control, which is a boolean meaning
  0 = semi-tones
  1 = Hz
* Assume current frequency is 20.0, and granularity is set to "Hz".
* User clicks 'increment' on frequency

Host:
        float old_val;
        float new_val;
        old_val = plug->parameter[p]->value;
        new_val = plug->parameter[p]->increment(old_val, 1);

Plug:
        if (current_granularity == GRAN_HZ)
                return old_val + n;
        else
                return semi_tone_incr(old_val, n);

Host:
        send_float_event(plug->parameter[p], new_event);

> > All of these are complexity.  If we make them optional, then hosts have to
> > test for them and have default handling.  If we make them mandatory, then
> > plugins will all have to provide them and have that bloat.
> 
> Since not everybody thinks it will need to be more than just a "atof", why
> not just provide default implementations that do just that and let the
> plugin override them somehow if it wants to?
>     from_string : atof
>     to_string : snprintf
>     increment_method : +n

Depending on the model we end up going with, that would be fine, AS LONG
AS it does not force all that code to be bundled into each plugin.

Tim

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: