Rumblepad geimplementeerd, actions toegevoegd en begin gemaakt met iTunes implementatie. Die geeft rare Jacob foutmeldingen over de versie.

This commit is contained in:
Bram Veenboer
2011-02-08 21:01:37 +00:00
parent e9c0216ad9
commit 0fb1a1fb71
6 changed files with 191 additions and 3 deletions

View File

@@ -0,0 +1,50 @@
package pm.application.iTunes;
import pm.application.Application;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
public class iTunes extends Application{
Dispatch iTunesController;
public iTunes() {
connect();
}
protected void connect() {
try {
ComThread.InitMTA(true);
ActiveXComponent iTunesCom = new ActiveXComponent("iTunes.Application");
iTunesController = (Dispatch)iTunesCom.getObject();
} catch (Exception e) { } // Ignore JacobVersion exception
}
public void play() {
System.out.println("play");
invoke("play");
}
public void pause() {
invoke("pause");
}
public void resume() {
invoke("resume");
}
public void exit() {
ComThread.Release();
}
protected void invoke(String invocation) {
Dispatch.call(iTunesController, invocation);
}
public static void main(String argv[]) throws Exception {
new iTunes();
}
}