diff options
author | Jasmin Jessich <jasmin@anw.at> | 2017-05-14 00:50:30 +0200 |
---|---|---|
committer | Jasmin Jessich <jasmin@anw.at> | 2017-05-14 00:50:30 +0200 |
commit | 7d2a5fec1e0f7f2ec079a4b8477a26ded11a53fc (patch) | |
tree | 20875d42dd942aece36ceeb1fd4d2aca7f40f225 | |
parent | 98de50e14c3c9f3189f9603dceea13050f5560ba (diff) | |
download | vdr-plugin-live-7d2a5fec1e0f7f2ec079a4b8477a26ded11a53fc.tar.gz vdr-plugin-live-7d2a5fec1e0f7f2ec079a4b8477a26ded11a53fc.tar.bz2 |
Added SortedTimers::Modified
-rw-r--r-- | timers.cpp | 34 | ||||
-rw-r--r-- | timers.h | 2 |
2 files changed, 35 insertions, 1 deletions
@@ -135,6 +135,40 @@ namespace vdrlive { return info.str(); } + bool SortedTimers::Modified() + { + // the global(!) list of known timers + static vector<cTimer> knownTimers; + + bool modified = false; + + LOCK_TIMERS_READ; + for ( const cTimer* timer = Timers->First(); timer; timer = Timers->Next( timer ) ) { + bool known_id = false; + for (vector<cTimer>::iterator it = knownTimers.begin(); it != knownTimers.end(); ++it) { + if (timer->Id() == it->Id()) { + known_id = true; + string timer_txt = *timer->ToText (true); + string known_txt = *it->ToText (true); + modified = timer_txt != known_txt; + break; + } + } + if (!known_id) { + modified = true; + break; + } + } + if (modified) { + knownTimers.clear(); + for (const cTimer* Timer = Timers->First(); Timer; Timer = Timers->Next (Timer)) { + knownTimers.push_back (*Timer); + } + } + + return modified; + } + TimerManager::TimerManager() { } @@ -24,7 +24,7 @@ namespace vdrlive { static std::string DecodeDomId(std::string const &timerDomId); #if VDRVERSNUM >= 20301 - bool Modified() { return true; } + bool Modified(); #else bool Modified() { return Timers.Modified(m_state); } #endif |