summaryrefslogtreecommitdiffstats
path: root/src/audio_core
diff options
context:
space:
mode:
authorChloe Marcec <dmarcecguzman@gmail.com>2021-01-24 09:13:34 +0100
committerChloe Marcec <dmarcecguzman@gmail.com>2021-01-24 09:13:34 +0100
commitb2b95e96c159afe3226fe6a001ff780a38813fe4 (patch)
tree701c946a772d58bca5b1fd153c324a98d622ec04 /src/audio_core
parentMerge pull request #5806 from bunnei/am-stub (diff)
downloadyuzu-b2b95e96c159afe3226fe6a001ff780a38813fe4.tar
yuzu-b2b95e96c159afe3226fe6a001ff780a38813fe4.tar.gz
yuzu-b2b95e96c159afe3226fe6a001ff780a38813fe4.tar.bz2
yuzu-b2b95e96c159afe3226fe6a001ff780a38813fe4.tar.lz
yuzu-b2b95e96c159afe3226fe6a001ff780a38813fe4.tar.xz
yuzu-b2b95e96c159afe3226fe6a001ff780a38813fe4.tar.zst
yuzu-b2b95e96c159afe3226fe6a001ff780a38813fe4.zip
Diffstat (limited to 'src/audio_core')
-rw-r--r--src/audio_core/stream.cpp8
-rw-r--r--src/audio_core/stream.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp
index afe68c9ed..5b0b285cd 100644
--- a/src/audio_core/stream.cpp
+++ b/src/audio_core/stream.cpp
@@ -51,6 +51,14 @@ void Stream::Stop() {
UNIMPLEMENTED();
}
+bool Stream::Flush() {
+ const bool had_buffers = !queued_buffers.empty();
+ while (!queued_buffers.empty()) {
+ queued_buffers.pop();
+ }
+ return had_buffers;
+}
+
void Stream::SetVolume(float volume) {
game_volume = volume;
}
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h
index 506ac536b..559844b9b 100644
--- a/src/audio_core/stream.h
+++ b/src/audio_core/stream.h
@@ -56,6 +56,9 @@ public:
/// Queues a buffer into the audio stream, returns true on success
bool QueueBuffer(BufferPtr&& buffer);
+ /// Flush audio buffers
+ bool Flush();
+
/// Returns true if the audio stream contains a buffer with the specified tag
[[nodiscard]] bool ContainsBuffer(Buffer::Tag tag) const;