rpms/vdr/devel vdr-timer-info-0.4-1.5.15.diff, NONE, 1.1.2.1 vdr.spec, 1.23.2.10, 1.23.2.11
Ville Skytta (scop)
fedora-extras-commits at redhat.com
Mon Apr 7 18:46:08 UTC 2008
Author: scop
Update of /cvs/pkgs/rpms/vdr/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8545
Modified Files:
Tag: vdr-1_6-test
vdr.spec
Added Files:
Tag: vdr-1_6-test
vdr-timer-info-0.4-1.5.15.diff
Log Message:
Update and apply timer-info patch.
vdr-timer-info-0.4-1.5.15.diff:
--- NEW FILE vdr-timer-info-0.4-1.5.15.diff ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## opt-41-x_timer-info.dpatch by Andreas Brugger <brougs78 at gmx.net>, Thomas Günther <tom at toms-cafe.de>
## http://toms-cafe.de/vdr/download/vdr-timer-info-0.4-1.5.15.diff
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Shows info, if it is possible to record an event in the timer-info of
## DP: vdr - see README.timer-info for details.
@DPATCH@
diff -urNad vdr-1.5.15~/README.timer-info vdr-1.5.15/README.timer-info
--- vdr-1.5.15~/README.timer-info 1970-01-01 01:00:00.000000000 +0100
+++ vdr-1.5.15/README.timer-info 2008-02-17 21:58:01.000000000 +0100
@@ -0,0 +1,61 @@
++------------------------------------------------------------------------------+
+| Info about the timer-info-patch by Brougs78 |
+| brougs78 at gmx.net / home.pages.at/brougs78 |
++------------------------------------------------------------------------------+
+
+
+README timer-info:
+------------------
+
+Features:
+ - Shows info, if it is possible to record an event in the timer menu of vdr.
+ For calculations the free space incl. the deleted recordings is used,
+ considering an average consumtion of 25.75 MB/min (also used by vdr itself).
+ The first column in the timer-list shows:
+ ( + ) recording will be most probably possible (enough space)
+ (+/-) recording may be possible
+ ( - ) recording will most probably fail (to less space)
+ The calculations also consider repeating timers.
+ - It is possible to deactivate the patch in the OSD-menu of VDR.
+
+
+HISTORY timer-info:
+-------------------
+
+25.11.2004: v0.1
+ - Initial release
+
+11.01.2005: v0.1b
+ - Bugfixes for vdr-1.3.18
+ - In the menu the free recording-time no longer includes the space of the
+ deleted recordings, because this slowed the vdr down to much.
+
+08.07.2005: v0.1c
+ - Made the patch configurable
+
+29.01.2006: v0.2 - Thomas Günther <tom at toms-cafe.de>
+ - Rewritten great parts for vdr-1.3.38+
+ http://toms-cafe.de/vdr/download/vdr-timer-info-0.2-1.3.38+.diff
+
+05.02.2006: v0.3 - Thomas Günther <tom at toms-cafe.de>
+ - Fixed refresh of timer menu in cMenuTimers::OnOff
+ - Fixed check of repeating timers
+ - Syslog debug messages can be enabled with Define DEBUG_TIMER_INFO
+ http://toms-cafe.de/vdr/download/vdr-timer-info-0.3-1.3.38+.diff
+
+03.03.2006: v0.4 - Thomas Günther <tom at toms-cafe.de>
+ - Adapted to vdr-1.3.44
+ - Removed setup parameter "Show timer-info"
+ http://toms-cafe.de/vdr/download/vdr-timer-info-0.4-1.3.44.diff
+
+26.03.2006: - Tobias Grimm <tg at e-tobi.net>
+ - Adapted to vdr-1.3.45
+ http://toms-cafe.de/vdr/download/vdr-timer-info-0.4-1.3.45.diff
+
+14.01.2008: - Thomas Günther <tom at toms-cafe.de>
+ - Adapted to vdr-1.5.13
+ http://toms-cafe.de/vdr/download/vdr-timer-info-0.4-1.5.13.diff
+
+17.02.2008: - Tobias Grimm <tg at e-tobi.net>
+ - Adapted to vdr-1.5.15
+ http://toms-cafe.de/vdr/download/vdr-timer-info-0.4-1.5.15.diff
diff -urNad vdr-1.5.15~/menu.c vdr-1.5.15/menu.c
--- vdr-1.5.15~/menu.c 2008-02-17 21:58:01.000000000 +0100
+++ vdr-1.5.15/menu.c 2008-02-17 22:05:25.000000000 +0100
@@ -828,8 +828,10 @@
class cMenuTimerItem : public cOsdItem {
private:
cTimer *timer;
+ char diskStatus;
public:
cMenuTimerItem(cTimer *Timer);
+ void SetDiskStatus(char DiskStatus);
virtual int Compare(const cListObject &ListObject) const;
virtual void Set(void);
cTimer *Timer(void) { return timer; }
@@ -838,6 +840,7 @@
cMenuTimerItem::cMenuTimerItem(cTimer *Timer)
{
timer = Timer;
+ diskStatus = ' ';
Set();
}
@@ -863,7 +866,8 @@
strftime(buffer, sizeof(buffer), "%Y%m%d", &tm_r);
day = buffer;
}
- SetText(cString::sprintf("%c\t%d\t%s%s%s\t%02d:%02d\t%02d:%02d\t%s",
+ SetText(cString::sprintf("%c%c\t%d\t%s%s%s\t%02d:%02d\t%02d:%02d\t%s",
+ diskStatus,
!(timer->HasFlags(tfActive)) ? ' ' : timer->FirstDay() ? '!' : timer->Recording() ? '#' : '>',
timer->Channel()->Number(),
*name,
@@ -876,6 +880,57 @@
timer->File()));
}
+void cMenuTimerItem::SetDiskStatus(char DiskStatus)
+{
+ diskStatus = DiskStatus;
+ Set();
+}
+
+// --- cTimerEntry -----------------------------------------------------------
+
+class cTimerEntry : public cListObject {
+private:
+ cMenuTimerItem *item;
+ const cTimer *timer;
+ time_t start;
+public:
+ cTimerEntry(cMenuTimerItem *item) : item(item), timer(item->Timer()), start(timer->StartTime()) {}
+ cTimerEntry(const cTimer *timer, time_t start) : item(NULL), timer(timer), start(start) {}
+ virtual int Compare(const cListObject &ListObject) const;
+ bool active(void) const { return timer->HasFlags(tfActive); }
+ time_t startTime(void) const { return start; }
+ int priority(void) const { return timer->Priority(); }
+ int duration(void) const;
+ bool repTimer(void) const { return !timer->IsSingleEvent(); }
+ bool isDummy(void) const { return item == NULL; }
+ const cTimer *Timer(void) const { return timer; }
+ void SetDiskStatus(char DiskStatus);
+ };
+
+int cTimerEntry::Compare(const cListObject &ListObject) const
+{
+ cTimerEntry *entry = (cTimerEntry *)&ListObject;
+ int r = startTime() - entry->startTime();
+ if (r == 0)
+ r = entry->priority() - priority();
+ return r;
+}
+
+int cTimerEntry::duration(void) const
+{
+ int dur = (timer->Stop() / 100 * 60 + timer->Stop() % 100) -
+ (timer->Start() / 100 * 60 + timer->Start() % 100);
+ if (dur < 0)
+ dur += 24 * 60;
+ return dur;
+}
+
+void cTimerEntry::SetDiskStatus(char DiskStatus)
+{
+ if (item)
+ item->SetDiskStatus(DiskStatus);
+}
+
// --- cMenuTimers -----------------------------------------------------------
class cMenuTimers : public cOsdMenu {
@@ -888,14 +943,17 @@
eOSState Info(void);
cTimer *CurrentTimer(void);
void SetHelpKeys(void);
+ void ActualiseDiskStatus(void);
+ bool actualiseDiskStatus;
public:
cMenuTimers(void);
virtual ~cMenuTimers();
+ virtual void Display(void);
virtual eOSState ProcessKey(eKeys Key);
};
cMenuTimers::cMenuTimers(void)
-:cOsdMenu(tr("Timers"), 2, CHNUMWIDTH, 10, 6, 6)
+:cOsdMenu(tr("Timers"), 3, CHNUMWIDTH, 10, 6, 6)
{
helpKeys = -1;
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
@@ -906,6 +964,7 @@
SetCurrent(First());
SetHelpKeys();
Timers.IncBeingEdited();
+ actualiseDiskStatus = true;
}
cMenuTimers::~cMenuTimers()
@@ -944,7 +1003,7 @@
timer->OnOff();
timer->SetEventFromSchedule();
RefreshCurrent();
- DisplayCurrent(true);
+ Display();
if (timer->FirstDay())
isyslog("timer %s first day set to %s", *timer->ToDescr(), *timer->PrintFirstDay());
else
@@ -1003,6 +1062,67 @@
return osContinue;
}
+void cMenuTimers::ActualiseDiskStatus(void)
+{
+ if (!actualiseDiskStatus || !Count())
+ return;
+
+ // compute free disk space
+ int freeMB, freeMinutes, runshortMinutes;
+ VideoDiskSpace(&freeMB);
+ freeMinutes = int(double(freeMB) * 1.1 / MB_PER_MINUTE); // overestimate by 10 percent
+ runshortMinutes = freeMinutes / 5; // 20 Percent
+
+ // fill entries list
+ cTimerEntry *entry;
+ cList<cTimerEntry> entries;
+ for (cOsdItem *item = First(); item; item = Next(item))
+ entries.Add(new cTimerEntry((cMenuTimerItem *)item));
+
+ // search last start time
+ time_t last = 0;
+ for (entry = entries.First(); entry; entry = entries.Next(entry))
+ last = max(entry->startTime(), last);
+
+ // add entries for repeating timers
+ for (entry = entries.First(); entry; entry = entries.Next(entry))
+ if (entry->repTimer() && !entry->isDummy())
+ for (time_t start = cTimer::IncDay(entry->startTime(), 1);
+ start <= last;
+ start = cTimer::IncDay(start, 1))
+ if (entry->Timer()->DayMatches(start))
+ entries.Add(new cTimerEntry(entry->Timer(), start));
+
+ // set the disk-status
+ entries.Sort();
+ for (entry = entries.First(); entry; entry = entries.Next(entry)) {
+ char status = ' ';
+ if (entry->active()) {
+ freeMinutes -= entry->duration();
+ status = freeMinutes > runshortMinutes ? '+' : freeMinutes > 0 ? 177 /* +/- */ : '-';
+ }
+ entry->SetDiskStatus(status);
+#ifdef DEBUG_TIMER_INFO
+ dsyslog("timer-info: %c | %d | %s | %s | %3d | %+5d -> %+5d",
+ status,
+ entry->startTime(),
+ entry->active() ? "aktiv " : "n.akt.",
+ entry->repTimer() ? entry->isDummy() ? " dummy " : "mehrmalig" : "einmalig ",
+ entry->duration(),
+ entry->active() ? freeMinutes + entry->duration() : freeMinutes,
+ freeMinutes);
+#endif
+ }
+
+ actualiseDiskStatus = false;
+}
+
+void cMenuTimers::Display(void)
+{
+ ActualiseDiskStatus();
+ cOsdMenu::Display();
+}
+
eOSState cMenuTimers::ProcessKey(eKeys Key)
{
int TimerNumber = HasSubMenu() ? Count() : -1;
@@ -1011,18 +1131,22 @@
if (state == osUnknown) {
switch (Key) {
case kOk: return Edit();
- case kRed: state = OnOff(); break; // must go through SetHelpKeys()!
+ case kRed: actualiseDiskStatus = true;
+ state = OnOff(); break; // must go through SetHelpKeys()!
case kGreen: return New();
- case kYellow: state = Delete(); break;
+ case kYellow: actualiseDiskStatus = true;
+ state = Delete(); break;
case kInfo:
case kBlue: return Info();
break;
default: break;
}
}
- if (TimerNumber >= 0 && !HasSubMenu() && Timers.Get(TimerNumber)) {
- // a newly created timer was confirmed with Ok
- Add(new cMenuTimerItem(Timers.Get(TimerNumber)), true);
+ if (TimerNumber >= 0 && !HasSubMenu()) {
+ if (Timers.Get(TimerNumber)) // a newly created timer was confirmed with Ok
+ Add(new cMenuTimerItem(Timers.Get(TimerNumber)), true);
+ Sort();
+ actualiseDiskStatus = true;
Display();
}
if (Key != kNone)
Index: vdr.spec
===================================================================
RCS file: /cvs/pkgs/rpms/vdr/devel/vdr.spec,v
retrieving revision 1.23.2.10
retrieving revision 1.23.2.11
diff -u -r1.23.2.10 -r1.23.2.11
--- vdr.spec 7 Apr 2008 15:14:45 -0000 1.23.2.10
+++ vdr.spec 7 Apr 2008 18:45:29 -0000 1.23.2.11
@@ -21,7 +21,7 @@
Name: vdr
Version: 1.6.0
-Release: 0.4%{?dist}
+Release: 0.5%{?dist}
Summary: Video Disk Recorder
Group: Applications/Multimedia
@@ -77,6 +77,7 @@
Patch14: %{name}-1.6.0-includes+pkgconfig.patch
Patch15: %{name}-1.6.0-fedora-pkgconfig.patch
Patch16: %{name}-1.6.0-dxr3-subtitles.patch
+Patch17: http://toms-cafe.de/vdr/download/vdr-timer-info-0.4-1.5.15.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libjpeg-devel
@@ -165,8 +166,6 @@
# TODO: does not apply, check upstream:
# http://www.ktverkko.fi/~msmakela/software/vdr/
#patch -i debian/patches/opt-20_suspend.dpatch
-# TODO: does not apply
-#patch -i debian/patches/opt-20_vdr-timer-info.dpatch
%patch2 -p1
%patch3 -p1
sed \
@@ -184,6 +183,8 @@
# TODO: does not apply
#patch10 -p0
%patch11 -p1
+# timer-info patch needs to come before timercmd patch to avoid conflicts
+%patch17 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p0
@@ -486,12 +487,13 @@
%endif # plugins
%changelog
-* Mon Apr 7 2008 Ville Skyttä <ville.skytta at iki.fi>
+* Mon Apr 7 2008 Ville Skyttä <ville.skytta at iki.fi> - 1.6.0-0.5
- Apply "unofficial" timercmd patch from HoochVDR.
- Apply Luca Olivetti's DXR3 subtitle compatibility patch.
- Decrease default wakeup delay before a timed recording to 10 minutes.
- Don't reload DVB drivers by default on unexpected exits in runvdr.
- Use "kill -HUP" in init script's restart action only on a running service.
+- Update and apply timer-info patch.
* Sun Apr 6 2008 Ville Skyttä <ville.skytta at iki.fi> - 1.6.0-0.4
- Obsolete vdr-subtitles.
More information about the fedora-extras-commits
mailing list