From f8ecc2cd3727b0fde8e75a66b4f20ba8d2670e37 Mon Sep 17 00:00:00 2001 From: T Date: Thu, 30 Mar 2017 22:57:49 +0200 Subject: Changes due to API version 2.3.0 --- responsememblk.c | 11 ++++++++++- smarttvfactory.c | 19 +++++++++++++++++++ smarttvfactory.h | 8 ++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/responsememblk.c b/responsememblk.c index 7a72b67..410ff1b 100755 --- a/responsememblk.c +++ b/responsememblk.c @@ -2762,9 +2762,14 @@ int cResponseMemBlk::GetRecordings( ) { hdr+= "VDR Recordings List\n"; *mResponseMessage += hdr; +#if APIVERSNUM > 20300 + LOCK_RECORDINGS_READ; + const cRecording *recording = NULL; + recording = Recordings->First(); +#else cRecording *recording = NULL; recording = Recordings.First(); - +#endif while (recording != NULL) { hdr = ""; @@ -2797,7 +2802,11 @@ int cResponseMemBlk::GetRecordings( ) { return OKAY; } item_count ++; +#if APIVERSNUM > 20300 + recording = (!single_item) ? Recordings->Next(recording) : NULL; +#else recording = (!single_item) ? Recordings.Next(recording) : NULL; +#endif } hdr = "\n"; diff --git a/smarttvfactory.c b/smarttvfactory.c index eba6329..ac29a45 100755 --- a/smarttvfactory.c +++ b/smarttvfactory.c @@ -136,8 +136,13 @@ void cRecFolder::print(string pref) { }; +#if APIVERSNUM > 20300 +cRecEntry::cRecEntry(string n, int l, Log* lg, const cRecording* r) : cRecEntryBase(n, l, false, lg), mRec(r), mSubfolders(), + mError(false), mTitle(n) { +#else cRecEntry::cRecEntry(string n, int l, Log* lg, cRecording* r) : cRecEntryBase(n, l, false, lg), mRec(r), mSubfolders(), mError(false), mTitle(n) { +#endif size_t pos = 0; size_t l_pos = 0; @@ -956,7 +961,12 @@ void SmartTvServer::acceptHttpResource(int &req_id) { cRecFolder* SmartTvServer::GetRecDb() { +#if APIVERSNUM > 20300 + static cStateKey RecordingsStateKey; + bool changed = cRecordings::GetRecordingsRead(RecordingsStateKey); +#else bool changed = Recordings.StateChanged(mRecState); +#endif *(mLog.log()) << mLog.getTimeString() << " GetRecDb Changed= " << ((changed) ? "Yes" : "No") << endl; @@ -970,7 +980,12 @@ cRecFolder* SmartTvServer::GetRecDb() { } void SmartTvServer::CreateRecDb() { +#if APIVERSNUM > 20300 + LOCK_RECORDINGS_READ + const cRecording *recording = Recordings->First(); +#else cRecording *recording = Recordings.First(); +#endif *(mLog.log()) << mLog.getTimeString() << ": CreateRecDb " << " NewState= " << mRecState << endl; @@ -989,7 +1004,11 @@ void SmartTvServer::CreateRecDb() { << " FName= " << recording->Name() << endl; */ +#if APIVERSNUM > 20300 + recording = Recordings->Next(recording); +#else recording = Recordings.Next(recording); +#endif } diff --git a/smarttvfactory.h b/smarttvfactory.h index 5356bb6..e313e65 100755 --- a/smarttvfactory.h +++ b/smarttvfactory.h @@ -123,7 +123,11 @@ class cRecFolder : public cRecEntryBase { }; class cRecEntry : public cRecEntryBase { +#if APIVERSNUM > 20300 + const cRecording* mRec; +#else cRecording* mRec; +#endif // bool mIsFolder ; public: vector mSubfolders; @@ -132,7 +136,11 @@ class cRecEntry : public cRecEntryBase { string mTitle; // list mEntries; // only when folder +#if APIVERSNUM > 20300 + cRecEntry(string mName, int l, Log* lg, const cRecording*); +#else cRecEntry(string mName, int l, Log* lg, cRecording*); +#endif virtual ~cRecEntry() {}; int writeXmlItem(string *, string own_ip, int own_port); -- cgit v1.2.3