Runner's High
Public Types | Public Member Functions | Public Attributes | Properties | List of all members
AudioAssetController Class Reference
Inheritance diagram for AudioAssetController:

Public Types

enum class  PlayMode { Oneshot , Loop }
 Define how the controller should play its assets. Oneshot: The asset is started and "forgotten". Loop: The asset is being looped according to the loop points specified in the database. More...
 
enum class  ChoiceMode { Random , CRC , RandomLazy }
 Define how the controller should choose its assets. Random: any element, including the one that is playing. CRC: any element, but not the one that is playing. RandomLazy: like random, but the asset is only changed when the current assets doesn't match will all matching controllers. More...
 
enum class  MatchMode { Always , OnlyWhenOtherIsPlaying , OnlyIfAvailable }
 Define how the controller should match its assets. Always: The controller must always match. This means that if the controller to match is currently not playing, this controller will also not play. OnlyWhenOtherIsPlaying: The controller matches to the other controllers when they are playing, but when they aren't, it plays "what it wants". OnlyIfAvailable: The controller tries to match, but if there is no matching asset, it plays "what it wants". More...
 

Public Member Functions

void Match (AudioAssetController other)
 Makes the controller match its assets to other controller. Throws an error if circular dependency would be introduced by establishing the match relation. More...
 
void Unmatch (AudioAssetController other)
 Stop matching the controller's assets to other controller's assets. More...
 
void Control (AudioAssetController other)
 Makes the controller also trigger the other controller when it is triggered. Throws an error if circular dependency would be introduced by establishing the contorl relation. More...
 
void Uncontrol (AudioAssetController other)
 Stop triggering the other controller when triggered. More...
 
void Reset ()
 Stops all loops and resets the controller to the state before it was first triggered. More...
 
void Pause ()
 Pauses all current assets without deleting them. Calling Resume() reactivates them. More...
 
void Resume ()
 Resumes all paused assets. More...
 
void Stop ()
 Stops all current assets by ordinarily exiting their loop phase. More...
 
void ExitImmediately ()
 Stops all current assets by immediately exiting their loop phase. More...
 
void StopImmediately ()
 Stops all assets immediately, ignoring tail after loop phase. More...
 
void Trigger (Dictionary< string, float > options=null)
 Trigger the asset controller. options: If desired, provide options on how the controller should trigger, for example the movement speed for binaural sources or the desired loop iterations. More...
 

Public Attributes

LibPdInstance pd
 The libpd instance this controller sends messages to (can be null). More...
 
IntPtr pdPatch
 The Pd patch this controller sends messages to (can be null). More...
 
List< AudioSource > activeLoops = new List<AudioSource>()
 The audio sources the controller is currently playing in loop. More...
 
int stride = 1
 Every stride calls to Trigger(), a trigger can potentially happen. More...
 
float triggerProbabilty = 1
 The probability of the controller playing an asset if it is triggerd. 1 means it will always play, 0 means it will never play. Note that, depending on it match relations to other controllers, the controller may also not play when probability is set to 1 and ChoiceMode is set to Always. More...
 
int InitialWait = 0
 The number of triggers the controller initially waits before playing an asset. More...
 
PlayMode PMode = PlayMode.Oneshot
 Sets how the controller plays its assets (loop or oneshot). More...
 
ChoiceMode CMode = ChoiceMode.CRC
 Sets how the controller chooses its assets (random, cycle round robin or random lazy) More...
 
MatchMode MMode = MatchMode.Always
 Sets how the controller matches assets with other controllers (always, only when other is playing, only if possible) More...
 

Properties

float PlayingSince [get]
 The time in seconds that the controller has been playing. This is reset to 0 whenever the controller is paused or stopped. More...
 
DBSet Set [get, set]
 The asset set the controller is currently assigned. Can be changed anytime. More...
 

Member Enumeration Documentation

◆ ChoiceMode

Define how the controller should choose its assets. Random: any element, including the one that is playing. CRC: any element, but not the one that is playing. RandomLazy: like random, but the asset is only changed when the current assets doesn't match will all matching controllers.

