#include "misc.h"
#include "scsetup.h"
#include "log-core.h"
+#include "i18n.h"
#define KEY_FILE "SoftCam.Key"
#define EXT_AU_INT (15*60*1000) // ms interval for external AU
if(k->Cmp(nk)) return false;
cPlainKey *ref=0;
- PRINTF(L_GEN_INFO,"key update for ID %s",*nk->ToString(true));
+ cString ks=nk->ToString(true);
+ PRINTF(L_GEN_INFO,"key update for ID %s",*ks);
+ ums.Queue("%s %s",tr("Key update"),*ks);
for(k=0; (k=FindKeyNoTrig(nk->type,nk->id,nk->keynr,nk->Size(),k)); ) {
if(nk->CanSupersede()) {
PRINTF(L_GEN_INFO,"supersedes key: %s",*k->ToString(true));
};
struct LogConfig logcfg = {
- 1,0,0,
+ 1,0,0,0,
0,
"/var/log/vdr-sc"
};
return -1;
}
+// -- cUserMsg -----------------------------------------------------------------
+
+cUserMsg::cUserMsg(const char *m)
+{
+ msg=strdup(m);
+}
+
+cUserMsg::~cUserMsg()
+{
+ free(msg);
+}
+
+// -- cUserMsgs ----------------------------------------------------------------
+
+cUserMsgs ums;
+
+cUserMsgs::cUserMsgs(void)
+{
+ mutex=new cMutex;
+}
+
+cUserMsgs::~cUserMsgs()
+{
+ delete mutex;
+}
+
+void cUserMsgs::Queue(const char *fmt, ...)
+{
+ if(logcfg.logUser) {
+ char buff[1024];
+ va_list ap;
+ va_start(ap,fmt);
+ vsnprintf(buff,sizeof(buff),fmt,ap);
+ va_end(ap);
+ mutex->Lock();
+ Add(new cUserMsg(buff));
+ mutex->Unlock();
+ }
+}
+
+cUserMsg *cUserMsgs::GetQueuedMsg(void)
+{
+ mutex->Lock();
+ cUserMsg *um=First();
+ if(um) Del(um,false);
+ mutex->Unlock();
+ return um;
+}
+
// -- cLogLineBuff -------------------------------------------------------------
cLogLineBuff::cLogLineBuff(int C)
#include "misc.h"
+class cMutex;
+
// ----------------------------------------------------------------
#define LOPT_NUM 24
// ----------------------------------------------------------------
struct LogConfig {
- int logCon, logFile, logSys;
+ int logCon, logFile, logSys, logUser;
int maxFilesize;
char logFilename[128];
};
// ----------------------------------------------------------------
+class cUserMsg : public cSimpleItem {
+private:
+ char *msg;
+public:
+ cUserMsg(const char *m);
+ ~cUserMsg();
+ const char *Message(void) { return msg; };
+ };
+
+// ----------------------------------------------------------------
+
+class cUserMsgs : public cSimpleList<cUserMsg> {
+private:
+ cMutex *mutex;
+public:
+ cUserMsgs(void);
+ ~cUserMsgs();
+ void Queue(const char *fmt, ...) __attribute__ ((format (printf,2,3)));
+ cUserMsg *GetQueuedMsg(void);
+ };
+
+extern cUserMsgs ums;
+
+// ----------------------------------------------------------------
+
class cLogLineBuff : public cLineBuff {
private:
int c;
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:49+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-08-27 12:45+0200\n"
"Last-Translator: somebody\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr "Key Update"
+
msgid "off"
msgstr "aus"
msgid "Log to syslog"
msgstr "Meldungen in Syslog"
+msgid "Show user messages"
+msgstr "Benutzer Meldungen zeigen"
+
msgid "A software emulated CAM"
msgstr "Ein Software emuliertes CAM"
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-08-27 12:45+0200\n"
"Last-Translator: somebody\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "pois"
msgid "Log to syslog"
msgstr "Tulosta systeemilokiin"
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "Ohjelmistopohjainen salauksenpurku"
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-08-27 12:45+0200\n"
"Last-Translator: somebody\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "off"
msgid "Log to syslog"
msgstr ""
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "Un logiciel emulateur de CAM"
msgstr ""
"Project-Id-Version: VDR 1.5.11\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-11-01 16:45+0200\n"
"Last-Translator: jv\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "ki"
msgid "Log to syslog"
msgstr "Naplózás a rendszelogba"
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "Szoftveresen emulált CAM"
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-08-27 12:45+0200\n"
"Last-Translator: somebody\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "spento"
msgid "Log to syslog"
msgstr "Log in Syslog"
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "Un software di emulazione CAM"
msgstr "SC-Seca: aggiornamenti EMM"
msgid "SC-Seca: activate PPV"
-msgstr "SC-Seca: attiva PPV"
+msgstr "SC-Seca: attiva PPV"
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-08-27 12:45+0200\n"
"Last-Translator: somebody\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "uit"
msgid "Log to syslog"
msgstr ""
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "In software geëmuleerde CAM"
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-08-27 12:45+0200\n"
"Last-Translator: somebody\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=ISO-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "wy³±cz"
msgid "Log to syslog"
msgstr ""
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "Programowo emulowany CAM"
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2008-01-03 14:21+0100\n"
"Last-Translator: somebody\n"
"Language-Team: ru\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "ÒëÚÛ"
msgid "Log to syslog"
msgstr "ÁÞÞÑéÕÝØï Ò Syslog"
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "¿àÞÓàÐÜÝëÙ íÜãÛïâÞà CAM"
msgstr ""
"Project-Id-Version: VDR 1.5.9\n"
"Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
"PO-Revision-Date: 2007-08-27 12:45+0200\n"
"Last-Translator: somebody\n"
"Language-Team: somebody\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
+msgid "Key update"
+msgstr ""
+
msgid "off"
msgstr "av"
msgid "Log to syslog"
msgstr ""
+msgid "Show user messages"
+msgstr ""
+
msgid "A software emulated CAM"
msgstr "En mjukvaruemulerad CAM"
virtual bool Start(void);
virtual void Stop(void);
virtual void Housekeeping(void);
+ virtual void MainThreadHook(void);
virtual cMenuSetupPage *SetupMenu(void);
virtual bool SetupParse(const char *Name, const char *Value);
virtual const char **SVDRPHelpPages(void);
ScOpts->Add(new cOptBool ("LocalPriority",trNOOP("Prefer local systems") ,&ScSetup.LocalPriority));
ScOpts->Add(new cOptMInt ("ScCaps" ,trNOOP("Active on DVB card") , ScSetup.ScCaps,MAXSCCAPS,0));
ScOpts->Add(new cOptMInt ("CaIgnore" ,trNOOP("Ignore CAID") , ScSetup.CaIgnore,MAXCAIGN,2));
- LogOpts=new cOpts(0,5);
+ LogOpts=new cOpts(0,6);
LogOpts->Add(new cOptBool ("LogConsole" ,trNOOP("Log to console") ,&logcfg.logCon));
LogOpts->Add(new cOptBool ("LogFile" ,trNOOP("Log to file") ,&logcfg.logFile));
LogOpts->Add(new cOptStr ("LogFileName" ,trNOOP("Filename") ,logcfg.logFilename,sizeof(logcfg.logFilename),FileNameChars));
LogOpts->Add(new cOptInt ("LogFileLimit",trNOOP("Filesize limit (KB)") ,&logcfg.maxFilesize,0,2000000));
LogOpts->Add(new cOptBool ("LogSyslog" ,trNOOP("Log to syslog") ,&logcfg.logSys));
+ LogOpts->Add(new cOptBool ("LogUserMsg" ,trNOOP("Show user messages") ,&logcfg.logUser));
#ifndef STATICBUILD
dlls.Load();
#endif
cSoftCAM::HouseKeeping();
}
+void cScPlugin::MainThreadHook(void)
+{
+ int n=0;
+ cUserMsg *um;
+ while(++n<=10 && (um=ums.GetQueuedMsg())) {
+ Skins.QueueMessage(mtInfo,um->Message());
+ delete um;
+ }
+}
+
const char **cScPlugin::SVDRPHelpPages(void)
{
static const char *HelpPages[] = {