use of org.fagu.fmv.core.project.FileSource in project fmv by f-agu.
the class View method run.
/**
* @see org.fagu.fmv.cli.Command#run(java.lang.String[])
*/
@Override
public void run(String[] args) {
int num = 0;
FileSource source = null;
if (args.length == 0) {
Integer lastView = project.getProperty(Properties.VIEW_LAST_MEDIA);
if (lastView == null) {
getPrinter().println("Last view undefined");
return;
}
source = project.getSource(lastView);
getPrinter().println("Last view n°" + lastView + ": " + source.getFile().getName());
num = lastView.intValue();
} else if (args.length > 1) {
println(getSyntax());
return;
} else {
num = NumberUtils.toInt(args[0], -1);
source = project.getSource(num);
if (source == null) {
println("Media number not found: " + num);
return;
}
}
open(source);
project.setProperty(Properties.VIEW_LAST_MEDIA, num);
}
Aggregations