Brunot
Loading...
Searching...
No Matches
PlayAudioAction.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19
20
21
22#pragma once
23#include "Actions/Action.h"
24
26
31class PlayAudioAction : public Action
32{
33public:
34
35#pragma region static_functions
36
37#pragma endregion
38
39 PlayAudioAction() = default;
41 auto operator=(const PlayAudioAction&) -> PlayAudioAction& = default;
42 ~PlayAudioAction() override = default;
43 PlayAudioAction(PlayAudioAction&& other) noexcept = default;
44 auto operator=(PlayAudioAction&& other) noexcept -> PlayAudioAction& = default;
45
46 // I have to comment this one out or else it throws an error
47 PlayAudioAction(std::string soundEffect);
48 PlayAudioAction(std::string soundEffect, float duration);
49 PlayAudioAction(std::string soundEffect, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
50
51#pragma region overridden_functions
52
53
54 auto init() -> void override;
55 auto execute() -> void override;
56 auto end() -> void override;
57
58 auto ActionShowMenu() -> void override;
59 auto render() const -> void override;
60
61#pragma endregion
62
63#pragma region PlaySoundEffectAction_functions
64
65 auto setModulated(bool state) -> void;
66
67#pragma endregion
68
69private:
70
71#pragma region member_variables
72
73 // What event we want to broadcast under
74 std::string soundEffect;
75
76 bool modulated = false;
77
78#pragma endregion
79
80#pragma region helper_functions
81
82 #pragma endregion
83
84#pragma region static_variables
85
86#pragma endregion
87
88};
A class that changes a variable over a set duration.
float initialDelay
Delay that acts between the action being created and the action initializing.
Definition Action.h:262
float endingDelay
Delay that acts after the action has finished updating but before it has ended.
Definition Action.h:264
Action()=default
auto operator=(const PlayAudioAction &) -> PlayAudioAction &=default
PlayAudioAction(PlayAudioAction &&other) noexcept=default
~PlayAudioAction() override=default
auto setModulated(bool state) -> void
Definition PlayAudioAction.cpp:80
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition PlayAudioAction.cpp:76
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition PlayAudioAction.cpp:72
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition PlayAudioAction.cpp:67
bool modulated
Definition PlayAudioAction.h:76
PlayAudioAction(const PlayAudioAction &)=default
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition PlayAudioAction.cpp:63
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition PlayAudioAction.cpp:49
auto operator=(PlayAudioAction &&other) noexcept -> PlayAudioAction &=default
std::string soundEffect
Definition PlayAudioAction.h:74
PlayAudioAction()=default
Definition Bezier.h:30