Jamba C++ API  4.0.0
GUIJmbParameter.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 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  *
16  * @author Yan Pujante
17  */
18 #pragma once
19 
20 #include <base/source/fobject.h>
22 #include <pongasoft/VST/ParamDef.h>
28 #include "IGUIParameter.h"
29 #include "GUIParamCx.h"
30 
32 
40 {
41 public:
42  // Constructor
43  explicit IGUIJmbParameter(std::shared_ptr<IJmbParamDef> iParamDef) : fParamDef{std::move(iParamDef)} {}
44 
45  // getParamDef
46  inline IJmbParamDef const *getParamDef() const { return fParamDef.get(); }
47 
48  // getJmbParamID
49  ParamID getJmbParamID() const { return fParamDef->fParamID; }
50 
51  // readFromStream
52  virtual tresult readFromStream(IBStreamer &iStreamer) = 0;
53 
54  // writeToStream
55  virtual tresult writeToStream(IBStreamer &oStreamer) const = 0;
56 
57  // readFromMessage
58  virtual tresult readFromMessage(Message const &iMessage) = 0;
59 
60  // writeToMessage
61  virtual tresult writeToMessage(Message &oMessage) const = 0;
62 
63  // writeToStream
64  virtual void writeToStream(std::ostream &oStream) const = 0;
65 
66  // handleMessage
67  tresult handleMessage(Message const &iMessage) override { return readFromMessage(iMessage); }
68 
69  // broadcast
70  tresult broadcast() const;
71 
72  // setMessageProducer
73  void setMessageProducer(IMessageProducer *iMessageProducer) { fMessageProducer = iMessageProducer; }
74 
75 protected:
76  std::shared_ptr<IJmbParamDef> fParamDef;
78 };
79 
84 template<typename T>
85 class GUIJmbParameter : public ITGUIParameter<T>, public IGUIJmbParameter, public FObject
86 {
87 public:
88  using ParamType = T;
90 
91  using FObject::update; // fixes overload hiding warning
92 
93  // Constructor
94  explicit GUIJmbParameter(std::shared_ptr<JmbParamDef<T>> iParamDef) :
95  IGUIJmbParameter(iParamDef),
96  FObject(),
97  fValue{iParamDef->fDefaultValue}
98  {
99 // DLOG_F(INFO, "GUIJmbParameter(%p)", this);
100  }
101 
102  // Destructor
103  ~GUIJmbParameter() override
104  {
105 // DLOG_F(INFO, "~GUIJmbParameter(%p)", this);
106  }
107 
108  // getParamID
109  ParamID getParamID() const override { return getJmbParamID(); }
110 
111  inline int32 getStepCount() const override { return 0; }
112 
113  // getParamDef
114  inline JmbParamDef<T> const *getParamDefT() const
115  {
116  return static_cast<JmbParamDef<T> const *>(getParamDef());
117  }
118 
124  bool update(ParamType const &iValue) override
125  {
126  // Implementation note: because this method is declared virtual the compiler must instantiate it
127  // even if never called and will generate an error if the ParamType does not define operator!=, so we
128  // need to account for this case
129  if constexpr(Utils::is_operator_not_eq_defined<ParamType>)
130  {
131  if(fValue != iValue)
132  {
133  if(setValue(iValue) == kResultOk)
134  return true;
135  }
136  }
137  else
138  {
139  if(setValue(iValue) == kResultOk)
140  return true;
141  }
142  return false;
143  }
144 
150  template<class ValueModifier>
151  bool updateIf(ValueModifier const &iValueModifier)
152  {
153  if(iValueModifier(&fValue))
154  {
155  changed();
156  return true;
157  }
158  return false;
159  }
160 
165  tresult setValue(ParamType const &iValue) override
166  {
167  // Implementation note: because this method is declared virtual the compiler must instantiate it
168  // even if never called and will generate an error if the ParamType does is not copy assignable, so we
169  // need to account for this case
170  if constexpr(std::is_copy_assignable_v<ParamType>)
171  {
172  fValue = iValue;
173  changed();
174  return kResultOk;
175  }
176  else
177  {
178  DLOG_F(ERROR, "%s is not copy_assignable. Call updateIf instead.", typeid(ParamType).name());
179  return kResultFalse;
180  }
181  }
182 
187  tresult setValue(ParamType &&iValue)
188  {
189  fValue = std::move(iValue);
190  changed();
191  return kResultOk;
192  }
193 
197  {
198  setValue(getParamDefT()->fDefaultValue);
199  }
200 
201  // readFromStream
202  tresult readFromStream(IBStreamer &iStreamer) override
203  {
204  tresult res = getParamDefT()->readFromStream(iStreamer, fValue);
205  if(res == kResultOk)
206  changed();
207  return res;
208  }
209 
210  // writeToStream
211  tresult writeToStream(IBStreamer &oStreamer) const override
212  {
213  return getParamDefT()->writeToStream(fValue, oStreamer);
214  }
215 
216  // writeToStream
217  void writeToStream(std::ostream &oStream) const override
218  {
219  getParamDefT()->writeToStream(fValue, oStream);
220  }
221 
222  // toUTF8String
223  std::string toUTF8String(int32 iPrecision) const override
224  {
225  return getParamDefT()->toUTF8String(getValue(), iPrecision);
226  }
227 
228  // readFromMessage
229  tresult readFromMessage(Message const &iMessage) override
230  {
231  tresult res = getParamDefT()->readFromMessage(iMessage, fValue);
232  if(res == kResultOk)
233  changed();
234  return res;
235  }
236 
237  // writeToMessage
238  tresult writeToMessage(Message &oMessage) const override
239  {
240  return getParamDefT()->writeToMessage(fValue, oMessage);
241  }
242 
243  // accessValue
244  tresult accessValue(typename ITGUIParameter<T>::ValueAccessor const &iGetter) const override
245  {
246  iGetter(fValue);
247  return kResultOk;
248  }
249 
250  // getValue
251  inline ParamType const &getValue() const { return fValue; }
252 
253  // getValue
254  inline ParamType &getValue() { return fValue; }
255 
256  // edit
257  std::unique_ptr<EditorType> edit() override
258  {
259  return std::make_unique<DefaultEditorImpl<T>>(this, getValue());
260  }
261 
266 
270  std::unique_ptr<FObjectCx> connect(Parameters::IChangeListener *iChangeListener) const override
271  {
272  return std::make_unique<GUIParamCx>(getJmbParamID(), const_cast<GUIJmbParameter *>(this), iChangeListener);
273  }
274 
278  std::unique_ptr<FObjectCx> connect(Parameters::ChangeCallback iChangeCallback) const override
279  {
280  return std::make_unique<FObjectCxCallback>(const_cast<GUIJmbParameter *>(this), std::move(iChangeCallback));
281  }
282 
283  // asDiscreteParameter
284  std::shared_ptr<GUIDiscreteParameter> asDiscreteParameter(int32 iStepCount) override;
285 
286 protected:
288 };
289 
294 template<typename T>
295 static std::shared_ptr<GUIJmbParameter<T>> castToJmb(std::shared_ptr<IGUIParameter> iParam)
296 {
297  return std::dynamic_pointer_cast<GUIJmbParameter<T>>(iParam);
298 }
299 
303 template<typename T>
305 {
306 public:
307  using EditorType = typename GUIDiscreteParameter::ITEditor;
308 
309 public:
310  GUIDiscreteJmbParameter(std::shared_ptr<GUIJmbParameter<T>> iJmbParameter,
311  std::shared_ptr<IDiscreteConverter<T>> iConverter) :
312  fJmbParameter{std::move(iJmbParameter)},
313  fConverter{iConverter}
314  {
315  DCHECK_F(fJmbParameter != nullptr);
316  DCHECK_F(fConverter != nullptr);
317  }
318 
319  // getParamID
320  ParamID getParamID() const override
321  {
322  return fJmbParameter->getParamID();
323  }
324 
325  // getStepCount
326  int32 getStepCount() const override
327  {
328  return fConverter->getStepCount();
329  }
330 
331  // connect
332  std::unique_ptr<FObjectCx> connect(Parameters::IChangeListener *iChangeListener) const override
333  {
334  return fJmbParameter->connect(iChangeListener);
335  }
336 
337  // connect
338  std::unique_ptr<FObjectCx> connect(Parameters::ChangeCallback iChangeCallback) const override
339  {
340  return fJmbParameter->connect(iChangeCallback);
341  }
342 
343  // asDiscreteParameter
344  std::shared_ptr <GUIDiscreteParameter> asDiscreteParameter(int32 iStepCount) override
345  {
346  return fJmbParameter->asDiscreteParameter(iStepCount);
347  }
348 
354  tresult getValue(int32 &oDiscreteValue) const
355  {
356  auto res = fConverter->convertToDiscreteValue(fJmbParameter->getValue(), oDiscreteValue);
357  #ifndef NDEBUG
358  if(res == kResultFalse)
359  DLOG_F(WARNING, "Cannot convert current value of Jmb param [%d] to a discrete value", getParamID());
360  #endif
361  return res;
362  }
363 
364  // accessValue
365  tresult accessValue(ValueAccessor const &iGetter) const override
366  {
367  int32 discreteValue;
368  if(getValue(discreteValue) == kResultOk)
369  {
370  iGetter(discreteValue);
371  return kResultOk;
372  }
373  return kResultFalse;
374  }
375 
376  // update
377  bool update(int32 const &iDiscreteValue) override
378  {
379  int32 currentDiscreteValue;
380  tresult res = getValue(currentDiscreteValue);
381 
382  if(res == kResultOk)
383  {
384  if(iDiscreteValue != currentDiscreteValue)
385  {
386  if(setValue(iDiscreteValue) == kResultOk)
387  return true;
388  }
389  }
390 
391  return false;
392  }
393 
394  // setValue
395  tresult setValue(int32 const &iDiscreteValue) override
396  {
397  int32 currentDiscreteValue;
398  tresult res = getValue(currentDiscreteValue);
399  if(res == kResultOk)
400  {
401  if(iDiscreteValue != currentDiscreteValue)
402  {
403  res = kResultFalse;
404  if constexpr(std::is_copy_assignable_v<T>)
405  {
406  T jmbValue = fJmbParameter->getValue();
407  if(fConverter->convertFromDiscreteValue(iDiscreteValue, jmbValue) == kResultOk)
408  res = fJmbParameter->setValue(jmbValue);
409  else
410  DLOG_F(WARNING, "Cannot convert discrete value [%d] to a [%s] value of Jmb param [%d]",
411  iDiscreteValue,
412  typeid(T).name(),
413  getParamID());
414  }
415  }
416  }
417 
418  return res;
419  }
420 
421  // edit
422  std::unique_ptr<EditorType> edit() override
423  {
424  int32 currentDiscreteValue;
425  tresult res = getValue(currentDiscreteValue);
426  if(res == kResultOk)
427  return std::make_unique<DefaultEditorImpl<int32>>(this, currentDiscreteValue);
428  else
429  return nullptr;
430  }
431 
432  // toUTF8String
433  std::string toUTF8String(int32 iPrecision) const override
434  {
435  return fJmbParameter->toUTF8String(iPrecision);
436  }
437 
438 protected:
439  std::shared_ptr<GUIJmbParameter<T>> fJmbParameter;
440  std::shared_ptr<IDiscreteConverter<T>> fConverter;
441 };
442 
443 //------------------------------------------------------------------------
444 // GUIJmbParameter<T>::asDiscreteParameter
445 //------------------------------------------------------------------------
446 template<typename T>
447 std::shared_ptr<GUIDiscreteParameter> GUIJmbParameter<T>::asDiscreteParameter(int32 iStepCount)
448 {
449  // Step 1: check if the Jmb param provide a discrete converter
450  auto converter = getParamDefT()->getDiscreteConverter();
451 
452  if(converter && converter->getStepCount() > 0)
453  return std::make_shared<GUIDiscreteJmbParameter<T>>(std::dynamic_pointer_cast<GUIJmbParameter<T>>(ITGUIParameter<T>::shared_from_this()),
454  std::move(converter));
455  else
456  {
457  // Step 2: no discrete converter, so we check if T can be automatically converted to an int32 (case where
458  // T is a numeric value, an enum, or a type that offers a "constructor(int32)" and "operator int32()" methods)
459  if(iStepCount > 0)
460  {
461  if constexpr(Utils::is_static_cast_defined<int32, T> && Utils::is_static_cast_defined<T, int32>)
462  {
463  converter = std::make_shared<StaticCastDiscreteConverter<T>>(iStepCount);
464  return std::make_shared<GUIDiscreteJmbParameter<T>>(std::dynamic_pointer_cast<GUIJmbParameter<T>>(ITGUIParameter<T>::shared_from_this()),
465  std::move(converter));
466  }
467  else
468  {
469  DLOG_F(WARNING, "Jmb param [%d] (type [%s]) cannot be converted to a discrete parameter",
470  getParamID(),
471  Utils::typeString<T>().c_str());
472  }
473  }
474  return nullptr;
475  }
476 }
477 
478 //------------------------------------------------------------------------
479 // GUIJmbParam - wrapper to make writing the code much simpler and natural
480 //------------------------------------------------------------------------
487 template<typename T>
489 {
490 public:
491  GUIJmbParam(std::shared_ptr<GUIJmbParameter<T>> iPtr = nullptr) : // NOLINT (not marked explicit on purpose)
492  fPtr{std::move(iPtr)}
493  {}
494 
496  GUIJmbParam<T> &operator=(GUIJmbParam<T> const &iOther) = default;
497 
498  // exists
499  inline bool exists() const { return fPtr != nullptr; }
500 
501  // getParamID
502  inline ParamID getParamID() const { DCHECK_F(exists()); return fPtr->getParamID(); }
503 
508  inline bool update(T const &iNewValue) { DCHECK_F(exists()); return fPtr->update(iNewValue); }
509 
514  template<class ValueModifier>
515  inline bool updateIf(ValueModifier const &iValueModifier) { DCHECK_F(exists()); return fPtr->updateIf(iValueModifier); }
516 
520  inline void setValue(T const &iNewValue) { DCHECK_F(exists()); fPtr->setValue(iNewValue); }
521 
525  inline void setValue(T &&iNewValue) { DCHECK_F(exists()); fPtr->setValue(std::move(iNewValue)); }
526 
529  inline void resetToDefault() { DCHECK_F(exists()); fPtr->resetToDefault(); }
530 
531  // getValue
532  inline T const &getValue() const { DCHECK_F(exists()); return fPtr->getValue(); }
533 
534  // allow to use the param as the underlying `ParamType` (ex: `if(param)` in the case `ParamType` is `bool`))
535  inline operator T const &() const { DCHECK_F(exists()); return fPtr->getValue(); } // NOLINT
536 
537  // allow writing param->xxx to access the underlying type directly (if not a primitive)
538  inline T const *operator->() const { DCHECK_F(exists()); return &fPtr->getValue(); }
539 
540  // broadcast
541  inline tresult broadcast() const { DCHECK_F(exists()); return fPtr->broadcast(); }
542 
543  // broadcast
544  inline void broadcast(T const &iValue)
545  {
546  setValue(iValue);
547  broadcast();
548  }
549 
550  // broadcast
551  inline void broadcast(T &&iValue)
552  {
553  setValue(std::move(iValue));
554  broadcast();
555  }
556 
557  // connect
558  inline std::unique_ptr<FObjectCx> connect(Parameters::IChangeListener *iChangeListener) { DCHECK_F(exists()); return fPtr->connect(iChangeListener); }
559 
560  // connect
561  inline std::unique_ptr<FObjectCx> connect(Parameters::ChangeCallback iChangeCallback) { DCHECK_F(exists()); return fPtr->connect(std::move(iChangeCallback)); }
562 
563 private:
564  std::shared_ptr<GUIJmbParameter<T>> fPtr;
565 };
566 
567 }
ParamID getParamID() const override
Each parameter has a unique ID returned by this method.
Definition: GUIJmbParameter.h:109
std::unique_ptr< EditorType > edit() override
Creates an editor to modify the parameter in a transactional fashion.
Definition: GUIJmbParameter.h:422
bool updateIf(ValueModifier const &iValueModifier)
Use this flavor of update if you want to modify the value itself.
Definition: GUIJmbParameter.h:515
void resetToDefault()
Resets the param to its default value.
Definition: GUIJmbParameter.h:196
bool update(T const &iNewValue)
This method is typically called by a view to change the value of the parameter.
Definition: GUIJmbParameter.h:508
void broadcast(T const &iValue)
Definition: GUIJmbParameter.h:544
std::shared_ptr< IJmbParamDef > fParamDef
Definition: GUIJmbParameter.h:76
tresult accessValue(typename ITGUIParameter< T >::ValueAccessor const &iGetter) const override
Definition: GUIJmbParameter.h:244
typename ITGUIParameter< T >::ITEditor EditorType
Definition: GUIJmbParameter.h:89
Base class for a Jamba (Jmb) GUI parameter.
Definition: GUIJmbParameter.h:39
Abstraction for allocating and sending a message.
Definition: MessageProducer.h:33
Simple wrapper class with better api.
Definition: Messaging.h:42
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition: Parameters.h:55
Represents a gui parameter with its underlying backing type T (aka ParamType).
Definition: IGUIParameter.h:33
tresult getValue(int32 &oDiscreteValue) const
Because converting the current Jmb value to an int32 may fail this api returns kResultOk if it works ...
Definition: GUIJmbParameter.h:354
ParamID getParamID() const override
Each parameter has a unique ID returned by this method.
Definition: GUIJmbParameter.h:320
IMessageProducer * fMessageProducer
Definition: GUIJmbParameter.h:77
JmbParamDef< T > const * getParamDefT() const
Definition: GUIJmbParameter.h:114
tresult readFromStream(IBStreamer &iStreamer) override
Definition: GUIJmbParameter.h:202
bool update(int32 const &iDiscreteValue) override
First check if the value provided (iValue) is different from the current value and if that is the cas...
Definition: GUIJmbParameter.h:377
Interface defining a message handler.
Definition: MessageHandler.h:30
void writeToStream(std::ostream &oStream) const override
Definition: GUIJmbParameter.h:217
tresult broadcast() const
Definition: GUIJmbParameter.cpp:29
IGUIJmbParameter(std::shared_ptr< IJmbParamDef > iParamDef)
Definition: GUIJmbParameter.h:43
GUIJmbParam< T > & operator=(GUIJmbParam< T > const &iOther)=default
Assignment operator: fMyParam = registerParam(...);
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const override
Definition: GUIJmbParameter.h:278
tresult accessValue(ValueAccessor const &iGetter) const override
API to access the underlying value.
Definition: GUIJmbParameter.h:365
tresult setValue(ParamType &&iValue)
Sets the value.
Definition: GUIJmbParameter.h:187
std::function< void(T const &)> ValueAccessor
API to access the value of the param.
Definition: IGUIParameter.h:178
void setValue(T const &iNewValue)
The difference with update is that it does not check for equality (case when T is not comparable)
Definition: GUIJmbParameter.h:520
tresult writeToMessage(Message &oMessage) const override
Definition: GUIJmbParameter.h:238
T ParamType
Definition: GUIJmbParameter.h:88
void setMessageProducer(IMessageProducer *iMessageProducer)
Definition: GUIJmbParameter.h:73
T const * operator->() const
Definition: GUIJmbParameter.h:538
typename GUIDiscreteParameter::ITEditor EditorType
Definition: GUIJmbParameter.h:307
std::string toUTF8String(int32 iPrecision) const override
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
Definition: GUIJmbParameter.h:433
Definition: GUIState.h:36
tresult handleMessage(Message const &iMessage) override
Definition: GUIJmbParameter.h:67
tresult setValue(int32 const &iDiscreteValue) override
Unconditionaly sets the value of the parameter to the value provided.
Definition: GUIJmbParameter.h:395
bool updateIf(ValueModifier const &iValueModifier)
Use this flavor of update if you want to modify the value itself.
Definition: GUIJmbParameter.h:151
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener)
Definition: GUIJmbParameter.h:558
std::shared_ptr< GUIJmbParameter< T > > fPtr
Definition: GUIJmbParameter.h:564
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition: GUIJmbParameter.h:488
std::shared_ptr< GUIJmbParameter< T > > fJmbParameter
Definition: GUIJmbParameter.h:439
virtual tresult writeToMessage(Message &oMessage) const =0
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const override
Creates a connection between this parameter and the change listener: whenever the parameter changes,...
Definition: GUIJmbParameter.h:332
bool exists() const
Definition: GUIJmbParameter.h:499
std::shared_ptr< GUIDiscreteParameter > asDiscreteParameter(int32 iStepCount) override
Converts this parameter into a discrete parameter.
Definition: GUIJmbParameter.h:344
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const override
Definition: GUIJmbParameter.h:270
This is the templated version providing serializer methods, very similar to the GUIVstParameter conce...
Definition: GUIJmbParameter.h:85
T const & getValue() const
Definition: GUIJmbParameter.h:532
int32 getStepCount() const override
When a parameter is a discrete parameter (which means its underlying backing type is an int32 with va...
Definition: GUIJmbParameter.h:326
~GUIJmbParameter() override
Definition: GUIJmbParameter.h:103
bool update(ParamType const &iValue) override
Update the parameter with a value.
Definition: GUIJmbParameter.h:124
GUIJmbParam(std::shared_ptr< GUIJmbParameter< T >> iPtr=nullptr)
Definition: GUIJmbParameter.h:491
void resetToDefault()
Resets the param to its default value.
Definition: GUIJmbParameter.h:529
ParamType const & getValue() const
Definition: GUIJmbParameter.h:251
std::shared_ptr< GUIDiscreteParameter > asDiscreteParameter(int32 iStepCount) override
Converts this parameter into a discrete parameter.
Definition: GUIJmbParameter.h:447
void broadcast(T &&iValue)
Definition: GUIJmbParameter.h:551
Interface that defines a converter from a type T to an int32 given a number of steps (provided by get...
Definition: ParamSerializers.h:45
ParamType fValue
Definition: GUIJmbParameter.h:287
virtual tresult writeToStream(IBStreamer &oStreamer) const =0
GUIJmbParameter(std::shared_ptr< JmbParamDef< T >> iParamDef)
Definition: GUIJmbParameter.h:94
IJmbParamDef const * getParamDef() const
Definition: GUIJmbParameter.h:46
Wraps a GUIJmbParameter<T> to interpret it as a discrete parameter using the converter.
Definition: GUIJmbParameter.h:304
int32 getStepCount() const override
When a parameter is a discrete parameter (which means its underlying backing type is an int32 with va...
Definition: GUIJmbParameter.h:111
tresult writeToStream(IBStreamer &oStreamer) const override
Definition: GUIJmbParameter.h:211
ParamID getJmbParamID() const
Definition: GUIJmbParameter.h:49
tresult setValue(ParamType const &iValue) override
Sets the value.
Definition: GUIJmbParameter.h:165
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback)
Definition: GUIJmbParameter.h:561
static std::shared_ptr< GUIJmbParameter< T > > castToJmb(std::shared_ptr< IGUIParameter > iParam)
Convenient function to cast a generic IGUIParameter to a GUIJmbParameter<T>.
Definition: GUIJmbParameter.h:295
ParamID getParamID() const
Definition: GUIJmbParameter.h:502
GUIDiscreteJmbParameter(std::shared_ptr< GUIJmbParameter< T >> iJmbParameter, std::shared_ptr< IDiscreteConverter< T >> iConverter)
Definition: GUIJmbParameter.h:310
void setValue(T &&iNewValue)
The difference with update is that it does not check for equality (case when T is not comparable)
Definition: GUIJmbParameter.h:525
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const override
Creates a connection between this parameter and the callback: whenever the parameter changes,...
Definition: GUIJmbParameter.h:338
Defines the API for the editor which can be obtained by calling ITGUIParameter::edit().
Definition: IGUIParameter.h:232
virtual tresult readFromStream(IBStreamer &iStreamer)=0
std::shared_ptr< IDiscreteConverter< T > > fConverter
Definition: GUIJmbParameter.h:440
Base class for all non vst parameters (need to provide serialization/deserialization)
Definition: ParamDef.h:273
tresult broadcast() const
Definition: GUIJmbParameter.h:541
std::string toUTF8String(int32 iPrecision) const override
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
Definition: GUIJmbParameter.h:223
virtual tresult readFromMessage(Message const &iMessage)=0
Base class for jamba parameters (non templated)
Definition: ParamDef.h:237
std::unique_ptr< EditorType > edit() override
Creates an editor to modify the parameter in a transactional fashion.
Definition: GUIJmbParameter.h:257
ParamType & getValue()
Definition: GUIJmbParameter.h:254
Interface to implement to receive parameter changes.
Definition: Parameters.h:43
tresult readFromMessage(Message const &iMessage) override
Definition: GUIJmbParameter.h:229