try to call flash functions

This commit is contained in:
Jindra Petk
2013-09-13 07:07:21 +02:00
parent 5e2bac3959
commit 892b2ff278
3 changed files with 35 additions and 9 deletions

View File

@@ -49,8 +49,35 @@ public class FlashPlayerPanel extends Panel implements FlashDisplay {
private static final int CMD_PLAYING = 8;
private static final int CMD_REWIND = 9;
private static final int CMD_GOTO = 10;
private static final int CMD_CALL = 11;
private int frameRate;
public boolean functionPlayback = false;
public synchronized String call(String callString){
if (pipe != null) {
IntByReference ibr = new IntByReference();
Kernel32.INSTANCE.WriteFile(pipe, new byte[]{CMD_CALL}, 1, ibr, null);
int callLen=callString.getBytes().length;
Kernel32.INSTANCE.WriteFile(pipe, new byte[]{(byte)((callLen>>8) &0xff),(byte)(callLen & 0xff)}, 2, ibr, null);
Kernel32.INSTANCE.WriteFile(pipe, callString.getBytes(), callLen, ibr, null);
byte res[] = new byte[2];
if (Kernel32.INSTANCE.ReadFile(pipe, res, 2, ibr, null)) {
int retLen = ((res[0] & 0xff) << 8) + (res[1] & 0xff);
res = new byte[retLen];
if (Kernel32.INSTANCE.ReadFile(pipe, res, retLen, ibr, null)) {
String ret=new String(res,0,retLen);
return ret;
}else{
return null;
}
} else {
return null;
}
}
return null;
}
private synchronized void resize() {
if (pipe != null) {
IntByReference ibr = new IntByReference();