summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-05-25 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-05-25 18:00:00 +0200
commit8ab980e1d9be404a8842fad54aa9c2e34fa6f4ea (patch)
tree0c0d1f31848a7aa5ed21a2426f65dd65b94e6d80 /menu.c
parent3bd9a7ccf355e445685ff115464a4e684a8c4211 (diff)
downloadvdr-patch-lnbsharing-8ab980e1d9be404a8842fad54aa9c2e34fa6f4ea.tar.gz
vdr-patch-lnbsharing-8ab980e1d9be404a8842fad54aa9c2e34fa6f4ea.tar.bz2
Version 1.1.33vdr-1.1.33
- Modified handling of audio packets in cDvbPlayer for better sync with external AC3 replay (thanks to Werner Fink). - Fixed a memory leak in cNonBlockingFileReader (thanks to Stefan Huelswitt). - Completed the French OSD texts (thanks to Gregoire Favre). - Completed the Finnish OSD texts (thanks to Niko Tarnanen and Rolf Ahrenberg). - Fixed I/O handling in case an explicit controlling terminal is given (thanks to Oliver Endriss). - Fixed resume file handling in case the resume.vdr file can't be written (thanks to Gerhard Steiner). - Fixed cutting a recording if there is only a single editing mark (thanks to Ralf Klueber for reporting this one). - Fixed volume display in case a plugin has its own OSD open (thanks to Marcel Wiesweg). - Fixed channel switching in the EPG scanner on single device systems. - Completed the Swedish OSD texts (thanks to Tomas Prybil). - Now switching to the channel used by the most recently started timer in case the original current channel becomes unavailable due to a recording on a different transponder. If this fails, a channel up/down switch is attempted as a fallback solution (thanks to Lauri Tischler for reporting this one, and to Hermann Gausterer for suggesting to switch to the recording channel). - Fixed cReplayControl::Show() to avoid a compiler warning in g++ 3.2.3 (thanks to Jan Ekholm for reporting this one). - Completed the Slovenian OSD texts (thanks to Matjaz Thaler). - Changed the DEFAULTPRIORITY in device.c to -1, so that the primary device will be used for FTA recordings in case the CAM is connected to a non-primary device (thanks to Reinhard Walter Buchner for reporting this one). - The cCiHandler now closes its file handle when it gets destroyed. - Checking for duplicate recordings with the same file name and disabling the second timer (thanks to Peter Bieringer for reporting this one). - Fixed handling newly created timers in case they are not confirmed with "Ok" (thanks to Gerhard Steiner for reporting this one). - It is now possible to directly delete a timer that is currently recording (thanks to Alexander Damhuis for reporting this one).
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c72
1 files changed, 57 insertions, 15 deletions
diff --git a/menu.c b/menu.c
index f4c58b3..9fb3750 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.245 2003/05/16 12:40:12 kls Exp $
+ * $Id: menu.c 1.249 2003/05/25 14:06:17 kls Exp $
*/
#include "menu.h"
@@ -834,6 +834,7 @@ private:
cTimer *timer;
cTimer data;
int channel;
+ bool deleteIfCancelled;
cMenuEditDateItem *firstday;
void SetFirstDayItem(void);
public:
@@ -847,6 +848,7 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
{
firstday = NULL;
timer = Timers.Get(Index);
+ deleteIfCancelled = New;
if (timer) {
data = *timer;
if (New)
@@ -867,6 +869,12 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
cMenuEditTimer::~cMenuEditTimer()
{
+ if (timer && deleteIfCancelled) {
+ int Index = timer->Index();
+ Timers.Del(timer);
+ Timers.Save();
+ isyslog("timer %d deleted", Index + 1);
+ }
Timers.DecBeingEdited();
}
@@ -907,6 +915,7 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key)
Timers.Save();
isyslog("timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
}
+ deleteIfCancelled = false;
}
return osBack;
case kRed:
@@ -1044,18 +1053,22 @@ eOSState cMenuTimers::Delete(void)
// Check if this timer is active:
cTimer *ti = CurrentTimer();
if (ti) {
- if (!ti->Recording()) {
- if (Interface->Confirm(tr("Delete timer?"))) {
- int Index = ti->Index();
- Timers.Del(ti);
- cOsdMenu::Del(Current());
- Timers.Save();
- Display();
- isyslog("timer %d deleted", Index + 1);
+ if (Interface->Confirm(tr("Delete timer?"))) {
+ if (ti->Recording()) {
+ if (Interface->Confirm(tr("Timer still recording - really delete?"))) {
+ ti->Skip();
+ cRecordControls::Process(time(NULL));
+ }
+ else
+ return osContinue;
}
+ int Index = ti->Index();
+ Timers.Del(ti);
+ cOsdMenu::Del(Current());
+ Timers.Save();
+ Display();
+ isyslog("timer %d deleted", Index + 1);
}
- else
- Interface->Error(tr("Timer is recording!"));
}
return osContinue;
}
@@ -1081,6 +1094,8 @@ eOSState cMenuTimers::Summary(void)
eOSState cMenuTimers::ProcessKey(eKeys Key)
{
+ cTimer *ti = HasSubMenu() ? CurrentTimer() : NULL;
+ int TimerNumber = ti ? ti->Index() : -1;
eOSState state = cOsdMenu::ProcessKey(Key);
if (state == osUnknown) {
@@ -1097,6 +1112,11 @@ eOSState cMenuTimers::ProcessKey(eKeys Key)
default: break;
}
}
+ if (TimerNumber >= 0 && !HasSubMenu() && !Timers.Get(TimerNumber)) {
+ // a newly created timer wasn't confirmed with Ok
+ cOsdMenu::Del(Current());
+ Display();
+ }
return state;
}
@@ -1263,7 +1283,7 @@ eOSState cMenuWhatsOn::Record(void)
delete timer;
timer = t;
}
- return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
+ return AddSubMenu(new cMenuEditTimer(timer->Index(), !t));
}
return osContinue;
}
@@ -1397,7 +1417,7 @@ eOSState cMenuSchedule::Record(void)
delete timer;
timer = t;
}
- return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
+ return AddSubMenu(new cMenuEditTimer(timer->Index(), !t));
}
return osContinue;
}
@@ -2938,6 +2958,23 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause)
}
cRecording Recording(timer, Title, Subtitle, Summary);
fileName = strdup(Recording.FileName());
+
+ // crude attempt to avoid duplicate recordings:
+ if (cRecordControls::GetRecordControl(fileName)) {
+ isyslog("already recording: '%s'", fileName);
+ if (Timer) {
+ timer->SetPending(false);
+ timer->SetRecording(false);
+ timer->OnOff();
+ }
+ else {
+ Timers.Del(timer);
+ Timers.Save();
+ }
+ timer = NULL;
+ return;
+ }
+
cRecordingUserCommand::InvokeCommand(RUC_BEFORERECORDING, fileName);
const cChannel *ch = timer->Channel();
recorder = new cRecorder(fileName, ch->Ca(), timer->Priority(), ch->Vpid(), ch->Apid1(), ch->Apid2(), ch->Dpid1(), ch->Dpid2());
@@ -3240,7 +3277,7 @@ void cReplayControl::ClearLastReplayed(const char *FileName)
}
}
-void cReplayControl::Show(int Seconds)
+void cReplayControl::ShowTimed(int Seconds)
{
if (modeOnly)
Hide();
@@ -3250,6 +3287,11 @@ void cReplayControl::Show(int Seconds)
}
}
+void cReplayControl::Show(void)
+{
+ ShowTimed();
+}
+
void cReplayControl::Hide(void)
{
if (visible) {
@@ -3447,7 +3489,7 @@ void cReplayControl::MarkToggle(void)
marks.Del(m);
else {
marks.Add(Current);
- Show(2);
+ ShowTimed(2);
}
marks.Save();
}