module RbSDL2::Audio::AudioFormat

Public Class Methods

to_num(signed: true, big_endian: false, bit_size: 16, float: false) click to toggle source
# File lib/rb_sdl2/audio/audio_format.rb, line 5
def to_num(signed: true, big_endian: false, bit_size: 16, float: false)
  num = 0 |
    (big_endian ? ::SDL2::SDL_AUDIO_MASK_ENDIAN : 0) |
    (bit_size & ::SDL2::SDL_AUDIO_MASK_BITSIZE) |
    (signed ? ::SDL2::SDL_AUDIO_MASK_SIGNED : 0)
  num | (float ? ::SDL2::SDL_AUDIO_MASK_DATATYPE & ::SDL2::SDL_AUDIO_MASK_SIGNED : 0)
end

Public Instance Methods

big_endian?(= ::SDL2::SDL_AUDIO_MASK_ENDIAN & format != 0) click to toggle source
# File lib/rb_sdl2/audio/audio_format.rb, line 14
    def big_endian? = ::SDL2::SDL_AUDIO_MASK_ENDIAN & format != 0

    def bit_size = ::SDL2::SDL_AUDIO_MASK_BITSIZE & format

    def float? = ::SDL2::SDL_AUDIO_MASK_DATATYPE & format != 0

    def signed? = ::SDL2::SDL_AUDIO_MASK_SIGNED & format != 0
  end
end
bit_size(= ::SDL2::SDL_AUDIO_MASK_BITSIZE & format) click to toggle source
# File lib/rb_sdl2/audio/audio_format.rb, line 16
      def bit_size = ::SDL2::SDL_AUDIO_MASK_BITSIZE & format

      def float? = ::SDL2::SDL_AUDIO_MASK_DATATYPE & format != 0

      def signed? = ::SDL2::SDL_AUDIO_MASK_SIGNED & format != 0
    end
  end
end
float?(= ::SDL2::SDL_AUDIO_MASK_DATATYPE & format != 0) click to toggle source
# File lib/rb_sdl2/audio/audio_format.rb, line 18
    def float? = ::SDL2::SDL_AUDIO_MASK_DATATYPE & format != 0

    def signed? = ::SDL2::SDL_AUDIO_MASK_SIGNED & format != 0
  end
end
signed?(= ::SDL2::SDL_AUDIO_MASK_SIGNED & format != 0) click to toggle source
# File lib/rb_sdl2/audio/audio_format.rb, line 20
  def signed? = ::SDL2::SDL_AUDIO_MASK_SIGNED & format != 0
end