Class: FMOD::Core::IntegerDescription
- Defined in:
- lib/fmod/core/integer_description.rb
Overview
Structure describing a integer parameter for a DSP unit.
Instance Attribute Summary collapse
-
#default ⇒ Integer
The default parameter value.
-
#max ⇒ Integer
The maximum parameter value.
-
#min ⇒ Integer
The minimum parameter value.
Instance Method Summary collapse
-
#infinite? ⇒ Boolean
Flag indicating if the last value represents infinity.
-
#initialize(address = nil) ⇒ IntegerDescription
constructor
A new instance of IntegerDescription.
-
#value_names ⇒ Array<String>
The names for each value.
Methods inherited from Structure
Constructor Details
#initialize(address = nil) ⇒ IntegerDescription
Returns a new instance of IntegerDescription.
12 13 14 15 16 |
# File 'lib/fmod/core/integer_description.rb', line 12 def initialize(address = nil) types = [TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOIDP] members = [:min, :max, :default, :infinite, :names] super(address, types, members) end |
Instance Attribute Details
#default ⇒ Integer
Returns the default parameter value.
27 28 29 |
# File 'lib/fmod/core/integer_description.rb', line 27 [:min, :max, :default].each do |symbol| define_method(symbol) { self[symbol] } end |
#max ⇒ Integer
Returns the maximum parameter value.
|
# File 'lib/fmod/core/integer_description.rb', line 21
|
#min ⇒ Integer
Returns the minimum parameter value.
|
# File 'lib/fmod/core/integer_description.rb', line 18
|
Instance Method Details
#infinite? ⇒ Boolean
Returns flag indicating if the last value represents infinity.
33 34 35 |
# File 'lib/fmod/core/integer_description.rb', line 33 def infinite? self[:infinite] != 0 end |
#value_names ⇒ Array<String>
Returns the names for each value.
39 40 41 42 43 |
# File 'lib/fmod/core/integer_description.rb', line 39 def value_names return [] if self[:names].null? count = max - min + 1 (0...count).map { |i| (self[:names] + (i * SIZEOF_INTPTR_T)).ptr.to_s } end |