remove GetCurrentModule() functions in HLE Services

This commit is contained in:
B3n30 2018-10-11 11:12:07 +02:00
parent 4ee914c7a8
commit 9d53136f20
14 changed files with 99 additions and 69 deletions

View file

@ -6,7 +6,8 @@
#include "core/core.h"
#include "core/gdbstub/gdbstub.h"
#include "core/hle/service/hid/hid.h"
#include "core/hle/service/ir/ir.h"
#include "core/hle/service/ir/ir_rst.h"
#include "core/hle/service/ir/ir_user.h"
#include "core/settings.h"
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"
@ -32,14 +33,37 @@ void Apply() {
VideoCore::g_renderer_bg_color_update_requested = true;
if (Core::System::GetInstance().IsPoweredOn()) {
auto& system = Core::System::GetInstance();
if (system.IsPoweredOn()) {
Core::DSP().SetSink(values.sink_id, values.audio_device_id);
Core::DSP().EnableStretching(values.enable_audio_stretching);
}
Service::HID::ReloadInputDevices();
Service::IR::ReloadInputDevices();
Service::CAM::ReloadCameraDevices();
auto& sm = system.ServiceManager();
auto hid = sm.GetService<Service::HID::Module::Interface>("hid:USER");
if (hid) {
auto hid_module = hid->GetModule();
if (hid_module) {
hid_module->ReloadInputDevices();
}
}
auto ir_user = sm.GetService<Service::IR::IR_USER>("ir:USER");
if (ir_user)
ir_user->ReloadInputDevices();
auto ir_rst = sm.GetService<Service::IR::IR_RST>("ir:rst");
if (ir_rst)
ir_rst->ReloadInputDevices();
auto cam = sm.GetService<Service::CAM::Module::Interface>("cam:u");
if (cam) {
auto cam_module = cam->GetModule();
if (cam_module) {
cam_module->ReloadCameraDevices();
}
}
}
}
template <typename T>