Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BGAprocessor: Change priority of movie files #190

Merged
merged 1 commit into from
Feb 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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