Elevate Engine 1
Loading...
Searching...
No Matches
WwiseItem.cpp
Go to the documentation of this file.
1#include "WwiseItem.h"
2
3WwiseItemPtr WwiseItem::Create()
4{
5 return std::make_shared<WwiseItem>();
6}
7
9{
10 return ShortID != 0;
11}
12
13bool WwiseItem::IsAnyOfType(std::initializer_list<WwiseType> types) const
14{
15 for (const auto& type : types)
16 {
17 if (type == Type)
18 {
19 return true;
20 }
21 }
22 return false;
23}
24
25std::string WwiseItem::GetTypeName() const
26{
27 switch (Type)
28 {
30 return "Tree Root";
31 break;
33 return "Root Directory";
34 break;
36 return "Work Unit";
37 break;
39 return "Virtual Folder";
40 break;
42 return "Event";
43 break;
44 case WwiseType::Bus:
45 return "Bus";
46 break;
48 return "Switch Group";
49 break;
51 return "Switch";
52 break;
54 return "State Group";
55 break;
57 return "State";
58 break;
60 return "Game Parameter";
61 break;
63 return "Effect ";
64 break;
66 return "Trigger";
67 break;
69 return "Audio Device";
70 break;
71 default:
72 return "Unknown";
73 break;
74 }
75}
76
81
82void WwiseItem::AddChildren(std::shared_ptr<WwiseItem> newChild)
83{
84 if (newChild)
85 {
86 Children.push_back(newChild);
87 }
88}
89
91{
92 return !Children.empty();
93}
94
96{
97 return Type == WwiseType::Event;
98}
99
101{
102 // For root folders
103 if (!IsDirectory()) return WwiseType::None;
104
105 if (Name == "Busses") return WwiseType::Bus;
106 else if (Name == "Devices") return WwiseType::AudioDevice;
107 else if (Name == "Events") return WwiseType::Event;
108 else if (Name == "Switches") return WwiseType::Switch;
109 else if (Name == "StateGroup") return WwiseType::StateGroup;
110 else if (Name == "States") return WwiseType::State;
111 else if (Name == "GameParameter") return WwiseType::GameParameter;
112 else if (Name == "Effects") return WwiseType::Effect;
113 else if (Name == "Triggers") return WwiseType::Trigger;
114 else return WwiseType::Unknown;
115}
WwiseType
Definition WwiseItem.h:10
WwiseType GetContainerType() const
bool IsEvent() const
Definition WwiseItem.cpp:95
std::string Name
Definition WwiseItem.h:44
std::vector< WwiseItemPtr > Children
Definition WwiseItem.h:49
void AddChildren(std::shared_ptr< WwiseItem > newChild)
Definition WwiseItem.cpp:82
static WwiseItemPtr Create()
Definition WwiseItem.cpp:3
uint32_t ShortID
Definition WwiseItem.h:47
bool IsDirectory() const
Definition WwiseItem.cpp:77
bool IsAnyOfType(std::initializer_list< WwiseType > types) const
Definition WwiseItem.cpp:13
bool HasValidShortID()
Definition WwiseItem.cpp:8
std::string GetTypeName() const
Definition WwiseItem.cpp:25
bool HasChildren() const
Definition WwiseItem.cpp:90
WwiseType Type
Definition WwiseItem.h:48