From f2310a9125d1212d8500cb5a043c04110f281cb7 Mon Sep 17 00:00:00 2001 From: Nanashi Date: Thu, 27 Jun 2024 19:48:20 +0900 Subject: [PATCH] Export tssln to JS (#175) * Add: Export tssln * Change: Use val --- core/src/main/kotlin/Library.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/kotlin/Library.kt b/core/src/main/kotlin/Library.kt index 25c76ae..15de2ae 100644 --- a/core/src/main/kotlin/Library.kt +++ b/core/src/main/kotlin/Library.kt @@ -65,6 +65,9 @@ fun parseStandardMid(file: File, params: ImportParams): Promise = parse(listOf(file), params, Format.Ppsf) +@JsExport +fun parseTssln(file: File, params: ImportParams): Promise = parse(listOf(file), params, Format.Tssln) + @JsExport fun parseUfData(file: File, params: ImportParams): Promise = parse(listOf(file), params, Format.UfData) @@ -123,12 +126,16 @@ fun generateVocaloidMid(project: ProjectContainer, params: ConversionParams): Pr fun generateStandardMid(project: ProjectContainer, params: ConversionParams): Promise = generate(project, params, Format.StandardMid) +@JsExport +fun generateTssln(project: ProjectContainer, params: ConversionParams): Promise = + generate(project, params, Format.Tssln) + @JsExport fun generateUfData(project: ProjectContainer, params: ConversionParams): Promise = generate(project, params, Format.UfData) private fun generate(project: ProjectContainer, params: ConversionParams, format: Format): Promise { - var features = mutableListOf() + val features = mutableListOf() if (params.convertPitch) { features.add(FeatureConfig.ConvertPitch) }