Drag[en]gine Script Module DragonScript Script API  1.0
DynamicMusic Class Reference

Dynamic music. More...

Inheritance diagram for DynamicMusic:

Public Member Functions

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

Detailed Description

Dynamic music.

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

Author
Roland Pl├╝ss
Version
1.0
Date
2016

Member Function Documentation

§ addPart()

void addPart ( DynamicMusicPart  part)

Add part.

§ addSwitch()

void addSwitch ( DynamicMusicSwitch  switch)

Add switch.

§ createSynthesizer()

Synthesizer createSynthesizer ( )

Create synthesizer from dynamic music definition.

§ forEachPart()

void forEachPart ( Block  ablock)

Visit parts with block with DynamicMusicPart as only parameter.

§ forEachSwitch()

void forEachSwitch ( Block  ablock)

Visit switches with block with DynamicMusicSwitch as only parameter.

§ getCurPart()

DynamicMusicPart getCurPart ( )

Current part played back or null if finished.

§ getNextPart()

DynamicMusicPart getNextPart ( )

Next part to play back or null to stop.

§ getPartAt()

DynamicMusicPart getPartAt ( int  index)

Get part at index.

§ getPartNamed()

DynamicMusicPart getPartNamed ( String  name)

Get named part.

§ getRemainingTime()

float getRemainingTime ( )

Remaining time in the current part.

§ getSelectNextTime()

float getSelectNextTime ( )

Seconds before part finishes to select next part.

§ getSpeaker()

Speaker getSpeaker ( )

Speaker used to play back dynamic music.

§ getSwitchAt()

DynamicMusicSwitch getSwitchAt ( int  index)

Get switch at index.

§ getSwitchCount()

int getSwitchCount ( )

Number of switches.

§ getSwitchNamed()

DynamicMusicSwitch getSwitchNamed ( String  name)

Get named switch or null if not found.

§ getSynthesizer()

SynthesizerInstance getSynthesizer ( )

Synthesizer used for playing back dynamic music.

§ hasPart()

bool hasPart ( DynamicMusicPart  part)

Part is present.

§ hasPartNamed()

bool hasPartNamed ( String  name)

Named part is present.

§ hasSwitchNamed()

bool hasSwitchNamed ( String  name)

Named switch is present.

§ new()

DynamicMusic new ( )

Create dynamic music.

§ play()

void play ( )

Start playing.

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

§ removeAllParts()

void removeAllParts ( )

Remove all parts.

§ removeAllSwitches()

void removeAllSwitches ( )

Remove all switches.

§ removePart()

void removePart ( DynamicMusicPart  part)

Remove part.

§ removeSwitch()

void removeSwitch ( DynamicMusicSwitch  switch)

Remove switch.

§ stop()

void stop ( )

Stop and reset.

§ update()

void update ( )

Update playback.

§ updateSampleRate()

void updateSampleRate ( )

Update next remaining sample rate from synthesizer if present.

§ updateSpeaker()

void updateSpeaker ( )

Update speaker for playing back dynamic music.

Call this method after modifying the parts.


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