iiwusynth-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iiwusynth-devel] Recent CVS changes


From: Peter Hanappe
Subject: Re: [iiwusynth-devel] Recent CVS changes
Date: Tue, 03 Dec 2002 13:53:30 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1

Josh Green wrote:
Some notes and thoughts on recent CVS changes:

Missing a parameter in call to new_iiwu_timer in src/iiwu_seq.c:354, I
just put a 0 for the last parameter to get on with things.

I fixed it and commited it to CVS. Thanks.

Most of the stuff that broke the Swami iiwusynth plugin were related to
the changes to the settings system. I don't think the use of directly
accessed fields is such a good idea for a long term API. [cut]

A good system I have seen of being able to set a lot of settings in a
backward compatible manner (when not using GObject properties and
ParamSpecs :) would be to make iiwu_settings_t opaque (no direct access
by library users, make it a void *) and then provide accessor functions
to it. [cut]

I agree almost completely. The reason I didn't do it this way
was to avoid a tediously long list of setting parameters and testing
for error results. Something you get with a lot of libraries (ALSA
is one of them):

  if (settings_init(settings) != 0) {
    printf("failed to initialize settings");
    goto error_recovery;
  }
  if (settings_set_xyz(settings, foo, bar) != 0) {
    printf("error setting xyz");
    goto error_recovery;
  }
  /* ... */

Creating an iiwusynth object was to be snappy:

  iiwu_settings_t settings = IIWU_DEFAULT_SETTING;
  iiwu_synth_t* synth = new_iiwu_synth(&settings);

Two lines and you've got a running MIDI synthesizer!

Anyway, you're right, we should use accessor functions. API change
coming soon!


This brings me to realize another thing missing from the current way of
dealing with settings. Ways to determine min/max/default values for
different parameters.

Completely agree. It's the modern way to do things.

Since we have quite a big number of settings, I'll try to think of
an organized way to do this to avoid an API explosion.


Cheers,
Peter

Cheers.
        Josh Green



_______________________________________________
iiwusynth-devel mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/iiwusynth-devel








reply via email to

[Prev in Thread] Current Thread [Next in Thread]