Commit 1d22145c authored by Klaus Schmidinger's avatar Klaus Schmidinger

Version 0.6

- Added support for LIRC remote control (thanks to Carsten Koch!).
  There are now three different remote control modes: KBD (PC-Keyboard), RCU
  and LIRC. See the INSTALL file for information on how to enable either of
  these modes. The default mode is now KBD, not RCU as before (to make it
  work immediately even if there is no actual remote control).
- Fixed small bug in dvbapi.c that was causing some channels (many on hotbird)
  not to be correctly tuned (thanks to Plamen Ganev!).
- Now clearing the replay buffer in search forward/back, which results in
  faster reaction.
- The 'Recordings' menu is now listed alphabetically (thanks to Carsten Koch!).
- The new 'epg2timers' tool (thanks to Carsten Koch!) can be used to convert
  an EPG "merkliste" page (http://www.tvtv.de) to vdr timer entries.
- The new 'xtvrc2vdr' tool (thanks to Plamen Ganev!) can be used to convert
  'xtvrc' channel files into 'vdr' format.
- When more than one timer matches at the same time, the first one in the list
  with the highest 'Priority' is selected.
- The MANUAL section on "Programming the Timer" has been filled in.
- The year in the "Recordings" menu as well as in the progress display during
  replay has been reduced to 2 digits to allow more space for the recording's
  title. In the internal file structure the year is still stored with 4 digits,
  so there will be no problem at the next turn of the century ;-)
- Channel names and timer filenames can now contain blanks. To avoid problems
  with file names that contain blanks, all blanks in recording file names are
  converted to underscores.
- The polarization can now be given in uppercase or lowercase characters in
  channels.conf.
- Fixed buffer initialization to work with DVB driver version 0.6.
- Implemented the "Simple Video Disk Recorder Protocol" (SVDRP) to control
  the VDR over a network connection.
- Implemented command line option handling.
- The program can now run in full background mode by using the --daemon option.
- Added a "summary" field to the timers (thanks to Carsten Koch!).
  This field can contain a descriptive text of the programme and will be
  displayed when the "Blue" key is pressed on a recording that was created by
  this timer. If the text contains the special character '|', a newline will
  be inserted at that place.  When pressing "Ok" on a timer that contains a
  summary field, the summary will be displayed. To edit such a timer the "Red"
  key must be pressed. Timers without a summary still go into Edit mode when
  pressing "Ok".  The summary field can only be filled in directly by editing
  the 'timers.conf' file with a text editor, or by defining/modifying the timer
  via the SVDRP interface.
