diff options
-rw-r--r-- | recmanager.c | 32 | ||||
-rw-r--r-- | recmanager.h | 6 | ||||
-rw-r--r-- | recmenumanager.c | 49 |
3 files changed, 40 insertions, 47 deletions
diff --git a/recmanager.c b/recmanager.c index 8bf94c3..9aff11c 100644 --- a/recmanager.c +++ b/recmanager.c @@ -180,9 +180,9 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p void cRecManager::DeleteTimer(int timerID) { dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__); #if VDRVERSNUM >= 20301 - const cTimer *t; + cTimer *t; { - LOCK_TIMERS_READ; + LOCK_TIMERS_WRITE; t = Timers->Get(timerID); } #else @@ -207,9 +207,9 @@ void cRecManager::DeleteTimer(const cEvent *event) { void cRecManager::DeleteLocalTimer(const cEvent *event) { dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__); #if VDRVERSNUM >= 20301 - const cTimer *t; + cTimer *t; { - LOCK_TIMERS_READ; + LOCK_TIMERS_WRITE; t = Timers->GetMatch(event); } #else @@ -220,29 +220,23 @@ void cRecManager::DeleteLocalTimer(const cEvent *event) { DeleteTimer(t); } - -#if VDRVERSNUM >= 20301 -void cRecManager::DeleteTimer(const cTimer *timer) { +void cRecManager::DeleteTimer(cTimer *timer) { dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__); +#if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; - cTimers* timers = Timers; - cTimer* t = timers->GetTimer((cTimer*)timer); // #TODO dirty cast - - if (t->Recording()) { - t->Skip(); - cRecordControls::Process(timers, time(NULL)); - } -#else -void cRecManager::DeleteTimer(cTimer *timer) { +#endif if (timer->Recording()) { timer->Skip(); +#if VDRVERSNUM >= 20301 + cRecordControls::Process(Timers, time(NULL)); +#else cRecordControls::Process(time(NULL)); - } #endif + } isyslog("timer %s deleted", *timer->ToDescr()); #if VDRVERSNUM >= 20301 - timers->Del(t, true); - timers->SetModified(); + Timers->Del(timer, true); + Timers->SetModified(); #else Timers.Del(timer, true); Timers.SetModified(); diff --git a/recmanager.h b/recmanager.h index 4fa3a46..1587db0 100644 --- a/recmanager.h +++ b/recmanager.h @@ -37,11 +37,7 @@ public: cTimer *createLocalTimer(const cEvent *event, std::string path); cTimer *createRemoteTimer(const cEvent *event, std::string path); void SetTimerPath(cTimer *timer, const cEvent *event, std::string path); -#if VDRVERSNUM >= 20301 - void DeleteTimer(const cTimer *timer); -#else void DeleteTimer(cTimer *timer); -#endif void DeleteTimer(int timerID); void DeleteTimer(const cEvent *event); void DeleteLocalTimer(const cEvent *event); @@ -76,4 +72,4 @@ public: virtual ~cRecManager (void); }; -#endif //__TVGUIDE_RECMMANAGER_H
\ No newline at end of file +#endif //__TVGUIDE_RECMMANAGER_H diff --git a/recmenumanager.c b/recmenumanager.c index 1c1a9e2..ccf6540 100644 --- a/recmenumanager.c +++ b/recmenumanager.c @@ -1,4 +1,4 @@ -#include "recmenu.h"
+#include "recmenu.h"
#include "recmenus.h"
#include "switchtimer.h"
#include "timerconflict.h"
@@ -87,8 +87,8 @@ void cRecMenuManager::DeleteBackground(void) { eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
eOSState state = osContinue;
switch (nextState) {
- /***************************************************************************************
- * INSTANT RECORDING
+ /***************************************************************************************
+ * INSTANT RECORDING
****************************************************************************************/
case rmsInstantRecord: {
//caller: main menu or folder chooser
@@ -248,7 +248,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { state = osEnd;
Close();
break; }
- /***************************************************************************************
+ /***************************************************************************************
* SERIES TIMER
****************************************************************************************/
case rmsSeriesTimer: {
@@ -285,8 +285,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu = new cRecMenuConfirmSeriesTimer(seriesTimer);
activeMenu->Display();
break; }
- /**********************************************************************************************
- * SEARCH TIMER
+ /**********************************************************************************************
+ * SEARCH TIMER
***********************************************************************************************/
case rmsSearchTimer:
//Caller: main menu
@@ -310,7 +310,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { delete activeMenu;
if (searchString.size() < 4) {
activeMenu = new cRecMenuSearchTimer(event);
- } else {
+ } else {
if (!reload) {
searchTimer.SetSearchString(searchString);
}
@@ -429,7 +429,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu = new cRecMenuSearchTimerDeleteConfirm(searchTimer);
activeMenu->Display();
break; }
- case rmsSearchTimerDelete:
+ case rmsSearchTimerDelete:
case rmsSearchTimerDeleteWithTimers: {
//caller: cRecMenuSearchTimerDeleteConfirm
//actually delete searchtimer
@@ -457,8 +457,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu = new cRecMenuSearchConfirmTimer(ev, rmsFavoritesRecordConfirm);
activeMenu->Display();
break; }
- /**********************************************************************************************
- * SWITCH TIMER
+ /**********************************************************************************************
+ * SWITCH TIMER
***********************************************************************************************/
case rmsSwitchTimer:
delete activeMenu;
@@ -475,14 +475,14 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu = new cRecMenuSwitchTimerConfirm(success);
activeMenu->Display();
break; }
- case rmsSwitchTimerDelete:
+ case rmsSwitchTimerDelete:
recManager->DeleteSwitchTimer(event);
delete activeMenu;
activeMenu = new cRecMenuSwitchTimerDelete();
activeMenu->Display();
break;
- /**********************************************************************************************
- * RECORDINGS SEARCH
+ /**********************************************************************************************
+ * RECORDINGS SEARCH
***********************************************************************************************/
case rmsRecordingSearch: {
//caller: main menu or rmsRecordingSearchResult
@@ -518,8 +518,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { }
activeMenu->Display();
break; }
- /**********************************************************************************************
- * SEARCH
+ /**********************************************************************************************
+ * SEARCH
***********************************************************************************************/
case rmsSearch:
case rmsSearchWithOptions: {
@@ -600,8 +600,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu->UpdateActiveMenuItem();
activeMenu->Show();
break;
- /**********************************************************************************************
- * CHECK FOR TIMER CONFLICTS
+ /**********************************************************************************************
+ * CHECK FOR TIMER CONFLICTS
***********************************************************************************************/
case rmsTimerConflicts: {
//caller: main menu
@@ -708,7 +708,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu->Display();
}
break; }
- /**********************************************************************************************
+ /**********************************************************************************************
* TIMELINE
***********************************************************************************************/
case rmsTimeline: {
@@ -719,7 +719,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { delete activeMenu;
activeMenu = new cRecMenuTimeline(timerConflicts);
activeMenu->Display();
- break; }
+ break; }
case rmsTimelineTimerEdit: {
#if VDRVERSNUM >= 20301
const cTimer *timer;
@@ -764,7 +764,10 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
timer = menu->GetOriginalTimer();
} else break;
- recManager->DeleteTimer(timer);
+ {
+ LOCK_TIMERS_WRITE;
+ recManager->DeleteTimer(Timers->GetTimer(timer));
+ }
delete activeMenu;
if (timerConflicts) {
delete timerConflicts;
@@ -773,7 +776,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { activeMenu = new cRecMenuTimeline(timerConflicts);
activeMenu->Display();
break; }
- /**********************************************************************************************
+ /**********************************************************************************************
* FAVORITES
*********************************************************************************************/
case rmsFavoritesRecord: {
@@ -833,7 +836,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { DisplayFavoriteResults(tvguideConfig.descUser4, result, numResults);
break; }
- /**********************************************************************************************
+ /**********************************************************************************************
* COMMON
*********************************************************************************************/
case rmsClose: {
@@ -849,7 +852,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { state = osContinue;
}
break; }
- default:
+ default:
break;
}
return state;
|