/* $Id: sefiles.h,v 1.1 1998/10/05 14:49:22 schwarz Exp $ include/sefiles.h 24.4.1998 Diemo Schwarz Include file for the spectral envelope library file handling. $Log: sefiles.h,v $ * Revision 1.1 1998/10/05 14:49:22 schwarz * Split up specenv.h into smaller include files seclasses.h, * sefiles.h, separa.h, seutil.h to facilitate selective including * and editing. * * New separate data structure seSpecEnv for spectral envelopes, * which is no longer part of the estimation parameter structures. * */ #ifndef _SEFILES_H_ #define _SEFILES_H_ #ifdef __cplusplus extern "C" { #endif #include #include "seutil.h" /* // DATA GROUP: FILE HANDLING */ #define seMultiNVT 0 /* sdif can't handle multiple NVTs correctly */ /*DOC: File types known to the spectral envelope library */ typedef enum { /* sound data */ seFtSignal = 0, seFtSpectrum = 1, seFtPartialsBin = 2, seFtPartialsAscii = 3, /* envelopes (representation) */ seFtEnvAscii = 4, seFtEnvSdif = 5, seFtEnvSvp = 6, /* SuperVP style binary envelopes */ /* break-point-function */ seFtBpf = 7, /* images */ seFtPgm = 8, seFtJpeg = 9, /* others */ seFtGzip = 10, seFtUnknown = 11, /* seFtUnknown MUST be 3rd to last */ /* actions for seSetFile */ seFtGuess = 12, /* guess file type from extension */ seFtNum = 13, /* seFtNum MUST be last in numbered list */ /* bits to be or'ed with above numbered values */ seFtGuessDefault = 16, /* If type == x | seFtGuessDefault, guess file type from extension. If unknown, take type x */ } seFileType; extern const char *seFileSuffixes [seFtNum]; /*DOC: File access modes */ typedef enum { seFmRead, seFmWrite, seFmNum } seFileMode; /*DOC: Read/Write Actions (unused?) */ typedef enum { seFaBegin, seFaFrame, seFaEnd } seFileAction; /* if sdif has not been included (because it generates warnings and we only really need it for file handling stuff), define a dummy for SdifFileT */ #ifndef _sdif_ typedef void SdifFileT; #endif /*DOC: File parameter structure where all information about a file is gathered */ typedef struct { const char *name; const char *realname; /* Always contains a printable string */ seFileType type; seFileMode mode; Boolean compressed; FILE *file; SdifFileT *sdif; Boolean frameheaderread; Boolean eof; } seFile; /* commands get a filename and have to output their result on stdout xxx */ #define seCompressCmd "gzip -c" #define seUncompressCmd "gzip -cd" /* // FUNCTION GROUP: FILE HANDLING */ /*DOC: Open file, parameters given in file structure. Automatically handles gzip compression. */ seReturn seOpenFile (seFile *file); /*DOC: Close file */ seReturn seCloseFile (seFile *file); /*DOC: Guess file type and compression from name. [in] file->name [out] file->type file->compressed */ seReturn seGuessFile (seFile *file); /*DOC: Lookup file type matching extension string, return seFtUnknown if none found. */ seFileType seLookupType (const char *string); /*DOC: Initialise file structure f. If type is seFtGuess, guess file type from extension */ seReturn seSetFile (seFile *f, const char *name, seFileType type, seFileMode mode); #ifdef __cplusplus } #endif #endif /* _SEFILES_H_ */