From: <man...@us...> - 2013-04-22 20:36:08
|
Revision: 1936 http://sourceforge.net/p/modplug/code/1936 Author: manxorist Date: 2013-04-22 20:36:01 +0000 (Mon, 22 Apr 2013) Log Message: ----------- [Ref] Both NO_MO3 and NO_MO3_SUPPORT are used, rename all NO_MO3_SUPPORT to NO_MO3. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/soundlib/Load_mo3.cpp Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2013-04-22 20:32:38 UTC (rev 1935) +++ trunk/OpenMPT/common/BuildSettings.h 2013-04-22 20:36:01 UTC (rev 1936) @@ -60,7 +60,7 @@ //#define NO_PORTAUDIO // Define to build without MO3 support. -//#define NO_MO3_SUPPORT +//#define NO_MO3 // Define to build without DirectSound support. //#define NO_DSOUND Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-22 20:32:38 UTC (rev 1935) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-22 20:36:01 UTC (rev 1936) @@ -1155,11 +1155,11 @@ "All Modules|" + exts + "|" "Compressed Modules (*.mdz;*.s3z;*.xmz;*.itz" -#ifndef NO_MO3_SUPPORT +#ifndef NO_MO3 ";*.mo3" #endif ")|*.mdz;*.s3z;*.xmz;*.itz;*.mdr;*.zip;*.rar;*.lha;*.gz" -#ifndef NO_MO3_SUPPORT +#ifndef NO_MO3 ";*.mo3" #endif "|" Modified: trunk/OpenMPT/soundlib/Load_mo3.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mo3.cpp 2013-04-22 20:32:38 UTC (rev 1935) +++ trunk/OpenMPT/soundlib/Load_mo3.cpp 2013-04-22 20:36:01 UTC (rev 1936) @@ -29,7 +29,7 @@ return false; } -#ifdef NO_MO3_SUPPORT +#ifdef NO_MO3 // As of April 2012, the format revision is 5; Versions > 31 are unlikely to exist in the next few years, // so we will just ignore those if there's no UNMO3 library to tell us if the file is valid or not // (avoid log entry with .MOD files that have a song name starting with "MO3". @@ -93,5 +93,5 @@ FreeLibrary(unmo3); } return result; -#endif // NO_MO3_SUPPORT +#endif // NO_MO3 } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-22 21:52:55
|
Revision: 1941 http://sourceforge.net/p/modplug/code/1941 Author: manxorist Date: 2013-04-22 21:52:47 +0000 (Mon, 22 Apr 2013) Log Message: ----------- [Ref] Convert argument of CModSpecifications::ExtensionToType to std::string. Modified Paths: -------------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-04-22 21:47:30 UTC (rev 1940) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-04-22 21:52:47 UTC (rev 1941) @@ -530,7 +530,7 @@ // Default mod type when using the "New" button const MODTYPE oldDefault = defaultModType; - defaultModType = CModSpecifications::ExtensionToType(CMainFrame::GetPrivateProfileCString("Misc", "DefaultModType", CSoundFile::GetModSpecifications(defaultModType).fileExtension, iniFile)); + defaultModType = CModSpecifications::ExtensionToType(mpt::String(CMainFrame::GetPrivateProfileCString("Misc", "DefaultModType", CSoundFile::GetModSpecifications(defaultModType).fileExtension, iniFile))); if(defaultModType == MOD_TYPE_NONE) { defaultModType = oldDefault; Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-22 21:47:30 UTC (rev 1940) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-04-22 21:52:47 UTC (rev 1941) @@ -239,7 +239,6 @@ VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("ita")), MOD_TYPE_NONE); VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("s2m")), MOD_TYPE_NONE); VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("")), MOD_TYPE_NONE); - VERIFY_EQUAL(CModSpecifications::ExtensionToType(LPCTSTR(nullptr)), MOD_TYPE_NONE); VERIFY_EQUAL( Util::Round(1.99), 2.0 ); VERIFY_EQUAL( Util::Round(1.5), 2.0 ); Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2013-04-22 21:47:30 UTC (rev 1940) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2013-04-22 21:52:47 UTC (rev 1941) @@ -11,8 +11,8 @@ #include <stdafx.h> #include "mod_specifications.h" #include "../common/misc_util.h" +#include <algorithm> - namespace ModSpecs { @@ -368,36 +368,32 @@ } // namespace ModSpecs -MODTYPE CModSpecifications::ExtensionToType(LPCTSTR pszExt) -//--------------------------------------------------------- +MODTYPE CModSpecifications::ExtensionToType(const std::string &ext_) +//------------------------------------------------------------------ { - if (pszExt == nullptr) + std::string ext = ext_; + if(ext == "") + { return MOD_TYPE_NONE; - if (pszExt[0] == '.') - pszExt++; - char szExtA[CountOf(ModSpecs::mod.fileExtension)]; - MemsetZero(szExtA); - const size_t nLength = _tcslen(pszExt); - if (nLength >= CountOf(szExtA)) - return MOD_TYPE_NONE; - for(size_t i = 0; i < nLength; i++) - szExtA[i] = static_cast<char>(pszExt[i]); - - for(size_t i = 0; i < CountOf(ModSpecs::Collection); i++) + } + if(ext.length() > 0 && ext[0] == '.') { - if (!lstrcmpiA(szExtA, ModSpecs::Collection[i]->fileExtension)) + ext = ext.substr(1); + } + std::transform( ext.begin(), ext.end(), ext.begin(), tolower ); + for(std::size_t i = 0; i < CountOf(ModSpecs::Collection); i++) + { + if(ext == ModSpecs::Collection[i]->fileExtension) { return ModSpecs::Collection[i]->internalType; } } // Special case: ITP files... - if(!lstrcmpi(szExtA, _T("itp"))) + if(ext == "itp") { return MOD_TYPE_IT; } - return MOD_TYPE_NONE; - } Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2013-04-22 21:47:30 UTC (rev 1940) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2013-04-22 21:52:47 UTC (rev 1941) @@ -21,7 +21,7 @@ { /// Returns modtype corresponding to given file extension. The extension string /// may begin with or without dot, e.g. both ".it" and "it" will be handled correctly. - static MODTYPE ExtensionToType(LPCTSTR pszExt); + static MODTYPE ExtensionToType(const std::string &ext); // Return true if format supports given note. bool HasNote(ModCommand::NOTE note) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-22 23:37:26
|
Revision: 1958 http://sourceforge.net/p/modplug/code/1958 Author: manxorist Date: 2013-04-22 23:37:19 +0000 (Mon, 22 Apr 2013) Log Message: ----------- [Ref] Move NoteNames table from mptrack into soundlib, CSoundFile::GetNoteName() needs them. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Tables.cpp Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-22 23:28:46 UTC (rev 1957) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-22 23:37:19 UTC (rev 1958) @@ -260,29 +260,6 @@ } -///////////////////////////////////////////////////////////////////////////// -// Common Tables - -const LPCSTR szNoteNames[12] = -{ - "C-", "C#", "D-", "D#", "E-", "F-", - "F#", "G-", "G#", "A-", "A#", "B-" -}; - -const LPCTSTR szDefaultNoteNames[NOTE_MAX] = { - TEXT("C-0"), TEXT("C#0"), TEXT("D-0"), TEXT("D#0"), TEXT("E-0"), TEXT("F-0"), TEXT("F#0"), TEXT("G-0"), TEXT("G#0"), TEXT("A-0"), TEXT("A#0"), TEXT("B-0"), - TEXT("C-1"), TEXT("C#1"), TEXT("D-1"), TEXT("D#1"), TEXT("E-1"), TEXT("F-1"), TEXT("F#1"), TEXT("G-1"), TEXT("G#1"), TEXT("A-1"), TEXT("A#1"), TEXT("B-1"), - TEXT("C-2"), TEXT("C#2"), TEXT("D-2"), TEXT("D#2"), TEXT("E-2"), TEXT("F-2"), TEXT("F#2"), TEXT("G-2"), TEXT("G#2"), TEXT("A-2"), TEXT("A#2"), TEXT("B-2"), - TEXT("C-3"), TEXT("C#3"), TEXT("D-3"), TEXT("D#3"), TEXT("E-3"), TEXT("F-3"), TEXT("F#3"), TEXT("G-3"), TEXT("G#3"), TEXT("A-3"), TEXT("A#3"), TEXT("B-3"), - TEXT("C-4"), TEXT("C#4"), TEXT("D-4"), TEXT("D#4"), TEXT("E-4"), TEXT("F-4"), TEXT("F#4"), TEXT("G-4"), TEXT("G#4"), TEXT("A-4"), TEXT("A#4"), TEXT("B-4"), - TEXT("C-5"), TEXT("C#5"), TEXT("D-5"), TEXT("D#5"), TEXT("E-5"), TEXT("F-5"), TEXT("F#5"), TEXT("G-5"), TEXT("G#5"), TEXT("A-5"), TEXT("A#5"), TEXT("B-5"), - TEXT("C-6"), TEXT("C#6"), TEXT("D-6"), TEXT("D#6"), TEXT("E-6"), TEXT("F-6"), TEXT("F#6"), TEXT("G-6"), TEXT("G#6"), TEXT("A-6"), TEXT("A#6"), TEXT("B-6"), - TEXT("C-7"), TEXT("C#7"), TEXT("D-7"), TEXT("D#7"), TEXT("E-7"), TEXT("F-7"), TEXT("F#7"), TEXT("G-7"), TEXT("G#7"), TEXT("A-7"), TEXT("A#7"), TEXT("B-7"), - TEXT("C-8"), TEXT("C#8"), TEXT("D-8"), TEXT("D#8"), TEXT("E-8"), TEXT("F-8"), TEXT("F#8"), TEXT("G-8"), TEXT("G#8"), TEXT("A-8"), TEXT("A#8"), TEXT("B-8"), - TEXT("C-9"), TEXT("C#9"), TEXT("D-9"), TEXT("D#9"), TEXT("E-9"), TEXT("F-9"), TEXT("F#9"), TEXT("G-9"), TEXT("G#9"), TEXT("A-9"), TEXT("A#9"), TEXT("B-9"), -}; - - TCHAR CTrackApp::m_szExePath[_MAX_PATH] = TEXT(""); ///////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2013-04-22 23:28:46 UTC (rev 1957) +++ trunk/OpenMPT/mptrack/Mptrack.h 2013-04-22 23:37:19 UTC (rev 1958) @@ -345,8 +345,6 @@ /////////////////////////////////////////////////// // Tables -extern const LPCSTR szNoteNames[12]; -extern const LPCTSTR szDefaultNoteNames[NOTE_MAX]; //const LPCTSTR szSpecialNoteNames[] = {TEXT("PCs"), TEXT("PC"), TEXT("~~"), TEXT("^^"), TEXT("==")}; const LPCTSTR szSpecialNoteNames[] = {TEXT("PCs"), TEXT("PC"), TEXT("~~ (Note Fade)"), TEXT("^^ (Note Cut)"), TEXT("== (Note Off)")}; const LPCTSTR szSpecialNoteShortDesc[] = {TEXT("Param Control (Smooth)"), TEXT("Param Control"), TEXT("Note Fade"), TEXT("Note Cut"), TEXT("Note Off")}; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-22 23:28:46 UTC (rev 1957) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-22 23:37:19 UTC (rev 1958) @@ -769,6 +769,10 @@ #pragma warning(default : 4324) //structure was padded due to __declspec(align()) +extern const LPCSTR szNoteNames[12]; +extern const LPCTSTR szDefaultNoteNames[NOTE_MAX]; + + inline IMixPlugin* CSoundFile::GetInstrumentPlugin(INSTRUMENTINDEX instr) //----------------------------------------------------------------------- { Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2013-04-22 23:28:46 UTC (rev 1957) +++ trunk/OpenMPT/soundlib/Tables.cpp 2013-04-22 23:37:19 UTC (rev 1958) @@ -20,6 +20,29 @@ // end rewbs.resamplerConf +///////////////////////////////////////////////////////////////////////////// +// Common Tables + +const LPCSTR szNoteNames[12] = +{ + "C-", "C#", "D-", "D#", "E-", "F-", + "F#", "G-", "G#", "A-", "A#", "B-" +}; + +const LPCTSTR szDefaultNoteNames[NOTE_MAX] = { + TEXT("C-0"), TEXT("C#0"), TEXT("D-0"), TEXT("D#0"), TEXT("E-0"), TEXT("F-0"), TEXT("F#0"), TEXT("G-0"), TEXT("G#0"), TEXT("A-0"), TEXT("A#0"), TEXT("B-0"), + TEXT("C-1"), TEXT("C#1"), TEXT("D-1"), TEXT("D#1"), TEXT("E-1"), TEXT("F-1"), TEXT("F#1"), TEXT("G-1"), TEXT("G#1"), TEXT("A-1"), TEXT("A#1"), TEXT("B-1"), + TEXT("C-2"), TEXT("C#2"), TEXT("D-2"), TEXT("D#2"), TEXT("E-2"), TEXT("F-2"), TEXT("F#2"), TEXT("G-2"), TEXT("G#2"), TEXT("A-2"), TEXT("A#2"), TEXT("B-2"), + TEXT("C-3"), TEXT("C#3"), TEXT("D-3"), TEXT("D#3"), TEXT("E-3"), TEXT("F-3"), TEXT("F#3"), TEXT("G-3"), TEXT("G#3"), TEXT("A-3"), TEXT("A#3"), TEXT("B-3"), + TEXT("C-4"), TEXT("C#4"), TEXT("D-4"), TEXT("D#4"), TEXT("E-4"), TEXT("F-4"), TEXT("F#4"), TEXT("G-4"), TEXT("G#4"), TEXT("A-4"), TEXT("A#4"), TEXT("B-4"), + TEXT("C-5"), TEXT("C#5"), TEXT("D-5"), TEXT("D#5"), TEXT("E-5"), TEXT("F-5"), TEXT("F#5"), TEXT("G-5"), TEXT("G#5"), TEXT("A-5"), TEXT("A#5"), TEXT("B-5"), + TEXT("C-6"), TEXT("C#6"), TEXT("D-6"), TEXT("D#6"), TEXT("E-6"), TEXT("F-6"), TEXT("F#6"), TEXT("G-6"), TEXT("G#6"), TEXT("A-6"), TEXT("A#6"), TEXT("B-6"), + TEXT("C-7"), TEXT("C#7"), TEXT("D-7"), TEXT("D#7"), TEXT("E-7"), TEXT("F-7"), TEXT("F#7"), TEXT("G-7"), TEXT("G#7"), TEXT("A-7"), TEXT("A#7"), TEXT("B-7"), + TEXT("C-8"), TEXT("C#8"), TEXT("D-8"), TEXT("D#8"), TEXT("E-8"), TEXT("F-8"), TEXT("F#8"), TEXT("G-8"), TEXT("G#8"), TEXT("A-8"), TEXT("A#8"), TEXT("B-8"), + TEXT("C-9"), TEXT("C#9"), TEXT("D-9"), TEXT("D#9"), TEXT("E-9"), TEXT("F-9"), TEXT("F#9"), TEXT("G-9"), TEXT("G#9"), TEXT("A-9"), TEXT("A#9"), TEXT("B-9"), +}; + + /////////////////////////////////////////////////////////// // File Formats Information (name, extension, etc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-23 20:00:42
|
Revision: 1962 http://sourceforge.net/p/modplug/code/1962 Author: manxorist Date: 2013-04-23 20:00:30 +0000 (Tue, 23 Apr 2013) Log Message: ----------- [Ref] Pure search and replace all of _T(x), _TEXT(x), __TEXT(x), T(x), TEXT(x) in common/ and soundlib/ with our own MPT_TEXT(x) which can safely be defined on other platform without conflicting with existing windows headers or platform or compiler specific namespaces. Modified Paths: -------------- trunk/OpenMPT/common/serialization_utils.cpp trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_mo3.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/MIDIMacros.cpp trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Tables.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.cpp trunk/OpenMPT/soundlib/tuningCollection.cpp trunk/OpenMPT/soundlib/tuningbase.cpp Modified: trunk/OpenMPT/common/serialization_utils.cpp =================================================================== --- trunk/OpenMPT/common/serialization_utils.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/common/serialization_utils.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -200,23 +200,23 @@ int32 Ssb::s_DefaultWriteLogMask = SNT_DEFAULT_MASK; Ssb::fpLogFunc_t Ssb::s_DefaultLogFunc = nullptr; -const TCHAR tstrWriteHeader[] = TEXT("Write header with ID = %s\n"); -const TCHAR tstrWriteProgress[] = TEXT("Wrote entry: {num, id, rpos, size} = {%u, %s, %u, %u}\n"); -const TCHAR tstrWritingMap[] = TEXT("Writing map to rpos: %u\n"); -const TCHAR tstrMapEntryWrite[] = TEXT("Writing map entry: id=%s, rpos=%u, size=%u\n"); -const TCHAR strWriteNote[] = TEXT("Write note: "); -const TCHAR tstrEndOfStream[] = TEXT("End of stream(rpos): %u\n"); +const TCHAR tstrWriteHeader[] = MPT_TEXT("Write header with ID = %s\n"); +const TCHAR tstrWriteProgress[] = MPT_TEXT("Wrote entry: {num, id, rpos, size} = {%u, %s, %u, %u}\n"); +const TCHAR tstrWritingMap[] = MPT_TEXT("Writing map to rpos: %u\n"); +const TCHAR tstrMapEntryWrite[] = MPT_TEXT("Writing map entry: id=%s, rpos=%u, size=%u\n"); +const TCHAR strWriteNote[] = MPT_TEXT("Write note: "); +const TCHAR tstrEndOfStream[] = MPT_TEXT("End of stream(rpos): %u\n"); -const TCHAR tstrReadingHeader[] = TEXT("Read header with expected ID = %s\n"); -const TCHAR strNoMapInFile[] = TEXT("No map in the file.\n"); -const TCHAR strIdMismatch[] = TEXT("ID mismatch, terminating read.\n"); -const TCHAR strIdMatch[] = TEXT("ID match, continuing reading.\n"); -const TCHAR tstrReadingMap[] = TEXT("Reading map from rpos: %u\n"); -const TCHAR tstrEndOfMap[] = TEXT("End of map(rpos): %u\n"); -const TCHAR tstrReadProgress[] = TEXT("Read entry: {num, id, rpos, size, desc} = {%u, %s, %u, %s, %s}\n"); -const TCHAR tstrNoEntryFound[] = TEXT("No entry with id %s found.\n"); -const TCHAR tstrCantFindSubEntry[] = TEXT("Unable to find subentry with id=%s\n"); -const TCHAR strReadNote[] = TEXT("Read note: "); +const TCHAR tstrReadingHeader[] = MPT_TEXT("Read header with expected ID = %s\n"); +const TCHAR strNoMapInFile[] = MPT_TEXT("No map in the file.\n"); +const TCHAR strIdMismatch[] = MPT_TEXT("ID mismatch, terminating read.\n"); +const TCHAR strIdMatch[] = MPT_TEXT("ID match, continuing reading.\n"); +const TCHAR tstrReadingMap[] = MPT_TEXT("Reading map from rpos: %u\n"); +const TCHAR tstrEndOfMap[] = MPT_TEXT("End of map(rpos): %u\n"); +const TCHAR tstrReadProgress[] = MPT_TEXT("Read entry: {num, id, rpos, size, desc} = {%u, %s, %u, %s, %s}\n"); +const TCHAR tstrNoEntryFound[] = MPT_TEXT("No entry with id %s found.\n"); +const TCHAR tstrCantFindSubEntry[] = MPT_TEXT("Unable to find subentry with id=%s\n"); +const TCHAR strReadNote[] = MPT_TEXT("Read note: "); #define SSB_INITIALIZATION_LIST \ Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/common/typedefs.h 2013-04-23 20:00:30 UTC (rev 1962) @@ -221,7 +221,13 @@ //To mark string that should be translated in case of multilingual version. #define GetStrI18N(x) (x) +#if defined(WIN32) || defined(_WIN32) +#define MPT_TEXT(x) _T(x) +#else +#define MPT_TEXT(x) x +#endif + #ifndef NO_LOGGING void Log(const char *format, ...); class Logger Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -22,12 +22,12 @@ #include "../common/version.h" #include "ITTools.h" -#define str_tooMuchPatternData (GetStrI18N((_TEXT("Warning: File format limit was reached. Some pattern data may not get written to file.")))) -#define str_pattern (GetStrI18N((_TEXT("pattern")))) -#define str_PatternSetTruncationNote (GetStrI18N((_TEXT("The module contains %u patterns but only %u patterns can be loaded in this OpenMPT version.")))) -#define str_SequenceTruncationNote (GetStrI18N((_TEXT("Module has sequence of length %u; it will be truncated to maximum supported length, %u.")))) -#define str_LoadingIncompatibleVersion TEXT("The file informed that it is incompatible with this version of OpenMPT. Loading was terminated.") -#define str_LoadingMoreRecentVersion TEXT("The loaded file was made with a more recent OpenMPT version and this version may not be able to load all the features or play the file correctly.") +#define str_tooMuchPatternData (GetStrI18N((MPT_TEXT("Warning: File format limit was reached. Some pattern data may not get written to file.")))) +#define str_pattern (GetStrI18N((MPT_TEXT("pattern")))) +#define str_PatternSetTruncationNote (GetStrI18N((MPT_TEXT("The module contains %u patterns but only %u patterns can be loaded in this OpenMPT version.")))) +#define str_SequenceTruncationNote (GetStrI18N((MPT_TEXT("Module has sequence of length %u; it will be truncated to maximum supported length, %u.")))) +#define str_LoadingIncompatibleVersion MPT_TEXT("The file informed that it is incompatible with this version of OpenMPT. Loading was terminated.") +#define str_LoadingMoreRecentVersion MPT_TEXT("The loaded file was made with a more recent OpenMPT version and this version may not be able to load all the features or play the file correctly.") const uint16 verMptFileVer = 0x891; const uint16 verMptFileVerLoadLimit = 0x1000; // If cwtv-field is greater or equal to this value, Modified: trunk/OpenMPT/soundlib/Load_mo3.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mo3.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/Load_mo3.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -38,7 +38,7 @@ return false; } - AddToLog(GetStrI18N(_TEXT("The file appears to be a MO3 file, but this OpenMPT build does not support loading MO3 files."))); + AddToLog(GetStrI18N(MPT_TEXT("The file appears to be a MO3 file, but this OpenMPT build does not support loading MO3 files."))); return false; #else @@ -49,14 +49,14 @@ #ifdef MODPLUG_TRACKER CHAR szPath[MAX_PATH]; strcpy(szPath, theApp.GetAppDirPath()); - _tcsncat(szPath, _TEXT("unmo3.dll"), MAX_PATH - (_tcslen(szPath) + 1)); + _tcsncat(szPath, MPT_TEXT("unmo3.dll"), MAX_PATH - (_tcslen(szPath) + 1)); HMODULE unmo3 = LoadLibrary(szPath); #else - HMODULE unmo3 = LoadLibrary(_TEXT("unmo3.dll")); + HMODULE unmo3 = LoadLibrary(MPT_TEXT("unmo3.dll")); #endif // MODPLUG_TRACKER if(unmo3 == nullptr) // Didn't succeed. { - AddToLog(GetStrI18N(_TEXT("Loading MO3 file failed because unmo3.dll could not be loaded."))); + AddToLog(GetStrI18N(MPT_TEXT("Loading MO3 file failed because unmo3.dll could not be loaded."))); } else // case: dll loaded succesfully. { Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -553,8 +553,8 @@ #ifndef MODPLUG_NO_FILESAVE -#define str_tooMuchPatternData (GetStrI18N((_TEXT("Warning: File format limit was reached. Some pattern data may not get written to file.")))) -#define str_pattern (GetStrI18N((_TEXT("pattern")))) +#define str_tooMuchPatternData (GetStrI18N((MPT_TEXT("Warning: File format limit was reached. Some pattern data may not get written to file.")))) +#define str_pattern (GetStrI18N((MPT_TEXT("pattern")))) bool CSoundFile::SaveXM(LPCSTR lpszFileName, bool compatibilityExport) Modified: trunk/OpenMPT/soundlib/MIDIMacros.cpp =================================================================== --- trunk/OpenMPT/soundlib/MIDIMacros.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/MIDIMacros.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -188,23 +188,23 @@ } if (paramName.IsEmpty()) { - return _T("N/A"); + return MPT_TEXT("N/A"); } CString formattedName; - formattedName.Format(_T("Param %d (%s)"), param, paramName); + formattedName.Format(MPT_TEXT("Param %d (%s)"), param, paramName); return formattedName; } else #endif // NO_VST { - return _T("N/A - No Plugin"); + return MPT_TEXT("N/A - No Plugin"); } } case sfx_cc: { CString formattedCC; - formattedCC.Format(_T("MIDI CC %d"), MacroToMidiCC(macroIndex)); + formattedCC.Format(MPT_TEXT("MIDI CC %d"), MacroToMidiCC(macroIndex)); return formattedCC; } @@ -221,26 +221,26 @@ switch(macroType) { case sfx_unused: - return _T("Unused"); + return MPT_TEXT("Unused"); case sfx_cutoff: - return _T("Set Filter Cutoff"); + return MPT_TEXT("Set Filter Cutoff"); case sfx_reso: - return _T("Set Filter Resonance"); + return MPT_TEXT("Set Filter Resonance"); case sfx_mode: - return _T("Set Filter Mode"); + return MPT_TEXT("Set Filter Mode"); case sfx_drywet: - return _T("Set Plugin Dry/Wet Ratio"); + return MPT_TEXT("Set Plugin Dry/Wet Ratio"); case sfx_plug: - return _T("Control Plugin Parameter..."); + return MPT_TEXT("Control Plugin Parameter..."); case sfx_cc: - return _T("MIDI CC..."); + return MPT_TEXT("MIDI CC..."); case sfx_channelAT: - return _T("Channel Aftertouch"); + return MPT_TEXT("Channel Aftertouch"); case sfx_polyAT: - return _T("Polyphonic Aftertouch"); + return MPT_TEXT("Polyphonic Aftertouch"); case sfx_custom: default: - return _T("Custom"); + return MPT_TEXT("Custom"); } } @@ -252,24 +252,24 @@ switch(macroType) { case zxx_unused: - return _T("Unused"); + return MPT_TEXT("Unused"); case zxx_reso4Bit: - return _T("Z80 - Z8F controls Resonant Filter Resonance"); + return MPT_TEXT("Z80 - Z8F controls Resonant Filter Resonance"); case zxx_reso7Bit: - return _T("Z80 - ZFF controls Resonant Filter Resonance"); + return MPT_TEXT("Z80 - ZFF controls Resonant Filter Resonance"); case zxx_cutoff: - return _T("Z80 - ZFF controls Resonant Filter Cutoff"); + return MPT_TEXT("Z80 - ZFF controls Resonant Filter Cutoff"); case zxx_mode: - return _T("Z80 - ZFF controls Resonant Filter Mode"); + return MPT_TEXT("Z80 - ZFF controls Resonant Filter Mode"); case zxx_resomode: - return _T("Z80 - Z9F controls Resonance + Filter Mode"); + return MPT_TEXT("Z80 - Z9F controls Resonance + Filter Mode"); case zxx_channelAT: - return _T("Z80 - ZFF controls Channel Aftertouch"); + return MPT_TEXT("Z80 - ZFF controls Channel Aftertouch"); case zxx_polyAT: - return _T("Z80 - ZFF controls Polyphonic Aftertouch"); + return MPT_TEXT("Z80 - ZFF controls Polyphonic Aftertouch"); case zxx_custom: default: - return _T("Custom"); + return MPT_TEXT("Custom"); } } Modified: trunk/OpenMPT/soundlib/ModSequence.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModSequence.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/ModSequence.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -20,7 +20,7 @@ #include "FileReader.h" #include <functional> -#define str_SequenceTruncationNote (GetStrI18N((_TEXT("Module has sequence of length %u; it will be truncated to maximum supported length, %u.")))) +#define str_SequenceTruncationNote (GetStrI18N((MPT_TEXT("Module has sequence of length %u; it will be truncated to maximum supported length, %u.")))) #if defined(MODPLUG_TRACKER) #ifdef _DEBUG Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -2389,7 +2389,7 @@ const CString path = CString(theApp.GetAppDirPath()) + "libmpg123-0.dll"; mp3lib = LoadLibrary(path); #else - mp3lib = LoadLibrary(_TEXT("libmpg123-0.dll")); + mp3lib = LoadLibrary(MPT_TEXT("libmpg123-0.dll")); #endif // MODPLUG_TRACKER } if(!mp3lib) return false; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -1208,7 +1208,7 @@ //--------------------------------------------------------------------- { if((nInstr >= MAX_INSTRUMENTS) || (!Instruments[nInstr])) - return TEXT(""); + return MPT_TEXT(""); ASSERT(nInstr <= GetNumInstruments()); return Instruments[nInstr]->name; @@ -1514,7 +1514,7 @@ const char* pData = nullptr; HGLOBAL hglob = nullptr; size_t nSize = 0; - if (LoadResource(MAKEINTRESOURCE(IDR_BUILTIN_TUNINGS), TEXT("TUNING"), pData, nSize, hglob) != nullptr) + if (LoadResource(MAKEINTRESOURCE(IDR_BUILTIN_TUNINGS), MPT_TEXT("TUNING"), pData, nSize, hglob) != nullptr) { std::istrstream iStrm(pData, nSize); s_pTuningsSharedBuiltIn->Deserialize(iStrm); Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/Tables.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -30,16 +30,16 @@ }; const LPCTSTR szDefaultNoteNames[NOTE_MAX] = { - TEXT("C-0"), TEXT("C#0"), TEXT("D-0"), TEXT("D#0"), TEXT("E-0"), TEXT("F-0"), TEXT("F#0"), TEXT("G-0"), TEXT("G#0"), TEXT("A-0"), TEXT("A#0"), TEXT("B-0"), - TEXT("C-1"), TEXT("C#1"), TEXT("D-1"), TEXT("D#1"), TEXT("E-1"), TEXT("F-1"), TEXT("F#1"), TEXT("G-1"), TEXT("G#1"), TEXT("A-1"), TEXT("A#1"), TEXT("B-1"), - TEXT("C-2"), TEXT("C#2"), TEXT("D-2"), TEXT("D#2"), TEXT("E-2"), TEXT("F-2"), TEXT("F#2"), TEXT("G-2"), TEXT("G#2"), TEXT("A-2"), TEXT("A#2"), TEXT("B-2"), - TEXT("C-3"), TEXT("C#3"), TEXT("D-3"), TEXT("D#3"), TEXT("E-3"), TEXT("F-3"), TEXT("F#3"), TEXT("G-3"), TEXT("G#3"), TEXT("A-3"), TEXT("A#3"), TEXT("B-3"), - TEXT("C-4"), TEXT("C#4"), TEXT("D-4"), TEXT("D#4"), TEXT("E-4"), TEXT("F-4"), TEXT("F#4"), TEXT("G-4"), TEXT("G#4"), TEXT("A-4"), TEXT("A#4"), TEXT("B-4"), - TEXT("C-5"), TEXT("C#5"), TEXT("D-5"), TEXT("D#5"), TEXT("E-5"), TEXT("F-5"), TEXT("F#5"), TEXT("G-5"), TEXT("G#5"), TEXT("A-5"), TEXT("A#5"), TEXT("B-5"), - TEXT("C-6"), TEXT("C#6"), TEXT("D-6"), TEXT("D#6"), TEXT("E-6"), TEXT("F-6"), TEXT("F#6"), TEXT("G-6"), TEXT("G#6"), TEXT("A-6"), TEXT("A#6"), TEXT("B-6"), - TEXT("C-7"), TEXT("C#7"), TEXT("D-7"), TEXT("D#7"), TEXT("E-7"), TEXT("F-7"), TEXT("F#7"), TEXT("G-7"), TEXT("G#7"), TEXT("A-7"), TEXT("A#7"), TEXT("B-7"), - TEXT("C-8"), TEXT("C#8"), TEXT("D-8"), TEXT("D#8"), TEXT("E-8"), TEXT("F-8"), TEXT("F#8"), TEXT("G-8"), TEXT("G#8"), TEXT("A-8"), TEXT("A#8"), TEXT("B-8"), - TEXT("C-9"), TEXT("C#9"), TEXT("D-9"), TEXT("D#9"), TEXT("E-9"), TEXT("F-9"), TEXT("F#9"), TEXT("G-9"), TEXT("G#9"), TEXT("A-9"), TEXT("A#9"), TEXT("B-9"), + MPT_TEXT("C-0"), MPT_TEXT("C#0"), MPT_TEXT("D-0"), MPT_TEXT("D#0"), MPT_TEXT("E-0"), MPT_TEXT("F-0"), MPT_TEXT("F#0"), MPT_TEXT("G-0"), MPT_TEXT("G#0"), MPT_TEXT("A-0"), MPT_TEXT("A#0"), MPT_TEXT("B-0"), + MPT_TEXT("C-1"), MPT_TEXT("C#1"), MPT_TEXT("D-1"), MPT_TEXT("D#1"), MPT_TEXT("E-1"), MPT_TEXT("F-1"), MPT_TEXT("F#1"), MPT_TEXT("G-1"), MPT_TEXT("G#1"), MPT_TEXT("A-1"), MPT_TEXT("A#1"), MPT_TEXT("B-1"), + MPT_TEXT("C-2"), MPT_TEXT("C#2"), MPT_TEXT("D-2"), MPT_TEXT("D#2"), MPT_TEXT("E-2"), MPT_TEXT("F-2"), MPT_TEXT("F#2"), MPT_TEXT("G-2"), MPT_TEXT("G#2"), MPT_TEXT("A-2"), MPT_TEXT("A#2"), MPT_TEXT("B-2"), + MPT_TEXT("C-3"), MPT_TEXT("C#3"), MPT_TEXT("D-3"), MPT_TEXT("D#3"), MPT_TEXT("E-3"), MPT_TEXT("F-3"), MPT_TEXT("F#3"), MPT_TEXT("G-3"), MPT_TEXT("G#3"), MPT_TEXT("A-3"), MPT_TEXT("A#3"), MPT_TEXT("B-3"), + MPT_TEXT("C-4"), MPT_TEXT("C#4"), MPT_TEXT("D-4"), MPT_TEXT("D#4"), MPT_TEXT("E-4"), MPT_TEXT("F-4"), MPT_TEXT("F#4"), MPT_TEXT("G-4"), MPT_TEXT("G#4"), MPT_TEXT("A-4"), MPT_TEXT("A#4"), MPT_TEXT("B-4"), + MPT_TEXT("C-5"), MPT_TEXT("C#5"), MPT_TEXT("D-5"), MPT_TEXT("D#5"), MPT_TEXT("E-5"), MPT_TEXT("F-5"), MPT_TEXT("F#5"), MPT_TEXT("G-5"), MPT_TEXT("G#5"), MPT_TEXT("A-5"), MPT_TEXT("A#5"), MPT_TEXT("B-5"), + MPT_TEXT("C-6"), MPT_TEXT("C#6"), MPT_TEXT("D-6"), MPT_TEXT("D#6"), MPT_TEXT("E-6"), MPT_TEXT("F-6"), MPT_TEXT("F#6"), MPT_TEXT("G-6"), MPT_TEXT("G#6"), MPT_TEXT("A-6"), MPT_TEXT("A#6"), MPT_TEXT("B-6"), + MPT_TEXT("C-7"), MPT_TEXT("C#7"), MPT_TEXT("D-7"), MPT_TEXT("D#7"), MPT_TEXT("E-7"), MPT_TEXT("F-7"), MPT_TEXT("F#7"), MPT_TEXT("G-7"), MPT_TEXT("G#7"), MPT_TEXT("A-7"), MPT_TEXT("A#7"), MPT_TEXT("B-7"), + MPT_TEXT("C-8"), MPT_TEXT("C#8"), MPT_TEXT("D-8"), MPT_TEXT("D#8"), MPT_TEXT("E-8"), MPT_TEXT("F-8"), MPT_TEXT("F#8"), MPT_TEXT("G-8"), MPT_TEXT("G#8"), MPT_TEXT("A-8"), MPT_TEXT("A#8"), MPT_TEXT("B-8"), + MPT_TEXT("C-9"), MPT_TEXT("C#9"), MPT_TEXT("D-9"), MPT_TEXT("D#9"), MPT_TEXT("E-9"), MPT_TEXT("F-9"), MPT_TEXT("F#9"), MPT_TEXT("G-9"), MPT_TEXT("G#9"), MPT_TEXT("A-9"), MPT_TEXT("A#9"), MPT_TEXT("B-9"), }; Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -73,7 +73,7 @@ memcpy(pNewSmp, smp.pSample, nOldBytes); } else - sndFile.AddToLog(LogNotification, TEXT("Unsupported start position in InsertSilence.")); + sndFile.AddToLog(LogNotification, MPT_TEXT("Unsupported start position in InsertSilence.")); } // Set loop points automatically Modified: trunk/OpenMPT/soundlib/tuningCollection.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuningCollection.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/tuningCollection.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -28,7 +28,7 @@ using namespace std; -const TCHAR CTuningCollection::s_FileExtension[4] = TEXT(".tc"); +const TCHAR CTuningCollection::s_FileExtension[4] = MPT_TEXT(".tc"); namespace CTuningS11n { Modified: trunk/OpenMPT/soundlib/tuningbase.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuningbase.cpp 2013-04-23 19:33:33 UTC (rev 1961) +++ trunk/OpenMPT/soundlib/tuningbase.cpp 2013-04-23 20:00:30 UTC (rev 1962) @@ -51,7 +51,7 @@ const TYPENAME CTUNINGBASE::SERIALIZATION_RETURN_TYPE CTUNINGBASE::SERIALIZATION_FAILURE = true; TEMPLATEDEC -const TCHAR CTUNINGBASE::s_FileExtension[5] = TEXT(".tun"); +const TCHAR CTUNINGBASE::s_FileExtension[5] = MPT_TEXT(".tun"); TEMPLATEDEC const TYPENAME CTUNINGBASE::EDITMASK CTUNINGBASE::EM_RATIOS = 1; //1b This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-24 13:53:15
|
Revision: 1963 http://sourceforge.net/p/modplug/code/1963 Author: manxorist Date: 2013-04-24 13:53:05 +0000 (Wed, 24 Apr 2013) Log Message: ----------- [Ref] Move contact and credits string from mptrack/Mptrack.cpp to common/version.cpp and only give credit for code or help that is actually used in the current build. Modified Paths: -------------- trunk/OpenMPT/common/mptString.h trunk/OpenMPT/common/version.cpp trunk/OpenMPT/common/version.h trunk/OpenMPT/mptrack/Mptrack.cpp Modified: trunk/OpenMPT/common/mptString.h =================================================================== --- trunk/OpenMPT/common/mptString.h 2013-04-23 20:00:30 UTC (rev 1962) +++ trunk/OpenMPT/common/mptString.h 2013-04-24 13:53:05 UTC (rev 1963) @@ -68,3 +68,14 @@ }; } + +inline std::string string_replace(std::string str, const std::string &oldStr, const std::string &newStr) +{ + std::size_t pos = 0; + while((pos = str.find(oldStr, pos)) != std::string::npos) + { + str.replace(pos, oldStr.length(), newStr); + pos += newStr.length(); + } + return str; +} Modified: trunk/OpenMPT/common/version.cpp =================================================================== --- trunk/OpenMPT/common/version.cpp 2013-04-23 20:00:30 UTC (rev 1962) +++ trunk/OpenMPT/common/version.cpp 2013-04-24 13:53:05 UTC (rev 1963) @@ -136,4 +136,104 @@ return str.str(); } +std::string GetContactString() +{ + return "Contact / Discussion:\n" + "http://forum.openmpt.org/\n" + "\n" + "Updates:\n" + "http://openmpt.org/download"; +} + +std::string GetFullCreditsString() +{ + return +#ifdef MODPLUG_TRACKER + "OpenMPT / ModPlug Tracker\n" +#else + "libopenmpt (based on OpenMPT / ModPlug Tracker)\n" +#endif + "Copyright \xA9 2004-2013 Contributors\n" + "Copyright \xA9 1997-2003 Olivier Lapicque\n" + "\n" + "Contributors:\n" + "Johannes Schultz (2008-2013)\n" + "Ahti Lepp\xE4nen (2005-2011, 2013)\n" + "Joern Heusipp (2012-2013)\n" + "Robin Fernandes (2004-2007)\n" + "Sergiy Pylypenko (2007)\n" + "Eric Chavanon (2004-2005)\n" + "Trevor Nunes (2004)\n" + "Olivier Lapicque (1997-2003)\n" + "\n" + "Additional patch submitters:\n" + "coda (http://coda.s3m.us/)\n" + "kode54 (http://kode54.foobar2000.org/)\n" + "xaimus (http://xaimus.com/)\n" + "\n" + "Thanks to:\n" + "\n" + "Konstanty for the XMMS-ModPlug resampling implementation\n" + "http://modplug-xmms.sourceforge.net/\n" +#ifdef MODPLUG_TRACKER + "Stephan M. Bernsee for pitch shifting source code\n" + "http://www.dspdimension.com/\n" +#endif +#ifdef MODPLUG_TRACKER + "Olli Parviainen for SoundTouch Library (time stretching)\n" + "http://www.surina.net/soundtouch/\n" +#endif +#ifndef NO_VST + "Hermann Seib for his example VST Host implementation\n" + "http://www.hermannseib.com/english/vsthost.htm\n" +#endif +#ifndef NO_MO3 + "Ian Luck for UNMO3\n" + "http://www.un4seen.com/mo3.html\n" +#endif + "Ben \"GreaseMonkey\" Russell for IT sample compression code\n" + "https://github.com/iamgreaser/it2everything/\n" + "Jean-loup Gailly and Mark Adler for zlib\n" + "http://zlib.net/\n" +#ifndef NO_PORTAUDIO + "PortAudio contributors\n" + "http://www.portaudio.com/\n" +#endif +#ifndef NO_FLAC + "Josh Coalson for libFLAC\n" + "http://flac.sourceforge.net/\n" +#endif +#ifndef NO_MP3_SAMPLES + "The mpg123 project for libmpg123\n" + "http://mpg123.de/\n" +#endif + "Storlek for all the IT compatibility hints and testcases\n" + "as well as the IMF, OKT and ULT loaders\n" + "http://schismtracker.org/\n" +#ifdef MODPLUG_TRACKER + "Pel K. Txnder for the scrolling credits control :)\n" + "http://tinyurl.com/4yze8\n" +#endif + "\n" + "The people at ModPlug forums for crucial contribution\n" + "in the form of ideas, testing and support; thanks\n" + "particularly to:\n" + "33, Anboi, BooT-SectoR-ViruZ, Bvanoudtshoorn\n" + "christofori, Diamond, Ganja, Georg, Goor00, jmkz,\n" + "KrazyKatz, LPChip, Nofold, Rakib, Sam Zen\n" + "Skaven, Skilletaudio, Snu, Squirrel Havoc, Waxhead\n" + "\n" +#ifndef NO_VST + "\n" + "VST PlugIn Technology by Steinberg Media Technologies GmbH\n" +#endif +#ifndef NO_ASIO + "\n" + "ASIO Technology by Steinberg Media Technologies GmbH\n" +#endif + "\n" + ; + +} + } // namespace MptVersion Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-04-23 20:00:30 UTC (rev 1962) +++ trunk/OpenMPT/common/version.h 2013-04-24 13:53:05 UTC (rev 1963) @@ -96,4 +96,7 @@ std::string GetVersionStringExtended(); std::string GetVersionUrlString(); + std::string GetFullCreditsString(); + std::string GetContactString(); + }; //namespace MptVersion Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-23 20:00:30 UTC (rev 1962) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2013-04-24 13:53:05 UTC (rev 1963) @@ -1520,75 +1520,9 @@ m_bmp.LoadBitmap(MAKEINTRESOURCE(IDB_MPTRACK)); SetDlgItemText(IDC_EDIT2, CString("Build Date: ") + MptVersion::GetBuildDateString().c_str()); SetDlgItemText(IDC_EDIT3, CString("OpenMPT ") + MptVersion::GetVersionStringExtended().c_str()); - - m_heContact.SetWindowText( - "Contact / Discussion:\r\n" - "http://forum.openmpt.org/\r\n" - "\r\nUpdates:\r\n" - "http://openmpt.org/download"); - - static const char* const pArrCredit = - { - "OpenMPT / ModPlug Tracker|" - "Copyright \xA9 2004-2013 Contributors|" - "Copyright \xA9 1997-2003 Olivier Lapicque|" - "|" - "Contributors:|" - "Johannes Schultz (2008-2013)|" - "Ahti Lepp\xE4nen (2005-2011, 2013)|" - "Joern Heusipp (2012-2013)|" - "Robin Fernandes (2004-2007)|" - "Sergiy Pylypenko (2007)|" - "Eric Chavanon (2004-2005)|" - "Trevor Nunes (2004)|" - "Olivier Lapicque (1997-2003)|" - "|" - "Additional patch submitters:|" - "coda (http://coda.s3m.us/)|" - "kode54 (http://kode54.foobar2000.org/)|" - "xaimus (http://xaimus.com/)|" - "|" - "Thanks to:||" - "Konstanty for the XMMS-ModPlug resampling implementation |" - "http://modplug-xmms.sourceforge.net/|" - "Stephan M. Bernsee for pitch shifting source code|" - "http://www.dspdimension.com/|" - "Olli Parviainen for SoundTouch Library (time stretching)|" - "http://www.surina.net/soundtouch/|" - "Hermann Seib for his example VST Host implementation|" - "http://www.hermannseib.com/english/vsthost.htm|" - "Ian Luck for UNMO3|" - "http://www.un4seen.com/mo3.html|" - "Ben \"GreaseMonkey\" Russell for IT sample compression code|" - "https://github.com/iamgreaser/it2everything/|" - "Jean-loup Gailly and Mark Adler for zlib|" - "http://zlib.net/|" - "PortAudio|" - "http://www.portaudio.com/|" - "Josh Coalson for libFLAC|" - "http://flac.sourceforge.net/|" - "The mpg123 project for libmpg123|" - "http://mpg123.de/|" - "Storlek for all the IT compatibility hints and testcases|" - "as well as the IMF, OKT and ULT loaders|" - "http://schismtracker.org/|" - "Pel K. Txnder for the scrolling credits control :)|" - "http://tinyurl.com/4yze8|" - "|The people at ModPlug forums for crucial contribution|" - "in the form of ideas, testing and support; thanks|" - "particularly to:|" - "33, Anboi, BooT-SectoR-ViruZ, Bvanoudtshoorn|" - "christofori, Diamond, Ganja, Georg, Goor00, jmkz,|" - "KrazyKatz, LPChip, Nofold, Rakib, Sam Zen|" - "Skaven, Skilletaudio, Snu, Squirrel Havoc, Waxhead|" - "|||||||" - "VST PlugIn Technology by Steinberg Media Technologies GmbH|" - "ASIO Technology by Steinberg Media Technologies GmbH|" - "||||||" - }; - + m_heContact.SetWindowText( string_replace(MptVersion::GetContactString(), "\n", "\r\n" ).c_str()); m_static.SubclassDlgItem(IDC_CREDITS,this); - m_static.SetCredits(pArrCredit); + m_static.SetCredits((string_replace(MptVersion::GetFullCreditsString(), "\n", "|") + "||||||").c_str()); m_static.SetSpeed(DISPLAY_SLOW); m_static.SetColor(BACKGROUND_COLOR, RGB(138, 165, 219)); // Background Colour m_static.SetTransparent(); // Set parts of bitmaps with RGB(192,192,192) transparent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-24 16:17:41
|
Revision: 1964 http://sourceforge.net/p/modplug/code/1964 Author: manxorist Date: 2013-04-24 16:17:21 +0000 (Wed, 24 Apr 2013) Log Message: ----------- [Ref] Repalce deprecated std::strstream with std::stringstream Modified Paths: -------------- trunk/OpenMPT/common/serialization_utils.cpp trunk/OpenMPT/common/serialization_utils.h trunk/OpenMPT/common/stdafx.h trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/common/serialization_utils.cpp =================================================================== --- trunk/OpenMPT/common/serialization_utils.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/common/serialization_utils.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -875,7 +875,8 @@ { OutStream& oStrm = *m_pOstrm; const Postype posDataEnd = oStrm.tellp(); - if (m_posMapStart != Postype(0) && ((uint32)m_MapStream.pcount() > m_nMapReserveSize)) + std::string mapStreamStr = m_MapStream.str(); + if (m_posMapStart != Postype(0) && ((uint32)mapStreamStr.length() > m_nMapReserveSize)) { AddWriteNote(SNW_INSUFFICIENT_MAPSIZE); return; } if (m_posMapStart < 1) @@ -888,8 +889,7 @@ if (GetFlag(RwfRwHasMap)) //Write map { - oStrm.write(m_MapStream.str(), m_MapStream.pcount()); - m_MapStream.freeze(false); + oStrm.write(mapStreamStr.c_str(), mapStreamStr.length()); } const Postype posMapEnd = oStrm.tellp(); Modified: trunk/OpenMPT/common/serialization_utils.h =================================================================== --- trunk/OpenMPT/common/serialization_utils.h 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/common/serialization_utils.h 2013-04-24 16:17:21 UTC (rev 1964) @@ -11,7 +11,7 @@ #pragma once #include <string> -#include <strstream> +#include <sstream> #include <vector> #include <bitset> #include "../common/misc_util.h" @@ -28,8 +28,8 @@ typedef std::ostream OutStream; typedef std::istream InStream; typedef std::iostream IoStream; -typedef std::istrstream IstrStream; -typedef std::ostrstream OstrStream; +typedef std::istringstream IstrStream; +typedef std::ostringstream OstrStream; typedef OutStream::off_type Offtype; typedef Offtype Postype; typedef std::streamsize Streamsize; Modified: trunk/OpenMPT/common/stdafx.h =================================================================== --- trunk/OpenMPT/common/stdafx.h 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/common/stdafx.h 2013-04-24 16:17:21 UTC (rev 1964) @@ -37,7 +37,7 @@ #include <string> #include <fstream> -#include <strstream> +#include <sstream> Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -1700,7 +1700,7 @@ size_t nSize = 0; if (LoadResource(MAKEINTRESOURCE(IDR_DEFAULT_KEYBINDINGS), TEXT("KEYBINDINGS"), pData, nSize, hglob) != nullptr) { - std::istrstream iStrm(pData, nSize); + std::istringstream iStrm(std::string(pData, nSize)); success = LoadFile(iStrm, TEXT("\"executable resource\"")); FreeResource(hglob); } Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -17,7 +17,6 @@ #include "mainfrm.h" #include <direct.h> #include ".\inputhandler.h" -#include <strstream> #include <Shlwapi.h> #define TRANSITIONBIT 0x8000 Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -1492,7 +1492,7 @@ nSize = file.Read(&data[0], nSize); file.Close(); - std::istrstream iStrm(&data[0], nSize); + std::istringstream iStrm(std::string(&data[0], nSize)); return ImportScl(iStrm, pszName); } Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -27,7 +27,7 @@ #include "../../soundlib/SampleFormatConverters.h" #include <limits> #include <fstream> -#include <strstream> +#include <sstream> #ifdef _DEBUG #define new DEBUG_NEW @@ -1041,7 +1041,7 @@ for(size_t j = 0; j < numCommands[i]; j++, iter++) pat[i][j] = *iter; } - std::strstream mem; + std::stringstream mem; WriteModPatterns(mem, sndFile.Patterns); VERIFY_EQUAL_NONCONT( mem.good(), true ); Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -17,7 +17,7 @@ #endif #include "../common/serialization_utils.h" #include <fstream> -#include <strstream> +#include <sstream> #include <list> #include "../common/version.h" #include "ITTools.h" @@ -913,7 +913,7 @@ const uint16 version = fileHeader.cwtv; if(version > 0x889 && file.Seek(mptStartPos)) { - std::istrstream iStrm(file.GetRawData(), file.BytesLeft()); + std::istringstream iStrm(std::string(file.GetRawData(), file.BytesLeft())); if(version >= 0x88D) { Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -1516,7 +1516,7 @@ size_t nSize = 0; if (LoadResource(MAKEINTRESOURCE(IDR_BUILTIN_TUNINGS), MPT_TEXT("TUNING"), pData, nSize, hglob) != nullptr) { - std::istrstream iStrm(pData, nSize); + std::istringstream iStrm(std::string(pData, nSize)); s_pTuningsSharedBuiltIn->Deserialize(iStrm); FreeResource(hglob); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-24 16:32:11
|
Revision: 1965 http://sourceforge.net/p/modplug/code/1965 Author: manxorist Date: 2013-04-24 16:32:03 +0000 (Wed, 24 Apr 2013) Log Message: ----------- [Ref] <fstream> header is not needed by any header file project wide and is generally only rarely used. Do not drag it in via stdafx.h precompiled header. Modified Paths: -------------- trunk/OpenMPT/common/stdafx.h trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/tuningCollection.cpp trunk/OpenMPT/soundlib/tuningbase.h Modified: trunk/OpenMPT/common/stdafx.h =================================================================== --- trunk/OpenMPT/common/stdafx.h 2013-04-24 16:17:21 UTC (rev 1964) +++ trunk/OpenMPT/common/stdafx.h 2013-04-24 16:32:03 UTC (rev 1965) @@ -36,7 +36,8 @@ #endif // MODPLUG_TRACKER #include <string> -#include <fstream> +#include <istream> +#include <ostream> #include <sstream> Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2013-04-24 16:17:21 UTC (rev 1964) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2013-04-24 16:32:03 UTC (rev 1965) @@ -13,6 +13,7 @@ #include "TuningDialog.h" #include "TrackerSettings.h" #include <algorithm> +#include <fstream> #include "../common/misc_util.h" #include "tuningdialog.h" Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-24 16:17:21 UTC (rev 1964) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-24 16:32:03 UTC (rev 1965) @@ -27,6 +27,7 @@ #include "../common/StringFixer.h" #include "../soundlib/FileReader.h" #include "../soundlib/plugins/JBridge.h" +#include <fstream> #ifdef VST_USE_ALTERNATIVE_MAGIC //Pelya's plugin ID fix. Breaks fx presets, so let's avoid it for now. #define ZLIB_WINAPI #include "../zlib/zlib.h" //For CRC32 calculation (to detect plugins with same UID) Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-24 16:17:21 UTC (rev 1964) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-04-24 16:32:03 UTC (rev 1965) @@ -26,7 +26,8 @@ #include "../../common/serialization_utils.h" #include "../../soundlib/SampleFormatConverters.h" #include <limits> -#include <fstream> +#include <istream> +#include <ostream> #include <sstream> #ifdef _DEBUG Modified: trunk/OpenMPT/soundlib/tuningCollection.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuningCollection.cpp 2013-04-24 16:17:21 UTC (rev 1964) +++ trunk/OpenMPT/soundlib/tuningCollection.cpp 2013-04-24 16:32:03 UTC (rev 1965) @@ -13,6 +13,7 @@ #include "../common/serialization_utils.h" #include <algorithm> #include <bitset> +#include <fstream> /* Version history: Modified: trunk/OpenMPT/soundlib/tuningbase.h =================================================================== --- trunk/OpenMPT/soundlib/tuningbase.h 2013-04-24 16:17:21 UTC (rev 1964) +++ trunk/OpenMPT/soundlib/tuningbase.h 2013-04-24 16:32:03 UTC (rev 1965) @@ -23,7 +23,8 @@ #include <string> #include <vector> #include <cmath> -#include <fstream> +#include <istream> +#include <ostream> #include <map> #include <limits> #include "../common/misc_util.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-25 22:36:00
|
Revision: 1973 http://sourceforge.net/p/modplug/code/1973 Author: saga-games Date: 2013-04-25 22:35:51 +0000 (Thu, 25 Apr 2013) Log Message: ----------- [Fix] Reading song message in 669, AMS, DMF, FAR, ULT and MTM files could lead to crashes (since OpenMPT 1.22.02) [Fix] Reading ZIP files could lead to crashes (since OpenMPT 1.22.02) [Mod] OpenMPT: Version is now 1.22.02.03 Modified Paths: -------------- trunk/OpenMPT/common/version.h trunk/OpenMPT/soundlib/Message.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/unarchiver/unarchiver.cpp trunk/OpenMPT/unarchiver/unarchiver.h Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/common/version.h 2013-04-25 22:35:51 UTC (rev 1973) @@ -21,7 +21,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 22 #define VER_MINOR 02 -#define VER_MINORMINOR 02 +#define VER_MINORMINOR 03 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Message.cpp =================================================================== --- trunk/OpenMPT/soundlib/Message.cpp 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/soundlib/Message.cpp 2013-04-25 22:35:51 UTC (rev 1973) @@ -143,7 +143,7 @@ for(size_t line = 0, fpos = 0, cpos = 0; line < numLines; line++, fpos += (lineLength + lineEndingLength), cpos += (lineLength + 1)) { append(str + fpos, std::min(lineLength, length - fpos)); - at(cpos + lineLength) = InternalLineEnding; + append(1, InternalLineEnding); // fix weird chars for(size_t lpos = 0; lpos < lineLength; lpos++) Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-25 22:35:51 UTC (rev 1973) @@ -607,12 +607,6 @@ m_dwCreatedWithVersion = MptVersion::num; } - // Adjust song / sample names - for(SAMPLEINDEX iSmp = 0; iSmp <= GetNumSamples(); iSmp++) - { - StringFixer::SetNullTerminator(m_szNames[iSmp]); - } - // Adjust channels for(CHANNELINDEX ich = 0; ich < MAX_BASECHANNELS; ich++) { @@ -634,6 +628,9 @@ ModSample *pSmp = Samples; for(SAMPLEINDEX nSmp = 0; nSmp < MAX_SAMPLES; nSmp++, pSmp++) { + // Adjust song / sample names + StringFixer::SetNullTerminator(m_szNames[nSmp]); + if(pSmp->pSample) { pSmp->SanitizeLoops(); @@ -1110,7 +1107,7 @@ void CSoundFile::PatternTranstionChnSolo(const CHANNELINDEX chnIndex) -//------------------------------------------------------------------------- +//------------------------------------------------------------------- { if(chnIndex >= m_nChannels) return; @@ -1124,7 +1121,7 @@ void CSoundFile::PatternTransitionChnUnmuteAll() -//---------------------------------------------------- +//---------------------------------------------- { for(CHANNELINDEX i = 0; i<m_nChannels; i++) { Modified: trunk/OpenMPT/unarchiver/unarchiver.cpp =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver.cpp 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/unarchiver/unarchiver.cpp 2013-04-25 22:35:51 UTC (rev 1973) @@ -13,8 +13,9 @@ #include "../soundlib/FileReader.h" CUnarchiver::CUnarchiver(FileReader &file, const std::vector<const char *> &extensions) : +ext(extensions), inFile(file), -zipArchive(inFile, extensions), +zipArchive(inFile, ext), rarArchive((LPBYTE)inFile.GetRawData(), inFile.GetLength()), lhaArchive((LPBYTE)inFile.GetRawData(), inFile.GetLength()), gzipArchive(inFile) Modified: trunk/OpenMPT/unarchiver/unarchiver.h =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver.h 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/unarchiver/unarchiver.h 2013-04-25 22:35:51 UTC (rev 1973) @@ -35,6 +35,7 @@ { protected: FileReader inFile; + const std::vector<const char *> ext; private: CZipArchive zipArchive; @@ -52,6 +53,6 @@ bool ExtractFile(); const char *GetComments(bool get); - CUnarchiver(FileReader &file, const std::vector<const char *> & extensions); + CUnarchiver(FileReader &file, const std::vector<const char *> &extensions); ~CUnarchiver(); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-26 20:35:32
|
Revision: 1975 http://sourceforge.net/p/modplug/code/1975 Author: saga-games Date: 2013-04-26 20:35:20 +0000 (Fri, 26 Apr 2013) Log Message: ----------- [New] Can now import DIGI (Digi Booster) modules. Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Tables.cpp Added Paths: ----------- trunk/OpenMPT/soundlib/Load_digi.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-26 20:35:20 UTC (rev 1975) @@ -372,6 +372,7 @@ bModified = FALSE; break; case MOD_TYPE_AMF0: + case MOD_TYPE_DIGI: m_SndFile.ChangeModTypeTo(MOD_TYPE_MOD); break; case MOD_TYPE_MED: Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2013-04-26 20:35:20 UTC (rev 1975) @@ -1337,6 +1337,10 @@ > </File> <File + RelativePath="..\soundlib\load_digi.cpp" + > + </File> + <File RelativePath="..\soundlib\load_dmf.cpp" > </File> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-04-26 20:35:20 UTC (rev 1975) @@ -269,6 +269,7 @@ <ClCompile Include="..\soundlib\Fastmix.cpp" /> <ClCompile Include="..\soundlib\ITCompression.cpp" /> <ClCompile Include="..\soundlib\ITTools.cpp" /> + <ClCompile Include="..\soundlib\Load_digi.cpp" /> <ClCompile Include="..\soundlib\Message.cpp" /> <ClCompile Include="..\soundlib\MIDIEvents.cpp" /> <ClCompile Include="..\soundlib\MIDIMacros.cpp" /> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-04-26 20:35:20 UTC (rev 1975) @@ -439,6 +439,9 @@ <ClCompile Include="..\common\version.cpp"> <Filter>Source Files\common</Filter> </ClCompile> + <ClCompile Include="..\soundlib\Load_digi.cpp"> + <Filter>Source Files\soundlib\Module Loaders</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\soundlib\Loaders.h"> Added: trunk/OpenMPT/soundlib/Load_digi.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_digi.cpp (rev 0) +++ trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-26 20:35:20 UTC (rev 1975) @@ -0,0 +1,187 @@ +/* + * Load_digi.cpp + * ------------- + * Purpose: Digi Booster module loader + * Notes : Basically these are like ProTracker MODs with a few extra features such as more channels, longer channels and a few more effects. + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#include "stdafx.h" +#include "Loaders.h" + +#ifdef NEEDS_PRAGMA_PACK +#pragma pack(push, 1) +#endif + +// DIGI File Header +struct PACKED DIGIFileHeader +{ + char signature[20]; + char versionStr[4]; // Supposed to be "V1.6" or similar, but other values like "TAP!" have been found as well. + uint8 versionInt; // e.g. 0x16 = 1.6 + uint8 numChannels; + uint8 packEnable; + char unknown[19]; + uint8 lastPatIndex; + uint8 lastOrdIndex; + uint8 orders[128]; + uint32 smpLength[31]; + uint32 smpLoopStart[31]; + uint32 smpLoopLength[31]; + uint8 smpVolume[31]; + uint8 smpFinetune[31]; + + // Convert all multi-byte numeric values to current platform's endianness or vice versa. + void ConvertEndianness() + { + for(SAMPLEINDEX i = 0; i < 31; i++) + { + SwapBytesBE(smpLength[i]); + SwapBytesBE(smpLoopStart[i]); + SwapBytesBE(smpLoopLength[i]); + } + } +}; + +STATIC_ASSERT(sizeof(DIGIFileHeader) == 610); + +#ifdef NEEDS_PRAGMA_PACK +#pragma pack(pop) +#endif + + +bool CSoundFile::ReadDIGI(FileReader &file) +//----------------------------------------- +{ + file.Rewind(); + + DIGIFileHeader fileHeader; + if(!file.ReadConvertEndianness(fileHeader) + || memcmp(fileHeader.signature, "DIGI Booster module\0", 20) + || !fileHeader.numChannels + || fileHeader.numChannels > 8 + || fileHeader.lastOrdIndex > 127) + { + return false; + } + + Order.ReadFromArray(fileHeader.orders, fileHeader.lastOrdIndex + 1); + + // Globals + m_nType = MOD_TYPE_DIGI; + m_nChannels = fileHeader.numChannels; + m_nInstruments = 0; + m_nSamples = 31; + m_nSamplePreAmp = 256 / m_nChannels; + m_nDefaultSpeed = 6; + m_nDefaultTempo = 125; + m_nDefaultGlobalVolume = MAX_GLOBAL_VOLUME; + + // Read sample headers + for(SAMPLEINDEX smp = 0; smp < 31; smp++) + { + ModSample &sample = Samples[smp + 1]; + sample.Initialize(MOD_TYPE_MOD); + sample.nLength = fileHeader.smpLength[smp]; + sample.nLoopStart = fileHeader.smpLoopStart[smp]; + sample.nLoopEnd = sample.nLoopStart + fileHeader.smpLoopLength[smp]; + if(fileHeader.smpLoopLength[smp]) + { + sample.uFlags.set(CHN_LOOP); + } + sample.SanitizeLoops(); + + sample.nVolume = std::min(fileHeader.smpVolume[smp], uint8(64)) * 4; + sample.nFineTune = MOD2XMFineTune(fileHeader.smpFinetune[smp]); + } + + // Read song + sample names + file.ReadString<StringFixer::maybeNullTerminated>(m_szNames[0], 32); + for(SAMPLEINDEX smp = 1; smp <= 31; smp++) + { + file.ReadString<StringFixer::maybeNullTerminated>(m_szNames[smp], 30); + } + + for(PATTERNINDEX pat = 0; pat <= fileHeader.lastPatIndex; pat++) + { + if(Patterns.Insert(pat, 64)) + { + break; + } + + vector<uint8> eventMask(64, 0xFF); + FileReader patternChunk; + + if(fileHeader.packEnable) + { + patternChunk = file.GetChunk(file.ReadUint16BE()); + patternChunk.ReadVector(eventMask, 64); + } else + { + patternChunk = file.GetChunk(4 * 64 * GetNumChannels()); + } + + size_t i = 0; + for(ROWINDEX row = 0; row < 64; row++) + { + PatternRow patRow = Patterns[pat].GetRow(row); + uint8 bit = 0x80; + for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++, bit >>= 1) + { + ModCommand &m = patRow[chn]; + if(eventMask[row] & bit) + { + ReadMODPatternEntry(patternChunk, m); + ConvertModCommand(m); + if(m.command == CMD_MODCMDEX) + { + switch(m.param & 0xF0) + { + case 0x30: + // E30 / E31: Play sample backwards (with some weird parameters that we won't support for now) + if(m.param <= 0x31) + { + m.command = CMD_S3MCMDEX; + m.param = 0x9F; + } + break; + case 0x40: + // E40: Stop playing sample + if(m.param == 0x40) + { + m.note = NOTE_NOTECUT; + m.command = CMD_NONE; + } + break; + case 0x80: + // E8x: High sample offset + m.command = CMD_S3MCMDEX; + m.param = 0xA0 | (m.param & 0x0F); + } + } else if(m.command == CMD_PANNING8) + { + // 8xx "Robot" effect (not supported) + m.command = CMD_NONE; + } + i += 4; + } + } + } + } + + // Reading Samples + const SampleIO sampleIO( + SampleIO::_8bit, + SampleIO::mono, + SampleIO::bigEndian, + SampleIO::signedPCM); + + for(SAMPLEINDEX smp = 1; smp <= 31; smp++) + { + sampleIO.ReadSample(Samples[smp], file); + } + + return true; +} Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2013-04-26 20:35:20 UTC (rev 1975) @@ -454,8 +454,8 @@ } -static void ReadPatternEntry(FileReader &file, ModCommand &m, const CSoundFile &sf) -//--------------------------------------------------------------------------------- +void CSoundFile::ReadMODPatternEntry(FileReader &file, ModCommand &m) +//------------------------------------------------------------------- { uint8 data[4]; file.ReadArray(data); @@ -464,7 +464,7 @@ uint16 period = (((static_cast<uint16>(data[0]) & 0x0F) << 8) | data[1]); if(period > 0 && period != 0xFFF) { - m.note = static_cast<ModCommand::NOTE>(sf.GetNoteFromPeriod(period * 4)); + m.note = static_cast<ModCommand::NOTE>(GetNoteFromPeriod(period * 4)); } // Read Instrument m.instr = (data[2] >> 4) | (data[0] & 0x10); @@ -650,7 +650,7 @@ for(CHANNELINDEX chn = 0; chn < readChannels; chn++) { ModCommand &m = rowBase[chn]; - ReadPatternEntry(file, m, *this); + ReadMODPatternEntry(file, m); if(m.command || m.param) { @@ -942,7 +942,7 @@ for(CHANNELINDEX chn = 0; chn < 4; chn++) { ModCommand &m = rowBase[chn]; - ReadPatternEntry(file, m, *this); + ReadMODPatternEntry(file, m); if(m.command || m.param) { Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2013-04-26 20:35:20 UTC (rev 1975) @@ -101,6 +101,7 @@ MOD_TYPE_MPT = 0x1000000, MOD_TYPE_IMF = 0x2000000, MOD_TYPE_AMS2 = 0x4000000, + MOD_TYPE_DIGI = 0x8000000, // Container formats (not used at the moment) MOD_TYPE_MO3 = 0x20000000, MOD_TYPE_GDM = 0x40000000, @@ -135,17 +136,17 @@ CHN_SURROUND = 0x800, // use surround channel CHN_NOIDO = 0x1000, // (IDO = Interpolation Do?) Indicates if the channel is near enough to an exact multiple of the base frequency that any interpolation won't be noticeable - or if interpolation was switched off completely. --Storlek CHN_HQSRC = 0x2000, // High quality sample rate conversion (i.e. apply interpolation) - CHN_FILTER = 0x4000, // filtered output - CHN_VOLUMERAMP = 0x8000, // ramp volume - CHN_VIBRATO = 0x10000, // apply vibrato - CHN_TREMOLO = 0x20000, // apply tremolo - CHN_PANBRELLO = 0x40000, // apply panbrello - CHN_PORTAMENTO = 0x80000, // apply portamento - CHN_GLISSANDO = 0x100000, // glissando mode - CHN_FASTVOLRAMP = 0x200000, // ramp volume very fast - CHN_EXTRALOUD = 0x400000, // force master volume to = 0x100 - CHN_REVERB = 0x800000, // apply reverb - CHN_NOREVERB = 0x1000000, // forbid reverb + CHN_FILTER = 0x4000, // Apply resonant filter on sample + CHN_VOLUMERAMP = 0x8000, // Apply volume ramping + CHN_VIBRATO = 0x10000, // Apply vibrato + CHN_TREMOLO = 0x20000, // Apply tremolo + CHN_PANBRELLO = 0x40000, // Apply panbrello + CHN_PORTAMENTO = 0x80000, // Apply portamento + CHN_GLISSANDO = 0x100000, // Glissando mode + CHN_FASTVOLRAMP = 0x200000, // Force usage of global ramping settings instead of ramping over the complete render buffer length + CHN_EXTRALOUD = 0x400000, // Force sample to play at 0dB + CHN_REVERB = 0x800000, // Apply reverb on this channel + CHN_NOREVERB = 0x1000000, // Disable reverb on this channel CHN_SOLO = 0x2000000, // solo channel -> CODE#0012 -> DESC="midi keyboard split" -! NEW_FEATURE#0012 CHN_NOFX = 0x4000000, // dry channel -> CODE#0015 -> DESC="channels management dlg" -! NEW_FEATURE#0015 CHN_SYNCMUTE = 0x8000000, // keep sample sync on mute Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-26 20:35:20 UTC (rev 1975) @@ -4577,7 +4577,7 @@ //--------------------------------------------------- { if (!period) return 0; - if (m_nType & (MOD_TYPE_MED|MOD_TYPE_MOD|MOD_TYPE_MTM|MOD_TYPE_669|MOD_TYPE_OKT|MOD_TYPE_AMF0)) + if (m_nType & (MOD_TYPE_MED|MOD_TYPE_MOD|MOD_TYPE_DIGI|MOD_TYPE_MTM|MOD_TYPE_669|MOD_TYPE_OKT|MOD_TYPE_AMF0)) { period >>= 2; for (UINT i=0; i<6*12; i++) @@ -4612,7 +4612,7 @@ { if ((!note) || (note >= NOTE_MIN_SPECIAL)) return 0; if (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_MDL|MOD_TYPE_ULT|MOD_TYPE_WAV - |MOD_TYPE_FAR|MOD_TYPE_DMF|MOD_TYPE_PTM|MOD_TYPE_AMS|MOD_TYPE_AMS2|MOD_TYPE_DBM|MOD_TYPE_AMF|MOD_TYPE_PSM|MOD_TYPE_J2B|MOD_TYPE_IMF)) + |MOD_TYPE_FAR|MOD_TYPE_DMF|MOD_TYPE_PTM|MOD_TYPE_AMS|MOD_TYPE_AMS2|MOD_TYPE_DIGI|MOD_TYPE_DBM|MOD_TYPE_AMF|MOD_TYPE_PSM|MOD_TYPE_J2B|MOD_TYPE_IMF)) { note--; if(m_SongFlags[SONG_LINEARSLIDES]) Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-26 20:35:20 UTC (rev 1975) @@ -578,6 +578,7 @@ #endif // MODPLUG_TRACKER && !ReadGDM(file) && !ReadIMF(file) + && !ReadDIGI(file) && !ReadAM(file) && !ReadJ2B(file) && !ReadMO3(file) @@ -1175,7 +1176,7 @@ //------------------------------------------- { if ((!m_nSamples) || (!m_nChannels) || GetType() == MOD_TYPE_NONE) return MOD_TYPE_NONE; - if (GetType() & (MOD_TYPE_MOD/*|MOD_TYPE_OKT*/)) + if (GetType() & (MOD_TYPE_MOD|MOD_TYPE_DIGI)) return MOD_TYPE_MOD; if (GetType() & (MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_ULT|MOD_TYPE_FAR|MOD_TYPE_PTM|MOD_TYPE_MTM)) return MOD_TYPE_S3M; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-26 20:35:20 UTC (rev 1975) @@ -504,6 +504,7 @@ bool ReadIMF(FileReader &file); bool ReadAM(FileReader &file); bool ReadJ2B(FileReader &file); + bool ReadDIGI(FileReader &file); bool ReadMID(const LPCBYTE lpStream, DWORD dwMemLength); static std::vector<const char *> GetSupportedExtensions(bool otherFormats); @@ -540,6 +541,7 @@ void S3MConvert(ModCommand &m, bool fromIT) const; void S3MSaveConvert(uint8 &command, uint8 ¶m, bool toIT, bool compatibilityExport = false) const; void ModSaveCommand(uint8 &command, uint8 ¶m, const bool toXM, const bool compatibilityExport = false) const; + void ReadMODPatternEntry(FileReader &file, ModCommand &m); void SetupMODPanning(bool bForceSetup = false); // Setup LRRL panning, max channel volume Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2013-04-26 17:13:44 UTC (rev 1974) +++ trunk/OpenMPT/soundlib/Tables.cpp 2013-04-26 20:35:20 UTC (rev 1975) @@ -85,6 +85,7 @@ { MOD_TYPE_PSM, "Epic Megagames MASI", "psm" }, { MOD_TYPE_MT2, "MadTracker 2", "mt2" }, { MOD_TYPE_DBM, "DigiBooster Pro", "dbm" }, + { MOD_TYPE_DIGI, "DigiBooster", "digi" }, { MOD_TYPE_IMF, "Imago Orpheus", "imf" }, { MOD_TYPE_J2B, "Galaxy Sound System", "j2b" }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-27 17:55:44
|
Revision: 1982 http://sourceforge.net/p/modplug/code/1982 Author: manxorist Date: 2013-04-27 17:55:34 +0000 (Sat, 27 Apr 2013) Log Message: ----------- [Ref] The unarchiver uses headers from common and soundlib but does not include BuildSettings.h. This could potentially cause all kinds of silent build corruption because different preprocessor flags are used in unarchiver and mptrack. There are also other inconsistencies (e.g. the mptrack project defines MODPLUG_TRACKER via project settings). The easiest fix is to just merge unarchiver project into the mptrack project. This also reduces future project file maintanance needs. Modified Paths: -------------- trunk/OpenMPT/mptrack/MPTRACK_08.sln trunk/OpenMPT/mptrack/MPTRACK_10.sln trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/unarchiver/unarchiver.cpp trunk/OpenMPT/unarchiver/ungzip.cpp trunk/OpenMPT/unarchiver/unlha.cpp trunk/OpenMPT/unarchiver/unrar.cpp trunk/OpenMPT/unarchiver/unzip.cpp Removed Paths: ------------- trunk/OpenMPT/unarchiver/unarchiver_08.vcproj trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj.filters Modified: trunk/OpenMPT/mptrack/MPTRACK_08.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_08.sln 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/mptrack/MPTRACK_08.sln 2013-04-27 17:55:34 UTC (rev 1982) @@ -2,7 +2,6 @@ # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mptrack", "mptrack_08.vcproj", "{21D95071-FB97-4E69-B3B1-050D0D4A5021}" ProjectSection(ProjectDependencies) = postProject - {94CD7910-649A-4075-9F33-7EBEE614FD45} = {94CD7910-649A-4075-9F33-7EBEE614FD45} {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8} = {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8} {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} = {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} {0A18A071-125E-442F-AFF7-A3F68ABECF99} = {0A18A071-125E-442F-AFF7-A3F68ABECF99} @@ -20,8 +19,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "..\include\portaudio\build\msvc\portaudio_openmpt_vs2008.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unarchiver", "..\unarchiver\unarchiver_08.vcproj", "{94CD7910-649A-4075-9F33-7EBEE614FD45}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -52,10 +49,6 @@ {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.ActiveCfg = Debug|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.Build.0 = Debug|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.ActiveCfg = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/OpenMPT/mptrack/MPTRACK_10.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_10.sln 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/mptrack/MPTRACK_10.sln 2013-04-27 17:55:34 UTC (rev 1982) @@ -15,8 +15,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "..\include\portaudio\build\msvc\portaudio_openmpt_vs2010.vcxproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unarchiver", "..\unarchiver\unarchiver_10.vcxproj", "{94CD7910-649A-4075-9F33-7EBEE614FD45}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -60,12 +58,6 @@ {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.ReleaseNoLTCG|Win32.ActiveCfg = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.ReleaseNoLTCG|Win32.Build.0 = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.ActiveCfg = Debug|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.Build.0 = Debug|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.ActiveCfg = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.Build.0 = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseNoLTCG|Win32.ActiveCfg = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseNoLTCG|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2013-04-27 17:55:34 UTC (rev 1982) @@ -49,7 +49,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\;..\common\svn_version;..\common\svn_version_default" + AdditionalIncludeDirectories="..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\include\zlib;..\;..\common\svn_version;..\common\svn_version_default" PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,MODPLUG_TRACKER" StringPooling="true" ExceptionHandling="2" @@ -158,7 +158,7 @@ Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="2" - AdditionalIncludeDirectories="..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\;..\common\svn_version;..\common\svn_version_default" + AdditionalIncludeDirectories="..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\include\zlib;..\;..\common\svn_version;..\common\svn_version_default" PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,MODPLUG_TRACKER" StringPooling="true" ExceptionHandling="2" @@ -1461,6 +1461,478 @@ > </File> </Filter> + <Filter + Name="unarchiver" + > + <File + RelativePath="..\unarchiver\unarchiver.cpp" + > + </File> + <File + RelativePath="..\unarchiver\unarchiver.h" + > + </File> + <File + RelativePath="..\unarchiver\ungzip.cpp" + > + </File> + <File + RelativePath="..\unarchiver\ungzip.h" + > + </File> + <File + RelativePath="..\unarchiver\unlha.cpp" + > + </File> + <File + RelativePath="..\unarchiver\unlha.h" + > + </File> + <File + RelativePath="..\unarchiver\unrar.cpp" + > + </File> + <File + RelativePath="..\unarchiver\unrar.h" + > + </File> + <File + RelativePath="..\unarchiver\unzip.cpp" + > + </File> + <File + RelativePath="..\unarchiver\unzip.h" + > + </File> + <Filter + Name="unlha" + > + <File + RelativePath="..\unarchiver\unlha\DHUF.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\EXTRACT.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\Header.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\HUF.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\LARC.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\LHARC.H" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\LHEXT.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\MAKETBL.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\SHUF.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\SLIDE.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unlha\SLIDEHUF.H" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="unrar" + > + <File + RelativePath="..\unarchiver\unrar\BLOCK.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\COMPR.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\CONST.H" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\CRCCRYPT.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\Extract.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\Global.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\Rdwrfn.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\Smallfn.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\Unpack.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\unarchiver\unrar\UNPOLD.CPP" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + </Filter> + </Filter> <File RelativePath=".\res\built-inTunings.tc" > Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-04-27 17:55:34 UTC (rev 1982) @@ -77,7 +77,7 @@ <ClCompile> <AdditionalOptions>/EHsc %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\;..\common\svn_version;..\common\svn_version_default;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\include\zlib;..\;..\common\svn_version;..\common\svn_version_default;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;MODPLUG_TRACKER;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> @@ -136,7 +136,7 @@ <ClCompile> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> - <AdditionalIncludeDirectories>..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\;..\common\svn_version;..\common\svn_version_default;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\include\zlib;..\;..\common\svn_version;..\common\svn_version_default;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;MODPLUG_TRACKER;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -199,7 +199,7 @@ <ClCompile> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> - <AdditionalIncludeDirectories>..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\;..\common\svn_version;..\common\svn_version_default;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\common;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\include\zlib;..\;..\common\svn_version;..\common\svn_version_default;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;MODPLUG_TRACKER;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -299,6 +299,101 @@ <ClCompile Include="..\soundlib\WAVTools.cpp" /> <ClCompile Include="..\soundlib\WindowedFIR.cpp" /> <ClCompile Include="..\soundlib\XMTools.cpp" /> + <ClCompile Include="..\unarchiver\unarchiver.cpp" /> + <ClCompile Include="..\unarchiver\ungzip.cpp" /> + <ClCompile Include="..\unarchiver\unlha.cpp" /> + <ClCompile Include="..\unarchiver\unlha\DHUF.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\EXTRACT.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\Header.cpp"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\HUF.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\LARC.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\LHEXT.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\MAKETBL.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\SHUF.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\SLIDE.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar.cpp" /> + <ClCompile Include="..\unarchiver\unrar\BLOCK.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\COMPR.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\CRCCRYPT.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Extract.cpp"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Global.cpp"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Rdwrfn.cpp"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Smallfn.cpp"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Unpack.cpp"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\UNPOLD.CPP"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClCompile> + <ClCompile Include="..\unarchiver\unzip.cpp" /> <ClCompile Include="AbstractVstEditor.cpp" /> <ClCompile Include="ACMConvert.cpp" /> <ClCompile Include="AutoSaver.cpp" /> @@ -466,6 +561,26 @@ <ClInclude Include="..\soundlib\WAVTools.h" /> <ClInclude Include="..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\soundlib\XMTools.h" /> + <ClInclude Include="..\unarchiver\unarchiver.h" /> + <ClInclude Include="..\unarchiver\ungzip.h" /> + <ClInclude Include="..\unarchiver\unlha.h" /> + <ClInclude Include="..\unarchiver\unlha\LHARC.H"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClInclude> + <ClInclude Include="..\unarchiver\unlha\SLIDEHUF.H"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClInclude> + <ClInclude Include="..\unarchiver\unrar.h" /> + <ClInclude Include="..\unarchiver\unrar\CONST.H"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + </ClInclude> + <ClInclude Include="..\unarchiver\unzip.h" /> <ClInclude Include="AbstractVstEditor.h" /> <ClInclude Include="ACMConvert.h" /> <ClInclude Include="AutoSaver.h" /> @@ -577,9 +692,6 @@ <Project>{cf3c2ca5-5d45-4635-bba4-c1f435e10896}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> - <ProjectReference Include="..\unarchiver\unarchiver_10.vcxproj"> - <Project>{94cd7910-649a-4075-9f33-7ebee614fd45}</Project> - </ProjectReference> <ProjectReference Include="..\xsoundlib\xsoundlib_10.vcxproj"> <Project>{dcc2bb2f-6778-4fd3-9c00-d6cd8dc917b8}</Project> </ProjectReference> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-04-27 17:55:34 UTC (rev 1982) @@ -442,6 +442,75 @@ <ClCompile Include="..\soundlib\Load_digi.cpp"> <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> + <ClCompile Include="..\unarchiver\unarchiver.cpp"> + <Filter>Source Files\unarchiver</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\ungzip.cpp"> + <Filter>Source Files\unarchiver</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha.cpp"> + <Filter>Source Files\unarchiver</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar.cpp"> + <Filter>Source Files\unarchiver</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unzip.cpp"> + <Filter>Source Files\unarchiver</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\DHUF.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\EXTRACT.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\Header.cpp"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\HUF.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\LARC.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\LHEXT.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\MAKETBL.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\SHUF.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unlha\SLIDE.CPP"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\BLOCK.CPP"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\COMPR.CPP"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\CRCCRYPT.CPP"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Extract.cpp"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Global.cpp"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Rdwrfn.cpp"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Smallfn.cpp"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\Unpack.cpp"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> + <ClCompile Include="..\unarchiver\unrar\UNPOLD.CPP"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\soundlib\Loaders.h"> @@ -819,6 +888,30 @@ <ClInclude Include="..\common\BuildSettings.h"> <Filter>Header Files\common</Filter> </ClInclude> + <ClInclude Include="..\unarchiver\unarchiver.h"> + <Filter>Header Files\unarchiver</Filter> + </ClInclude> + <ClInclude Include="..\unarchiver\ungzip.h"> + <Filter>Header Files\unarchiver</Filter> + </ClInclude> + <ClInclude Include="..\unarchiver\unlha.h"> + <Filter>Header Files\unarchiver</Filter> + </ClInclude> + <ClInclude Include="..\unarchiver\unrar.h"> + <Filter>Header Files\unarchiver</Filter> + </ClInclude> + <ClInclude Include="..\unarchiver\unzip.h"> + <Filter>Header Files\unarchiver</Filter> + </ClInclude> + <ClInclude Include="..\unarchiver\unlha\LHARC.H"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClInclude> + <ClInclude Include="..\unarchiver\unlha\SLIDEHUF.H"> + <Filter>Source Files\unarchiver\unlha</Filter> + </ClInclude> + <ClInclude Include="..\unarchiver\unrar\CONST.H"> + <Filter>Source Files\unarchiver\unrar</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="res\bitmap1.bmp"> @@ -967,6 +1060,18 @@ <Filter Include="Header Files\mptrack\Dialogs"> <UniqueIdentifier>{7526c521-5a42-4ad4-9d39-76f5871e5771}</UniqueIdentifier> </Filter> + <Filter Include="Header Files\unarchiver"> + <UniqueIdentifier>{4d964e85-7434-4182-9392-bdfa71c6d1cf}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\unarchiver"> + <UniqueIdentifier>{2e5a8242-6eec-48cd-93b3-5880bee8b740}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\unarchiver\unrar"> + <UniqueIdentifier>{ffd114ee-74f6-4d3e-87af-44e29e79b71f}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\unarchiver\unlha"> + <UniqueIdentifier>{b35a6890-84c2-43ed-8e0f-b28d5afcbb6a}</UniqueIdentifier> + </Filter> </ItemGroup> <ItemGroup> <ResourceCompile Include="mptrack.rc"> Modified: trunk/OpenMPT/unarchiver/unarchiver.cpp =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver.cpp 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/unarchiver/unarchiver.cpp 2013-04-27 17:55:34 UTC (rev 1982) @@ -7,6 +7,8 @@ * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ +#include "stdafx.h" + #include <Windows.h> #include "unarchiver.h" Deleted: trunk/OpenMPT/unarchiver/unarchiver_08.vcproj =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver_08.vcproj 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/unarchiver/unarchiver_08.vcproj 2013-04-27 17:55:34 UTC (rev 1982) @@ -1,631 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9,00" - Name="unarchiver" - ProjectGUID="{94CD7910-649A-4075-9F33-7EBEE614FD45}" - RootNamespace="unarchiver" - TargetFrameworkVersion="196613" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="../include/;../include/zlib/" - PreprocessorDefinitions="WIN32;ZLIB_WINAPI" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - WarningLevel="3" - DebugInformationFormat="3" - OmitDefaultLibName="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories="../include/;../include/zlib/" - PreprocessorDefinitions="WIN32;ZLIB_WINAPI" - RuntimeLibrary="0" - EnableFunctionLevelLinking="true" - WarningLevel="3" - SuppressStartupBanner="false" - DebugInformationFormat="0" - OmitDefaultLibName="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\unarchiver.cpp" - > - </File> - <File - RelativePath=".\ungzip.cpp" - > - </File> - <File - RelativePath=".\unlha.cpp" - > - </File> - <File - RelativePath=".\unrar.cpp" - > - </File> - <File - RelativePath=".\unzip.cpp" - > - </File> - <Filter - Name="unlha" - > - <File - RelativePath=".\unlha\DHUF.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\EXTRACT.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\Header.cpp" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\HUF.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\LARC.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\LHARC.H" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\LHEXT.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\MAKETBL.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\SHUF.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\SLIDE.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unlha\SLIDEHUF.H" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="unrar" - > - <File - RelativePath=".\unrar\BLOCK.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\COMPR.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\CONST.H" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\CRCCRYPT.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\Extract.cpp" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\Global.cpp" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\Rdwrfn.cpp" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\Smallfn.cpp" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\Unpack.cpp" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\unrar\UNPOLD.CPP" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - /> - </FileConfiguration> - </File> - </Filter> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\unarchiver.h" - > - </File> - <File - RelativePath=".\ungzip.h" - > - </File> - <File - RelativePath=".\unlha.h" - > - </File> - <File - RelativePath=".\unrar.h" - > - </File> - <File - RelativePath=".\unzip.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> Deleted: trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj 2013-04-27 17:55:34 UTC (rev 1982) @@ -1,176 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - </ItemGroup> - <ItemGroup> - <ClCompile Include="unarchiver.cpp" /> - <ClCompile Include="ungzip.cpp" /> - <ClCompile Include="unlha.cpp" /> - <ClCompile Include="unlha\DHUF.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\EXTRACT.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\Header.cpp"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\HUF.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\LARC.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\LHEXT.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\MAKETBL.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\SHUF.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unlha\SLIDE.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar.cpp" /> - <ClCompile Include="unrar\BLOCK.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\COMPR.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\CRCCRYPT.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\Extract.cpp"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\Global.cpp"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\Rdwrfn.cpp"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\Smallfn.cpp"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\Unpack.cpp"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unrar\UNPOLD.CPP"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClCompile> - <ClCompile Include="unzip.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="unarchiver.h" /> - <ClInclude Include="ungzip.h" /> - <ClInclude Include="unlha.h" /> - <ClInclude Include="unlha\LHARC.H"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClInclude> - <ClInclude Include="unlha\SLIDEHUF.H"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClInclude> - <ClInclude Include="unrar.h" /> - <ClInclude Include="unrar\CONST.H"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> - </ClInclude> - <ClInclude Include="unzip.h" /> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectName>unarchiver</ProjectName> - <ProjectGuid>{94CD7910-649A-4075-9F33-7EBEE614FD45}</ProjectGuid> - <RootNamespace>unarchiver</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>false</WholeProgramOptimization> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>_DEBUG;WIN32;ZLIB_WINAPI;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <MinimalRebuild>true</MinimalRebuild> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - <OmitDefaultLibName>true</OmitDefaultLibName> - <AdditionalIncludeDirectories>../include/;../include/zlib/</AdditionalIncludeDirectories> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>NDEBUG;WIN32;ZLIB_WINAPI;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - <DebugInformationFormat> - </DebugInformationFormat> - <OmitDefaultLibName>true</OmitDefaultLibName> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <AdditionalIncludeDirectories>../include/;../include/zlib/</AdditionalIncludeDirectories> - <WholeProgramOptimization>false</WholeProgramOptimization> - <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> - </ClCompile> - </ItemDefinitionGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file Deleted: trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj.filters 2013-04-27 17:46:48 UTC (rev 1981) +++ trunk/OpenMPT/unarchiver/unarchiver_10.vcxproj.filters 2013-04-27 17:55:34 UTC (rev 1982) @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="unlha"> - <UniqueIdentifier>{29ea7892-4daf-402b-983c-cb831dedb8aa}</UniqueIdentifier> - </Filter> - <Filter Include="unrar"> - <UniqueIdentifier>{3cda0dab-901c-4ab5-a35e-632733040926}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="ungzip.cpp" /> - <ClCompile Include="unlha.cpp" />... [truncated message content] |
From: <sag...@us...> - 2013-04-27 18:37:40
|
Revision: 1984 http://sourceforge.net/p/modplug/code/1984 Author: saga-games Date: 2013-04-27 18:37:32 +0000 (Sat, 27 Apr 2013) Log Message: ----------- [Fix] Channel flags were not reset when resetting channel settings. Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/soundlib/Load_digi.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_ult.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -845,10 +845,7 @@ sndFile.Instruments[i]->nResSwing = 0; } - for(CHANNELINDEX i = 0; i <= sndFile.GetNumChannels(); i++) - { - sndFile.ChnSettings[i].Reset(); - } + sndFile.InitializeChannels(); // reset samples ctrlSmp::ResetSamples(sndFile, ctrlSmp::SmpResetCompo); Modified: trunk/OpenMPT/soundlib/Load_digi.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -171,7 +171,6 @@ } else { // ...but uncompressed patterns are stored in column-major order. WTF! - ASSERT(false); for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) { for(ROWINDEX row = 0; row < 64; row++) Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -415,8 +415,6 @@ { ChnSettings[i].Reset(); ChnSettings[i].nVolume = Clamp(fileHeader.chnvol[i], uint8(0), uint8(64)); - ChnSettings[i].nPan = 128; - ChnSettings[i].dwFlags.reset(); if(fileHeader.chnpan[i] & 0x80) ChnSettings[i].dwFlags.set(CHN_MUTE); uint8 n = fileHeader.chnpan[i] & 0x7F; if(n <= 64) ChnSettings[i].nPan = n * 4; Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -1171,8 +1171,7 @@ { ChnSettings[i].Reset(); ChnSettings[i].nPan = ((15 - (file.ReadUint8() & 0x0F)) * 256 + 8) / 15; // 15 seems to be left and 0 seems to be right... - ChnSettings[i].nVolume = 64; - ChnSettings[i].dwFlags.reset(); // (i >= fileHeader.numChannelsPlay) ? CHN_MUTE : 0; // don't mute channels, as muted channels are completely ignored in S3M + // ChnSettings[i].dwFlags = (i >= fileHeader.numChannelsPlay) ? CHN_MUTE : 0; // don't mute channels, as muted channels are completely ignored in S3M } } Modified: trunk/OpenMPT/soundlib/Load_ult.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -432,20 +432,13 @@ if(GetNumChannels() > MAX_BASECHANNELS || numPats > MAX_PATTERNS) return false; - if(fileHeader.version >= '3') + for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) { - for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) - { - ChnSettings[chn].Reset(); + ChnSettings[chn].Reset(); + if(fileHeader.version >= '3') ChnSettings[chn].nPan = ((file.ReadUint8() & 0x0F) << 4) + 8; - } - } else - { - for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) - { - ChnSettings[chn].Reset(); + else ChnSettings[chn].nPan = (chn & 1) ? 192 : 64; - } } for(PATTERNINDEX pat = 0; pat < numPats; pat++) Modified: trunk/OpenMPT/soundlib/ModChannel.h =================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/ModChannel.h 2013-04-27 18:37:32 UTC (rev 1984) @@ -195,6 +195,7 @@ void Reset() { + dwFlags.reset(); nPan = 128; nVolume = 64; nMixPlugin = 0; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -1238,12 +1238,7 @@ { if(nChn >= MAX_BASECHANNELS) return true; - ChnSettings[nChn].nPan = 128; - ChnSettings[nChn].nVolume = 64; - ChnSettings[nChn].dwFlags.reset(); - ChnSettings[nChn].nMixPlugin = 0; - strcpy(ChnSettings[nChn].szName, ""); - + ChnSettings[nChn].Reset(); Chn[nChn].Reset(ModChannel::resetTotal, *this, nChn); #ifdef MODPLUG_TRACKER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-27 18:59:34
|
Revision: 1985 http://sourceforge.net/p/modplug/code/1985 Author: manxorist Date: 2013-04-27 18:59:25 +0000 (Sat, 27 Apr 2013) Log Message: ----------- [Ref] Change CSoundFile::Create to take a FileReader as parameter instead of an pointer and a length. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-27 18:37:32 UTC (rev 1984) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-27 18:59:25 UTC (rev 1985) @@ -35,6 +35,7 @@ #include "SelectPluginDialog.h" #include "ExceptionHandler.h" #include "PatternClipboard.h" +#include "soundlib/FileReader.h" #include "../common/Profiler.h" #ifdef _DEBUG @@ -1633,7 +1634,7 @@ //---------------------------- { m_WaveFile.Destroy(); - m_WaveFile.Create(NULL, 0); + m_WaveFile.Create(FileReader(), nullptr); // Avoid global volume ramping when trying samples in the treeview. m_WaveFile.m_nDefaultGlobalVolume = m_WaveFile.m_nGlobalVolume = MAX_GLOBAL_VOLUME; m_WaveFile.SetMixLevels(mixLevels_117RC3); Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-27 18:37:32 UTC (rev 1984) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-27 18:59:25 UTC (rev 1985) @@ -23,6 +23,7 @@ #include "modsmp_ctrl.h" #include "CleanupSong.h" #include "../common/StringFixer.h" +#include "soundlib/FileReader.h" #include <shlwapi.h> #ifdef _DEBUG @@ -168,7 +169,7 @@ { if (!CDocument::OnNewDocument()) return FALSE; - m_SndFile.Create(NULL, this, 0); + m_SndFile.Create(FileReader(), this); m_SndFile.ChangeModTypeTo(CTrackApp::GetDefaultDocType()); if(CTrackApp::IsProject()) @@ -213,7 +214,7 @@ LPBYTE lpStream = f.Lock(); if (lpStream) { - m_SndFile.Create(lpStream, this, dwLen); + m_SndFile.Create(FileReader(lpStream, dwLen), this); f.Unlock(); } } Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2013-04-27 18:37:32 UTC (rev 1984) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2013-04-27 18:59:25 UTC (rev 1985) @@ -17,6 +17,7 @@ #include "dlsbank.h" #include "dlg_misc.h" #include "vstplug.h" +#include "../soundlib/FileReader.h" CSoundFile *CModTree::m_SongFile = nullptr; @@ -274,7 +275,7 @@ } if(m_SongFile != nullptr) { - m_SongFile->Create(lpStream, NULL, dwLen); + m_SongFile->Create(FileReader(lpStream, dwLen), nullptr); // Destroy some stuff that we're not going to use anyway. m_SongFile->Patterns.DestroyPatterns(); m_SongFile->songMessage.clear(); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 18:37:32 UTC (rev 1984) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 18:59:25 UTC (rev 1985) @@ -509,13 +509,13 @@ #ifdef MODPLUG_TRACKER -BOOL CSoundFile::Create(LPCBYTE lpStream, CModDoc *pModDoc, DWORD dwMemLength) -//---------------------------------------------------------------------------- +BOOL CSoundFile::Create(FileReader filereader, CModDoc *pModDoc) +//-------------------------------------------------------------- { m_pModDoc = pModDoc; #else -BOOL CSoundFile::Create(LPCBYTE lpStream, void *pModDoc, DWORD dwMemLength) -//------------------------------------------------------------------------- +BOOL CSoundFile::Create(FileReader filereader, void*) +//--------------------------------------------------- { #endif // MODPLUG_TRACKER @@ -544,10 +544,13 @@ MemsetZero(m_szNames); MemsetZero(m_MixPlugins); - if(lpStream) + if(filereader.IsValid()) { - FileReader file(lpStream, dwMemLength); + FileReader file(filereader); + LPCBYTE lpStream = reinterpret_cast<const unsigned char*>(file.GetRawData()); + DWORD dwMemLength = file.GetLength(); + #ifndef NO_ARCHIVE_SUPPORT CUnarchiver unarchiver(file, GetSupportedExtensions(true)); if(unarchiver.IsArchive() && unarchiver.ExtractFile()) Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-27 18:37:32 UTC (rev 1984) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-27 18:59:25 UTC (rev 1985) @@ -405,11 +405,11 @@ public: #ifdef MODPLUG_TRACKER - BOOL Create(LPCBYTE lpStream, CModDoc *pModDoc, DWORD dwMemLength=0); + BOOL Create(FileReader filereader, CModDoc *pModDoc); // Get parent CModDoc. Can be nullptr if previewing from tree view, and is always nullptr if we're not actually compiling OpenMPT. CModDoc *GetpModDoc() const { return m_pModDoc; } #else - BOOL Create(LPCBYTE lpStream, void *pModDoc, DWORD dwMemLength=0); + BOOL Create(FileReader filereader, void *pModDoc=nullptr); void *GetpModDoc() const { return nullptr; } #endif // MODPLUG_TRACKER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-27 23:45:27
|
Revision: 1989 http://sourceforge.net/p/modplug/code/1989 Author: saga-games Date: 2013-04-27 23:45:18 +0000 (Sat, 27 Apr 2013) Log Message: ----------- [Ref] Add a "loadFlags" parameter to every loader, to optional not load patterns or samples or to just check the header for validity. [Imp] Don't load patterns from file when previewing samples / instruments from modules in the tree view. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/LOAD_DBM.CPP trunk/OpenMPT/soundlib/LOAD_DMF.CPP trunk/OpenMPT/soundlib/LOAD_DSM.CPP trunk/OpenMPT/soundlib/Load_669.cpp trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_digi.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_gdm.cpp trunk/OpenMPT/soundlib/Load_imf.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/Load_mdl.cpp trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_mo3.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_mt2.cpp trunk/OpenMPT/soundlib/Load_mtm.cpp trunk/OpenMPT/soundlib/Load_okt.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_stm.cpp trunk/OpenMPT/soundlib/Load_ult.cpp trunk/OpenMPT/soundlib/Load_umx.cpp trunk/OpenMPT/soundlib/Load_wav.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/load_j2b.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -1634,7 +1634,7 @@ //---------------------------- { m_WaveFile.Destroy(); - m_WaveFile.Create(FileReader(), nullptr); + m_WaveFile.Create(FileReader()); // Avoid global volume ramping when trying samples in the treeview. m_WaveFile.m_nDefaultGlobalVolume = m_WaveFile.m_nGlobalVolume = MAX_GLOBAL_VOLUME; m_WaveFile.SetMixLevels(mixLevels_117RC3); Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -169,7 +169,7 @@ { if (!CDocument::OnNewDocument()) return FALSE; - m_SndFile.Create(FileReader(), this); + m_SndFile.Create(FileReader(), CSoundFile::loadCompleteModule, this); m_SndFile.ChangeModTypeTo(CTrackApp::GetDefaultDocType()); if(CTrackApp::IsProject()) @@ -214,7 +214,7 @@ LPBYTE lpStream = f.Lock(); if (lpStream) { - m_SndFile.Create(FileReader(lpStream, dwLen), this); + m_SndFile.Create(FileReader(lpStream, dwLen), CSoundFile::loadCompleteModule, this); f.Unlock(); } } Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -275,7 +275,7 @@ } if(m_SongFile != nullptr) { - m_SongFile->Create(FileReader(lpStream, dwLen), nullptr); + m_SongFile->Create(FileReader(lpStream, dwLen), CSoundFile::loadNoPatternData, nullptr); // Destroy some stuff that we're not going to use anyway. m_SongFile->Patterns.DestroyPatterns(); m_SongFile->songMessage.clear(); Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2013-04-27 23:45:18 UTC (rev 1989) @@ -100,8 +100,8 @@ #endif -bool CSoundFile::ReadAMF_Asylum(FileReader &file) -//----------------------------------------------- +bool CSoundFile::ReadAMF_Asylum(FileReader &file, ModLoadingFlags loadFlags) +//-------------------------------------------------------------------------- { file.Rewind(); @@ -112,6 +112,9 @@ || file.BytesLeft() < 256 + 64 * sizeof(AsylumSampleHeader) + 64 * 4 * 8 * fileHeader.numPatterns) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -143,7 +146,7 @@ // Read Patterns for(PATTERNINDEX pat = 0; pat < fileHeader.numPatterns; pat++) { - if(Patterns.Insert(pat, 64)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, 64)) { file.Skip(64 * 4 * 8); continue; @@ -167,19 +170,22 @@ } } - // Read Sample Data - const SampleIO sampleIO( - SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - SampleIO::signedPCM); + if(loadFlags & loadSampleData) + { + // Read Sample Data + const SampleIO sampleIO( + SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + SampleIO::signedPCM); - for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) - { - sampleIO.ReadSample(Samples[smp], file); + for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + { + sampleIO.ReadSample(Samples[smp], file); + } } + return true; - } @@ -355,8 +361,8 @@ } -bool CSoundFile::ReadAMF_DSMI(FileReader &file) -//--------------------------------------------- +bool CSoundFile::ReadAMF_DSMI(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------------ { file.Rewind(); @@ -367,6 +373,9 @@ || ((fileHeader.numChannels < 1 || fileHeader.numChannels > 32) && fileHeader.version >= 10)) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -520,31 +529,39 @@ trackData[i] = file.GetChunk(trackSize * 3); } - // Read Sample Data - const SampleIO sampleIO( - SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - SampleIO::unsignedPCM); + if(loadFlags & loadSampleData) + { + // Read Sample Data + const SampleIO sampleIO( + SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + SampleIO::unsignedPCM); - // Why is all of this sample loading business so dumb in AMF? - // Surely there must be some great idea behind it which isn't handled here (re-using the same sample data for different sample slots maybe?) - for(uint32 seekPos = 1; seekPos <= maxSamplePos; seekPos++) - { - for(SAMPLEINDEX smp = 0; smp < GetNumSamples(); smp++) + // Why is all of this sample loading business so dumb in AMF? + // Surely there must be some great idea behind it which isn't handled here (re-using the same sample data for different sample slots maybe?) + for(uint32 seekPos = 1; seekPos <= maxSamplePos; seekPos++) { - if(seekPos == samplePos[smp]) + for(SAMPLEINDEX smp = 0; smp < GetNumSamples(); smp++) { - sampleIO.ReadSample(Samples[smp + 1], file); + if(seekPos == samplePos[smp]) + { + sampleIO.ReadSample(Samples[smp + 1], file); + break; + } + } + if(!file.BytesLeft()) + { break; } } - if(!file.BytesLeft()) - { - break; - } } + if(!(loadFlags & loadPatternData)) + { + return true; + } + // Create the patterns from the list of tracks for(PATTERNINDEX pat = 0; pat < fileHeader.numOrders; pat++) { Modified: trunk/OpenMPT/soundlib/LOAD_DBM.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2013-04-27 23:45:18 UTC (rev 1989) @@ -196,8 +196,8 @@ } -bool CSoundFile::ReadDBM(const BYTE *lpStream, const DWORD dwMemLength) -//--------------------------------------------------------------------- +bool CSoundFile::ReadDBM(const BYTE *lpStream, const DWORD dwMemLength, ModLoadingFlags loadFlags) +//------------------------------------------------------------------------------------------------ { const DBMFileHeader *pfh = (DBMFileHeader *)lpStream; DWORD dwMemPos; @@ -209,7 +209,10 @@ || (pfh->info_id != DBM_ID_INFO) || (pfh->info_len != DBM_INFOLEN)) return false; dwMemPos = sizeof(DBMFileHeader); nOrders = BigEndianW(pfh->orders); - if (dwMemPos + 2 * nOrders + 8*3 >= dwMemLength) return false; + if (dwMemPos + 2 * nOrders + 8*3 >= dwMemLength) + return false; + else if(loadFlags == onlyVerifyHeader) + return true; InitializeGlobals(); InitializeChannels(); @@ -340,7 +343,7 @@ } } else // Packed Pattern Data - if (chunk_id == DBM_ID_PATT) + if (chunk_id == DBM_ID_PATT && (loadFlags & loadPatternData)) { if (nPatterns > MAX_PATTERNS) nPatterns = MAX_PATTERNS; for(PATTERNINDEX iPat = 0; iPat < nPatterns; iPat++) @@ -456,7 +459,7 @@ } } else // Reading Sample Data - if (chunk_id == DBM_ID_SMPL) + if (chunk_id == DBM_ID_SMPL && (loadFlags & loadSampleData)) { if (nSamples >= MAX_SAMPLES) nSamples = MAX_SAMPLES-1; m_nSamples = nSamples; Modified: trunk/OpenMPT/soundlib/LOAD_DMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-04-27 23:45:18 UTC (rev 1989) @@ -954,8 +954,8 @@ } -bool CSoundFile::ReadDMF(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadDMF(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { DMFFileHeader fileHeader; file.Rewind(); @@ -964,6 +964,9 @@ || !fileHeader.version || fileHeader.version > 10) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -1004,7 +1007,7 @@ // Read patterns chunk = chunks.GetChunk(DMFChunk::idPATT); - if(chunk.IsValid()) + if(chunk.IsValid() && (loadFlags & loadPatternData)) { DMFPatterns patHeader; chunk.ReadConvertEndianness(patHeader); @@ -1076,7 +1079,7 @@ // Now read the sample data from the data chunk FileReader sampleData = sampleDataChunk.GetChunk(sampleDataChunk.ReadUint32LE()); - if(sampleData.IsValid()) + if(sampleData.IsValid() && (loadFlags & loadSampleData)) { SampleIO( sample.uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, Modified: trunk/OpenMPT/soundlib/LOAD_DSM.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2013-04-27 23:45:18 UTC (rev 1989) @@ -1,7 +1,7 @@ /* * Load_dsm.cpp * ------------ - * Purpose: DSIK Internal Format (DSM) module loader + * Purpose: Digisound Interface Kit (DSIK) Internal Format (DSM) module loader * Notes : (currently none) * Authors: Olivier Lapicque * OpenMPT Devs @@ -100,8 +100,8 @@ #endif -bool CSoundFile::ReadDSM(const LPCBYTE lpStream, const DWORD dwMemLength) -//----------------------------------------------------------------------- +bool CSoundFile::ReadDSM(const LPCBYTE lpStream, const DWORD dwMemLength, ModLoadingFlags loadFlags) +//-------------------------------------------------------------------------------------------------- { DSMFILEHEADER *pfh = (DSMFILEHEADER *)lpStream; DSMSONG *psong; @@ -112,7 +112,13 @@ if ((!lpStream) || (dwMemLength < 1024) || (pfh->id_RIFF != DSMID_RIFF) || (pfh->riff_len + 8 > dwMemLength) || (pfh->riff_len < 1024) || (pfh->id_DSMF != DSMID_DSMF) || (pfh->id_SONG != DSMID_SONG) - || (pfh->song_len > dwMemLength)) return false; + || (pfh->song_len > dwMemLength)) + { + return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; + } psong = (DSMSONG *)(lpStream + sizeof(DSMFILEHEADER)); dwMemPos = sizeof(DSMFILEHEADER) + pfh->song_len; @@ -149,7 +155,7 @@ DSMPATT *ppatt = (DSMPATT *)(lpStream + dwMemPos); DSMSAMPLE *pSmp = (DSMSAMPLE *)(lpStream+dwMemPos); // Reading Patterns - if (ppatt->id_PATT == DSMID_PATT) + if (ppatt->id_PATT == DSMID_PATT && (loadFlags & loadPatternData)) { dwMemPos += 8; if (dwMemPos + ppatt->patt_len >= dwMemLength) break; @@ -249,13 +255,16 @@ sample.nVolume = (WORD)(pSmp->volume << 2); if (sample.nVolume > 256) sample.nVolume = 256; - FileReader chunk(lpStream + dwPos, dwMemLength - dwPos); - SampleIO( - SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - (pSmp->flags & 2) ? SampleIO::signedPCM : SampleIO::unsignedPCM) - .ReadSample(sample, chunk); + if(loadFlags & loadSampleData) + { + FileReader chunk(lpStream + dwPos, dwMemLength - dwPos); + SampleIO( + SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + (pSmp->flags & 2) ? SampleIO::signedPCM : SampleIO::unsignedPCM) + .ReadSample(sample, chunk); + } nSmp++; } else Modified: trunk/OpenMPT/soundlib/Load_669.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_669.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_669.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -87,8 +87,8 @@ #endif -bool CSoundFile::Read669(FileReader &file) -//---------------------------------------- +bool CSoundFile::Read669(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { _669FileHeader fileHeader; @@ -100,6 +100,9 @@ || fileHeader.patterns > 128) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } //bool has669Ext = fileHeader.sig == _669FileHeader::magic669Ext; @@ -145,7 +148,7 @@ // Reading Patterns for(PATTERNINDEX pat = 0; pat < fileHeader.patterns; pat++) { - if(Patterns.Insert(pat, 64)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, 64)) { file.Skip(64 * 8 * 3); continue; @@ -265,16 +268,20 @@ Patterns[pat].WriteEffect(EffectWriter(CMD_SPEED, fileHeader.tempoList[pat]).Retry(EffectWriter::rmTryNextRow)); } - // Reading Samples - const SampleIO sampleIO( - SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - SampleIO::unsignedPCM); + if(loadFlags & loadSampleData) + { + // Reading Samples + const SampleIO sampleIO( + SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + SampleIO::unsignedPCM); - for(SAMPLEINDEX n = 1; n <= m_nSamples; n++) - { - sampleIO.ReadSample(Samples[n], file); + for(SAMPLEINDEX n = 1; n <= m_nSamples; n++) + { + sampleIO.ReadSample(Samples[n], file); + } } + return true; } \ No newline at end of file Modified: trunk/OpenMPT/soundlib/Load_ams.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ams.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_ams.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -377,8 +377,8 @@ #endif -bool CSoundFile::ReadAMS(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadAMS(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); @@ -390,6 +390,9 @@ || fileHeader.versionHigh != 0x01) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -480,19 +483,26 @@ uint32 patLength = file.ReadUint32LE(); FileReader patternChunk = file.GetChunk(patLength); - ReadAMSPattern(Patterns[pat], false, patternChunk, *this); + if(loadFlags & loadPatternData) + { + ReadAMSPattern(Patterns[pat], false, patternChunk, *this); + } } - // Read Samples - for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + if(loadFlags & loadSampleData) { - SampleIO( - (Samples[smp].uFlags & CHN_16BIT) ? SampleIO::_16bit : SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - packSample[smp - 1] ? SampleIO::AMS : SampleIO::signedPCM) - .ReadSample(Samples[smp], file); + // Read Samples + for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + { + SampleIO( + (Samples[smp].uFlags & CHN_16BIT) ? SampleIO::_16bit : SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + packSample[smp - 1] ? SampleIO::AMS : SampleIO::signedPCM) + .ReadSample(Samples[smp], file); + } } + return true; } @@ -726,8 +736,8 @@ #endif -bool CSoundFile::ReadAMS2(FileReader &file) -//----------------------------------------- +bool CSoundFile::ReadAMS2(FileReader &file, ModLoadingFlags loadFlags) +//-------------------------------------------------------------------- { file.Rewind(); @@ -737,6 +747,9 @@ || !file.ReadConvertEndianness(fileHeader)) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } uint16 headerFlags; @@ -913,22 +926,30 @@ uint32 patLength = file.ReadUint32LE(); FileReader patternChunk = file.GetChunk(patLength); - const ROWINDEX numRows = patternChunk.ReadUint8() + 1; - // We don't need to know the number of channels or commands. - patternChunk.Skip(1); - - if(Patterns.Insert(pat, numRows)) + if(loadFlags & loadPatternData) { - continue; - } + const ROWINDEX numRows = patternChunk.ReadUint8() + 1; + // We don't need to know the number of channels or commands. + patternChunk.Skip(1); - char patternName[11]; - ReadAMSString(patternName, patternChunk); - Patterns[pat].SetName(patternName); + if(Patterns.Insert(pat, numRows)) + { + continue; + } - ReadAMSPattern(Patterns[pat], true, patternChunk, *this); + char patternName[11]; + ReadAMSString(patternName, patternChunk); + Patterns[pat].SetName(patternName); + + ReadAMSPattern(Patterns[pat], true, patternChunk, *this); + } } + if(!(loadFlags & loadSampleData)) + { + return true; + } + // Read Samples for(SAMPLEINDEX smp = 0; smp < GetNumSamples(); smp++) { Modified: trunk/OpenMPT/soundlib/Load_digi.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -90,8 +90,8 @@ } -bool CSoundFile::ReadDIGI(FileReader &file) -//----------------------------------------- +bool CSoundFile::ReadDIGI(FileReader &file, ModLoadingFlags loadFlags) +//-------------------------------------------------------------------- { file.Rewind(); @@ -103,6 +103,9 @@ || fileHeader.lastOrdIndex > 127) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } // Globals @@ -143,14 +146,22 @@ for(PATTERNINDEX pat = 0; pat <= fileHeader.lastPatIndex; pat++) { - if(Patterns.Insert(pat, 64)) + FileReader patternChunk; + if(fileHeader.packEnable) { - break; + patternChunk = file.GetChunk(file.ReadUint16BE()); + } else + { + patternChunk = file.GetChunk(4 * 64 * GetNumChannels()); } + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, 64)) + { + continue; + } + if(fileHeader.packEnable) { - FileReader patternChunk = file.GetChunk(file.ReadUint16BE()); std::vector<uint8> eventMask; patternChunk.ReadVector(eventMask, 64); @@ -175,22 +186,25 @@ { for(ROWINDEX row = 0; row < 64; row++) { - ReadDIGIPatternEntry(file, *Patterns[pat].GetpModCommand(row, chn), *this); + ReadDIGIPatternEntry(patternChunk, *Patterns[pat].GetpModCommand(row, chn), *this); } } } } - // Reading Samples - const SampleIO sampleIO( - SampleIO::_8bit, - SampleIO::mono, - SampleIO::bigEndian, - SampleIO::signedPCM); + if(loadFlags & loadSampleData) + { + // Reading Samples + const SampleIO sampleIO( + SampleIO::_8bit, + SampleIO::mono, + SampleIO::bigEndian, + SampleIO::signedPCM); - for(SAMPLEINDEX smp = 1; smp <= 31; smp++) - { - sampleIO.ReadSample(Samples[smp], file); + for(SAMPLEINDEX smp = 1; smp <= 31; smp++) + { + sampleIO.ReadSample(Samples[smp], file); + } } return true; Modified: trunk/OpenMPT/soundlib/Load_far.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_far.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_far.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -132,8 +132,8 @@ #endif -bool CSoundFile::ReadFAR(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadFAR(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); @@ -144,6 +144,9 @@ || file.GetLength() < static_cast<size_t>(fileHeader.headerLength)) { return false; + } else + { + return true; } // Globals @@ -215,7 +218,7 @@ // Calculate pattern length in rows (every event is 4 bytes, and we have 16 channels) ROWINDEX numRows = (orderHeader.patternSize[pat] - 2) / (16 * 4); - if(!numRows || numRows > MAX_PATTERN_ROWS || Patterns.Insert(pat, numRows)) + if(!(loadFlags & loadPatternData) || !numRows || numRows > MAX_PATTERN_ROWS || Patterns.Insert(pat, numRows)) { continue; } @@ -284,6 +287,11 @@ Patterns[pat].WriteEffect(EffectWriter(CMD_PATTERNBREAK, 0).Row(breakRow).Retry(EffectWriter::rmTryNextRow)); } + if(!(loadFlags & loadSampleData)) + { + return true; + } + // Read samples uint8 sampleMap[8]; // Sample usage bitset file.ReadArray(sampleMap); Modified: trunk/OpenMPT/soundlib/Load_gdm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -130,8 +130,8 @@ #endif -bool CSoundFile::ReadGDM(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadGDM(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); @@ -151,6 +151,9 @@ || fileHeader.originalFormat == 0) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -267,7 +270,7 @@ } // Read sample data - if(file.Seek(fileHeader.sampleDataOffset)) + if((loadFlags & loadSampleData) && file.Seek(fileHeader.sampleDataOffset)) { for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) { @@ -304,9 +307,9 @@ } FileReader chunk = file.GetChunk(patternLength - 2); - if(!chunk.IsValid() || Patterns.Insert(pat, 64)) + if(!(loadFlags & loadPatternData) || !chunk.IsValid() || Patterns.Insert(pat, 64)) { - break; + continue; } enum Modified: trunk/OpenMPT/soundlib/Load_imf.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_imf.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_imf.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -393,8 +393,8 @@ } } -bool CSoundFile::ReadIMF(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadIMF(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { IMFFileHeader fileHeader; file.Rewind(); @@ -404,12 +404,11 @@ return false; } - InitializeGlobals(); // Read channel configuration std::bitset<32> ignoreChannels; // bit set for each channel that's completely disabled - m_nChannels = 0; - for(CHANNELINDEX chn = 0; chn < 32; chn++) + uint8 detectedChannels = 0; + for(uint8 chn = 0; chn < 32; chn++) { ChnSettings[chn].Reset(); ChnSettings[chn].nPan = fileHeader.channels[chn].panning * 256 / 255; @@ -420,11 +419,11 @@ switch(fileHeader.channels[chn].status) { case 0: // enabled; don't worry about it - m_nChannels = chn + 1; + detectedChannels = chn + 1; break; case 1: // mute ChnSettings[chn].dwFlags = CHN_MUTE; - m_nChannels = chn + 1; + detectedChannels = chn + 1; break; case 2: // disabled ChnSettings[chn].dwFlags = CHN_MUTE; @@ -435,8 +434,17 @@ return false; } } - if(!m_nChannels) return false; + if(!detectedChannels) + { + return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; + } + InitializeGlobals(); + m_nChannels = detectedChannels; + //From mikmod: work around an Orpheus bug if(fileHeader.channels[0].status == 0) { @@ -474,7 +482,7 @@ const uint16 length = file.ReadUint16LE(), numRows = file.ReadUint16LE(); FileReader patternChunk = file.GetChunk(length - 4); - if(Patterns.Insert(pat, numRows)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, numRows)) { continue; } @@ -602,12 +610,15 @@ if(sampleHeader.length) { FileReader sampleChunk = file.GetChunk(sampleHeader.length); - SampleIO( - sample.uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - SampleIO::signedPCM) - .ReadSample(sample, sampleChunk); + if(loadFlags & loadSampleData) + { + SampleIO( + sample.uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + SampleIO::signedPCM) + .ReadSample(sample, sampleChunk); + } } } firstSample += instrumentHeader.smpNum; Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -278,8 +278,8 @@ } -bool CSoundFile::ReadIT(FileReader &file) -//--------------------------------------- +bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------ { file.Rewind(); @@ -291,6 +291,9 @@ || !file.CanRead(fileHeader.ordnum + (fileHeader.insnum + fileHeader.smpnum + fileHeader.patnum) * 4)) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -629,7 +632,7 @@ StringFixer::ReadString<StringFixer::spacePadded>(m_szNames[i + 1], sampleHeader.name); - if(file.Seek(sampleOffset)) + if((loadFlags & loadSampleData) && file.Seek(sampleOffset)) { sampleHeader.GetSampleFormat(fileHeader.cwtv).ReadSample(Samples[i + 1], file); lastSampleOffset = std::max(lastSampleOffset, file.GetPosition()); @@ -669,7 +672,7 @@ // Checking for number of used channels, which is not explicitely specified in the file. for(PATTERNINDEX pat = 0; pat < numPats; pat++) { - if(patPos[pat] == 0 || !file.Seek(patPos[pat])) + if(!(loadFlags & loadPatternData) || patPos[pat] == 0 || !file.Seek(patPos[pat])) continue; uint16 len = file.ReadUint16LE(); Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -35,8 +35,8 @@ } -bool CSoundFile::ReadITProject(FileReader &file) -//---------------------------------------------- +bool CSoundFile::ReadITProject(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------------- { #ifndef MODPLUG_TRACKER return false; @@ -55,6 +55,9 @@ || !ReadITPString(m_szNames[0], file)) // Song name { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -147,7 +150,7 @@ FileReader patternChunk = file.GetChunk(numRows * size * GetNumChannels()); // Allocate pattern - if(numRows == 0 || numRows > MAX_PATTERN_ROWS || Patterns.Insert(pat, numRows)) + if(!(loadFlags & loadPatternData) || numRows == 0 || numRows > MAX_PATTERN_ROWS || Patterns.Insert(pat, numRows)) { pattNames.Skip(patNameLen); continue; Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mdl.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -284,8 +284,8 @@ -bool CSoundFile::ReadMDL(const BYTE *lpStream, const DWORD dwMemLength) -//--------------------------------------------------------------------- +bool CSoundFile::ReadMDL(const BYTE *lpStream, const DWORD dwMemLength, ModLoadingFlags loadFlags) +//------------------------------------------------------------------------------------------------ { DWORD dwMemPos, dwPos, blocklen, dwTrackPos; const MDLFileHeader *pmsh = (const MDLFileHeader *)lpStream; @@ -303,6 +303,7 @@ if ((!lpStream) || (dwMemLength < 1024)) return false; if ((pmsh->id != 0x4C444D44) || ((pmsh->version & 0xF0) > 0x10)) return false; + else if(loadFlags == onlyVerifyHeader) return true; #ifdef MDL_LOG Log("MDL v%d.%d\n", pmsh->version>>4, pmsh->version&0x0f); #endif @@ -595,6 +596,10 @@ #ifdef MDL_LOG Log("sample data: %d bytes\n", blocklen); #endif + if(!(loadFlags & loadSampleData)) + { + break; + } dwPos = dwMemPos; for (i=1; i<=m_nSamples; i++) if ((Samples[i].nLength) && (!Samples[i].pSample) && (smpinfo[i] != 3) && (dwPos < dwMemLength)) { @@ -631,7 +636,7 @@ dwMemPos += blocklen; } // Unpack Patterns - if ((dwTrackPos) && (npatterns) && (m_nChannels) && (ntracks)) + if((loadFlags & loadPatternData) && (dwTrackPos) && (npatterns) && (m_nChannels) && (ntracks)) { for (UINT ipat=0; ipat<npatterns; ipat++) { Modified: trunk/OpenMPT/soundlib/Load_med.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_med.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -499,8 +499,8 @@ } -bool CSoundFile::ReadMed(const BYTE *lpStream, const DWORD dwMemLength) -//--------------------------------------------------------------------- +bool CSoundFile::ReadMed(const BYTE *lpStream, const DWORD dwMemLength, ModLoadingFlags loadFlags) +//------------------------------------------------------------------------------------------------ { const MEDMODULEHEADER *pmmh; const MMD0SONGHEADER *pmsh; @@ -520,6 +520,7 @@ if ((dwSong >= dwMemLength) || (dwSong + sizeof(MMD0SONGHEADER) >= dwMemLength)) return false; version = (signed char)((pmmh->id >> 24) & 0xFF); if ((version < '0') || (version > '3')) return false; + else if(loadFlags == onlyVerifyHeader) return true; #ifdef MED_LOG Log("\nLoading MMD%c module (flags=0x%02X)...\n", version, BigEndian(pmmh->mmdflags)); Log(" modlen = %d\n", BigEndian(pmmh->modlen)); @@ -544,6 +545,9 @@ InitializeGlobals(); InitializeChannels(); + // Setup channel pan positions and volume + SetupMODPanning(true); + m_nType = MOD_TYPE_MED; m_nSamplePreAmp = 32; dwBlockArr = BigEndian(pmmh->blockarr); @@ -652,7 +656,7 @@ sample.RelativeTone = pmsh->sample[iSHdr].strans; sample.nPan = 128; if (sample.nLoopEnd <= 2) sample.nLoopEnd = 0; - if (sample.nLoopEnd) sample.uFlags |= CHN_LOOP; + if (sample.nLoopEnd) sample.uFlags.set(CHN_LOOP); } // Common Flags m_SongFlags.set(SONG_FASTVOLSLIDES, !(pmsh->flags & 0x20)); @@ -830,10 +834,17 @@ } } Samples[iSmp + 1].nLength = len; - FileReader chunk(psdata, dwMemLength - dwPos - 6); - sampleIO.ReadSample(Samples[iSmp + 1], chunk); + if(loadFlags & loadSampleData) + { + FileReader chunk(psdata, dwMemLength - dwPos - 6); + sampleIO.ReadSample(Samples[iSmp + 1], chunk); + } } // Reading patterns (blocks) + if(!(loadFlags & loadPatternData)) + { + return true; + } if (wNumBlocks > MAX_PATTERNS) wNumBlocks = MAX_PATTERNS; if ((!dwBlockArr) || (dwBlockArr > dwMemLength - 4*wNumBlocks)) return true; pdwTable = (LPDWORD)(lpStream + dwBlockArr); @@ -942,8 +953,6 @@ } } } - // Setup channel pan positions and volume - SetupMODPanning(true); return true; } Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -473,8 +473,8 @@ #define MIDIGLOBAL_XGSYSTEMON 0x0200 -bool CSoundFile::ReadMID(const BYTE *lpStream, DWORD dwMemLength) -//--------------------------------------------------------------- +bool CSoundFile::ReadMID(const BYTE *lpStream, DWORD dwMemLength, ModLoadingFlags loadFlags) +//------------------------------------------------------------------------------------------ { const MIDIFILEHEADER *pmfh = (const MIDIFILEHEADER *)lpStream; const MIDITRACKHEADER *pmth; @@ -529,6 +529,7 @@ pmth = (MIDITRACKHEADER *)(lpStream+dwMemPos); tracks = BigEndianW(pmfh->wTrks); if ((pmth->id != 0x6B72544D) || (!tracks)) return false; + else if(loadFlags == onlyVerifyHeader) return true; miditracks.resize(tracks); // Reading File... Modified: trunk/OpenMPT/soundlib/Load_mo3.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mo3.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_mo3.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -16,21 +16,24 @@ #endif // MODPLUG_TRACKER -bool CSoundFile::ReadMO3(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadMO3(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); const void *stream = file.GetRawData(); int length = file.GetLength(); // No valid MO3 file (magic bytes: "MO3") - if(file.GetLength() < 8 || !file.ReadMagic("MO3")) + if(!file.CanRead(8) || !file.ReadMagic("MO3")) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } #ifdef NO_MO3 - // As of April 2012, the format revision is 5; Versions > 31 are unlikely to exist in the next few years, + // As of April 2013, the format revision is 5; Versions > 31 are unlikely to exist in the next few years, // so we will just ignore those if there's no UNMO3 library to tell us if the file is valid or not // (avoid log entry with .MOD files that have a song name starting with "MO3". if(file.ReadUint8() > 31) @@ -79,12 +82,12 @@ { FileReader unpackedFile(stream, length); - result = ReadXM(unpackedFile) - || ReadIT(unpackedFile) - || ReadS3M(unpackedFile) - || ReadMTM(unpackedFile) - || ReadMod(unpackedFile) - || ReadM15(unpackedFile); + result = ReadXM(unpackedFile, loadFlags) + || ReadIT(unpackedFile, loadFlags) + || ReadS3M(unpackedFile, loadFlags) + || ReadMTM(unpackedFile, loadFlags) + || ReadMod(unpackedFile, loadFlags) + || ReadM15(unpackedFile, loadFlags); } UNMO3_Free(stream); Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -474,8 +474,8 @@ } -bool CSoundFile::ReadMod(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadMod(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { char magic[4]; if(!file.Seek(1080) || !file.ReadArray(magic)) @@ -520,6 +520,10 @@ { return false; } + if(loadFlags == onlyVerifyHeader) + { + return true; + } LimitMax(m_nChannels, MAX_BASECHANNELS); @@ -625,17 +629,19 @@ if((pat % 2u) == 0) { // Only create "even" patterns for FLT8 files - if(Patterns.Insert(pat / 2, 64)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat / 2, 64)) { - break; + file.Skip(readChannels * 64 * 4); + continue; } } actualPattern /= 2; } else { - if(Patterns.Insert(pat, 64)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, 64)) { - break; + file.Skip(readChannels * 64 * 4); + continue; } } @@ -689,9 +695,12 @@ } // Reading samples - for(SAMPLEINDEX smp = 1; smp <= 31; smp++) + if(loadFlags & loadSampleData) { - MODSampleHeader::GetSampleFormat().ReadSample(Samples[smp], file); + for(SAMPLEINDEX smp = 1; smp <= 31; smp++) + { + MODSampleHeader::GetSampleFormat().ReadSample(Samples[smp], file); + } } // Fix VBlank MODs. Arbitrary threshold: 10 minutes. @@ -741,8 +750,8 @@ } -bool CSoundFile::ReadM15(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadM15(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); @@ -840,6 +849,11 @@ return false; } + if(loadFlags == onlyVerifyHeader) + { + return true; + } + // Now we can be pretty sure that this is a valid Soundtracker file. Set up default song settings. m_nType = MOD_TYPE_MOD; m_nChannels = 4; @@ -934,9 +948,10 @@ // Reading patterns for(PATTERNINDEX pat = 0; pat < numPatterns; pat++) { - if(Patterns.Insert(pat, 64)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, 64)) { - break; + file.Skip(64 * 4 * 4); + continue; } for(ROWINDEX row = 0; row < 64; row++) @@ -1016,15 +1031,18 @@ } // Reading samples - for(SAMPLEINDEX smp = 1; smp <= 15; smp++) + if(loadFlags & loadSampleData) { - // Looped samples in (Ultimate) Soundtracker seem to ignore all sample data before the actual loop start. - // This avoids the clicks in the first sample of pretend.mod by Karsten Obarski. - file.Skip(Samples[smp].nLoopStart); - Samples[smp].nLength -= Samples[smp].nLoopStart; - Samples[smp].nLoopEnd -= Samples[smp].nLoopStart; - Samples[smp].nLoopStart = 0; - MODSampleHeader::GetSampleFormat().ReadSample(Samples[smp], file); + for(SAMPLEINDEX smp = 1; smp <= 15; smp++) + { + // Looped samples in (Ultimate) Soundtracker seem to ignore all sample data before the actual loop start. + // This avoids the clicks in the first sample of pretend.mod by Karsten Obarski. + file.Skip(Samples[smp].nLoopStart); + Samples[smp].nLength -= Samples[smp].nLoopStart; + Samples[smp].nLoopEnd -= Samples[smp].nLoopStart; + Samples[smp].nLoopStart = 0; + MODSampleHeader::GetSampleFormat().ReadSample(Samples[smp], file); + } } return true; Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mt2.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -216,8 +216,8 @@ } -bool CSoundFile::ReadMT2(LPCBYTE lpStream, DWORD dwMemLength) -//----------------------------------------------------------- +bool CSoundFile::ReadMT2(LPCBYTE lpStream, DWORD dwMemLength, ModLoadingFlags loadFlags) +//-------------------------------------------------------------------------------------- { MT2FILEHEADER *pfh = (MT2FILEHEADER *)lpStream; DWORD dwMemPos, dwDrumDataPos, dwExtraDataPos; @@ -229,7 +229,13 @@ if ((!lpStream) || (dwMemLength < sizeof(MT2FILEHEADER)) || (pfh->dwMT20 != 0x3032544D) || (pfh->wVersion < 0x0200) || (pfh->wVersion >= 0x0300) - || (pfh->wChannels < 1) || (pfh->wChannels > MAX_BASECHANNELS)) return false; + || (pfh->wChannels < 1) || (pfh->wChannels > MAX_BASECHANNELS)) + { + return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; + } pdd = NULL; InitializeGlobals(); @@ -314,7 +320,7 @@ dwMemPos += 6; if (dwMemPos + wDataLen > dwMemLength) break; UINT nLines = pmp->wLines; - if ((iPat < MAX_PATTERNS) && (nLines > 0) && (nLines <= MAX_PATTERN_ROWS)) + if ((iPat < MAX_PATTERNS) && (nLines > 0) && (nLines <= MAX_PATTERN_ROWS) && (loadFlags & loadPatternData)) { #ifdef MT2DEBUG Log("Pattern #%d @%04X: %d lines, %d bytes\n", iPat, dwMemPos-6, nLines, pmp->wDataLen); @@ -614,6 +620,10 @@ #ifdef MT2DEBUG Log("Loading sample data at offset 0x%08X\n", dwMemPos); #endif + if(!(loadFlags & loadSampleData)) + { + return true; + } for (UINT iData=0; iData<256; iData++) if ((iData < m_nSamples) && (SampleMap[iData])) { MT2SAMPLE *pms = SampleMap[iData]; Modified: trunk/OpenMPT/soundlib/Load_mtm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mtm.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_mtm.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -97,8 +97,8 @@ #endif -bool CSoundFile::ReadMTM(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadMTM(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); MTMFileHeader fileHeader; @@ -113,6 +113,9 @@ || file.BytesLeft() < sizeof(MTMSampleHeader) * fileHeader.numSamples + 128 + 192 * fileHeader.numTracks + 64 * (fileHeader.lastPattern + 1) + fileHeader.commentSize) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -147,7 +150,7 @@ for(PATTERNINDEX pat = 0; pat <= fileHeader.lastPattern; pat++) { - if(Patterns.Insert(pat, rowsPerPat)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, rowsPerPat)) { break; } @@ -195,14 +198,17 @@ } // Reading Samples - for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + if(loadFlags & loadSampleData) { - SampleIO( - Samples[smp].uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - SampleIO::unsignedPCM) - .ReadSample(Samples[smp], file); + for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + { + SampleIO( + Samples[smp].uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + SampleIO::unsignedPCM) + .ReadSample(Samples[smp], file); + } } m_nMinPeriod = 64; Modified: trunk/OpenMPT/soundlib/Load_okt.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_okt.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_okt.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -279,8 +279,8 @@ } -bool CSoundFile::ReadOKT(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadOKT(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); if(!file.ReadMagic("OKTASONG")) @@ -332,6 +332,11 @@ ChnSettings[m_nChannels].Reset(); ChnSettings[m_nChannels++].nPan = (((nChn & 3) == 1) || ((nChn & 3) == 2)) ? 0xC0 : 0x40; } + + if(loadFlags == onlyVerifyHeader) + { + return true; + } break; case OktIffChunk::idSAMP: @@ -404,19 +409,22 @@ } // Read patterns - for(PATTERNINDEX nPat = 0; nPat < patternChunks.size(); nPat++) + if(loadFlags & loadPatternData) { - if(patternChunks[nPat].GetLength() > 0) - ReadOKTPattern(patternChunks[nPat], nPat, *this); - else - Patterns.Insert(nPat, 64); // invent empty pattern + for(PATTERNINDEX nPat = 0; nPat < patternChunks.size(); nPat++) + { + if(patternChunks[nPat].GetLength() > 0) + ReadOKTPattern(patternChunks[nPat], nPat, *this); + else + Patterns.Insert(nPat, 64); // invent empty pattern + } } // Read samples size_t nFileSmp = 0; for(SAMPLEINDEX nSmp = 1; nSmp < m_nSamples; nSmp++) { - if(nFileSmp >= sampleChunks.size()) + if(nFileSmp >= sampleChunks.size() || !(loadFlags & loadSampleData)) break; ModSample &mptSample = Samples[nSmp]; Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -266,8 +266,8 @@ } -bool CSoundFile::ReadPSM(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadPSM(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); PSMFileHeader fileHeader; @@ -284,6 +284,9 @@ || fileHeader.fileInfoID != PSMFileHeader::magicFILE) // "FILE" { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } // Yep, this seems to be a valid file. @@ -589,46 +592,49 @@ subsongs.push_back(subsong); } - // // DSMP - Samples - vector<FileReader> sampleChunks = chunks.GetAllChunks(PSMChunk::idDSMP); - for(vector<FileReader>::iterator sampleIter = sampleChunks.begin(); sampleIter != sampleChunks.end(); sampleIter++) + // DSMP - Samples + if(loadFlags & loadSampleData) { - FileReader chunk(*sampleIter); - if(!newFormat) + vector<FileReader> sampleChunks = chunks.GetAllChunks(PSMChunk::idDSMP); + for(vector<FileReader>::iterator sampleIter = sampleChunks.begin(); sampleIter != sampleChunks.end(); sampleIter++) { - // Original header - PSMOldSampleHeader sampleHeader; - if(!chunk.ReadConvertEndianness(sampleHeader)) + FileReader chunk(*sampleIter); + if(!newFormat) { - continue; - } + // Original header + PSMOldSampleHeader sampleHeader; + if(!chunk.ReadConvertEndianness(sampleHeader)) + { + continue; + } - SAMPLEINDEX smp = static_cast<SAMPLEINDEX>(sampleHeader.sampleNumber + 1); - if(smp < MAX_SAMPLES) - { - m_nSamples = MAX(m_nSamples, smp); - StringFixer::ReadString<StringFixer::nullTerminated>(m_szNames[smp], sampleHeader.sampleName); + SAMPLEINDEX smp = static_cast<SAMPLEINDEX>(sampleHeader.sampleNumber + 1); + if(smp < MAX_SAMPLES) + { + m_nSamples = MAX(m_nSamples, smp); + StringFixer::ReadString<StringFixer::nullTerminated>(m_szNames[smp], sampleHeader.sampleName); - sampleHeader.ConvertToMPT(Samples[smp]); - sampleHeader.GetSampleFormat().ReadSample(Samples[smp], chunk); - } - } else - { - // Sinaria uses a slightly different sample header - PSMNewSampleHeader sampleHeader; - if(!chunk.ReadConvertEndianness(sampleHeader)) + sampleHeader.ConvertToMPT(Samples[smp]); + sampleHeader.GetSampleFormat().ReadSample(Samples[smp], chunk); + } + } else { - continue; - } + // Sinaria uses a slightly different sample header + PSMNewSampleHeader sampleHeader; + if(!chunk.ReadConvertEndianness(sampleHeader)) + { + continue; + } - SAMPLEINDEX smp = static_cast<SAMPLEINDEX>(sampleHeader.sampleNumber + 1); - if(smp < MAX_SAMPLES) - { - m_nSamples = MAX(m_nSamples, smp); - StringFixer::ReadString<StringFixer::nullTerminated>(m_szNames[smp], sampleHeader.sampleName); + SAMPLEINDEX smp = static_cast<SAMPLEINDEX>(sampleHeader.sampleNumber + 1); + if(smp < MAX_SAMPLES) + { + m_nSamples = MAX(m_nSamples, smp); + StringFixer::ReadString<StringFixer::nullTerminated>(m_szNames[smp], sampleHeader.sampleName); - sampleHeader.ConvertToMPT(Samples[smp]); - sampleHeader.GetSampleFormat().ReadSample(Samples[smp], chunk); + sampleHeader.ConvertToMPT(Samples[smp]); + sampleHeader.GetSampleFormat().ReadSample(Samples[smp], chunk); + } } } } @@ -645,6 +651,11 @@ ChnSettings[chn].dwFlags.set(CHN_SURROUND, subsongs[0].channelSurround[chn]); } + if(!(loadFlags & loadPatternData)) + { + return true; + } + // Now that we know the number of channels, we can go through all the patterns. // This is a bit stupid since we will even read duplicate patterns twice, but hey, we do this just once... so who cares? PATTERNINDEX pat = 0; @@ -1122,18 +1133,15 @@ #endif -bool CSoundFile::ReadPSM16(FileReader &file) -//------------------------------------------ +bool CSoundFile::ReadPSM16(FileReader &file, ModLoadingFlags loadFlags) +//--------------------------------------------------------------------- { file.Rewind(); + + // Is it a valid PSM16 file? PSM16FileHeader fileHeader; - if(!file.ReadConvertEndianness(fileHeader)) - { - return false; - } - - // Check header - if(fileHeader.formatID != PSM16FileHeader::magicPSM_ // "PSM\xFE" + if(!file.ReadConvertEndianness(fileHeader) + || fileHeader.formatID != PSM16FileHeader::magicPSM_ // "PSM\xFE" || fileHeader.lineEnd != 0x1A || (fileHeader.formatVersion != 0x10 && fileHeader.formatVersion != 0x01) // why is this sometimes 0x01? || fileHeader.patternVersion != 0 // 255ch pattern version not supported (did anyone use this?) @@ -1141,6 +1149,9 @@ || std::max(fileHeader.numChannelsPlay, fileHeader.numChannelsReal) == 0) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } // Seems to be valid! @@ -1200,6 +1211,10 @@ } // Read patterns + if(!(loadFlags & loadPatternData)) + { + return true; + } if(fileHeader.patOffset > 4 && file.Seek(fileHeader.patOffset - 4) && file.ReadUint32LE() == PSM16FileHeader::idPPAT) { for(PATTERNINDEX pat = 0; pat < fileHeader.numPatterns; pat++) Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ptm.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -64,8 +64,8 @@ #endif -bool CSoundFile::ReadPTM(const BYTE *lpStream, const DWORD dwMemLength) -//--------------------------------------------------------------------- +bool CSoundFile::ReadPTM(const BYTE *lpStream, const DWORD dwMemLength, ModLoadingFlags loadFlags) +//------------------------------------------------------------------------------------------------ { if(lpStream == nullptr || dwMemLength < sizeof(PTMFILEHEADER)) return false; @@ -91,7 +91,13 @@ || (pfh.norders > 256) || (!pfh.norders) || (!pfh.nsamples) || (pfh.nsamples > 255) || (!pfh.npatterns) || (pfh.npatterns > 128) - || (sizeof(PTMFILEHEADER) + pfh.nsamples * sizeof(PTMSAMPLE) >= dwMemLength)) return false; + || (sizeof(PTMFILEHEADER) + pfh.nsamples * sizeof(PTMSAMPLE) >= dwMemLength)) + { + return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; + } StringFixer::ReadString<StringFixer::maybeNullTerminated>(m_szNames[0], pfh.songname); @@ -144,7 +150,7 @@ sample.nLoopStart /= 2; sample.nLoopEnd /= 2; } - if(sample.nLength && samplepos && samplepos < dwMemLength) + if(sample.nLength && samplepos && samplepos < dwMemLength && (loadFlags & loadSampleData)) { FileReader chunk(lpStream + samplepos, dwMemLength - samplepos); sampleIO.ReadSample(sample, chunk); @@ -152,6 +158,10 @@ } } // Reading Patterns + if(!(loadFlags && loadPatternData)) + { + return true; + } for (UINT ipat=0; ipat<pfh.npatterns; ipat++) { dwMemPos = ((UINT)pfh.patseg[ipat]) << 4; Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -424,23 +424,23 @@ }; -bool CSoundFile::ReadS3M(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadS3M(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); + // Is it a valid S3M file? S3MFileHeader fileHeader; - if(!file.ReadConvertEndianness(fileHeader) || !file.CanRead(fileHeader.ordNum + (fileHeader.smpNum + fileHeader.patNum) * 2)) - { - return false; - } - - // Is it a valid S3M file? - if(fileHeader.magic != S3MFileHeader::idSCRM + if(!file.ReadConvertEndianness(fileHeader) + || !file.CanRead(fileHeader.ordNum + (fileHeader.smpNum + fileHeader.patNum) * 2) + || fileHeader.magic != S3MFileHeader::idSCRM || fileHeader.fileType != S3MFileHeader::idS3MType || (fileHeader.formatVersion != S3MFileHeader::oldVersion && fileHeader.formatVersion != S3MFileHeader::newVersion)) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -598,7 +598,7 @@ const uint32 sampleOffset = (sampleHeader.dataPointer[1] << 4) | (sampleHeader.dataPointer[2] << 12) | (sampleHeader.dataPointer[0] << 20); - if(sampleHeader.length != 0 && file.Seek(sampleOffset)) + if((loadFlags & loadSampleData) && sampleHeader.length != 0 && file.Seek(sampleOffset)) { sampleHeader.GetSampleFormat((fileHeader.formatVersion == S3MFileHeader::oldVersion)).ReadSample(Samples[smp + 1], file); } @@ -620,6 +620,10 @@ int zxxCountRight = 0, zxxCountLeft = 0; // Reading patterns + if(!(loadFlags & loadPatternData)) + { + return true; + } const PATTERNINDEX readPatterns = MIN(fileHeader.patNum, MAX_PATTERNS); for(PATTERNINDEX pat = 0; pat < readPatterns; pat++) { Modified: trunk/OpenMPT/soundlib/Load_stm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_stm.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -112,8 +112,8 @@ #endif -bool CSoundFile::ReadSTM(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadSTM(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); @@ -125,6 +125,9 @@ && _strnicmp(fileHeader.trackername, "BMOD2STM", 8))) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } StringFixer::ReadString<StringFixer::maybeNullTerminated>(m_szNames[0], fileHeader.songname); @@ -171,8 +174,9 @@ { STMPatternEntry patternData[64 * 4]; - if(Patterns.Insert(pat, 64) || !file.ReadArray(patternData)) + if(!(loadFlags & loadPatternData) || Patterns.Insert(pat, 64) || !file.ReadArray(patternData)) { + file.Skip(sizeof(patternData)); continue; } @@ -272,27 +276,31 @@ } // Reading Samples - const SampleIO sampleIO( - SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - SampleIO::signedPCM); + if(loadFlags & loadSampleData) + { + const SampleIO sampleIO( + SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + SampleIO::signedPCM); - for(SAMPLEINDEX smp = 1; smp <= 31; smp++) - { - ModSample &sample = Samples[smp]; - if(sample.nLength) + for(SAMPLEINDEX smp = 1; smp <= 31; smp++) { - //size_t sampleOffset = fileHeader.samples[smp - 1].offset << 4; - //if(sampleOffset > sizeof(STMPatternEntry) && sampleOffset < file.GetLength()) - //{ - // file.Seek(sampleOffset); - //} else + ModSample &sample = Samples[smp]; + if(sample.nLength) { - file.Seek((file.GetPosition() + 15) & (~15)); + //size_t sampleOffset = fileHeader.samples[smp - 1].offset << 4; + //if(sampleOffset > sizeof(STMPatternEntry) && sampleOffset < file.GetLength()) + //{ + // file.Seek(sampleOffset); + //} else + { + file.Seek((file.GetPosition() + 15) & (~15)); + } + sampleIO.ReadSample(sample, file); } - sampleIO.ReadSample(sample, file); } } + return true; } Modified: trunk/OpenMPT/soundlib/Load_ult.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -374,8 +374,8 @@ }; -bool CSoundFile::ReadUlt(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadUlt(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); UltFileHeader fileHeader; @@ -387,6 +387,9 @@ || memcmp(fileHeader.signature, "MAS_UTrack_V00", sizeof(fileHeader.signature)) != 0) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); @@ -476,14 +479,17 @@ // Post-fix some effects. Patterns.ForEachModCommand(PostFixUltCommands(GetNumChannels())); - for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + if(loadFlags & loadSampleData) { - SampleIO( - Samples[smp].uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, - SampleIO::mono, - SampleIO::littleEndian, - SampleIO::signedPCM) - .ReadSample(Samples[smp], file); + for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + { + SampleIO( + Samples[smp].uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, + SampleIO::mono, + SampleIO::littleEndian, + SampleIO::signedPCM) + .ReadSample(Samples[smp], file); + } } return true; } \ No newline at end of file Modified: trunk/OpenMPT/soundlib/Load_umx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_umx.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_umx.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -159,8 +159,8 @@ } -bool CSoundFile::ReadUMX(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadUMX(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { file.Rewind(); UMXFileHeader fileHeader; @@ -229,6 +229,9 @@ if(!isMusic && !isSound) { continue; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } FileReader chunk = file.GetChunk(objOffset, objSize); @@ -275,15 +278,15 @@ if(isMusic) { // Read as module - if(ReadIT(fileChunk) - || ReadXM(fileChunk) - || ReadS3M(fileChunk) - || ReadWav(fileChunk) - || ReadSTM(fileChunk) - || Read669(fileChunk) - || ReadFAR(fileChunk) - || ReadMod(fileChunk) - || ReadM15(fileChunk)) + if(ReadIT(fileChunk, loadFlags) + || ReadXM(fileChunk, loadFlags) + || ReadS3M(fileChunk, loadFlags) + || ReadWav(fileChunk, loadFlags) + || ReadSTM(fileChunk, loadFlags) + || Read669(fileChunk, loadFlags) + || ReadFAR(fileChunk, loadFlags) + || ReadMod(fileChunk, loadFlags) + || ReadM15(fileChunk, loadFlags)) { return true; } Modified: trunk/OpenMPT/soundlib/Load_wav.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_wav.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_wav.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -40,8 +40,8 @@ } -bool CSoundFile::ReadWav(FileReader &file) -//---------------------------------------- +bool CSoundFile::ReadWav(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------- { WAVReader wavFile(file); @@ -53,6 +53,9 @@ || (wavFile.GetSampleFormat() != WAVFormatChunk::fmtPCM && wavFile.GetSampleFormat() != WAVFormatChunk::fmtFloat)) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -247,8 +247,8 @@ }; -bool CSoundFile::ReadXM(FileReader &file) -//--------------------------------------- +bool CSoundFile::ReadXM(FileReader &file, ModLoadingFlags loadFlags) +//------------------------------------------------------------------ { file.Rewind(); @@ -260,6 +260,9 @@ || !file.CanRead(fileHeader.orders)) { return false; + } else if(loadFlags == onlyVerifyHeader) + { + return true; } InitializeGlobals(); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 23:06:51 UTC (rev 1988) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 23:45:18 UTC (rev 1989) @@ -509,13 +509,13 @@ #ifdef MODPLUG_TRACKER -BOOL CSoundFile::Create(FileReader filereader, CModDoc *pModDoc) -//-------------------------------------------------------------- +BOOL CSoundFile::Create(FileReader file, ModLoadingFlags loadFlags, CModDoc *pModDoc) +//----------------------------------... [truncated message content] |
From: <sag...@us...> - 2013-04-28 00:55:46
|
Revision: 1990 http://sourceforge.net/p/modplug/code/1990 Author: saga-games Date: 2013-04-28 00:55:38 +0000 (Sun, 28 Apr 2013) Log Message: ----------- [Mod] Added a few more mod type checks in Snd_fx.cpp (helpful for libopenmpt) Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-27 23:45:18 UTC (rev 1989) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-28 00:55:38 UTC (rev 1990) @@ -395,12 +395,17 @@ case MOD_TYPE_MTM: m_SndFile.ChangeModTypeTo(MOD_TYPE_S3M); break; + case MOD_TYPE_AMS: + case MOD_TYPE_AMS2: + case MOD_TYPE_DMF: + case MOD_TYPE_DBM: case MOD_TYPE_IMF: case MOD_TYPE_PSM: case MOD_TYPE_J2B: case MOD_TYPE_ULT: case MOD_TYPE_OKT: case MOD_TYPE_MT2: + case MOD_TYPE_MDL: default: m_SndFile.ChangeModTypeTo(MOD_TYPE_IT); } Modified: trunk/OpenMPT/soundlib/Load_far.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_far.cpp 2013-04-27 23:45:18 UTC (rev 1989) +++ trunk/OpenMPT/soundlib/Load_far.cpp 2013-04-28 00:55:38 UTC (rev 1990) @@ -199,7 +199,7 @@ CMD_VOLUMESLIDE, // down CMD_VIBRATO, // sustained (?) CMD_NONE, // actually slide-to-volume - CMD_PANNING8, + CMD_S3MCMDEX, // panning CMD_S3MCMDEX, // note offset => note delay? CMD_NONE, // fine tempo down CMD_NONE, // fine tempo up @@ -269,15 +269,17 @@ break; case 0x06: // Vibrato speed case 0x07: // Volume slide up - case 0x0B: // Panning m.param *= 8; break; case 0x0A: // Volume-portamento (what!) m.volcmd = VOLCMD_VOLUME; m.vol = (m.param << 2) + 4; break; + case 0x0B: // Panning + m.param |= 0x80; + break; case 0x0C: // Note offset - m.param = 6 / (1 + (m.param & 0x0F)) + 1; + m.param = 6 / (1 + m.param) + 1; m.param |= 0x0D; } m.command = farEffects[data[3] >> 4]; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-27 23:45:18 UTC (rev 1989) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-28 00:55:38 UTC (rev 1990) @@ -327,14 +327,14 @@ case CMD_SPEED: if (!param) break; // Allow high speed values here for VBlank MODs. (Maybe it would be better to have a "VBlank MOD" flag somewhere? Is it worth the effort?) - if ((param <= GetModSpecifications().speedMax) || (m_nType & MOD_TYPE_MOD)) + if ((param <= GetModSpecifications().speedMax) || GetType() == MOD_TYPE_MOD) { memory.musicSpeed = param; } break; // Set Tempo case CMD_TEMPO: - if ((adjustMode & eAdjust) && (m_nType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))) + if ((adjustMode & eAdjust) && (GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))) { if (param) pChn->nOldTempo = (BYTE)param; else param = pChn->nOldTempo; } @@ -447,7 +447,7 @@ // break; // } - if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) param <<= 1; + if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM))) param <<= 1; // IT compatibility 16. FT2, ST3 and IT ignore out-of-range values if(param <= 128) { @@ -467,25 +467,25 @@ if (((param & 0x0F) == 0x0F) && (param & 0xF0)) { param >>= 4; - if (!(GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT))) param <<= 1; + if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM))) param <<= 1; memory.glbVol += param << 1; } else if (((param & 0xF0) == 0xF0) && (param & 0x0F)) { param = (param & 0x0F) << 1; - if (!(GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT))) param <<= 1; + if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM))) param <<= 1; memory.glbVol -= param; } else if (param & 0xF0) { param >>= 4; param <<= 1; - if (!(GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT))) param <<= 1; + if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM))) param <<= 1; memory.glbVol += param * memory.musicSpeed; } else { param = (param & 0x0F) << 1; - if (!(GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT))) param <<= 1; + if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM))) param <<= 1; memory.glbVol -= param * memory.musicSpeed; } memory.glbVol = CLAMP(memory.glbVol, 0, 256); @@ -2241,7 +2241,7 @@ case CMD_ARPEGGIO: // IT compatibility 01. Don't ignore Arpeggio if no note is playing (also valid for ST3) if ((m_nTickCount) || (((!pChn->nPeriod) || !pChn->nNote) && !IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER))) break; - if ((!param) && (!(GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)))) break; + if ((!param) && (!(GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)))) break; // Only important when editing MOD/XM files pChn->nCommand = CMD_ARPEGGIO; if (param) pChn->nArpeggio = param; break; @@ -2322,7 +2322,7 @@ break; } - if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) param *= 2; + if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM))) param *= 2; // IT compatibility 16. FT2, ST3 and IT ignore out-of-range values. // Test case: globalvol-invalid.it @@ -2353,18 +2353,21 @@ { pChn->dwFlags.reset(CHN_SURROUND); } - if (GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_XM | MOD_TYPE_MOD | MOD_TYPE_MT2)) + if(!(GetType() & (MOD_TYPE_S3M | MOD_TYPE_PTM | MOD_TYPE_DSM | MOD_TYPE_AMF | MOD_TYPE_MTM))) { + // Real 8-bit panning pChn->nPan = param; } else - if (param <= 0x80) { - pChn->nPan = param << 1; - } else - if (param == 0xA4) - { - pChn->dwFlags.set(CHN_SURROUND); - pChn->nPan = 0x80; + // 7-bit panning + surround + if(param <= 0x80) + { + pChn->nPan = param << 1; + } else if(param == 0xA4) + { + pChn->dwFlags.set(CHN_SURROUND); + pChn->nPan = 0x80; + } } pChn->dwFlags.set(CHN_FASTVOLRAMP); pChn->nRestorePanOnNewNote = 0; @@ -2652,7 +2655,7 @@ else param = pChn->nOldPortaUpDown; - const bool doFineSlides = !doFinePortamentoAsRegular && (GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_STM)); + const bool doFineSlides = !doFinePortamentoAsRegular && !(GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM | MOD_TYPE_MT2 | MOD_TYPE_MED | MOD_TYPE_AMF0 | MOD_TYPE_DIGI)); // Process MIDI pitch bend for instrument plugins MidiPortamento(nChn, param, doFineSlides); @@ -2700,7 +2703,7 @@ else param = pChn->nOldPortaUpDown; - const bool doFineSlides = !doFinePortamentoAsRegular && (GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_STM)); + const bool doFineSlides = !doFinePortamentoAsRegular && !(GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM | MOD_TYPE_MT2 | MOD_TYPE_MED | MOD_TYPE_AMF0 | MOD_TYPE_DIGI)); // Process MIDI pitch bend for instrument plugins MidiPortamento(nChn, -static_cast<int>(param), doFineSlides); @@ -2964,7 +2967,7 @@ pChn->nOldPortaUpDown = param; } - if(m_nType == MOD_TYPE_MPT && pChn->pModInstrument && pChn->pModInstrument->pTuning) + if(GetType() == MOD_TYPE_MPT && pChn->pModInstrument && pChn->pModInstrument->pTuning) { //Behavior: Param tells number of finesteps(or 'fullsteps'(notes) with glissando) //to slide per row(not per tick). @@ -3089,7 +3092,7 @@ else param = pChn->nOldVolumeSlide; - if((GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM | MOD_TYPE_MT2))) + if((GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM | MOD_TYPE_MT2 | MOD_TYPE_MED | MOD_TYPE_DIGI | MOD_TYPE_DBM))) { // MOD / XM nibble priority if((param & 0xF0) != 0) @@ -3102,7 +3105,7 @@ } int newvolume = pChn->nVolume; - if (GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM|MOD_TYPE_AMF)) + if(!(GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM | MOD_TYPE_AMF0 | MOD_TYPE_DIGI | MOD_TYPE_MED))) { if ((param & 0x0F) == 0x0F) //Fine upslide or slide -15 { @@ -3145,7 +3148,7 @@ { newvolume += (int)((param & 0xF0) >> 2); } - if (m_nType == MOD_TYPE_MOD) pChn->dwFlags.set(CHN_FASTVOLRAMP); + if (GetType() == MOD_TYPE_MOD) pChn->dwFlags.set(CHN_FASTVOLRAMP); } newvolume = Clamp(newvolume, 0, 256); @@ -3180,7 +3183,7 @@ int32 nPanSlide = 0; - if (GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM)) + if(!(GetType() & (MOD_TYPE_XM | MOD_TYPE_MT2))) { if (((param & 0x0F) == 0x0F) && (param & 0xF0)) { @@ -3315,7 +3318,7 @@ { if (param & 0x0F) { - if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (param & 0xF0) == 0) + if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_J2B | MOD_TYPE_DBM)) || (param & 0xF0) == 0) nChnSlide = -(int)(param & 0x0F); } else { @@ -3342,9 +3345,9 @@ { // E0x: Set Filter // E1x: Fine Portamento Up - case 0x10: if ((param) || (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2))) FinePortamentoUp(pChn, param); break; + case 0x10: if ((param) || (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))) FinePortamentoUp(pChn, param); break; // E2x: Fine Portamento Down - case 0x20: if ((param) || (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2))) FinePortamentoDown(pChn, param); break; + case 0x20: if ((param) || (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))) FinePortamentoDown(pChn, param); break; // E3x: Set Glissando Control case 0x30: pChn->dwFlags.set(CHN_GLISSANDO, param != 0); break; // E4x: Set Vibrato WaveForm @@ -3354,7 +3357,7 @@ { break; } - if(GetType() == MOD_TYPE_MOD) + if(GetType() & (MOD_TYPE_MOD | MOD_TYPE_DIGI | MOD_TYPE_AMF0 | MOD_TYPE_MED)) { pChn->nFineTune = MOD2XMFineTune(param); if(pChn->nPeriod && pChn->rowCommand.IsNote()) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed); @@ -3384,9 +3387,9 @@ // E9x: Retrig case 0x90: RetrigNote(nChn, param); break; // EAx: Fine Volume Up - case 0xA0: if ((param) || (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2))) FineVolumeUp(pChn, param, false); break; + case 0xA0: if ((param) || (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))) FineVolumeUp(pChn, param, false); break; // EBx: Fine Volume Down - case 0xB0: if ((param) || (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2))) FineVolumeDown(pChn, param, false); break; + case 0xB0: if ((param) || (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))) FineVolumeDown(pChn, param, false); break; // ECx: Note Cut case 0xC0: NoteCut(nChn, param); break; // EDx: Note Delay @@ -4054,7 +4057,7 @@ } // -! NEW_FEATURE#0010 - if ((pChn->rowCommand.note >= NOTE_MIN) && (pChn->rowCommand.note <= NOTE_MAX)) + if(pChn->rowCommand.IsNote()) { pChn->nPos = param; pChn->nPosLo = 0; @@ -4515,7 +4518,7 @@ if (param & 0xF0) { // IT compatibility: Ignore slide commands with both nibbles set. - if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (param & 0x0F) == 0) + if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM)) || (param & 0x0F) == 0) nGlbSlide = (int)((param & 0xF0) >> 4) * 2; } else { @@ -4525,7 +4528,7 @@ } if (nGlbSlide) { - if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) nGlbSlide *= 2; + if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DBM))) nGlbSlide *= 2; nGlbSlide += m_nGlobalVolume; Limit(nGlbSlide, 0, 256); m_nGlobalVolume = nGlbSlide; @@ -4577,7 +4580,7 @@ //--------------------------------------------------- { if (!period) return 0; - if (m_nType & (MOD_TYPE_MED|MOD_TYPE_MOD|MOD_TYPE_DIGI|MOD_TYPE_MTM|MOD_TYPE_669|MOD_TYPE_OKT|MOD_TYPE_AMF0)) + if (GetType() & (MOD_TYPE_MED|MOD_TYPE_MOD|MOD_TYPE_DIGI|MOD_TYPE_MTM|MOD_TYPE_669|MOD_TYPE_OKT|MOD_TYPE_AMF0)) { period >>= 2; for (UINT i=0; i<6*12; i++) @@ -4612,7 +4615,7 @@ { if ((!note) || (note >= NOTE_MIN_SPECIAL)) return 0; if (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_MDL|MOD_TYPE_ULT|MOD_TYPE_WAV - |MOD_TYPE_FAR|MOD_TYPE_DMF|MOD_TYPE_PTM|MOD_TYPE_AMS|MOD_TYPE_AMS2|MOD_TYPE_DIGI|MOD_TYPE_DBM|MOD_TYPE_AMF|MOD_TYPE_PSM|MOD_TYPE_J2B|MOD_TYPE_IMF)) + |MOD_TYPE_FAR|MOD_TYPE_DMF|MOD_TYPE_PTM|MOD_TYPE_AMS|MOD_TYPE_AMS2|MOD_TYPE_DBM|MOD_TYPE_AMF|MOD_TYPE_PSM|MOD_TYPE_J2B|MOD_TYPE_IMF)) { note--; if(m_SongFlags[SONG_LINEARSLIDES]) @@ -4674,11 +4677,11 @@ //----------------------------------------------------------------------------------- { if (!period) return 0; - if (GetType() & (MOD_TYPE_MED|MOD_TYPE_MOD|MOD_TYPE_DIGI|MOD_TYPE_MTM|MOD_TYPE_669|MOD_TYPE_OKT|MOD_TYPE_AMF0)) + if (GetType() & (MOD_TYPE_MED|MOD_TYPE_MOD|MOD_TYPE_DIGI|MOD_TYPE_MTM|MOD_TYPE_669|MOD_TYPE_AMF0)) { return (3546895L*4) / period; } else - if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) + if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) { if(m_SongFlags[SONG_LINEARSLIDES]) return XMLinearTable[period % 768] >> (period / 768); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-28 14:35:06
|
Revision: 1992 http://sourceforge.net/p/modplug/code/1992 Author: saga-games Date: 2013-04-28 14:34:58 +0000 (Sun, 28 Apr 2013) Log Message: ----------- [Imp] DMF Loader: Offset without note should now work. [Ref] Got rid of some compiler warnings. Modified Paths: -------------- trunk/OpenMPT/soundlib/LOAD_DMF.CPP trunk/OpenMPT/soundlib/Load_gdm.cpp trunk/OpenMPT/soundlib/load_j2b.cpp trunk/OpenMPT/unarchiver/unzip.cpp Modified: trunk/OpenMPT/soundlib/LOAD_DMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-04-28 10:11:05 UTC (rev 1991) +++ trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-04-28 14:34:58 UTC (rev 1992) @@ -680,6 +680,11 @@ } } effect1 = CMD_OFFSET; + if(m->note == NOTE_NONE) + { + // Offset without note does also work in DMF. + m->note = settings.channels[chn].lastNote; + } settings.channels[chn].playDir = false; break; case 10: // Invert Sample play direction ("Tekkno Invert") Modified: trunk/OpenMPT/soundlib/Load_gdm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-04-28 10:11:05 UTC (rev 1991) +++ trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-04-28 14:34:58 UTC (rev 1992) @@ -169,7 +169,7 @@ ChnSettings[i].Reset(); if(fileHeader.panMap[i] < 16) { - ChnSettings[i].nPan = std::min((fileHeader.panMap[i] * 16) + 8, 256); + ChnSettings[i].nPan = static_cast<uint16>(std::min((fileHeader.panMap[i] * 16) + 8, 256)); } else if(fileHeader.panMap[i] == 16) { ChnSettings[i].nPan = 128; Modified: trunk/OpenMPT/soundlib/load_j2b.cpp =================================================================== --- trunk/OpenMPT/soundlib/load_j2b.cpp 2013-04-28 10:11:05 UTC (rev 1991) +++ trunk/OpenMPT/soundlib/load_j2b.cpp 2013-04-28 14:34:58 UTC (rev 1992) @@ -801,7 +801,7 @@ if(pan >= 128) ChnSettings[nChn].dwFlags = CHN_MUTE; else - ChnSettings[nChn].nPan = std::min(pan * 4, 256); + ChnSettings[nChn].nPan = static_cast<uint16>(std::min(pan * 4, 256)); } } Modified: trunk/OpenMPT/unarchiver/unzip.cpp =================================================================== --- trunk/OpenMPT/unarchiver/unzip.cpp 2013-04-28 10:11:05 UTC (rev 1991) +++ trunk/OpenMPT/unarchiver/unzip.cpp 2013-04-28 14:34:58 UTC (rev 1992) @@ -158,7 +158,7 @@ while(ext > name) { ext--; - *ext = tolower(*ext); + *ext = static_cast<char>(tolower(*ext)); if(*ext == '.') { ext++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-28 14:37:28
|
Revision: 1993 http://sourceforge.net/p/modplug/code/1993 Author: saga-games Date: 2013-04-28 14:37:19 +0000 (Sun, 28 Apr 2013) Log Message: ----------- [Mod] Reset pattern delays when manually jumping around in the module. [Fix] Fix portamento not resetting finetune in jam007.xm (http://bugs.openmpt.org/view.php?id=390) [Mod] Behaviour change: Allow S9F + note to work with looped samples. [Mod] OpenMPT: Version is now 1.22.02.04 Modified Paths: -------------- trunk/OpenMPT/common/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-04-28 14:34:58 UTC (rev 1992) +++ trunk/OpenMPT/common/version.h 2013-04-28 14:37:19 UTC (rev 1993) @@ -21,7 +21,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 22 #define VER_MINOR 02 -#define VER_MINORMINOR 03 +#define VER_MINORMINOR 04 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-28 14:34:58 UTC (rev 1992) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-28 14:37:19 UTC (rev 1993) @@ -551,6 +551,7 @@ { // Target found, or there is no target (i.e. play whole song)... m_nGlobalVolume = memory.glbVol; + m_nFrameDelay = m_nPatternDelay = 0; m_lTotalSampleCount = memory.renderedSamples; m_bPositionChanged = true; if(IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2)) @@ -655,12 +656,13 @@ // instrumentChanged is used for IT carry-on env option bool instrumentChanged = (pIns != pChn->pModInstrument); + const bool sampleChanged = (pChn->pModSample != nullptr) && (pSmp != pChn->pModSample); if(!instrumentChanged) { // Special XM hack if ((bPorta) && (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) && (pIns) - && (pChn->pModSample) && (pSmp != pChn->pModSample)) + && sampleChanged) { // FT2 doesn't change the sample in this case, // but still uses the sample info from the old one (bug?) @@ -887,8 +889,13 @@ pChn->nC5Speed = pSmp->nC5Speed; pChn->m_CalculateFreq = true; pChn->nFineTune = 0; - } else if(!bPorta || !(GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM))) + } else if(!bPorta || sampleChanged || !(GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM))) { + // Don't reset finetune changed by "set finetune" command. + // Test case: finetune.xm, finetune.mod + // But *do* change the finetune if we switch to a different sample, to fix + // Miranda`s axe by Jamson (jam007.xm) - this file doesn't use compatible play mode, + // so we may want to use IsCompatibleMode instead if further problems arise. pChn->nC5Speed = pSmp->nC5Speed; pChn->nFineTune = pSmp->nFineTune; } @@ -1150,10 +1157,10 @@ pChn->dwFlags.reset(CHN_FILTER); pChn->dwFlags.set(CHN_FASTVOLRAMP); - // IT compatibility 15. Retrigger will not be reset (Tremor doesn't store anything here, so we just don't reset this as well) + // IT compatibility 15. Retrigger is reset in RetrigNote (Tremor doesn't store anything here, so we just don't reset this as well) if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { - // FT2 compatibility: FT2 also doesn't reset retrigger + // FT2 compatibility: Retrigger is reset in RetrigNote if(!IsCompatibleMode(TRK_FASTTRACKER2)) { pChn->nRetrigCount = 0; @@ -2026,7 +2033,7 @@ if (volcmd == VOLCMD_TONEPORTAMENTO) { UINT param = 0; - if(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) + if(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_AMS | MOD_TYPE_AMS2 | MOD_TYPE_DMF | MOD_TYPE_DBM | MOD_TYPE_IMF | MOD_TYPE_PSM | MOD_TYPE_J2B | MOD_TYPE_ULT | MOD_TYPE_OKT | MOD_TYPE_MT2 | MOD_TYPE_MDL)) { param = ImpulseTrackerPortaVolCmd[vol & 0x0F]; } else @@ -3624,9 +3631,9 @@ case 0x0E: pChn->dwFlags.reset(CHN_PINGPONGFLAG); break; - // S9F: Go backward (set position at the end for non-looping samples) + // S9F: Go backward (and set playback position to the end if sample just started) case 0x0F: - if(!pChn->dwFlags[CHN_LOOP] && !pChn->nPos && pChn->nLength) + if(!pChn->nPos && pChn->nLength && !pChn->rowCommand.IsNote()) { pChn->nPos = pChn->nLength - 1; pChn->nPosLo = 0xFFFF; @@ -4093,7 +4100,7 @@ } } else if ((param < pChn->nLength) && (GetType() & (MOD_TYPE_MTM|MOD_TYPE_DMF))) { - // XXX what's this? + // Some trackers can also call offset effects without notes next to them... pChn->nPos = param; pChn->nPosLo = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-28 22:43:47
|
Revision: 1998 http://sourceforge.net/p/modplug/code/1998 Author: saga-games Date: 2013-04-28 22:43:36 +0000 (Sun, 28 Apr 2013) Log Message: ----------- [Fix] FAR Loader broke some revisions ago. [Imp] Added "made with" tracker identification to most loaders (missing for XM and S3M right now, plus extended Schism Tracker identification in IT files) Modified Paths: -------------- trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/LOAD_DBM.CPP trunk/OpenMPT/soundlib/Load_669.cpp trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_digi.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_gdm.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_mt2.cpp trunk/OpenMPT/soundlib/Load_mtm.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Load_stm.cpp trunk/OpenMPT/soundlib/Load_ult.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/load_j2b.cpp Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -124,7 +124,7 @@ m_PlugMixBox.SetCurSel(0); for(int i = m_PlugMixBox.GetCount(); i > 0; i--) { - if(m_PlugMixBox.GetItemData(i) == sndFile.GetMixLevels()) + if(static_cast<mixLevels>(m_PlugMixBox.GetItemData(i)) == sndFile.GetMixLevels()) { m_PlugMixBox.SetCurSel(i); break; @@ -149,8 +149,10 @@ SetDlgItemText(IDC_TEXT_SAVEDWITH, "Last saved with:"); SetDlgItemText(IDC_EDIT_CREATEDWITH, FormatVersionNumber(sndFile.m_dwCreatedWithVersion)); - SetDlgItemText(IDC_EDIT_SAVEDWITH, FormatVersionNumber(sndFile.m_dwLastSavedWithVersion)); - +// if(sndFile.m_dwLastSavedWithVersion) +// SetDlgItemText(IDC_EDIT_SAVEDWITH, FormatVersionNumber(sndFile.m_dwLastSavedWithVersion)); +// else + SetDlgItemText(IDC_EDIT_SAVEDWITH, sndFile.madeWithTracker.c_str()); UpdateDialog(); EnableToolTips(TRUE); @@ -161,7 +163,7 @@ CString CModTypeDlg::FormatVersionNumber(DWORD version) //----------------------------------------------------- { - return CString(MptVersion::ToStr(version)) + (MptVersion::IsTestBuild(version) ? " (Test Build)" : ""); + return CString(MptVersion::ToStr(version)) + (MptVersion::IsTestBuild(version) ? " (test build)" : ""); } Modified: trunk/OpenMPT/soundlib/LOAD_DBM.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/LOAD_DBM.CPP 2013-04-28 22:43:36 UTC (rev 1998) @@ -222,6 +222,7 @@ nPatterns = BigEndianW(pfh->patterns); m_nType = MOD_TYPE_DBM; m_nChannels = CLAMP(BigEndianW(pfh->channels), 1, MAX_BASECHANNELS); // note: MAX_BASECHANNELS is currently 127, but DBM supports up to 128 channels. + madeWithTracker.Format("Digi Booster %x.%x", pfh->trkver >> 8, pfh->trkver & 0xFF); if(pfh->songname[0]) { Modified: trunk/OpenMPT/soundlib/Load_669.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_669.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_669.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -116,6 +116,11 @@ m_nDefaultSpeed = 4; m_nChannels = 8; + if(fileHeader.sig == _669FileHeader::magic669) + madeWithTracker = "Composer 669"; + else + madeWithTracker = "UNIS 669"; + m_nSamples = fileHeader.samples; for(SAMPLEINDEX smp = 1; smp <= m_nSamples; smp++) { Modified: trunk/OpenMPT/soundlib/Load_ams.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ams.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_ams.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -403,6 +403,7 @@ m_nSamples = fileHeader.numSamps; SetModFlag(MSF_COMPATIBLE_PLAY, true); SetupMODPanning(true); + madeWithTracker.Format("Extreme's tracker %d.%d", fileHeader.versionHigh, fileHeader.versionLow); vector<bool> packSample(fileHeader.numSamps); @@ -777,6 +778,7 @@ m_nChannels = 32; SetModFlag(MSF_COMPATIBLE_PLAY, true); SetupMODPanning(true); + madeWithTracker.Format("Velvet Studio %d.%d", fileHeader.format >> 4, fileHeader.format & 0x0F); // Instruments vector<SAMPLEINDEX> firstSample; // First sample of instrument Modified: trunk/OpenMPT/soundlib/Load_digi.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -116,6 +116,7 @@ m_nChannels = fileHeader.numChannels; m_nSamples = 31; m_nSamplePreAmp = 256 / m_nChannels; + madeWithTracker.Format("Digi Booster %d.%d", fileHeader.versionInt >> 4, fileHeader.versionInt & 0x0F); Order.ReadFromArray(fileHeader.orders, fileHeader.lastOrdIndex + 1); Modified: trunk/OpenMPT/soundlib/Load_far.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_far.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_far.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -144,7 +144,7 @@ || file.GetLength() < static_cast<size_t>(fileHeader.headerLength)) { return false; - } else + } else if(loadFlags == onlyVerifyHeader) { return true; } Modified: trunk/OpenMPT/soundlib/Load_gdm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -158,6 +158,7 @@ InitializeGlobals(); m_nType = gdmFormatOrigin[fileHeader.originalFormat]; + madeWithTracker.Format("BWSB 2GDM %d.%d (converted from %s)", fileHeader.trackerMajorVer, fileHeader.formatMinorVer, ModTypeToTracker(GetType())); // Song name StringFixer::ReadString<StringFixer::maybeNullTerminated>(m_szNames[0], fileHeader.songTitle); Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -344,23 +344,27 @@ { // ModPlug Tracker 1.16 (semi-raped IT format) m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 16, 00, 00); + madeWithTracker = "ModPlug tracker 1.09 - 1.16"; } else { // OpenMPT 1.17 disguised as this in compatible mode, // but never writes 0xFF in the pan map for unused channels (which is an invalid value). m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 17, 00, 00); + madeWithTracker = "OpenMPT 1.17 (compatibility export)"; } interpretModPlugMade = true; } else if(fileHeader.cwtv == 0x0214 && fileHeader.cmwt == 0x0202 && fileHeader.reserved == 0) { // ModPlug Tracker b3.3 - 1.09, instruments 557 bytes apart m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 09, 00, 00); + madeWithTracker = "ModPlug tracker b3.3 - 1.09"; interpretModPlugMade = true; } else if(fileHeader.cwtv == 0x0214 && fileHeader.cmwt == 0x0200 && fileHeader.reserved == 0) { // ModPlug Tracker 1.00a5, instruments 560 bytes apart m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 00, 00, A5); + madeWithTracker = "ModPlug tracker 1.00a5"; interpretModPlugMade = true; } } else // case: type == MOD_TYPE_MPT @@ -534,6 +538,7 @@ { // These were not zero bytes -> We're in the wrong place! file.SkipBack(2); + madeWithTracker = "UNMO3"; } } @@ -551,6 +556,11 @@ m_SongFlags.set(SONG_EMBEDMIDICFG); } + if(file.ReadMagic("MODU")) + { + madeWithTracker = "BeRoTracker"; + } + // Read pattern names: "PNAM" FileReader patNames; if(file.ReadMagic("PNAM")) @@ -901,6 +911,84 @@ UpgradeModFlags(); + if(m_dwLastSavedWithVersion && madeWithTracker.empty()) + { + madeWithTracker = "OpenMPT " + MptVersion::ToStr(m_dwLastSavedWithVersion); + if(fileHeader.reserved != ITFileHeader::omptMagic && (fileHeader.cwtv & 0xF000) == 0x5000) + { + madeWithTracker += " (compatibility export)"; + } else if(MptVersion::IsTestBuild(m_dwLastSavedWithVersion)) + { + madeWithTracker += " (test build)"; + } + } else + { + switch(fileHeader.cwtv >> 12) + { + case 0: + if(!madeWithTracker.empty()) + { + // BeRoTracker has been detected above. + } else if(fileHeader.cwtv == 0x0214 && fileHeader.cmwt == 0x0200 && fileHeader.flags == 9 && fileHeader.special == 0 + && fileHeader.highlight_major == 0 && fileHeader.highlight_minor == 0 + && fileHeader.insnum == 0 && fileHeader.patnum + 1 == fileHeader.ordnum + && fileHeader.globalvol == 128 && fileHeader.mv == 100 && fileHeader.speed == 1 && fileHeader.sep == 128 && fileHeader.pwd == 0 + && fileHeader.msglength == 0 && fileHeader.msgoffset == 0 && fileHeader.reserved == 0) + { + madeWithTracker = "OpenSPC conversion"; + } else if(fileHeader.cwtv == 0x0214 && fileHeader.cmwt == 0x0214 && fileHeader.reserved == ITFileHeader::chibiMagic) + { + madeWithTracker = "ChibiTracker"; + } else if(fileHeader.cwtv == 0x0214 && fileHeader.cmwt == 0x0214 && !(fileHeader.special & 3) && fileHeader.reserved == 0 && !strcmp(Samples[1].filename, "XXXXXXXX.YYY")) + { + madeWithTracker = "CheeseTracker"; + } else + { + if(fileHeader.cmwt > 0x0214) + { + madeWithTracker = "Impulse Tracker 2.15"; + } else if(fileHeader.cwtv > 0x0214) + { + // Patched update of IT 2.14 (0x0215 - 0x0217 == p1 - p3) + // p4 (as found on modland) adds the ITVSOUND driver, but doesn't seem to change + // anything as far as file saving is concerned. + madeWithTracker.Format("Impulse Tracker 2.14p%d", fileHeader.cwtv - 0x0214); + } else + { + madeWithTracker.Format("Impulse Tracker %d.%02x", (fileHeader.cwtv & 0x0F00) >> 8, (fileHeader.cwtv & 0xFF)); + } + } + break; + case 1: + madeWithTracker = "Schism Tracker "; + if(fileHeader.cwtv > 0x1050) + { + mpt::String version; + tm epoch; + MemsetZero(epoch); + epoch.tm_year = 109, epoch.tm_mon = 9; epoch.tm_mday = 31; + //int32 versionSec = ((fileHeader.cwtv - 0x050) * 86400) + mktime(&epoch); + // TODO what's the difference between localtime and localtime_r? +// if(localtime_r(&versionSec, &epoch)) { +// sprintf(buf, "%04d-%02d-%02d", +// version.tm_year + 1900, version.tm_mon + 1, version.tm_mday); +// return; + } else + { + mpt::String version; + version.Format("0.%x", fileHeader.cwtv & 0xFF); + madeWithTracker += version; + } + break; + case 6: + madeWithTracker.Format("BeRoTracker %x.%x"); + break; + case 7: + madeWithTracker.Format("ITMCK %d.%d.%d", (fileHeader.cwtv >> 8) & 0x0F, (fileHeader.cwtv >> 4) & 0x0F, fileHeader.cwtv & 0x0F); + break; + } + } + if(GetType() == MOD_TYPE_IT) { // Set appropriate mod flags if the file was not made with MPT. Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -263,6 +263,8 @@ UpgradeModFlags(); + madeWithTracker = "OpenMPT " + MptVersion::ToStr(m_dwLastSavedWithVersion); + return true; #endif } Modified: trunk/OpenMPT/soundlib/Load_med.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_med.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -547,6 +547,7 @@ InitializeChannels(); // Setup channel pan positions and volume SetupMODPanning(true); + madeWithTracker.Format("OctaMED (MMD%c)", version); m_nType = MOD_TYPE_MED; m_nSamplePreAmp = 32; Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -1,5 +1,5 @@ /* - * Load_med.cpp + * Load_mid.cpp * ------------ * Purpose: MIDI file loader * Notes : MIDI import is pretty crappy. @@ -336,13 +336,6 @@ }; -const WORD kMidiChannelPriority[16] = -{ - 0xFFFE, 0xFFFC, 0xFFF8, 0xFFF0, 0xFFE0, 0xFFC0, 0xFF80, 0xFF00, - 0xFE00, 0xFDFF, 0xF800, 0xF000, 0xE000, 0xC000, 0x8000, 0x0000, -}; - - /////////////////////////////////////////////////////////////////////////// // Helper functions Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -454,8 +454,8 @@ } -void CSoundFile::ReadMODPatternEntry(FileReader &file, ModCommand &m) -//------------------------------------------------------------------- +void CSoundFile::ReadMODPatternEntry(FileReader &file, ModCommand &m) const +//------------------------------------------------------------------------- { uint8 data[4]; file.ReadArray(data); @@ -494,15 +494,20 @@ || IsMagic(magic, "FEST")) // jobbig.mod by Mahoney { m_nChannels = 4; - } else if(IsMagic(magic, "CD81") // Falcon - || IsMagic(magic, "OKTA") // Oktalyzer + } else if(IsMagic(magic, "CD81")) // Falcon + { + m_nChannels = 8; + madeWithTracker = "Falcon"; + } else if(IsMagic(magic, "OKTA") // Oktalyzer || IsMagic(magic, "OCTA")) // Oktalyzer { m_nChannels = 8; + madeWithTracker = "Oktalyzer"; } else if((!memcmp(magic, "FLT", 3) || !memcmp(magic, "EXO", 3)) && magic[3] >= '4' && magic[3] <= '9') { // FLTx / EXOx - Startrekker by Exolon / Fairlight m_nChannels = magic[3] - '0'; + madeWithTracker = "Startrekker"; } else if(magic[0] >= '1' && magic[0] <= '9' && !memcmp(magic + 1, "CHN", 3)) { // xCHN - Many trackers @@ -516,6 +521,7 @@ { // TDZx - TakeTracker m_nChannels = magic[3] - '0'; + madeWithTracker = "TakeTracker"; } else { return false; Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mt2.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -240,6 +240,7 @@ InitializeGlobals(); InitializeChannels(); + madeWithTracker.Format("MadTracker %d.%x", pfh->wVersion >> 8, pfh->wVersion & 0xFF); m_nType = MOD_TYPE_MT2; m_nChannels = pfh->wChannels; m_nRestartPos = pfh->wRestart; Modified: trunk/OpenMPT/soundlib/Load_mtm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mtm.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_mtm.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -123,6 +123,7 @@ m_nType = MOD_TYPE_MTM; m_nSamples = fileHeader.numSamples; m_nChannels = fileHeader.numChannels; + madeWithTracker.Format("MultiTracker %d.%d", fileHeader.version >> 4, fileHeader.version & 0x0F); // Reading instruments for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -651,6 +651,12 @@ ChnSettings[chn].dwFlags.set(CHN_SURROUND, subsongs[0].channelSurround[chn]); } + madeWithTracker = "Epic MegaGames MASI ("; + if(newFormat) + madeWithTracker = "New Version / Sinaria)"; + else + madeWithTracker = "New Version)"; + if(!(loadFlags & loadPatternData)) { return true; @@ -1156,6 +1162,7 @@ // Seems to be valid! InitializeGlobals(); + madeWithTracker = "Epic MegaGames MASI (Old Version)"; m_nType = MOD_TYPE_S3M; m_nChannels = Clamp(CHANNELINDEX(fileHeader.numChannelsPlay), CHANNELINDEX(fileHeader.numChannelsReal), MAX_BASECHANNELS); m_nSamplePreAmp = fileHeader.masterVolume; Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ptm.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -102,6 +102,7 @@ StringFixer::ReadString<StringFixer::maybeNullTerminated>(m_szNames[0], pfh.songname); InitializeGlobals(); + madeWithTracker.Format("PolyTracker %d.%d", pfh.version_hi, pfh.version_lo); m_nType = MOD_TYPE_PTM; m_nChannels = pfh.nchannels; m_nSamples = MIN(pfh.nsamples, MAX_SAMPLES - 1); Modified: trunk/OpenMPT/soundlib/Load_stm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_stm.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -134,6 +134,7 @@ // Read STM header InitializeGlobals(); + madeWithTracker.Format("Scream Tracker %d.%02x", fileHeader.verMajor, fileHeader.verMinor); m_nType = MOD_TYPE_STM; m_nSamples = 31; m_nChannels = 4; Modified: trunk/OpenMPT/soundlib/Load_ult.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -395,6 +395,10 @@ InitializeGlobals(); StringFixer::ReadString<StringFixer::maybeNullTerminated>(m_szNames[0], fileHeader.songName); + const char *versions[] = {"<1.4", "1.4", "1.5", "1.6"}; + madeWithTracker = "UltraTracker "; + madeWithTracker += versions[fileHeader.version - '1']; + m_nType = MOD_TYPE_ULT; m_SongFlags = SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS; // this will be converted to IT format by MPT. SetModFlag(MSF_COMPATIBLE_PLAY, true); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -489,6 +489,7 @@ m_nMinPeriod = 16; m_nMaxPeriod = 32767; m_dwLastSavedWithVersion = m_dwCreatedWithVersion = 0; + madeWithTracker.clear(); SetMixLevels(mixLevels_compatible); SetModFlags(0); @@ -608,6 +609,11 @@ m_nType = MOD_TYPE_NONE; } + if(madeWithTracker.empty()) + { + madeWithTracker = ModTypeToTracker(GetType()); + } + #ifndef NO_ARCHIVE_SUPPORT // Read archive comment if there is no song comment if(!songMessage.empty() && unarchiver.GetComments(false)) Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-28 22:43:36 UTC (rev 1998) @@ -379,6 +379,7 @@ public: // Song message SongMessage songMessage; + mpt::String madeWithTracker; // -> CODE#0023 // -> DESC="IT project files (.itp)" @@ -555,7 +556,7 @@ void S3MConvert(ModCommand &m, bool fromIT) const; void S3MSaveConvert(uint8 &command, uint8 ¶m, bool toIT, bool compatibilityExport = false) const; void ModSaveCommand(uint8 &command, uint8 ¶m, const bool toXM, const bool compatibilityExport = false) const; - void ReadMODPatternEntry(FileReader &file, ModCommand &m); + void ReadMODPatternEntry(FileReader &file, ModCommand &m) const; void SetupMODPanning(bool bForceSetup = false); // Setup LRRL panning, max channel volume Modified: trunk/OpenMPT/soundlib/load_j2b.cpp =================================================================== --- trunk/OpenMPT/soundlib/load_j2b.cpp 2013-04-28 19:40:37 UTC (rev 1997) +++ trunk/OpenMPT/soundlib/load_j2b.cpp 2013-04-28 22:43:36 UTC (rev 1998) @@ -778,6 +778,12 @@ m_nDefaultGlobalVolume = mainChunk.globalvolume * 2; m_nType = MOD_TYPE_J2B; + madeWithTracker = "Galaxy Sound System ("; + if(isAM) + madeWithTracker += "new version)"; + else + madeWithTracker += "old version)"; + ASSERT(mainChunk.unknown == LittleEndian(0xFF0001C5) || mainChunk.unknown == LittleEndian(0x35800716) || mainChunk.unknown == LittleEndian(0xFF00FFFF)); StringFixer::ReadString<StringFixer::maybeNullTerminated>(m_szNames[0], mainChunk.songname); @@ -849,7 +855,7 @@ continue; } - m_nInstruments = MAX(m_nInstruments, instr); + m_nInstruments = std::max(m_nInstruments, instr); instrHeader.ConvertToMPT(*pIns, m_nSamples); @@ -909,7 +915,7 @@ { continue; } - m_nInstruments = MAX(m_nInstruments, instr); + m_nInstruments = std::max(m_nInstruments, instr); instrHeader.ConvertToMPT(*pIns, m_nSamples); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-05-01 00:34:01
|
Revision: 2000 http://sourceforge.net/p/modplug/code/2000 Author: manxorist Date: 2013-05-01 00:33:53 +0000 (Wed, 01 May 2013) Log Message: ----------- [Ref] Move the version number to a new file common/versionNumber.h and include that only in version.cpp and the ressource file. This prevents rebuild of a bunch of files when only the version number changed. [Ref] Add comments for all functions in version.h Modified Paths: -------------- trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/common/version.cpp trunk/OpenMPT/common/version.h trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/mptrack/res/MPTRACK.RC2 trunk/OpenMPT/mptrack/tagging.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp Added Paths: ----------- trunk/OpenMPT/common/versionNumber.h Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/common/typedefs.h 2013-05-01 00:33:53 UTC (rev 2000) @@ -256,6 +256,13 @@ +//STRINGIZE makes a string of given argument. If used with #defined value, +//the string is made of the contents of the defined value. +#define HELPER_STRINGIZE(x) #x +#define STRINGIZE(x) HELPER_STRINGIZE(x) + + + #ifndef MAX #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #endif Modified: trunk/OpenMPT/common/version.cpp =================================================================== --- trunk/OpenMPT/common/version.cpp 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/common/version.cpp 2013-05-01 00:33:53 UTC (rev 2000) @@ -12,10 +12,56 @@ #include <sstream> +#include "versionNumber.h" #include "svn_version.h" namespace MptVersion { +const VersionNum num = MPT_VERSION_NUMERIC; + +const char * const str = MPT_VERSION_STR; + +std::string GetOpenMPTVersionStr() +{ + return std::string("OpenMPT ") + std::string(MPT_VERSION_STR); +} + +VersionNum ToNum(const char *const s) +{ + int v1, v2, v3, v4; + sscanf(s, "%x.%x.%x.%x", &v1, &v2, &v3, &v4); + return ((v1 << 24) | (v2 << 16) | (v3 << 8) | v4); +} + +mpt::String ToStr(const VersionNum v) +{ + mpt::String strVersion; + if(v == 0) + { + // Unknown version + strVersion = "Unknown"; + } else if((v & 0xFFFF) == 0) + { + // Only parts of the version number are known (e.g. when reading the version from the IT or S3M file header) + strVersion.Format("%X.%02X", (v >> 24) & 0xFF, (v >> 16) & 0xFF); + } else + { + // Full version info available + strVersion.Format("%X.%02X.%02X.%02X", (v >> 24) & 0xFF, (v >> 16) & 0xFF, (v >> 8) & 0xFF, (v) & 0xFF); + } + return strVersion; +} + +VersionNum RemoveBuildNumber(const VersionNum num) +{ + return (num & 0xFFFFFF00); +} + +bool IsTestBuild(const VersionNum num) +{ + return ((num > MAKE_VERSION_NUMERIC(1,17,02,54) && num < MAKE_VERSION_NUMERIC(1,18,02,00) && num != MAKE_VERSION_NUMERIC(1,18,00,00)) || (num > MAKE_VERSION_NUMERIC(1,18,02,00) && RemoveBuildNumber(num) != num)); +} + bool IsDebugBuild() { #ifdef _DEBUG Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/common/version.h 2013-05-01 00:33:53 UTC (rev 2000) @@ -12,91 +12,75 @@ #include <string> -//STRINGIZE makes a string of given argument. If used with #defined value, -//the string is made of the contents of the defined value. -#define HELPER_STRINGIZE(x) #x -#define STRINGIZE(x) HELPER_STRINGIZE(x) -//Version definitions. The only thing that needs to be changed when changing version number. -#define VER_MAJORMAJOR 1 -#define VER_MAJOR 22 -#define VER_MINOR 02 -#define VER_MINORMINOR 04 - //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of //version 1.17.02.28. #define MAKE_VERSION_NUMERIC(v0,v1,v2,v3) ((0x##v0 << 24) | (0x##v1<<16) | (0x##v2<<8) | (0x##v3)) -//Version string. For example "1.17.02.28" -#define MPT_VERSION_STR STRINGIZE(VER_MAJORMAJOR)"."STRINGIZE(VER_MAJOR)"."STRINGIZE(VER_MINOR)"."STRINGIZE(VER_MINORMINOR) -//Numerical value of the version. -#define MPT_VERSION_NUMERIC MAKE_VERSION_NUMERIC(VER_MAJORMAJOR,VER_MAJOR,VER_MINOR,VER_MINORMINOR) - namespace MptVersion { + typedef uint32 VersionNum; - const VersionNum num = MPT_VERSION_NUMERIC; - const char* const str = MPT_VERSION_STR; + extern const VersionNum num; // e.g. 0x01170208 + extern const char * const str; // e.g "1.17.02.08" + + // Return a OpenMPT version string suitable for file format tags + std::string GetOpenMPTVersionStr(); // e.g. "OpenMPT 1.17.02.08" + // Returns numerical version value from given version string. - static VersionNum ToNum(const char *const s) - { - int v1, v2, v3, v4; - sscanf(s, "%x.%x.%x.%x", &v1, &v2, &v3, &v4); - return ((v1 << 24) | (v2 << 16) | (v3 << 8) | v4); - } + VersionNum ToNum(const char *const s); // Returns version string from given numerical version value. - static mpt::String ToStr(const VersionNum v) - { - mpt::String strVersion; - if(v == 0) - { - // Unknown version - strVersion = "Unknown"; - } else if((v & 0xFFFF) == 0) - { - // Only parts of the version number are known (e.g. when reading the version from the IT or S3M file header) - strVersion.Format("%X.%02X", (v >> 24) & 0xFF, (v >> 16) & 0xFF); - } else - { - // Full version info available - strVersion.Format("%X.%02X.%02X.%02X", (v >> 24) & 0xFF, (v >> 16) & 0xFF, (v >> 8) & 0xFF, (v) & 0xFF); - } - return strVersion; - } + mpt::String ToStr(const VersionNum v); // Return a version without build number (the last number in the version). // The current versioning scheme uses this number only for test builds, and it should be 00 for official builds, // So sometimes it might be wanted to do comparisons without the build number. - static VersionNum RemoveBuildNumber(const VersionNum num) - { - return (num & 0xFFFFFF00); - } + VersionNum RemoveBuildNumber(const VersionNum num); // Returns true if a given version number is from a test build, false if it's a release build. - static bool IsTestBuild(const VersionNum num = MPT_VERSION_NUMERIC) - { - return ((num > MAKE_VERSION_NUMERIC(1,17,02,54) && num < MAKE_VERSION_NUMERIC(1,18,02,00) && num != MAKE_VERSION_NUMERIC(1,18,00,00)) || (num > MAKE_VERSION_NUMERIC(1,18,02,00) && RemoveBuildNumber(num) != num)); - } + bool IsTestBuild(const VersionNum num = MptVersion::num); + // Return true if this is a debug build with no optimizations bool IsDebugBuild(); + // Return the svn repository url (if built from a svn working copy and tsvn was available during build) std::string GetUrl(); + + // Return the svn revision (if built from a svn working copy and tsvn was available during build) int GetRevision(); + + // Return if the svn working copy had local changes during build (if built from a svn working copy and tsvn was available during build) bool IsDirty(); + + // Return if the svn working copy had files checked out from different revisions and/or branches (if built from a svn working copy and tsvn was available during build) bool HasMixedRevisions(); - std::string GetStateString(); + + // Return a string decribing the working copy state (dirty and/or mixed revisions) (if built from a svn working copy and tsvn was available during build) + std::string GetStateString(); // e.g. "" or "+mixed" or "+mixed+dirty" or "+dirty" + + // Return a string decribing the time of the build process (if built from a svn working copy and tsvn was available during build, otherwise it returns the time version.cpp was last rebuild which could be unreliable as it does not get rebuild every time without tsvn) std::string GetBuildDateString(); - std::string GetBuildFlagsString(); - std::string GetRevisionString(); - std::string GetVersionStringExtended(); - std::string GetVersionUrlString(); + // Return a string decribing some of the buidl features and/or flags + std::string GetBuildFlagsString(); // e.g. " TEST DEBUG NO_VST" + // Return a string decribing the revision of the svn working copy and if it was dirty (+) or had mixed revisions (!) (if built from a svn working copy and tsvn was available during build) + std::string GetRevisionString(); // e.g. "-r1234+" + + // Returns MptVersion::str if the build is a clean release build straight from the repository or an extended strin otherwise (if built from a svn working copy and tsvn was available during build) + std::string GetVersionStringExtended(); // e.g. "1.17.02.08-r1234+ DEBUG" + + // Returns a string combining the repository url and the revision, suitable for checkout if the working copy was clean (if built from a svn working copy and tsvn was available during build) + std::string GetVersionUrlString(); // e.g. "https://svn.code.sf.net/p/modplug/code/trunk/OpenMPT@1234+dirty" + + // Returns a multi-line string containing the full credits for the code base std::string GetFullCreditsString(); + + // Returns a multi-line string containing developer contact and community addresses std::string GetContactString(); }; //namespace MptVersion Added: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h (rev 0) +++ trunk/OpenMPT/common/versionNumber.h 2013-05-01 00:33:53 UTC (rev 2000) @@ -0,0 +1,26 @@ +/* + * versionNumber.h + * --------------- + * Purpose: OpenMPT version handling. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +#define VER_HELPER_STRINGIZE(x) #x +#define VER_STRINGIZE(x) VER_HELPER_STRINGIZE(x) + +//Version definitions. The only thing that needs to be changed when changing version number. +#define VER_MAJORMAJOR 1 +#define VER_MAJOR 22 +#define VER_MINOR 02 +#define VER_MINORMINOR 05 + +//Version string. For example "1.17.02.28" +#define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR)"."VER_STRINGIZE(VER_MAJOR)"."VER_STRINGIZE(VER_MINOR)"."VER_STRINGIZE(VER_MINORMINOR) + +//Numerical value of the version. +#define MPT_VERSION_NUMERIC MAKE_VERSION_NUMERIC(VER_MAJORMAJOR,VER_MAJOR,VER_MINOR,VER_MINORMINOR) Property changes on: trunk/OpenMPT/common/versionNumber.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2013-05-01 00:33:53 UTC (rev 2000) @@ -1153,6 +1153,10 @@ > </File> <File + RelativePath="..\common\versionNumber.h" + > + </File> + <File RelativePath=".\view_com.h" > </File> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-05-01 00:33:53 UTC (rev 2000) @@ -520,6 +520,7 @@ <ClInclude Include="..\common\svn_version_default\svn_version.h" /> <ClInclude Include="..\common\typedefs.h" /> <ClInclude Include="..\common\version.h" /> + <ClInclude Include="..\common\versionNumber.h" /> <ClInclude Include="..\sounddev\SoundDevice.h" /> <ClInclude Include="..\sounddev\SoundDevices.h" /> <ClInclude Include="..\sounddsp\AGC.h" /> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-05-01 00:33:53 UTC (rev 2000) @@ -912,6 +912,9 @@ <ClInclude Include="..\unarchiver\unrar\CONST.H"> <Filter>Source Files\unarchiver\unrar</Filter> </ClInclude> + <ClInclude Include="..\common\versionNumber.h"> + <Filter>Header Files\common</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="res\bitmap1.bmp"> Modified: trunk/OpenMPT/mptrack/res/MPTRACK.RC2 =================================================================== --- trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2013-05-01 00:33:53 UTC (rev 2000) @@ -10,11 +10,11 @@ ///////////////////////////////////////////////////////////////////////////// // Add manually edited resources here... -#include "../common/version.h" +#include "../common/versionNumber.h" #include <winver.h> #define VER_FILEVERSION VER_MAJORMAJOR,VER_MAJOR,VER_MINOR,VER_MINORMINOR -#define VER_FILEVERSION_STR STRINGIZE(VER_FILEVERSION) +#define VER_FILEVERSION_STR VER_STRINGIZE(VER_FILEVERSION) #ifndef _DEBUG #define VER_DEBUG 0 Modified: trunk/OpenMPT/mptrack/tagging.cpp =================================================================== --- trunk/OpenMPT/mptrack/tagging.cpp 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/mptrack/tagging.cpp 2013-05-01 00:33:53 UTC (rev 2000) @@ -20,7 +20,7 @@ CFileTagging::CFileTagging() //-------------------------- { - encoder = "OpenMPT " MPT_VERSION_STR; + encoder = MptVersion::GetOpenMPTVersionStr(); } /////////////////////////////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-05-01 00:33:53 UTC (rev 2000) @@ -109,8 +109,6 @@ { //Verify that macros and functions work. { - VERIFY_EQUAL( MPT_VERSION_NUMERIC, MptVersion::num ); - VERIFY_EQUAL( CString(MPT_VERSION_STR), CString(MptVersion::str) ); VERIFY_EQUAL( MptVersion::ToNum(MptVersion::ToStr(MptVersion::num)), MptVersion::num ); VERIFY_EQUAL( MptVersion::ToStr(MptVersion::ToNum(MptVersion::str)), MptVersion::str ); VERIFY_EQUAL( MptVersion::ToStr(18285096), "1.17.02.28" ); Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2013-05-01 00:33:53 UTC (rev 2000) @@ -580,7 +580,8 @@ memcpy(fileHeader.signature, "Extended Module: ", 17); StringFixer::WriteString<StringFixer::spacePadded>(fileHeader.songName, m_szNames[0]); fileHeader.eof = 0x1A; - memcpy(fileHeader.trackerName, "OpenMPT " MPT_VERSION_STR " ", 20); + std::string openMptTrackerName = MptVersion::GetOpenMPTVersionStr(); + StringFixer::WriteString<StringFixer::spacePadded>(fileHeader.trackerName, openMptTrackerName.c_str(), openMptTrackerName.length()); // Writing song header fileHeader.version = 0x0104; // XM Format v1.04 Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-04-28 22:55:08 UTC (rev 1999) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-05-01 00:33:53 UTC (rev 2000) @@ -397,7 +397,8 @@ bool CSoundFile::SaveWAVSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const //---------------------------------------------------------------------------------- { - char *softwareId = "OpenMPT " MPT_VERSION_STR; + std::string softwareIdString = MptVersion::GetOpenMPTVersionStr(); + const char *softwareId = softwareIdString.c_str(); size_t softwareIdLength = strlen(softwareId) + 1; WAVEFILEHEADER header; @@ -2166,7 +2167,7 @@ FLAC__StreamMetadata_VorbisComment_Entry entry; FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, "TITLE", m_szNames[nSample]); FLAC__metadata_object_vorbiscomment_append_comment(metadata[0], entry, false); - FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, "ENCODER", "OpenMPT " MPT_VERSION_STR); + FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, "ENCODER", MptVersion::GetOpenMPTVersionStr().c_str()); FLAC__metadata_object_vorbiscomment_append_comment(metadata[0], entry, false); } if(metadata[1]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-05-01 11:38:48
|
Revision: 2001 http://sourceforge.net/p/modplug/code/2001 Author: manxorist Date: 2013-05-01 11:38:40 +0000 (Wed, 01 May 2013) Log Message: ----------- [Ref] Remove X86_ name tag from most mixing helper functions: Move C implementations to their own C_ functions and expose untagged functions which select the proper one based on compile-time setting. [Ref] Add some missing C implementations. Modified Paths: -------------- trunk/OpenMPT/sounddsp/Reverb.cpp trunk/OpenMPT/soundlib/Fastmix.cpp trunk/OpenMPT/soundlib/Mmx_mix.cpp trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/Waveform.cpp Modified: trunk/OpenMPT/sounddsp/Reverb.cpp =================================================================== --- trunk/OpenMPT/sounddsp/Reverb.cpp 2013-05-01 00:33:53 UTC (rev 2000) +++ trunk/OpenMPT/sounddsp/Reverb.cpp 2013-05-01 11:38:40 UTC (rev 2001) @@ -18,7 +18,7 @@ #pragma warning(disable:4725) // Pentium fdiv bug #pragma warning(disable:4731) // ebp modified -extern VOID X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs); +extern void StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs); @@ -403,7 +403,7 @@ UINT nIn, nOut; if ((!gnReverbSend) && (!gnReverbSamples)) return; - if (!gnReverbSend) X86_StereoFill(MixReverbBuffer, nSamples, &gnRvbROfsVol, &gnRvbLOfsVol); + if (!gnReverbSend) StereoFill(MixReverbBuffer, nSamples, &gnRvbROfsVol, &gnRvbLOfsVol); if (!(sysinfo & PROCSUPPORT_MMX)) return; // Dynamically adjust reverb master gains LONG lMasterGain; Modified: trunk/OpenMPT/soundlib/Fastmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Fastmix.cpp 2013-05-01 00:33:53 UTC (rev 2000) +++ trunk/OpenMPT/soundlib/Fastmix.cpp 2013-05-01 11:38:40 UTC (rev 2001) @@ -461,12 +461,12 @@ // extern void X86_StereoMixToFloat(const int *pSrc, float *pOut1, float *pOut2, UINT nCount, const float _i2fc); extern void X86_FloatToStereoMix(const float *pIn1, const float *pIn2, int *pOut, UINT nCount, const float _f2ic); -extern void X86_MonoMixToFloat(const int *pSrc, float *pOut, UINT nCount, const float _i2fc); -extern void X86_FloatToMonoMix(const float *pIn, int *pOut, UINT nCount, const float _f2ic); +extern void C_StereoMixToFloat(const int *pSrc, float *pOut1, float *pOut2, UINT nCount, const float _i2fc); +extern void C_FloatToStereoMix(const float *pIn1, const float *pIn2, int *pOut, UINT nCount, const float _f2ic); -void X86_InitMixBuffer(int *pBuffer, UINT nSamples); -void X86_EndChannelOfs(ModChannel *pChannel, int *pBuffer, UINT nSamples); -void X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs); +void InitMixBuffer(int *pBuffer, UINT nSamples); +void EndChannelOfs(ModChannel *pChannel, int *pBuffer, UINT nSamples); +void StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs); #ifdef ENABLE_3DNOW @@ -1452,7 +1452,7 @@ if (!count) return 0; BOOL bSurround; bool ITPingPongMode = IsITPingPongMode(); - if (m_MixerSettings.gnChannels > 2) X86_InitMixBuffer(MixRearBuffer, count*2); + if (m_MixerSettings.gnChannels > 2) InitMixBuffer(MixRearBuffer, count*2); nchused = nchmixed = 0; for (UINT nChn=0; nChn<m_nMixChannels; nChn++) { @@ -1524,7 +1524,7 @@ pOfsL = &pPlugin->nVolDecayL; if (!(pPlugin->dwFlags & SNDMIXPLUGINSTATE::psfMixReady)) { - X86_StereoFill(pbuffer, count, pOfsR, pOfsL); + StereoFill(pbuffer, count, pOfsR, pOfsL); pPlugin->dwFlags |= SNDMIXPLUGINSTATE::psfMixReady; } } @@ -1534,7 +1534,7 @@ { if (!m_Reverb.gnReverbSend) { - X86_StereoFill(MixReverbBuffer, count, &m_Reverb.gnRvbROfsVol, &m_Reverb.gnRvbLOfsVol); + StereoFill(MixReverbBuffer, count, &m_Reverb.gnRvbROfsVol, &m_Reverb.gnRvbLOfsVol); } m_Reverb.gnReverbSend += count; pOfsR = &m_Reverb.gnRvbROfsVol; @@ -1558,7 +1558,7 @@ pChannel->nPos = 0; pChannel->nPosLo = 0; pChannel->nRampLength = 0; - X86_EndChannelOfs(pChannel, pbuffer, nsamples); + EndChannelOfs(pChannel, pbuffer, nsamples); *pOfsR += pChannel->nROfs; *pOfsL += pChannel->nLOfs; pChannel->nROfs = pChannel->nLOfs = 0; @@ -1677,7 +1677,7 @@ } else if (pState->nVolDecayR|pState->nVolDecayL) { - X86_StereoFill(pState->pMixBuffer, nCount, &pState->nVolDecayR, &pState->nVolDecayL); + StereoFill(pState->pMixBuffer, nCount, &pState->nVolDecayR, &pState->nVolDecayL); StereoMixToFloat(pState->pMixBuffer, pState->pOutBufferL, pState->pOutBufferR, nCount); } else { @@ -1786,7 +1786,6 @@ VOID CSoundFile::StereoMixToFloat(const int *pSrc, float *pOut1, float *pOut2, UINT nCount) //----------------------------------------------------------------------------------------- { - if(m_MixerSettings.MixerFlags & SNDMIX_ENABLEMMX) { #ifdef ENABLE_SSE @@ -1804,9 +1803,11 @@ } #endif // ENABLE_3DNOW } - +#ifdef ENABLE_X86 X86_StereoMixToFloat(pSrc, pOut1, pOut2, nCount, m_PlayConfig.getIntToFloat()); - +#else + C_StereoMixToFloat(pSrc, pOut1, pOut2, nCount, m_PlayConfig.getIntToFloat()); +#endif } @@ -1823,59 +1824,21 @@ } #endif // ENABLE_3DNOW } +#ifdef ENABLE_X86 X86_FloatToStereoMix(pIn1, pIn2, pOut, nCount, m_PlayConfig.getFloatToInt()); +#else + C_FloatToStereoMix(pIn1, pIn2, pOut, nCount, m_PlayConfig.getFloatToInt()); +#endif } -VOID CSoundFile::MonoMixToFloat(const int *pSrc, float *pOut, UINT nCount) -//------------------------------------------------------------------------ -{ - if(m_MixerSettings.MixerFlags & SNDMIX_ENABLEMMX) - { -#ifdef ENABLE_SSE - if(gdwSysInfo & PROCSUPPORT_SSE) - { - SSE_MonoMixToFloat(pSrc, pOut, nCount, m_PlayConfig.getIntToFloat()); - return; - } -#endif // ENABLE_SSE -#ifdef ENABLE_3DNOW - if(gdwSysInfo & PROCSUPPORT_3DNOW) - { - AMD_MonoMixToFloat(pSrc, pOut, nCount, m_PlayConfig.getIntToFloat()); - return; - } -#endif // ENABLE_3DNOW - } - X86_MonoMixToFloat(pSrc, pOut, nCount, m_PlayConfig.getIntToFloat()); +#pragma warning (disable:4100) -} - -VOID CSoundFile::FloatToMonoMix(const float *pIn, int *pOut, UINT nCount) -//----------------------------------------------------------------------- +#ifdef ENABLE_X86 +static DWORD X86_Convert32To8(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//-------------------------------------------------------------------------- { - if(m_MixerSettings.MixerFlags & SNDMIX_ENABLEMMX) - { -#ifdef ENABLE_3DNOW - if(gdwSysInfo & PROCSUPPORT_3DNOW) - { - AMD_FloatToMonoMix(pIn, pOut, nCount, m_PlayConfig.getFloatToInt()); - return; - } -#endif // ENABLE_3DNOW - } - X86_FloatToMonoMix(pIn, pOut, nCount, m_PlayConfig.getFloatToInt()); -} - - -#pragma warning (disable:4100) - -// Clip and convert to 8 bit -DWORD X86_Convert32To8(LPVOID lp16, int *pBuffer, DWORD lSampleCount) -//------------------------------------------------------------------- -{ -#ifdef ENABLE_X86 DWORD result; _asm { mov ebx, lp16 // ebx = 8-bit buffer @@ -1908,7 +1871,12 @@ mov result, eax } return result; -#else +} +#endif + +static DWORD C_Convert32To8(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//------------------------------------------------------------------------ +{ uint8 * p = (uint8*)lp16; for(DWORD i=0; i<lSampleCount; i++) { @@ -1918,15 +1886,24 @@ p[i] = (uint8)((v >> (24-MIXING_ATTENUATION))+0x80); // unsigned } return lSampleCount * 1; -#endif } +// Clip and convert to 8 bit +DWORD Convert32To8(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//--------------------------------------------------------------- +{ + #ifdef ENABLE_X86 + X86_Convert32To8(lp16, pBuffer, lSampleCount); + #else + C_Convert32To8(lp16, pBuffer, lSampleCount); + #endif +} -// Clip and convert to 16 bit -DWORD X86_Convert32To16(LPVOID lp16, int *pBuffer, DWORD lSampleCount) -//-------------------------------------------------------------------- + +#ifdef ENABLE_X86 +static DWORD X86_Convert32To16(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//--------------------------------------------------------------------------- { -#ifdef ENABLE_X86 DWORD result; _asm { mov ebx, lp16 // ebx = 16-bit buffer @@ -1959,7 +1936,12 @@ mov result, eax } return result; -#else +} +#endif + +static DWORD C_Convert32To16(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//------------------------------------------------------------------------- +{ int16 * p = (int16*)lp16; for(DWORD i=0; i<lSampleCount; i++) { @@ -1969,15 +1951,24 @@ p[i] = (int16)(v >> (16-MIXING_ATTENUATION)); } return lSampleCount * 2; -#endif } +// Clip and convert to 16 bit +DWORD Convert32To16(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//---------------------------------------------------------------- +{ + #ifdef ENABLE_X86 + X86_Convert32To16(lp16, pBuffer, lSampleCount); + #else + C_Convert32To16(lp16, pBuffer, lSampleCount); + #endif +} -// Clip and convert to 24 bit -DWORD X86_Convert32To24(LPVOID lp16, int *pBuffer, DWORD lSampleCount) -//-------------------------------------------------------------------- + +#ifdef ENABLE_X86 +static DWORD X86_Convert32To24(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//--------------------------------------------------------------------------- { -#ifdef ENABLE_X86 DWORD result; _asm { mov ebx, lp16 // ebx = 8-bit buffer @@ -2012,7 +2003,12 @@ mov result, eax } return result; -#else +} +#endif + +static DWORD C_Convert32To24(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//------------------------------------------------------------------------- +{ uint8 * p = (uint8*)lp16; for(DWORD i=0; i<lSampleCount; i++) { @@ -2031,15 +2027,24 @@ #endif } return lSampleCount * 3; -#endif } +// Clip and convert to 24 bit +DWORD Convert32To24(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +{ + #ifdef ENABLE_X86 + X86_Convert32To24(lp16, pBuffer, lSampleCount); + #else + C_Convert32To24(lp16, pBuffer, lSampleCount); + #endif +} -// Clip and convert to 32 bit -DWORD X86_Convert32To32(LPVOID lp16, int *pBuffer, DWORD lSampleCount) -//-------------------------------------------------------------------- + + +#ifdef ENABLE_X86 +static DWORD X86_Convert32To32(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//--------------------------------------------------------------------------- { -#ifdef ENABLE_X86 DWORD result; _asm { mov ebx, lp16 // ebx = 32-bit buffer @@ -2071,7 +2076,12 @@ mov result, eax } return result; -#else +} +#endif + +static DWORD C_Convert32To32(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//------------------------------------------------------------------------- +{ int32 * p = (int32*)lp16; for(DWORD i=0; i<lSampleCount; i++) { @@ -2081,10 +2091,20 @@ p[i] = v << MIXING_ATTENUATION; } return lSampleCount * 4; -#endif } +// Clip and convert to 32 bit +DWORD Convert32To32(LPVOID lp16, int *pBuffer, DWORD lSampleCount) +//---------------------------------------------------------------- +{ + #ifdef ENABLE_X86 + X86_Convert32To32(lp16, pBuffer, lSampleCount); + #else + C_Convert32To32(lp16, pBuffer, lSampleCount); + #endif +} + // convert to 32 bit floats and do NOT clip to [-1,1] DWORD Convert32ToFloat32(LPVOID lpBuffer, int *pBuffer, DWORD lSampleCount) //------------------------------------------------------------------------- @@ -2099,8 +2119,8 @@ } -void X86_InitMixBuffer(int *pBuffer, UINT nSamples) -//------------------------------------------------- +void InitMixBuffer(int *pBuffer, UINT nSamples) +//--------------------------------------------- { memset(pBuffer, 0, nSamples * sizeof(int)); } @@ -2163,10 +2183,10 @@ #endif -void X86_InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nFrames) -//------------------------------------------------------------------------ +#ifdef ENABLE_X86 +static void X86_InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nFrames) +//------------------------------------------------------------------------------- { -#ifdef ENABLE_X86 _asm { mov ecx, nFrames // ecx = framecount mov esi, pFrontBuf // esi = front buffer @@ -2191,7 +2211,12 @@ jnz interleaveloop pop ebp } -#else +} +#endif + +static void C_InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nFrames) +//----------------------------------------------------------------------------- +{ // copy backwards as we are writing back into FrontBuf for(int i=nFrames-1; i>=0; i--) { @@ -2200,12 +2225,22 @@ pFrontBuf[i*4+1] = pFrontBuf[i*2+1]; pFrontBuf[i*4+0] = pFrontBuf[i*2+0]; } -#endif } +void InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nFrames) +//-------------------------------------------------------------------- +{ + #ifdef ENABLE_X86 + X86_InterleaveFrontRear(pFrontBuf, pRearBuf, nFrames); + #else + C_InterleaveFrontRear(pFrontBuf, pRearBuf, nFrames); + #endif +} -VOID X86_MonoFromStereo(int *pMixBuf, UINT nSamples) -//-------------------------------------------------- + +#ifdef ENABLE_X86 +static void X86_MonoFromStereo(int *pMixBuf, UINT nSamples) +//--------------------------------------------------------- { _asm { mov ecx, nSamples @@ -2223,15 +2258,36 @@ jnz stloop } } +#endif +static void C_MonoFromStereo(int *pMixBuf, UINT nSamples) +//------------------------------------------------------- +{ + for(UINT i=0; i<nSamples; ++i) + { + pMixBuf[i] = (pMixBuf[i*2] + pMixBuf[i*2+1]) / 2; + } +} + +void MonoFromStereo(int *pMixBuf, UINT nSamples) +//---------------------------------------------- +{ + #ifdef ENABLE_X86 + X86_MonoFromStereo(pMixBuf, nSamples); + #else + C_MonoFromStereo(pMixBuf, nSamples); + #endif +} + + #define OFSDECAYSHIFT 8 #define OFSDECAYMASK 0xFF -void X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs) -//---------------------------------------------------------------------------- +#ifdef ENABLE_X86 +static void X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs) +//----------------------------------------------------------------------------------- { -#ifdef ENABLE_X86 _asm { mov edi, pBuffer mov ecx, nSamples @@ -2299,13 +2355,19 @@ mov [esi], eax mov [edi], edx } -#else // c implementation taken from libmodplug +} +#endif + +// c implementation taken from libmodplug +static void C_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs) +//--------------------------------------------------------------------------------- +{ int rofs = *lpROfs; int lofs = *lpLOfs; if ((!rofs) && (!lofs)) { - X86_InitMixBuffer(pBuffer, nSamples*2); + InitMixBuffer(pBuffer, nSamples*2); return; } for (UINT i=0; i<nSamples; i++) @@ -2319,16 +2381,24 @@ } *lpROfs = rofs; *lpLOfs = lofs; -#endif } +void StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs) +//------------------------------------------------------------------------ +{ + #ifdef ENABLE_X86 + X86_StereoFill(pBuffer, nSamples, lpROfs, lpLOfs); + #else + C_StereoFill(pBuffer, nSamples, lpROfs, lpLOfs); + #endif +} -typedef struct ModChannel ModChannel_; -void X86_EndChannelOfs(ModChannel *pChannel, int *pBuffer, UINT nSamples) -//----------------------------------------------------------------------- +#ifdef ENABLE_X86 +typedef ModChannel ModChannel_; +static void X86_EndChannelOfs(ModChannel *pChannel, int *pBuffer, UINT nSamples) +//------------------------------------------------------------------------------ { -#ifdef ENABLE_X86 _asm { mov esi, pChannel mov edi, pBuffer @@ -2365,7 +2435,14 @@ mov dword ptr [esi+ModChannel_.nROfs], eax mov dword ptr [esi+ModChannel_.nLOfs], edx } -#else // c implementation taken from libmodplug +} +#endif + +// c implementation taken from libmodplug +static void C_EndChannelOfs(ModChannel *pChannel, int *pBuffer, UINT nSamples) +//---------------------------------------------------------------------------- +{ + int rofs = pChannel->nROfs; int lofs = pChannel->nLOfs; @@ -2381,6 +2458,14 @@ } pChannel->nROfs = rofs; pChannel->nLOfs = lofs; -#endif } +void EndChannelOfs(ModChannel *pChannel, int *pBuffer, UINT nSamples) +//------------------------------------------------------------------- +{ + #ifdef ENABLE_X86 + X86_EndChannelOfs(pChannel, pBuffer, nSamples); + #else + C_EndChannelOfs(pChannel, pBuffer, nSamples); + #endif +} Modified: trunk/OpenMPT/soundlib/Mmx_mix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Mmx_mix.cpp 2013-05-01 00:33:53 UTC (rev 2000) +++ trunk/OpenMPT/soundlib/Mmx_mix.cpp 2013-05-01 11:38:40 UTC (rev 2001) @@ -27,6 +27,7 @@ DWORD CSoundFile::GetSysInfo() //---------------------------- { +#ifdef ENABLE_X86 static unsigned int fProcessorExtensions = 0; static bool bMMXChecked = false; @@ -78,6 +79,9 @@ bMMXChecked = true; } return fProcessorExtensions; +#else + return 0; +#endif } @@ -285,6 +289,8 @@ // Convert floating-point mix to integer + +#ifdef ENABLE_X86 void X86_FloatToStereoMix(const float *pIn1, const float *pIn2, int *pOut, UINT nCount, const float _f2ic) //-------------------------------------------------------------------------------------------------------- { @@ -309,8 +315,22 @@ fstp st(0) } } +#endif +void C_FloatToStereoMix(const float *pIn1, const float *pIn2, int *pOut, UINT nCount, const float _f2ic) +//------------------------------------------------------------------------------------------------------ +{ + for(UINT i=0; i<nCount; ++i) + { + *pOut++ = (int)(*pIn1++ * _f2ic); + *pOut++ = (int)(*pIn2++ * _f2ic); + } +} + + // Convert integer mix to floating-point + +#ifdef ENABLE_X86 void X86_StereoMixToFloat(const int *pSrc, float *pOut1, float *pOut2, UINT nCount, const float _i2fc) //---------------------------------------------------------------------------------------------------- { @@ -335,8 +355,20 @@ fstp st(0) } } +#endif +void C_StereoMixToFloat(const int *pSrc, float *pOut1, float *pOut2, UINT nCount, const float _i2fc) +//-------------------------------------------------------------------------------------------------- +{ + for(UINT i=0; i<nCount; ++i) + { + *pOut1++ = *pSrc++ * _i2fc; + *pOut2++ = *pSrc++ * _i2fc; + } +} + +#ifdef ENABLE_X86 void X86_FloatToMonoMix(const float *pIn, int *pOut, UINT nCount, const float _f2ic) //---------------------------------------------------------------------------------- { @@ -357,8 +389,19 @@ fstp st(0) } } +#endif +void C_FloatToMonoMix(const float *pIn, int *pOut, UINT nCount, const float _f2ic) +//-------------------------------------------------------------------------------- +{ + for(UINT i=0; i<nCount; ++i) + { + *pOut++ = (int)(*pIn++ * _f2ic); + } +} + +#ifdef ENABLE_X86 void X86_MonoMixToFloat(const int *pSrc, float *pOut, UINT nCount, const float _i2fc) //----------------------------------------------------------------------------------- { @@ -379,3 +422,13 @@ fstp st(0) } } +#endif + +void C_MonoMixToFloat(const int *pSrc, float *pOut, UINT nCount, const float _i2fc) +//--------------------------------------------------------------------------------- +{ + for(UINT i=0; i<nCount; ++i) + { + *pOut++ = *pSrc++ * _i2fc; + } +} Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2013-05-01 00:33:53 UTC (rev 2000) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2013-05-01 11:38:40 UTC (rev 2001) @@ -35,17 +35,17 @@ typedef DWORD (* LPCONVERTPROC)(LPVOID, int *, DWORD); -extern DWORD X86_Convert32To8(LPVOID lpBuffer, int *, DWORD nSamples); -extern DWORD X86_Convert32To16(LPVOID lpBuffer, int *, DWORD nSamples); -extern DWORD X86_Convert32To24(LPVOID lpBuffer, int *, DWORD nSamples); -extern DWORD X86_Convert32To32(LPVOID lpBuffer, int *, DWORD nSamples); +extern DWORD Convert32To8(LPVOID lpBuffer, int *, DWORD nSamples); +extern DWORD Convert32To16(LPVOID lpBuffer, int *, DWORD nSamples); +extern DWORD Convert32To24(LPVOID lpBuffer, int *, DWORD nSamples); +extern DWORD Convert32To32(LPVOID lpBuffer, int *, DWORD nSamples); extern DWORD Convert32ToFloat32(LPVOID lpBuffer, int *pBuffer, DWORD lSampleCount); #ifdef ENABLE_X86 extern VOID X86_Dither(int *pBuffer, UINT nSamples, UINT nBits); #endif -extern VOID X86_InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nFrames); -extern VOID X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs); -extern VOID X86_MonoFromStereo(int *pMixBuf, UINT nSamples); +extern void InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nFrames); +extern void StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs); +extern void MonoFromStereo(int *pMixBuf, UINT nSamples); // Log tables for pre-amp // Pre-amp (or more precisely: Pre-attenuation) depends on the number of channels, @@ -193,10 +193,10 @@ lSampleSize = m_MixerSettings.gnChannels; switch(m_MixerSettings.m_SampleFormat) { - case SampleFormatUnsigned8: pCvt = X86_Convert32To8 ; break; - case SampleFormatInt16: pCvt = X86_Convert32To16; break; - case SampleFormatInt24: pCvt = X86_Convert32To24; break; - case SampleFormatInt32: pCvt = X86_Convert32To32; break; + case SampleFormatUnsigned8: pCvt = Convert32To8 ; break; + case SampleFormatInt16: pCvt = Convert32To16; break; + case SampleFormatInt24: pCvt = Convert32To24; break; + case SampleFormatInt32: pCvt = Convert32To32; break; case SampleFormatFloat32: pCvt = Convert32ToFloat32; break; } lSampleSize *= m_MixerSettings.GetBitsPerSample()/8; @@ -265,7 +265,7 @@ #endif // NO_REVERB // Resetting sound buffer - X86_StereoFill(MixSoundBuffer, lCount, &gnDryROfsVol, &gnDryLOfsVol); + StereoFill(MixSoundBuffer, lCount, &gnDryROfsVol, &gnDryLOfsVol); ASSERT(lCount<=MIXBUFFERSIZE); // ensure MIXBUFFERSIZE really is our max buffer size if (m_MixerSettings.gnChannels >= 2) @@ -293,7 +293,7 @@ #endif // NO_REVERB if (nMaxPlugins) ProcessPlugins(lCount); - X86_MonoFromStereo(MixSoundBuffer, lCount); + MonoFromStereo(MixSoundBuffer, lCount); // Apply global volume if (m_PlayConfig.getGlobalVolumeAppliesToMaster()) @@ -337,7 +337,7 @@ // Multichannel if (m_MixerSettings.gnChannels > 2) { - X86_InterleaveFrontRear(MixSoundBuffer, MixRearBuffer, lCount); + InterleaveFrontRear(MixSoundBuffer, MixRearBuffer, lCount); lTotalSampleCount *= 2; } Modified: trunk/OpenMPT/soundlib/Waveform.cpp =================================================================== --- trunk/OpenMPT/soundlib/Waveform.cpp 2013-05-01 00:33:53 UTC (rev 2000) +++ trunk/OpenMPT/soundlib/Waveform.cpp 2013-05-01 11:38:40 UTC (rev 2001) @@ -56,9 +56,9 @@ #ifdef ENABLE_X86 extern void X86_Dither(int *pBuffer, UINT nSamples, UINT nBits); #endif -extern DWORD X86_Convert32To8(LPVOID lpBuffer, int *, DWORD nSamples); -extern DWORD X86_Convert32To16(LPVOID lpBuffer, int *, DWORD nSamples); -extern DWORD X86_Convert32To24(LPVOID lpBuffer, int *, DWORD nSamples); +extern DWORD Convert32To8(LPVOID lpBuffer, int *, DWORD nSamples); +extern DWORD Convert32To16(LPVOID lpBuffer, int *, DWORD nSamples); +extern DWORD Convert32To24(LPVOID lpBuffer, int *, DWORD nSamples); UINT CSoundFile::Normalize24BitBuffer(LPBYTE pbuffer, UINT dwSize, DWORD lmax24, DWORD dwByteInc) //----------------------------------------------------------------------------------------------- @@ -73,9 +73,9 @@ X86_Dither(tempbuf, nbuf, 8 * dwByteInc); switch(dwByteInc) { - case 2: X86_Convert32To16(pbuffer, tempbuf, nbuf); break; - case 3: X86_Convert32To24(pbuffer, tempbuf, nbuf); break; - default: X86_Convert32To8(pbuffer, tempbuf, nbuf); + case 2: Convert32To16(pbuffer, tempbuf, nbuf); break; + case 3: Convert32To24(pbuffer, tempbuf, nbuf); break; + default: Convert32To8(pbuffer, tempbuf, nbuf); break; } n -= nbuf; pbuffer += dwByteInc * nbuf; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-05-01 13:07:42
|
Revision: 2002 http://sourceforge.net/p/modplug/code/2002 Author: manxorist Date: 2013-05-01 13:07:32 +0000 (Wed, 01 May 2013) Log Message: ----------- [Ref] Make class FileReader optinally read from a std::istream. This can be used in the future to only read the file headers from unseekable streams instead of pre-caching the whole file just to decide if it would be readable at all. This is completely disabled in the tracker and compiled out for now because the tracker just mmaps the whole file. [Ref] Reduce usage of FileReader functions that would require pre-caching until EOF for unseekable steam. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/common/stdafx.h trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/ChunkReader.h trunk/OpenMPT/soundlib/FileReader.h trunk/OpenMPT/soundlib/ITCompression.cpp trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_gdm.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_mtm.cpp trunk/OpenMPT/soundlib/Load_okt.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_wav.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/WAVTools.cpp trunk/OpenMPT/soundlib/load_j2b.cpp trunk/OpenMPT/unarchiver/ungzip.cpp Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/common/BuildSettings.h 2013-05-01 13:07:32 UTC (rev 2002) @@ -38,6 +38,9 @@ // Disable unarchiving support //#define NO_ARCHIVE_SUPPORT +// Disable std::istream support in class FileReader (this is generally not needed for the tracker, local files can easily be mmapped as they have been before introducing std::istream support) +#define NO_FILEREADER_STD_ISTREAM + // Disable the built-in reverb effect //#define NO_REVERB Modified: trunk/OpenMPT/common/stdafx.h =================================================================== --- trunk/OpenMPT/common/stdafx.h 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/common/stdafx.h 2013-05-01 13:07:32 UTC (rev 2002) @@ -50,6 +50,7 @@ // this will be available everywhere #include "../common/typedefs.h" // this adds: +// <memory> // <new> // <string> // <vector> Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/common/typedefs.h 2013-05-01 13:07:32 UTC (rev 2002) @@ -99,6 +99,15 @@ +#include <memory> +#if defined(_MSC_VER) && (_MSC_VER <= MSVC_VER_2008) +#define MPT_SHARED_PTR std::tr1::shared_ptr +#else +#define MPT_SHARED_PTR std::shared_ptr +#endif + + + #if !defined(_MFC_VER) void AssertHandler(const char *file, int line, const char *function, const char *expr); #if defined(_DEBUG) Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -24,6 +24,7 @@ #include "CleanupSong.h" #include "../common/StringFixer.h" #include "soundlib/FileReader.h" +#include <fstream> #include <shlwapi.h> #ifdef _DEBUG @@ -200,27 +201,34 @@ //------------------------------------------------ { BOOL bModified = TRUE; - CMappedFile f; ScopedLogCapturer logcapturer(*this); if (!lpszPathName) return OnNewDocument(); + BeginWaitCursor(); - if (f.Open(lpszPathName)) + #ifndef NO_FILEREADER_STD_ISTREAM + std::ifstream f(lpszPathName, std::ios_base::binary); + m_SndFile.Create(FileReader(&f), CSoundFile::loadCompleteModule, this); + #else { - DWORD dwLen = f.GetLength(); - if (dwLen) + CMappedFile f; + if (f.Open(lpszPathName)) { - LPBYTE lpStream = f.Lock(); - if (lpStream) + DWORD dwLen = f.GetLength(); + if (dwLen) { - m_SndFile.Create(FileReader(lpStream, dwLen), CSoundFile::loadCompleteModule, this); - f.Unlock(); + LPBYTE lpStream = f.Lock(); + if (lpStream) + { + m_SndFile.Create(FileReader(lpStream, dwLen), CSoundFile::loadCompleteModule, this); + f.Unlock(); + } } + f.Close(); } - f.Close(); } - + #endif EndWaitCursor(); std::ostringstream str; Modified: trunk/OpenMPT/soundlib/ChunkReader.h =================================================================== --- trunk/OpenMPT/soundlib/ChunkReader.h 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/ChunkReader.h 2013-05-01 13:07:32 UTC (rev 2002) @@ -102,7 +102,7 @@ ChunkList<T> ReadChunks(size_t padding) { ChunkList<T> result; - while(BytesLeft()) + while(AreBytesLeft()) { T chunkHeader; if(!Read(chunkHeader)) Modified: trunk/OpenMPT/soundlib/FileReader.h =================================================================== --- trunk/OpenMPT/soundlib/FileReader.h 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/FileReader.h 2013-05-01 13:07:32 UTC (rev 2002) @@ -10,38 +10,421 @@ #pragma once + #include "../common/typedefs.h" #include "../common/StringFixer.h" #include "Endianness.h" -#include <vector> #include <algorithm> +#ifndef NO_FILEREADER_STD_ISTREAM +#include <ios> +#include <istream> +#endif #include <limits> +#include <vector> +// change to show warnings for functions which trigger pre-caching the whole file for unseekable streams +//#define FILEREADER_DEPRECATED DEPRECATED +#define FILEREADER_DEPRECATED + + +#ifndef NO_FILEREADER_STD_ISTREAM + +class IFileDataContainer { +public: + typedef std::size_t off_t; +protected: + IFileDataContainer() { } +public: + virtual ~IFileDataContainer() { } +public: + virtual bool IsValid() const = 0; + virtual const char *GetRawData() const = 0; + virtual off_t GetLength() const = 0; + virtual off_t Read(char *dst, off_t pos, off_t count) const = 0; + + virtual const char *GetPartialRawData(off_t pos, off_t length) const // DO NOT USE!!! this is just for ReadMagic ... the pointer returned may be invalid after the next Read() + { + if(pos + length > GetLength()) + { + return nullptr; + } + return GetRawData() + pos; + } + + virtual bool CanRead(off_t pos, off_t length) const + { + return pos + length <= GetLength(); + } + + virtual off_t GetReadableLength(off_t pos, off_t length) const + { + if(pos >= GetLength()) + { + return 0; + } + return std::min<off_t>(length, GetLength() - pos); + } +}; + + +class FileDataContainerDummy : public IFileDataContainer { +public: + FileDataContainerDummy() { } + virtual ~FileDataContainerDummy() { } +public: + bool IsValid() const + { + return false; + } + + const char *GetRawData() const + { + return nullptr; + } + + off_t GetLength() const + { + return 0; + } + off_t Read(char *dst, off_t pos, off_t count) const + { + return 0; + } +}; + + +class FileDataContainerWindow : public IFileDataContainer +{ +private: + MPT_SHARED_PTR<IFileDataContainer> data; + off_t dataOffset; + off_t dataLength; +public: + FileDataContainerWindow(MPT_SHARED_PTR<IFileDataContainer> src, off_t off, off_t len) : data(src), dataOffset(off), dataLength(len) { } + virtual ~FileDataContainerWindow() { } + + bool IsValid() const + { + return data->IsValid(); + } + const char *GetRawData() const { + return data->GetRawData() + dataOffset; + } + off_t GetLength() const { + return dataLength; + } + off_t Read(char *dst, off_t pos, off_t count) const + { + return data->Read(dst, dataOffset + pos, count); + } + const char *GetPartialRawData(off_t pos, off_t length) const + { + if(pos + length > dataLength) + { + return nullptr; + } + return data->GetPartialRawData(dataOffset + pos, length); + } + bool CanRead(off_t pos, off_t length) const { + return pos + length <= dataLength; + } + off_t GetReadableLength(off_t pos, off_t length) const + { + if(pos >= dataLength) + { + return 0; + } + return std::min<off_t>(length, dataLength - pos); + } +}; + + +class FileDataContainerStdStream : public IFileDataContainer { +private: + mutable std::vector<char> cache; + mutable bool streamFullyCached; + + std::istream *stream; + +public: + FileDataContainerStdStream(std::istream *s) : stream(s), streamFullyCached(false) { } + virtual ~FileDataContainerStdStream() { } + +private: + static const std::size_t buffer_size = 65536; + void CacheStream() const + { + if(streamFullyCached) + { + return; + } + while(*stream) + { + cache.resize(cache.size() + buffer_size); + stream->read(&cache[cache.size() - buffer_size], buffer_size); + std::size_t readcount = static_cast<std::size_t>(stream->gcount()); + cache.resize(cache.size() - buffer_size + readcount); + } + streamFullyCached = true; + } + void CacheStreamUpTo(std::streampos pos) const + { + if(streamFullyCached) + { + return; + } + if(pos <= std::streampos(cache.size())) + { + return; + } + std::size_t needcount = static_cast<std::size_t>(pos - std::streampos(cache.size())); + cache.resize(static_cast<std::size_t>(pos)); + stream->read(&cache[cache.size() - needcount], needcount); + std::size_t readcount = static_cast<std::size_t>(stream->gcount()); + cache.resize(cache.size() - buffer_size + readcount); + if(*stream) + { + // can read further + return; + } + streamFullyCached = true; + } +private: + void ReadCached(char *dst, off_t pos, off_t count) const + { + std::copy(cache.begin() + pos, cache.begin() + pos + count, dst); + } + +public: + + bool IsValid() const + { + return true; + } + + const char *GetRawData() const + { + CacheStream(); + return &cache[0]; + } + + off_t GetLength() const + { + if(streamFullyCached) + { + return cache.size(); + } else + { + stream->clear(); + std::streampos oldpos = stream->tellg(); + if(!stream->fail() && oldpos != std::streampos(-1)) + { + stream->seekg(0, std::ios::end); + if(!stream->fail()) + { + std::streampos length = stream->tellg(); + if(!stream->fail() && length != std::streampos(-1)) + { + stream->seekg(oldpos); + stream->clear(); + return static_cast<off_t>(length); + } + } + stream->clear(); + stream->seekg(oldpos); + } + // not seekable + stream->clear(); + CacheStream(); + return cache.size(); + } + } + + off_t Read(char *dst, off_t pos, off_t count) const + { + CacheStreamUpTo(pos + count); + if(pos >= off_t(cache.size())) + { + return 0; + } + off_t cache_avail = std::min<off_t>(off_t(cache.size()) - pos, count); + ReadCached(dst, pos, cache_avail); + return cache_avail; + } + + const char *GetPartialRawData(off_t pos, off_t length) const + { + CacheStreamUpTo(pos + length); + if(pos + length > off_t(cache.size())) + { + return nullptr; + } + return &cache[pos]; + } + + bool CanRead(off_t pos, off_t length) const + { + CacheStreamUpTo(pos + length); + return pos + length <= off_t(cache.size()); + } + + off_t GetReadableLength(off_t pos, off_t length) const + { + CacheStreamUpTo(pos + length); + return std::min<off_t>(cache.size() - pos, length); + } + +}; + +#endif + + +class FileDataContainerMemory +#ifndef NO_FILEREADER_STD_ISTREAM + : public IFileDataContainer +#endif +{ + +#ifdef NO_FILEREADER_STD_ISTREAM +public: + typedef std::size_t off_t; +#endif + +private: + + const char *streamData; // Pointer to memory-mapped file + off_t streamLength; // Size of memory-mapped file in bytes + +public: + FileDataContainerMemory() : streamData(nullptr), streamLength(0) { } + FileDataContainerMemory(const char *data, off_t length) : streamData(data), streamLength(length) { } +#ifndef NO_FILEREADER_STD_ISTREAM + virtual +#endif + ~FileDataContainerMemory() { } + +public: + + bool IsValid() const + { + return streamData != nullptr; + } + + const char *GetRawData() const + { + return streamData; + } + + off_t GetLength() const + { + return streamLength; + } + + off_t Read(char *dst, off_t pos, off_t count) const + { + if(pos >= streamLength) + { + return 0; + } + off_t avail = std::min<off_t>(streamLength - pos, count); + std::copy(streamData + pos, streamData + pos + avail, dst); + return avail; + } + + const char *GetPartialRawData(off_t pos, off_t length) const + { + if(pos + length > streamLength) + { + return nullptr; + } + return streamData + pos; + } + + bool CanRead(off_t pos, off_t length) const + { + return pos + length <= streamLength; + } + + off_t GetReadableLength(off_t pos, off_t length) const + { + if(pos >= streamLength) + { + return 0; + } + return std::min<off_t>(length, streamLength - pos); + } + +}; + + //============== class FileReader //============== { + public: - typedef size_t off_t; // Type for file offsets and sizes +#ifndef NO_FILEREADER_STD_ISTREAM + typedef IFileDataContainer::off_t off_t; +#else + typedef FileDataContainerMemory::off_t off_t; +#endif + private: - const char *streamData; // Pointer to memory-mapped file - off_t streamLength; // Size of memory-mapped file in bytes + +#ifndef NO_FILEREADER_STD_ISTREAM + const IFileDataContainer & DataContainer() const { return *data; } + IFileDataContainer & DataContainer() { return *data; } + MPT_SHARED_PTR<IFileDataContainer> data; +#else + const FileDataContainerMemory & DataContainer() const { return data; } + FileDataContainerMemory & DataContainer() { return data; } + FileDataContainerMemory data; +#endif + off_t streamPos; // Cursor location in the file public: + +#ifndef NO_FILEREADER_STD_ISTREAM + // Initialize invalid file reader object. - FileReader() : streamData(nullptr), streamLength(0), streamPos(0) { } + FileReader() : data(new FileDataContainerDummy()), streamPos(0) { } + // Initialize file reader object with pointer to data and data length. - FileReader(const void *data, off_t length) : streamData(static_cast<const char *>(data)), streamLength(length), streamPos(0) { } + FileReader(const void *voiddata, off_t length) : data(new FileDataContainerMemory(static_cast<const char *>(voiddata), length)), streamPos(0) { } + FileReader(const char *chardata, off_t length) : data(new FileDataContainerMemory(chardata, length)), streamPos(0) { } + FileReader(const uint8 *uint8data, off_t length) : data(new FileDataContainerMemory(reinterpret_cast<const char *>(uint8data), length)), streamPos(0) { } + + // Initialize file reader object with a std::istream. + FileReader(std::istream *s) : data(new FileDataContainerStdStream(s)), streamPos(0) { } + + // Initialize file reader object based on an existing file reader object window. + FileReader(MPT_SHARED_PTR<IFileDataContainer> other) : data(other), streamPos(0) { } + // Initialize file reader object based on an existing file reader object. The other object's stream position is copied. - FileReader(const FileReader &other) : streamData(other.streamData), streamLength(other.streamLength), streamPos(other.streamPos) { } + FileReader(const FileReader &other) : data(other.data), streamPos(other.streamPos) { } +#else + + // Initialize invalid file reader object. + FileReader() : data(nullptr, 0), streamPos(0) { } + + // Initialize file reader object with pointer to data and data length. + FileReader(const void *voiddata, off_t length) : data(static_cast<const char *>(voiddata), length), streamPos(0) { } + FileReader(const char *chardata, off_t length) : data(chardata, length), streamPos(0) { } + FileReader(const uint8 *uint8data, off_t length) : data(reinterpret_cast<const char *>(uint8data), length), streamPos(0) { } + + // Initialize file reader object based on an existing file reader object. The other object's stream position is copied. + FileReader(const FileReader &other) : data(other.data), streamPos(other.streamPos) { } + +#endif + // Returns true if the object points to a valid stream. bool IsValid() const { - return streamData != nullptr; + return DataContainer().IsValid(); } // Reset cursor to first byte in file. @@ -54,10 +437,15 @@ // Returns false if position is invalid. bool Seek(off_t position) { - if(position <= streamLength) + if(position <= streamPos) { streamPos = position; return true; + } + if(position <= DataContainer().GetLength()) + { + streamPos = position; + return true; } else { return false; @@ -68,13 +456,13 @@ // Returns true if skipBytes could be skipped or false if the file end was reached earlier. bool Skip(off_t skipBytes) { - if(BytesLeft() >= skipBytes) + if(CanRead(skipBytes)) { streamPos += skipBytes; return true; } else { - streamPos = streamLength; + streamPos = DataContainer().GetLength(); return false; } } @@ -101,34 +489,49 @@ } // Returns size of the mapped file in bytes. - off_t GetLength() const + FILEREADER_DEPRECATED off_t GetLength() const { - return streamLength; + // deprecated because in case of an unseekable std::istream, this triggers caching of the whole file + return DataContainer().GetLength(); } // Return byte count between cursor position and end of file, i.e. how many bytes can still be read. - off_t BytesLeft() const + FILEREADER_DEPRECATED off_t BytesLeft() const { - return streamLength - streamPos; + // deprecated because in case of an unseekable std::istream, this triggers caching of the whole file + return DataContainer().GetLength() - streamPos; } + bool AreBytesLeft() const + { + return CanRead(1); + } + + bool NoBytesLeft() const + { + return !CanRead(1); + } + // Check if "amount" bytes can be read from the current position in the stream. bool CanRead(off_t amount) const { - return (amount <= BytesLeft()); + return DataContainer().CanRead(streamPos, amount); } // Create a new FileReader object for parsing a sub chunk at a given position with a given length. // The file cursor is not modified. FileReader GetChunk(off_t position, off_t length) const { - if(position < streamLength) + off_t readableLength = DataContainer().GetReadableLength(position, length); + if(readableLength == 0) { - return FileReader(streamData + position, (std::min)(length, streamLength - position)); - } else - { return FileReader(); } + #ifndef NO_FILEREADER_STD_ISTREAM + return FileReader(MPT_SHARED_PTR<IFileDataContainer>(new FileDataContainerWindow(data, position, (std::min)(length, DataContainer().GetLength() - position)))); + #else + return FileReader(DataContainer().GetRawData() + position, (std::min)(length, DataContainer().GetLength() - position)); + #endif } // Create a new FileReader object for parsing a sub chunk at the current position with a given length. @@ -142,9 +545,10 @@ // Returns raw stream data at cursor position. // Should only be used if absolutely necessary, for example for sample reading. - const char *GetRawData() const + FILEREADER_DEPRECATED const char *GetRawData() const { - return streamData + streamPos; + // deprecated because in case of an unseekable std::istream, this triggers caching of the whole file + return DataContainer().GetRawData() + streamPos; } // Read a "T" object from the stream. @@ -153,15 +557,12 @@ template <typename T> bool Read(T &target) { - if(CanRead(sizeof(T))) + if(sizeof(T) != DataContainer().Read(reinterpret_cast<char*>(&target), streamPos, sizeof(T))) { - target = *reinterpret_cast<const T *>(streamData + streamPos); - streamPos += sizeof(T); - return true; - } else - { return false; } + streamPos += sizeof(T); + return true; } protected: @@ -331,9 +732,7 @@ template <typename T> bool ReadStructPartial(T &target, off_t partialSize = sizeof(T)) { - const off_t copyBytes = Util::Min(partialSize, sizeof(target), BytesLeft()); - - memcpy(&target, streamData + streamPos, copyBytes); + const off_t copyBytes = DataContainer().Read(reinterpret_cast<char *>(&target), streamPos, partialSize); memset(reinterpret_cast<char *>(&target) + copyBytes, 0, sizeof(target) - copyBytes); Skip(partialSize); @@ -363,7 +762,7 @@ { if(CanRead(srcSize)) { - StringFixer::ReadString<mode, destSize>(destBuffer, streamData + streamPos, srcSize); + StringFixer::ReadString<mode, destSize>(destBuffer, DataContainer().GetPartialRawData(streamPos, srcSize), srcSize); streamPos += srcSize; return true; } else @@ -380,8 +779,10 @@ { if(CanRead(sizeof(destArray))) { - memcpy(destArray, streamData + streamPos, sizeof(destArray)); - streamPos += sizeof(destArray); + for(std::size_t i = 0; i < destSize; ++i) + { + Read(destArray[i]); + } return true; } else { @@ -400,10 +801,9 @@ destVector.resize(destSize); if(CanRead(readSize)) { - if(readSize) + for(std::size_t i = 0; i < destSize; ++i) { - memcpy(&destVector[0], streamData + streamPos, readSize); - streamPos += readSize; + Read(destVector[i]); } return true; } else @@ -418,10 +818,16 @@ bool ReadMagic(const char *const magic) { const off_t magicLength = strlen(magic); - if(CanRead(magicLength) && !memcmp(streamData + streamPos, magic, magicLength)) + if(CanRead(magicLength)) { - streamPos += magicLength; - return true; + if(!memcmp(DataContainer().GetPartialRawData(streamPos, magicLength), magic, magicLength)) + { + streamPos += magicLength; + return true; + } else + { + return false; + } } else { return false; @@ -439,7 +845,7 @@ && std::numeric_limits<T>::is_signed == false, "Target type is a not an unsigned integer"); - if(!BytesLeft()) + if(NoBytesLeft()) { target = 0; return false; @@ -458,7 +864,7 @@ } } - while(BytesLeft() && (b & 0x80) != 0) + while(AreBytesLeft() && (b & 0x80) != 0) { b = ReadUint8(); target <<= 7; Modified: trunk/OpenMPT/soundlib/ITCompression.cpp =================================================================== --- trunk/OpenMPT/soundlib/ITCompression.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/ITCompression.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -354,7 +354,7 @@ for(uint8 chn = 0; chn < mptSample.GetNumChannels(); chn++) { writtenSamples = writePos = 0; - while(writtenSamples < sample.nLength && file.BytesLeft()) + while(writtenSamples < sample.nLength && file.AreBytesLeft()) { chunk = file.GetChunk(file.ReadUint16LE()); Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2013-05-01 13:07:32 UTC (rev 2002) @@ -109,7 +109,7 @@ if(!file.Read(fileHeader) || strncmp(fileHeader.signature, "ASYLUM Music Format V1.0", 25) || fileHeader.numSamples > 64 - || file.BytesLeft() < 256 + 64 * sizeof(AsylumSampleHeader) + 64 * 4 * 8 * fileHeader.numPatterns) + || !file.CanRead(256 + 64 * sizeof(AsylumSampleHeader) + 64 * 4 * 8 * fileHeader.numPatterns)) { return false; } else if(loadFlags == onlyVerifyHeader) @@ -195,7 +195,7 @@ { fileChunk.Rewind(); ModCommand::INSTR lastInstr = 0; - while(fileChunk.BytesLeft()) + while(fileChunk.AreBytesLeft()) { const uint8 row = fileChunk.ReadUint8(); const uint8 command = fileChunk.ReadUint8(); @@ -550,7 +550,7 @@ break; } } - if(!file.BytesLeft()) + if(file.NoBytesLeft()) { break; } Modified: trunk/OpenMPT/soundlib/Load_ams.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ams.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_ams.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -106,7 +106,7 @@ for(ROWINDEX row = 0; row < pattern.GetNumRows(); row++) { PatternRow baseRow = pattern.GetRow(row); - while(patternChunk.BytesLeft()) + while(patternChunk.AreBytesLeft()) { const uint8 flags = patternChunk.ReadUint8(); if(flags == emptyRow) @@ -386,7 +386,7 @@ if(!file.ReadMagic("Extreme") || !file.ReadConvertEndianness(fileHeader) || !file.Skip(fileHeader.extraSize) - || file.BytesLeft() < fileHeader.numSamps * sizeof(AMSSampleHeader) + || !file.CanRead(fileHeader.numSamps * sizeof(AMSSampleHeader)) || fileHeader.versionHigh != 0x01) { return false; Modified: trunk/OpenMPT/soundlib/Load_gdm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_gdm.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -357,7 +357,7 @@ m.command = CMD_NONE; m.volcmd = VOLCMD_NONE; - while(chunk.BytesLeft()) + while(chunk.AreBytesLeft()) { uint8 effByte = chunk.ReadUint8(); uint8 paramByte = chunk.ReadUint8(); Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -583,7 +583,7 @@ } // Read mix plugins information - if(file.BytesLeft() > 8) + if(file.CanRead(9)) { LoadMixPlugins(file); } @@ -697,7 +697,7 @@ ROWINDEX row = 0; vector<uint8> chnMask(GetNumChannels()); - while(row < numRows && patternData.BytesLeft()) + while(row < numRows && patternData.AreBytesLeft()) { uint8 b = patternData.ReadUint8(); if(!b) @@ -778,7 +778,7 @@ ModCommand *m = Patterns[pat]; ROWINDEX row = 0; - while(row < numRows && patternData.BytesLeft()) + while(row < numRows && patternData.AreBytesLeft()) { uint8 b = patternData.ReadUint8(); if(!b) @@ -1745,7 +1745,7 @@ void CSoundFile::LoadMixPlugins(FileReader &file) //----------------------------------------------- { - while(file.BytesLeft() > 8) + while(file.CanRead(9)) { char code[4]; file.ReadArray(code); @@ -1797,7 +1797,7 @@ //if dwMPTExtra is positive and there are dwMPTExtra bytes left in nPluginSize, we have some more data! if(modularData.IsValid()) { - while(modularData.BytesLeft() > 4) + while(modularData.CanRead(5)) { // do we recognize this chunk? modularData.ReadArray(code); @@ -2078,7 +2078,7 @@ if(pInterpretMptMade != nullptr) *pInterpretMptMade = true; - while(file.BytesLeft() >= 6) //Loop 'till beginning of end of file/mpt specific looking for inst. extensions + while(file.CanRead(6)) //Loop 'till beginning of end of file/mpt specific looking for inst. extensions { uint32 code = file.ReadUint32LE(); @@ -2123,7 +2123,7 @@ #define CASE_NOTXM(id, data) \ case id: if(modtype != MOD_TYPE_XM) { fadr = reinterpret_cast<char *>(&data); maxReadCount = std::min(size_t(size), sizeof(data));} break; - while(file.BytesLeft() > 6) + while(file.CanRead(7)) { const uint32 code = file.ReadUint32LE(); const uint16 size = file.ReadUint16LE(); @@ -2274,7 +2274,7 @@ FileReader modularData = file.GetChunk(file.ReadUint32LE()); // Handle chunks - while(modularData.BytesLeft()) + while(modularData.AreBytesLeft()) { const uint32 chunkID = modularData.ReadUint32LE(); Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -49,7 +49,7 @@ file.Rewind(); // Check file ID - if(file.BytesLeft() < 12 + 4 + 24 + 4 + if(!file.CanRead(12 + 4 + 24 + 4) || file.ReadUint32LE() != ITP_FILE_ID // Magic bytes || (version = file.ReadUint32LE()) > ITP_VERSION // Format version || !ReadITPString(m_szNames[0], file)) // Song name @@ -233,7 +233,7 @@ code = file.ReadUint32LE(); INSTRUMENTINDEX ins = 1; - while(ins <= GetNumInstruments() && file.BytesLeft()) + while(ins <= GetNumInstruments() && file.AreBytesLeft()) { if(code == 'MPTS') { Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -769,7 +769,7 @@ char songname[20]; file.ReadArray(songname); if(!IsValidName(songname, sizeof(songname), ' ') - || file.BytesLeft() < sizeof(MODSampleHeader) * 15 + sizeof(MODFileHeader)) + || !file.CanRead(sizeof(MODSampleHeader) * 15 + sizeof(MODFileHeader))) { return false; } Modified: trunk/OpenMPT/soundlib/Load_mtm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mtm.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_mtm.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -110,7 +110,7 @@ || fileHeader.numSamples >= MAX_SAMPLES || fileHeader.lastPattern >= MAX_PATTERNS || fileHeader.beatsPerTrack == 0 - || file.BytesLeft() < sizeof(MTMSampleHeader) * fileHeader.numSamples + 128 + 192 * fileHeader.numTracks + 64 * (fileHeader.lastPattern + 1) + fileHeader.commentSize) + || !file.CanRead(sizeof(MTMSampleHeader) * fileHeader.numSamples + 128 + 192 * fileHeader.numTracks + 64 * (fileHeader.lastPattern + 1) + fileHeader.commentSize)) { return false; } else if(loadFlags == onlyVerifyHeader) Modified: trunk/OpenMPT/soundlib/Load_okt.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_okt.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_okt.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -298,7 +298,7 @@ m_szNames[0][0] = '\0'; // Go through IFF chunks... - while(file.BytesLeft()) + while(file.AreBytesLeft()) { OktIffChunk iffHead; if(!file.ReadConvertEndianness(iffHead)) Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -409,7 +409,7 @@ uint16 chunkCount = 0, firstOrderChunk = uint16_max; // "Sub sub sub chunks" (grrrr, silly format) - while(subChunk.BytesLeft()) + while(subChunk.AreBytesLeft()) { uint8 subChunkID = subChunk.ReadUint8(); if(!subChunkID) @@ -546,7 +546,7 @@ ASSERT(subChunkHead.length >= m_nChannels * 2u); for(CHANNELINDEX chn = 0; chn < m_nChannels; chn++) { - if(subChunk.BytesLeft() < 2) + if(!subChunk.CanRead(2)) { break; } @@ -702,7 +702,7 @@ FileReader rowChunk = patternChunk.GetChunk(rowSize - 2); - while(rowChunk.BytesLeft()) + while(rowChunk.AreBytesLeft()) { uint8 flags = rowChunk.ReadUint8(); uint8 channel = rowChunk.ReadUint8(); @@ -1255,7 +1255,7 @@ ROWINDEX curRow = 0; - while(patternChunk.BytesLeft() && curRow < patternHeader.numRows) + while(patternChunk.AreBytesLeft() && curRow < patternHeader.numRows) { uint8 chnFlag = patternChunk.ReadUint8(); if(chnFlag == 0) Modified: trunk/OpenMPT/soundlib/Load_wav.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_wav.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_wav.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -28,7 +28,7 @@ const size_t offset = channelIndex * sizeof(SampleConverter::input_t); - if(sample.AllocateSample() == 0 || file.BytesLeft() < offset) + if(sample.AllocateSample() == 0 || !file.CanRead(offset)) { return false; } Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -486,7 +486,7 @@ } // Read mix plugins information - if(file.BytesLeft() >= 8) + if(file.CanRead(8)) { FileReader::off_t oldPos = file.GetPosition(); LoadMixPlugins(file); @@ -524,7 +524,7 @@ } // Leave if no extra instrument settings are available (end of file reached) - if(!file.BytesLeft()) return true; + if(file.NoBytesLeft()) return true; bool interpretOpenMPTMade = false; // specific for OpenMPT 1.17+ (bMadeWithModPlug is also for MPT 1.16) if(GetNumInstruments()) Modified: trunk/OpenMPT/soundlib/ModSequence.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModSequence.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/ModSequence.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -678,7 +678,7 @@ bool ModSequence::Deserialize(FileReader &file) //--------------------------------------------- { - if(file.BytesLeft() < 2 + 4) return false; + if(!file.CanRead(2 + 4)) return false; uint16 version = file.ReadUint16LE(); if(version != 0) return false; Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -1425,7 +1425,7 @@ FileReader soundChunk(chunks.GetChunk(AIFFChunk::idSSND)); AIFFSoundChunk sampleHeader; if(!soundChunk.ReadConvertEndianness(sampleHeader) - || soundChunk.BytesLeft() <= sampleHeader.offset) + || !soundChunk.CanRead(sampleHeader.offset)) { return false; } @@ -1755,7 +1755,7 @@ return; } - while(file.BytesLeft() > 6) + while(file.CanRead(7)) { ReadExtendedInstrumentProperty(pIns, file.ReadUint32LE(), file); } @@ -1972,7 +1972,7 @@ static FLAC__bool eof_cb(const FLAC__StreamDecoder *, void *client_data) { FileReader &file = static_cast<FLACDecoder *>(client_data)->file; - return file.BytesLeft() == 0; + return file.NoBytesLeft(); } static FLAC__StreamDecoderWriteStatus write_cb(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data) @@ -2342,7 +2342,7 @@ // Check file for validity, or else mpg123 will happily munch many files that start looking vaguely resemble an MPEG stream mid-file. file.Rewind(); - while(file.BytesLeft() > 3) + while(file.CanRead(4)) { uint8 header[3]; file.ReadArray(header); Modified: trunk/OpenMPT/soundlib/WAVTools.cpp =================================================================== --- trunk/OpenMPT/soundlib/WAVTools.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/WAVTools.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -169,7 +169,7 @@ sample.nVibDepth = mptInfo.vibratoDepth; sample.nVibRate = mptInfo.vibratoRate; - if(xtraChunk.BytesLeft() >= MAX_SAMPLENAME) + if(xtraChunk.CanRead(MAX_SAMPLENAME)) { // Name present (clipboard only) xtraChunk.ReadString<StringFixer::nullTerminated>(sampleName, MAX_SAMPLENAME); Modified: trunk/OpenMPT/soundlib/load_j2b.cpp =================================================================== --- trunk/OpenMPT/soundlib/load_j2b.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/soundlib/load_j2b.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -599,7 +599,7 @@ dataFlag = 0xE0, // Channel data present }; - if(!chunk.BytesLeft()) + if(chunk.NoBytesLeft()) { return false; } @@ -616,7 +616,7 @@ PatternRow rowBase = sndFile.Patterns[pat].GetRow(0); ROWINDEX row = 0; - while(row < numRows && chunk.BytesLeft()) + while(row < numRows && chunk.AreBytesLeft()) { const uint8 flags = chunk.ReadUint8(); Modified: trunk/OpenMPT/unarchiver/ungzip.cpp =================================================================== --- trunk/OpenMPT/unarchiver/ungzip.cpp 2013-05-01 11:38:40 UTC (rev 2001) +++ trunk/OpenMPT/unarchiver/ungzip.cpp 2013-05-01 13:07:32 UTC (rev 2002) @@ -87,7 +87,7 @@ } // Well, this is a bit small when inflated / deflated. - if(trailer.isize == 0 || inFile.BytesLeft() < sizeof(GZtrailer)) + if(trailer.isize == 0 || !inFile.CanRead(sizeof(GZtrailer))) { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-05-03 14:49:39
|
Revision: 2006 http://sourceforge.net/p/modplug/code/2006 Author: manxorist Date: 2013-05-03 14:49:28 +0000 (Fri, 03 May 2013) Log Message: ----------- [Ref] Try to improve debug messages in CASIODevice. Modified Paths: -------------- trunk/OpenMPT/common/AudioCriticalSection.h trunk/OpenMPT/common/typedefs.cpp trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/mptrack/ExceptionHandler.cpp trunk/OpenMPT/sounddev/SoundDevice.cpp trunk/OpenMPT/sounddev/SoundDevices.h Modified: trunk/OpenMPT/common/AudioCriticalSection.h =================================================================== --- trunk/OpenMPT/common/AudioCriticalSection.h 2013-05-02 23:28:58 UTC (rev 2005) +++ trunk/OpenMPT/common/AudioCriticalSection.h 2013-05-03 14:49:28 UTC (rev 2006) @@ -56,15 +56,21 @@ { Leave(); }; - static void AssertUnlocked() + static bool IsLocked() // DEBUGGING only { - // asserts that the critical section is currently not hold by THIS thread + bool islocked = false; if(TryEnterCriticalSection(&g_csAudio)) { - ALWAYS_ASSERT(g_csAudioLockCount==0); + islocked = (g_csAudioLockCount > 0); LeaveCriticalSection(&g_csAudio); } + return islocked; } + static void AssertUnlocked() + { + // asserts that the critical section is currently not hold by THIS thread + ALWAYS_ASSERT(!IsLocked()); + } }; #else // !MODPLUG_TRACKER Modified: trunk/OpenMPT/common/typedefs.cpp =================================================================== --- trunk/OpenMPT/common/typedefs.cpp 2013-05-02 23:28:58 UTC (rev 2005) +++ trunk/OpenMPT/common/typedefs.cpp 2013-05-03 14:49:28 UTC (rev 2006) @@ -14,16 +14,29 @@ #ifndef MODPLUG_TRACKER -void AlwaysAssertHandler(const char *file, int line, const char *function, const char *expr) -//------------------------------------------------------------------------------------------ +void AlwaysAssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg) +//----------------------------------------------------------------------------------------------------------- { - std::cerr - << "openmpt: ASSERTION FAILED: " - << file << "(" << line << ")" << ": " - << std::string(expr) - << " [" << function << "]" - << std::endl - ; + if(msg) + { + std::cerr + << "openmpt: ASSERTION FAILED: " + << file << "(" << line << ")" << ": " + << msg + << " (" << std::string(expr) << ") " + << " [" << function << "]" + << std::endl + ; + } else + { + std::cerr + << "openmpt: ASSERTION FAILED: " + << file << "(" << line << ")" << ": " + << std::string(expr) + << " [" << function << "]" + << std::endl + ; + } } #endif Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2013-05-02 23:28:58 UTC (rev 2005) +++ trunk/OpenMPT/common/typedefs.h 2013-05-03 14:49:28 UTC (rev 2006) @@ -119,9 +119,11 @@ #if defined(_DEBUG) #define ALWAYS_ASSERT(expr) ASSERT(expr) +#define ALWAYS_ASSERT_WARN_MESSAGE(expr,msg) ASSERT(expr) #else -void AlwaysAssertHandler(const char *file, int line, const char *function, const char *expr); +void AlwaysAssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg=nullptr); #define ALWAYS_ASSERT(expr) do { if(!(expr)) { AlwaysAssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } } while(0) +#define ALWAYS_ASSERT_WARN_MESSAGE(expr,msg) do { if(!(expr)) { AlwaysAssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } } while(0) #endif // Compile time assert. Modified: trunk/OpenMPT/mptrack/ExceptionHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2013-05-02 23:28:58 UTC (rev 2005) +++ trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2013-05-03 14:49:28 UTC (rev 2006) @@ -25,9 +25,15 @@ ); -static void GenerateDump(CString &errorMessage, _EXCEPTION_POINTERS *pExceptionInfo=NULL) -//--------------------------------------------------------------------------------------- +enum DumpMode { + DumpModeCrash = 0, + DumpModeWarning = 1, +}; + +static void GenerateDump(CString &errorMessage, _EXCEPTION_POINTERS *pExceptionInfo=NULL, DumpMode mode=DumpModeCrash) +//-------------------------------------------------------------------------------------------------------------------- +{ CMainFrame* pMainFrame = CMainFrame::GetMainFrame(); const CString timestampDir = (CTime::GetCurrentTime()).Format("%Y-%m-%d %H.%M.%S\\"); @@ -114,7 +120,13 @@ MptVersion::GetVersionUrlString().c_str() ); - Reporting::Error(errorMessage, "OpenMPT Crash", pMainFrame); + if(mode == DumpModeWarning) + { + Reporting::Error(errorMessage, "OpenMPT Warning", pMainFrame); + } else + { + Reporting::Error(errorMessage, "OpenMPT Crash", pMainFrame); + } } @@ -151,8 +163,9 @@ #ifndef _DEBUG -void AlwaysAssertHandler(const char *file, int line, const char *function, const char *expr) -//------------------------------------------------------------------------------------------ + +void AlwaysAssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg) +//----------------------------------------------------------------------------------------------------------- { if(IsDebuggerPresent()) { @@ -162,10 +175,19 @@ DebugBreak(); } else { - CString errorMessage; - errorMessage.Format("Internal error occured at %s(%d): ASSERT(%s) failed in [%s].", file, line, expr, function); - GenerateDump(errorMessage); + if(msg) + { + CString errorMessage; + errorMessage.Format("Internal state inconsistency detected at %s(%d). This is just a warning that could potentially lead to a crash later on: %s [%s].", file, line, msg, function); + GenerateDump(errorMessage, NULL, DumpModeWarning); + } else + { + CString errorMessage; + errorMessage.Format("Internal error occured at %s(%d): ASSERT(%s) failed in [%s].", file, line, expr, function); + GenerateDump(errorMessage); + } } } + #endif Modified: trunk/OpenMPT/sounddev/SoundDevice.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.cpp 2013-05-02 23:28:58 UTC (rev 2005) +++ trunk/OpenMPT/sounddev/SoundDevice.cpp 2013-05-03 14:49:28 UTC (rev 2006) @@ -19,7 +19,10 @@ #endif #include "../common/StringFixer.h" +// DEBUG: +#include "../common/AudioCriticalSection.h" + /////////////////////////////////////////////////////////////////////////////////////// // // ISoundDevice base class @@ -1165,16 +1168,39 @@ } -void CASIODevice::WaitForRenderSilenceUpdated(bool on) -//---------------------------------------------------- +void CASIODevice::SetRenderSilence(bool silence, bool wait) +//--------------------------------------------------------- { + InterlockedExchange(&m_RenderSilence, silence?1:0); + if(!wait) + { + return; + } DWORD pollingstart = GetTickCount(); - while(InterlockedExchangeAdd(&m_RenderingSilence, 0) != (on?1:0)) + while(InterlockedExchangeAdd(&m_RenderingSilence, 0) != (silence?1:0)) { Sleep(1); - if(GetTickCount() - pollingstart > 250) + if(GetTickCount() - pollingstart > 1000) { - ALWAYS_ASSERT(false && "waiting for asio failed"); + if(silence) + { + if(CriticalSection::IsLocked()) + { + ALWAYS_ASSERT_WARN_MESSAGE(false, "AudioCriticalSection locked while stopping ASIO"); + } else + { + ALWAYS_ASSERT_WARN_MESSAGE(false, "waiting for asio failed in Stop()"); + } + } else + { + if(CriticalSection::IsLocked()) + { + ALWAYS_ASSERT_WARN_MESSAGE(false, "AudioCriticalSection locked while starting ASIO"); + } else + { + ALWAYS_ASSERT_WARN_MESSAGE(false, "waiting for asio failed in Start()"); + } + } break; } } @@ -1184,12 +1210,14 @@ void CASIODevice::InternalStart() //------------------------------- { + ALWAYS_ASSERT_WARN_MESSAGE(!CriticalSection::IsLocked(), "AudioCriticalSection locked while starting ASIO"); + ALWAYS_ASSERT(g_asio_startcount==0); g_asio_startcount++; - InterlockedExchange(&m_RenderSilence, 0); if(!m_bMixRunning) { + SetRenderSilence(false); m_bMixRunning = TRUE; try { @@ -1197,10 +1225,11 @@ } catch(...) { CASIODevice::ReportASIOException("ASIO crash in start()\n"); + m_bMixRunning = FALSE; } } else { - WaitForRenderSilenceUpdated(false); + SetRenderSilence(false, true); } } @@ -1208,8 +1237,10 @@ void CASIODevice::InternalStop() //------------------------------ { - InterlockedExchange(&m_RenderSilence, 1); - WaitForRenderSilenceUpdated(true); + ALWAYS_ASSERT(g_asio_startcount==1); + ALWAYS_ASSERT_WARN_MESSAGE(!CriticalSection::IsLocked(), "AudioCriticalSection locked while stopping ASIO"); + + SetRenderSilence(true, true); g_asio_startcount--; ALWAYS_ASSERT(g_asio_startcount==0); } @@ -1223,6 +1254,7 @@ if (m_bMixRunning) { m_bMixRunning = FALSE; + ALWAYS_ASSERT(g_asio_startcount==1 || g_asio_startcount==0); try { m_pAsioDrv->stop(); @@ -1231,6 +1263,7 @@ CASIODevice::ReportASIOException("ASIO crash in stop()\n"); } } + SetRenderSilence(false); try { m_pAsioDrv->disposeBuffers(); @@ -1254,6 +1287,7 @@ if(m_bMixRunning) { m_bMixRunning = FALSE; + ALWAYS_ASSERT(g_asio_startcount==1 || g_asio_startcount==0); try { m_pAsioDrv->stop(); @@ -1262,7 +1296,7 @@ CASIODevice::ReportASIOException("ASIO crash in stop()\n"); } g_asio_startcount = 0; - InterlockedExchange(&m_RenderSilence, 0); + SetRenderSilence(false); } } @@ -1435,7 +1469,13 @@ //---------------------------------------------------------------------------- { UNREFERENCED_PARAMETER(directProcess); - if(gpCurrentAsio) gpCurrentAsio->BufferSwitch(doubleBufferIndex); + if(gpCurrentAsio) + { + gpCurrentAsio->BufferSwitch(doubleBufferIndex); + } else + { + ALWAYS_ASSERT(false && "gpCurrentAsio"); + } } Modified: trunk/OpenMPT/sounddev/SoundDevices.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevices.h 2013-05-02 23:28:58 UTC (rev 2005) +++ trunk/OpenMPT/sounddev/SoundDevices.h 2013-05-03 14:49:28 UTC (rev 2006) @@ -197,7 +197,7 @@ int m_FrameBuffer[ASIO_BLOCK_LEN]; private: - void WaitForRenderSilenceUpdated(bool on); + void SetRenderSilence(bool silence, bool wait=false); public: static int baseChannel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-05-05 21:41:40
|
Revision: 2008 http://sourceforge.net/p/modplug/code/2008 Author: saga-games Date: 2013-05-05 21:41:31 +0000 (Sun, 05 May 2013) Log Message: ----------- [Imp] Improve IT, S3M, XM tracker detection. Modified Paths: -------------- trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/common/mptString.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2013-05-05 00:25:59 UTC (rev 2007) +++ trunk/OpenMPT/common/mptString.cpp 2013-05-05 21:41:31 UTC (rev 2008) @@ -46,4 +46,30 @@ #endif } + +// Remove whitespaces at start of string +void String::LTrim() +{ + size_type pos = find_first_not_of(" \n\r\t"); + if(pos != npos) + erase(begin(), begin() + pos); +} + + +// Remove whitespaces at end of string +void String::RTrim() +{ + size_type pos = find_last_not_of(" \n\r\t"); + if(pos != npos) + erase(begin() + pos + 1, end()); +} + + +// Remove whitespaces at start and end of string +void String::Trim() +{ + LTrim(); + RTrim(); +} + } // namespace mpt Modified: trunk/OpenMPT/common/mptString.h =================================================================== --- trunk/OpenMPT/common/mptString.h 2013-05-05 00:25:59 UTC (rev 2007) +++ trunk/OpenMPT/common/mptString.h 2013-05-05 21:41:31 UTC (rev 2008) @@ -65,6 +65,13 @@ // Formats this string, like CString::Format. void Format(const CharT* pszFormat, ...); + + // Remove whitespaces at start of string + void LTrim(); + // Remove whitespaces at end of string + void RTrim(); + // Remove whitespaces at start and end of string + void Trim(); }; } Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-05-05 00:25:59 UTC (rev 2007) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-05-05 21:41:31 UTC (rev 2008) @@ -278,6 +278,31 @@ } +// Get version of Schism Tracker that was used to create an IT/S3M file. +mpt::String CSoundFile::GetSchismTrackerVersion(uint16 cwtv) +//---------------------------------------------------------- +{ + cwtv &= 0xFFF; + mpt::String version; + if(cwtv > 0x050) + { + tm epoch, *verTime; + MemsetZero(epoch); + epoch.tm_year = 109, epoch.tm_mon = 9; epoch.tm_mday = 31; + time_t versionSec = ((cwtv - 0x050) * 86400) + mktime(&epoch); + if((verTime = localtime(&versionSec)) != nullptr) + { + version.Format("Schism Tracker %04d-%02d-%02d", + verTime->tm_year + 1900, verTime->tm_mon + 1, verTime->tm_mday); + } + } else + { + version.Format("Schism Tracker 0.%x", cwtv & 0xFF); + } + return version; +} + + bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) //------------------------------------------------------------------ { @@ -960,25 +985,7 @@ } break; case 1: - madeWithTracker = "Schism Tracker "; - if(fileHeader.cwtv > 0x1050) - { - mpt::String version; - tm epoch; - MemsetZero(epoch); - epoch.tm_year = 109, epoch.tm_mon = 9; epoch.tm_mday = 31; - //int32 versionSec = ((fileHeader.cwtv - 0x050) * 86400) + mktime(&epoch); - // TODO what's the difference between localtime and localtime_r? -// if(localtime_r(&versionSec, &epoch)) { -// sprintf(buf, "%04d-%02d-%02d", -// version.tm_year + 1900, version.tm_mon + 1, version.tm_mday); -// return; - } else - { - mpt::String version; - version.Format("0.%x", fileHeader.cwtv & 0xFF); - madeWithTracker += version; - } + madeWithTracker = GetSchismTrackerVersion(fileHeader.cwtv); break; case 6: madeWithTracker.Format("BeRoTracker %x.%x"); Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2013-05-05 00:25:59 UTC (rev 2007) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2013-05-05 21:41:31 UTC (rev 2008) @@ -481,7 +481,7 @@ if(fileHeader.cwtv == S3MFileHeader::trkBeRoTrackerOld) trackerName = "BeRoTracker"; else - trackerName = "Schism Tracker"; // TODO Version Number + trackerName = GetSchismTrackerVersion(fileHeader.cwtv); break; case S3MFileHeader::trkOpenMPT: trackerName = "OpenMPT %d.%02x"; Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2013-05-05 00:25:59 UTC (rev 2007) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2013-05-05 21:41:31 UTC (rev 2008) @@ -282,17 +282,14 @@ { if(fileHeader.version < 0x0104) madeWith = verFT2Generic | verConfirmed; + else if(memchr(fileHeader.songName, '\0', 20) != nullptr) + // FT2 pads the song title with spaces, some other trackers use null chars + madeWith = verFT2Clone | verNewModPlug; else madeWith = verFT2Generic | verNewModPlug; - - // FT2 pads the song title with spaces, some other trackers don't - if(madeWith[verFT2Generic] && memchr(fileHeader.songName, '\0', 20) != nullptr) - madeWith = verFT2Generic | verNewModPlug; } else if(!memcmp(fileHeader.trackerName + 12, "v 2.00 ", 8)) { - // Old MPT: - // - 1.00a5 (ihdr=245) - // - beta 3.3 (ihdr=263) + // MPT 1.0 (exact version to be determined later) madeWith = verOldModPlug; } else { @@ -303,8 +300,9 @@ } else { // Something else! - madeWith.set(verConfirmed); + madeWith = verUnknown |verConfirmed; madeWithTracker.AppendChars(fileHeader.trackerName); + madeWithTracker.RTrim(); } StringFixer::ReadString<StringFixer::spacePadded>(m_szNames[0], fileHeader.songName); @@ -362,21 +360,31 @@ { // ModPlug Tracker Alpha m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 00, 00, A5); - madeWithTracker = "ModPlug Tracker 1.0a5"; + madeWithTracker = "ModPlug Tracker 1.0 alpha"; } else if(instrHeader.size == 263) { // ModPlug Tracker Beta (Beta 1 still behaves like Alpha, but Beta 3.3 does it this way) m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 00, 00, B3); - madeWithTracker = "ModPlug Tracker 1.0b3"; + madeWithTracker = "ModPlug Tracker 1.0 beta"; } else { // WTF? madeWith = (verUnknown | verConfirmed); } - } else if(madeWith[verNewModPlug] && instrHeader.numSamples == 0) + } else if(instrHeader.numSamples == 0) { // Empty instruments make tracker identification pretty easy! - madeWith = ((instrHeader.size == 263 && instrHeader.sampleHeaderSize == 0) ? verNewModPlug : verUnknown) | verConfirmed; + if(instrHeader.size == 263 && instrHeader.sampleHeaderSize == 0 && madeWith[verNewModPlug]) + madeWith.set(verConfirmed); + else if(instrHeader.size != 29 && madeWith[verDigiTracker]) + madeWith.reset(verDigiTracker); + else if(madeWith[verFT2Clone |verFT2Generic] && instrHeader.size != 33) + { + // Sure isn't FT2. + // Note: FT2 NORMALLY writes shdr=40 for all samples, but sometimes it + // just happens to write random garbage there instead. Surprise! + madeWith = verUnknown; + } } if(AllocateInstrument(instr) == nullptr) @@ -403,7 +411,7 @@ if((instrHeader.instrument.midiEnabled | instrHeader.instrument.midiChannel | instrHeader.instrument.midiProgram | instrHeader.instrument.muteComputer) != 0) { // Definitely not an old MPT. - madeWith = verUnknown; + madeWith.reset(verOldModPlug | verNewModPlug); } // Read sample headers Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-05-05 00:25:59 UTC (rev 2007) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-05-05 21:41:31 UTC (rev 2008) @@ -409,8 +409,8 @@ enum ModLoadingFlags { onlyVerifyHeader = 0x00, - loadPatternData = 0x01, // Advise loaders to not process any pattern data (if possible) - loadSampleData = 0x02, // Advise loaders to not process any sample data (if possible) + loadPatternData = 0x01, // If unset, advise loaders to not process any pattern data (if possible) + loadSampleData = 0x02, // If unset, advise loaders to not process any sample data (if possible) // Shortcuts loadCompleteModule = loadSampleData | loadPatternData, loadNoPatternData = loadSampleData, @@ -547,6 +547,8 @@ void LoadExtendedSongProperties(const MODTYPE modtype, FileReader &file, bool* pInterpretMptMade = nullptr); static size_t LoadModularInstrumentData(FileReader &file, ModInstrument &ins); + mpt::String GetSchismTrackerVersion(uint16 cwtv); + // Reads extended instrument properties(XM/IT/MPTM). // If no errors occur and song extension tag is found, returns pointer to the beginning // of the tag, else returns NULL. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-05-11 14:51:23
|
Revision: 2014 http://sourceforge.net/p/modplug/code/2014 Author: manxorist Date: 2013-05-11 14:51:10 +0000 (Sat, 11 May 2013) Log Message: ----------- [New] Add a (soon) portable libopenmpt player library with a stable C and C++ API and ABI. This has (of course) no VST support. Archive support is also disabled as this is probably handled better by the library user. [New] Add a simple C and a simple C++ example player which demonstrates basic usage of libopenmpt. [New] Add libmodplug emulation layer via libopenmpt. [New] Add a skeleton libopenmpt_interactive interface with a probably less stable API and ABI as libopenmpt which can be extended with all kinds of functionality that is not just module playback. [New] Add in_openmpt, a winamp2 compatible input plugin. [New] Add xmp-openmpt, a xmplay compatible file format plugin. [New] Add libopenmpt_settings, a settings window for player plugins (requires installed .net 4.0 framework). It can be disbaled by the user by just deleting the DLL. The winamp and xmplay plugin will continue to work without a settings window then. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/include/readme.txt Added Paths: ----------- trunk/OpenMPT/include/libmodplug/ trunk/OpenMPT/include/winamp/ trunk/OpenMPT/include/xmplay/ trunk/OpenMPT/libopenmpt/ trunk/OpenMPT/libopenmpt/SettingsForm.cpp trunk/OpenMPT/libopenmpt/SettingsForm.h trunk/OpenMPT/libopenmpt/SettingsForm.resx trunk/OpenMPT/libopenmpt/bin/ trunk/OpenMPT/libopenmpt/examples/ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp trunk/OpenMPT/libopenmpt/libopenmpt.cpp trunk/OpenMPT/libopenmpt/libopenmpt.h trunk/OpenMPT/libopenmpt/libopenmpt.hpp trunk/OpenMPT/libopenmpt/libopenmpt.sln trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj.filters trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp trunk/OpenMPT/libopenmpt/libopenmpt_config.h trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp trunk/OpenMPT/libopenmpt/libopenmpt_interactive.cpp trunk/OpenMPT/libopenmpt/libopenmpt_interactive.hpp trunk/OpenMPT/libopenmpt/libopenmpt_internal.h trunk/OpenMPT/libopenmpt/libopenmpt_modplug.c trunk/OpenMPT/libopenmpt/libopenmpt_settings.cpp trunk/OpenMPT/libopenmpt/libopenmpt_settings.h trunk/OpenMPT/libopenmpt/libopenmpt_settings.vcxproj trunk/OpenMPT/libopenmpt/libopenmpt_settings.vcxproj.filters trunk/OpenMPT/libopenmpt/libopenmpt_settings_dialog.cpp trunk/OpenMPT/libopenmpt/libopenmpt_settings_dialog.h trunk/OpenMPT/libopenmpt/libopenmpt_stream_callbacks.h trunk/OpenMPT/libopenmpt/libopenmpt_version.cpp trunk/OpenMPT/libopenmpt/libopenmpt_version.h trunk/OpenMPT/libopenmpt/libopenmpt_winamp.cpp trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp trunk/OpenMPT/libopenmpt/libopenmpt_xmplay_c.c trunk/OpenMPT/libopenmpt/xmpin.def Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/common/BuildSettings.h 2013-05-11 14:51:10 UTC (rev 2014) @@ -41,6 +41,17 @@ #endif // ENABLE_ASM + + +#if defined(MODPLUG_TRACKER) && defined(LIBOPENMPT_BUILD) + +#error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined" + +#elif defined(MODPLUG_TRACKER) + +// Disable any file saving functionality (not really useful except for the player library) +//#define MODPLUG_NO_FILESAVE + // Disable any debug logging //#define NO_LOGGING @@ -83,8 +94,54 @@ // Define to build without MP3 import support (via mpg123) //#define NO_MP3_SAMPLES +// Do not build libmodplug emulation layer (only makes sense for library) +#define NO_LIBMODPLUG +// Do not build xmplay input plugin cod (only makes snse for library) +#define NO_XMPLAY +// Do not build winamp input plugin code (only makes sense for library) +#define NO_WINAMP + +// Do not build libopenmpt C api +#define NO_LIBOPENMPT_C + +// Do not build libopenmpt C++ api +#define NO_LIBOPENMPT_CXX + +#elif defined(LIBOPENMPT_BUILD) + +#define MODPLUG_NO_FILESAVE +//#define NO_LOGGING +#define NO_ARCHIVE_SUPPORT +//#define NO_FILEREADER_STD_ISTREAM +#define NO_REVERB +#define NO_DSP +#define NO_EQ +#define NO_AGC +#define NO_ASIO +#define NO_VST +#define NO_PORTAUDIO +#if !defined(_WIN32) +#define NO_MO3 +#endif +#define NO_DSOUND +#define NO_FLAC +#define NO_MP3_SAMPLES +//#define NO_LIBMODPLUG +//#define NO_WINAMP +//#define NO_XMPLAY +//#define NO_LIBOPENMPT_C +//#define NO_LIBOPENMPT_CXX + +#else + +#error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined" + +#endif + + + #ifdef _MSC_VER #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif Index: trunk/OpenMPT/include/libmodplug =================================================================== --- trunk/OpenMPT/include/libmodplug 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/libmodplug 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/include/libmodplug ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Modified: trunk/OpenMPT/include/readme.txt =================================================================== --- trunk/OpenMPT/include/readme.txt 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/readme.txt 2013-05-11 14:51:10 UTC (rev 2014) @@ -29,4 +29,22 @@ library should be easy. Please visit https://sourceforge.net/projects/portmedia/files/portmidi/ -to download the SDK. \ No newline at end of file +to download the SDK. + +LibModplug +=========== +To build libopenmpt with a libmodplug compatible interface, copy the libmodplug +header files from xmms-modplug into libmodplug directory. +Use #define NO_LIBMODPLUG in common/BuildSettings.h to disable. + +Winamp2 SDK +=========== +To build libopenmpt as a winamp2 input plugin, copy the winamp2 SDK headers to +include/winamp/. +Use #define NO_WINAMP in common/BuildSettings.h to disable. + +xmplay input SDK +================ +To build libopenmpt with xmplay input plugin support, copy the contents of +xmpin.zip into include/xmplay/. +Use #define NO_XMPLAY in common/BuildSettings.h to disable. Index: trunk/OpenMPT/include/winamp =================================================================== --- trunk/OpenMPT/include/winamp 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/winamp 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/include/winamp ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Index: trunk/OpenMPT/include/xmplay =================================================================== --- trunk/OpenMPT/include/xmplay 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/xmplay 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/include/xmplay ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Index: trunk/OpenMPT/libopenmpt =================================================================== --- trunk/OpenMPT/libopenmpt 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/libopenmpt 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/libopenmpt ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,16 ## +Debug +DebugStatic +Release +ReleaseStatic +ipch +libopenmpt.opensdf +libopenmpt.sdf +libopenmpt.suo +libopenmpt.vcxproj.user +libopenmpt_foobar2000.sdf +libopenmpt_foobar2000.vcxproj.user +libopenmpt_settings-Debug +libopenmpt_settings-Release +libopenmpt_settings.vcxproj.user +libopenmpt_foobar2000.opensdf +libopenmpt_foobar2000.suo Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/SettingsForm.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/SettingsForm.cpp (rev 0) +++ trunk/OpenMPT/libopenmpt/SettingsForm.cpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,4 @@ + +#define LIBOPENMPT_BUILD_SETTINGS_DLL +#include "SettingsForm.h" + Property changes on: trunk/OpenMPT/libopenmpt/SettingsForm.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/SettingsForm.h =================================================================== --- trunk/OpenMPT/libopenmpt/SettingsForm.h (rev 0) +++ trunk/OpenMPT/libopenmpt/SettingsForm.h 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,430 @@ +#pragma once + +#include "libopenmpt_settings.h" + +namespace libopenmpt { + + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Data; + using namespace System::Drawing; + + /// <summary> + /// Summary for SettingsForm + /// </summary> + public ref class SettingsForm : public System::Windows::Forms::Form + { + private: + openmpt::settings * settings; + public: + SettingsForm( const char * title, openmpt::settings * s ) : settings(s) + { + InitializeComponent(); + + Text = gcnew System::String( title ); + + comboBoxSamplerate->Items->Add(6000); + comboBoxSamplerate->Items->Add(8000); + comboBoxSamplerate->Items->Add(11025); + comboBoxSamplerate->Items->Add(16000); + comboBoxSamplerate->Items->Add(22050); + comboBoxSamplerate->Items->Add(32000); + comboBoxSamplerate->Items->Add(44100); + comboBoxSamplerate->Items->Add(48000); + comboBoxSamplerate->Items->Add(88200); + comboBoxSamplerate->Items->Add(96000); + comboBoxSamplerate->SelectedItem = settings->samplerate; + + comboBoxChannels->Items->Add("mono"); + comboBoxChannels->Items->Add("stereo"); + comboBoxChannels->Items->Add("quad"); + if ( settings->channels == 1 ) comboBoxChannels->SelectedItem = "mono"; + if ( settings->channels == 2 ) comboBoxChannels->SelectedItem = "stereo"; + if ( settings->channels == 3 ) comboBoxChannels->SelectedItem = "quad"; + + comboBoxSamplerate->Enabled = settings->with_outputformat; + comboBoxChannels->Enabled = settings->with_outputformat; + + trackBarGain->Value = settings->mastergain; + + trackBarMaxPolyphony->Value = settings->maxmixchannels; + + comboBoxInterpolation->SelectedIndex = settings->interpolationmode - 1; + + comboBoxRepeat->SelectedIndex = settings->repeatcount + 1; + + trackBarStereoSeparation->Value = settings->stereoseparation; + + trackBarVolrampin->Value = settings->volrampin; + trackBarVolrampout->Value = settings->volrampout; + + // + //TODO: Add the constructor code here + // + } + + protected: + /// <summary> + /// Clean up any resources being used. + /// </summary> + ~SettingsForm() + { + if (components) + { + delete components; + } + } + private: System::Windows::Forms::ComboBox^ comboBoxSamplerate; + protected: + private: System::Windows::Forms::Label^ labelSamplerate; + private: System::Windows::Forms::Button^ buttonOK; + private: System::Windows::Forms::Label^ labelChannels; + private: System::Windows::Forms::ComboBox^ comboBoxChannels; + private: System::Windows::Forms::Label^ labelGain; + private: System::Windows::Forms::TrackBar^ trackBarGain; + private: System::Windows::Forms::Label^ labelMaxPolyphony; + private: System::Windows::Forms::TrackBar^ trackBarMaxPolyphony; + private: System::Windows::Forms::Label^ labelInterpolation; + private: System::Windows::Forms::ComboBox^ comboBoxInterpolation; + private: System::Windows::Forms::Label^ labelRepeat; + private: System::Windows::Forms::ComboBox^ comboBoxRepeat; + private: System::Windows::Forms::Label^ labelStereoSeparation; + private: System::Windows::Forms::TrackBar^ trackBarStereoSeparation; + private: System::Windows::Forms::Label^ labelVolrampin; + private: System::Windows::Forms::Label^ labelVolrampout; + private: System::Windows::Forms::TrackBar^ trackBarVolrampin; + private: System::Windows::Forms::TrackBar^ trackBarVolrampout; + + + protected: + + private: + /// <summary> + /// Required designer variable. + /// </summary> + System::ComponentModel::Container ^components; + +#pragma region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + void InitializeComponent(void) + { + this->comboBoxSamplerate = (gcnew System::Windows::Forms::ComboBox()); + this->labelSamplerate = (gcnew System::Windows::Forms::Label()); + this->buttonOK = (gcnew System::Windows::Forms::Button()); + this->labelChannels = (gcnew System::Windows::Forms::Label()); + this->comboBoxChannels = (gcnew System::Windows::Forms::ComboBox()); + this->labelGain = (gcnew System::Windows::Forms::Label()); + this->trackBarGain = (gcnew System::Windows::Forms::TrackBar()); + this->labelMaxPolyphony = (gcnew System::Windows::Forms::Label()); + this->trackBarMaxPolyphony = (gcnew System::Windows::Forms::TrackBar()); + this->labelInterpolation = (gcnew System::Windows::Forms::Label()); + this->comboBoxInterpolation = (gcnew System::Windows::Forms::ComboBox()); + this->labelRepeat = (gcnew System::Windows::Forms::Label()); + this->comboBoxRepeat = (gcnew System::Windows::Forms::ComboBox()); + this->labelStereoSeparation = (gcnew System::Windows::Forms::Label()); + this->trackBarStereoSeparation = (gcnew System::Windows::Forms::TrackBar()); + this->labelVolrampin = (gcnew System::Windows::Forms::Label()); + this->labelVolrampout = (gcnew System::Windows::Forms::Label()); + this->trackBarVolrampin = (gcnew System::Windows::Forms::TrackBar()); + this->trackBarVolrampout = (gcnew System::Windows::Forms::TrackBar()); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarGain))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarMaxPolyphony))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarStereoSeparation))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampin))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampout))->BeginInit(); + this->SuspendLayout(); + // + // comboBoxSamplerate + // + this->comboBoxSamplerate->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxSamplerate->FormattingEnabled = true; + this->comboBoxSamplerate->Location = System::Drawing::Point(106, 9); + this->comboBoxSamplerate->Name = L"comboBoxSamplerate"; + this->comboBoxSamplerate->Size = System::Drawing::Size(121, 21); + this->comboBoxSamplerate->TabIndex = 1; + this->comboBoxSamplerate->SelectedIndexChanged += gcnew System::EventHandler(this, &SettingsForm::comboBoxSamplerate_SelectedIndexChanged); + // + // labelSamplerate + // + this->labelSamplerate->AutoSize = true; + this->labelSamplerate->Location = System::Drawing::Point(12, 12); + this->labelSamplerate->Name = L"labelSamplerate"; + this->labelSamplerate->Size = System::Drawing::Size(58, 13); + this->labelSamplerate->TabIndex = 0; + this->labelSamplerate->Text = L"samplerate"; + // + // buttonOK + // + this->buttonOK->Location = System::Drawing::Point(15, 357); + this->buttonOK->Name = L"buttonOK"; + this->buttonOK->Size = System::Drawing::Size(212, 23); + this->buttonOK->TabIndex = 2; + this->buttonOK->Text = L"OK"; + this->buttonOK->UseVisualStyleBackColor = true; + this->buttonOK->Click += gcnew System::EventHandler(this, &SettingsForm::buttonOK_Click); + // + // labelChannels + // + this->labelChannels->AutoSize = true; + this->labelChannels->Location = System::Drawing::Point(12, 39); + this->labelChannels->Name = L"labelChannels"; + this->labelChannels->Size = System::Drawing::Size(50, 13); + this->labelChannels->TabIndex = 3; + this->labelChannels->Text = L"channels"; + // + // comboBoxChannels + // + this->comboBoxChannels->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxChannels->FormattingEnabled = true; + this->comboBoxChannels->Location = System::Drawing::Point(106, 36); + this->comboBoxChannels->Name = L"comboBoxChannels"; + this->comboBoxChannels->Size = System::Drawing::Size(121, 21); + this->comboBoxChannels->TabIndex = 4; + // + // labelGain + // + this->labelGain->AutoSize = true; + this->labelGain->Location = System::Drawing::Point(12, 74); + this->labelGain->Name = L"labelGain"; + this->labelGain->Size = System::Drawing::Size(27, 13); + this->labelGain->TabIndex = 5; + this->labelGain->Text = L"gain"; + // + // trackBarGain + // + this->trackBarGain->LargeChange = 3; + this->trackBarGain->Location = System::Drawing::Point(106, 63); + this->trackBarGain->Maximum = 12; + this->trackBarGain->Minimum = -12; + this->trackBarGain->Name = L"trackBarGain"; + this->trackBarGain->Size = System::Drawing::Size(121, 42); + this->trackBarGain->TabIndex = 6; + this->trackBarGain->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarGain->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarGain_Scroll); + // + // labelMaxPolyphony + // + this->labelMaxPolyphony->AutoSize = true; + this->labelMaxPolyphony->Location = System::Drawing::Point(12, 124); + this->labelMaxPolyphony->Name = L"labelMaxPolyphony"; + this->labelMaxPolyphony->Size = System::Drawing::Size(77, 13); + this->labelMaxPolyphony->TabIndex = 7; + this->labelMaxPolyphony->Text = L"max polyphony"; + // + // trackBarMaxPolyphony + // + this->trackBarMaxPolyphony->LargeChange = 16; + this->trackBarMaxPolyphony->Location = System::Drawing::Point(106, 111); + this->trackBarMaxPolyphony->Maximum = 256; + this->trackBarMaxPolyphony->Minimum = 16; + this->trackBarMaxPolyphony->Name = L"trackBarMaxPolyphony"; + this->trackBarMaxPolyphony->Size = System::Drawing::Size(121, 42); + this->trackBarMaxPolyphony->TabIndex = 8; + this->trackBarMaxPolyphony->TickFrequency = 16; + this->trackBarMaxPolyphony->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarMaxPolyphony->Value = 256; + this->trackBarMaxPolyphony->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarMaxPolyphony_Scroll); + // + // labelInterpolation + // + this->labelInterpolation->AutoSize = true; + this->labelInterpolation->Location = System::Drawing::Point(12, 162); + this->labelInterpolation->Name = L"labelInterpolation"; + this->labelInterpolation->Size = System::Drawing::Size(64, 13); + this->labelInterpolation->TabIndex = 9; + this->labelInterpolation->Text = L"interpolation"; + // + // comboBoxInterpolation + // + this->comboBoxInterpolation->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxInterpolation->FormattingEnabled = true; + this->comboBoxInterpolation->Items->AddRange(gcnew cli::array< System::Object^ >(12) {L"nearest", L"linear", L"spline", L"polyphase", + L"fir hann", L"fir hamming", L"fir blackman exact", L"fir blackman 3 tap 1", L"fir blackman 3 tap 2", L"fir blackman 4 tap 1", + L"fir blackman 4 tap 2", L"fir kaiser 4 tap"}); + this->comboBoxInterpolation->Location = System::Drawing::Point(106, 159); + this->comboBoxInterpolation->Name = L"comboBoxInterpolation"; + this->comboBoxInterpolation->Size = System::Drawing::Size(121, 21); + this->comboBoxInterpolation->TabIndex = 10; + this->comboBoxInterpolation->SelectedIndexChanged += gcnew System::EventHandler(this, &SettingsForm::comboBoxInterpolation_SelectedIndexChanged); + // + // labelRepeat + // + this->labelRepeat->AutoSize = true; + this->labelRepeat->Location = System::Drawing::Point(12, 189); + this->labelRepeat->Name = L"labelRepeat"; + this->labelRepeat->Size = System::Drawing::Size(37, 13); + this->labelRepeat->TabIndex = 11; + this->labelRepeat->Text = L"repeat"; + // + // comboBoxRepeat + // + this->comboBoxRepeat->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxRepeat->FormattingEnabled = true; + this->comboBoxRepeat->Items->AddRange(gcnew cli::array< System::Object^ >(3) {L"forever", L"never", L"once"}); + this->comboBoxRepeat->Location = System::Drawing::Point(106, 186); + this->comboBoxRepeat->Name = L"comboBoxRepeat"; + this->comboBoxRepeat->Size = System::Drawing::Size(121, 21); + this->comboBoxRepeat->TabIndex = 12; + this->comboBoxRepeat->SelectedIndexChanged += gcnew System::EventHandler(this, &SettingsForm::comboBoxRepeat_SelectedIndexChanged); + // + // labelStereoSeparation + // + this->labelStereoSeparation->AutoSize = true; + this->labelStereoSeparation->Location = System::Drawing::Point(12, 226); + this->labelStereoSeparation->Name = L"labelStereoSeparation"; + this->labelStereoSeparation->Size = System::Drawing::Size(88, 13); + this->labelStereoSeparation->TabIndex = 13; + this->labelStereoSeparation->Text = L"stereo separation"; + // + // trackBarStereoSeparation + // + this->trackBarStereoSeparation->LargeChange = 100; + this->trackBarStereoSeparation->Location = System::Drawing::Point(106, 213); + this->trackBarStereoSeparation->Maximum = 400; + this->trackBarStereoSeparation->Name = L"trackBarStereoSeparation"; + this->trackBarStereoSeparation->Size = System::Drawing::Size(121, 42); + this->trackBarStereoSeparation->SmallChange = 25; + this->trackBarStereoSeparation->TabIndex = 14; + this->trackBarStereoSeparation->TickFrequency = 100; + this->trackBarStereoSeparation->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarStereoSeparation->Value = 100; + this->trackBarStereoSeparation->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarStereoSeparation_Scroll); + // + // labelVolrampin + // + this->labelVolrampin->AutoSize = true; + this->labelVolrampin->Location = System::Drawing::Point(12, 274); + this->labelVolrampin->Name = L"labelVolrampin"; + this->labelVolrampin->Size = System::Drawing::Size(78, 13); + this->labelVolrampin->TabIndex = 15; + this->labelVolrampin->Text = L"volume ramp in"; + // + // labelVolrampout + // + this->labelVolrampout->AutoSize = true; + this->labelVolrampout->Location = System::Drawing::Point(12, 321); + this->labelVolrampout->Name = L"labelVolrampout"; + this->labelVolrampout->Size = System::Drawing::Size(85, 13); + this->labelVolrampout->TabIndex = 16; + this->labelVolrampout->Text = L"volume ramp out"; + // + // trackBarVolrampin + // + this->trackBarVolrampin->LargeChange = 16; + this->trackBarVolrampin->Location = System::Drawing::Point(106, 261); + this->trackBarVolrampin->Maximum = 256; + this->trackBarVolrampin->Name = L"trackBarVolrampin"; + this->trackBarVolrampin->Size = System::Drawing::Size(121, 42); + this->trackBarVolrampin->TabIndex = 17; + this->trackBarVolrampin->TickFrequency = 16; + this->trackBarVolrampin->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarVolrampin->Value = 16; + this->trackBarVolrampin->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarVolrampin_Scroll); + // + // trackBarVolrampout + // + this->trackBarVolrampout->LargeChange = 16; + this->trackBarVolrampout->Location = System::Drawing::Point(106, 309); + this->trackBarVolrampout->Maximum = 256; + this->trackBarVolrampout->Name = L"trackBarVolrampout"; + this->trackBarVolrampout->Size = System::Drawing::Size(121, 42); + this->trackBarVolrampout->TabIndex = 18; + this->trackBarVolrampout->TickFrequency = 16; + this->trackBarVolrampout->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarVolrampout->Value = 42; + this->trackBarVolrampout->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarVolrampout_Scroll); + // + // SettingsForm + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->AutoSize = true; + this->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink; + this->ClientSize = System::Drawing::Size(436, 477); + this->Controls->Add(this->trackBarVolrampout); + this->Controls->Add(this->trackBarVolrampin); + this->Controls->Add(this->labelVolrampout); + this->Controls->Add(this->labelVolrampin); + this->Controls->Add(this->trackBarStereoSeparation); + this->Controls->Add(this->labelStereoSeparation); + this->Controls->Add(this->comboBoxRepeat); + this->Controls->Add(this->labelRepeat); + this->Controls->Add(this->comboBoxInterpolation); + this->Controls->Add(this->labelInterpolation); + this->Controls->Add(this->trackBarMaxPolyphony); + this->Controls->Add(this->labelMaxPolyphony); + this->Controls->Add(this->trackBarGain); + this->Controls->Add(this->labelGain); + this->Controls->Add(this->comboBoxChannels); + this->Controls->Add(this->labelChannels); + this->Controls->Add(this->buttonOK); + this->Controls->Add(this->labelSamplerate); + this->Controls->Add(this->comboBoxSamplerate); + this->MaximizeBox = false; + this->MinimizeBox = false; + this->Name = L"SettingsForm"; + this->ShowIcon = false; + this->ShowInTaskbar = false; + this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide; + this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent; + this->Text = L"SettingsForm"; + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarGain))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarMaxPolyphony))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarStereoSeparation))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampin))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampout))->EndInit(); + this->ResumeLayout(false); + this->PerformLayout(); + + } +#pragma endregion + private: System::Void comboBoxSamplerate_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + settings->samplerate = (int)comboBoxSamplerate->SelectedItem; + settings->changed(); + } + private: System::Void buttonOK_Click(System::Object^ sender, System::EventArgs^ e) { + this->Close(); + settings->changed(); + } +private: System::Void comboBoxChannels_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + System::String ^ val = (System::String ^)comboBoxChannels->SelectedItem; + if ( val == "mono" ) settings->channels = 1; + if ( val == "stereo" ) settings->channels = 2; + if ( val == "quad" ) settings->channels = 4; + settings->changed(); + } +private: System::Void trackBarGain_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->mastergain = (int)trackBarGain->Value; + settings->changed(); + } +private: System::Void comboBoxInterpolation_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + settings->interpolationmode = (int)comboBoxInterpolation->SelectedIndex + 1; + settings->changed(); + } +private: System::Void trackBarMaxPolyphony_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->maxmixchannels = (int)trackBarMaxPolyphony->Value; + settings->changed(); + } +private: System::Void comboBoxRepeat_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + settings->repeatcount = (int)comboBoxRepeat->SelectedIndex - 1; + settings->changed(); + } +private: System::Void trackBarStereoSeparation_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->stereoseparation = (int)trackBarStereoSeparation->Value; + settings->changed(); + } +private: System::Void trackBarVolrampin_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->volrampin = (int)trackBarVolrampin->Value; + settings->changed(); + } +private: System::Void trackBarVolrampout_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->volrampout = (int)trackBarVolrampout->Value; + settings->changed(); + } +}; +} Property changes on: trunk/OpenMPT/libopenmpt/SettingsForm.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/SettingsForm.resx =================================================================== --- trunk/OpenMPT/libopenmpt/SettingsForm.resx (rev 0) +++ trunk/OpenMPT/libopenmpt/SettingsForm.resx 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Index: trunk/OpenMPT/libopenmpt/bin =================================================================== --- trunk/OpenMPT/libopenmpt/bin 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/libopenmpt/bin 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/libopenmpt/bin ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Index: trunk/OpenMPT/libopenmpt/examples =================================================================== --- trunk/OpenMPT/libopenmpt/examples 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/libopenmpt/examples 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/libopenmpt/examples ___________________________________________________________________ Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c (rev 0) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,56 @@ +/* + * libopenmpt_example_c.c + * ---------------------- + * Purpose: libopenmpt C API simple example + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include <memory.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <libopenmpt/libopenmpt.h> +#include <libopenmpt/libopenmpt_stream_callbacks.h> + +#include <portaudio.h> + +#define BUFFERSIZE 1024 +#define SAMPLERATE 48000 + +static int16_t left[BUFFERSIZE]; +static int16_t right[BUFFERSIZE]; +static int16_t* const buffers[2] = {left,right}; + +int main(int argc,char* argv[]){ + FILE* file = 0; + openmpt_module* mod = 0; + size_t count = 0; + PaStream* stream = 0; + PaStreamParameters streamparameters; + memset(&streamparameters,0,sizeof(PaStreamParameters)); + file = fopen(argv[1],"rb"); + mod = openmpt_module_create(openmpt_stream_get_file_callbacks(),file,NULL,NULL); + fclose(file); + Pa_Initialize(); + streamparameters.device = Pa_GetDefaultOutputDevice(); + streamparameters.channelCount = 2; + streamparameters.sampleFormat = paInt16|paNonInterleaved; + streamparameters.suggestedLatency = 250*0.001; + Pa_OpenStream(&stream,NULL,&streamparameters,SAMPLERATE,paFramesPerBufferUnspecified,0,NULL,NULL); + Pa_StartStream(stream); + while(1){ + count = openmpt_module_read_stereo(mod,SAMPLERATE,BUFFERSIZE,left,right); + if(count==0){ + break; + } + Pa_WriteStream(stream,buffers,count); + } + Pa_StopStream(stream); + Pa_CloseStream(stream); + Pa_Terminate(); + return 0; +} Property changes on: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-csrc \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c (rev 0) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,63 @@ +/* + * libopenmpt_example_c_mem.c + * -------------------------- + * Purpose: libopenmpt C API simple example + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include <memory.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <libopenmpt/libopenmpt.h> + +#include <portaudio.h> + +#define BUFFERSIZE 1024 +#define SAMPLERATE 48000 + +static int16_t left[BUFFERSIZE]; +static int16_t right[BUFFERSIZE]; +static int16_t* const buffers[2] = {left,right}; + +int main(int argc,char* argv[]){ + FILE* file = 0; + size_t size = 0; + void* data = 0; + openmpt_module* mod = 0; + size_t count = 0; + PaStream* stream = 0; + PaStreamParameters streamparameters; + memset(&streamparameters,0,sizeof(PaStreamParameters)); + file = fopen(argv[1],"rb"); + fseek(file,0,SEEK_END); + size = ftell(file); + fseek(file,0,SEEK_SET); + data = malloc(size); + fread(data,1,size,file); + fclose(file); + mod = openmpt_module_create_from_memory(data,size,NULL,NULL); + free(data); + Pa_Initialize(); + streamparameters.device = Pa_GetDefaultOutputDevice(); + streamparameters.channelCount = 2; + streamparameters.sampleFormat = paInt16|paNonInterleaved; + streamparameters.suggestedLatency = 250*0.001; + Pa_OpenStream(&stream,NULL,&streamparameters,SAMPLERATE,paFramesPerBufferUnspecified,0,NULL,NULL); + Pa_StartStream(stream); + while(1){ + count = openmpt_module_read_stereo(mod,SAMPLERATE,BUFFERSIZE,left,right); + if(count==0){ + break; + } + Pa_WriteStream(stream,buffers,count); + } + Pa_StopStream(stream); + Pa_CloseStream(stream); + Pa_Terminate(); + return 0; +} Property changes on: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-csrc \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp (rev 0) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,46 @@ +/* + * libopenmpt_example_cpp.cpp + * -------------------------- + * Purpose: libopenmpt C++ API simple example + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include <fstream> +#include <vector> + +#include <libopenmpt/libopenmpt.hpp> + +#include <portaudio.h> + +int main( int argc, char * argv [] ) { + const std::size_t buffersize = 1024; + const std::int32_t samplerate = 48000; + std::vector<float> left( buffersize ); + std::vector<float> right( buffersize ); + float * buffers [2] = { left.data(), right.data() }; + std::ifstream file( argv[1], std::ios::binary ); + openmpt::module mod( file ); + Pa_Initialize(); + PaStream * stream = 0; + PaStreamParameters streamparameters; + std::memset( &streamparameters, 0, sizeof(PaStreamParameters) ); + streamparameters.device = Pa_GetDefaultOutputDevice(); + streamparameters.channelCount = 2; + streamparameters.sampleFormat = paFloat32 | paNonInterleaved; + streamparameters.suggestedLatency = 250 * 0.001; + Pa_OpenStream( &stream, NULL, &streamparameters, samplerate, paFramesPerBufferUnspecified, 0, NULL, NULL ); + Pa_StartStream( stream ); + while ( true ) { + std::size_t count = mod.read( samplerate, buffersize, left.data(), right.data() ); + if ( count == 0 ) { + break; + } + Pa_WriteStream( stream, buffers, count ); + } + Pa_StopStream( stream ); + Pa_CloseStream( stream ); + Pa_Terminate(); + return 0; +} Property changes on: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.cpp (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt.cpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,47 @@ +/* + * libopenmpt.cpp + * -------------- + * Purpose: libopenmpt general implementation + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include "BuildSettings.h" + +#include "libopenmpt_internal.h" +#include "libopenmpt.hpp" +#include "libopenmpt.h" + +#if defined( LIBOPENMPT_BUILD_DLL ) +#if defined( _WIN32 ) + +#include <windows.h> + +#ifndef NO_XMPLAY + +void xmp_openmpt_on_dll_load(); +void xmp_openmpt_on_dll_unload(); + +#endif // NOXMPLAY + +BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { + #ifndef NO_XMPLAY + switch ( fdwReason ) { + case DLL_PROCESS_ATTACH: + #ifndef NO_XMPLAY + xmp_openmpt_on_dll_load(); + #endif // NOXMPLAY + break; + case DLL_PROCESS_DETACH: + #ifndef NO_XMPLAY + xmp_openmpt_on_dll_unload(); + #endif // NOXMPLAY + break; + } + #endif // NOXMPLAY + return TRUE; +} + +#endif +#endif Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt.h =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.h (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt.h 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,148 @@ +/* + * libopenmpt.h + * ------------ + * Purpose: libopenmpt public c interface + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#ifndef LIBOPENMPT_H +#define LIBOPENMPT_H + +#include "libopenmpt_config.h" +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +LIBOPENMPT_API int openmpt_is_compatible_version( uint32_t api_version ); + +LIBOPENMPT_API uint32_t openmpt_get_library_version(void); + +LIBOPENMPT_API uint32_t openmpt_get_core_version(void); + +#define OPENMPT_STRING_LIBRARY_VERSION "library_version" +#define OPENMPT_STRING_CORE_VERSION "core_version" +#define OPENMPT_STRING_BUILD "build" +#define OPENMPT_STRING_CREDITS "credits" +#define OPENMPT_STRING_CONTACT "contact" + +LIBOPENMPT_API void openmpt_free_string( const char * str ); + +LIBOPENMPT_API const char * openmpt_get_string( const char * key ); + +LIBOPENMPT_API const char * openmpt_get_supported_extensions(void); + +LIBOPENMPT_API int openmpt_is_extension_supported( const char * extension ); + +typedef int (*openmpt_stream_read_func)( void * stream, void * dst, int bytes ); +typedef int (*openmpt_stream_seek_func)( void * stream, int64_t offset, int whence ); +typedef int64_t (*openmpt_stream_tell_func)( void * stream ); + +typedef struct openmpt_stream_callbacks { + openmpt_stream_read_func read; + openmpt_stream_seek_func seek; + openmpt_stream_tell_func tell; +} openmpt_stream_callbacks; + +typedef void (*openmpt_log_func)( const char * message, void * user ); + +LIBOPENMPT_API void openmpt_log_func_default( const char * message, void * user ); + +LIBOPENMPT_API void openmpt_log_func_silent( const char * message, void * user ); + +LIBOPENMPT_API double openmpt_could_open_propability( openmpt_stream_callbacks stream_callbacks, void * stream, double effort, openmpt_log_func logfunc, void * user ); + +typedef struct openmpt_module openmpt_module; + +LIBOPENMPT_API openmpt_module * openmpt_module_create( openmpt_stream_callbacks stream_callbacks, void * stream, openmpt_log_func logfunc, void * user ); + +LIBOPENMPT_API openmpt_module * openmpt_module_create_from_memory( const void * filedata, size_t filesize, openmpt_log_func logfunc, void * user ); + +LIBOPENMPT_API void openmpt_module_destroy( openmpt_module * mod ); + +#define OPENMPT_MODULE_RENDER_MASTERGAIN_DB 1 +#define OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT 2 +#define OPENMPT_MODULE_RENDER_REPEATCOUNT 3 +#define OPENMPT_MODULE_RENDER_QUALITY_PERCENT 4 +#define OPENMPT_MODULE_RENDER_MAXMIXCHANNELS 5 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_MODE 6 +#define OPENMPT_MODULE_RENDER_VOLUMERAMP_IN_SAMPLES 7 +#define OPENMPT_MODULE_RENDER_VOLUMERAMP_OUT_SAMPLES 8 + +#define OPENMPT_MODULE_RENDER_INTERPOLATION_NEAREST 1 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_LINEAR 2 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_SPLINE 3 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_POLYPHASE 4 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_HANN 5 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_HAMMING 6 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMANEXACT 7 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN3T61 8 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN3T67 9 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN4T92 10 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN4T74 11 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_KAISER4T 12 + +#define OPENMPT_MODULE_COMMAND_NOTE 0 +#define OPENMPT_MODULE_COMMAND_INSTRUMENT 1 +#define OPENMPT_MODULE_COMMAND_VOLUMEEFFECT 2 +#define OPENMPT_MODULE_COMMAND_EFFECT 3 +#define OPENMPT_MODULE_COMMAND_VOLUME 4 +#define OPENMPT_MODULE_COMMAND_PARAMETER 5 + +LIBOPENMPT_API int openmpt_module_get_render_param( openmpt_module * mod, int command, int32_t * value ); +LIBOPENMPT_API int openmpt_module_set_render_param( openmpt_module * mod, int command, int32_t value ); + +LIBOPENMPT_API int openmpt_module_select_subsong( openmpt_module * mod, int32_t subsong ); + +LIBOPENMPT_API double openmpt_module_seek_seconds( openmpt_module * mod, double seconds ); + +LIBOPENMPT_API size_t openmpt_module_read_mono( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * mono ); +LIBOPENMPT_API size_t openmpt_module_read_stereo( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * left, int16_t * right ); +LIBOPENMPT_API size_t openmpt_module_read_quad( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * left, int16_t * right, int16_t * back_left, int16_t * back_right ); +LIBOPENMPT_API size_t openmpt_module_read_float_mono( openmpt_module * mod, int32_t samplerate, size_t count, float * mono ); +LIBOPENMPT_API size_t openmpt_module_read_float_stereo( openmpt_module * mod, int32_t samplerate, size_t count, float * left, float * right ); +LIBOPENMPT_API size_t openmpt_module_read_float_quad( openmpt_module * mod, int32_t samplerate, size_t count, float * left, float * right, float * back_left, float * back_right ); + +LIBOPENMPT_API double openmpt_module_get_current_position_seconds( openmpt_module * mod ); + +LIBOPENMPT_API double openmpt_module_get_duration_seconds( openmpt_module * mod ); + +LIBOPENMPT_API const char * openmpt_module_get_metadata_keys( openmpt_module * mod ); +LIBOPENMPT_API const char * openmpt_module_get_metadata( openmpt_module * mod, const char * key ); + +LIBOPENMPT_API int32_t openmpt_module_get_current_speed( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_tempo( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_order( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_pattern( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_row( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_playing_channels( openmpt_module * mod ); + +LIBOPENMPT_API int32_t openmpt_module_get_num_subsongs( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_channels( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_orders( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_patterns( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_instruments( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_samples( openmpt_module * mod ); + +LIBOPENMPT_API const char * openmpt_module_get_subsong_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_channel_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_order_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_pattern_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_instrument_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_sample_name( openmpt_module * mod, int32_t index ); + +LIBOPENMPT_API int32_t openmpt_module_get_order_pattern( openmpt_module * mod, int32_t order ); +LIBOPENMPT_API int32_t openmpt_module_get_pattern_num_rows( openmpt_module * mod, int32_t pattern ); + +LIBOPENMPT_API uint8_t openmpt_module_get_pattern_row_channel_command( openmpt_module * mod, int32_t pattern, int32_t row, int32_t channel, int command ); + +/* remember to add new functions to both C and C++ interfaces and to increase OPENMPT_API_VERSION_MINOR */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LIBOPENMPT_H */ Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt.hpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.hpp (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt.hpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,187 @@ +/* + * libopenmpt.hpp + * -------------- + * Purpose: libopenmpt public c++ interface + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#ifndef LIBOPENMPT_HPP +#define LIBOPENMPT_HPP + +#include "libopenmpt_config.h" + +#include <exception> +#include <iostream> +#include <istream> +#include <ostream> +#include <string> +#include <vector> + +#include <cstdint> + +namespace openmpt { + +class LIBOPENMPT_CXX_API exception : public std::exception { +public: + exception( const char * text ); +}; // class exception + +LIBOPENMPT_CXX_API std::uint32_t get_library_version(); + +LIBOPENMPT_CXX_API std::uint32_t get_core_version(); + +namespace detail { + +LIBOPENMPT_CXX_API void version_compatible_or_throw( std::int32_t api_version ); + +class api_version_checker { +public: + inline api_version_checker( std::int32_t api_version = OPENMPT_API_VERSION ) { + version_compatible_or_throw( api_version ); + } +}; // class api_version_checker + +} // namespace detail + +namespace string { + +static const char * const library_version = "library_version"; +static const char * const core_version = "core_version"; +static const char * const build = "build"; +static const char * const credits = "credits"; +static const char * const contact = "contact"; + +LIBOPENMPT_CXX_API std::string get( const std::string & key ); + +} // namespace string + +LIBOPENMPT_CXX_API std::vector<std::string> get_supported_extensions(); + +LIBOPENMPT_CXX_API bool is_extension_supported( const std::string & extension ); + +LIBOPENMPT_CXX_API double could_open_propability( std::istream & stream, double effort = 1.0, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + +class module_impl; + +class interactive_module; + +class LIBOPENMPT_CXX_API module { + + friend interactive_module; + +public: + + enum render_param { + RENDER_MASTERGAIN_DB = 1, + RENDER_STEREOSEPARATION_PERCENT = 2, + RENDER_REPEATCOUNT = 3, + RENDER_QUALITY_PERCENT = 4, + RENDER_MAXMIXCHANNELS = 5, + RENDER_INTERPOLATION_MODE = 6, + RENDER_VOLUMERAMP_IN_SAMPLES = 7, + RENDER_VOLUMERAMP_OUT_SAMPLES = 8, + }; + + enum interpolation_mode { + INTERPOLATION_NEAREST = 1, + INTERPOLATION_LINEAR = 2, + INTERPOLATION_SPLINE = 3, + INTERPOLATION_POLYPHASE = 4, + INTERPOLATION_FIR_HANN = 5, + INTERPOLATION_FIR_HAMMING = 6, + INTERPOLATION_FIR_BLACKMANEXACT = 7, + INTERPOLATION_FIR_BLACKMAN3T61 = 8, + INTERPOLATION_FIR_BLACKMAN3T67 = 9, + INTERPOLATION_FIR_BLACKMAN4T92 = 10, + INTERPOLATION_FIR_BLACKMAN4T74 = 11, + INTERPOLATION_FIR_KAISER4T = 12, + }; + + enum command_index { + command_note = 0, + command_instrument = 1, + command_volumeffect = 2, + command_effect = 3, + command_volume = 4, + command_parameter = 5, + }; + +private: + module_impl * impl; +private: + // non-copyable + module( const module & ); + void operator = ( const module & ); +private: + // for interactive_module + module(); + void set_impl( module_impl * i ); +public: + module( std::istream & stream, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::vector<std::uint8_t> & data, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::uint8_t * beg, const std::uint8_t * end, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::uint8_t * data, std::size_t size, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::vector<char> & data, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const char * beg, const char * end, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const char * data, std::size_t size, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const void * data, std::size_t size, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + virtual ~module(); +public: + + std::int32_t get_render_param( int command ) const; + void set_render_param( int command, std::int32_t value ); + + void select_subsong( std::int32_t subsong ); + + double seek_seconds( double seconds ); + + std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * mono ); + std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right ); + std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right, std::int16_t * back_left, std::int16_t * back_right ); + std::size_t read( std::int32_t samplerate, std::size_t count, float * mono ); + std::size_t read( std::int32_t samplerate, std::size_t count, float * left, float * right ); + std::size_t read( std::int32_t samplerate, std::size_t count, float * left, float * right, float * back_left, float * back_right ); + + double get_current_position_seconds() const; + + double get_duration_seconds() const; + + std::vector<std::string> get_metadata_keys() const; + std::string get_metadata( const std::string & key ) const; + + std::int32_t get_current_speed() const; + std::int32_t get_current_tempo() const; + std::int32_t get_current_order() const; + std::int32_t get_current_pattern() const; + std::int32_t get_current_row() const; + std::int32_t get_current_playing_channels() const; + + std::int32_t get_num_subsongs() const; + std::int32_t get_num_channels() const; + std::int32_t get_num_orders() const; + std::int32_t get_num_patterns() const; + std::int32_t get_num_instruments() const; + std::int32_t get_num_samples() const; + + std::vector<std::string> get_subsong_names() const; + std::vector<std::string> get_channel_names() const; + std::vector<std::string> get_order_names() const; + std::vector<std::string> get_pattern_names() const; + std::vector<std::string> get_instrument_names() const; + std::vector<std::string> get_sample_names() const; + + std::int32_t get_order_pattern( std::int32_t order ) const; + + std::int32_t get_pattern_num_rows( std::int32_t pattern ) const; + + std::uint8_t get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel, int command ) const; + + // remember to add new functions to both C and C++ interfaces and to increase OPENMPT_API_VERSION_MINOR + +}; // class module + +} // namespace openmpt + +#endif // LIBOPENMPT_HPP Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt.hpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++hdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline a... [truncated message content] |
From: <man...@us...> - 2013-05-11 14:53:47
|
Revision: 2015 http://sourceforge.net/p/modplug/code/2015 Author: manxorist Date: 2013-05-11 14:53:38 +0000 (Sat, 11 May 2013) Log Message: ----------- [New] Add foo_openmpt, a foobar2000 compatible input component (currently still untested). Modified Paths: -------------- trunk/OpenMPT/include/readme.txt trunk/OpenMPT/soundlib/Tables.cpp Added Paths: ----------- trunk/OpenMPT/include/foobar2000sdk/ trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.cpp trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.sln trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj.filters Index: trunk/OpenMPT/include/foobar2000sdk =================================================================== --- trunk/OpenMPT/include/foobar2000sdk 2013-05-11 14:51:10 UTC (rev 2014) +++ trunk/OpenMPT/include/foobar2000sdk 2013-05-11 14:53:38 UTC (rev 2015) Property changes on: trunk/OpenMPT/include/foobar2000sdk ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Modified: trunk/OpenMPT/include/readme.txt =================================================================== --- trunk/OpenMPT/include/readme.txt 2013-05-11 14:51:10 UTC (rev 2014) +++ trunk/OpenMPT/include/readme.txt 2013-05-11 14:53:38 UTC (rev 2015) @@ -48,3 +48,8 @@ To build libopenmpt with xmplay input plugin support, copy the contents of xmpin.zip into include/xmplay/. Use #define NO_XMPLAY in common/BuildSettings.h to disable. + +foobar2000 SDK +============== +Building the openmpt fooobar input service requires the contents of +SDK-2011-03-11.zip being placed in include/foobar2000sdk/. Added: trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.cpp (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.cpp 2013-05-11 14:53:38 UTC (rev 2015) @@ -0,0 +1,170 @@ + +#include "foobar2000/SDK/foobar2000.h" +#include "foobar2000/helpers/helpers.h" + +#define LIBOPENMPT_ALPHA_WARNING_SEEN_AND_I_KNOW_WHAT_I_AM_DOING +#include "libopenmpt.hpp" + +#include <algorithm> +#include <locale> +#include <string> +#include <vector> + + + +// Declaration of your component's version information +// Since foobar2000 v1.0 having at least one of these in your DLL is mandatory to let the troubleshooter tell different versions of your component apart. +// Note that it is possible to declare multiple components within one DLL, but it's strongly recommended to keep only one declaration per DLL. +// As for 1.1, the version numbers are used by the component update finder to find updates; for that to work, you must have ONLY ONE declaration per DLL. If there are multiple declarations, the component is assumed to be outdated and a version number of "0" is assumed, to overwrite the component with whatever is currently on the site assuming that it comes with proper version numbers. +DECLARE_COMPONENT_VERSION("OpenMPT component","0.1","libopenmpt based module file player"); + + + +// This will prevent users from renaming your component around (important for proper troubleshooter behaviors) or loading multiple instances of it. +VALIDATE_COMPONENT_FILENAME("foo_openmpt.dll"); + + + +// Sample initquit implementation. See also: initquit class documentation in relevant header. + +class myinitquit : public initquit { +public: + void on_init() { + // console::print("Sample component: on_init()"); + } + void on_quit() { + // console::print("Sample component: on_quit()"); + } +}; + +static initquit_factory_t<myinitquit> g_myinitquit_factory; + + + +// No inheritance. Our methods get called over input framework templates. See input_singletrack_impl for descriptions of what each method does. +class input_openmpt { +public: + void open(service_ptr_t<file> p_filehint,const char * p_path,t_input_open_reason p_reason,abort_callback & p_abort) { + if ( p_reason == input_open_info_write ) { + throw exception_io_unsupported_format(); // our input does not support retagging. + } + m_file = p_filehint; // p_filehint may be null, hence next line + input_open_file_helper(m_file,p_path,p_reason,p_abort); // if m_file is null, opens file with appropriate privileges for our operation (read/write for writing tags, read-only otherwise). + if ( m_file->get_size( p_abort ) >= (std::numeric_limits<std::size_t>::max)() ) { + throw exception_io_unsupported_format(); + } + std::vector<char> data( static_cast<std::size_t>( m_file->get_size( p_abort ) ) ); + m_file->read( data.data(), data.size(), p_abort ); + mod = new openmpt::module( data ); + } + void get_info(file_info & p_info,abort_callback & p_abort) { + p_info.set_length( mod->get_duration_seconds() ); + p_info.info_set_int( "samplerate", 48000 ); + p_info.info_set_int( "channels", 2 ); + p_info.info_set_int( "bitspersample", 32 ); + std::vector<std::string> keys = mod->get_metadata_keys(); + for ( std::vector<std::string>::iterator key = keys.begin(); key != keys.end(); ++key ) { + p_info.meta_set( (*key).c_str(), mod->get_metadata( *key ).c_str() ); + } + } + t_filestats get_file_stats(abort_callback & p_abort) { + return m_file->get_stats(p_abort); + } + void decode_initialize(unsigned p_flags,abort_callback & p_abort) { + m_file->reopen(p_abort); // equivalent to seek to zero, except it also works on nonseekable streams + } + bool decode_run(audio_chunk & p_chunk,abort_callback & p_abort) { + std::size_t count = mod->read( 48000, buffersize, left.data(), right.data() ); + if ( count == 0 ) { + return false; + } + for ( std::size_t frame = 0; frame < count; frame++ ) { + buffer[frame*2+0] = left[frame]; + buffer[frame*2+1] = right[frame]; + } + p_chunk.set_data_32( buffer.data(), count, 2, 48000 ); + return true; + } + void decode_seek(double p_seconds,abort_callback & p_abort) { + mod->seek_seconds( p_seconds ); + } + bool decode_can_seek() { + return true; + } + bool decode_get_dynamic_info(file_info & p_out, double & p_timestamp_delta) { // deals with dynamic information such as VBR bitrates + return false; + } + bool decode_get_dynamic_info_track(file_info & p_out, double & p_timestamp_delta) { // deals with dynamic information such as track changes in live streams + return false; + } + void decode_on_idle(abort_callback & p_abort) { + m_file->on_idle( p_abort ); + } + void retag(const file_info & p_info,abort_callback & p_abort) { + throw exception_io_unsupported_format(); + } + static bool g_is_our_content_type(const char * p_content_type) { // match against supported mime types here + return false; + } + static bool g_is_our_path(const char * p_path,const char * p_extension) { + if ( !p_extension ) { + return false; + } + std::vector<std::string> extensions = openmpt::get_supported_extensions(); + std::string ext = p_extension; + std::transform( ext.begin(), ext.end(), ext.begin(), tolower ); + return std::find( extensions.begin(), extensions.end(), ext ) != extensions.end(); + } +public: + service_ptr_t<file> m_file; + static const std::size_t buffersize = 1024; + openmpt::module * mod; + std::vector<float> left; + std::vector<float> right; + std::vector<float> buffer; + input_openmpt() : mod(0), left(buffersize), right(buffersize), buffer(2*buffersize) {} + ~input_openmpt() { delete mod; mod = 0; } +}; + +static input_singletrack_factory_t<input_openmpt> g_input_openmpt_factory; + + + +// copied table from soundlib/Tables.cpp +// the foobar2000 interface is stupid demanding to declare those statically + +DECLARE_FILE_TYPE("OpenMPT compatibel module files", + "*.mod" ";" + "*.s3m" ";" + "*.xm" ";" + "*.it" ";" + "*.mptm" ";" + "*.stm" ";" + "*.nst" ";" + "*.m15" ";" + "*.stk" ";" + "*.wow" ";" + "*.ult" ";" + "*.669" ";" + "*.mtm" ";" + "*.med" ";" + "*.far" ";" + "*.mdl" ";" + "*.ams" ";" + "*.ams" ";" + "*.dsm" ";" + "*.amf" ";" + "*.amf" ";" + "*.okt" ";" + "*.dmf" ";" + "*.ptm" ";" + "*.psm" ";" + "*.mt2" ";" + "*.dbm" ";" + "*.digi" ";" + "*.imf" ";" + "*.j2b" ";" + "*.gdm" ";" + "*.umx" ";" + "*.uax" ";" + "*.mo3" ); Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.sln =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.sln (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.sln 2013-05-11 14:53:38 UTC (rev 2015) @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libopenmpt_foobar2000", "libopenmpt_foobar2000.vcxproj", "{3F14BF17-016A-44C3-9B8D-C875C2EC8A18}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "foobar2000_SDK", "..\include\foobar2000sdk\foobar2000\SDK\foobar2000_SDK.vcxproj", "{E8091321-D79D-4575-86EF-064EA1A4A20D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "foobar2000_component_client", "..\include\foobar2000sdk\foobar2000\foobar2000_component_client\foobar2000_component_client.vcxproj", "{71AD2674-065B-48F5-B8B0-E1F9D3892081}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "foobar2000_sdk_helpers", "..\include\foobar2000sdk\foobar2000\helpers\foobar2000_sdk_helpers.vcxproj", "{EE47764E-A202-4F85-A767-ABDAB4AFF35F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pfc", "..\include\foobar2000sdk\pfc\pfc.vcxproj", "{EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libopenmpt", "libopenmpt.vcxproj", "{812A654D-99BE-4D13-B97F-86332AD3E363}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\include\zlib\contrib\vstudio\vc10\zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3F14BF17-016A-44C3-9B8D-C875C2EC8A18}.Debug|Win32.ActiveCfg = Debug|Win32 + {3F14BF17-016A-44C3-9B8D-C875C2EC8A18}.Debug|Win32.Build.0 = Debug|Win32 + {3F14BF17-016A-44C3-9B8D-C875C2EC8A18}.Release|Win32.ActiveCfg = Release|Win32 + {3F14BF17-016A-44C3-9B8D-C875C2EC8A18}.Release|Win32.Build.0 = Release|Win32 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Debug|Win32.ActiveCfg = Debug|Win32 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Debug|Win32.Build.0 = Debug|Win32 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Release|Win32.ActiveCfg = Release|Win32 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Release|Win32.Build.0 = Release|Win32 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Debug|Win32.ActiveCfg = Debug|Win32 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Debug|Win32.Build.0 = Debug|Win32 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Release|Win32.ActiveCfg = Release|Win32 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Release|Win32.Build.0 = Release|Win32 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Debug|Win32.ActiveCfg = Debug|Win32 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Debug|Win32.Build.0 = Debug|Win32 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Release|Win32.ActiveCfg = Release|Win32 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Release|Win32.Build.0 = Release|Win32 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Debug|Win32.ActiveCfg = Debug|Win32 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Debug|Win32.Build.0 = Debug|Win32 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Release|Win32.ActiveCfg = Release|Win32 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Release|Win32.Build.0 = Release|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Debug|Win32.ActiveCfg = DebugStatic|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Debug|Win32.Build.0 = DebugStatic|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Release|Win32.ActiveCfg = ReleaseStatic|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Release|Win32.Build.0 = ReleaseStatic|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = ReleaseWithoutAsm|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.sln ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-ms-sln \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +CRLF \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj 2013-05-11 14:53:38 UTC (rev 2015) @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{3F14BF17-016A-44C3-9B8D-C875C2EC8A18}</ProjectGuid> + <RootNamespace>libopenmpt_foobar2000</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <TargetName>foo_openmpt</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <TargetName>foo_openmpt</TargetName> + <OutDir>bin\</OutDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../include/foobar2000sdk</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalDependencies>..\include\foobar2000sdk\foobar2000\shared\shared.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Full</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <AdditionalIncludeDirectories>../include/foobar2000sdk</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>..\include\foobar2000sdk\foobar2000\shared\shared.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="libopenmpt_foobar2000.cpp" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\include\foobar2000sdk\foobar2000\foobar2000_component_client\foobar2000_component_client.vcxproj"> + <Project>{71ad2674-065b-48f5-b8b0-e1f9d3892081}</Project> + </ProjectReference> + <ProjectReference Include="..\include\foobar2000sdk\foobar2000\helpers\foobar2000_sdk_helpers.vcxproj"> + <Project>{ee47764e-a202-4f85-a767-abdab4aff35f}</Project> + </ProjectReference> + <ProjectReference Include="..\include\foobar2000sdk\foobar2000\SDK\foobar2000_SDK.vcxproj"> + <Project>{e8091321-d79d-4575-86ef-064ea1a4a20d}</Project> + </ProjectReference> + <ProjectReference Include="..\include\foobar2000sdk\pfc\pfc.vcxproj"> + <Project>{ebfffb4e-261d-44d3-b89c-957b31a0bf9c}</Project> + </ProjectReference> + <ProjectReference Include="..\include\zlib\contrib\vstudio\vc10\zlibstat.vcxproj"> + <Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project> + </ProjectReference> + <ProjectReference Include="libopenmpt.vcxproj"> + <Project>{812a654d-99be-4d13-b97f-86332ad3e363}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file Added: trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj.filters =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj.filters (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt_foobar2000.vcxproj.filters 2013-05-11 14:53:38 UTC (rev 2015) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="libopenmpt_foobar2000.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2013-05-11 14:51:10 UTC (rev 2014) +++ trunk/OpenMPT/soundlib/Tables.cpp 2013-05-11 14:53:38 UTC (rev 2015) @@ -53,6 +53,7 @@ char *extension; // "mod" }; +// remember to also update libopenmpt/libopenmpt_foobar2000.cpp (all other plugins read these dynamically) static const ModFormatInfo modFormatInfo[] = { { MOD_TYPE_MOD, "ProTracker", "mod" }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-05-11 14:54:54
|
Revision: 2016 http://sourceforge.net/p/modplug/code/2016 Author: manxorist Date: 2013-05-11 14:54:46 +0000 (Sat, 11 May 2013) Log Message: ----------- [New] Add openmpt123, a command line module player using libopenmpt. [New] Add modplug123, a modplug123 command line interface for openmpt123. [Mod] Build portaudio with VS2010 also with winmm support for openmpt123. Use of this API via portaudio is disabled in the tracker by default to not confuse users, but can be enabled via a hidden setting: [Sound Settings]MorePortaudio. Modified Paths: -------------- trunk/OpenMPT/include/portaudio/OpenMPT.txt trunk/OpenMPT/include/portaudio/build/msvc/portaudio_openmpt_vs2010.vcxproj trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h Added Paths: ----------- trunk/OpenMPT/openmpt123/ trunk/OpenMPT/openmpt123/bin/ trunk/OpenMPT/openmpt123/openmpt123.cpp trunk/OpenMPT/openmpt123/openmpt123.sln trunk/OpenMPT/openmpt123/openmpt123.vcxproj trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters Modified: trunk/OpenMPT/include/portaudio/OpenMPT.txt =================================================================== --- trunk/OpenMPT/include/portaudio/OpenMPT.txt 2013-05-11 14:53:38 UTC (rev 2015) +++ trunk/OpenMPT/include/portaudio/OpenMPT.txt 2013-05-11 14:54:46 UTC (rev 2016) @@ -4,4 +4,5 @@ - Change the Runtime library [C/C++/Code Generation/Runtime Library] to static linking in both Release and Debug configurations (/MT and /MTd instead of /MD and /MDd). - Change the [General/Confguration Type] to Static Library. - Exclude hostapi/ASIO/ASIOSDK/asio.cpp hostapi/ASIO/ASIOSDK/asiodrivers.cpp hostapi/ASIO/ASIOSDK/asiolist.cpp and hostapi/ASIO/pa_asio.cpp from the build. -- Change the following preprocessor definitions in [C/C++/Preprocessor]: PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0; to only build portaudio with wasapi support. +- For VS2008, change the following preprocessor definitions in [C/C++/Preprocessor]: PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0; to only build portaudio with wasapi support. +- For VS2010, change the following preprocessor definitions in [C/C++/Preprocessor]: PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=0; to only build portaudio with winmm and wasapi support (winmm being used for openmpt123). Modified: trunk/OpenMPT/include/portaudio/build/msvc/portaudio_openmpt_vs2010.vcxproj =================================================================== --- trunk/OpenMPT/include/portaudio/build/msvc/portaudio_openmpt_vs2010.vcxproj 2013-05-11 14:53:38 UTC (rev 2015) +++ trunk/OpenMPT/include/portaudio/build/msvc/portaudio_openmpt_vs2010.vcxproj 2013-05-11 14:54:46 UTC (rev 2016) @@ -139,7 +139,7 @@ <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <FunctionLevelLinking>true</FunctionLevelLinking> @@ -229,7 +229,7 @@ <ClCompile> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>true</MinimalRebuild> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-05-11 14:53:38 UTC (rev 2015) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-05-11 14:54:46 UTC (rev 2016) @@ -213,8 +213,18 @@ } COMBOBOXEXITEM cbi; UINT iItem = 0; + for (UINT nDevType = 0; nDevType < SNDDEV_NUM_DEVTYPES; nDevType++) { + if(!TrackerSettings::Instance().m_MorePortaudio) + { + if(nDevType == SNDDEV_PORTAUDIO_ASIO || nDevType == SNDDEV_PORTAUDIO_DS || nDevType == SNDDEV_PORTAUDIO_WMME) + { + // skip those portaudio apis that are already implemented via our own ISoundDevice class + // can be overwritten via [Sound Settings]MorePortaudio=1 + continue; + } + } UINT nDev = 0; while (EnumerateSoundDevices(nDevType, nDev, s, CountOf(s))) @@ -225,9 +235,11 @@ switch(nDevType) { case SNDDEV_DSOUND: + case SNDDEV_PORTAUDIO_DS: cbi.iImage = IMAGE_DIRECTX; break; case SNDDEV_ASIO: + case SNDDEV_PORTAUDIO_ASIO: bAsio = TRUE; cbi.iImage = IMAGE_ASIO; break; Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-05-11 14:53:38 UTC (rev 2015) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-05-11 14:54:46 UTC (rev 2016) @@ -68,6 +68,7 @@ // Audio device gbLoopSong = TRUE; + m_MorePortaudio = false; m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // Default value will be overridden m_LatencyMS = SNDDEV_DEFAULT_LATENCY_MS; m_UpdateIntervalMS = SNDDEV_DEFAULT_UPDATEINTERVAL_MS; @@ -327,6 +328,7 @@ rgbCustomColors[ncol] = CMainFrame::GetPrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile); } + m_MorePortaudio = CMainFrame::GetPrivateProfileBool("Sound Settings", "MorePortaudio", m_MorePortaudio, iniFile); DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // first WaveOut device #ifndef NO_ASIO // If there's an ASIO device available, prefer it over DirectSound Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2013-05-11 14:53:38 UTC (rev 2015) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2013-05-11 14:54:46 UTC (rev 2016) @@ -177,6 +177,7 @@ // Audio Setup DWORD gbLoopSong; + bool m_MorePortaudio; LONG m_nWaveDevice; // use the SNDDEV_GET_NUMBER and SNDDEV_GET_TYPE macros to decode DWORD m_LatencyMS; DWORD m_UpdateIntervalMS; Index: trunk/OpenMPT/openmpt123 =================================================================== --- trunk/OpenMPT/openmpt123 2013-05-11 14:53:38 UTC (rev 2015) +++ trunk/OpenMPT/openmpt123 2013-05-11 14:54:46 UTC (rev 2016) Property changes on: trunk/OpenMPT/openmpt123 ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,9 ## +Debug +Release +ReleaseStatic +openmpt123.sdf +openmpt123.suo +openmpt123.vcxproj.user +openmpt123.opensdf +ipch +DebugStatic Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Index: trunk/OpenMPT/openmpt123/bin =================================================================== --- trunk/OpenMPT/openmpt123/bin 2013-05-11 14:53:38 UTC (rev 2015) +++ trunk/OpenMPT/openmpt123/bin 2013-05-11 14:54:46 UTC (rev 2016) Property changes on: trunk/OpenMPT/openmpt123/bin ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/openmpt123/openmpt123.cpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.cpp (rev 0) +++ trunk/OpenMPT/openmpt123/openmpt123.cpp 2013-05-11 14:54:46 UTC (rev 2016) @@ -0,0 +1,766 @@ +/* + * openmpt123.cpp + * -------------- + * Purpose: libopenmpt command line example player + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#define LIBOPENMPT_ALPHA_WARNING_SEEN_AND_I_KNOW_WHAT_I_AM_DOING + +#define OPENMPT123_VERSION_STRING "0.1" + +#include <algorithm> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <sstream> +#include <string> +#include <vector> + +#include <cstdint> + +#if defined(_MSC_VER) +#include <fcntl.h> +#include <io.h> +#include <stdio.h> +#include <sys/stat.h> +#include <sys/types.h> +#endif + +#include <libopenmpt/libopenmpt.hpp> + +#include <portaudio.h> + +struct show_help_exception : public std::exception { + std::string message; + show_help_exception( const std::string & msg = "" ) : message(msg) { } +}; + +struct openmpt123_exception : public std::exception { + openmpt123_exception( const char * text ) : std::exception( text ) { } +}; + +struct silent_exit_exception : public std::exception { + silent_exit_exception() { } +}; + +struct show_version_number_exception : public std::exception { + show_version_number_exception() { } +}; + +struct portaudio_exception : public std::exception { + portaudio_exception( PaError code ) : std::exception( Pa_GetErrorText( code ) ) { } +}; + +struct openmpt123_flags { + bool modplug123; + int device; + std::int32_t channels; + std::int32_t buffer; + std::int32_t repeatcount; + std::int32_t samplerate; + std::int32_t gain; + std::int32_t quality; + std::int32_t rampinsamples; + std::int32_t rampoutsamples; + bool quiet; + bool verbose; + bool show_message; + bool show_progress; + double seek_target; + bool use_float; + bool use_stdout; + std::vector<std::string> filenames; + openmpt123_flags() { + modplug123 = false; + device = -1; + channels = 2; + buffer = 250; + repeatcount = 0; + samplerate = 48000; + gain = 0; + quality = 100; + rampinsamples = 16; + rampoutsamples = 42; + quiet = false; + verbose = false; + show_message = false; + show_progress = false; + seek_target = 0.0; + use_float = false; + use_stdout = false; + } + void check_and_sanitize() { + if ( filenames.size() == 0 ) { + throw show_help_exception(); + } + if ( quiet ) { + verbose = false; + show_progress = false; + } + if ( channels != 1 && channels != 2 && channels != 4 ) { + channels = openmpt123_flags().channels; + } + if ( samplerate < 0 ) { + samplerate = openmpt123_flags().samplerate; + } + } +}; + +std::ostream & operator << ( std::ostream & s, const openmpt123_flags & flags ) { + s << "Quiet: " << flags.quiet << std::endl; + s << "Verbose: " << flags.verbose << std::endl; + s << "Show message: " << flags.show_message << std::endl; + s << "Show progress: " << flags.show_progress << std::endl; + s << "Device: " << flags.device << std::endl; + s << "Channels: " << flags.channels << std::endl; + s << "Buffer: " << flags.buffer << std::endl; + s << "Repeat count: " << flags.repeatcount << std::endl; + s << "Sample rate: " << flags.samplerate << std::endl; + s << "Gain: " << flags.gain << std::endl; + s << "Quality: " << flags.quality << std::endl; + s << "Seek target: " << flags.seek_target << std::endl; + s << "Float: " << flags.use_float << std::endl; + s << "Standard output: " << flags.use_stdout << std::endl; + s << std::endl; + s << "Files: " << std::endl; + for ( std::vector<std::string>::const_iterator filename = flags.filenames.begin(); filename != flags.filenames.end(); ++filename ) { + s << " " << *filename << std::endl; + } + s << std::endl; + return s; +} + +static std::string seconds_to_string( double time ) { + std::int64_t time_ms = static_cast<std::int64_t>( time * 1000 ); + std::int64_t milliseconds = time_ms % 1000; + std::int64_t seconds = ( time_ms / 1000 ) % 60; + std::int64_t minutes = ( time_ms / ( 1000 * 60 ) ) % 24; + std::int64_t hours = ( time_ms / ( 1000 * 60 * 24 ) ); + std::ostringstream str; + if ( hours > 0 ) { + str << hours << ":"; + } + str << std::setfill('0') << std::setw(2) << minutes; + str << ":"; + str << std::setfill('0') << std::setw(2) << seconds; + str << "."; + str << std::setfill('0') << std::setw(3) << milliseconds; + return str.str(); +} + +template < typename T > +std::string bytes_to_string( T bytes ) { + std::ostringstream str; + if ( bytes >= std::uint64_t(10) * 1024 * 1024 * 1024 ) { + str << bytes / 1024 / 1024 / 1024 << "GiB"; + } else if ( bytes >= std::uint64_t(10) * 1024 * 1024 ) { + str << bytes / 1024 / 1024 << "MiB"; + } else if ( bytes >= std::uint64_t(10) * 1024 ) { + str << bytes / 1024 << "KiB"; + } else { + str << bytes << "B"; + } + return str.str(); +} + +typedef void (*PaUtilLogCallback ) (const char *log); +extern "C" void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb); + +class portaudio_raii { +private: + bool log_set; + bool portaudio_initialized; + static std::ostream * portaudio_log_stream; +private: + static void portaudio_log_function( const char * log ) { + if ( portaudio_log_stream ) { + *portaudio_log_stream << "PortAudio: " << log; + } + } +protected: + void check_portaudio_error( PaError e, std::ostream & log = std::cerr ) { + if ( e == paNoError ) { + return; + } + if ( e == paOutputUnderflowed ) { + log << "PortAudio warning: " << Pa_GetErrorText( e ) << std::endl; + return; + } + throw portaudio_exception( e ); + } +public: + portaudio_raii( bool verbose, std::ostream & log = std::cerr ) : log_set(false), portaudio_initialized(false) { + if ( verbose ) { + portaudio_log_stream = &log; + } else { + portaudio_log_stream = nullptr; + } + PaUtil_SetDebugPrintFunction( portaudio_log_function ); + log_set = true; + check_portaudio_error( Pa_Initialize() ); + portaudio_initialized = true; + if ( verbose ) { + *portaudio_log_stream << std::endl; + } + } + ~portaudio_raii() { + if ( portaudio_initialized ) { + check_portaudio_error( Pa_Terminate() ); + portaudio_initialized = false; + } + if ( log_set ) { + PaUtil_SetDebugPrintFunction( NULL ); + portaudio_log_stream = nullptr; + log_set = false; + } + } +}; + +std::ostream * portaudio_raii::portaudio_log_stream = nullptr; + +class write_buffers_interface { +public: + virtual void write( const std::vector<float*> buffers, std::size_t frames ) = 0; + virtual void write( const std::vector<std::int16_t*> buffers, std::size_t frames ) = 0; +}; + +class portaudio_stream_raii : public portaudio_raii, public write_buffers_interface { +private: + PaStream * stream; +public: + portaudio_stream_raii( const openmpt123_flags & flags, std::ostream & log = std::cerr ) : portaudio_raii(flags.verbose, log), stream(NULL) { + PaStreamParameters streamparameters; + std::memset( &streamparameters, 0, sizeof(PaStreamParameters) ); + streamparameters.device = ( flags.device == -1 ) ? Pa_GetDefaultOutputDevice() : flags.device; + streamparameters.channelCount = flags.channels; + streamparameters.sampleFormat = ( flags.use_float ? paFloat32 : paInt16 ) | paNonInterleaved; + streamparameters.suggestedLatency = flags.buffer * 0.001; + check_portaudio_error( Pa_OpenStream( &stream, NULL, &streamparameters, flags.samplerate, paFramesPerBufferUnspecified, 0, NULL, NULL ) ); + check_portaudio_error( Pa_StartStream( stream ) ); + if ( flags.verbose ) { + log << "PortAudio:" << std::endl; + log << " device: " + << streamparameters.device + << " [ " << Pa_GetHostApiInfo( Pa_GetDeviceInfo( streamparameters.device )->hostApi )->name << " / " << Pa_GetDeviceInfo( streamparameters.device )->name << " ] " + << std::endl; + log << " channels: " << streamparameters.channelCount << std::endl; + log << " sampleformat: " << ( ( streamparameters.sampleFormat == ( paFloat32 | paNonInterleaved ) ) ? "paFloat32" : "paInt16" ) << std::endl; + log << " latency: " << streamparameters.suggestedLatency << std::endl; + log << " samplerate: " << flags.samplerate << std::endl; + log << std::endl; + } + } + ~portaudio_stream_raii() { + if ( stream ) { + check_portaudio_error( Pa_StopStream( stream ) ); + check_portaudio_error( Pa_CloseStream( stream ) ); + stream = NULL; + } + } +public: + void write( const std::vector<float*> buffers, std::size_t frames ) { + check_portaudio_error( Pa_WriteStream( stream, buffers.data(), frames ) ); + } + void write( const std::vector<std::int16_t*> buffers, std::size_t frames ) { + check_portaudio_error( Pa_WriteStream( stream, buffers.data(), frames ) ); + } +}; + +class stdout_stream_raii : public write_buffers_interface { +private: + std::vector<float> interleaved_float_buffer; + std::vector<std::int16_t> interleaved_int_buffer; +public: + stdout_stream_raii() { + #if defined(_MSC_VER) + _setmode( _fileno( stdout ), _O_BINARY ); + #endif + } +public: + void write( const std::vector<float*> buffers, std::size_t frames ) { + interleaved_float_buffer.clear(); + for ( std::size_t frame = 0; frame < frames; frame++ ) { + for ( std::size_t channel = 0; channel < buffers.size(); channel++ ) { + interleaved_float_buffer.push_back( buffers[channel][frame] ); + } + } + std::cout.write( (const char*)( interleaved_float_buffer.data() ), interleaved_float_buffer.size() * sizeof( float ) ); + } + void write( const std::vector<std::int16_t*> buffers, std::size_t frames ) { + interleaved_int_buffer.clear(); + for ( std::size_t frame = 0; frame < frames; frame++ ) { + for ( std::size_t channel = 0; channel < buffers.size(); channel++ ) { + interleaved_int_buffer.push_back( buffers[channel][frame] ); + } + } + std::cout.write( (const char*)( interleaved_int_buffer.data() ), interleaved_int_buffer.size() * sizeof( std::int32_t ) ); + } +}; + +static void show_info( std::ostream & log, bool modplug123 = false ) { + log << ( modplug123 ? "modplug123 emulated by " : "" ) << "openmpt123" << " version " << OPENMPT123_VERSION_STRING << std::endl; + log << " Copyright (c) 2013 OpenMPT developers (http://openmpt.org/)" << std::endl; + log << " libopenmpt version " << openmpt::string::get( openmpt::string::library_version ) << " " << "(built " << openmpt::string::get( openmpt::string::build ) << ")" << std::endl; + log << " OpenMPT version " << openmpt::string::get( openmpt::string::core_version ) << std::endl; + log << " " << Pa_GetVersionText() << " (http://portaudio.com/)" << std::endl; + log << std::endl; +} + +static void show_version() { + std::clog << OPENMPT123_VERSION_STRING << std::endl; +} + +static std::string get_device_string( int device ) { + if ( device == -1 ) { + return "default"; + } + std::ostringstream str; + str << device; + return str.str(); +} + +static void show_help( show_help_exception & e, bool modplug123 ) { + show_info( std::clog, modplug123 ); + if ( modplug123 ) { + std::clog << "Usage: modplug123 [options] file1 [file2] ..." << std::endl; + std::clog << std::endl; + std::clog << " -h, --help Show help" << std::endl; + std::clog << " -v, --version Show version number and nothing else" << std::endl; + std::clog << " -l Loop song [default: " << openmpt123_flags().repeatcount << "]" << std::endl; + std::clog << " -ao n Set output device [default: " << openmpt123_flags().device << "]," << std::endl; + std::clog << " use -ao help to show available devices" << std::endl; + } else { + std::clog << "Usage: openmpt123 [options] [--] file1 [file2] ..." << std::endl; + std::clog << std::endl; + std::clog << " -h, --help Show help" << std::endl; + std::clog << " -q, --quiet Suppress non-error screen output" << std::endl; + std::clog << " -v, --verbose Show more screen output" << std::endl; + std::clog << " --version Show version number and nothing else" << std::endl; + std::clog << " --[no-]message Show song message [default: " << openmpt123_flags().show_message << "]" << std::endl; + std::clog << " --[no-]progress Show playback progress [default: " << openmpt123_flags().show_progress << "]" << std::endl; + std::clog << " --device n Set output device [default: " << get_device_string( openmpt123_flags().device ) << "]," << std::endl; + std::clog << " use --device help to show available devices" << std::endl; + std::clog << " --channels n use n [1,2,4] output channels [default: " << openmpt123_flags().channels << "]" << std::endl; + std::clog << " --[no]-float Output 32bit floating point instead of 16bit integer [default: " << openmpt123_flags().use_float << "]" << std::endl; + std::clog << " --buffer n Set output buffer size to n ms [default: " << openmpt123_flags().buffer << "]," << std::endl; + std::clog << " --samplerate n Set samplerate to n Hz [default: " << openmpt123_flags().samplerate << "]" << std::endl; + std::clog << " --gain n Set output gain to n dB [default: " << openmpt123_flags().gain << "]" << std::endl; + std::clog << " --repeat n Repeat song n times (-1 means forever) [default: " << openmpt123_flags().repeatcount << "]" << std::endl; + std::clog << " --quality n Set rendering quality to n % [default: " << openmpt123_flags().quality << "]" << std::endl; + std::clog << " --seek n Seek to n seconds on start [default: " << openmpt123_flags().seek_target << "]" << std::endl; + std::clog << " --volrampin n Use n samples volume ramping on sample begin [default: " << openmpt123_flags().rampinsamples << "]" << std::endl; + std::clog << " --volrampout n Use n samples volume ramping on sample end [default: " << openmpt123_flags().rampoutsamples << "]" << std::endl; + std::clog << std::endl; + std::clog << " -- Interpret further arguments as filenames" << std::endl; + std::clog << std::endl; + std::clog << " Supported file formats: " << std::endl; + std::clog << " "; + std::vector<std::string> extensions = openmpt::get_supported_extensions(); + bool first = true; + for ( std::vector<std::string>::iterator i = extensions.begin(); i != extensions.end(); ++i ) { + if ( first ) { + first = false; + } else { + std::clog << ", "; + } + std::clog << *i; + } + std::clog << std::endl; + } + + std::clog << std::endl; + + if ( e.message.size() > 0 ) { + std::clog << e.message; + std::clog << std::endl; + } +} + +static void show_audio_devices() { + std::ostringstream devices; + devices << " Available devices:" << std::endl; + portaudio_raii portaudio( false ); + devices << " " << "stdout" << ": " << "use standard output" << std::endl; + devices << " " << "default" << ": " << "default" << std::endl; + for ( PaDeviceIndex i = 0; i < Pa_GetDeviceCount(); ++i ) { + if ( Pa_GetDeviceInfo( i ) && Pa_GetDeviceInfo( i )->maxOutputChannels > 0 ) { + devices << " " << i << ": " << Pa_GetDeviceInfo( i )->name << std::endl; + } + } + throw show_help_exception( devices.str() ); +} + +template < typename Tsample > +void render_loop( const openmpt123_flags & flags, openmpt::module & mod, double & duration, std::ostream & log, write_buffers_interface & audio_stream ) { + + const std::size_t bufsize = 1024; + + std::vector<Tsample> left( bufsize ); + std::vector<Tsample> right( bufsize ); + std::vector<Tsample> back_left( bufsize ); + std::vector<Tsample> back_right( bufsize ); + std::vector<Tsample*> buffers( 4 ) ; + buffers[0] = left.data(); + buffers[1] = right.data(); + buffers[2] = back_left.data(); + buffers[3] = back_right.data(); + buffers.resize( flags.channels ); + + while ( true ) { + + std::size_t count = 0; + + switch ( flags.channels ) { + case 1: count = mod.read( flags.samplerate, bufsize, left.data() ); break; + case 2: count = mod.read( flags.samplerate, bufsize, left.data(), right.data() ); break; + case 4: count = mod.read( flags.samplerate, bufsize, left.data(), right.data(), back_left.data(), back_right.data() ); break; + } + + if ( count == 0 ) { + break; + } + + audio_stream.write( buffers, count ); + + if ( flags.show_progress ) { + log + << " " + << seconds_to_string( mod.get_current_position_seconds() ) + << " / " + << seconds_to_string( duration ) + << " " + << "Ord:" << mod.get_current_order() << "/" << mod.get_num_orders() << " Pat:" << mod.get_current_pattern() << " Row:" << mod.get_current_row() + << " " + << "Spd:" << mod.get_current_speed() << " Tmp:" << mod.get_current_tempo() + << " " + << "Chn:" << mod.get_current_playing_channels() + << " " + << "\r"; + } + + } + +} + +static void render_file( const openmpt123_flags & flags, const std::string & filename, std::ostream & log, write_buffers_interface & audio_stream ) { + + try { + + std::ifstream file_stream; + std::istream & stdin_stream = std::cin; + bool use_stdin = ( filename == "-" ); + if ( !use_stdin ) { + file_stream.open( filename, std::ios::binary ); + } else { + stdin_stream.setf( std::ios::binary ); + } + std::istream & data_stream = use_stdin ? stdin_stream : file_stream; + if ( data_stream.fail() ) { + throw openmpt123_exception( "file open error" ); + } + + openmpt::module mod( data_stream ); + + if ( !use_stdin ) { + file_stream.close(); + } + + double duration = mod.get_duration_seconds(); + log << "File: " << filename << std::endl; + log << "Type: " << mod.get_metadata( "type" ) << " (" << mod.get_metadata( "type_long" ) << ")" << std::endl; + log << "Tracker: " << mod.get_metadata( "tracker" ) << std::endl; + log << "Title: " << mod.get_metadata( "title" ) << std::endl; + log << "Duration: " << seconds_to_string( duration ) << std::endl; + log << "Channels: " << mod.get_num_channels() << std::endl; + log << "Orders: " << mod.get_num_orders() << std::endl; + log << "Patterns: " << mod.get_num_patterns() << std::endl; + log << "Instruments: " << mod.get_num_instruments() << std::endl; + log << "Samples: " << mod.get_num_samples() << std::endl; + + if ( flags.show_message ) { + log << "Message: " << std::endl; + log << mod.get_metadata( "message" ) << std::endl; + log << std::endl; + } + + mod.set_render_param( openmpt::module::RENDER_REPEATCOUNT, flags.repeatcount ); + mod.set_render_param( openmpt::module::RENDER_QUALITY_PERCENT, flags.quality ); + mod.set_render_param( openmpt::module::RENDER_MASTERGAIN_DB, flags.gain ); + mod.set_render_param( openmpt::module::RENDER_VOLUMERAMP_IN_SAMPLES, flags.rampinsamples ); + mod.set_render_param( openmpt::module::RENDER_VOLUMERAMP_OUT_SAMPLES, flags.rampoutsamples ); + + if ( flags.seek_target > 0.0 ) { + mod.seek_seconds( flags.seek_target ); + } + + if ( flags.use_float ) { + render_loop<float>( flags, mod, duration, log, audio_stream ); + } else { + render_loop<std::int16_t>( flags, mod, duration, log, audio_stream ); + } + + if ( flags.show_progress ) { + log << std::endl; + } + + } catch ( std::exception & e ) { + std::cerr << "error playing '" << filename << "': " << e.what() << std::endl; + } catch ( ... ) { + std::cerr << "unknown error playing '" << filename << "'" << std::endl; + } + + log << std::endl; + +} + +static openmpt123_flags parse_modplug123( const std::vector<std::string> & args ) { + + openmpt123_flags flags; + + flags.modplug123 = true; + + bool files_only = false; + for ( std::vector<std::string>::const_iterator i = args.begin(); i != args.end(); ++i ) { + if ( i == args.begin() ) { + // skip program name + continue; + } + std::string arg = *i; + std::string nextarg = ( i+1 != args.end() ) ? *(i+1) : ""; + if ( files_only ) { + flags.filenames.push_back( arg ); + } else if ( arg.substr( 0, 1 ) != "-" ) { + flags.filenames.push_back( arg ); + } else if ( arg == "-h" || arg == "--help" ) { + throw show_help_exception(); + } else if ( arg == "-v" || arg == "--version" ) { + show_info( std::clog, true ); + throw silent_exit_exception(); + } else if ( arg == "-l" ) { + flags.repeatcount = -1; + } else if ( arg == "-ao" && nextarg != "" ) { + if ( nextarg == "help" ) { + show_audio_devices(); + } else if ( nextarg == "stdout" ) { + flags.use_stdout = true; + } else if ( nextarg == "default" ) { + flags.device = -1; + } else { + std::istringstream istr( nextarg ); + istr >> flags.device; + } + ++i; + } + } + + return flags; + +} + +static openmpt123_flags parse_openmpt123( const std::vector<std::string> & args ) { + + openmpt123_flags flags; + + bool files_only = false; + for ( std::vector<std::string>::const_iterator i = args.begin(); i != args.end(); ++i ) { + if ( i == args.begin() ) { + // skip program name + continue; + } + std::string arg = *i; + std::string nextarg = ( i+1 != args.end() ) ? *(i+1) : ""; + if ( files_only ) { + flags.filenames.push_back( arg ); + } else if ( arg.substr( 0, 1 ) != "-" ) { + flags.filenames.push_back( arg ); + } else { + if ( arg == "--" ) { + files_only = true; + } else if ( arg == "-h" || arg == "--help" ) { + throw show_help_exception(); + } else if ( arg == "-q" || arg == "--quiet" ) { + flags.quiet = true; + } else if ( arg == "-v" || arg == "--verbose" ) { + flags.verbose = true; + } else if ( arg == "--version" ) { + throw show_version_number_exception(); + } else if ( arg == "--message" ) { + flags.show_message = true; + } else if ( arg == "--no-message" ) { + flags.show_message = false; + } else if ( arg == "--progress" ) { + flags.show_progress = true; + } else if ( arg == "--no-progress" ) { + flags.show_progress = false; + } else if ( arg == "--device" && nextarg != "" ) { + if ( nextarg == "help" ) { + show_audio_devices(); + } else if ( nextarg == "stdout" ) { + flags.use_stdout = true; + } else if ( nextarg == "default" ) { + flags.device = -1; + } else { + std::istringstream istr( nextarg ); + istr >> flags.device; + } + ++i; + } else if ( arg == "--channels" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.channels; + ++i; + } else if ( arg == "--float" ) { + flags.use_float = true; + } else if ( arg == "--no-float" ) { + flags.use_float = false; + } else if ( arg == "--buffer" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.buffer; + ++i; + } else if ( arg == "--samplerate" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.samplerate; + ++i; + } else if ( arg == "--gain" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.gain; + ++i; + } else if ( arg == "--repeat" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.repeatcount; + ++i; + } else if ( arg == "--quality" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.quality; + ++i; + } else if ( arg == "--seek" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.seek_target; + ++i; + } else if ( arg == "--volrampin" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.rampinsamples; + ++i; + } else if ( arg == "--volrampout" && nextarg != "" ) { + std::istringstream istr( nextarg ); + istr >> flags.rampoutsamples; + ++i; + } else if ( arg.size() > 0 && arg.substr( 0, 1 ) == "-" ) { + throw show_help_exception(); + } + } + } + + return flags; + +} + +static bool equal_end( const std::string & str1, const std::string & str2 ) { + std::size_t minlength = std::min( str1.length(), str2.length() ); + return str1.substr( str1.length() - minlength ) == str2.substr( str2.length() - minlength ); +} + +static bool is_modplug123_binary_name( std::string name ) { + std::transform( name.begin(), name.end(), name.begin(), tolower ); + if ( equal_end( name, "modplug123" ) ) { + return true; + } + if ( equal_end( name, "modplug123.exe" ) ) { + return true; + } + return false; +} + +static void show_credits( std::ostream & s ) { + s << openmpt::string::get( openmpt::string::contact ) << std::endl; + s << std::endl; + s << openmpt::string::get( openmpt::string::credits ); +} + +int main( int argc, char * argv [] ) { + + openmpt123_flags flags; + + try { + + std::vector<std::string> args( argv, argv + argc ); + + if ( args.size() > 0 && is_modplug123_binary_name( args[0] ) ) { + + flags = parse_modplug123( args ); + + } else { + + flags = parse_openmpt123( args ); + + } + + flags.check_and_sanitize(); + + std::ostringstream dummy_log; + std::ostream & log = flags.quiet ? dummy_log : std::clog; + + show_info( log, flags.modplug123 ); + + if ( flags.verbose ) { + + show_credits( log ); + + log << flags; + + } + + #if defined(_MSC_VER) + + for ( std::vector<std::string>::iterator filename = flags.filenames.begin(); filename != flags.filenames.end(); ++filename ) { + if ( *filename == "-" ) { + _setmode( _fileno( stdin ), _O_BINARY ); + break; + } + } + + #endif + + if ( flags.use_stdout ) { + + stdout_stream_raii stdout_audio_stream; + + for ( std::vector<std::string>::iterator filename = flags.filenames.begin(); filename != flags.filenames.end(); ++filename ) { + render_file( flags, *filename, log, stdout_audio_stream ); + } + + } else { + + portaudio_stream_raii portaudio_stream( flags, log ); + + for ( std::vector<std::string>::iterator filename = flags.filenames.begin(); filename != flags.filenames.end(); ++filename ) { + render_file( flags, *filename, log, portaudio_stream ); + } + + } + + } catch ( show_help_exception & e ) { + show_help( e, flags.modplug123 ); + if ( flags.verbose ) { + show_credits( std::clog ); + } + return 1; + } catch ( show_version_number_exception & ) { + show_version(); + return 0; + } catch ( portaudio_exception & e ) { + std::cerr << "PortAudio error: " << e.what() << std::endl; + } catch ( silent_exit_exception & ) { + return 0; + } catch ( std::exception & e ) { + std::cerr << "error: " << e.what() << std::endl; + return 1; + } catch ( ... ) { + std::cerr << "unknown error" << std::endl; + return 1; + } + + return 0; +} Property changes on: trunk/OpenMPT/openmpt123/openmpt123.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/openmpt123/openmpt123.sln =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.sln (rev 0) +++ trunk/OpenMPT/openmpt123/openmpt123.sln 2013-05-11 14:54:46 UTC (rev 2016) @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openmpt123", "openmpt123.vcxproj", "{29E00E3B-C33B-4DC1-B44F-64597A3701DE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libopenmpt", "..\libopenmpt\libopenmpt.vcxproj", "{812A654D-99BE-4D13-B97F-86332AD3E363}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "..\include\portaudio\build\msvc\portaudio_openmpt_vs2010.vcxproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\include\zlib\contrib\vstudio\vc10\zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29E00E3B-C33B-4DC1-B44F-64597A3701DE}.Debug|Win32.ActiveCfg = Debug|Win32 + {29E00E3B-C33B-4DC1-B44F-64597A3701DE}.Debug|Win32.Build.0 = Debug|Win32 + {29E00E3B-C33B-4DC1-B44F-64597A3701DE}.Release|Win32.ActiveCfg = Release|Win32 + {29E00E3B-C33B-4DC1-B44F-64597A3701DE}.Release|Win32.Build.0 = Release|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Debug|Win32.ActiveCfg = DebugStatic|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Debug|Win32.Build.0 = DebugStatic|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Release|Win32.ActiveCfg = ReleaseStatic|Win32 + {812A654D-99BE-4D13-B97F-86332AD3E363}.Release|Win32.Build.0 = ReleaseStatic|Win32 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = ReleaseWithoutAsm|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Property changes on: trunk/OpenMPT/openmpt123/openmpt123.sln ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-ms-sln \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +CRLF \ No newline at end of property Added: trunk/OpenMPT/openmpt123/openmpt123.vcxproj =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.vcxproj (rev 0) +++ trunk/OpenMPT/openmpt123/openmpt123.vcxproj 2013-05-11 14:54:46 UTC (rev 2016) @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{29E00E3B-C33B-4DC1-B44F-64597A3701DE}</ProjectGuid> + <RootNamespace>openmpt123</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>NotSet</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>false</WholeProgramOptimization> + <CharacterSet>NotSet</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <OutDir>bin\</OutDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..;../common;../include/portaudio/include;../common/svn_version;../common/svn_version_default</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FloatingPointModel>Fast</FloatingPointModel> + <AdditionalIncludeDirectories>..;../common;../include/portaudio/include;../common/svn_version;../common/svn_version_default</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <SubSystem>Console</SubSystem> + </Link> + <PostBuildEvent> + <Command>copy /y bin\openmpt123.exe bin\modplug123.exe</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="openmpt123.cpp" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\include\portaudio\build\msvc\portaudio_openmpt_vs2010.vcxproj"> + <Project>{0a18a071-125e-442f-aff7-a3f68abecf99}</Project> + </ProjectReference> + <ProjectReference Include="..\include\zlib\contrib\vstudio\vc10\zlibstat.vcxproj"> + <Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project> + </ProjectReference> + <ProjectReference Include="..\libopenmpt\libopenmpt.vcxproj"> + <Project>{812a654d-99be-4d13-b97f-86332ad3e363}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file Added: trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters (rev 0) +++ trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters 2013-05-11 14:54:46 UTC (rev 2016) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="openmpt123.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |