2015-03-27 16:51:54 -07:00
|
|
|
// Copyright 2015 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2017-12-09 03:02:40 -08:00
|
|
|
#include <memory>
|
2016-09-20 23:52:38 -07:00
|
|
|
#include "core/hle/service/ir/ir.h"
|
2015-03-27 16:51:54 -07:00
|
|
|
#include "core/hle/service/ir/ir_rst.h"
|
|
|
|
#include "core/hle/service/ir/ir_u.h"
|
|
|
|
#include "core/hle/service/ir/ir_user.h"
|
2016-09-17 17:38:01 -07:00
|
|
|
#include "core/hle/service/service.h"
|
2015-03-27 16:51:54 -07:00
|
|
|
|
|
|
|
namespace Service {
|
|
|
|
namespace IR {
|
|
|
|
|
2017-12-09 03:02:40 -08:00
|
|
|
static std::weak_ptr<IR_RST> current_ir_rst;
|
2017-12-09 04:46:19 -08:00
|
|
|
static std::weak_ptr<IR_USER> current_ir_user;
|
2015-03-27 16:51:54 -07:00
|
|
|
|
2017-03-31 12:27:18 -07:00
|
|
|
void ReloadInputDevices() {
|
2017-12-09 04:46:19 -08:00
|
|
|
if (auto ir_user = current_ir_user.lock())
|
|
|
|
ir_user->ReloadInputDevices();
|
2017-12-09 03:02:40 -08:00
|
|
|
|
|
|
|
if (auto ir_rst = current_ir_rst.lock())
|
|
|
|
ir_rst->ReloadInputDevices();
|
2017-03-31 12:27:18 -07:00
|
|
|
}
|
|
|
|
|
2017-12-09 02:34:23 -08:00
|
|
|
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
|
|
|
std::make_shared<IR_U>()->InstallAsService(service_manager);
|
2017-12-09 03:02:40 -08:00
|
|
|
|
2017-12-09 04:46:19 -08:00
|
|
|
auto ir_user = std::make_shared<IR_USER>();
|
|
|
|
ir_user->InstallAsService(service_manager);
|
|
|
|
current_ir_user = ir_user;
|
|
|
|
|
2017-12-09 03:02:40 -08:00
|
|
|
auto ir_rst = std::make_shared<IR_RST>();
|
|
|
|
ir_rst->InstallAsService(service_manager);
|
|
|
|
current_ir_rst = ir_rst;
|
2017-12-09 02:34:23 -08:00
|
|
|
}
|
|
|
|
|
2015-03-27 16:51:54 -07:00
|
|
|
} // namespace IR
|
|
|
|
|
|
|
|
} // namespace Service
|