[gmpi] Re: low level API - Abstract Factory summary

  • From: "Angus F. Hewlett" <angus@xxxxxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Thu, 10 Feb 2005 09:50:41 +0000

Mike Berry wrote:

Steve's comments here have made me think of something which may be a problem for GUIDs, but not so much for URIs. Lets say you write a VST wrapper plugin which can host a VST plugin. How do you give it a GMPI GUID? You would need to construct one on the fly, which would have repeatability problems and machine-to-machine problems.

This is absolutely true, and I speak from personal experience here.

For the VST-DX wrapper (DX uses two GUIDs per plug-in), we cheated as follows:-

The first 4 bytes of each of the GUID-pair were randomly generated using MS' generator.

The next 4 bytes are the VST unique-ID

The final 8 bytes are the first eight chars of the VST plug-in's 8.3 filename.

Why did we do this?

- Randomly generated GUIDs would be unique to the END-USER's machine, and so other users with the wrapper and the same VSTs couldn't open their songs
- A central registry of VST-plugin->GUID maps was unmaintainable and impractical
- Originally, the design was to have 12 bytes from Guidgen and 4 from the VST-ID, but it turns out that VST-IDs are not very unique. So we had to grab another 8 bytes which would not vary from machine to machine, or plug-in minor-version to minor-version (that ruled out hashes based on DLL binary data)


Similarly, for the VST-AU wrapper (AU uses a 12 byte id - MANU: TYPE: PLUG), we set our manufacturer ID, whatever type-ID is required by the AU spec, and use the four-byte VST-ID for the final 4 bytes. In this case, we can't do anything but warn the user if VST-IDs collide, which sucks.

URIs as plaintext make it much easier for everyone to spot problems. Nothing can stop problems from happening in the first place, but if even the user can open up somebody's plug and see "GMPI://testplug.com/foobar" in there, well, that ought to shame the developer in to doing something ;-)

Regards,
      Angus.

--
=========================================================
Angus F. Hewlett, Managing Director (CEO)
FXpansion Audio UK Ltd - http://www.fxpansion.com
Registered in the UK - #4455834 - VAT: GB 798 7782 33
=========================================================



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