Audacity 3.2.0
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
AudacityHostAttribute Class Referencefinal
Collaboration diagram for AudacityHostAttribute:
[legend]

Classes

union  v
 

Public Types

enum  Type { kInteger , kFloat , kString , kBinary }
 

Public Member Functions

 AudacityHostAttribute (int64 value)
 
 AudacityHostAttribute (double value)
 
 AudacityHostAttribute (const TChar *value, uint32 sizeInCodeUnit)
 
 AudacityHostAttribute (const void *value, uint32 sizeInBytes)
 
 ~AudacityHostAttribute ()
 
int64 intValue () const
 
double floatValue () const
 
const TChar * stringValue (uint32 &sizeInCodeUnit)
 
const void * binaryValue (uint32 &sizeInBytes)
 
Type getType () const
 

Protected Attributes

union AudacityHostAttribute::v v
 
uint32 size
 
Type type
 

Detailed Description

Definition at line 18 of file AudacityVst3HostApplication.cpp.

Member Enumeration Documentation

◆ Type

Constructor & Destructor Documentation

◆ AudacityHostAttribute() [1/4]

AudacityHostAttribute::AudacityHostAttribute ( int64  value)
inlineexplicit

◆ AudacityHostAttribute() [2/4]

AudacityHostAttribute::AudacityHostAttribute ( double  value)
inlineexplicit

Definition at line 36 of file AudacityVst3HostApplication.cpp.

37 : size(0)
38 , type(kFloat)
39 {
40 v.floatValue = value;
41 }

References AudacityHostAttribute::v::floatValue.

◆ AudacityHostAttribute() [3/4]

AudacityHostAttribute::AudacityHostAttribute ( const TChar *  value,
uint32  sizeInCodeUnit 
)
inlineexplicit

size is in code unit (count of TChar)

Definition at line 43 of file AudacityVst3HostApplication.cpp.

44 : size(sizeInCodeUnit)
45 , type(kString)
46 {
47 v.stringValue = new TChar[sizeInCodeUnit];
48 memcpy(v.stringValue, value, sizeInCodeUnit * sizeof(TChar));
49 }

References AudacityHostAttribute::v::stringValue.

◆ AudacityHostAttribute() [4/4]

AudacityHostAttribute::AudacityHostAttribute ( const void *  value,
uint32  sizeInBytes 
)
inlineexplicit

Definition at line 51 of file AudacityVst3HostApplication.cpp.

52 : size(sizeInBytes)
53 , type(kBinary)
54 {
55 v.binaryValue = new char[sizeInBytes];
56 memcpy(v.binaryValue, value, sizeInBytes);
57 }

References AudacityHostAttribute::v::binaryValue.

◆ ~AudacityHostAttribute()

AudacityHostAttribute::~AudacityHostAttribute ( )
inline

Definition at line 59 of file AudacityVst3HostApplication.cpp.

60 {
61 if (size)
62 delete[] v.binaryValue;
63 }

References AudacityHostAttribute::v::binaryValue, and size.

Member Function Documentation

◆ binaryValue()

const void * AudacityHostAttribute::binaryValue ( uint32 &  sizeInBytes)
inline

Definition at line 80 of file AudacityVst3HostApplication.cpp.

81 {
82 sizeInBytes = size;
83 return v.binaryValue;
84 }

References AudacityHostAttribute::v::binaryValue, and size.

◆ floatValue()

double AudacityHostAttribute::floatValue ( ) const
inline

Definition at line 70 of file AudacityVst3HostApplication.cpp.

71 {
72 return v.floatValue;
73 }

References AudacityHostAttribute::v::floatValue.

◆ getType()

Type AudacityHostAttribute::getType ( ) const
inline

Definition at line 86 of file AudacityVst3HostApplication.cpp.

87 {
88 return type;
89 }

References type.

◆ intValue()

int64 AudacityHostAttribute::intValue ( ) const
inline

Definition at line 65 of file AudacityVst3HostApplication.cpp.

66 {
67 return v.intValue;
68 }

References AudacityHostAttribute::v::intValue.

◆ stringValue()

const TChar * AudacityHostAttribute::stringValue ( uint32 &  sizeInCodeUnit)
inline

sizeInCodeUnit is in code unit (count of TChar)

Definition at line 75 of file AudacityVst3HostApplication.cpp.

76 {
77 sizeInCodeUnit = size;
78 return v.stringValue;
79 }

References size, and AudacityHostAttribute::v::stringValue.

Member Data Documentation

◆ size

uint32 AudacityHostAttribute::size
protected

◆ type

Type AudacityHostAttribute::type
protected

Definition at line 100 of file AudacityVst3HostApplication.cpp.

Referenced by getType().

◆ v


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