//if (fi != stdin && fi != NULL) fclose(fi);//flatmax
	fi->close():
}

int main(int argc, char **argv) { 
	int i=1, endc; 
	//FILE *fi=stdin; 	 //flatmax
	ifstream fi=ifstream(stdin); //flatmax
 
	while(i<argc) {
		if(!strcmp("--help",argv[i]) || !strcmp("-h",argv[i])) {
			putinfo(); return(0);
		}
		if(!strcmp("-f",argv[i])) {
			i++;
			if(i>=argc) return(-1);
			//fi=fopen(argv[i],"rb");
			//if(fi == NULL) return(-1);
			fi=ifstream(argv[i]);
			if (!fi) return(-1);
			i++;
			continue;
		}
		if(!strcmp("-t",argv[i])) {
			shiftflag=TRUE;
			i++;
			continue;
		}
		if(!strcmp("-s",argv[i])) {
			vplowpass=TRUE;
			i++;
			continue;
		}
		if(!strcmp("-p",argv[i])) { 
			i++;
			if(i>=argc) { closefile(fi); return(-1); }
			if(atoi(argv[i]) <= CPMAX)
				nofpitches=atoi(argv[i]); 
			else
				nofpitches=CPMAX;
			i++;
			continue;
		}
		if(!strcmp("-w",argv[i])) {
			i++;
			if(i>=argc) { closefile(fi); return(-1); }
			minweight=atof(argv[i]);
			i++;
			continue;
		}
		if(!strcmp("-n",argv[i])) {
			noteflag=TRUE;
			i++;
			continue;
		}
		closefile(&fi);
		return(-1); /* Unknown argument */
	}
//	while((endc=initialise(fi)) == (int)EODATA) { 
	while((endc=initialise(&fi)) == (int)EODATA) {  //flatmax
		if(ptp.count < 0) break;  
		createspp();
		subcoincidence();
		spsintocombipat();
		vpsintocombipat();
		for(i=0;i<=cbp.count && i<nofpitches;i++) {
			if(noteflag) printnotename(cbp.nomp[i]*1000.0);
			else
			{
				if(!shiftflag)
					printf("%4.1f ",cbp.nomp[i]*1000.0); 
				else  
					printf("%4.1f ",cbp.trup[i]*1000.0); 
			}
			printf("%1.2f ",cbp.weight[i]); 
			if(cbp.spflg[i]) putchar('s');
			else putchar('v');
			putchar('\n');
		}
		printf("%c\n",EODATA);
	}
	closefile(fi);
	return(0);
} 
Ejemplo n.º 2
0
INTEGER putinfo_(char *string)
{
    return (putinfo(fcstring(string)));
}