wip: Implement events

This commit is contained in:
2026-04-10 23:28:46 +02:00
parent 626380bcc4
commit f6721de3a6
36 changed files with 1824 additions and 111 deletions
+3 -3
View File
@@ -42,6 +42,9 @@ namespace margelo::nitro::omni {
static jni::alias_ref<JPlayerStatus> fromCpp(PlayerStatus value) {
static const auto clazz = javaClassStatic();
switch (value) {
case PlayerStatus::ERROR:
static const auto fieldERROR = clazz->getStaticField<JPlayerStatus>("ERROR");
return clazz->getStaticFieldValue(fieldERROR);
case PlayerStatus::IDLE:
static const auto fieldIDLE = clazz->getStaticField<JPlayerStatus>("IDLE");
return clazz->getStaticFieldValue(fieldIDLE);
@@ -51,9 +54,6 @@ namespace margelo::nitro::omni {
case PlayerStatus::READYTOPLAY:
static const auto fieldREADYTOPLAY = clazz->getStaticField<JPlayerStatus>("READYTOPLAY");
return clazz->getStaticFieldValue(fieldREADYTOPLAY);
case PlayerStatus::ERROR:
static const auto fieldERROR = clazz->getStaticField<JPlayerStatus>("ERROR");
return clazz->getStaticFieldValue(fieldERROR);
default:
std::string stringValue = std::to_string(static_cast<int>(value));
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");