# Amuse: amuse::Engine Class Reference

amuse::Engine Class Reference

`#include <Engine.hpp>`

Collaboration diagram for amuse::Engine:

## Public Member Functions

| Engine (IBackendVoiceAllocator &backend)
IBackendVoiceAllocator & | getBackend ()
void | pumpEngine (double dt)
const AudioGroup * | addAudioGroup (const AudioGroupData &data)
void | removeAudioGroup (const AudioGroupData &data)
Submix * | addSubmix (Submix *parent=nullptr)
void | removeSubmix (Submix *smx)
std::shared_ptr< Voice > | fxStart (int sfxId, float vol, float pan, Submix *smx=nullptr)
std::shared_ptr< Emitter > | addEmitter (const Vector3f &pos, const Vector3f &dir, float maxDist, float falloff, int sfxId, float minVol, float maxVol, Submix *smx=nullptr)
std::shared_ptr< Sequencer > | seqPlay (int groupId, int songId, const unsigned char *arrData, Submix *smx=nullptr)
std::shared_ptr< Voice > | findVoice (int vid)
void | killKeygroup (uint8_t kg, bool now)
void | sendMacroMessage (ObjectId macroId, int32_t val)
uint32_t | nextRandom ()

## Friends

class | Voice
class | Emitter
class | Sequencer
class | Sequencer::ChannelState

## Detailed Description

Main audio playback system for a single audio output

Definition at line 23 of file Engine.hpp.

## Member Function Documentation

const AudioGroup* amuse::Engine::addAudioGroup | ( | const AudioGroupData & | data | ) |

Add audio group data pointers to engine; must remain resident!

Here is the caller graph for this function:

std::shared_ptr<Emitter> amuse::Engine::addEmitter | ( | const Vector3f & | pos,
|  | const Vector3f & | dir,
|  | float | maxDist,
|  | float | falloff,
|  | int | sfxId,
|  | float | minVol,
|  | float | maxVol,
|  | Submix * | smx = `nullptr`
| ) |  |

Start soundFX playing from loaded audio groups, attach to positional emitter

Here is the caller graph for this function:

Submix* amuse::Engine::addSubmix | ( | Submix * | parent = `nullptr` | ) |

Create new Submix (a.k.a 'Studio') within root mix engine

Here is the caller graph for this function:

std::shared_ptr<Voice> amuse::Engine::findVoice | ( | int | vid | ) |

Find voice from VoiceId

Here is the caller graph for this function:

std::shared_ptr<Voice> amuse::Engine::fxStart | ( | int | sfxId,
|  | float | vol,
|  | float | pan,
|  | Submix * | smx = `nullptr`
| ) |  |

Start soundFX playing from loaded audio groups

Here is the caller graph for this function:

IBackendVoiceAllocator& amuse::Engine::getBackend | ( |  | ) |

inline

Access voice backend of engine

Definition at line 58 of file Engine.hpp.

Here is the call graph for this function:

void amuse::Engine::killKeygroup | ( | uint8_t | kg,
|  | bool | now
| ) |  |

Stop all voices in `kg`, stops immediately (no KeyOff) when `now` set

Here is the caller graph for this function:

uint32_t amuse::Engine::nextRandom | ( |  | ) |

inline

Obtain next random number from engine's PRNG

Definition at line 97 of file Engine.hpp.

void amuse::Engine::pumpEngine | ( | double | dt | ) |

Update all active audio entities and fill OS audio buffers as needed

Here is the caller graph for this function:

void amuse::Engine::removeAudioGroup | ( | const AudioGroupData & | data | ) |

Remove audio group from engine

Here is the caller graph for this function:

void amuse::Engine::removeSubmix | ( | Submix * | smx | ) |

Remove Submix and deallocate

Here is the caller graph for this function:

void amuse::Engine::sendMacroMessage | ( | ObjectId | macroId,
|  | int32_t | val
| ) |  |

Send all voices using `macroId` the message `val`

Here is the caller graph for this function:

std::shared_ptr<Sequencer> amuse::Engine::seqPlay | ( | int | groupId,
|  | int | songId,
|  | const unsigned char * | arrData,
|  | Submix * | smx = `nullptr`
| ) |  |

Start song playing from loaded audio groups

Here is the caller graph for this function:

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

- include/amuse/Engine.hpp