[gmpi] Re: Topic 8: Parameters

  • From: "Silver Blade" <lists@xxxxxxxxxxxxxxxxx>
  • To: <gmpi@xxxxxxxxxxxxx>
  • Date: Sat, 9 Aug 2003 12:31:49 +0100

With the host application I've been slowly developing (with a lot of
redesigning in the process), I have adopted a RIFF format for the song
files. True, the format is quite old it seems, but it's more compact than
XML and I don't really see why anyone would want to edit parameters by hand
(ie, not using a GUI) anyway.

But anyway, what I'm doing is creating an instance of my own "RIFF_File"
class, and asking each module (mixer, arranger, event list - all internal at
present) to save it's data. Each module is subclassed from a SaveableModule
class. Module.Save() is called, passing the RIFF_File object as a parameter.
As each module is called, they then call a function of the RIFF_File class
to write data to the file - the parameters are header, buffer and size.

Once the module has saved its data, the next module is called, and so on.
Until all the data is saved.

Upon loading the file, the owner of the chunks are identified (they are
grouped as sub-chunks of things like MIXR, etc) and that module's Load()
function is called.

If an unknown chunk is found, it's still read into memory, but placed in a
special list which doesn't get used. Eventually, I may flush this data out
to disk until it's needed (ie, for saving the file.)

This would probably be over-kill for plugins, but for my host app it's ideal
since it means if someone uses a newer version of it, and then goes back to
the old one, the new data remains intact. This is something I had to battle
with when I wrote Midget - switching instrument/patch maps to GM and then
back again would result in patches being changed.


So, maybe something similar could be used... Unknown chunks could just be
ignored, but that decision should be made by the plugin (or rather, the
plugin's author.)

Just a thought.

-Andrew



----- Original Message ----- 
From: "Frederic Vanmol" <frederic@xxxxxxxxxxxxxxx>
To: <gmpi@xxxxxxxxxxxxx>
Sent: Friday, August 08, 2003 9:34 PM
Subject: [gmpi] Re: Topic 8: Parameters


> You make problems where there are none (IMHO).
>
> A plugin has one state, that of its latest version. However, since it's
> interesting to be able to load settings, you can send an old chunk (I'll
use
> the VST term) to the plugin and it will be able to interpret it. That's my
> main reason for wanting chunks. Let the plugin handle those problems,
since
> it knows what to do in every specific case. The host can only aspire to
> provide a good-enough generic solution, and then plugins will have to use
> workarounds to get more exotic results. Again, just my opinion.


----------------------------------------------------------------------
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: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: