refactor: centralize domain models into core.model module
This commit is contained in:
-9
@@ -1,9 +0,0 @@
|
||||
package fr.ajaury.gwenedeg.player.model
|
||||
|
||||
data class PlaybackTiming(
|
||||
val positionMs: Long = 0L,
|
||||
val durationMs: Long = 0L,
|
||||
) {
|
||||
val progress: Float
|
||||
get() = if (durationMs > 0) (positionMs.toFloat() / durationMs).coerceIn(0f, 1f) else 0f
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
alias(libs.plugins.androidMultiplatformLibrary)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
|
||||
jvm()
|
||||
|
||||
js {
|
||||
browser()
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalWasmDsl::class)
|
||||
wasmJs {
|
||||
browser()
|
||||
}
|
||||
|
||||
androidLibrary {
|
||||
namespace = "fr.ajaury.gwenedeg.core.model"
|
||||
compileSdk =
|
||||
libs.versions.androidCompileSdk
|
||||
.get()
|
||||
.toInt()
|
||||
minSdk =
|
||||
libs.versions.androidMinSdk
|
||||
.get()
|
||||
.toInt()
|
||||
|
||||
compilerOptions {
|
||||
jvmTarget = JvmTarget.JVM_11
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonTest.dependencies {
|
||||
implementation(libs.kotlin.test)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package fr.ajaury.gwenedeg.core.model
|
||||
|
||||
/**
|
||||
* [translation] is the optional translation of [transcription] in the user's language
|
||||
* (e.g. French), shown alongside the original.
|
||||
*/
|
||||
data class Phrase(
|
||||
val transcription: String,
|
||||
val translation: String? = null,
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
package fr.ajaury.gwenedeg.core.model
|
||||
|
||||
data class Record(
|
||||
val id: Int,
|
||||
val index: Int,
|
||||
val title: String,
|
||||
val titleTranslation: String? = null,
|
||||
val audioResourcePath: String,
|
||||
val subtitleResourcePath: String,
|
||||
val translationSubtitleResourcePath: String? = null,
|
||||
)
|
||||
Reference in New Issue
Block a user