From a5c871c47c721e1179bee7c4695169dd3344c0c2 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Wed, 19 Nov 2008 18:53:09 +0100 Subject: new setup option to display channels without EPG --- epg_events.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'epg_events.cpp') diff --git a/epg_events.cpp b/epg_events.cpp index 962fcfc..ac6bcaa 100644 --- a/epg_events.cpp +++ b/epg_events.cpp @@ -195,6 +195,22 @@ namespace vdrlive return name; } + /* + * ------------------------------------------------------------------------- + * EmptyEvent + * ------------------------------------------------------------------------- + */ + + EmptyEvent::EmptyEvent(std::string const &id, tChannelID const &channelID, const char* channelName) : + EpgInfo(id, channelName), + m_channelID(channelID) + { + } + + EmptyEvent::~EmptyEvent() + { + } + /* * ------------------------------------------------------------------------- * EpgEvents @@ -267,8 +283,16 @@ namespace vdrlive EpgInfoPtr EpgEvents::CreateEpgInfo(cChannel const *chan, cEvent const *event, char const *idOverride) { - string domId(idOverride ? idOverride : EncodeDomId(chan->GetChannelID(), event->EventID())); - return EpgInfoPtr(new EpgEvent(domId, event, chan->Name())); + if (event) + { + string domId(idOverride ? idOverride : EncodeDomId(chan->GetChannelID(), event->EventID())); + return EpgInfoPtr(new EpgEvent(domId, event, chan->Name())); + } + else if (LiveSetup().GetShowChannelsWithoutEPG()) + { + string domId(idOverride ? idOverride : EncodeDomId(chan->GetChannelID(), 0)); + return EpgInfoPtr(new EmptyEvent(domId, chan->GetChannelID(), chan->Name())); + } } EpgInfoPtr EpgEvents::CreateEpgInfo(string const &recid, cRecording const *recording, char const *caption) -- cgit v1.2.3