1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed moving editing marks, so that they don't get overwritten with old values through an update of the marks file

This commit is contained in:
Klaus Schmidinger 2013-02-11 11:27:34 +01:00
parent d8ba7158bc
commit d2ef44f8f5
5 changed files with 23 additions and 14 deletions

View File

@ -7585,10 +7585,12 @@ Video Disk Recorder Revision History
- Fixed formatting and removed some superfluous break statements in vdr.c's command - Fixed formatting and removed some superfluous break statements in vdr.c's command
line option switch. line option switch.
2013-02-10: Version 1.7.38 2013-02-11: Version 1.7.38
- Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk). - Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk).
- Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Updated the Estonian OSD texts (thanks to Arthur Konovalov).
- Updated the Romanian OSD texts (thanks to Lucian Muresan). - Updated the Romanian OSD texts (thanks to Lucian Muresan).
- Updated the French OSD texts (thanks to Marc Perrudin). - Updated the French OSD texts (thanks to Marc Perrudin).
- Updated the Macedonian OSD texts (thanks to Dimitar Petrovski). - Updated the Macedonian OSD texts (thanks to Dimitar Petrovski).
- Fixed moving editing marks, so that they don't get overwritten with old values
through an update of the marks file.

View File

@ -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 2.65 2013/02/09 15:09:22 kls Exp $ * $Id: config.h 2.66 2013/02/11 11:27:34 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -27,8 +27,8 @@
// The plugin API's version number: // The plugin API's version number:
#define APIVERSION "1.7.37" #define APIVERSION "1.7.38"
#define APIVERSNUM 10737 // Version * 10000 + Major * 100 + Minor #define APIVERSNUM 10738 // 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

13
menu.c
View File

@ -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: menu.c 2.76 2013/02/02 14:00:39 kls Exp $ * $Id: menu.c 2.77 2013/02/11 11:08:54 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -4763,9 +4763,8 @@ void cReplayControl::MarkToggle(void)
{ {
int Current, Total; int Current, Total;
if (GetIndex(Current, Total, true)) { if (GetIndex(Current, Total, true)) {
cMark *m = marks.Get(Current);
lastCurrent = -1; // triggers redisplay lastCurrent = -1; // triggers redisplay
if (m) if (cMark *m = marks.Get(Current))
marks.Del(m); marks.Del(m);
else { else {
marks.Add(Current); marks.Add(Current);
@ -4784,8 +4783,7 @@ void cReplayControl::MarkJump(bool Forward)
int Current, Total; int Current, Total;
if (GetIndex(Current, Total)) { if (GetIndex(Current, Total)) {
if (marks.Count()) { if (marks.Count()) {
cMark *m = Forward ? marks.GetNext(Current) : marks.GetPrev(Current); if (cMark *m = Forward ? marks.GetNext(Current) : marks.GetPrev(Current)) {
if (m) {
Goto(m->Position(), true); Goto(m->Position(), true);
displayFrames = true; displayFrames = true;
return; return;
@ -4801,8 +4799,7 @@ void cReplayControl::MarkMove(bool Forward)
{ {
int Current, Total; int Current, Total;
if (GetIndex(Current, Total)) { if (GetIndex(Current, Total)) {
cMark *m = marks.Get(Current); if (cMark *m = marks.Get(Current)) {
if (m) {
displayFrames = true; displayFrames = true;
int p = SkipFrames(Forward ? 1 : -1); int p = SkipFrames(Forward ? 1 : -1);
cMark *m2; cMark *m2;
@ -4878,7 +4875,7 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
{ {
if (!Active()) if (!Active())
return osEnd; return osEnd;
if (Key == kNone) if (Key == kNone && !marksModified)
marks.Update(); marks.Update();
if (visible) { if (visible) {
if (timeoutShow && time(NULL) > timeoutShow) { if (timeoutShow && time(NULL) > timeoutShow) {

View File

@ -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 2.86 2013/02/08 09:02:07 kls Exp $ * $Id: recording.c 2.87 2013/02/11 11:18:22 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -1506,6 +1506,15 @@ bool cMarks::Update(void)
return false; return false;
} }
bool cMarks::Save(void)
{
if (cConfig<cMark>::Save()) {
lastFileTime = LastModifiedTime(fileName);
return true;
}
return false;
}
void cMarks::Align(void) void cMarks::Align(void)
{ {
cIndexFile IndexFile(recordingFileName, false, isPesRecording); cIndexFile IndexFile(recordingFileName, false, isPesRecording);

View File

@ -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 2.42 2013/02/07 13:42:17 kls Exp $ * $Id: recording.h 2.43 2013/02/11 11:18:13 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@ -234,6 +234,7 @@ private:
public: public:
bool Load(const char *RecordingFileName, double FramesPerSecond = DEFAULTFRAMESPERSECOND, bool IsPesRecording = false); bool Load(const char *RecordingFileName, double FramesPerSecond = DEFAULTFRAMESPERSECOND, bool IsPesRecording = false);
bool Update(void); bool Update(void);
bool Save(void);
void Align(void); void Align(void);
void Sort(void); void Sort(void);
void Add(int Position); void Add(int Position);