Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
LV2ControlPort Class Referencefinal

Immutable description of an LV2 control port. More...

#include <LV2Ports.h>

Inheritance diagram for LV2ControlPort:
[legend]
Collaboration diagram for LV2ControlPort:
[legend]

Public Member Functions

 LV2ControlPort (const LilvPort *port, int index, bool isInput, const wxString &symbol, const wxString &name, const TranslatableString &group, std::vector< double > scaleValues, wxArrayString scaleLabels, const wxString &units, float min, float max, float def, bool hasLo, bool hasHi, bool toggle, bool enumeration, bool integer, bool sampleRate, bool trigger, bool logarithmic)
 
size_t Discretize (float value) const
 Map a real number to one of the scale points. More...
 
- Public Member Functions inherited from LV2Port
 LV2Port (const LilvPort *port, int index, bool isInput, const wxString &symbol, const wxString &name, const TranslatableString &group)
 

Public Attributes

const std::vector< double > mScaleValues
 
const wxArrayString mScaleLabels
 
const wxString mUnits
 
const float mMin
 
const float mMax
 
const float mDef
 
const bool mHasLo
 
const bool mHasHi
 
const bool mToggle
 
const bool mEnumeration
 
const bool mInteger
 
const bool mSampleRate
 
const bool mTrigger
 
const bool mLogarithmic
 
- Public Attributes inherited from LV2Port
const LilvPort *const mPort
 
const uint32_t mIndex
 
const bool mIsInput
 
const wxString mSymbol
 
const wxString mName
 
const TranslatableString mGroup
 

Detailed Description

Immutable description of an LV2 control port.

Definition at line 160 of file LV2Ports.h.

Constructor & Destructor Documentation

◆ LV2ControlPort()

LV2ControlPort::LV2ControlPort ( const LilvPort *  port,
int  index,
bool  isInput,
const wxString &  symbol,
const wxString &  name,
const TranslatableString group,
std::vector< double >  scaleValues,
wxArrayString  scaleLabels,
const wxString &  units,
float  min,
float  max,
float  def,
bool  hasLo,
bool  hasHi,
bool  toggle,
bool  enumeration,
bool  integer,
bool  sampleRate,
bool  trigger,
bool  logarithmic 
)
inline

Definition at line 163 of file LV2Ports.h.

171 : LV2Port{ port, index, isInput, symbol, name, group }
172 , mScaleValues{ move(scaleValues) }
173 , mScaleLabels( std::move(scaleLabels) )
174 , mUnits{ units }
175 , mMin{ min }, mMax{ max }, mDef{ def }
176 , mHasLo{ hasLo }, mHasHi{ hasHi }
177 , mToggle{ toggle }, mEnumeration{ enumeration }, mInteger{ integer }
179 , mTrigger{ trigger }, mLogarithmic{ logarithmic }
180 {}
int min(int a, int b)
wxString name
Definition: TagsEditor.cpp:166
const bool mSampleRate
Definition: LV2Ports.h:195
const bool mInteger
Definition: LV2Ports.h:194
const bool mToggle
Definition: LV2Ports.h:192
const bool mTrigger
Definition: LV2Ports.h:196
const wxArrayString mScaleLabels
Definition: LV2Ports.h:184
const bool mHasHi
Definition: LV2Ports.h:191
const bool mHasLo
Definition: LV2Ports.h:190
const float mMax
Definition: LV2Ports.h:188
const wxString mUnits
Definition: LV2Ports.h:186
const bool mEnumeration
Definition: LV2Ports.h:193
const float mDef
Definition: LV2Ports.h:189
const bool mLogarithmic
Definition: LV2Ports.h:197
const std::vector< double > mScaleValues
Definition: LV2Ports.h:183
const float mMin
Definition: LV2Ports.h:187
Immutable description of an LV2 port.
Definition: LV2Ports.h:35

Member Function Documentation

◆ Discretize()

size_t LV2ControlPort::Discretize ( float  value) const

Map a real number to one of the scale points.

Definition at line 128 of file LV2Ports.cpp.

129{
130 auto s = mScaleValues.size();
131 for (; s > 0 && --s;)
132 if (value >= mScaleValues[s])
133 break;
134 return s;
135}

References mScaleValues.

Member Data Documentation

◆ mDef

const float LV2ControlPort::mDef

Definition at line 189 of file LV2Ports.h.

◆ mEnumeration

const bool LV2ControlPort::mEnumeration

Definition at line 193 of file LV2Ports.h.

◆ mHasHi

const bool LV2ControlPort::mHasHi

Definition at line 191 of file LV2Ports.h.

◆ mHasLo

const bool LV2ControlPort::mHasLo

Definition at line 190 of file LV2Ports.h.

◆ mInteger

const bool LV2ControlPort::mInteger

Definition at line 194 of file LV2Ports.h.

◆ mLogarithmic

const bool LV2ControlPort::mLogarithmic

Definition at line 197 of file LV2Ports.h.

◆ mMax

const float LV2ControlPort::mMax

Definition at line 188 of file LV2Ports.h.

◆ mMin

const float LV2ControlPort::mMin

Definition at line 187 of file LV2Ports.h.

◆ mSampleRate

const bool LV2ControlPort::mSampleRate

Definition at line 195 of file LV2Ports.h.

◆ mScaleLabels

const wxArrayString LV2ControlPort::mScaleLabels

Definition at line 184 of file LV2Ports.h.

◆ mScaleValues

const std::vector<double> LV2ControlPort::mScaleValues

Definition at line 183 of file LV2Ports.h.

Referenced by Discretize().

◆ mToggle

const bool LV2ControlPort::mToggle

Definition at line 192 of file LV2Ports.h.

◆ mTrigger

const bool LV2ControlPort::mTrigger

Definition at line 196 of file LV2Ports.h.

◆ mUnits

const wxString LV2ControlPort::mUnits

Definition at line 186 of file LV2Ports.h.


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