28 #include "../../../idlib/precompiled.h"
37 int parseRange(
const char *rangeStr,
int field,
int skipnum[],
int startnum[],
int endnum[],
int numfiles[],
bool padding[],
int numpadding[] );
38 int parseTimecodeRange(
const char *rangeStr,
int field,
int skipnum[],
int startnum[],
int endnum[],
int numfiles[],
bool padding[],
int numpadding[] );
50 common->
Printf(
"Error: can't open param file %s\n", fileName);
89 if (token.
Icmp(
"input_dir") == 0) {
98 if (token.
Icmp(
"scale_down") == 0) {
105 if (token.
Icmp(
"fullsearch") == 0) {
112 if (token.
Icmp(
"scaleable") == 0) {
118 if (token.
Icmp(
"no_alpha") == 0) {
124 if (token.
Icmp(
"24_fps_in_30_fps_out") == 0) {
130 if (token.
Icmp(
"video_in") == 0) {
136 if (token.
Icmp(
"timecode") == 0) {
144 if (token.
Icmp(
"sound") == 0) {
152 if (token.
Icmp(
"has_sound") == 0) {
157 if (token.
Icmp(
"filename") == 0) {
166 if (token.
Icmp(
"start_palette") == 0) {
175 if (token.
Icmp(
"end_palette") == 0) {
184 if (token.
Icmp(
"fixed_palette") == 0) {
193 if (token.
Icmp(
"screenshot") == 0) {
200 if (token.
Icmp(
"key_color") == 0) {
210 if (token.
Icmp(
"just_delta") == 0) {
218 if (token.
Icmp(
"3DO") == 0) {
224 if (token.
Icmp(
"codebook") == 0) {
230 if (token.
Icmp(
"firstframesize") == 0) {
236 if (token.
Icmp(
"normalframesize") == 0) {
242 if (token.
Icmp(
"stillframequality") == 0) {
247 if (token.
Icmp(
"input") == 0) {
270 if ( token.
Icmp(
"end_input") != 0 ) {
293 if ( arg1[0] !=
'[' ) {
300 if ( arg1[0] ==
'[' )
312 else if (( arg1[0] !=
'[' ) && ( arg2[0] ==
'[') && ( arg3[0] ==
'[')) {
321 if (files1 != files2) {
322 common->
Error(
"You had %d files for %s and %d for %s!", files1, arg1.
c_str(), files2, arg2.
c_str() );
334 }
while (token.
Icmp(
"end_input"));
345 int i, myfield,
index,hrs,mins,secs,frs;
346 char tempfile[33], left[256],
right[256], *strp;
360 if (
range[myfield] == 1 ) {
362 strcpy( left,
file[myfield] );
363 strp = strstr( left,
"*" );
373 if (
padding[myfield] ==
true ) {
375 hrs = index/(30*60*60) ;
376 mins = (index/(30*60)) %60;
377 secs = (index/(30)) % 60;
379 sprintf(fileName,
"%s%.02d%.02d/%.02d%.02d%.02d%.02d%s",left,hrs,mins,hrs,mins,secs,frs,right);
382 sprintf(tempfile,
"%032d", index );
387 hrs = index/(30*60*60) ;
388 mins = (index/(30*60)) %60;
389 secs = (index/(30)) % 60;
391 sprintf(fileName,
"%s%.02d%.02d/%.02d%.02d%.02d%.02d%s",left,hrs,mins,hrs,mins,secs,frs,right);
394 sprintf(fileName,
"%s%d%s", left, index, right );
397 }
else if (
range[myfield] == 2 ) {
399 strcpy( left,
file[myfield] );
400 strp = strstr( left,
"*" );
410 if (
padding[myfield] ==
true ) {
411 sprintf(tempfile,
"%032d", index );
414 sprintf(fileName,
"%s%d%s", left, index, right );
417 strcpy( left,
file2[myfield] );
418 strp = strstr( left,
"*" );
429 sprintf(tempfile,
"%032d", index );
430 fileName +=
va(
"\n%s%s%s", left, &tempfile[ 32-
numpadding2[myfield] ], right );
432 fileName +=
va(
"\n%s%d%s", left, index, right );
435 fileName =
file[myfield];
478 for(i=0; i<
len; i++ )
542 int parseRange(
const char *rangeStr,
int field,
int skipnum[],
int startnum[],
int endnum[],
int numfiles[],
bool padding[],
int numpadding[] ) {
544 char *stptr, *enptr, *skptr;
553 *stptr++ = rangeStr[i++];
554 }
while ( rangeStr[i] >=
'0' && rangeStr[i] <=
'9' );
556 if ( rangeStr[i++] !=
'-' ) {
557 common->
Error(
"Error: invalid range on middle \n");
560 *enptr++ = rangeStr[i++];
561 }
while ( rangeStr[i] >=
'0' && rangeStr[i] <=
'9' );
563 if ( rangeStr[i] !=
']' ) {
564 if ( rangeStr[i++] !=
'+' ) {
568 *skptr++ = rangeStr[i++];
569 }
while ( rangeStr[i] >=
'0' && rangeStr[i] <=
'9' );
571 skipnum[field] = atoi( skip );
575 startnum[field] = atoi( start );
576 endnum[field] = atoi( end );
577 numfiles[field] = (abs( startnum[field] - endnum[field] ) / skipnum[field]) + 1;
578 realnum += numfiles[field];
579 if ( start[0] ==
'0' && start[1] !=
'\0' ) {
580 padding[field] =
true;
581 numpadding[field] = strlen( start );
583 padding[field] =
false;
588 int parseTimecodeRange(
const char *rangeStr,
int field,
int skipnum[],
int startnum[],
int endnum[],
int numfiles[],
bool padding[],
int numpadding[] )
591 char *stptr, *enptr, *skptr;
592 int i,realnum,hrs,mins,secs,frs;
600 *stptr++ = rangeStr[i++];
601 }
while ( rangeStr[i] >=
'0' && rangeStr[i] <=
'9' );
603 if ( rangeStr[i++] !=
'-' ) {
604 common->
Error(
"Error: invalid range on middle \n");
607 *enptr++ = rangeStr[i++];
608 }
while ( rangeStr[i] >=
'0' && rangeStr[i] <=
'9' );
610 if ( rangeStr[i] !=
']' ) {
611 if ( rangeStr[i++] !=
'+' ) {
615 *skptr++ = rangeStr[i++];
616 }
while ( rangeStr[i] >=
'0' && rangeStr[i] <=
'9' );
618 skipnum[field] = atoi( skip );
622 sscanf(start,
"%2d%2d%2d%2d",&hrs,&mins,&secs,&frs);
623 startnum[field] = hrs*30*60*60 + mins *60*30 + secs*30 +frs;
624 sscanf(end,
"%2d%2d%2d%2d",&hrs,&mins,&secs,&frs);
625 endnum[field] = hrs*30*60*60 + mins *60*30 + secs*30 +frs;
626 numfiles[field] = (abs( startnum[field] - endnum[field] ) / skipnum[field]) + 1;
627 realnum += numfiles[field];
628 if ( start[0] ==
'0' && start[1] !=
'\0' ) {
629 padding[field] =
true;
630 numpadding[field] = strlen( start );
632 padding[field] =
false;
const char * RoqTempFilename(void)
void AssureSize(int newSize)
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
int Icmp(const char *text) const
GLuint GLuint GLuint GLuint arg1
int ReadToken(idToken *token)
void GetNthInputFileName(idStr &fileName, int n)
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
void InitFromFile(const char *fileName)
const char * GetNextImageFilename(void)
const char * RoqFilename(void)
int parseTimecodeRange(const char *rangeStr, int field, int skipnum[], int startnum[], int endnum[], int numfiles[], bool padding[], int numpadding[])
virtual void Printf(const char *fmt,...) id_attribute((format(printf
int NormalFrameSize(void)
bool TwentyFourToThirty(void)
int Append(const type &obj)
void * Mem_ClearedAlloc(const int size)
int ReadTokenOnLine(idToken *token)
const char * c_str(void) const
int parseRange(const char *rangeStr, int field, int skipnum[], int startnum[], int endnum[], int numfiles[], bool padding[], int numpadding[])
char * va(const char *fmt,...)
virtual void Error(const char *fmt,...) id_attribute((format(printf
const char * SoundFilename(void)
int sprintf(idStr &string, const char *fmt,...)