diff options
| author | 2021-06-21 18:17:12 +0100 | |
|---|---|---|
| committer | 2021-06-22 04:39:17 +0100 | |
| commit | ba3af04da1ba020bdbb7285c8da73f75fcba68cc (patch) | |
| tree | 60e516f0db83ee9d2e6d2b4cf05671b721bce043 /src/audio_core/stream.h | |
| parent | Merge pull request #6486 from CaptV0rt3x/httplib (diff) | |
| download | yuzu-ba3af04da1ba020bdbb7285c8da73f75fcba68cc.tar.gz yuzu-ba3af04da1ba020bdbb7285c8da73f75fcba68cc.tar.xz yuzu-ba3af04da1ba020bdbb7285c8da73f75fcba68cc.zip | |
Implement audout GetAudioOutPlayedSampleCount
Used in Ninja Gaiden games.
Diffstat (limited to 'src/audio_core/stream.h')
| -rw-r--r-- | src/audio_core/stream.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h index 559844b9b..dbd97ec9c 100644 --- a/src/audio_core/stream.h +++ b/src/audio_core/stream.h | |||
| @@ -89,6 +89,11 @@ public: | |||
| 89 | return sample_rate; | 89 | return sample_rate; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | /// Gets the number of samples played so far | ||
| 93 | [[nodiscard]] u64 GetPlayedSampleCount() const { | ||
| 94 | return played_samples; | ||
| 95 | } | ||
| 96 | |||
| 92 | /// Gets the number of channels | 97 | /// Gets the number of channels |
| 93 | [[nodiscard]] u32 GetNumChannels() const; | 98 | [[nodiscard]] u32 GetNumChannels() const; |
| 94 | 99 | ||
| @@ -106,6 +111,7 @@ private: | |||
| 106 | [[nodiscard]] std::chrono::nanoseconds GetBufferReleaseNS(const Buffer& buffer) const; | 111 | [[nodiscard]] std::chrono::nanoseconds GetBufferReleaseNS(const Buffer& buffer) const; |
| 107 | 112 | ||
| 108 | u32 sample_rate; ///< Sample rate of the stream | 113 | u32 sample_rate; ///< Sample rate of the stream |
| 114 | u64 played_samples{}; ///< The current played sample count | ||
| 109 | Format format; ///< Format of the stream | 115 | Format format; ///< Format of the stream |
| 110 | float game_volume = 1.0f; ///< The volume the game currently has set | 116 | float game_volume = 1.0f; ///< The volume the game currently has set |
| 111 | ReleaseCallback release_callback; ///< Buffer release callback for the stream | 117 | ReleaseCallback release_callback; ///< Buffer release callback for the stream |