|
From: <man...@us...> - 2013-04-22 23:29:07
|
Revision: 1957
http://sourceforge.net/p/modplug/code/1957
Author: manxorist
Date: 2013-04-22 23:28:46 +0000 (Mon, 22 Apr 2013)
Log Message:
-----------
[Imp] Add CSoundFile::ModTypeToString() and CSoundFile::ModTypeToTracker()
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Tables.cpp
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-22 23:18:28 UTC (rev 1956)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-22 23:28:46 UTC (rev 1957)
@@ -507,6 +507,8 @@
bool ReadMID(const LPCBYTE lpStream, DWORD dwMemLength);
static std::vector<const char *> GetSupportedExtensions(bool otherFormats);
+ static const char * ModTypeToString(MODTYPE modtype);
+ static const char * ModTypeToTracker(MODTYPE modtype);
void UpgradeModFlags();
void UpgradeSong();
Modified: trunk/OpenMPT/soundlib/Tables.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Tables.cpp 2013-04-22 23:18:28 UTC (rev 1956)
+++ trunk/OpenMPT/soundlib/Tables.cpp 2013-04-22 23:28:46 UTC (rev 1957)
@@ -118,6 +118,34 @@
}
+const char * CSoundFile::ModTypeToString(MODTYPE modtype)
+//-------------------------------------------------------
+{
+ for(size_t i = 0; i < CountOf(modFormatInfo); i++)
+ {
+ if(modFormatInfo[i].format & modtype)
+ {
+ return modFormatInfo[i].extension;
+ }
+ }
+ return "";
+}
+
+
+const char * CSoundFile::ModTypeToTracker(MODTYPE modtype)
+//--------------------------------------------------------
+{
+ for(size_t i = 0; i < CountOf(modFormatInfo); i++)
+ {
+ if(modFormatInfo[i].format & modtype)
+ {
+ return modFormatInfo[i].name;
+ }
+ }
+ return "";
+}
+
+
///////////////////////////////////////////////////////////////////////
const uint8 ImpulseTrackerPortaVolCmd[16] =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|