Also, I'm hoping to be able to do this in response to a parameter change as well as from the GUI so how would I do a state capture/restore when a param change is detected without causing a meltdown? Any advice much appreciated.

Code: Select all
static object syncLock = new object();
public void Work()
{
lock (syncLock)
{
// Things that need to be safe
}
}
Code: Select all
Application.Current.Dispatcher.BeginInvoke((Action)(() =>
{
// Do stuff here
}));
yes, this works for synchronizing your own machine's threads, where you can lock all your own threads with your own object. But note that you make your own lock object here, so this will not work for locking the state of OTHER machines and threads which you don't own. The other machines don't know anything about your lock object (and neither does buzz). You need to use THEIR lock objects. that's why machineinterface has the lock functions..there must be some equivalent in the .net api and if not, call the native function from .net.
Thanks! I'm out of my depth just finding my way around C#, .NET AND WPF. I spent ten minutes poking around BuzzGUI looking for how to implement Tick() until I realised my mistake.
It's amazing! I hadn't considered it before but it doesn't save the VST, it saves PVST which means a snapshot can load an entirely different plugin!
How would I go about doing that?
Whenever I intercept a call from a button click, the thread id is 1 so I guess that's the one I'm aiming for. The invoke thing wde posted above looks promising (and easy) so I'll give that a try first. Wish me luck!
Hmmm, Application doesn't seem to have a 'Current' (different .NET version?) I did find 'BuzzGUI.Common.DispatcherAction' which looks like it does something similar. Nothing happens when I do this but there's a strong chance that I'm doing it completely wrong...wde wrote: ↑Thu Oct 07, 2021 12:57 pm This might help with the GUI thread thing:Code: Select all
Application.Current.Dispatcher.BeginInvoke((Action)(() => { // Do stuff here }));
Code: Select all
var da = new DispatcherAction(() =>
{
MessageBox.Show("Hello!");
});
da.Dispatch(System.Windows.Threading.DispatcherPriority.Normal);
Ignore that idiot from last night, he doesn't know what he's doing. Must've been missing a reference in a particular file because I just found it while trying stuff elsewhere. Early signs are promising, I just restored a single global param on one machine in response to a slot change and it didn't lock up like it always has done before!