/* * iMON LCD plugin to VDR (C++) * * (C) 2009 Andreas Brachold * * This code is distributed under the terms and conditions of the * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details. * */ #include #include #include #include "watch.h" #include "status.h" //#define MOREDEBUGMSG // --- ciMonStatusMonitor::ciMonStatusMonitor(ciMonWatch* pDev) : m_pDev(pDev) { } void ciMonStatusMonitor::ChannelSwitch(const cDevice *pDevice, int nChannelNumber) { if (nChannelNumber > 0 && pDevice->IsPrimaryDevice() && !EITScanner.UsesDevice(pDevice) && (nChannelNumber == cDevice::CurrentChannel())) { #ifdef MOREDEBUGMSG dsyslog("iMonLCD: channel switched to %d on DVB %d", nChannelNumber, pDevice->CardIndex()); #endif m_pDev->Channel(nChannelNumber); } } void ciMonStatusMonitor::SetVolume(int Volume, bool Absolute) { #ifdef MOREDEBUGMSG dsyslog("iMonLCD: SetVolume %d %d", Volume, Absolute); #endif m_pDev->Volume(Volume,Absolute); } void ciMonStatusMonitor::Recording(const cDevice *pDevice, const char *szName, const char *szFileName, bool bOn) { #ifdef MOREDEBUGMSG dsyslog("iMonLCD: Recording %d %s", pDevice->CardIndex(), szName); #endif m_pDev->Recording(pDevice,szName,szFileName,bOn); } void ciMonStatusMonitor::Replaying(const cControl *pControl, const char *szName, const char *szFileName, bool bOn) { #ifdef MOREDEBUGMSG dsyslog("iMonLCD: Replaying %s", szName); #endif m_pDev->Replaying(pControl,szName,szFileName,bOn); } void ciMonStatusMonitor::OsdClear(void) { #ifdef unusedMOREDEBUGMSG dsyslog("iMonLCD: OsdClear"); #endif } void ciMonStatusMonitor::OsdTitle(const char *Title) { #ifdef unusedMOREDEBUGMSG dsyslog("iMonLCD: OsdTitle '%s'", Title); #endif } void ciMonStatusMonitor::OsdStatusMessage(const char *szMessage) { #ifdef MOREDEBUGMSG dsyslog("iMonLCD: OsdStatusMessage '%s'", szMessage ? szMessage : "NULL"); #endif m_pDev->StatusMessage(szMessage); } void ciMonStatusMonitor::OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue) { #ifdef unusedMOREDEBUGMSG dsyslog("iMonLCD: OsdHelpKeys %s - %s - %s - %s", Red, Green, Yellow, Blue); #endif } void ciMonStatusMonitor::OsdCurrentItem(const char *Text) { #ifdef unusedMOREDEBUGMSG dsyslog("iMonLCD: OsdCurrentItem %s", Text); #endif } void ciMonStatusMonitor::OsdTextItem(const char *Text, bool Scroll) { #ifdef unusedMOREDEBUGMSG dsyslog("iMonLCD: OsdTextItem %s %d", Text, Scroll); #endif } void ciMonStatusMonitor::OsdChannel(const char *Text) { #ifdef unusedMOREDEBUGMSG dsyslog("iMonLCD: OsdChannel %s", Text); #endif } void ciMonStatusMonitor::OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) { #ifdef unusedMOREDEBUGMSG char buffer[25]; struct tm tm_r; dsyslog("iMonLCD: OsdProgramme"); strftime(buffer, sizeof(buffer), "%R", localtime_r(&PresentTime, &tm_r)); dsyslog("%5s %s", buffer, PresentTitle); dsyslog("%5s %s", "", PresentSubtitle); strftime(buffer, sizeof(buffer), "%R", localtime_r(&FollowingTime, &tm_r)); dsyslog("%5s %s", buffer, FollowingTitle); dsyslog("%5s %s", "", FollowingSubtitle); #endif }