Skip to content

Commit

Permalink
Merge pull request #190 from LNTakeshi/dev
Browse files Browse the repository at this point in the history
 BGAprocessor: Change priority of movie files
  • Loading branch information
exch-bms2 committed Feb 24, 2018
2 parents 2f2fce9 + 9b3eb9a commit b3924c9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/bms/player/beatoraja/play/bga/BGAProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static bms.player.beatoraja.skin.SkinProperty.TIMER_PLAY;

import java.nio.file.*;
import java.util.Arrays;
import java.util.logging.Logger;

import bms.model.BMSModel;
Expand Down Expand Up @@ -59,7 +60,7 @@ protected void dispose(MovieProcessor resource) {

};

public static final String[] mov_extension = { "mpg", "mpeg", "m1v", "m2v", "m4v", "avi", "wmv", "mp4" };
public static final String[] mov_extension = { "mp4", "wmv", "m4v", "webm", "mpg", "mpeg", "m1v", "m2v", "avi"};

/**
* BGAイメージのキャッシュ枚数
Expand Down Expand Up @@ -135,7 +136,23 @@ public synchronized void setModel(BMSModel model) {
}
Path f = null;
if (Files.exists(dpath.resolve(name))) {
final int index = name.lastIndexOf('.');
String fex = null;
if (index != -1) {
fex = name.substring(index + 1).toLowerCase();
}
if(fex != null && !(Arrays.asList(mov_extension).contains(fex))){
f = dpath.resolve(name);
}else if(fex != null){
name = name.substring(0, index);
for (String mov : mov_extension) {
final Path mpgfile = dpath.resolve(name + "." + mov);
if (Files.exists(mpgfile)) {
f = mpgfile;
break;
}
}
}
}
if (f == null) {
final int index = name.lastIndexOf('.');
Expand Down

0 comments on commit b3924c9

Please sign in to comment.