diff options
author | Lioncash <mathew1800@gmail.com> | 2022-09-16 15:40:41 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2022-09-16 15:45:54 +0200 |
commit | 7a5d235d944bb3837abb0be649303a5c15ea36f5 (patch) | |
tree | a84ff0e56d2ba965dbcc46a9b655137cea4b14a6 /src/audio_core | |
parent | audio_out: Mark several functions as const (diff) | |
download | yuzu-7a5d235d944bb3837abb0be649303a5c15ea36f5.tar yuzu-7a5d235d944bb3837abb0be649303a5c15ea36f5.tar.gz yuzu-7a5d235d944bb3837abb0be649303a5c15ea36f5.tar.bz2 yuzu-7a5d235d944bb3837abb0be649303a5c15ea36f5.tar.lz yuzu-7a5d235d944bb3837abb0be649303a5c15ea36f5.tar.xz yuzu-7a5d235d944bb3837abb0be649303a5c15ea36f5.tar.zst yuzu-7a5d235d944bb3837abb0be649303a5c15ea36f5.zip |
Diffstat (limited to 'src/audio_core')
-rw-r--r-- | src/audio_core/in/audio_in.cpp | 8 | ||||
-rw-r--r-- | src/audio_core/in/audio_in.h | 8 | ||||
-rw-r--r-- | src/audio_core/in/audio_in_system.cpp | 10 | ||||
-rw-r--r-- | src/audio_core/in/audio_in_system.h | 10 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/audio_core/in/audio_in.cpp b/src/audio_core/in/audio_in.cpp index c946895d6..91ccd5ad7 100644 --- a/src/audio_core/in/audio_in.cpp +++ b/src/audio_core/in/audio_in.cpp @@ -72,7 +72,7 @@ Kernel::KReadableEvent& In::GetBufferEvent() { return event->GetReadableEvent(); } -f32 In::GetVolume() { +f32 In::GetVolume() const { std::scoped_lock l{parent_mutex}; return system.GetVolume(); } @@ -82,17 +82,17 @@ void In::SetVolume(f32 volume) { system.SetVolume(volume); } -bool In::ContainsAudioBuffer(u64 tag) { +bool In::ContainsAudioBuffer(u64 tag) const { std::scoped_lock l{parent_mutex}; return system.ContainsAudioBuffer(tag); } -u32 In::GetBufferCount() { +u32 In::GetBufferCount() const { std::scoped_lock l{parent_mutex}; return system.GetBufferCount(); } -u64 In::GetPlayedSampleCount() { +u64 In::GetPlayedSampleCount() const { std::scoped_lock l{parent_mutex}; return system.GetPlayedSampleCount(); } diff --git a/src/audio_core/in/audio_in.h b/src/audio_core/in/audio_in.h index 6253891d5..092ab7236 100644 --- a/src/audio_core/in/audio_in.h +++ b/src/audio_core/in/audio_in.h @@ -102,7 +102,7 @@ public: * * @return The current volume. */ - f32 GetVolume(); + f32 GetVolume() const; /** * Set the system volume. @@ -117,21 +117,21 @@ public: * @param tag - The tag to search for. * @return True if the buffer is in the system, otherwise false. */ - bool ContainsAudioBuffer(u64 tag); + bool ContainsAudioBuffer(u64 tag) const; /** * Get the maximum number of buffers. * * @return The maximum number of buffers. */ - u32 GetBufferCount(); + u32 GetBufferCount() const; /** * Get the total played sample count for this audio in. * * @return The played sample count. */ - u64 GetPlayedSampleCount(); + u64 GetPlayedSampleCount() const; private: /// The AudioIn::Manager this audio in is registered with diff --git a/src/audio_core/in/audio_in_system.cpp b/src/audio_core/in/audio_in_system.cpp index 9c6039aea..e7f918a47 100644 --- a/src/audio_core/in/audio_in_system.cpp +++ b/src/audio_core/in/audio_in_system.cpp @@ -34,16 +34,16 @@ size_t System::GetSessionId() const { return session_id; } -std::string_view System::GetDefaultDeviceName() { +std::string_view System::GetDefaultDeviceName() const { return "BuiltInHeadset"; } -std::string_view System::GetDefaultUacDeviceName() { +std::string_view System::GetDefaultUacDeviceName() const { return "Uac"; } Result System::IsConfigValid(const std::string_view device_name, - const AudioInParameter& in_params) { + const AudioInParameter& in_params) const { if ((device_name.size() > 0) && (device_name != GetDefaultDeviceName() && device_name != GetDefaultUacDeviceName())) { return Service::Audio::ERR_INVALID_DEVICE_NAME; @@ -202,11 +202,11 @@ void System::SetVolume(const f32 volume_) { session->SetVolume(volume_); } -bool System::ContainsAudioBuffer(const u64 tag) { +bool System::ContainsAudioBuffer(const u64 tag) const { return buffers.ContainsBuffer(tag); } -u32 System::GetBufferCount() { +u32 System::GetBufferCount() const { return buffers.GetAppendedRegisteredCount(); } diff --git a/src/audio_core/in/audio_in_system.h b/src/audio_core/in/audio_in_system.h index 9ddc8daae..b9dc0e60f 100644 --- a/src/audio_core/in/audio_in_system.h +++ b/src/audio_core/in/audio_in_system.h @@ -68,7 +68,7 @@ public: * * @return The default audio input device name. */ - std::string_view GetDefaultDeviceName(); + std::string_view GetDefaultDeviceName() const; /** * Get the default USB audio input device name. @@ -77,7 +77,7 @@ public: * * @return The default USB audio input device name. */ - std::string_view GetDefaultUacDeviceName(); + std::string_view GetDefaultUacDeviceName() const; /** * Is the given initialize config valid? @@ -86,7 +86,7 @@ public: * @param in_params - Input parameters, see AudioInParameter. * @return Result code. */ - Result IsConfigValid(std::string_view device_name, const AudioInParameter& in_params); + Result IsConfigValid(std::string_view device_name, const AudioInParameter& in_params) const; /** * Initialize this system. @@ -218,14 +218,14 @@ public: * @param tag - Unique tag to search for. * @return True if the buffer is in the system, otherwise false. */ - bool ContainsAudioBuffer(u64 tag); + bool ContainsAudioBuffer(u64 tag) const; /** * Get the maximum number of usable buffers (default 32). * * @return The number of buffers. */ - u32 GetBufferCount(); + u32 GetBufferCount() const; /** * Get the total number of samples played by this system. |