|
Toast Engine
|
Handles loading and loading AudioBanks. More...
#include <audio_context.hpp>


Public Member Functions | |
| void | addBank (const assets::Handle< assets::AudioBank > &bank) |
| void | removeBank (assets::Handle< assets::AudioBank > bank) |
| void | reload () |
| Public Member Functions inherited from toast::Node | |
| auto | uid () const noexcept -> const UID & |
| Stable unique identifier, assigned at construction or deserialization. Never changes. | |
| auto | rid () const noexcept -> std::uintptr_t |
| Runtime identifier for this node, guaranteed to be unique but changes every time. | |
| auto | name () const noexcept -> std::string_view |
| Display name. Siblings may share one - this is not an identifier. | |
| void | name (std::string_view name) noexcept |
| Sets the display name. | |
| auto | enabled () const noexcept -> bool |
| Whether this node is currently active. | |
| auto | participatesIn (NodeOwnerParticipation use) const noexcept -> bool |
| auto | owner () const noexcept -> INodeOwner * |
| The World or Workspace this node belongs to. | |
| void | enabled (bool value) noexcept |
| Sets the local enabled flag and propagates the change to all children. | |
| auto | box () const noexcept -> Box< Node > |
| Returns an owning handle to this node. | |
| auto | info () const -> const NodeInfo * |
| Reflection metadata registered by the code generator. | |
| auto | sourcePrefab () const noexcept -> const assets::Handle< assets::Prefab > & |
| The prefab this node was instantiated from. | |
| auto | isInstanceRoot () const noexcept -> bool |
| Whether this node is the root of a prefab instance. | |
| auto | root () const noexcept -> Box< Node > |
| The topmost ancestor that is not the world root. | |
| auto | state () const noexcept -> NodeState |
| auto | type () const noexcept -> NodeType |
| auto | listener () noexcept -> event::Listener & |
| The event Listener owned by this node. Lazy-allocated, freed only with the node. | |
| auto | parent () noexcept -> Box< Node > |
| The immediate parent of this node. | |
| auto | children () const noexcept -> const std::vector< Box< Node > > & |
| The ordered list of direct children. | |
| auto | childrenSnapshot () const -> std::vector< Box< Node > > |
| auto | create (std::string_view type="toast::Node") noexcept -> Box< Node > |
| Creates a new child node of the given type and attaches it to this node. | |
| auto | spawn (UID uid) noexcept -> Box< Node > |
| Asynchronously instantiates a prefab as a child of this node. | |
| auto | spawn (std::string_view uri) noexcept -> Box< Node > |
| Asynchronously instantiates a prefab as a child of this node. | |
| auto | find (std::string_view query) -> Box< Node > |
| Depth-first search for a single descendant. | |
| auto | find (const UID &uid) -> Box< Node > |
| Looks up a node by UID within this node's local root. | |
| auto | search (std::string_view query) -> std::vector< Box< Node > > |
| Depth-first search for all matching descendants. | |
| auto | childrenOfType (const NodeInfo *type) const -> std::vector< Box< Node > > |
| auto | searchType (const NodeInfo *type) const -> std::vector< Box< Node > > |
| void | addDependsOn (Node &other) |
| void | removeDependsOn (Node &other) |
| void | interactsWith (Node &other) |
| Declares that the scripts of this node and of other call each other. | |
| auto | scriptRuntime () noexcept -> scripting::ScriptRuntime * |
| auto | hasTickFunction (TickFunctionList mask) const noexcept -> bool |
| auto | scriptVm (TickFunctionList func) const noexcept -> std::optional< size_t > |
| The interpreter this node runs Lua on while it executes func, empty when it runs none. | |
| auto | scriptVmAny () const noexcept -> std::optional< size_t > |
| The interpreter the scripts of this node live on whatever phase they define. | |
| auto | hasCallable (std::string_view name) const noexcept -> bool |
| void | reloadScripts () noexcept |
| Rebuilds the script runtime after a script asset changed (hot reload or attach). | |
| auto | scripts () const noexcept -> const std::vector< assets::Handle< assets::Script > > & |
| void | setScripts (std::vector< assets::Handle< assets::Script > > scripts) noexcept |
| void | addScript (const assets::Handle< assets::Script > &script) noexcept |
| template<typename R = void, typename... Args> | |
| auto | call (std::string_view name, Args &&... args) -> R |
| Invokes all C++ reflected implementations of name (base→derived) and all same-named Lua functions across every attached script, forwarding args. | |
| template<typename T> | |
| auto | get (std::string_view name) const -> T |
| Reads a named value: reflected C++ field first, then the first matching Lua instance variable. | |
| template<typename T> | |
| void | set (std::string_view name, const T &value) |
| Writes a named value: reflected C++ field if present and every Lua instance variable of that name that already exists. | |
| auto | isRecursivePrefab () const noexcept -> bool |
Additional Inherited Members | |
| Public Attributes inherited from toast::Node | |
| signals::Signal< Box< Node > > | on_enable |
| signals::Signal< Box< Node > > | on_disable |
| signals::Signal< Box< Node > > | on_begin |
| signals::Signal< Box< Node > > | on_end |
| Protected Member Functions inherited from toast::Node | |
| virtual void | onReflectedFieldChanged (std::string_view) |
| virtual void | onScriptsReloaded () |
| virtual void | onScriptsReloading () |
| virtual auto | luaAffinity () const noexcept -> std::optional< size_t > |
| virtual void | onScriptVarChanged (std::string_view path) |
| void | addInspectorMessage (const NodeMessage &message) |
| void | removeInspectorMessage (const NodeMessage &message) |
| Protected Attributes inherited from toast::Node | |
| INodeOwner * | m_owner = nullptr |
Handles loading and loading AudioBanks.
If you manually load or unload a bank during runtime (after init), it won't be updated by default, and you need to call the reload() function