Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » DSP and Plug-in Development
Thread Read
Custom GUI
LemonLime
KVRist
- profile
- pm
- e-mail
PostPosted: Sun Jun 10, 2012 7:20 am reply with quote
Hia peeps,

Okay, so my VST plug-in works fine, but now it's time to make it looks snazzy.
The plug-in is coded in XCode (using VST2.4 sdk), and I'm trying to use VST GUI 4 to implement my custom view. The VST SDK has a "getting started" section as well as an XCode tutorial project that I followed very closely to build up just a basic view to start off with. But this is what I'm getting (after building the plug-in and bringing it up in Audacity for the first time):


If I close Audacity, open it up and bring up the plug-in again, I get a gigantic, blank window that takes up half my screen; and this is within the same build of the plug-in -- no code is changed, just reopening the host and selecting the plug-in. When I get the small window with the knobs under the buttons, I can move them around and it works as expected, but something is completely off with the view obviously.

It seems the window isn't scaling to the view size I specify with CFrame. I've racked my brain over this and can't see what I'm doing wrong. Anyone have any insight into this? It seems like such a basic thing to get VST GUI up and running with a simple view, but I just can't get it working properly. Maybe I'm missing an important Framework (the tutorial has Accelerate, Carbon, Cocoa), or build setting, ...?

Inside my plug-in constructor I have:

// set editor for plug-in GUI
   extern AEffGUIEditor* createEditor (AudioEffectX*);
   setEditor (createEditor (this));

Then, inside the editor .cpp file:

AEffGUIEditor* createEditor (AudioEffectX* effect)
{
   return new RingModEditor (effect);
}

//--------------------------------//

RingModEditor::RingModEditor (void* ptr) : AEffGUIEditor (ptr)
{
}

//--------------------------------//

bool RingModEditor::open (void* ptr)
{
   CRect frameSize (0, 0, 300, 300);
   CFrame* newFrame = new CFrame (frameSize, ptr, this);
   newFrame->setBackgroundColor(kWhiteCColor);
    ...
    // additional code setting up knobs, etc.

//--------------------------------//

void RingModEditor::close ()
{
   CFrame* oldFrame = frame;
   frame = 0;
   oldFrame->forget();
}



Along the same lines, what's the opinion on VST gui? Are there better tools out there for custom UI? What do you guys use for custom UI? I read a little bit about JUCE and it seems pretty cool.

Much appreciated.
LemonLime
^ Joined: 15 Apr 2012  Member: #278696  Location: Toronto, ON
Big Tick
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Sun Jun 10, 2012 6:01 pm reply with quote
You need to implement the getRect() method in your editor, as follows:

virtual bool RingModEditor::getRect(ERect** rect);

This is where you specify the size of the window the host will open for you.

'Tick
^ Joined: 28 May 2001  Member: #586  Location: New York, NY
LemonLime
KVRist
- profile
- pm
- e-mail
PostPosted: Mon Jun 11, 2012 7:01 am reply with quote
Magic!
Thank you, sir.

In case others encounter this problem, I added these lines of code inside the 'open' function of my plugin editor:

ERect *wSize;
getRect (&wSize);
wSize->top = wSize->left = 0;
wSize->bottom = wSize->right = 300;


And then you go about creating the view frame, attaching it to the parent window, etc.
^ Joined: 15 Apr 2012  Member: #278696  Location: Toronto, ON
All times are GMT - 8 Hours

Printable version
Page 1 of 1
Display posts from previous:   
ReplyNew TopicPrevious TopicNext Topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Username: Password:  
KVR Developer Challenge 2012