class WAD::Music
- WAD::Music
- Reference
- Object
Overview
A music track.
Included Modules
Defined in:
wa-cr/wad/wad-data/music.crwrite.cr
Constructors
-
.parse(filename : String | Path) : Music
Parses a music file given the filename
-
.parse(io : IO) : Music
Parses a music file given the io
Class Method Summary
-
.is_music?(name : String)
Checks to see if name is music with name format 'D_x..x'.
Instance Method Summary
-
#channels : UInt16
Count of primary channels.
-
#channels=(channels : UInt16)
Count of primary channels.
-
#clone
Returns a copy of
self
with all instance variables cloned. - #dummy : UInt16
- #dummy=(dummy : UInt16)
- #identifier : String
- #identifier=(identifier : String)
- #instr_cnt : UInt16
- #instr_cnt=(instr_cnt : UInt16)
- #instruments : Array(UInt16)
- #instruments=(instruments : Array(UInt16))
- #score_len : UInt16
- #score_len=(score_len : UInt16)
- #score_start : UInt16
- #score_start=(score_start : UInt16)
-
#sec_channels : UInt16
Count of secondary channels.
-
#sec_channels=(sec_channels : UInt16)
Count of secondary channels.
- #song : Array(UInt8)
- #song=(song : Array(UInt8))
Instance methods inherited from module WritingAdditions::Music
write(file : String | Path) : UInt32write(io : IO) : UInt32 write
Constructor Detail
Parses a music file given the filename
Opens a music file and parses it:
my_music = WAD::Music.parse("Path/To/Music")
Parses a music file given the io
Opens a music io and parses it:
File.open("Path/To/Music") do |file|
my_music = WAD::Music.parse(file)
end
Class Method Detail
def self.is_music?(name : String)
#
Checks to see if name is music with name format 'D_x..x'.
Returns true if the name is a music:
music_name = "D_E1M1"
if WAD::Music.is_music?(music_name)
puts "Is a Music"
else
puts "Is not a Music"
end