forked from suyu/suyu
Merge pull request #9134 from lioncash/init
audio_in/out_system: Pass Initialize members by value where applicable
This commit is contained in:
commit
86a3a0b1b4
6 changed files with 8 additions and 8 deletions
|
@ -56,7 +56,7 @@ Result System::IsConfigValid(const std::string_view device_name,
|
||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result System::Initialize(std::string& device_name, const AudioInParameter& in_params,
|
Result System::Initialize(std::string device_name, const AudioInParameter& in_params,
|
||||||
const u32 handle_, const u64 applet_resource_user_id_) {
|
const u32 handle_, const u64 applet_resource_user_id_) {
|
||||||
auto result{IsConfigValid(device_name, in_params)};
|
auto result{IsConfigValid(device_name, in_params)};
|
||||||
if (result.IsError()) {
|
if (result.IsError()) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
* @param applet_resource_user_id - Unused.
|
* @param applet_resource_user_id - Unused.
|
||||||
* @return Result code.
|
* @return Result code.
|
||||||
*/
|
*/
|
||||||
Result Initialize(std::string& device_name, const AudioInParameter& in_params, u32 handle,
|
Result Initialize(std::string device_name, const AudioInParameter& in_params, u32 handle,
|
||||||
u64 applet_resource_user_id);
|
u64 applet_resource_user_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -49,8 +49,8 @@ Result System::IsConfigValid(std::string_view device_name,
|
||||||
return Service::Audio::ERR_INVALID_CHANNEL_COUNT;
|
return Service::Audio::ERR_INVALID_CHANNEL_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result System::Initialize(std::string& device_name, const AudioOutParameter& in_params, u32 handle_,
|
Result System::Initialize(std::string device_name, const AudioOutParameter& in_params, u32 handle_,
|
||||||
u64& applet_resource_user_id_) {
|
u64 applet_resource_user_id_) {
|
||||||
auto result = IsConfigValid(device_name, in_params);
|
auto result = IsConfigValid(device_name, in_params);
|
||||||
if (result.IsError()) {
|
if (result.IsError()) {
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -88,8 +88,8 @@ public:
|
||||||
* @param applet_resource_user_id - Unused.
|
* @param applet_resource_user_id - Unused.
|
||||||
* @return Result code.
|
* @return Result code.
|
||||||
*/
|
*/
|
||||||
Result Initialize(std::string& device_name, const AudioOutParameter& in_params, u32 handle,
|
Result Initialize(std::string device_name, const AudioOutParameter& in_params, u32 handle,
|
||||||
u64& applet_resource_user_id);
|
u64 applet_resource_user_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start this system.
|
* Start this system.
|
||||||
|
|
|
@ -17,7 +17,7 @@ using namespace AudioCore::AudioIn;
|
||||||
class IAudioIn final : public ServiceFramework<IAudioIn> {
|
class IAudioIn final : public ServiceFramework<IAudioIn> {
|
||||||
public:
|
public:
|
||||||
explicit IAudioIn(Core::System& system_, Manager& manager, size_t session_id,
|
explicit IAudioIn(Core::System& system_, Manager& manager, size_t session_id,
|
||||||
std::string& device_name, const AudioInParameter& in_params, u32 handle,
|
const std::string& device_name, const AudioInParameter& in_params, u32 handle,
|
||||||
u64 applet_resource_user_id)
|
u64 applet_resource_user_id)
|
||||||
: ServiceFramework{system_, "IAudioIn"},
|
: ServiceFramework{system_, "IAudioIn"},
|
||||||
service_context{system_, "IAudioIn"}, event{service_context.CreateEvent("AudioInEvent")},
|
service_context{system_, "IAudioIn"}, event{service_context.CreateEvent("AudioInEvent")},
|
||||||
|
|
|
@ -24,7 +24,7 @@ using namespace AudioCore::AudioOut;
|
||||||
class IAudioOut final : public ServiceFramework<IAudioOut> {
|
class IAudioOut final : public ServiceFramework<IAudioOut> {
|
||||||
public:
|
public:
|
||||||
explicit IAudioOut(Core::System& system_, AudioCore::AudioOut::Manager& manager,
|
explicit IAudioOut(Core::System& system_, AudioCore::AudioOut::Manager& manager,
|
||||||
size_t session_id, std::string& device_name,
|
size_t session_id, const std::string& device_name,
|
||||||
const AudioOutParameter& in_params, u32 handle, u64 applet_resource_user_id)
|
const AudioOutParameter& in_params, u32 handle, u64 applet_resource_user_id)
|
||||||
: ServiceFramework{system_, "IAudioOut", ServiceThreadType::CreateNew},
|
: ServiceFramework{system_, "IAudioOut", ServiceThreadType::CreateNew},
|
||||||
service_context{system_, "IAudioOut"}, event{service_context.CreateEvent(
|
service_context{system_, "IAudioOut"}, event{service_context.CreateEvent(
|
||||||
|
|
Loading…
Reference in a new issue