◆ MatchMode

Define how the controller should match its assets. Always: The controller must always match. This means that if the controller to match is currently not playing, this controller will also not play. OnlyWhenOtherIsPlaying: The controller matches to the other controllers when they are playing, but when they aren't, it plays "what it wants". OnlyIfAvailable: The controller tries to match, but if there is no matching asset, it plays "what it wants".

◆ PlayMode

Define how the controller should play its assets. Oneshot: The asset is started and "forgotten". Loop: The asset is being looped according to the loop points specified in the database.

Member Function Documentation

◆ Control()

void AudioAssetController.Control ( AudioAssetController  other)

Makes the controller also trigger the other controller when it is triggered. Throws an error if circular dependency would be introduced by establishing the contorl relation.

◆ ExitImmediately()

void AudioAssetController.ExitImmediately ( )

Stops all current assets by immediately exiting their loop phase.

◆ Match()

void AudioAssetController.Match ( AudioAssetController  other)

Makes the controller match its assets to other controller. Throws an error if circular dependency would be introduced by establishing the match relation.

◆ Pause()

void AudioAssetController.Pause ( )

Pauses all current assets without deleting them. Calling Resume() reactivates them.

◆ Reset()

void AudioAssetController.Reset ( )

Stops all loops and resets the controller to the state before it was first triggered.

◆ Resume()

void AudioAssetController.Resume ( )

Resumes all paused assets.

◆ Stop()

void AudioAssetController.Stop ( )

Stops all current assets by ordinarily exiting their loop phase.

◆ StopImmediately()

void AudioAssetController.StopImmediately ( )

Stops all assets immediately, ignoring tail after loop phase.

◆ Trigger()

void AudioAssetController.Trigger ( Dictionary< string, float >  options = null)

Trigger the asset controller. options: If desired, provide options on how the controller should trigger, for example the movement speed for binaural sources or the desired loop iterations.

Parameters
options

◆ Uncontrol()

void AudioAssetController.Uncontrol ( AudioAssetController  other)

Stop triggering the other controller when triggered.

◆ Unmatch()

void AudioAssetController.Unmatch ( AudioAssetController  other)

Stop matching the controller's assets to other controller's assets.

Member Data Documentation

◆ activeLoops

List<AudioSource> AudioAssetController.activeLoops = new List<AudioSource>()

The audio sources the controller is currently playing in loop.

◆ CMode

ChoiceMode AudioAssetController.CMode = ChoiceMode.CRC

Sets how the controller chooses its assets (random, cycle round robin or random lazy)

◆ InitialWait

int AudioAssetController.InitialWait = 0

The number of triggers the controller initially waits before playing an asset.

◆ MMode

MatchMode AudioAssetController.MMode = MatchMode.Always

Sets how the controller matches assets with other controllers (always, only when other is playing, only if possible)

◆ pd

LibPdInstance AudioAssetController.pd

The libpd instance this controller sends messages to (can be null).

◆ pdPatch

IntPtr AudioAssetController.pdPatch

The Pd patch this controller sends messages to (can be null).

◆ PMode

PlayMode AudioAssetController.PMode = PlayMode.Oneshot

Sets how the controller plays its assets (loop or oneshot).

◆ stride

int AudioAssetController.stride = 1

Every stride calls to Trigger(), a trigger can potentially happen.

◆ triggerProbabilty

float AudioAssetController.triggerProbabilty = 1

The probability of the controller playing an asset if it is triggerd. 1 means it will always play, 0 means it will never play. Note that, depending on it match relations to other controllers, the controller may also not play when probability is set to 1 and ChoiceMode is set to Always.

Property Documentation

◆ PlayingSince

float AudioAssetController.PlayingSince
get

The time in seconds that the controller has been playing. This is reset to 0 whenever the controller is paused or stopped.

◆ Set

DBSet AudioAssetController.Set
getset

The asset set the controller is currently assigned. Can be changed anytime.


The documentation for this class was generated from the following file: