Anders429 / simfile

Apache License 2.0
0 stars 0 forks source link

Subtitle Assumption #34

Closed Anders429 closed 2 years ago

Anders429 commented 2 years ago

For dwi and msd formats, subtitles can be assumed from #TITLE tags. SM5 does this using their own form of detection, using a set of delimiters that begin with spaces (see the source). However, it looks like including the spaces is surprising to people (see this issue). It would be better to match without including the spaces.

The matching should be on \t, -, ~, (, and [, in that order, to match the order which SM5 prefers. \t should be removed when splitting, but every other character should be included with the substring.

When splitting, the character split on should be preserved (e.g. if we split on a \t that should be included in the struct) to ensure that the same #TITLE tag can be reconstructed when writing back to a dwi or msd file. This delimiter could be provided as well on Song construction to specify how the joining should be done when constructed from other formats. This way, simfiles with subtitles could be written to dwi format with the subtitle provided as part of the title.

Anders429 commented 2 years ago

Alternatively, this could be omitted from this entirely, leaving it up to consumers of the output to parse out the title and subtitle in whatever way they decide to. However, this would mean subtitles are completely lost when converting between formats.