Modules

  • This module is used to asynchronously answer simple queries across thread boundaries. A query is a question that can only be answered by one thread, and only be answered to one thread. In essence, this is a one-shot single-producer-single-consumer channel.

Macros

Structs

  • This exists to send commands to an Engine that belongs to some other thread. If you’re operating entirely in a single thread, you can also just call any of these methods on an Engine directly.
  • This is the main moving part of the Second Music System. You create one of these, give it a delegate to handle music decoding, and “turn the handle” in your sound output code to make music come out.
  • Represents a fade, in or out, currently in progress.
  • A very unsophisticated TaskRuntime that just immediately and synchronously executes any task you send it. Used to implement “foreground loading”, for example for offline rendering of replays or GEFMVs.
  • Describes an sound stream actively being decoded from the game data. It has a particular sample rate (which we will convert), a particular speaker layout (which we may also convert), and a callback that will return decoded samples as needed. SMS will either cache this or stream it directly… because of the latter case, mind your thread safety!
  • A finite, positive f32.
  • Encapsulates all the information about a soundtrack: what files to play, how to play them, etc. This is purely inert data. It can be built up incrementally, or replaced entirely, cleanly and efficiently.
  • An in-progress transaction. Create one by calling begin_transaction on any type that can receive commands.

Enums

  • Specifies what kind of curve to use in a fade.
  • Describes the format of sound samples stored in a file. SMS uses floats internally, so floats are the preferred format. Using other datatypes will save some memory if cached samples are used, since they will be cached in “native format”.
  • Describes the number of channels and the speaker layout of sound sample frames. This is used both for formats on disk, and also for the output sound. SMS will interconvert them as needed.
  • A string, or a number.
  • Types of background loading tasks.

Constants

  • The name of the default channel. The default channel is at volume 1.0 by default, while all other channels are at 0.0. Additionally, the default channel is exempted from the “all except main” channel commands.

Traits

  • This is an object that SMS will hang onto, and will call upon to open sound files and issue warnings. It must be thread safe.
  • This is an object that SMS will hang onto, representing an ongoing decoding of a particular underlying file. SMS will either use this to populate a cache or to stream it directly, depending on the Soundtrack’s configuration.
  • Something where we can put in async functions and have them execute eventually.