The slots SunVox can use. MAX: 16
Constructors
from_int(in_int :
Int) :
Slot Converts an integer index (0..15) into a Slot, raising if out of range.
Sourceopen(slot :
Slot |
Int =
Slot::Zero) :
Slot Opens a slot (defaults to Slot::Zero) and returns it.
SourceClass methods
open(slot :
Slot |
Int =
Slot::Zero, & :
Slot -> )
Opens a slot, yields it to the block, and ensures it is closed afterwards.
SourceInstance methods
Creates a new module in this slot and returns its SunVox::Module wrapper.
SourceEnables or disables autostop on this slot.
Sourceautostop?
Returns true if autostop is enabled (song stops at end instead of looping).
Sourcebase_version
Gets the SunVox version used to create the project.
Sourcebpm
Gets the project BPM (Beats Per Minute).
Sourceclose
Closes this slot in the SunVox engine.
Sourcecurrent_line
Gets the current line number on the timeline.
Sourcecurrent_line2
Gets the current line number in fixed-point 27.5 format.
Sourcecurrent_line_float
Gets the current line number as a floating-point value.
Sourceduration
Gets the approximate duration of the project.
Sourceeight?
Returns true if this enum value equals Eight
Sourceeleven?
Returns true if this enum value equals Eleven
Sourceend_of_song?
Returns true if the song has stopped / finished playing.
Sourceexport_to_wav(out_filename :
String |
Path, song_len_frames :
Int = length_frames) : self
Exports the project in this slot to a WAV file (requires engine started with offline: true).
Sourcefifteen?
Returns true if this enum value equals Fifteen
Sourcefind_module(name :
String) :
Module |
Nil Finds a module by name and returns it, or nil if not found.
Sourcefind_pattern(name :
String) :
Pattern |
Nil Finds a pattern by name and returns it, or nil if not found.
Sourcefive?
Returns true if this enum value equals Five
Sourcefour?
Returns true if this enum value equals Four
Sourcefourteen?
Returns true if this enum value equals Fourteen
Sourcefrom_int(in_int :
Int) :
Slot Instance-level helper preserved for backwards compatibility.
Sourcelength_frames
Gets the project length in audio frames.
Sourcelength_lines
Gets the project length in tracker lines.
SourceLoads a project file (.sunvox, .mod, .xm) from disk into this slot.
Sourceload(data :
Bytes) : self
Loads a project from a memory buffer (Bytes) into this slot.
Sourceload_from_memory(data :
Bytes) : self
Alias for #load(data : Bytes).
SourceLoads a module or sample from a file (sunsynth, xi, wav, aiff, ogg, mp3, flac) and returns a SunVox::Module.
SourceLoads a module or sample from memory (Bytes) and returns a SunVox::Module.
SourceAlias for #load_module(data : Bytes, ...).
Sourcelock
Locks this slot for thread-safe access/modification.
Sourcemodule(id :
Int32) :
Module Returns a SunVox::Module handle for id.
Sourcemodule(name :
String) :
Module Finds a module by name and returns its SunVox::Module, raising if not found.
Sourcemodule?(id :
Int32) :
Module |
Nil Returns a SunVox::Module for id if it exists in this slot, or nil.
Sourcemodule?(name :
String) :
Module |
Nil Finds a module by name and returns it, or nil if not found.
Sourcemodule_slots_count
Returns the number of module slots in the project (some slots may be empty).
Sourcemodules
Returns all active modules currently existing in this slot.
Sourcename
Gets the project/song name.
SourceSets the project/song name.
SourceCreates a new pattern in this slot and returns its SunVox::Pattern wrapper.
Sourcenine?
Returns true if this enum value equals Nine
Sourceone?
Returns true if this enum value equals One
Sourceopen
Opens this slot in the SunVox engine.
Sourceopen?
Returns true if this slot is currently open.
Sourceoutput
Returns the built-in Output module (module 0) for this slot.
Sourcepattern(id :
Int32) :
Pattern Returns a SunVox::Pattern handle for id.
Sourcepattern(name :
String) :
Pattern Finds a pattern by name and returns its SunVox::Pattern, raising if not found.
Sourcepattern?(id :
Int32) :
Pattern |
Nil Returns a SunVox::Pattern for id if it exists in this slot, or nil.
Sourcepattern?(name :
String) :
Pattern |
Nil Finds a pattern by name and returns it, or nil if not found.
Sourcepattern_slots_count
Returns the number of pattern slots in the project (some slots may be empty).
Sourcepatterns
Returns all active patterns currently existing in this slot.
Sourcepause
Pauses the audio stream on this slot.
Sourceplay
Plays the current project from the current playhead position.
Sourceplay_from_beginning
Plays the current project from the beginning (line 0).
Sourceplaying?
Returns true if the song is currently playing.
SourceSets whether the song repeats when the end is reached.
Sourcerepeats?
Returns whether the song repeats (i.e. autostop is disabled).
Sourcereset_event_time
Resets event timing on this slot back to automatic mode.
Sourceresume
Resumes the audio stream on this slot.
Sourcerewind(line_num :
Int32) : self
Jumps the playhead to line_num.
SourceSaves the current project in this slot to a file on disk.
Sourcesave_to_bytes
Saves the current project in this slot to a Bytes buffer in memory.
Sourcesave_to_memory
Alias for #save_to_bytes.
Sourcesend_event(track_num :
Int32, note :
Note |
Int32 =
Note::None, velocity :
Int32 = 0, mod :
Module |
Int32 = -1, ctl :
Int32 = 0, effect :
Int32 = 0, ctl_value :
Int32 = 0) : self
Sends a real-time event to this slot.
Sourcesend_event(track_num :
Int32, event :
Event) : self
Sends a SunVox::Event record to track_num on this slot.
Sourceset_event_time(timestamp :
UInt32 = 0_u32, set :
Bool = true) : self
Sets the timestamp for subsequent events sent to this slot.
Sourceseven?
Returns true if this enum value equals Seven
SourceGets the current real-time output signal level (0..255) for channel (0 = left, 1 = right).
Sourcesix?
Returns true if this enum value equals Six
Sourcestop
Stops playback (second call puts all modules into standby mode).
Sourcesync_resume
Waits for sync (pattern effect 0x33) and resumes the audio stream on this slot.
Sourcesynchronize
Locks this slot, yields self, and unlocks in an ensure block.
Sourceten?
Returns true if this enum value equals Ten
Sourcethirteen?
Returns true if this enum value equals Thirteen
Sourcethree?
Returns true if this enum value equals Three
Sourcetime_map(start_line :
Int32 = 0, len :
Int32 = length_lines.to_i, flags :
TimeMapFlags |
Int32 =
TimeMapFlags::Speed) :
Slice(
UInt32)
Gets the project time map for len lines starting at start_line.
Sourcetpl
Gets the project TPL (Ticks Per Line).
Sourcetwelve?
Returns true if this enum value equals Twelve
Sourcetwo?
Returns true if this enum value equals Two
SourceSets the volume of this slot (0..256) and returns the previous volume.
Sourcevolume
Gets the current volume of this slot (0..256).
SourceSets the volume of this slot (0..256).
Sourcezero?
Returns true if this enum value equals Zero
Source