[vdr] check cam status [writing plugin help needed]
Simon Baxter
linuxtv at nzbaxters.com
Wed Aug 18 04:18:33 CEST 2010
> I'd like to write a plugin which can provide the displayed Setup>CAM
> status via an SVDRP command, and maybe check the CAM menu can be accessed.
>
> As a beginner to such things, can someone help?
I basically want to implement bits of menu.c (the CAM status and menu
accessing parts) via SVDRP.
Can someone please help?
> If I pull some of the following from menu.c I think this should give me
> what I want:
>
> Get list of availablecams:
> void cMenuCam::GenerateTitle(const char *s)
> {
> SetTitle(cString::sprintf("CAM %d - %s", camSlot->SlotNumber(), (s && *s)
> ? s : camSlot->GetCamName()));
> }
>
> Get the CAM status (being Ready, Present, -, or "Alphacrypt" etc:
> bool cMenuSetupCAMItem::Changed(void)
> {
> char buffer[32];
> const char *CamName = camSlot->GetCamName();
> if (!CamName) {
> switch (camSlot->ModuleStatus()) {
> case msReset: CamName = tr("CAM reset"); break;
> case msPresent: CamName = tr("CAM present"); break;
> case msReady: CamName = tr("CAM ready"); break;
> default: CamName = "-"; break;
> }
> }
> snprintf(buffer, sizeof(buffer), " %d %s", camSlot->SlotNumber(),
> CamName);
> if (strcmp(buffer, Text()) != 0) {
> SetText(buffer);
> return true;
> }
> return false;
> }
More information about the vdr
mailing list