--- a/devstatus.c +++ b/devstatus.c @@ -55,8 +55,14 @@ int channelNo; cChannel *channel = NULL; +#if VDRVERSNUM < 20300 for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) { if( (channel = Channels.GetByNumber(channelNo)) ) { +#else + LOCK_CHANNELS_READ; + for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) { + if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) { +#endif if (d->IsTunedToTransponder(channel)) { return channel; } @@ -78,8 +84,14 @@ cChannel *resChannel = NULL; int oldQRG = getTunedFrequency(device); +#if VDRVERSNUM < 20300 for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) { if( (channel = Channels.GetByNumber(channelNo)) ) { +#else + LOCK_CHANNELS_READ; + for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) { + if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) { +#endif if( device->ProvidesSource( channel->Source() ) ) { // same source (DVB-T, -S, ...) if( !ISTRANSPONDER(channel->Frequency(),oldQRG) ) { //not the same transponder if( channel->Frequency()*direction > oldQRG*direction ) { @@ -152,7 +164,11 @@ int GetChannelNr() { return ChannelNr; } bool IsChannel() { return ChannelNr != 0; } bool HasDevice() { return DeviceNr >= 0; } +#if VDRVERSNUM < 20300 cChannel* GetChannel() { return Channels.GetByNumber(ChannelNr); } +#else + cChannel* GetChannel() { LOCK_CHANNELS_READ; return (cChannel*) Channels->GetByNumber(ChannelNr); } +#endif cDevice* GetDevice() { return cDevice::GetDevice(DeviceNr); }; }; @@ -279,8 +295,15 @@ int channelNo; cChannel *channel = NULL; +#if VDRVERSNUM < 20300 for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) { if( (channel = Channels.GetByNumber(channelNo)) ) { +#else + LOCK_CHANNELS_READ; + for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) { + if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) { + +#endif if (d->IsTunedToTransponder(channel)) { bool currentLive = channelNo == d->CurrentChannel() && (i == cDevice::ActualDevice()->CardIndex()); @@ -350,7 +373,12 @@ eOSState Play(char* file) { // Play the selected recording cRecording* recordingFound = NULL; +#if VDRVERSNUM < 20300 for(cRecording* recording = Recordings.First(); recording; recording = Recordings.Next(recording)) +#else + LOCK_RECORDINGS_READ; + for(cRecording* recording = (cRecording*) Recordings->First(); recording; recording = (cRecording*) Recordings->Next(recording)) +#endif if (strstr(recording->Title(), file)) recordingFound = recording; if (!recordingFound) @@ -405,7 +433,12 @@ ri = (cMenuRecItem*)Get(Current()); if (ri->Selectable()) { if (ri->IsChannel()) { +#if VDRVERSNUM < 20300 Channels.SwitchTo(ri->GetChannelNr()); +#else + LOCK_CHANNELS_READ; + Channels->SwitchTo(ri->GetChannelNr()); +#endif Write(); //repaint; maybe 'Live' has changed return osContinue; } else @@ -635,7 +668,12 @@ #endif if (Name) { // insert new timers currently recording in TimersRecording +#if VDRVERSNUM < 20300 for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) +#else + LOCK_TIMERS_READ; + for (cTimer *ti = (cTimer*) Timers->First(); ti; ti = (cTimer*) Timers->Next(ti)) +#endif if (ti->Recording()) { // check if this is a new entry bool bFound = false;