summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2022-04-29 12:19:05 +0200
committerhorchi <vdr@jwendel.de>2022-04-29 12:19:05 +0200
commit5a6a55bfab016372c31b901968bb738a4b319326 (patch)
treef8cd1173ff5374d3a3ffc5e3fef53bcbfe0a2c62
parent9c515233168067ee8e56d35a8ee89bfc4d74e618 (diff)
downloadvdr-plugin-epg2vdr-master.tar.gz
vdr-plugin-epg2vdr-master.tar.bz2
2022-04-29: version 1.2.7 (horchi)\n - change: Moded initialize of EPG handler to Initialize() (reported by Alexander Grothe)\n\nHEAD1.2.7master
-rw-r--r--HISTORY.h7
-rw-r--r--epg2vdr.c4
-rw-r--r--handler.h7
-rw-r--r--update.c78
-rw-r--r--update.h133
5 files changed, 75 insertions, 154 deletions
diff --git a/HISTORY.h b/HISTORY.h
index 801c7bc..3fc3c55 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -5,8 +5,8 @@
*
*/
-#define _VERSION "1.2.6"
-#define VERSION_DATE "12.01.2022"
+#define _VERSION "1.2.7"
+#define VERSION_DATE "29.04.2022"
#define DB_API 7
@@ -19,6 +19,9 @@
/*
* ------------------------------------
+2022-04-29: version 1.2.7 (horchi)
+ - change: Moded initialize of EPG handler to Initialize() (reported by Alexander Grothe)
+
2022-01-12: version 1.2.6 (horchi)
- change: Further porting to vdr 2.6 (fixed detection of timer stop)
diff --git a/epg2vdr.c b/epg2vdr.c
index 3f09560..487539f 100644
--- a/epg2vdr.c
+++ b/epg2vdr.c
@@ -25,7 +25,8 @@ const char* logPrefix = LOG_PREFIX;
// Static global handler Instance
//***************************************************************************
-cEpg2VdrEpgHandler* cEpg2VdrEpgHandler::singleton = cEpg2VdrEpgHandler::getSingleton();
+cEpg2VdrEpgHandler* cEpg2VdrEpgHandler::singleton {nullptr};
+// cEpg2VdrEpgHandler* cEpg2VdrEpgHandler::singleton = cEpg2VdrEpgHandler::getSingleton();
//***************************************************************************
// Menu Edit List Item
@@ -1060,6 +1061,7 @@ int cPluginEPG2VDR::recordingDetails(cEpgRecording_Details_Service_V1* rd)
bool cPluginEPG2VDR::Initialize()
{
+ cEpg2VdrEpgHandler::getSingleton();
return true;
}
diff --git a/handler.h b/handler.h
index 799c144..fea38b0 100644
--- a/handler.h
+++ b/handler.h
@@ -5,11 +5,9 @@
*
*/
-#ifndef __HANDLER_H
-#define __HANDLER_H
+#pragma once
#include "lib/vdrlocks.h"
-
#include "update.h"
#define CHANNELMARKOBSOLETE "OBSOLETE"
@@ -1131,6 +1129,3 @@ class cEpg2VdrEpgHandler : public cEpgHandler
static cEpg2VdrEpgHandler* singleton;
};
-
-//***************************************************************************
-#endif // __HANDLER_H
diff --git a/update.c b/update.c
index f70a34b..17da311 100644
--- a/update.c
+++ b/update.c
@@ -79,83 +79,6 @@ const char* cUpdate::auxFields[] =
cUpdate::cUpdate(cPluginEPG2VDR* aPlugin)
: cThread("epg2vdr-update")
{
- // thread / update control
-
- plugin = aPlugin;
- connection = 0;
- loopActive = no;
- timerJobsUpdateTriggered = yes;
- timerTableUpdateTriggered = yes;
- recordingStateChangedTrigger = yes;
- updateRecFolderOptionTrigger = no;
-
- storeAllRecordingInfoFilesTrigger = no;
- recordingFullReloadTrigger = no;
- manualTrigger = no;
- videoBasePath = 0;
- dbReconnectTriggered = no;
- switchTimerTrigger = no;
-
- fullreload = no;
- epgdBusy = yes;
- epgdState = cEpgdState::esUnknown;
- mainActPending = yes;
- eventsPending = no;
- nextEpgdUpdateAt = 0;
-
- lastUpdateAt = 0;
- lastEventsUpdateAt = 0;
- lastRecordingCount = 0;
- lastRecordingDeleteAt = 0;
- timersTableMaxUpdsp = 0;
-
- //
-
- compDb = 0;
- eventsDb = 0;
- useeventsDb = 0;
- fileDb = 0;
- imageDb = 0;
- imageRefDb = 0;
- episodeDb = 0;
- vdrDb = 0;
- mapDb = 0;
- timerDb = 0;
- timerDoneDb = 0;
- recordingDirDb = 0;
- recordingListDb = 0;
- recordingImagesDb = 0;
-
- selectMasterVdr = 0;
- selectAllImages = 0;
- selectUpdEvents = 0;
- selectEventById = 0;
- selectAllChannels = 0;
- selectChannelById = 0;
- markUnknownChannel = 0;
- selectComponentsOf = 0;
- deleteTimer = 0;
- selectMyTimer = 0;
- selectRecordings = 0;
- selectImagesOfRecording = 0;
- selectRecForInfoUpdate = 0;
- selectTimerByEvent = 0;
- selectTimerById = 0;
- selectTimerByDoneId = 0;
- selectMaxUpdSp = 0;
- selectPendingTimerActions = 0;
- selectSwitchTimerActions = 0;
-
- viewDescription = 0;
- viewMergeSource = 0;
- viewLongDescription = 0;
-
- //
-
- epgimagedir = 0;
- withutf8 = no;
- handlerMaster = no;
-
// check/create uuid
if (isEmpty(Epg2VdrConfig.uuid))
@@ -163,7 +86,6 @@ cUpdate::cUpdate(cPluginEPG2VDR* aPlugin)
sstrcpy(Epg2VdrConfig.uuid, getUniqueId(), sizeof(Epg2VdrConfig.uuid));
plugin->SetupStore("Uuid", Epg2VdrConfig.uuid);
Setup.Save();
-
tell(0, "Initially created uuid '%s'", Epg2VdrConfig.uuid);
}
}
diff --git a/update.h b/update.h
index 77481cb..7589cda 100644
--- a/update.h
+++ b/update.h
@@ -222,79 +222,79 @@ class cUpdate : public cThread, public cStatus, public cParameters
// data
- cDbConnection* connection;
- cPluginEPG2VDR* plugin;
- int handlerMaster;
- int loopActive;
- time_t nextEpgdUpdateAt;
- time_t lastUpdateAt;
- time_t lastEventsUpdateAt;
- time_t lastRecordingDeleteAt;
- int lastRecordingCount;
- char* epgimagedir;
- int withutf8;
+ cDbConnection* connection {nullptr};
+ cPluginEPG2VDR* plugin {nullptr};
+ int handlerMaster {no};
+ int loopActive {no};
+ time_t nextEpgdUpdateAt {0};
+ time_t lastUpdateAt {0};
+ time_t lastEventsUpdateAt {0};
+ time_t lastRecordingDeleteAt {0};
+ int lastRecordingCount {0};
+ char* epgimagedir {nullptr};
+ int withutf8 {no};
cCondVar waitCondition;
cMutex mutex;
- int fullreload;
- char imageExtension[3+TB];
+ int fullreload {no};
+ char imageExtension[3+TB] {""};
cMutex timerMutex;
cMutex swTimerMutex;
- int dbReconnectTriggered;
- int timerJobsUpdateTriggered;
- int timerTableUpdateTriggered;
+ int dbReconnectTriggered {no};
+ int timerJobsUpdateTriggered {yes};
+ int timerTableUpdateTriggered {yes};
cStateKey timerStateKey;
- int manualTrigger;
- int recordingStateChangedTrigger;
- int recordingFullReloadTrigger;
- int storeAllRecordingInfoFilesTrigger;
- int updateRecFolderOptionTrigger;
- int switchTimerTrigger;
+ int manualTrigger {no};
+ int recordingStateChangedTrigger {yes};
+ int recordingFullReloadTrigger {no};
+ int storeAllRecordingInfoFilesTrigger {no};
+ int updateRecFolderOptionTrigger {no};
+ int switchTimerTrigger {no};
cList<cRunningRecording> runningRecordings;
cMutex runningRecMutex;
- Es::State epgdState;
- int epgdBusy;
- int eventsPending;
- int mainActPending;
- const char* videoBasePath;
- int timersTableMaxUpdsp;
-
- cDbTable* eventsDb;
- cDbTable* useeventsDb;
- cDbTable* fileDb;
- cDbTable* imageDb;
- cDbTable* imageRefDb;
- cDbTable* episodeDb;
- cDbTable* mapDb;
- cDbTable* timerDb;
- cDbTable* timerDoneDb;
- cDbTable* vdrDb;
- cDbTable* compDb;
- cDbTable* recordingDirDb;
- cDbTable* recordingListDb;
- cDbTable* recordingImagesDb;
-
- cDbStatement* selectMasterVdr;
- cDbStatement* selectAllImages;
- cDbStatement* selectUpdEvents;
+ Es::State epgdState {cEpgdState::esUnknown};
+ int epgdBusy {yes};
+ int eventsPending {no};
+ int mainActPending {yes};
+ const char* videoBasePath {nullptr};
+ int timersTableMaxUpdsp {0};
+
+ cDbTable* eventsDb {nullptr};
+ cDbTable* useeventsDb {nullptr};
+ cDbTable* fileDb {nullptr};
+ cDbTable* imageDb {nullptr};
+ cDbTable* imageRefDb {nullptr};
+ cDbTable* episodeDb {nullptr};
+ cDbTable* mapDb {nullptr};
+ cDbTable* timerDb {nullptr};
+ cDbTable* timerDoneDb {nullptr};
+ cDbTable* vdrDb {nullptr};
+ cDbTable* compDb {nullptr};
+ cDbTable* recordingDirDb {nullptr};
+ cDbTable* recordingListDb {nullptr};
+ cDbTable* recordingImagesDb {nullptr};
+
+ cDbStatement* selectMasterVdr {nullptr};
+ cDbStatement* selectAllImages {nullptr};
+ cDbStatement* selectUpdEvents {nullptr};
cDbStatement* selectAllEvents {nullptr};
- cDbStatement* selectEventById;
- cDbStatement* selectAllChannels;
- cDbStatement* selectChannelById;
- cDbStatement* markUnknownChannel;
- cDbStatement* selectComponentsOf;
- cDbStatement* deleteTimer;
- cDbStatement* selectMyTimer;
- cDbStatement* selectRecordings;
- cDbStatement* selectImagesOfRecording;
- cDbStatement* selectRecForInfoUpdate;
- cDbStatement* selectPendingTimerActions;
- cDbStatement* selectSwitchTimerActions;
- cDbStatement* selectTimerByEvent;
- cDbStatement* selectTimerById;
- cDbStatement* selectTimerByDoneId;
- cDbStatement* selectMaxUpdSp;
+ cDbStatement* selectEventById {nullptr};
+ cDbStatement* selectAllChannels {nullptr};
+ cDbStatement* selectChannelById {nullptr};
+ cDbStatement* markUnknownChannel {nullptr};
+ cDbStatement* selectComponentsOf {nullptr};
+ cDbStatement* deleteTimer {nullptr};
+ cDbStatement* selectMyTimer {nullptr};
+ cDbStatement* selectRecordings {nullptr};
+ cDbStatement* selectImagesOfRecording {nullptr};
+ cDbStatement* selectRecForInfoUpdate {nullptr};
+ cDbStatement* selectPendingTimerActions {nullptr};
+ cDbStatement* selectSwitchTimerActions {nullptr};
+ cDbStatement* selectTimerByEvent {nullptr};
+ cDbStatement* selectTimerById {nullptr};
+ cDbStatement* selectTimerByDoneId {nullptr};
+ cDbStatement* selectMaxUpdSp {nullptr};
cDbValue vdrEvtId;
cDbValue extEvtId;
@@ -305,9 +305,9 @@ class cUpdate : public cThread, public cStatus, public cParameters
cDbValue imageSizeRec;
cDbValue masterId;
- cDbValue* viewDescription;
- cDbValue* viewMergeSource;
- cDbValue* viewLongDescription;
+ cDbValue* viewDescription {nullptr};
+ cDbValue* viewMergeSource {nullptr};
+ cDbValue* viewLongDescription {nullptr};
std::queue<std::string> pendingNewRecordings; // recordings to store details (obsolete if pendingRecordingActions implemented finally)
std::queue<RecordingAction> pendingRecordingActions; // recordings actions (start/stop)
@@ -317,6 +317,5 @@ class cUpdate : public cThread, public cStatus, public cParameters
std::list<cTimerThread*> timerThreads;
static void sendEvent(int event, void* userData);
-
static const char* auxFields[];
};