diff options
| author | 2018-07-28 13:35:22 -0400 | |
|---|---|---|
| committer | 2018-07-30 18:58:40 -0400 | |
| commit | 0e8a2c7222b978507f62d7e0b83187b16532eae8 (patch) | |
| tree | bfcc69cc41fc9cf9fe9a80c321f27ba50d17065f /src/audio_core/stream.h | |
| parent | audio_core: Move to audout_u impl. (diff) | |
| download | yuzu-0e8a2c7222b978507f62d7e0b83187b16532eae8.tar.gz yuzu-0e8a2c7222b978507f62d7e0b83187b16532eae8.tar.xz yuzu-0e8a2c7222b978507f62d7e0b83187b16532eae8.zip | |
audio_core: Misc. improvements to stream/buffer/audio_out.
Diffstat (limited to 'src/audio_core/stream.h')
| -rw-r--r-- | src/audio_core/stream.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h index 5f43b0798..5c1005899 100644 --- a/src/audio_core/stream.h +++ b/src/audio_core/stream.h | |||
| @@ -16,8 +16,6 @@ | |||
| 16 | 16 | ||
| 17 | namespace AudioCore { | 17 | namespace AudioCore { |
| 18 | 18 | ||
| 19 | using BufferPtr = std::shared_ptr<Buffer>; | ||
| 20 | |||
| 21 | /** | 19 | /** |
| 22 | * Represents an audio stream, which is a sequence of queued buffers, to be outputed by AudioOut | 20 | * Represents an audio stream, which is a sequence of queued buffers, to be outputed by AudioOut |
| 23 | */ | 21 | */ |
| @@ -60,6 +58,17 @@ public: | |||
| 60 | return queued_buffers.size(); | 58 | return queued_buffers.size(); |
| 61 | } | 59 | } |
| 62 | 60 | ||
| 61 | /// Gets the sample rate | ||
| 62 | u32 GetSampleRate() const { | ||
| 63 | return sample_rate; | ||
| 64 | } | ||
| 65 | |||
| 66 | /// Gets the number of channels | ||
| 67 | u32 GetNumChannels() const; | ||
| 68 | |||
| 69 | /// Gets the sample size in bytes | ||
| 70 | u32 GetSampleSize() const; | ||
| 71 | |||
| 63 | private: | 72 | private: |
| 64 | /// Current state of the stream | 73 | /// Current state of the stream |
| 65 | enum class State { | 74 | enum class State { |
| @@ -86,4 +95,6 @@ private: | |||
| 86 | std::queue<BufferPtr> released_buffers; ///< Buffers recently released from the stream | 95 | std::queue<BufferPtr> released_buffers; ///< Buffers recently released from the stream |
| 87 | }; | 96 | }; |
| 88 | 97 | ||
| 98 | using StreamPtr = std::shared_ptr<Stream>; | ||
| 99 | |||
| 89 | } // namespace AudioCore | 100 | } // namespace AudioCore |