summaryrefslogtreecommitdiffstats
path: root/src/audio_core/stream.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-28 19:44:50 +0200
committerbunnei <bunneidev@gmail.com>2018-07-31 03:45:24 +0200
commitf437c11caf2c1afc0b7d0fdb808be10d7b1adfcf (patch)
treee5224d2e6b57c5ac0aec46377d6bfae9072ab820 /src/audio_core/stream.h
parentaudio_core: Add interfaces for Sink and SinkStream. (diff)
downloadyuzu-f437c11caf2c1afc0b7d0fdb808be10d7b1adfcf.tar
yuzu-f437c11caf2c1afc0b7d0fdb808be10d7b1adfcf.tar.gz
yuzu-f437c11caf2c1afc0b7d0fdb808be10d7b1adfcf.tar.bz2
yuzu-f437c11caf2c1afc0b7d0fdb808be10d7b1adfcf.tar.lz
yuzu-f437c11caf2c1afc0b7d0fdb808be10d7b1adfcf.tar.xz
yuzu-f437c11caf2c1afc0b7d0fdb808be10d7b1adfcf.tar.zst
yuzu-f437c11caf2c1afc0b7d0fdb808be10d7b1adfcf.zip
Diffstat (limited to 'src/audio_core/stream.h')
-rw-r--r--src/audio_core/stream.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h
index 5c1005899..35253920e 100644
--- a/src/audio_core/stream.h
+++ b/src/audio_core/stream.h
@@ -10,6 +10,7 @@
#include <queue>
#include "audio_core/buffer.h"
+#include "audio_core/sink_stream.h"
#include "common/assert.h"
#include "common/common_types.h"
#include "core/core_timing.h"
@@ -31,7 +32,8 @@ public:
/// Callback function type, used to change guest state on a buffer being released
using ReleaseCallback = std::function<void()>;
- Stream(int sample_rate, Format format, ReleaseCallback&& release_callback);
+ Stream(u32 sample_rate, Format format, ReleaseCallback&& release_callback,
+ SinkStream& sink_stream);
/// Plays the audio stream
void Play();
@@ -85,7 +87,7 @@ private:
/// Gets the number of core cycles when the specified buffer will be released
s64 GetBufferReleaseCycles(const Buffer& buffer) const;
- int sample_rate; ///< Sample rate of the stream
+ u32 sample_rate; ///< Sample rate of the stream
Format format; ///< Format of the stream
ReleaseCallback release_callback; ///< Buffer release callback for the stream
State state{State::Stopped}; ///< Playback state of the stream
@@ -93,6 +95,7 @@ private:
BufferPtr active_buffer; ///< Actively playing buffer in the stream
std::queue<BufferPtr> queued_buffers; ///< Buffers queued to be played in the stream
std::queue<BufferPtr> released_buffers; ///< Buffers recently released from the stream
+ SinkStream& sink_stream; ///< Output sink for the stream
};
using StreamPtr = std::shared_ptr<Stream>;