News:

Latest versions:
Server plugin: 0.5.1
MVP dongle: 0.5.2
Raspberry Pi client: 0.5.2
Windows client: 0.5.2-1

Main Menu

cPlugin::Active()

Started by Harry, April 20, 2006, 14:49:47

Previous topic - Next topic

Harry

Quoteposted by Chris
I will implement this for the next plugin version, since this ability has been requested before on here.
does this mean the idle timer will be reset on every keypress?  ;D
would be superb.

Chris

Well.. A tricky one this. I havn't looked at the VDR code yet but I assume it will be trivial to do this active() call. As I still have not seen VDR frontend at work and I certainly am totally unaware of why and how this idle timeout system should work, I realise that I need a bit of input to tell me when this active should be called. What is the point of it in VDR? When would you have this shutdown timer active? Is it some sort of sleep timer which _should_ interrupt the stream on vdr / stream to mvp and shut down VDR after a certain amount of user-idle time, or do you want the fact that the mvp is streaming to call active() and keep resetting the timer? I doubt having every key press on the MVP would have much point (or would it?). Do you even want the MVP/plugin to call active even if there is just the welcome menu on the MVP?

Input!  ;D

Harry

heehee....

you've made my brain reboot again  ;)
good point here.

for the time being, i'm using a script that checks (among
other things) whether a vomp client has an active connection.
if so, the server doesn't shut down after the idle period expires.

so... yes: any active streaming should be considered for calling
cPlugin::Active() every 5 minutes -ish.
(hmm... would this collide with a sleep-timer?)

having said this, i have to pull back my earlier wish for calling
cPlugin::Active() after every key stroke. wouldn't make much
sense, would it?

cheers,
Harry

Chris

I dunno, it might make sense, but not really have much point (since streaming should cause enough active calls anyway ?) and could be a pain to do.

Well if you have any more ideas... :)

And anyone else, chip in with ideas!

Anyway, now that I have my dev system rebuilt I might take a look at these timers to see what they are all about.

davep

How about the VOMP plugin calling  cPlugin::Active() every five minutes if there has been some interaction with a client during the previous five minutes? That would cover a user browsing the menus as well as streaming video.

Chris

Actually having looked at it, it is called the other way around - VDR calls Vompserver::active() to ask the plugin if it is still active. The plugin is expected to return a string containing a reason why VDR should not shut down if necessary. This would throw off the idea of this being useful for the VDR idle/sleep timer(s) because this active() call is all about presenting the user with a reason on screen why they should cancel their shutdown request.

MartenR

I have again looked at it and additionally at vdr.c. Returning an string in the method Active does also prevent the vdr to shutdown. The only thing which have to be done for implementation is to have an internal time for the last client request and if this time is more than x minutes ago, than we would return NULL and if not an string like "Vomp clients showed activety in the last x minutes".
And this would behave like we want to.
The only question for me is, how the cpluginvompserver object can access the mvpclient objects status?

Marten

pompase

#7
As fas as I understood CPlugin:Active all plugins running with vdr are asked whether they are active or not. In case at least one plugin is active vdr does not shutdown. This in my opinion is the perfect place for the vompserver to avoid vdr shutdown while at least one vomp client is connected.
As I want to implement a vdr remote shutdown by vomp (inclusive a sleep timer for vomp itself) I have  to do some more considerations. In case i want to shutdown vdr by vomp onyl the last vomp client connected should shutdown vdr. In this case the vompserver plugin has to remove the active state only when no other vomp is connected anymore not to break its own shutdown request.

pompase

Hello,
I wrote a patch to apply the active function to vompserver. As long as atleast one vomp client is connected vdr resumes to shutdown with a message that a vompclient is connected. If you want to shutdown vdr anyway you can press ok to shutdown. Anyone that wants to test the vompserver plugin patch is welcome.
You can donwload the patch at
http://www.pompase.net//joomla/index.php?option=com_remository&Itemid=33&func=fileinfo&id=6

Chris

Hello all, I have applied the cplugin::active part of the patch to cvs. Thanks for the work pompase.

pompase

#10
This means, all of my patches (except from the shutdown patch)  are currently in the main tree. As soon as I have some free time (after working on my mediad plugin), I am going to implement the sleep timer functions :-).

By the way, Chris, do you plan to implement the shutdown stuff also?