This patch includes one improvement and one bug fix:
Select channels by their index in the TV Guide / current channel group is in my opinion the way how selecting by index should work. In the current implantation you could a) accidentally select a radio channel or b) select a channel which was hidden in the TV guide because you don't have a subscription for it or you simply don't ever want to view that channel.
When zapping to the next or previous channel the ZapOsd threats TV and Radio channels equally, if your DVB provider mixes TV and radio channels on one transponder after scanning your tuning-details would internally look like this:
If you start the TVPlugin and start viewing TV channel 2, then you one channel up. You would expect to see channel 3, but instead the ZapOsd, threating radio and tv channels equally, sends a request to view radio channel 1. The result is a black screen and 2 seconds of radio after which you will be left with just a black screen, not really the behavior we'r looking for I think. This patch fixes the issue by only allowing the ZapOsd to tune in to TV channels.
Edit: Thecurrent previous patch breaks broke zapping by channel number because this method relies on the zapping by channel index method, I am currently testing a version which calls ZapToChannel with an instance of a Channel class instead. PS: Who in gods name made zapping by channel number depend on zapping by channel index
Update: the new patch fixes the zap by channal number issue I introduced in the previous patch. It also removes the GetChannels(bool refresh) method which was already obsolete since revision 26014. This improves the performance of the method because by calling GetChannels(true) on each attempt to zap by channel number a new list<T> was made and populated with all channels available (this resource probably entered gen2 and hench added pressure to the GC while being a completely useless).
- Feat: Zapping to channels by using the numeric keys (1-9) now only selects a channel that is visible in the TvGuide.
- Fix: When having both radio and TV channels the previous and next channel methods would select TV and Radio channels causing several an exception and strange zap behavior.
Select channels by their index in the TV Guide / current channel group is in my opinion the way how selecting by index should work. In the current implantation you could a) accidentally select a radio channel or b) select a channel which was hidden in the TV guide because you don't have a subscription for it or you simply don't ever want to view that channel.
When zapping to the next or previous channel the ZapOsd threats TV and Radio channels equally, if your DVB provider mixes TV and radio channels on one transponder after scanning your tuning-details would internally look like this:
- TV Channel 1
- TV Channel 2
- Radio Channel 1
- TV Channel 3
- Radio Channel 2
- Radio Channel 3
- TV Channel 4
If you start the TVPlugin and start viewing TV channel 2, then you one channel up. You would expect to see channel 3, but instead the ZapOsd, threating radio and tv channels equally, sends a request to view radio channel 1. The result is a black screen and 2 seconds of radio after which you will be left with just a black screen, not really the behavior we'r looking for I think. This patch fixes the issue by only allowing the ZapOsd to tune in to TV channels.
Edit: The
Update: the new patch fixes the zap by channal number issue I introduced in the previous patch. It also removes the GetChannels(bool refresh) method which was already obsolete since revision 26014. This improves the performance of the method because by calling GetChannels(true) on each attempt to zap by channel number a new list<T> was made and populated with all channels available (this resource probably entered gen2 and hench added pressure to the GC while being a completely useless).