|
From: <man...@us...> - 2013-04-22 22:11:57
|
Revision: 1947
http://sourceforge.net/p/modplug/code/1947
Author: manxorist
Date: 2013-04-22 22:11:51 +0000 (Mon, 22 Apr 2013)
Log Message:
-----------
[Ref] Move sample saving functions inside #ifndef MODPLUG_NO_FILESAVE.
[Ref] Add one missing #ifndef NO_FLAC.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/SampleFormats.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp
===================================================================
--- trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-04-22 22:07:55 UTC (rev 1946)
+++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-04-22 22:11:51 UTC (rev 1947)
@@ -393,6 +393,7 @@
// Save WAV
+#ifndef MODPLUG_NO_FILESAVE
bool CSoundFile::SaveWAVSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const
//----------------------------------------------------------------------------------
{
@@ -536,6 +537,11 @@
return true;
}
+#endif // MODPLUG_NO_FILESAVE
+
+
+#ifndef MODPLUG_NO_FILESAVE
+
///////////////////////////////////////////////////////////////
// Save RAW
@@ -557,6 +563,8 @@
return true;
}
+#endif // MODPLUG_NO_FILESAVE
+
/////////////////////////////////////////////////////////////
// GUS Patches
@@ -1049,6 +1057,8 @@
}
+#ifndef MODPLUG_NO_FILESAVE
+
bool CSoundFile::SaveXIInstrument(INSTRUMENTINDEX nInstr, const LPCSTR lpszFileName) const
//----------------------------------------------------------------------------------------
{
@@ -1116,7 +1126,9 @@
return true;
}
+#endif // MODPLUG_NO_FILESAVE
+
// Read first sample from XI file into a sample slot
bool CSoundFile::ReadXISample(SAMPLEINDEX nSample, FileReader &file)
//------------------------------------------------------------------
@@ -1628,6 +1640,8 @@
}
+#ifndef MODPLUG_NO_FILESAVE
+
bool CSoundFile::SaveITIInstrument(INSTRUMENTINDEX nInstr, const LPCSTR lpszFileName, bool compress) const
//--------------------------------------------------------------------------------------------------------
{
@@ -1698,7 +1712,9 @@
return true;
}
+#endif // MODPLUG_NO_FILESAVE
+
void ReadInstrumentExtensionField(ModInstrument* pIns, const uint32 code, const uint16 size, FileReader &file)
//------------------------------------------------------------------------------------------------------------
{
@@ -2108,6 +2124,7 @@
}
+#ifndef NO_FLAC
// Helper function for copying OpenMPT's sample data to FLAC's int32 buffer.
template<typename T>
inline static void SampleToFLAC32(FLAC__int32 *dst, const void *src, SmpLength numSamples)
@@ -2118,8 +2135,10 @@
dst[i] = in[i];
}
};
+#endif
+#ifndef MODPLUG_NO_FILESAVE
bool CSoundFile::SaveFLACSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const
//-----------------------------------------------------------------------------------
{
@@ -2263,6 +2282,7 @@
return false;
#endif // NO_FLAC
}
+#endif // MODPLUG_NO_FILESAVE
///////////////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-22 22:07:55 UTC (rev 1946)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-22 22:11:51 UTC (rev 1947)
@@ -698,9 +698,11 @@
bool Read8SVXSample(SAMPLEINDEX nInstr, const LPBYTE lpMemFile, DWORD dwFileLength);
bool ReadFLACSample(SAMPLEINDEX sample, FileReader &file);
bool ReadMP3Sample(SAMPLEINDEX sample, FileReader &file);
+#ifndef MODPLUG_NO_FILESAVE
bool SaveWAVSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const;
bool SaveRAWSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const;
bool SaveFLACSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const;
+#endif
// Instrument file I/O
bool ReadInstrumentFromFile(INSTRUMENTINDEX nInstr, const LPBYTE lpMemFile, DWORD dwFileLength);
@@ -708,8 +710,10 @@
bool ReadITIInstrument(INSTRUMENTINDEX nInstr, FileReader &file);
bool ReadPATInstrument(INSTRUMENTINDEX nInstr, const LPBYTE lpMemFile, DWORD dwFileLength);
bool ReadSampleAsInstrument(INSTRUMENTINDEX nInstr, const LPBYTE lpMemFile, DWORD dwFileLength);
+#ifndef MODPLUG_NO_FILESAVE
bool SaveXIInstrument(INSTRUMENTINDEX nInstr, const LPCSTR lpszFileName) const;
bool SaveITIInstrument(INSTRUMENTINDEX nInstr, const LPCSTR lpszFileName, bool compress) const;
+#endif
// I/O from another sound file
bool ReadInstrumentFromSong(INSTRUMENTINDEX targetInstr, const CSoundFile &srcSong, INSTRUMENTINDEX sourceInstr);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|