Go to the documentation of this file.00001
00009 package org.rosmultimedia.player.xbmc.internal;
00010
00011 import org.rosbuilding.common.ISystem;
00012 import org.rosmultimedia.player.xbmc.XbmcNode;
00013 import org.rosmultimedia.player.xbmc.jsonrpc.XbmcJson;
00014 import org.xbmc.android.jsonrpc.api.call.System;
00015
00016 import smarthome_media_msgs.MediaAction;
00017 import smarthome_media_msgs.StateData;
00018
00026 public class XbmcSystem implements ISystem<StateData, MediaAction> {
00030 private XbmcNode xbmcNode;
00031
00035 private XbmcJson xbmcJson;
00036
00042 public XbmcSystem(XbmcJson xbmcJson, XbmcNode node) {
00043 this.xbmcJson = xbmcJson;
00044 this.xbmcNode = node;
00045 }
00046
00047 @Override
00048 public void load(StateData stateData) {
00049
00050 }
00051
00052 @Override
00053 public void callbackCmdAction(MediaAction message, StateData stateData) {
00054 switch (message.getMethod()) {
00055 case OP_POWER:
00056 this.xbmcNode.wakeOnLan();
00057 break;
00058 case OP_SHUTDOWN:
00059 this.xbmcJson.getResult(new System.Shutdown());
00060 break;
00061 default:
00062
00063 }
00064 }
00065
00066 }