How would you share a "global" variable for each plugin instance?
Hi all,
I'd like to share for every classes within the same plugin's instance scope a common/global variable.
Such as "gLastTriggeredVoiceIndex" within my VoiceManager class, accessible for each other classes that needs it (Filters, Envelopes, and so on), but of course without passing to them a reference/pointer (keeping all stuff separated).
Each instance of the plugin should have its own VoiceManager instance, so its own gLastTriggeredVoiceIndex (not shared across all instances so).
Do you know any way in IPlug/C++?
static (internal) or external linkage won't works, since it will be the same for every plugin intance.
Thanks
|