[mythtv] Ticket #3910: Mythshutdown cleanup / ShutdownWakeup Class
mythtv at dsl.pipex.com
Sun Sep 2 21:08:45 UTC 2007
Matthew Wire wrote:
>> Replying to [comment:1 Matthew Wire <devel at mrwire.co.uk>]:
>> > I'm trying to work on some shutdown/wakeup features at the moment and
>> part of this includes centralising all the shutdown/wakeup functions into
>> a shutdownwakeup class within libmyth. The changes on this patch facilite
>> part of this.
>> Can you be a little more specific about where you are going with all this.
>> What is the final goal? I'm not sure Isaac and the other devs will want to
>> add extra stuff to libmyth unless there is a very good reason to do so.
> Currently there is a significant amount of duplication with code
> involving shutdown/wakeup stuff. There is code in mythshutdown,
> mythwelcome, scheduler(mythbackend), mythfrontend all dealing with
> There's various things I'd like to see in MythTV such as an improved
> system-wide sleep timer, alarm clock etc. and centralising the
> shutdown/wakeup code should go some way to facilitating this.
> So, the way I've gone about this at the moment is to create a new class
> called ShutdownWakeup within libmyth (shutdownwakeup.h/cpp) and
> gradually migrate functions from elsewhere into this class.
> I've reduced mythshutdown to four functions by using this class.
> Mythwelcome doesn't call mythshutdown every time it needs status info
> and can call getStatus() instead. Scheduler and mythwelcome both call
> WasStartedAutomatically instead of using their internal copy.
> A fictional alarm plugin would call setWakeupTime for example.
> I plan to add more helper functions for shutting down etc. as well.
> Any comments would of course be much appreciated and if it would be
> better in libmythtv or elsewhere please do let me know!
That all sounds reasonable to me. libmyth would seem to be the logical
place for it since it's all part of the core functionality and it makes
it easier for external progs like mythwelcome, mythshutdown and even the
plugins to use it since they have to link to libmyth anyway.
More information about the mythtv-dev