mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2025-08-08 11:12:32 -07:00
kernel/event: Reference ReadableEvent from WritableEvent
This commit is contained in:
@@ -15,11 +15,11 @@ namespace Service::AM::Applets {
|
||||
|
||||
AppletDataBroker::AppletDataBroker() {
|
||||
auto& kernel = Core::System::GetInstance().Kernel();
|
||||
state_changed_event = Kernel::WritableEvent::CreateRegisteredEventPair(
|
||||
state_changed_event = Kernel::WritableEvent::CreateEventPair(
|
||||
kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:StateChangedEvent");
|
||||
pop_out_data_event = Kernel::WritableEvent::CreateRegisteredEventPair(
|
||||
pop_out_data_event = Kernel::WritableEvent::CreateEventPair(
|
||||
kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:PopDataOutEvent");
|
||||
pop_interactive_out_data_event = Kernel::WritableEvent::CreateRegisteredEventPair(
|
||||
pop_interactive_out_data_event = Kernel::WritableEvent::CreateEventPair(
|
||||
kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:PopInteractiveDataOutEvent");
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void AppletDataBroker::PushNormalDataFromGame(IStorage storage) {
|
||||
|
||||
void AppletDataBroker::PushNormalDataFromApplet(IStorage storage) {
|
||||
out_channel.push(std::make_unique<IStorage>(storage));
|
||||
pop_out_data_event->Signal();
|
||||
pop_out_data_event.writable->Signal();
|
||||
}
|
||||
|
||||
void AppletDataBroker::PushInteractiveDataFromGame(IStorage storage) {
|
||||
@@ -76,29 +76,23 @@ void AppletDataBroker::PushInteractiveDataFromGame(IStorage storage) {
|
||||
|
||||
void AppletDataBroker::PushInteractiveDataFromApplet(IStorage storage) {
|
||||
out_interactive_channel.push(std::make_unique<IStorage>(storage));
|
||||
pop_interactive_out_data_event->Signal();
|
||||
pop_interactive_out_data_event.writable->Signal();
|
||||
}
|
||||
|
||||
void AppletDataBroker::SignalStateChanged() const {
|
||||
state_changed_event->Signal();
|
||||
state_changed_event.writable->Signal();
|
||||
}
|
||||
|
||||
Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetNormalDataEvent() const {
|
||||
const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent(
|
||||
"ILibraryAppletAccessor:PopDataOutEvent")};
|
||||
return event->second;
|
||||
return pop_out_data_event.readable;
|
||||
}
|
||||
|
||||
Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetInteractiveDataEvent() const {
|
||||
const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent(
|
||||
"ILibraryAppletAccessor:PopInteractiveDataOutEvent")};
|
||||
return event->second;
|
||||
return pop_interactive_out_data_event.readable;
|
||||
}
|
||||
|
||||
Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetStateChangedEvent() const {
|
||||
const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent(
|
||||
"ILibraryAppletAccessor:StateChangedEvent")};
|
||||
return event->second;
|
||||
return state_changed_event.readable;
|
||||
}
|
||||
|
||||
Applet::Applet() = default;
|
||||
|
@@ -60,13 +60,13 @@ private:
|
||||
// PopInteractiveDataToGame and PushInteractiveDataFromApplet
|
||||
std::queue<std::unique_ptr<IStorage>> out_interactive_channel;
|
||||
|
||||
Kernel::SharedPtr<Kernel::WritableEvent> state_changed_event;
|
||||
Kernel::EventPair state_changed_event;
|
||||
|
||||
// Signaled on PushNormalDataFromApplet
|
||||
Kernel::SharedPtr<Kernel::WritableEvent> pop_out_data_event;
|
||||
Kernel::EventPair pop_out_data_event;
|
||||
|
||||
// Signaled on PushInteractiveDataFromApplet
|
||||
Kernel::SharedPtr<Kernel::WritableEvent> pop_interactive_out_data_event;
|
||||
Kernel::EventPair pop_interactive_out_data_event;
|
||||
};
|
||||
|
||||
class Applet {
|
||||
|
Reference in New Issue
Block a user