From: <man...@us...> - 2014-09-07 07:44:05
|
Revision: 4249 http://sourceforge.net/p/modplug/code/4249 Author: manxorist Date: 2014-09-07 07:43:55 +0000 (Sun, 07 Sep 2014) Log Message: ----------- [Reg] openmpt123: Remove support for writing WavPack files. Modified Paths: -------------- trunk/OpenMPT/Makefile trunk/OpenMPT/README.md trunk/OpenMPT/libopenmpt/dox/changelog.md trunk/OpenMPT/libopenmpt/dox/dependencies.md trunk/OpenMPT/libopenmpt/dox/quickstart.md trunk/OpenMPT/openmpt123/openmpt123.cpp trunk/OpenMPT/openmpt123/openmpt123.vcxproj trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters Removed Paths: ------------- trunk/OpenMPT/openmpt123/openmpt123_wavpack.hpp Modified: trunk/OpenMPT/Makefile =================================================================== --- trunk/OpenMPT/Makefile 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/Makefile 2014-09-07 07:43:55 UTC (rev 4249) @@ -61,7 +61,6 @@ # NO_SDL=1 Avoid using SDL, even if found # NO_PORTAUDIO=1 Avoid using PortAudio, even if found # NO_FLAC=1 Avoid using FLAC, even if found -# NO_WAVPACK=1 Avoid using WavPack, even if found # NO_SNDFILE=1 Avoid using libsndfile, even if found # # @@ -312,18 +311,6 @@ endif endif -ifeq ($(NO_WAVPACK),1) -else -#LDLIBS += -lwavpack -ifeq ($(shell pkg-config --exists wavpack && echo yes),yes) -CPPFLAGS_WAVPACK := $(shell pkg-config --cflags-only-I wavpack ) -DMPT_WITH_WAVPACK -LDFLAGS_WAVPACK := $(shell pkg-config --libs-only-L wavpack ) $(shell pkg-config --libs-only-other wavpack ) -LDLIBS_WAVPACK := $(shell pkg-config --libs-only-l wavpack ) -else -NO_WAVPACK:=1 -endif -endif - ifeq ($(NO_SNDFILE),1) else #LDLIBS += -lsndfile @@ -340,9 +327,9 @@ LDFLAGS += $(LDFLAGS_ZLIB) $(LDFLAGS_MO3) LDLIBS += $(LDLIBS_ZLIB) $(LDLIBS_MO3) -CPPFLAGS_OPENMPT123 += $(CPPFLAGS_SDL) $(CPPFLAGS_PORTAUDIO) $(CPPFLAGS_FLAC) $(CPPFLAGS_WAVPACK) $(CPPFLAGS_SNDFILE) -LDFLAGS_OPENMPT123 += $(LDFLAGS_SDL) $(LDFLAGS_PORTAUDIO) $(LDFLAGS_FLAC) $(LDFLAGS_WAVPACK) $(LDFLAGS_SNDFILE) -LDLIBS_OPENMPT123 += $(LDLIBS_SDL) $(LDLIBS_PORTAUDIO) $(LDLIBS_FLAC) $(LDLIBS_WAVPACK) $(LDLIBS_SNDFILE) +CPPFLAGS_OPENMPT123 += $(CPPFLAGS_SDL) $(CPPFLAGS_PORTAUDIO) $(CPPFLAGS_FLAC) $(CPPFLAGS_SNDFILE) +LDFLAGS_OPENMPT123 += $(LDFLAGS_SDL) $(LDFLAGS_PORTAUDIO) $(LDFLAGS_FLAC) $(LDFLAGS_SNDFILE) +LDLIBS_OPENMPT123 += $(LDLIBS_SDL) $(LDLIBS_PORTAUDIO) $(LDLIBS_FLAC) $(LDLIBS_SNDFILE) %: %.o Modified: trunk/OpenMPT/README.md =================================================================== --- trunk/OpenMPT/README.md 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/README.md 2014-09-07 07:43:55 UTC (rev 4249) @@ -108,8 +108,8 @@ The Makefile requires pkg-config for native builds. For sound output in openmpt123, PortAudio or SDL is required. - openmpt123 can optionally use libflac, libwavpack and libsndfile to - render PCM files to disk. + openmpt123 can optionally use libflac and libsndfile to render PCM + files to disk. When using gcc, run: Modified: trunk/OpenMPT/libopenmpt/dox/changelog.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/changelog.md 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/libopenmpt/dox/changelog.md 2014-09-07 07:43:55 UTC (rev 4249) @@ -9,6 +9,15 @@ * [Bug] The distributed windows .zip file did not include pugixml. + * [Regression] openmpt123: Support for writing WavPack (.wv) files has been + removed. + Reasoning: + 1. WavPack support was incomplete and did not include support for writing + WavPack metadata at all. + 2. openmpt123 already supports libSndFile which can be used to write + uncompressed lossless WAV files which can then be encoded to whatever + format the user desires with other tools. + ### 2014-09-06 - libopenmpt 0.2-beta6 * openmpt123: SDL is now also used by default if availble, in addition to Modified: trunk/OpenMPT/libopenmpt/dox/dependencies.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/dependencies.md 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/libopenmpt/dox/dependencies.md 2014-09-07 07:43:55 UTC (rev 4249) @@ -56,7 +56,6 @@ * Rendering to PCM files can use: * **FLAC 1.2** or higher * **libsndfile** - * **WavPack** * **Win32** for WAVE * raw PCM has no external dependencies * **help2man** is required to build the documentation. Modified: trunk/OpenMPT/libopenmpt/dox/quickstart.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/quickstart.md 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/libopenmpt/dox/quickstart.md 2014-09-07 07:43:55 UTC (rev 4249) @@ -17,7 +17,6 @@ - **help2man** - **libFLAC** - **libsndfile** - - **WavPack** 3. Run: svn checkout http://svn.code.sf.net/p/modplug/code/trunk/OpenMPT/ openmpt-trunk Modified: trunk/OpenMPT/openmpt123/openmpt123.cpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.cpp 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/openmpt123/openmpt123.cpp 2014-09-07 07:43:55 UTC (rev 4249) @@ -91,7 +91,6 @@ #include "openmpt123_portaudio.hpp" #include "openmpt123_sdl.hpp" #include "openmpt123_waveout.hpp" -#include "openmpt123_wavpack.hpp" namespace openmpt123 { @@ -179,10 +178,6 @@ } else if ( flags.output_extension == "flac" ) { impl = new flac_stream_raii( filename, flags, log ); #endif -#ifdef MPT_WITH_WAVPACK - } else if ( flags.output_extension == "wv" ) { - impl = new wavpack_stream_raii( filename, flags, log ); -#endif #ifdef MPT_WITH_SNDFILE } else { impl = new sndfile_stream_raii( filename, flags, log ); @@ -361,11 +356,6 @@ sndfile_info[127] = '\0'; log << " libsndfile " << sndfile_info << " <http://mega-nerd.com/libsndfile/>" << std::endl; #endif -#ifdef MPT_WITH_WAVPACK - std::ostringstream wpver; - wpver << std::hex << std::setfill('0') << std::setw(8) << WavpackGetLibraryVersion(); - log << " WavPack " << WavpackGetLibraryVersionString() << " (" << wpver.str() << ") (http://wavpack.com/)" << std::endl; -#endif log << std::endl; } Modified: trunk/OpenMPT/openmpt123/openmpt123.vcxproj =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.vcxproj 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/openmpt123/openmpt123.vcxproj 2014-09-07 07:43:55 UTC (rev 4249) @@ -171,7 +171,6 @@ <ClInclude Include="openmpt123_sndfile.hpp" /> <ClInclude Include="openmpt123_stdout.hpp" /> <ClInclude Include="openmpt123_waveout.hpp" /> - <ClInclude Include="openmpt123_wavpack.hpp" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> Modified: trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/openmpt123/openmpt123.vcxproj.filters 2014-09-07 07:43:55 UTC (rev 4249) @@ -37,9 +37,6 @@ <ClInclude Include="openmpt123_mmio.hpp"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="openmpt123_wavpack.hpp"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="openmpt123_waveout.hpp"> <Filter>Header Files</Filter> </ClInclude> Deleted: trunk/OpenMPT/openmpt123/openmpt123_wavpack.hpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123_wavpack.hpp 2014-09-07 07:28:20 UTC (rev 4248) +++ trunk/OpenMPT/openmpt123/openmpt123_wavpack.hpp 2014-09-07 07:43:55 UTC (rev 4249) @@ -1,127 +0,0 @@ -/* - * openmpt123_wavpack.hpp - * ---------------------- - * Purpose: libopenmpt command line player - * Notes : (currently none) - * Authors: OpenMPT Devs - * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. - */ - -#ifndef OPENMPT123_WAVPACK_HPP -#define OPENMPT123_WAVPACK_HPP - -#include "openmpt123_config.hpp" -#include "openmpt123.hpp" - -#if defined(MPT_WITH_WAVPACK) - -#include <wavpack/wavpack.h> - -namespace openmpt123 { - -#define CHECKED(x) do { \ - int err = x ; \ - if ( !err ) { \ - throw exception( WavpackGetErrorMessage( wpc ) ); \ - } \ -} while(0) - -class wavpack_stream_raii : public file_audio_stream_base { -private: - commandlineflags flags; - std::ofstream file; - WavpackContext * wpc; - WavpackConfig wpconfig; - bool first_block_seen; - std::streampos first_block_pos; - std::vector<char> first_block; - std::vector<int32_t> interleaved_buffer; - static int write_block( void * id, void * data, int32_t length ) { - return reinterpret_cast<wavpack_stream_raii*>(id)->write_block( reinterpret_cast<const char*>(data), length ) ? 1 : 0; - } - bool write_block( const char * data, std::size_t length ) { - if ( !first_block_seen ) { - first_block_pos = file.tellp(); - first_block = std::vector<char>( data, data + length ); - first_block_seen = true; - } - file.write( data, length ); - if ( !file ) { - return false; - } - return true; - } -public: - wavpack_stream_raii( const std::string & filename, const commandlineflags & flags_, std::ostream & /*log*/ ) - : flags(flags_) - , file(filename.c_str(), std::ios::binary | std::ios::trunc) - , wpc(NULL) - , wpconfig() - , first_block_seen(false) - , first_block_pos(0) - { - wpc = WavpackOpenFileOutput( write_block, this, NULL ); - wpconfig.bytes_per_sample = flags.use_float ? 4 : 2; - wpconfig.bits_per_sample = flags.use_float ? 32 : 16; - if ( flags.channels == 1 ) { - wpconfig.channel_mask = (1<<2); - } else if ( flags.channels == 2 ) { - wpconfig.channel_mask = (1<<0)|(1<<1); - } else if ( flags.channels == 3 ) { - wpconfig.channel_mask = (1<<0)|(1<<1)|(1<<8); - } else if ( flags.channels == 4 ) { - wpconfig.channel_mask = (1<<0)|(1<<1)|(1<<4)|(1<<5); - } else { - wpconfig.channel_mask = 0; - } - wpconfig.num_channels = flags.channels; - wpconfig.sample_rate = flags.samplerate; - wpconfig.flags = flags.use_float ? CONFIG_SKIP_WVX : 0; - wpconfig.float_norm_exp = flags.use_float ? 127 : 0; - CHECKED( WavpackSetConfiguration( wpc, &wpconfig, -1 ) ); - CHECKED( WavpackPackInit( wpc ) ); - } - ~wavpack_stream_raii() { - CHECKED( WavpackFlushSamples( wpc ) ); - if ( first_block_seen ) { - WavpackUpdateNumSamples( wpc, reinterpret_cast<void*>( first_block.data() ) ); - std::streampos endpos = file.tellp(); - file.seekp( first_block_pos ); - file.write( first_block.data(), first_block.size() ); - file.seekp( endpos ); - } - WavpackCloseFile( wpc ); - wpc = NULL; - } - void write( const std::vector<float*> buffers, std::size_t frames ) { - interleaved_buffer.clear(); - for ( std::size_t frame = 0; frame < frames; frame++ ) { - for ( std::size_t channel = 0; channel < buffers.size(); channel++ ) { - union { - std::uint32_t i; - float f; - } conv; - conv.f = buffers[channel][frame]; - interleaved_buffer.push_back( conv.i ); - } - } - CHECKED( WavpackPackSamples( wpc, interleaved_buffer.data(), frames ) ); - } - void write( const std::vector<std::int16_t*> buffers, std::size_t frames ) { - interleaved_buffer.clear(); - for ( std::size_t frame = 0; frame < frames; frame++ ) { - for ( std::size_t channel = 0; channel < buffers.size(); channel++ ) { - interleaved_buffer.push_back( buffers[channel][frame] ); - } - } - CHECKED( WavpackPackSamples( wpc, interleaved_buffer.data(), frames ) ); - } -}; - -#undef CHECKED - -} // namespace openmpt123 - -#endif // MPT_WITH_WAVPACK - -#endif // OPENMPT123_WAVPACK_HPP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |