On Fri, Aug 08, 2003 at 11:37:13 +0200, Koen Tanghe wrote: > > host: int volIdx = plug->GetParamIndexByName("/global/mixer/volume"); > > > > .. host can now use volIdx in automation calls. > > Seems like a good compromise, yes. > > Marc's reservations against using strings instead of for example enums (I > think that's what he was thinking of?) while programming seems also viable > to me though (compilers can check for that, not for strings). > But then again I'd still prefer the string approach in the long term because > it seems more natural to me. What about hashes? If you agree on a decent even hash (crc32 or a partial md5) from a control path name then you dont need an explit function in the plugin to assign an id; a gmpi support library can provide the hashing function. md5 takes around 1000 cycles to execute (on a PIII or similar) and produces up to 128bits, crc32 about takes something like 500 cycles. the plugin can do gmpi_id my_control = gmpi_hash("/global/mixer/volume"); in its init() code, or prefedine them in a .h file, and the host can do something similar once the plugin has given it the paths of its ports. The downside is that the control ids wont be contiguous. - Steve ---------------------------------------------------------------------- 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