summaryrefslogtreecommitdiff
path: root/src/audio_core/buffer.h
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-26 20:01:37 -0400
committerGravatar bunnei2018-07-27 22:33:31 -0400
commitab756fd068c45fd1b3e3d0216b78c39a741214ae (patch)
tree6508316ccfbffc0fc5be6e964f6c7f20adf6b722 /src/audio_core/buffer.h
parentMerge pull request #845 from lioncash/nfc (diff)
downloadyuzu-ab756fd068c45fd1b3e3d0216b78c39a741214ae.tar.gz
yuzu-ab756fd068c45fd1b3e3d0216b78c39a741214ae.tar.xz
yuzu-ab756fd068c45fd1b3e3d0216b78c39a741214ae.zip
audio_core: Add initial code for keeping track of audout state.
Diffstat (limited to 'src/audio_core/buffer.h')
-rw-r--r--src/audio_core/buffer.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/audio_core/buffer.h b/src/audio_core/buffer.h
new file mode 100644
index 000000000..874ec787e
--- /dev/null
+++ b/src/audio_core/buffer.h
@@ -0,0 +1,37 @@
1// Copyright 2018 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <vector>
8
9#include "common/common_types.h"
10
11namespace AudioCore {
12
13/**
14 * Represents a buffer of audio samples to be played in an audio stream
15 */
16class Buffer {
17public:
18 using Tag = u64;
19
20 Buffer(Tag tag, std::vector<u8>&& data) : tag{tag}, data{std::move(data)} {}
21
22 /// Returns the raw audio data for the buffer
23 const std::vector<u8>& GetData() const {
24 return data;
25 }
26
27 /// Returns the buffer tag, this is provided by the game to the audout service
28 Tag GetTag() const {
29 return tag;
30 }
31
32private:
33 Tag tag;
34 std::vector<u8> data;
35};
36
37} // namespace AudioCore