This project has moved and is read-only. For the latest updates, please go here.

How to affect custom UI from Process function?

Topics: Editor UI
Feb 16, 2012 at 11:20 AM


I posted here already about problems with additional custom references directory, but i already came across more critical problem.

I managed to implement FFT in my effect and now i am trying to show results on my custom WPF UI.

My class of PluginEditorView is very simple:

 public partial class PluginEditorView : UserControl
        public PluginEditorView()
            ControlPanel effect = new ControlPanel();
            WPFDisplay.Child = effect; this.Controls.Add(WPFDisplay);


I have now instance of ControlPanel: effect.

I would like to invoke some method of that object for example: effect.ShowFFTResults() in Process function of AudioProcessor class.

Where can i learn how to change editor view from the process function? Its hard and i run out of ideas...

Feb 17, 2012 at 6:51 PM

If you write data into a buffer in de AudioProcessor.Process method (probably where your FFT is executed) and implement the Editor's ProcessIdle method to invalidate the region of the screen that needs to be updated, when the buffers was changed, then the drawing code should get triggered.

The drawing code will read from the data buffer and generate a visual representation of that data.

To my mind the dependency flows from the UI to the processing component (AudioProcessor) not the other way around. Try to avoid using any type of thread synchronization mechanism for it may block the processing of the audio. And if the read will read corrupt data once in a while, there is not much of a problem.

Hope it helps,

Feb 17, 2012 at 7:21 PM

Thank you for your comment.

So as far as I understand I have to implement ProcessIdle method. I will try to find all what I can in documentation and search (this time deeper)  the samples with custom UI and if i get stuck somewhere I will probably ask you again for help...

Meanwhile i was trying to get my ControlPanel instance in AudioProcessor by implementing singleton pattern in ControlPanel. I was able to get the instance in AudioProcessor and invoke drawing method... but nothing changed... 

So I will focus myself on the ProcessIdle and read everything about it then.

Thanx Marc,


Feb 17, 2012 at 7:38 PM

You can use your plugin root object (that implements IVstPlugin) to contain the data buffer. That way all pieces (objects) of the plugin can access it. You have to make sure you invoke your drawing method from the UI thread (use the Dispatcher). You will get an exception otherwise.

I would not implement any statics (singletons) in your plugin, just use the references managed by the Plugin root object (InterfaceManager) to retrieve refs to other objects (GetInstance<MyPluginEditor>). Refer to the code that the Visual Studio templates lay down for you when you create a new VST.NET project.

Feb 18, 2012 at 8:09 PM
Edited Feb 19, 2012 at 10:25 AM

Your advices were very helpful. Finally I've made my UI to work.

Thank you!