Handle rendition selection

This commit is contained in:
2026-05-13 18:23:09 +02:00
parent 9e4fc4aa67
commit e68628daba
18 changed files with 152 additions and 60 deletions
+3
View File
@@ -48,6 +48,9 @@ namespace margelo::nitro::omni {
case BoolProperty::MUTED:
static const auto fieldMUTED = clazz->getStaticField<JBoolProperty>("MUTED");
return clazz->getStaticFieldValue(fieldMUTED);
case BoolProperty::ISAUTOQUALITY:
static const auto fieldISAUTOQUALITY = clazz->getStaticField<JBoolProperty>("ISAUTOQUALITY");
return clazz->getStaticFieldValue(fieldISAUTOQUALITY);
default:
std::string stringValue = std::to_string(static_cast<int>(value));
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
@@ -225,6 +225,11 @@ namespace margelo::nitro::omni {
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jboolean /* muted */)>("setMuted");
method(_javaPart, muted);
}
bool JHybridOmniPlayerSpec::getIsAutoQuality() {
static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean()>("isAutoQuality");
auto __result = method(_javaPart);
return static_cast<bool>(__result);
}
// Methods
void JHybridOmniPlayerSpec::play() {
@@ -73,6 +73,7 @@ namespace margelo::nitro::omni {
void setVolume(double volume) override;
bool getMuted() override;
void setMuted(bool muted) override;
bool getIsAutoQuality() override;
public:
// Methods
+3
View File
@@ -57,6 +57,9 @@ namespace margelo::nitro::omni {
case NumberProperty::VOLUME:
static const auto fieldVOLUME = clazz->getStaticField<JNumberProperty>("VOLUME");
return clazz->getStaticFieldValue(fieldVOLUME);
case NumberProperty::ISAUTOQUALITY:
static const auto fieldISAUTOQUALITY = clazz->getStaticField<JNumberProperty>("ISAUTOQUALITY");
return clazz->getStaticFieldValue(fieldISAUTOQUALITY);
default:
std::string stringValue = std::to_string(static_cast<int>(value));
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
@@ -17,7 +17,8 @@ import com.facebook.proguard.annotations.DoNotStrip
@Keep
enum class BoolProperty(@DoNotStrip @Keep val value: Int) {
ISPLAYING(0),
MUTED(1);
MUTED(1),
ISAUTOQUALITY(2);
companion object
}
@@ -104,6 +104,10 @@ abstract class HybridOmniPlayerSpec: HybridObject() {
@set:DoNotStrip
@set:Keep
abstract var muted: Boolean
@get:DoNotStrip
@get:Keep
abstract val isAutoQuality: Boolean
// Methods
@DoNotStrip
@@ -20,7 +20,8 @@ enum class NumberProperty(@DoNotStrip @Keep val value: Int) {
BUFFERED(1),
DURATION(2),
PLAYBACKRATE(3),
VOLUME(4);
VOLUME(4),
ISAUTOQUALITY(5);
companion object
}