gehe zur Dokumentation dieser Datei00001
00028
00029
00030 #ifndef MU32_DEFS_H
00031 #define MU32_DEFS_H
00032
00033 #ifdef HAVE_CONFIG_H
00034 #include "config.h"
00035 #else
00036 #define MUTWIN
00037
00038 #endif
00039
00040 #ifdef WX
00041 #include "mhDefs.h"
00042 #include "wx/wxchar.h"
00043 #include "wx/intl.h"
00044 #endif
00045
00046
00047 #if defined(MUTWIN) && (!defined(WX) || defined(__WXMSW__))
00048 #include <windows.h>
00049 #endif
00050
00051 #ifdef WX
00052 #include "stdint.h"
00053 # include "wx/setup.h"
00054 # include "wx/wxchar.h"
00055 # if !defined(__WXMSW__)
00056 #define UINT unsigned int
00057 #define WORD uint16_t
00058 #define DWORD uint32_t
00059 #define BYTE uint8_t
00060 #define BOOL bool
00061 #define pascal
00062 #define CALLBACK
00063 #endif
00064 #define _export
00065 #if defined(__VISUALC__)
00066 #define min(a, b) wxMin(a, b)
00067 #endif
00068 #else // not WX
00069 #define REUSE(type) type
00070 #endif
00071
00072 #if defined(WX)
00073 #define STD_PRE std
00074 #else
00075 #define STD_PRE
00076 #endif
00077
00078 #define mutT _T
00079
00080 #ifdef WX
00081
00082 #define mutChar wxChar
00083 #define mutString wxString
00084 #define mutStringRef mutString &
00085 #define mutEmptyString (wxString) wxEmptyString
00086 #define mutDelString(string) (string = mutEmptyString)
00087 #define mutFreeString(string)
00088 #define mutFopen wxFopen
00089 #define mutCopyString(left,right) (left = right)
00090 #define mutCopyIntoString(left,right) (left = right)
00091 #define mutStrdup wxStrdup
00092 #define mutStrCmp(left, right) (left.Cmp (right))
00093 #define mutStrEq(left, right) (left == right)
00094 #define mutStrEq2(left, right) (left.IsSameAs(right))
00095 #define mutStrLast(x) ((x).Last())
00096 #define mutLen(x) ((x).Len())
00097 #define C_STR(x) ((const wxChar *)(x).c_str())
00098 #define mutC_STR(x) (C_STR(muT(x)))
00099
00100 #define mutStrLen wxStrlen
00101 #define mutStrChr wxStrchr
00102 #define mutIsspace wxIsspace
00103 #define mutIsdigit wxIsdigit
00104 #define mutFileName(name) (name.fn_str())
00105
00106 #define mutOFstream wxOutputStream
00107 #define mutIFstream wxInputStream
00108 #define mutTextStream wxTextFile
00109
00110 #define mutOpenOFstream(name,filename) \
00111 wxFFileOutputStream name (filename, _T("wb"))
00112 #define mutOpenIFstream(name,filename) \
00113 wxFFileInputStream name (filename, _T("rb"))
00114 #define mutOpenITextStream(name, filename) \
00115 wxTextFile name (filename)
00116
00117 #define mutWriteStream(stream,data,count) \
00118 (stream).Write(data,count)
00119 #define mutReadStream(stream,data,count) \
00120 (stream).Read(data,count)
00121 #define mutCloseStream(stream)
00122
00123 #define mutPutC(stream,data) (stream).PutC(data)
00124 #define mutGetC(stream) (stream).GetC()
00125
00126 #define mutStreamBad(stream) (!(stream).IsOk())
00127 #define mutStreamGood(stream) ((stream).IsOk())
00128 #define mutStreamEOF(stream) ((stream).Eof())
00129
00130 #if (wxMAJOR_VERSION > 2 || wxMINOR_VERSION >= 9)
00131 #define mutTranslationChar char
00132 #define N_T(s) (s)
00133 #define _C_STR(s) C_STR(s)
00134 #else
00135 #define mutTranslationChar mutChar
00136 #define N_T(s) _T(s)
00137 #define _C_STR(s) (s)
00138 #endif
00139
00140 #else
00141
00142 #define mutChar char
00143 #define mutString (char*)
00144 #define mutStringRef mutString
00145 #define mutEmptyString ((char *) NULL)
00146 #define mutFreeString(string) if (string) free (string)
00147 #define mutDelString(string) (mutFreeString(string), string = mutEmptyString)
00148 #define mutFopen fopen
00149 #define mutCopyString(left,right) left = strdup(right)
00150 #define mutCopyIntoString(left,right) strcpy(left,right)
00151 #define mutStrdup strdup
00152 #define mutStrCmp(left,right) strcmp (left, right)
00153 #define mutStrEq(left,right) (!strcmp (left, right))
00154 #define mutStrLast(x) (x[strlen(x)])
00155 #define C_STR(x) (x)
00156 #define mutC_STR(x) (x)
00157
00158
00159 #define mutStrLen strlen
00160 #define mutStrChr strchr
00161 #define mutFileName
00162
00163 #define mutOFstream STD_PRE::ofstream
00164 #define mutIFstream STD_PRE::ifstream
00165 #define mutTextStrem STD_PRE::ifstream
00166
00167 #define mutOpenOFstream(name,filename) \
00168 STD_PRE::ofstream name(mutFileName(filename), STD_PRE::ios::out | STD_PRE::ios::binary)
00169 #define mutOpenIFstream(name,filename) \
00170 STD_PRE::ifstream name(mutFileName(filename), STD_PRE::ios::in | STD_PRE::ios::binary)
00171
00172 #define mutWriteStream(stream,data,count) \
00173 stream.write(data,count)
00174 #define mutReadStream(stream,data,count) \
00175 stream.read(data,count)
00176 #define mutCloseStream(stream) stream.close()
00177
00178
00179 #define mutPutC(stream,data) stream.putc(data)
00180 #define mutGetC(stream) stream.getc()
00181
00182 #define mutStreamBad(stream) (stream.bad())
00183 #define mutStreamGood(stream) (!stream.bad())
00184 #define mutStreamEOF(stream) (stream.eof())
00185
00186 #endif
00187
00188 #ifdef DEBUG
00189 #define mutAssertMsg(cond,msg) \
00190 if (!(cond)) \
00191 std::cerr << (const char *)(wxString(msg).ToUTF8()) << std::endl; \
00192 assert(cond)
00193 #else
00194 #define mutAssertMsg(cond,msg)
00195 #endif
00196
00197 inline wxString getContextLocal(const wxString & s)
00198 {
00199 wxString ret = s.AfterFirst('|');
00200
00201 if (ret == wxEmptyString) return s;
00202 else return ret;
00203 }
00204
00205 #define MIDI_MIN_CHANNEL 0
00206 #define MIDI_MAX_CHANNEL 15
00207 #define MIDI_MIN_KEY 0
00208 #define MIDI_MAX_KEY 0x7f
00209 #endif
00210
00211
00212
00213