Jamba C++ API  4.4.0
GUIController Class Referenceabstract

Base class from which the actual controller inherits from. More...

#include <GUIController.h>

Inherits EditController, VST3EditorDelegate, and IMessageProducer.

Public Member Functions

IPtr< IMessage > allocateMessage () override
 Allocates a message instance. More...
 
virtual IController * createCustomController (UTF8StringPtr iName, IUIDescription const *iDescription, IController *iBaseController)
 Subclasses should override this method to return the custom controller or nullptr if doesn't match the name. More...
 
virtual GUIStategetGUIState ()=0
 Subclasses must implement this method to return the state. More...
 
 GUIController (char const *iXmlFileName="Views.uidesc", char const *iMainViewName="view")
 
tresult sendMessage (IPtr< IMessage > iMessage) override
 Sends the given message to the peer. More...
 
 ~GUIController () override
 
- Public Member Functions inherited from IMessageProducer
virtual ~IMessageProducer ()=default
 

Protected Member Functions

IController * createSubController (UTF8StringPtr iName, const IUIDescription *iDescription, VST3Editor *iEditor) override
 Called when a sub controller needs to be created. More...
 
IPlugView *PLUGIN_API createView (const char *name) override
 Create the view. More...
 
void didOpen (VST3Editor *editor) override
 
tresult PLUGIN_API getState (IBStream *state) override
 Called to save the state (UI only!) (before saving a preset or project) More...
 
tresult PLUGIN_API initialize (FUnknown *context) override
 Called at first after constructor. More...
 
tresult PLUGIN_API notify (IMessage *message) SMTG_OVERRIDE
 Called to handle a message (coming from RT) More...
 
void registerParameters (ParamAware *iParamAware)
 
tresult PLUGIN_API setComponentState (IBStream *state) override
 Sets the component state (after setting the processor) or after restore. More...
 
tresult PLUGIN_API setState (IBStream *state) override
 Restore the state (UI only!) (ex: after loading preset or project) More...
 
virtual bool switchToMainView ()
 Switch back to the main view. More...
 
virtual bool switchToView (char const *iViewName)
 This method should be called to display a totally different (root) view. More...
 
tresult PLUGIN_API terminate () override
 Called at the end before destructor. More...
 
void willClose (VST3Editor *editor) override
 

Protected Attributes

VSTGUI::CKnobMode fDefaultKnobMode {VSTGUI::CKnobMode::kLinearMode}
 
char const *const fXmlFileName
 

Private Attributes

std::string fCurrentViewName
 
std::string fMainViewName
 
Views::CustomUIViewFactoryfViewFactory {nullptr}
 
VSTGUI::VST3Editor * fVST3Editor {}
 

Detailed Description

Base class from which the actual controller inherits from.

Handles most of the "framework" logic, (state loading/saving in a thread safe manner, registering VST parameters...) so that the actual controller code deals mostly with business logic.

Constructor & Destructor Documentation

◆ GUIController()

GUIController ( char const *  iXmlFileName = "Views.uidesc",
char const *  iMainViewName = "view" 
)
explicit

◆ ~GUIController()

~GUIController ( )
override

Member Function Documentation

◆ allocateMessage()

IPtr< IMessage > allocateMessage ( )
overridevirtual

Allocates a message instance.

Implements IMessageProducer.

◆ createCustomController()

virtual IController* createCustomController ( UTF8StringPtr  iName,
IUIDescription const *  iDescription,
IController *  iBaseController 
)
inlinevirtual

Subclasses should override this method to return the custom controller or nullptr if doesn't match the name.

◆ createSubController()

IController * createSubController ( UTF8StringPtr  iName,
const IUIDescription *  iDescription,
VST3Editor *  iEditor 
)
overrideprotected

Called when a sub controller needs to be created.

◆ createView()

IPlugView * createView ( const char *  name)
overrideprotected

Create the view.

◆ didOpen()

void didOpen ( VST3Editor *  editor)
overrideprotected

◆ getGUIState()

virtual GUIState* getGUIState ( )
pure virtual

Subclasses must implement this method to return the state.

◆ getState()

tresult getState ( IBStream *  state)
overrideprotected

Called to save the state (UI only!) (before saving a preset or project)

◆ initialize()

tresult initialize ( FUnknown *  context)
overrideprotected

Called at first after constructor.

◆ notify()

tresult notify ( IMessage *  message)
protected

Called to handle a message (coming from RT)

◆ registerParameters()

void registerParameters ( ParamAware iParamAware)
protected

◆ sendMessage()

tresult sendMessage ( IPtr< IMessage >  iMessage)
overridevirtual

Sends the given message to the peer.

Implements IMessageProducer.

◆ setComponentState()

tresult setComponentState ( IBStream *  state)
overrideprotected

Sets the component state (after setting the processor) or after restore.

◆ setState()

tresult setState ( IBStream *  state)
overrideprotected

Restore the state (UI only!) (ex: after loading preset or project)

◆ switchToMainView()

virtual bool switchToMainView ( )
inlineprotectedvirtual

Switch back to the main view.

◆ switchToView()

bool switchToView ( char const *  iViewName)
protectedvirtual

This method should be called to display a totally different (root) view.

Example: with xxx.uidesc like this one, you would call switchToView("compact_view");

<vstgui-ui-description version="1">
  <!-- Main view opened on creation -->
    <template class="CViewContainer" name="view" ...>
  </template>
  <!-- Secondary view you can switch to -->
    <template class="CViewContainer" name="compact_view" ...>
  </template>
<vstgui-ui-description
Returns
true if switching worked

◆ terminate()

tresult terminate ( )
overrideprotected

Called at the end before destructor.

◆ willClose()

void willClose ( VST3Editor *  editor)
overrideprotected

Member Data Documentation

◆ fCurrentViewName

std::string fCurrentViewName
private

◆ fDefaultKnobMode

VSTGUI::CKnobMode fDefaultKnobMode {VSTGUI::CKnobMode::kLinearMode}
protected

◆ fMainViewName

std::string fMainViewName
private

◆ fViewFactory

Views::CustomUIViewFactory* fViewFactory {nullptr}
private

◆ fVST3Editor

VSTGUI::VST3Editor* fVST3Editor {}
private

◆ fXmlFileName

char const* const fXmlFileName
protected

The documentation for this class was generated from the following files: