Module: SDL2::Audio

Defined in:
lib/sdl2/audio.rb

Defined Under Namespace

Modules: MASK Classes: CVT, Spec

Constant Summary collapse

U8 =
0x0008
S8 =
0x8008
U16LSB =
0x0010
S16LSB =
0x8010
U16MSB =
0x1010
S16MSB =
0x9010
U16 =
U16LSB
S16 =
S16LSB
S32LSB =
0x8020
S32MSB =
0x9020
S32 =
S32LSB
F32LSB =
0x8120
F32MSB =
0x9120
F32 =
F32LSB
ALLOW_FREQUENCY_CHANGE =
0x00000001
ALLOW_FORMAT_CHANGE =
0x00000002
ALLOW_CHANNELS_CHANGE =
0x00000004
ALLOW_ANY_CHANGE =
(ALLOW_FREQUENCY_CHANGE|ALLOW_FORMAT_CHANGE|ALLOW_CHANNELS_CHANGE)

Class Method Summary collapse

Class Method Details

.bitsize(x) ⇒ Object



19
20
21
# File 'lib/sdl2/audio.rb', line 19

def self.bitsize(x)
  x & Mask.BITSIZE
end

.is_big_endian?(x) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/sdl2/audio.rb', line 27

def self.is_big_endian?(x)
  x & mask.ENDIAN
end

.is_float?(x) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/sdl2/audio.rb', line 23

def self.is_float?(x)
  (x & Mask.DATATYPE) != 0
end

.is_int?(x) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/sdl2/audio.rb', line 35

def self.is_int?(x)
  !is_float?(x)
end

.is_little_endian?(x) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/sdl2/audio.rb', line 39

def self.is_little_endian?(x)
  !is_big_endian?(x)
end

.is_signed?(x) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/sdl2/audio.rb', line 31

def self.is_signed?(x)
  x & mask.SIGNED
end

.is_unsigned?(x) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/sdl2/audio.rb', line 43

def self.is_unsigned?(x)
  !is_signed?(x)
end