Jamba  3.0.2
pongasoft::VST::GUI::GUIController Class Referenceabstract

#include <GUIController.h>

Inherits EditController, VST3EditorDelegate, and pongasoft::VST::IMessageProducer.

Public Member Functions

IPtr< IMessage > allocateMessage () override
 
virtual IController * createCustomController (UTF8StringPtr iName, IUIDescription const *iDescription, IController *iBaseController)
 
virtual GUIStategetGUIState ()=0
 
 GUIController (char const *iXmlFileName="Views.uidesc", char const *iMainViewName="view")
 
tresult sendMessage (IPtr< IMessage > iMessage) override
 
 ~GUIController () override
 
- Public Member Functions inherited from pongasoft::VST::IMessageProducer
virtual ~IMessageProducer ()=default
 

Protected Member Functions

IController * createSubController (UTF8StringPtr iName, const IUIDescription *iDescription, VST3Editor *iEditor) override
 
IPlugView *PLUGIN_API createView (const char *name) override
 
void didOpen (VST3Editor *editor) override
 
tresult PLUGIN_API getState (IBStream *state) override
 
tresult PLUGIN_API initialize (FUnknown *context) override
 
tresult PLUGIN_API notify (IMessage *message) SMTG_OVERRIDE
 
void registerParameters (GUIParamCxAware *iGUIParamCxAware)
 
tresult PLUGIN_API setComponentState (IBStream *state) override
 
tresult PLUGIN_API setState (IBStream *state) override
 
virtual bool switchToMainView ()
 
virtual bool switchToView (char const *iViewName)
 
tresult PLUGIN_API terminate () override
 
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()

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

◆ ~GUIController()

pongasoft::VST::GUI::GUIController::~GUIController ( )
override

Member Function Documentation

◆ allocateMessage()

IPtr< IMessage > pongasoft::VST::GUI::GUIController::allocateMessage ( )
overridevirtual

Allocates a message instance

Implements pongasoft::VST::IMessageProducer.

◆ createCustomController()

virtual IController* pongasoft::VST::GUI::GUIController::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 * pongasoft::VST::GUI::GUIController::createSubController ( UTF8StringPtr  iName,
const IUIDescription *  iDescription,
VST3Editor *  iEditor 
)
overrideprotected

Called when a sub controller needs to be created

◆ createView()

IPlugView * pongasoft::VST::GUI::GUIController::createView ( const char *  name)
overrideprotected

Create the view

◆ didOpen()

void pongasoft::VST::GUI::GUIController::didOpen ( VST3Editor *  editor)
overrideprotected

◆ getGUIState()

virtual GUIState* pongasoft::VST::GUI::GUIController::getGUIState ( )
pure virtual

Subclasses must implement this method to return the state

◆ getState()

tresult pongasoft::VST::GUI::GUIController::getState ( IBStream *  state)
overrideprotected

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

◆ initialize()

tresult pongasoft::VST::GUI::GUIController::initialize ( FUnknown *  context)
overrideprotected

Called at first after constructor

◆ notify()

tresult pongasoft::VST::GUI::GUIController::notify ( IMessage *  message)
protected

Called to handle a message (coming from RT)

◆ registerParameters()

void pongasoft::VST::GUI::GUIController::registerParameters ( GUIParamCxAware iGUIParamCxAware)
protected

◆ sendMessage()

tresult pongasoft::VST::GUI::GUIController::sendMessage ( IPtr< IMessage >  iMessage)
overridevirtual

Sends the given message to the peer.

Implements pongasoft::VST::IMessageProducer.

◆ setComponentState()

tresult pongasoft::VST::GUI::GUIController::setComponentState ( IBStream *  state)
overrideprotected

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

◆ setState()

tresult pongasoft::VST::GUI::GUIController::setState ( IBStream *  state)
overrideprotected

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

◆ switchToMainView()

virtual bool pongasoft::VST::GUI::GUIController::switchToMainView ( )
inlineprotectedvirtual

Switch back to the main view

◆ switchToView()

bool pongasoft::VST::GUI::GUIController::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 pongasoft::VST::GUI::GUIController::terminate ( )
overrideprotected

Called at the end before destructor

◆ willClose()

void pongasoft::VST::GUI::GUIController::willClose ( VST3Editor *  editor)
overrideprotected

Member Data Documentation

◆ fCurrentViewName

std::string pongasoft::VST::GUI::GUIController::fCurrentViewName
private

◆ fDefaultKnobMode

VSTGUI::CKnobMode pongasoft::VST::GUI::GUIController::fDefaultKnobMode {VSTGUI::CKnobMode::kLinearMode}
protected

◆ fMainViewName

std::string pongasoft::VST::GUI::GUIController::fMainViewName
private

◆ fViewFactory

Views::CustomUIViewFactory* pongasoft::VST::GUI::GUIController::fViewFactory {nullptr}
private

◆ fVST3Editor

VSTGUI::VST3Editor* pongasoft::VST::GUI::GUIController::fVST3Editor {}
private

◆ fXmlFileName

char const* const pongasoft::VST::GUI::GUIController::fXmlFileName
protected

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