summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
authorAndreas Brugger <brougs78@gmx.net>2005-12-11 12:00:00 +0100
committerThomas Günther <tom@toms-cafe.de>2009-06-03 01:10:21 +0200
commitbb39010021b5fd8a1046200839c678afc76227d5 (patch)
tree81c27dc44e9c40512514334030ce7309c48efaa2 /display.c
parent662dd62488f6f842fe5d940e986f798abe1c7691 (diff)
downloadvdr-plugin-text2skin-bb39010021b5fd8a1046200839c678afc76227d5.tar.gz
vdr-plugin-text2skin-bb39010021b5fd8a1046200839c678afc76227d5.tar.bz2
2005-12-11: Version 1.1-cvs_ext-0.3 (vdr-text2skin-1.1-cvs_ext-0.3.diff)
- added recording-tokens: RecordingLength, RecordingCuttedLength
Diffstat (limited to 'display.c')
-rw-r--r--display.c51
1 files changed, 14 insertions, 37 deletions
diff --git a/display.c b/display.c
index 72b42cd..371c4bc 100644
--- a/display.c
+++ b/display.c
@@ -1270,43 +1270,20 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
#endif
case tRecordingSize:
- if (mRecording != NULL) {
- bool bRet=false;
- long long size = 0;
- int nFiles;
- struct stat fileinfo; // Holds file information structure
- char *cmd = NULL;
- cReadLine reader;
- asprintf(&cmd, "find '%s' -follow -type f -name '*.*'|sort ", mRecording->FileName());
-
- FILE *p = popen(cmd, "r");
- int ret=0;
- if (p)
- {
- char *s;
-
- while ((s = reader.Read(p)) != NULL)
- {
- if ((ret=stat(s, &fileinfo)) != -1)
- {
- size += (long long)fileinfo.st_size;
- nFiles++;
- }
- }
-
- bRet=true;
- }
-
- pclose(p);
- delete cmd;
-
- return (long)(size / 1024 / 1024); // [MB]
- }
- else
- {
- return false;
- }
-
+ return mRecording != NULL
+ ? (cxType)GetRecordingSize(mRecording->FileName())
+ : (cxType)false;
+
+ case tRecordingLength:
+ return mRecording != NULL
+ ? (cxType)GetRecordingLength(mRecording->FileName())
+ : (cxType)false;
+
+ case tRecordingCuttedLength:
+ return mRecording != NULL
+ ? (cxType)GetRecordingCuttedLength(mRecording->FileName())
+ : (cxType)false;
+
default:
return cText2SkinRender::GetTokenData(Token);
}