|
From: Jim V. <jim...@us...> - 2002-06-11 17:31:52
|
Update of /cvsroot/swapdv/swapdv/ReplayClient
In directory usw-pr-cvs1:/tmp/cvs-serv17124/ReplayClient
Modified Files:
ReplayClient.java
Log Message:
Added sending of remote control commands.
Added a missing close() in deleteShow().
Index: ReplayClient.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/ReplayClient/ReplayClient.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ReplayClient.java 11 Jun 2002 15:50:04 -0000 1.16
+++ ReplayClient.java 11 Jun 2002 17:31:45 -0000 1.17
@@ -66,7 +66,7 @@
nl[0]=13;
nl[1]=10;
name = getFriendlyName();
- chan = Logger.getNextChannel();
+ chan = Logger.getNextChannel();
}
private String getFriendlyName() throws IOException {
@@ -87,7 +87,7 @@
details.setSwapDV(isSwapDV);
return details;
}
-
+
public boolean isSwapDV() {
return isSwapDV;
}
@@ -130,9 +130,9 @@
boolean result = false;
String connectionKey = System.currentTimeMillis()+remotefile;
ReplayConnection c= null;
- try {
+ try {
// next statement not reached until an available slot comes up
- c = new ReplayConnection(this);
+ c = new ReplayConnection(this);
long offset = 0;
if (resume) offset = new File(localfile).length();
c.writeRequest("httpfs-readfile?name=\""+remotefile+"\"&pos="+offset+"&size=" + size);
@@ -181,7 +181,7 @@
c.writeRequest("http_replay_guide-delete_show?show_id="+showHex+"&channel_id="+chanHex+"=RTV4080K0000000000");
c.writeHeaders();
c.processHeader();
- Logger.log(0, LoggerI.LEVEL_DEBUG, "Results "+c.processBodyAsLines());
+ c.close();
return true; // hmm, we don't get any status back
} catch (Exception ex) {
ex.printStackTrace();
@@ -190,6 +190,69 @@
}
}
+ public final static int REMOTE_escape = 133; //escape probably not a 'real' CioCode -- escape from remote monitor (WebTV keyboard ESCape)
+ public final static int REMOTE_stop = 156;
+ public final static int REMOTE_record = 157;
+ public final static int REMOTE_play = 158;
+ public final static int REMOTE_pause = 159;
+ public final static int REMOTE_rewind = 160;
+ public final static int REMOTE_fastforward = 161;
+ public final static int REMOTE_menu = 162;
+ public final static int REMOTE_guide = 163;
+ public final static int REMOTE_exit = 164;
+ public final static int REMOTE_channelup = 167;
+ public final static int REMOTE_channeldown = 168;
+ public final static int REMOTE_north = 169;
+ public final static int REMOTE_south = 170;
+ public final static int REMOTE_west = 171;
+ public final static int REMOTE_east = 172;
+ public final static int REMOTE_northwest = 173;
+ public final static int REMOTE_northeast = 174;
+ public final static int REMOTE_southwest = 175;
+ public final static int REMOTE_utheast = 176;
+ public final static int REMOTE_display = 177;
+ public final static int REMOTE_execute = 178; // The "select" button, in the middle of the movement buttons
+ public final static int REMOTE_enter = 179;
+ public final static int REMOTE_zero = 180;
+ public final static int REMOTE_one = 181;
+ public final static int REMOTE_two = 182;
+ public final static int REMOTE_three = 183;
+ public final static int REMOTE_four = 184;
+ public final static int REMOTE_five = 185;
+ public final static int REMOTE_six = 186;
+ public final static int REMOTE_seven = 187;
+ public final static int REMOTE_eight = 188;
+ public final static int REMOTE_nine = 189;
+ public final static int REMOTE_catchup = 190;
+ public final static int REMOTE_replayguide = 191;
+ public final static int REMOTE_instantreplay = 192;
+ public final static int REMOTE_commercialskip = 193;
+ public final static int REMOTE_jump = 195;
+ public final static int REMOTE_input = 196;
+ public final static int REMOTE_exp_1 = 197; // the "zone" button_ 197
+ public final static int REMOTE_exp_2 = 198; // unknown
+ public final static int REMOTE_power = 199; // not listed in the monitor, name not 'official'_ 199
+ public final static int REMOTE_power_on = 200; // not listed in the monitor, name not 'official'
+ public final static int REMOTE_power_off = 201; // not listed in the monitor, name not 'official'
+ public final static int REMOTE_category = 209; // displays the category section of the ReplayGuide? screen; not listed in the simulator, name not 'official'
+ public final static int REMOTE_togglerf = 211; // not listed in the monitor, name not 'official'; toggles an "RF output" setting, but not sure what -- the channel the antenna output is on?
+ public final static int REMOTE_bypass = 212; // not listed in the monitor, name not 'official'
+ public final static int REMOTE_autoskip = 213;
+
+
+ public void sendCIO(int remoteCommand) {
+ try {
+ ReplayConnection c = new ReplayConnection(this);
+ c.writeRequest("httputils-sendciomessage?cioc="+remoteCommand);
+ c.writeHeaders();
+ c.processHeader();
+ c.close();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Logger.log(chan, LoggerI.LEVEL_ERR, ex.getMessage());
+ }
+ }
+
// only return the guide we've cached
public Guide getCachedGuide() {
return guide;
@@ -202,7 +265,7 @@
String guideFilename = "0";
// make sure we only download a guide if its newer than the one we have...
if (guide!=null) {
- guideFilename = guide.asciiHeader.RemoteFileName;
+ guideFilename = guide.asciiHeader.RemoteFileName;
Logger.log(0, LoggerI.LEVEL_DEBUG, "Existing guide has date "+guide.asciiHeader.RemoteFileName);
}
c.writeRequest("http_replay_guide-get_snapshot?guide_file_name="+guideFilename+"&serial_no=RTV4080K0000000000");
|