summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-09-27 23:05:03 +0200
committerGitHub <noreply@github.com>2018-09-27 23:05:03 +0200
commitfc2419e441dbd2270460c8fe7a92e515c0789fa5 (patch)
treeb424962d98ee97013c5c67ef8913c4a2aaf9e0c2 /src
parentMerge pull request #1389 from PhiBabin/valgrind (diff)
parentstream: Preserve enum class type in GetState() (diff)
downloadyuzu-fc2419e441dbd2270460c8fe7a92e515c0789fa5.tar
yuzu-fc2419e441dbd2270460c8fe7a92e515c0789fa5.tar.gz
yuzu-fc2419e441dbd2270460c8fe7a92e515c0789fa5.tar.bz2
yuzu-fc2419e441dbd2270460c8fe7a92e515c0789fa5.tar.lz
yuzu-fc2419e441dbd2270460c8fe7a92e515c0789fa5.tar.xz
yuzu-fc2419e441dbd2270460c8fe7a92e515c0789fa5.tar.zst
yuzu-fc2419e441dbd2270460c8fe7a92e515c0789fa5.zip
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/audio_renderer.cpp2
-rw-r--r--src/audio_core/audio_renderer.h2
-rw-r--r--src/audio_core/stream.cpp4
-rw-r--r--src/audio_core/stream.h14
-rw-r--r--src/core/hle/service/audio/audren_u.cpp2
5 files changed, 12 insertions, 12 deletions
diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp
index 521b19ff7..6f0ff953a 100644
--- a/src/audio_core/audio_renderer.cpp
+++ b/src/audio_core/audio_renderer.cpp
@@ -79,7 +79,7 @@ u32 AudioRenderer::GetMixBufferCount() const {
return worker_params.mix_buffer_count;
}
-u32 AudioRenderer::GetState() const {
+Stream::State AudioRenderer::GetStreamState() const {
return stream->GetState();
}
diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h
index be923ee65..dfef89e1d 100644
--- a/src/audio_core/audio_renderer.h
+++ b/src/audio_core/audio_renderer.h
@@ -170,7 +170,7 @@ public:
u32 GetSampleRate() const;
u32 GetSampleCount() const;
u32 GetMixBufferCount() const;
- u32 GetState() const;
+ Stream::State GetStreamState() const;
private:
class VoiceState;
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp
index ee4aa98af..742a5e0a0 100644
--- a/src/audio_core/stream.cpp
+++ b/src/audio_core/stream.cpp
@@ -53,8 +53,8 @@ void Stream::Stop() {
ASSERT_MSG(false, "Unimplemented");
}
-u32 Stream::GetState() const {
- return static_cast<u32>(state);
+Stream::State Stream::GetState() const {
+ return state;
}
s64 Stream::GetBufferReleaseCycles(const Buffer& buffer) const {
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:
Multi51Channel16,
};
+ /// Current state of the stream
+ enum class State {
+ Stopped,
+ Playing,
+ };
+
/// Callback function type, used to change guest state on a buffer being released
using ReleaseCallback = std::function<void()>;
@@ -73,15 +79,9 @@ public:
u32 GetNumChannels() const;
/// Get the state
- u32 GetState() const;
+ State GetState() const;
private:
- /// Current state of the stream
- enum class State {
- Stopped,
- Playing,
- };
-
/// Plays the next queued buffer in the audio stream, starting playback if necessary
void PlayNextBuffer();
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index fa15712cf..6073f4ecd 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -66,7 +66,7 @@ private:
void GetAudioRendererState(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- rb.Push<u32>(renderer->GetState());
+ rb.Push<u32>(static_cast<u32>(renderer->GetStreamState()));
LOG_DEBUG(Service_Audio, "called");
}