CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Source.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Forward.hpp"
11
13
15
16namespace CeresEngine {
17
23 AudioAPIBufferPtr buffer = nullptr;
24
26 Vector3 position = Vector3(0.0);
27
29 Vector3 direction = Vector3(0.0);
30
32 Vector3 velocity = Vector3(0.0);
33
37 bool startPlaying = false;
38
41 bool looping = false;
42
45 double pitch = 1.0;
46
49 double gain = 1.0;
50
53 double minimumGain = 0.0;
54
57 double maximumGain = 1.0;
58
62 double maximumDistance = 100.0;
63
66 double rolloffFactor = 1.0;
67
72 double referenceDistance = 1.0;
73
76 double coneOuterGain = 1.0;
77
80 double coneInnerAngle = 360.0;
81
84 double coneOuterAngle = 360.0;
85
89 bool relative = false;
90
93 double offset = 0.0;
94 };
95
105 public:
107 AudioAPISource() = default;
108
111
114
116 virtual ~AudioAPISource() = default;
117
118 public:
121 virtual void play() = 0;
122
124 [[nodiscard]] CE_SCRIPT_EXPORT()
125 virtual bool isPlaying() const = 0;
126
130 virtual void stop() = 0;
131
135 [[nodiscard]] CE_SCRIPT_EXPORT()
136 virtual bool isStopped() const = 0;
137
141 virtual void pause() = 0;
142
146 [[nodiscard]] CE_SCRIPT_EXPORT()
147 virtual bool isPaused() const = 0;
148
151 virtual void resume() = 0;
152
153 public:
155 virtual void update(const AudioAPISourceDescriptor& descriptor) = 0;
156 };
157
158} // namespace CeresEngine
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
A audio source is an entity that emits sounds.
Definition Source.hpp:104
virtual ~AudioAPISource()=default
Destroys the audio source.
AudioAPISource()=default
The default constructor.
AudioAPISource & operator=(const AudioAPISource &)=delete
Deleted copy assignment operator.
AudioAPISource(const AudioAPISource &)=delete
Deleted copy constructor.
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
A simple reference counter base class.
Definition SmartPtr.hpp:438
Definition Application.hpp:19
A descriptor structure that describes the creation of an audio source.
Definition Source.hpp:19