setChunk return value

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I've just implemented chunks for my VST plugin and was wondering what the return value of setChunk should be. 0 for a fail 1 for success? I can't imagine this value making much difference, but perhaps there are some host that are picky about it?

Cheers,

Matt

Post

I just always return 0 and things work. :P

edit: note that documentation doesn't seem to specify anything..

Post

Another one of those weird parts of VST that aren't explained, most likely because there isn't any explanation.

When they implemented it they probably had no use for it. Although I would have returned an error code with several values such as:

Code: Select all

enum setchunk_error
{
 setchunk_no_error = 0,
 setchunk_error, // use if no other appropriate code  
 setchunk_wrong_format, // identifying data in chunk not what was expected
 setchunk_wrong_size, // size of chunk not what was expected
 setchunk_bad_data, // data in chunk corrupt
};
Then the host could tell you "we tried to load a chunk and the plugin says: wrong format" and allow you to dump the chunk or import a replacement and so on. Only VST was never designed that way for some reason...
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

Thanks mystran,

I had assumed as much, but it helps to hear that from someone with releases tested out in the wild.

Post

which is a classic example of how messy 2.4 is, we really needed something better, perhaps not 3 though :)

Post

Well, I'd probably describe this example as a bit untidy rather than messy. I mean just a small comment in the code saying the return value had been reserved for future error codes would have been enough.

They could then implement that in VST2.5 after they bin VST3 :hihi:

Post

matt42 wrote:Well, I'd probably describe this example as a bit untidy rather than messy. I mean just a small comment in the code saying the return value had been reserved for future error codes would have been enough.

They could then implement that in VST2.5 after they bin VST3 :hihi:
Was about to post the same thing..
Image

Post

Or alternatively we can just start using it right now, like I already do.

Ten years later you get a little tired of waiting.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post Reply

Return to “DSP and Plugin Development”