wip: Add prev/next

This commit is contained in:
2026-05-10 16:57:28 +02:00
parent 1e3734aeb5
commit 1e4a6e3787
14 changed files with 467 additions and 125 deletions
@@ -0,0 +1,50 @@
///
/// BaseSource.kt
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///
package com.margelo.nitro.omni
import androidx.annotation.Keep
import com.facebook.proguard.annotations.DoNotStrip
/**
* Represents the JavaScript object/struct "BaseSource".
*/
@DoNotStrip
@Keep
data class BaseSource(
@DoNotStrip
@Keep
val src: Array<VideoSrc>,
@DoNotStrip
@Keep
val startTime: Double?,
@DoNotStrip
@Keep
val subtitles: Array<Subtitle>,
@DoNotStrip
@Keep
val metadata: Metadata?,
@DoNotStrip
@Keep
val mixAudio: MixAudioMode?
) {
/* primary constructor */
companion object {
/**
* Constructor called from C++
*/
@DoNotStrip
@Keep
@Suppress("unused")
@JvmStatic
private fun fromCpp(src: Array<VideoSrc>, startTime: Double?, subtitles: Array<Subtitle>, metadata: Metadata?, mixAudio: MixAudioMode?): BaseSource {
return BaseSource(src, startTime, subtitles, metadata, mixAudio)
}
}
}
@@ -28,13 +28,7 @@ data class Metadata(
val artist: String?,
@DoNotStrip
@Keep
val imageLink: String?,
@DoNotStrip
@Keep
val hasPrev: Boolean?,
@DoNotStrip
@Keep
val hasNext: Boolean?
val imageLink: String?
) {
/* primary constructor */
@@ -46,8 +40,8 @@ data class Metadata(
@Keep
@Suppress("unused")
@JvmStatic
private fun fromCpp(title: String, album: String?, artist: String?, imageLink: String?, hasPrev: Boolean?, hasNext: Boolean?): Metadata {
return Metadata(title, album, artist, imageLink, hasPrev, hasNext)
private fun fromCpp(title: String, album: String?, artist: String?, imageLink: String?): Metadata {
return Metadata(title, album, artist, imageLink)
}
}
}
@@ -17,6 +17,12 @@ import com.facebook.proguard.annotations.DoNotStrip
@DoNotStrip
@Keep
data class Source(
@DoNotStrip
@Keep
val prev: BaseSource?,
@DoNotStrip
@Keep
val next: BaseSource?,
@DoNotStrip
@Keep
val src: Array<VideoSrc>,
@@ -43,8 +49,8 @@ data class Source(
@Keep
@Suppress("unused")
@JvmStatic
private fun fromCpp(src: Array<VideoSrc>, startTime: Double?, subtitles: Array<Subtitle>, metadata: Metadata?, mixAudio: MixAudioMode?): Source {
return Source(src, startTime, subtitles, metadata, mixAudio)
private fun fromCpp(prev: BaseSource?, next: BaseSource?, src: Array<VideoSrc>, startTime: Double?, subtitles: Array<Subtitle>, metadata: Metadata?, mixAudio: MixAudioMode?): Source {
return Source(prev, next, src, startTime, subtitles, metadata, mixAudio)
}
}
}