class FMOD::Core::IntegerDescription

Structure describing a integer parameter for a DSP unit.

Public Class Methods

new(address = nil) click to toggle source

@param address [Pointer, Integer, String, nil] The address in memory

where the structure will be created from. If no address is given, new
memory will be allocated.
Calls superclass method
# 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

Public Instance Methods

infinite?() click to toggle source

@return [Boolean] flag indicating if the last value represents infinity.

# File lib/fmod/core/integer_description.rb, line 33
def infinite?
  self[:infinite] != 0
end
value_names() click to toggle source

@return [Array<String>] the names for each value.

# 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