3#include "pixelbullet/audio/audio_load_mode.h"
4#include "pixelbullet/audio/audio_serialization.h"
5#include "pixelbullet/audio/audio_spatial_settings.h"
6#include "pixelbullet/filesystem/virtual_path.h"
7#include "pixelbullet/filesystem/virtual_path_serialization.h"
8#include "pixelbullet/serialization/node.h"
20 AudioLoadMode load_mode = AudioLoadMode::Auto;
24 return enabled == other.enabled && clip.logical_path() == other.clip.logical_path() && autoplay == other.autoplay &&
25 loop == other.loop && volume == other.volume && spatial_settings == other.spatial_settings && load_mode == other.load_mode;
31 node[
"enabled"] << component.enabled;
32 node[
"clip"] << component.clip;
33 node[
"autoplay"] << component.autoplay;
34 node[
"loop"] << component.loop;
35 node[
"volume"] << component.volume;
36 node[
"spatial"] << component.spatial_settings.enabled;
37 node[
"minDistance"] << component.spatial_settings.min_distance;
38 node[
"maxDistance"] << component.spatial_settings.max_distance;
39 node[
"loadMode"] << component.load_mode;
43inline const Node& operator>>(
const Node& node, AudioSourceComponent& component)
45 if (node.has_property(
"enabled"))
47 node[
"enabled"] >> component.enabled;
49 if (node.has_property(
"clip"))
51 node[
"clip"] >> component.clip;
53 if (node.has_property(
"autoplay"))
55 node[
"autoplay"] >> component.autoplay;
57 if (node.has_property(
"loop"))
59 node[
"loop"] >> component.loop;
61 if (node.has_property(
"volume"))
63 node[
"volume"] >> component.volume;
65 if (node.has_property(
"spatial"))
67 node[
"spatial"] >> component.spatial_settings.enabled;
69 if (node.has_property(
"minDistance"))
71 node[
"minDistance"] >> component.spatial_settings.min_distance;
73 if (node.has_property(
"maxDistance"))
75 node[
"maxDistance"] >> component.spatial_settings.max_distance;
77 if (node.has_property(
"loadMode"))
79 node[
"loadMode"] >> component.load_mode;
Represents a hierarchical node capable of storing various data types and supporting YAML serializatio...
Definition node.h:49
Definition virtual_path.h:10
Definition audio_source_component.h:13
Definition audio_spatial_settings.h:6