Development Topics > Plugin Development
coding...
haze:
Hi
SV crashes as soon as I start it up (with my dll installed).
const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int version,
unsigned int index)
{
if (version < 1) return 0;
return vocalRangeAnalyzerPlugin.getDescriptor();
return 0;
}
--How do I use vamp-simple-host? And what debugger do you suggest?
Thanks
Hazel
cannam:
It looks like you wanted something more like
const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int version, unsigned int index)
{
if (version < 1) return 0;
if (index == 0) return vocalRangeAnalyzerPlugin.getDescriptor();
else return 0;
}
Note that it only returns a plugin descriptor when called with index 0.
The principle of this function, generally speaking, is that it allows the plugin library to contain many different plugins, identified with different index values. The host calls this function, repeatedly with index values incrementing from 0, and with each call it gets back a new plugin descriptor. When it gets back a null descriptor (or 0 -- same thing), then it stops.
So, with a function as you quoted it, the host will keep calling this function forever, getting a new (identical) descriptor object each time -- because the function returns a new object regardless of the value of the index parameter.
Hope this helps!
Chris
haze:
Hi.
I tried the codes you've given me, but still SV crashes as it starts.
What could possibly be the problem here?
Thanks.
cannam:
Well, when SV starts up it does the following in order to build up its plugin menu:
-- opens the plugin DLL
-- calls vampGetPluginDescriptor repeatedly, with values starting at 0 and increasing by 1, until vampGetPluginDescriptor returns a NULL (or zero) value
-- constructs each plugin whose descriptor was returned, calls getOutputDescriptors() on it, then destroys it again
This suggests various places where troubles could arise:
-- the plugin's constructor?
-- the getOutputDescriptors function?
-- the destructor?
Note that initialise() and process() are not called on startup, so this crash shouldn't be in either of those.
It's also possible to run into problems if, for example, you compile the plugin using one version of the Vamp plugin SDK and link (perhaps dynamically) with a different version. Make sure you're using version 2.0 of the SDK libraries and headers.
Can you try running SV in your IDE's debugger? -- for example in Visual Studio you can configure the Debug command to run a particular executable instead of the thing you were just compiling, so you could tell it to run the Sonic Visualiser executable (e.g. in VS2008 Project -> Properties -> Configuration Properties -> Debugging -> Executable). Hopefully you should get a workable stack trace when it crashes.
Chris
haze:
Hi.
I've tried to configure the Debug command as you say so but still I get the same result. It still crashes.
Do you mean I have to get the codes of Sonic V. to run in Visual Studio?
I am using ver.2.0 of the SDK libraries and headers.
Thanks a lot.
Hazel
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version