Sha256: c06177e14f67cf6fbbe0e265524c98cc5d34259e641339b01081dde88786c367

Contents?: true

Size: 1.5 KB

Versions: 5

Compression:

Stored size: 1.5 KB

Contents

module FMOD
  module Core

    ##
    # Structure describing a float parameter for a DSP unit.
    class FloatDescription < Structure

      ##
      # Values mapped linearly across range.
      LINEAR = 0

      ##
      # A mapping is automatically chosen based on range and units.
      AUTO = 1

      ##
      # Values mapped in a piecewise linear fashion.
      PIECEWISE_LINEAR = 2

      ##
      # @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.
      def initialize(address = nil)
        types = [TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_INT]
        members = [:min, :max, :default, :mapping]
        super(address, types, members)
      end

      # @!attribute min
      # @return [Float] the minimum parameter value.

      # @!attribute max
      # @return [Float] the maximum parameter value.

      # @!attribute default
      # @return [Float] the default parameter value.

      # @!attribute mapping
      # Value indicating how the values are distributed across dials and
      # automation curves (e.g. linearly, exponentially etc).
      #
      # Will be one of the following values:
      # * {LINEAR}
      # * {AUTO}
      # * {PIECEWISE_LINEAR}
      # @return [Integer] the mapping type.

      [:min, :max, :default, :mapping].each do |symbol|
        define_method(symbol) { self[symbol] }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fmod-0.9.6 lib/fmod/core/float_description.rb
fmod-0.9.5 lib/fmod/core/float_description.rb
fmod-0.9.4 lib/fmod/core/float_description.rb
fmod-0.9.3 lib/fmod/core/float_description.rb
fmod-0.9.2 lib/fmod/core/float_description.rb