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

On Saturday, November 06, 2004 2:54 AM [GMT+1=CET],
Tim Hockin <xxxthockin@xxxxxxxxxxxxx> wrote:

> 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);

OK. That works for me.

>> 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.

OK, that is what I meant by "default implementations".

Koen


----------------------------------------------------------------------
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: