NextPVR Forums

Full Version: Question on C# libs regarding EPG 'serviceType'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Using C# classes 'Channel' and 'EPGEvent', is there a(n easy) way to detect whether the channel is a radio channel or a TV channel through the provided DLLs? I have a C# class that browses through a Dictionary<Channel, List<EPGEvent> list and would like to filter out all radio channels? I failed to see a 'typeOfService' member in either of the aforementioned classes (where I would expect a value '02' standing for digital radio). What comes close is the member "channel.GetChannelMapping(<captureSourceOID>).serviceType, but I am not sure this is the correct member nor do I know what to specify as <captureSourceOID>.

Does anybody has some advise on how this could be done?

Tanks in advance
Frederic
You would have to look at the mappings for each channel to determine it's types.

The reasons it is on the channel mapping is because different mappings can carry different types of content. For example, one channel might be MPEG2 from one capture device, and H.264 from another. Another example might a radio station being MPEG1 audio from one device and AAC audio from another. That said, its unlikely to be a radio type from one source and video from another, so you can just do this to tell:

Code:
if (channel.Mappings.Count > 0)
                                    {
                                        int serviceType = channel.Mappings[0].serviceType;
                                        if (serviceType == 0x02 || serviceType == 0x0A)
                                        {
                                            ...radio...
                                        }
                                    }
works like a charm, thanks!