Feature #1038 » vdr-plugin-dm140vfd-0.0.6.diff
vdr-plugin-dm140vfd-0.0.6/bitmap.c 2010-12-30 09:19:10.000000000 +0100 | ||
---|---|---|
/*
|
||
* targavfd plugin for VDR (C++)
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
*
|
||
* This targavfd plugin is free software: you can redistribute it and/or
|
||
* This dm140vfd 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.
|
||
*
|
vdr-plugin-dm140vfd-0.0.6/bitmap.h 2010-12-29 16:33:19.000000000 +0100 | ||
---|---|---|
/*
|
||
* targavfd plugin for VDR (C++)
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
*
|
||
* This targavfd plugin is free software: you can redistribute it and/or
|
||
* This dm140vfd 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.
|
||
*
|
vdr-plugin-dm140vfd-0.0.6/dm140vfd.c 2010-12-30 09:39:26.000000000 +0100 | ||
---|---|---|
/*
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
*
|
||
* This dm140vfd 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 <vdr/plugin.h>
|
||
#include <getopt.h>
|
||
#include <string.h>
|
||
#include "dm140vfd.h"
|
||
#include "vfd.h"
|
||
#include "watch.h"
|
||
#include "status.h"
|
||
#include "setup.h"
|
||
static const char *VERSION = "0.0.6";
|
||
cPluginDm140VFD::cPluginDm140VFD(void)
|
||
{
|
||
m_bSuspend = true;
|
||
statusMonitor = NULL;
|
||
m_szIconHelpPage = NULL;
|
||
}
|
||
cPluginDm140VFD::~cPluginDm140VFD()
|
||
{
|
||
//Cleanup if'nt throw housekeeping
|
||
if(statusMonitor) {
|
||
delete statusMonitor;
|
||
statusMonitor = NULL;
|
||
}
|
||
if(m_szIconHelpPage) {
|
||
free(m_szIconHelpPage);
|
||
m_szIconHelpPage = NULL;
|
||
}
|
||
}
|
||
const char* cPluginDm140VFD::Version(void) {
|
||
return VERSION;
|
||
}
|
||
const char* cPluginDm140VFD::Description(void) {
|
||
return tr("Control a dm140 vfd");
|
||
}
|
||
const char *cPluginDm140VFD::CommandLineHelp(void)
|
||
{
|
||
// Return a string that describes all known command line options.
|
||
return "";
|
||
}
|
||
bool cPluginDm140VFD::ProcessArgs(int argc, char *argv[])
|
||
{
|
||
return true;
|
||
}
|
||
bool cPluginDm140VFD::Initialize(void)
|
||
{
|
||
// Initialize any background activities the plugin shall perform.
|
||
return true;
|
||
}
|
||
bool cPluginDm140VFD::resume() {
|
||
if(m_bSuspend
|
||
&& m_dev.open()) {
|
||
m_bSuspend = false;
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
bool cPluginDm140VFD::suspend() {
|
||
if(!m_bSuspend) {
|
||
m_dev.shutdown(eOnExitMode_BLANKSCREEN);
|
||
m_bSuspend = true;
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
bool cPluginDm140VFD::Start(void)
|
||
{
|
||
if(resume()) {
|
||
statusMonitor = new cVFDStatusMonitor(&m_dev);
|
||
if(NULL == statusMonitor){
|
||
esyslog("DM140VFD: can't create cVFDStatusMonitor!");
|
||
return (false);
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
void cPluginDm140VFD::Stop(void)
|
||
{
|
||
if(statusMonitor) {
|
||
delete statusMonitor;
|
||
statusMonitor = NULL;
|
||
}
|
||
m_dev.shutdown(theSetup.m_nOnExit);
|
||
}
|
||
void cPluginDm140VFD::Housekeeping(void)
|
||
{
|
||
// Perform any cleanup or other regular tasks.
|
||
}
|
||
void cPluginDm140VFD::MainThreadHook(void)
|
||
{
|
||
// Perform actions in the context of the main program thread.
|
||
// WARNING: Use with great care - see PLUGINS.html!
|
||
}
|
||
cString cPluginDm140VFD::Active(void)
|
||
{
|
||
// Return a message string if shutdown should be postponed
|
||
return NULL;
|
||
}
|
||
time_t cPluginDm140VFD::WakeupTime(void)
|
||
{
|
||
// Return custom wakeup time for shutdown script
|
||
return 0;
|
||
}
|
||
cOsdObject *cPluginDm140VFD::MainMenuAction(void)
|
||
{
|
||
return NULL;
|
||
}
|
||
cMenuSetupPage *cPluginDm140VFD::SetupMenu(void)
|
||
{
|
||
return new cVFDMenuSetup(&m_dev);
|
||
}
|
||
bool cPluginDm140VFD::SetupParse(const char *szName, const char *szValue)
|
||
{
|
||
return theSetup.SetupParse(szName,szValue);
|
||
}
|
||
const char* cPluginDm140VFD::SVDRPCommandOn(const char *Option, int &ReplyCode)
|
||
{
|
||
if(!m_bSuspend) {
|
||
ReplyCode=251;
|
||
return "driver already resumed";
|
||
}
|
||
if(resume()) {
|
||
ReplyCode=250;
|
||
return "driver resumed";
|
||
} else {
|
||
ReplyCode=554;
|
||
return "driver could not resumed";
|
||
}
|
||
}
|
||
const char* cPluginDm140VFD::SVDRPCommandOff(const char *Option, int &ReplyCode)
|
||
{
|
||
if(suspend()) {
|
||
ReplyCode=250;
|
||
return "driver suspended";
|
||
} else {
|
||
ReplyCode=251;
|
||
return "driver already suspended";
|
||
}
|
||
}
|
||
static const struct {
|
||
unsigned int nIcon;
|
||
const char* szIcon;
|
||
} icontable[] = {
|
||
{ eIconPLAY , "Play" },
|
||
{ eIconPAUSE , "Pause" },
|
||
{ eIconRECORD , "Record" },
|
||
{ eIconMESSAGE , "Msg" },
|
||
{ eIconMSGAT , "MsgAt" },
|
||
{ eIconMUTE , "Mute" },
|
||
{ eIconWLAN1 , "WLAN1" },
|
||
{ eIconWLAN2 , "WLAN2" },
|
||
{ eIconWLAN3 , "WLAN3" },
|
||
{ eIconWLAN4 , "WLAN4" },
|
||
{ eIconVOLUME , "Volume" },
|
||
{ eIconVOL1 , "Level1" },
|
||
{ eIconVOL2 , "Level2" },
|
||
{ eIconVOL3 , "Level3" },
|
||
{ eIconVOL4 , "Level4" },
|
||
{ eIconVOL5 , "Level5" },
|
||
{ eIconVOL6 , "Level6" },
|
||
{ eIconVOL7 , "Level7" },
|
||
{ eIconVOL8 , "Level8" },
|
||
{ eIconVOL9 , "Level9" },
|
||
{ eIconVOL10 , "Level10" },
|
||
{ eIconVOL11 , "Level11" },
|
||
{ eIconVOL12 , "Level12" }
|
||
// { eIconVOL12 , "Level12" },
|
||
// { eIconVOL13 , "Level13" },
|
||
// { eIconVOL14 , "Level14" }
|
||
};
|
||
const char* cPluginDm140VFD::SVDRPCommandIcon(const char *Option, int &ReplyCode)
|
||
{
|
||
if(m_bSuspend) {
|
||
ReplyCode=251;
|
||
return "driver suspended";
|
||
}
|
||
if( Option && strlen(Option) < 256) {
|
||
char* request = strdup(Option);
|
||
char* cmd = NULL;
|
||
if( request ) {
|
||
char* tmp = request;
|
||
eIconState m = eIconStateQuery;
|
||
cmd = strtok_r(request, " ", &tmp);
|
||
if(cmd) {
|
||
char* param = strtok_r(0, " ", &tmp);
|
||
if(param) {
|
||
if(!strcasecmp(param,"ON")) {
|
||
m = eIconStateOn;
|
||
} else if(!strcasecmp(param,"OFF")) {
|
||
m = eIconStateOff;
|
||
} else if(!strcasecmp(param,"AUTO")) {
|
||
m = eIconStateAuto;
|
||
} else {
|
||
ReplyCode=501;
|
||
free(request);
|
||
return "unknown icon state";
|
||
}
|
||
}
|
||
}
|
||
ReplyCode=501;
|
||
const char* szReplay = "unknown icon title";
|
||
if(cmd) {
|
||
unsigned int i;
|
||
for(i = 0; i < (sizeof(icontable)/sizeof(*icontable));++i)
|
||
{
|
||
if(0 == strcasecmp(cmd,icontable[i].szIcon))
|
||
{
|
||
eIconState r = m_dev.ForceIcon(icontable[i].nIcon, m);
|
||
switch(r) {
|
||
case eIconStateAuto:
|
||
ReplyCode=250;
|
||
szReplay = "icon state 'auto'";
|
||
break;
|
||
case eIconStateOn:
|
||
ReplyCode=251;
|
||
szReplay = "icon state 'on'";
|
||
break;
|
||
case eIconStateOff:
|
||
ReplyCode=252;
|
||
szReplay = "icon state 'off'";
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
free(request);
|
||
return szReplay;
|
||
}
|
||
}
|
||
ReplyCode=501;
|
||
return "wrong parameter";
|
||
}
|
||
cString cPluginDm140VFD::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
|
||
{
|
||
ReplyCode=501;
|
||
const char* szReplay = "unknown command";
|
||
if(!strcasecmp(Command, "ON")) {
|
||
szReplay = SVDRPCommandOn(Option,ReplyCode);
|
||
} else if(!strcasecmp(Command, "OFF")) {
|
||
szReplay = SVDRPCommandOff(Option,ReplyCode);
|
||
} else if(!strcasecmp(Command, "ICON")) {
|
||
szReplay = SVDRPCommandIcon(Option,ReplyCode);
|
||
}
|
||
dsyslog("DM140VFD: SVDRP %s %s - %d (%s)", Command, Option, ReplyCode, szReplay);
|
||
return szReplay;
|
||
}
|
||
const char **cPluginDm140VFD::SVDRPHelpPages(void)
|
||
{
|
||
if(!m_szIconHelpPage) {
|
||
unsigned int i,l,k;
|
||
for(i = 0,l = 0, k = (sizeof(icontable)/sizeof(*icontable)); i < k;++i) {
|
||
l += strlen(icontable[i].szIcon);
|
||
l += 2;
|
||
}
|
||
l += 80;
|
||
m_szIconHelpPage = (char*) calloc(l + 1,1);
|
||
if(m_szIconHelpPage) {
|
||
strncat(m_szIconHelpPage, "ICON [name] [on|off|auto]\n Force state of icon. Names of icons are:", l);
|
||
for(i = 0; i < k;++i) {
|
||
if((i % 7) == 0) {
|
||
strncat(m_szIconHelpPage, "\n ", l - (strlen(m_szIconHelpPage) + 5));
|
||
} else {
|
||
strncat(m_szIconHelpPage, ",", l - (strlen(m_szIconHelpPage) + 1));
|
||
}
|
||
strncat(m_szIconHelpPage, icontable[i].szIcon,
|
||
l - (strlen(m_szIconHelpPage) + strlen(icontable[i].szIcon)));
|
||
}
|
||
}
|
||
}
|
||
// Return help text for SVDRP commands this plugin implements
|
||
static const char *HelpPages[] = {
|
||
"ON\n"
|
||
" Resume driver of display.\n",
|
||
"OFF\n"
|
||
" Suspend driver of display.\n",
|
||
"ICON [name] [on|off|auto]\n"
|
||
" Force state of icon.\n",
|
||
NULL
|
||
};
|
||
if(m_szIconHelpPage)
|
||
HelpPages[2] = m_szIconHelpPage;
|
||
return HelpPages;
|
||
}
|
||
VDRPLUGINCREATOR(cPluginDm140VFD); // Don't touch this!
|
vdr-plugin-dm140vfd-0.0.6/dm140vfd.h 2010-12-29 16:33:19.000000000 +0100 | ||
---|---|---|
/*
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
*
|
||
* This dm140vfd 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.
|
||
*
|
||
*/
|
||
#ifndef __DM140VFD_H___
|
||
#define __DM140VFD_H___
|
||
#include <vdr/plugin.h>
|
||
#include "vfd.h"
|
||
#include "watch.h"
|
||
#include "status.h"
|
||
class cPluginDm140VFD : public cPlugin {
|
||
private:
|
||
cVFDStatusMonitor *statusMonitor;
|
||
cVFDWatch m_dev;
|
||
bool m_bSuspend;
|
||
char* m_szIconHelpPage;
|
||
protected:
|
||
bool resume();
|
||
bool suspend();
|
||
const char* SVDRPCommandOn(const char *Option, int &ReplyCode);
|
||
const char* SVDRPCommandOff(const char *Option, int &ReplyCode);
|
||
const char* SVDRPCommandIcon(const char *Option, int &ReplyCode);
|
||
public:
|
||
cPluginDm140VFD(void);
|
||
virtual ~cPluginDm140VFD();
|
||
virtual const char *Version(void);
|
||
virtual const char *Description(void);
|
||
virtual const char *CommandLineHelp(void);
|
||
virtual bool ProcessArgs(int argc, char *argv[]);
|
||
virtual bool Initialize(void);
|
||
virtual bool Start(void);
|
||
virtual void Stop(void);
|
||
virtual void Housekeeping(void);
|
||
virtual void MainThreadHook(void);
|
||
virtual cString Active(void);
|
||
virtual time_t WakeupTime(void);
|
||
virtual const char *MainMenuEntry(void) { return NULL; }
|
||
virtual cOsdObject *MainMenuAction(void);
|
||
virtual cMenuSetupPage *SetupMenu(void);
|
||
virtual bool SetupParse(const char *Name, const char *Value);
|
||
virtual bool Service(const char *Id, void *Data = NULL);
|
||
virtual const char **SVDRPHelpPages(void);
|
||
virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
|
||
};
|
||
#endif
|
vdr-plugin-dm140vfd-0.0.6/ffont.c 2010-12-30 09:19:10.000000000 +0100 | ||
---|---|---|
/*
|
||
* targavfd plugin for VDR (C++)
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
* Glyph handling based on <vdr/font.c>
|
||
*
|
||
* This targavfd plugin is free software: you can redistribute it and/or
|
||
* This dm140vfd 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.
|
||
*
|
||
... | ... | |
bottom = face->glyph->bitmap.rows-face->glyph->bitmap_top;
|
||
}
|
||
else
|
||
esyslog("targaVFD: FreeType: error %d in FT_Render_Glyph", error);
|
||
esyslog("DM140VFD: FreeType: error %d in FT_Render_Glyph", error);
|
||
}
|
||
else
|
||
esyslog("targaVFD: FreeType: error %d in FT_Load_Glyph", error);
|
||
esyslog("DM140VFD: FreeType: error %d in FT_Load_Glyph", error);
|
||
}
|
||
}
|
||
else {
|
||
... | ... | |
bottom = abs((face->size->metrics.descender - 63) / 64);
|
||
}
|
||
else
|
||
esyslog("targaVFD: FreeType: error %d during FT_Set_Char_Size (font = %s)\n", error, Name);
|
||
esyslog("DM140VFD: FreeType: error %d during FT_Set_Char_Size (font = %s)\n", error, Name);
|
||
}
|
||
}
|
||
else
|
||
esyslog("targaVFD: FreeType: load error %d (font = %s)", error, Name);
|
||
esyslog("DM140VFD: FreeType: load error %d (font = %s)", error, Name);
|
||
}
|
||
else
|
||
esyslog("targaVFD: FreeType: initialization error %d (font = %s)", error, Name);
|
||
esyslog("DM140VFD: FreeType: initialization error %d (font = %s)", error, Name);
|
||
}
|
||
cVFDFont::~cVFDFont()
|
||
... | ... | |
// Load glyph image into the slot (erase previous one):
|
||
int error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
|
||
if (error)
|
||
esyslog("targaVFD: FreeType: error during FT_Load_Glyph");
|
||
esyslog("DM140VFD: FreeType: error during FT_Load_Glyph");
|
||
else {
|
||
#if ((FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 7) \
|
||
|| (FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 2 && FREETYPE_PATCH <= 1))
|
||
... | ... | |
#endif
|
||
error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_MONO);
|
||
if (error)
|
||
esyslog("targaVFD: FreeType: error during FT_Render_Glyph %d, %d\n", CharCode, glyph_index);
|
||
esyslog("DM140VFD: FreeType: error during FT_Render_Glyph %d, %d\n", CharCode, glyph_index);
|
||
else { //new bitmap
|
||
cVFDGlyph *Glyph = new cVFDGlyph(CharCode, face->glyph);
|
||
glyphCache->Add(Glyph);
|
vdr-plugin-dm140vfd-0.0.6/ffont.h 2010-12-29 16:33:19.000000000 +0100 | ||
---|---|---|
/*
|
||
* targavfd plugin for VDR (C++)
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
* Glyph handling based on <vdr/font.c>
|
||
*
|
||
* This targavfd plugin is free software: you can redistribute it and/or
|
||
* This dm140vfd 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.
|
||
*
|
vdr-plugin-dm140vfd-0.0.6/HISTORY 2010-12-30 10:00:20.000000000 +0100 | ||
---|---|---|
VDR Plugin 'dm140vfd' Revision History
|
||
-------------------------------------
|
||
2010-12-29: Version 0.0.6
|
||
- forked dm140vfd from targavfd 0.0.6
|
||
VDR Plugin 'targavfd' Revision History
|
||
-------------------------------------
|
||
vdr-plugin-dm140vfd-0.0.6/lcd-bitmaps.txt 2010-12-30 10:00:56.000000000 +0100 | ||
---|---|---|
DVD
|
||
Bitmap[2]=0x01
|
||
Video
|
||
Bitmap[1]=0x80
|
||
CD
|
||
Bitmap[1]=0x40
|
||
Play
|
||
Bitmap[1]=0x20
|
||
Rewind
|
||
Bitmap[1]=0x10
|
||
Pause
|
||
Bitmap[1]=0x08
|
||
FFWD
|
||
Bitmap[1]=0x04
|
||
Speaker
|
||
Bitmap[1]=0x02
|
||
Record
|
||
Bitmap[1]=0x01
|
||
Radio
|
||
Bitmap[2]=0x02
|
||
Volume
|
||
Bitmap[2]=0x04
|
||
Raising Volume: 00
|
||
Bitmap[2]=0x04
|
||
Raising Volume: 01
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Raising Volume: 02
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Raising Volume: 03
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Raising Volume: 04
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Raising Volume: 05
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Raising Volume: 06
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Raising Volume: 07
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Raising Volume: 08
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Raising Volume: 09
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Raising Volume: 10
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Bitmap[6]=0x88
|
||
Raising Volume: 11
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Bitmap[6]=0x88
|
||
Bitmap[7]=0x08
|
||
Raising Volume: 12
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Bitmap[6]=0x88
|
||
Bitmap[7]=0x08
|
||
Bitmap[7]=0x88
|
||
Lowering Volume: 12
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Bitmap[6]=0x88
|
||
Bitmap[7]=0x08
|
||
Bitmap[7]=0x88
|
||
Lowering Volume: 11
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Bitmap[6]=0x88
|
||
Bitmap[7]=0x08
|
||
Lowering Volume: 10
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Bitmap[6]=0x88
|
||
Lowering Volume: 09
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Bitmap[6]=0x08
|
||
Lowering Volume: 08
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Bitmap[5]=0x88
|
||
Lowering Volume: 07
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Bitmap[5]=0x08
|
||
Lowering Volume: 06
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Bitmap[4]=0x88
|
||
Lowering Volume: 05
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Bitmap[4]=0x08
|
||
Lowering Volume: 04
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Bitmap[3]=0x88
|
||
Lowering Volume: 03
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Bitmap[3]=0x08
|
||
Lowering Volume: 02
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Bitmap[2]=0x8c
|
||
Lowering Volume: 01
|
||
Bitmap[2]=0x04
|
||
Bitmap[2]=0x0c
|
||
Lowering Volume: 00
|
||
Bitmap[2]=0x04
|
vdr-plugin-dm140vfd-0.0.6/Makefile 2010-12-29 16:33:18.000000000 +0100 | ||
---|---|---|
#
|
||
# Makefile for targavfd plugin to VDR (C++)
|
||
# Makefile for dm140vfd plugin to VDR (C++)
|
||
#
|
||
# (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
#
|
||
... | ... | |
# IMPORTANT: the presence of this macro is important for the Make.config
|
||
# file. So it must be defined, even if it is not used here!
|
||
#
|
||
PLUGIN = targavfd
|
||
PLUGIN = dm140vfd
|
||
### The version number of this plugin (taken from the main source file):
|
||
... | ... | |
INCLUDES += $(shell freetype-config --cflags)
|
||
LIBS += $(shell freetype-config --libs)
|
||
INCLUDES += $(shell pkg-config --cflags libhid)
|
||
LIBS += $(shell pkg-config --libs libhid)
|
||
#INCLUDES += $(shell pkg-config --cflags libhid)
|
||
#LIBS += $(shell pkg-config --libs libhid)
|
||
DEFINES += -DHAVE_STDBOOL_H
|
||
### The object files (add further files here):
|
vdr-plugin-dm140vfd-0.0.6/po/de_DE.po 2010-12-30 13:10:10.000000000 +0100 | ||
---|---|---|
# vdr-targavfd-plugin language source file.
|
||
# vdr-dm140vfd-plugin language source file.
|
||
# Copyright (C) Andreas Brachold <vdr07 AT deltab de>
|
||
# This file is distributed under the same license as the PACKAGE package.
|
||
#
|
||
# Andreas Brachold <vdr07 AT deltab de> 2009, 2010.
|
||
msgid ""
|
||
msgstr ""
|
||
"Project-Id-Version: vdr-targavfd-plugin 0.0.5\n"
|
||
"Project-Id-Version: vdr-dm140vfd-plugin 0.0.5\n"
|
||
"Report-Msgid-Bugs-To: <see README>\n"
|
||
"POT-Creation-Date: 2010-10-23 18:00+0200\n"
|
||
"POT-Creation-Date: 2010-12-30 09:35+0100\n"
|
||
"PO-Revision-Date: 2010-07-02 21:25+0200\n"
|
||
"Last-Translator: Andreas Brachold <vdr07 AT deltab de>\n"
|
||
"Language-Team: Andreas Brachold <vdr07 AT deltab de>\n"
|
||
... | ... | |
"Content-Type: text/plain; charset=utf-8\n"
|
||
"Content-Transfer-Encoding: 8bit\n"
|
||
msgid "targavfd"
|
||
msgstr "TargaVFD"
|
||
msgid "Control a dm140 vfd"
|
||
msgstr "Steuert ein DM140 VFD"
|
||
msgid "Show nothing"
|
||
msgstr "Nichts anzeigen"
|
||
msgid "Half brightness"
|
||
msgstr "Halbe Helligkeit"
|
||
msgid "Full brightness"
|
||
msgstr "Volle Helligkeit"
|
||
msgid "Brightness"
|
||
msgstr "Helligkeit"
|
||
msgid "dm140vfd"
|
||
msgstr "Dm140VFD"
|
||
msgid "Single line"
|
||
msgstr "Einzelne Zeile"
|
||
... | ... | |
msgid "Do nothing"
|
||
msgstr "Nichts unternehmen"
|
||
msgid "Showing clock"
|
||
msgstr "Uhrzeit anzeigen"
|
||
msgid "Turning display off"
|
||
msgstr "Abschalten der Anzeige"
|
||
... | ... | |
msgid "End time of suspend"
|
||
msgstr "Endzeit"
|
||
msgid "Control a targa vfd"
|
||
msgstr "Steuert ein Targa VFD"
|
||
msgid "Hiper Media: 040b:7001"
|
||
msgstr "Hiper Media: 040b:7001"
|
||
msgid "Activy: 1509:925d"
|
||
msgstr "Activy: 1509:925d"
|
||
msgid "Display Type"
|
||
msgstr "Display Typ"
|
||
msgid "None active timer"
|
||
msgstr "Kein aktiver Timer"
|
||
msgid "Unknown title"
|
||
msgstr "Unbekannter Titel"
|
||
#~ msgid "Show nothing"
|
||
#~ msgstr "Nichts anzeigen"
|
||
#~ msgid "Half brightness"
|
||
#~ msgstr "Halbe Helligkeit"
|
||
#~ msgid "Full brightness"
|
||
#~ msgstr "Volle Helligkeit"
|
||
#~ msgid "Brightness"
|
||
#~ msgstr "Helligkeit"
|
||
#~ msgid "Showing clock"
|
||
#~ msgstr "Uhrzeit anzeigen"
|
||
#~ msgid "Open display once"
|
||
#~ msgstr "Display nur einmal öffnen"
|
||
#~ msgid "Reopen display on failure"
|
||
#~ msgstr "Display bei Fehler erneut öffnen"
|
vdr-plugin-dm140vfd-0.0.6/po/it_IT.po 2010-12-30 13:10:10.000000000 +0100 | ||
---|---|---|
# vdr-targavfd-plugin language source file.
|
||
# vdr-dm140vfd-plugin language source file.
|
||
# Copyright (C) Diego Pierotto <vdr-italian at tiscali.it>
|
||
# This file is distributed under the same license as the PACKAGE package.
|
||
# Diego Pierotto <vdr-italian at tiscali.it> 2009
|
||
#
|
||
msgid ""
|
||
msgstr ""
|
||
"Project-Id-Version: vdr-targavfd-plugin 0.0.5\n"
|
||
"Project-Id-Version: vdr-dm140vfd-plugin 0.0.5\n"
|
||
"Report-Msgid-Bugs-To: <see README>\n"
|
||
"POT-Creation-Date: 2010-10-23 18:00+0200\n"
|
||
"POT-Creation-Date: 2010-12-30 09:35+0100\n"
|
||
"PO-Revision-Date: 2010-07-17 23:32+0100\n"
|
||
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
|
||
"Language-Team: \n"
|
||
... | ... | |
"X-Poedit-Country: ITALY\n"
|
||
"X-Poedit-SourceCharset: utf-8\n"
|
||
msgid "targavfd"
|
||
msgstr "TargaVFD"
|
||
msgid "Control a dm140 vfd"
|
||
msgstr "Controlla una dm140 VFD"
|
||
msgid "Show nothing"
|
||
msgstr "Non mostrare niente"
|
||
msgid "Half brightness"
|
||
msgstr "Luminosità a metà"
|
||
msgid "Full brightness"
|
||
msgstr "Luminosità piena"
|
||
msgid "Brightness"
|
||
msgstr "Luminosità"
|
||
msgid "dm140vfd"
|
||
msgstr "Dm140VFD"
|
||
msgid "Single line"
|
||
msgstr "Linea singola"
|
||
... | ... | |
msgid "Do nothing"
|
||
msgstr "Non fare nulla"
|
||
msgid "Showing clock"
|
||
msgstr "Mostra orologio"
|
||
msgid "Turning display off"
|
||
msgstr "Spegni retroilluminazione"
|
||
... | ... | |
msgid "End time of suspend"
|
||
msgstr ""
|
||
msgid "Control a targa vfd"
|
||
msgstr "Controlla una targa VFD"
|
||
msgid "Hiper Media: 040b:7001"
|
||
msgstr ""
|
||
msgid "Activy: 1509:925d"
|
||
msgstr ""
|
||
msgid "Display Type"
|
||
msgstr ""
|
||
msgid "None active timer"
|
||
msgstr "Nessun timer attivo"
|
||
msgid "Unknown title"
|
||
msgstr "Titolo sconosciuto"
|
||
#~ msgid "Show nothing"
|
||
#~ msgstr "Non mostrare niente"
|
||
#~ msgid "Half brightness"
|
||
#~ msgstr "Luminosità a metà"
|
||
#~ msgid "Full brightness"
|
||
#~ msgstr "Luminosità piena"
|
||
#~ msgid "Brightness"
|
||
#~ msgstr "Luminosità"
|
||
#~ msgid "Showing clock"
|
||
#~ msgstr "Mostra orologio"
|
||
#, fuzzy
|
||
#~ msgid "Open display once"
|
||
#~ msgstr "Spegni retroilluminazione"
|
vdr-plugin-dm140vfd-0.0.6/README 2010-12-29 16:33:19.000000000 +0100 | ||
---|---|---|
This is a "plugin" for the Video Disk Recorder (VDR).
|
||
Written by : Andreas Brachold <vdr07 AT deltab de>
|
||
Adapted to DM140 by: Andreas Holzhammer <andreas . holzhammer AT gmx . de>
|
||
Original targavfd README below:
|
||
Project's homepage: http://projects.vdr-developer.org/wiki/plg-targavfd
|
||
vdr-plugin-dm140vfd-0.0.6/README.targavfd 2010-12-29 16:33:18.000000000 +0100 | ||
---|---|---|
This is a "plugin" for the Video Disk Recorder (VDR).
|
||
Written by : Andreas Brachold <vdr07 AT deltab de>
|
||
Project's homepage: http://projects.vdr-developer.org/wiki/plg-targavfd
|
||
This plugin for VDR 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.
|
||
This plugin for VDR is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||
for more details.
|
||
You should have received a copy of the GNU General Public License
|
||
along with this plugin for VDR. If not, see <http://www.gnu.org/licenses/>.
|
||
See the file COPYING for license information.
|
||
Description:
|
||
------------
|
||
targavfd is a plugin for the Video Disc Recorder and shows information
|
||
about the current state of VDR on Targa USB Graphic Vacuum Fluorescent Display.
|
||
Install libhid:
|
||
-------------------------------------
|
||
You need installed library libhid to use the vdr-plugin-targavfd.
|
||
This library libhid is used to access and interact with a USB HID device.
|
||
1. http://libhid.alioth.debian.org/
|
||
Install vdr-plugin-targavfd:
|
||
---------------------------
|
||
Unpack the vdr-targavfd tarball to $VDRSOURCE/PLUGINS/src directory.
|
||
Variable $VDRSOURCE stands for a directory, where source archive of VDR package
|
||
was be decompressed.
|
||
#> cd $VDRSOURCE/PLUGINS/src
|
||
#> tar -xzvf vdr-targavfd-0.0.1.tgz
|
||
#> ln -s targavfd-0.0.1 targavfd
|
||
Compile the plugin (from VDR's source directory)
|
||
Change the working directory to VDR source root and compile this plugin
|
||
like all other VDR plugins.
|
||
#> cd $VDRSOURCE
|
||
#> make plugins
|
||
After everything has been compiled without errors, copy the plugin to their
|
||
target directory.
|
||
#> make install
|
||
Check follow requirements
|
||
-------------------------
|
||
* Device still detected and writable
|
||
#> lsusb -vd 19c2:6a11 | grep iProduct
|
||
iProduct 2 Targa USB Graphic Vacuum Fluorescent Display
|
||
* Add a udev permission rule, if required (writable for group vdr) e.g.
|
||
/etc/udev/rules.d/92-vfd.rules
|
||
ACTION=="add", BUS=="usb", SYSFS{idVendor}=="19c2", SYSFS{idProduct}=="6a11", GROUP="vdr"
|
||
Start VDR with the plugin.
|
||
---------------------------
|
||
Examples:
|
||
vdr -P'targavfd'
|
||
Setup options
|
||
-------------
|
||
This options are editable at run time. (Menu: Setup > Plugin > targavfd ... )
|
||
* Brightness
|
||
- Set brightness from display. (Default: Half brightness)
|
||
* Default font
|
||
- Used font, there should installed like other FreeType supported fonts
|
||
* Height of big font
|
||
* Height of small font
|
||
* Render mode
|
||
- Single line
|
||
- Dual lines
|
||
- Single line (Channel names only)
|
||
* Exit mode
|
||
- Do nothing - Just leave the "last" message there
|
||
- Showing clock - Show the big clock
|
||
- Turning display off - Blank the device completely
|
||
- Show next timer - Show time and title of next timer
|
||
- Show only present next timer - If present, show time and title of next timer
|
||
* Show volume bargraph
|
||
- Never - Show the volume bar never
|
||
- Timed - Show the volume bar only a short time, if volume changed
|
||
- Ever - Show the volume bar every time
|
||
* Suspend display at night
|
||
- Allow turn display off at night, depends selected mode and time frame.
|
||
Plugin SVDRP commands
|
||
---------------------
|
||
* HELP - List known commands
|
||
* OFF - Suspend driver of display.
|
||
* ON - Resume driver of display.
|
||
* ICON [name] [on|off|auto] - Force state of icon.
|
||
Use this commands like follow samples
|
||
#> svdrpsend.pl PLUG targavfd OFF
|
||
220 vdr SVDRP VideoDiskRecorder ....
|
||
250 driver suspended
|
||
221 vdr closing connection
|
||
#> svdrpsend.pl PLUG targavfd HELP ICON
|
||
214-ICON [name] [on|off|auto]
|
||
214- Force state of icon. Names of icons are:
|
||
214- Play,Pause,Record,Message,Message,Mute...
|
||
This commands can have follow responses
|
||
OFF : 250 driver suspended
|
||
251 driver already suspended
|
||
ON : 250 driver resumed
|
||
251 driver already resumed
|
||
554 driver could not resumed
|
||
ICON : 250 icon state 'auto'
|
||
251 icon state 'on'
|
||
252 icon state 'off'
|
||
* 501 unknown command
|
||
Spectrum analyzer visualization
|
||
-------------------------------
|
||
This plugin can show a spectrum analyzer visualization on audio playback.
|
||
As middleware you need the 'Sp'ectrum 'An'alyzer Plugin.
|
||
See also http://lcr.vdr-developer.org/htmls/span-plugin.html
|
||
vdr-plugin-dm140vfd-0.0.6/setup.c 2010-12-30 13:13:24.000000000 +0100 | ||
---|---|---|
/*
|
||
* targavfd plugin for VDR (C++)
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
*
|
||
* This targavfd plugin is free software: you can redistribute it and/or
|
||
* This dm140vfd 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.
|
||
*
|
||
... | ... | |
#include <vdr/i18n.h>
|
||
#define DEFAULT_ON_EXIT eOnExitMode_BLANKSCREEN /**< Blank the device completely */
|
||
#define DEFAULT_BRIGHTNESS 1
|
||
#define DEFAULT_WIDTH 96
|
||
//#define DEFAULT_BRIGHTNESS 1
|
||
#define DEFAULT_WIDTH 112
|
||
#define DEFAULT_HEIGHT 16
|
||
#define DEFAULT_FONT "Sans:Bold"
|
||
#define DEFAULT_TWO_LINE_MODE eRenderMode_SingleLine
|
||
... | ... | |
#define DEFAULT_SMALL_FONT_HEIGHT 7
|
||
#define DEFAULT_VOLUME_MODE eVolumeMode_ShowEver /**< Show the volume bar ever */
|
||
#define DEFAULT_SUSPEND_MODE eSuspendMode_Never /**< Suspend display never */
|
||
#define DEFAULT_DISPLAY_TYPE eDisplayType_Hiper /**< Hiper Media is what I have :-) */
|
||
//#define DEFAULT_DISPLAY_RETRY eDisplayRetry_Yes /**< try to re-open Display if not available on first access */
|
||
/// The one and only Stored setup data
|
||
cVFDSetup theSetup;
|
||
... | ... | |
, m_cHeight(DEFAULT_HEIGHT)
|
||
{
|
||
m_nOnExit = DEFAULT_ON_EXIT;
|
||
m_nBrightness = DEFAULT_BRIGHTNESS;
|
||
// m_nBrightness = DEFAULT_BRIGHTNESS;
|
||
m_nRenderMode = DEFAULT_TWO_LINE_MODE;
|
||
m_nBigFontHeight = DEFAULT_BIG_FONT_HEIGHT;
|
||
m_nSmallFontHeight = DEFAULT_SMALL_FONT_HEIGHT;
|
||
... | ... | |
m_nSuspendMode = DEFAULT_SUSPEND_MODE;
|
||
m_nSuspendTimeOn = 2200;
|
||
m_nSuspendTimeOff = 800;
|
||
m_nDisplayType = DEFAULT_DISPLAY_TYPE;
|
||
// m_nDisplayRetry = DEFAULT_DISPLAY_RETRY;
|
||
strncpy(m_szFont,DEFAULT_FONT,sizeof(m_szFont));
|
||
}
|
||
... | ... | |
cVFDSetup& cVFDSetup::operator = (const cVFDSetup& x)
|
||
{
|
||
m_nOnExit = x.m_nOnExit;
|
||
m_nBrightness = x.m_nBrightness;
|
||
// m_nBrightness = x.m_nBrightness;
|
||
m_nRenderMode = x.m_nRenderMode;
|
||
m_nBigFontHeight = x.m_nBigFontHeight;
|
||
... | ... | |
m_nSuspendTimeOn = x.m_nSuspendTimeOn;
|
||
m_nSuspendTimeOff = x.m_nSuspendTimeOff;
|
||
m_nDisplayType = x.m_nDisplayType;
|
||
// m_nDisplayRetry = x.m_nDisplayRetry;
|
||
strncpy(m_szFont,x.m_szFont,sizeof(m_szFont));
|
||
return *this;
|
||
... | ... | |
if(!strcasecmp(szName, "OnExit")) {
|
||
int n = atoi(szValue);
|
||
if ((n < eOnExitMode_SHOWMSG) || (n >= eOnExitMode_LASTITEM)) {
|
||
esyslog("targaVFD: OnExit must be between %d and %d, using default %d",
|
||
esyslog("DM140VFD: OnExit must be between %d and %d, using default %d",
|
||
eOnExitMode_SHOWMSG, eOnExitMode_LASTITEM, DEFAULT_ON_EXIT);
|
||
n = DEFAULT_ON_EXIT;
|
||
}
|
||
... | ... | |
return true;
|
||
}
|
||
// Brightness
|
||
if(!strcasecmp(szName, "Brightness")) {
|
||
int n = atoi(szValue);
|
||
if ((n < 0) || (n > 2)) {
|
||
esyslog("targaVFD: Brightness must be between 0 and 2, using default %d",
|
||
DEFAULT_BRIGHTNESS);
|
||
n = DEFAULT_BRIGHTNESS;
|
||
}
|
||
m_nBrightness = n;
|
||
return true;
|
||
}
|
||
// // Brightness
|
||
// if(!strcasecmp(szName, "Brightness")) {
|
||
// int n = atoi(szValue);
|
||
// if ((n < 0) || (n > 2)) {
|
||
// esyslog("DM140VFD: Brightness must be between 0 and 2, using default %d",
|
||
// DEFAULT_BRIGHTNESS);
|
||
// n = DEFAULT_BRIGHTNESS;
|
||
// }
|
||
// m_nBrightness = n;
|
||
// return true;
|
||
// }
|
||
// Font
|
||
if(!strcasecmp(szName, "Font")) {
|
||
if(szValue) {
|
||
... | ... | |
return true;
|
||
}
|
||
}
|
||
esyslog("targaVFD: Font '%s' not found, using default %s",
|
||
esyslog("DM140VFD: Font '%s' not found, using default %s",
|
||
szValue, DEFAULT_FONT);
|
||
strncpy(m_szFont,DEFAULT_FONT,sizeof(m_szFont));
|
||
return true;
|
||
... | ... | |
if(!strcasecmp(szName, "BigFont")) {
|
||
int n = atoi(szValue);
|
||
if ((n < 5) || (n > 24)) {
|
||
esyslog("targaVFD: BigFont must be between 5 and 24, using default %d",
|
||
esyslog("DM140VFD: BigFont must be between 5 and 24, using default %d",
|
||
DEFAULT_BIG_FONT_HEIGHT);
|
||
n = DEFAULT_BIG_FONT_HEIGHT;
|
||
}
|
||
... | ... | |
if(!strcasecmp(szName, "SmallFont")) {
|
||
int n = atoi(szValue);
|
||
if ((n < 5) || (n > 24)) {
|
||
esyslog("targaVFD: SmallFont must be between 5 and 24, using default %d",
|
||
esyslog("DM140VFD: SmallFont must be between 5 and 24, using default %d",
|
||
DEFAULT_SMALL_FONT_HEIGHT);
|
||
n = DEFAULT_SMALL_FONT_HEIGHT;
|
||
}
|
||
... | ... | |
if(!strcasecmp(szName, "TwoLineMode")) {
|
||
int n = atoi(szValue);
|
||
if ((n < eRenderMode_SingleLine) || (n >= eRenderMode_LASTITEM)) {
|
||
esyslog("targaVFD: TwoLineMode must be between %d and %d, using default %d",
|
||
esyslog("DM140VFD: TwoLineMode must be between %d and %d, using default %d",
|
||
eRenderMode_SingleLine, eRenderMode_LASTITEM, DEFAULT_TWO_LINE_MODE );
|
||
n = DEFAULT_TWO_LINE_MODE;
|
||
}
|
||
... | ... | |
if(!strcasecmp(szName, "VolumeMode")) {
|
||
int n = atoi(szValue);
|
||
if ((n < eVolumeMode_ShowNever) || (n >= eVolumeMode_LASTITEM)) {
|
||
esyslog("targaVFD: VolumeMode must be between %d and %d, using default %d",
|
||
esyslog("DM140VFD: VolumeMode must be between %d and %d, using default %d",
|
||
eVolumeMode_ShowNever, eVolumeMode_LASTITEM, DEFAULT_VOLUME_MODE);
|
||
n = DEFAULT_VOLUME_MODE;
|
||
}
|
||
... | ... | |
if(!strcasecmp(szName, "SuspendMode")) {
|
||
int n = atoi(szValue);
|
||
if ((n < eSuspendMode_Never) || (n >= eSuspendMode_LASTITEM)) {
|
||
esyslog("targaVFD: SuspendMode must be between %d and %d, using default %d",
|
||
esyslog("DM140VFD: SuspendMode must be between %d and %d, using default %d",
|
||
eSuspendMode_Never, eSuspendMode_LASTITEM, DEFAULT_SUSPEND_MODE);
|
||
n = DEFAULT_SUSPEND_MODE;
|
||
}
|
||
... | ... | |
if(!strcasecmp(szName, "SuspendTimeOn")) {
|
||
int n = atoi(szValue);
|
||
if ((n < 0) || (n >= 2400)) {
|
||
esyslog("targaVFD: SuspendTimeOn must be between %d and %d, using default %d",
|
||
esyslog("DM140VFD: SuspendTimeOn must be between %d and %d, using default %d",
|
||
0, 2359, 0);
|
||
n = 0;
|
||
}
|
||
... | ... | |
if(!strcasecmp(szName, "SuspendTimeOff")) {
|
||
int n = atoi(szValue);
|
||
if ((n < 0) || (n >= 2400)) {
|
||
esyslog("targaVFD: SuspendTimeOff must be between %d and %d, using default %d",
|
||
esyslog("DM140VFD: SuspendTimeOff must be between %d and %d, using default %d",
|
||
0, 2359, 0);
|
||
n = 0;
|
||
}
|
||
m_nSuspendTimeOff = n;
|
||
return true;
|
||
}
|
||
// DisplayType
|
||
if(!strcasecmp(szName, "DisplayType")) {
|
||
int n = atoi(szValue);
|
||
if ((n < eDisplayType_Hiper) || (n >= eDisplayType_LASTITEM)) {
|
||
esyslog("DM140VFD: DisplayType must be between %d and %d, using default %d",
|
||
eDisplayType_Hiper, eDisplayType_LASTITEM, DEFAULT_DISPLAY_TYPE);
|
||
n = DEFAULT_DISPLAY_TYPE;
|
||
}
|
||
m_nDisplayType = n;
|
||
return true;
|
||
}
|
||
// // DisplayRetry
|
||
// if(!strcasecmp(szName, "DisplayRetry")) {
|
||
// int n = atoi(szValue);
|
||
// if ((n < eDisplayRetry_No) || (n >= eDisplayRetry_LASTITEM)) {
|
||
// esyslog("DM140VFD: DisplayRetry must be between %d and %d, using default %d",
|
||
// eDisplayRetry_No, eDisplayRetry_LASTITEM, DEFAULT_DISPLAY_RETRY);
|
||
// n = DEFAULT_DISPLAY_RETRY;
|
||
// }
|
||
// m_nDisplayRetry = n;
|
||
// return true;
|
||
// }
|
||
//Unknow parameter
|
||
return false;
|
||
... | ... | |
theSetup = m_tmpSetup;
|
||
SetupStore("OnExit", theSetup.m_nOnExit);
|
||
SetupStore("Brightness", theSetup.m_nBrightness);
|
||
// SetupStore("Brightness", theSetup.m_nBrightness);
|
||
SetupStore("Font", theSetup.m_szFont);
|
||
SetupStore("BigFont", theSetup.m_nBigFontHeight);
|
||
SetupStore("SmallFont", theSetup.m_nSmallFontHeight);
|
||
... | ... | |
SetupStore("SuspendMode", theSetup.m_nSuspendMode);
|
||
SetupStore("SuspendTimeOn", theSetup.m_nSuspendTimeOn);
|
||
SetupStore("SuspendTimeOff", theSetup.m_nSuspendTimeOff);
|
||
SetupStore("DisplayType", theSetup.m_nDisplayType);
|
||
// SetupStore("DisplayRetry", theSetup.m_nDisplayRetry);
|
||
}
|
||
cVFDMenuSetup::cVFDMenuSetup(cVFDWatch* pDev)
|
||
: m_tmpSetup(theSetup)
|
||
, m_pDev(pDev)
|
||
{
|
||
SetSection(tr("targavfd"));
|
||
SetSection(tr("dm140vfd"));
|
||
cFont::GetAvailableFontNames(&fontNames);
|
||
fontNames.Insert(strdup(DEFAULT_FONT));
|
||
fontIndex = max(0, fontNames.Find(m_tmpSetup.m_szFont));
|
||
static const char * szBrightness[3];
|
||
szBrightness[0] = tr("Show nothing");
|
||
szBrightness[1] = tr("Half brightness");
|
||
szBrightness[2] = tr("Full brightness");
|
||
Add(new cMenuEditStraItem (tr("Brightness"),
|
||
&m_tmpSetup.m_nBrightness,
|
||
memberof(szBrightness), szBrightness));
|
||
// static const char * szBrightness[3];
|
||
// szBrightness[0] = tr("Show nothing");
|
||
// szBrightness[1] = tr("Half brightness");
|
||
// szBrightness[2] = tr("Full brightness");
|
||
//
|
||
// Add(new cMenuEditStraItem (tr("Brightness"),
|
||
// &m_tmpSetup.m_nBrightness,
|
||
// memberof(szBrightness), szBrightness));
|
||
static const char * szRenderMode[3];
|
||
szRenderMode[eRenderMode_SingleLine] = tr("Single line");
|
||
... | ... | |
static const char * szExitModes[eOnExitMode_LASTITEM];
|
||
szExitModes[eOnExitMode_SHOWMSG] = tr("Do nothing");
|
||
szExitModes[eOnExitMode_SHOWCLOCK] = tr("Showing clock");
|
||
// szExitModes[eOnExitMode_SHOWCLOCK] = tr("Showing clock");
|
||
szExitModes[eOnExitMode_BLANKSCREEN] = tr("Turning display off");
|
||
szExitModes[eOnExitMode_NEXTTIMER] = tr("Show next timer");
|
||
szExitModes[eOnExitMode_NEXTTIMER_BLANKSCR] = tr("Show only present next timer");
|
||
... | ... | |
&m_tmpSetup.m_nSuspendTimeOn));
|
||
Add(new cMenuEditTimeItem (tr("End time of suspend"),
|
||
&m_tmpSetup.m_nSuspendTimeOff));
|
||
static const char * szDisplayType[eDisplayType_LASTITEM];
|
||
szDisplayType[eDisplayType_Hiper] = tr("Hiper Media: 040b:7001");
|
||
szDisplayType[eDisplayType_Activy] = tr("Activy: 1509:925d");
|
||
Add(new cMenuEditStraItem (tr("Display Type"),
|
||
&m_tmpSetup.m_nDisplayType,
|
||
memberof(szDisplayType), szDisplayType));
|
||
// static const char * szDisplayRetry[eDisplayRetry_LASTITEM];
|
||
// szDisplayRetry[eDisplayRetry_No] = tr("Open display once");
|
||
// szDisplayRetry[eDisplayRetry_Yes] = tr("Reopen display on failure");
|
||
//
|
||
// Add(new cMenuEditStraItem (tr("Display Retry"),
|
||
// &m_tmpSetup.m_nDisplayRetry,
|
||
// memberof(szDisplayRetry), szDisplayRetry));
|
||
}
|
||
eOSState cVFDMenuSetup::ProcessKey(eKeys nKey)
|
||
... | ... | |
m_tmpSetup.m_nBigFontHeight,
|
||
m_tmpSetup.m_nSmallFontHeight);
|
||
}
|
||
if (m_tmpSetup.m_nDisplayType != theSetup.m_nDisplayType) {
|
||
theSetup.m_nDisplayType = m_tmpSetup.m_nDisplayType;
|
||
m_pDev->shutdown(m_tmpSetup.m_nOnExit);
|
||
m_pDev->open();
|
||
}
|
||
}
|
||
return cMenuSetupPage::ProcessKey(nKey);
|
||
}
|
vdr-plugin-dm140vfd-0.0.6/setup.h 2010-12-30 09:29:22.000000000 +0100 | ||
---|---|---|
/*
|
||
* targavfd plugin for VDR (C++)
|
||
* dm140vfd plugin for VDR (C++)
|
||
*
|
||
* (C) 2010 Andreas Brachold <vdr07 AT deltab de>
|
||
*
|
||
* This targavfd plugin is free software: you can redistribute it and/or
|
||
* This dm140vfd 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.
|
||
*
|
||
... | ... | |
enum eOnExitMode {
|
||
eOnExitMode_SHOWMSG /**< Do nothing - just leave the "last" message there */
|
||
,eOnExitMode_SHOWCLOCK /**< Show the big clock */
|
||
// ,eOnExitMode_SHOWCLOCK /**< Show the big clock */
|
||
,eOnExitMode_BLANKSCREEN /**< Blank the device completely */
|
||
,eOnExitMode_NEXTTIMER /**< Show next active timer */
|
||
,eOnExitMode_NEXTTIMER_BLANKSCR /**< Show next active timer, or blank if none timer defined */
|
||
... | ... | |
,eSuspendMode_LASTITEM
|