/* $Id: umodplayer.h,v 1.5 2006/09/15 14:16:27 toad32767 Exp $ */ /** ** 2005, 2006 by Marco Trillo ** This file is part of UModPlayer, and is released by ** its autors to the Public Domain. ** In case it's not legally possible, its autors grant ** anyone the right to use, redistribute and modify ** this software for any purpose, without any conditions ** unless such conditions are required by law. ** ** THIS FILE COMES WITHOUT ANY WARRANTY. THE AUTHORS ** SHALL NOT BE LIABLE FOR ANY DAMAGE RESULTING BY THE ** USE OR MISUSE OF THIS SOFTWARE. **/ #ifndef _UMODPLAYER_H_ #define _UMODPLAYER_H_ #include #ifdef EXPORT # undef EXPORT #endif #define EXPORT /**/ #ifdef LOCAL # undef LOCAL #endif #define LOCAL static #include #include #include #include #include #include #include #include #include #include #include #include #include /* byte-swapping */ #ifdef swap32 # undef swap32 #endif #ifdef swap16 # undef swap16 #endif #define swap32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0xff0000) >> 8) | (((x) & 0xff00) << 8) | (((x) & 0xff) << 24)) #define swap16(x) ((((x) & 0xff00) >> 8) | (((x) & 0xff) << 8)) #define DEFAULT_SAMPLERATE 44100 #define PREFS_FILE ".umodplayerb" #define STREQ(aa,bb) (strcmp(aa,bb)==0) #define MAXVAL(xx,yy) ((xx>yy) ? xx : yy) #define EXPORT_TYPE_IT 6 #define EXPORT_TYPE_WAV 3 #define EXPORT_TYPE_AIFF 4 #define EXPORT_TYPE_PCM 5 #define EXPORT_SYS_ENDIAN 0 #define EXPORT_BIG_ENDIAN 2 #define EXPORT_LTE_ENDIAN 8 /* error codes */ #define UM_OK 0 #define UM_ERR_INTERNAL 1 #define UM_ERR_INVAL 2 #define UM_ERR_MEMORY 3 #define UM_ERR_IO 4 #define UM_ERR_NOITEM 5 /* this is special for playlist */ /* * some system header files might define these */ #ifdef BIG_ENDIAN # undef BIG_ENDIAN #endif #ifdef LTE_ENDIAN # undef LTE_ENDIAN #endif #ifdef UNKNOWN_ENDIAN # undef UNKNOWN_ENDIAN #endif enum endian {BIG_ENDIAN, LTE_ENDIAN, UNKNOWN_ENDIAN}; typedef enum endian Endian; /* * boolean data type */ #ifdef Bool # undef Bool #endif #ifdef TRUE # undef TRUE #endif #ifdef FALSE # undef FALSE #endif enum boolean {FALSE = 0, TRUE}; typedef enum boolean Bool; struct oFlags { int samplerate; unsigned int vol; int channels; int flags; int resampling; int reverbDepth; int reverbDelay; int bassAmount; int bassRange; int surroundDepth; int surroundDelay; WTheme appareance; Endian endianness; int verbosity; }; typedef void (*xproc) (); struct file { Bool malloc; /* is file name malloc()'d ? */ char *name; /* file name */ ModPlugFile *mod; /* ModPlug */ }; extern struct file file; extern struct oFlags sets; extern char **rr; extern int startpos; extern int endpos; extern int CoreSound_BitsPerSample; extern char *AudioDriver; extern Bool AudioActive; extern ao_device *AO_Device; void PrintBanner(void); #ifdef bsLE16 # undef bsLE16 #endif #ifdef bsLE32 # undef bsLE32 #endif #ifdef bsBE32 # undef bsBE32 #endif /* defined in io.c */ uint16_t bsLE16(uint16_t); uint32_t bsLE32(uint32_t); uint32_t bsBE32(uint32_t); void notice(char*, ...); void warning(char*, ...); void error(char*, ...); #endif