From 56e8a8648027508341a020d4c200122e700c9028 Mon Sep 17 00:00:00 2001 From: lado Date: Thu, 14 Mar 2013 11:25:06 +0100 Subject: deal with timerStopTime --- .../de/bjusystems/vdrmanager/data/Recording.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'vdrmanager') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java index ea414a1..f2ad445 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java @@ -32,6 +32,13 @@ public class Recording extends Event{ if(idx < words.length){ devInode = mapSpecialChars(words[idx++]); } + + if(idx < words.length) { //timer + String data = words[idx++]; + if(data != null && data.length() > 0){ + timerStopTime = new Date(Long.parseLong(data) * 1000L); + } + } } private String fileName; @@ -44,6 +51,19 @@ public class Recording extends Event{ private String devInode = null; + /** + * If it is not null, recording is on going or will be on going until this date; + */ + private Date timerStopTime = null; + + public Date getTimerStopTime() { + return timerStopTime; + } + + public void setTimerStopTime(Date timerStopTime) { + this.timerStopTime = timerStopTime; + } + public String getDevInode() { return devInode; } @@ -61,6 +81,10 @@ public class Recording extends Event{ } public long getDuration(){ + if(timerStopTime != null){ + return timerStopTime.getTime() - start.getTime(); + } + if(realDuration != -1){ return realDuration; } -- cgit v1.2.3