Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
audio_bus.hpp
Go to the documentation of this file.
1
8
9
#pragma once
10
#include <
toast/assets/data.hpp
>
11
#include <
toast/export.hpp
>
12
13
namespace
assets {
14
15
class
TOAST_API AudioBus :
public
Data {
16
public
:
17
explicit
AudioBus(
const
toml::table& table,
Handle<Schema>
schema = {}) : Data(table, std::move(schema)) { }
18
19
[[nodiscard]]
20
auto
type()
const
-> std::string_view
override
{
21
return
"audio_bus"
;
22
}
23
24
// Type-safe string getters pulling from the underlying m_root DataValue
25
[[nodiscard]]
26
auto
eventType()
const
-> std::string_view {
27
return
m_root
.contains(
"type"
) ?
m_root
[
"type"
].as<std::string_view>() :
""
;
28
}
29
30
[[nodiscard]]
31
auto
name()
const
-> std::string_view {
32
return
m_root
.contains(
"name"
) ?
m_root
[
"name"
].as<std::string_view>() :
""
;
33
}
34
35
[[nodiscard]]
36
auto
path()
const
-> std::string_view {
37
return
m_root
.contains(
"path"
) ?
m_root
[
"path"
].as<std::string_view>() :
""
;
38
}
39
40
[[nodiscard]]
41
auto
guid()
const
-> std::string_view {
42
return
m_root
.contains(
"guid"
) ?
m_root
[
"guid"
].as<std::string_view>() :
""
;
43
}
44
45
void
setVolume(
float
volume)
const
;
46
};
47
48
}
assets::Data::m_root
DataValue m_root
Object DataValue holding all fields.
Definition
data.hpp:68
assets::Handle
Type-safe smart pointer for assets.
Definition
core_types.hpp:149
data.hpp
Typed data asset backed by schema-driven TOML.
export.hpp
engine
src
toast
audio
audio_bus.hpp
Generated by
1.17.0