Like en dislike acties voor iTunes toegevoegd.
This commit is contained in:
@@ -42,7 +42,7 @@ public class Macro extends Sequence {
|
||||
}
|
||||
if (!holdList.isEmpty()) {
|
||||
throw new StateOrderException("One or more buttons are not released.");
|
||||
}
|
||||
eventArray = (State[]) eventList.toArray(new State[0]);
|
||||
}
|
||||
this.eventArray = (State[]) eventList.toArray(new State[0]);
|
||||
}
|
||||
}
|
||||
@@ -66,8 +66,8 @@ public class Main extends EventListener {
|
||||
//add(new ExampleApplication());
|
||||
//add(new WMPApplication());
|
||||
//add(new GomPlayerApplication());
|
||||
add(new WinampApplication());
|
||||
//add(new iTunesApplication());
|
||||
//add(new WinampApplication());
|
||||
add(new iTunesApplication());
|
||||
//add(new VLCApplication());
|
||||
//add(new MPCApplication());
|
||||
startApplications();
|
||||
|
||||
@@ -5,7 +5,6 @@ import pm.exception.application.ApplicationExitException;
|
||||
import pm.value.Action;
|
||||
|
||||
import com.dt.iTunesController.ITCOMDisabledReason;
|
||||
import com.dt.iTunesController.ITPlaylistRepeatMode;
|
||||
import com.dt.iTunesController.ITTrack;
|
||||
import com.dt.iTunesController.iTunes;
|
||||
import com.dt.iTunesController.iTunesEventsInterface;
|
||||
@@ -13,6 +12,8 @@ import com.dt.iTunesController.iTunesEventsInterface;
|
||||
public class iTunesApplication extends Application implements iTunesEventsInterface {
|
||||
protected static final int POSTION_CHANGE_RATE = 1;
|
||||
protected static final int VOLUME_CHANGE_RATE = 5;
|
||||
protected static final String PLAYLIST_LIKE = "Like";
|
||||
protected static final String PLAYLIST_DISLIKE = "Dislike";
|
||||
|
||||
protected iTunes iTunes;
|
||||
|
||||
@@ -71,6 +72,12 @@ public class iTunesApplication extends Application implements iTunesEventsInterf
|
||||
iTunes.cycleSongRepeat();
|
||||
//iTunes.resume();
|
||||
break;
|
||||
case LIKE:
|
||||
iTunes.playlistAddCurrentTrack(PLAYLIST_LIKE);
|
||||
break;
|
||||
case DISLIKE:
|
||||
iTunes.playlistAddCurrentTrack(PLAYLIST_DISLIKE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,12 @@ public class JIntellitypeDevice extends Device implements HotkeyListener, Intell
|
||||
add(
|
||||
new Hotkey(Modifier.CTRL | Modifier.WIN, 'x'),
|
||||
new Task(Action.EXIT, Target.MAIN));
|
||||
add(
|
||||
new Hotkey(Modifier.CTRL | Modifier.SHIFT | Modifier.WIN, 'n'),
|
||||
new Task(Action.NEXT, Target.APPLICATION));
|
||||
add(
|
||||
new Hotkey(Modifier.CTRL | Modifier.SHIFT | Modifier.WIN, 'p'),
|
||||
new Task(Action.PREVIOUS, Target.APPLICATION));
|
||||
/*add(
|
||||
new Hotkey(Modifier.CTRL | Modifier.WIN, 't'),
|
||||
new Task(Action.TEST, Target.MAIN));
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.wiigee.util.Log;
|
||||
|
||||
import pm.Button;
|
||||
import pm.Device;
|
||||
import pm.Macro;
|
||||
import pm.device.wiimote.gesture.GestureDevice;
|
||||
import pm.event.Task;
|
||||
import pm.event.task.Continuous;
|
||||
@@ -13,6 +14,7 @@ import pm.event.task.Dynamic;
|
||||
import pm.exception.button.UnknownButtonException;
|
||||
import pm.exception.device.DeviceExitException;
|
||||
import pm.exception.device.DeviceInitialiseException;
|
||||
import pm.exception.macro.StateOrderException;
|
||||
import pm.macro.state.Hold;
|
||||
import pm.macro.state.Press;
|
||||
import pm.macro.state.Release;
|
||||
@@ -96,6 +98,20 @@ public class WiimoteDevice extends Device implements GestureListener {
|
||||
add(
|
||||
new Press(WiimoteButton.HOME),
|
||||
new Task(Action.NEXT, Target.MAIN));
|
||||
try {
|
||||
add(
|
||||
new Macro(
|
||||
new Hold(WiimoteButton.TWO),
|
||||
new Press(WiimoteButton.PLUS),
|
||||
new Release(WiimoteButton.TWO)),
|
||||
new Task(Action.LIKE, Target.APPLICATION));
|
||||
add(
|
||||
new Macro(
|
||||
new Hold(WiimoteButton.TWO),
|
||||
new Press(WiimoteButton.MINUS),
|
||||
new Release(WiimoteButton.TWO)),
|
||||
new Task(Action.DISLIKE, Target.APPLICATION));
|
||||
} catch (StateOrderException e) {}
|
||||
}
|
||||
|
||||
public void exit() throws DeviceExitException {
|
||||
|
||||
@@ -16,5 +16,5 @@ public enum Action {
|
||||
VOLUME_DOWN,
|
||||
VOLUME_UP,
|
||||
FULLSCREEN,
|
||||
TRAIN, STOP, SAVE, RECOGNIZE, LOAD, SHUFFLE, FADEOUT, QUIT, VISUALISER;
|
||||
TRAIN, STOP, SAVE, RECOGNIZE, LOAD, SHUFFLE, FADEOUT, QUIT, VISUALISER, LIKE, DISLIKE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user