2010-07-19, 08:49 AM
Hi sub,
If you've got a minute, could you look over the following for me. It relates to the "Update EPG" command I have in the System plugin...
What I have seems to work (most of the time), but I'd just like to know I've done it the way you'd expect. The few problems I've seen relate to quitting while an update is in progress, or trying to record/tune live tv at the same time. Part of the problem is I'm developing with a different hardware/OS setup compared to what I've had stable for years with GBPVR, so I'm never sure whether problems are related to my setup, or nPVR's beta status, etc.
Stripping away the crud leaves:
I found it had to be done in another thread otherwise nPVR just hung while it ran.
There are references to EPG related things elsewhere in the libraries but this looked like the best way of doing it.
Is is ok to create a new EPGManager like that, or should I be retrieving one from elsewhere (factory method or somesuch)?
Thanks
Iain
If you've got a minute, could you look over the following for me. It relates to the "Update EPG" command I have in the System plugin...
What I have seems to work (most of the time), but I'd just like to know I've done it the way you'd expect. The few problems I've seen relate to quitting while an update is in progress, or trying to record/tune live tv at the same time. Part of the problem is I'm developing with a different hardware/OS setup compared to what I've had stable for years with GBPVR, so I'm never sure whether problems are related to my setup, or nPVR's beta status, etc.
Stripping away the crud leaves:
Code:
class NSystemStatus : EPGManager.IEPGUpdateCallback
{
void UpdateEPG()
{
new Thread(EPGRunner).Start();
}
void EPGRunner()
{
EPGManager epg = new EPGManager();
epg.UpdateEPG(this);
}
public bool SetEPGUpdateStatus(string status)
{
// Display the status message...
return true;
}
}
I found it had to be done in another thread otherwise nPVR just hung while it ran.
There are references to EPG related things elsewhere in the libraries but this looked like the best way of doing it.
Is is ok to create a new EPGManager like that, or should I be retrieving one from elsewhere (factory method or somesuch)?
Thanks
Iain