Begonnen aan nieuwe implementatie van Winamp mbv windows command line device.
This commit is contained in:
@@ -12,7 +12,7 @@ import pm.application.example.ExampleApplication;
|
||||
import pm.application.itunes.iTunesApplication;
|
||||
import pm.application.mpc.MPCApplication;
|
||||
import pm.application.vlc.VLCApplication;
|
||||
import pm.application.winamp.WinampApplication;
|
||||
import pm.application.windows.winamp.WinampApplication;
|
||||
import pm.device.gui.GUIDevice;
|
||||
import pm.device.javainput.extreme3d.Extreme3DDevice;
|
||||
import pm.device.javainput.rumblepad.RumblepadDevice;
|
||||
@@ -54,19 +54,19 @@ public class Main extends EventListener {
|
||||
public void initialise() throws DeviceInitialiseException {
|
||||
add(new JIntellitypeDevice());
|
||||
//add(new PlayerDevice());
|
||||
add(new RumblepadDevice());
|
||||
//add(new WiimoteDevice());
|
||||
//add(new RumblepadDevice());
|
||||
add(new WiimoteDevice());
|
||||
//add(new GUIDevice());
|
||||
//add(new TextDevice());
|
||||
add(new PanelDevice());
|
||||
//add(new PanelDevice());
|
||||
//add(new LanTextDevice());
|
||||
//add(new Extreme3DDevice());
|
||||
startDevices();
|
||||
|
||||
add(new ExampleApplication());
|
||||
//add(new ExampleApplication());
|
||||
//add(new WMPApplication());
|
||||
//add(new GomPlayerApplication());
|
||||
//add(new WinampApplication());
|
||||
add(new WinampApplication());
|
||||
//add(new iTunesApplication());
|
||||
//add(new VLCApplication());
|
||||
//add(new MPCApplication());
|
||||
|
||||
@@ -43,8 +43,9 @@ abstract public class WindowsApplication extends CMDApplication {
|
||||
Windows.sendMessage(handle, Windows.WM_COMMAND, command, 0);
|
||||
}
|
||||
|
||||
protected void user(int code) {
|
||||
Windows.sendMessage(handle, Windows.WM_USER + code, 0, 0);
|
||||
protected int user(int wParam, int lParam) {
|
||||
return Windows.sendMessage(handle, Windows.WM_USER, wParam, lParam);
|
||||
//return Windows.sendMessage(handle, Windows.WM_USER + wParam, 0, 0);
|
||||
}
|
||||
|
||||
protected void key(Type key, int code) {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package pm.application.windows.winamp;
|
||||
|
||||
import pm.application.cmd.windows.WindowsApplication;
|
||||
import pm.util.Windows;
|
||||
import pm.value.Action;
|
||||
|
||||
public class WinampApplication extends WindowsApplication {
|
||||
protected final static String PROGRAM = "winamp.exe";
|
||||
protected final static String TITLE = "Winamp";
|
||||
protected final static String NAME = "Winamp v1.x";
|
||||
|
||||
public WinampApplication() {
|
||||
super(PROGRAM, TITLE, NAME);
|
||||
}
|
||||
|
||||
public void action(Action action) {
|
||||
System.out.println("WinampApplication: " + action);
|
||||
switch (action) {
|
||||
case PLAY:
|
||||
command(40046);
|
||||
break;
|
||||
case FORWARD:
|
||||
command(0x8009);
|
||||
break;
|
||||
case REWIND:
|
||||
command(0x8008);
|
||||
break;
|
||||
case MUTE:
|
||||
command(0x8016);
|
||||
break;
|
||||
case VOLUME_UP:
|
||||
command(0x8014);
|
||||
break;
|
||||
case VOLUME_DOWN:
|
||||
command(0x8013);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean playing() {
|
||||
int status = Windows.sendMessage(handle, Windows.WM_USER, 0, 104);
|
||||
return status == 1;
|
||||
// 1='playing', 3='paused' or 0='stopped'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,5 +79,6 @@ public class JIntellitypeDevice extends Device implements HotkeyListener, Intell
|
||||
jit.removeHotKeyListener(this);
|
||||
jit.removeIntellitypeListener(this);
|
||||
jit.cleanUp();
|
||||
System.out.println("klaar" + run);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ public class Windows {
|
||||
return findWindow.executeCall(new Object[] {className, windowName});
|
||||
}
|
||||
|
||||
public static boolean postMessage(int handle, int message, int wParam, int lParam) {
|
||||
return postMessage.executeBooleanCall(new Object[] {handle, message, wParam, lParam});
|
||||
public static int postMessage(int handle, int message, int wParam, int lParam) {
|
||||
return postMessage.executeCall(new Object[] {handle, message, wParam, lParam});
|
||||
}
|
||||
|
||||
public static boolean sendMessage(int handle, int message, int wParam, int lParam) {
|
||||
return sendMessage.executeBooleanCall(new Object[] {handle, message, wParam, lParam});
|
||||
public static int sendMessage(int handle, int message, int wParam, int lParam) {
|
||||
return sendMessage.executeCall(new Object[] {handle, message, wParam, lParam});
|
||||
}
|
||||
|
||||
public static int mapVirtualKey(int code, int mapType) {
|
||||
|
||||
Reference in New Issue
Block a user