sounds ![code/controllers/subsystem/sounds.dm 3](git.png)
Vars | |
all_sounds | All valid sound files in the sound directory |
---|---|
channel_list | List of all channels as numbers |
channel_random_low | lower iteration position - Incremented and looped to get "random" sound channels for normal sounds. The channel at this index is returned when asking for a random channel. |
channel_reserve_high | higher reserve position - decremented and incremented to reserve sound channels, anything above this is reserved. The channel at this index is the highest unreserved channel. |
precache_errors | Any errors from precaching. |
random_channels_min | Amount of channels to reserve for random usage rather than reservations being allowed to reserve all channels. Also a nice safeguard for when someone screws up. |
reserved_channels | Associative list of all reserved channels associated to their position. "[channel_number]" = index as number |
sound_lengths | k:v list of file_path : length |
sounds_to_precache | A list of sounds to cache upon initialize. |
using_channels | Assoc list, "[channel]" = either the datum using it or TRUE for an unsafe-reserved (datumless reservation) channel |
using_channels_by_datum | Assoc list datum = list(channel1, channel2, ...) for what channels something reserved. |
Procs | |
available_channels_left | How many channels we have left. |
cache_sounds | Cache a list of sound lengths. |
free_channel | Frees a channel and updates the datastructure. Private proc. |
free_datum_channels | Frees all the channels a datum is using. |
free_datumless_channels | Frees all datumless channels |
free_sound_channel | Removes a channel from using list. |
get_sound_length | Cache and return a single sound. |
random_available_channel | Random available channel, returns number |
random_available_channel_text | Random available channel, returns text. |
reserve_channel | Reserves a channel and updates the datastructure. Private proc. |
reserve_sound_channel | Reserves a channel for a datum. Automatic cleanup only when the datum is deleted. Returns an integer for channel. |
reserve_sound_channel_datumless | NO AUTOMATIC CLEANUP - If you use this, you better manually free it later! Returns an integer for channel. |
Var Details
all_sounds ![code/controllers/subsystem/sounds.dm 27](git.png)
All valid sound files in the sound directory
channel_list ![code/controllers/subsystem/sounds.dm 18](git.png)
List of all channels as numbers
channel_random_low ![code/controllers/subsystem/sounds.dm 22](git.png)
lower iteration position - Incremented and looped to get "random" sound channels for normal sounds. The channel at this index is returned when asking for a random channel.
channel_reserve_high ![code/controllers/subsystem/sounds.dm 24](git.png)
higher reserve position - decremented and incremented to reserve sound channels, anything above this is reserved. The channel at this index is the highest unreserved channel.
precache_errors ![code/controllers/subsystem/sounds.dm 35](git.png)
Any errors from precaching.
random_channels_min ![code/controllers/subsystem/sounds.dm 9](git.png)
Amount of channels to reserve for random usage rather than reservations being allowed to reserve all channels. Also a nice safeguard for when someone screws up.
reserved_channels ![code/controllers/subsystem/sounds.dm 20](git.png)
Associative list of all reserved channels associated to their position. "[channel_number]" =
index as number
sound_lengths ![code/controllers/subsystem/sounds.dm 31](git.png)
k:v list of file_path : length
sounds_to_precache ![code/controllers/subsystem/sounds.dm 33](git.png)
A list of sounds to cache upon initialize.
using_channels ![code/controllers/subsystem/sounds.dm 13](git.png)
Assoc list, "[channel]" =
either the datum using it or TRUE for an unsafe-reserved (datumless reservation) channel
using_channels_by_datum ![code/controllers/subsystem/sounds.dm 15](git.png)
Assoc list datum = list(channel1, channel2, ...) for what channels something reserved.
Proc Details
available_channels_left
How many channels we have left.
cache_sounds
Cache a list of sound lengths.
free_channel
Frees a channel and updates the datastructure. Private proc.
free_datum_channels
Frees all the channels a datum is using.
free_datumless_channels
Frees all datumless channels
free_sound_channel
Removes a channel from using list.
get_sound_length
Cache and return a single sound.
random_available_channel
Random available channel, returns number
random_available_channel_text
Random available channel, returns text.
reserve_channel
Reserves a channel and updates the datastructure. Private proc.
reserve_sound_channel
Reserves a channel for a datum. Automatic cleanup only when the datum is deleted. Returns an integer for channel.
reserve_sound_channel_datumless
NO AUTOMATIC CLEANUP - If you use this, you better manually free it later! Returns an integer for channel.