Small library to allow old files be supported properly

This commit is contained in:
Victor Shcherb 2011-08-21 00:00:21 +02:00
parent ec55e071ca
commit 1da889a813
2 changed files with 11 additions and 3 deletions

View file

@ -55,9 +55,7 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer {
long time = System.currentTimeMillis();
try {
this.ctx = ctx;
prologSystem = new Prolog(
new String[] { "alice.tuprolog.lib.BasicLibrary",
"alice.tuprolog.lib.ISOLibrary"}); //$NON-NLS-1$
prologSystem = new Prolog(getLibraries());
} catch (InvalidLibraryException e) {
log.error("Initializing error", e); //$NON-NLS-1$
throw new RuntimeException(e);
@ -67,6 +65,11 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer {
}
init(voiceProvider, configFile);
}
public String[] getLibraries(){
return new String[] { "alice.tuprolog.lib.BasicLibrary",
"alice.tuprolog.lib.ISOLibrary"};
}
private void init(String voiceProvider, String configFile) throws CommandPlayerException {
prologSystem.clearTheory();

View file

@ -45,6 +45,11 @@ public class MediaCommandPlayerImpl extends AbstractPrologCommandPlayer {
mediaPlayer = null;
}
@Override
public String[] getLibraries() {
return new String[] { "alice.tuprolog.lib.BasicLibrary"};
}
@Override
public void playCommands(CommandBuilder builder){
filesToPlay.addAll(builder.execute());