summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS35
-rw-r--r--HISTORY28
-rw-r--r--MANUAL15
-rw-r--r--channels.conf21
-rw-r--r--channels.conf.terr9
-rw-r--r--config.h4
-rw-r--r--dvbapi.c30
-rw-r--r--dvbapi.h4
-rw-r--r--dvbosd.c5
-rw-r--r--i18n.c55
-rw-r--r--interface.h3
-rw-r--r--menu.c136
-rw-r--r--menu.h8
-rw-r--r--recording.c6
-rw-r--r--ringbuffer.c66
15 files changed, 326 insertions, 99 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index ec742b1..874d98e 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1,4 +1,7 @@
-Thanks go to the following people for patches and contributions:
+Tons of suggestions, bugreports, patches and other contributions have been
+provided by the people on the 'linux-dvb' and 'vdr' mailing lists.
+Special thanks go to the following individuals (if your name is missing here,
+please send an email to kls@cadsoft.de):
Carsten Koch <Carsten.Koch@icem.de>
for adding LIRC support
@@ -28,7 +31,7 @@ Guido Fiala <gfiala@s.netic.de>
now does these things itself)
for making the replay progress display avoid unnecessary code execution
-Robert Schneider <Robert.Schneider@lotus.com>
+Robert Schneider <Robert.Schneider@de.ibm.com>
for implementing EIT support for displaying the current/next info
for extending EIT support to implement a complete EPG
@@ -117,6 +120,11 @@ Stefan Huelswitt <huels@iname.com>
for implementing backtracing for fast forward/rewind
for implementing the replay mode display
for fixing a crash when replaying with DEBUG_OSD=1
+ for fixing a crash when selecting the "Jump" function directly after setting
+ an editing mark
+ for reporting a possible endless loop in shifting recordings between DVB cards
+ for making it no longer setting PIDs 0x1FFF, which apparently fixes problems
+ with CAMs and AC3 sound only working the first time
Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than
@@ -157,6 +165,8 @@ Werner Fink <werner@suse.de>
for helping to debug leftover 'zombie' processes when closing a pipe
for making the Dolby Digital thread start only if the recording actually
contains Dolby Digital data
+ for improving thread locking in the ring buffer to avoid possible race conditions
+ under heavy load
Rolf Hakenes <hakenes@hippomi.de>
for providing 'libdtv' and adapting the EIT mechanisms to it
@@ -185,7 +195,7 @@ Thomas Heiligenmann <thomas@heiligenmann.de>
Norbert Schmidt <nschmidt-nrw@t-online.de>
for filling in some missing teletext PIDs
-Thilo Wunderlich <tw@ubcom.net>
+Thilo Wunderlich <wunderlich@speedway.org>
for his help in keeping 'channels.conf' up to date
for reporting a problem with accessing the epg.data file before it is fully written
@@ -202,6 +212,8 @@ Sergei Haller <Sergei.Haller@math.uni-giessen.de>
for adding the TPID to Hessen-3 in 'channels.conf'
for suggesting that the EPG scan should skip channels with their 'Ca' parameter
explicitly set to an other DVB card
+ for implementing enhanced string editing with upper-/lowercase, insert/overwrite
+ and delete
Andreas Gebel <andreas@xcapenet.de>
for his help in keeping 'channels.conf' up to date
@@ -280,3 +292,20 @@ Dirk Wiebel <dirk@wiebel.de>
Gerald Raaf <graaf@attglobal.net>
for helping to fix the still picture workaround in case the progress display
is active
+
+Andreas Roedl <flood@flood-net.de>
+ for adding some DVB-T channels for Berlin (Germany) to channels.conf.terr
+
+Jean Martin <mac_j_fr@hotmail.com>
+ for pointing out a problem with OSD color palette handling on "big endian" systems
+
+Steffen Koch <Steffen.Koch@koch-enterprises.de>
+ for reporting a crash when selecting the "Jump" function directly after setting
+ an editing mark
+
+Matthias Hilbig <hilbig@upb.de>
+ for fixing some missing ',' in i18n.c
+
+Simon Dean <linux-dvb@sickhack.com>
+ for reporting a problem with '.' at the end of a directory name in case of VFAT=1
+ (Windows can't handle these)
diff --git a/HISTORY b/HISTORY
index af15667..76e658e 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1190,3 +1190,31 @@ Video Disk Recorder Revision History
- Fixed a bug in the editing process in case a previously edited file with the
same name was manually deleted on a system with more than one video directory
(thanks to Dirk Wiebel for reporting this one).
+
+2002-04-21: Version 1.0.1
+
+- Added some DVB-T channels for Berlin (Germany) to channels.conf.terr (thanks to
+ Andreas Roedl).
+- Implemented enhanced string editing with upper-/lowercase, insert/overwrite
+ and delete (thanks to Sergei Haller).
+- Fixed color palette handling on "big endian" systems (thanks to Jean Martin
+ for pointing out this one).
+- Updated the "Blue Movie" channels to the new "Premiere Erotik" (thanks to
+ Thilo Wunderlich). NOTE: this adds a new channel to 'channels.conf', so that
+ any timers referencing a channel with a number higher than 102 should be
+ checked and adapted if necessary (this only applies if you are using the default
+ 'channels.conf').
+- Improved thread locking in the ring buffer to avoid possible race conditions
+ under heavy load (thanks to Werner Fink).
+- Fixed a crash when selecting the "Jump" function directly after setting an
+ editing mark (thanks to Steffen Koch for reporting and Stefan Huelswitt for
+ fixing this one).
+- Fixed some missing ',' in i18n.c (thanks to Matthias Hilbig).
+- Fixed a possible endless loop in shifting recordings between DVB cards (thanks
+ to Stefan Huelswitt for reporting this one).
+- Updated the Premiere World Formula 1 channels in 'channels.conf' (thanks to Mel
+ Schächner).
+- No longer setting PIDs 0x1FFF, which apparently fixes problems with CAMs and
+ AC3 sound only working the first time (thanks to Stefan Huelswitt).
+- Now encoding '.' at the end of a directory name in case of VFAT=1, since Windows
+ can't handle these (thanks to Simon Dean for reporting this one).
diff --git a/MANUAL b/MANUAL
index b940505..58d78ae 100644
--- a/MANUAL
+++ b/MANUAL
@@ -17,9 +17,9 @@ Video Disk Recorder User's Manual
Ok Ch display Select Switch Edit Accept Play Progress disp.
Menu Menu on Menu off Menu off Menu off Menu off Menu off Menu on
Back - Menu off VDR menu VDR menu Discard VDR menu Recordings menu
- Red - Record Edit Edit - Play Jump
- Green - Language New New - Rewind Skip -60s
- Yellow - - Delete Delete - Delete Skip +60s
+ Red - Record Edit Edit ABC/abc Play Jump
+ Green - Language New New Ins/Ovr Rewind Skip -60s
+ Yellow - - Delete Delete Delete Delete Skip +60s
Blue - Stop/Resume Mark On/Off(1) - Summary Stop
0..9 Ch select - - - Numeric inp. - Editing
@@ -58,11 +58,10 @@ Video Disk Recorder User's Manual
by pressing the "Right" button (which puts brackets around the current
character as in "[R]TL"), selecting the desired character position with
"Left" and "Right", and changing the character with the "Up" and "Down"
- keys. "Ok" then confirms the changes. The special character '^' can be used
- to "cut off" a string at this position. When this character is visible in the
- brackets (as in abc[^]), the next press to the "Left" or "Ok" button will
- actually cut off the string. Using "Up" and/or "Down" brings back the
- original rest of the string (unless you have pressed "Left" or "Ok").
+ keys. "Ok" then confirms the changes. The "Red" key toggles between
+ upper- and lowercase characters, while the "Green" key switches between
+ insert and overwrite mode. The "Yellow" key deletes the current character
+ (or the one to the right of the cursor in insert mode).
The "Red", "Green", "Yellow" and "Blue" buttons have special meanings
in various menus and are listed at the bottom of the on-screen-display.
diff --git a/channels.conf b/channels.conf
index db1cbf4..be18f30 100644
--- a/channels.conf
+++ b/channels.conf
@@ -101,20 +101,21 @@ CNBC:11954:h:0:27500:510:520:0:0:28010
Liberty TV.com:12610:V:0:22000:941:943,942:0:0:12199
:PW Erotic
Beate-Uhse.TV:11758:h:0:27500:3839:3840:0:101:21
-Blue Movie 1:11758:h:0:27500:1791:1792:0:101:513
-Blue Movie 2:11758:h:0:27500:2047:2048:0:101:514
-Blue Movie 3:11758:h:0:27500:2303:2304:0:101:515
+Premiere Erotik 1:11758:h:0:27500:1791:1792:0:101:513
+Premiere Erotik 2:11758:h:0:27500:2047:2048:0:101:778
+Premiere Erotik 3:11758:h:0:27500:2303:2304:0:101:779
+Premiere Erotik 4:11758:h:0:27500:2559:2560:0:101:780
:Sportsworld
Premiere Sport 1:11720:h:0:27500:255:256,257:0:101:17
Premiere Sport 2:12070:h:0:27500:3839:3840:0:101:27
Premiere Sport 3:12070:h:0:27500:255:256:0:101:26
-:Formel 1
-Infokanal:11720:h:0:27500:3071:3072:0:101:244
-Multikanal:11720:h:0:27500:2815:2816:0:101:243
-Supersignal:11720:h:0:27500:255:256:0:101:17
-Verfolgerfeld:11720:h:0:27500:2303:2304:0:101:241
-Cockpitkanal:11720:h:0:27500:2559:2560:0:101:242
-Boxengasse:11720:h:0:27500:2047:2048:0:101:240
+:PW-Formel 1
+F1 Info:11720:h:0:27500:3071:3073:0:101:244
+F1 Multi:11720:h:0:27500:255:256:0:101:17
+F1 Supersignal:11720:h:0:27500:2047:2048:0:101:240
+F1 Verfolger:11720:h:0:27500:2815:2817:0:101:243
+F1 Cockpit:11720:h:0:27500:2303:2305:0:101:241
+F1 Boxen:11720:h:0:27500:2559:2561:0:101:242
:Premiere World Bundesliga
Superdom:11758:h:0:27500:2815:8192:0:101:18
BuLi-Konferenz:11758:h:0:27500:3327:3328,3329:0:101:215
diff --git a/channels.conf.terr b/channels.conf.terr
index bed1be8..81c0581 100644
--- a/channels.conf.terr
+++ b/channels.conf.terr
@@ -9,3 +9,12 @@ BBC CHOICE:505833:0:0:0:620:621:0:0:4351
BBC NEWS 24:505833:0:0:0:640:641:0:0:4415
BBC Knowledge:505833:0:0:0:630:631:0:0:4607
Shop!:561833:0:0:0:6049:6050:0:0:13120
+: DVB-T Berlin Germany
+RTL 1:778000:V:0:27500:160:80:0:1:1
+RTL 2:778000:V:0:27500:161:82:0:1:2
+Super RTL:778000:V:0:27500:162:84:0:1:3
+VOX:778000:V:0:27500:165:81:0:1:4
+SAT 1:714000:V:0:27500:160:80:0:1:18
+PRO 7:714000:V:0:27500:161:82:0:1:19
+KABEL 1:714000:V:0:27500:162:84:0:1:20
+N24:714000:V:0:27500:163:86:0:1:21
diff --git a/config.h b/config.h
index 00774b0..67ae92c 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.109 2002/04/07 13:08:12 kls Exp $
+ * $Id: config.h 1.110 2002/04/21 10:09:56 kls Exp $
*/
#ifndef __CONFIG_H
@@ -19,7 +19,7 @@
#include "eit.h"
#include "tools.h"
-#define VDRVERSION "1.0.0"
+#define VDRVERSION "1.0.1"
#define MAXPRIORITY 99
#define MAXLIFETIME 99
diff --git a/dvbapi.c b/dvbapi.c
index 9d59d90..0006e43 100644
--- a/dvbapi.c
+++ b/dvbapi.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.c 1.170 2002/04/07 09:35:51 kls Exp $
+ * $Id: dvbapi.c 1.173 2002/04/21 11:55:48 kls Exp $
*/
#include "dvbapi.h"
@@ -533,6 +533,8 @@ void cRecordBuffer::Input(void)
int w = Put(p, r);
p += w;
r -= w;
+ if (r > 0)
+ usleep(1); // this keeps the CPU load low
}
t = time(NULL);
}
@@ -1810,21 +1812,24 @@ bool cDvbApi::SetPrimaryDvbApi(int n)
return false;
}
-int cDvbApi::CanShift(int Ca, int Priority)
+int cDvbApi::CanShift(int Ca, int Priority, int UsedCards)
{
// Test whether a recording on this DVB device can be shifted to another one
// in order to perform a new recording with the given Ca and Priority on this device:
int ShiftLevel = -1; // default means this device can't be shifted
+ if (UsedCards & (1 << CardIndex()) != 0)
+ return ShiftLevel; // otherwise we would get into a loop
if (Recording()) {
if (ProvidesCa(Ca) // this device provides the requested Ca
&& (Ca != this->Ca() // the requested Ca is different from the one currently used...
|| Priority > this->Priority())) { // ...or the request comes from a higher priority
cDvbApi *d = NULL;
int Provides[MAXDVBAPI];
+ UsedCards |= (1 << CardIndex());
for (int i = 0; i < NumDvbApis; i++) {
if ((Provides[i] = dvbApi[i]->ProvidesCa(this->Ca())) != 0) { // this device is basicly able to do the job
if (dvbApi[i] != this) { // it is not _this_ device
- int sl = dvbApi[i]->CanShift(this->Ca(), Priority); // this is the original Priority!
+ int sl = dvbApi[i]->CanShift(this->Ca(), Priority, UsedCards); // this is the original Priority!
if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) {
d = dvbApi[i];
ShiftLevel = sl;
@@ -2301,16 +2306,17 @@ bool cDvbApi::SetPid(int fd, dmxPesType_t PesType, int Pid, dmxOutput_t Output)
{
if (Pid) {
CHECK(ioctl(fd, DMX_STOP));
- dmxPesFilterParams pesFilterParams;
- pesFilterParams.pid = Pid;
- pesFilterParams.input = DMX_IN_FRONTEND;
- pesFilterParams.output = Output;
- pesFilterParams.pesType = PesType;
- pesFilterParams.flags = DMX_IMMEDIATE_START;
- if (ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
- if (Pid != 0x1FFF)
+ if (Pid != 0x1FFF) {
+ dmxPesFilterParams pesFilterParams;
+ pesFilterParams.pid = Pid;
+ pesFilterParams.input = DMX_IN_FRONTEND;
+ pesFilterParams.output = Output;
+ pesFilterParams.pesType = PesType;
+ pesFilterParams.flags = DMX_IMMEDIATE_START;
+ if (ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
LOG_ERROR;
- return false;
+ return false;
+ }
}
}
return true;
diff --git a/dvbapi.h b/dvbapi.h
index e9cf8c8..7e63878 100644
--- a/dvbapi.h
+++ b/dvbapi.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.h 1.68 2002/03/10 10:50:00 kls Exp $
+ * $Id: dvbapi.h 1.69 2002/04/21 09:49:22 kls Exp $
*/
#ifndef __DVBAPI_H
@@ -104,7 +104,7 @@ private:
static int useDvbApi;
int cardIndex;
int caCaps[MAXCACAPS];
- int CanShift(int Ca, int Priority);
+ int CanShift(int Ca, int Priority, int UsedCards = 0);
public:
static cDvbApi *PrimaryDvbApi;
static void SetUseDvbApi(int n);
diff --git a/dvbosd.c b/dvbosd.c
index c348430..eb96261 100644
--- a/dvbosd.c
+++ b/dvbosd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbosd.c 1.12 2002/01/13 16:25:18 kls Exp $
+ * $Id: dvbosd.c 1.13 2002/04/13 11:34:48 kls Exp $
*/
#include "dvbosd.h"
@@ -25,6 +25,9 @@ cPalette::cPalette(int Bpp)
int cPalette::Index(eDvbColor Color)
{
+#if __BYTE_ORDER == __BIG_ENDIAN
+ Color = eDvbColor(((Color & 0xFF) << 24) | ((Color & 0xFF00) << 8) | ((Color & 0xFF0000) >> 8) | ((Color & 0xFF000000) >> 24));
+#endif
for (int i = 0; i < numColors; i++) {
if (color[i] == Color) {
used[i] = true;
diff --git a/i18n.c b/i18n.c
index 0b22f1d..eb37100 100644
--- a/i18n.c
+++ b/i18n.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: i18n.c 1.79 2002/04/06 09:49:19 kls Exp $
+ * $Id: i18n.c 1.82 2002/04/20 09:40:37 kls Exp $
*
* Slovenian translations provided by Miha Setina <mihasetina@softhome.net> and Matjaz Thaler <matjaz.thaler@guest.arnes.si>
* Italian translations provided by Alberto Carraro <bertocar@tin.it>
@@ -467,6 +467,42 @@ const tPhrase Phrases[] = {
"Wyrzucenie",
"Eyectar",
},
+ { "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ "ABC/abc",
+ },
+ { "Insert",
+ "Einfügen",
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ },
+ { "Overwrite",
+ "Überschreiben",
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ },
// Confirmations:
{ "Delete channel?",
"Kanal löschen?",
@@ -508,7 +544,7 @@ const tPhrase Phrases[] = {
"Timer zeichnet auf - trotzdem löschen?",
"Snemanje po terminu - zares odstrani?",
"Timer in regestazione - cancello?",
- "Timer neemt nog op - toch verwijderen?"
+ "Timer neemt nog op - toch verwijderen?",
"Timer activo - têm a certeza que quer apagar?",
"Enregistrement en cours - confirmez la suppression",
"Timer gjør opptak - vil du slette likevel?",
@@ -1602,6 +1638,19 @@ const tPhrase Phrases[] = {
"PonWtoSroCzwPiaSobNie",
"LunMarMieJueVieSabDom",
},
+ // The allowed characters in strings:
+ { " abcdefghijklmnopqrstuvwxyz0123456789-.#~",
+ " aäbcdefghijklmnoöpqrstuüvwxyz0123456789-.#~",
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ "",// TODO
+ " aábcdeéfghiíjklmnñoópqrstuúvwxyz0123456789-.#~",
+ },
// Learning keys:
{ "Learning Remote Control Keys",
"Fernbedienungs-Codes lernen",
@@ -2080,7 +2129,7 @@ const tPhrase Phrases[] = {
"Eerste DVB-kaart wordt omgeschakeld...",
"A mudar interface DVB primário...",
"Changement de carte DVB primaire...",
- "Bytter første DVB-enhet..."
+ "Bytter første DVB-enhet...",
"Vaihdetaan ensisijainen vastaanotin...",
"Pierwszy interfejs DVB przelacza...",
"Cambio interface primario...",
diff --git a/interface.h b/interface.h
index dbfa1bc..914a383 100644
--- a/interface.h
+++ b/interface.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: interface.h 1.24 2001/09/01 15:14:50 kls Exp $
+ * $Id: interface.h 1.25 2002/04/19 13:17:15 kls Exp $
*/
#ifndef __INTERFACE_H
@@ -46,6 +46,7 @@ public:
void SetBitmap(int x, int y, const cBitmap &Bitmap);
void Flush(void);
void SetCols(int *c);
+ const int *GetCols(void) { return cols; }
eDvbFont SetFont(eDvbFont Font);
char *WrapText(const char *Text, int Width, int *Height);
void Write(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
diff --git a/menu.c b/menu.c
index bc3aeb6..ed219cd 100644
--- a/menu.c
+++ b/menu.c
@@ -4,10 +4,11 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.182 2002/04/06 09:41:59 kls Exp $
+ * $Id: menu.c 1.187 2002/04/20 09:17:08 kls Exp $
*/
#include "menu.h"
+#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -23,7 +24,7 @@
#define CHNUMWIDTH (Channels.Count() > 999 ? 5 : 4) // there are people with more than 999 channels...
-const char *FileNameChars = " aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789-.#~^";
+const char *FileNameChars = " abcdefghijklmnopqrstuvwxyz0123456789-.#~";
// --- cMenuEditItem ---------------------------------------------------------
@@ -515,6 +516,8 @@ private:
int length;
const char *allowed;
int pos;
+ bool insert, newchar, uppercase;
+ void SetHelpKeys(void);
virtual void Set(void);
char Inc(char c, bool Up);
public:
@@ -530,6 +533,8 @@ cMenuEditStrItem::cMenuEditStrItem(const char *Name, char *Value, int Length, co
length = Length;
allowed = strdup(Allowed);
pos = -1;
+ insert = uppercase = false;
+ newchar = true;
Set();
}
@@ -538,14 +543,54 @@ cMenuEditStrItem::~cMenuEditStrItem()
delete allowed;
}
+void cMenuEditStrItem::SetHelpKeys(void)
+{
+ if (pos >= 0)
+ Interface->Help(tr("ABC/abc"), tr(insert ? "Overwrite" : "Insert"), tr("Delete"));
+ else
+ Interface->Help(NULL);
+}
+
void cMenuEditStrItem::Set(void)
{
char buf[1000];
+ const char *fmt = insert && newchar ? "[]%c%s" : "[%c]%s";
+
if (pos >= 0) {
strncpy(buf, value, pos);
- const char *s = value[pos] != '^' ? value + pos + 1 : "";
- snprintf(buf + pos, sizeof(buf) - pos - 2, "[%c]%s", *(value + pos), s);
- SetValue(buf);
+ snprintf(buf + pos, sizeof(buf) - pos - 2, fmt, *(value + pos), value + pos + 1);
+ int width = Interface->Width() - Interface->GetCols()[0];
+ if (cDvbApi::PrimaryDvbApi->WidthInCells(buf) <= width) {
+ // the whole buffer fits on the screen
+ SetValue(buf);
+ return;
+ }
+ width *= cDvbApi::PrimaryDvbApi->CellWidth();
+ width -= cDvbApi::PrimaryDvbApi->Width('>'); // assuming '<' and '>' have the same with
+ int w = 0;
+ int i = 0;
+ int l = strlen(buf);
+ while (i < l && w <= width)
+ w += cDvbApi::PrimaryDvbApi->Width(buf[i++]);
+ if (i >= pos + 4) {
+ // the cursor fits on the screen
+ buf[i - 1] = '>';
+ buf[i] = 0;
+ SetValue(buf);
+ return;
+ }
+ // the cursor doesn't fit on the screen
+ w = 0;
+ if (buf[i = pos + 3]) {
+ buf[i] = '>';
+ buf[i + 1] = 0;
+ }
+ else
+ i--;
+ while (i >= 0 && w <= width)
+ w += cDvbApi::PrimaryDvbApi->Width(buf[i--]);
+ buf[++i] = '<';
+ SetValue(buf + i);
}
else
SetValue(value);
@@ -568,34 +613,86 @@ char cMenuEditStrItem::Inc(char c, bool Up)
eOSState cMenuEditStrItem::ProcessKey(eKeys Key)
{
switch (Key) {
+ case kRed: // Switch between upper- and lowercase characters
+ if (pos >= 0 && (!insert || !newchar)) {
+ uppercase = !uppercase;
+ value[pos] = uppercase ? toupper(value[pos]) : tolower(value[pos]);
+ }
+ break;
+ case kGreen: // Toggle insert/overwrite modes
+ if (pos >= 0) {
+ insert = !insert;
+ newchar = true;
+ }
+ SetHelpKeys();
+ break;
+ case kYellow|k_Repeat:
+ case kYellow: // Remove the character at current position; in insert mode it is the character to the right of cursor
+ if (pos >= 0) {
+ if (strlen(value) > 1) {
+ memmove(value + pos, value + pos + 1, strlen(value) - pos);
+ // reduce position, if we removed the last character
+ if (pos == int(strlen(value)))
+ pos--;
+ }
+ else if (strlen(value) == 1)
+ value[0] = ' '; // This is the last character in the string, replace it with a blank
+ if (isalpha(value[pos]))
+ uppercase = isupper(value[pos]);
+ newchar = true;
+ }
+ break;
case kLeft|k_Repeat:
case kLeft: if (pos > 0) {
- if (value[pos] == '^')
- value[pos] = 0;
- pos--;
+ if (!insert || newchar)
+ pos--;
+ newchar = true;
}
+ if (!insert && isalpha(value[pos]))
+ uppercase = isupper(value[pos]);
break;
case kRight|k_Repeat:
- case kRight: if (pos < length && value[pos] != '^' && (pos < int(strlen(value) - 1) || value[pos] != ' ')) {
+ case kRight: if (pos < length && pos < int(strlen(value)) ) {
if (++pos >= int(strlen(value))) {
- value[pos] = ' ';
- value[pos + 1] = 0;
+ if (pos >= 2 && value[pos - 1] == ' ' && value[pos - 2] == ' ')
+ pos--; // allow only two blanks at the end
+ else {
+ value[pos] = ' ';
+ value[pos + 1] = 0;
+ }
}
}
+ newchar = true;
+ if (!insert && isalpha(value[pos]))
+ uppercase = isupper(value[pos]);
+ if (pos == 0)
+ SetHelpKeys();
break;
case kUp|k_Repeat:
case kUp:
case kDown|k_Repeat:
- case kDown: if (pos >= 0)
- value[pos] = Inc(value[pos], NORMALKEY(Key) == kUp);
+ case kDown: if (pos >= 0) {
+ if (insert && newchar) {
+ // create a new character in insert mode
+ if (int(strlen(value)) < length) {
+ memmove(value + pos + 1, value + pos, strlen(value) - pos + 1);
+ value[pos] = ' ';
+ }
+ }
+ if (uppercase)
+ value[pos] = toupper(Inc(tolower(value[pos]), NORMALKEY(Key) == kUp));
+ else
+ value[pos] = Inc( value[pos], NORMALKEY(Key) == kUp);
+ newchar = false;
+ }
else
return cMenuEditItem::ProcessKey(Key);
break;
case kOk: if (pos >= 0) {
- if (value[pos] == '^')
- value[pos] = 0;
pos = -1;
+ newchar = true;
stripspace(value);
+ SetHelpKeys();
break;
}
// run into default
@@ -699,7 +796,7 @@ cMenuEditChannel::cMenuEditChannel(int Index)
channel = Channels.Get(Index);
if (channel) {
data = *channel;
- Add(new cMenuEditStrItem( tr("Name"), data.name, sizeof(data.name), FileNameChars));
+ Add(new cMenuEditStrItem( tr("Name"), data.name, sizeof(data.name), tr(FileNameChars)));
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
Add(new cMenuEditChrItem( tr("Polarization"), &data.polarization, "hv"));
Add(new cMenuEditIntItem( tr("DiSEqC"), &data.diseqc, 0, 10)); //TODO exact limits???
@@ -1086,7 +1183,7 @@ cMenuEditTimer::cMenuEditTimer(int Index, bool New)
//TODO VPS???
Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
- Add(new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file), FileNameChars));
+ Add(new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file), tr(FileNameChars)));
SetFirstDayItem();
}
}
@@ -2104,7 +2201,7 @@ void cMenuSetupRecord::Set(void)
Add(new cMenuEditIntItem( tr("Setup.Recording$Default lifetime (d)"), &data.DefaultLifetime, 0, MAXLIFETIME));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Use episode name"), &data.UseSubtitle));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Mark instant recording"), &data.MarkInstantRecord));
- Add(new cMenuEditStrItem( tr("Setup.Recording$Name instant recording"), data.NameInstantRecord, sizeof(data.NameInstantRecord), FileNameChars));
+ Add(new cMenuEditStrItem( tr("Setup.Recording$Name instant recording"), data.NameInstantRecord, sizeof(data.NameInstantRecord), tr(FileNameChars)));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Record Dolby Digital"), &data.RecordDolbyDigital));
Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size (MB)"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZE));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Split edited files"), &data.SplitEditedFiles));
@@ -3185,6 +3282,7 @@ void cReplayControl::TimeSearch(void)
else
return;
}
+ timeoutShow = 0;
TimeSearchDisplay();
timeSearchActive = true;
}
@@ -3287,7 +3385,7 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
}
else if (modeOnly)
ShowMode();
- else
+ else
shown = ShowProgress(!shown) || shown;
}
bool DisplayedFrames = displayFrames;
diff --git a/menu.h b/menu.h
index 8893016..a0e0851 100644
--- a/menu.h
+++ b/menu.h
@@ -4,11 +4,11 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.h 1.41 2002/03/31 13:53:23 kls Exp $
+ * $Id: menu.h 1.42 2002/04/13 15:31:41 kls Exp $
*/
-#ifndef _MENU_H
-#define _MENU_H
+#ifndef __MENU_H
+#define __MENU_H
#include "dvbapi.h"
#include "osd.h"
@@ -142,4 +142,4 @@ public:
static void ClearLastReplayed(const char *FileName);
};
-#endif //_MENU_H
+#endif //__MENU_H
diff --git a/recording.c b/recording.c
index b19e8b7..e637045 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 1.60 2002/04/01 10:51:23 kls Exp $
+ * $Id: recording.c 1.61 2002/04/21 14:02:55 kls Exp $
*/
#include "recording.h"
@@ -222,7 +222,6 @@ static char *ExchangeChars(char *s, bool ToFileSystem)
case '+':
case ',':
case '-':
- case '.':
case ';':
case '=':
case '0' ... '9':
@@ -237,7 +236,8 @@ static char *ExchangeChars(char *s, bool ToFileSystem)
case ' ': *p = '_'; break;
case '~': *p = '/'; break;
// characters that have to be encoded:
- default: {
+ default:
+ if (*p != '.' || !*(p + 1) || *(p + 1) == '~') { // Windows can't handle '.' at the end of directory names
int l = p - s;
s = (char *)realloc(s, strlen(s) + 10);
p = s + l;
diff --git a/ringbuffer.c b/ringbuffer.c
index 8b8420c..a52683d 100644
--- a/ringbuffer.c
+++ b/ringbuffer.c
@@ -7,7 +7,7 @@
* Parts of this file were inspired by the 'ringbuffy.c' from the
* LinuxDVB driver (see linuxtv.org).
*
- * $Id: ringbuffer.c 1.5 2001/11/03 09:50:46 kls Exp $
+ * $Id: ringbuffer.c 1.6 2002/04/18 15:46:36 kls Exp $
*/
#include "ringbuffer.h"
@@ -154,7 +154,6 @@ int cRingBufferLinear::Put(const uchar *Data, int Count)
Lock();
int rest = Size() - head;
int diff = tail - head;
- Unlock();
int free = (diff > 0) ? diff - 1 : Size() + diff - 1;
if (statistics) {
int fill = Size() - free - 1 + Count;
@@ -167,22 +166,25 @@ int cRingBufferLinear::Put(const uchar *Data, int Count)
dsyslog(LOG_INFO, "buffer usage: %d%%", percent);
}
}
- if (free <= 0)
- return 0;
- if (free < Count)
- Count = free;
- if (Count > maxFill)
- maxFill = Count;
- if (Count >= rest) {
- memcpy(buffer + head, Data, rest);
- if (Count - rest)
- memcpy(buffer, Data + rest, Count - rest);
- head = Count - rest;
- }
- else {
- memcpy(buffer + head, Data, Count);
- head += Count;
+ if (free > 0) {
+ if (free < Count)
+ Count = free;
+ if (Count > maxFill)
+ maxFill = Count;
+ if (Count >= rest) {
+ memcpy(buffer + head, Data, rest);
+ if (Count - rest)
+ memcpy(buffer, Data + rest, Count - rest);
+ head = Count - rest;
+ }
+ else {
+ memcpy(buffer + head, Data, Count);
+ head += Count;
+ }
}
+ else
+ Count = 0;
+ Unlock();
}
return Count;
}
@@ -193,22 +195,24 @@ int cRingBufferLinear::Get(uchar *Data, int Count)
Lock();
int rest = Size() - tail;
int diff = head - tail;
- Unlock();
int cont = (diff >= 0) ? diff : Size() + diff;
- if (rest <= 0)
- return 0;
- if (cont < Count)
- Count = cont;
- if (Count >= rest) {
- memcpy(Data, buffer + tail, rest);
- if (Count - rest)
- memcpy(Data + rest, buffer, Count - rest);
- tail = Count - rest;
- }
- else {
- memcpy(Data, buffer + tail, Count);
- tail += Count;
+ if (rest > 0) {
+ if (cont < Count)
+ Count = cont;
+ if (Count >= rest) {
+ memcpy(Data, buffer + tail, rest);
+ if (Count - rest)
+ memcpy(Data + rest, buffer, Count - rest);
+ tail = Count - rest;
+ }
+ else {
+ memcpy(Data, buffer + tail, Count);
+ tail += Count;
+ }
}
+ else
+ Count = 0;
+ Unlock();
}
return Count;
}