Kemena3D
Loading...
Searching...
No Matches
kaudiomanager.h
Go to the documentation of this file.
1
5
6#ifndef KAUDIOMANAGER_H
7#define KAUDIOMANAGER_H
8
9#include "kexport.h"
10#include "kdatatype.h"
11#include "kaudio.h"
12
13#include <vector>
14
15namespace kemena
16{
37 {
38 public:
41
44
45 // --- Lifecycle -------------------------------------------------------
46
51 bool init();
52
57 void shutdown();
58
59 // --- Global controls -------------------------------------------------
60
65 void setMasterVolume(float volume);
66
68 float getMasterVolume() const;
69
70 // --- 3D listener -----------------------------------------------------
71
76 void setListenerPosition(const kVec3 &position);
77
83 void setListenerDirection(const kVec3 &forward, const kVec3 &up);
84
89 void setListenerVelocity(const kVec3 &velocity);
90
91 // --- Audio clip factory ----------------------------------------------
92
104 kAudio *loadAudio(const kString &filePath);
105
110 void unloadAudio(kAudio *audio);
111
112 protected:
113 private:
114 struct Impl;
115 Impl *m_impl;
116 };
117
118} // namespace kemena
119
120#endif // KAUDIOMANAGER_H
Represents a loaded audio clip that can be played, stopped, and positioned.
Definition kaudio.h:36
float getMasterVolume() const
Returns the current master volume.
bool init()
Initialises the underlying miniaudio engine.
kAudio * loadAudio(const kString &filePath)
Loads an audio file and returns a new kAudio instance.
kAudioManager()
Constructs the manager; call init() before use.
void setListenerPosition(const kVec3 &position)
Moves the audio listener to a new world-space position.
void setListenerDirection(const kVec3 &forward, const kVec3 &up)
Sets the listener's orientation.
void unloadAudio(kAudio *audio)
Stops and destroys a previously loaded kAudio.
void setListenerVelocity(const kVec3 &velocity)
Sets the listener's velocity for Doppler shift calculation.
void shutdown()
Stops all sounds, unloads every kAudio, and tears down the engine. Called automatically by the destru...
void setMasterVolume(float volume)
Sets the master output volume.
~kAudioManager()
Destroys the manager, calling shutdown() if still active.
Single audio clip — 2D or 3D positional playback.
Core type aliases, enumerations, structs, and utility functions used throughout the engine.
Symbol visibility / linkage macro for the Kemena3D library.
#define KEMENA3D_API
Definition kexport.h:35
Top-level Kemena3D engine namespace.
Definition kanimation.h:23
std::string kString
Standard string alias.
Definition kdatatype.h:42
glm::vec3 kVec3
3-component float vector.
Definition kdatatype.h:33