Add GetModule() helper functions, for HID, CAM, and CFG

This commit is contained in:
B3n30 2018-10-12 11:50:50 +02:00
parent 1b1de23a98
commit eb3af0f16a
12 changed files with 49 additions and 51 deletions

View file

@ -38,30 +38,22 @@ void Apply() {
Core::DSP().SetSink(values.sink_id, values.audio_device_id);
Core::DSP().EnableStretching(values.enable_audio_stretching);
auto& sm = system.ServiceManager();
auto hid = sm.GetService<Service::HID::Module::Interface>("hid:USER");
auto hid = Service::HID::GetModule(system);
if (hid) {
auto hid_module = hid->GetModule();
if (hid_module) {
hid_module->ReloadInputDevices();
}
hid->ReloadInputDevices();
}
auto sm = system.ServiceManager();
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");
auto cam = Service::CAM::GetModule(system);
if (cam) {
auto cam_module = cam->GetModule();
if (cam_module) {
cam_module->ReloadCameraDevices();
}
cam->ReloadCameraDevices();
}
}
}