class WAD::Music

Overview

A music track.

Included Modules

Defined in:

wa-cr/wad/wad-data/music.cr
write.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module WritingAdditions::Music

write(file : String | Path) : UInt32
write(io : IO) : UInt32
write

Constructor Detail

def self.parse(filename : String | Path) : Music #

Parses a music file given the filename

Opens a music file and parses it:

my_music = WAD::Music.parse("Path/To/Music")

def self.parse(io : IO) : 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

Instance Method Detail

def channels : UInt16 #

Count of primary channels.


def channels=(channels : UInt16) #

Count of primary channels.


def clone #

Returns a copy of self with all instance variables cloned.


def dummy : UInt16 #

def dummy=(dummy : UInt16) #

def identifier : String #

def identifier=(identifier : String) #

def instr_cnt : UInt16 #

def instr_cnt=(instr_cnt : UInt16) #

def instruments : Array(UInt16) #

def instruments=(instruments : Array(UInt16)) #

def score_len : UInt16 #

def score_len=(score_len : UInt16) #

def score_start : UInt16 #

def score_start=(score_start : UInt16) #

def sec_channels : UInt16 #

Count of secondary channels.


def sec_channels=(sec_channels : UInt16) #

Count of secondary channels.


def song : Array(UInt8) #

def song=(song : Array(UInt8)) #