diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-30 19:15:59 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-30 19:15:59 +0000 |
commit | 669bcea5fa4390749fd1b84f80e9f4b1d2a83d9e (patch) | |
tree | 9573419d7f190bd7eeef86a444dc69be7100be4e | |
parent | 366fcf3f618defa1f296116e0c1f8b5db4fbf4af (diff) | |
download | vdr-plugin-live-669bcea5fa4390749fd1b84f80e9f4b1d2a83d9e.tar.gz vdr-plugin-live-669bcea5fa4390749fd1b84f80e9f4b1d2a83d9e.tar.bz2 |
- added readable channels specification
-rw-r--r-- | epgsearch.cpp | 21 | ||||
-rw-r--r-- | epgsearch.h | 9 | ||||
-rw-r--r-- | pages/searchtimers.ecpp | 3 |
3 files changed, 24 insertions, 9 deletions
diff --git a/epgsearch.cpp b/epgsearch.cpp index 1816574..68d3aad 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -1,4 +1,5 @@ #include <vector> +#include <vdr/channels.h> #include <vdr/plugin.h> #include "epgsearch/services.h" #include "epgsearch.h" @@ -71,8 +72,10 @@ SearchTimer::SearchTimer( string const& data ): void SearchTimer::ParseChannel( string const& data ) { switch ( m_useChannel ) { + case NoChannel: m_channels = tr("All"); break; case Interval: ParseChannelIDs( data ); break; - case Group: m_channelGroup = data; break; + case Group: m_channels = data; break; + case FTAOnly: m_channels = tr("FTA"); break; } } @@ -80,8 +83,19 @@ void SearchTimer::ParseChannelIDs( string const& data ) { vector< string > parts = StringSplit( data, '|' ); m_channelMin = lexical_cast< tChannelID >( parts[ 0 ] ); - if ( parts.size() == 2 ) - m_channelMax = lexical_cast< tChannelID >( parts[ 1 ] ); + + cChannel const* channel = Channels.GetByChannelID( m_channelMin ); + if ( channel != 0 ) + m_channels = channel->Name(); + + if ( parts.size() < 2 ) + return; + + m_channelMax = lexical_cast< tChannelID >( parts[ 1 ] ); + + channel = Channels.GetByChannelID( m_channelMax ); + if ( channel != 0 ) + m_channels += string( " - " ) + channel->Name(); } SearchTimers::SearchTimers() @@ -90,6 +104,7 @@ SearchTimers::SearchTimers() if ( cPluginManager::CallFirstService("Epgsearch-services-v1.0", &service) == 0 ) throw HtmlError( tr("No searchtimers available") ); + ReadLock channelsLock( Channels, 0 ); list< string > timers = service.handler->SearchTimerList(); m_timers.assign( timers.begin(), timers.end() ); } diff --git a/epgsearch.h b/epgsearch.h index 1ce7698..30927bf 100644 --- a/epgsearch.h +++ b/epgsearch.h @@ -14,7 +14,7 @@ bool operator<( SearchTimer const& left, SearchTimer const& right ); class SearchTimer { public: - enum UseChannel + enum eUseChannel { NoChannel = 0, Interval = 1, @@ -29,9 +29,8 @@ public: bool UseTime() const { return m_useTime; } int StartTime() const { return m_startTime; } int StopTime() const { return m_stopTime; } - bool UseChannel() const { return m_useChannel; } - tChannelID const& ChannelMin() const { return m_channelMin; } - tChannelID const& ChannelMax() const { return m_channelMax; } + eUseChannel UseChannel() const { return static_cast< eUseChannel >( m_useChannel ); } + std::string ChannelText() const { return m_channels; } bool UseAsSearchTimer() const { return m_useAsSearchTimer; } friend bool operator<( SearchTimer const& left, SearchTimer const& right ); @@ -45,7 +44,7 @@ private: int m_useChannel; tChannelID m_channelMin; tChannelID m_channelMax; - std::string m_channelGroup; + std::string m_channels; bool m_useCase; int m_mode; bool m_useTitle; diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index 63b75c9..cf3ee1a 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -1,4 +1,5 @@ <%pre> +#include <vdr/channels.h> #include <vdr/i18n.h> #include "epgsearch.h" #include "tools.h" @@ -44,7 +45,7 @@ using namespace vdrlive; <td><button type="button" class="smallbutton" onclick="location.href='edit_searchtimer.html?timerid=<$ timer->Id() $>';"><$ tr("Edit") $></button></td> <td><img src="/<$ timer->UseAsSearchTimer() ? "active" : "inactive" $>.png" alt="Aktiv?" /></td> <td><$ timer->Search() $></td> - <td><? timer->UseChannel() ? *timer->ChannelMin().ToString() ?></td> + <td><$ timer->ChannelText() $></td> <td><? timer->UseTime() ? timer->StartTime() ?></td> <td><? timer->UseTime() ? timer->StopTime() ?></td> <td> </td> |