summaryrefslogtreecommitdiff
path: root/status.c
blob: 115d238845e13394e5c61bf964caf90fcae14ad7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
 * targavfd plugin for VDR (C++)
 *
 * (C) 2010 Andreas Brachold <vdr07 AT deltab de>
 *
 * This targavfd plugin is free software: you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation, version 3 of the License.
 *
 * See the files README and COPYING for details.
 *
 */

#include <stdint.h>
#include <time.h>
#include <vdr/eitscan.h>

#include "watch.h"
#include "status.h"

//#define MOREDEBUGMSG

// ---
cVFDStatusMonitor::cVFDStatusMonitor(cVFDWatch*    pDev)
: m_pDev(pDev)
{

}

void cVFDStatusMonitor::ChannelSwitch(const cDevice *pDevice, int nChannelNumber)
{
    if (nChannelNumber > 0 
        && pDevice->IsPrimaryDevice() 
        && !EITScanner.UsesDevice(pDevice)
        && (nChannelNumber == cDevice::CurrentChannel()))
    {
#ifdef MOREDEBUGMSG
        dsyslog("targaVFD: channel switched to %d on DVB %d", nChannelNumber, pDevice->CardIndex());
#endif
        m_pDev->Channel(nChannelNumber);
    }
}

void cVFDStatusMonitor::SetVolume(int Volume, bool Absolute)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: SetVolume  %d %d", Volume, Absolute);
#endif
  m_pDev->Volume(Volume,Absolute);
}

void cVFDStatusMonitor::Recording(const cDevice *pDevice, const char *szName, const char *szFileName, bool bOn)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: Recording  %d %s", pDevice->CardIndex(), szName);
#endif
  m_pDev->Recording(pDevice,szName,szFileName,bOn);
}

void cVFDStatusMonitor::Replaying(const cControl *pControl, const char *szName, const char *szFileName, bool bOn)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: Replaying  %s", szName);
#endif
  m_pDev->Replaying(pControl,szName,szFileName,bOn);
}

void cVFDStatusMonitor::OsdClear(void)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: OsdClear");
#endif
  m_pDev->OsdClear();
}

void cVFDStatusMonitor::OsdTitle(const char *Title)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: OsdTitle '%s'", Title);
#endif
  m_pDev->OsdTitle(Title);
}

void cVFDStatusMonitor::OsdStatusMessage(const char *szMessage)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: OsdStatusMessage '%s'", szMessage ? szMessage : "NULL");
#endif
  m_pDev->OsdStatusMessage(szMessage);
}

void cVFDStatusMonitor::OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue)
{
#ifdef unusedMOREDEBUGMSG
  dsyslog("targaVFD: OsdHelpKeys %s - %s - %s - %s", Red, Green, Yellow, Blue);
#endif
}

void cVFDStatusMonitor::OsdCurrentItem(const char *szText)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: OsdCurrentItem %s", szText);
#endif
  m_pDev->OsdCurrentItem(szText);
}

void cVFDStatusMonitor::OsdTextItem(const char *Text, bool Scroll)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: OsdTextItem %s %d", Text, Scroll);
#endif
}

void cVFDStatusMonitor::OsdChannel(const char *Text)
{
#ifdef MOREDEBUGMSG
  dsyslog("targaVFD: OsdChannel %s", Text);
#endif
}

void cVFDStatusMonitor::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("targaVFD: 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
}