Skip to content

Commit

Permalink
minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
truj committed Aug 24, 2023
1 parent c78232f commit c8a9f8e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file modified midica.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions src/org/midica/Midica.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public class Midica {
* After switching to a new major version, this has to be set to "-1" manually, so that
* precommit.pl starts with "0" again.
*/
private static final int VERSION_MINOR = 6;
private static final int VERSION_MINOR = 7;

/** UNIX timestamp of the last commit */
public static final int COMMIT_TIME = 1691601094;
public static final int COMMIT_TIME = 1692861685;

/** Branch name. Automatically changed by precommit.pl */
public static final String BRANCH = "osx";
public static final String BRANCH = "master";

/** Full version string. */
public static final String VERSION = VERSION_MAJOR + "." + VERSION_MIDDLE + "." + VERSION_MINOR + ("master".equals(BRANCH) ? "" : "-" + BRANCH);
Expand Down
10 changes: 9 additions & 1 deletion src/org/midica/file/write/MidicaPLExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ private void createMetaBlock() {
HashMap<String, String> metaInfo = (HashMap<String, String>) sequenceInfo.get("meta_info");
HashMap<String, Object> karaokeInfo = KaraokeAnalyzer.getKaraokeInfo();
String copyright = (String) metaInfo.get("copyright");
if (copyright != null)
copyright = copyright.replace("\n", "\\n").replace("\r", "\\r"); // TODO: support multiple lines in MidicaPL
String[] fields = {"copyright", "title", "composer", "lyricist", "artist"};
String[] values = new String[5];
String[] mplIds = {
Expand Down Expand Up @@ -286,8 +288,14 @@ private String createSoftKaraokeBlock(HashMap<String, Object> karaokeInfo) {

// read value
String value = (String) karaokeInfo.get(fields[i]);
if (null == value)
if (null == value) {
continue;
}
else {
// Escaping \r and \n not allowed in soft karaoke.
// But newlines must be thrown out anyway.
value = value.replace("\n", " ").replace("\r", " ");
}

// append the line
block.append("\t\t" + String.format("%-12s", mplIds[i]) + " " + value + NEW_LINE);
Expand Down

0 comments on commit c8a9f8e

Please sign in to comment.