summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2012-05-17 12:48:45 +0200
committerJochen Dolze <vdr@dolze.de>2012-05-17 12:48:45 +0200
commitf71889cd4de662eb29d706f8659e86d13a076fd2 (patch)
treef2f40415b05ebfaf18c3d39c16796f4b0eab0c21 /plugin
parent0942647e18e14cfd5f1ab651da0660618490d834 (diff)
downloadvdr-plugin-markad-f71889cd4de662eb29d706f8659e86d13a076fd2.tar.gz
vdr-plugin-markad-f71889cd4de662eb29d706f8659e86d13a076fd2.tar.bz2
Fixed warnings from cppcheck
Added setup menu entry to prevent deferred shutdown Added many logos from contributors
Diffstat (limited to 'plugin')
l---------plugin/HISTORY1
l---------plugin/README1
-rw-r--r--plugin/markad.cpp4
-rw-r--r--plugin/menu.cpp12
-rw-r--r--plugin/po/de_DE.po6
-rw-r--r--plugin/po/es_ES.po6
-rw-r--r--plugin/po/fi_FI.po6
-rw-r--r--plugin/po/it_IT.po6
-rw-r--r--plugin/po/sk_SK.po6
-rw-r--r--plugin/setup.cpp5
-rw-r--r--plugin/setup.h2
-rw-r--r--plugin/status.cpp4
12 files changed, 39 insertions, 20 deletions
diff --git a/plugin/HISTORY b/plugin/HISTORY
new file mode 120000
index 0000000..ec72466
--- /dev/null
+++ b/plugin/HISTORY
@@ -0,0 +1 @@
+../HISTORY \ No newline at end of file
diff --git a/plugin/README b/plugin/README
new file mode 120000
index 0000000..59a23c4
--- /dev/null
+++ b/plugin/README
@@ -0,0 +1 @@
+../README \ No newline at end of file
diff --git a/plugin/markad.cpp b/plugin/markad.cpp
index 7dc97d1..cfd9ba2 100644
--- a/plugin/markad.cpp
+++ b/plugin/markad.cpp
@@ -26,6 +26,7 @@ cPluginMarkAd::cPluginMarkAd(void)
statusMonitor=NULL;
bindir=strdup(DEF_BINDIR);
logodir=strdup(DEF_LOGODIR);
+ title[0]=0;
setup.ProcessDuring=true;
setup.whileRecording=true;
@@ -39,6 +40,7 @@ cPluginMarkAd::cPluginMarkAd(void)
setup.Log2Rec=false;
setup.LogoOnly=true;
setup.SaveInfo=false;
+ setup.DeferredShutdown=true;
}
cPluginMarkAd::~cPluginMarkAd()
@@ -160,7 +162,7 @@ void cPluginMarkAd::MainThreadHook(void)
cString cPluginMarkAd::Active(void)
{
// Return a message string if shutdown should be postponed
- if (statusMonitor->MarkAdRunning())
+ if (statusMonitor->MarkAdRunning() && (setup.DeferredShutdown))
return tr("markad still running");
return NULL;
}
diff --git a/plugin/menu.cpp b/plugin/menu.cpp
index 1ad8d84..13171b3 100644
--- a/plugin/menu.cpp
+++ b/plugin/menu.cpp
@@ -72,7 +72,7 @@ cMenuMarkAd::cMenuMarkAd(cStatusMarkAd *Status):cOsdMenu(tr("markad status"),15)
if (write())
{
- cOsdMarkAd *osd=(cOsdMarkAd *) Get(Current());
+ cOsdMarkAd *osd=static_cast<cOsdMarkAd *>(Get(Current()));
if ((osd) && (osd->Selectable()))
{
SetHelpText(osd->GetEntry());
@@ -158,7 +158,7 @@ eOSState cMenuMarkAd::ProcessKey(eKeys Key)
switch (Key)
{
case kRed:
- osd=(cOsdMarkAd *) Get(Current());
+ osd=static_cast<cOsdMarkAd *>(Get(Current()));
if ((osd) && (osd->Selectable()))
{
struct recs *entry=osd->GetEntry();
@@ -173,7 +173,7 @@ eOSState cMenuMarkAd::ProcessKey(eKeys Key)
break;
case kGreen:
- osd=(cOsdMarkAd *) Get(Current());
+ osd=static_cast<cOsdMarkAd *>(Get(Current()));
if ((osd) && (osd->Selectable()))
{
struct recs *entry=osd->GetEntry();
@@ -189,7 +189,7 @@ eOSState cMenuMarkAd::ProcessKey(eKeys Key)
case kUp:
CursorUp();
- osd=(cOsdMarkAd *) Get(Current());
+ osd=static_cast<cOsdMarkAd *>(Get(Current()));
if ((osd) && (osd->Selectable()))
{
SetHelpText(osd->GetEntry());
@@ -199,7 +199,7 @@ eOSState cMenuMarkAd::ProcessKey(eKeys Key)
case kDown:
CursorDown();
- osd=(cOsdMarkAd *) Get(Current());
+ osd=static_cast<cOsdMarkAd *>(Get(Current()));
if ((osd) && (osd->Selectable()))
{
SetHelpText(osd->GetEntry());
@@ -216,7 +216,7 @@ eOSState cMenuMarkAd::ProcessKey(eKeys Key)
{
if (write())
{
- cOsdMarkAd *osd=(cOsdMarkAd *) Get(Current());
+ cOsdMarkAd *osd=static_cast<cOsdMarkAd *>(Get(Current()));
if ((osd) && (osd->Selectable()))
{
SetHelpText(osd->GetEntry());
diff --git a/plugin/po/de_DE.po b/plugin/po/de_DE.po
index 94dae99..6c2a6e8 100644
--- a/plugin/po/de_DE.po
+++ b/plugin/po/de_DE.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2012-02-25 15:48+0100\n"
+"POT-Creation-Date: 2012-05-17 12:42+0200\n"
"PO-Revision-Date: 2009-08-27 14:18+0200\n"
"Last-Translator: Jochen Dolze <vdr@dolze.de>\n"
"Language-Team: German <vdr@linuxtv.org>\n"
@@ -67,6 +67,9 @@ msgstr " während einer Wiedergabe"
msgid "scan only channels with logo"
msgstr "nur Kanäle mit Logo scannen"
+msgid "deferred shutdown"
+msgstr "Herunterfahren verzögern?"
+
msgid "ignore timer margins"
msgstr "Timer Vor-/Nachlauf ignorieren"
@@ -102,4 +105,3 @@ msgstr "zurück"
msgid "Mark advertisements"
msgstr "Markiere Werbung"
-
diff --git a/plugin/po/es_ES.po b/plugin/po/es_ES.po
index e1c6cd8..eee5681 100644
--- a/plugin/po/es_ES.po
+++ b/plugin/po/es_ES.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2012-02-25 15:48+0100\n"
+"POT-Creation-Date: 2012-05-17 12:42+0200\n"
"PO-Revision-Date: 2011-02-12 11:30+0100\n"
"Last-Translator: Javier Bradineras <jbradi@hotmail.com>\n"
"Language-Team: Spanish <vdr@linuxtv.org>\n"
@@ -70,6 +70,9 @@ msgstr " Durante la reproducción"
msgid "scan only channels with logo"
msgstr "Escanea únicamente canales con logo"
+msgid "deferred shutdown"
+msgstr ""
+
msgid "ignore timer margins"
msgstr "Ignora márgenes de tiempo"
@@ -105,4 +108,3 @@ msgstr "Atrás"
msgid "Mark advertisements"
msgstr "Marca anuncios"
-
diff --git a/plugin/po/fi_FI.po b/plugin/po/fi_FI.po
index e568492..57576b1 100644
--- a/plugin/po/fi_FI.po
+++ b/plugin/po/fi_FI.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2012-02-25 15:48+0100\n"
+"POT-Creation-Date: 2012-05-17 12:42+0200\n"
"PO-Revision-Date: 2011-02-27 02:27+0200\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: Finnish <vdr@linuxtv.org>\n"
@@ -68,6 +68,9 @@ msgstr " tallenteen toiston aikana"
msgid "scan only channels with logo"
msgstr "Käytä vain logollisilla kanavilla"
+msgid "deferred shutdown"
+msgstr ""
+
msgid "ignore timer margins"
msgstr "Älä huomioi ajastinmarginaaleja"
@@ -103,4 +106,3 @@ msgstr "Takaisin"
msgid "Mark advertisements"
msgstr "Merkitse mainokset automaattisesti"
-
diff --git a/plugin/po/it_IT.po b/plugin/po/it_IT.po
index 77f188f..6d6403a 100644
--- a/plugin/po/it_IT.po
+++ b/plugin/po/it_IT.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2012-02-25 15:48+0100\n"
+"POT-Creation-Date: 2012-05-17 12:42+0200\n"
"PO-Revision-Date: 2011-07-10 00:56+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: Italian <vdr@linuxtv.org>\n"
@@ -70,6 +70,9 @@ msgstr " durante la riproduzione"
msgid "scan only channels with logo"
msgstr "Scansione solo canali con loghi"
+msgid "deferred shutdown"
+msgstr ""
+
msgid "ignore timer margins"
msgstr "Ignora margini timer"
@@ -105,4 +108,3 @@ msgstr "Indietro"
msgid "Mark advertisements"
msgstr "Segna i marcatori della pubblicità"
-
diff --git a/plugin/po/sk_SK.po b/plugin/po/sk_SK.po
index 30019c3..5bb67a9 100644
--- a/plugin/po/sk_SK.po
+++ b/plugin/po/sk_SK.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: markad\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2012-02-25 15:48+0100\n"
+"POT-Creation-Date: 2012-05-17 12:42+0200\n"
"PO-Revision-Date: 2011-03-01 20:26+0100\n"
"Last-Translator: milan hrala <hrala.milan@gmail.com>\n"
"Language-Team: milan hrala <grala.milan@gmail.com>\n"
@@ -70,6 +70,9 @@ msgstr " keď sa prehráva"
msgid "scan only channels with logo"
msgstr "Snímať kanály iba s logom"
+msgid "deferred shutdown"
+msgstr ""
+
msgid "ignore timer margins"
msgstr "Ignorovať okraje plánu"
@@ -105,4 +108,3 @@ msgstr "späť"
msgid "Mark advertisements"
msgstr "Značkovač reklamy"
-
diff --git a/plugin/setup.cpp b/plugin/setup.cpp
index e449f61..8b54d54 100644
--- a/plugin/setup.cpp
+++ b/plugin/setup.cpp
@@ -23,6 +23,7 @@ cSetupMarkAd::cSetupMarkAd(struct setup *Setup)
log2rec=setup->Log2Rec;
logoonly=setup->LogoOnly;
saveinfo=setup->SaveInfo;
+ deferredshutdown=setup->DeferredShutdown;
processTexts[0]=tr("after");
processTexts[1]=tr("during");
@@ -46,6 +47,7 @@ void cSetupMarkAd::write(void)
}
Add(new cMenuEditBoolItem(tr("scan only channels with logo"),&logoonly),true);
lpos=Current();
+ Add(new cMenuEditBoolItem(tr("deferred shutdown"),&deferredshutdown));
Add(new cMenuEditBoolItem(tr("ignore timer margins"),&nomargins));
Add(new cMenuEditBoolItem(tr("detect overlaps"),&secondpass));
Add(new cMenuEditBoolItem(tr("recreate index"),&genindex));
@@ -118,6 +120,7 @@ void cSetupMarkAd::Store(void)
SetupStore("Log2Rec",log2rec);
SetupStore("LogoOnly",logoonly);
SetupStore("SaveInfo",saveinfo);
+ SetupStore("DeferredShutdown",deferredshutdown);
setup->ProcessDuring=(bool) processduring;
setup->whileRecording=(bool) whilerecording;
@@ -128,6 +131,7 @@ void cSetupMarkAd::Store(void)
setup->Verbose=(bool) verbose;
setup->NoMargins=(bool) nomargins;
setup->HideMainMenuEntry=(bool) hidemainmenuentry;
+ setup->DeferredShutdown=(bool) deferredshutdown;
setup->Log2Rec=log2rec;
setup->LogoOnly=logoonly;
setup->SaveInfo=saveinfo;
@@ -200,7 +204,6 @@ int cSetupMarkAdListItem::Compare(const cListObject &ListObject) const
{
return 0;
}
-
}
eOSState cSetupMarkAdList::ProcessKey (eKeys Key)
diff --git a/plugin/setup.h b/plugin/setup.h
index dc3a75b..d22460a 100644
--- a/plugin/setup.h
+++ b/plugin/setup.h
@@ -23,6 +23,7 @@ struct setup
bool HideMainMenuEntry;
bool Log2Rec;
bool LogoOnly;
+ bool DeferredShutdown;
const char *LogoDir;
const char *PluginName;
};
@@ -44,6 +45,7 @@ private:
int log2rec;
int logoonly;
int saveinfo;
+ int deferredshutdown;
void write(void);
int lpos;
protected:
diff --git a/plugin/status.cpp b/plugin/status.cpp
index 84801f1..1200974 100644
--- a/plugin/status.cpp
+++ b/plugin/status.cpp
@@ -239,7 +239,7 @@ bool cStatusMarkAd::getStatus(int Position)
if (fstat)
{
// found a running markad
- ret=fscanf(fstat,"%*d %*s %c",&recs[Position].Status);
+ ret=fscanf(fstat,"%*10d %*255s %c",&recs[Position].Status);
fclose(fstat);
}
else
@@ -268,7 +268,7 @@ bool cStatusMarkAd::getPid(int Position)
{
free(buf);
int pid;
- ret=fscanf(fpid,"%i\n",&pid);
+ ret=fscanf(fpid,"%10i\n",&pid);
if (ret==1) recs[Position].Pid=pid;
fclose(fpid);
}