summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eepg.c35
-rw-r--r--log.h3
-rw-r--r--setupeepg.c33
-rw-r--r--setupeepg.h33
4 files changed, 70 insertions, 34 deletions
diff --git a/eepg.c b/eepg.c
index 22ee520..2ed8f2f 100644
--- a/eepg.c
+++ b/eepg.c
@@ -40,6 +40,7 @@
#include "dish.h"
#include "epghandler.h"
#include "log.h"
+#include "setupeepg.h"
#include <map>
#include <string>
@@ -75,8 +76,6 @@ static const char *DESCRIPTION = trNOOP ("Parses Extended EPG data");
using namespace std;
-// --- cSetupEEPG -------------------------------------------------------
-
const char *optPats[] = {
"%s",
"%s (Option %d)",
@@ -101,38 +100,8 @@ char *cs_hexdump (int m, const uchar * buf, int n)
return (dump);
}
-class cSetupEEPG
-{
-public:
- int OptPat;
- int OrderInfo;
- int RatingInfo;
- int FixEpg;
- int DisplayMessage;
- int ProcessEIT;
-#ifdef DEBUG
- int LogLevel;
-#endif
-
-public:
- cSetupEEPG (void);
-};
-
-cSetupEEPG SetupPE;
+cSetupEEPG SetupPE = *cSetupEEPG::getInstance();
-cSetupEEPG::cSetupEEPG (void)
-{
- OptPat = 1;
- OrderInfo = 1;
- RatingInfo = 1;
- FixEpg = 0;
- DisplayMessage = 1;
- ProcessEIT = 0;
-#ifdef DEBUG
- LogLevel = 0;
-#endif
-
-}
// --- cMenuSetupPremiereEpg ------------------------------------------------------------
diff --git a/log.h b/log.h
index 900aed6..c771d5f 100644
--- a/log.h
+++ b/log.h
@@ -10,6 +10,7 @@
#include <string>
#include <stdarg.h>
+#include "setupeepg.h"
#define VERBOSE 1
/* 0 = only print errors, 1 = print channels and themes, 2 = print channels, themes, titles, summaries 3 = debug mode */
@@ -19,7 +20,7 @@
bool CheckLevel(int level)
{
#ifdef DEBUG
- if (SetupPE.LogLevel >= level)
+ if (cSetupEEPG::getInstance().LogLevel >= level)
#else
if (VERBOSE >= level)
#endif
diff --git a/setupeepg.c b/setupeepg.c
new file mode 100644
index 0000000..4c6693d
--- /dev/null
+++ b/setupeepg.c
@@ -0,0 +1,33 @@
+/*
+ * setupeepg.c
+ *
+ * Created on: 08.5.2012
+ * Author: d.petrovski
+ */
+
+#include "setupeepg.h"
+
+// --- cSetupEEPG -------------------------------------------------------
+
+cSetupEEPG::cSetupEEPG (void)
+{
+ OptPat = 1;
+ OrderInfo = 1;
+ RatingInfo = 1;
+ FixEpg = 0;
+ DisplayMessage = 1;
+ ProcessEIT = 0;
+#ifdef DEBUG
+ LogLevel = 0;
+#endif
+
+}
+
+static cSetupEEPG* cSetupEEPG::getInstance()
+{
+ if (!_setupEEPG)
+ _setupEEPG = new cSetupEEPG();
+
+ return _setupEEPG;
+}
+
diff --git a/setupeepg.h b/setupeepg.h
new file mode 100644
index 0000000..7441223
--- /dev/null
+++ b/setupeepg.h
@@ -0,0 +1,33 @@
+/*
+ * setupeepg.h
+ *
+ * Created on: 08.5.2012
+ * Author: d.petrovski
+ */
+
+#ifndef SETUPEEPG_H_
+#define SETUPEEPG_H_
+
+class cSetupEEPG
+{
+public:
+ int OptPat;
+ int OrderInfo;
+ int RatingInfo;
+ int FixEpg;
+ int DisplayMessage;
+ int ProcessEIT;
+#ifdef DEBUG
+ int LogLevel;
+#endif
+
+public:
+ static cSetupEEPG* getInstance();
+
+private:
+ cSetupEEPG (void);
+ cSetupEEPG* _setupEEPG;
+
+};
+
+#endif /* SETUPEEPG_H_ */