mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Version 1.4.1-3
- Fixed assigning schedules to channels in case there is no initial EPG information (thanks to Frank Schmirler). - Increased the APIVERSION to allow plugins that relied on the cStatus::MsgSetVolume() bug to react properly (suggested by Stefan Huelswitt). - Fixed cDevice::ToggleMute() (thanks to Christoph Haubrich). - Fixed deleting the last character of a string menu item in insert mode (thanks to Udo Richter). - The /video/.update file is now touched _after_ an editing process is finished in order to avoid excessive disk access (thanks to Artur Skawina). - Fixed handling the running status of EPG events before the currently running one, in case they are added after the current event (cont'd from version 1.4.1-2). - Modified the shutdown mechanism, so that the shutdown script is never given a time in the past (reported by Helmut Auer). If a timer is currently recording, or a recording would start within the next 30 minutes (default for the "Min. event timeout" setup parameter), and the user insists in shutting down now, the reboot time given to the shutdown script will correspond to a time that is "Min. event timeout" minutes (default is 30) in the future. - Avoiding shutdown message "Recording in ... minutes, shut down anyway?" with a negative number of minutes (reported by Udo Richter). - Fixed getting the next active timer when shutting down (thanks to Udo Richter). - Modified the cSVDRP::Close() function to avoid code duplication.
This commit is contained in:
parent
80c0452968
commit
33f1491b18
12
CONTRIBUTORS
12
CONTRIBUTORS
@ -220,6 +220,8 @@ Stefan Huelswitt <huels@iname.com>
|
|||||||
for reporting a problem with channel up/down switching on single card systems
|
for reporting a problem with channel up/down switching on single card systems
|
||||||
for fixing the PremiereContentTransmissionDescriptor in 'libsi'
|
for fixing the PremiereContentTransmissionDescriptor in 'libsi'
|
||||||
for reporting a double fdopen() in cPipe::Open()
|
for reporting a double fdopen() in cPipe::Open()
|
||||||
|
for suggesting to increase the APIVERSION to allow plugins that relied on the
|
||||||
|
cStatus::MsgSetVolume() bug to react properly
|
||||||
|
|
||||||
Ulrich Röder <roeder@efr-net.de>
|
Ulrich Röder <roeder@efr-net.de>
|
||||||
for pointing out that there are channels that have a symbol rate higher than 27500
|
for pointing out that there are channels that have a symbol rate higher than 27500
|
||||||
@ -277,6 +279,8 @@ Artur Skawina <skawina@geocities.com>
|
|||||||
for a patch that contained a fix for checking toFile in cCuttingThread::Action()
|
for a patch that contained a fix for checking toFile in cCuttingThread::Action()
|
||||||
for improving cUnbufferedFile
|
for improving cUnbufferedFile
|
||||||
for fixing calculating the cache size in cUnbufferedFile::Read()
|
for fixing calculating the cache size in cUnbufferedFile::Read()
|
||||||
|
for making the /video/.update file be touched _after_ an editing process is finished
|
||||||
|
in order to avoid excessive disk access
|
||||||
|
|
||||||
Werner Fink <werner@suse.de>
|
Werner Fink <werner@suse.de>
|
||||||
for making I/O more robust by handling EINTR
|
for making I/O more robust by handling EINTR
|
||||||
@ -577,6 +581,8 @@ Helmut Auer <vdr@helmutauer.de>
|
|||||||
for reporting a problem with the "Press any key on the RC unit" step when learning
|
for reporting a problem with the "Press any key on the RC unit" step when learning
|
||||||
LIRC remote control codes
|
LIRC remote control codes
|
||||||
for suggesting to reduce the logging for the SVDRP GRAB command
|
for suggesting to reduce the logging for the SVDRP GRAB command
|
||||||
|
for reporting that the shutdown script is given a reboot time in the past if there
|
||||||
|
is a recording going on or about to start, and the user insists in shutting down now
|
||||||
|
|
||||||
Jeremy Hall <jhall@UU.NET>
|
Jeremy Hall <jhall@UU.NET>
|
||||||
for fixing an incomplete initialization of the filter parameters in eit.c
|
for fixing an incomplete initialization of the filter parameters in eit.c
|
||||||
@ -1450,6 +1456,10 @@ Udo Richter <udo_richter@gmx.de>
|
|||||||
for adding "-fPIC" to the compiler options in Make.config.template when compiling
|
for adding "-fPIC" to the compiler options in Make.config.template when compiling
|
||||||
plugins
|
plugins
|
||||||
for reporting a missing '--vfat' in the vdr.1 man page
|
for reporting a missing '--vfat' in the vdr.1 man page
|
||||||
|
for fixing deleting the last character of a string menu item in insert mode
|
||||||
|
for reporting that the shutdown message "Recording in ... minutes, shut down anyway?"
|
||||||
|
may have been given with a negative number of minutes
|
||||||
|
for fixing getting the next active timer when shutting down
|
||||||
|
|
||||||
Sven Kreiensen <svenk@kammer.uni-hannover.de>
|
Sven Kreiensen <svenk@kammer.uni-hannover.de>
|
||||||
for his help in keeping 'channels.conf.terr' up to date
|
for his help in keeping 'channels.conf.terr' up to date
|
||||||
@ -1871,6 +1881,7 @@ Christoph Haubrich <christoph1.haubrich@arcor.de>
|
|||||||
the jump instead of closing the display
|
the jump instead of closing the display
|
||||||
for reporting that the log message "deleting plugin: ..." is irritating when
|
for reporting that the log message "deleting plugin: ..." is irritating when
|
||||||
calling "vdr --help"
|
calling "vdr --help"
|
||||||
|
for fixing cDevice::ToggleMute()
|
||||||
|
|
||||||
Pekka Mauno <pekka.mauno@iki.fi>
|
Pekka Mauno <pekka.mauno@iki.fi>
|
||||||
for fixing cSchedule::GetFollowingEvent() in case there is currently no present
|
for fixing cSchedule::GetFollowingEvent() in case there is currently no present
|
||||||
@ -1958,3 +1969,4 @@ Norbert Wentz <norbert.wentz@online.de>
|
|||||||
|
|
||||||
Frank Schmirler <vdr@schmirler.de>
|
Frank Schmirler <vdr@schmirler.de>
|
||||||
for fixing handling client side termination of SVDRP connections
|
for fixing handling client side termination of SVDRP connections
|
||||||
|
for fixing assigning schedules to channels in case there is no initial EPG information
|
||||||
|
24
HISTORY
24
HISTORY
@ -4834,3 +4834,27 @@ Video Disk Recorder Revision History
|
|||||||
have a dedicated minimum or maximum limit (suggested by Andy Grobb). Looping is
|
have a dedicated minimum or maximum limit (suggested by Andy Grobb). Looping is
|
||||||
only done for normal keypresses, not for repeated ones. This allows the user to
|
only done for normal keypresses, not for repeated ones. This allows the user to
|
||||||
scroll the value all the way to the limit by keeping the key pressed.
|
scroll the value all the way to the limit by keeping the key pressed.
|
||||||
|
|
||||||
|
2006-08-06: Version 1.4.1-3
|
||||||
|
|
||||||
|
- Fixed assigning schedules to channels in case there is no initial EPG information
|
||||||
|
(thanks to Frank Schmirler).
|
||||||
|
- Increased the APIVERSION to allow plugins that relied on the cStatus::MsgSetVolume()
|
||||||
|
bug to react properly (suggested by Stefan Huelswitt).
|
||||||
|
- Fixed cDevice::ToggleMute() (thanks to Christoph Haubrich).
|
||||||
|
- Fixed deleting the last character of a string menu item in insert mode (thanks
|
||||||
|
to Udo Richter).
|
||||||
|
- The /video/.update file is now touched _after_ an editing process is finished
|
||||||
|
in order to avoid excessive disk access (thanks to Artur Skawina).
|
||||||
|
- Fixed handling the running status of EPG events before the currently running one,
|
||||||
|
in case they are added after the current event (cont'd from version 1.4.1-2).
|
||||||
|
- Modified the shutdown mechanism, so that the shutdown script is never given a
|
||||||
|
time in the past (reported by Helmut Auer). If a timer is currently recording,
|
||||||
|
or a recording would start within the next 30 minutes (default for the "Min.
|
||||||
|
event timeout" setup parameter), and the user insists in shutting down now, the
|
||||||
|
reboot time given to the shutdown script will correspond to a time that is
|
||||||
|
"Min. event timeout" minutes (default is 30) in the future.
|
||||||
|
- Avoiding shutdown message "Recording in ... minutes, shut down anyway?" with
|
||||||
|
a negative number of minutes (reported by Udo Richter).
|
||||||
|
- Fixed getting the next active timer when shutting down (thanks to Udo Richter).
|
||||||
|
- Modified the cSVDRP::Close() function to avoid code duplication.
|
||||||
|
11
INSTALL
11
INSTALL
@ -171,7 +171,7 @@ calling the shutdown program, but will rather continue normally until it
|
|||||||
receives a SIGTERM when the computer is actually shut down. So in case
|
receives a SIGTERM when the computer is actually shut down. So in case
|
||||||
the shutdown fails, or the shutdown program for some reason decides not to
|
the shutdown fails, or the shutdown program for some reason decides not to
|
||||||
perform a shutdown, VDR will stay up and running and will call the shutdown
|
perform a shutdown, VDR will stay up and running and will call the shutdown
|
||||||
program again after another MinUserInactivity minutes.
|
program again after another five minutes.
|
||||||
|
|
||||||
If there are currently no timers active, both parameters will be '0'.
|
If there are currently no timers active, both parameters will be '0'.
|
||||||
In that case the program shall not set the hardware for automatic restart
|
In that case the program shall not set the hardware for automatic restart
|
||||||
@ -191,11 +191,10 @@ that this is a user requested shutdown (resulting from pressing the "Power"
|
|||||||
key). The shutdown program may use this information to decide whether or
|
key). The shutdown program may use this information to decide whether or
|
||||||
not to actually perform the system shutdown.
|
not to actually perform the system shutdown.
|
||||||
|
|
||||||
If a timer is currently recording, the parameters will reflect the start
|
If a timer is currently recording, or a recording would start within the
|
||||||
time of that timer. This means that the first parameter will be a time in
|
next 30 minutes (default for the "Min. event timeout" setup parameter), and
|
||||||
the past, and the second parameter will be a negative number. This only
|
the user insists in shutting down now, the first and second parameter will
|
||||||
happens if the user presses the "Power" key while a timer is currently
|
correspond to a time that is "Min. event timeout" minutes in the future.
|
||||||
recording.
|
|
||||||
|
|
||||||
Before the shutdown program is called, the user will be prompted to inform
|
Before the shutdown program is called, the user will be prompted to inform
|
||||||
him that the system is about to shut down. If any remote control key is
|
him that the system is about to shut down. If any remote control key is
|
||||||
|
8
config.h
8
config.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.h 1.262 2006/06/24 09:08:46 kls Exp $
|
* $Id: config.h 1.264 2006/07/29 09:56:04 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CONFIG_H
|
#ifndef __CONFIG_H
|
||||||
@ -21,13 +21,13 @@
|
|||||||
|
|
||||||
// VDR's own version number:
|
// VDR's own version number:
|
||||||
|
|
||||||
#define VDRVERSION "1.4.1-2"
|
#define VDRVERSION "1.4.1-3"
|
||||||
#define VDRVERSNUM 10401 // Version * 10000 + Major * 100 + Minor
|
#define VDRVERSNUM 10401 // Version * 10000 + Major * 100 + Minor
|
||||||
|
|
||||||
// The plugin API's version number:
|
// The plugin API's version number:
|
||||||
|
|
||||||
#define APIVERSION "1.4.1"
|
#define APIVERSION "1.4.2"
|
||||||
#define APIVERSNUM 10401 // Version * 10000 + Major * 100 + Minor
|
#define APIVERSNUM 10402 // Version * 10000 + Major * 100 + Minor
|
||||||
|
|
||||||
// When loading plugins, VDR searches them by their APIVERSION, which
|
// When loading plugins, VDR searches them by their APIVERSION, which
|
||||||
// may be smaller than VDRVERSION in case there have been no changes to
|
// may be smaller than VDRVERSION in case there have been no changes to
|
||||||
|
5
cutter.c
5
cutter.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: cutter.c 1.15 2006/02/12 10:07:23 kls Exp $
|
* $Id: cutter.c 1.16 2006/07/30 10:22:08 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cutter.h"
|
#include "cutter.h"
|
||||||
@ -171,6 +171,7 @@ void cCuttingThread::Action(void)
|
|||||||
LastMark = true;
|
LastMark = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Recordings.TouchUpdate();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
esyslog("no editing marks found!");
|
esyslog("no editing marks found!");
|
||||||
@ -205,7 +206,7 @@ bool cCutter::Start(const char *FileName)
|
|||||||
// XXX
|
// XXX
|
||||||
editedVersionName = strdup(evn);
|
editedVersionName = strdup(evn);
|
||||||
Recording.WriteInfo();
|
Recording.WriteInfo();
|
||||||
Recordings.AddByName(editedVersionName);
|
Recordings.AddByName(editedVersionName, false);
|
||||||
cuttingThread = new cCuttingThread(FileName, editedVersionName);
|
cuttingThread = new cCuttingThread(FileName, editedVersionName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
6
device.c
6
device.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: device.c 1.133 2006/07/22 14:06:11 kls Exp $
|
* $Id: device.c 1.134 2006/07/29 10:03:56 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
@ -751,12 +751,12 @@ bool cDevice::ToggleMute(void)
|
|||||||
mute = !mute;
|
mute = !mute;
|
||||||
//XXX why is it necessary to use different sequences???
|
//XXX why is it necessary to use different sequences???
|
||||||
if (mute) {
|
if (mute) {
|
||||||
SetVolume(0, mute);
|
SetVolume(0, true);
|
||||||
Audios.MuteAudio(mute); // Mute external audio after analog audio
|
Audios.MuteAudio(mute); // Mute external audio after analog audio
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Audios.MuteAudio(mute); // Enable external audio before analog audio
|
Audios.MuteAudio(mute); // Enable external audio before analog audio
|
||||||
SetVolume(0, mute);
|
SetVolume(OldVolume, true);
|
||||||
}
|
}
|
||||||
volume = OldVolume;
|
volume = OldVolume;
|
||||||
return mute;
|
return mute;
|
||||||
|
7
eit.c
7
eit.c
@ -8,7 +8,7 @@
|
|||||||
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
||||||
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
|
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
|
||||||
*
|
*
|
||||||
* $Id: eit.c 1.119 2006/07/22 09:21:59 kls Exp $
|
* $Id: eit.c 1.120 2006/08/05 10:01:21 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "eit.h"
|
#include "eit.h"
|
||||||
@ -94,6 +94,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
|
|||||||
pEvent->SetStartTime(SiEitEvent.getStartTime());
|
pEvent->SetStartTime(SiEitEvent.getStartTime());
|
||||||
pEvent->SetDuration(SiEitEvent.getDuration());
|
pEvent->SetDuration(SiEitEvent.getDuration());
|
||||||
}
|
}
|
||||||
|
if (newEvent)
|
||||||
|
pSchedule->AddEvent(newEvent);
|
||||||
if (Tid == 0x4E) { // we trust only the present/following info on the actual TS
|
if (Tid == 0x4E) { // we trust only the present/following info on the actual TS
|
||||||
if (SiEitEvent.getRunningStatus() >= SI::RunningStatusNotRunning)
|
if (SiEitEvent.getRunningStatus() >= SI::RunningStatusNotRunning)
|
||||||
pSchedule->SetRunningStatus(pEvent, SiEitEvent.getRunningStatus(), channel);
|
pSchedule->SetRunningStatus(pEvent, SiEitEvent.getRunningStatus(), channel);
|
||||||
@ -240,9 +242,6 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
|
|||||||
delete ExtendedEventDescriptors;
|
delete ExtendedEventDescriptors;
|
||||||
delete ShortEventDescriptor;
|
delete ShortEventDescriptor;
|
||||||
|
|
||||||
if (newEvent)
|
|
||||||
pSchedule->AddEvent(newEvent);
|
|
||||||
|
|
||||||
pEvent->SetComponents(Components);
|
pEvent->SetComponents(Components);
|
||||||
|
|
||||||
pEvent->FixEpgBugs();
|
pEvent->FixEpgBugs();
|
||||||
|
14
epg.c
14
epg.c
@ -7,7 +7,7 @@
|
|||||||
* Original version (as used in VDR before 1.3.0) written by
|
* Original version (as used in VDR before 1.3.0) written by
|
||||||
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
||||||
*
|
*
|
||||||
* $Id: epg.c 1.77 2006/07/22 10:13:34 kls Exp $
|
* $Id: epg.c 1.79 2006/08/05 10:04:17 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "epg.h"
|
#include "epg.h"
|
||||||
@ -647,7 +647,7 @@ Final:
|
|||||||
cSchedule::cSchedule(tChannelID ChannelID)
|
cSchedule::cSchedule(tChannelID ChannelID)
|
||||||
{
|
{
|
||||||
channelID = ChannelID;
|
channelID = ChannelID;
|
||||||
hasRunning = false;;
|
hasRunning = false;
|
||||||
modified = 0;
|
modified = 0;
|
||||||
presentSeen = 0;
|
presentSeen = 0;
|
||||||
}
|
}
|
||||||
@ -738,6 +738,7 @@ const cEvent *cSchedule::GetEventAround(time_t Time) const
|
|||||||
|
|
||||||
void cSchedule::SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel)
|
void cSchedule::SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel)
|
||||||
{
|
{
|
||||||
|
hasRunning = false;
|
||||||
for (cEvent *p = events.First(); p; p = events.Next(p)) {
|
for (cEvent *p = events.First(); p; p = events.Next(p)) {
|
||||||
if (p == Event) {
|
if (p == Event) {
|
||||||
if (p->RunningStatus() > SI::RunningStatusNotRunning || RunningStatus > SI::RunningStatusNotRunning)
|
if (p->RunningStatus() > SI::RunningStatusNotRunning || RunningStatus > SI::RunningStatusNotRunning)
|
||||||
@ -745,9 +746,9 @@ void cSchedule::SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Cha
|
|||||||
}
|
}
|
||||||
else if (RunningStatus >= SI::RunningStatusPausing && p->StartTime() < Event->StartTime())
|
else if (RunningStatus >= SI::RunningStatusPausing && p->StartTime() < Event->StartTime())
|
||||||
p->SetRunningStatus(SI::RunningStatusNotRunning);
|
p->SetRunningStatus(SI::RunningStatusNotRunning);
|
||||||
}
|
if (p->RunningStatus() >= SI::RunningStatusPausing)
|
||||||
if (RunningStatus >= SI::RunningStatusPausing)
|
|
||||||
hasRunning = true;
|
hasRunning = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSchedule::ClrRunningStatus(cChannel *Channel)
|
void cSchedule::ClrRunningStatus(cChannel *Channel)
|
||||||
@ -775,7 +776,7 @@ void cSchedule::Sort(void)
|
|||||||
// Make sure there are no RunningStatusUndefined before the currently running event:
|
// Make sure there are no RunningStatusUndefined before the currently running event:
|
||||||
if (hasRunning) {
|
if (hasRunning) {
|
||||||
for (cEvent *p = events.First(); p; p = events.Next(p)) {
|
for (cEvent *p = events.First(); p; p = events.Next(p)) {
|
||||||
if (p->RunningStatus() > SI::RunningStatusNotRunning)
|
if (p->RunningStatus() >= SI::RunningStatusPausing)
|
||||||
break;
|
break;
|
||||||
p->SetRunningStatus(SI::RunningStatusNotRunning);
|
p->SetRunningStatus(SI::RunningStatusNotRunning);
|
||||||
}
|
}
|
||||||
@ -1035,6 +1036,9 @@ cSchedule *cSchedules::AddSchedule(tChannelID ChannelID)
|
|||||||
if (!p) {
|
if (!p) {
|
||||||
p = new cSchedule(ChannelID);
|
p = new cSchedule(ChannelID);
|
||||||
Add(p);
|
Add(p);
|
||||||
|
cChannel *channel = Channels.GetByChannelID(ChannelID);
|
||||||
|
if (channel)
|
||||||
|
channel->schedule = p;
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: menuitems.c 1.46 2006/07/23 09:42:17 kls Exp $
|
* $Id: menuitems.c 1.47 2006/07/30 09:09:30 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menuitems.h"
|
#include "menuitems.h"
|
||||||
@ -313,7 +313,7 @@ void cMenuEditStrItem::Set(void)
|
|||||||
SetValue(buf);
|
SetValue(buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
width -= font->Width('>'); // assuming '<' and '>' have the same with
|
width -= font->Width('>'); // assuming '<' and '>' have the same width
|
||||||
int w = 0;
|
int w = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int l = strlen(buf);
|
int l = strlen(buf);
|
||||||
@ -395,6 +395,8 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key)
|
|||||||
if (strlen(value) > 1) {
|
if (strlen(value) > 1) {
|
||||||
if (!insert || pos < int(strlen(value)) - 1)
|
if (!insert || pos < int(strlen(value)) - 1)
|
||||||
memmove(value + pos, value + pos + 1, strlen(value) - pos);
|
memmove(value + pos, value + pos + 1, strlen(value) - pos);
|
||||||
|
else if (insert && pos == int(strlen(value)) - 1)
|
||||||
|
value[pos] = ' '; // in insert mode, deleting the last character replaces it with a blank to keep the cursor position
|
||||||
// reduce position, if we removed the last character
|
// reduce position, if we removed the last character
|
||||||
if (pos == int(strlen(value)))
|
if (pos == int(strlen(value)))
|
||||||
pos--;
|
pos--;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: recording.c 1.148 2006/04/29 13:22:20 kls Exp $
|
* $Id: recording.c 1.149 2006/07/30 10:23:46 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "recording.h"
|
#include "recording.h"
|
||||||
@ -970,7 +970,7 @@ cRecording *cRecordings::GetByName(const char *FileName)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cRecordings::AddByName(const char *FileName)
|
void cRecordings::AddByName(const char *FileName, bool TriggerUpdate)
|
||||||
{
|
{
|
||||||
LOCK_THREAD;
|
LOCK_THREAD;
|
||||||
cRecording *recording = GetByName(FileName);
|
cRecording *recording = GetByName(FileName);
|
||||||
@ -978,6 +978,7 @@ void cRecordings::AddByName(const char *FileName)
|
|||||||
recording = new cRecording(FileName);
|
recording = new cRecording(FileName);
|
||||||
Add(recording);
|
Add(recording);
|
||||||
ChangeState();
|
ChangeState();
|
||||||
|
if (TriggerUpdate)
|
||||||
TouchUpdate();
|
TouchUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: recording.h 1.54 2006/04/09 13:47:11 kls Exp $
|
* $Id: recording.h 1.55 2006/07/30 10:24:07 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __RECORDING_H
|
#ifndef __RECORDING_H
|
||||||
@ -133,7 +133,7 @@ public:
|
|||||||
bool StateChanged(int &State);
|
bool StateChanged(int &State);
|
||||||
void ResetResume(const char *ResumeFileName = NULL);
|
void ResetResume(const char *ResumeFileName = NULL);
|
||||||
cRecording *GetByName(const char *FileName);
|
cRecording *GetByName(const char *FileName);
|
||||||
void AddByName(const char *FileName);
|
void AddByName(const char *FileName, bool TriggerUpdate = true);
|
||||||
void DelByName(const char *FileName);
|
void DelByName(const char *FileName);
|
||||||
int TotalFileSizeMB(void); ///< Only for deleted recordings!
|
int TotalFileSizeMB(void); ///< Only for deleted recordings!
|
||||||
};
|
};
|
||||||
|
28
svdrp.c
28
svdrp.c
@ -10,7 +10,7 @@
|
|||||||
* and interact with the Video Disk Recorder - or write a full featured
|
* and interact with the Video Disk Recorder - or write a full featured
|
||||||
* graphical interface that sits on top of an SVDRP connection.
|
* graphical interface that sits on top of an SVDRP connection.
|
||||||
*
|
*
|
||||||
* $Id: svdrp.c 1.98 2006/07/22 13:59:43 kls Exp $
|
* $Id: svdrp.c 1.99 2006/08/06 09:17:58 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "svdrp.h"
|
#include "svdrp.h"
|
||||||
@ -378,17 +378,19 @@ cSVDRP::cSVDRP(int Port)
|
|||||||
|
|
||||||
cSVDRP::~cSVDRP()
|
cSVDRP::~cSVDRP()
|
||||||
{
|
{
|
||||||
Close();
|
Close(true);
|
||||||
free(cmdLine);
|
free(cmdLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSVDRP::Close(bool Timeout)
|
void cSVDRP::Close(bool SendReply, bool Timeout)
|
||||||
{
|
{
|
||||||
if (file.IsOpen()) {
|
if (file.IsOpen()) {
|
||||||
|
if (SendReply) {
|
||||||
//TODO how can we get the *full* hostname?
|
//TODO how can we get the *full* hostname?
|
||||||
char buffer[BUFSIZ];
|
char buffer[BUFSIZ];
|
||||||
gethostname(buffer, sizeof(buffer));
|
gethostname(buffer, sizeof(buffer));
|
||||||
Reply(221, "%s closing connection%s", buffer, Timeout ? " (timeout)" : "");
|
Reply(221, "%s closing connection%s", buffer, Timeout ? " (timeout)" : "");
|
||||||
|
}
|
||||||
isyslog("closing SVDRP connection"); //TODO store IP#???
|
isyslog("closing SVDRP connection"); //TODO store IP#???
|
||||||
file.Close();
|
file.Close();
|
||||||
DELETENULL(PUTEhandler);
|
DELETENULL(PUTEhandler);
|
||||||
@ -401,7 +403,7 @@ bool cSVDRP::Send(const char *s, int length)
|
|||||||
length = strlen(s);
|
length = strlen(s);
|
||||||
if (safe_write(file, s, length) < 0) {
|
if (safe_write(file, s, length) < 0) {
|
||||||
LOG_ERROR;
|
LOG_ERROR;
|
||||||
file.Close();
|
Close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -423,10 +425,8 @@ void cSVDRP::Reply(int Code, const char *fmt, ...)
|
|||||||
cont = '-';
|
cont = '-';
|
||||||
char number[16];
|
char number[16];
|
||||||
sprintf(number, "%03d%c", abs(Code), cont);
|
sprintf(number, "%03d%c", abs(Code), cont);
|
||||||
if (!(Send(number) && Send(s, n ? n - s : -1) && Send("\r\n"))) {
|
if (!(Send(number) && Send(s, n ? n - s : -1) && Send("\r\n")))
|
||||||
Close();
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
s = n ? n + 1 : NULL;
|
s = n ? n + 1 : NULL;
|
||||||
}
|
}
|
||||||
free(buffer);
|
free(buffer);
|
||||||
@ -1530,7 +1530,7 @@ void cSVDRP::Execute(char *Cmd)
|
|||||||
else if (CMD("STAT")) CmdSTAT(s);
|
else if (CMD("STAT")) CmdSTAT(s);
|
||||||
else if (CMD("UPDT")) CmdUPDT(s);
|
else if (CMD("UPDT")) CmdUPDT(s);
|
||||||
else if (CMD("VOLU")) CmdVOLU(s);
|
else if (CMD("VOLU")) CmdVOLU(s);
|
||||||
else if (CMD("QUIT")) Close();
|
else if (CMD("QUIT")) Close(true);
|
||||||
else Reply(500, "Command unrecognized: \"%s\"", Cmd);
|
else Reply(500, "Command unrecognized: \"%s\"", Cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1570,7 +1570,7 @@ bool cSVDRP::Process(void)
|
|||||||
}
|
}
|
||||||
else if (c == 0x04 && numChars == 0) {
|
else if (c == 0x04 && numChars == 0) {
|
||||||
// end of file (only at beginning of line)
|
// end of file (only at beginning of line)
|
||||||
Close();
|
Close(true);
|
||||||
}
|
}
|
||||||
else if (c == 0x08 || c == 0x7F) {
|
else if (c == 0x08 || c == 0x7F) {
|
||||||
// backspace or delete (last character)
|
// backspace or delete (last character)
|
||||||
@ -1590,20 +1590,14 @@ bool cSVDRP::Process(void)
|
|||||||
}
|
}
|
||||||
lastActivity = time(NULL);
|
lastActivity = time(NULL);
|
||||||
}
|
}
|
||||||
else if (r < 0) {
|
else if (r <= 0) {
|
||||||
isyslog("lost connection to SVDRP client");
|
isyslog("lost connection to SVDRP client");
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
isyslog("SVDRP client closed connection");
|
|
||||||
//TODO give cSVDRP::Close() an extra parameter to avoid this code duplication
|
|
||||||
file.Close();
|
|
||||||
DELETENULL(PUTEhandler);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (Setup.SVDRPTimeout && time(NULL) - lastActivity > Setup.SVDRPTimeout) {
|
if (Setup.SVDRPTimeout && time(NULL) - lastActivity > Setup.SVDRPTimeout) {
|
||||||
isyslog("timeout on SVDRP connection");
|
isyslog("timeout on SVDRP connection");
|
||||||
Close(true);
|
Close(true, true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
4
svdrp.h
4
svdrp.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: svdrp.h 1.27 2005/12/30 14:46:38 kls Exp $
|
* $Id: svdrp.h 1.28 2006/08/06 08:51:09 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SVDRP_H
|
#ifndef __SVDRP_H
|
||||||
@ -50,7 +50,7 @@ private:
|
|||||||
char *cmdLine;
|
char *cmdLine;
|
||||||
time_t lastActivity;
|
time_t lastActivity;
|
||||||
static char *grabImageDir;
|
static char *grabImageDir;
|
||||||
void Close(bool Timeout = false);
|
void Close(bool SendReply = false, bool Timeout = false);
|
||||||
bool Send(const char *s, int length = -1);
|
bool Send(const char *s, int length = -1);
|
||||||
void Reply(int Code, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
void Reply(int Code, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
||||||
void PrintHelpTopics(const char **hp);
|
void PrintHelpTopics(const char **hp);
|
||||||
|
5
timers.c
5
timers.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: timers.c 1.61 2006/05/25 14:36:37 kls Exp $
|
* $Id: timers.c 1.62 2006/08/05 12:03:36 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
@ -351,7 +351,7 @@ bool cTimer::Matches(time_t t, bool Directly, int Margin) const
|
|||||||
if (DayMatches(t0)) {
|
if (DayMatches(t0)) {
|
||||||
time_t a = SetTime(t0, begin);
|
time_t a = SetTime(t0, begin);
|
||||||
time_t b = a + length;
|
time_t b = a + length;
|
||||||
if ((!day || a >= day) && t <= b) {
|
if ((!day || a >= day) && t < b) {
|
||||||
startTime = a;
|
startTime = a;
|
||||||
stopTime = b;
|
stopTime = b;
|
||||||
break;
|
break;
|
||||||
@ -647,6 +647,7 @@ cTimer *cTimers::GetNextActiveTimer(void)
|
|||||||
{
|
{
|
||||||
cTimer *t0 = NULL;
|
cTimer *t0 = NULL;
|
||||||
for (cTimer *ti = First(); ti; ti = Next(ti)) {
|
for (cTimer *ti = First(); ti; ti = Next(ti)) {
|
||||||
|
ti->Matches();
|
||||||
if ((ti->HasFlags(tfActive)) && (!t0 || ti->StopTime() > time(NULL) && ti->Compare(*t0) < 0))
|
if ((ti->HasFlags(tfActive)) && (!t0 || ti->StopTime() > time(NULL) && ti->Compare(*t0) < 0))
|
||||||
t0 = ti;
|
t0 = ti;
|
||||||
}
|
}
|
||||||
|
10
vdr.c
10
vdr.c
@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
* The project's page is at http://www.cadsoft.de/vdr
|
* The project's page is at http://www.cadsoft.de/vdr
|
||||||
*
|
*
|
||||||
* $Id: vdr.c 1.276 2006/06/18 08:49:20 kls Exp $
|
* $Id: vdr.c 1.278 2006/08/05 10:46:38 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -1015,6 +1015,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (cPluginManager::Active(tr("shut down anyway?")))
|
if (cPluginManager::Active(tr("shut down anyway?")))
|
||||||
break;
|
break;
|
||||||
|
if (!cRecordControls::Active()) {
|
||||||
cTimer *timer = Timers.GetNextActiveTimer();
|
cTimer *timer = Timers.GetNextActiveTimer();
|
||||||
time_t Next = timer ? timer->StartTime() : 0;
|
time_t Next = timer ? timer->StartTime() : 0;
|
||||||
time_t Delta = timer ? Next - time(NULL) : 0;
|
time_t Delta = timer ? Next - time(NULL) : 0;
|
||||||
@ -1026,6 +1027,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!confirm)
|
if (!confirm)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ForceShutdown = true;
|
ForceShutdown = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1166,6 +1168,12 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
LastActivity = 1;
|
LastActivity = 1;
|
||||||
}
|
}
|
||||||
|
if (timer && Delta < Setup.MinEventTimeout * 60 && ForceShutdown) {
|
||||||
|
Delta = Setup.MinEventTimeout * 60;
|
||||||
|
Next = Now + Delta;
|
||||||
|
timer = NULL;
|
||||||
|
dsyslog("reboot at %s", *TimeToString(Next));
|
||||||
|
}
|
||||||
if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
|
if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
|
||||||
ForceShutdown = false;
|
ForceShutdown = false;
|
||||||
if (timer)
|
if (timer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user