Jamba C++ API 8.0.0
Loading...
Searching...
No Matches
CustomController.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018-2019 pongasoft
3 *
4 * Licensed under the Apache License, Version 2.0 or the MIT license,
5 * at your option. You may not use this file except in compliance with
6 * one of these licenses. You may obtain copies of the licenses at:
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 * https://opensource.org/licenses/MIT
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 *
17 * @author Yan Pujante
18 */
19#pragma once
20
21#include <vstgui4/vstgui/uidescription/delegationcontroller.h>
23
24#include "StateAware.h"
25
27
34class CustomController : public VSTGUI::DelegationController, public ParamAware
35{
36public:
37 // Constructor
38 explicit CustomController(IController *iBaseController) : DelegationController(iBaseController) {}
39};
40
41
51template<GUIStateSubclass TGUIState>
53{
54public:
55 // Constructor
56 explicit StateAwareCustomController(IController *iBaseController) : CustomController(iBaseController) {}
57
78 template<typename TView>
80 return StateAware<TGUIState>::fState->makeParamAware(iView);
81 }
82
83protected:
86 void initState(GUIState *iGUIState) override
87 {
90 }
91};
92}
Definition GUIState.h:45
This class is inherited by classes who want to be aware of parameters and be notified when they chang...
Definition ParamAware.h:64
virtual void initState(GUIState *iGUIState)
Called during initialization.
Definition ParamAware.cpp:37
This subclass allows for registering callbacks to any kind of view without having to inherit from it.
Definition ParamAware.h:516
CustomController(IController *iBaseController)
Definition CustomController.h:38
ParamAwareView< TView > * makeParamAware(TView *iView)
Allow for registering an arbitrary callback on an arbitrary view without having to inherit from the v...
Definition CustomController.h:79
void initState(GUIState *iGUIState) override
Overriden to call both ParamAware::initState() and StateAware::initState().
Definition CustomController.h:86
StateAwareCustomController(IController *iBaseController)
Definition CustomController.h:56
This class is used to get access to the GUI state and parameters of the plugin with their actual type...
Definition StateAware.h:32
TGUIState * fState
Gives access to the GUI state (ex: fState->fLabelA).
Definition StateAware.h:54
virtual void initState(GUIState *iGUIState)
This method is called by Jamba automatically to initialize the state.
Definition StateAware.h:43
Definition CustomController.h:26