From 82bfd4c15949019ede37b2b04be79659c5c65dbe Mon Sep 17 00:00:00 2001 From: Martin Prochnow Date: Tue, 11 Apr 2006 19:12:01 +0200 Subject: Version 0.9 - removed myDvbPlayer, use VDR's cDvbPlayer instead - made adjustments to work with BigPatch-VDRs (JumpPlay-patch) - added option for sort recordings - moved editing of priority and lifetime to its own submenu - removed option to select alternative dvd marker, the icon is now default - added default values for setup options - moved content of patches/ and tools/ to contrib/ and added a small README - new version of 'dvdarchive.sh'; thanks to vejoun from vdr-portal.de - fixed problem with archive dvd recordings at the base dir; thanks to Mase from vdr-portal.de for reporting --- contrib/README | 14 ++++ contrib/getlength.c | 68 +++++++++++++++++ contrib/isodetect.c | 150 +++++++++++++++++++++++++++++++++++++ contrib/vdr-1.3.43-extrecmenu.diff | 31 ++++++++ 4 files changed, 263 insertions(+) create mode 100644 contrib/README create mode 100644 contrib/getlength.c create mode 100644 contrib/isodetect.c create mode 100644 contrib/vdr-1.3.43-extrecmenu.diff (limited to 'contrib') diff --git a/contrib/README b/contrib/README new file mode 100644 index 0000000..3ec797d --- /dev/null +++ b/contrib/README @@ -0,0 +1,14 @@ +getlength.c +------------------------------------------------------------------------------- +Creates a length.vdr from an index.vdr +Compile with 'gcc getlength.c -o getlength' + +isodetect.c +------------------------------------------------------------------------------- +Checks, if a dvd is in the drive. Used optionally by dvdarchive.sh +Compile with 'gcc isodetect.c -o isodetect' + +vdr-1.3.43-extrecmenu.diff +------------------------------------------------------------------------------- +A patch to replace VDR's recordings menu with the plugin +Apply with 'patch < vdr-1.3.43.extrecmenu.diff' diff --git a/contrib/getlength.c b/contrib/getlength.c new file mode 100644 index 0000000..946e01c --- /dev/null +++ b/contrib/getlength.c @@ -0,0 +1,68 @@ +/* + * getlength - a small tool to get the length of a VDR recording by the size + * of the file index.vdr + * + * (c) by Martin Prochnow + * Distributed under the terms of the GPL v2.0 (see COPYING at the root dir of + * this archive). + * + * Compile with: gcc getlength.c -o getlength + * + * Usage: 'getlength' if index.vdr is in the current working directory or + 'getlength /PATH/TO/RECDIR/' else + */ + +#include +#include +#include +#include +#include + +int main(int argc,char **argv) +{ + char *filename; + int hasindex,length; + struct stat status; + FILE *out; + + switch(argc) + { + case 1: asprintf(&filename,"./index.vdr");break; + case 2: asprintf(&filename,"%s/index.vdr",argv[1]);break; + default: fprintf(stderr,"Usage:\ngetlength [PATH/TO/index.vdr]\n");exit(-1); + } + + hasindex=!access(filename,R_OK); + if(hasindex) + { + stat(filename,&status); + length=status.st_size/12000; // calculate length if the recording by the size of index.vdr + + free(filename); + switch(argc) + { + case 1: asprintf(&filename,"./length.vdr");break; + case 2: asprintf(&filename,"%s/length.vdr",argv[1]);break; + } + if((out=fopen(filename,"w"))!=NULL) + { + fprintf(out,"%d\n",length); + fclose(out); + } + else + { + perror("Error while open length.vdr"); + free(filename); + exit(-1); + } + } + else + { + perror("Error while accessing index.vdr"); + free(filename); + exit(-1); + } + + free(filename); + return 0; +} diff --git a/contrib/isodetect.c b/contrib/isodetect.c new file mode 100644 index 0000000..25c4c68 --- /dev/null +++ b/contrib/isodetect.c @@ -0,0 +1,150 @@ +/* + isodetect.c + + gcc -O2 -Wall isodetect.c -o isodetect + + Looks in first block of an block-device and checks if there is an ISO9660- + filesystem on it. This is done by checking for a string "CD001". + + Also reads certain information out of the block. + + 14.11.95 T.Niederreiter (based on cdlabel.c by aeb) +*/ + +#include +#include +#include +#include +#include + +char buf[1024]; +char devname[80]; + +void printnsp(int begin, int end, char *txt); +void printchar(unsigned char c); + +main(int argc, char **argv) { +FILE * infile; +int c; +int id=0; + + /* Default device to check */ + strcpy(devname,"/dev/cdrom"); + + while ((c = getopt (argc,argv,"hVpPAd:")) != EOF) { + switch(c) { + case 0: + break; + + case 'V': + id=1; + break; + + case 'p': + id=2; + break; + + case 'P': + id=3; + break; + + case 'A': + id=4; + break; + + case 'd': + strcpy(devname,optarg); + break; + + case 'h': + printf("Usage: %s [OPTIONS]\n",argv[0]); + printf("\ + -h show help (this text)\n\ + -V print VOLUME_ID of ISO9660-Image\n\ + -p print PREPARER_ID of ISO9660-Image\n\ + -P print PUBLISHER_ID of ISO9660-Image\n\ + -A print APPLICATION_ID of ISO9660-Image\n\ + -d \n"); + + exit(1); + } + } + + infile = fopen(devname, "rb"); + + if (infile == NULL) { + perror(devname); + exit(1); + } + + if (lseek(fileno(infile), 32768, SEEK_SET) < 0) { + perror("lseek"); + exit(1); + } + + if (read(fileno(infile), buf, sizeof(buf)) != sizeof(buf)) { + perror("read"); + exit(1); + } + + if (strncmp(buf, "\001CD001\001", 8) != 0) { + if (id==0) { + printf("Not ISO9660\n"); + exit(0); + } + } + else { + switch(id) { + case 0: + printf("ISO9660\n"); + exit(0); + break; + + case 1: + printnsp(40,72,"Volume_ID"); /* 32 */ + break; + + case 3: + printnsp(318,446,"Publisher"); /* 128 */ + break; + + case 2: + printnsp(446,574,"Preparer"); /* 128 */ + break; + + case 4: + printnsp(574,702,"Application"); /* 128 */ + break; + } + } + exit(0); +} + +int empty(char c) { + return (c == 0 || c == ' '); +} + +void printnsp(int begin, int end, char *txt) { +int i,j,k; + + for(i=begin; iSetupParse("IsOrgRecMenu", "0")) ? AddSubMenu((cOsdMenu *)p->MainMenuAction()) : AddSubMenu(new cMenuRecordings(NULL, 0, true)); ++ } ++ break; + case osSetup: AddSubMenu(new cMenuSetup); break; + case osCommands: AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); break; + default: break; +@@ -3044,7 +3048,14 @@ + break; + case osChannels: return AddSubMenu(new cMenuChannels); + case osTimers: return AddSubMenu(new cMenuTimers); +- case osRecordings: return AddSubMenu(new cMenuRecordings); ++ case osRecordings: { ++ cPlugin *p = cPluginManager::GetPlugin("extrecmenu"); ++ if (p && !p->SetupParse("IsOrgRecMenu", "0")) ++ return AddSubMenu((cOsdMenu *)p->MainMenuAction()); ++ else ++ return AddSubMenu(new cMenuRecordings); ++ } ++ break; + case osSetup: return AddSubMenu(new cMenuSetup); + case osCommands: return AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); + case osStopRecord: if (Interface->Confirm(tr("Stop recording?"))) { -- cgit v1.2.3