Skip to content

Commit

Permalink
Export tssln to JS (#175)
Browse files Browse the repository at this point in the history
* Add: Export tssln

* Change: Use val
  • Loading branch information
sevenc-nanashi authored Jun 27, 2024
1 parent c6cd4aa commit f2310a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/main/kotlin/Library.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ fun parseStandardMid(file: File, params: ImportParams): Promise<ProjectContainer
@JsExport
fun parsePpsf(file: File, params: ImportParams): Promise<ProjectContainer> = parse(listOf(file), params, Format.Ppsf)

@JsExport
fun parseTssln(file: File, params: ImportParams): Promise<ProjectContainer> = parse(listOf(file), params, Format.Tssln)

@JsExport
fun parseUfData(file: File, params: ImportParams): Promise<ProjectContainer> =
parse(listOf(file), params, Format.UfData)
Expand Down Expand Up @@ -123,12 +126,16 @@ fun generateVocaloidMid(project: ProjectContainer, params: ConversionParams): Pr
fun generateStandardMid(project: ProjectContainer, params: ConversionParams): Promise<ExportResult> =
generate(project, params, Format.StandardMid)

@JsExport
fun generateTssln(project: ProjectContainer, params: ConversionParams): Promise<ExportResult> =
generate(project, params, Format.Tssln)

@JsExport
fun generateUfData(project: ProjectContainer, params: ConversionParams): Promise<ExportResult> =
generate(project, params, Format.UfData)

private fun generate(project: ProjectContainer, params: ConversionParams, format: Format): Promise<ExportResult> {
var features = mutableListOf<FeatureConfig>()
val features = mutableListOf<FeatureConfig>()
if (params.convertPitch) {
features.add(FeatureConfig.ConvertPitch)
}
Expand Down

0 comments on commit f2310a9

Please sign in to comment.