From 4c0d3398fc6444169ee47935b9ab814eb3929e72 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Sun, 18 Feb 2007 22:22:35 +0000 Subject: - 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. --- epg_events.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'epg_events.cpp') 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 + #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() { -- cgit v1.2.3