summaryrefslogtreecommitdiff
path: root/searchtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'searchtimer.c')
-rw-r--r--searchtimer.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/searchtimer.c b/searchtimer.c
index 7e9b4db..1af3f86 100644
--- a/searchtimer.c
+++ b/searchtimer.c
@@ -16,8 +16,14 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) {
startTime = 0000;
stopTime = 2359;
useChannel = false;
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_CHANNELS_READ;
+ channelMin = Channels->GetByNumber(cDevice::CurrentChannel());
+ channelMax = Channels->GetByNumber(cDevice::CurrentChannel());
+#else
channelMin = Channels.GetByNumber(cDevice::CurrentChannel());
channelMax = Channels.GetByNumber(cDevice::CurrentChannel());
+#endif
channelGroup = "";
useCase = false;
mode = 0;
@@ -239,7 +245,12 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
char *channelMinbuffer = NULL;
char *channelMaxbuffer = NULL;
int channels = sscanf(values[value].c_str(), "%a[^|]|%a[^|]", &channelMinbuffer, &channelMaxbuffer);
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_CHANNELS_READ;
+ channelMin = Channels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
+#else
channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
+#endif
if (!channelMin) {
channelMin = channelMax = NULL;
useChannel = 0;
@@ -247,7 +258,11 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
if (channels == 1)
channelMax = channelMin;
else {
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ channelMax = Channels->GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
+#else
channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
+#endif
if (!channelMax) {
channelMin = channelMax = NULL;
useChannel = 0;
@@ -511,7 +526,12 @@ int cTVGuideSearchTimer::GetNumTimers(void) {
int numTimers = 0;
if (ID < 0)
return numTimers;
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_TIMERS_READ;
+ for (const cTimer *timer = Timers->First(); timer; timer = Timers->Next(timer)) {
+#else
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
+#endif
char* searchID = GetAuxValue(timer, "s-id");
if (!searchID) continue;
if (ID == atoi(searchID))
@@ -525,7 +545,12 @@ int cTVGuideSearchTimer::GetNumRecordings(void) {
int numRecordings = 0;
if (ID < 0)
return numRecordings;
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_RECORDINGS_READ;
+ for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) {
+#else
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
+#endif
if (recording->IsEdited())
continue;
if (!recording->Info())
@@ -568,3 +593,22 @@ void cTVGuideSearchTimer::Dump(void) {
esyslog("tvguide searchtimer: useDescription: %d", useDescription);
}
+void cTVGuideSearchTimer::SetStartChannel(int startChannel)
+{
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_CHANNELS_READ;
+ channelMin = Channels->GetByNumber(startChannel);
+#else
+ channelMin = Channels.GetByNumber(startChannel);
+#endif
+};
+
+void cTVGuideSearchTimer::SetStopChannel(int stopChannel)
+{
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_CHANNELS_READ;
+ channelMax = Channels->GetByNumber(stopChannel);
+#else
+ channelMax = Channels.GetByNumber(stopChannel);
+#endif
+};