Access custom CView from the controller when it has been created from the .uidesc


Now I’m trying to access the “handle” to my custom CView that was added successfully through a factory (ViewCreatorAdapter).
In the Controller’s createView the .uidesc is loaded/created with all of the views/controllers but how do I get hold of them.
I would like to set a value from the controller to my custom CView, isn’t that possible?
The custom view has a function like setSomething(int val) but I need to reach the object from the controller.

And yes, I don’t want to add more prarameters, they are getting so many when using them to set graphic values, totally unnesesary.

By the way, my intensions are to add a view updating some lines for a compressor.

Please help me :confused:

Thanks in advance.

Well I’ve looked at the again send and receive message but it’s only sending from the plugin, or from the process to the controller. I can’t see any way from controller to plugin control.
Sad, and the part of the documentation that the Steinberg staff always are pointing to is behind password for me, so I haven’t seen it.

And once again…

I found a solution…

I’m using a MessageController sending message from processor to controller and from there to MessageController.

(from processor)sendMessageText->(in controller)receiveText->uiMessageController->setMessageText->(in MessageController) I receive the message through the function setMessageText and from there I set my CControl/CView

It’s working but is it ok to do it this way??


EDIT: It seems to me like if the MessageController isn’t working on the same thread as the custom control’s graphics, because calling invalid() (rapidly) in the control through the MessageController makes access violation and a crash :confused:

EDIT2: It is the sendTextMessage( from the processor that is breaking it, if I turn any other knob in the plugin’s GUI, then there will be an access violation in the vector that holds the MessageControll

If you want to communicate with a view you have described in the uidesc file, you need to implement the VSTGUI::IVST3EditorDelegate interface in your EditController and overwrite IVST3EditorDelegate::verifyView(…). Then you will have direct access to the views or if you want to have finer control you need to use IVST3EditorDelegate::createSubController(…) and set the sub-controller name of the parent view of the view you want to control in the uidesc file, so that the sub controller will be created before the view is created and then again you can use the verifyView method of the sub controller to get the view.

1 Like

Well thanks a lot for the explanation, it’s working but how do I check if the view is really visible before calling it. I’ve tried to compare with NULL and .isVisible() but it still craches if the plugin window is closed.

you need to add a listener to the view and if it is destroyed you need to make sure that you don’t call it again.

Ok I see… like the viewWillDelete (VSTGUI::ViewListenerAdapter) maybe

Yes that was it, thanks a bunch. Now it’s working like a charm.