Mercurial > audlegacy
diff 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 |
line wrap: on
line diff
--- a/Plugins/Input/modplug/modplugbmp.cpp Mon Apr 10 17:18:44 2006 -0700 +++ b/Plugins/Input/modplug/modplugbmp.cpp Tue Apr 11 14:33:16 2006 -0700 @@ -41,6 +41,7 @@ mVolumeRamp = true; mFastinfo = true; mUseFilename = false; + mGrabAmigaMOD = true; mChannels = 2; mFrequency = 44100; @@ -74,6 +75,7 @@ bmp_cfg_db_get_bool(db,"modplug","Reverb", &mModProps.mReverb); bmp_cfg_db_get_bool(db,"modplug","FastInfo", &mModProps.mFastinfo); bmp_cfg_db_get_bool(db,"modplug","UseFileName", &mModProps.mUseFilename); + bmp_cfg_db_get_bool(db,"modplug","GrabAmigaMOD", &mModProps.mGrabAmigaMOD); bmp_cfg_db_get_bool(db,"modplug","PreAmp", &mModProps.mPreamp); bmp_cfg_db_get_float(db,"modplug","PreAmpLevel", &mModProps.mPreampLevel); bmp_cfg_db_get_int(db,"modplug", "Channels", &mModProps.mChannels); @@ -131,6 +133,7 @@ vfs_fclose(file); return 1; } + if(mModProps.mGrabAmigaMOD) { vfs_fseek(file, 1080, SEEK_SET); vfs_fread(magic, 1, 4, file); if (!memcmp(magic, MOD_MAGIC_PROTRACKER4, 4)) { @@ -141,6 +144,10 @@ vfs_fclose(file); return 1; } + if (!memcmp(magic, MOD_MAGIC_NOISETRACKER, 4)) { + vfs_fclose(file); + return 1; + } if (!memcmp(magic, MOD_MAGIC_STARTRACKER4, 4)) { vfs_fclose(file); return 1; @@ -149,6 +156,14 @@ vfs_fclose(file); return 1; } + if (!memcmp(magic, MOD_MAGIC_STARTRACKER4X, 4)) { + vfs_fclose(file); + return 1; + } + if (!memcmp(magic, MOD_MAGIC_STARTRACKER8X, 4)) { + vfs_fclose(file); + return 1; + } if (!memcmp(magic, MOD_MAGIC_FASTTRACKER4, 4)) { vfs_fclose(file); return 1; @@ -181,6 +196,7 @@ vfs_fclose(file); return 1; } + } /* end of if(mModProps.mGrabAmigaMOD) */ /* We didn't find the magic bytes, fall back to extension check */ vfs_fclose(file); @@ -207,8 +223,6 @@ return true; if (lExt == ".mdl") return true; - if (lExt == ".med") - return true; if (lExt == ".stm") return true; if (lExt == ".ult") @@ -769,6 +783,7 @@ bmp_cfg_db_set_bool(db,"modplug","Reverb", mModProps.mReverb); bmp_cfg_db_set_bool(db,"modplug","FastInfo", mModProps.mFastinfo); bmp_cfg_db_set_bool(db,"modplug","UseFileName", mModProps.mUseFilename); + bmp_cfg_db_set_bool(db,"modplug","GrabAmigaMOD", mModProps.mGrabAmigaMOD); bmp_cfg_db_set_bool(db,"modplug","PreAmp", mModProps.mPreamp); bmp_cfg_db_set_float(db,"modplug","PreAmpLevel", mModProps.mPreampLevel); bmp_cfg_db_set_int(db,"modplug", "Channels", mModProps.mChannels);
