Skip to content

Commit

Permalink
Merge pull request #156 from sdercolin/hotfix/support-ustx-trackname
Browse files Browse the repository at this point in the history
Add support for track name in USTX
  • Loading branch information
sdercolin authored Jan 2, 2024
2 parents 7b188f4 + 4b9c62c commit 6c10612
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/jsMain/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ui.strings.Language
import ui.strings.initializeI18n

const val APP_NAME = "UtaFormatix"
const val APP_VERSION = "3.20.1"
const val APP_VERSION = "3.20.2"

suspend fun main() {
initializeI18n(Language.English)
Expand Down
5 changes: 3 additions & 2 deletions src/jsMain/kotlin/io/Ustx.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object Ustx {
val trackMap = List(project.tracks.size) { index: Int ->
model.Track(
id = index,
name = "Track ${index + 1}",
name = project.tracks[index].trackName ?: "Track ${index + 1}",
notes = listOf(),
)
}.associateBy { it.id }.toMutableMap()
Expand Down Expand Up @@ -193,7 +193,7 @@ object Ustx {
val template = jsonSerializer.decodeFromString(Project.serializer(), templateJsonText)
val trackTemplate = template.tracks.first()
val tracks = project.tracks.map {
trackTemplate.copy()
trackTemplate.copy(trackName = it.name)
}
val voicePartTemplate = template.voiceParts.first()
val voiceParts = project.tracks.map {
Expand Down Expand Up @@ -317,6 +317,7 @@ object Ustx {
val mute: Boolean = false,
val solo: Boolean = false,
val volume: Double = 0.0,
@SerialName("track_name") val trackName: String? = null,
)

@Serializable
Expand Down

0 comments on commit 6c10612

Please sign in to comment.