parent 3b78ec83
......@@ -4,9 +4,3 @@ Video Disk Recorder - Known Bugs
* Sometimes the picture "jumps" as if a frame is skipped.
Presumably this is a problem in the card driver or firmware?
* When the on-screen display is activated during recording,
the video data stream gets corrupted, which results in a
distorted picture when replaying such a recording.
I assume this is a problem in the driver of firmware.
There is no such problem in replay mode.
......@@ -2,4 +2,10 @@ Thanks go to the following people for patches and contributions:
Carsten Koch <Carsten.Koch@icem.de>
for adding LIRC support
for making the 'Recordings' menu be listed alphabetically
for implementing the 'Summary' feature
for adding the 'epg2timers' tool (see Tools/epg2timers)
Plamen Ganev <pganev@com-it.net>
for fixing the frequency offset for Hotbird channels
for adding the 'xtvrc2vdr' tool (see Tools/xtvrc2vdr)
......@@ -56,11 +56,46 @@ Video Disk Recorder Revision History
the PC keyboard to better resemble the "up-down-left-right-ok" layout on
menu controlling remote control units.
2000-07-15: Version 0.06
2000-07-25: Version 0.6
- Added support for LIRC remote control (thanks to Carsten Koch!).
There are now three different remote control modes: KBD (PC-Keyboard), RCU
and LIRC. See the INSTALL file for information on how to enable either of
these modes. The default mode is now KBD, not RCU as before (to make it
work immediately even if there is no actual remote control).
- Fixed small bug in dvbapi.c that was causing some channels (many on hotbird)
not to be correctly tuned (thanks to Plamen Ganev!).
- Now clearing the replay buffer in search forward/back, which results in
faster reaction.
- The 'Recordings' menu is now listed alphabetically (thanks to Carsten Koch!).
- The new 'epg2timers' tool (thanks to Carsten Koch!) can be used to convert
an EPG "merkliste" page (http://www.tvtv.de) to vdr timer entries.
- The new 'xtvrc2vdr' tool (thanks to Plamen Ganev!) can be used to convert
'xtvrc' channel files into 'vdr' format.
- When more than one timer matches at the same time, the first one in the list
with the highest 'Priority' is selected.
- The MANUAL section on "Programming the Timer" has been filled in.
- The year in the "Recordings" menu as well as in the progress display during
replay has been reduced to 2 digits to allow more space for the recording's
title. In the internal file structure the year is still stored with 4 digits,
so there will be no problem at the next turn of the century ;-)
- Channel names and timer filenames can now contain blanks. To avoid problems
with file names that contain blanks, all blanks in recording file names are
converted to underscores.
- The polarization can now be given in uppercase or lowercase characters in
channels.conf.
- Fixed buffer initialization to work with DVB driver version 0.6.
- Implemented the "Simple Video Disk Recorder Protocol" (SVDRP) to control
the VDR over a network connection.
- Implemented command line option handling.
- The program can now run in full background mode by using the --daemon option.
- Added a "summary" field to the timers (thanks to Carsten Koch!).
This field can contain a descriptive text of the programme and will be
displayed when the "Blue" key is pressed on a recording that was created by
this timer. If the text contains the special character '|', a newline will
be inserted at that place. When pressing "Ok" on a timer that contains a
summary field, the summary will be displayed. To edit such a timer the "Red"
key must be pressed. Timers without a summary still go into Edit mode when
pressing "Ok". The summary field can only be filled in directly by editing
the 'timers.conf' file with a text editor, or by defining/modifying the timer
via the SVDRP interface.
......@@ -40,6 +40,17 @@ When running, the 'vdr' program writes status information into the
system log file (/var/log/messages). You may want to watch these
messages (tail -f /var/log/mesages) to see if there are any problems.
The program can be controlled via a network connection to its SVDRP
port ("Simple Video Disk Recorder Protocol"). By default, it listens
on port 2001 (use the --port=PORT option to change this). For details
about the SVDRP syntax see the source file 'svdrp.c'.
If the program shall run as a daemon, use the --daemon option. This
will completely detach it from the terminal and will continue as a
background process.
Use "vdr --help" for a list of available command line options.
The video data directory:
-------------------------
......
......@@ -41,7 +41,11 @@ 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.
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").
The "Red", "Green", "Yellow" and "Blue" buttons have special meanings
in various menus and are listed at the bottom of the on-screen-display.
......@@ -108,4 +112,43 @@ Video Disk Recorder User's Manual
* Programming the Timer
Use the "Timer" menu to maintain your list of timer controlled recordings.
The parameters in the "Edit Timer" menu have the following meanings:
Active: Defines whether the timer will be processed (set it to 'no' to
temporarily desable a timer).
Channel: The channel to be recorded (as defined in the "Channels" list).
Any changes made in the "Channels" list (like renaming or
reordering channels) will be automatically reflected in the
timers settings.
Day: The day on which this timer shall start. This can be either a
"day of month" (1..31), which allows programming a "single shot"
timer that hits once and is deleted after it ends. Single shot
timers can be programmed up to one month into the future.
Another option here are "repeating timers" which are defined
by listing the days of the week on which they shall record.
For example, a timer that shall record every monday and wednesday
would have a Day setting of "M-W----".
Start: The start time of the timer in hh:mm as 24 hour ("military") time.
Stop: The stop time of the timer.
Priority: The Priority (0..99) is used to decide which timer shall be
started in case there are two or more timers with the exact same
start time. The first timer in the list with the highest Priority
will be used. This value is also stored with the recording and is
later used to decide which recording to remove from disk in order
to free space for a new recording. If the disk is full and a new
recording needs more space, an existing recording with the lowest
Priority (and which has exceeded its guaranteed Lifetime) will be
removed.
Lifetime: The number of days (0..99) a recording made through this timer is
guaranteed to remain on disk before it is automatically removed
to free up space for a new recording. Note that setting this
parameter to very high values for all recordings may soon fill up
the entire disk and cause new recordings to fail due to low disk
space.
File: The name under which a recording created through this timer will
be stored on disk (the actual name will also contain the date and
time, so it is possible to have a "repeating timer" store all its
recordings under the same name; they will be distinguishable by
their date and time).
If this field is left blank, the channel name will be used to form
the name of the recording.
#
# Makefile for the On Screen Menu of the Video Disk Recorder
# Makefile for the Video Disk Recorder
#
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 1.4 2000/06/24 15:09:30 kls Exp $
# $Id: Makefile 1.5 2000/07/23 11:57:14 kls Exp $
OBJS = config.o dvbapi.o interface.o menu.o osd.o recording.o remote.o tools.o vdr.o
OBJS = config.o dvbapi.o interface.o menu.o osd.o recording.o remote.o svdrp.o tools.o vdr.o
ifndef REMOTE
REMOTE = KBD
......@@ -28,9 +28,10 @@ dvbapi.o : dvbapi.c config.h dvbapi.h interface.h tools.h
interface.o: interface.c config.h dvbapi.h interface.h remote.h tools.h
menu.o : menu.c config.h dvbapi.h interface.h menu.h osd.h recording.h tools.h
osd.o : osd.c config.h dvbapi.h interface.h osd.h tools.h
vdr.o : vdr.c config.h dvbapi.h interface.h menu.h osd.h recording.h tools.h
vdr.o : vdr.c config.h dvbapi.h interface.h menu.h osd.h recording.h svdrp.h tools.h
recording.o: recording.c config.h dvbapi.h interface.h recording.h tools.h
remote.o : remote.c remote.h tools.h
svdrp.o : svdrp.c svdrp.h config.h interface.h tools.h
tools.o : tools.c tools.h
vdr: $(OBJS)
......
......@@ -8,3 +8,4 @@ TODO list for the Video Disk Recorder project
commercial breaks).
* Implement channel scanning.
* Better support for encrypted channels.
* Implement remaining commands in SVDRP.
This diff is collapsed.
#
# Makefile for xtvrc2vdr utility
#
OBJS = xtvrc2vdr.o
%.o: %.c
gcc -g -O2 -Wall -c $(DEFINES) $<
all: xtvrc2vdr
xtvrc2vdr: $(OBJS)
gcc -g -O2 $(OBJS) -o xtvrc2vdr
clean:
-rm -f $(OBJS) xtvrc2vdr
TV Polonia:10719:v:1:27500:163:92:0:0
Credit Agricole:10834:v:1:27500:5321:5333:0:0
La Chaine Parlementaire:10873:v:1:27500:1020:1030:0:0
TMT:10892:v:1:27500:163:92:0:0
Multivision Accueil:10911:v:1:27500:320:330:0:0
RTL:11054:v:1:27500:160:80:0:0
VOX:11054:v:1:27500:500:501:0:0
Sat 1 A:11054:v:1:27500:511:512:0:0
RTL II Austria:11054:v:1:27500:520:521:0:0
NBC Europe:11054:v:1:27500:550:551:0:0
ZDF:11054:v:1:27500:570:571:0:0
K-T9:11054:v:1:27500:580:581:0:0
Sat 1 Schweiz:11604:v:1:27500:101:102:0:0
MKT9:11623:v:1:27500:222:242:0:0
Olisat TV Promo:11623:v:1:27500:226:246:0:0
Bloomberg TV Germany:11642:v:1:27500:1460:1420:0:0
Bloomberg TV UK:11642:v:1:27500:1560:1520:0:0
SAT 7:11642:v:1:27500:1660:1620:0:0
Multivision 1:11662:v:1:27500:120:130:0:0
Dubai EDT9:11746:v:1:27500:4130:4131:0:0
Dubai Sport Channel:11746:v:1:27500:4386:4387:0:0
Dubai Business Channel:11746:v:1:27500:4642:4643:0:0
Dubai EDT9:11746:v:1:27500:4898:4899:0:0
RAI Uno:11766:v:1:27500:160:80:0:0
RAI Due:11766:v:1:27500:161:84:0:0
RAI Tre:11766:v:1:27500:162:88:0:0
RAI Mosaico:11766:v:1:27500:518:8191:0:0
RAI SportSat:11804:v:1:27500:512:650:0:0
RAI Nettuno Sat 2:11804:v:1:27500:513:651:0:0
RAI Educational:11804:v:1:27500:514:652:0:0
TelePace :11804:v:1:27500:515:653:0:0
RAI News24:11804:v:1:27500:516:654:0:0
Camera dei Deputati:11804:v:1:27500:517:655:0:0
SAT 2000:11804:v:1:27500:518:656:0:0
RAI NettunoSat 1:11804:v:1:27500:519:657:0:0
ERT Sat:11823:v:1:27500:521:740:0:0
INT9:11843:v:1:27500:2324:2325:0:0
TVL:11843:v:1:27500:2441:2442:0:0
Team TV :11881:v:1:27500:2305:2306:0:0
Ante Prima:11881:v:1:27500:2435:2436:0:0
SNAI:11881:v:1:27500:2561:2562:0:0
Italia 1 :11919:v:1:27500:512:650:0:0
Canale 5:11919:v:1:27500:513:660:0:0
Rete 4 :11919:v:1:27500:514:670:0:0
ART Europe:12015:v:1:27500:164:96:0:0
ESC 2:12015:v:1:27500:166:104:0:0
ART Iqra:12015:v:1:27500:168:112:0:0
Vetrina D+:12034:v:1:27500:166:105:0:0
D+ Info:12073:v:1:27500:160:80:0:0
Palco Promo:12073:v:1:27500:161:84:0:0
Vacaciones T9:12092:v:1:27500:4112:4113:0:0
TvL - TV Locale:12092:v:1:27500:4160:4161:0:0
Satisfaction T9:12092:v:1:27500:4192:4193:0:0
TVE Internacional:12092:v:1:27500:4208:4209:0:0
TVG - TV de Galicia :12092:v:1:27500:4224:4225:0:0
La Cadena Del Milagro:12092:v:1:27500:4368:4369:0:0
Fiesta:12092:v:1:27500:4432:4433:0:0
Visions Europe:12092:v:1:27500:4416:4417:0:0
SateliTV/TV Sex Channel:12092:v:1:27500:4480:4481:0:0
Krisma:12111:v:1:27500:200:201:0:0
NT9:12111:v:1:27500:210:211:0:0
Armenia TV 1:12111:v:1:27500:240:241:0:0
SMAU Channel :12111:v:1:27500:260:261:0:0
JSC - Al Jazeera Satellite Ch :12111:v:1:27500:270:271:0:0
Il Tirreno Sat:12111:v:1:27500:280:301:0:0
Coming Soon T9:12111:v:1:27500:310:311:0:0
Alice:12149:v:1:27500:160:161:0:0
Nuvolari Promo:12149:v:1:27500:176:177:0:0
CCTV 4:12169:v:1:27500:516:690:0:0
Kanali Vuolis:12169:v:1:27500:517:700:0:0
Nova Promo:12169:v:1:27500:521:740:0:0
ERT Sat :12188:v:1:27500:514:652:0:0
Kanali Voulis:12188:v:1:27500:515:653:0:0
OTE Promo:12188:v:1:27500:517:655:0:0
TV 5 Europe:12245:v:1:27500:121:131:0:0
Fashion T9:12245:v:1:27500:123:133:0:0
TV Ajara:12245:v:1:27500:127:137:0:0
Telekom T9:12265:v:1:27500:1460:1420:0:0
SLO-TV1:12303:v:1:27500:200:201:0:0
Polonia 1:12303:v:1:27500:205:206:0:0
Super 1:12303:v:1:27500:207:208:0:0
Sicilia Internacional:12303:v:1:27500:210:211:0:0
SicilSat:12303:v:1:27500:225:226:0:0
TBNE Italy:12303:v:1:27500:230:231:0:0
Countdown T9:12303:v:1:27500:235:236:0:0
Napoli International:12303:v:1:27500:240:241:0:0
Magic T9:12303:v:1:27500:245:246:0:0
TEST:12341:v:1:27500:165:108:0:0
Colour Bars:12380:v:1:27500:3022:3032:0:0
Tele 24 :12380:v:1:27500:3023:3033:0:0
Abu Dhabi TV :12380:v:1:27500:3024:3034:0:0
LCA:12380:v:1:27500:3025:3035:0:0
RTV Montenegro:12380:v:1:27500:3026:3036:0:0
SRG SSR Sat Access :12399:v:1:27500:165:98:0:0
Jam-e-Jam Network 1 (IRIB 1):12437:v:1:27500:160:80:0:0
Jam-e-Jam Network 2 (IRIB 2):12437:v:1:27500:161:82:0:0
Sahar University Network:12437:v:1:27500:162:84:0:0
Maharishi Open University:12476:v:1:27500:42:43:0:0
Europe by Satellite:12476:v:1:27500:101:201:0:0
Pink Backup:12476:v:1:27500:308:256:0:0
Mizik Tropical:12476:v:1:27500:435:436:0:0
TLI info card:12476:v:1:27500:771:768:0:0
Liberty T9:12476:v:1:27500:941:942:0:0
HRT TV 1:12520:v:1:27500:100:101:0:0
HRT National:12520:v:1:27500:107:108:0:0
BVN TV:12520:v:1:27500:210:211:0:0
Sicilia International:12520:v:1:27500:501:502:0:0
Sardegna Uno:12520:v:1:27500:503:504:0:0
TGRT:12520:v:1:27500:505:506:0:0
Euro Mediterraneo:12520:v:1:27500:510:511:0:0
WWWTravel T9:12540:v:1:27500:1180:1183:0:0
WWWTravel T9:12540:v:1:27500:1180:1184:0:0
WWWTravel T9:12540:v:1:27500:1180:1185:0:0
Bulgaria T9:12540:v:1:27500:4612:4613:0:0
MC Sat Monte Carlo:12540:v:1:27500:5126:5122:0:0
MBC:12597:v:1:27500:160:80:0:0
SIMA-YEH-MOGHAVEMENT:12597:v:1:27500:161:84:0:0
NITV (National Iran TV ):12597:v:1:27500:163:92:0:0
BET International:12597:v:1:27500:167:108:0:0
JSTV 2 Info Card:12597:v:1:27500:2011:2012:0:0
EuroNews:12597:v:1:27500:2221:2231:0:0
EuroNews:12597:v:1:27500:2221:2232:0:0
EuroNews:12597:v:1:27500:2221:2233:0:0
EuroNews:12597:v:1:27500:2221:2234:0:0
EuroNews:12597:v:1:27500:2221:2235:0:0
EuroNews:12597:v:1:27500:2221:2236:0:0
EuroNews:12597:v:1:27500:2221:2237:0:0
Canal Agro Rual:12597:v:1:27500:2321:2331:0:0
MMO9:12616:v:1:27500:2561:2562:0:0
Dubai Sport Channel:12654:v:1:27500:1060:1020:0:0
Sharjah TV :12654:v:1:27500:1160:1120:0:0
Qatar T9:12654:v:1:27500:1260:1220:0:0
Saudi Channel 1 :12654:v:1:27500:1360:1320:0:0
Kuwait Space Channel :12654:v:1:27500:1460:1420:0:0
Libya T9:12654:v:1:27500:1560:1520:0:0
Sudan T9:12654:v:1:27500:1660:1620:0:0
Oman T9:12654:v:1:27500:1760:1720:0:0
Jordan Satellite Channel:12654:v:1:27500:1860:1820:0:0
Iraq Satellite Channel:12654:v:1:27500:1960:1920:0:0
Thai TV 5 Global Network :12673:v:1:27500:200:201:0:0
DigItaly:12673:v:1:27500:220:221:0:0
Studio Europa:12673:v:1:27500:230:231:0:0
Game Network:12673:v:1:27500:291:292:0:0
Video Italia :12673:v:1:27500:340:341:0:0
Telemarket:12673:v:1:27500:350:351:0:0
Evision:12673:v:1:27500:360:361:0:0
AB Passion:12692:v:1:27500:160:80:0:0
Onyx T9:12692:v:1:27500:161:84:0:0
EWTN:10723:v:1:29900:1001:1201:0:0
Test (Newslynx):10723:v:1:29900:1002:1202:0:0
MTA International:10723:v:1:29900:1004:1204:0:0
J TV Test:10992:v:1:27500:2436:2437:0:0
Bloomberg UK Test Card:11242:v:1:27500:162:88:0:0
Channel SUN Test (KBT):11604:v:1:27500:111:112:0:0
Racing Channel Test:11623:v:1:27500:223:243:0:0
Test Card (pgm 4):11623:v:1:27500:224:244:0:0
Olisat TLC test card:11623:v:1:27500:225:245:0:0
Channel SUN Test (KBT):11623:v:1:27500:229:249:0:0
Rai way 3 test card:11766:v:1:27500:164:96:0:0
Rai way 1 test card:11766:v:1:27500:515:653:0:0
Rai way 2 test card:11766:v:1:27500:516:654:0:0
Test (Local Satellite):12092:v:1:27500:4176:4177:0:0
Retelsat Test:12092:v:1:27500:4464:4465:0:0
AIT Test Card:12111:v:1:27500:220:221:0:0
Fucino Test Card:12111:v:1:27500:230:231:0:0
Espresso(Antenna Hungaria Test Card):12149:v:1:27500:36:37:0:0
Antenna Hungaria Test Card:12149:v:1:27500:96:97:0:0
Antenna Hungaria Test Card:12149:v:1:27500:112:113:0:0
Leonardo (Antenna Hungaria Test):12149:v:1:27500:128:129:0:0
Test (Sahar):12437:v:1:27500:163:86:0:0
Test 1:12437:v:1:27500:164:88:0:0
Test 2:12437:v:1:27500:165:90:0:0
CNES-Toulouse test:12558:v:1:27500:6143:6142:0:0
Test Card:12597:v:1:27500:161:84:0:0
FEED:11242:v:1:27500:167:108:0:0
Feed :11623:v:1:27500:221:241:0:0
Quantum 24 :10913:v:1:3998:1160:1120:0:0
Quantum 24:10913:v:1:3998:1160:1220:0:0
VIVA Polska:11131:v:1:4340:98:99:0:0
Deutsche Welle T9:11196:v:1:9096:101:102:0:0
Canal 24 Horas :11205:v:1:4000:4130:4131:0:0
TV 5 Asie :11338:v:1:5632:512:640:0:0
RAI4IFA:11548:v:1:4398:512:650:0:0
Pro TV International:12201:v:1:5632:1160:1120:0:0
TVN Polnoc:12211:v:1:5632:4194:4195:0:0
WorldNet Europe:12484:v:1:8298:4260:4220:0:0
WorldNet Europe:12484:v:1:8298:4360:4320:0:0
WorldNet Europe:12484:v:1:8298:4460:4420:0:0
WorldNet Europe:12484:v:1:8298:4560:4520:0:0
TVN Polnoc:12573:v:1:5632:4194:4195:0:0
APTN:12582:v:1:5632:308:256:0:0
This diff is collapsed.
/*
* * xtvrc2vdr.c: Converts 'xtvrc' files to 'vdr' channel format
* *
* * Copyright (C) 2000 Plamen Ganev
* *
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as published by the Free Software Foundation; either version 2
* * of the License, or (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
* *
* * The author can be reached at pganev@comm.it
* *
* */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#define MAX_LINE_LEN 1024
#define MAX_NAME 100
#define TOKS ": \n\r"
#define NAMETOKS ":\n\r"
typedef struct {
char Name[MAX_NAME+1];
int freq;
int color, hue, bright, saturation ;
int nitv, input ;
int pol, srate, fec, vpid, apid, lnbnum, type;
} CHANNEL_DATA ;
void strlwr( char *s ){
while ( s && *s ){
*s = tolower(*s);
s++;
}
}
int ReadChannel( FILE *f, CHANNEL_DATA *channel ) {
static char s[MAX_LINE_LEN+1];
char *p;
memset( channel, sizeof( CHANNEL_DATA ), 0 ) ;
while ((p=fgets( s, MAX_LINE_LEN, f ))!=NULL){
// printf("%s", s ) ;
if (s[0] == '*')
break ;
}
if ( !p ) { /* EOF? */
// printf("EOF\n");
return 0 ;
}
while (fgets( s, MAX_LINE_LEN, f )){
if ( s[0] == '\n' )
return channel->freq ? 1 : 0;
p = strtok( s, TOKS ) ;
if ( !p ) {
return 0;
}
strlwr( p ) ;
if ( !strcmp( p, "channel" )){
p=strtok( NULL, NAMETOKS );
while ( p && *p==' ')
p++;
strcpy( channel->Name, p );
// printf("%d ", channel->freq ) ;
} else if ( !strcmp( p, "frequency")) {
channel->freq = atoi( p=strtok( NULL, TOKS ));
// printf("%d ", channel->freq ) ;
} else if ( !strcmp( p, "cbhc")) {
channel->color = atoi(p=strtok(NULL,TOKS));
channel->hue = atoi(p=strtok(NULL,TOKS));
channel->bright = atoi(p=strtok(NULL,TOKS));
channel->saturation = atoi(p=strtok(NULL,TOKS));
} else if ( !strcmp( p, "ni")) {
channel->nitv = atoi(p=strtok(NULL,TOKS));
channel->input = atoi(p=strtok(NULL,TOKS));
} else if ( !strcmp( p, "sat")) {
channel->pol = atoi(p=strtok(NULL,TOKS));
channel->srate = atoi(p=strtok(NULL,TOKS));
channel->fec = atoi(p=strtok(NULL,TOKS));
channel->vpid = atoi(p=strtok(NULL,TOKS));
channel->apid = atoi(p=strtok(NULL,TOKS));
channel->lnbnum = atoi(p=strtok(NULL,TOKS));
channel->type = atoi(p=strtok(NULL,TOKS));
} else
printf("Unknown token %s\n", p ) ;
}
return 1 ;
}
int main ( int argc, char *argv[] ){
FILE *f, *fo ;
int cnt = 0;
CHANNEL_DATA channel ;
if ( argc != 3 ){
printf("USAGE: %s <xtvrc file> <vdr file>\n\n", argv[0] ) ;
return 0;
}
if ( !(f=fopen(argv[1], "rt"))){
printf("Can't open %s for reading\n\n", argv[1]);
return 0;
}
if ( !(fo=fopen(argv[2], "wt"))){
printf("Can't open %s for writing\n\n", argv[2]);
return 0;
}
while ( ReadChannel( f, &channel ) ) {
cnt++;
fprintf(fo, "%s:%d:%c:%d:%d:%d:%d:%d:%d\n",
channel.Name ,
channel.freq ,
channel.pol ? 'v' : 'h' ,
1, //channel.lnbnum ,
channel.srate ,
channel.vpid ,
channel.apid ,
0, //channel.type ,
0 ); //channel.fec ) ;
}
printf( "%d channels read.\n\n", cnt ) ;
fclose(f);
fclose(fo);
return 1;
}
......@@ -31,12 +31,12 @@ Sky News:12552:v:1:22000:305:306:0:0
KinderNet:12574:h:1:22000:163:92:0:0
Alice:12610:v:1:22000:162:96:0:0
n-tv:12670:v:1:22000:162:96:0:0
Grand Tour.:12670:v:1:22000:289:290:0:0
Grand Tourisme:12670:v:1:22000:289:290:0:0
TW1:12692:h:1:22000:166:167:0:0
Eins Extra:12722:h:1:22000:101:102:0:0
Eins Festival:12722:h:1:22000:201:202:0:0
Eins MuXx:12722:h:1:22000:301:302:0:0
MDR:12722:h:1:22000:401:402:0:0
MDR:12110:h:1:27500:401:402:0:0
ORB:12722:h:1:22000:501:502:0:0
B1:12722:h:1:22000:601:602:0:0
ARD Online-Kanal:12722:h:1:22000:8191:701:0:0
......@@ -113,3 +113,4 @@ MHP test:12604:h:1:22000:5632:8191:0:0
Bloomberg TV Spain:12610:v:1:22000:45:49:0:0
Video Italia:12610:v:1:22000:121:122:0:0
AC 3 promo:12670:v:1:22000:308:256:0:0
Rtlneu:12188:h:1:27500:163:104:0:0
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.8 2000/06/24 13:43:14 kls Exp $
* $Id: config.c 1.15 2000/07/25 16:21:20 kls Exp $
*/
#include "config.h"
......@@ -54,7 +54,13 @@ void cKeys::Clear(void)
k->code = 0;
}
bool cKeys::Load(char *FileName)
void cKeys::SetDummyValues(void)
{
for (tKey *k = keys; k->type != kNone; k++)
k->code = k->type + 1; // '+1' to avoid 0
}
bool cKeys::Load(const char *FileName)
{
isyslog(LOG_INFO, "loading %s", FileName);
bool result = false;
......@@ -150,7 +156,7 @@ unsigned int cKeys::Encode(const char *Command)
{
if (Command != NULL) {
const tKey *k = keys;
while ((k->type != kNone) && strncmp(k->name, Command, strlen(k->name)) != 0) //XXX why 'strncmp()'???
while ((k->type != kNone) && strcmp(k->name, Command) != 0)
k++;
return k->code;
}
......@@ -169,6 +175,8 @@ void cKeys::Set(eKeys Key, unsigned int Code)
// -- cChannel ---------------------------------------------------------------
char *cChannel::buffer = NULL;
cChannel::cChannel(void)
{
*name = 0;
......@@ -187,7 +195,18 @@ cChannel::cChannel(const cChannel *Channel)
pnr = Channel ? Channel->pnr : 0;
}
bool cChannel::Parse(char *s)
const char *cChannel::ToText(cChannel *Channel)
{
asprintf(&buffer, "%s:%d:%c:%d:%d:%d:%d:%d:%d\n", Channel->name, Channel->frequency, Channel->polarization, Channel->diseqc, Channel->srate, Channel->vpid, Channel->apid, Channel->ca, Channel->pnr);
return buffer;
}
const char *cChannel::ToText(void)
{
return ToText(this);
}
bool cChannel::Parse(const char *s)
{
char *buffer = NULL;
if (9 == sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apid, &ca, &pnr)) {
......@@ -201,7 +220,7 @@ bool cChannel::Parse(char *s)
bool cChannel::Save(FILE *f)
{
return fprintf(f, "%s:%d:%c:%d:%d:%d:%d:%d:%d\n", name, frequency, polarization, diseqc, srate, vpid, apid, ca, pnr) > 0;
return fprintf(f, ToText()) > 0;
}
bool cChannel::Switch(cDvbApi *DvbApi)
......@@ -211,7 +230,7 @@ bool cChannel::Switch(cDvbApi *DvbApi)
if (!DvbApi->Recording()) {
isyslog(LOG_INFO, "switching to channel %d", Index() + 1);
CurrentChannel = Index();
for (int i = 3; --i;) {
for (int i = 3; i--;) {
if (DvbApi->SetChannel(frequency, polarization, diseqc, srate, vpid, apid, ca, pnr))
return true;
esyslog(LOG_ERR, "retrying");
......@@ -236,6 +255,8 @@ const char *cChannel::GetChannelName(int i)
// -- cTimer -----------------------------------------------------------------
char *cTimer::buffer = NULL;
cTimer::cTimer(bool Instant)
{
startTime = stopTime = 0;
......@@ -253,10 +274,35 @@ cTimer::cTimer(bool Instant)
priority = 99;
lifetime = 99;
*file = 0;
summary = NULL;
if (Instant)
snprintf(file, sizeof(file), "@%s", cChannel::GetChannelName(CurrentChannel));
}
cTimer::~cTimer()
{
delete summary;
}
cTimer& cTimer::operator= (const cTimer &Timer)
{
memcpy(this, &Timer, sizeof(*this));
if (summary)
summary = strdup(summary);
return *this;
}
const char *cTimer::ToText(cTimer *Timer)
{
asprintf(&buffer, "%d:%d:%s:%d:%d:%d:%d:%s:%s\n", Timer->active, Timer->channel, PrintDay(Timer->day), Timer->start, Timer->stop, Timer->priority, Timer->lifetime, Timer->file, Timer->summary ? Timer->summary : "");
return buffer;
}
const char *cTimer::ToText(void)
{
return ToText(this);
}
int cTimer::TimeToInt(int t)
{
return (t / 100 * 60 + t % 100) * 60;
......@@ -269,7 +315,7 @@ time_t cTimer::Day(time_t t)
return mktime(&d);
}
int cTimer::ParseDay(char *s)
int cTimer::ParseDay(const char *s)
{
char *tail;
int d = strtol(s, &tail, 10);
......@@ -277,7 +323,7 @@ int cTimer::ParseDay(char *s)
d = 0;
if (tail == s) {
if (strlen(s) == 7) {
for (char *p = s + 6; p >= s; p--) {
for (const char *p = s + 6; p >= s; p--) {
d <<= 1;
d |= (*p != '-');
}
......@@ -290,7 +336,7 @@ int cTimer::ParseDay(char *s)
return d;
}
char *cTimer::PrintDay(int d)
const char *cTimer::PrintDay(int d)
{
static char buffer[8];
if ((d & 0x80000000) != 0) {
......@@ -308,14 +354,20 @@ char *cTimer::PrintDay(int d)
return buffer;
}
bool cTimer::Parse(char *s)
bool cTimer::Parse(const char *s)
{
char *buffer1 = NULL;
char *buffer2 = NULL;
if (8 == sscanf(s, "%d:%d:%a[^:]:%d:%d:%d:%d:%as", &active, &channel, &buffer1, &start, &stop, &priority, &lifetime, &buffer2)) {