diff options
| author | 2018-09-23 20:01:02 -0400 | |
|---|---|---|
| committer | 2018-09-23 20:03:38 -0400 | |
| commit | 2f6a6113118a6d23bc88b7c3e3d1bfee28c11f63 (patch) | |
| tree | 52a37fb98b002943669ab96ad1bdecd3cd42f6d9 /src/audio_core/stream.h | |
| parent | Added glObjectLabels for renderdoc for textures and shader programs (#1384) (diff) | |
| download | yuzu-2f6a6113118a6d23bc88b7c3e3d1bfee28c11f63.tar.gz yuzu-2f6a6113118a6d23bc88b7c3e3d1bfee28c11f63.tar.xz yuzu-2f6a6113118a6d23bc88b7c3e3d1bfee28c11f63.zip | |
stream: Preserve enum class type in GetState()
Preserves the meaning/type-safetiness of the stream state instead of
making it an opaque u32. This makes it usable for other things outside
of the service HLE context.
Diffstat (limited to 'src/audio_core/stream.h')
| -rw-r--r-- | src/audio_core/stream.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h index 43eca74e1..aebfeb51d 100644 --- a/src/audio_core/stream.h +++ b/src/audio_core/stream.h | |||
| @@ -33,6 +33,12 @@ public: | |||
| 33 | Multi51Channel16, | 33 | Multi51Channel16, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | /// Current state of the stream | ||
| 37 | enum class State { | ||
| 38 | Stopped, | ||
| 39 | Playing, | ||
| 40 | }; | ||
| 41 | |||
| 36 | /// Callback function type, used to change guest state on a buffer being released | 42 | /// Callback function type, used to change guest state on a buffer being released |
| 37 | using ReleaseCallback = std::function<void()>; | 43 | using ReleaseCallback = std::function<void()>; |
| 38 | 44 | ||
| @@ -73,15 +79,9 @@ public: | |||
| 73 | u32 GetNumChannels() const; | 79 | u32 GetNumChannels() const; |
| 74 | 80 | ||
| 75 | /// Get the state | 81 | /// Get the state |
| 76 | u32 GetState() const; | 82 | State GetState() const; |
| 77 | 83 | ||
| 78 | private: | 84 | private: |
| 79 | /// Current state of the stream | ||
| 80 | enum class State { | ||
| 81 | Stopped, | ||
| 82 | Playing, | ||
| 83 | }; | ||
| 84 | |||
| 85 | /// Plays the next queued buffer in the audio stream, starting playback if necessary | 85 | /// Plays the next queued buffer in the audio stream, starting playback if necessary |
| 86 | void PlayNextBuffer(); | 86 | void PlayNextBuffer(); |
| 87 | 87 | ||