Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
ParamDisplayView.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 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/lib/controls/cparamdisplay.h>
23
24#include "CustomView.h"
25
27
37class ParamDisplayView : public CustomViewAdapter<CParamDisplay>
38{
39public:
41
42public:
43 // Constructor
44 explicit ParamDisplayView(const CRect &iSize) : super_type(iSize)
45 {
47 }
48
49 // draw - overridden to handle any parameter
50 void draw(CDrawContext *iContext) override;
51
59 int32 getPrecisionOverride() const { return fPrecisionOverride; }
60 void setPrecisionOverride(int32 iPrecisionOverride) { fPrecisionOverride = iPrecisionOverride; markDirty(); }
61
62 // registerParameters
63 void registerParameters() override;
64
65protected:
67
69
70public:
71 class Creator : public CustomViewCreator<ParamDisplayView, super_type>
72 {
73 public:
74 explicit Creator(char const *iViewName = nullptr, char const *iDisplayName = nullptr) :
75 CustomViewCreator(iViewName, iDisplayName, VSTGUI::UIViewCreator::kCParamDisplay)
76 {
78 }
79 };
80};
81
82}
83
Wrapper instance returned by ParamAware::registerBaseParam() methods.
Definition IGUIParameter.h:403
CustomViewAdapter(const CRect &iSize, Args &&...args)
Definition CustomView.h:344
CustomViewCreator(char const *iViewName=nullptr, char const *iDisplayName=nullptr, char const *iBaseViewName=VSTGUI::UIViewCreator::kCView)
Definition CustomViewCreator.h:1318
Creator(char const *iViewName=nullptr, char const *iDisplayName=nullptr)
Definition ParamDisplayView.h:74
void setPrecisionOverride(int32 iPrecisionOverride)
Definition ParamDisplayView.h:60
void registerParameters() override
Subclasses should override this method to register each parameter.
Definition ParamDisplayView.cpp:42
void draw(CDrawContext *iContext) override
Definition ParamDisplayView.cpp:27
int32 getPrecisionOverride() const
Allow to override the precision of the parameter.
Definition ParamDisplayView.h:59
IGUIParam fParam
Definition ParamDisplayView.h:68
int32 fPrecisionOverride
Definition ParamDisplayView.h:66
ParamDisplayView(const CRect &iSize)
Definition ParamDisplayView.h:44
CustomViewAdapter< CParamDisplay > super_type
Definition ParamDisplayView.h:40
void registerIntegerAttribute(std::string const &iName, typename IntegerAttribute< TInt >::Getter iGetter, typename IntegerAttribute< TInt >::Setter iSetter)
Definition CustomViewCreator.h:1060
Definition Types.h:30
Definition CustomController.h:25
constexpr ParamID UNDEFINED_PARAM_ID
Constant used throughout the code to test whether the ParamID represents a valid id or an undefined o...
Definition Types.h:48