Class: FMOD::Core::ParameterInfo
- Includes:
- Fiddle
- Defined in:
- lib/fmod/core/parameter_info.rb
Overview
Base Structure for DSP parameter descriptions.
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The description of the parameter to be displayed as a help item / tooltip for this parameter.
-
#label ⇒ String
readonly
A string to be put next to value to denote the unit type (ie “Hz”).
-
#name ⇒ String
readonly
The of the parameter to be displayed (ie “Cutoff frequency”).
-
#type ⇒ Integer
readonly
The type of this parameter.
Instance Method Summary collapse
-
#info ⇒ FloatDescription, ...
Struct containing information about the parameter.
-
#initialize(address = nil) ⇒ ParameterInfo
constructor
A new instance of ParameterInfo.
Methods inherited from Structure
Constructor Details
#initialize(address = nil) ⇒ ParameterInfo
Returns a new instance of ParameterInfo.
14 15 16 17 18 |
# File 'lib/fmod/core/parameter_info.rb', line 14 def initialize(address = nil) types = [TYPE_INT, [TYPE_CHAR, 16], [TYPE_CHAR, 16], TYPE_VOIDP, TYPE_VOIDP] members = [:type, :name, :label, :description, :info] super(address, types, members) end |
Instance Attribute Details
#description ⇒ String (readonly)
Returns the description of the parameter to be displayed as a help item / tooltip for this parameter.
51 52 53 |
# File 'lib/fmod/core/parameter_info.rb', line 51 def description self[:description].to_s end |
#label ⇒ String (readonly)
Returns a string to be put next to value to denote the unit type (ie “Hz”).
43 44 45 |
# File 'lib/fmod/core/parameter_info.rb', line 43 def label (self + SIZEOF_INT + 16).to_s(16).delete("\0") end |
#name ⇒ String (readonly)
Returns the of the parameter to be displayed (ie “Cutoff frequency”).
34 35 36 |
# File 'lib/fmod/core/parameter_info.rb', line 34 def name (self + SIZEOF_INT).to_s(16).delete("\0").force_encoding('UTF-8') end |
#type ⇒ Integer (readonly)
Returns the type of this parameter. @see ParameterType.
25 26 27 |
# File 'lib/fmod/core/parameter_info.rb', line 25 def type self[:type] end |
Instance Method Details
#info ⇒ FloatDescription, ...
Struct containing information about the parameter. The type of info will vary depending on the #type value.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/fmod/core/parameter_info.rb', line 65 def info pointer = self + SIZEOF_INT + (SIZEOF_CHAR * 32) + SIZEOF_INTPTR_T case self[:type] when ParameterType::FLOAT then FloatDescription.new(pointer) when ParameterType::INT then IntegerDescription.new(pointer) when ParameterType::BOOL then BoolDescription.new(pointer) when ParameterType::DATA then DataDescription.new(pointer) else raise RangeError, "Invalid data type for parameter." end end |