Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Audio.DynamicMusic.DynamicMusic Class Reference

Dynamic music. More...

Inheritance diagram for Dragengine.Audio.DynamicMusic.DynamicMusic:

Public Member Functions

void addPart (DynamicMusicPart part)
 Add part.
void addSwitch (DynamicMusicSwitch switch)
 Add switch.
Synthesizer createSynthesizer ()
 Create synthesizer from dynamic music definition.
void forEachPart (Block ablock)
 Visit parts with block with DynamicMusicPart as only parameter.
void forEachSwitch (Block ablock)
 Visit switches with block with DynamicMusicSwitch as only parameter.
SynthesizerController getControllerPart ()
 Part selector controller.
SynthesizerController getControllerState ()
 Play state controller.
DynamicMusicPart getCurPart ()
 Current part played back or null if finished.
DynamicMusicPart getNextPart ()
 Next part to play back or null to stop.
DynamicMusicPart getPartAt (int index)
 Get part at index.
DynamicMusicPart getPartNamed (String name)
 Get named part.
float getRemainingTime ()
 Remaining time in the current part.
float getSelectNextTime ()
 Seconds before part finishes to select next part.
Speaker getSpeaker ()
 Speaker used to play back dynamic music.
DynamicMusicSwitch getSwitchAt (int index)
 Get switch at index.
int getSwitchCount ()
 Number of switches.
DynamicMusicSwitch getSwitchNamed (String name)
 Get named switch or null if not found.
SynthesizerInstance getSynthesizer ()
 Synthesizer used for playing back dynamic music.
bool hasPart (DynamicMusicPart part)
 Part is present.
bool hasPartNamed (String name)
 Named part is present.
bool hasSwitchNamed (String name)
 Named switch is present.
DynamicMusic new ()
 Create dynamic music.
void play ()
 Start playing.
void removeAllParts ()
 Remove all parts.
void removeAllSwitches ()
 Remove all switches.
void removePart (DynamicMusicPart part)
 Remove part.
void removeSwitch (DynamicMusicSwitch switch)
 Remove switch.
void stop ()
 Stop and reset.
void update ()
 Update playback.
void updateSampleRate ()
 Update next remaining sample rate from synthesizer if present.
void updateSpeaker ()
 Update speaker for playing back dynamic music.

Public Attributes

final float statePlay = 3
 State controller values.
final float stateWait = 2

Detailed Description

Dynamic music.

Play back dynamic music using a synthesizer loaded from an XML file.

Member Function Documentation

◆ addPart()

void Dragengine.Audio.DynamicMusic.DynamicMusic.addPart ( DynamicMusicPart part)

Add part.

Referenced by update().

◆ addSwitch()

void Dragengine.Audio.DynamicMusic.DynamicMusic.addSwitch ( DynamicMusicSwitch switch)

Add switch.

References getSwitchAt().

Referenced by hasPartNamed().

◆ createSynthesizer()

◆ forEachPart()

void Dragengine.Audio.DynamicMusic.DynamicMusic.forEachPart ( Block ablock)

Visit parts with block with DynamicMusicPart as only parameter.

References removeAllSwitches().

Referenced by createSynthesizer().

◆ forEachSwitch()

void Dragengine.Audio.DynamicMusic.DynamicMusic.forEachSwitch ( Block ablock)

Visit switches with block with DynamicMusicSwitch as only parameter.

Referenced by getRemainingTime().

◆ getControllerPart()

SynthesizerController Dragengine.Audio.DynamicMusic.DynamicMusic.getControllerPart ( )

Part selector controller.

References getPartAt().

Referenced by createSynthesizer().

◆ getControllerState()

SynthesizerController Dragengine.Audio.DynamicMusic.DynamicMusic.getControllerState ( )

Play state controller.

References getPartNamed().

Referenced by createSynthesizer().

◆ getCurPart()

DynamicMusicPart Dragengine.Audio.DynamicMusic.DynamicMusic.getCurPart ( )

Current part played back or null if finished.

Referenced by createSynthesizer().

◆ getNextPart()

DynamicMusicPart Dragengine.Audio.DynamicMusic.DynamicMusic.getNextPart ( )

Next part to play back or null to stop.

Referenced by createSynthesizer().

◆ getPartAt()

DynamicMusicPart Dragengine.Audio.DynamicMusic.DynamicMusic.getPartAt ( int index)

Get part at index.

References hasSwitchNamed().

Referenced by getControllerPart().

◆ getPartNamed()

DynamicMusicPart Dragengine.Audio.DynamicMusic.DynamicMusic.getPartNamed ( String name)

