Show OSD help
Posted: Mon Feb 03, 2014 5:11 am
Ok so I did some research, and im coming up with blanks. I am not very educated on python, but i kind of understand it.
Basically I made an on screen menu for a sleep timer with the options 60 90 120 and cancel, so it will stop media players and send ir signal to turn of tv. I would like an osd to show current remaining time when I bring up the menu for a few seconds, so I can track how much longer is on the sleep timer.
So to have ShowOSD show this I have gotten this far
I know I need to insert python info in brackets such as {eg.plugins.timer.............}
The timer is named sleep, and I go into the python sonsole and look through all the name space, and I don't think there is a value that shows remaining time, just a value that shows when the end event will happen. but even that is foreign to me. This is what I could find.
eg.plugins.Timer.plugin.timerObjects[Sleep].nextEventAt
Type: <type 'float'>
Value: 1391405993.35
Now the sleep in the brackets in timerObjects[sleep] messes things up, when the following is entered into the console
eg.plugins.Timer.plugin.timerObjects[Sleep].nextEventAt
it shows
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'Sleep' is not defined
So first I need to figure out how to get this value and convert it in some sort of time format, then I am going to have to recieve the current system time, have it do some subtraction in a seperate python script and write that value to its own namespace. then have the show osd plugin in show the value for that name space.
Am I on the right track here?
If someone is interested in a interesting project and figure this out for me it would be great, seeing the finished product would help me learn a bit more about what I can do with the show OSD plugin.
Thanks
Basically I made an on screen menu for a sleep timer with the options 60 90 120 and cancel, so it will stop media players and send ir signal to turn of tv. I would like an osd to show current remaining time when I bring up the menu for a few seconds, so I can track how much longer is on the sleep timer.
So to have ShowOSD show this I have gotten this far
I know I need to insert python info in brackets such as {eg.plugins.timer.............}
The timer is named sleep, and I go into the python sonsole and look through all the name space, and I don't think there is a value that shows remaining time, just a value that shows when the end event will happen. but even that is foreign to me. This is what I could find.
eg.plugins.Timer.plugin.timerObjects[Sleep].nextEventAt
Type: <type 'float'>
Value: 1391405993.35
Now the sleep in the brackets in timerObjects[sleep] messes things up, when the following is entered into the console
eg.plugins.Timer.plugin.timerObjects[Sleep].nextEventAt
it shows
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'Sleep' is not defined
So first I need to figure out how to get this value and convert it in some sort of time format, then I am going to have to recieve the current system time, have it do some subtraction in a seperate python script and write that value to its own namespace. then have the show osd plugin in show the value for that name space.
Am I on the right track here?
If someone is interested in a interesting project and figure this out for me it would be great, seeing the finished product would help me learn a bit more about what I can do with the show OSD plugin.
Thanks