summaryrefslogtreecommitdiff
path: root/epg_events.cpp
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-02-18 22:22:35 +0000
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-02-18 22:22:35 +0000
commit4c0d3398fc6444169ee47935b9ab814eb3929e72 (patch)
treeeed61c51a9c32ee726553d893567419d67b3bfdd /epg_events.cpp
parent55076f14be853cb7cb1c801484267214e98c4a5e (diff)
downloadvdr-plugin-live-4c0d3398fc6444169ee47935b9ab814eb3929e72.tar.gz
vdr-plugin-live-4c0d3398fc6444169ee47935b9ab814eb3929e72.tar.bz2
- Added status box with current channel, program and elapsed time in the
logo area. - Added support for progress bars to display elapsed content. - Extendend ajax.js to be usable for non xml requests. - adapted styles for the new features.
Diffstat (limited to 'epg_events.cpp')
-rw-r--r--epg_events.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/epg_events.cpp b/epg_events.cpp
index 3940a57..2619b46 100644
--- a/epg_events.cpp
+++ b/epg_events.cpp
@@ -1,3 +1,5 @@
+#include <time.h>
+
#include "tools.h"
#include "epg_events.h"
@@ -46,6 +48,22 @@ namespace vdrlive
return FormatDateTime(format, m_end_time);
}
+ const std::string EpgEvent::CurrentTime(const char* format) const
+ {
+ return FormatDateTime(format, time(0));
+ }
+
+ int EpgEvent::Elapsed() const
+ {
+ if (m_end_time > m_start_time) {
+ time_t now = time(0);
+ if ((m_start_time <= now) && (now <= m_end_time)) {
+ return 100 * (now - m_start_time) / (m_end_time - m_start_time);
+ }
+ }
+ return -1;
+ }
+
EpgEvents::EpgEvents() :
std::vector<EpgEventPtr>()
{