Get named part.

Referenced by createSynthesizer(), and getControllerState().

◆ getRemainingTime()

float Dragengine.Audio.DynamicMusic.DynamicMusic.getRemainingTime ( )

Remaining time in the current part.

References forEachSwitch().

Referenced by createSynthesizer().

◆ getSelectNextTime()

float Dragengine.Audio.DynamicMusic.DynamicMusic.getSelectNextTime ( )

Seconds before part finishes to select next part.

Referenced by createSynthesizer().

◆ getSpeaker()

Speaker Dragengine.Audio.DynamicMusic.DynamicMusic.getSpeaker ( )

Speaker used to play back dynamic music.

Referenced by createSynthesizer().

◆ getSwitchAt()

DynamicMusicSwitch Dragengine.Audio.DynamicMusic.DynamicMusic.getSwitchAt ( int index)

Get switch at index.

Referenced by addSwitch().

◆ getSwitchCount()

int Dragengine.Audio.DynamicMusic.DynamicMusic.getSwitchCount ( )

Number of switches.

Referenced by hasSwitchNamed().

◆ getSwitchNamed()

DynamicMusicSwitch Dragengine.Audio.DynamicMusic.DynamicMusic.getSwitchNamed ( String name)

Get named switch or null if not found.

Referenced by removeAllSwitches().

◆ getSynthesizer()

SynthesizerInstance Dragengine.Audio.DynamicMusic.DynamicMusic.getSynthesizer ( )

Synthesizer used for playing back dynamic music.

Referenced by createSynthesizer().

◆ hasPart()

bool Dragengine.Audio.DynamicMusic.DynamicMusic.hasPart ( DynamicMusicPart part)

Part is present.

Referenced by stop().

◆ hasPartNamed()

bool Dragengine.Audio.DynamicMusic.DynamicMusic.hasPartNamed ( String name)

Named part is present.

References addSwitch(), hasSwitchNamed(), and new().

Referenced by stop(), and update().

◆ hasSwitchNamed()

bool Dragengine.Audio.DynamicMusic.DynamicMusic.hasSwitchNamed ( String name)

Named switch is present.

References getSwitchCount().

Referenced by getPartAt(), and hasPartNamed().

◆ new()

DynamicMusic Dragengine.Audio.DynamicMusic.DynamicMusic.new ( )

Create dynamic music.

Referenced by createSynthesizer(), hasPartNamed(), and update().

◆ play()

void Dragengine.Audio.DynamicMusic.DynamicMusic.play ( )

Start playing.

Evaluates switches with init part to select part to start playing. If not valid does not start playing.

Referenced by createSynthesizer().

◆ removeAllParts()

void Dragengine.Audio.DynamicMusic.DynamicMusic.removeAllParts ( )

Remove all parts.

Referenced by createSynthesizer().

◆ removeAllSwitches()

void Dragengine.Audio.DynamicMusic.DynamicMusic.removeAllSwitches ( )

Remove all switches.

References getSwitchNamed().

Referenced by forEachPart().

◆ removePart()

void Dragengine.Audio.DynamicMusic.DynamicMusic.removePart ( DynamicMusicPart part)

Remove part.

References removeSwitch().

Referenced by updateSpeaker().

◆ removeSwitch()

void Dragengine.Audio.DynamicMusic.DynamicMusic.removeSwitch ( DynamicMusicSwitch switch)

Remove switch.

Referenced by removePart().

◆ stop()

void Dragengine.Audio.DynamicMusic.DynamicMusic.stop ( )

Stop and reset.

References hasPart(), and hasPartNamed().

Referenced by createSynthesizer().

◆ update()

void Dragengine.Audio.DynamicMusic.DynamicMusic.update ( )

Update playback.

References addPart(), hasPartNamed(), and new().

Referenced by createSynthesizer().

◆ updateSampleRate()

void Dragengine.Audio.DynamicMusic.DynamicMusic.updateSampleRate ( )

Update next remaining sample rate from synthesizer if present.

Referenced by createSynthesizer().

◆ updateSpeaker()

void Dragengine.Audio.DynamicMusic.DynamicMusic.updateSpeaker ( )

Update speaker for playing back dynamic music.

Call this method after modifying the parts.

References removePart().

Referenced by createSynthesizer().

Member Data Documentation

◆ statePlay

final float Dragengine.Audio.DynamicMusic.DynamicMusic.statePlay = 3

State controller values.

Referenced by createSynthesizer().

◆ stateWait

final float Dragengine.Audio.DynamicMusic.DynamicMusic.stateWait = 2

Referenced by createSynthesizer().


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