Class: Raylib::Music

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/core/structs/music.rb

Overview

Music, audio stream, anything longer than ~10 seconds should be streamed

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(stream, frame_count, looping, ctx_type, ctx_data) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/raylib/core/structs/music.rb', line 12

def self.create(stream, frame_count, looping, ctx_type, ctx_data)
  new.tap do |instance|
    instance[:stream] = stream
    instance[:frameCount] = frame_count
    instance[:looping] = looping
    instance[:ctxType] = ctx_type
    instance[:ctxData] = ctx_data
  end
end

Instance Method Details

#ctx_datavoid *

Audio context data, depends on type

Returns:

  • (void *)

    ctxData



64
# File 'lib/raylib/core/structs/music.rb', line 64

def ctx_data = self[:ctxData]

#ctx_data=(new_ctx_data) ⇒ Object

Sets Audio context data, depends on type



67
68
69
# File 'lib/raylib/core/structs/music.rb', line 67

def ctx_data=(new_ctx_data)
  self[:ctxData] = new_ctx_data
end

#ctx_typeInteger

Type of music context (audio filetype)

Returns:

  • (Integer)

    ctxType



55
# File 'lib/raylib/core/structs/music.rb', line 55

def ctx_type = self[:ctxType]

#ctx_type=(new_ctx_type) ⇒ Object

Sets Type of music context (audio filetype)



58
59
60
# File 'lib/raylib/core/structs/music.rb', line 58

def ctx_type=(new_ctx_type)
  self[:ctxType] = new_ctx_type
end

#frame_countInteger

Total number of frames (considering channels)

Returns:

  • (Integer)

    frameCount



37
# File 'lib/raylib/core/structs/music.rb', line 37

def frame_count = self[:frameCount]

#frame_count=(new_frame_count) ⇒ Object

Sets Total number of frames (considering channels)



40
41
42
# File 'lib/raylib/core/structs/music.rb', line 40

def frame_count=(new_frame_count)
  self[:frameCount] = new_frame_count
end

#loopingbool

Music looping enable

Returns:

  • (bool)

    looping



46
# File 'lib/raylib/core/structs/music.rb', line 46

def looping = self[:looping]

#looping=(new_looping) ⇒ Object

Sets Music looping enable



49
50
51
# File 'lib/raylib/core/structs/music.rb', line 49

def looping=(new_looping)
  self[:looping] = new_looping
end

#streamAudioStream

Audio stream

Returns:



28
# File 'lib/raylib/core/structs/music.rb', line 28

def stream = self[:stream]

#stream=(new_stream) ⇒ Object

Sets Audio stream



31
32
33
# File 'lib/raylib/core/structs/music.rb', line 31

def stream=(new_stream)
  self[:stream] = new_stream
end

#to_sObject



22
23
24
# File 'lib/raylib/core/structs/music.rb', line 22

def to_s
  "Raylib::Music##{object_id} stream=#{stream} frame_count=#{frame_count} looping=#{looping} ctx_type=#{ctx_type} ctx_data=#{ctx_data}"
end