PixelBullet
0.0.1
A C++ game engine
Loading...
Searching...
No Matches
engine
include
pixelbullet
audio
audio.h
1
#pragma once
2
3
#include <functional>
4
#include <memory>
5
6
namespace
pixelbullet
7
{
8
class
Filesystem;
9
class
VirtualPath;
10
14
class
Audio
15
{
16
public
:
17
explicit
Audio
(
Filesystem
& filesystem);
18
~Audio
();
19
20
Audio
(
const
Audio
&) =
delete
;
21
Audio
& operator=(
const
Audio
&) =
delete
;
22
24
void
PlaySound
(
const
VirtualPath
& filePath,
bool
loop =
false
);
25
26
private
:
28
bool
Init();
30
void
Shutdown();
32
void
AudioThreadLoop();
34
void
SubmitCommand(
const
std::function<
void
()>& command);
35
36
private
:
37
struct
State
;
38
39
Filesystem
& filesystem_;
40
std::unique_ptr<State> state_;
41
};
42
}
// namespace pixelbullet
pixelbullet::Audio
Definition
audio.h:15
pixelbullet::Audio::PlaySound
void PlaySound(const VirtualPath &filePath, bool loop=false)
Play a sound given its file path. If loop is true the sound will restart endlessly.
Definition
audio.cc:64
pixelbullet::Filesystem
Definition
filesystem.h:16
pixelbullet::VirtualPath
Definition
virtual_path.h:10
pixelbullet::Audio::State
Definition
audio.cc:15
Generated by
1.12.0