Go to the documentation of this file.00001
00009 package org.rosmultimedia.player.samsung.internal;
00010
00011 import java.io.IOException;
00012
00013 import org.rosbuilding.common.media.IPlayer;
00014 import org.rosmultimedia.player.samsung.SamsungCommand;
00015 import org.rosmultimedia.player.samsung.SamsungTvNode;
00016
00017 import smarthome_media_msgs.MediaAction;
00018 import smarthome_media_msgs.PlayerInfo;
00019 import smarthome_media_msgs.StateData;
00020
00026 public class SamsungPlayer implements IPlayer {
00027
00028
00029 private SamsungTvNode node;
00030
00031 public SamsungPlayer(SamsungTvNode node) {
00032 this.node = node;
00033 }
00034
00035 @Override
00036 public void load(StateData stateData) {
00037 this.load(stateData.getPlayer());
00038 }
00039
00040 public void load(PlayerInfo stateData) {
00041
00042
00043 }
00044
00045 @Override
00046 public void callbackCmdAction(MediaAction message, StateData stateData) throws IOException, InterruptedException {
00047 switch (message.getMethod()) {
00048
00049 case OP_HOME:
00050 this.node.pushEnum( SamsungCommand.KEY_HOME, 2f);
00051 break;
00052
00053 case OP_INFO:
00054 this.node.pushEnum( SamsungCommand.KEY_INFO, 2f);
00055 break;
00056
00057 case OP_DISPLAY:
00058 this.node.pushEnum( SamsungCommand.KEY_CONTENTS, 2f);
00059 break;
00060
00061 case OP_SELECT:
00062 if (stateData.getPlayer().getCanseek()) {
00063 message.setMethod(OP_PLAYPAUSE);
00064 this.callbackCmdAction(message, stateData);
00065 } else {
00066 this.node.pushEnum( SamsungCommand.KEY_ENTER, 2f);
00067 }
00068 break;
00069
00070 case OP_CONTEXT:
00071 this.node.pushEnum( SamsungCommand.KEY_MENU, 2f);
00072 break;
00073
00074 case OP_UP:
00075 if (stateData.getPlayer().getCanseek()) {
00076 this.node.pushEnum( SamsungCommand.KEY_UP, 2f);
00077
00078 } else {
00079 this.node.pushEnum( SamsungCommand.KEY_UP, 2f);
00080 }
00081 break;
00082
00083 case OP_DOWN:
00084 if (stateData.getPlayer().getCanseek()) {
00085 this.node.pushEnum( SamsungCommand.KEY_DOWN, 2f);
00086
00087 } else {
00088 this.node.pushEnum( SamsungCommand.KEY_DOWN, 2f);
00089 }
00090 break;
00091
00092 case OP_LEFT:
00093 if (stateData.getPlayer().getCanseek()) {
00094 this.node.pushEnum( SamsungCommand.KEY_LEFT, 2f);
00095
00096 } else {
00097 this.node.pushEnum( SamsungCommand.KEY_LEFT, 2f);
00098 }
00099 break;
00100
00101 case OP_RIGHT:
00102 if (stateData.getPlayer().getCanseek()) {
00103 this.node.pushEnum( SamsungCommand.KEY_RIGHT, 2f);
00104
00105 } else {
00106 this.node.pushEnum( SamsungCommand.KEY_RIGHT, 2f);
00107 }
00108 break;
00109
00110 }
00111 }
00112
00113 }