comparison Plugins/Input/modplug/modplugbmp.cpp @ 924:5ef13028e42d trunk

[svn] Allow to disable grabbing Amiga MOD files so a diferent plugin such as UADE gets a chance. Adds a few extra magic strings for Amiga files. Amiga MOD grabbing defaults to on for that Just Works(TM) feeling.
author chainsaw
date Tue, 11 Apr 2006 14:33:16 -0700
parents a540829b188a
children 543e37d18997
comparison
equal deleted inserted replaced
923:ddadd6828a1a 924:5ef13028e42d
39 mMegabass = false; 39 mMegabass = false;
40 mNoiseReduction = true; 40 mNoiseReduction = true;
41 mVolumeRamp = true; 41 mVolumeRamp = true;
42 mFastinfo = true; 42 mFastinfo = true;
43 mUseFilename = false; 43 mUseFilename = false;
44 mGrabAmigaMOD = true;
44 45
45 mChannels = 2; 46 mChannels = 2;
46 mFrequency = 44100; 47 mFrequency = 44100;
47 mBits = 16; 48 mBits = 16;
48 mResamplingMode = SRCMODE_POLYPHASE; 49 mResamplingMode = SRCMODE_POLYPHASE;
72 bmp_cfg_db_get_bool(db,"modplug","NoiseReduction", &mModProps.mNoiseReduction); 73 bmp_cfg_db_get_bool(db,"modplug","NoiseReduction", &mModProps.mNoiseReduction);
73 bmp_cfg_db_get_bool(db,"modplug","VolumeRamp", &mModProps.mVolumeRamp); 74 bmp_cfg_db_get_bool(db,"modplug","VolumeRamp", &mModProps.mVolumeRamp);
74 bmp_cfg_db_get_bool(db,"modplug","Reverb", &mModProps.mReverb); 75 bmp_cfg_db_get_bool(db,"modplug","Reverb", &mModProps.mReverb);
75 bmp_cfg_db_get_bool(db,"modplug","FastInfo", &mModProps.mFastinfo); 76 bmp_cfg_db_get_bool(db,"modplug","FastInfo", &mModProps.mFastinfo);
76 bmp_cfg_db_get_bool(db,"modplug","UseFileName", &mModProps.mUseFilename); 77 bmp_cfg_db_get_bool(db,"modplug","UseFileName", &mModProps.mUseFilename);
78 bmp_cfg_db_get_bool(db,"modplug","GrabAmigaMOD", &mModProps.mGrabAmigaMOD);
77 bmp_cfg_db_get_bool(db,"modplug","PreAmp", &mModProps.mPreamp); 79 bmp_cfg_db_get_bool(db,"modplug","PreAmp", &mModProps.mPreamp);
78 bmp_cfg_db_get_float(db,"modplug","PreAmpLevel", &mModProps.mPreampLevel); 80 bmp_cfg_db_get_float(db,"modplug","PreAmpLevel", &mModProps.mPreampLevel);
79 bmp_cfg_db_get_int(db,"modplug", "Channels", &mModProps.mChannels); 81 bmp_cfg_db_get_int(db,"modplug", "Channels", &mModProps.mChannels);
80 bmp_cfg_db_get_int(db,"modplug", "Bits", &mModProps.mBits); 82 bmp_cfg_db_get_int(db,"modplug", "Bits", &mModProps.mBits);
81 bmp_cfg_db_get_int(db,"modplug", "Frequency", &mModProps.mFrequency); 83 bmp_cfg_db_get_int(db,"modplug", "Frequency", &mModProps.mFrequency);
129 vfs_fread(magic, 1, 4, file); 131 vfs_fread(magic, 1, 4, file);
130 if (!memcmp(magic, S3M_MAGIC, 4)) { 132 if (!memcmp(magic, S3M_MAGIC, 4)) {
131 vfs_fclose(file); 133 vfs_fclose(file);
132 return 1; 134 return 1;
133 } 135 }
136 if(mModProps.mGrabAmigaMOD) {
134 vfs_fseek(file, 1080, SEEK_SET); 137 vfs_fseek(file, 1080, SEEK_SET);
135 vfs_fread(magic, 1, 4, file); 138 vfs_fread(magic, 1, 4, file);
136 if (!memcmp(magic, MOD_MAGIC_PROTRACKER4, 4)) { 139 if (!memcmp(magic, MOD_MAGIC_PROTRACKER4, 4)) {
137 vfs_fclose(file); 140 vfs_fclose(file);
138 return 1; 141 return 1;
139 } 142 }
140 if (!memcmp(magic, MOD_MAGIC_PROTRACKER4X, 4)) { 143 if (!memcmp(magic, MOD_MAGIC_PROTRACKER4X, 4)) {
141 vfs_fclose(file); 144 vfs_fclose(file);
142 return 1; 145 return 1;
143 } 146 }
147 if (!memcmp(magic, MOD_MAGIC_NOISETRACKER, 4)) {
148 vfs_fclose(file);
149 return 1;
150 }
144 if (!memcmp(magic, MOD_MAGIC_STARTRACKER4, 4)) { 151 if (!memcmp(magic, MOD_MAGIC_STARTRACKER4, 4)) {
145 vfs_fclose(file); 152 vfs_fclose(file);
146 return 1; 153 return 1;
147 } 154 }
148 if (!memcmp(magic, MOD_MAGIC_STARTRACKER8, 4)) { 155 if (!memcmp(magic, MOD_MAGIC_STARTRACKER8, 4)) {
149 vfs_fclose(file); 156 vfs_fclose(file);
150 return 1; 157 return 1;
151 } 158 }
159 if (!memcmp(magic, MOD_MAGIC_STARTRACKER4X, 4)) {
160 vfs_fclose(file);
161 return 1;
162 }
163 if (!memcmp(magic, MOD_MAGIC_STARTRACKER8X, 4)) {
164 vfs_fclose(file);
165 return 1;
166 }
152 if (!memcmp(magic, MOD_MAGIC_FASTTRACKER4, 4)) { 167 if (!memcmp(magic, MOD_MAGIC_FASTTRACKER4, 4)) {
153 vfs_fclose(file); 168 vfs_fclose(file);
154 return 1; 169 return 1;
155 } 170 }
156 if (!memcmp(magic, MOD_MAGIC_FASTTRACKER6, 4)) { 171 if (!memcmp(magic, MOD_MAGIC_FASTTRACKER6, 4)) {
179 } 194 }
180 if (!memcmp(magic, MOD_MAGIC_15INSTRUMENT, 4)) { 195 if (!memcmp(magic, MOD_MAGIC_15INSTRUMENT, 4)) {
181 vfs_fclose(file); 196 vfs_fclose(file);
182 return 1; 197 return 1;
183 } 198 }
199 } /* end of if(mModProps.mGrabAmigaMOD) */
184 200
185 /* We didn't find the magic bytes, fall back to extension check */ 201 /* We didn't find the magic bytes, fall back to extension check */
186 vfs_fclose(file); 202 vfs_fclose(file);
187 } /* end of vfs_open main if statement */ 203 } /* end of vfs_open main if statement */
188 204
204 if (lExt == ".dsm") 220 if (lExt == ".dsm")
205 return true; 221 return true;
206 if (lExt == ".far") 222 if (lExt == ".far")
207 return true; 223 return true;
208 if (lExt == ".mdl") 224 if (lExt == ".mdl")
209 return true;
210 if (lExt == ".med")
211 return true; 225 return true;
212 if (lExt == ".stm") 226 if (lExt == ".stm")
213 return true; 227 return true;
214 if (lExt == ".ult") 228 if (lExt == ".ult")
215 return true; 229 return true;
767 bmp_cfg_db_set_bool(db,"modplug","NoiseReduction", mModProps.mNoiseReduction); 781 bmp_cfg_db_set_bool(db,"modplug","NoiseReduction", mModProps.mNoiseReduction);
768 bmp_cfg_db_set_bool(db,"modplug","VolumeRamp", mModProps.mVolumeRamp); 782 bmp_cfg_db_set_bool(db,"modplug","VolumeRamp", mModProps.mVolumeRamp);
769 bmp_cfg_db_set_bool(db,"modplug","Reverb", mModProps.mReverb); 783 bmp_cfg_db_set_bool(db,"modplug","Reverb", mModProps.mReverb);
770 bmp_cfg_db_set_bool(db,"modplug","FastInfo", mModProps.mFastinfo); 784 bmp_cfg_db_set_bool(db,"modplug","FastInfo", mModProps.mFastinfo);
771 bmp_cfg_db_set_bool(db,"modplug","UseFileName", mModProps.mUseFilename); 785 bmp_cfg_db_set_bool(db,"modplug","UseFileName", mModProps.mUseFilename);
786 bmp_cfg_db_set_bool(db,"modplug","GrabAmigaMOD", mModProps.mGrabAmigaMOD);
772 bmp_cfg_db_set_bool(db,"modplug","PreAmp", mModProps.mPreamp); 787 bmp_cfg_db_set_bool(db,"modplug","PreAmp", mModProps.mPreamp);
773 bmp_cfg_db_set_float(db,"modplug","PreAmpLevel", mModProps.mPreampLevel); 788 bmp_cfg_db_set_float(db,"modplug","PreAmpLevel", mModProps.mPreampLevel);
774 bmp_cfg_db_set_int(db,"modplug", "Channels", mModProps.mChannels); 789 bmp_cfg_db_set_int(db,"modplug", "Channels", mModProps.mChannels);
775 bmp_cfg_db_set_int(db,"modplug", "Bits", mModProps.mBits); 790 bmp_cfg_db_set_int(db,"modplug", "Bits", mModProps.mBits);
776 bmp_cfg_db_set_int(db,"modplug", "Frequency", mModProps.mFrequency); 791 bmp_cfg_db_set_int(db,"modplug", "Frequency", mModProps.mFrequency);