Jamba  3.0.2
Parameters.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 #ifndef __PONGASOFT_VST_PARAMETERS_H__
19 #define __PONGASOFT_VST_PARAMETERS_H__
20 
21 #include "ParamDef.h"
22 #include "NormalizedState.h"
23 
24 #include <map>
25 #include <vector>
26 #include <set>
27 #include <functional>
28 
29 #include <public.sdk/source/vst/vstparameters.h>
30 
31 namespace pongasoft {
32 namespace VST {
33 
34 namespace Debug { class ParamDisplay; }
35 
40 {
41 public:
46  {
47  public:
48  virtual void onParameterChange(ParamID iParamID) = 0;
49  };
50 
57  using ChangeCallback = std::function<void()>;
58 
62  template<typename Param>
63  using ChangeCallback1 = std::function<void(Param &)>;
64 
68  template<typename TView, typename Param>
69  using ChangeCallback2 = std::function<void(TView *, Param &)>;
70 
71 public:
75  {
76  // builder methods
77  RawVstParamDefBuilder &units(const TChar *iUnits) { fUnits = iUnits; return *this; }
78  RawVstParamDefBuilder &defaultValue(ParamValue iDefaultValue) { fDefaultValue = iDefaultValue; return *this;}
79  RawVstParamDefBuilder &stepCount(int32 iStepCount) { fStepCount = iStepCount; return *this;}
80  RawVstParamDefBuilder &flags(int32 iFlags) { fFlags = iFlags; return *this; }
81  RawVstParamDefBuilder &unitID(int32 iUnitID) { fUnitID = iUnitID; return *this; }
82  RawVstParamDefBuilder &shortTitle(const TChar *iShortTitle) { fShortTitle = iShortTitle; return *this; }
83  RawVstParamDefBuilder &precision(int32 iPrecision) { fPrecision = iPrecision; return *this; }
86  RawVstParamDefBuilder &transient(bool iTransient = true) { fTransient = iTransient; return *this; }
87 
88  // parameter factory method
89  RawVstParam add() const;
90 
91  // fields
92  ParamID fParamID;
93  const TChar *fTitle;
94  const TChar *fUnits = nullptr;
95  ParamValue fDefaultValue{};
96  int32 fStepCount{0};
97  int32 fFlags = ParameterInfo::kCanAutomate;
98  UnitID fUnitID = kRootUnitId;
99  const TChar *fShortTitle = nullptr;
100  int32 fPrecision = 4;
102  bool fTransient = false;
103 
104  friend class Parameters;
105 
106  protected:
107  RawVstParamDefBuilder(Parameters *iParameters, ParamID iParamID, const TChar* iTitle) :
108  fParamID{iParamID}, fTitle{iTitle}, fParameters{iParameters} {}
109 
110  private:
112  };
113 
117  template<typename T>
119  {
120  // builder methods
121  VstParamDefBuilder &units(const TChar *iUnits) { fUnits = iUnits; return *this; }
122  VstParamDefBuilder &defaultValue(T const &iDefaultValue) { fDefaultValue = iDefaultValue; return *this;}
123  VstParamDefBuilder &flags(int32 iFlags) { fFlags = iFlags; return *this; }
124  VstParamDefBuilder &unitID(int32 iUnitID) { fUnitID = iUnitID; return *this; }
125  VstParamDefBuilder &shortTitle(const TChar *iShortTitle) { fShortTitle = iShortTitle; return *this; }
126  VstParamDefBuilder &precision(int32 iPrecision) { fPrecision = iPrecision; return *this; }
129  VstParamDefBuilder &transient(bool iTransient = true) { fTransient = iTransient; return *this; }
130  VstParamDefBuilder &converter(std::shared_ptr<IParamConverter<T>> iConverter) { fConverter = std::move(iConverter); return *this; }
131  template<typename ParamConverter, typename... Args>
132  VstParamDefBuilder &converter(Args... iArgs) { fConverter = std::make_shared<ParamConverter>(iArgs...); return *this; }
133 
134  // parameter factory method
135  VstParam<T> add() const;
136 
137  // fields
138  ParamID fParamID;
139  const TChar *fTitle;
140  const TChar *fUnits = nullptr;
142  int32 fFlags = ParameterInfo::kCanAutomate;
143  UnitID fUnitID = kRootUnitId;
144  const TChar *fShortTitle = nullptr;
145  int32 fPrecision = 4;
147  bool fTransient = false;
148  std::shared_ptr<IParamConverter<T>> fConverter{};
149 
150  friend class Parameters;
151 
152  protected:
153  VstParamDefBuilder(Parameters *iParameters, ParamID iParamID, const TChar* iTitle) :
154  fParamID{iParamID}, fTitle{iTitle}, fParameters{iParameters} {}
155 
156  private:
158  };
159 
163  template<typename T>
165  {
166  // builder methods
167  JmbParamDefBuilder &defaultValue(T const &iDefaultValue) { fDefaultValue = iDefaultValue; return *this;}
168  JmbParamDefBuilder &transient(bool iTransient = true) { fTransient = iTransient; return *this; }
171  JmbParamDefBuilder &shared(bool iShared = true) { fShared = iShared; return *this; }
172  JmbParamDefBuilder &serializer(std::shared_ptr<IParamSerializer<T>> iSerializer) { fSerializer = std::move(iSerializer); return *this; }
173  template<typename ParamSerializer, typename... Args>
174  JmbParamDefBuilder &serializer(Args... iArgs) { fSerializer = std::make_shared<ParamSerializer>(iArgs...); return *this; }
175 
176  // parameter factory method
177  JmbParam<T> add() const;
178 
179  // fields
180  ParamID fParamID;
181  const TChar *fTitle;
184  bool fTransient = false;
185  bool fShared = false;
186  std::shared_ptr<IParamSerializer<T>> fSerializer{};
187 
188  friend class Parameters;
189 
190  protected:
191  JmbParamDefBuilder(Parameters *iParameters, ParamID iParamID, const TChar* iTitle) :
192  fParamID{iParamID}, fTitle{iTitle}, fParameters{iParameters} {}
193 
194  private:
196  };
197 
198 public:
199  // Constructor
200  explicit Parameters() = default;
201 
202  // Ensure the class is polymorphinc
203  virtual ~Parameters() = default;
204 
205 
209  RawVstParamDefBuilder raw(ParamID iParamID, const TChar *iTitle);
210 
214  template<typename ParamConverter, typename... Args>
215  VstParamDefBuilder<typename ParamConverter::ParamType> vst(ParamID iParamID, const TChar *iTitle, Args... iConverterArgs);
216 
221  template<typename T>
222  VstParamDefBuilder<T> vstFromType(ParamID iParamID, const TChar *iTitle);
223 
227  template<typename ParamSerializer, typename... Args>
228  JmbParamDefBuilder<typename ParamSerializer::ParamType> jmb(ParamID iParamID, const TChar *iTitle, Args... iSerializerArgs);
229 
234  template<typename T>
235  JmbParamDefBuilder<T> jmbFromType(ParamID iParamID, const TChar *iTitle);
236 
244  template<typename... Args>
245  tresult setRTSaveStateOrder(int16 iVersion, Args... args);
246 
251  tresult setRTSaveStateOrder(NormalizedState::SaveOrder const &iSaveOrder);
252 
257 
265  template<typename... Args>
266  tresult setGUISaveStateOrder(int16 iVersion, Args... args);
267 
272  tresult setGUISaveStateOrder(NormalizedState::SaveOrder const &iSaveOrder);
273 
279 
284  void registerVstParameters(Vst::ParameterContainer &iParameterContainer) const;
285 
288  virtual tresult readRTState(IBStreamer &iStreamer, NormalizedState *oNormalizedState) const;
289 
292  virtual tresult writeRTState(NormalizedState const *iNormalizedState, IBStreamer &oStreamer) const;
293 
297  virtual std::unique_ptr<NormalizedState> newRTState() const;
298 
302  virtual ParamValue readNormalizedValue(ParamID iParamID, IBStreamer &iStreamer) const;
303 
304  // getParamDef - nullptr when not found
305  std::shared_ptr<RawVstParamDef> getRawVstParamDef(ParamID iParamID) const;
306 
307  // getJmbParamDef - nullptr when not found
308  std::shared_ptr<IJmbParamDef> getJmbParamDef(ParamID iParamID) const;
309 
310  // getVstRegistrationOrder
311  std::vector<ParamID> const &getVstRegistrationOrder() const { return fVstRegistrationOrder; }
312 
313  // getAllRegistrationOrder
314  std::vector<ParamID> const &getAllRegistrationOrder() const { return fAllRegistrationOrder; }
315 
316  // gives access for debug
317  friend class Debug::ParamDisplay;
318 
319 protected:
320  // internally called by the builder
321  RawVstParam add(RawVstParamDefBuilder const &iBuilder);
322 
323  // internally called by the builder
324  template<typename T>
325  VstParam<T> add(VstParamDefBuilder<T> const &iBuilder);
326 
327  // internally called by the builder
328  template<typename T>
329  JmbParam<T> add(JmbParamDefBuilder<T> const &iBuilder);
330 
331  // addVstParamDef
332  tresult addVstParamDef(std::shared_ptr<RawVstParamDef> iParamDef);
333 
334  // addJmbParamDef
335  tresult addJmbParamDef(std::shared_ptr<IJmbParamDef> iParamDef);
336 
337 private:
338  // contains all the registered (raw type) parameters (unique ID, will be checked on add)
339  std::map<ParamID, std::shared_ptr<RawVstParamDef>> fVstParams{};
340 
341  // contains all the registered (serializable type) parameters (unique ID, will be checked on add)
342  std::map<ParamID, std::shared_ptr<IJmbParamDef>> fJmbParams{};
343 
344  // order in which the parameters will be registered in the vst world
345  std::vector<ParamID> fVstRegistrationOrder{};
346 
347  // order in which the parameters were registered
348  std::vector<ParamID> fAllRegistrationOrder{};
349 
353 
354 private:
355  // leaf of templated calls to build a list of ParamIDs from ParamID or ParamDefs
356  tresult buildParamIDs(std::vector<ParamID> &iParamIDs) { return kResultOk; }
357 
358  // case when ParamID
359  template<typename... Args>
360  tresult buildParamIDs(std::vector<ParamID> &iParamIDs, ParamID id, Args... args);
361 
362  // case when IJmbParamDef
363  template<typename... Args>
364  tresult buildParamIDs(std::vector<ParamID> &iParamIDs, std::shared_ptr<IJmbParamDef> &iParamDef, Args... args)
365  {
366  return buildParamIDs(iParamIDs, iParamDef->fParamID, args...);
367  }
368 
369  // case when IJmbParamDef
370  template<typename T, typename... Args>
371  tresult buildParamIDs(std::vector<ParamID> &iParamIDs, std::shared_ptr<JmbParamDef<T>> &iParamDef, Args... args)
372  {
373  return buildParamIDs(iParamIDs, iParamDef->fParamID, args...);
374  }
375 
376  // case when VstParamDef
377  template<typename ParamConverver, typename... Args>
378  tresult buildParamIDs(std::vector<ParamID> &iParamIDs, std::shared_ptr<VstParamDef<ParamConverver>> &iParamDef, Args... args)
379  {
380  return buildParamIDs(iParamIDs, iParamDef->fParamID, args...);
381  }
382 
383  // case when RawVstParamDef
384  template<typename... Args>
385  tresult buildParamIDs(std::vector<ParamID> &iParamIDs, std::shared_ptr<RawVstParamDef> &iParamDef, Args... args)
386  {
387  return buildParamIDs(iParamIDs, iParamDef->fParamID, args...);
388  }
389 
390 };
391 
392 //------------------------------------------------------------------------
393 // Parameters::JmbParamDefBuilder::add
394 //------------------------------------------------------------------------
395 template<typename T>
397 {
398  return fParameters->add(*this);
399 }
400 
401 //------------------------------------------------------------------------
402 // Parameters::VstParamDefBuilder::add
403 //------------------------------------------------------------------------
404 template<typename T>
406 {
407  return fParameters->add(*this);
408 }
409 
410 //------------------------------------------------------------------------
411 // Parameters::add (called by the builder)
412 //------------------------------------------------------------------------
413 template<typename T>
415 {
416  auto param = std::make_shared<VstParamDef<T>>(iBuilder.fParamID,
417  iBuilder.fTitle,
418  iBuilder.fUnits,
419  iBuilder.fDefaultValue,
420  iBuilder.fFlags,
421  iBuilder.fUnitID,
422  iBuilder.fShortTitle,
423  iBuilder.fPrecision,
424  iBuilder.fOwner,
425  iBuilder.fTransient,
426  iBuilder.fConverter);
427 
428  if(!iBuilder.fTransient && !iBuilder.fConverter)
429  {
430  DLOG_F(WARNING, "No converter defined for non transient parameter [%d]", iBuilder.fParamID);
431  }
432 
433  if(addVstParamDef(param) == kResultOk)
434  return param;
435  else
436  return nullptr;
437 }
438 
439 //------------------------------------------------------------------------
440 // Parameters::add (called by the builder)
441 //------------------------------------------------------------------------
442 template<typename T>
444 {
445  auto param = std::make_shared<JmbParamDef<T>>(iBuilder.fParamID,
446  iBuilder.fTitle,
447  iBuilder.fOwner,
448  iBuilder.fTransient,
449  iBuilder.fShared,
450  iBuilder.fDefaultValue,
451  iBuilder.fSerializer);
452 
453  if(!iBuilder.fTransient && !iBuilder.fSerializer)
454  {
455  DLOG_F(WARNING, "No serializer defined for parameter [%d] (won't be able to be saved)", iBuilder.fParamID);
456  }
457 
458  if(iBuilder.fShared && !iBuilder.fSerializer)
459  {
460  DLOG_F(WARNING, "No serializer defined for parameter [%d] (won't be able to be shared with peer)", iBuilder.fParamID);
461  }
462 
463  if(addJmbParamDef(param) == kResultOk)
464  return param;
465  else
466  return nullptr;
467 }
468 
469 
470 //------------------------------------------------------------------------
471 // Parameters::vstFromType
472 //------------------------------------------------------------------------
473 template<typename T>
474 Parameters::VstParamDefBuilder<T> Parameters::vstFromType(ParamID iParamID, const TChar *iTitle)
475 {
476  return Parameters::VstParamDefBuilder<T>(this, iParamID, iTitle);
477 }
478 
479 //------------------------------------------------------------------------
480 // Parameters::vst
481 //------------------------------------------------------------------------
482 template<typename ParamConverter, typename... Args>
484  const TChar *iTitle,
485  Args... iConverterArgs)
486 {
487  auto builder = vstFromType<typename ParamConverter::ParamType>(iParamID, iTitle);
488  builder.template converter<ParamConverter>(iConverterArgs...);
489  return builder;
490 }
491 
492 //------------------------------------------------------------------------
493 // Parameters::jmbFromType
494 //------------------------------------------------------------------------
495 template<typename T>
496 Parameters::JmbParamDefBuilder<T> Parameters::jmbFromType(ParamID iParamID, const TChar *iTitle)
497 {
498  return Parameters::JmbParamDefBuilder<T>(this, iParamID, iTitle);
499 }
500 
501 //------------------------------------------------------------------------
502 // Parameters::jmb
503 //------------------------------------------------------------------------
504 template<typename ParamSerializer, typename... Args>
506  const TChar *iTitle,
507  Args... iSerializerArgs)
508 {
509  auto builder = jmbFromType<typename ParamSerializer::ParamType>(iParamID, iTitle);
510  builder.template serializer<ParamSerializer>(iSerializerArgs...);
511  return builder;
512 }
513 
514 //------------------------------------------------------------------------
515 // Parameters::buildParamIDs
516 //------------------------------------------------------------------------
517 template<typename... Args>
518 tresult Parameters::buildParamIDs(std::vector<ParamID> &iParamIDs, ParamID iParamID, Args... args)
519 {
520  tresult res = kResultOk;
521 
522  if(fVstParams.find(iParamID) != fVstParams.cend() ||
523  fJmbParams.find(iParamID) != fJmbParams.cend())
524  {
525  iParamIDs.emplace_back(iParamID);
526  }
527  else
528  {
529  DLOG_F(ERROR, "No such parameter [%d]", iParamID);
530  res = kResultFalse;
531  }
532  res |= buildParamIDs(iParamIDs, args...);
533  return res;
534 }
535 
536 //------------------------------------------------------------------------
537 // Parameters::setRTSaveStateOrder
538 //------------------------------------------------------------------------
539 template<typename... Args>
540 tresult Parameters::setRTSaveStateOrder(int16 iVersion, Args... args)
541 {
542  std::vector<ParamID> ids{};
543  buildParamIDs(ids, args...);
544  return setRTSaveStateOrder({iVersion, ids});
545 }
546 
547 //------------------------------------------------------------------------
548 // Parameters::setRTSaveStateOrder
549 //------------------------------------------------------------------------
550 template<typename... Args>
551 tresult Parameters::setGUISaveStateOrder(int16 iVersion, Args... args)
552 {
553  std::vector<ParamID> ids{};
554  buildParamIDs(ids, args...);
555  return setGUISaveStateOrder({iVersion, ids});
556 }
557 
558 }
559 }
560 
561 #endif // __PONGASOFT_VST_PARAMETERS_H__
tresult buildParamIDs(std::vector< ParamID > &iParamIDs, std::shared_ptr< JmbParamDef< T >> &iParamDef, Args... args)
Definition: Parameters.h:371
IParamDef::Owner fOwner
Definition: Parameters.h:101
std::map< ParamID, std::shared_ptr< IJmbParamDef > > fJmbParams
Definition: Parameters.h:342
Parameters * fParameters
Definition: Parameters.h:157
NormalizedState::SaveOrder fGUISaveStateOrder
Definition: Parameters.h:352
const TChar * fShortTitle
Definition: Parameters.h:144
Definition: Parameters.h:39
const TChar * fTitle
Definition: Parameters.h:139
const TChar * fShortTitle
Definition: Parameters.h:99
tresult setRTSaveStateOrder(int16 iVersion, Args... args)
Definition: Parameters.h:540
int32 fStepCount
Definition: Parameters.h:96
virtual void onParameterChange(ParamID iParamID)=0
JmbParamDefBuilder< typename ParamSerializer::ParamType > jmb(ParamID iParamID, const TChar *iTitle, Args... iSerializerArgs)
Definition: Parameters.h:505
std::shared_ptr< VstParamDef< T > > VstParam
Definition: ParamDef.h:358
std::shared_ptr< IParamSerializer< T > > fSerializer
Definition: Parameters.h:186
std::vector< ParamID > fAllRegistrationOrder
Definition: Parameters.h:348
ParamValue fDefaultValue
Definition: Parameters.h:95
std::shared_ptr< IJmbParamDef > getJmbParamDef(ParamID iParamID) const
Definition: Parameters.cpp:143
RawVstParamDefBuilder raw(ParamID iParamID, const TChar *iTitle)
Definition: Parameters.cpp:399
const TChar * fTitle
Definition: Parameters.h:181
RawVstParamDefBuilder & unitID(int32 iUnitID)
Definition: Parameters.h:81
VstParamDefBuilder & flags(int32 iFlags)
Definition: Parameters.h:123
VstParamDefBuilder & shortTitle(const TChar *iShortTitle)
Definition: Parameters.h:125
Definition: ParamDisplay.h:33
UnitID fUnitID
Definition: Parameters.h:98
T fDefaultValue
Definition: Parameters.h:141
tresult buildParamIDs(std::vector< ParamID > &iParamIDs)
Definition: Parameters.h:356
Definition: Clock.h:22
virtual ParamValue readNormalizedValue(ParamID iParamID, IBStreamer &iStreamer) const
Definition: Parameters.cpp:116
Definition: NormalizedState.h:44
tresult buildParamIDs(std::vector< ParamID > &iParamIDs, std::shared_ptr< VstParamDef< ParamConverver >> &iParamDef, Args... args)
Definition: Parameters.h:378
RawVstParamDefBuilder & defaultValue(ParamValue iDefaultValue)
Definition: Parameters.h:78
std::vector< ParamID > const & getAllRegistrationOrder() const
Definition: Parameters.h:314
JmbParamDefBuilder & rtOwned()
Definition: Parameters.h:169
IParamDef::Owner fOwner
Definition: Parameters.h:183
int32 fFlags
Definition: Parameters.h:142
tresult setGUISaveStateOrder(int16 iVersion, Args... args)
Definition: Parameters.h:551
ParamID fParamID
Definition: Parameters.h:138
std::shared_ptr< IParamConverter< T > > fConverter
Definition: Parameters.h:148
VstParamDefBuilder & converter(std::shared_ptr< IParamConverter< T >> iConverter)
Definition: Parameters.h:130
NormalizedState::SaveOrder const & getRTSaveStateOrder() const
Definition: Parameters.h:278
std::vector< ParamID > fVstRegistrationOrder
Definition: Parameters.h:345
VstParamDefBuilder & defaultValue(T const &iDefaultValue)
Definition: Parameters.h:122
VstParamDefBuilder & precision(int32 iPrecision)
Definition: Parameters.h:126
std::shared_ptr< JmbParamDef< T > > JmbParam
Definition: ParamDef.h:365
JmbParamDefBuilder & serializer(std::shared_ptr< IParamSerializer< T >> iSerializer)
Definition: Parameters.h:172
const TChar * fUnits
Definition: Parameters.h:140
RawVstParamDefBuilder & flags(int32 iFlags)
Definition: Parameters.h:80
bool fTransient
Definition: Parameters.h:147
tresult buildParamIDs(std::vector< ParamID > &iParamIDs, std::shared_ptr< RawVstParamDef > &iParamDef, Args... args)
Definition: Parameters.h:385
UnitID fUnitID
Definition: Parameters.h:143
Definition: NormalizedState.h:38
VstParam< T > add() const
Definition: Parameters.h:405
IParamDef::Owner fOwner
Definition: Parameters.h:146
JmbParamDefBuilder< T > jmbFromType(ParamID iParamID, const TChar *iTitle)
Definition: Parameters.h:496
tresult addVstParamDef(std::shared_ptr< RawVstParamDef > iParamDef)
Definition: Parameters.cpp:155
JmbParamDefBuilder & serializer(Args... iArgs)
Definition: Parameters.h:174
const TChar * fUnits
Definition: Parameters.h:94
RawVstParamDefBuilder & guiOwned()
Definition: Parameters.h:85
NormalizedState::SaveOrder const & getGUISaveStateOrder() const
Definition: Parameters.h:256
VstParamDefBuilder & unitID(int32 iUnitID)
Definition: Parameters.h:124
virtual tresult writeRTState(NormalizedState const *iNormalizedState, IBStreamer &oStreamer) const
Definition: Parameters.cpp:107
RawVstParamDefBuilder & units(const TChar *iUnits)
Definition: Parameters.h:77
RawVstParamDefBuilder & precision(int32 iPrecision)
Definition: Parameters.h:83
RawVstParamDefBuilder & shortTitle(const TChar *iShortTitle)
Definition: Parameters.h:82
RawVstParam add(RawVstParamDefBuilder const &iBuilder)
Definition: Parameters.cpp:376
std::shared_ptr< RawVstParamDef > RawVstParam
Definition: ParamDef.h:359
std::function< void()> ChangeCallback
Definition: Parameters.h:57
VstParamDefBuilder & guiOwned()
Definition: Parameters.h:128
bool fTransient
Definition: Parameters.h:102
Parameters * fParameters
Definition: Parameters.h:195
JmbParamDefBuilder(Parameters *iParameters, ParamID iParamID, const TChar *iTitle)
Definition: Parameters.h:191
RawVstParamDefBuilder(Parameters *iParameters, ParamID iParamID, const TChar *iTitle)
Definition: Parameters.h:107
VstParamDefBuilder< typename ParamConverter::ParamType > vst(ParamID iParamID, const TChar *iTitle, Args... iConverterArgs)
Definition: Parameters.h:483
std::shared_ptr< RawVstParamDef > getRawVstParamDef(ParamID iParamID) const
Definition: Parameters.cpp:131
JmbParamDefBuilder & guiOwned()
Definition: Parameters.h:170
tresult buildParamIDs(std::vector< ParamID > &iParamIDs, std::shared_ptr< IJmbParamDef > &iParamDef, Args... args)
Definition: Parameters.h:364
Definition: ParamSerializers.h:43
bool fTransient
Definition: Parameters.h:184
Owner
Definition: ParamDef.h:45
JmbParamDefBuilder & defaultValue(T const &iDefaultValue)
Definition: Parameters.h:167
RawVstParamDefBuilder & stepCount(int32 iStepCount)
Definition: Parameters.h:79
RawVstParamDefBuilder & rtOwned()
Definition: Parameters.h:84
bool fShared
Definition: Parameters.h:185
virtual ~Parameters()=default
void registerVstParameters(Vst::ParameterContainer &iParameterContainer) const
Definition: Parameters.cpp:56
ParamID fParamID
Definition: Parameters.h:92
T fDefaultValue
Definition: Parameters.h:182
int32 fPrecision
Definition: Parameters.h:100
JmbParam< T > add() const
Definition: Parameters.h:396
ParamID fParamID
Definition: Parameters.h:180
RawVstParam add() const
Definition: Parameters.cpp:368
VstParamDefBuilder & converter(Args... iArgs)
Definition: Parameters.h:132
std::vector< ParamID > const & getVstRegistrationOrder() const
Definition: Parameters.h:311
VstParamDefBuilder(Parameters *iParameters, ParamID iParamID, const TChar *iTitle)
Definition: Parameters.h:153
Definition: ParamDef.h:129
const TChar * fTitle
Definition: Parameters.h:93
std::map< ParamID, std::shared_ptr< RawVstParamDef > > fVstParams
Definition: Parameters.h:339
Parameters * fParameters
Definition: Parameters.h:111
virtual tresult readRTState(IBStreamer &iStreamer, NormalizedState *oNormalizedState) const
Definition: Parameters.cpp:87
VstParamDefBuilder< T > vstFromType(ParamID iParamID, const TChar *iTitle)
Definition: Parameters.h:474
VstParamDefBuilder & rtOwned()
Definition: Parameters.h:127
virtual std::unique_ptr< NormalizedState > newRTState() const
Definition: Parameters.cpp:68
NormalizedState::SaveOrder fRTSaveStateOrder
Definition: Parameters.h:351
tresult addJmbParamDef(std::shared_ptr< IJmbParamDef > iParamDef)
Definition: Parameters.cpp:190
Definition: ParamDef.h:225
std::function< void(Param &)> ChangeCallback1
Definition: Parameters.h:63
VstParamDefBuilder & units(const TChar *iUnits)
Definition: Parameters.h:121
int32 fPrecision
Definition: Parameters.h:145
JmbParamDefBuilder & shared(bool iShared=true)
Definition: Parameters.h:171
int32 fFlags
Definition: Parameters.h:97
Definition: ParamConverters.h:50
std::function< void(TView *, Param &)> ChangeCallback2
Definition: Parameters.h:69