summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2007-04-15 18:34:18 +0000
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2007-04-15 18:34:18 +0000
commit97b856ab7ad8f845ea51378f6448676787bf21e6 (patch)
tree1d897577d25fc979f63d99197d91666bdbe0db5e
parent059b437a2a72410a799b8e22a7ffcec1405af107 (diff)
downloadvdr-plugin-live-97b856ab7ad8f845ea51378f6448676787bf21e6.tar.gz
vdr-plugin-live-97b856ab7ad8f845ea51378f6448676787bf21e6.tar.bz2
changes for searchtimer edit
-rw-r--r--epgsearch.cpp378
-rw-r--r--epgsearch.h265
2 files changed, 564 insertions, 79 deletions
diff --git a/epgsearch.cpp b/epgsearch.cpp
index 68d3aad..2936b71 100644
--- a/epgsearch.cpp
+++ b/epgsearch.cpp
@@ -1,6 +1,7 @@
#include <vector>
#include <vdr/channels.h>
#include <vdr/plugin.h>
+#include <iomanip>
#include "epgsearch/services.h"
#include "epgsearch.h"
#include "exception.h"
@@ -12,34 +13,55 @@ using namespace std;
bool operator<( SearchTimer const& left, SearchTimer const& right )
{
- return left.m_id < right.m_id;
-}
-
-SearchTimer::SearchTimer( string const& data ):
- m_id( 0 ),
- m_useTime( false ),
- m_startTime( 0 ),
- m_stopTime( 0 ),
- m_useChannel( NoChannel ),
- m_useCase( false ),
- m_mode( 0 ),
- m_useTitle( false ),
- m_useSubtitle( false ),
- m_useDescription( false ),
- m_useDuration( false ),
- m_minDuration( 0 ),
- m_maxDuration( 0 ),
- m_useAsSearchTimer( false ),
- m_useDayOfWeek( false ),
- m_dayOfWeek( 0 ),
- m_useEpisode( false ),
- m_priority( 0 ),
- m_lifetime( 0 )
-{
- vector< string > parts = StringSplit( data, ':' );
- try {
- vector< string >::const_iterator part = parts.begin();
- for ( int i = 0; part != parts.end(); ++i, ++part ) {
+ return left.m_search < right.m_search;
+}
+
+SearchTimer::SearchTimer()
+{
+ Init();
+}
+
+void SearchTimer::Init()
+{
+ m_id = -1;
+ m_useTime = false;
+ m_startTime = 0;
+ m_stopTime = 0;
+ m_useChannel = NoChannel;
+ m_useCase = false;
+ m_mode = 0;
+ m_useTitle = false;
+ m_useSubtitle = false;
+ m_useDescription = false;
+ m_useDuration = false;
+ m_minDuration = 0;
+ m_maxDuration = 0;
+ m_useDayOfWeek = false;
+ m_dayOfWeek = 0;
+ m_useEpisode = false;
+ m_priority = 99;
+ m_lifetime = 50;
+ m_fuzzytolerance = 1;
+ m_useInFavorites = false;
+ m_useAsSearchtimer = false;
+ m_action = 0;
+ m_delAfterDays = 0;
+ m_recordingsKeep = 0;
+ m_pauseOnNrRecordings = 0;
+ m_switchMinBefore = 1;
+ m_useExtEPGInfo = false;
+ m_useVPS = false;
+ m_marginstart = 2;
+ m_marginstop = 10;
+}
+
+SearchTimer::SearchTimer( string const& data )
+{
+ Init();
+ vector< string > parts = StringSplit( data, ':' );
+ try {
+ vector< string >::const_iterator part = parts.begin();
+ for ( int i = 0; part != parts.end(); ++i, ++part ) {
switch ( i ) {
case 0: m_id = lexical_cast< int >( *part ); break;
case 1: m_search = StringReplace( StringReplace( *part, "|", ":" ), "!^pipe^!", "|" ); break;
@@ -56,19 +78,150 @@ SearchTimer::SearchTimer( string const& data ):
case 12: m_useDuration = lexical_cast< bool >( *part ); break;
case 13: if ( m_useDuration ) m_minDuration = lexical_cast< int >( *part ); break;
case 14: if ( m_useDuration ) m_maxDuration = lexical_cast< int >( *part ); break;
- case 15: m_useAsSearchTimer = lexical_cast< bool >( *part ); break;
+ case 15: m_useAsSearchtimer = lexical_cast< bool >( *part ); break;
case 16: m_useDayOfWeek = lexical_cast< bool >( *part ); break;
case 17: m_dayOfWeek = lexical_cast< int >( *part ); break;
case 18: m_useEpisode = lexical_cast< bool >( *part ); break;
- case 19: m_directory = *part; break;
+ case 19: m_directory = StringReplace( StringReplace( *part, "|", ":" ), "!^pipe^!", "|" ); break;
case 20: m_priority = lexical_cast< int >( *part ); break;
case 21: m_lifetime = lexical_cast< int >( *part ); break;
+ case 22: m_marginstart = lexical_cast< int >( *part ); break;
+ case 23: m_marginstop = lexical_cast< int >( *part ); break;
+ case 24: m_useVPS = lexical_cast< bool >( *part ); break;
+ case 25: m_action = lexical_cast< int >( *part ); break;
+ case 26: m_useExtEPGInfo = lexical_cast< bool >( *part ); break;
+ case 27: ParseExtEPGInfo( *part ); break;
+ case 28: m_avoidrepeats = lexical_cast< bool >( *part ); break;
+ case 29: m_allowedrepeats = lexical_cast< int >( *part ); break;
+ case 30: m_compareTitle = lexical_cast< bool >( *part ); break;
+ case 31: m_compareSubtitle = lexical_cast< bool >( *part ); break;
+ case 32: m_compareSummary = lexical_cast< bool >( *part ); break;
+ case 33: m_catvaluesAvoidRepeat = lexical_cast< unsigned long >( *part ); break;
+ case 34: m_repeatsWithinDays = lexical_cast< int >( *part ); break;
+ case 35: m_delAfterDays = lexical_cast< int >( *part ); break;
+ case 36: m_recordingsKeep = lexical_cast< int >( *part ); break;
+ case 37: m_switchMinBefore = lexical_cast< int >( *part ); break;
+ case 38: m_pauseOnNrRecordings = lexical_cast< int >( *part ); break;
+ case 39: m_blacklistmode = lexical_cast< int >( *part ); break;
+ case 40: ParseBlacklist( *part ); break;
+ case 41: m_fuzzytolerance = lexical_cast< int >( *part ); break;
+ case 42: m_useInFavorites = lexical_cast< bool >( *part ); break;
+ case 43: m_menuTemplate = lexical_cast< int >( *part ); break;
}
}
} catch ( bad_lexical_cast const& ex ) {
}
}
+std::string SearchTimer::ToText()
+{
+ std::string tmp_Start;
+ std::string tmp_Stop;
+ std::string tmp_minDuration;
+ std::string tmp_maxDuration;
+ std::string tmp_chanSel;
+ std::string tmp_search;
+ std::string tmp_directory;
+ std::string tmp_catvalues;
+ std::string tmp_blacklists;
+
+ tmp_search = StringReplace(StringReplace(m_search, "|", "!^pipe^!"), ":", "|");
+ tmp_directory = StringReplace(StringReplace(m_directory, "|", "!^pipe^!"), ":", "|");
+
+ if (m_useTime)
+ {
+ ostringstream os;
+ os << setw(4) << setfill('0') << m_startTime;
+ tmp_Start = os.str();
+ os.str("");
+ os << setw(4) << setfill('0') << m_stopTime;
+ tmp_Stop = os.str();
+ }
+ if (m_useDuration)
+ {
+ ostringstream os;
+ os << setw(4) << setfill('0') << m_minDuration;
+ tmp_minDuration = os.str();
+ os.str("");
+ os << setw(4) << setfill('0') << m_maxDuration;
+ tmp_maxDuration = os.str();
+ }
+
+ if (m_useChannel==1)
+ {
+ cChannel const* channelMin = Channels.GetByChannelID( m_channelMin );
+ cChannel const* channelMax = Channels.GetByChannelID( m_channelMax );
+
+ if (channelMax && channelMin->Number() < channelMax->Number())
+ tmp_chanSel = *m_channelMin.ToString() + std::string("|") + *m_channelMax.ToString();
+ else
+ tmp_chanSel = *m_channelMin.ToString();
+ }
+ if (m_useChannel==2)
+ tmp_chanSel = m_channels;
+
+ if (m_useExtEPGInfo)
+ {
+ for(unsigned int i=0; i<m_ExtEPGInfo.size(); i++)
+ tmp_catvalues += (tmp_catvalues != ""?"|":"") +
+ StringReplace(StringReplace(m_ExtEPGInfo[i], ":", "!^colon^!"), "|", "!^pipe^!");
+ }
+
+ if (m_blacklistmode == 1)
+ {
+ for(unsigned int i=0; i<m_blacklistIDs.size(); i++)
+ tmp_blacklists += (tmp_blacklists != ""?"|":"") + m_blacklistIDs[i];
+ }
+
+ ostringstream os;
+ os << m_id << ":"
+ << tmp_search << ":"
+ << (m_useTime?1:0) << ":"
+ << tmp_Start << ":"
+ << tmp_Stop << ":"
+ << m_useChannel << ":"
+ << ((m_useChannel>0 && m_useChannel<3)?tmp_chanSel:"0") << ":"
+ << (m_useCase?1:0) << ":"
+ << m_mode << ":"
+ << (m_useTitle?1:0) << ":"
+ << (m_useSubtitle?1:0) << ":"
+ << (m_useDescription?1:0) << ":"
+ << (m_useDuration?1:0) << ":"
+ << tmp_minDuration << ":"
+ << tmp_maxDuration << ":"
+ << (m_useAsSearchtimer?1:0) << ":"
+ << (m_useDayOfWeek?1:0) << ":"
+ << m_dayOfWeek << ":"
+ << (m_useEpisode?1:0) << ":"
+ << tmp_directory << ":"
+ << m_priority << ":"
+ << m_lifetime << ":"
+ << m_marginstart << ":"
+ << m_marginstop << ":"
+ << (m_useVPS?1:0) << ":"
+ << m_action << ":"
+ << (m_useExtEPGInfo?1:0) << ":"
+ << tmp_catvalues << ":"
+ << (m_avoidrepeats?1:0) << ":"
+ << m_allowedrepeats << ":"
+ << (m_compareTitle?1:0) << ":"
+ << (m_compareSubtitle?1:0) << ":"
+ << (m_compareSummary?1:0) << ":"
+ << m_catvaluesAvoidRepeat << ":"
+ << m_repeatsWithinDays << ":"
+ << m_delAfterDays << ":"
+ << m_recordingsKeep << ":"
+ << m_switchMinBefore << ":"
+ << m_pauseOnNrRecordings << ":"
+ << m_blacklistmode << ":"
+ << tmp_blacklists << ":"
+ << m_fuzzytolerance << ":"
+ << (m_useInFavorites?1:0) << ":"
+ << m_menuTemplate << ":";
+
+ return os.str();
+}
+
void SearchTimer::ParseChannel( string const& data )
{
switch ( m_useChannel ) {
@@ -98,6 +251,32 @@ void SearchTimer::ParseChannelIDs( string const& data )
m_channels += string( " - " ) + channel->Name();
}
+void SearchTimer::ParseExtEPGInfo( string const& data )
+{
+ m_ExtEPGInfo = StringSplit( data, '|' );
+}
+
+void SearchTimer::ParseBlacklist( string const& data )
+{
+ m_blacklistIDs = StringSplit( data, '|' );
+}
+
+string SearchTimer::StartTimeFormatted()
+{
+ ostringstream os;
+ os << setw(2) << setfill('0') << ( StartTime() / 100 ) % 100 << ":"
+ << setw(2) << setfill('0') << StartTime() % 100;
+ return os.str();
+}
+
+string SearchTimer::StopTimeFormatted()
+{
+ ostringstream os;
+ os << setw(2) << setfill('0') << ( StopTime() / 100 ) % 100 << ":"
+ << setw(2) << setfill('0') << StopTime() % 100;
+ return os.str();
+}
+
SearchTimers::SearchTimers()
{
Epgsearch_services_v1_0 service;
@@ -107,6 +286,145 @@ SearchTimers::SearchTimers()
ReadLock channelsLock( Channels, 0 );
list< string > timers = service.handler->SearchTimerList();
m_timers.assign( timers.begin(), timers.end() );
+ m_timers.sort();
+}
+
+bool SearchTimers::Save(SearchTimer* searchtimer)
+{
+ Epgsearch_services_v1_0 service;
+ if ( cPluginManager::CallFirstService("Epgsearch-services-v1.0", &service) == 0 )
+ throw HtmlError( tr("No searchtimers available") );
+
+ if (!searchtimer) return false;
+ ReadLock channelsLock( Channels, 0 );
+ if (searchtimer->Id() >= 0)
+ return service.handler->ModSearchTimer(searchtimer->ToText());
+ else
+ {
+ int id = service.handler->AddSearchTimer(searchtimer->ToText());
+ if (id >= 0)
+ searchtimer->SetId(id);
+ return (id >= 0);
+ }
+}
+
+SearchTimer* SearchTimers::GetByTimerId( std::string const& id )
+{
+ for (SearchTimers::iterator timer = m_timers.begin(); timer != m_timers.end(); ++timer)
+ if (timer->Id() == lexical_cast< int >(id))
+ return &*timer;
+ return NULL;
+
+}
+
+bool SearchTimer::BlacklistSelected(int id) const
+{
+ for(unsigned int i=0; i<m_blacklistIDs.size(); i++)
+ if (StringToInt(m_blacklistIDs[i]) == id) return true;
+ return false;
+}
+
+ExtEPGInfo::ExtEPGInfo( string const& data )
+{
+ m_id = -1;
+ m_searchmode = 0;
+
+ vector< string > parts = StringSplit( data, '|' );
+ try {
+ vector< string >::const_iterator part = parts.begin();
+ for ( int i = 0; part != parts.end(); ++i, ++part ) {
+ switch ( i ) {
+ case 0: m_id = lexical_cast< int >( *part ); break;
+ case 1: m_name = *part; break;
+ case 2: m_menuname = *part; break;
+ case 3: ParseValues( *part ); break;
+ case 4: m_searchmode = lexical_cast< int >( *part ); break;
+ }
+ }
+ } catch ( bad_lexical_cast const& ex ) {
+ }
+}
+
+void ExtEPGInfo::ParseValues( string const& data )
+{
+ m_values = StringSplit( data, ',' );
+}
+
+bool ExtEPGInfo::Selected(unsigned int index, std::string const& values)
+{
+ if (index >= m_values.size()) return false;
+ string extepgvalue = StringTrim(m_values[index]);
+
+ vector< string > parts;
+ parts = StringSplit( values, ',' );
+ for(unsigned int i=0; i<parts.size(); i++) if (StringTrim(parts[i]) == extepgvalue) return true;
+ parts = StringSplit( values, ';' );
+ for(unsigned int i=0; i<parts.size(); i++) if (StringTrim(parts[i]) == extepgvalue) return true;
+ parts = StringSplit( values, '|' );
+ for(unsigned int i=0; i<parts.size(); i++) if (StringTrim(parts[i]) == extepgvalue) return true;
+ parts = StringSplit( values, '~' );
+ for(unsigned int i=0; i<parts.size(); i++) if (StringTrim(parts[i]) == extepgvalue) return true;
+ return false;
+}
+
+ExtEPGInfos::ExtEPGInfos()
+{
+ Epgsearch_services_v1_0 service;
+ if ( cPluginManager::CallFirstService("Epgsearch-services-v1.0", &service) == 0 )
+ throw HtmlError( tr("No searchtimers available") );
+
+ list< string > infos = service.handler->ExtEPGInfoList();
+ m_infos.assign( infos.begin(), infos.end() );
+}
+
+ChannelGroup::ChannelGroup( string const& data )
+{
+ vector< string > parts = StringSplit( data, '|' );
+ try {
+ vector< string >::const_iterator part = parts.begin();
+ for ( int i = 0; part != parts.end(); ++i, ++part ) {
+ switch ( i ) {
+ case 0: m_name = *part; break;
+ }
+ }
+ } catch ( bad_lexical_cast const& ex ) {
+ }
+}
+
+ChannelGroups::ChannelGroups()
+{
+ Epgsearch_services_v1_0 service;
+ if ( cPluginManager::CallFirstService("Epgsearch-services-v1.0", &service) == 0 )
+ throw HtmlError( tr("No searchtimers available") );
+
+ list< string > list = service.handler->ChanGrpList();
+ m_list.assign( list.begin(), list.end() );
+}
+
+Blacklist::Blacklist( string const& data )
+{
+ vector< string > parts = StringSplit( data, ':' );
+ try {
+ vector< string >::const_iterator part = parts.begin();
+ for ( int i = 0; part != parts.end(); ++i, ++part ) {
+ switch ( i ) {
+ case 0: m_id = lexical_cast< int >( *part ); break;
+ case 1: m_search = StringReplace( StringReplace( *part, "|", ":" ), "!^pipe^!", "|" ); break;
+ }
+ }
+ } catch ( bad_lexical_cast const& ex ) {
+ }
+}
+
+Blacklists::Blacklists()
+{
+ Epgsearch_services_v1_0 service;
+ if ( cPluginManager::CallFirstService("Epgsearch-services-v1.0", &service) == 0 )
+ throw HtmlError( tr("No searchtimers available") );
+
+ list< string > list = service.handler->BlackList();
+ m_list.assign( list.begin(), list.end() );
+ m_list.sort();
}
} // namespace vdrlive
diff --git a/epgsearch.h b/epgsearch.h
index 30927bf..4ca37f4 100644
--- a/epgsearch.h
+++ b/epgsearch.h
@@ -1,6 +1,7 @@
#ifndef VDR_LIVE_EPGSEARCH_H
#define VDR_LIVE_EPGSEARCH_H
+#include <vector>
#include <list>
#include <string>
#include <vdr/channels.h>
@@ -22,18 +23,100 @@ public:
FTAOnly = 3
};
+ SearchTimer();
SearchTimer( std::string const& data );
+ void Init();
+ std::string ToText();
+ friend bool operator<( SearchTimer const& left, SearchTimer const& right );
int Id() const { return m_id; }
+ void SetId(int id) { m_id = id; }
std::string const& Search() const { return m_search; }
+ void SetSearch(std::string const& search) { m_search = search; }
+ int SearchMode() { return m_mode; }
+ void SetSearchMode(int mode) { m_mode = mode; }
+ int Tolerance() const { return m_fuzzytolerance; }
+ void SetTolerance(int tolerance) { m_fuzzytolerance = tolerance; }
+ bool MatchCase() const { return m_useCase; }
+ void SetMatchCase(bool useCase) { m_useCase = useCase; }
bool UseTime() const { return m_useTime; }
+ void SetUseTime(bool useTime) { m_useTime = useTime; }
+ bool UseTitle() const { return m_useTitle; }
+ void SetUseTitle(bool useTitle) { m_useTitle = useTitle; }
+ bool UseSubtitle() const { return m_useSubtitle; }
+ void SetUseSubtitle(bool useSubtitle) { m_useSubtitle = useSubtitle; }
+ bool UseDescription() const { return m_useDescription; }
+ void SetUseDescription(bool useDescription) { m_useDescription = useDescription; }
int StartTime() const { return m_startTime; }
+ std::string StartTimeFormatted();
+ void SetStartTime(int startTime) { m_startTime = startTime; }
int StopTime() const { return m_stopTime; }
+ std::string StopTimeFormatted();
+ void SetStopTime(int stopTime) { m_stopTime = stopTime; }
eUseChannel UseChannel() const { return static_cast< eUseChannel >( m_useChannel ); }
+ void SetUseChannel(eUseChannel useChannel) { m_useChannel = useChannel; }
+ tChannelID ChannelMin() const { return m_channelMin; }
+ void SetChannelMin(tChannelID channelMin) { m_channelMin = channelMin; }
+ tChannelID ChannelMax() const { return m_channelMax; }
+ void SetChannelMax(tChannelID channelMax) { m_channelMax = channelMax; }
std::string ChannelText() const { return m_channels; }
- bool UseAsSearchTimer() const { return m_useAsSearchTimer; }
-
- friend bool operator<( SearchTimer const& left, SearchTimer const& right );
+ void SetChannelText(std::string channels) { m_channels = channels; }
+ bool UseAsSearchTimer() const { return m_useAsSearchtimer; }
+ void SetUseAsSearchTimer(bool useAsSearchtimer) { m_useAsSearchtimer = useAsSearchtimer; }
+ bool UseDuration() const { return m_useDuration; }
+ void SetUseDuration(bool useDuration) { m_useDuration = useDuration; }
+ int MinDuration() const { return m_minDuration; }
+ void SetMinDuration(int minDuration) { m_minDuration = minDuration; }
+ int MaxDuration() const { return m_maxDuration; }
+ void SetMaxDuration(int maxDuration) { m_maxDuration = maxDuration; }
+ bool UseDayOfWeek() const { return m_useDayOfWeek; }
+ void SetUseDayOfWeek(bool useDayOfWeek) { m_useDayOfWeek = useDayOfWeek; }
+ int DayOfWeek() const { return m_dayOfWeek; }
+ void SetDayOfWeek(int dayOfWeek) { m_dayOfWeek = dayOfWeek; }
+ bool UseInFavorites() const { return m_useInFavorites; }
+ void SetUseInFavorites(bool useInFavorites) { m_useInFavorites = useInFavorites; }
+ int SearchTimerAction() const { return m_action; }
+ void SetSearchTimerAction(int action) { m_action = action; }
+ bool UseSeriesRecording() const { return m_useEpisode; }
+ void SetUseSeriesRecording(bool useEpisode) { m_useEpisode = useEpisode; }
+ std::string const& Directory() const { return m_directory; }
+ void SetDirectory(std::string const& directory) { m_directory = directory; }
+ int DelRecsAfterDays() const { return m_delAfterDays; }
+ void SetDelRecsAfterDays(int delAfterDays) { m_delAfterDays = delAfterDays; }
+ int KeepRecs() const { return m_recordingsKeep; }
+ void SetKeepRecs(int recordingsKeep) { m_recordingsKeep = recordingsKeep; }
+ int PauseOnRecs() const {return m_pauseOnNrRecordings; }
+ void SetPauseOnRecs(int pauseOnNrRecordings) { m_pauseOnNrRecordings = pauseOnNrRecordings; }
+ int BlacklistMode() const {return m_blacklistmode; }
+ void SetBlacklistMode(int blacklistmode) { m_blacklistmode = blacklistmode; }
+ bool BlacklistSelected(int id) const;
+ void ParseBlacklist( std::string const& data );
+ int SwitchMinBefore() const { return m_switchMinBefore; }
+ void SetSwitchMinBefore(int switchMinBefore) { m_switchMinBefore = switchMinBefore; }
+ bool UseExtEPGInfo() const { return m_useExtEPGInfo; }
+ void SetUseExtEPGInfo(bool useExtEPGInfo) { m_useExtEPGInfo = useExtEPGInfo; }
+ std::vector< std::string > ExtEPGInfo() const { return m_ExtEPGInfo; }
+ void SetExtEPGInfo(std::vector< std::string > ExtEPGInfo) { m_ExtEPGInfo = ExtEPGInfo; }
+ bool AvoidRepeats() const { return m_avoidrepeats; }
+ void SetAvoidRepeats(bool avoidrepeats) { m_avoidrepeats = avoidrepeats; }
+ bool CompareTitle() const { return m_compareTitle; }
+ void SetCompareTitle(bool compareTitle) { m_compareTitle = compareTitle; }
+ bool CompareSubtitle() const { return m_compareSubtitle; }
+ void SetCompareSubtitle(bool compareSubtitle) { m_compareSubtitle = compareSubtitle; }
+ bool CompareSummary() const { return m_compareSummary; }
+ void SetCompareSummary(bool compareSummary) { m_compareSummary = compareSummary; }
+ unsigned long CompareCategories() const { return m_catvaluesAvoidRepeat; }
+ void SetCompareCategories(unsigned long compareCategories) { m_catvaluesAvoidRepeat = compareCategories; }
+ int Priority() const { return m_priority; }
+ void SetPriority(int priority) { m_priority = priority; }
+ int Lifetime() const { return m_lifetime; }
+ void SetLifetime(int lifetime) { m_lifetime = lifetime; }
+ int MarginStart() const { return m_marginstart; }
+ void SetMarginStart(int marginstart) { m_marginstart = marginstart; }
+ int MarginStop() const { return m_marginstop; }
+ void SetMarginStop(int marginstop) { m_marginstop = marginstop; }
+ bool UseVPS() const { return m_useVPS; }
+ void SetUseVPS(bool useVPS) { m_useVPS = useVPS; }
private:
int m_id;
@@ -53,58 +136,106 @@ private:
bool m_useDuration;
int m_minDuration;
int m_maxDuration;
- bool m_useAsSearchTimer;
bool m_useDayOfWeek;
int m_dayOfWeek;
bool m_useEpisode;
- std::string m_directory;
int m_priority;
int m_lifetime;
+ int m_fuzzytolerance;
+ bool m_useInFavorites;
+ bool m_useAsSearchtimer;
+ int m_action;
+ std::string m_directory;
+ int m_delAfterDays;
+ int m_recordingsKeep;
+ int m_pauseOnNrRecordings;
+ int m_switchMinBefore;
+ int m_marginstart;
+ int m_marginstop;
+ bool m_useVPS;
+ bool m_useExtEPGInfo;
+ std::vector< std::string > m_ExtEPGInfo;
+ bool m_avoidrepeats;
+ int m_allowedrepeats;
+ bool m_compareTitle;
+ bool m_compareSubtitle;
+ bool m_compareSummary;
+ int m_repeatsWithinDays;
+ int m_blacklistmode;
+ std::vector< std::string > m_blacklistIDs;
+ int m_menuTemplate;
+ unsigned long m_catvaluesAvoidRepeat;
void ParseChannel( std::string const& data );
void ParseChannelIDs( std::string const& data );
-/*
- int useChannel;
- int useCase;
- int mode;
- int useTitle;
- int useSubtitle;
- int useDescription;
- int useDuration;
- int minDuration;
- int maxDuration;
- int useAsSearchTimer;
- int useDayOfWeek;
- int DayOfWeek;
- int useEpisode;
- char directory[MaxFileName];
- int Priority;
- int Lifetime;
- int MarginStart;
- int MarginStop;
- int useVPS;
- int action;
- int useExtEPGInfo;
- char** catvalues;
- cChannel *channelMin;
- cChannel *channelMax;
- char* channelGroup;
- int avoidRepeats;
- int compareTitle;
- int compareSubtitle;
- int compareSummary;
- int allowedRepeats;
- unsigned long catvaluesAvoidRepeat;
- int repeatsWithinDays;
- int delAfterDays;
- int recordingsKeep;
- int switchMinsBefore;
- int pauseOnNrRecordings;
- int blacklistMode;
- cList<cBlacklistObject> blacklists;
- int fuzzyTolerance;
- int useInFavorites;
- int menuTemplate;*/
+ void ParseExtEPGInfo( std::string const& data );
+};
+
+class ExtEPGInfo
+{
+ public:
+ ExtEPGInfo(std::string const& data );
+ int Id() const { return m_id; }
+ std::string Name() const { return m_menuname; }
+ std::vector< std::string > Values() const { return m_values; }
+ bool Selected(unsigned int index, std::string const& values);
+ private:
+ int m_id;
+ std::string m_name;
+ std::string m_menuname;
+ std::vector< std::string > m_values;
+ int m_searchmode;
+
+ void ParseValues( std::string const& data );
+};
+
+class ExtEPGInfos
+{
+public:
+ typedef std::list< ExtEPGInfo > ExtEPGInfoList;
+ typedef ExtEPGInfoList::size_type size_type;
+ typedef ExtEPGInfoList::iterator iterator;
+ typedef ExtEPGInfoList::const_iterator const_iterator;
+
+ ExtEPGInfos();
+
+ size_type size() const { return m_infos.size(); }
+
+ iterator begin() { return m_infos.begin(); }
+ const_iterator begin() const { return m_infos.begin(); }
+ iterator end() { return m_infos.end(); }
+ const_iterator end() const { return m_infos.end(); }
+private:
+ ExtEPGInfoList m_infos;
+};
+
+class ChannelGroup
+{
+ public:
+ ChannelGroup(std::string const& data );
+ std::string Name() { return m_name; }
+ private:
+ std::string m_name;
+};
+
+class ChannelGroups
+{
+public:
+ typedef std::list< ChannelGroup > ChannelGroupList;
+ typedef ChannelGroupList::size_type size_type;
+ typedef ChannelGroupList::iterator iterator;
+ typedef ChannelGroupList::const_iterator const_iterator;
+
+ ChannelGroups();
+
+ size_type size() const { return m_list.size(); }
+
+ iterator begin() { return m_list.begin(); }
+ const_iterator begin() const { return m_list.begin(); }
+ iterator end() { return m_list.end(); }
+ const_iterator end() const { return m_list.end(); }
+private:
+ ChannelGroupList m_list;
};
class SearchTimers
@@ -116,6 +247,7 @@ public:
typedef TimerList::const_iterator const_iterator;
SearchTimers();
+ bool Save(SearchTimer* searchtimer);
size_type size() const { return m_timers.size(); }
@@ -123,12 +255,47 @@ public:
const_iterator begin() const { return m_timers.begin(); }
iterator end() { return m_timers.end(); }
const_iterator end() const { return m_timers.end(); }
-
+ SearchTimer* GetByTimerId( std::string const& id );
private:
TimerList m_timers;
};
+class Blacklist
+{
+public:
+ Blacklist( std::string const& data );
+
+ std::string const& Search() const { return m_search; }
+ int Id() const { return m_id; }
+ bool operator<( Blacklist const& other ) const { return Search() < other.Search(); }
+
+private:
+ int m_id;
+ std::string m_search;
+};
+
+class Blacklists
+{
+public:
+ typedef std::list< Blacklist > blacklist;
+ typedef blacklist::size_type size_type;
+ typedef blacklist::iterator iterator;
+ typedef blacklist::const_iterator const_iterator;
+
+ Blacklists();
+
+ size_type size() const { return m_list.size(); }
+
+ iterator begin() { return m_list.begin(); }
+ const_iterator begin() const { return m_list.begin(); }
+ iterator end() { return m_list.end(); }
+ const_iterator end() const { return m_list.end(); }
+private:
+ blacklist m_list;
+};
+
+}
-} // namespace vdrlive
+ // namespace vdrlive
#endif // VDR_LIVE_EPGSEARCH_H