diff options
author | bunnei <bunneidev@gmail.com> | 2020-11-25 19:50:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 19:50:52 +0100 |
commit | b7f1095980d614842f6264667d9ddd38186d57ff (patch) | |
tree | 980eba01298d420dad312534e93f8fbd82e3ba76 /src/audio_core/stream.h | |
parent | Merge pull request #4978 from bunnei/shutdown-crash (diff) | |
parent | Addressed changes (diff) | |
download | yuzu-b7f1095980d614842f6264667d9ddd38186d57ff.tar yuzu-b7f1095980d614842f6264667d9ddd38186d57ff.tar.gz yuzu-b7f1095980d614842f6264667d9ddd38186d57ff.tar.bz2 yuzu-b7f1095980d614842f6264667d9ddd38186d57ff.tar.lz yuzu-b7f1095980d614842f6264667d9ddd38186d57ff.tar.xz yuzu-b7f1095980d614842f6264667d9ddd38186d57ff.tar.zst yuzu-b7f1095980d614842f6264667d9ddd38186d57ff.zip |
Diffstat (limited to 'src/audio_core/stream.h')
-rw-r--r-- | src/audio_core/stream.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h index 6437b8591..71c2d0b4f 100644 --- a/src/audio_core/stream.h +++ b/src/audio_core/stream.h @@ -57,37 +57,40 @@ public: bool QueueBuffer(BufferPtr&& buffer); /// Returns true if the audio stream contains a buffer with the specified tag - bool ContainsBuffer(Buffer::Tag tag) const; + [[nodiscard]] bool ContainsBuffer(Buffer::Tag tag) const; /// Returns a vector of recently released buffers specified by tag - std::vector<Buffer::Tag> GetTagsAndReleaseBuffers(std::size_t max_count); + [[nodiscard]] std::vector<Buffer::Tag> GetTagsAndReleaseBuffers(std::size_t max_count); + + /// Returns a vector of all recently released buffers specified by tag + [[nodiscard]] std::vector<Buffer::Tag> GetTagsAndReleaseBuffers(); void SetVolume(float volume); - float GetVolume() const { + [[nodiscard]] float GetVolume() const { return game_volume; } /// Returns true if the stream is currently playing - bool IsPlaying() const { + [[nodiscard]] bool IsPlaying() const { return state == State::Playing; } /// Returns the number of queued buffers - std::size_t GetQueueSize() const { + [[nodiscard]] std::size_t GetQueueSize() const { return queued_buffers.size(); } /// Gets the sample rate - u32 GetSampleRate() const { + [[nodiscard]] u32 GetSampleRate() const { return sample_rate; } /// Gets the number of channels - u32 GetNumChannels() const; + [[nodiscard]] u32 GetNumChannels() const; /// Get the state - State GetState() const; + [[nodiscard]] State GetState() const; private: /// Plays the next queued buffer in the audio stream, starting playback if necessary @@ -97,7 +100,7 @@ private: void ReleaseActiveBuffer(std::chrono::nanoseconds ns_late = {}); /// Gets the number of core cycles when the specified buffer will be released - std::chrono::nanoseconds GetBufferReleaseNS(const Buffer& buffer) const; + [[nodiscard]] std::chrono::nanoseconds GetBufferReleaseNS(const Buffer& buffer) const; u32 sample_rate; ///< Sample rate of the stream Format format; ///< Format of the stream |