react-native-audio-browser 0.2.0-next.4 → 0.2.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/audiobrowser/model/PlayerUpdateOptions.kt +11 -11
- package/android/src/main/java/com/audiobrowser/player/CapabilityControls.kt +111 -58
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +9 -5
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCommandManager.kt +218 -252
- package/android/src/main/java/com/audiobrowser/player/Player.kt +19 -8
- package/android/src/test/java/com/audiobrowser/player/CapabilityControlsTest.kt +100 -56
- package/android/src/test/java/com/audiobrowser/player/MediaSessionSlotMappingTest.kt +45 -0
- package/lib/commonjs/features/player/options.js +45 -15
- package/lib/commonjs/features/player/options.js.map +1 -1
- package/lib/commonjs/features/player/setup.js +13 -6
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/module/features/player/options.js +45 -15
- package/lib/module/features/player/options.js.map +1 -1
- package/lib/module/features/player/setup.js +13 -6
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/typescript/src/features/player/options.d.ts +86 -36
- package/lib/typescript/src/features/player/options.d.ts.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts +10 -3
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/nitrogen/generated/android/AudioBrowser+autolinking.cmake +1 -1
- package/nitrogen/generated/android/c++/JAndroidOptions.hpp +10 -10
- package/nitrogen/generated/android/c++/JFunc_void_Options.hpp +5 -5
- package/nitrogen/generated/android/c++/JHybridAudioBrowserSpec.cpp +9 -9
- package/nitrogen/generated/android/c++/JNativeSetupPlayerOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/JNativeUpdateOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/JNitroAndroidUpdateOptions.hpp +10 -10
- package/nitrogen/generated/android/c++/JOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/{JNotificationButton.hpp → JRemoteButton.hpp} +19 -19
- package/nitrogen/generated/android/c++/JRemoteButtonLayout.hpp +86 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RemoteButtonLayout.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RemoteButtonLayout.hpp +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/AndroidOptions.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NitroAndroidUpdateOptions.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{NotificationButton.kt → RemoteButton.kt} +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/RemoteButtonLayout.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{Variant_NullType_NotificationButtonLayout.kt → Variant_NullType_RemoteButtonLayout.kt} +9 -9
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Bridge.hpp +36 -51
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Umbrella.hpp +6 -6
- package/nitrogen/generated/ios/c++/HybridAudioBrowserSpecSwift.hpp +6 -6
- package/nitrogen/generated/ios/swift/AndroidOptions.swift +12 -12
- package/nitrogen/generated/ios/swift/NitroAndroidUpdateOptions.swift +12 -12
- package/nitrogen/generated/ios/swift/{NotificationButton.swift → RemoteButton.swift} +6 -6
- package/nitrogen/generated/ios/swift/RemoteButtonLayout.swift +57 -0
- package/nitrogen/generated/ios/swift/{Variant_NullType_NotificationButtonLayout.swift → Variant_NullType_RemoteButtonLayout.swift} +3 -3
- package/nitrogen/generated/shared/c++/AndroidOptions.hpp +8 -8
- package/nitrogen/generated/shared/c++/NitroAndroidUpdateOptions.hpp +8 -8
- package/nitrogen/generated/shared/c++/{NotificationButton.hpp → RemoteButton.hpp} +19 -19
- package/nitrogen/generated/shared/c++/RemoteButtonLayout.hpp +94 -0
- package/package.json +1 -1
- package/src/features/player/options.ts +97 -37
- package/src/features/player/setup.test.ts +12 -4
- package/src/features/player/setup.ts +14 -7
- package/nitrogen/generated/android/c++/JNotificationButtonLayout.hpp +0 -94
- package/nitrogen/generated/android/c++/JVariant_NullType_NotificationButtonLayout.cpp +0 -26
- package/nitrogen/generated/android/c++/JVariant_NullType_NotificationButtonLayout.hpp +0 -75
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NotificationButtonLayout.kt +0 -50
- package/nitrogen/generated/ios/swift/NotificationButtonLayout.swift +0 -92
- package/nitrogen/generated/shared/c++/NotificationButtonLayout.hpp +0 -102
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JRemoteButton.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -8,30 +8,30 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "
|
|
11
|
+
#include "RemoteButton.hpp"
|
|
12
12
|
|
|
13
13
|
namespace margelo::nitro::audiobrowser {
|
|
14
14
|
|
|
15
15
|
using namespace facebook;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The C++ JNI bridge between the C++ enum "
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "RemoteButton" and the the Kotlin enum "RemoteButton".
|
|
19
19
|
*/
|
|
20
|
-
struct
|
|
20
|
+
struct JRemoteButton final: public jni::JavaClass<JRemoteButton> {
|
|
21
21
|
public:
|
|
22
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/audiobrowser/
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/audiobrowser/RemoteButton;";
|
|
23
23
|
|
|
24
24
|
public:
|
|
25
25
|
/**
|
|
26
|
-
* Convert this Java/Kotlin-based enum to the C++ enum
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum RemoteButton.
|
|
27
27
|
*/
|
|
28
28
|
[[maybe_unused]]
|
|
29
29
|
[[nodiscard]]
|
|
30
|
-
|
|
30
|
+
RemoteButton toCpp() const {
|
|
31
31
|
static const auto clazz = javaClassStatic();
|
|
32
32
|
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
33
|
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
-
return static_cast<
|
|
34
|
+
return static_cast<RemoteButton>(ordinal);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
public:
|
|
@@ -39,23 +39,23 @@ namespace margelo::nitro::audiobrowser {
|
|
|
39
39
|
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
40
|
*/
|
|
41
41
|
[[maybe_unused]]
|
|
42
|
-
static jni::alias_ref<
|
|
42
|
+
static jni::alias_ref<JRemoteButton> fromCpp(RemoteButton value) {
|
|
43
43
|
static const auto clazz = javaClassStatic();
|
|
44
44
|
switch (value) {
|
|
45
|
-
case
|
|
46
|
-
static const auto fieldSKIP_TO_PREVIOUS = clazz->getStaticField<
|
|
45
|
+
case RemoteButton::SKIP_TO_PREVIOUS:
|
|
46
|
+
static const auto fieldSKIP_TO_PREVIOUS = clazz->getStaticField<JRemoteButton>("SKIP_TO_PREVIOUS");
|
|
47
47
|
return clazz->getStaticFieldValue(fieldSKIP_TO_PREVIOUS);
|
|
48
|
-
case
|
|
49
|
-
static const auto fieldSKIP_TO_NEXT = clazz->getStaticField<
|
|
48
|
+
case RemoteButton::SKIP_TO_NEXT:
|
|
49
|
+
static const auto fieldSKIP_TO_NEXT = clazz->getStaticField<JRemoteButton>("SKIP_TO_NEXT");
|
|
50
50
|
return clazz->getStaticFieldValue(fieldSKIP_TO_NEXT);
|
|
51
|
-
case
|
|
52
|
-
static const auto fieldJUMP_BACKWARD = clazz->getStaticField<
|
|
51
|
+
case RemoteButton::JUMP_BACKWARD:
|
|
52
|
+
static const auto fieldJUMP_BACKWARD = clazz->getStaticField<JRemoteButton>("JUMP_BACKWARD");
|
|
53
53
|
return clazz->getStaticFieldValue(fieldJUMP_BACKWARD);
|
|
54
|
-
case
|
|
55
|
-
static const auto fieldJUMP_FORWARD = clazz->getStaticField<
|
|
54
|
+
case RemoteButton::JUMP_FORWARD:
|
|
55
|
+
static const auto fieldJUMP_FORWARD = clazz->getStaticField<JRemoteButton>("JUMP_FORWARD");
|
|
56
56
|
return clazz->getStaticFieldValue(fieldJUMP_FORWARD);
|
|
57
|
-
case
|
|
58
|
-
static const auto fieldFAVORITE = clazz->getStaticField<
|
|
57
|
+
case RemoteButton::FAVORITE:
|
|
58
|
+
static const auto fieldFAVORITE = clazz->getStaticField<JRemoteButton>("FAVORITE");
|
|
59
59
|
return clazz->getStaticFieldValue(fieldFAVORITE);
|
|
60
60
|
default:
|
|
61
61
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JRemoteButtonLayout.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "RemoteButtonLayout.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JRemoteButton.hpp"
|
|
14
|
+
#include "RemoteButton.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <vector>
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::audiobrowser {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "RemoteButtonLayout" and the the Kotlin data class "RemoteButtonLayout".
|
|
24
|
+
*/
|
|
25
|
+
struct JRemoteButtonLayout final: public jni::JavaClass<JRemoteButtonLayout> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/audiobrowser/RemoteButtonLayout;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Convert this Java/Kotlin-based struct to the C++ struct RemoteButtonLayout by copying all values to C++.
|
|
32
|
+
*/
|
|
33
|
+
[[maybe_unused]]
|
|
34
|
+
[[nodiscard]]
|
|
35
|
+
RemoteButtonLayout toCpp() const {
|
|
36
|
+
static const auto clazz = javaClassStatic();
|
|
37
|
+
static const auto fieldBack = clazz->getField<JRemoteButton>("back");
|
|
38
|
+
jni::local_ref<JRemoteButton> back = this->getFieldValue(fieldBack);
|
|
39
|
+
static const auto fieldForward = clazz->getField<JRemoteButton>("forward");
|
|
40
|
+
jni::local_ref<JRemoteButton> forward = this->getFieldValue(fieldForward);
|
|
41
|
+
static const auto fieldOverflow = clazz->getField<jni::JArrayClass<JRemoteButton>>("overflow");
|
|
42
|
+
jni::local_ref<jni::JArrayClass<JRemoteButton>> overflow = this->getFieldValue(fieldOverflow);
|
|
43
|
+
return RemoteButtonLayout(
|
|
44
|
+
back != nullptr ? std::make_optional(back->toCpp()) : std::nullopt,
|
|
45
|
+
forward != nullptr ? std::make_optional(forward->toCpp()) : std::nullopt,
|
|
46
|
+
[&]() {
|
|
47
|
+
size_t __size = overflow->size();
|
|
48
|
+
std::vector<RemoteButton> __vector;
|
|
49
|
+
__vector.reserve(__size);
|
|
50
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
51
|
+
auto __element = overflow->getElement(__i);
|
|
52
|
+
__vector.push_back(__element->toCpp());
|
|
53
|
+
}
|
|
54
|
+
return __vector;
|
|
55
|
+
}()
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
/**
|
|
61
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
62
|
+
*/
|
|
63
|
+
[[maybe_unused]]
|
|
64
|
+
static jni::local_ref<JRemoteButtonLayout::javaobject> fromCpp(const RemoteButtonLayout& value) {
|
|
65
|
+
using JSignature = JRemoteButtonLayout(jni::alias_ref<JRemoteButton>, jni::alias_ref<JRemoteButton>, jni::alias_ref<jni::JArrayClass<JRemoteButton>>);
|
|
66
|
+
static const auto clazz = javaClassStatic();
|
|
67
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
68
|
+
return create(
|
|
69
|
+
clazz,
|
|
70
|
+
value.back.has_value() ? JRemoteButton::fromCpp(value.back.value()) : nullptr,
|
|
71
|
+
value.forward.has_value() ? JRemoteButton::fromCpp(value.forward.value()) : nullptr,
|
|
72
|
+
[&]() {
|
|
73
|
+
size_t __size = value.overflow.size();
|
|
74
|
+
jni::local_ref<jni::JArrayClass<JRemoteButton>> __array = jni::JArrayClass<JRemoteButton>::newArray(__size);
|
|
75
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
76
|
+
const auto& __element = value.overflow[__i];
|
|
77
|
+
auto __elementJni = JRemoteButton::fromCpp(__element);
|
|
78
|
+
__array->setElement(__i, *__elementJni);
|
|
79
|
+
}
|
|
80
|
+
return __array;
|
|
81
|
+
}()
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
} // namespace margelo::nitro::audiobrowser
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_NullType_RemoteButtonLayout.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JVariant_NullType_RemoteButtonLayout.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::audiobrowser {
|
|
11
|
+
/**
|
|
12
|
+
* Converts JVariant_NullType_RemoteButtonLayout to std::variant<nitro::NullType, RemoteButtonLayout>
|
|
13
|
+
*/
|
|
14
|
+
std::variant<nitro::NullType, RemoteButtonLayout> JVariant_NullType_RemoteButtonLayout::toCpp() const {
|
|
15
|
+
if (isInstanceOf(JVariant_NullType_RemoteButtonLayout_impl::First::javaClassStatic())) {
|
|
16
|
+
// It's a `nitro::NullType`
|
|
17
|
+
auto jniValue = static_cast<const JVariant_NullType_RemoteButtonLayout_impl::First*>(this)->getValue();
|
|
18
|
+
return nitro::null;
|
|
19
|
+
} else if (isInstanceOf(JVariant_NullType_RemoteButtonLayout_impl::Second::javaClassStatic())) {
|
|
20
|
+
// It's a `RemoteButtonLayout`
|
|
21
|
+
auto jniValue = static_cast<const JVariant_NullType_RemoteButtonLayout_impl::Second*>(this)->getValue();
|
|
22
|
+
return jniValue->toCpp();
|
|
23
|
+
}
|
|
24
|
+
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
25
|
+
}
|
|
26
|
+
} // namespace margelo::nitro::audiobrowser
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_NullType_RemoteButtonLayout.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <variant>
|
|
12
|
+
|
|
13
|
+
#include <NitroModules/Null.hpp>
|
|
14
|
+
#include "RemoteButtonLayout.hpp"
|
|
15
|
+
#include <variant>
|
|
16
|
+
#include <NitroModules/JNull.hpp>
|
|
17
|
+
#include "JRemoteButtonLayout.hpp"
|
|
18
|
+
#include "RemoteButton.hpp"
|
|
19
|
+
#include <optional>
|
|
20
|
+
#include "JRemoteButton.hpp"
|
|
21
|
+
#include <vector>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::audiobrowser {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "Variant_NullType_RemoteButtonLayout".
|
|
29
|
+
*/
|
|
30
|
+
class JVariant_NullType_RemoteButtonLayout: public jni::JavaClass<JVariant_NullType_RemoteButtonLayout> {
|
|
31
|
+
public:
|
|
32
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/audiobrowser/Variant_NullType_RemoteButtonLayout;";
|
|
33
|
+
|
|
34
|
+
static jni::local_ref<JVariant_NullType_RemoteButtonLayout> create_0(jni::alias_ref<JNull> value) {
|
|
35
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_NullType_RemoteButtonLayout(jni::alias_ref<JNull>)>("create");
|
|
36
|
+
return method(javaClassStatic(), value);
|
|
37
|
+
}
|
|
38
|
+
static jni::local_ref<JVariant_NullType_RemoteButtonLayout> create_1(jni::alias_ref<JRemoteButtonLayout> value) {
|
|
39
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_NullType_RemoteButtonLayout(jni::alias_ref<JRemoteButtonLayout>)>("create");
|
|
40
|
+
return method(javaClassStatic(), value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static jni::local_ref<JVariant_NullType_RemoteButtonLayout> fromCpp(const std::variant<nitro::NullType, RemoteButtonLayout>& variant) {
|
|
44
|
+
switch (variant.index()) {
|
|
45
|
+
case 0: return create_0(JNull::null());
|
|
46
|
+
case 1: return create_1(JRemoteButtonLayout::fromCpp(std::get<1>(variant)));
|
|
47
|
+
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[[nodiscard]] std::variant<nitro::NullType, RemoteButtonLayout> toCpp() const;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
namespace JVariant_NullType_RemoteButtonLayout_impl {
|
|
55
|
+
class First final: public jni::JavaClass<First, JVariant_NullType_RemoteButtonLayout> {
|
|
56
|
+
public:
|
|
57
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/audiobrowser/Variant_NullType_RemoteButtonLayout$First;";
|
|
58
|
+
|
|
59
|
+
[[nodiscard]] jni::local_ref<JNull> getValue() const {
|
|
60
|
+
static const auto field = javaClassStatic()->getField<JNull>("value");
|
|
61
|
+
return getFieldValue(field);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
class Second final: public jni::JavaClass<Second, JVariant_NullType_RemoteButtonLayout> {
|
|
66
|
+
public:
|
|
67
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/audiobrowser/Variant_NullType_RemoteButtonLayout$Second;";
|
|
68
|
+
|
|
69
|
+
[[nodiscard]] jni::local_ref<JRemoteButtonLayout> getValue() const {
|
|
70
|
+
static const auto field = javaClassStatic()->getField<JRemoteButtonLayout>("value");
|
|
71
|
+
return getFieldValue(field);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
} // namespace JVariant_NullType_RemoteButtonLayout_impl
|
|
75
|
+
} // namespace margelo::nitro::audiobrowser
|
|
@@ -25,7 +25,7 @@ data class AndroidOptions(
|
|
|
25
25
|
val skipSilence: Boolean,
|
|
26
26
|
@DoNotStrip
|
|
27
27
|
@Keep
|
|
28
|
-
val
|
|
28
|
+
val remoteButtonLayout: Variant_NullType_RemoteButtonLayout?
|
|
29
29
|
) {
|
|
30
30
|
/* primary constructor */
|
|
31
31
|
|
|
@@ -37,8 +37,8 @@ data class AndroidOptions(
|
|
|
37
37
|
@Keep
|
|
38
38
|
@Suppress("unused")
|
|
39
39
|
@JvmStatic
|
|
40
|
-
private fun fromCpp(appKilledPlaybackBehavior: AppKilledPlaybackBehavior, skipSilence: Boolean,
|
|
41
|
-
return AndroidOptions(appKilledPlaybackBehavior, skipSilence,
|
|
40
|
+
private fun fromCpp(appKilledPlaybackBehavior: AppKilledPlaybackBehavior, skipSilence: Boolean, remoteButtonLayout: Variant_NullType_RemoteButtonLayout?): AndroidOptions {
|
|
41
|
+
return AndroidOptions(appKilledPlaybackBehavior, skipSilence, remoteButtonLayout)
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -25,7 +25,7 @@ data class NitroAndroidUpdateOptions(
|
|
|
25
25
|
val skipSilence: Boolean?,
|
|
26
26
|
@DoNotStrip
|
|
27
27
|
@Keep
|
|
28
|
-
val
|
|
28
|
+
val remoteButtonLayout: Variant_NullType_RemoteButtonLayout?
|
|
29
29
|
) {
|
|
30
30
|
/* primary constructor */
|
|
31
31
|
|
|
@@ -37,8 +37,8 @@ data class NitroAndroidUpdateOptions(
|
|
|
37
37
|
@Keep
|
|
38
38
|
@Suppress("unused")
|
|
39
39
|
@JvmStatic
|
|
40
|
-
private fun fromCpp(appKilledPlaybackBehavior: AppKilledPlaybackBehavior?, skipSilence: Boolean?,
|
|
41
|
-
return NitroAndroidUpdateOptions(appKilledPlaybackBehavior, skipSilence,
|
|
40
|
+
private fun fromCpp(appKilledPlaybackBehavior: AppKilledPlaybackBehavior?, skipSilence: Boolean?, remoteButtonLayout: Variant_NullType_RemoteButtonLayout?): NitroAndroidUpdateOptions {
|
|
41
|
+
return NitroAndroidUpdateOptions(appKilledPlaybackBehavior, skipSilence, remoteButtonLayout)
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// RemoteButton.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -11,11 +11,11 @@ import androidx.annotation.Keep
|
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Represents the JavaScript enum/union "
|
|
14
|
+
* Represents the JavaScript enum/union "RemoteButton".
|
|
15
15
|
*/
|
|
16
16
|
@DoNotStrip
|
|
17
17
|
@Keep
|
|
18
|
-
enum class
|
|
18
|
+
enum class RemoteButton(@DoNotStrip @Keep val value: Int) {
|
|
19
19
|
SKIP_TO_PREVIOUS(0),
|
|
20
20
|
SKIP_TO_NEXT(1),
|
|
21
21
|
JUMP_BACKWARD(2),
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/RemoteButtonLayout.kt
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RemoteButtonLayout.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.audiobrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "RemoteButtonLayout".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class RemoteButtonLayout(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val back: RemoteButton?,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val forward: RemoteButton?,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val overflow: Array<RemoteButton>
|
|
29
|
+
) {
|
|
30
|
+
/* primary constructor */
|
|
31
|
+
|
|
32
|
+
companion object {
|
|
33
|
+
/**
|
|
34
|
+
* Constructor called from C++
|
|
35
|
+
*/
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
@Suppress("unused")
|
|
39
|
+
@JvmStatic
|
|
40
|
+
private fun fromCpp(back: RemoteButton?, forward: RemoteButton?, overflow: Array<RemoteButton>): RemoteButtonLayout {
|
|
41
|
+
return RemoteButtonLayout(back, forward, overflow)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// Variant_NullType_RemoteButtonLayout.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -11,15 +11,15 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
11
11
|
import com.margelo.nitro.core.NullType
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Represents the TypeScript variant "NullType |
|
|
14
|
+
* Represents the TypeScript variant "NullType | RemoteButtonLayout".
|
|
15
15
|
*/
|
|
16
16
|
@Suppress("ClassName")
|
|
17
17
|
@DoNotStrip
|
|
18
|
-
sealed class
|
|
18
|
+
sealed class Variant_NullType_RemoteButtonLayout {
|
|
19
19
|
@DoNotStrip
|
|
20
|
-
data class First(@DoNotStrip val value: NullType):
|
|
20
|
+
data class First(@DoNotStrip val value: NullType): Variant_NullType_RemoteButtonLayout()
|
|
21
21
|
@DoNotStrip
|
|
22
|
-
data class Second(@DoNotStrip val value:
|
|
22
|
+
data class Second(@DoNotStrip val value: RemoteButtonLayout): Variant_NullType_RemoteButtonLayout()
|
|
23
23
|
|
|
24
24
|
val isFirst: Boolean
|
|
25
25
|
get() = this is First
|
|
@@ -30,12 +30,12 @@ sealed class Variant_NullType_NotificationButtonLayout {
|
|
|
30
30
|
val value = (this as? First)?.value ?: return null
|
|
31
31
|
return value
|
|
32
32
|
}
|
|
33
|
-
fun asSecondOrNull():
|
|
33
|
+
fun asSecondOrNull(): RemoteButtonLayout? {
|
|
34
34
|
val value = (this as? Second)?.value ?: return null
|
|
35
35
|
return value
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
inline fun <R> match(first: (NullType) -> R, second: (
|
|
38
|
+
inline fun <R> match(first: (NullType) -> R, second: (RemoteButtonLayout) -> R): R {
|
|
39
39
|
return when (this) {
|
|
40
40
|
is First -> first(value)
|
|
41
41
|
is Second -> second(value)
|
|
@@ -45,9 +45,9 @@ sealed class Variant_NullType_NotificationButtonLayout {
|
|
|
45
45
|
companion object {
|
|
46
46
|
@JvmStatic
|
|
47
47
|
@DoNotStrip
|
|
48
|
-
fun create(value: NullType):
|
|
48
|
+
fun create(value: NullType): Variant_NullType_RemoteButtonLayout = First(value)
|
|
49
49
|
@JvmStatic
|
|
50
50
|
@DoNotStrip
|
|
51
|
-
fun create(value:
|
|
51
|
+
fun create(value: RemoteButtonLayout): Variant_NullType_RemoteButtonLayout = Second(value)
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -108,10 +108,6 @@ namespace margelo::nitro::audiobrowser { struct NavigationError; }
|
|
|
108
108
|
namespace margelo::nitro::audiobrowser { struct NitroAndroidUpdateOptions; }
|
|
109
109
|
// Forward declaration of `NitroIOSUpdateOptions` to properly resolve imports.
|
|
110
110
|
namespace margelo::nitro::audiobrowser { struct NitroIOSUpdateOptions; }
|
|
111
|
-
// Forward declaration of `NotificationButtonLayout` to properly resolve imports.
|
|
112
|
-
namespace margelo::nitro::audiobrowser { struct NotificationButtonLayout; }
|
|
113
|
-
// Forward declaration of `NotificationButton` to properly resolve imports.
|
|
114
|
-
namespace margelo::nitro::audiobrowser { enum class NotificationButton; }
|
|
115
111
|
// Forward declaration of `NowPlayingMetadata` to properly resolve imports.
|
|
116
112
|
namespace margelo::nitro::audiobrowser { struct NowPlayingMetadata; }
|
|
117
113
|
// Forward declaration of `NowPlayingUpdate` to properly resolve imports.
|
|
@@ -146,6 +142,10 @@ namespace margelo::nitro::audiobrowser { struct PlayerCapabilities; }
|
|
|
146
142
|
namespace margelo::nitro::audiobrowser { struct PlayingState; }
|
|
147
143
|
// Forward declaration of `Progress` to properly resolve imports.
|
|
148
144
|
namespace margelo::nitro::audiobrowser { struct Progress; }
|
|
145
|
+
// Forward declaration of `RemoteButtonLayout` to properly resolve imports.
|
|
146
|
+
namespace margelo::nitro::audiobrowser { struct RemoteButtonLayout; }
|
|
147
|
+
// Forward declaration of `RemoteButton` to properly resolve imports.
|
|
148
|
+
namespace margelo::nitro::audiobrowser { enum class RemoteButton; }
|
|
149
149
|
// Forward declaration of `RemoteJumpBackwardEvent` to properly resolve imports.
|
|
150
150
|
namespace margelo::nitro::audiobrowser { struct RemoteJumpBackwardEvent; }
|
|
151
151
|
// Forward declaration of `RemoteJumpForwardEvent` to properly resolve imports.
|
|
@@ -248,8 +248,6 @@ namespace AudioBrowser { class HybridAudioBrowserSpec_cxx; }
|
|
|
248
248
|
#include "NavigationErrorType.hpp"
|
|
249
249
|
#include "NitroAndroidUpdateOptions.hpp"
|
|
250
250
|
#include "NitroIOSUpdateOptions.hpp"
|
|
251
|
-
#include "NotificationButton.hpp"
|
|
252
|
-
#include "NotificationButtonLayout.hpp"
|
|
253
251
|
#include "NowPlayingMetadata.hpp"
|
|
254
252
|
#include "NowPlayingUpdate.hpp"
|
|
255
253
|
#include "Options.hpp"
|
|
@@ -267,6 +265,8 @@ namespace AudioBrowser { class HybridAudioBrowserSpec_cxx; }
|
|
|
267
265
|
#include "PlayerCapabilities.hpp"
|
|
268
266
|
#include "PlayingState.hpp"
|
|
269
267
|
#include "Progress.hpp"
|
|
268
|
+
#include "RemoteButton.hpp"
|
|
269
|
+
#include "RemoteButtonLayout.hpp"
|
|
270
270
|
#include "RemoteJumpBackwardEvent.hpp"
|
|
271
271
|
#include "RemoteJumpForwardEvent.hpp"
|
|
272
272
|
#include "RemotePlayIdEvent.hpp"
|
|
@@ -2182,31 +2182,31 @@ namespace margelo::nitro::audiobrowser::bridge::swift {
|
|
|
2182
2182
|
return optional.value();
|
|
2183
2183
|
}
|
|
2184
2184
|
|
|
2185
|
-
// pragma MARK: std::optional<std::variant<nitro::NullType,
|
|
2185
|
+
// pragma MARK: std::optional<std::variant<nitro::NullType, RemoteButtonLayout>>
|
|
2186
2186
|
/**
|
|
2187
|
-
* Specialized version of `std::optional<std::variant<nitro::NullType,
|
|
2187
|
+
* Specialized version of `std::optional<std::variant<nitro::NullType, RemoteButtonLayout>>`.
|
|
2188
2188
|
*/
|
|
2189
|
-
using
|
|
2190
|
-
inline std::optional<std::variant<nitro::NullType,
|
|
2191
|
-
return std::optional<std::variant<nitro::NullType,
|
|
2189
|
+
using std__optional_std__variant_nitro__NullType__RemoteButtonLayout__ = std::optional<std::variant<nitro::NullType, RemoteButtonLayout>>;
|
|
2190
|
+
inline std::optional<std::variant<nitro::NullType, RemoteButtonLayout>> create_std__optional_std__variant_nitro__NullType__RemoteButtonLayout__(const std::variant<nitro::NullType, RemoteButtonLayout>& value) noexcept {
|
|
2191
|
+
return std::optional<std::variant<nitro::NullType, RemoteButtonLayout>>(value);
|
|
2192
2192
|
}
|
|
2193
|
-
inline bool
|
|
2193
|
+
inline bool has_value_std__optional_std__variant_nitro__NullType__RemoteButtonLayout__(const std::optional<std::variant<nitro::NullType, RemoteButtonLayout>>& optional) noexcept {
|
|
2194
2194
|
return optional.has_value();
|
|
2195
2195
|
}
|
|
2196
|
-
inline std::variant<nitro::NullType,
|
|
2196
|
+
inline std::variant<nitro::NullType, RemoteButtonLayout> get_std__optional_std__variant_nitro__NullType__RemoteButtonLayout__(const std::optional<std::variant<nitro::NullType, RemoteButtonLayout>>& optional) noexcept {
|
|
2197
2197
|
return optional.value();
|
|
2198
2198
|
}
|
|
2199
2199
|
|
|
2200
|
-
// pragma MARK: std::variant<nitro::NullType,
|
|
2200
|
+
// pragma MARK: std::variant<nitro::NullType, RemoteButtonLayout>
|
|
2201
2201
|
/**
|
|
2202
|
-
* Wrapper struct for `std::variant<nitro::NullType,
|
|
2202
|
+
* Wrapper struct for `std::variant<nitro::NullType, RemoteButtonLayout>`.
|
|
2203
2203
|
* std::variant cannot be used in Swift because of a Swift bug.
|
|
2204
2204
|
* Not even specializing it works. So we create a wrapper struct.
|
|
2205
2205
|
*/
|
|
2206
|
-
struct
|
|
2207
|
-
std::variant<nitro::NullType,
|
|
2208
|
-
|
|
2209
|
-
operator std::variant<nitro::NullType,
|
|
2206
|
+
struct std__variant_nitro__NullType__RemoteButtonLayout_ final {
|
|
2207
|
+
std::variant<nitro::NullType, RemoteButtonLayout> variant;
|
|
2208
|
+
std__variant_nitro__NullType__RemoteButtonLayout_(std::variant<nitro::NullType, RemoteButtonLayout> variant): variant(variant) { }
|
|
2209
|
+
operator std::variant<nitro::NullType, RemoteButtonLayout>() const noexcept {
|
|
2210
2210
|
return variant;
|
|
2211
2211
|
}
|
|
2212
2212
|
inline size_t index() const noexcept {
|
|
@@ -2215,54 +2215,39 @@ namespace margelo::nitro::audiobrowser::bridge::swift {
|
|
|
2215
2215
|
inline nitro::NullType get_0() const noexcept {
|
|
2216
2216
|
return std::get<0>(variant);
|
|
2217
2217
|
}
|
|
2218
|
-
inline
|
|
2218
|
+
inline RemoteButtonLayout get_1() const noexcept {
|
|
2219
2219
|
return std::get<1>(variant);
|
|
2220
2220
|
}
|
|
2221
2221
|
};
|
|
2222
|
-
inline
|
|
2223
|
-
return
|
|
2222
|
+
inline std__variant_nitro__NullType__RemoteButtonLayout_ create_std__variant_nitro__NullType__RemoteButtonLayout_(nitro::NullType value) noexcept {
|
|
2223
|
+
return std__variant_nitro__NullType__RemoteButtonLayout_(value);
|
|
2224
2224
|
}
|
|
2225
|
-
inline
|
|
2226
|
-
return
|
|
2225
|
+
inline std__variant_nitro__NullType__RemoteButtonLayout_ create_std__variant_nitro__NullType__RemoteButtonLayout_(const RemoteButtonLayout& value) noexcept {
|
|
2226
|
+
return std__variant_nitro__NullType__RemoteButtonLayout_(value);
|
|
2227
2227
|
}
|
|
2228
2228
|
|
|
2229
|
-
// pragma MARK: std::optional<
|
|
2229
|
+
// pragma MARK: std::optional<RemoteButton>
|
|
2230
2230
|
/**
|
|
2231
|
-
* Specialized version of `std::optional<
|
|
2231
|
+
* Specialized version of `std::optional<RemoteButton>`.
|
|
2232
2232
|
*/
|
|
2233
|
-
using
|
|
2234
|
-
inline std::optional<
|
|
2235
|
-
return std::optional<
|
|
2233
|
+
using std__optional_RemoteButton_ = std::optional<RemoteButton>;
|
|
2234
|
+
inline std::optional<RemoteButton> create_std__optional_RemoteButton_(const RemoteButton& value) noexcept {
|
|
2235
|
+
return std::optional<RemoteButton>(value);
|
|
2236
2236
|
}
|
|
2237
|
-
inline bool
|
|
2237
|
+
inline bool has_value_std__optional_RemoteButton_(const std::optional<RemoteButton>& optional) noexcept {
|
|
2238
2238
|
return optional.has_value();
|
|
2239
2239
|
}
|
|
2240
|
-
inline
|
|
2240
|
+
inline RemoteButton get_std__optional_RemoteButton_(const std::optional<RemoteButton>& optional) noexcept {
|
|
2241
2241
|
return optional.value();
|
|
2242
2242
|
}
|
|
2243
2243
|
|
|
2244
|
-
// pragma MARK: std::
|
|
2244
|
+
// pragma MARK: std::vector<RemoteButton>
|
|
2245
2245
|
/**
|
|
2246
|
-
* Specialized version of `std::
|
|
2246
|
+
* Specialized version of `std::vector<RemoteButton>`.
|
|
2247
2247
|
*/
|
|
2248
|
-
using
|
|
2249
|
-
inline std::
|
|
2250
|
-
|
|
2251
|
-
}
|
|
2252
|
-
inline bool has_value_std__optional_std__vector_NotificationButton__(const std::optional<std::vector<NotificationButton>>& optional) noexcept {
|
|
2253
|
-
return optional.has_value();
|
|
2254
|
-
}
|
|
2255
|
-
inline std::vector<NotificationButton> get_std__optional_std__vector_NotificationButton__(const std::optional<std::vector<NotificationButton>>& optional) noexcept {
|
|
2256
|
-
return optional.value();
|
|
2257
|
-
}
|
|
2258
|
-
|
|
2259
|
-
// pragma MARK: std::vector<NotificationButton>
|
|
2260
|
-
/**
|
|
2261
|
-
* Specialized version of `std::vector<NotificationButton>`.
|
|
2262
|
-
*/
|
|
2263
|
-
using std__vector_NotificationButton_ = std::vector<NotificationButton>;
|
|
2264
|
-
inline std::vector<NotificationButton> create_std__vector_NotificationButton_(size_t size) noexcept {
|
|
2265
|
-
std::vector<NotificationButton> vector;
|
|
2248
|
+
using std__vector_RemoteButton_ = std::vector<RemoteButton>;
|
|
2249
|
+
inline std::vector<RemoteButton> create_std__vector_RemoteButton_(size_t size) noexcept {
|
|
2250
|
+
std::vector<RemoteButton> vector;
|
|
2266
2251
|
vector.reserve(size);
|
|
2267
2252
|
return vector;
|
|
2268
2253
|
}
|
|
@@ -112,10 +112,6 @@ namespace margelo::nitro::audiobrowser { struct NavigationError; }
|
|
|
112
112
|
namespace margelo::nitro::audiobrowser { struct NitroAndroidUpdateOptions; }
|
|
113
113
|
// Forward declaration of `NitroIOSUpdateOptions` to properly resolve imports.
|
|
114
114
|
namespace margelo::nitro::audiobrowser { struct NitroIOSUpdateOptions; }
|
|
115
|
-
// Forward declaration of `NotificationButtonLayout` to properly resolve imports.
|
|
116
|
-
namespace margelo::nitro::audiobrowser { struct NotificationButtonLayout; }
|
|
117
|
-
// Forward declaration of `NotificationButton` to properly resolve imports.
|
|
118
|
-
namespace margelo::nitro::audiobrowser { enum class NotificationButton; }
|
|
119
115
|
// Forward declaration of `NowPlayingMetadata` to properly resolve imports.
|
|
120
116
|
namespace margelo::nitro::audiobrowser { struct NowPlayingMetadata; }
|
|
121
117
|
// Forward declaration of `NowPlayingUpdate` to properly resolve imports.
|
|
@@ -150,6 +146,10 @@ namespace margelo::nitro::audiobrowser { struct PlayerCapabilities; }
|
|
|
150
146
|
namespace margelo::nitro::audiobrowser { struct PlayingState; }
|
|
151
147
|
// Forward declaration of `Progress` to properly resolve imports.
|
|
152
148
|
namespace margelo::nitro::audiobrowser { struct Progress; }
|
|
149
|
+
// Forward declaration of `RemoteButtonLayout` to properly resolve imports.
|
|
150
|
+
namespace margelo::nitro::audiobrowser { struct RemoteButtonLayout; }
|
|
151
|
+
// Forward declaration of `RemoteButton` to properly resolve imports.
|
|
152
|
+
namespace margelo::nitro::audiobrowser { enum class RemoteButton; }
|
|
153
153
|
// Forward declaration of `RemoteJumpBackwardEvent` to properly resolve imports.
|
|
154
154
|
namespace margelo::nitro::audiobrowser { struct RemoteJumpBackwardEvent; }
|
|
155
155
|
// Forward declaration of `RemoteJumpForwardEvent` to properly resolve imports.
|
|
@@ -250,8 +250,6 @@ namespace margelo::nitro::audiobrowser { struct TransformableRequestConfig; }
|
|
|
250
250
|
#include "NavigationErrorType.hpp"
|
|
251
251
|
#include "NitroAndroidUpdateOptions.hpp"
|
|
252
252
|
#include "NitroIOSUpdateOptions.hpp"
|
|
253
|
-
#include "NotificationButton.hpp"
|
|
254
|
-
#include "NotificationButtonLayout.hpp"
|
|
255
253
|
#include "NowPlayingMetadata.hpp"
|
|
256
254
|
#include "NowPlayingUpdate.hpp"
|
|
257
255
|
#include "Options.hpp"
|
|
@@ -269,6 +267,8 @@ namespace margelo::nitro::audiobrowser { struct TransformableRequestConfig; }
|
|
|
269
267
|
#include "PlayerCapabilities.hpp"
|
|
270
268
|
#include "PlayingState.hpp"
|
|
271
269
|
#include "Progress.hpp"
|
|
270
|
+
#include "RemoteButton.hpp"
|
|
271
|
+
#include "RemoteButtonLayout.hpp"
|
|
272
272
|
#include "RemoteJumpBackwardEvent.hpp"
|
|
273
273
|
#include "RemoteJumpForwardEvent.hpp"
|
|
274
274
|
#include "RemotePlayIdEvent.hpp"
|