Jump to content


Photo

Detect current working channel on the system

channel system

  • Please log in to reply
11 replies to this topic

#1 Mouneer

  • Member
  • 13 posts

0
Neutral

Posted 11 June 2016 - 22:48

Hi All,

 

I wonder if it is applicable to get information about the current working channel on the system. Also, can I add an event handler when channel is changed?



Re: Detect current working channel on the system #2 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 12 June 2016 - 08:48

1. You can get EventInfo of current event from session globals, at least that's how I do it.

event = self.session.screen["Event_Now"].getEvent()

You can look how it's used for example in enigma2 sources in EventView.py

 

2. Yes, you can create ServiceEventTracker, register it to your screen and map event like evStart to trigger your function when new event starts:

        self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
        {
            iPlayableService.evStart: self.__serviceChanged,
        })

For more examples just look in enigma2 sources for ServiceEventTracker.



Re: Detect current working channel on the system #3 Mouneer

  • Member
  • 13 posts

0
Neutral

Posted 12 June 2016 - 20:26

Thanks mx3L. Regarding (1),

event = self.session.screen["Event_Now"].getEvent()

this always gives me None. I investigated about this and tried many things with no luck. Any Idea?



Re: Detect current working channel on the system #4 gutemine

  • Senior Member
  • 873 posts

+68
Good

Posted 12 June 2016 - 21:17

What a great community of OpenSource developers you are here, helping out each other ...

 

He asked about infos on he channel so you probably need to know first which one is running.

import NavigationInstance
cur_ref = NavigationInstance.instance.getCurrentlyPlayingServiceReference()
if cur_ref is not None:                           
   cur_serv=cur_ref.toString()
   print cur_serv

                        
 


Edited by gutemine, 12 June 2016 - 21:19.


Re: Detect current working channel on the system #5 WanWizard

  • Forum Moderator
    PLi® Core member
  • 50,037 posts

+899
Excellent

Posted 12 June 2016 - 21:29

Behave yourself, there is no need to be sarcastic.

 

mx3L might as well have missed the first part of the question. There is no indication whatsoever that he did that on purpose.

 

Without that comment perhaps people would mistakenly have believed you were part of that great community too. On the plus side, good to see you're not falling out of your usual role...


Currently in use: VU+Duo 4K (2xFBC S2), Amiko Viper T2C (T2), SAB Alpha Triple HD (S2+T2), Zgemma H3.T2C (T/C), Zgemma H6 (fallback), VU+Zero (fallback)

Many answers to your question can be found in our new and improved wiki.

note: I do not provide support via PM !

 


Re: Detect current working channel on the system #6 Mouneer

  • Member
  • 13 posts

0
Neutral

Posted 12 June 2016 - 23:36

Great support guys. Thank you all. I succeeded now to get the current playing channel. I need now to get more info about it. I managed to get its number using 

cur_ref.getChannelNum()

I also need to get its name, frequency , and other descriptive info.

 

 I tried 

cur_ref.getName()

and 

cur_ref.getData()

but unfortunately both return empty string. What am I missing? I appreciate your help very much :)


Edited by Mouneer, 12 June 2016 - 23:37.


Re: Detect current working channel on the system #7 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 13 June 2016 - 04:31

You're right guys I somehow misinterpreted the question, thanks for correction.



Re: Detect current working channel on the system #8 Rob van der Does

  • Senior Member
  • 7,731 posts

+184
Excellent

Posted 13 June 2016 - 04:52

On the plus side, good to see you're not falling out of your usual role...

LOL, she's always easy to recognize :)



Re: Detect current working channel on the system #9 Mouneer

  • Member
  • 13 posts

0
Neutral

Posted 13 June 2016 - 09:43

Honestly, it's a great honor for me to have you all at my first post at OpenPLI forum. Pleased to meet you, guys.  :) 
 

Back to my question:
 

I want to get all info about the currently playing service. getName() returns empty string and getData() needs arguments. And originally I don't know whether these methods give my info like channel name, satalite, frequency, Polarization, FEC, Symbol Rate and finally how long has the channel been watched at the time of my inquery - or not. I don't know from where to start. I indeed need all your help, guys. 

Waiting your valuable replies. :)


Edited by Mouneer, 13 June 2016 - 09:45.


Re: Detect current working channel on the system #10 Mouneer

  • Member
  • 13 posts

0
Neutral

Posted 14 June 2016 - 02:03

Any tips/hints guys?



Re: Detect current working channel on the system #11 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 14 June 2016 - 04:59

I don't have direct answer to your question since I don't have experience with this, but I would try to look for keywords in source files of enigma2, then look in most probable source files how it's used.

marko@ openpli-enigma2 $grep -Irsl getData lib/
lib/python/Screens/NetworkSetup.py
lib/python/Screens/ChannelSelection.py
lib/python/enigma.py
lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/plugin.py
lib/python/Plugins/SystemPlugins/WirelessLan/Wlan.py
lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py
lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py
lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py
lib/python/Plugins/Extensions/PicturePlayer/ui.py
lib/python/Components/HdmiCec.py
lib/python/enigma_python.cpp
lib/gdi/picload.h
lib/gdi/picload.cpp
lib/service/servicedvbstream.cpp
lib/service/servicedvbrecord.cpp
lib/service/iservice.h
lib/service/servicets.cpp
lib/service/servicemp3.cpp
lib/service/servicewebts.cpp
lib/service/servicedvb.cpp
lib/network/xmlrpc.h
lib/network/xmlrpc.cpp
lib/driver/hdmi_cec.h
lib/driver/hdmi_cec.cpp
lib/dvb/frontend.cpp
lib/dvb/pmt.h
lib/dvb/frontend.h
lib/dvb/idvb.h
lib/dvb/dvb.cpp
lib/dvb/fbc.cpp
lib/dvb/pmt.cpp
lib/dvb/sec.cpp

So I guess how to use getData on channel could be in ChannelSelection.py?

 

For polarization keyword:

marko@ openpli-enigma2 $grep -Iirsl polarization lib/
lib/python/Screens/Dish.py
lib/python/Screens/ScanSetup.py
lib/python/Screens/ServiceInfo.py
lib/python/Tools/Transponder.py
lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
lib/python/Components/Converter/TransponderInfo.py
lib/python/Components/Converter/PliExtraInfo.py
lib/python/Components/NimManager.py
lib/python/python_helpers.cpp
lib/dvb/frontend.cpp
lib/dvb/idvb.h
lib/dvb/fastscan.h
lib/dvb/fastscan.cpp
lib/dvb/frontendparms.h
lib/dvb/db.cpp
lib/dvb/frontendparms.cpp

So Transporder.py or ServiceInfo.py for polarization, etc...



Re: Detect current working channel on the system #12 Mouneer

  • Member
  • 13 posts

0
Neutral

Posted 14 June 2016 - 22:04

great tip bro. I will try it. Thank you :)







Also tagged with one or more of these keywords: channel, system

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users