[OpenMPT / vgmstream] Made libraries pre-built

Made the OpenMPT / legacy OpenMPT and mpg123 libraries pre-built.
Changed the OpenMPT and vgmstream plugins to import the libraries as
they are now. Made mpg123 embedded and imported by the main binary,
since it's now shared by two plugins.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
lastfm
Christopher Snowhill 2022-06-24 14:40:44 -07:00
parent 4540b88094
commit 32a595222d
119 changed files with 20309 additions and 19615 deletions

View File

@ -104,6 +104,8 @@
831B99BF27C23E88005A969B /* Cog.sdef in Resources */ = {isa = PBXBuildFile; fileRef = 831B99BE27C23E88005A969B /* Cog.sdef */; };
83229C9F283B0095004626A8 /* SpectrumWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83229C9D283B0095004626A8 /* SpectrumWindowController.m */; };
83229CA0283B0095004626A8 /* SpectrumWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83229C9E283B0095004626A8 /* SpectrumWindow.xib */; };
83256B68286661FC0036D9C0 /* libmpg123.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256B672866617F0036D9C0 /* libmpg123.0.dylib */; };
83256B69286661FC0036D9C0 /* libmpg123.0.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83256B672866617F0036D9C0 /* libmpg123.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
832923AF279FAC400048201E /* Cog.q1.json in Resources */ = {isa = PBXBuildFile; fileRef = 832923AE279FAC400048201E /* Cog.q1.json */; };
83293070277886250010C07E /* OpenMPTOld.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8329306D277885790010C07E /* OpenMPTOld.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
832C1253180BD1E2005507C1 /* Cog.help in Resources */ = {isa = PBXBuildFile; fileRef = 832C1252180BD1E2005507C1 /* Cog.help */; };
@ -738,6 +740,7 @@
836EF0E027BB98A800BF35B2 /* libopus.0.dylib in CopyFiles */,
836EF0CB27BB91EE00BF35B2 /* libFLAC.8.dylib in CopyFiles */,
836EF0CA27BB91EB00BF35B2 /* libvorbis.0.dylib in CopyFiles */,
83256B69286661FC0036D9C0 /* libmpg123.0.dylib in CopyFiles */,
836EF0C927BB91E900BF35B2 /* libvorbisfile.3.dylib in CopyFiles */,
836EF0C827BB91E600BF35B2 /* libogg.0.dylib in CopyFiles */,
83AA7D07279EBCAF00087AA4 /* libswresample.4.dylib in CopyFiles */,
@ -921,6 +924,7 @@
83229C9C283B0095004626A8 /* SpectrumWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpectrumWindowController.h; sourceTree = "<group>"; };
83229C9D283B0095004626A8 /* SpectrumWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SpectrumWindowController.m; sourceTree = "<group>"; };
83229C9E283B0095004626A8 /* SpectrumWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SpectrumWindow.xib; sourceTree = "<group>"; };
83256B672866617F0036D9C0 /* libmpg123.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmpg123.0.dylib; path = ThirdParty/mpg123/lib/libmpg123.0.dylib; sourceTree = "<group>"; };
832923AE279FAC400048201E /* Cog.q1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Cog.q1.json; sourceTree = "<group>"; };
83293065277885790010C07E /* OpenMPTOld.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OpenMPTOld.xcodeproj; path = Plugins/OpenMPT.old/OpenMPTOld.xcodeproj; sourceTree = "<group>"; };
832C1252180BD1E2005507C1 /* Cog.help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Cog.help; sourceTree = "<group>"; };
@ -1096,6 +1100,7 @@
ED69CBC725BE32C00090B90D /* MASShortcut.framework in Frameworks */,
8355D6B8180613FB00D05687 /* Security.framework in Frameworks */,
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
83256B68286661FC0036D9C0 /* libmpg123.0.dylib in Frameworks */,
17BB5CED0B8A86010009ACB1 /* AudioToolbox.framework in Frameworks */,
835FAC7F27BCDF5B00BA8562 /* libavif.a in Frameworks */,
835FAC7E27BCDF5B00BA8562 /* libaom.a in Frameworks */,
@ -1155,6 +1160,7 @@
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
83256B672866617F0036D9C0 /* libmpg123.0.dylib */,
835FAC7C27BCDF5B00BA8562 /* libaom.a */,
835FAC7D27BCDF5B00BA8562 /* libavif.a */,
836EF0CD27BB94F100BF35B2 /* libopusfile.0.dylib */,
@ -2963,6 +2969,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/ThirdParty/avif/lib",
"$(PROJECT_DIR)/ThirdParty/mpg123/lib",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = (
@ -3015,6 +3022,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/ThirdParty/avif/lib",
"$(PROJECT_DIR)/ThirdParty/mpg123/lib",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = (

View File

@ -1,572 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
8313E31D1901FBDC00B4B6F1 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8313E31B1901FBDC00B4B6F1 /* InfoPlist.strings */; };
8313E38A1901FC3800B4B6F1 /* abi_align.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3461901FC3800B4B6F1 /* abi_align.h */; };
8313E38B1901FC3800B4B6F1 /* compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3471901FC3800B4B6F1 /* compat.c */; };
8313E38C1901FC3800B4B6F1 /* compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3481901FC3800B4B6F1 /* compat.h */; };
8313E38D1901FC3800B4B6F1 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3491901FC3800B4B6F1 /* config.h */; };
8313E3911901FC3800B4B6F1 /* dct64.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E34D1901FC3800B4B6F1 /* dct64.c */; };
8313E3921901FC3800B4B6F1 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E34E1901FC3800B4B6F1 /* debug.h */; };
8313E3931901FC3800B4B6F1 /* decode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E34F1901FC3800B4B6F1 /* decode.h */; };
8313E3951901FC3800B4B6F1 /* dither.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3511901FC3800B4B6F1 /* dither.h */; };
8313E3961901FC3800B4B6F1 /* equalizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3521901FC3800B4B6F1 /* equalizer.c */; };
8313E3981901FC3800B4B6F1 /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3541901FC3800B4B6F1 /* format.c */; };
8313E3991901FC3800B4B6F1 /* frame.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3551901FC3800B4B6F1 /* frame.c */; };
8313E39A1901FC3800B4B6F1 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3561901FC3800B4B6F1 /* frame.h */; };
8313E39B1901FC3800B4B6F1 /* gapless.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3571901FC3800B4B6F1 /* gapless.h */; };
8313E39C1901FC3800B4B6F1 /* getbits.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3581901FC3800B4B6F1 /* getbits.h */; };
8313E39D1901FC3800B4B6F1 /* getcpuflags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3591901FC3800B4B6F1 /* getcpuflags.h */; };
8313E39E1901FC3800B4B6F1 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E35A1901FC3800B4B6F1 /* huffman.h */; };
8313E3A01901FC3800B4B6F1 /* icy.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E35C1901FC3800B4B6F1 /* icy.h */; };
8313E3A21901FC3800B4B6F1 /* icy2utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E35E1901FC3800B4B6F1 /* icy2utf8.h */; };
8313E3A31901FC3800B4B6F1 /* id3.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E35F1901FC3800B4B6F1 /* id3.c */; };
8313E3A41901FC3800B4B6F1 /* id3.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3601901FC3800B4B6F1 /* id3.h */; };
8313E3A51901FC3800B4B6F1 /* index.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3611901FC3800B4B6F1 /* index.c */; };
8313E3A61901FC3800B4B6F1 /* index.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3621901FC3800B4B6F1 /* index.h */; };
8313E3A71901FC3800B4B6F1 /* intsym.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3631901FC3800B4B6F1 /* intsym.h */; };
8313E3A81901FC3800B4B6F1 /* l2tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3641901FC3800B4B6F1 /* l2tables.h */; };
8313E3A91901FC3800B4B6F1 /* l3_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3651901FC3800B4B6F1 /* l3_integer_tables.h */; };
8313E3AA1901FC3800B4B6F1 /* l12_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3661901FC3800B4B6F1 /* l12_integer_tables.h */; };
8313E3B01901FC3800B4B6F1 /* libmpg123.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E36C1901FC3800B4B6F1 /* libmpg123.c */; };
8313E3B11901FC3800B4B6F1 /* mangle.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E36D1901FC3800B4B6F1 /* mangle.h */; };
8313E3B21901FC3800B4B6F1 /* mpeghead.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E36E1901FC3800B4B6F1 /* mpeghead.h */; };
8313E3B31901FC3800B4B6F1 /* mpg123.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E36F1901FC3800B4B6F1 /* mpg123.h */; settings = {ATTRIBUTES = (Public, ); }; };
8313E3B41901FC3800B4B6F1 /* mpg123lib_intern.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3701901FC3800B4B6F1 /* mpg123lib_intern.h */; };
8313E3B51901FC3800B4B6F1 /* newhuffman.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3711901FC3800B4B6F1 /* newhuffman.h */; };
8313E3B71901FC3800B4B6F1 /* optimize.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3731901FC3800B4B6F1 /* optimize.c */; };
8313E3B81901FC3800B4B6F1 /* optimize.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3741901FC3800B4B6F1 /* optimize.h */; };
8313E3B91901FC3800B4B6F1 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3751901FC3800B4B6F1 /* parse.c */; };
8313E3BA1901FC3800B4B6F1 /* parse.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3761901FC3800B4B6F1 /* parse.h */; };
8313E3BB1901FC3800B4B6F1 /* reader.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3771901FC3800B4B6F1 /* reader.h */; };
8313E3BC1901FC3800B4B6F1 /* readers.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3781901FC3800B4B6F1 /* readers.c */; };
8313E3BD1901FC3800B4B6F1 /* sample.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3791901FC3800B4B6F1 /* sample.h */; };
8313E3C31901FC3800B4B6F1 /* synth_mono.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E37F1901FC3800B4B6F1 /* synth_mono.h */; };
8313E3C41901FC3800B4B6F1 /* synth_ntom.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3801901FC3800B4B6F1 /* synth_ntom.h */; };
8313E3C91901FC3800B4B6F1 /* synth.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3851901FC3800B4B6F1 /* synth.h */; };
8313E3CA1901FC3800B4B6F1 /* synths.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3861901FC3800B4B6F1 /* synths.h */; };
8313E3CB1901FC3800B4B6F1 /* tabinit.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3871901FC3800B4B6F1 /* tabinit.c */; };
8313E3CD1901FC3800B4B6F1 /* true.h in Headers */ = {isa = PBXBuildFile; fileRef = 8313E3891901FC3800B4B6F1 /* true.h */; };
8313E3D01902001600B4B6F1 /* icy.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3CE1902001600B4B6F1 /* icy.c */; };
8313E3D11902001600B4B6F1 /* icy2utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3CF1902001600B4B6F1 /* icy2utf8.c */; };
8313E3DB1902003100B4B6F1 /* dither.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D21902003100B4B6F1 /* dither.c */; };
8313E3DC1902003100B4B6F1 /* feature.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D31902003100B4B6F1 /* feature.c */; };
8313E3DD1902003100B4B6F1 /* layer1.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D41902003100B4B6F1 /* layer1.c */; };
8313E3DE1902003100B4B6F1 /* layer2.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D51902003100B4B6F1 /* layer2.c */; };
8313E3DF1902003100B4B6F1 /* layer3.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D61902003100B4B6F1 /* layer3.c */; };
8313E3E01902003100B4B6F1 /* ntom.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D71902003100B4B6F1 /* ntom.c */; };
8313E3E11902003100B4B6F1 /* stringbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D81902003100B4B6F1 /* stringbuf.c */; };
8313E3E21902003100B4B6F1 /* synth_real.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3D91902003100B4B6F1 /* synth_real.c */; };
8313E3E31902003100B4B6F1 /* synth.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3DA1902003100B4B6F1 /* synth.c */; };
8313E3E5190200D000B4B6F1 /* synth_s32.c in Sources */ = {isa = PBXBuildFile; fileRef = 8313E3E4190200D000B4B6F1 /* synth_s32.c */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
8313E30F1901FBDC00B4B6F1 /* mpg123.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = mpg123.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8313E31A1901FBDC00B4B6F1 /* mpg123-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "mpg123-Info.plist"; sourceTree = "<group>"; };
8313E31C1901FBDC00B4B6F1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8313E3461901FC3800B4B6F1 /* abi_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = abi_align.h; sourceTree = "<group>"; };
8313E3471901FC3800B4B6F1 /* compat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compat.c; sourceTree = "<group>"; };
8313E3481901FC3800B4B6F1 /* compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compat.h; sourceTree = "<group>"; };
8313E3491901FC3800B4B6F1 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
8313E34D1901FC3800B4B6F1 /* dct64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dct64.c; sourceTree = "<group>"; };
8313E34E1901FC3800B4B6F1 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; };
8313E34F1901FC3800B4B6F1 /* decode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decode.h; sourceTree = "<group>"; };
8313E3511901FC3800B4B6F1 /* dither.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = "<group>"; };
8313E3521901FC3800B4B6F1 /* equalizer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = equalizer.c; sourceTree = "<group>"; };
8313E3541901FC3800B4B6F1 /* format.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = format.c; sourceTree = "<group>"; };
8313E3551901FC3800B4B6F1 /* frame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = frame.c; sourceTree = "<group>"; };
8313E3561901FC3800B4B6F1 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = "<group>"; };
8313E3571901FC3800B4B6F1 /* gapless.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gapless.h; sourceTree = "<group>"; };
8313E3581901FC3800B4B6F1 /* getbits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getbits.h; sourceTree = "<group>"; };
8313E3591901FC3800B4B6F1 /* getcpuflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getcpuflags.h; sourceTree = "<group>"; };
8313E35A1901FC3800B4B6F1 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = "<group>"; };
8313E35C1901FC3800B4B6F1 /* icy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy.h; sourceTree = "<group>"; };
8313E35E1901FC3800B4B6F1 /* icy2utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy2utf8.h; sourceTree = "<group>"; };
8313E35F1901FC3800B4B6F1 /* id3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = id3.c; sourceTree = "<group>"; };
8313E3601901FC3800B4B6F1 /* id3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3.h; sourceTree = "<group>"; };
8313E3611901FC3800B4B6F1 /* index.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = index.c; sourceTree = "<group>"; };
8313E3621901FC3800B4B6F1 /* index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = index.h; sourceTree = "<group>"; };
8313E3631901FC3800B4B6F1 /* intsym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intsym.h; sourceTree = "<group>"; };
8313E3641901FC3800B4B6F1 /* l2tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = "<group>"; };
8313E3651901FC3800B4B6F1 /* l3_integer_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l3_integer_tables.h; sourceTree = "<group>"; };
8313E3661901FC3800B4B6F1 /* l12_integer_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l12_integer_tables.h; sourceTree = "<group>"; };
8313E36C1901FC3800B4B6F1 /* libmpg123.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libmpg123.c; sourceTree = "<group>"; };
8313E36D1901FC3800B4B6F1 /* mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mangle.h; sourceTree = "<group>"; };
8313E36E1901FC3800B4B6F1 /* mpeghead.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpeghead.h; sourceTree = "<group>"; };
8313E36F1901FC3800B4B6F1 /* mpg123.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = "<group>"; };
8313E3701901FC3800B4B6F1 /* mpg123lib_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123lib_intern.h; sourceTree = "<group>"; };
8313E3711901FC3800B4B6F1 /* newhuffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newhuffman.h; sourceTree = "<group>"; };
8313E3731901FC3800B4B6F1 /* optimize.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = optimize.c; sourceTree = "<group>"; };
8313E3741901FC3800B4B6F1 /* optimize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = optimize.h; sourceTree = "<group>"; };
8313E3751901FC3800B4B6F1 /* parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parse.c; sourceTree = "<group>"; };
8313E3761901FC3800B4B6F1 /* parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = "<group>"; };
8313E3771901FC3800B4B6F1 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; };
8313E3781901FC3800B4B6F1 /* readers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = readers.c; sourceTree = "<group>"; };
8313E3791901FC3800B4B6F1 /* sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample.h; sourceTree = "<group>"; };
8313E37F1901FC3800B4B6F1 /* synth_mono.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_mono.h; sourceTree = "<group>"; };
8313E3801901FC3800B4B6F1 /* synth_ntom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_ntom.h; sourceTree = "<group>"; };
8313E3851901FC3800B4B6F1 /* synth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth.h; sourceTree = "<group>"; };
8313E3861901FC3800B4B6F1 /* synths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synths.h; sourceTree = "<group>"; };
8313E3871901FC3800B4B6F1 /* tabinit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tabinit.c; sourceTree = "<group>"; };
8313E3891901FC3800B4B6F1 /* true.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = true.h; sourceTree = "<group>"; };
8313E3CE1902001600B4B6F1 /* icy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = icy.c; sourceTree = "<group>"; };
8313E3CF1902001600B4B6F1 /* icy2utf8.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = icy2utf8.c; sourceTree = "<group>"; };
8313E3D21902003100B4B6F1 /* dither.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dither.c; sourceTree = "<group>"; };
8313E3D31902003100B4B6F1 /* feature.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = feature.c; sourceTree = "<group>"; };
8313E3D41902003100B4B6F1 /* layer1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer1.c; sourceTree = "<group>"; };
8313E3D51902003100B4B6F1 /* layer2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer2.c; sourceTree = "<group>"; };
8313E3D61902003100B4B6F1 /* layer3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer3.c; sourceTree = "<group>"; };
8313E3D71902003100B4B6F1 /* ntom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ntom.c; sourceTree = "<group>"; };
8313E3D81902003100B4B6F1 /* stringbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stringbuf.c; sourceTree = "<group>"; };
8313E3D91902003100B4B6F1 /* synth_real.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_real.c; sourceTree = "<group>"; };
8313E3DA1902003100B4B6F1 /* synth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth.c; sourceTree = "<group>"; };
8313E3E4190200D000B4B6F1 /* synth_s32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_s32.c; sourceTree = "<group>"; };
833F684A1CDBCAC600AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8313E30B1901FBDC00B4B6F1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8313E3051901FBDC00B4B6F1 = {
isa = PBXGroup;
children = (
8313E3181901FBDC00B4B6F1 /* mpg123 */,
8313E3111901FBDC00B4B6F1 /* Frameworks */,
8313E3101901FBDC00B4B6F1 /* Products */,
);
sourceTree = "<group>";
};
8313E3101901FBDC00B4B6F1 /* Products */ = {
isa = PBXGroup;
children = (
8313E30F1901FBDC00B4B6F1 /* mpg123.framework */,
);
name = Products;
sourceTree = "<group>";
};
8313E3111901FBDC00B4B6F1 /* Frameworks */ = {
isa = PBXGroup;
children = (
8313E3141901FBDC00B4B6F1 /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
8313E3141901FBDC00B4B6F1 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
);
name = "Other Frameworks";
sourceTree = "<group>";
};
8313E3181901FBDC00B4B6F1 /* mpg123 */ = {
isa = PBXGroup;
children = (
8313E3E4190200D000B4B6F1 /* synth_s32.c */,
8313E3D21902003100B4B6F1 /* dither.c */,
8313E3D31902003100B4B6F1 /* feature.c */,
8313E3D41902003100B4B6F1 /* layer1.c */,
8313E3D51902003100B4B6F1 /* layer2.c */,
8313E3D61902003100B4B6F1 /* layer3.c */,
8313E3D71902003100B4B6F1 /* ntom.c */,
8313E3D81902003100B4B6F1 /* stringbuf.c */,
8313E3D91902003100B4B6F1 /* synth_real.c */,
8313E3DA1902003100B4B6F1 /* synth.c */,
8313E3CE1902001600B4B6F1 /* icy.c */,
8313E3CF1902001600B4B6F1 /* icy2utf8.c */,
8313E3461901FC3800B4B6F1 /* abi_align.h */,
8313E3471901FC3800B4B6F1 /* compat.c */,
8313E3481901FC3800B4B6F1 /* compat.h */,
8313E3491901FC3800B4B6F1 /* config.h */,
8313E34D1901FC3800B4B6F1 /* dct64.c */,
8313E34E1901FC3800B4B6F1 /* debug.h */,
8313E34F1901FC3800B4B6F1 /* decode.h */,
8313E3511901FC3800B4B6F1 /* dither.h */,
8313E3521901FC3800B4B6F1 /* equalizer.c */,
8313E3541901FC3800B4B6F1 /* format.c */,
8313E3551901FC3800B4B6F1 /* frame.c */,
8313E3561901FC3800B4B6F1 /* frame.h */,
8313E3571901FC3800B4B6F1 /* gapless.h */,
8313E3581901FC3800B4B6F1 /* getbits.h */,
8313E3591901FC3800B4B6F1 /* getcpuflags.h */,
8313E35A1901FC3800B4B6F1 /* huffman.h */,
8313E35C1901FC3800B4B6F1 /* icy.h */,
8313E35E1901FC3800B4B6F1 /* icy2utf8.h */,
8313E35F1901FC3800B4B6F1 /* id3.c */,
8313E3601901FC3800B4B6F1 /* id3.h */,
8313E3611901FC3800B4B6F1 /* index.c */,
8313E3621901FC3800B4B6F1 /* index.h */,
8313E3631901FC3800B4B6F1 /* intsym.h */,
8313E3641901FC3800B4B6F1 /* l2tables.h */,
8313E3651901FC3800B4B6F1 /* l3_integer_tables.h */,
8313E3661901FC3800B4B6F1 /* l12_integer_tables.h */,
8313E36C1901FC3800B4B6F1 /* libmpg123.c */,
8313E36D1901FC3800B4B6F1 /* mangle.h */,
8313E36E1901FC3800B4B6F1 /* mpeghead.h */,
8313E36F1901FC3800B4B6F1 /* mpg123.h */,
8313E3701901FC3800B4B6F1 /* mpg123lib_intern.h */,
8313E3711901FC3800B4B6F1 /* newhuffman.h */,
8313E3731901FC3800B4B6F1 /* optimize.c */,
8313E3741901FC3800B4B6F1 /* optimize.h */,
8313E3751901FC3800B4B6F1 /* parse.c */,
8313E3761901FC3800B4B6F1 /* parse.h */,
8313E3771901FC3800B4B6F1 /* reader.h */,
8313E3781901FC3800B4B6F1 /* readers.c */,
8313E3791901FC3800B4B6F1 /* sample.h */,
8313E37F1901FC3800B4B6F1 /* synth_mono.h */,
8313E3801901FC3800B4B6F1 /* synth_ntom.h */,
8313E3851901FC3800B4B6F1 /* synth.h */,
8313E3861901FC3800B4B6F1 /* synths.h */,
8313E3871901FC3800B4B6F1 /* tabinit.c */,
8313E3891901FC3800B4B6F1 /* true.h */,
8313E3191901FBDC00B4B6F1 /* Supporting Files */,
);
path = mpg123;
sourceTree = "<group>";
};
8313E3191901FBDC00B4B6F1 /* Supporting Files */ = {
isa = PBXGroup;
children = (
8313E31A1901FBDC00B4B6F1 /* mpg123-Info.plist */,
8313E31B1901FBDC00B4B6F1 /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
8313E30C1901FBDC00B4B6F1 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
8313E3B31901FC3800B4B6F1 /* mpg123.h in Headers */,
8313E3A01901FC3800B4B6F1 /* icy.h in Headers */,
8313E3B51901FC3800B4B6F1 /* newhuffman.h in Headers */,
8313E3BB1901FC3800B4B6F1 /* reader.h in Headers */,
8313E3A41901FC3800B4B6F1 /* id3.h in Headers */,
8313E3B21901FC3800B4B6F1 /* mpeghead.h in Headers */,
8313E3CA1901FC3800B4B6F1 /* synths.h in Headers */,
8313E3B81901FC3800B4B6F1 /* optimize.h in Headers */,
8313E3C31901FC3800B4B6F1 /* synth_mono.h in Headers */,
8313E3C41901FC3800B4B6F1 /* synth_ntom.h in Headers */,
8313E3A81901FC3800B4B6F1 /* l2tables.h in Headers */,
8313E3A71901FC3800B4B6F1 /* intsym.h in Headers */,
8313E39A1901FC3800B4B6F1 /* frame.h in Headers */,
8313E3A91901FC3800B4B6F1 /* l3_integer_tables.h in Headers */,
8313E3B11901FC3800B4B6F1 /* mangle.h in Headers */,
8313E39C1901FC3800B4B6F1 /* getbits.h in Headers */,
8313E3BD1901FC3800B4B6F1 /* sample.h in Headers */,
8313E39E1901FC3800B4B6F1 /* huffman.h in Headers */,
8313E39D1901FC3800B4B6F1 /* getcpuflags.h in Headers */,
8313E3A61901FC3800B4B6F1 /* index.h in Headers */,
8313E3C91901FC3800B4B6F1 /* synth.h in Headers */,
8313E3921901FC3800B4B6F1 /* debug.h in Headers */,
8313E38C1901FC3800B4B6F1 /* compat.h in Headers */,
8313E3AA1901FC3800B4B6F1 /* l12_integer_tables.h in Headers */,
8313E3951901FC3800B4B6F1 /* dither.h in Headers */,
8313E3A21901FC3800B4B6F1 /* icy2utf8.h in Headers */,
8313E3BA1901FC3800B4B6F1 /* parse.h in Headers */,
8313E3B41901FC3800B4B6F1 /* mpg123lib_intern.h in Headers */,
8313E38A1901FC3800B4B6F1 /* abi_align.h in Headers */,
8313E3CD1901FC3800B4B6F1 /* true.h in Headers */,
8313E3931901FC3800B4B6F1 /* decode.h in Headers */,
8313E39B1901FC3800B4B6F1 /* gapless.h in Headers */,
8313E38D1901FC3800B4B6F1 /* config.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
8313E30E1901FBDC00B4B6F1 /* mpg123 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8313E3371901FBDC00B4B6F1 /* Build configuration list for PBXNativeTarget "mpg123" */;
buildPhases = (
8313E30A1901FBDC00B4B6F1 /* Sources */,
8313E30B1901FBDC00B4B6F1 /* Frameworks */,
8313E30C1901FBDC00B4B6F1 /* Headers */,
8313E30D1901FBDC00B4B6F1 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = mpg123;
productName = mpg123;
productReference = 8313E30F1901FBDC00B4B6F1 /* mpg123.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
8313E3061901FBDC00B4B6F1 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1400;
ORGANIZATIONNAME = "Christopher Snowhill";
TargetAttributes = {
8313E30E1901FBDC00B4B6F1 = {
DevelopmentTeam = "";
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 8313E3091901FBDC00B4B6F1 /* Build configuration list for PBXProject "mpg123" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
es,
Base,
);
mainGroup = 8313E3051901FBDC00B4B6F1;
productRefGroup = 8313E3101901FBDC00B4B6F1 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8313E30E1901FBDC00B4B6F1 /* mpg123 */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8313E30D1901FBDC00B4B6F1 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8313E31D1901FBDC00B4B6F1 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8313E30A1901FBDC00B4B6F1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8313E3DE1902003100B4B6F1 /* layer2.c in Sources */,
8313E3E21902003100B4B6F1 /* synth_real.c in Sources */,
8313E3CB1901FC3800B4B6F1 /* tabinit.c in Sources */,
8313E3961901FC3800B4B6F1 /* equalizer.c in Sources */,
8313E3911901FC3800B4B6F1 /* dct64.c in Sources */,
8313E3A51901FC3800B4B6F1 /* index.c in Sources */,
8313E3E31902003100B4B6F1 /* synth.c in Sources */,
8313E3A31901FC3800B4B6F1 /* id3.c in Sources */,
8313E3B71901FC3800B4B6F1 /* optimize.c in Sources */,
8313E3B01901FC3800B4B6F1 /* libmpg123.c in Sources */,
8313E3DC1902003100B4B6F1 /* feature.c in Sources */,
8313E3BC1901FC3800B4B6F1 /* readers.c in Sources */,
8313E3DB1902003100B4B6F1 /* dither.c in Sources */,
8313E3E01902003100B4B6F1 /* ntom.c in Sources */,
8313E3D01902001600B4B6F1 /* icy.c in Sources */,
8313E3B91901FC3800B4B6F1 /* parse.c in Sources */,
8313E3DD1902003100B4B6F1 /* layer1.c in Sources */,
8313E3981901FC3800B4B6F1 /* format.c in Sources */,
8313E3991901FC3800B4B6F1 /* frame.c in Sources */,
8313E3DF1902003100B4B6F1 /* layer3.c in Sources */,
8313E3D11902001600B4B6F1 /* icy2utf8.c in Sources */,
8313E3E11902003100B4B6F1 /* stringbuf.c in Sources */,
8313E3E5190200D000B4B6F1 /* synth_s32.c in Sources */,
8313E38B1901FC3800B4B6F1 /* compat.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
8313E31B1901FBDC00B4B6F1 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
8313E31C1901FBDC00B4B6F1 /* en */,
833F684A1CDBCAC600AFB9F0 /* es */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
8313E3351901FBDC00B4B6F1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "@loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = YES;
SKIP_INSTALL = YES;
};
name = Debug;
};
8313E3361901FBDC00B4B6F1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "@loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
SKIP_INSTALL = YES;
};
name = Release;
};
8313E3381901FBDC00B4B6F1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_WARN_INHIBIT_ALL_WARNINGS = YES;
INFOPLIST_FILE = "mpg123/mpg123-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "NoWork-Inc.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
WRAPPER_EXTENSION = framework;
};
name = Debug;
};
8313E3391901FBDC00B4B6F1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_WARN_INHIBIT_ALL_WARNINGS = YES;
INFOPLIST_FILE = "mpg123/mpg123-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "NoWork-Inc.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = framework;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
8313E3091901FBDC00B4B6F1 /* Build configuration list for PBXProject "mpg123" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8313E3351901FBDC00B4B6F1 /* Debug */,
8313E3361901FBDC00B4B6F1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8313E3371901FBDC00B4B6F1 /* Build configuration list for PBXNativeTarget "mpg123" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8313E3381901FBDC00B4B6F1 /* Debug */,
8313E3391901FBDC00B4B6F1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 8313E3061901FBDC00B4B6F1 /* Project object */;
}

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8313E30E1901FBDC00B4B6F1"
BuildableName = "mpg123.framework"
BlueprintName = "mpg123"
ReferencedContainer = "container:mpg123.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8313E30E1901FBDC00B4B6F1"
BuildableName = "mpg123.framework"
BlueprintName = "mpg123"
ReferencedContainer = "container:mpg123.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8313E30E1901FBDC00B4B6F1"
BuildableName = "mpg123.framework"
BlueprintName = "mpg123"
ReferencedContainer = "container:mpg123.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,138 +0,0 @@
/*
compat: Some compatibility functions.
The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX.
So anything possibly somewhat advanced should be considered to be put here, with proper #ifdef;-)
copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis, Windows Unicode stuff by JonY.
*/
#include "config.h"
#include "compat.h"
#ifdef _MSC_VER
#include <io.h>
#else
#include <fcntl.h>
#endif
#include <sys/stat.h>
#ifdef WANT_WIN32_UNICODE
#include <wchar.h>
#include <windows.h>
#include <winnls.h>
#endif
#include "debug.h"
/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */
void *safe_realloc(void *ptr, size_t size)
{
if(ptr == NULL) return malloc(size);
else return realloc(ptr, size);
}
#ifndef HAVE_STRERROR
const char *strerror(int errnum)
{
extern int sys_nerr;
extern char *sys_errlist[];
return (errnum < sys_nerr) ? sys_errlist[errnum] : "";
}
#endif
#ifndef HAVE_STRDUP
char *strdup(const char *src)
{
char *dest;
if (!(dest = (char *) malloc(strlen(src)+1)))
return NULL;
else
return strcpy(dest, src);
}
#endif
int compat_open(const char *filename, int flags)
{
int ret;
#if defined (WANT_WIN32_UNICODE)
wchar_t *frag = NULL;
ret = win32_utf8_wide(filename, &frag, NULL);
if ((frag == NULL) || (ret == 0)) goto fallback; /* Fallback to plain open when ucs-2 conversion fails */
ret = _wopen(frag, flags); /*Try _wopen */
if (ret != -1 ) goto open_ok; /* msdn says -1 means failure */
fallback:
#endif
#if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */
ret = _open(filename, flags); /* Try plain old _open(), if it fails, do nothing */
#else
/* On UNIX, we always add a default permission mask in case flags|O_CREAT. */
ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
#endif
#if defined (WANT_WIN32_UNICODE)
open_ok:
free ((void *)frag); /* Freeing a NULL should be OK */
#endif
return ret;
}
int compat_close(int infd)
{
#if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */
return _close(infd);
#else
return close(infd);
#endif
}
/* Windows Unicode stuff */
#ifdef WANT_WIN32_UNICODE
int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen)
{
size_t len;
char *buf;
int ret = 0;
len = WideCharToMultiByte(CP_UTF8, 0, wptr, -1, NULL, 0, NULL, NULL); /* Get utf-8 string length */
buf = calloc(len + 1, sizeof (char)); /* Can we assume sizeof char always = 1? */
if(!buf) len = 0;
else {
if (len != 0) ret = WideCharToMultiByte(CP_UTF8, 0, wptr, -1, buf, len, NULL, NULL); /*Do actual conversion*/
buf[len] = '0'; /* Must terminate */
}
*mbptr = buf; /* Set string pointer to allocated buffer */
if(buflen != NULL) *buflen = (len) * sizeof (char); /* Give length of allocated memory if needed. */
return ret;
}
int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen)
{
size_t len;
wchar_t *buf;
int ret = 0;
len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, NULL, 0); /* Get converted size */
buf = calloc(len + 1, sizeof (wchar_t)); /* Allocate memory accordingly */
if(!buf) len = 0;
else {
if (len != 0) ret = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, buf, len); /* Do conversion */
buf[len] = L'0'; /* Must terminate */
}
*wptr = buf; /* Set string pointer to allocated buffer */
if (buflen != NULL) *buflen = len * sizeof (wchar_t); /* Give length of allocated memory if needed. */
return ret; /* Number of characters written */
}
#endif

View File

@ -1,183 +0,0 @@
/*
compat: Some compatibility functions and header inclusions.
Basic standard C stuff, that may barely be above/around C89.
The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX.
It is envisioned to include this compat header instead of any of the "standard" headers, to catch compatibility issues.
So, don't include stdlib.h or string.h ... include compat.h.
copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
*/
#ifndef MPG123_COMPAT_H
#define MPG123_COMPAT_H
#include "config.h"
#include "intsym.h"
#ifdef HAVE_STDLIB_H
/* realloc, size_t */
#include <stdlib.h>
#endif
#include <stdio.h>
#include <math.h>
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#else
#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
/* Types, types, types. */
/* Do we actually need these two in addition to sys/types.h? As replacement? */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
/* We want SIZE_MAX, etc. */
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#endif
#ifndef ULONG_MAX
#define ULONG_MAX ((unsigned long)-1)
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef OS2
#include <float.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
/* For select(), I need select.h according to POSIX 2001, else: sys/time.h sys/types.h unistd.h */
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
/* compat_open makes little sense without */
#include <fcntl.h>
/* To parse big numbers... */
#ifdef HAVE_ATOLL
#define atobigint atoll
#else
#define atobigint atol
#endif
typedef unsigned char byte;
/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */
void *safe_realloc(void *ptr, size_t size);
#ifndef HAVE_STRERROR
const char *strerror(int errnum);
#endif
#ifndef HAVE_STRDUP
char *strdup(const char *s);
#endif
/* If we have the size checks enabled, try to derive some sane printfs.
Simple start: Use max integer type and format if long is not big enough.
I am hesitating to use %ll without making sure that it's there... */
#if !(defined PLAIN_C89) && (defined SIZEOF_OFF_T) && (SIZEOF_OFF_T > SIZEOF_LONG) && (defined PRIiMAX)
# define OFF_P PRIiMAX
typedef intmax_t off_p;
#else
# define OFF_P "li"
typedef long off_p;
#endif
#if !(defined PLAIN_C89) && (defined SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > SIZEOF_LONG) && (defined PRIuMAX)
# define SIZE_P PRIuMAX
typedef uintmax_t size_p;
#else
# define SIZE_P "lu"
typedef unsigned long size_p;
#endif
#if !(defined PLAIN_C89) && (defined SIZEOF_SSIZE_T) && (SIZEOF_SSIZE_T > SIZEOF_LONG) && (defined PRIiMAX)
# define SSIZE_P PRIuMAX
typedef intmax_t ssize_p;
#else
# define SSIZE_P "li"
typedef long ssize_p;
#endif
/**
* Opening a file handle can be different.
* This function here is defined to take a path in native encoding (ISO8859 / UTF-8 / ...), or, when MS Windows Unicode support is enabled, an UTF-8 string that will be converted back to native UCS-2 (wide character) before calling the system's open function.
* @param[in] wptr Pointer to wide string.
* @param[in] mbptr Pointer to multibyte string.
* @return file descriptor (>=0) or error code.
*/
int compat_open(const char *filename, int flags);
/**
* Closing a file handle can be platform specific.
* This function takes a file descriptor that is to be closed.
* @param[in] infd File descriptor to be closed.
* @return 0 if the file was successfully closed. A return value of -1 indicates an error.
*/
int compat_close(int infd);
/* Those do make sense in a separate file, but I chose to include them in compat.c because that's the one source whose object is shared between mpg123 and libmpg123 -- and both need the functionality internally. */
#ifdef WANT_WIN32_UNICODE
/**
* win32_uni2mbc
* Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent.
* Caller is supposed to free allocated buffer.
* @param[in] wptr Pointer to wide string.
* @param[out] mbptr Pointer to multibyte string.
* @param[out] buflen Optional parameter for length of allocated buffer.
* @return status of WideCharToMultiByte conversion.
*
* WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx
*/
int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen);
/**
* win32_mbc2uni
* Converts a null terminated UTF-8 string to a UCS-2 equivalent.
* Caller is supposed to free allocated buffer.
* @param[out] mbptr Pointer to multibyte string.
* @param[in] wptr Pointer to wide string.
* @param[out] buflen Optional parameter for length of allocated buffer.
* @return status of WideCharToMultiByte conversion.
*
* MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx
*/
int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen);
#endif
/* That one comes from Tellie on OS/2, needed in resolver. */
#ifdef __KLIBC__
typedef int socklen_t;
#endif
#include "true.h"
#endif

View File

@ -1,457 +0,0 @@
/* src/config.h. Generated from config.h.in by configure. */
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* Define if your architecture wants/needs/can use attribute_align_arg and
alignment checks. It is for 32bit x86... */
/* #undef ABI_ALIGN_FUN */
/* Define to use proper rounding. */
/* #undef ACCURATE_ROUNDING */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Define if .balign is present. */
#define ASMALIGN_BALIGN 1
/* Define if .align just takes byte count. */
/* #undef ASMALIGN_BYTE */
/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */
/* #undef ASMALIGN_EXP */
/* Define if __attribute__((aligned(16))) shall be used */
/* #undef CCALIGN */
/* Define if debugging is enabled. */
/* #undef DEBUG */
/* The default audio output module(s) to use */
#define DEFAULT_OUTPUT_MODULE "dummy"
/* Define if building with dynamcally linked libmpg123 */
#define DYNAMIC_BUILD 1
/* Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter */
/* #undef EOVERFLOW */
/* Define if FIFO support is enabled. */
#define FIFO 1
/* Define if frame index should be used. */
#define FRAME_INDEX 1
/* Define if gapless is enabled. */
#define GAPLESS 1
/* Define to 1 if you have the <alc.h> header file. */
/* #undef HAVE_ALC_H */
/* Define to 1 if you have the <Alib.h> header file. */
/* #undef HAVE_ALIB_H */
/* Define to 1 if you have the <AL/alc.h> header file. */
/* #undef HAVE_AL_ALC_H */
/* Define to 1 if you have the <AL/al.h> header file. */
/* #undef HAVE_AL_AL_H */
/* Define to 1 if you have the <al.h> header file. */
/* #undef HAVE_AL_H */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the <asm/audioio.h> header file. */
/* #undef HAVE_ASM_AUDIOIO_H */
/* Define to 1 if you have the `atoll' function. */
#define HAVE_ATOLL 1
/* Define to 1 if you have the <audios.h> header file. */
/* #undef HAVE_AUDIOS_H */
/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */
/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */
/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */
/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */
/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */
/* #undef HAVE_CORESERVICES_CORESERVICES_H */
/* Define to 1 if you have the <CUlib.h> header file. */
/* #undef HAVE_CULIB_H */
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */
#define HAVE_GAI_ADDRCONFIG 1
/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `getuid' function. */
#define HAVE_GETUID 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <langinfo.h> header file. */
#define HAVE_LANGINFO_H 1
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the `mx' library (-lmx). */
/* #undef HAVE_LIBMX */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <linux/soundcard.h> header file. */
/* #undef HAVE_LINUX_SOUNDCARD_H */
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define if libltdl is available */
/* #undef HAVE_LTDL */
/* Define to 1 if you have the <machine/soundcard.h> header file. */
/* #undef HAVE_MACHINE_SOUNDCARD_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkfifo' function. */
#define HAVE_MKFIFO 1
/* Define to 1 if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <netinet/tcp.h> header file. */
/* #undef HAVE_NETINET_TCP_H */
/* Define to 1 if you have the `nl_langinfo' function. */
#define HAVE_NL_LANGINFO 1
/* Define to 1 if you have the <OpenAL/alc.h> header file. */
/* #undef HAVE_OPENAL_ALC_H */
/* Define to 1 if you have the <OpenAL/al.h> header file. */
/* #undef HAVE_OPENAL_AL_H */
/* Define to 1 if you have the <os2me.h> header file. */
/* #undef HAVE_OS2ME_H */
/* Define to 1 if you have the <os2.h> header file. */
/* #undef HAVE_OS2_H */
/* Define to 1 if you have the `random' function. */
#define HAVE_RANDOM 1
/* Define to 1 if you have the <sched.h> header file. */
#define HAVE_SCHED_H 1
/* Define to 1 if you have the `sched_setscheduler' function. */
#define HAVE_SCHED_SETSCHEDULER 1
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
/* Define to 1 if you have the `setpriority' function. */
#define HAVE_SETPRIORITY 1
/* Define to 1 if you have the `setuid' function. */
#define HAVE_SETUID 1
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if you have the <sndio.h> header file. */
/* #undef HAVE_SNDIO_H */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sun/audioio.h> header file. */
/* #undef HAVE_SUN_AUDIOIO_H */
/* Define to 1 if you have the <sys/audioio.h> header file. */
/* #undef HAVE_SYS_AUDIOIO_H */
/* Define to 1 if you have the <sys/audio.h> header file. */
/* #undef HAVE_SYS_AUDIO_H */
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/signal.h> header file. */
#define HAVE_SYS_SIGNAL_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/soundcard.h> header file. */
/* #undef HAVE_SYS_SOUNDCARD_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
/* Define this if you have the POSIX termios library */
#define HAVE_TERMIOS 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */
/* Define to 1 if you have the <ws2tcpip.h> header file. */
/* #undef HAVE_WS2TCPIP_H */
/* Define to indicate that float storage follows IEEE754. */
#define IEEE_FLOAT 1
/* size of the frame index seek table */
#define INDEX_SIZE 1000
/* Define if IPV6 support is enabled. */
#define IPV6 1
/* Define this to the size of native offset type in bits, used for LFS alias
functions. */
#define LFS_ALIAS_BITS 32
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* The suffix for module files. */
#define MODULE_FILE_SUFFIX ".la"
/* Define if network support is enabled. */
/* #undef NETWORK */
/* Define to disable 16 bit integer output. */
/* #undef NO_16BIT */
/* Define to disable 32 bit and 24 bit integer output. */
/* #undef NO_32BIT */
/* Define to disable 8 bit integer output. */
#define NO_8BIT
/* Define to disable downsampled decoding. */
#define NO_DOWNSAMPLE
/* Define to disable error messages in combination with a return value (the
return is left intact). */
/* #undef NO_ERETURN */
/* Define to disable error messages. */
/* #undef NO_ERRORMSG */
/* Define to disable feeder and buffered readers. */
/* #undef NO_FEEDER */
/* Define to disable ICY handling. */
#define NO_ICY
/* Define to disable ID3v2 parsing. */
#define NO_ID3V2
/* Define to disable layer I. */
/* #undef NO_LAYER1 */
/* Define to disable layer II. */
/* #undef NO_LAYER2 */
/* Define to disable layer III. */
/* #undef NO_LAYER3 */
/* Define to disable ntom resampling. */
/* #undef NO_NTOM */
/* Define to disable real output. */
/* #undef NO_REAL */
/* Define to disable string functions. */
/* #undef NO_STRING */
/* Define to disable warning messages. */
/* #undef NO_WARNING */
/* Name of package */
#define PACKAGE "mpg123"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net"
/* Define to the full name of this package. */
#define PACKAGE_NAME "mpg123"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "mpg123 1.16.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "mpg123"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.16.0"
/* Define if portaudio v18 API is wanted. */
/* #undef PORTAUDIO18 */
/* The size of `int32_t', as computed by sizeof. */
#define SIZEOF_INT32_T 4
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 8
/* The size of `off_t', as computed by sizeof. */
#define SIZEOF_OFF_T 8
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 8
/* The size of `ssize_t', as computed by sizeof. */
#define SIZEOF_SSIZE_T 8
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if modules are enabled */
/* #undef USE_MODULES */
/* Define for new Huffman decoding scheme. */
#define USE_NEW_HUFFTABLE 1
/* Define to use yasm for assemble AVX sources. */
/* #undef USE_YASM_FOR_AVX */
/* Version number of package */
#define VERSION "1.16.0"
/* Define to use Win32 named pipes */
/* #undef WANT_WIN32_FIFO */
/* Define to use Win32 sockets */
/* #undef WANT_WIN32_SOCKETS */
/* Define to use Unicode for Windows */
/* #undef WANT_WIN32_UNICODE */
/* WinXP and above for ipv6 */
/* #undef WINVER */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* WinXP and above for ipv6 */
/* #undef _WIN32_WINNT */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `short' if <sys/types.h> does not define. */
/* #undef int16_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef int32_t */
/* Define to the native offset type (long or actually off_t). */
#define lfs_alias_t off_t
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned long' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to `long' if <sys/types.h> does not define. */
/* #undef ssize_t */
/* Define to `unsigned short' if <sys/types.h> does not define. */
/* #undef uint16_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef uint32_t */
/* Define to `unsigned long' if <sys/types.h> does not define. */
/* #undef uintptr_t */
#define OPT_GENERIC

View File

@ -1,174 +0,0 @@
/*
dct64.c: DCT64, the plain C version
copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
*/
/*
* Discrete Cosine Tansform (DCT) for subband synthesis
*
* -funroll-loops (for gcc) will remove the loops for better performance
* using loops in the source-code enhances readabillity
*
*
* TODO: write an optimized version for the down-sampling modes
* (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero
*/
#include "mpg123lib_intern.h"
void dct64(real *out0,real *out1,real *samples)
{
real bufs[64];
{
register int i,j;
register real *b1,*b2,*bs,*costab;
b1 = samples;
bs = bufs;
costab = pnts[0]+16;
b2 = b1 + 32;
for(i=15;i>=0;i--)
*bs++ = (*b1++ + *--b2);
for(i=15;i>=0;i--)
*bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
b1 = bufs;
costab = pnts[1]+8;
b2 = b1 + 16;
{
for(i=7;i>=0;i--)
*bs++ = (*b1++ + *--b2);
for(i=7;i>=0;i--)
*bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
b2 += 32;
costab += 8;
for(i=7;i>=0;i--)
*bs++ = (*b1++ + *--b2);
for(i=7;i>=0;i--)
*bs++ = REAL_MUL((*b1++ - *--b2), *--costab);
b2 += 32;
}
bs = bufs;
costab = pnts[2];
b2 = b1 + 8;
for(j=2;j;j--)
{
for(i=3;i>=0;i--)
*bs++ = (*b1++ + *--b2);
for(i=3;i>=0;i--)
*bs++ = REAL_MUL((*--b2 - *b1++), costab[i]);
b2 += 16;
for(i=3;i>=0;i--)
*bs++ = (*b1++ + *--b2);
for(i=3;i>=0;i--)
*bs++ = REAL_MUL((*b1++ - *--b2), costab[i]);
b2 += 16;
}
b1 = bufs;
costab = pnts[3];
b2 = b1 + 4;
for(j=4;j;j--)
{
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
*bs++ = REAL_MUL((*--b2 - *b1++), costab[1]);
*bs++ = REAL_MUL((*--b2 - *b1++), costab[0]);
b2 += 8;
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
*bs++ = REAL_MUL((*b1++ - *--b2), costab[1]);
*bs++ = REAL_MUL((*b1++ - *--b2), costab[0]);
b2 += 8;
}
bs = bufs;
costab = pnts[4];
for(j=8;j;j--)
{
real v0,v1;
v0=*b1++; v1 = *b1++;
*bs++ = (v0 + v1);
*bs++ = REAL_MUL((v0 - v1), (*costab));
v0=*b1++; v1 = *b1++;
*bs++ = (v0 + v1);
*bs++ = REAL_MUL((v1 - v0), (*costab));
}
}
{
register real *b1;
register int i;
for(b1=bufs,i=8;i;i--,b1+=4)
b1[2] += b1[3];
for(b1=bufs,i=4;i;i--,b1+=8)
{
b1[4] += b1[6];
b1[6] += b1[5];
b1[5] += b1[7];
}
for(b1=bufs,i=2;i;i--,b1+=16)
{
b1[8] += b1[12];
b1[12] += b1[10];
b1[10] += b1[14];
b1[14] += b1[9];
b1[9] += b1[13];
b1[13] += b1[11];
b1[11] += b1[15];
}
}
out0[0x10*16] = REAL_SCALE_DCT64(bufs[0]);
out0[0x10*15] = REAL_SCALE_DCT64(bufs[16+0] + bufs[16+8]);
out0[0x10*14] = REAL_SCALE_DCT64(bufs[8]);
out0[0x10*13] = REAL_SCALE_DCT64(bufs[16+8] + bufs[16+4]);
out0[0x10*12] = REAL_SCALE_DCT64(bufs[4]);
out0[0x10*11] = REAL_SCALE_DCT64(bufs[16+4] + bufs[16+12]);
out0[0x10*10] = REAL_SCALE_DCT64(bufs[12]);
out0[0x10* 9] = REAL_SCALE_DCT64(bufs[16+12] + bufs[16+2]);
out0[0x10* 8] = REAL_SCALE_DCT64(bufs[2]);
out0[0x10* 7] = REAL_SCALE_DCT64(bufs[16+2] + bufs[16+10]);
out0[0x10* 6] = REAL_SCALE_DCT64(bufs[10]);
out0[0x10* 5] = REAL_SCALE_DCT64(bufs[16+10] + bufs[16+6]);
out0[0x10* 4] = REAL_SCALE_DCT64(bufs[6]);
out0[0x10* 3] = REAL_SCALE_DCT64(bufs[16+6] + bufs[16+14]);
out0[0x10* 2] = REAL_SCALE_DCT64(bufs[14]);
out0[0x10* 1] = REAL_SCALE_DCT64(bufs[16+14] + bufs[16+1]);
out0[0x10* 0] = REAL_SCALE_DCT64(bufs[1]);
out1[0x10* 0] = REAL_SCALE_DCT64(bufs[1]);
out1[0x10* 1] = REAL_SCALE_DCT64(bufs[16+1] + bufs[16+9]);
out1[0x10* 2] = REAL_SCALE_DCT64(bufs[9]);
out1[0x10* 3] = REAL_SCALE_DCT64(bufs[16+9] + bufs[16+5]);
out1[0x10* 4] = REAL_SCALE_DCT64(bufs[5]);
out1[0x10* 5] = REAL_SCALE_DCT64(bufs[16+5] + bufs[16+13]);
out1[0x10* 6] = REAL_SCALE_DCT64(bufs[13]);
out1[0x10* 7] = REAL_SCALE_DCT64(bufs[16+13] + bufs[16+3]);
out1[0x10* 8] = REAL_SCALE_DCT64(bufs[3]);
out1[0x10* 9] = REAL_SCALE_DCT64(bufs[16+3] + bufs[16+11]);
out1[0x10*10] = REAL_SCALE_DCT64(bufs[11]);
out1[0x10*11] = REAL_SCALE_DCT64(bufs[16+11] + bufs[16+7]);
out1[0x10*12] = REAL_SCALE_DCT64(bufs[7]);
out1[0x10*13] = REAL_SCALE_DCT64(bufs[16+7] + bufs[16+15]);
out1[0x10*14] = REAL_SCALE_DCT64(bufs[15]);
out1[0x10*15] = REAL_SCALE_DCT64(bufs[16+15]);
}

View File

@ -1,171 +0,0 @@
/*
debug.h:
if DEBUG defined: debugging macro fprintf wrappers
else: macros defined to do nothing
That saves typing #ifdef DEBUG all the time and still preserves
lean code without debugging.
public domain (or LGPL / GPL, if you like that more;-)
generated by debugdef.pl, what was
trivially written by Thomas Orgis <thomas@orgis.org>
*/
#include "config.h"
/*
I could do that with variadic macros available:
#define sdebug(me, s) fprintf(stderr, "[location] " s "\n")
#define debug(me, s, ...) fprintf(stderr, "[location] " s "}n", __VA_ARGS__)
Variadic macros are a C99 feature...
Now just predefining stuff non-variadic for up to 15 arguments.
It's cumbersome to have them all with different names, though...
*/
#ifdef DEBUG
#include <stdio.h>
#define debug(s) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__)
#define debug1(s, a) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a)
#define debug2(s, a, b) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b)
#define debug3(s, a, b, c) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c)
#define debug4(s, a, b, c, d) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d)
#define debug5(s, a, b, c, d, e) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e)
#define debug6(s, a, b, c, d, e, f) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f)
#define debug7(s, a, b, c, d, e, f, g) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g)
#define debug8(s, a, b, c, d, e, f, g, h) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h)
#define debug9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i)
#define debug10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j)
#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k)
#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l)
#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#else
#define debug(s)
#define debug1(s, a)
#define debug2(s, a, b)
#define debug3(s, a, b, c)
#define debug4(s, a, b, c, d)
#define debug5(s, a, b, c, d, e)
#define debug6(s, a, b, c, d, e, f)
#define debug7(s, a, b, c, d, e, f, g)
#define debug8(s, a, b, c, d, e, f, g, h)
#define debug9(s, a, b, c, d, e, f, g, h, i)
#define debug10(s, a, b, c, d, e, f, g, h, i, j)
#define debug11(s, a, b, c, d, e, f, g, h, i, j, k)
#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l)
#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#endif
/* warning macros also here... */
#ifndef NO_WARNING
#define warning(s) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__)
#define warning1(s, a) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a)
#define warning2(s, a, b) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b)
#define warning3(s, a, b, c) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c)
#define warning4(s, a, b, c, d) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d)
#define warning5(s, a, b, c, d, e) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e)
#define warning6(s, a, b, c, d, e, f) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f)
#define warning7(s, a, b, c, d, e, f, g) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g)
#define warning8(s, a, b, c, d, e, f, g, h) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h)
#define warning9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i)
#define warning10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j)
#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k)
#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l)
#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#else
#define warning(s)
#define warning1(s, a)
#define warning2(s, a, b)
#define warning3(s, a, b, c)
#define warning4(s, a, b, c, d)
#define warning5(s, a, b, c, d, e)
#define warning6(s, a, b, c, d, e, f)
#define warning7(s, a, b, c, d, e, f, g)
#define warning8(s, a, b, c, d, e, f, g, h)
#define warning9(s, a, b, c, d, e, f, g, h, i)
#define warning10(s, a, b, c, d, e, f, g, h, i, j)
#define warning11(s, a, b, c, d, e, f, g, h, i, j, k)
#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l)
#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#endif
/* error macros also here... */
#ifndef NO_ERRORMSG
#define error(s) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__)
#define error1(s, a) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a)
#define error2(s, a, b) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b)
#define error3(s, a, b, c) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c)
#define error4(s, a, b, c, d) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d)
#define error5(s, a, b, c, d, e) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e)
#define error6(s, a, b, c, d, e, f) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f)
#define error7(s, a, b, c, d, e, f, g) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g)
#define error8(s, a, b, c, d, e, f, g, h) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h)
#define error9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i)
#define error10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j)
#define error11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k)
#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l)
#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#else
#define error(s)
#define error1(s, a)
#define error2(s, a, b)
#define error3(s, a, b, c)
#define error4(s, a, b, c, d)
#define error5(s, a, b, c, d, e)
#define error6(s, a, b, c, d, e, f)
#define error7(s, a, b, c, d, e, f, g)
#define error8(s, a, b, c, d, e, f, g, h)
#define error9(s, a, b, c, d, e, f, g, h, i)
#define error10(s, a, b, c, d, e, f, g, h, i, j)
#define error11(s, a, b, c, d, e, f, g, h, i, j, k)
#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l)
#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#endif
/* ereturn macros also here... */
#ifndef NO_ERETURN
#define ereturn(rv, s) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__); return rv; }while(0)
#define ereturn1(rv, s, a) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a); return rv; }while(0)
#define ereturn2(rv, s, a, b) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b); return rv; }while(0)
#define ereturn3(rv, s, a, b, c) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c); return rv; }while(0)
#define ereturn4(rv, s, a, b, c, d) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d); return rv; }while(0)
#define ereturn5(rv, s, a, b, c, d, e) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e); return rv; }while(0)
#define ereturn6(rv, s, a, b, c, d, e, f) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f); return rv; }while(0)
#define ereturn7(rv, s, a, b, c, d, e, f, g) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g); return rv; }while(0)
#define ereturn8(rv, s, a, b, c, d, e, f, g, h) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h); return rv; }while(0)
#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i); return rv; }while(0)
#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j); return rv; }while(0)
#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k); return rv; }while(0)
#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l); return rv; }while(0)
#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m); return rv; }while(0)
#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n); return rv; }while(0)
#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); return rv; }while(0)
#else
#define ereturn(rv, s) return rv
#define ereturn1(rv, s, a) return rv
#define ereturn2(rv, s, a, b) return rv
#define ereturn3(rv, s, a, b, c) return rv
#define ereturn4(rv, s, a, b, c, d) return rv
#define ereturn5(rv, s, a, b, c, d, e) return rv
#define ereturn6(rv, s, a, b, c, d, e, f) return rv
#define ereturn7(rv, s, a, b, c, d, e, f, g) return rv
#define ereturn8(rv, s, a, b, c, d, e, f, g, h) return rv
#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) return rv
#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) return rv
#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) return rv
#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) return rv
#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) return rv
#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) return rv
#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) return rv
#endif

View File

@ -1,2 +0,0 @@
/* Localized versions of Info.plist keys */

View File

@ -1,17 +0,0 @@
/*
equalizer.c: equalizer settings
copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
*/
#include "mpg123lib_intern.h"
void do_equalizer(real *bandPtr,int channel, real equalizer[2][32])
{
int i;
for(i=0;i<32;i++)
bandPtr[i] = REAL_MUL(bandPtr[i], equalizer[channel][i]);
}

View File

@ -1,2 +0,0 @@
/* Localized versions of Info.plist keys */

View File

@ -1,106 +0,0 @@
#include "mpg123lib_intern.h"
int mpg123_feature(const enum mpg123_feature_set key)
{
switch(key)
{
case MPG123_FEATURE_ABI_UTF8OPEN:
#ifdef WANT_WIN32_UNICODE
return 1;
#else
return 0;
#endif /* WANT_WIN32_UNICODE */
case MPG123_FEATURE_OUTPUT_8BIT:
#ifdef NO_8BIT
return 0;
#else
return 1;
#endif /* mpg123_output_8bit */
case MPG123_FEATURE_OUTPUT_16BIT:
#ifdef NO_16BIT
return 0;
#else
return 1;
#endif /* mpg123_output_16bit */
case MPG123_FEATURE_OUTPUT_32BIT:
#ifdef NO_32BIT
return 0;
#else
return 1;
#endif /* mpg123_output_32bit */
case MPG123_FEATURE_PARSE_ID3V2:
#ifdef NO_ID3V2
return 0;
#else
return 1;
#endif /* NO_ID3V2 */
case MPG123_FEATURE_DECODE_LAYER1:
#ifdef NO_LAYER1
return 0;
#else
return 1;
#endif /* NO_LAYER1 */
case MPG123_FEATURE_DECODE_LAYER2:
#ifdef NO_LAYER2
return 0;
#else
return 1;
#endif /* NO_LAYER2 */
case MPG123_FEATURE_DECODE_LAYER3:
#ifdef NO_LAYER3
return 0;
#else
return 1;
#endif /* NO_LAYER3 */
case MPG123_FEATURE_DECODE_ACCURATE:
#ifdef ACCURATE_ROUNDING
return 1;
#else
return 0;
#endif /* ACCURATE_ROUNDING */
case MPG123_FEATURE_DECODE_DOWNSAMPLE:
#ifdef NO_DOWNSAMPLE
return 0;
#else
return 1;
#endif /* NO_DOWNSAMPLE */
case MPG123_FEATURE_DECODE_NTOM:
#ifdef NO_NTOM
return 0;
#else
return 1;
#endif /* NO_NTOM */
case MPG123_FEATURE_PARSE_ICY:
#ifdef NO_ICY
return 0;
#else
return 1;
#endif /* NO_ICY */
case MPG123_FEATURE_INDEX:
#ifdef FRAME_INDEX
return 1;
#else
return 0;
#endif /* FRAME_INDEX */
case MPG123_FEATURE_TIMEOUT_READ:
#ifdef TIMEOUT_READ
return 1;
#else
return 0;
#endif
default: return 0;
}
}

View File

@ -1,521 +0,0 @@
/*
format:routines to deal with audio (output) format
copyright 2008-9 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis, starting with parts of the old audio.c, with only faintly manage to show now
*/
#include "mpg123lib_intern.h"
#include "debug.h"
/* static int chans[NUM_CHANNELS] = { 1 , 2 }; */
static const long my_rates[MPG123_RATES] = /* only the standard rates */
{
8000, 11025, 12000,
16000, 22050, 24000,
32000, 44100, 48000,
};
static const int my_encodings[MPG123_ENCODINGS] =
{
MPG123_ENC_SIGNED_16,
MPG123_ENC_UNSIGNED_16,
MPG123_ENC_SIGNED_32,
MPG123_ENC_UNSIGNED_32,
MPG123_ENC_SIGNED_24,
MPG123_ENC_UNSIGNED_24,
/* Floating point range, see below. */
MPG123_ENC_FLOAT_32,
MPG123_ENC_FLOAT_64,
/* 8 bit range, see below. */
MPG123_ENC_SIGNED_8,
MPG123_ENC_UNSIGNED_8,
MPG123_ENC_ULAW_8,
MPG123_ENC_ALAW_8
};
/* Make that match the above table.
And yes, I still don't like this kludgy stuff. */
/* range[0] <= i < range[1] for forced floating point */
static const int enc_float_range[2] = { 6, 8 };
/* same for 8 bit encodings */
static const int enc_8bit_range[2] = { 8, 12 };
/* Only one type of float is supported. */
# ifdef REAL_IS_FLOAT
# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_32
# else
# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_64
# endif
/* The list of actually possible encodings. */
static const int good_encodings[] =
{
#ifndef NO_16BIT
MPG123_ENC_SIGNED_16,
MPG123_ENC_UNSIGNED_16,
#endif
#ifndef NO_32BIT
MPG123_ENC_SIGNED_32,
MPG123_ENC_UNSIGNED_32,
MPG123_ENC_SIGNED_24,
MPG123_ENC_UNSIGNED_24,
#endif
#ifndef NO_REAL
MPG123_FLOAT_ENC,
#endif
#ifndef NO_8BIT
MPG123_ENC_SIGNED_8,
MPG123_ENC_UNSIGNED_8,
MPG123_ENC_ULAW_8,
MPG123_ENC_ALAW_8
#endif
};
/* Check if encoding is a valid one in this build.
...lazy programming: linear search. */
static int good_enc(const int enc)
{
size_t i;
for(i=0; i<sizeof(good_encodings)/sizeof(int); ++i)
if(enc == good_encodings[i]) return TRUE;
return FALSE;
}
void attribute_align_arg mpg123_rates(const long **list, size_t *number)
{
if(list != NULL) *list = my_rates;
if(number != NULL) *number = sizeof(my_rates)/sizeof(long);
}
/* Now that's a bit tricky... One build of the library knows only a subset of the encodings. */
void attribute_align_arg mpg123_encodings(const int **list, size_t *number)
{
if(list != NULL) *list = good_encodings;
if(number != NULL) *number = sizeof(good_encodings)/sizeof(int);
}
int attribute_align_arg mpg123_encsize(int encoding)
{
if(encoding & MPG123_ENC_8)
return 1;
else if(encoding & MPG123_ENC_16)
return 2;
else if(encoding & MPG123_ENC_24)
return 3;
else if(encoding & MPG123_ENC_32 || encoding == MPG123_ENC_FLOAT_32)
return 4;
else if(encoding == MPG123_ENC_FLOAT_64)
return 8;
else
return 0;
}
/* char audio_caps[NUM_CHANNELS][MPG123_RATES+1][MPG123_ENCODINGS]; */
static int rate2num(mpg123_pars *mp, long r)
{
int i;
for(i=0;i<MPG123_RATES;i++) if(my_rates[i] == r) return i;
#ifndef NO_NTOM
if(mp && mp->force_rate != 0 && mp->force_rate == r) return MPG123_RATES;
#endif
return -1;
}
static int enc2num(int encoding)
{
int i;
for(i=0;i<MPG123_ENCODINGS;++i)
if(my_encodings[i] == encoding) return i;
return -1;
}
static int cap_fit(mpg123_handle *fr, struct audioformat *nf, int f0, int f2)
{
int i;
int c = nf->channels-1;
int rn = rate2num(&fr->p, nf->rate);
if(rn >= 0) for(i=f0;i<f2;i++)
{
if(fr->p.audio_caps[c][rn][i])
{
nf->encoding = my_encodings[i];
return 1;
}
}
return 0;
}
static int freq_fit(mpg123_handle *fr, struct audioformat *nf, int f0, int f2)
{
nf->rate = frame_freq(fr)>>fr->p.down_sample;
if(cap_fit(fr,nf,f0,f2)) return 1;
if(fr->p.flags & MPG123_AUTO_RESAMPLE)
{
nf->rate>>=1;
if(cap_fit(fr,nf,f0,f2)) return 1;
nf->rate>>=1;
if(cap_fit(fr,nf,f0,f2)) return 1;
}
#ifndef NO_NTOM
/* If nothing worked, try the other rates, only without constrains from user.
In case you didn't guess: We enable flexible resampling if we find a working rate. */
if( fr->p.flags & MPG123_AUTO_RESAMPLE &&
!fr->p.force_rate && fr->p.down_sample == 0)
{
int i;
int c = nf->channels-1;
int rn = rate2num(&fr->p, frame_freq(fr));
int rrn;
if(rn < 0) return 0;
/* Try higher rates first. */
for(i=f0;i<f2;i++) for(rrn=rn+1; rrn<MPG123_RATES; ++rrn)
if(fr->p.audio_caps[c][rrn][i])
{
nf->rate = my_rates[rrn];
nf->encoding = my_encodings[i];
return 1;
}
/* Then lower rates. */
for(i=f0;i<f2;i++) for(rrn=rn-1; rrn>=0; --rrn)
if(fr->p.audio_caps[c][rrn][i])
{
nf->rate = my_rates[rrn];
nf->encoding = my_encodings[i];
return 1;
}
}
#endif
return 0;
}
/* match constraints against supported audio formats, store possible setup in frame
return: -1: error; 0: no format change; 1: format change */
int frame_output_format(mpg123_handle *fr)
{
struct audioformat nf;
int f0=0;
int f2=MPG123_ENCODINGS; /* Omit the 32bit and float encodings. */
mpg123_pars *p = &fr->p;
/* initialize new format, encoding comes later */
nf.channels = fr->stereo;
/* All this forcing should be removed in favour of the capabilities table... */
if(p->flags & MPG123_FORCE_8BIT)
{
f0 = enc_8bit_range[0];
f2 = enc_8bit_range[1];
}
if(p->flags & MPG123_FORCE_FLOAT)
{
f0 = enc_float_range[0];
f2 = enc_float_range[1];
}
/* force stereo is stronger */
if(p->flags & MPG123_FORCE_MONO) nf.channels = 1;
if(p->flags & MPG123_FORCE_STEREO) nf.channels = 2;
#ifndef NO_NTOM
if(p->force_rate)
{
nf.rate = p->force_rate;
if(cap_fit(fr,&nf,f0,2)) goto end; /* 16bit encodings */
if(cap_fit(fr,&nf,f0<=2 ? 2 : f0,f2)) goto end; /* 8bit encodings */
/* try again with different stereoness */
if(nf.channels == 2 && !(p->flags & MPG123_FORCE_STEREO)) nf.channels = 1;
else if(nf.channels == 1 && !(p->flags & MPG123_FORCE_MONO)) nf.channels = 2;
if(cap_fit(fr,&nf,f0,2)) goto end; /* 16bit encodings */
if(cap_fit(fr,&nf,f0<=2 ? 2 : f0,f2)) goto end; /* 8bit encodings */
if(NOQUIET)
error3( "Unable to set up output format! Constraints: %s%s%liHz.",
( p->flags & MPG123_FORCE_STEREO ? "stereo, " :
(p->flags & MPG123_FORCE_MONO ? "mono, " : "") ),
(p->flags & MPG123_FORCE_8BIT ? "8bit, " : ""),
p->force_rate );
/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */
fr->err = MPG123_BAD_OUTFORMAT;
return -1;
}
#endif
if(freq_fit(fr, &nf, f0, 2)) goto end; /* try rates with 16bit */
if(freq_fit(fr, &nf, f0<=2 ? 2 : f0, f2)) goto end; /* ... 8bit */
/* try again with different stereoness */
if(nf.channels == 2 && !(p->flags & MPG123_FORCE_STEREO)) nf.channels = 1;
else if(nf.channels == 1 && !(p->flags & MPG123_FORCE_MONO)) nf.channels = 2;
if(freq_fit(fr, &nf, f0, 2)) goto end; /* try rates with 16bit */
if(freq_fit(fr, &nf, f0<=2 ? 2 : f0, f2)) goto end; /* ... 8bit */
/* Here is the _bad_ end. */
if(NOQUIET)
{
error5( "Unable to set up output format! Constraints: %s%s%li, %li or %liHz.",
( p->flags & MPG123_FORCE_STEREO ? "stereo, " :
(p->flags & MPG123_FORCE_MONO ? "mono, " : "") ),
(p->flags & MPG123_FORCE_8BIT ? "8bit, " : ""),
frame_freq(fr), frame_freq(fr)>>1, frame_freq(fr)>>2 );
}
/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */
fr->err = MPG123_BAD_OUTFORMAT;
return -1;
end: /* Here is the _good_ end. */
/* we had a successful match, now see if there's a change */
if(nf.rate == fr->af.rate && nf.channels == fr->af.channels && nf.encoding == fr->af.encoding)
{
debug2("Old format with %i channels, and FORCE_MONO=%li", nf.channels, p->flags & MPG123_FORCE_MONO);
return 0; /* the same format as before */
}
else /* a new format */
{
debug1("New format with %i channels!", nf.channels);
fr->af.rate = nf.rate;
fr->af.channels = nf.channels;
fr->af.encoding = nf.encoding;
/* Cache the size of one sample in bytes, for ease of use. */
fr->af.encsize = mpg123_encsize(fr->af.encoding);
if(fr->af.encsize < 1)
{
if(NOQUIET) error1("Some unknown encoding??? (%i)", fr->af.encoding);
fr->err = MPG123_BAD_OUTFORMAT;
return -1;
}
return 1;
}
}
int attribute_align_arg mpg123_format_none(mpg123_handle *mh)
{
int r;
if(mh == NULL) return MPG123_ERR;
r = mpg123_fmt_none(&mh->p);
if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
return r;
}
int attribute_align_arg mpg123_fmt_none(mpg123_pars *mp)
{
if(mp == NULL) return MPG123_BAD_PARS;
if(PVERB(mp,3)) fprintf(stderr, "Note: Disabling all formats.\n");
memset(mp->audio_caps,0,sizeof(mp->audio_caps));
return MPG123_OK;
}
int attribute_align_arg mpg123_format_all(mpg123_handle *mh)
{
int r;
if(mh == NULL) return MPG123_ERR;
r = mpg123_fmt_all(&mh->p);
if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
return r;
}
int attribute_align_arg mpg123_fmt_all(mpg123_pars *mp)
{
size_t rate, ch, enc;
if(mp == NULL) return MPG123_BAD_PARS;
if(PVERB(mp,3)) fprintf(stderr, "Note: Enabling all formats.\n");
for(ch=0; ch < NUM_CHANNELS; ++ch)
for(rate=0; rate < MPG123_RATES+1; ++rate)
for(enc=0; enc < MPG123_ENCODINGS; ++enc)
mp->audio_caps[ch][rate][enc] = good_enc(my_encodings[enc]) ? 1 : 0;
return MPG123_OK;
}
int attribute_align_arg mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings)
{
int r;
if(mh == NULL) return MPG123_ERR;
r = mpg123_fmt(&mh->p, rate, channels, encodings);
if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
return r;
}
int attribute_align_arg mpg123_fmt(mpg123_pars *mp, long rate, int channels, int encodings)
{
int ie, ic, ratei;
int ch[2] = {0, 1};
if(mp == NULL) return MPG123_BAD_PARS;
if(!(channels & (MPG123_MONO|MPG123_STEREO))) return MPG123_BAD_CHANNEL;
if(PVERB(mp,3)) fprintf(stderr, "Note: Want to enable format %li/%i for encodings 0x%x.\n", rate, channels, encodings);
if(!(channels & MPG123_STEREO)) ch[1] = 0; /* {0,0} */
else if(!(channels & MPG123_MONO)) ch[0] = 1; /* {1,1} */
ratei = rate2num(mp, rate);
if(ratei < 0) return MPG123_BAD_RATE;
/* now match the encodings */
for(ic = 0; ic < 2; ++ic)
{
for(ie = 0; ie < MPG123_ENCODINGS; ++ie)
if(good_enc(my_encodings[ie]) && ((my_encodings[ie] & encodings) == my_encodings[ie]))
mp->audio_caps[ch[ic]][ratei][ie] = 1;
if(ch[0] == ch[1]) break; /* no need to do it again */
}
return MPG123_OK;
}
int attribute_align_arg mpg123_format_support(mpg123_handle *mh, long rate, int encoding)
{
if(mh == NULL) return 0;
else return mpg123_fmt_support(&mh->p, rate, encoding);
}
int attribute_align_arg mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding)
{
int ch = 0;
int ratei, enci;
ratei = rate2num(mp, rate);
enci = enc2num(encoding);
if(mp == NULL || ratei < 0 || enci < 0) return 0;
if(mp->audio_caps[0][ratei][enci]) ch |= MPG123_MONO;
if(mp->audio_caps[1][ratei][enci]) ch |= MPG123_STEREO;
return ch;
}
/* Call this one to ensure that any valid format will be something different than this. */
void invalidate_format(struct audioformat *af)
{
af->encoding = 0;
af->rate = 0;
af->channels = 0;
}
/* Consider 24bit output needing 32bit output as temporary storage. */
off_t samples_to_storage(mpg123_handle *fr, off_t s)
{
if(fr->af.encoding & MPG123_ENC_24)
return s*4*fr->af.channels; /* 4 bytes per sample */
else
return samples_to_bytes(fr, s);
}
/* take into account: channels, bytes per sample -- NOT resampling!*/
off_t samples_to_bytes(mpg123_handle *fr , off_t s)
{
return s * fr->af.encsize * fr->af.channels;
}
off_t bytes_to_samples(mpg123_handle *fr , off_t b)
{
return b / fr->af.encsize / fr->af.channels;
}
#ifndef NO_32BIT
/* Remove every fourth byte, facilitating conversion from 32 bit to 24 bit integers.
This has to be aware of endianness, of course. */
static void chop_fourth_byte(struct outbuffer *buf)
{
unsigned char *wpos = buf->data;
unsigned char *rpos = buf->data;
#ifdef WORDS_BIGENDIAN
while((size_t) (rpos - buf->data + 4) <= buf->fill)
{
/* Really stupid: Copy, increment. Byte per byte. */
*wpos = *rpos;
wpos++; rpos++;
*wpos = *rpos;
wpos++; rpos++;
*wpos = *rpos;
wpos++; rpos++;
rpos++; /* Skip the lowest byte (last). */
}
#else
while((size_t) (rpos - buf->data + 4) <= buf->fill)
{
/* Really stupid: Copy, increment. Byte per byte. */
rpos++; /* Skip the lowest byte (first). */
*wpos = *rpos;
wpos++; rpos++;
*wpos = *rpos;
wpos++; rpos++;
*wpos = *rpos;
wpos++; rpos++;
}
#endif
buf->fill = wpos-buf->data;
}
#endif
void postprocess_buffer(mpg123_handle *fr)
{
/* Handle unsigned output formats via reshifting after decode here.
Also handle conversion to 24 bit. */
#ifndef NO_32BIT
if(fr->af.encoding == MPG123_ENC_UNSIGNED_32 || fr->af.encoding == MPG123_ENC_UNSIGNED_24)
{ /* 32bit signed -> unsigned */
size_t i;
int32_t *ssamples;
uint32_t *usamples;
ssamples = (int32_t*)fr->buffer.data;
usamples = (uint32_t*)fr->buffer.data;
debug("converting output to unsigned 32 bit integer");
for(i=0; i<fr->buffer.fill/sizeof(int32_t); ++i)
{
/* Different strategy since we don't have a larger type at hand.
Also watch out for silly +-1 fun because integer constants are signed in C90! */
if(ssamples[i] >= 0)
usamples[i] = (uint32_t)ssamples[i] + 2147483647+1;
/* The smalles value goes zero. */
else if(ssamples[i] == ((int32_t)-2147483647-1))
usamples[i] = 0;
/* Now -value is in the positive range of signed int ... so it's a possible value at all. */
else
usamples[i] = (uint32_t)2147483647+1 - (uint32_t)(-ssamples[i]);
}
/* Dumb brute force: A second pass for hacking off the last byte. */
if(fr->af.encoding == MPG123_ENC_UNSIGNED_24)
chop_fourth_byte(&fr->buffer);
}
else if(fr->af.encoding == MPG123_ENC_SIGNED_24)
{
/* We got 32 bit signed ... chop off for 24 bit signed. */
chop_fourth_byte(&fr->buffer);
}
#endif
#ifndef NO_16BIT
if(fr->af.encoding == MPG123_ENC_UNSIGNED_16)
{
size_t i;
short *ssamples;
unsigned short *usamples;
ssamples = (short*)fr->buffer.data;
usamples = (unsigned short*)fr->buffer.data;
debug("converting output to unsigned 16 bit integer");
for(i=0; i<fr->buffer.fill/sizeof(short); ++i)
{
long tmp = (long)ssamples[i]+32768;
usamples[i] = (unsigned short)tmp;
}
}
#endif
}

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +0,0 @@
/*
icy: Puny code to pretend for a serious ICY data structure.
copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
*/
#include "icy.h"
void init_icy(struct icy_meta *icy)
{
icy->data = NULL;
}
void clear_icy(struct icy_meta *icy)
{
if(icy->data != NULL) free(icy->data);
init_icy(icy);
}
void reset_icy(struct icy_meta *icy)
{
clear_icy(icy);
init_icy(icy);
}
/*void set_icy(struct icy_meta *icy, char* new_data)
{
if(icy->data) free(icy->data);
icy->data = new_data;
icy->changed = 1;
}*/

View File

@ -1,438 +0,0 @@
/* mpg123 note: This is BSD-licensed code that is no problem for mpg123 usage under LGPL.
It's Free, understood? ;-) */
/* Another note: This code is basically written by Thorsten Glaser,
Thomas Orgis did just some rearrangements and comments. */
/*-
* Copyright (c) 2008
* Thorsten Glaser <tg@mirbsd.org>
*
* Provided that these terms and disclaimer and all copyright notices
* are retained or reproduced in an accompanying document, permission
* is granted to deal in this work without restriction, including un-
* limited rights to use, publicly perform, distribute, sell, modify,
* merge, give away, or sublicence.
*
* This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
* the utmost extent permitted by applicable law, neither express nor
* implied; without malicious intent or gross negligence. In no event
* may a licensor, author or contributor be held liable for indirect,
* direct, other damage, loss, or other issues arising in any way out
* of dealing in the work, even if advised of the possibility of such
* damage or existence of a defect, except proven that it results out
* of said person's immediate fault when using the work as intended.
*-
* Convert from ICY encoding (windows-1252 codepage) to UTF-8
*/
/* Includes string and stdlib headers... */
#include "compat.h"
/* ThOr: too lazy for this type check; also we use char/short all around anyway.
Of cource, it would be the proper way to use _these_ kind of types all around. */
#define uint8_t unsigned char
#define uint16_t unsigned short
static const uint8_t cp1252_utf8[] = {
/* 0x00 @ 0 */ 0x00,
/* 0x01 @ 1 */ 0x01,
/* 0x02 @ 2 */ 0x02,
/* 0x03 @ 3 */ 0x03,
/* 0x04 @ 4 */ 0x04,
/* 0x05 @ 5 */ 0x05,
/* 0x06 @ 6 */ 0x06,
/* 0x07 @ 7 */ 0x07,
/* 0x08 @ 8 */ 0x08,
/* 0x09 @ 9 */ 0x09,
/* 0x0A @ 10 */ 0x0A,
/* 0x0B @ 11 */ 0x0B,
/* 0x0C @ 12 */ 0x0C,
/* 0x0D @ 13 */ 0x0D,
/* 0x0E @ 14 */ 0x0E,
/* 0x0F @ 15 */ 0x0F,
/* 0x10 @ 16 */ 0x10,
/* 0x11 @ 17 */ 0x11,
/* 0x12 @ 18 */ 0x12,
/* 0x13 @ 19 */ 0x13,
/* 0x14 @ 20 */ 0x14,
/* 0x15 @ 21 */ 0x15,
/* 0x16 @ 22 */ 0x16,
/* 0x17 @ 23 */ 0x17,
/* 0x18 @ 24 */ 0x18,
/* 0x19 @ 25 */ 0x19,
/* 0x1A @ 26 */ 0x1A,
/* 0x1B @ 27 */ 0x1B,
/* 0x1C @ 28 */ 0x1C,
/* 0x1D @ 29 */ 0x1D,
/* 0x1E @ 30 */ 0x1E,
/* 0x1F @ 31 */ 0x1F,
/* 0x20 @ 32 */ 0x20,
/* 0x21 @ 33 */ 0x21,
/* 0x22 @ 34 */ 0x22,
/* 0x23 @ 35 */ 0x23,
/* 0x24 @ 36 */ 0x24,
/* 0x25 @ 37 */ 0x25,
/* 0x26 @ 38 */ 0x26,
/* 0x27 @ 39 */ 0x27,
/* 0x28 @ 40 */ 0x28,
/* 0x29 @ 41 */ 0x29,
/* 0x2A @ 42 */ 0x2A,
/* 0x2B @ 43 */ 0x2B,
/* 0x2C @ 44 */ 0x2C,
/* 0x2D @ 45 */ 0x2D,
/* 0x2E @ 46 */ 0x2E,
/* 0x2F @ 47 */ 0x2F,
/* 0x30 @ 48 */ 0x30,
/* 0x31 @ 49 */ 0x31,
/* 0x32 @ 50 */ 0x32,
/* 0x33 @ 51 */ 0x33,
/* 0x34 @ 52 */ 0x34,
/* 0x35 @ 53 */ 0x35,
/* 0x36 @ 54 */ 0x36,
/* 0x37 @ 55 */ 0x37,
/* 0x38 @ 56 */ 0x38,
/* 0x39 @ 57 */ 0x39,
/* 0x3A @ 58 */ 0x3A,
/* 0x3B @ 59 */ 0x3B,
/* 0x3C @ 60 */ 0x3C,
/* 0x3D @ 61 */ 0x3D,
/* 0x3E @ 62 */ 0x3E,
/* 0x3F @ 63 */ 0x3F,
/* 0x40 @ 64 */ 0x40,
/* 0x41 @ 65 */ 0x41,
/* 0x42 @ 66 */ 0x42,
/* 0x43 @ 67 */ 0x43,
/* 0x44 @ 68 */ 0x44,
/* 0x45 @ 69 */ 0x45,
/* 0x46 @ 70 */ 0x46,
/* 0x47 @ 71 */ 0x47,
/* 0x48 @ 72 */ 0x48,
/* 0x49 @ 73 */ 0x49,
/* 0x4A @ 74 */ 0x4A,
/* 0x4B @ 75 */ 0x4B,
/* 0x4C @ 76 */ 0x4C,
/* 0x4D @ 77 */ 0x4D,
/* 0x4E @ 78 */ 0x4E,
/* 0x4F @ 79 */ 0x4F,
/* 0x50 @ 80 */ 0x50,
/* 0x51 @ 81 */ 0x51,
/* 0x52 @ 82 */ 0x52,
/* 0x53 @ 83 */ 0x53,
/* 0x54 @ 84 */ 0x54,
/* 0x55 @ 85 */ 0x55,
/* 0x56 @ 86 */ 0x56,
/* 0x57 @ 87 */ 0x57,
/* 0x58 @ 88 */ 0x58,
/* 0x59 @ 89 */ 0x59,
/* 0x5A @ 90 */ 0x5A,
/* 0x5B @ 91 */ 0x5B,
/* 0x5C @ 92 */ 0x5C,
/* 0x5D @ 93 */ 0x5D,
/* 0x5E @ 94 */ 0x5E,
/* 0x5F @ 95 */ 0x5F,
/* 0x60 @ 96 */ 0x60,
/* 0x61 @ 97 */ 0x61,
/* 0x62 @ 98 */ 0x62,
/* 0x63 @ 99 */ 0x63,
/* 0x64 @ 100 */ 0x64,
/* 0x65 @ 101 */ 0x65,
/* 0x66 @ 102 */ 0x66,
/* 0x67 @ 103 */ 0x67,
/* 0x68 @ 104 */ 0x68,
/* 0x69 @ 105 */ 0x69,
/* 0x6A @ 106 */ 0x6A,
/* 0x6B @ 107 */ 0x6B,
/* 0x6C @ 108 */ 0x6C,
/* 0x6D @ 109 */ 0x6D,
/* 0x6E @ 110 */ 0x6E,
/* 0x6F @ 111 */ 0x6F,
/* 0x70 @ 112 */ 0x70,
/* 0x71 @ 113 */ 0x71,
/* 0x72 @ 114 */ 0x72,
/* 0x73 @ 115 */ 0x73,
/* 0x74 @ 116 */ 0x74,
/* 0x75 @ 117 */ 0x75,
/* 0x76 @ 118 */ 0x76,
/* 0x77 @ 119 */ 0x77,
/* 0x78 @ 120 */ 0x78,
/* 0x79 @ 121 */ 0x79,
/* 0x7A @ 122 */ 0x7A,
/* 0x7B @ 123 */ 0x7B,
/* 0x7C @ 124 */ 0x7C,
/* 0x7D @ 125 */ 0x7D,
/* 0x7E @ 126 */ 0x7E,
/* 0x7F @ 127 */ 0x7F,
/* 0x80 @ 128 */ 0xE2, 0x82, 0xAC,
/* 0x81 @ 131 */ 0xEF, 0xBF, 0xBD,
/* 0x82 @ 134 */ 0xE2, 0x80, 0x9A,
/* 0x83 @ 137 */ 0xC6, 0x92,
/* 0x84 @ 139 */ 0xE2, 0x80, 0x9E,
/* 0x85 @ 142 */ 0xE2, 0x80, 0xA6,
/* 0x86 @ 145 */ 0xE2, 0x80, 0xA0,
/* 0x87 @ 148 */ 0xE2, 0x80, 0xA1,
/* 0x88 @ 151 */ 0xCB, 0x86,
/* 0x89 @ 153 */ 0xE2, 0x80, 0xB0,
/* 0x8A @ 156 */ 0xC5, 0xA0,
/* 0x8B @ 158 */ 0xE2, 0x80, 0xB9,
/* 0x8C @ 161 */ 0xC5, 0x92,
/* 0x8D @ 163 */ 0xEF, 0xBF, 0xBD,
/* 0x8E @ 166 */ 0xC5, 0xBD,
/* 0x8F @ 168 */ 0xEF, 0xBF, 0xBD,
/* 0x90 @ 171 */ 0xEF, 0xBF, 0xBD,
/* 0x91 @ 174 */ 0xE2, 0x80, 0x98,
/* 0x92 @ 177 */ 0xE2, 0x80, 0x99,
/* 0x93 @ 180 */ 0xE2, 0x80, 0x9C,
/* 0x94 @ 183 */ 0xE2, 0x80, 0x9D,
/* 0x95 @ 186 */ 0xE2, 0x80, 0xA2,
/* 0x96 @ 189 */ 0xE2, 0x80, 0x93,
/* 0x97 @ 192 */ 0xE2, 0x80, 0x94,
/* 0x98 @ 195 */ 0xCB, 0x9C,
/* 0x99 @ 197 */ 0xE2, 0x84, 0xA2,
/* 0x9A @ 200 */ 0xC5, 0xA1,
/* 0x9B @ 202 */ 0xE2, 0x80, 0xBA,
/* 0x9C @ 205 */ 0xC5, 0x93,
/* 0x9D @ 207 */ 0xEF, 0xBF, 0xBD,
/* 0x9E @ 210 */ 0xC5, 0xBE,
/* 0x9F @ 212 */ 0xC5, 0xB8,
/* 0xA0 @ 214 */ 0xC2, 0xA0,
/* 0xA1 @ 216 */ 0xC2, 0xA1,
/* 0xA2 @ 218 */ 0xC2, 0xA2,
/* 0xA3 @ 220 */ 0xC2, 0xA3,
/* 0xA4 @ 222 */ 0xC2, 0xA4,
/* 0xA5 @ 224 */ 0xC2, 0xA5,
/* 0xA6 @ 226 */ 0xC2, 0xA6,
/* 0xA7 @ 228 */ 0xC2, 0xA7,
/* 0xA8 @ 230 */ 0xC2, 0xA8,
/* 0xA9 @ 232 */ 0xC2, 0xA9,
/* 0xAA @ 234 */ 0xC2, 0xAA,
/* 0xAB @ 236 */ 0xC2, 0xAB,
/* 0xAC @ 238 */ 0xC2, 0xAC,
/* 0xAD @ 240 */ 0xC2, 0xAD,
/* 0xAE @ 242 */ 0xC2, 0xAE,
/* 0xAF @ 244 */ 0xC2, 0xAF,
/* 0xB0 @ 246 */ 0xC2, 0xB0,
/* 0xB1 @ 248 */ 0xC2, 0xB1,
/* 0xB2 @ 250 */ 0xC2, 0xB2,
/* 0xB3 @ 252 */ 0xC2, 0xB3,
/* 0xB4 @ 254 */ 0xC2, 0xB4,
/* 0xB5 @ 256 */ 0xC2, 0xB5,
/* 0xB6 @ 258 */ 0xC2, 0xB6,
/* 0xB7 @ 260 */ 0xC2, 0xB7,
/* 0xB8 @ 262 */ 0xC2, 0xB8,
/* 0xB9 @ 264 */ 0xC2, 0xB9,
/* 0xBA @ 266 */ 0xC2, 0xBA,
/* 0xBB @ 268 */ 0xC2, 0xBB,
/* 0xBC @ 270 */ 0xC2, 0xBC,
/* 0xBD @ 272 */ 0xC2, 0xBD,
/* 0xBE @ 274 */ 0xC2, 0xBE,
/* 0xBF @ 276 */ 0xC2, 0xBF,
/* 0xC0 @ 278 */ 0xC3, 0x80,
/* 0xC1 @ 280 */ 0xC3, 0x81,
/* 0xC2 @ 282 */ 0xC3, 0x82,
/* 0xC3 @ 284 */ 0xC3, 0x83,
/* 0xC4 @ 286 */ 0xC3, 0x84,
/* 0xC5 @ 288 */ 0xC3, 0x85,
/* 0xC6 @ 290 */ 0xC3, 0x86,
/* 0xC7 @ 292 */ 0xC3, 0x87,
/* 0xC8 @ 294 */ 0xC3, 0x88,
/* 0xC9 @ 296 */ 0xC3, 0x89,
/* 0xCA @ 298 */ 0xC3, 0x8A,
/* 0xCB @ 300 */ 0xC3, 0x8B,
/* 0xCC @ 302 */ 0xC3, 0x8C,
/* 0xCD @ 304 */ 0xC3, 0x8D,
/* 0xCE @ 306 */ 0xC3, 0x8E,
/* 0xCF @ 308 */ 0xC3, 0x8F,
/* 0xD0 @ 310 */ 0xC3, 0x90,
/* 0xD1 @ 312 */ 0xC3, 0x91,
/* 0xD2 @ 314 */ 0xC3, 0x92,
/* 0xD3 @ 316 */ 0xC3, 0x93,
/* 0xD4 @ 318 */ 0xC3, 0x94,
/* 0xD5 @ 320 */ 0xC3, 0x95,
/* 0xD6 @ 322 */ 0xC3, 0x96,
/* 0xD7 @ 324 */ 0xC3, 0x97,
/* 0xD8 @ 326 */ 0xC3, 0x98,
/* 0xD9 @ 328 */ 0xC3, 0x99,
/* 0xDA @ 330 */ 0xC3, 0x9A,
/* 0xDB @ 332 */ 0xC3, 0x9B,
/* 0xDC @ 334 */ 0xC3, 0x9C,
/* 0xDD @ 336 */ 0xC3, 0x9D,
/* 0xDE @ 338 */ 0xC3, 0x9E,
/* 0xDF @ 340 */ 0xC3, 0x9F,
/* 0xE0 @ 342 */ 0xC3, 0xA0,
/* 0xE1 @ 344 */ 0xC3, 0xA1,
/* 0xE2 @ 346 */ 0xC3, 0xA2,
/* 0xE3 @ 348 */ 0xC3, 0xA3,
/* 0xE4 @ 350 */ 0xC3, 0xA4,
/* 0xE5 @ 352 */ 0xC3, 0xA5,
/* 0xE6 @ 354 */ 0xC3, 0xA6,
/* 0xE7 @ 356 */ 0xC3, 0xA7,
/* 0xE8 @ 358 */ 0xC3, 0xA8,
/* 0xE9 @ 360 */ 0xC3, 0xA9,
/* 0xEA @ 362 */ 0xC3, 0xAA,
/* 0xEB @ 364 */ 0xC3, 0xAB,
/* 0xEC @ 366 */ 0xC3, 0xAC,
/* 0xED @ 368 */ 0xC3, 0xAD,
/* 0xEE @ 370 */ 0xC3, 0xAE,
/* 0xEF @ 372 */ 0xC3, 0xAF,
/* 0xF0 @ 374 */ 0xC3, 0xB0,
/* 0xF1 @ 376 */ 0xC3, 0xB1,
/* 0xF2 @ 378 */ 0xC3, 0xB2,
/* 0xF3 @ 380 */ 0xC3, 0xB3,
/* 0xF4 @ 382 */ 0xC3, 0xB4,
/* 0xF5 @ 384 */ 0xC3, 0xB5,
/* 0xF6 @ 386 */ 0xC3, 0xB6,
/* 0xF7 @ 388 */ 0xC3, 0xB7,
/* 0xF8 @ 390 */ 0xC3, 0xB8,
/* 0xF9 @ 392 */ 0xC3, 0xB9,
/* 0xFA @ 394 */ 0xC3, 0xBA,
/* 0xFB @ 396 */ 0xC3, 0xBB,
/* 0xFC @ 398 */ 0xC3, 0xBC,
/* 0xFD @ 400 */ 0xC3, 0xBD,
/* 0xFE @ 402 */ 0xC3, 0xBE,
/* 0xFF @ 404 */ 0xC3, 0xBF,
};
static const uint16_t tblofs[257] = {
/* 0x00 */ 0, 1, 2, 3, 4, 5, 6, 7,
/* 0x08 */ 8, 9, 10, 11, 12, 13, 14, 15,
/* 0x10 */ 16, 17, 18, 19, 20, 21, 22, 23,
/* 0x18 */ 24, 25, 26, 27, 28, 29, 30, 31,
/* 0x20 */ 32, 33, 34, 35, 36, 37, 38, 39,
/* 0x28 */ 40, 41, 42, 43, 44, 45, 46, 47,
/* 0x30 */ 48, 49, 50, 51, 52, 53, 54, 55,
/* 0x38 */ 56, 57, 58, 59, 60, 61, 62, 63,
/* 0x40 */ 64, 65, 66, 67, 68, 69, 70, 71,
/* 0x48 */ 72, 73, 74, 75, 76, 77, 78, 79,
/* 0x50 */ 80, 81, 82, 83, 84, 85, 86, 87,
/* 0x58 */ 88, 89, 90, 91, 92, 93, 94, 95,
/* 0x60 */ 96, 97, 98, 99, 100, 101, 102, 103,
/* 0x68 */ 104, 105, 106, 107, 108, 109, 110, 111,
/* 0x70 */ 112, 113, 114, 115, 116, 117, 118, 119,
/* 0x78 */ 120, 121, 122, 123, 124, 125, 126, 127,
/* 0x80 */ 128, 131, 134, 137, 139, 142, 145, 148,
/* 0x88 */ 151, 153, 156, 158, 161, 163, 166, 168,
/* 0x90 */ 171, 174, 177, 180, 183, 186, 189, 192,
/* 0x98 */ 195, 197, 200, 202, 205, 207, 210, 212,
/* 0xA0 */ 214, 216, 218, 220, 222, 224, 226, 228,
/* 0xA8 */ 230, 232, 234, 236, 238, 240, 242, 244,
/* 0xB0 */ 246, 248, 250, 252, 254, 256, 258, 260,
/* 0xB8 */ 262, 264, 266, 268, 270, 272, 274, 276,
/* 0xC0 */ 278, 280, 282, 284, 286, 288, 290, 292,
/* 0xC8 */ 294, 296, 298, 300, 302, 304, 306, 308,
/* 0xD0 */ 310, 312, 314, 316, 318, 320, 322, 324,
/* 0xD8 */ 326, 328, 330, 332, 334, 336, 338, 340,
/* 0xE0 */ 342, 344, 346, 348, 350, 352, 354, 356,
/* 0xE8 */ 358, 360, 362, 364, 366, 368, 370, 372,
/* 0xF0 */ 374, 376, 378, 380, 382, 384, 386, 388,
/* 0xF8 */ 390, 392, 394, 396, 398, 400, 402, 404,
/* sizeof (cp1252_utf8) */ 406
};
/* Check if a string qualifies as UTF-8. */
static int
is_utf8(const char* src)
{
uint8_t ch;
size_t i;
const uint8_t* s = (const uint8_t*) src;
/* We make a loop over every character, until we find a null one.
Remember: The string is supposed to end with a NUL, so ahead checks are safe. */
while ((ch = *s++)) {
/* Ye olde 7bit ASCII chars 'rr fine for anything */
if(ch < 0x80) continue;
/* Now, we watch out for non-UTF conform sequences. */
else if ((ch < 0xC2) || (ch > 0xFD))
return 0;
/* check for some misformed sequences */
if (((ch == 0xC2) && (s[0] < 0xA0)) ||
((ch == 0xEF) && (s[0] == 0xBF) && (s[1] > 0xBD)))
/* XXX add more for outside the BMP */
return 0;
/* Check the continuation bytes. */
if (ch < 0xE0) i = 1;
else if (ch < 0xF0) i = 2;
else if (ch < 0xF8) i = 3;
else if (ch < 0xFC) i = 4;
else
i = 5;
while (i--)
if ((*s++ & 0xC0) != 0x80)
return 0;
}
/* If no check failed, the string indeed looks like valid UTF-8. */
return 1;
}
/* The main conversion routine.
ICY in CP-1252 (or UTF-8 alreay) to UTF-8 encoded string.
If force is applied, it will always encode to UTF-8, without checking. */
char *
icy2utf8(const char *src, int force)
{
const uint8_t *s = (const uint8_t *)src;
size_t srclen, dstlen, i, k;
uint8_t ch, *d;
char *dst;
/* Some funny streams from Apple/iTunes give ICY info in UTF-8 already.
So, be prepared and don't try to re-encode such. Unless forced. */
if(!force && is_utf8(src)) return (strdup(src));
srclen = strlen(src) + 1;
/* allocate conservatively */
if ((d = malloc(srclen * 3)) == NULL)
return (NULL);
i = 0;
dstlen = 0;
while (i < srclen) {
ch = s[i++];
k = tblofs[ch];
while (k < tblofs[ch + 1])
d[dstlen++] = cp1252_utf8[k++];
}
/* dstlen includes trailing NUL since srclen also does */
if ((dst = realloc(d, dstlen)) == NULL) {
free(d);
return (NULL);
}
return (dst);
}
/* This stuff is for testing only. */
#ifdef TEST
static const char intext[] = "\225 Gr\374\337e kosten 0,55 \200\205";
#include <stdio.h>
int
main(void)
{
char *t, *t2;
if ((t = icy2utf8(intext, 0)) == NULL) {
fprintf(stderr, "out of memory\n");
return (1);
}
/* make sure it won't be converted twice */
if ((t2 = icy2utf8(t), 0) == NULL) {
fprintf(stderr, "out of memory\n");
return (1);
}
printf("Result is:\t\343\200\214%s\343\200\215\n"
"\t\t\343\200\214%s\343\200\215\n", t, t2);
free(t);
free(t2);
return (0);
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,134 +0,0 @@
/*
index: frame index data structure and functions
copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
*/
#include "index.h"
#include "debug.h"
/* The next expected frame offset, one step ahead. */
static off_t fi_next(struct frame_index *fi)
{
return (off_t)fi->fill*fi->step;
}
/* Shrink down the used index to the half.
Be careful with size = 1 ... there's no shrinking possible there. */
static void fi_shrink(struct frame_index *fi)
{
if(fi->fill < 2) return; /* Won't shrink below 1. */
else
{ /* Double the step, half the fill. Should work as well for fill%2 = 1 */
size_t c;
debug2("shrink index with fill %lu and step %lu", (unsigned long)fi->fill, (unsigned long)fi->step);
fi->step *= 2;
fi->fill /= 2;
/* Move the data down. */
for(c = 0; c < fi->fill; ++c)
fi->data[c] = fi->data[2*c];
}
fi->next = fi_next(fi);
}
void fi_init(struct frame_index *fi)
{
fi->data = NULL;
fi->step = 1;
fi->fill = 0;
fi->size = 0;
fi->grow_size = 0;
fi->next = fi_next(fi);
}
void fi_exit(struct frame_index *fi)
{
debug2("fi_exit: %p and %lu", (void*)fi->data, (unsigned long)fi->size);
if(fi->size && fi->data != NULL) free(fi->data);
fi_init(fi); /* Be prepared for further fun, still. */
}
int fi_resize(struct frame_index *fi, size_t newsize)
{
off_t *newdata = NULL;
if(newsize == fi->size) return 0;
if(newsize > 0 && newsize < fi->size)
{ /* When we reduce buffer size a bit, shrink stuff. */
while(fi->fill > newsize){ fi_shrink(fi); }
}
newdata = safe_realloc(fi->data, newsize*sizeof(off_t));
if(newsize == 0 || newdata != NULL)
{
fi->data = newdata;
fi->size = newsize;
if(fi->fill > fi->size) fi->fill = fi->size;
fi->next = fi_next(fi);
debug2("new index of size %lu at %p", (unsigned long)fi->size, (void*)fi->data);
return 0;
}
else
{
error("failed to resize index!");
return -1;
}
}
void fi_add(struct frame_index *fi, off_t pos)
{
debug3("wanting to add to fill %lu, step %lu, size %lu", (unsigned long)fi->fill, (unsigned long)fi->step, (unsigned long)fi->size);
if(fi->fill == fi->size)
{ /* Index is full, we need to shrink... or grow. */
/* Store the current frame number to check later if we still want it. */
off_t framenum = fi->fill*fi->step;
/* If we want not / cannot grow, we shrink. */
if( !(fi->grow_size && fi_resize(fi, fi->size+fi->grow_size)==0) )
fi_shrink(fi);
/* Now check if we still want to add this frame (could be that not, because of changed step). */
if(fi->next != framenum) return;
}
/* When we are here, we want that frame. */
if(fi->fill < fi->size) /* safeguard for size=1, or just generally */
{
debug1("adding to index at %p", (void*)(fi->data+fi->fill));
fi->data[fi->fill] = pos;
++fi->fill;
fi->next = fi_next(fi);
debug3("added pos %li to index with fill %lu and step %lu", (long) pos, (unsigned long)fi->fill, (unsigned long)fi->step);
}
}
int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill)
{
if(fi_resize(fi, fill) == -1) return -1;
fi->step = step;
if(offsets != NULL)
{
memcpy(fi->data, offsets, fill*sizeof(off_t));
fi->fill = fill;
}
else
{
/* allocation only, no entries in index yet */
fi->fill = 0;
}
fi->next = fi_next(fi);
debug3("set new index of fill %lu, size %lu at %p",
(unsigned long)fi->fill, (unsigned long)fi->size, (void*)fi->data);
return 0;
}
void fi_reset(struct frame_index *fi)
{
debug1("reset with size %"SIZE_P, (size_p)fi->size);
fi->fill = 0;
fi->step = 1;
fi->next = fi_next(fi);
}

View File

@ -1,271 +0,0 @@
#ifndef MPG123_INTMAP_H
#define MPG123_INTMAP_H
/* Mapping of internal mpg123 symbols to something that is less likely to conflict in case of static linking. */
#define COS9 INT123_COS9
#define tfcos36 INT123_tfcos36
#define pnts INT123_pnts
#define safe_realloc INT123_safe_realloc
#define compat_open INT123_compat_open
#define compat_close INT123_compat_close
#define win32_wide_utf8 INT123_win32_wide_utf8
#define win32_utf8_wide INT123_win32_utf8_wide
#define ntom_set_ntom INT123_ntom_set_ntom
#define synth_1to1 INT123_synth_1to1
#define synth_1to1_dither INT123_synth_1to1_dither
#define synth_1to1_i386 INT123_synth_1to1_i386
#define synth_1to1_i586 INT123_synth_1to1_i586
#define synth_1to1_i586_dither INT123_synth_1to1_i586_dither
#define synth_1to1_mmx INT123_synth_1to1_mmx
#define synth_1to1_3dnow INT123_synth_1to1_3dnow
#define synth_1to1_sse INT123_synth_1to1_sse
#define synth_1to1_stereo_sse INT123_synth_1to1_stereo_sse
#define synth_1to1_3dnowext INT123_synth_1to1_3dnowext
#define synth_1to1_altivec INT123_synth_1to1_altivec
#define synth_1to1_stereo_altivec INT123_synth_1to1_stereo_altivec
#define synth_1to1_x86_64 INT123_synth_1to1_x86_64
#define synth_1to1_stereo_x86_64 INT123_synth_1to1_stereo_x86_64
#define synth_1to1_avx INT123_synth_1to1_avx
#define synth_1to1_stereo_avx INT123_synth_1to1_stereo_avx
#define synth_1to1_arm INT123_synth_1to1_arm
#define synth_1to1_neon INT123_synth_1to1_neon
#define synth_1to1_stereo_neon INT123_synth_1to1_stereo_neon
#define absynth_1to1_i486 INT123_absynth_1to1_i486
#define synth_1to1_mono INT123_synth_1to1_mono
#define synth_1to1_m2s INT123_synth_1to1_m2s
#define synth_2to1 INT123_synth_2to1
#define synth_2to1_dither INT123_synth_2to1_dither
#define synth_2to1_i386 INT123_synth_2to1_i386
#define synth_2to1_mono INT123_synth_2to1_mono
#define synth_2to1_m2s INT123_synth_2to1_m2s
#define synth_4to1 INT123_synth_4to1
#define synth_4to1_dither INT123_synth_4to1_dither
#define synth_4to1_i386 INT123_synth_4to1_i386
#define synth_4to1_mono INT123_synth_4to1_mono
#define synth_4to1_m2s INT123_synth_4to1_m2s
#define synth_ntom INT123_synth_ntom
#define synth_ntom_mono INT123_synth_ntom_mono
#define synth_ntom_m2s INT123_synth_ntom_m2s
#define synth_1to1_8bit INT123_synth_1to1_8bit
#define synth_1to1_8bit_i386 INT123_synth_1to1_8bit_i386
#define synth_1to1_8bit_wrap INT123_synth_1to1_8bit_wrap
#define synth_1to1_8bit_mono INT123_synth_1to1_8bit_mono
#define synth_1to1_8bit_m2s INT123_synth_1to1_8bit_m2s
#define synth_1to1_8bit_wrap_mono INT123_synth_1to1_8bit_wrap_mono
#define synth_1to1_8bit_wrap_m2s INT123_synth_1to1_8bit_wrap_m2s
#define synth_2to1_8bit INT123_synth_2to1_8bit
#define synth_2to1_8bit_i386 INT123_synth_2to1_8bit_i386
#define synth_2to1_8bit_mono INT123_synth_2to1_8bit_mono
#define synth_2to1_8bit_m2s INT123_synth_2to1_8bit_m2s
#define synth_4to1_8bit INT123_synth_4to1_8bit
#define synth_4to1_8bit_i386 INT123_synth_4to1_8bit_i386
#define synth_4to1_8bit_mono INT123_synth_4to1_8bit_mono
#define synth_4to1_8bit_m2s INT123_synth_4to1_8bit_m2s
#define synth_ntom_8bit INT123_synth_ntom_8bit
#define synth_ntom_8bit_mono INT123_synth_ntom_8bit_mono
#define synth_ntom_8bit_m2s INT123_synth_ntom_8bit_m2s
#define synth_1to1_real INT123_synth_1to1_real
#define synth_1to1_real_i386 INT123_synth_1to1_real_i386
#define synth_1to1_real_sse INT123_synth_1to1_real_sse
#define synth_1to1_real_stereo_sse INT123_synth_1to1_real_stereo_sse
#define synth_1to1_real_x86_64 INT123_synth_1to1_real_x86_64
#define synth_1to1_real_stereo_x86_64 INT123_synth_1to1_real_stereo_x86_64
#define synth_1to1_real_avx INT123_synth_1to1_real_avx
#define synth_1to1_real_stereo_avx INT123_synth_1to1_real_stereo_avx
#define synth_1to1_real_altivec INT123_synth_1to1_real_altivec
#define synth_1to1_real_stereo_altivec INT123_synth_1to1_real_stereo_altivec
#define synth_1to1_real_neon INT123_synth_1to1_real_neon
#define synth_1to1_real_stereo_neon INT123_synth_1to1_real_stereo_neon
#define synth_1to1_real_mono INT123_synth_1to1_real_mono
#define synth_1to1_real_m2s INT123_synth_1to1_real_m2s
#define synth_2to1_real INT123_synth_2to1_real
#define synth_2to1_real_i386 INT123_synth_2to1_real_i386
#define synth_2to1_real_mono INT123_synth_2to1_real_mono
#define synth_2to1_real_m2s INT123_synth_2to1_real_m2s
#define synth_4to1_real INT123_synth_4to1_real
#define synth_4to1_real_i386 INT123_synth_4to1_real_i386
#define synth_4to1_real_mono INT123_synth_4to1_real_mono
#define synth_4to1_real_m2s INT123_synth_4to1_real_m2s
#define synth_ntom_real INT123_synth_ntom_real
#define synth_ntom_real_mono INT123_synth_ntom_real_mono
#define synth_ntom_real_m2s INT123_synth_ntom_real_m2s
#define synth_1to1_s32 INT123_synth_1to1_s32
#define synth_1to1_s32_i386 INT123_synth_1to1_s32_i386
#define synth_1to1_s32_sse INT123_synth_1to1_s32_sse
#define synth_1to1_s32_stereo_sse INT123_synth_1to1_s32_stereo_sse
#define synth_1to1_s32_x86_64 INT123_synth_1to1_s32_x86_64
#define synth_1to1_s32_stereo_x86_64 INT123_synth_1to1_s32_stereo_x86_64
#define synth_1to1_s32_avx INT123_synth_1to1_s32_avx
#define synth_1to1_s32_stereo_avx INT123_synth_1to1_s32_stereo_avx
#define synth_1to1_s32_altivec INT123_synth_1to1_s32_altivec
#define synth_1to1_s32_stereo_altivec INT123_synth_1to1_s32_stereo_altivec
#define synth_1to1_s32_neon INT123_synth_1to1_s32_neon
#define synth_1to1_s32_stereo_neon INT123_synth_1to1_s32_stereo_neon
#define synth_1to1_s32_mono INT123_synth_1to1_s32_mono
#define synth_1to1_s32_m2s INT123_synth_1to1_s32_m2s
#define synth_2to1_s32 INT123_synth_2to1_s32
#define synth_2to1_s32_i386 INT123_synth_2to1_s32_i386
#define synth_2to1_s32_mono INT123_synth_2to1_s32_mono
#define synth_2to1_s32_m2s INT123_synth_2to1_s32_m2s
#define synth_4to1_s32 INT123_synth_4to1_s32
#define synth_4to1_s32_i386 INT123_synth_4to1_s32_i386
#define synth_4to1_s32_mono INT123_synth_4to1_s32_mono
#define synth_4to1_s32_m2s INT123_synth_4to1_s32_m2s
#define synth_ntom_s32 INT123_synth_ntom_s32
#define synth_ntom_s32_mono INT123_synth_ntom_s32_mono
#define synth_ntom_s32_m2s INT123_synth_ntom_s32_m2s
#define dct64 INT123_dct64
#define dct64_i386 INT123_dct64_i386
#define dct64_altivec INT123_dct64_altivec
#define dct64_i486 INT123_dct64_i486
#define dct36 INT123_dct36
#define dct36_3dnow INT123_dct36_3dnow
#define dct36_3dnowext INT123_dct36_3dnowext
#define dct36_sse INT123_dct36_sse
#define dct36_x86_64 INT123_dct36_x86_64
#define dct36_avx INT123_dct36_avx
#define synth_ntom_set_step INT123_synth_ntom_set_step
#define ntom_val INT123_ntom_val
#define ntom_frame_outsamples INT123_ntom_frame_outsamples
#define ntom_frmouts INT123_ntom_frmouts
#define ntom_ins2outs INT123_ntom_ins2outs
#define ntom_frameoff INT123_ntom_frameoff
#define init_layer3 INT123_init_layer3
#define init_layer3_gainpow2 INT123_init_layer3_gainpow2
#define init_layer3_stuff INT123_init_layer3_stuff
#define init_layer12 INT123_init_layer12
#define init_layer12_table INT123_init_layer12_table
#define init_layer12_stuff INT123_init_layer12_stuff
#define prepare_decode_tables INT123_prepare_decode_tables
#define make_decode_tables INT123_make_decode_tables
#define make_decode_tables_mmx INT123_make_decode_tables_mmx
#define init_layer3_gainpow2_mmx INT123_init_layer3_gainpow2_mmx
#define init_layer12_table_mmx INT123_init_layer12_table_mmx
#define make_conv16to8_table INT123_make_conv16to8_table
#define do_layer3 INT123_do_layer3
#define do_layer2 INT123_do_layer2
#define do_layer1 INT123_do_layer1
#define do_equalizer INT123_do_equalizer
#define dither_table_init INT123_dither_table_init
#define frame_dither_init INT123_frame_dither_init
#define invalidate_format INT123_invalidate_format
#define frame_init INT123_frame_init
#define frame_init_par INT123_frame_init_par
#define frame_outbuffer INT123_frame_outbuffer
#define frame_output_format INT123_frame_output_format
#define frame_buffers INT123_frame_buffers
#define frame_reset INT123_frame_reset
#define frame_buffers_reset INT123_frame_buffers_reset
#define frame_exit INT123_frame_exit
#define frame_index_find INT123_frame_index_find
#define frame_index_setup INT123_frame_index_setup
#define do_volume INT123_do_volume
#define do_rva INT123_do_rva
#define frame_gapless_init INT123_frame_gapless_init
#define frame_gapless_realinit INT123_frame_gapless_realinit
#define frame_gapless_update INT123_frame_gapless_update
#define frame_gapless_bytify INT123_frame_gapless_bytify
#define frame_gapless_ignore INT123_frame_gapless_ignore
#define frame_expect_outsamples INT123_frame_expect_outsamples
#define frame_skip INT123_frame_skip
#define frame_ins2outs INT123_frame_ins2outs
#define frame_outs INT123_frame_outs
#define frame_expect_outsampels INT123_frame_expect_outsampels
#define frame_offset INT123_frame_offset
#define frame_set_frameseek INT123_frame_set_frameseek
#define frame_set_seek INT123_frame_set_seek
#define frame_tell_seek INT123_frame_tell_seek
#define frame_fill_toc INT123_frame_fill_toc
#define getbits INT123_getbits
#define getcpuflags INT123_getcpuflags
#define icy2utf8 INT123_icy2utf8
#define init_icy INT123_init_icy
#define clear_icy INT123_clear_icy
#define reset_icy INT123_reset_icy
#define init_id3 INT123_init_id3
#define exit_id3 INT123_exit_id3
#define reset_id3 INT123_reset_id3
#define id3_link INT123_id3_link
#define parse_new_id3 INT123_parse_new_id3
#define id3_to_utf8 INT123_id3_to_utf8
#define fi_init INT123_fi_init
#define fi_exit INT123_fi_exit
#define fi_resize INT123_fi_resize
#define fi_add INT123_fi_add
#define fi_set INT123_fi_set
#define fi_reset INT123_fi_reset
#define double_to_long_rounded INT123_double_to_long_rounded
#define scale_rounded INT123_scale_rounded
#define decode_update INT123_decode_update
#define samples_to_bytes INT123_samples_to_bytes
#define bytes_to_samples INT123_bytes_to_samples
#define frame_cpu_opt INT123_frame_cpu_opt
#define set_synth_functions INT123_set_synth_functions
#define dectype INT123_dectype
#define defdec INT123_defdec
#define decclass INT123_decclass
#define check_decoders INT123_check_decoders
#define read_frame_init INT123_read_frame_init
#define frame_bitrate INT123_frame_bitrate
#define frame_freq INT123_frame_freq
#define read_frame_recover INT123_read_frame_recover
#define read_frame INT123_read_frame
#define set_pointer INT123_set_pointer
#define position_info INT123_position_info
#define compute_bpf INT123_compute_bpf
#define time_to_frame INT123_time_to_frame
#define get_songlen INT123_get_songlen
#define open_stream INT123_open_stream
#define open_stream_handle INT123_open_stream_handle
#define open_feed INT123_open_feed
#define feed_more INT123_feed_more
#define feed_forget INT123_feed_forget
#define feed_set_pos INT123_feed_set_pos
#define open_bad INT123_open_bad
#define dct64_3dnow INT123_dct64_3dnow
#define dct64_3dnowext INT123_dct64_3dnowext
#define dct64_mmx INT123_dct64_mmx
#define dct64_MMX INT123_dct64_MMX
#define dct64_sse INT123_dct64_sse
#define dct64_real_sse INT123_dct64_real_sse
#define dct64_x86_64 INT123_dct64_x86_64
#define dct64_real_x86_64 INT123_dct64_real_x86_64
#define dct64_avx INT123_dct64_avx
#define dct64_real_avx INT123_dct64_real_avx
#define dct64_neon INT123_dct64_neon
#define dct64_real_neon INT123_dct64_real_neon
#define do_equalizer_3dnow INT123_do_equalizer_3dnow
#define synth_1to1_3dnow_asm INT123_synth_1to1_3dnow_asm
#define synth_1to1_arm_asm INT123_synth_1to1_arm_asm
#define synth_1to1_arm_accurate_asm INT123_synth_1to1_arm_accurate_asm
#define synth_1to1_i586_asm INT123_synth_1to1_i586_asm
#define synth_1to1_i586_asm_dither INT123_synth_1to1_i586_asm_dither
#define synth_1to1_MMX INT123_synth_1to1_MMX
#define synth_1to1_sse_accurate_asm INT123_synth_1to1_sse_accurate_asm
#define synth_1to1_real_sse_asm INT123_synth_1to1_real_sse_asm
#define synth_1to1_s32_sse_asm INT123_synth_1to1_s32_sse_asm
#define synth_1to1_s_sse_accurate_asm INT123_synth_1to1_s_sse_accurate_asm
#define synth_1to1_real_s_sse_asm INT123_synth_1to1_real_s_sse_asm
#define synth_1to1_s32_s_sse_asm INT123_synth_1to1_s32_s_sse_asm
#define synth_1to1_s_x86_64_asm INT123_synth_1to1_s_x86_64_asm
#define synth_1to1_s_x86_64_accurate_asm INT123_synth_1to1_s_x86_64_accurate_asm
#define synth_1to1_real_s_x86_64_asm INT123_synth_1to1_real_s_x86_64_asm
#define synth_1to1_s32_s_x86_64_asm INT123_synth_1to1_s32_s_x86_64_asm
#define synth_1to1_x86_64_asm INT123_synth_1to1_x86_64_asm
#define synth_1to1_x86_64_accurate_asm INT123_synth_1to1_x86_64_accurate_asm
#define synth_1to1_real_x86_64_asm INT123_synth_1to1_real_x86_64_asm
#define synth_1to1_s32_x86_64_asm INT123_synth_1to1_s32_x86_64_asm
#define synth_1to1_s_avx_asm INT123_synth_1to1_s_avx_asm
#define synth_1to1_s_avx_accurate_asm INT123_synth_1to1_s_avx_accurate_asm
#define synth_1to1_real_s_avx_asm INT123_synth_1to1_real_s_avx_asm
#define synth_1to1_s32_s_avx_asm INT123_synth_1to1_s32_s_avx_asm
#define synth_1to1_neon_asm INT123_synth_1to1_neon_asm
#define synth_1to1_neon_accurate_asm INT123_synth_1to1_neon_accurate_asm
#define synth_1to1_real_neon_asm INT123_synth_1to1_real_neon_asm
#define synth_1to1_s32_neon_asm INT123_synth_1to1_s32_neon_asm
#define synth_1to1_s_neon_asm INT123_synth_1to1_s_neon_asm
#define synth_1to1_s_neon_accurate_asm INT123_synth_1to1_s_neon_accurate_asm
#define synth_1to1_real_s_neon_asm INT123_synth_1to1_real_s_neon_asm
#define synth_1to1_s32_s_neon_asm INT123_synth_1to1_s32_s_neon_asm
#define costab_mmxsse INT123_costab_mmxsse
#define make_decode_tables_mmx_asm INT123_make_decode_tables_mmx_asm
#endif

View File

@ -1,278 +0,0 @@
/*
l12_integer_tables.h: Layer1/2 Constant tables for integer decoders
copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Taihei Monma
*/
#ifndef MPG123_L12_INTEGER_TABLES_H
#define MPG123_L12_INTEGER_TABLES_H
static const real layer12_table[27][64] =
{
{
},
{
-1431655765,-1136305934,-901886617,-715827883,-568152967,-450943309,-357913941,-284076483,
-225471654,-178956971,-142038242,-112735827,-89478485,-71019121,-56367914,-44739243,
-35509560,-28183957,-22369621,-17754780,-14091978,-11184811,-8877390,-7045989,
-5592405,-4438695,-3522995,-2796203,-2219348,-1761497,-1398101,-1109674,
-880749,-699051,-554837,-440374,-349525,-277418,-220187,-174763,
-138709,-110094,-87381,-69355,-55047,-43691,-34677,-27523,
-21845,-17339,-13762,-10923,-8669,-6881,-5461,-4335,
-3440,-2731,-2167,-1720,-1365,-1084,-860,0
},
{
1431655765,1136305934,901886617,715827883,568152967,450943309,357913941,284076483,
225471654,178956971,142038242,112735827,89478485,71019121,56367914,44739243,
35509560,28183957,22369621,17754780,14091978,11184811,8877390,7045989,
5592405,4438695,3522995,2796203,2219348,1761497,1398101,1109674,
880749,699051,554837,440374,349525,277418,220187,174763,
138709,110094,87381,69355,55047,43691,34677,27523,
21845,17339,13762,10923,8669,6881,5461,4335,
3440,2731,2167,1720,1365,1084,860,0
},
{
613566757,486988257,386522836,306783378,243494129,193261418,153391689,121747064,
96630709,76695845,60873532,48315355,38347922,30436766,24157677,19173961,
15218383,12078839,9586981,7609192,6039419,4793490,3804596,3019710,
2396745,1902298,1509855,1198373,951149,754927,599186,475574,
377464,299593,237787,188732,149797,118894,94366,74898,
59447,47183,37449,29723,23591,18725,14862,11796,
9362,7431,5898,4681,3715,2949,2341,1858,
1474,1170,929,737,585,464,369,0
},
{
286331153,227261187,180377323,143165577,113630593,90188662,71582788,56815297,
45094331,35791394,28407648,22547165,17895697,14203824,11273583,8947849,
7101912,5636791,4473924,3550956,2818396,2236962,1775478,1409198,
1118481,887739,704599,559241,443870,352299,279620,221935,
176150,139810,110967,88075,69905,55484,44037,34953,
27742,22019,17476,13871,11009,8738,6935,5505,
4369,3468,2752,2185,1734,1376,1092,867,
688,546,433,344,273,217,172,0
},
{
138547332,109965090,87279350,69273666,54982545,43639675,34636833,27491273,
21819838,17318417,13745636,10909919,8659208,6872818,5454959,4329604,
3436409,2727480,2164802,1718205,1363740,1082401,859102,681870,
541201,429551,340935,270600,214776,170467,135300,107388,
85234,67650,53694,42617,33825,26847,21308,16913,
13423,10654,8456,6712,5327,4228,3356,2664,
2114,1678,1332,1057,839,666,529,419,
333,264,210,166,132,105,83,0
},
{
68174084,54109806,42946982,34087042,27054903,21473491,17043521,13527452,
10736745,8521761,6763726,5368373,4260880,3381863,2684186,2130440,
1690931,1342093,1065220,845466,671047,532610,422733,335523,
266305,211366,167762,133153,105683,83881,66576,52842,
41940,33288,26421,20970,16644,13210,10485,8322,
6605,5243,4161,3303,2621,2081,1651,1311,
1040,826,655,520,413,328,260,206,
164,130,103,82,65,52,41,0
},
{
33818640,26841872,21304408,16909320,13420936,10652204,8454660,6710468,
5326102,4227330,3355234,2663051,2113665,1677617,1331526,1056833,
838809,665763,528416,419404,332881,264208,209702,166441,
132104,104851,83220,66052,52426,41610,33026,26213,
20805,16513,13106,10403,8257,6553,5201,4128,
3277,2601,2064,1638,1300,1032,819,650,
516,410,325,258,205,163,129,102,
81,65,51,41,32,26,20,0
},
{
16843009,13368305,10610431,8421505,6684153,5305215,4210752,3342076,
2652608,2105376,1671038,1326304,1052688,835519,663152,526344,
417760,331576,263172,208880,165788,131586,104440,82894,
65793,52220,41447,32897,26110,20723,16448,13055,
10362,8224,6527,5181,4112,3264,2590,2056,
1632,1295,1028,816,648,514,408,324,
257,204,162,129,102,81,64,51,
40,32,25,20,16,13,10,0
},
{
8405024,6671072,5294833,4202512,3335536,2647417,2101256,1667768,
1323708,1050628,833884,661854,525314,416942,330927,262657,
208471,165464,131329,104236,82732,65664,52118,41366,
32832,26059,20683,16416,13029,10341,8208,6515,
5171,4104,3257,2585,2052,1629,1293,1026,
814,646,513,407,323,257,204,162,
128,102,81,64,51,40,32,25,
20,16,13,10,8,6,5,0
},
{
4198404,3332275,2644829,2099202,1666138,1322414,1049601,833069,
661207,524801,416534,330604,262400,208267,165302,131200,
104134,82651,65600,52067,41325,32800,26033,20663,
16400,13017,10331,8200,6508,5166,4100,3254,
2583,2050,1627,1291,1025,814,646,513,
407,323,256,203,161,128,102,81,
64,51,40,32,25,20,16,13,
10,8,6,5,4,3,3,0
},
{
2098177,1665324,1321768,1049088,832662,660884,524544,416331,
330442,262272,208165,165221,131136,104083,82611,65568,
52041,41305,32784,26021,20653,16392,13010,10326,
8196,6505,5163,4098,3253,2582,2049,1626,
1291,1025,813,645,512,407,323,256,
203,161,128,102,81,64,51,40,
32,25,20,16,13,10,8,6,
5,4,3,3,2,2,1,0
},
{
1048832,832459,660723,524416,416229,330361,262208,208115,
165181,131104,104057,82590,65552,52029,41295,32776,
26014,20648,16388,13007,10324,8194,6504,5162,
4097,3252,2581,2049,1626,1290,1024,813,
645,512,406,323,256,203,161,128,
102,81,64,51,40,32,25,20,
16,13,10,8,6,5,4,3,
3,2,2,1,1,1,1,0
},
{
524352,416178,330321,262176,208089,165161,131088,104045,
82580,65544,52022,41290,32772,26011,20645,16386,
13006,10323,8193,6503,5161,4097,3251,2581,
2048,1626,1290,1024,813,645,512,406,
323,256,203,161,128,102,81,64,
51,40,32,25,20,16,13,10,
8,6,5,4,3,3,2,2,
1,1,1,1,1,0,0,0
},
{
262160,208077,165150,131080,104038,82575,65540,52019,
41288,32770,26010,20644,16385,13005,10322,8193,
6502,5161,4096,3251,2580,2048,1626,1290,
1024,813,645,512,406,323,256,203,
161,128,102,81,64,51,40,32,
25,20,16,13,10,8,6,5,
4,3,3,2,2,1,1,1,
1,1,0,0,0,0,0,0
},
{
131076,104035,82573,65538,52018,41286,32769,26009,
20643,16385,13004,10322,8192,6502,5161,4096,
3251,2580,2048,1626,1290,1024,813,645,
512,406,323,256,203,161,128,102,
81,64,51,40,32,25,20,16,
13,10,8,6,5,4,3,3,
2,2,1,1,1,1,1,0,
0,0,0,0,0,0,0,0
},
{
65537,52017,41286,32769,26008,20643,16384,13004,
10321,8192,6502,5161,4096,3251,2580,2048,
1626,1290,1024,813,645,512,406,323,
256,203,161,128,102,81,64,51,
40,32,25,20,16,13,10,8,
6,5,4,3,3,2,2,1,
1,1,1,1,0,0,0,0,
0,0,0,0,0,0,0,0
},
{
-1717986918,-1363567121,-1082263941,-858993459,-681783560,-541131970,-429496730,-340891780,
-270565985,-214748365,-170445890,-135282993,-107374182,-85222945,-67641496,-53687091,
-42611473,-33820748,-26843546,-21305736,-16910374,-13421773,-10652868,-8455187,
-6710886,-5326434,-4227594,-3355443,-2663217,-2113797,-1677722,-1331609,
-1056898,-838861,-665804,-528449,-419430,-332902,-264225,-209715,
-166451,-132112,-104858,-83226,-66056,-52429,-41613,-33028,
-26214,-20806,-16514,-13107,-10403,-8257,-6554,-5202,
-4129,-3277,-2601,-2064,-1638,-1300,-1032,0
},
{
-858993459,-681783560,-541131970,-429496730,-340891780,-270565985,-214748365,-170445890,
-135282993,-107374182,-85222945,-67641496,-53687091,-42611473,-33820748,-26843546,
-21305736,-16910374,-13421773,-10652868,-8455187,-6710886,-5326434,-4227594,
-3355443,-2663217,-2113797,-1677722,-1331609,-1056898,-838861,-665804,
-528449,-419430,-332902,-264225,-209715,-166451,-132112,-104858,
-83226,-66056,-52429,-41613,-33028,-26214,-20806,-16514,
-13107,-10403,-8257,-6554,-5202,-4129,-3277,-2601,
-2064,-1638,-1300,-1032,-819,-650,-516,0
},
{
858993459,681783560,541131970,429496730,340891780,270565985,214748365,170445890,
135282993,107374182,85222945,67641496,53687091,42611473,33820748,26843546,
21305736,16910374,13421773,10652868,8455187,6710886,5326434,4227594,
3355443,2663217,2113797,1677722,1331609,1056898,838861,665804,
528449,419430,332902,264225,209715,166451,132112,104858,
83226,66056,52429,41613,33028,26214,20806,16514,
13107,10403,8257,6554,5202,4129,3277,2601,
2064,1638,1300,1032,819,650,516,0
},
{
1717986918,1363567121,1082263941,858993459,681783560,541131970,429496730,340891780,
270565985,214748365,170445890,135282993,107374182,85222945,67641496,53687091,
42611473,33820748,26843546,21305736,16910374,13421773,10652868,8455187,
6710886,5326434,4227594,3355443,2663217,2113797,1677722,1331609,
1056898,838861,665804,528449,419430,332902,264225,209715,
166451,132112,104858,83226,66056,52429,41613,33028,
26214,20806,16514,13107,10403,8257,6554,5202,
4129,3277,2601,2064,1638,1300,1032,0
},
{
-1908874354,-1515074579,-1202515490,-954437177,-757537289,-601257745,-477218588,-378768645,
-300628872,-238609294,-189384322,-150314436,-119304647,-94692161,-75157218,-59652324,
-47346081,-37578609,-29826162,-23673040,-18789305,-14913081,-11836520,-9394652,
-7456540,-5918260,-4697326,-3728270,-2959130,-2348663,-1864135,-1479565,
-1174332,-932068,-739783,-587166,-466034,-369891,-293583,-233017,
-184946,-146791,-116508,-92473,-73396,-58254,-46236,-36698,
-29127,-23118,-18349,-14564,-11559,-9174,-7282,-5780,
-4587,-3641,-2890,-2294,-1820,-1445,-1147,0
},
{
-954437177,-757537289,-601257745,-477218588,-378768645,-300628872,-238609294,-189384322,
-150314436,-119304647,-94692161,-75157218,-59652324,-47346081,-37578609,-29826162,
-23673040,-18789305,-14913081,-11836520,-9394652,-7456540,-5918260,-4697326,
-3728270,-2959130,-2348663,-1864135,-1479565,-1174332,-932068,-739783,
-587166,-466034,-369891,-293583,-233017,-184946,-146791,-116508,
-92473,-73396,-58254,-46236,-36698,-29127,-23118,-18349,
-14564,-11559,-9174,-7282,-5780,-4587,-3641,-2890,
-2294,-1820,-1445,-1147,-910,-722,-573,0
},
{
-477218588,-378768645,-300628872,-238609294,-189384322,-150314436,-119304647,-94692161,
-75157218,-59652324,-47346081,-37578609,-29826162,-23673040,-18789305,-14913081,
-11836520,-9394652,-7456540,-5918260,-4697326,-3728270,-2959130,-2348663,
-1864135,-1479565,-1174332,-932068,-739783,-587166,-466034,-369891,
-293583,-233017,-184946,-146791,-116508,-92473,-73396,-58254,
-46236,-36698,-29127,-23118,-18349,-14564,-11559,-9174,
-7282,-5780,-4587,-3641,-2890,-2294,-1820,-1445,
-1147,-910,-722,-573,-455,-361,-287,0
},
{
477218588,378768645,300628872,238609294,189384322,150314436,119304647,94692161,
75157218,59652324,47346081,37578609,29826162,23673040,18789305,14913081,
11836520,9394652,7456540,5918260,4697326,3728270,2959130,2348663,
1864135,1479565,1174332,932068,739783,587166,466034,369891,
293583,233017,184946,146791,116508,92473,73396,58254,
46236,36698,29127,23118,18349,14564,11559,9174,
7282,5780,4587,3641,2890,2294,1820,1445,
1147,910,722,573,455,361,287,0
},
{
954437177,757537289,601257745,477218588,378768645,300628872,238609294,189384322,
150314436,119304647,94692161,75157218,59652324,47346081,37578609,29826162,
23673040,18789305,14913081,11836520,9394652,7456540,5918260,4697326,
3728270,2959130,2348663,1864135,1479565,1174332,932068,739783,
587166,466034,369891,293583,233017,184946,146791,116508,
92473,73396,58254,46236,36698,29127,23118,18349,
14564,11559,9174,7282,5780,4587,3641,2890,
2294,1820,1445,1147,910,722,573,0
},
{
1908874354,1515074579,1202515490,954437177,757537289,601257745,477218588,378768645,
300628872,238609294,189384322,150314436,119304647,94692161,75157218,59652324,
47346081,37578609,29826162,23673040,18789305,14913081,11836520,9394652,
7456540,5918260,4697326,3728270,2959130,2348663,1864135,1479565,
1174332,932068,739783,587166,466034,369891,293583,233017,
184946,146791,116508,92473,73396,58254,46236,36698,
29127,23118,18349,14564,11559,9174,7282,5780,
4587,3641,2890,2294,1820,1445,1147,0
},
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,155 +0,0 @@
/*
layer1.c: the layer 1 decoder
copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
may have a few bugs after last optimization ...
*/
#include "mpg123lib_intern.h"
#include "getbits.h"
static void I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT],mpg123_handle *fr)
{
unsigned int *ba=balloc;
unsigned int *sca = (unsigned int *) scale_index;
if(fr->stereo == 2)
{
int i;
int jsbound = fr->jsbound;
for(i=0;i<jsbound;i++)
{
*ba++ = getbits(fr, 4);
*ba++ = getbits(fr, 4);
}
for(i=jsbound;i<SBLIMIT;i++) *ba++ = getbits(fr, 4);
ba = balloc;
for(i=0;i<jsbound;i++)
{
if ((*ba++))
*sca++ = getbits(fr, 6);
if ((*ba++))
*sca++ = getbits(fr, 6);
}
for (i=jsbound;i<SBLIMIT;i++)
if((*ba++))
{
*sca++ = getbits(fr, 6);
*sca++ = getbits(fr, 6);
}
}
else
{
int i;
for(i=0;i<SBLIMIT;i++) *ba++ = getbits(fr, 4);
ba = balloc;
for (i=0;i<SBLIMIT;i++)
if ((*ba++))
*sca++ = getbits(fr, 6);
}
}
static void I_step_two(real fraction[2][SBLIMIT],unsigned int balloc[2*SBLIMIT], unsigned int scale_index[2][SBLIMIT],mpg123_handle *fr)
{
int i,n;
int smpb[2*SBLIMIT]; /* values: 0-65535 */
int *sample;
register unsigned int *ba;
register unsigned int *sca = (unsigned int *) scale_index;
if(fr->stereo == 2)
{
int jsbound = fr->jsbound;
register real *f0 = fraction[0];
register real *f1 = fraction[1];
ba = balloc;
for(sample=smpb,i=0;i<jsbound;i++)
{
if((n = *ba++)) *sample++ = getbits(fr, n+1);
if((n = *ba++)) *sample++ = getbits(fr, n+1);
}
for(i=jsbound;i<SBLIMIT;i++)
if((n = *ba++))
*sample++ = getbits(fr, n+1);
ba = balloc;
for(sample=smpb,i=0;i<jsbound;i++)
{
if((n=*ba++))
*f0++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15( ((-1)<<n) + (*sample++) + 1), fr->muls[n+1][*sca++]);
else *f0++ = DOUBLE_TO_REAL(0.0);
if((n=*ba++))
*f1++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15( ((-1)<<n) + (*sample++) + 1), fr->muls[n+1][*sca++]);
else *f1++ = DOUBLE_TO_REAL(0.0);
}
for(i=jsbound;i<SBLIMIT;i++)
{
if((n=*ba++))
{
real samp = DOUBLE_TO_REAL_15( ((-1)<<n) + (*sample++) + 1);
*f0++ = REAL_MUL_SCALE_LAYER12(samp, fr->muls[n+1][*sca++]);
*f1++ = REAL_MUL_SCALE_LAYER12(samp, fr->muls[n+1][*sca++]);
}
else *f0++ = *f1++ = DOUBLE_TO_REAL(0.0);
}
for(i=fr->down_sample_sblimit;i<32;i++)
fraction[0][i] = fraction[1][i] = 0.0;
}
else
{
register real *f0 = fraction[0];
ba = balloc;
for(sample=smpb,i=0;i<SBLIMIT;i++)
if ((n = *ba++))
*sample++ = getbits(fr, n+1);
ba = balloc;
for(sample=smpb,i=0;i<SBLIMIT;i++)
{
if((n=*ba++))
*f0++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15( ((-1)<<n) + (*sample++) + 1), fr->muls[n+1][*sca++]);
else *f0++ = DOUBLE_TO_REAL(0.0);
}
for(i=fr->down_sample_sblimit;i<32;i++)
fraction[0][i] = DOUBLE_TO_REAL(0.0);
}
}
int do_layer1(mpg123_handle *fr)
{
int clip=0;
int i,stereo = fr->stereo;
unsigned int balloc[2*SBLIMIT];
unsigned int scale_index[2][SBLIMIT];
real (*fraction)[SBLIMIT] = fr->layer1.fraction; /* fraction[2][SBLIMIT] */
int single = fr->single;
fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : 32;
if(stereo == 1 || single == SINGLE_MIX) /* I don't see mixing handled here */
single = SINGLE_LEFT;
I_step_one(balloc,scale_index,fr);
for(i=0;i<SCALE_BLOCK;i++)
{
I_step_two(fraction,balloc,scale_index,fr);
if(single != SINGLE_STEREO)
clip += (fr->synth_mono)(fraction[single], fr);
else
clip += (fr->synth_stereo)(fraction[0], fraction[1], fr);
}
return clip;
}

View File

@ -1,371 +0,0 @@
/*
layer2.c: the layer 2 decoder, root of mpg123
copyright 1994-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
mpg123 started as mp2 decoder a long time ago...
part of this file is required for layer 1, too.
*/
#include "mpg123lib_intern.h"
#ifndef NO_LAYER2
#include "l2tables.h"
#endif
#include "getbits.h"
#ifndef NO_LAYER12 /* Stuff needed for layer I and II. */
static int grp_3tab[32 * 3] = { 0, }; /* used: 27 */
static int grp_5tab[128 * 3] = { 0, }; /* used: 125 */
static int grp_9tab[1024 * 3] = { 0, }; /* used: 729 */
#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
#include "l12_integer_tables.h"
#else
static const double mulmul[27] =
{
0.0 , -2.0/3.0 , 2.0/3.0 ,
2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 ,
2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 ,
2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 ,
-4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 ,
-8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0
};
#endif
void init_layer12(void)
{
const int base[3][9] =
{
{ 1 , 0, 2 , } ,
{ 17, 18, 0 , 19, 20 , } ,
{ 21, 1, 22, 23, 0, 24, 25, 2, 26 }
};
int i,j,k,l,len;
const int tablen[3] = { 3 , 5 , 9 };
int *itable;
int *tables[3] = { grp_3tab , grp_5tab , grp_9tab };
for(i=0;i<3;i++)
{
itable = tables[i];
len = tablen[i];
for(j=0;j<len;j++)
for(k=0;k<len;k++)
for(l=0;l<len;l++)
{
*itable++ = base[i][l];
*itable++ = base[i][k];
*itable++ = base[i][j];
}
}
}
void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m))
{
int k;
real *table;
for(k=0;k<27;k++)
{
table = init_table(fr, fr->muls[k], k);
*table++ = 0.0;
}
}
real* init_layer12_table(mpg123_handle *fr, real *table, int m)
{
#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
int i;
for(i=0;i<63;i++)
*table++ = layer12_table[m][i];
#else
int i,j;
for(j=3,i=0;i<63;i++,j--)
*table++ = DOUBLE_TO_REAL_SCALE_LAYER12(mulmul[m] * pow(2.0,(double) j / 3.0));
#endif
return table;
}
#ifdef OPT_MMXORSSE
real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m)
{
int i,j;
if(!fr->p.down_sample)
{
for(j=3,i=0;i<63;i++,j--)
*table++ = DOUBLE_TO_REAL(16384 * mulmul[m] * pow(2.0,(double) j / 3.0));
}
else
{
for(j=3,i=0;i<63;i++,j--)
*table++ = DOUBLE_TO_REAL(mulmul[m] * pow(2.0,(double) j / 3.0));
}
return table;
}
#endif
#endif /* NO_LAYER12 */
/* The rest is the actual decoding of layer II data. */
#ifndef NO_LAYER2
static void II_step_one(unsigned int *bit_alloc,int *scale,mpg123_handle *fr)
{
int stereo = fr->stereo-1;
int sblimit = fr->II_sblimit;
int jsbound = fr->jsbound;
int sblimit2 = fr->II_sblimit<<stereo;
const struct al_table *alloc1 = fr->alloc;
int i;
unsigned int scfsi_buf[64];
unsigned int *scfsi,*bita;
int sc,step;
bita = bit_alloc;
if(stereo)
{
for(i=jsbound;i;i--,alloc1+=(1<<step))
{
step=alloc1->bits;
*bita++ = (char) getbits(fr, step);
*bita++ = (char) getbits(fr, step);
}
for(i=sblimit-jsbound;i;i--,alloc1+=(1<<step))
{
step=alloc1->bits;
bita[0] = (char) getbits(fr, step);
bita[1] = bita[0];
bita+=2;
}
bita = bit_alloc;
scfsi=scfsi_buf;
for(i=sblimit2;i;i--)
if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2);
}
else /* mono */
{
for(i=sblimit;i;i--,alloc1+=(1<<step))
{
step=alloc1->bits;
*bita++ = (char) getbits(fr, step);
}
bita = bit_alloc;
scfsi=scfsi_buf;
for(i=sblimit;i;i--)
if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2);
}
bita = bit_alloc;
scfsi=scfsi_buf;
for(i=sblimit2;i;i--)
if(*bita++)
switch(*scfsi++)
{
case 0:
*scale++ = (int) getbits_fast(fr, 6);
*scale++ = (int) getbits_fast(fr, 6);
*scale++ = (int) getbits_fast(fr, 6);
break;
case 1 :
*scale++ = sc = (int) getbits_fast(fr, 6);
*scale++ = sc;
*scale++ = (int) getbits_fast(fr, 6);
break;
case 2:
*scale++ = sc = (int) getbits_fast(fr, 6);
*scale++ = sc;
*scale++ = sc;
break;
default: /* case 3 */
*scale++ = (int) getbits_fast(fr, 6);
*scale++ = sc = (int) getbits_fast(fr, 6);
*scale++ = sc;
break;
}
}
static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,mpg123_handle *fr,int x1)
{
int i,j,k,ba;
int stereo = fr->stereo;
int sblimit = fr->II_sblimit;
int jsbound = fr->jsbound;
const struct al_table *alloc2,*alloc1 = fr->alloc;
unsigned int *bita=bit_alloc;
int d1,step;
for(i=0;i<jsbound;i++,alloc1+=(1<<step))
{
step = alloc1->bits;
for(j=0;j<stereo;j++)
{
if( (ba=*bita++) )
{
k=(alloc2 = alloc1+ba)->bits;
if( (d1=alloc2->d) < 0)
{
real cm=fr->muls[k][scale[x1]];
fraction[j][0][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
fraction[j][1][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
fraction[j][2][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
}
else
{
const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
unsigned int idx,*tab,m=scale[x1];
idx = (unsigned int) getbits(fr, k);
tab = (unsigned int *) (table[d1] + idx + idx + idx);
fraction[j][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
fraction[j][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
fraction[j][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m]);
}
scale+=3;
}
else
fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0);
}
}
for(i=jsbound;i<sblimit;i++,alloc1+=(1<<step))
{
step = alloc1->bits;
bita++; /* channel 1 and channel 2 bitalloc are the same */
if( (ba=*bita++) )
{
k=(alloc2 = alloc1+ba)->bits;
if( (d1=alloc2->d) < 0)
{
real cm;
cm=fr->muls[k][scale[x1+3]];
fraction[0][0][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
fraction[0][1][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
fraction[0][2][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
fraction[1][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm);
fraction[1][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm);
fraction[1][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm);
cm=fr->muls[k][scale[x1]];
fraction[0][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm);
fraction[0][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm);
fraction[0][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm);
}
else
{
const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
unsigned int idx,*tab,m1,m2;
m1 = scale[x1]; m2 = scale[x1+3];
idx = (unsigned int) getbits(fr, k);
tab = (unsigned int *) (table[d1] + idx + idx + idx);
fraction[0][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]);
fraction[0][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]);
fraction[0][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m2]);
}
scale+=6;
}
else
{
fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] =
fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = DOUBLE_TO_REAL(0.0);
}
/*
Historic comment...
should we use individual scalefac for channel 2 or
is the current way the right one , where we just copy channel 1 to
channel 2 ??
The current 'strange' thing is, that we throw away the scalefac
values for the second channel ...!!
-> changed .. now we use the scalefac values of channel one !!
*/
}
if(sblimit > (fr->down_sample_sblimit) )
sblimit = fr->down_sample_sblimit;
for(i=sblimit;i<SBLIMIT;i++)
for (j=0;j<stereo;j++)
fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0);
}
static void II_select_table(mpg123_handle *fr)
{
const int translate[3][2][16] =
{
{
{ 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 },
{ 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 }
},
{
{ 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 },
{ 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 }
},
{
{ 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 },
{ 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 }
}
};
int table,sblim;
const struct al_table *tables[5] = { alloc_0, alloc_1, alloc_2, alloc_3 , alloc_4 };
const int sblims[5] = { 27 , 30 , 8, 12 , 30 };
if(fr->sampling_frequency >= 3) /* Or equivalent: (fr->lsf == 1) */
table = 4;
else
table = translate[fr->sampling_frequency][2-fr->stereo][fr->bitrate_index];
sblim = sblims[table];
fr->alloc = tables[table];
fr->II_sblimit = sblim;
}
int do_layer2(mpg123_handle *fr)
{
int clip=0;
int i,j;
int stereo = fr->stereo;
/* pick_table clears unused subbands */
/* replacement for real fraction[2][4][SBLIMIT], needs alignment. */
real (*fraction)[4][SBLIMIT] = fr->layer2.fraction;
unsigned int bit_alloc[64];
int scale[192];
int single = fr->single;
II_select_table(fr);
fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit;
if(fr->jsbound > fr->II_sblimit)
{
fprintf(stderr, "Truncating stereo boundary to sideband limit.\n");
fr->jsbound=fr->II_sblimit;
}
/* TODO: What happens with mono mixing, actually? */
if(stereo == 1 || single == SINGLE_MIX) /* also, mix not really handled */
single = SINGLE_LEFT;
II_step_one(bit_alloc, scale, fr);
for(i=0;i<SCALE_BLOCK;i++)
{
II_step_two(bit_alloc,fraction,scale,fr,i>>2);
for(j=0;j<3;j++)
{
if(single != SINGLE_STEREO)
clip += (fr->synth_mono)(fraction[single][j], fr);
else
clip += (fr->synth_stereo)(fraction[0][j], fraction[1][j], fr);
}
}
return clip;
}
#endif /* NO_LAYER2 */

File diff suppressed because it is too large Load Diff

View File

@ -1,222 +0,0 @@
/*
lfs_alias: Aliases to the small/native API functions with the size of long int as suffix.
copyright 2010-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
Use case: Client code on Linux/x86-64 that defines _FILE_OFFSET_BITS to 64,
which is the only choice on that platform anyway. It should be no-op, but
prompts the platform-agnostic header of mpg123 to define API calls with the
corresponding suffix. This file provides the names for this case. It's cruft,
but glibc does it, too -- so people rely on it.
Oh, and it also caters for the lunatics that define _FILE_OFFSET_BITS=32 on
32 bit platforms. In addition, it's needed for platforms that always have
off_t /= long, and clients still insisting on defining _FILE_OFFSET_BITS.
Depending on use case, the aliases map to 32 (small) or 64 bit (large) offset
functions, to the ones from libmpg123 or the ones from lfs_wrap.
So, two basic cases:
1. mpg123_bla_32 alias for mpg123_bla (native)
2. mpg123_bla alias for mpg123_bla_32 (wrapper)
Same for 64 bits. Confusing, I know. It sucks.
Note that the mpg123 header is _not_ used here to avoid definition with whacky off_t.
The aliases are always about arguments of native alias_t type. This can be off_t, but
on Linux/x86, this is long int. The off_t declarations in mpg123.h confuse things,
so reproduce definitions for the wrapper functions in that case. The definitions are
pulled by an inline Perl script in any case ... no need to copy anything manually!
As a benefit, one can skip undefining possible largefile namings.
*/
#include "config.h"
/* Hack for Solaris: Some system headers included from compat.h might force _FILE_OFFSET_BITS. Need to follow that here.
Also, want it around to have types defined. */
#include "compat.h"
#ifndef LFS_ALIAS_BITS
#error "I need the count of alias bits here."
#endif
#define MACROCAT_REALLY(a, b) a ## b
#define MACROCAT(a, b) MACROCAT_REALLY(a, b)
/* This is wicked switchery: Decide which way the aliases are facing. */
#if _FILE_OFFSET_BITS+0 == LFS_ALIAS_BITS
/* The native functions have suffix, the aliases not. */
#define NATIVE_SUFFIX MACROCAT(_, _FILE_OFFSET_BITS)
#define NATIVE_NAME(func) MACROCAT(func, NATIVE_SUFFIX)
#define ALIAS_NAME(func) func
#else
/* The alias functions have suffix, the native ones not. */
#define ALIAS_SUFFIX MACROCAT(_, LFS_ALIAS_BITS)
#define ALIAS_NAME(func) MACROCAT(func, ALIAS_SUFFIX)
#define NATIVE_NAME(func) func
#endif
/* Copy of necessary definitions, actually just forward declarations. */
struct mpg123_handle_struct;
typedef struct mpg123_handle_struct mpg123_handle;
/* Get attribute_align_arg, to stay safe. */
#include "abi_align.h"
/*
Extract the list of functions we need wrappers for, pregenerating the wrappers for simple cases (inline script for nedit):
perl -ne '
if(/^\s*EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/)
{
my $type = $1;
my $name = $2;
my $args = $3;
next unless ($type =~ /off_t/ or $args =~ /off_t/ or ($name =~ /open/ and $name ne mpg123_open_feed));
$type =~ s/off_t/lfs_alias_t/g;
my @nargs = ();
$args =~ s/off_t/lfs_alias_t/g;
foreach my $a (split(/,/, $args))
{
$a =~ s/^.*\s\**([a-z_]+)$/$1/;
push(@nargs, $a);
}
my $nargs = join(", ", @nargs);
$nargs = "Human: figure me out." if($nargs =~ /\(/);
print <<EOT
$type NATIVE_NAME($name)($args);
$type attribute_align_arg ALIAS_NAME($name)($args)
{
return NATIVE_NAME($name)($nargs);
}
EOT
}' < mpg123.h.in
*/
int NATIVE_NAME(mpg123_open)(mpg123_handle *mh, const char *path);
int attribute_align_arg ALIAS_NAME(mpg123_open)(mpg123_handle *mh, const char *path)
{
return NATIVE_NAME(mpg123_open)(mh, path);
}
int NATIVE_NAME(mpg123_open_fd)(mpg123_handle *mh, int fd);
int attribute_align_arg ALIAS_NAME(mpg123_open_fd)(mpg123_handle *mh, int fd)
{
return NATIVE_NAME(mpg123_open_fd)(mh, fd);
}
int NATIVE_NAME(mpg123_open_handle)(mpg123_handle *mh, void *iohandle);
int attribute_align_arg ALIAS_NAME(mpg123_open_handle)(mpg123_handle *mh, void *iohandle)
{
return NATIVE_NAME(mpg123_open_handle)(mh, iohandle);
}
int NATIVE_NAME(mpg123_decode_frame)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes);
int attribute_align_arg ALIAS_NAME(mpg123_decode_frame)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes)
{
return NATIVE_NAME(mpg123_decode_frame)(mh, num, audio, bytes);
}
int NATIVE_NAME(mpg123_framebyframe_decode)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes);
int attribute_align_arg ALIAS_NAME(mpg123_framebyframe_decode)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes)
{
return NATIVE_NAME(mpg123_framebyframe_decode)(mh, num, audio, bytes);
}
lfs_alias_t NATIVE_NAME(mpg123_framepos)(mpg123_handle *mh);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_framepos)(mpg123_handle *mh)
{
return NATIVE_NAME(mpg123_framepos)(mh);
}
lfs_alias_t NATIVE_NAME(mpg123_tell)(mpg123_handle *mh);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_tell)(mpg123_handle *mh)
{
return NATIVE_NAME(mpg123_tell)(mh);
}
lfs_alias_t NATIVE_NAME(mpg123_tellframe)(mpg123_handle *mh);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_tellframe)(mpg123_handle *mh)
{
return NATIVE_NAME(mpg123_tellframe)(mh);
}
lfs_alias_t NATIVE_NAME(mpg123_tell_stream)(mpg123_handle *mh);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_tell_stream)(mpg123_handle *mh)
{
return NATIVE_NAME(mpg123_tell_stream)(mh);
}
lfs_alias_t NATIVE_NAME(mpg123_seek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_seek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence)
{
return NATIVE_NAME(mpg123_seek)(mh, sampleoff, whence);
}
lfs_alias_t NATIVE_NAME(mpg123_feedseek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence, lfs_alias_t *input_offset);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_feedseek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence, lfs_alias_t *input_offset)
{
return NATIVE_NAME(mpg123_feedseek)(mh, sampleoff, whence, input_offset);
}
lfs_alias_t NATIVE_NAME(mpg123_seek_frame)(mpg123_handle *mh, lfs_alias_t frameoff, int whence);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_seek_frame)(mpg123_handle *mh, lfs_alias_t frameoff, int whence)
{
return NATIVE_NAME(mpg123_seek_frame)(mh, frameoff, whence);
}
lfs_alias_t NATIVE_NAME(mpg123_timeframe)(mpg123_handle *mh, double sec);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_timeframe)(mpg123_handle *mh, double sec)
{
return NATIVE_NAME(mpg123_timeframe)(mh, sec);
}
int NATIVE_NAME(mpg123_index)(mpg123_handle *mh, lfs_alias_t **offsets, lfs_alias_t *step, size_t *fill);
int attribute_align_arg ALIAS_NAME(mpg123_index)(mpg123_handle *mh, lfs_alias_t **offsets, lfs_alias_t *step, size_t *fill)
{
return NATIVE_NAME(mpg123_index)(mh, offsets, step, fill);
}
int NATIVE_NAME(mpg123_set_index)(mpg123_handle *mh, lfs_alias_t *offsets, lfs_alias_t step, size_t fill);
int attribute_align_arg ALIAS_NAME(mpg123_set_index)(mpg123_handle *mh, lfs_alias_t *offsets, lfs_alias_t step, size_t fill)
{
return NATIVE_NAME(mpg123_set_index)(mh, offsets, step, fill);
}
int NATIVE_NAME(mpg123_position)( mpg123_handle *mh, lfs_alias_t frame_offset, lfs_alias_t buffered_bytes, lfs_alias_t *current_frame, lfs_alias_t *frames_left, double *current_seconds, double *seconds_left);
int attribute_align_arg ALIAS_NAME(mpg123_position)( mpg123_handle *mh, lfs_alias_t frame_offset, lfs_alias_t buffered_bytes, lfs_alias_t *current_frame, lfs_alias_t *frames_left, double *current_seconds, double *seconds_left)
{
return NATIVE_NAME(mpg123_position)(mh, frame_offset, buffered_bytes, current_frame, frames_left, current_seconds, seconds_left);
}
lfs_alias_t NATIVE_NAME(mpg123_length)(mpg123_handle *mh);
lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_length)(mpg123_handle *mh)
{
return NATIVE_NAME(mpg123_length)(mh);
}
int NATIVE_NAME(mpg123_set_filesize)(mpg123_handle *mh, lfs_alias_t size);
int attribute_align_arg ALIAS_NAME(mpg123_set_filesize)(mpg123_handle *mh, lfs_alias_t size)
{
return NATIVE_NAME(mpg123_set_filesize)(mh, size);
}
int NATIVE_NAME(mpg123_replace_reader)(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), lfs_alias_t (*r_lseek)(int, lfs_alias_t, int));
int attribute_align_arg ALIAS_NAME(mpg123_replace_reader)(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), lfs_alias_t (*r_lseek)(int, lfs_alias_t, int))
{
return NATIVE_NAME(mpg123_replace_reader)(mh, r_read, r_lseek);
}
int NATIVE_NAME(mpg123_replace_reader_handle)(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), lfs_alias_t (*r_lseek)(void *, lfs_alias_t, int), void (*cleanup)(void*));
int attribute_align_arg ALIAS_NAME(mpg123_replace_reader_handle)(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), lfs_alias_t (*r_lseek)(void *, lfs_alias_t, int), void (*cleanup)(void*))
{
return NATIVE_NAME(mpg123_replace_reader_handle)(mh, r_read, r_lseek, cleanup);
}

View File

@ -1,751 +0,0 @@
/*
lfs_wrap: Crappy wrapper code for supporting crappy ambiguous large file support.
copyright 2010 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis, thanks to Guido Draheim for consulting
This file contains wrappers for the case that _FILE_OFFSET_BITS (or equivalent, theoretically, depends on mpg123.h) is defined and thus certain mpg123 API calls get renamed with a suffix (p.ex. _64).
The renamed calls expect large off_t arguments, and possibly return large off_t values... these wrappers here provide the same functionality with long integer arguments/values.
Prototypical idea: There is
off_t mpg123_seek_64(mpg123_handle*, off_t, int)
This code provides
long mpg123_seek(mpg123_handle*, long, int)
This is rather simple business... wouldn't mpg123 offer replacing the I/O core with callbacks. Translating the callbacks between long and off_t world is the main reason why this file contains non-trivial code.
Note about file descriptors: We just assume that they are generally interchangeable between large and small file code... and that a large file descriptor will trigger errors when accessed with small file code where it may cause trouble (a really large file).
*/
/* It mainly needs the official API ... */
/* ... but also some inside access (frame struct, readers). */
#include "mpg123lib_intern.h"
/* Include the system headers _after_ the implied config.h!
Otherwise _FILE_OFFSET_BITS is not in effect! */
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "compat.h"
#include "debug.h"
/*
Now, start off easy... translate simple API calls.
I need to deal with these here:
perl -ne '
if(/^\s*EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/)
{
$type = $1;
$name = $2;
$args = $3;
next unless ($type =~ /off_t/ or $args =~ /off_t/);
print "$name\n" unless grep {$_ eq $name}
("mpg123_open", "mpg123_open_fd", "mpg123_open_handle", "mpg123_replace_reader", "mpg123_replace_reader_handle");
}' < mpg123.h.in
mpg123_decode_frame
mpg123_framebyframe_decode
mpg123_framepos
mpg123_tell
mpg123_tellframe
mpg123_tell_stream
mpg123_seek
mpg123_feedseek
mpg123_seek_frame
mpg123_timeframe
mpg123_index
mpg123_set_index
mpg123_position
mpg123_length
mpg123_set_filesize
mpg123_decode_raw ... that's experimental.
Let's work on them in that order.
*/
/* I see that I will need custom data storage. Main use is for the replaced I/O later, but the seek table for small file offsets needs extra storage, too. */
/* The wrapper handle for descriptor and handle I/O. */
/* The handle is used for nothing (0), or one of these two modes of operation: */
#define IO_FD 1 /* Wrapping over callbacks operation on integer file descriptor. */
#define IO_HANDLE 2 /* Wrapping over custom handle callbacks. */
struct wrap_data
{
/* Storage for small offset index table. */
long *indextable;
/* I/O handle stuff */
int iotype; /* IO_FD or IO_HANDLE */
/* Data for IO_FD. */
int fd;
int my_fd; /* A descriptor that the wrapper code opened itself. */
/* The actual callbacks from the outside. */
ssize_t (*r_read) (int, void *, size_t);
long (*r_lseek)(int, long, int);
/* Data for IO_HANDLE. */
void* handle;
ssize_t (*r_h_read)(void *, void *, size_t);
long (*r_h_lseek)(void*, long, int);
void (*h_cleanup)(void*);
};
/* Cleanup I/O part of the handle handle... but not deleting the wrapper handle itself.
That is stored in the frame and only deleted on mpg123_delete(). */
static void wrap_io_cleanup(void *handle)
{
struct wrap_data *ioh = handle;
if(ioh->iotype == IO_HANDLE)
{
if(ioh->h_cleanup != NULL && ioh->handle != NULL)
ioh->h_cleanup(ioh->handle);
ioh->handle = NULL;
}
if(ioh->my_fd >= 0)
{
close(ioh->my_fd);
ioh->my_fd = -1;
}
}
/* Really finish off the handle... freeing all memory. */
static void wrap_destroy(void *handle)
{
struct wrap_data *wh = handle;
wrap_io_cleanup(handle);
if(wh->indextable != NULL)
free(wh->indextable);
free(wh);
}
/* More helper code... extract the special wrapper handle, possible allocate and initialize it. */
static struct wrap_data* wrap_get(mpg123_handle *mh)
{
struct wrap_data* whd;
if(mh == NULL) return NULL;
/* Access the private storage inside the mpg123 handle.
The real callback functions and handles are stored there. */
if(mh->wrapperdata == NULL)
{
/* Create a new one. */
mh->wrapperdata = malloc(sizeof(struct wrap_data));
if(mh->wrapperdata == NULL)
{
mh->err = MPG123_OUT_OF_MEM;
return NULL;
}
/* When we have wrapper data present, the callback for its proper cleanup is needed. */
mh->wrapperclean = wrap_destroy;
whd = mh->wrapperdata;
whd->indextable = NULL;
whd->iotype = 0;
whd->fd = -1;
whd->my_fd = -1;
whd->r_read = NULL;
whd->r_lseek = NULL;
whd->handle = NULL;
whd->r_h_read = NULL;
whd->r_h_lseek = NULL;
whd->h_cleanup = NULL;
}
else whd = mh->wrapperdata;
return whd;
}
/* After settling the data... start with some simple wrappers. */
#undef mpg123_decode_frame
/* int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes) */
int attribute_align_arg mpg123_decode_frame(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes)
{
off_t largenum;
int err;
err = MPG123_LARGENAME(mpg123_decode_frame)(mh, &largenum, audio, bytes);
if(err == MPG123_OK && num != NULL)
{
*num = largenum;
if(*num != largenum)
{
mh->err = MPG123_LFS_OVERFLOW;
err = MPG123_ERR;
}
}
return err;
}
#undef mpg123_framebyframe_decode
/* int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); */
int attribute_align_arg mpg123_framebyframe_decode(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes)
{
off_t largenum;
int err;
err = MPG123_LARGENAME(mpg123_framebyframe_decode)(mh, &largenum, audio, bytes);
if(err == MPG123_OK && num != NULL)
{
*num = largenum;
if(*num != largenum)
{
mh->err = MPG123_LFS_OVERFLOW;
err = MPG123_ERR;
}
}
return err;
}
#undef mpg123_framepos
/* off_t mpg123_framepos(mpg123_handle *mh); */
long attribute_align_arg mpg123_framepos(mpg123_handle *mh)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_framepos)(mh);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
#undef mpg123_tell
/* off_t mpg123_tell(mpg123_handle *mh); */
long attribute_align_arg mpg123_tell(mpg123_handle *mh)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_tell)(mh);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
#undef mpg123_tellframe
/* off_t mpg123_tellframe(mpg123_handle *mh); */
long attribute_align_arg mpg123_tellframe(mpg123_handle *mh)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_tellframe)(mh);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
#undef mpg123_tell_stream
/* off_t mpg123_tell_stream(mpg123_handle *mh); */
long attribute_align_arg mpg123_tell_stream(mpg123_handle *mh)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_tell_stream)(mh);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
#undef mpg123_seek
/* off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); */
long attribute_align_arg mpg123_seek(mpg123_handle *mh, long sampleoff, int whence)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_seek)(mh, sampleoff, whence);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
#undef mpg123_feedseek
/* off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); */
long attribute_align_arg mpg123_feedseek(mpg123_handle *mh, long sampleoff, int whence, long *input_offset)
{
long val;
off_t largeioff;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_feedseek)(mh, sampleoff, whence, &largeioff);
/* Error/message codes are small... */
if(largeval < 0) return (long)largeval;
val = largeval;
*input_offset = largeioff;
if(val != largeval || *input_offset != largeioff)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
#undef mpg123_seek_frame
/* off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); */
long attribute_align_arg mpg123_seek_frame(mpg123_handle *mh, long frameoff, int whence)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_seek_frame)(mh, frameoff, whence);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
#undef mpg123_timeframe
/* off_t mpg123_timeframe(mpg123_handle *mh, double sec); */
long attribute_align_arg mpg123_timeframe(mpg123_handle *mh, double sec)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_timeframe)(mh, sec);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
/* Now something less simple: Index retrieval and manipulation.
The index is an _array_ of off_t, which means that I need to construct a copy with translated long values. */
#undef mpg123_index
/* int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill) */
int attribute_align_arg mpg123_index(mpg123_handle *mh, long **offsets, long *step, size_t *fill)
{
int err;
size_t i;
long smallstep;
size_t thefill;
off_t largestep;
off_t *largeoffsets;
struct wrap_data *whd;
whd = wrap_get(mh);
if(whd == NULL) return MPG123_ERR;
err = MPG123_LARGENAME(mpg123_index)(mh, &largeoffsets, &largestep, &thefill);
if(err != MPG123_OK) return err;
/* For a _very_ large file, even the step could overflow. */
smallstep = largestep;
if(smallstep != largestep)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
if(step != NULL) *step = smallstep;
/* When there are no values stored, there is no table content to take care of.
Table pointer does not matter. Mission completed. */
if(thefill == 0) return MPG123_OK;
if(fill != NULL) *fill = thefill;
/* Construct a copy of the index to hand over to the small-minded client. */
*offsets = safe_realloc(whd->indextable, (*fill)*sizeof(long));
if(*offsets == NULL)
{
mh->err = MPG123_OUT_OF_MEM;
return MPG123_ERR;
}
whd->indextable = *offsets;
/* Elaborate conversion of each index value, with overflow check. */
for(i=0; i<*fill; ++i)
{
whd->indextable[i] = largeoffsets[i];
if(whd->indextable[i] != largeoffsets[i])
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
}
/* If we came that far... there should be a valid copy of the table now. */
return MPG123_OK;
}
/* The writing does basically the same than the above, just the opposite.
Oh, and the overflow checks are not needed -- off_t is bigger than long. */
#undef mpg123_set_index
/* int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); */
int attribute_align_arg mpg123_set_index(mpg123_handle *mh, long *offsets, long step, size_t fill)
{
int err;
size_t i;
struct wrap_data *whd;
off_t *indextmp;
whd = wrap_get(mh);
if(whd == NULL) return MPG123_ERR;
/* Expensive temporary storage... for staying outside at the API layer. */
indextmp = malloc(fill*sizeof(off_t));
if(indextmp == NULL)
{
mh->err = MPG123_OUT_OF_MEM;
return MPG123_ERR;
}
if(fill > 0 && offsets == NULL)
{
mh->err = MPG123_BAD_INDEX_PAR;
err = MPG123_ERR;
}
else
{
/* Fill the large-file copy of the provided index, then feed it to mpg123. */
for(i=0; i<fill; ++i)
indextmp[i] = offsets[i];
err = MPG123_LARGENAME(mpg123_set_index)(mh, indextmp, step, fill);
}
free(indextmp);
return err;
}
/* So... breathe... a couple of simple wrappers before the big mess. */
#undef mpg123_position
/* int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); */
int attribute_align_arg mpg123_position(mpg123_handle *mh, long frame_offset, long buffered_bytes, long *current_frame, long *frames_left, double *current_seconds, double *seconds_left)
{
off_t curframe, frameleft;
long small_curframe, small_frameleft;
int err;
err = MPG123_LARGENAME(mpg123_position)(mh, frame_offset, buffered_bytes, &curframe, &frameleft, current_seconds, seconds_left);
if(err != MPG123_OK) return err;
small_curframe = curframe;
small_frameleft = frameleft;
if(small_curframe != curframe || small_frameleft != frameleft)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
if(current_frame != NULL) *current_frame = small_curframe;
if(frames_left != NULL) *frames_left = small_frameleft;
return MPG123_OK;
}
#undef mpg123_length
/* off_t mpg123_length(mpg123_handle *mh); */
long attribute_align_arg mpg123_length(mpg123_handle *mh)
{
long val;
off_t largeval;
largeval = MPG123_LARGENAME(mpg123_length)(mh);
val = largeval;
if(val != largeval)
{
mh->err = MPG123_LFS_OVERFLOW;
return MPG123_ERR;
}
return val;
}
/* The simplest wrapper of all... */
#undef mpg123_set_filesize
/* int mpg123_set_filesize(mpg123_handle *mh, off_t size); */
int attribute_align_arg mpg123_set_filesize(mpg123_handle *mh, long size)
{
return MPG123_LARGENAME(mpg123_set_filesize)(mh, size);
}
/* =========================================
THE BOUNDARY OF SANITY
Behold, stranger!
========================================= */
/*
The messy part: Replacement of I/O core (actally, this is only due to lseek()).
Both descriptor and handle replaced I/O are mapped to replaced handle I/O, the handle wrapping over the actual callbacks and the actual handle/descriptor.
You got multiple levels of handles and callbacks to think about. Have fun reading and comprehending.
*/
/* Could go into compat.h ... Windows needs that flag. */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* Read callback needs nothing special. */
ssize_t wrap_read(void* handle, void *buf, size_t count)
{
struct wrap_data *ioh = handle;
switch(ioh->iotype)
{
case IO_FD: return ioh->r_read(ioh->fd, buf, count);
case IO_HANDLE: return ioh->r_h_read(ioh->handle, buf, count);
}
error("Serious breakage - bad IO type in LFS wrapper!");
return -1;
}
/* Seek callback needs protection from too big offsets. */
off_t wrap_lseek(void *handle, off_t offset, int whence)
{
struct wrap_data *ioh = handle;
long smalloff = offset;
if(smalloff == offset)
{
switch(ioh->iotype)
{
case IO_FD: return ioh->r_lseek(ioh->fd, smalloff, whence);
case IO_HANDLE: return ioh->r_h_lseek(ioh->handle, smalloff, whence);
}
error("Serious breakage - bad IO type in LFS wrapper!");
return -1;
}
else
{
errno = EOVERFLOW;
return -1;
}
}
/*
Now, let's replace the API dealing with replacement I/O.
Start with undefining the renames...
*/
#undef mpg123_replace_reader
#undef mpg123_replace_reader_handle
#undef mpg123_open
#undef mpg123_open_fd
#undef mpg123_open_handle
/* Normal reader replacement needs fallback implementations. */
static ssize_t fallback_read(int fd, void *buf, size_t count)
{
return read(fd, buf, count);
}
static long fallback_lseek(int fd, long offset, int whence)
{
/* Since the offset is long int already, the returned value really should fit into a long... but whatever. */
long newpos_long;
off_t newpos;
newpos = lseek(fd, offset, whence);
newpos_long = newpos;
if(newpos_long == newpos)
return newpos_long;
else
{
errno = EOVERFLOW;
return -1;
}
}
/* Reader replacement prepares the hidden handle storage for next mpg123_open_fd() or plain mpg123_open(). */
int attribute_align_arg mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), long (*r_lseek)(int, long, int) )
{
struct wrap_data* ioh;
if(mh == NULL) return MPG123_ERR;
mpg123_close(mh);
ioh = wrap_get(mh);
if(ioh == NULL) return MPG123_ERR;
/* If both callbacks are NULL, switch totally to internal I/O, else just use fallback for at most half of them. */
if(r_read == NULL && r_lseek == NULL)
{
/* Only the type is actually important to disable the code. */
ioh->iotype = 0;
ioh->fd = -1;
ioh->r_read = NULL;
ioh->r_lseek = NULL;
}
else
{
ioh->iotype = IO_FD;
ioh->fd = -1; /* On next mpg123_open_fd(), this gets a value. */
ioh->r_read = r_read != NULL ? r_read : fallback_read;
ioh->r_lseek = r_lseek != NULL ? r_lseek : fallback_lseek;
}
/* The real reader replacement will happen while opening. */
return MPG123_OK;
}
int attribute_align_arg mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void*, void *, size_t), long (*r_lseek)(void*, long, int), void (*cleanup)(void*))
{
struct wrap_data* ioh;
if(mh == NULL) return MPG123_ERR;
mpg123_close(mh);
ioh = wrap_get(mh);
if(ioh == NULL) return MPG123_ERR;
ioh->iotype = IO_HANDLE;
ioh->handle = NULL;
ioh->r_h_read = r_read;
ioh->r_h_lseek = r_lseek;
ioh->h_cleanup = cleanup;
/* The real reader replacement will happen while opening. */
return MPG123_OK;
}
/*
The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O.
Two cases to consider:
1. Plain normal open using internal I/O.
2. Client called mpg123_replace_reader() before.
The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it.
*/
int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path)
{
struct wrap_data* ioh;
if(mh == NULL) return MPG123_ERR;
ioh = mh->wrapperdata;
/* Mimic the use of mpg123_replace_reader() functions by lower levels...
IO_HANDLE is not valid here, though. Only IO_FD. */
if(ioh != NULL && ioh->iotype == IO_FD)
{
int err;
err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup);
if(err != MPG123_OK) return MPG123_ERR;
/* The above call implied mpg123_close() already */
/*
I really need to open the file here... to be able to use the replacer handle I/O ...
my_fd is used to indicate closing of the descriptor on cleanup.
*/
ioh->my_fd = compat_open(path, O_RDONLY|O_BINARY);
if(ioh->my_fd < 0)
{
if(!(mh->p.flags & MPG123_QUIET)) error2("Cannot open file %s: %s", path, strerror(errno));
mh->err = MPG123_BAD_FILE;
return MPG123_ERR;
}
/* Store a copy of the descriptor where it is actually used. */
ioh->fd = ioh->my_fd;
/* Initiate I/O operating on my handle now. */
err = open_stream_handle(mh, ioh);
if(err != MPG123_OK)
{
wrap_io_cleanup(ioh);
return MPG123_ERR;
}
/* All fine... */
return MPG123_OK;
}
else return MPG123_LARGENAME(mpg123_open)(mh, path);
}
/*
This is in fact very similar to the above:
The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O.
Two cases to consider:
1. Plain normal open_fd using internal I/O.
2. Client called mpg123_replace_reader() before.
The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it.
*/
int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd)
{
struct wrap_data* ioh;
if(mh == NULL) return MPG123_ERR;
mpg123_close(mh);
ioh = mh->wrapperdata;
if(ioh != NULL && ioh->iotype == IO_FD)
{
int err;
err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup);
if(err != MPG123_OK) return MPG123_ERR;
/* The above call implied mpg123_close() already */
/* Store the real file descriptor inside the handle. */
ioh->fd = fd;
/* Initiate I/O operating on my handle now. */
err = open_stream_handle(mh, ioh);
if(err != MPG123_OK)
{
wrap_io_cleanup(ioh);
return MPG123_ERR;
}
/* All fine... */
return MPG123_OK;
}
else return MPG123_LARGENAME(mpg123_open_fd)(mh, fd);
}
int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *handle)
{
struct wrap_data* ioh;
if(mh == NULL) return MPG123_ERR;
mpg123_close(mh);
ioh = mh->wrapperdata;
if(ioh != NULL && ioh->iotype == IO_HANDLE && ioh->r_h_read != NULL)
{
/* Wrap the custom handle into my handle. */
int err;
err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup);
if(err != MPG123_OK) return MPG123_ERR;
ioh->handle = handle;
/* No extra error handling, keep behaviour of the original open_handle. */
return open_stream_handle(mh, ioh);
}
else
{
/* This is an error ... you need to prepare the I/O before using it. */
mh->err = MPG123_BAD_CUSTOM_IO;
return MPG123_ERR;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,94 +0,0 @@
/*
mangle: support defines for preprocessed assembler
copyright 1995-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
This once started out as mangle.h from MPlayer, but you can't really call it derived work... the small part that in principle stems from MPlayer also being not very special (once you decided to use such a header at all, it's quite obvious material).
*/
#ifndef __MANGLE_H
#define __MANGLE_H
#include "config.h"
#include "intsym.h"
#ifdef CCALIGN
#define MOVUAPS movaps
#else
#define MOVUAPS movups
#endif
/*
ALIGNX: align to X bytes
This differs per compiler/platform in taking the byte count or an exponent for base 2.
A way out is balign, if the assembler supports it (gas extension).
*/
#ifdef ASMALIGN_BALIGN
#define ALIGN4 .balign 4
#define ALIGN8 .balign 8
#define ALIGN16 .balign 16
#define ALIGN32 .balign 32
#define ALIGN64 .balign 64
#else
#ifdef ASMALIGN_EXP
#define ALIGN4 .align 2
#define ALIGN8 .align 3
#define ALIGN16 .align 4
#define ALIGN32 .align 5
#define ALIGN64 .align 6
#else
#ifdef ASMALIGN_BYTE
#define ALIGN4 .align 4
#define ALIGN8 .align 8
#define ALIGN16 .align 16
#define ALIGN32 .align 32
#define ALIGN64 .align 64
#else
#error "Dunno how assembler alignment works. Please specify."
#endif
#endif
#endif
#define MANGLE_MACROCAT_REALLY(a, b) a ## b
#define MANGLE_MACROCAT(a, b) MANGLE_MACROCAT_REALLY(a, b)
/* Feel free to add more to the list, eg. a.out IMO */
#if defined(__USER_LABEL_PREFIX__)
#define ASM_NAME(a) MANGLE_MACROCAT(__USER_LABEL_PREFIX__,a)
#define ASM_VALUE(a) MANGLE_MACROCAT($,ASM_NAME(a))
#elif defined(__CYGWIN__) || defined(_WIN32) && !defined (_WIN64) || defined(__OS2__) || \
(defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
#define ASM_NAME(a) MANGLE_MACROCAT(_,a)
#define ASM_VALUE(a) MANGLE_MACROCAT($_,a)
#else
#define ASM_NAME(a) a
#define ASM_VALUE(a) MANGLE_MACROCAT($,a)
#endif
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
#define COMM(a,b,c) .comm a,b
#else
#define COMM(a,b,c) .comm a,b,c
#endif
/* more hacks for macosx; no .bss ... */
#ifdef __APPLE__
#define BSS .data
#else
#define BSS .bss
#endif
/* Mark non-executable stack.
It's mainly for GNU on Linux... who else does (not) like this? */
#if !defined(__SUNPRO_C) && defined(__linux__) && defined(__ELF__)
#define NONEXEC_STACK .section .note.GNU-stack,"",@progbits
#else
#define NONEXEC_STACK
#endif
#endif /* !__MANGLE_H */

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2021-2022 Christopher Snowhill. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@ -1,148 +0,0 @@
/*
ntom.c: N->M down/up sampling; the setup code.
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
*/
#define SAFE_NTOM /* Do not depend on off_t*off_t with big values still being in the range... */
#include "mpg123lib_intern.h"
#include "debug.h"
int synth_ntom_set_step(mpg123_handle *fr)
{
long m,n;
m = frame_freq(fr);
n = fr->af.rate;
if(VERBOSE2)
fprintf(stderr,"Init rate converter: %ld->%ld\n",m,n);
if(n > NTOM_MAX_FREQ || m > NTOM_MAX_FREQ || m <= 0 || n <= 0) {
if(NOQUIET) error("NtoM converter: illegal rates");
fr->err = MPG123_BAD_RATE;
return -1;
}
n *= NTOM_MUL;
fr->ntom_step = (unsigned long) n / m;
if(fr->ntom_step > (unsigned long)NTOM_MAX*NTOM_MUL) {
if(NOQUIET) error3("max. 1:%i conversion allowed (%lu vs %lu)!", NTOM_MAX, fr->ntom_step, (unsigned long)8*NTOM_MUL);
fr->err = MPG123_BAD_RATE;
return -1;
}
fr->ntom_val[0] = fr->ntom_val[1] = ntom_val(fr, fr->num);
return 0;
}
/*
The SAFE_NTOM does iterative loops instead of straight multiplication.
The safety is not just about the algorithm closely mimicking the decoder instead of applying some formula,
it is more about avoiding multiplication of possibly big sample offsets (a 32bit off_t could overflow too easily).
*/
unsigned long ntom_val(mpg123_handle *fr, off_t frame)
{
off_t ntm;
#ifdef SAFE_NTOM /* Carry out the loop, without the threatening integer overflow. */
off_t f;
ntm = NTOM_MUL>>1; /* for frame 0 */
for(f=0; f<frame; ++f) /* for frame > 0 */
{
ntm += spf(fr)*fr->ntom_step;
ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
}
#else /* Just make one computation with overall sample offset. */
ntm = (NTOM_MUL>>1) + spf(fr)*frame*fr->ntom_step;
ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
#endif
return (unsigned long) ntm;
}
/* Set the ntom value for next expected frame to be decoded.
This is for keeping output consistent across seeks. */
void ntom_set_ntom(mpg123_handle *fr, off_t num)
{
fr->ntom_val[1] = fr->ntom_val[0] = ntom_val(fr, num);
}
/* Carry out the ntom sample count operation for this one frame.
No fear of integer overflow here. */
off_t ntom_frame_outsamples(mpg123_handle *fr)
{
/* The do this before decoding the separate channels, so there is only one common ntom value. */
int ntm = fr->ntom_val[0];
ntm += spf(fr)*fr->ntom_step;
return ntm/NTOM_MUL;
}
/* Convert frame offset to unadjusted output sample offset. */
off_t ntom_frmouts(mpg123_handle *fr, off_t frame)
{
#ifdef SAFE_NTOM
off_t f;
#endif
off_t soff = 0;
off_t ntm = ntom_val(fr,0);
#ifdef SAFE_NTOM
if(frame <= 0) return 0;
for(f=0; f<frame; ++f)
{
ntm += spf(fr)*fr->ntom_step;
soff += ntm/NTOM_MUL;
ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
}
#else
soff = (ntm + frame*(off_t)spf(fr)*(off_t)fr->ntom_step)/(off_t)NTOM_MUL;
#endif
return soff;
}
/* Convert input samples to unadjusted output samples. */
off_t ntom_ins2outs(mpg123_handle *fr, off_t ins)
{
off_t soff = 0;
off_t ntm = ntom_val(fr,0);
#ifdef SAFE_NTOM
{
off_t block = spf(fr);
if(ins <= 0) return 0;
do
{
off_t nowblock = ins > block ? block : ins;
ntm += nowblock*fr->ntom_step;
soff += ntm/NTOM_MUL;
ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
ins -= nowblock;
} while(ins > 0);
}
#else
/* Beware of overflows: when off_t is 32bits, the multiplication blows too easily.
Of course, it blows for 64bits, too, in theory, but that's for _really_ large files. */
soff = ((off_t)ntm + (off_t)ins*(off_t)fr->ntom_step)/(off_t)NTOM_MUL;
#endif
return soff;
}
/* Determine frame offset from unadjusted output sample offset. */
off_t ntom_frameoff(mpg123_handle *fr, off_t soff)
{
off_t ioff = 0; /* frames or samples */
off_t ntm = ntom_val(fr,0);
#ifdef SAFE_NTOM
if(soff <= 0) return 0;
for(ioff=0; 1; ++ioff)
{
ntm += spf(fr)*fr->ntom_step;
if(ntm/NTOM_MUL > soff) break;
soff -= ntm/NTOM_MUL;
ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
}
return ioff;
#else
ioff = (soff*(off_t)NTOM_MUL-ntm)/(off_t)fr->ntom_step;
return ioff/(off_t)spf(fr);
#endif
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,186 +0,0 @@
/*
stringbuf: mimicking a bit of C++ to more safely handle strings
copyright 2006-10 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
*/
#include "mpg123lib_intern.h"
#include "config.h"
#include "mpg123.h"
#include "compat.h"
#include <string.h>
#include "debug.h"
void attribute_align_arg mpg123_init_string(mpg123_string* sb)
{
sb->p = NULL;
sb->size = 0;
sb->fill = 0;
}
void attribute_align_arg mpg123_free_string(mpg123_string* sb)
{
if(sb->p != NULL) free(sb->p);
mpg123_init_string(sb);
}
int attribute_align_arg mpg123_grow_string(mpg123_string* sb, size_t new)
{
if(sb->size < new) return mpg123_resize_string(sb, new);
else return 1;
}
int attribute_align_arg mpg123_resize_string(mpg123_string* sb, size_t new)
{
debug3("resizing string pointer %p from %lu to %lu", (void*) sb->p, (unsigned long)sb->size, (unsigned long)new);
if(new == 0)
{
if(sb->size && sb->p != NULL) free(sb->p);
mpg123_init_string(sb);
return 1;
}
if(sb->size != new)
{
char* t;
debug("really!");
t = (char*) safe_realloc(sb->p, new*sizeof(char));
debug1("safe_realloc returned %p", (void*) t);
if(t != NULL)
{
sb->p = t;
sb->size = new;
return 1;
}
else return 0;
}
else return 1; /* success */
}
int attribute_align_arg mpg123_copy_string(mpg123_string* from, mpg123_string* to)
{
size_t fill;
char *text;
if(to == NULL) return -1;
debug2("called copy_string with %p -> %p", (void*)from, (void*)to);
if(from == NULL)
{
fill = 0;
text = NULL;
}
else
{
fill = from->fill;
text = from->p;
}
if(mpg123_resize_string(to, fill))
{
memcpy(to->p, text, fill);
to->fill = fill;
return 1;
}
else return 0;
}
int attribute_align_arg mpg123_add_string(mpg123_string* sb, const char* stuff)
{
debug1("adding %s", stuff);
return mpg123_add_substring(sb, stuff, 0, strlen(stuff));
}
int attribute_align_arg mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count)
{
debug("adding a substring");
if(sb->fill) /* includes zero byte... */
{
if( (SIZE_MAX - sb->fill >= count) /* Avoid overflow. */
&& (sb->size >= sb->fill+count || mpg123_grow_string(sb, sb->fill+count)) )
{
memcpy(sb->p+sb->fill-1, stuff+from, count);
sb->fill += count;
sb->p[sb->fill-1] = 0; /* Terminate! */
}
else return 0;
}
else
{
if( count < SIZE_MAX && mpg123_grow_string(sb, count+1) )
{
memcpy(sb->p, stuff+from, count);
sb->fill = count+1;
sb->p[sb->fill-1] = 0; /* Terminate! */
}
else return 0;
}
return 1;
}
int attribute_align_arg mpg123_set_substring(mpg123_string* sb, const char* stuff, size_t from, size_t count)
{
sb->fill = 0;
return mpg123_add_substring(sb, stuff, from, count);
}
int attribute_align_arg mpg123_set_string(mpg123_string* sb, const char* stuff)
{
sb->fill = 0;
return mpg123_add_string(sb, stuff);
}
size_t attribute_align_arg mpg123_strlen(mpg123_string *sb, int utf8)
{
size_t i;
size_t bytelen;
/* Notions of empty string. If there's only a single character, it has to be the trailing zero, and if the first is the trailing zero anyway, we got empty. */
if(sb->fill < 2 || sb->p[0] == 0) return 0;
/* Find the first non-null character from the back.
We already established that the first character is non-null
That at fill-2 has to be null, though. */
for(i=sb->fill-2; i>0; --i)
if(sb->p[i] != 0) break;
/* For simple byte strings, we are done now. */
bytelen = i+1;
if(!utf8) return bytelen;
else
{
/* Work out the actual count of UTF8 bytes.
This employs no particular encoding error checking. */
size_t len = 0;
for(i=0; i<bytelen; ++i)
{
/* Every byte that is not a continuation byte ( 0xc0 == 10xx xxxx ) stands for a character. */
if((sb->p[i] & 0xc0) != 0x80) len++;
}
return len;
}
}
int attribute_align_arg mpg123_chomp_string(mpg123_string *sb)
{
ssize_t i;
if(!sb || !sb->fill) return 0;
/* Ensure that it is zero-terminated. */
sb->p[sb->fill-1] = 0;
for(i=sb->fill-2; i>=0; --i)
{
char *c = sb->p+i;
/* Stop at the first proper character. */
if(*c && *c != '\r' && *c != '\n') break;
else *c = 0;
}
/* initial fill at least 1, so i at least -1,
+2 means nothing happened for fill=1 .
With i=0, we got one non-null character, fill shall be 2
to accomodate the trailing zero. */
sb->fill = (size_t)i+2;
return 1;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,496 +0,0 @@
/*
synth_real.c: The functions for synthesizing real (float) samples, at the end of decoding.
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp, heavily dissected and rearranged by Thomas Orgis
*/
#include "mpg123lib_intern.h"
#include "sample.h"
#include "debug.h"
#ifdef REAL_IS_FIXED
#error "Do not build this file with fixed point math!"
#else
/*
Part 3: All synth functions that produce float output.
What we need is just a special WRITE_SAMPLE. For the generic and i386 functions, that is.
The optimized synths would need to be changed internally to support float output.
*/
#define SAMPLE_T real
#define WRITE_SAMPLE(samples,sum,clip) WRITE_REAL_SAMPLE(samples,sum,clip)
/* Part 3a: All straight 1to1 decoding functions */
#define BLOCK 0x40 /* One decoding block is 64 samples. */
#define SYNTH_NAME synth_1to1_real
#include "synth.h"
#undef SYNTH_NAME
/* Mono-related synths; they wrap over _some_ synth_1to1_real (could be generic, could be i386). */
#define SYNTH_NAME fr->synths.plain[r_1to1][f_real]
#define MONO_NAME synth_1to1_real_mono
#define MONO2STEREO_NAME synth_1to1_real_m2s
#include "synth_mono.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#ifdef OPT_X86
#define NO_AUTOINCREMENT
#define SYNTH_NAME synth_1to1_real_i386
#include "synth.h"
#undef SYNTH_NAME
/* i386 uses the normal mono functions. */
#undef NO_AUTOINCREMENT
#endif
#undef BLOCK
/* At least one optimized real decoder... */
#ifdef OPT_X86_64
/* Assembler routines. */
int synth_1to1_real_x86_64_asm(real *window, real *b0, real *samples, int bo1);
int synth_1to1_real_s_x86_64_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
void dct64_real_x86_64(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_real_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_x86_64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_x86_64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
synth_1to1_real_x86_64_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return 0;
}
int synth_1to1_real_stereo_x86_64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_x86_64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_x86_64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_x86_64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_x86_64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
synth_1to1_real_s_x86_64_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return 0;
}
#endif
#ifdef OPT_AVX
/* Assembler routines. */
#ifndef OPT_X86_64
int synth_1to1_real_x86_64_asm(real *window, real *b0, real *samples, int bo1);
#endif
int synth_1to1_real_s_avx_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
void dct64_real_avx(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_real_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_avx(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_avx(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
synth_1to1_real_x86_64_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return 0;
}
int synth_1to1_real_stereo_avx(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_avx(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_avx(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_avx(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_avx(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
synth_1to1_real_s_avx_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return 0;
}
#endif
#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
/* Assembler routines. */
int synth_1to1_real_sse_asm(real *window, real *b0, real *samples, int bo1);
int synth_1to1_real_s_sse_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
void dct64_real_sse(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_real_sse(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_sse(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_sse(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
synth_1to1_real_sse_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return 0;
}
int synth_1to1_real_stereo_sse(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_sse(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_sse(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_sse(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_sse(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
synth_1to1_real_s_sse_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return 0;
}
#endif
#ifdef OPT_NEON
/* Assembler routines. */
int synth_1to1_real_neon_asm(real *window, real *b0, real *samples, int bo1);
int synth_1to1_real_s_neon_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
void dct64_real_neon(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_real_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_neon(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_neon(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
synth_1to1_real_neon_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return 0;
}
int synth_1to1_real_stereo_neon(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_neon(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_neon(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_neon(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_neon(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
synth_1to1_real_s_neon_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return 0;
}
#endif
#ifndef NO_DOWNSAMPLE
/*
Part 3b: 2to1 synth. Only generic and i386.
*/
#define BLOCK 0x20 /* One decoding block is 32 samples. */
#define SYNTH_NAME synth_2to1_real
#include "synth.h"
#undef SYNTH_NAME
/* Mono-related synths; they wrap over _some_ synth_2to1_real (could be generic, could be i386). */
#define SYNTH_NAME fr->synths.plain[r_2to1][f_real]
#define MONO_NAME synth_2to1_real_mono
#define MONO2STEREO_NAME synth_2to1_real_m2s
#include "synth_mono.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#ifdef OPT_X86
#define NO_AUTOINCREMENT
#define SYNTH_NAME synth_2to1_real_i386
#include "synth.h"
#undef SYNTH_NAME
/* i386 uses the normal mono functions. */
#undef NO_AUTOINCREMENT
#endif
#undef BLOCK
/*
Part 3c: 4to1 synth. Only generic and i386.
*/
#define BLOCK 0x10 /* One decoding block is 16 samples. */
#define SYNTH_NAME synth_4to1_real
#include "synth.h"
#undef SYNTH_NAME
/* Mono-related synths; they wrap over _some_ synth_4to1_real (could be generic, could be i386). */
#define SYNTH_NAME fr->synths.plain[r_4to1][f_real]
#define MONO_NAME synth_4to1_real_mono
#define MONO2STEREO_NAME synth_4to1_real_m2s
#include "synth_mono.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#ifdef OPT_X86
#define NO_AUTOINCREMENT
#define SYNTH_NAME synth_4to1_real_i386
#include "synth.h"
#undef SYNTH_NAME
/* i386 uses the normal mono functions. */
#undef NO_AUTOINCREMENT
#endif
#undef BLOCK
#endif /* NO_DOWNSAMPLE */
#ifndef NO_NTOM
/*
Part 3d: ntom synth.
Same procedure as above... Just no extra play anymore, straight synth that may use an optimized dct64.
*/
/* These are all in one header, there's no flexibility to gain. */
#define SYNTH_NAME synth_ntom_real
#define MONO_NAME synth_ntom_real_mono
#define MONO2STEREO_NAME synth_ntom_real_m2s
#include "synth_ntom.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#endif
#undef SAMPLE_T
#undef WRITE_SAMPLE
#endif /* non-fixed type */

View File

@ -1,506 +0,0 @@
/*
synth_s32.c: The functions for synthesizing real (float) samples, at the end of decoding.
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp, heavily dissected and rearranged by Thomas Orgis
*/
#include "mpg123lib_intern.h"
#include "sample.h"
#include "debug.h"
#ifdef REAL_IS_FIXED
#error "Do not build this file with fixed point math!"
#else
/*
Part 4: All synth functions that produce signed 32 bit output.
What we need is just a special WRITE_SAMPLE.
*/
#define SAMPLE_T int32_t
#define WRITE_SAMPLE(samples,sum,clip) WRITE_S32_SAMPLE(samples,sum,clip)
/* Part 4a: All straight 1to1 decoding functions */
#define BLOCK 0x40 /* One decoding block is 64 samples. */
#define SYNTH_NAME synth_1to1_s32
#include "synth.h"
#undef SYNTH_NAME
/* Mono-related synths; they wrap over _some_ synth_1to1_s32 (could be generic, could be i386). */
#define SYNTH_NAME fr->synths.plain[r_1to1][f_32]
#define MONO_NAME synth_1to1_s32_mono
#define MONO2STEREO_NAME synth_1to1_s32_m2s
#include "synth_mono.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#ifdef OPT_X86
#define NO_AUTOINCREMENT
#define SYNTH_NAME synth_1to1_s32_i386
#include "synth.h"
#undef SYNTH_NAME
/* i386 uses the normal mono functions. */
#undef NO_AUTOINCREMENT
#endif
#ifdef OPT_X86_64
/* Assembler routines. */
int synth_1to1_s32_x86_64_asm(real *window, real *b0, int32_t *samples, int bo1);
int synth_1to1_s32_s_x86_64_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
void dct64_real_x86_64(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_s32_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
int clip;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_x86_64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_x86_64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
clip = synth_1to1_s32_x86_64_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return clip;
}
int synth_1to1_s32_stereo_x86_64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
int clip;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_x86_64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_x86_64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_x86_64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_x86_64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
clip = synth_1to1_s32_s_x86_64_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return clip;
}
#endif
#ifdef OPT_AVX
/* Assembler routines. */
#ifndef OPT_x86_64
int synth_1to1_s32_x86_64_asm(real *window, real *b0, int32_t *samples, int bo1);
#endif
int synth_1to1_s32_s_avx_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
void dct64_real_avx(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_s32_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
int clip;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_avx(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_avx(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
clip = synth_1to1_s32_x86_64_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return clip;
}
int synth_1to1_s32_stereo_avx(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
int clip;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_avx(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_avx(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_avx(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_avx(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
clip = synth_1to1_s32_s_avx_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return clip;
}
#endif
#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
/* Assembler routines. */
int synth_1to1_s32_sse_asm(real *window, real *b0, int32_t *samples, int bo1);
int synth_1to1_s32_s_sse_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
void dct64_real_sse(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_s32_sse(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
int clip;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_sse(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_sse(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
clip = synth_1to1_s32_sse_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return clip;
}
int synth_1to1_s32_stereo_sse(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
int clip;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_sse(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_sse(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_sse(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_sse(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
clip = synth_1to1_s32_s_sse_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return clip;
}
#endif
#ifdef OPT_NEON
/* Assembler routines. */
int synth_1to1_s32_neon_asm(real *window, real *b0, int32_t *samples, int bo1);
int synth_1to1_s32_s_neon_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
void dct64_real_neon(real *out0, real *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_s32_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
int clip;
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
if(!channel)
{
fr->bo--;
fr->bo &= 0xf;
buf = fr->real_buffs[0];
}
else
{
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
dct64_real_neon(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
}
else
{
b0 = buf[1];
bo1 = fr->bo+1;
dct64_real_neon(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
clip = synth_1to1_s32_neon_asm(fr->decwin, b0, samples, bo1);
if(final) fr->buffer.fill += 256;
return clip;
}
int synth_1to1_s32_stereo_neon(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
int clip;
if(fr->have_eq_settings)
{
do_equalizer(bandPtr_l,0,fr->equalizer);
do_equalizer(bandPtr_r,1,fr->equalizer);
}
fr->bo--;
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
bo1 = fr->bo;
dct64_real_neon(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
dct64_real_neon(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
}
else
{
b0l = bufl[1];
b0r = bufr[1];
bo1 = fr->bo+1;
dct64_real_neon(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_real_neon(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
clip = synth_1to1_s32_s_neon_asm(fr->decwin, b0l, b0r, samples, bo1);
fr->buffer.fill += 256;
return clip;
}
#endif
#undef BLOCK
#ifndef NO_DOWNSAMPLE
/*
Part 4b: 2to1 synth. Only generic and i386.
*/
#define BLOCK 0x20 /* One decoding block is 32 samples. */
#define SYNTH_NAME synth_2to1_s32
#include "synth.h"
#undef SYNTH_NAME
/* Mono-related synths; they wrap over _some_ synth_2to1_s32 (could be generic, could be i386). */
#define SYNTH_NAME fr->synths.plain[r_2to1][f_32]
#define MONO_NAME synth_2to1_s32_mono
#define MONO2STEREO_NAME synth_2to1_s32_m2s
#include "synth_mono.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#ifdef OPT_X86
#define NO_AUTOINCREMENT
#define SYNTH_NAME synth_2to1_s32_i386
#include "synth.h"
#undef SYNTH_NAME
/* i386 uses the normal mono functions. */
#undef NO_AUTOINCREMENT
#endif
#undef BLOCK
/*
Part 4c: 4to1 synth. Only generic and i386.
*/
#define BLOCK 0x10 /* One decoding block is 16 samples. */
#define SYNTH_NAME synth_4to1_s32
#include "synth.h"
#undef SYNTH_NAME
/* Mono-related synths; they wrap over _some_ synth_4to1_s32 (could be generic, could be i386). */
#define SYNTH_NAME fr->synths.plain[r_4to1][f_32]
#define MONO_NAME synth_4to1_s32_mono
#define MONO2STEREO_NAME synth_4to1_s32_m2s
#include "synth_mono.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#ifdef OPT_X86
#define NO_AUTOINCREMENT
#define SYNTH_NAME synth_4to1_s32_i386
#include "synth.h"
#undef SYNTH_NAME
/* i386 uses the normal mono functions. */
#undef NO_AUTOINCREMENT
#endif
#undef BLOCK
#endif /* NO_DOWNSAMPLE */
#ifndef NO_NTOM
/*
Part 4d: ntom synth.
Same procedure as above... Just no extra play anymore, straight synth that may use an optimized dct64.
*/
/* These are all in one header, there's no flexibility to gain. */
#define SYNTH_NAME synth_ntom_s32
#define MONO_NAME synth_ntom_s32_mono
#define MONO2STEREO_NAME synth_ntom_s32_m2s
#include "synth_ntom.h"
#undef SYNTH_NAME
#undef MONO_NAME
#undef MONO2STEREO_NAME
#endif
#undef SAMPLE_T
#undef WRITE_SAMPLE
#endif /* non-fixed type */

View File

@ -1,300 +0,0 @@
/*
tabinit.c: initialize tables...
copyright ?-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
*/
#include "mpg123lib_intern.h"
#include "debug.h"
/* That altivec alignment part here should not hurt generic code, I hope */
#ifdef OPT_ALTIVEC
static ALIGNED(16) real cos64[16];
static ALIGNED(16) real cos32[8];
static ALIGNED(16) real cos16[4];
static ALIGNED(16) real cos8[2];
static ALIGNED(16) real cos4[1];
#elif defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
static real cos64[16] =
{
8398725,8480395,8647771,8909416,9279544,9780026,10443886,11321405,
12491246,14081950,16316987,19619946,24900150,34523836,57170182,170959967
};
static real cos32[8] =
{
8429197,8766072,9511743,10851869,13223040,17795219,28897867,85583072
};
static real cos16[4] =
{
8552951,10088893,15099095,42998586
};
static real cos8[2] =
{
9079764,21920489
};
static real cos4[1] =
{
11863283
};
#else
static real cos64[16],cos32[8],cos16[4],cos8[2],cos4[1];
#endif
real *pnts[] = { cos64,cos32,cos16,cos8,cos4 };
static long intwinbase[] = {
0, -1, -1, -1, -1, -1, -1, -2, -2, -2,
-2, -3, -3, -4, -4, -5, -5, -6, -7, -7,
-8, -9, -10, -11, -13, -14, -16, -17, -19, -21,
-24, -26, -29, -31, -35, -38, -41, -45, -49, -53,
-58, -63, -68, -73, -79, -85, -91, -97, -104, -111,
-117, -125, -132, -139, -147, -154, -161, -169, -176, -183,
-190, -196, -202, -208, -213, -218, -222, -225, -227, -228,
-228, -227, -224, -221, -215, -208, -200, -189, -177, -163,
-146, -127, -106, -83, -57, -29, 2, 36, 72, 111,
153, 197, 244, 294, 347, 401, 459, 519, 581, 645,
711, 779, 848, 919, 991, 1064, 1137, 1210, 1283, 1356,
1428, 1498, 1567, 1634, 1698, 1759, 1817, 1870, 1919, 1962,
2001, 2032, 2057, 2075, 2085, 2087, 2080, 2063, 2037, 2000,
1952, 1893, 1822, 1739, 1644, 1535, 1414, 1280, 1131, 970,
794, 605, 402, 185, -45, -288, -545, -814, -1095, -1388,
-1692, -2006, -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788,
-5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597, -7910, -8209,
-8491, -8755, -8998, -9219, -9416, -9585, -9727, -9838, -9916, -9959,
-9966, -9935, -9863, -9750, -9592, -9389, -9139, -8840, -8492, -8092,
-7640, -7134, -6574, -5959, -5288, -4561, -3776, -2935, -2037, -1082,
-70, 998, 2122, 3300, 4533, 5818, 7154, 8540, 9975, 11455,
12980, 14548, 16155, 17799, 19478, 21189, 22929, 24694, 26482, 28289,
30112, 31947, 33791, 35640, 37489, 39336, 41176, 43006, 44821, 46617,
48390, 50137, 51853, 53534, 55178, 56778, 58333, 59838, 61289, 62684,
64019, 65290, 66494, 67629, 68692, 69679, 70590, 71420, 72169, 72835,
73415, 73908, 74313, 74630, 74856, 74992, 75038 };
void prepare_decode_tables()
{
#if !defined(REAL_IS_FIXED) || !defined(PRECALC_TABLES)
int i,k,kr,divv;
real *costab;
for(i=0;i<5;i++)
{
kr=0x10>>i; divv=0x40>>i;
costab = pnts[i];
for(k=0;k<kr;k++)
costab[k] = DOUBLE_TO_REAL(1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv)));
}
#endif
}
#ifdef OPT_MMXORSSE
#if !defined(OPT_X86_64) && !defined(OPT_NEON) && !defined(OPT_AVX)
void make_decode_tables_mmx_asm(long scaleval, float* decwin_mmx, float *decwins);
void make_decode_tables_mmx(mpg123_handle *fr)
{
debug("MMX decode tables");
/* Take care: The scale should be like before, when we didn't have float output all around. */
make_decode_tables_mmx_asm((long)((fr->lastscale < 0 ? fr->p.outscale : fr->lastscale)*SHORT_SCALE), fr->decwin_mmx, fr->decwins);
debug("MMX decode tables done");
}
#else
/* This mimics round() as defined in C99. We stay C89. */
static int rounded(double f)
{
return (int)(f>0 ? floor(f+0.5) : ceil(f-0.5));
}
/* x86-64 doesn't use asm version */
void make_decode_tables_mmx(mpg123_handle *fr)
{
int i,j,val;
int idx = 0;
short *ptr = (short *)fr->decwins;
/* Scale is always based on 1.0 . */
double scaleval = -0.5*(fr->lastscale < 0 ? fr->p.outscale : fr->lastscale);
debug1("MMX decode tables with scaleval %g", scaleval);
for(i=0,j=0;i<256;i++,j++,idx+=32)
{
if(idx < 512+16)
fr->decwin_mmx[idx+16] = fr->decwin_mmx[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
if(i % 32 == 31)
idx -= 1023;
if(i % 64 == 63)
scaleval = - scaleval;
}
for( /* i=256 */ ;i<512;i++,j--,idx+=32)
{
if(idx < 512+16)
fr->decwin_mmx[idx+16] = fr->decwin_mmx[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
if(i % 32 == 31)
idx -= 1023;
if(i % 64 == 63)
scaleval = - scaleval;
}
for(i=0; i<512; i++) {
if(i&1) val = rounded(fr->decwin_mmx[i]*0.5);
else val = rounded(fr->decwin_mmx[i]*-0.5);
if(val > 32767) val = 32767;
else if(val < -32768) val = -32768;
ptr[i] = val;
}
for(i=512; i<512+32; i++) {
if(i&1) val = rounded(fr->decwin_mmx[i]*0.5);
else val = 0;
if(val > 32767) val = 32767;
else if(val < -32768) val = -32768;
ptr[i] = val;
}
for(i=0; i<512; i++) {
val = rounded(fr->decwin_mmx[511-i]*-0.5);
if(val > 32767) val = 32767;
else if(val < -32768) val = -32768;
ptr[512+32+i] = val;
}
debug("decode tables done");
}
#endif
#endif
void make_decode_tables(mpg123_handle *fr)
{
int i,j;
int idx = 0;
/* Scale is always based on 1.0 . */
double scaleval = -0.5*(fr->lastscale < 0 ? fr->p.outscale : fr->lastscale);
debug1("decode tables with scaleval %g", scaleval);
#ifdef REAL_IS_FIXED
long scaleval_long = DOUBLE_TO_REAL_15(scaleval);
#endif
for(i=0,j=0;i<256;i++,j++,idx+=32)
{
if(idx < 512+16)
#ifdef REAL_IS_FIXED
fr->decwin[idx+16] = fr->decwin[idx] = REAL_SCALE_WINDOW(intwinbase[j] * scaleval_long);
#else
fr->decwin[idx+16] = fr->decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
#endif
if(i % 32 == 31)
idx -= 1023;
if(i % 64 == 63)
#ifdef REAL_IS_FIXED
scaleval_long = - scaleval_long;
#else
scaleval = - scaleval;
#endif
}
for( /* i=256 */ ;i<512;i++,j--,idx+=32)
{
if(idx < 512+16)
#ifdef REAL_IS_FIXED
fr->decwin[idx+16] = fr->decwin[idx] = REAL_SCALE_WINDOW(intwinbase[j] * scaleval_long);
#else
fr->decwin[idx+16] = fr->decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
#endif
if(i % 32 == 31)
idx -= 1023;
if(i % 64 == 63)
#ifdef REAL_IS_FIXED
scaleval_long = - scaleval_long;
#else
scaleval = - scaleval;
#endif
}
#if defined(OPT_X86_64) || defined(OPT_ALTIVEC) || defined(OPT_SSE) || defined(OPT_SSE_VINTAGE) || defined(OPT_ARM) || defined(OPT_NEON) || defined(OPT_AVX)
if( fr->cpu_opts.type == x86_64
|| fr->cpu_opts.type == altivec
|| fr->cpu_opts.type == sse
|| fr->cpu_opts.type == sse_vintage
|| fr->cpu_opts.type == arm
|| fr->cpu_opts.type == neon
|| fr->cpu_opts.type == avx )
{ /* for float SSE / AltiVec / ARM decoder */
for(i=512; i<512+32; i++)
{
fr->decwin[i] = (i&1) ? fr->decwin[i] : 0;
}
for(i=0; i<512; i++)
{
fr->decwin[512+32+i] = -fr->decwin[511-i];
}
#ifdef OPT_NEON
if(fr->cpu_opts.type == neon)
{
for(i=0; i<512; i+=2)
{
fr->decwin[i] = -fr->decwin[i];
}
}
#endif
}
#endif
debug("decode tables done");
}
#ifndef NO_8BIT
int make_conv16to8_table(mpg123_handle *fr)
{
int i;
int mode = fr->af.encoding;
/*
* ????: 8.0 is right but on SB cards '2.0' is a better value ???
*/
const double mul = 8.0;
if(!fr->conv16to8_buf){
fr->conv16to8_buf = (unsigned char *) malloc(8192);
if(!fr->conv16to8_buf) {
fr->err = MPG123_ERR_16TO8TABLE;
if(NOQUIET) error("Can't allocate 16 to 8 converter table!");
return -1;
}
fr->conv16to8 = fr->conv16to8_buf + 4096;
}
if(fr->af.encoding == MPG123_ENC_ULAW_8){
double m=127.0 / log(256.0);
int c1;
for(i=-4096;i<4096;i++) {
/* dunno whether this is a valid transformation rule ?!?!? */
if(i < 0)
c1 = 127 - (int) (log( 1.0 - 255.0 * (double) i*mul / 32768.0 ) * m);
else
c1 = 255 - (int) (log( 1.0 + 255.0 * (double) i*mul / 32768.0 ) * m);
if((c1 < 0 || c1 > 255) && NOQUIET) error2("Converror %d %d",i,c1);
if(c1 == 0)
c1 = 2;
fr->conv16to8[i] = (unsigned char) c1;
}
}
else if(mode == MPG123_ENC_SIGNED_8) {
for(i=-4096;i<4096;i++) {
fr->conv16to8[i] = i>>5;
}
}
else if(mode == MPG123_ENC_UNSIGNED_8) {
for(i=-4096;i<4096;i++) {
fr->conv16to8[i] = (i>>5)+128;
}
}
else {
for(i=-4096;i<4096;i++) {
fr->conv16to8[i] = 0;
}
}
return 0;
}
#endif

View File

@ -82,8 +82,6 @@
830EBE102004655D0023AA10 /* atrac9_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBE0F2004655D0023AA10 /* atrac9_decoder.c */; };
830EBE132004656E0023AA10 /* xnb.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBE112004656E0023AA10 /* xnb.c */; };
830EBE142004656E0023AA10 /* ktss.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBE122004656E0023AA10 /* ktss.c */; };
8313E3E61902020400B4B6F1 /* mpg123.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8313E3431901FBDD00B4B6F1 /* mpg123.framework */; };
8313E3E71902021800B4B6F1 /* mpg123.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8313E3431901FBDD00B4B6F1 /* mpg123.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
8315868726F586E200803A3A /* psb.c in Sources */ = {isa = PBXBuildFile; fileRef = 8315868326F586E200803A3A /* psb.c */; };
8315868A26F586F900803A3A /* m2_psb.c in Sources */ = {isa = PBXBuildFile; fileRef = 8315868826F586F900803A3A /* m2_psb.c */; };
8315868B26F586F900803A3A /* m2_psb.h in Headers */ = {isa = PBXBuildFile; fileRef = 8315868926F586F900803A3A /* m2_psb.h */; };
@ -103,6 +101,7 @@
8322ECE7240268BB009E9429 /* raw_al.c in Sources */ = {isa = PBXBuildFile; fileRef = 8322ECE6240268BA009E9429 /* raw_al.c */; };
832389501D2246C300482226 /* hca.c in Sources */ = {isa = PBXBuildFile; fileRef = 8323894F1D2246C300482226 /* hca.c */; };
832389521D224C0800482226 /* hca_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 832389511D224C0800482226 /* hca_decoder.c */; };
83256BC8286662840036D9C0 /* libmpg123.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256BC7286662610036D9C0 /* libmpg123.0.dylib */; };
83269DD22399F5DE00F49FE3 /* nus3bank_streamfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 83269DD02399F5DD00F49FE3 /* nus3bank_streamfile.h */; };
83269DD32399F5DE00F49FE3 /* ivag.c in Sources */ = {isa = PBXBuildFile; fileRef = 83269DD12399F5DE00F49FE3 /* ivag.c */; };
83299FD01E7660C7003A3242 /* bik.c in Sources */ = {isa = PBXBuildFile; fileRef = 83299FCE1E7660C7003A3242 /* bik.c */; };
@ -706,20 +705,6 @@
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
8313E3421901FBDD00B4B6F1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8313E33D1901FBDC00B4B6F1 /* mpg123.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8313E30F1901FBDC00B4B6F1;
remoteInfo = mpg123;
};
8313E3E81902021F00B4B6F1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8313E33D1901FBDC00B4B6F1 /* mpg123.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 8313E30E1901FBDC00B4B6F1;
remoteInfo = mpg123;
};
835FC6C523F62AEF006960FA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 835FC6C123F62AEE006960FA /* libatrac9.xcodeproj */;
@ -787,7 +772,6 @@
files = (
836C052C23F62F3100FA07C7 /* libatrac9.framework in CopyFiles */,
83D7318A1A749D2200CA1366 /* g719.framework in CopyFiles */,
8313E3E71902021800B4B6F1 /* mpg123.framework in CopyFiles */,
83D6772F2653A32B00252130 /* libcelt_0061.framework in CopyFiles */,
83D677302653A32E00252130 /* libcelt_0110.framework in CopyFiles */,
);
@ -880,7 +864,6 @@
830EBE0F2004655D0023AA10 /* atrac9_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atrac9_decoder.c; sourceTree = "<group>"; };
830EBE112004656E0023AA10 /* xnb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xnb.c; sourceTree = "<group>"; };
830EBE122004656E0023AA10 /* ktss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ktss.c; sourceTree = "<group>"; };
8313E33D1901FBDC00B4B6F1 /* mpg123.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mpg123.xcodeproj; path = ../mpg123/mpg123.xcodeproj; sourceTree = "<group>"; };
8315868326F586E200803A3A /* psb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psb.c; sourceTree = "<group>"; };
8315868826F586F900803A3A /* m2_psb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = m2_psb.c; sourceTree = "<group>"; };
8315868926F586F900803A3A /* m2_psb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = m2_psb.h; sourceTree = "<group>"; };
@ -901,6 +884,47 @@
8322ECE6240268BA009E9429 /* raw_al.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raw_al.c; sourceTree = "<group>"; };
8323894F1D2246C300482226 /* hca.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hca.c; sourceTree = "<group>"; };
832389511D224C0800482226 /* hca_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hca_decoder.c; sourceTree = "<group>"; };
83256B9D286662610036D9C0 /* l12tabs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = l12tabs.h; sourceTree = "<group>"; };
83256B9E286662610036D9C0 /* synth_8bit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = synth_8bit.h; sourceTree = "<group>"; };
83256B9F286662610036D9C0 /* index.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = index.h; sourceTree = "<group>"; };
83256BA0286662610036D9C0 /* synth_ntom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = synth_ntom.h; sourceTree = "<group>"; };
83256BA1286662610036D9C0 /* reader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; };
83256BA2286662610036D9C0 /* debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; };
83256BA3286662610036D9C0 /* mpg123.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = "<group>"; };
83256BA4286662610036D9C0 /* dither.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = "<group>"; };
83256BA5286662610036D9C0 /* optimize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = optimize.h; sourceTree = "<group>"; };
83256BA6286662610036D9C0 /* getbits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = getbits.h; sourceTree = "<group>"; };
83256BA7286662610036D9C0 /* synth.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = synth.h; sourceTree = "<group>"; };
83256BA8286662610036D9C0 /* synths.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = synths.h; sourceTree = "<group>"; };
83256BA9286662610036D9C0 /* mangle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mangle.h; sourceTree = "<group>"; };
83256BAA286662610036D9C0 /* init_layer12.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = init_layer12.h; sourceTree = "<group>"; };
83256BAB286662610036D9C0 /* frame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = "<group>"; };
83256BAC286662610036D9C0 /* parse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = "<group>"; };
83256BAD286662610036D9C0 /* synth_sse3d.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = synth_sse3d.h; sourceTree = "<group>"; };
83256BAE286662610036D9C0 /* l3bandgain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = l3bandgain.h; sourceTree = "<group>"; };
83256BAF286662610036D9C0 /* mpg123lib_intern.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpg123lib_intern.h; sourceTree = "<group>"; };
83256BB0286662610036D9C0 /* init_layer3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = init_layer3.h; sourceTree = "<group>"; };
83256BB1286662610036D9C0 /* getcpuflags.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = getcpuflags.h; sourceTree = "<group>"; };
83256BB2286662610036D9C0 /* icy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = icy.h; sourceTree = "<group>"; };
83256BB3286662610036D9C0 /* fmt123.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fmt123.h; sourceTree = "<group>"; };
83256BB4286662610036D9C0 /* newhuffman.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = newhuffman.h; sourceTree = "<group>"; };
83256BB5286662610036D9C0 /* synth_mono.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = synth_mono.h; sourceTree = "<group>"; };
83256BB6286662610036D9C0 /* gapless.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gapless.h; sourceTree = "<group>"; };
83256BB7286662610036D9C0 /* costabs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = costabs.h; sourceTree = "<group>"; };
83256BB8286662610036D9C0 /* l2tables.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = "<group>"; };
83256BB9286662610036D9C0 /* swap_bytes_impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = swap_bytes_impl.h; sourceTree = "<group>"; };
83256BBA286662610036D9C0 /* icy2utf8.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = icy2utf8.h; sourceTree = "<group>"; };
83256BBB286662610036D9C0 /* l3tabs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = l3tabs.h; sourceTree = "<group>"; };
83256BBC286662610036D9C0 /* dither_impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dither_impl.h; sourceTree = "<group>"; };
83256BBD286662610036D9C0 /* mpeghead.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpeghead.h; sourceTree = "<group>"; };
83256BBE286662610036D9C0 /* huffman.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = "<group>"; };
83256BBF286662610036D9C0 /* sample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sample.h; sourceTree = "<group>"; };
83256BC0286662610036D9C0 /* init_costabs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = init_costabs.h; sourceTree = "<group>"; };
83256BC1286662610036D9C0 /* decode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = decode.h; sourceTree = "<group>"; };
83256BC2286662610036D9C0 /* abi_align.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = abi_align.h; sourceTree = "<group>"; };
83256BC3286662610036D9C0 /* true.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = true.h; sourceTree = "<group>"; };
83256BC4286662610036D9C0 /* id3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = id3.h; sourceTree = "<group>"; };
83256BC7286662610036D9C0 /* libmpg123.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libmpg123.0.dylib; sourceTree = "<group>"; };
83269DD02399F5DD00F49FE3 /* nus3bank_streamfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nus3bank_streamfile.h; sourceTree = "<group>"; };
83269DD12399F5DE00F49FE3 /* ivag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ivag.c; sourceTree = "<group>"; };
83299FCE1E7660C7003A3242 /* bik.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bik.c; sourceTree = "<group>"; };
@ -1510,8 +1534,8 @@
838BDB711D3B1F990022CA6F /* CoreFoundation.framework in Frameworks */,
838BDB6A1D3AF7140022CA6F /* libiconv.tbd in Frameworks */,
838BDB681D3AF70D0022CA6F /* libz.tbd in Frameworks */,
83256BC8286662840036D9C0 /* libmpg123.0.dylib in Frameworks */,
83D731891A749D1500CA1366 /* g719.framework in Frameworks */,
8313E3E61902020400B4B6F1 /* mpg123.framework in Frameworks */,
8315868D26F58AF900803A3A /* libspeex.a in Frameworks */,
836C052B23F62F1A00FA07C7 /* libatrac9.framework in Frameworks */,
83D6772D2653A30B00252130 /* libcelt_0061.framework in Frameworks */,
@ -1522,12 +1546,77 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8313E33E1901FBDC00B4B6F1 /* Products */ = {
83256B9A286662610036D9C0 /* mpg123 */ = {
isa = PBXGroup;
children = (
8313E3431901FBDD00B4B6F1 /* mpg123.framework */,
83256B9B286662610036D9C0 /* include */,
83256BC6286662610036D9C0 /* lib */,
);
name = Products;
name = mpg123;
path = ../../ThirdParty/mpg123;
sourceTree = "<group>";
};
83256B9B286662610036D9C0 /* include */ = {
isa = PBXGroup;
children = (
83256B9C286662610036D9C0 /* libmpg123 */,
);
path = include;
sourceTree = "<group>";
};
83256B9C286662610036D9C0 /* libmpg123 */ = {
isa = PBXGroup;
children = (
83256B9D286662610036D9C0 /* l12tabs.h */,
83256B9E286662610036D9C0 /* synth_8bit.h */,
83256B9F286662610036D9C0 /* index.h */,
83256BA0286662610036D9C0 /* synth_ntom.h */,
83256BA1286662610036D9C0 /* reader.h */,
83256BA2286662610036D9C0 /* debug.h */,
83256BA3286662610036D9C0 /* mpg123.h */,
83256BA4286662610036D9C0 /* dither.h */,
83256BA5286662610036D9C0 /* optimize.h */,
83256BA6286662610036D9C0 /* getbits.h */,
83256BA7286662610036D9C0 /* synth.h */,
83256BA8286662610036D9C0 /* synths.h */,
83256BA9286662610036D9C0 /* mangle.h */,
83256BAA286662610036D9C0 /* init_layer12.h */,
83256BAB286662610036D9C0 /* frame.h */,
83256BAC286662610036D9C0 /* parse.h */,
83256BAD286662610036D9C0 /* synth_sse3d.h */,
83256BAE286662610036D9C0 /* l3bandgain.h */,
83256BAF286662610036D9C0 /* mpg123lib_intern.h */,
83256BB0286662610036D9C0 /* init_layer3.h */,
83256BB1286662610036D9C0 /* getcpuflags.h */,
83256BB2286662610036D9C0 /* icy.h */,
83256BB3286662610036D9C0 /* fmt123.h */,
83256BB4286662610036D9C0 /* newhuffman.h */,
83256BB5286662610036D9C0 /* synth_mono.h */,
83256BB6286662610036D9C0 /* gapless.h */,
83256BB7286662610036D9C0 /* costabs.h */,
83256BB8286662610036D9C0 /* l2tables.h */,
83256BB9286662610036D9C0 /* swap_bytes_impl.h */,
83256BBA286662610036D9C0 /* icy2utf8.h */,
83256BBB286662610036D9C0 /* l3tabs.h */,
83256BBC286662610036D9C0 /* dither_impl.h */,
83256BBD286662610036D9C0 /* mpeghead.h */,
83256BBE286662610036D9C0 /* huffman.h */,
83256BBF286662610036D9C0 /* sample.h */,
83256BC0286662610036D9C0 /* init_costabs.h */,
83256BC1286662610036D9C0 /* decode.h */,
83256BC2286662610036D9C0 /* abi_align.h */,
83256BC3286662610036D9C0 /* true.h */,
83256BC4286662610036D9C0 /* id3.h */,
);
path = libmpg123;
sourceTree = "<group>";
};
83256BC6286662610036D9C0 /* lib */ = {
isa = PBXGroup;
children = (
83256BC7286662610036D9C0 /* libmpg123.0.dylib */,
);
path = lib;
sourceTree = "<group>";
};
835FC6C223F62AEE006960FA /* Products */ = {
@ -1579,6 +1668,7 @@
836F6B3E18BDB8880095E648 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
83256B9A286662610036D9C0 /* mpg123 */,
836EF0DC27BB97BA00BF35B2 /* libvorbisfile.3.dylib */,
836EF0D027BB960A00BF35B2 /* libvorbis.0.dylib */,
83B72E342790452C006007A3 /* libfdk-aac.2.dylib */,
@ -1591,7 +1681,6 @@
835FC6C123F62AEE006960FA /* libatrac9.xcodeproj */,
83D6762B26539A7100252130 /* libcelt_0061.xcodeproj */,
83D676B926539F4E00252130 /* libcelt_0110.xcodeproj */,
8313E33D1901FBDC00B4B6F1 /* mpg123.xcodeproj */,
);
name = "Other Frameworks";
sourceTree = "<group>";
@ -2461,7 +2550,6 @@
83D6772C2653A2F000252130 /* PBXTargetDependency */,
836C052623F62F0000FA07C7 /* PBXTargetDependency */,
83D731881A749D0D00CA1366 /* PBXTargetDependency */,
8313E3E91902021F00B4B6F1 /* PBXTargetDependency */,
);
name = libvgmstream;
productName = vgmstream;
@ -2512,10 +2600,6 @@
ProductGroup = 83D676BA26539F4E00252130 /* Products */;
ProjectRef = 83D676B926539F4E00252130 /* libcelt_0110.xcodeproj */;
},
{
ProductGroup = 8313E33E1901FBDC00B4B6F1 /* Products */;
ProjectRef = 8313E33D1901FBDC00B4B6F1 /* mpg123.xcodeproj */;
},
);
projectRoot = "";
targets = (
@ -2525,13 +2609,6 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
8313E3431901FBDD00B4B6F1 /* mpg123.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = mpg123.framework;
remoteRef = 8313E3421901FBDD00B4B6F1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
835FC6C623F62AEF006960FA /* libatrac9.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
@ -3142,11 +3219,6 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
8313E3E91902021F00B4B6F1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = mpg123;
targetProxy = 8313E3E81902021F00B4B6F1 /* PBXContainerItemProxy */;
};
836C052623F62F0000FA07C7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = libatrac9;
@ -3359,6 +3431,7 @@
../../ThirdParty/speex,
"../../ThirdParty/fdk-aac/lib",
../../ThirdParty/vorbis/lib,
../../ThirdParty/mpg123/lib,
);
PRODUCT_BUNDLE_IDENTIFIER = "NoWork-Inc.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
@ -3392,6 +3465,7 @@
../../ThirdParty/speex,
"../../ThirdParty/fdk-aac/lib",
../../ThirdParty/vorbis/lib,
../../ThirdParty/mpg123/lib,
);
PRODUCT_BUNDLE_IDENTIFIER = "NoWork-Inc.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";

View File

@ -7,8 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
83187C7120E4EAB700DED293 /* libOpenMPTOld.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8308151E20E4EA96003ACEDA /* libOpenMPTOld.framework */; };
83187C7220E4EAC400DED293 /* libOpenMPTOld.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8308151E20E4EA96003ACEDA /* libOpenMPTOld.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
83256BDE286663DF0036D9C0 /* libopenmpt.old.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256BCC286663DF0036D9C0 /* libopenmpt.old.a */; };
83256C0E286664090036D9C0 /* libmpg123.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256C0C286664090036D9C0 /* libmpg123.0.dylib */; };
83256C112866643E0036D9C0 /* libvorbisfile.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256C0F2866643E0036D9C0 /* libvorbisfile.3.dylib */; };
83256C142866645F0036D9C0 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256C13286664580036D9C0 /* libz.tbd */; };
8372349F277AA34000CD0A77 /* OMPTVersionCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = 8372349D277AA34000CD0A77 /* OMPTVersionCheck.m */; };
83747C152862DB080021245F /* Shared.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 83747C132862DB080021245F /* Shared.xcconfig */; };
83E5FE731FFF010C00659F0F /* OMPTDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E5FE6D1FFF010B00659F0F /* OMPTDecoder.mm */; };
@ -16,23 +18,6 @@
83E5FE751FFF010C00659F0F /* OMPTMetadataReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E5FE701FFF010C00659F0F /* OMPTMetadataReader.mm */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
8308151D20E4EA96003ACEDA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83E5EFC81FFEF7CC00659F0F /* libOpenMPTOld.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 83E5EFBD1FFEF7CC00659F0F;
remoteInfo = libOpenMPTOld;
};
83187C6E20E4EAA900DED293 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83E5EFC81FFEF7CC00659F0F /* libOpenMPTOld.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 83E5EFBC1FFEF7CC00659F0F;
remoteInfo = libOpenMPTOld;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
83E5FE681FFF001800659F0F /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
@ -40,19 +25,76 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
83187C7220E4EAC400DED293 /* libOpenMPTOld.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
83256BCC286663DF0036D9C0 /* libopenmpt.old.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopenmpt.old.a; sourceTree = "<group>"; };
83256BCF286663DF0036D9C0 /* libopenmpt_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_impl.hpp; sourceTree = "<group>"; };
83256BD0286663DF0036D9C0 /* libopenmpt_stream_callbacks_fd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_stream_callbacks_fd.h; sourceTree = "<group>"; };
83256BD1286663DF0036D9C0 /* libopenmpt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt.hpp; sourceTree = "<group>"; };
83256BD2286663DF0036D9C0 /* libopenmpt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt.h; sourceTree = "<group>"; };
83256BD3286663DF0036D9C0 /* libopenmpt_plugin_settings.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_plugin_settings.hpp; sourceTree = "<group>"; };
83256BD4286663DF0036D9C0 /* libopenmpt_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_internal.h; sourceTree = "<group>"; };
83256BD5286663DF0036D9C0 /* libopenmpt_ext_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_ext_impl.hpp; sourceTree = "<group>"; };
83256BD6286663DF0036D9C0 /* libopenmpt_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_config.h; sourceTree = "<group>"; };
83256BD7286663DF0036D9C0 /* libopenmpt_stream_callbacks_file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_stream_callbacks_file.h; sourceTree = "<group>"; };
83256BD8286663DF0036D9C0 /* libopenmpt_ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_ext.h; sourceTree = "<group>"; };
83256BD9286663DF0036D9C0 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = "<group>"; };
83256BDA286663DF0036D9C0 /* libopenmpt_plugin_gui.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_plugin_gui.hpp; sourceTree = "<group>"; };
83256BDB286663DF0036D9C0 /* libopenmpt_ext.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_ext.hpp; sourceTree = "<group>"; };
83256BDC286663DF0036D9C0 /* libopenmpt_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_version.h; sourceTree = "<group>"; };
83256BDD286663DF0036D9C0 /* libopenmpt_stream_callbacks_buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_stream_callbacks_buffer.h; sourceTree = "<group>"; };
83256BE2286664080036D9C0 /* l12tabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l12tabs.h; sourceTree = "<group>"; };
83256BE3286664080036D9C0 /* synth_8bit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_8bit.h; sourceTree = "<group>"; };
83256BE4286664080036D9C0 /* index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = index.h; sourceTree = "<group>"; };
83256BE5286664080036D9C0 /* synth_ntom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_ntom.h; sourceTree = "<group>"; };
83256BE6286664080036D9C0 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; };
83256BE7286664080036D9C0 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; };
83256BE8286664080036D9C0 /* mpg123.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = "<group>"; };
83256BE9286664090036D9C0 /* dither.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = "<group>"; };
83256BEA286664090036D9C0 /* optimize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = optimize.h; sourceTree = "<group>"; };
83256BEB286664090036D9C0 /* getbits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getbits.h; sourceTree = "<group>"; };
83256BEC286664090036D9C0 /* synth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth.h; sourceTree = "<group>"; };
83256BED286664090036D9C0 /* synths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synths.h; sourceTree = "<group>"; };
83256BEE286664090036D9C0 /* mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mangle.h; sourceTree = "<group>"; };
83256BEF286664090036D9C0 /* init_layer12.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = init_layer12.h; sourceTree = "<group>"; };
83256BF0286664090036D9C0 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = "<group>"; };
83256BF1286664090036D9C0 /* parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = "<group>"; };
83256BF2286664090036D9C0 /* synth_sse3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_sse3d.h; sourceTree = "<group>"; };
83256BF3286664090036D9C0 /* l3bandgain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l3bandgain.h; sourceTree = "<group>"; };
83256BF4286664090036D9C0 /* mpg123lib_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123lib_intern.h; sourceTree = "<group>"; };
83256BF5286664090036D9C0 /* init_layer3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = init_layer3.h; sourceTree = "<group>"; };
83256BF6286664090036D9C0 /* getcpuflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getcpuflags.h; sourceTree = "<group>"; };
83256BF7286664090036D9C0 /* icy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy.h; sourceTree = "<group>"; };
83256BF8286664090036D9C0 /* fmt123.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fmt123.h; sourceTree = "<group>"; };
83256BF9286664090036D9C0 /* newhuffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newhuffman.h; sourceTree = "<group>"; };
83256BFA286664090036D9C0 /* synth_mono.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_mono.h; sourceTree = "<group>"; };
83256BFB286664090036D9C0 /* gapless.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gapless.h; sourceTree = "<group>"; };
83256BFC286664090036D9C0 /* costabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = costabs.h; sourceTree = "<group>"; };
83256BFD286664090036D9C0 /* l2tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = "<group>"; };
83256BFE286664090036D9C0 /* swap_bytes_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap_bytes_impl.h; sourceTree = "<group>"; };
83256BFF286664090036D9C0 /* icy2utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy2utf8.h; sourceTree = "<group>"; };
83256C00286664090036D9C0 /* l3tabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l3tabs.h; sourceTree = "<group>"; };
83256C01286664090036D9C0 /* dither_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither_impl.h; sourceTree = "<group>"; };
83256C02286664090036D9C0 /* mpeghead.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpeghead.h; sourceTree = "<group>"; };
83256C03286664090036D9C0 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = "<group>"; };
83256C04286664090036D9C0 /* sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample.h; sourceTree = "<group>"; };
83256C05286664090036D9C0 /* init_costabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = init_costabs.h; sourceTree = "<group>"; };
83256C06286664090036D9C0 /* decode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decode.h; sourceTree = "<group>"; };
83256C07286664090036D9C0 /* abi_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = abi_align.h; sourceTree = "<group>"; };
83256C08286664090036D9C0 /* true.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = true.h; sourceTree = "<group>"; };
83256C09286664090036D9C0 /* id3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3.h; sourceTree = "<group>"; };
83256C0C286664090036D9C0 /* libmpg123.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libmpg123.0.dylib; sourceTree = "<group>"; };
83256C0F2866643E0036D9C0 /* libvorbisfile.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbisfile.3.dylib; path = ../../ThirdParty/vorbis/lib/libvorbisfile.3.dylib; sourceTree = "<group>"; };
83256C13286664580036D9C0 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
8372349D277AA34000CD0A77 /* OMPTVersionCheck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OMPTVersionCheck.m; path = OpenMPT/OMPTVersionCheck.m; sourceTree = "<group>"; };
8372349E277AA34000CD0A77 /* OMPTVersionCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OMPTVersionCheck.h; path = OpenMPT/OMPTVersionCheck.h; sourceTree = "<group>"; };
83747C132862DB080021245F /* Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shared.xcconfig; sourceTree = "<group>"; };
83E5EFA31FFEF78100659F0F /* OpenMPTOld.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OpenMPTOld.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
83E5EFA61FFEF78100659F0F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
83E5EFC81FFEF7CC00659F0F /* libOpenMPTOld.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libOpenMPTOld.xcodeproj; path = ../../Frameworks/OpenMPT.old/libOpenMPTOld.xcodeproj; sourceTree = "<group>"; };
83E5FE6B1FFF004D00659F0F /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = "<group>"; };
83E5FE6C1FFF006400659F0F /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = "<group>"; };
83E5FE6D1FFF010B00659F0F /* OMPTDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OMPTDecoder.mm; path = OpenMPT/OMPTDecoder.mm; sourceTree = "<group>"; };
@ -69,19 +111,135 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
83187C7120E4EAB700DED293 /* libOpenMPTOld.framework in Frameworks */,
83256C0E286664090036D9C0 /* libmpg123.0.dylib in Frameworks */,
83256C142866645F0036D9C0 /* libz.tbd in Frameworks */,
83256C112866643E0036D9C0 /* libvorbisfile.3.dylib in Frameworks */,
83256BDE286663DF0036D9C0 /* libopenmpt.old.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8308151A20E4EA96003ACEDA /* Products */ = {
83256BCA2866634A0036D9C0 /* libopenmpt_old */ = {
isa = PBXGroup;
children = (
8308151E20E4EA96003ACEDA /* libOpenMPTOld.framework */,
83256BCD286663DF0036D9C0 /* include */,
83256BCB286663DF0036D9C0 /* lib */,
);
name = Products;
name = libopenmpt_old;
path = ../../ThirdParty/libopenmpt_old;
sourceTree = "<group>";
};
83256BCB286663DF0036D9C0 /* lib */ = {
isa = PBXGroup;
children = (
83256BCC286663DF0036D9C0 /* libopenmpt.old.a */,
);
path = lib;
sourceTree = "<group>";
};
83256BCD286663DF0036D9C0 /* include */ = {
isa = PBXGroup;
children = (
83256BCE286663DF0036D9C0 /* libopenmpt */,
);
path = include;
sourceTree = "<group>";
};
83256BCE286663DF0036D9C0 /* libopenmpt */ = {
isa = PBXGroup;
children = (
83256BCF286663DF0036D9C0 /* libopenmpt_impl.hpp */,
83256BD0286663DF0036D9C0 /* libopenmpt_stream_callbacks_fd.h */,
83256BD1286663DF0036D9C0 /* libopenmpt.hpp */,
83256BD2286663DF0036D9C0 /* libopenmpt.h */,
83256BD3286663DF0036D9C0 /* libopenmpt_plugin_settings.hpp */,
83256BD4286663DF0036D9C0 /* libopenmpt_internal.h */,
83256BD5286663DF0036D9C0 /* libopenmpt_ext_impl.hpp */,
83256BD6286663DF0036D9C0 /* libopenmpt_config.h */,
83256BD7286663DF0036D9C0 /* libopenmpt_stream_callbacks_file.h */,
83256BD8286663DF0036D9C0 /* libopenmpt_ext.h */,
83256BD9286663DF0036D9C0 /* resource.h */,
83256BDA286663DF0036D9C0 /* libopenmpt_plugin_gui.hpp */,
83256BDB286663DF0036D9C0 /* libopenmpt_ext.hpp */,
83256BDC286663DF0036D9C0 /* libopenmpt_version.h */,
83256BDD286663DF0036D9C0 /* libopenmpt_stream_callbacks_buffer.h */,
);
path = libopenmpt;
sourceTree = "<group>";
};
83256BDF286664080036D9C0 /* mpg123 */ = {
isa = PBXGroup;
children = (
83256BE0286664080036D9C0 /* include */,
83256C0B286664090036D9C0 /* lib */,
);
name = mpg123;
path = ../../ThirdParty/mpg123;
sourceTree = "<group>";
};
83256BE0286664080036D9C0 /* include */ = {
isa = PBXGroup;
children = (
83256BE1286664080036D9C0 /* libmpg123 */,
);
path = include;
sourceTree = "<group>";
};
83256BE1286664080036D9C0 /* libmpg123 */ = {
isa = PBXGroup;
children = (
83256BE2286664080036D9C0 /* l12tabs.h */,
83256BE3286664080036D9C0 /* synth_8bit.h */,
83256BE4286664080036D9C0 /* index.h */,
83256BE5286664080036D9C0 /* synth_ntom.h */,
83256BE6286664080036D9C0 /* reader.h */,
83256BE7286664080036D9C0 /* debug.h */,
83256BE8286664080036D9C0 /* mpg123.h */,
83256BE9286664090036D9C0 /* dither.h */,
83256BEA286664090036D9C0 /* optimize.h */,
83256BEB286664090036D9C0 /* getbits.h */,
83256BEC286664090036D9C0 /* synth.h */,
83256BED286664090036D9C0 /* synths.h */,
83256BEE286664090036D9C0 /* mangle.h */,
83256BEF286664090036D9C0 /* init_layer12.h */,
83256BF0286664090036D9C0 /* frame.h */,
83256BF1286664090036D9C0 /* parse.h */,
83256BF2286664090036D9C0 /* synth_sse3d.h */,
83256BF3286664090036D9C0 /* l3bandgain.h */,
83256BF4286664090036D9C0 /* mpg123lib_intern.h */,
83256BF5286664090036D9C0 /* init_layer3.h */,
83256BF6286664090036D9C0 /* getcpuflags.h */,
83256BF7286664090036D9C0 /* icy.h */,
83256BF8286664090036D9C0 /* fmt123.h */,
83256BF9286664090036D9C0 /* newhuffman.h */,
83256BFA286664090036D9C0 /* synth_mono.h */,
83256BFB286664090036D9C0 /* gapless.h */,
83256BFC286664090036D9C0 /* costabs.h */,
83256BFD286664090036D9C0 /* l2tables.h */,
83256BFE286664090036D9C0 /* swap_bytes_impl.h */,
83256BFF286664090036D9C0 /* icy2utf8.h */,
83256C00286664090036D9C0 /* l3tabs.h */,
83256C01286664090036D9C0 /* dither_impl.h */,
83256C02286664090036D9C0 /* mpeghead.h */,
83256C03286664090036D9C0 /* huffman.h */,
83256C04286664090036D9C0 /* sample.h */,
83256C05286664090036D9C0 /* init_costabs.h */,
83256C06286664090036D9C0 /* decode.h */,
83256C07286664090036D9C0 /* abi_align.h */,
83256C08286664090036D9C0 /* true.h */,
83256C09286664090036D9C0 /* id3.h */,
);
path = libmpg123;
sourceTree = "<group>";
};
83256C0B286664090036D9C0 /* lib */ = {
isa = PBXGroup;
children = (
83256C0C286664090036D9C0 /* libmpg123.0.dylib */,
);
path = lib;
sourceTree = "<group>";
};
83747C122862DB080021245F /* Xcode-config */ = {
@ -123,7 +281,10 @@
83E5EFB21FFEF79000659F0F /* Frameworks */ = {
isa = PBXGroup;
children = (
83E5EFC81FFEF7CC00659F0F /* libOpenMPTOld.xcodeproj */,
83256BCA2866634A0036D9C0 /* libopenmpt_old */,
83256C0F2866643E0036D9C0 /* libvorbisfile.3.dylib */,
83256C13286664580036D9C0 /* libz.tbd */,
83256BDF286664080036D9C0 /* mpg123 */,
);
name = Frameworks;
sourceTree = "<group>";
@ -161,7 +322,6 @@
buildRules = (
);
dependencies = (
83187C6F20E4EAA900DED293 /* PBXTargetDependency */,
);
name = OpenMPTOld;
productName = OpenMPTOld;
@ -193,12 +353,6 @@
mainGroup = 83E5EF9A1FFEF78100659F0F;
productRefGroup = 83E5EFA41FFEF78100659F0F /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 8308151A20E4EA96003ACEDA /* Products */;
ProjectRef = 83E5EFC81FFEF7CC00659F0F /* libOpenMPTOld.xcodeproj */;
},
);
projectRoot = "";
targets = (
83E5EFA21FFEF78100659F0F /* OpenMPTOld */,
@ -206,16 +360,6 @@
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
8308151E20E4EA96003ACEDA /* libOpenMPTOld.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = libOpenMPTOld.framework;
remoteRef = 8308151D20E4EA96003ACEDA /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
83E5EFA11FFEF78100659F0F /* Resources */ = {
isa = PBXResourcesBuildPhase;
@ -241,14 +385,6 @@
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
83187C6F20E4EAA900DED293 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = libOpenMPTOld;
targetProxy = 83187C6E20E4EAA900DED293 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
83E5EFA71FFEF78100659F0F /* Debug */ = {
isa = XCBuildConfiguration;
@ -368,6 +504,11 @@
DEAD_CODE_STRIPPING = YES;
INFOPLIST_FILE = OpenMPT/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = (
../../ThirdParty/libopenmpt_old/lib,
../../ThirdParty/mpg123/lib,
../../ThirdParty/vorbis/lib,
);
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.OpenMPTOld;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
@ -382,6 +523,11 @@
DEAD_CODE_STRIPPING = YES;
INFOPLIST_FILE = OpenMPT/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = (
../../ThirdParty/libopenmpt_old/lib,
../../ThirdParty/mpg123/lib,
../../ThirdParty/vorbis/lib,
);
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.OpenMPTOld;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;

View File

@ -7,8 +7,11 @@
objects = {
/* Begin PBXBuildFile section */
83187C7120E4EAB700DED293 /* libOpenMPT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8308151E20E4EA96003ACEDA /* libOpenMPT.framework */; };
83187C7220E4EAC400DED293 /* libOpenMPT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8308151E20E4EA96003ACEDA /* libOpenMPT.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
83256B4A28665A5D0036D9C0 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 83256B4728665A5D0036D9C0 /* README.md */; };
83256B4B28665A5D0036D9C0 /* libopenmpt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256B4928665A5D0036D9C0 /* libopenmpt.a */; };
83256B4E28665B540036D9C0 /* libvorbisfile.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256B4D28665B540036D9C0 /* libvorbisfile.3.dylib */; };
83256B4F28665BAF0036D9C0 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256B4C28665B0A0036D9C0 /* libz.tbd */; };
83256B99286662360036D9C0 /* libmpg123.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83256B97286662360036D9C0 /* libmpg123.0.dylib */; };
8372349C277AA23F00CD0A77 /* OMPTVersionCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = 8372349B277AA23F00CD0A77 /* OMPTVersionCheck.m */; };
83747C1A2862DB2F0021245F /* Shared.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 83747C182862DB2F0021245F /* Shared.xcconfig */; };
83E5FE731FFF010C00659F0F /* OMPTDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E5FE6D1FFF010B00659F0F /* OMPTDecoder.mm */; };
@ -16,43 +19,72 @@
83E5FE751FFF010C00659F0F /* OMPTMetadataReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E5FE701FFF010C00659F0F /* OMPTMetadataReader.mm */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
8308151D20E4EA96003ACEDA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83E5EFC81FFEF7CC00659F0F /* libOpenMPT.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 83E5EFBD1FFEF7CC00659F0F;
remoteInfo = libOpenMPT;
};
83187C6E20E4EAA900DED293 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83E5EFC81FFEF7CC00659F0F /* libOpenMPT.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 83E5EFBC1FFEF7CC00659F0F;
remoteInfo = libOpenMPT;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
83E5FE681FFF001800659F0F /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
83187C7220E4EAC400DED293 /* libOpenMPT.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
83256B3828665A5D0036D9C0 /* libopenmpt_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_impl.hpp; sourceTree = "<group>"; };
83256B3928665A5D0036D9C0 /* libopenmpt_stream_callbacks_fd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_stream_callbacks_fd.h; sourceTree = "<group>"; };
83256B3A28665A5D0036D9C0 /* libopenmpt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt.hpp; sourceTree = "<group>"; };
83256B3B28665A5D0036D9C0 /* libopenmpt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt.h; sourceTree = "<group>"; };
83256B3C28665A5D0036D9C0 /* libopenmpt_plugin_settings.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_plugin_settings.hpp; sourceTree = "<group>"; };
83256B3D28665A5D0036D9C0 /* libopenmpt_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_internal.h; sourceTree = "<group>"; };
83256B3E28665A5D0036D9C0 /* libopenmpt_ext_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_ext_impl.hpp; sourceTree = "<group>"; };
83256B3F28665A5D0036D9C0 /* libopenmpt_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_config.h; sourceTree = "<group>"; };
83256B4028665A5D0036D9C0 /* libopenmpt_stream_callbacks_file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_stream_callbacks_file.h; sourceTree = "<group>"; };
83256B4128665A5D0036D9C0 /* libopenmpt_ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_ext.h; sourceTree = "<group>"; };
83256B4228665A5D0036D9C0 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = "<group>"; };
83256B4328665A5D0036D9C0 /* libopenmpt_plugin_gui.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_plugin_gui.hpp; sourceTree = "<group>"; };
83256B4428665A5D0036D9C0 /* libopenmpt_ext.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libopenmpt_ext.hpp; sourceTree = "<group>"; };
83256B4528665A5D0036D9C0 /* libopenmpt_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_version.h; sourceTree = "<group>"; };
83256B4628665A5D0036D9C0 /* libopenmpt_stream_callbacks_buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libopenmpt_stream_callbacks_buffer.h; sourceTree = "<group>"; };
83256B4728665A5D0036D9C0 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
83256B4928665A5D0036D9C0 /* libopenmpt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopenmpt.a; sourceTree = "<group>"; };
83256B4C28665B0A0036D9C0 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
83256B4D28665B540036D9C0 /* libvorbisfile.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libvorbisfile.3.dylib; path = ../../ThirdParty/vorbis/lib/libvorbisfile.3.dylib; sourceTree = "<group>"; };
83256B6D286662360036D9C0 /* l12tabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l12tabs.h; sourceTree = "<group>"; };
83256B6E286662360036D9C0 /* synth_8bit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_8bit.h; sourceTree = "<group>"; };
83256B6F286662360036D9C0 /* index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = index.h; sourceTree = "<group>"; };
83256B70286662360036D9C0 /* synth_ntom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_ntom.h; sourceTree = "<group>"; };
83256B71286662360036D9C0 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; };
83256B72286662360036D9C0 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; };
83256B73286662360036D9C0 /* mpg123.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = "<group>"; };
83256B74286662360036D9C0 /* dither.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = "<group>"; };
83256B75286662360036D9C0 /* optimize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = optimize.h; sourceTree = "<group>"; };
83256B76286662360036D9C0 /* getbits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getbits.h; sourceTree = "<group>"; };
83256B77286662360036D9C0 /* synth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth.h; sourceTree = "<group>"; };
83256B78286662360036D9C0 /* synths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synths.h; sourceTree = "<group>"; };
83256B79286662360036D9C0 /* mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mangle.h; sourceTree = "<group>"; };
83256B7A286662360036D9C0 /* init_layer12.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = init_layer12.h; sourceTree = "<group>"; };
83256B7B286662360036D9C0 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = "<group>"; };
83256B7C286662360036D9C0 /* parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = "<group>"; };
83256B7D286662360036D9C0 /* synth_sse3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_sse3d.h; sourceTree = "<group>"; };
83256B7E286662360036D9C0 /* l3bandgain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l3bandgain.h; sourceTree = "<group>"; };
83256B7F286662360036D9C0 /* mpg123lib_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123lib_intern.h; sourceTree = "<group>"; };
83256B80286662360036D9C0 /* init_layer3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = init_layer3.h; sourceTree = "<group>"; };
83256B81286662360036D9C0 /* getcpuflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getcpuflags.h; sourceTree = "<group>"; };
83256B82286662360036D9C0 /* icy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy.h; sourceTree = "<group>"; };
83256B83286662360036D9C0 /* fmt123.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fmt123.h; sourceTree = "<group>"; };
83256B84286662360036D9C0 /* newhuffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newhuffman.h; sourceTree = "<group>"; };
83256B85286662360036D9C0 /* synth_mono.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_mono.h; sourceTree = "<group>"; };
83256B86286662360036D9C0 /* gapless.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gapless.h; sourceTree = "<group>"; };
83256B87286662360036D9C0 /* costabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = costabs.h; sourceTree = "<group>"; };
83256B88286662360036D9C0 /* l2tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = "<group>"; };
83256B89286662360036D9C0 /* swap_bytes_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap_bytes_impl.h; sourceTree = "<group>"; };
83256B8A286662360036D9C0 /* icy2utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy2utf8.h; sourceTree = "<group>"; };
83256B8B286662360036D9C0 /* l3tabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l3tabs.h; sourceTree = "<group>"; };
83256B8C286662360036D9C0 /* dither_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither_impl.h; sourceTree = "<group>"; };
83256B8D286662360036D9C0 /* mpeghead.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpeghead.h; sourceTree = "<group>"; };
83256B8E286662360036D9C0 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = "<group>"; };
83256B8F286662360036D9C0 /* sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample.h; sourceTree = "<group>"; };
83256B90286662360036D9C0 /* init_costabs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = init_costabs.h; sourceTree = "<group>"; };
83256B91286662360036D9C0 /* decode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decode.h; sourceTree = "<group>"; };
83256B92286662360036D9C0 /* abi_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = abi_align.h; sourceTree = "<group>"; };
83256B93286662360036D9C0 /* true.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = true.h; sourceTree = "<group>"; };
83256B94286662360036D9C0 /* id3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3.h; sourceTree = "<group>"; };
83256B97286662360036D9C0 /* libmpg123.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libmpg123.0.dylib; sourceTree = "<group>"; };
8372349A277AA1F600CD0A77 /* OMPTVersionCheck.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OMPTVersionCheck.h; path = OpenMPT/OMPTVersionCheck.h; sourceTree = "<group>"; };
8372349B277AA23F00CD0A77 /* OMPTVersionCheck.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = OMPTVersionCheck.m; path = OpenMPT/OMPTVersionCheck.m; sourceTree = "<group>"; };
83747C182862DB2F0021245F /* Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shared.xcconfig; sourceTree = "<group>"; };
83E5EFA31FFEF78100659F0F /* OpenMPT.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OpenMPT.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
83E5EFA61FFEF78100659F0F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
83E5EFC81FFEF7CC00659F0F /* libOpenMPT.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libOpenMPT.xcodeproj; path = ../../Frameworks/OpenMPT/libOpenMPT.xcodeproj; sourceTree = "<group>"; };
83E5FE6B1FFF004D00659F0F /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = "<group>"; };
83E5FE6C1FFF006400659F0F /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = "<group>"; };
83E5FE6D1FFF010B00659F0F /* OMPTDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OMPTDecoder.mm; path = OpenMPT/OMPTDecoder.mm; sourceTree = "<group>"; };
@ -69,19 +101,136 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
83187C7120E4EAB700DED293 /* libOpenMPT.framework in Frameworks */,
83256B4E28665B540036D9C0 /* libvorbisfile.3.dylib in Frameworks */,
83256B4F28665BAF0036D9C0 /* libz.tbd in Frameworks */,
83256B99286662360036D9C0 /* libmpg123.0.dylib in Frameworks */,
83256B4B28665A5D0036D9C0 /* libopenmpt.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8308151A20E4EA96003ACEDA /* Products */ = {
83256B3528665A5D0036D9C0 /* libopenmpt */ = {
isa = PBXGroup;
children = (
8308151E20E4EA96003ACEDA /* libOpenMPT.framework */,
83256B3628665A5D0036D9C0 /* include */,
83256B4728665A5D0036D9C0 /* README.md */,
83256B4828665A5D0036D9C0 /* lib */,
);
name = Products;
name = libopenmpt;
path = ../../ThirdParty/libopenmpt;
sourceTree = "<group>";
};
83256B3628665A5D0036D9C0 /* include */ = {
isa = PBXGroup;
children = (
83256B3728665A5D0036D9C0 /* libopenmpt */,
);
path = include;
sourceTree = "<group>";
};
83256B3728665A5D0036D9C0 /* libopenmpt */ = {
isa = PBXGroup;
children = (
83256B3828665A5D0036D9C0 /* libopenmpt_impl.hpp */,
83256B3928665A5D0036D9C0 /* libopenmpt_stream_callbacks_fd.h */,
83256B3A28665A5D0036D9C0 /* libopenmpt.hpp */,
83256B3B28665A5D0036D9C0 /* libopenmpt.h */,
83256B3C28665A5D0036D9C0 /* libopenmpt_plugin_settings.hpp */,
83256B3D28665A5D0036D9C0 /* libopenmpt_internal.h */,
83256B3E28665A5D0036D9C0 /* libopenmpt_ext_impl.hpp */,
83256B3F28665A5D0036D9C0 /* libopenmpt_config.h */,
83256B4028665A5D0036D9C0 /* libopenmpt_stream_callbacks_file.h */,
83256B4128665A5D0036D9C0 /* libopenmpt_ext.h */,
83256B4228665A5D0036D9C0 /* resource.h */,
83256B4328665A5D0036D9C0 /* libopenmpt_plugin_gui.hpp */,
83256B4428665A5D0036D9C0 /* libopenmpt_ext.hpp */,
83256B4528665A5D0036D9C0 /* libopenmpt_version.h */,
83256B4628665A5D0036D9C0 /* libopenmpt_stream_callbacks_buffer.h */,
);
path = libopenmpt;
sourceTree = "<group>";
};
83256B4828665A5D0036D9C0 /* lib */ = {
isa = PBXGroup;
children = (
83256B4928665A5D0036D9C0 /* libopenmpt.a */,
);
path = lib;
sourceTree = "<group>";
};
83256B6A286662360036D9C0 /* mpg123 */ = {
isa = PBXGroup;
children = (
83256B6B286662360036D9C0 /* include */,
83256B96286662360036D9C0 /* lib */,
);
name = mpg123;
path = ../../ThirdParty/mpg123;
sourceTree = "<group>";
};
83256B6B286662360036D9C0 /* include */ = {
isa = PBXGroup;
children = (
83256B6C286662360036D9C0 /* libmpg123 */,
);
path = include;
sourceTree = "<group>";
};
83256B6C286662360036D9C0 /* libmpg123 */ = {
isa = PBXGroup;
children = (
83256B6D286662360036D9C0 /* l12tabs.h */,
83256B6E286662360036D9C0 /* synth_8bit.h */,
83256B6F286662360036D9C0 /* index.h */,
83256B70286662360036D9C0 /* synth_ntom.h */,
83256B71286662360036D9C0 /* reader.h */,
83256B72286662360036D9C0 /* debug.h */,
83256B73286662360036D9C0 /* mpg123.h */,
83256B74286662360036D9C0 /* dither.h */,
83256B75286662360036D9C0 /* optimize.h */,
83256B76286662360036D9C0 /* getbits.h */,
83256B77286662360036D9C0 /* synth.h */,
83256B78286662360036D9C0 /* synths.h */,
83256B79286662360036D9C0 /* mangle.h */,
83256B7A286662360036D9C0 /* init_layer12.h */,
83256B7B286662360036D9C0 /* frame.h */,
83256B7C286662360036D9C0 /* parse.h */,
83256B7D286662360036D9C0 /* synth_sse3d.h */,
83256B7E286662360036D9C0 /* l3bandgain.h */,
83256B7F286662360036D9C0 /* mpg123lib_intern.h */,
83256B80286662360036D9C0 /* init_layer3.h */,
83256B81286662360036D9C0 /* getcpuflags.h */,
83256B82286662360036D9C0 /* icy.h */,
83256B83286662360036D9C0 /* fmt123.h */,
83256B84286662360036D9C0 /* newhuffman.h */,
83256B85286662360036D9C0 /* synth_mono.h */,
83256B86286662360036D9C0 /* gapless.h */,
83256B87286662360036D9C0 /* costabs.h */,
83256B88286662360036D9C0 /* l2tables.h */,
83256B89286662360036D9C0 /* swap_bytes_impl.h */,
83256B8A286662360036D9C0 /* icy2utf8.h */,
83256B8B286662360036D9C0 /* l3tabs.h */,
83256B8C286662360036D9C0 /* dither_impl.h */,
83256B8D286662360036D9C0 /* mpeghead.h */,
83256B8E286662360036D9C0 /* huffman.h */,
83256B8F286662360036D9C0 /* sample.h */,
83256B90286662360036D9C0 /* init_costabs.h */,
83256B91286662360036D9C0 /* decode.h */,
83256B92286662360036D9C0 /* abi_align.h */,
83256B93286662360036D9C0 /* true.h */,
83256B94286662360036D9C0 /* id3.h */,
);
path = libmpg123;
sourceTree = "<group>";
};
83256B96286662360036D9C0 /* lib */ = {
isa = PBXGroup;
children = (
83256B97286662360036D9C0 /* libmpg123.0.dylib */,
);
path = lib;
sourceTree = "<group>";
};
83747C172862DB2F0021245F /* Xcode-config */ = {
@ -123,7 +272,10 @@
83E5EFB21FFEF79000659F0F /* Frameworks */ = {
isa = PBXGroup;
children = (
83E5EFC81FFEF7CC00659F0F /* libOpenMPT.xcodeproj */,
83256B3528665A5D0036D9C0 /* libopenmpt */,
83256B4D28665B540036D9C0 /* libvorbisfile.3.dylib */,
83256B4C28665B0A0036D9C0 /* libz.tbd */,
83256B6A286662360036D9C0 /* mpg123 */,
);
name = Frameworks;
sourceTree = "<group>";
@ -156,12 +308,10 @@
83E5EF9F1FFEF78100659F0F /* Sources */,
83E5EFA01FFEF78100659F0F /* Frameworks */,
83E5EFA11FFEF78100659F0F /* Resources */,
83E5FE681FFF001800659F0F /* CopyFiles */,
);
buildRules = (
);
dependencies = (
83187C6F20E4EAA900DED293 /* PBXTargetDependency */,
);
name = OpenMPT;
productName = OpenMPT;
@ -193,12 +343,6 @@
mainGroup = 83E5EF9A1FFEF78100659F0F;
productRefGroup = 83E5EFA41FFEF78100659F0F /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 8308151A20E4EA96003ACEDA /* Products */;
ProjectRef = 83E5EFC81FFEF7CC00659F0F /* libOpenMPT.xcodeproj */;
},
);
projectRoot = "";
targets = (
83E5EFA21FFEF78100659F0F /* OpenMPT */,
@ -206,21 +350,12 @@
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
8308151E20E4EA96003ACEDA /* libOpenMPT.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = libOpenMPT.framework;
remoteRef = 8308151D20E4EA96003ACEDA /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
83E5EFA11FFEF78100659F0F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
83256B4A28665A5D0036D9C0 /* README.md in Resources */,
83747C1A2862DB2F0021245F /* Shared.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -241,14 +376,6 @@
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
83187C6F20E4EAA900DED293 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = libOpenMPT;
targetProxy = 83187C6E20E4EAA900DED293 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
83E5EFA71FFEF78100659F0F /* Debug */ = {
isa = XCBuildConfiguration;
@ -368,6 +495,11 @@
DEAD_CODE_STRIPPING = YES;
INFOPLIST_FILE = OpenMPT/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = (
../../ThirdParty/libopenmpt/lib,
../../ThirdParty/vorbis/lib,
../../ThirdParty/mpg123/lib,
);
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.OpenMPT;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
@ -382,6 +514,11 @@
DEAD_CODE_STRIPPING = YES;
INFOPLIST_FILE = OpenMPT/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = (
../../ThirdParty/libopenmpt/lib,
../../ThirdParty/vorbis/lib,
../../ThirdParty/mpg123/lib,
);
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.OpenMPT;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;

View File

@ -6,7 +6,7 @@
// Copyright 2018 __LoSnoCo__. All rights reserved.
//
#import <libOpenMPT/libopenmpt.hpp>
#import <libopenmpt/libopenmpt.hpp>
#import "OMPTContainer.h"
#import "OMPTDecoder.h"

View File

@ -8,7 +8,7 @@
#import <Cocoa/Cocoa.h>
#import <libOpenMPT/libopenmpt.hpp>
#import <libopenmpt/libopenmpt.hpp>
#include <vector>

View File

@ -9,7 +9,7 @@
#import "OMPTMetadataReader.h"
#import "OMPTDecoder.h"
#import <libOpenMPT/libopenmpt.hpp>
#import <libopenmpt/libopenmpt.hpp>
#import "Logging.H"

10
ThirdParty/libopenmpt/README.md vendored Normal file
View File

@ -0,0 +1,10 @@
Built from the latest archive, version 0.6.4 as of this writing, using the
Makefile variant:
for arch in x86_64 arm64; do
env CFLAGS="-g -Os -mmacosx-version-min=10.15 -arch $arch" CXXFLAGS="-g -Os -mmacosx-version-min=10.15 -arch $arch" LDFLAGS="-mmacosx-version-min=10.15 -arch $arch" make -j8 SHARED_LIB=0 EXAMPLES=0 OPENMPT123=0 DEBUG=1 OPTIMIZE_SIZE=1 TEST=0
cp bin/libopenmpt.a libopenmpt_$arch.a
make clean
done
lipo -create -output libopenmpt.a libopenmpt_x86_64.a libopenmpt_arm64.a

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,205 @@
/*
* libopenmpt_config.h
* -------------------
* Purpose: libopenmpt public interface configuration
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_CONFIG_H
#define LIBOPENMPT_CONFIG_H
/* clang-format off */
/*! \defgroup libopenmpt libopenmpt */
/*! \addtogroup libopenmpt
@{
*/
/* provoke warnings if already defined */
#define LIBOPENMPT_API
#undef LIBOPENMPT_API
#define LIBOPENMPT_CXX_API
#undef LIBOPENMPT_CXX_API
/*!
@}
*/
/*! \addtogroup libopenmpt_c
@{
*/
/*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_buffer.h exists. */
#define LIBOPENMPT_STREAM_CALLBACKS_BUFFER
/*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_fd.h exists.
* \since 0.3
* \remarks
* Use the following to check for availability:
* \code
* #include <libopenmpt/libopenmpt.h>
* #if defined(LIBOPENMPT_STREAM_CALLBACKS_FD) || ((OPENMPT_API_VERSION_MAJOR == 0) && ((OPENMPT_API_VERSION_MINOR == 2) || (OPENMPT_API_VERSION_MINOR == 1)))
* #include <libopenmpt/libopenmpt_stream_callbacks_fd.h>
* #endif
* \endcode
*/
#define LIBOPENMPT_STREAM_CALLBACKS_FD
/*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_file.h exists.
* \since 0.3
* \remarks
* Use the following to check for availability:
* \code
* #include <libopenmpt/libopenmpt.h>
* #if defined(LIBOPENMPT_STREAM_CALLBACKS_FILE) || ((OPENMPT_API_VERSION_MAJOR == 0) && ((OPENMPT_API_VERSION_MINOR == 2) || (OPENMPT_API_VERSION_MINOR == 1)))
* #include <libopenmpt/libopenmpt_stream_callbacks_file.h>
* #endif
* \endcode
*/
#define LIBOPENMPT_STREAM_CALLBACKS_FILE
/*!
@}
*/
/*! \addtogroup libopenmpt
@{
*/
#if defined(__DOXYGEN__)
#define LIBOPENMPT_API_HELPER_EXPORT
#define LIBOPENMPT_API_HELPER_IMPORT
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#elif defined(_MSC_VER)
#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#elif defined(__EMSCRIPTEN__)
#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
#elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
#elif defined(__GNUC__) || defined(__clang__)
#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
#elif defined(_WIN32)
#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#else
#define LIBOPENMPT_API_HELPER_EXPORT
#define LIBOPENMPT_API_HELPER_IMPORT
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#endif
#if defined(LIBOPENMPT_BUILD_DLL)
#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
#elif defined(LIBOPENMPT_USE_DLL)
#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
#else
#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
#endif
#ifdef __cplusplus
#define LIBOPENMPT_CXX_API LIBOPENMPT_API
#if defined(LIBOPENMPT_USE_DLL)
#if defined(_MSC_VER) && !defined(_DLL)
#error "C++ interface is disabled if libopenmpt is built as a DLL and the runtime is statically linked. This is not supported by microsoft and cannot possibly work. Ever."
#undef LIBOPENMPT_CXX_API
#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#endif
#if defined(__EMSCRIPTEN__)
/* Only the C API is supported for emscripten. Disable the C++ API. */
#undef LIBOPENMPT_CXX_API
#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#endif
/*!
@}
*/
/* C */
#if !defined(LIBOPENMPT_NO_DEPRECATE)
#if defined(__clang__)
#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
#elif defined(__GNUC__)
#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define LIBOPENMPT_DEPRECATED __declspec(deprecated)
#else
#define LIBOPENMPT_DEPRECATED
#endif
#else
#define LIBOPENMPT_DEPRECATED
#endif
#ifndef __cplusplus
#if !defined(LIBOPENMPT_NO_DEPRECATE)
LIBOPENMPT_DEPRECATED static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT = 0;
#define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
#else
#define LIBOPENMPT_DEPRECATED_STRING( str ) str
#endif
#else
#define LIBOPENMPT_DEPRECATED_STRING( str ) str
#endif
/* C++ */
#ifdef __cplusplus
#if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
#endif
#if !defined(LIBOPENMPT_NO_DEPRECATE)
#define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
#else
#define LIBOPENMPT_ATTR_DEPRECATED
#endif
#endif
/* clang-format on */
#include "libopenmpt_version.h"
#endif /* LIBOPENMPT_CONFIG_H */

View File

@ -0,0 +1,405 @@
/*
* libopenmpt_ext.h
* ----------------
* Purpose: libopenmpt public c interface for libopenmpt extensions
* Notes :
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_EXT_H
#define LIBOPENMPT_EXT_H
#include "libopenmpt_config.h"
#include "libopenmpt.h"
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \page libopenmpt_ext_c_overview libopenmpt_ext C API
*
* libopenmpt_ext is included in all builds by default.
*
* \section libopenmpt-ext-c-detailed Detailed documentation
*
* \ref libopenmpt_ext_c
*
*/
/*! \defgroup libopenmpt_ext_c libopenmpt_ext C */
/*! \addtogroup libopenmpt_ext_c
* @{
*/
/*! \brief Opaque type representing a libopenmpt extension module
*/
typedef struct openmpt_module_ext openmpt_module_ext;
/*! \brief Construct an openmpt_module_ext
*
* \param stream_callbacks Input stream callback operations.
* \param stream Input stream to load the module from.
* \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module_ext. May be NULL.
* \param loguser User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
* \param errfunc Error function to define error behaviour. May be NULL.
* \param erruser Error function user context. Used to pass any user-defined data associated with this module to the logging function.
* \param error Pointer to an integer where an error may get stored. May be NULL.
* \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
* \param ctls A map of initial ctl values, see openmpt_module_get_ctls.
* \return A pointer to the constructed openmpt_module_ext, or NULL on failure.
* \remarks The input data can be discarded after an openmpt_module_ext has been constructed successfully.
* \sa openmpt_stream_callbacks
* \sa \ref libopenmpt_c_fileio
* \since 0.3.0
*/
LIBOPENMPT_API openmpt_module_ext * openmpt_module_ext_create( openmpt_stream_callbacks stream_callbacks, void * stream, openmpt_log_func logfunc, void * loguser, openmpt_error_func errfunc, void * erruser, int * error, const char * * error_message, const openmpt_module_initial_ctl * ctls );
/*! \brief Construct an openmpt_module_ext
*
* \param filedata Data to load the module from.
* \param filesize Amount of data available.
* \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module_ext.
* \param loguser User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
* \param errfunc Error function to define error behaviour. May be NULL.
* \param erruser Error function user context. Used to pass any user-defined data associated with this module to the logging function.
* \param error Pointer to an integer where an error may get stored. May be NULL.
* \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
* \param ctls A map of initial ctl values, see openmpt_module_get_ctls.
* \return A pointer to the constructed openmpt_module_ext, or NULL on failure.
* \remarks The input data can be discarded after an openmpt_module_ext has been constructed successfully.
* \sa \ref libopenmpt_c_fileio
* \since 0.3.0
*/
LIBOPENMPT_API openmpt_module_ext * openmpt_module_ext_create_from_memory( const void * filedata, size_t filesize, openmpt_log_func logfunc, void * loguser, openmpt_error_func errfunc, void * erruser, int * error, const char * * error_message, const openmpt_module_initial_ctl * ctls );
/*! \brief Unload a previously created openmpt_module_ext from memory.
*
* \param mod_ext The module to unload.
*/
LIBOPENMPT_API void openmpt_module_ext_destroy( openmpt_module_ext * mod_ext );
/*! \brief Retrieve the openmpt_module handle from an openmpt_module_ext handle.
*
* \param mod_ext The extension module handle to convert
* \return An equivalent openmpt_module handle to pass to standard libopenmpt functions
* \since 0.3.0
*/
LIBOPENMPT_API openmpt_module * openmpt_module_ext_get_module( openmpt_module_ext * mod_ext );
/*! Retrieve a libopenmpt extension.
*
* \param mod_ext The module handle to work on.
* \param interface_id The name of the extension interface to retrieve (e.g. LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS).
* \param interface Appropriate structure of interface function pointers which is to be filled by this function (e.g. a pointer to a openmpt_module_ext_interface_pattern_vis structure).
* \param interface_size Size of the interface's structure of function pointers (e.g. sizeof(openmpt_module_ext_interface_pattern_vis)).
* \return 1 on success, 0 if the interface was not found.
* \since 0.3.0
*/
LIBOPENMPT_API int openmpt_module_ext_get_interface( openmpt_module_ext * mod_ext, const char * interface_id, void * interface, size_t interface_size );
#ifndef LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS
#define LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS "pattern_vis"
#endif
/*! Pattern command type */
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_UNKNOWN 0
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GENERAL 1
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GLOBAL 2
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_VOLUME 3
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PANNING 4
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PITCH 5
typedef struct openmpt_module_ext_interface_pattern_vis {
/*! Get pattern command type for pattern highlighting
*
* \param mod_ext The module handle to work on.
* \param pattern The pattern whose data should be retrieved.
* \param row The row from which the data should be retrieved.
* \param channel The channel from which the data should be retrieved.
* \return The command type in the effect column at the given pattern position (see OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_*)
* \sa openmpt_module_ext_interface_pattern_vis::get_pattern_row_channel_volume_effect_type
*/
int ( * get_pattern_row_channel_volume_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
/*! Get pattern command type for pattern highlighting
*
* \param mod_ext The module handle to work on.
* \param pattern The pattern whose data should be retrieved.
* \param row The row from which the data should be retrieved.
* \param channel The channel from which the data should be retrieved.
* \return The command type in the effect column at the given pattern position (see OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_*)
* \sa openmpt_module_ext_interface_pattern_vis::get_pattern_row_channel_volume_effect_type
*/
int ( * get_pattern_row_channel_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
} openmpt_module_ext_interface_pattern_vis;
#ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE
#define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE "interactive"
#endif
typedef struct openmpt_module_ext_interface_interactive {
/*! Set the current ticks per row (speed)
*
* \param mod_ext The module handle to work on.
* \param speed The new tick count in range [1, 65535].
* \return 1 on success, 0 on failure.
* \remarks The tick count may be reset by pattern commands at any time.
* \sa openmpt_module_get_current_speed
*/
int ( * set_current_speed ) ( openmpt_module_ext * mod_ext, int32_t speed );
/*! Set the current module tempo
*
* \param mod_ext The module handle to work on.
* \param tempo The new tempo in range [32, 512]. The exact meaning of the value depends on the tempo mode used by the module.
* \return 1 on success, 0 on failure.
* \remarks The tempo may be reset by pattern commands at any time. Use openmpt_module_ext_interface_interactive::set_tempo_factor to apply a tempo factor that is independent of pattern commands.
* \sa openmpt_module_get_current_tempo
*/
int ( * set_current_tempo ) ( openmpt_module_ext * mod_ext, int32_t tempo );
/*! Set the current module tempo factor without affecting playback pitch
*
* \param mod_ext The module handle to work on.
* \param factor The new tempo factor in range ]0.0, 4.0] - 1.0 means unmodified tempo.
* \return 1 on success, 0 on failure.
* \remarks Modifying the tempo without applying the same pitch factor using openmpt_module_ext_interface_interactive::set_pitch_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
* \sa openmpt_module_ext_interface_interactive::get_tempo_factor
*/
int ( * set_tempo_factor ) ( openmpt_module_ext * mod_ext, double factor );
/*! Gets the current module tempo factor
*
* \param mod_ext The module handle to work on.
* \return The current tempo factor.
* \sa openmpt_module_ext_interface_interactive::set_tempo_factor
*/
double ( * get_tempo_factor ) ( openmpt_module_ext * mod_ext );
/*! Set the current module pitch factor without affecting playback speed
*
* \param mod_ext The module handle to work on.
* \param factor The new pitch factor in range ]0.0, 4.0] - 1.0 means unmodified pitch.
* \return 1 on success, 0 on failure.
* \remarks Modifying the pitch without applying the the same tempo factor using openmpt_module_ext_interface_interactive::set_tempo_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
* \remarks To shift the pich by `n` semitones, the parameter can be calculated as follows: `pow( 2.0, n / 12.0 )`
* \sa openmpt_module_ext_interface_interactive::get_pitch_factor
*/
int ( * set_pitch_factor ) ( openmpt_module_ext * mod_ext, double factor );
/*! Gets the current module pitch factor
*
* \param mod_ext The module handle to work on.
* \return The current pitch factor.
* \sa openmpt_module_ext_interface_interactive::set_pitch_factor
*/
double ( * get_pitch_factor ) ( openmpt_module_ext * mod_ext );
/*! Set the current global volume
*
* \param mod_ext The module handle to work on.
* \param volume The new global volume in range [0.0, 1.0]
* \return 1 on success, 0 on failure.
* \remarks The global volume may be reset by pattern commands at any time. Use openmpt_module_set_render_param to apply a global overall volume factor that is independent of pattern commands.
* \sa openmpt_module_ext_interface_interactive::get_global_volume
*/
int ( * set_global_volume ) ( openmpt_module_ext * mod_ext, double volume );
/*! Get the current global volume
*
* \param mod_ext The module handle to work on.
* \return The current global volume in range [0.0, 1.0]
* \sa openmpt_module_ext_interface_interactive::set_global_volume
*/
double ( * get_global_volume ) ( openmpt_module_ext * mod_ext );
/*! Set the current channel volume for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose volume should be set, in range [0, openmpt_module_get_num_channels()[
* \param volume The new channel volume in range [0.0, 1.0]
* \return 1 on success, 0 on failure (channel out of range).
* \remarks The channel volume may be reset by pattern commands at any time.
* \sa openmpt_module_ext_interface_interactive::get_channel_volume
*/
int ( * set_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel, double volume );
/*! Get the current channel volume for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose volume should be retrieved, in range [0, openmpt_module_get_num_channels()[
* \return The current channel volume in range [0.0, 1.0]
* \sa openmpt_module_ext_interface_interactive::set_channel_volume
*/
double ( * get_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel );
/*! Set the current mute status for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose mute status should be set, in range [0, openmpt_module_get_num_channels()[
* \param mute The new mute status. true is muted, false is unmuted.
* \return 1 on success, 0 on failure (channel out of range).
* \sa openmpt_module_ext_interface_interactive::get_channel_mute_status
*/
int ( * set_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel, int mute );
/*! Get the current mute status for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose mute status should be retrieved, in range [0, openmpt_module_get_num_channels()[
* \return The current channel mute status. 1 is muted, 0 is unmuted, -1 means the instrument was out of range
* \sa openmpt_module_ext_interface_interactive::set_channel_mute_status
*/
int ( * get_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel );
/*! Set the current mute status for an instrument
*
* \param mod_ext The module handle to work on.
* \param instrument The instrument whose mute status should be set, in range [0, openmpt_module_get_num_instruments()[ if openmpt_module_get_num_instruments is not 0, otherwise in [0, openmpt_module_get_num_samples()[
* \param mute The new mute status. true is muted, false is unmuted.
* \return 1 on success, 0 on failure (instrument out of range).
* \sa openmpt_module_ext_interface_interactive::get_instrument_mute_status
*/
int ( * set_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument, int mute );
/*! Get the current mute status for an instrument
*
* \param mod_ext The module handle to work on.
* \param instrument The instrument whose mute status should be retrieved, in range [0, openmpt_module_get_num_instruments()[ if openmpt_module_get_num_instruments is not 0, otherwise in [0, openmpt_module_get_num_samples()[
* \return The current instrument mute status. 1 is muted, 0 is unmuted, -1 means the instrument was out of range
* \sa openmpt_module_ext_interface_interactive::set_instrument_mute_status
*/
int ( * get_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument );
/*! Play a note using the specified instrument
*
* \param mod_ext The module handle to work on.
* \param instrument The instrument that should be played, in range [0, openmpt_module_get_num_instruments()[ if openmpt_module_get_num_instruments is not 0, otherwise in [0, openmpt_module_get_num_samples()[
* \param note The note to play, in rage [0, 119]. 60 is the middle C.
* \param volume The volume at which the note should be triggered, in range [0.0, 1.0]
* \param panning The panning position at which the note should be triggered, in range [-1.0, 1.0], 0.0 is center.
* \return The channel on which the note is played. This can pe be passed to openmpt_module_ext_interface_interactive::stop_note to stop the note. -1 means that no channel could be allocated and the note is not played.
* \sa openmpt_module_ext_interface_interactive::stop_note
* \sa openmpt_module_ext_interface_interactive2::note_off
* \sa openmpt_module_ext_interface_interactive2::note_fade
*/
int32_t ( * play_note ) ( openmpt_module_ext * mod_ext, int32_t instrument, int32_t note, double volume, double panning );
/*! Stop the note playing on the specified channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel on which the note should be stopped. This is the value returned by a previous play_note call.
* \return 1 on success, 0 on failure (channel out of range).
* \sa openmpt_module_ext_interface_interactive::play_note
* \sa openmpt_module_ext_interface_interactive2::note_off
* \sa openmpt_module_ext_interface_interactive2::note_fade
*/
int ( * stop_note ) ( openmpt_module_ext * mod_ext, int32_t channel );
} openmpt_module_ext_interface_interactive;
#ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE2
#define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE2 "interactive2"
#endif
typedef struct openmpt_module_ext_interface_interactive2 {
//! Sends a key-off command for the note playing on the specified channel
/*!
* \param mod_ext The module handle to work on.
* \param channel The channel on which the key-off event should be triggered. This is the value returned by a previous play_note call.
* \return 1 on success, 0 on failure (channel out of range).
* \remarks This method releases envelopes and sample sustain loops. If the sample has no sustain loop, or if the module does not use instruments, it does nothing.
* \sa openmpt_module_ext_interface_interactive::play_note
* \sa openmpt_module_ext_interface_interactive::stop_note
* \sa openmpt_module_ext_interface_interactive2::note_fade
* \since 0.6.0
*/
int ( *note_off ) ( openmpt_module_ext * mod_ext, int32_t channel );
//! Sends a note fade command for the note playing on the specified channel
/*!
* \param mod_ext The module handle to work on.
* \param channel The channel on which the note should be faded. This is the value returned by a previous play_note call.
* \return 1 on success, 0 on failure (channel out of range).
* \remarks This method uses the instrument's fade-out value. If the module does not use instruments, or the instrument's fade-out value is 0, it does nothing.
* \sa openmpt_module_ext_interface_interactive::play_note
* \sa openmpt_module_ext_interface_interactive::stop_note
* \sa openmpt_module_ext_interface_interactive2::note_fade
* \since 0.6.0
*/
int ( *note_fade ) ( openmpt_module_ext * mod_ext, int32_t channel );
//! Set the current panning for a channel
/*!
* \param mod_ext The module handle to work on.
* \param channel The channel that should be panned. This is the value returned by a previous play_note call.
* \param panning The panning position to set on the channel, in range [-1.0, 1.0], 0.0 is center.
* \return 1 on success, 0 on failure (channel out of range).
* \remarks This command affects subsequent notes played on the same channel, and may itself be overridden by subsequent panning commands encountered in the module itself.
* \sa openmpt_module_ext_interface_interactive2::get_channel_panning
* \since 0.6.0
*/
int ( *set_channel_panning) ( openmpt_module_ext * mod_ext, int32_t channel, double panning );
//! Get the current panning position for a channel
/*!
* \param mod_ext The module handle to work on.
* \param channel The channel whose panning should be retrieved. This is the value returned by a previous play_note call.
* \return The current channel panning, in range [-1.0, 1.0], 0.0 is center.
* \sa openmpt_module_ext_interface_interactive2::set_channel_panning
* \since 0.6.0
*/
double (*get_channel_panning) ( openmpt_module_ext * mod_ext, int32_t channel );
//! Set the finetune for the currently playing note on a channel
/*!
* \param mod_ext The module handle to work on.
* \param channel The channel whose finetune will be changed, in range [0, openmpt::module::get_num_channels()[
* \param finetune The finetune to set on the channel, in range [-1.0, 1.0], 0.0 is center.
* \throws openmpt::exception Throws an exception derived from openmpt::exception if the channel index is invalid.
* \remarks The finetune range depends on the pitch wheel depth of the instrument playing on the current channel; for sample-based modules, the depth of this command is fixed to +/-1 semitone.
* \remarks This command does not affect subsequent notes played on the same channel, but may itself be overridden by subsequent finetune commands encountered in the module itself.
* \sa openmpt_module_ext_interface_interactive2::get_note_finetune
* \since 0.6.0
*/
int ( *set_note_finetune) ( openmpt_module_ext * mod_ext, int32_t channel, double finetune );
//! Get the finetune for the currently playing note on a channel
/*!
* \param mod_ext The module handle to work on.
* \param channel The channel whose finetune should be retrieved, in range [0, openmpt::module::get_num_channels()[
* \return The current channel finetune, in range [-1.0, 1.0], 0.0 is center.
* \remarks The finetune range depends on the pitch wheel depth of the instrument playing on the current channel; for sample-based modules, the depth of this command is fixed to +/-1 semitone.
* \throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
* \sa openmpt_module_ext_interface_interactive2::set_note_finetune
* \since 0.6.0
*/
double (*get_note_finetune) ( openmpt_module_ext * mod_ext, int32_t channel );
} openmpt_module_ext_interface_interactive2;
/* add stuff here */
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_EXT_H */

View File

@ -0,0 +1,404 @@
/*
* libopenmpt_ext.hpp
* ------------------
* Purpose: libopenmpt public c++ interface for libopenmpt extensions
* Notes :
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_EXT_HPP
#define LIBOPENMPT_EXT_HPP
#include "libopenmpt_config.h"
#include "libopenmpt.hpp"
/*!
* \page libopenmpt_ext_cpp_overview libopenmpt_ext C++ API
*
* libopenmpt_ext is now included in all builds by default.
*
* \section libopenmpt-ext-cpp-detailed Detailed documentation
*
* \ref libopenmpt_ext_cpp
*
*/
/*! \defgroup libopenmpt_ext_cpp libopenmpt_ext C++ */
namespace openmpt {
/*! \addtogroup libopenmpt_ext_cpp
@{
*/
class module_ext_impl;
class LIBOPENMPT_CXX_API module_ext : public module {
private:
module_ext_impl * ext_impl;
private:
// non-copyable
module_ext( const module_ext & );
void operator = ( const module_ext & );
public:
module_ext( std::istream & stream, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::vector<std::byte> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::vector<std::uint8_t> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::vector<char> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::byte * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::uint8_t * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const char * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const void * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
virtual ~module_ext();
public:
//! Retrieve a libopenmpt extension.
/*! Example: Retrieving the interactive extension to change the tempo of a module:
\code{.cpp}
openmpt::module_ext *mod = new openmpt::module_ext( stream );
#ifdef LIBOPENMPT_EXT_INTERFACE_INTERACTIVE
openmpt::ext::interactive *interactive = static_cast<openmpt::ext::interactive *>( self->mod->get_interface( openmpt::ext::interactive_id ) );
if ( interactive ) {
interactive->set_tempo_factor( 2.0 ); // play module at double speed
} else {
// interface not available
}
#else
// interfae not available
#endif
\endcode
\param interface_id The name of the extension interface to retrieve.
\return The interface object. This may be a nullptr if the extension was not found.
*/
void * get_interface( const std::string & interface_id );
}; // class module_ext
/*!
@}
*/
namespace ext {
/*! \addtogroup libopenmpt_ext_cpp
@{
*/
#define LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE(name) \
static const char name ## _id [] = # name ; \
class name; \
/**/
#define LIBOPENMPT_EXT_CXX_INTERFACE(name) \
protected: \
name () {} \
virtual ~ name () {} \
public: \
/**/
#ifndef LIBOPENMPT_EXT_INTERFACE_PATTERN_VIS
#define LIBOPENMPT_EXT_INTERFACE_PATTERN_VIS
#endif
LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE(pattern_vis)
class pattern_vis {
LIBOPENMPT_EXT_CXX_INTERFACE(pattern_vis)
//! Pattern command type
enum effect_type {
effect_unknown = 0,
effect_general = 1,
effect_global = 2,
effect_volume = 3,
effect_panning = 4,
effect_pitch = 5
}; // enum effect_type
//! Get pattern command type for pattern highlighting
/*!
\param pattern The pattern whose data should be retrieved.
\param row The row from which the data should be retrieved.
\param channel The channel from which the data should be retrieved.
\return The command type in the effect column at the given pattern position (see openmpt::ext::pattern_vis::effect_type)
\sa openmpt::ext::pattern_vis::get_pattern_row_channel_effect_type
*/
virtual effect_type get_pattern_row_channel_volume_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const = 0;
//! Get pattern command type for pattern highlighting
/*!
\param pattern The pattern whose data should be retrieved.
\param row The row from which the data should be retrieved.
\param channel The channel from which the data should be retrieved.
\return The command type in the volume column at the given pattern position (see openmpt::ext::pattern_vis::effect_type)
\sa openmpt::ext::pattern_vis::get_pattern_row_channel_volume_effect_type
*/
virtual effect_type get_pattern_row_channel_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const = 0;
}; // class pattern_vis
#ifndef LIBOPENMPT_EXT_INTERFACE_INTERACTIVE
#define LIBOPENMPT_EXT_INTERFACE_INTERACTIVE
#endif
LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE(interactive)
class interactive {
LIBOPENMPT_EXT_CXX_INTERFACE(interactive)
//! Set the current ticks per row (speed)
/*!
\param speed The new tick count in range [1, 65535].
\throws openmpt::exception Throws an exception derived from openmpt::exception if the speed is outside the specified range.
\remarks The tick count may be reset by pattern commands at any time.
\sa openmpt::module::get_current_speed
*/
virtual void set_current_speed( std::int32_t speed ) = 0;
//! Set the current module tempo
/*!
\param tempo The new tempo in range [32, 512]. The exact meaning of the value depends on the tempo mode used by the module.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the tempo is outside the specified range.
\remarks The tempo may be reset by pattern commands at any time. Use openmpt::ext:interactive::set_tempo_factor to apply a tempo factor that is independent of pattern commands.
\sa openmpt::module::get_current_tempo
*/
virtual void set_current_tempo( std::int32_t tempo ) = 0;
//! Set the current module tempo factor without affecting playback pitch
/*!
\param factor The new tempo factor in range ]0.0, 4.0] - 1.0 means unmodified tempo.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the factor is outside the specified range.
\remarks Modifying the tempo without applying the same pitch factor using openmpt::ext::interactive::set_pitch_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
\sa openmpt::ext::interactive::get_tempo_factor
*/
virtual void set_tempo_factor( double factor ) = 0;
//! Gets the current module tempo factor
/*!
\return The current tempo factor.
\sa openmpt::ext::interactive::set_tempo_factor
*/
virtual double get_tempo_factor( ) const = 0;
//! Set the current module pitch factor without affecting playback speed
/*!
\param factor The new pitch factor in range ]0.0, 4.0] - 1.0 means unmodified pitch.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the factor is outside the specified range.
\remarks Modifying the pitch without applying the the same tempo factor using openmpt::ext::interactive::set_tempo_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
\remarks To shift the pich by `n` semitones, the parameter can be calculated as follows: `pow( 2.0, n / 12.0 )`
\sa openmpt::ext::interactive::get_pitch_factor
*/
virtual void set_pitch_factor( double factor ) = 0;
//! Gets the current module pitch factor
/*!
\return The current pitch factor.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the pitch is outside the specified range.
\sa openmpt::ext::interactive::set_pitch_factor
*/
virtual double get_pitch_factor( ) const = 0;
//! Set the current global volume
/*!
\param volume The new global volume in range [0.0, 1.0]
\throws openmpt::exception Throws an exception derived from openmpt::exception if the volume is outside the specified range.
\remarks The global volume may be reset by pattern commands at any time. Use openmpt::module::set_render_param to apply a global overall volume factor that is independent of pattern commands.
\sa openmpt::ext::interactive::get_global_volume
*/
virtual void set_global_volume( double volume ) = 0;
//! Get the current global volume
/*!
\return The current global volume in range [0.0, 1.0]
\sa openmpt::ext::interactive::set_global_volume
*/
virtual double get_global_volume( ) const = 0;
//! Set the current channel volume for a channel
/*!
\param channel The channel whose volume should be set, in range [0, openmpt::module::get_num_channels()[
\param volume The new channel volume in range [0.0, 1.0]
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel or volume is outside the specified range.
\remarks The channel volume may be reset by pattern commands at any time.
\sa openmpt::ext::interactive::get_channel_volume
*/
virtual void set_channel_volume( std::int32_t channel, double volume ) = 0;
//! Get the current channel volume for a channel
/*!
\param channel The channel whose volume should be retrieved, in range [0, openmpt::module::get_num_channels()[
\return The current channel volume in range [0.0, 1.0]
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\sa openmpt::ext::interactive::set_channel_volume
*/
virtual double get_channel_volume( std::int32_t channel ) const = 0;
//! Set the current mute status for a channel
/*!
\param channel The channel whose mute status should be set, in range [0, openmpt::module::get_num_channels()[
\param mute The new mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\sa openmpt::ext::interactive::get_channel_mute_status
*/
virtual void set_channel_mute_status( std::int32_t channel, bool mute ) = 0;
//! Get the current mute status for a channel
/*!
\param channel The channel whose mute status should be retrieved, in range [0, openmpt::module::get_num_channels()[
\return The current channel mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\sa openmpt::ext::interactive::set_channel_mute_status
*/
virtual bool get_channel_mute_status( std::int32_t channel ) const = 0;
//! Set the current mute status for an instrument
/*!
\param instrument The instrument whose mute status should be set, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
\param mute The new mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the instrument is outside the specified range.
\sa openmpt::ext::interactive::get_instrument_mute_status
*/
virtual void set_instrument_mute_status( std::int32_t instrument, bool mute ) = 0;
//! Get the current mute status for an instrument
/*!
\param instrument The instrument whose mute status should be retrieved, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
\return The current instrument mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the instrument is outside the specified range.
\sa openmpt::ext::interactive::set_instrument_mute_status
*/
virtual bool get_instrument_mute_status( std::int32_t instrument ) const = 0;
//! Play a note using the specified instrument
/*!
\param instrument The instrument that should be played, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
\param note The note to play, in rage [0, 119]. 60 is the middle C.
\param volume The volume at which the note should be triggered, in range [0.0, 1.0]
\param panning The panning position at which the note should be triggered, in range [-1.0, 1.0], 0.0 is center.
\return The channel on which the note is played. This can pe be passed to openmpt::ext::interactive::stop_note to stop the note.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the instrument or note is outside the specified range.
\sa openmpt::ext::interactive::stop_note
\sa openmpt::ext::interactive2::note_off
\sa openmpt::ext::interactive2::note_fade
*/
virtual std::int32_t play_note( std::int32_t instrument, std::int32_t note, double volume, double panning ) = 0;
//! Stop the note playing on the specified channel
/*!
\param channel The channel on which the note should be stopped. This is the value returned by a previous play_note call.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel index is invalid.
\sa openmpt::ext::interactive::play_note
\sa openmpt::ext::interactive2::note_off
\sa openmpt::ext::interactive2::note_fade
*/
virtual void stop_note( std::int32_t channel ) = 0;
}; // class interactive
#ifndef LIBOPENMPT_EXT_INTERFACE_INTERACTIVE2
#define LIBOPENMPT_EXT_INTERFACE_INTERACTIVE2
#endif
LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE(interactive2)
class interactive2 {
LIBOPENMPT_EXT_CXX_INTERFACE(interactive2)
//! Sends a key-off command for the note playing on the specified channel
/*!
\param channel The channel on which the key-off event should be triggered. This is the value returned by a previous play_note call.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel index is invalid.
\remarks This method releases envelopes and sample sustain loops. If the sample has no sustain loop, or if the module does not use instruments, it does nothing.
\sa openmpt::ext::interactive::play_note
\sa openmpt::ext::interactive::stop_note
\sa openmpt::ext::interactive2::note_fade
\since 0.6.0
*/
virtual void note_off(int32_t channel ) = 0;
//! Sends a note fade command for the note playing on the specified channel
/*!
\param channel The channel on which the note should be faded. This is the value returned by a previous play_note call.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel index is invalid.
\remarks This method uses the instrument's fade-out value. If the module does not use instruments, or the instrument's fade-out value is 0, it does nothing.
\sa openmpt::ext::interactive::play_note
\sa openmpt::ext::interactive::stop_note
\sa openmpt::ext::interactive2::note_off
\since 0.6.0
*/
virtual void note_fade(int32_t channel) = 0;
//! Set the current panning position for a channel
/*!
\param channel The channel whose panning will be changed, in range [0, openmpt::module::get_num_channels()[
\param panning The panning position to set on the channel, in range [-1.0, 1.0], 0.0 is center.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel index is invalid.
\remarks This command affects subsequent notes played on the same channel, and may itself be overridden by subsequent panning commands encountered in the module itself.
\sa openmpt::ext::interactive2::get_channel_panning
\since 0.6.0
*/
virtual void set_channel_panning(int32_t channel, double panning ) = 0;
//! Get the current panning position for a channel
/*!
\param channel The channel whose panning should be retrieved, in range [0, openmpt::module::get_num_channels()[
\return The current channel panning, in range [-1.0, 1.0], 0.0 is center.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\sa openmpt::ext::interactive2::set_channel_panning
\since 0.6.0
*/
virtual double get_channel_panning( int32_t channel ) = 0;
//! Set the finetune for the currently playing note on a channel
/*!
\param channel The channel whose finetune will be changed, in range [0, openmpt::module::get_num_channels()[
\param finetune The finetune to set on the channel, in range [-1.0, 1.0], 0.0 is center.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel index is invalid.
\remarks The finetune range depends on the pitch wheel depth of the instrument playing on the current channel; for sample-based modules, the depth of this command is fixed to +/-1 semitone.
\remarks This command does not affect subsequent notes played on the same channel, but may itself be overridden by subsequent finetune commands encountered in the module itself.
\sa openmpt::ext::interactive2::get_note_finetune
\since 0.6.0
*/
virtual void set_note_finetune(int32_t channel, double finetune ) = 0;
//! Get the finetune for the currently playing note on a channel
/*!
\param channel The channel whose finetune should be retrieved, in range [0, openmpt::module::get_num_channels()[
\return The current channel finetune, in range [-1.0, 1.0], 0.0 is center.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\remarks The finetune range depends on the pitch wheel depth of the instrument playing on the current channel; for sample-based modules, the depth of this command is fixed to +/-1 semitone.
\sa openmpt::ext::interactive2::set_note_finetune
\since 0.6.0
*/
virtual double get_note_finetune( int32_t channel ) = 0;
}; // class interactive
/* add stuff here */
#undef LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE
#undef LIBOPENMPT_EXT_CXX_INTERFACE
/*!
@}
*/
} // namespace ext
} // namespace openmpt
#endif // LIBOPENMPT_EXT_HPP

View File

@ -0,0 +1,122 @@
/*
* libopenmpt_ext_impl.hpp
* -----------------------
* Purpose: libopenmpt extensions - implementation header
* Notes :
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_EXT_IMPL_HPP
#define LIBOPENMPT_EXT_IMPL_HPP
#include "libopenmpt_internal.h"
#include "libopenmpt_impl.hpp"
#include "libopenmpt_ext.hpp"
namespace openmpt {
class module_ext_impl
: public module_impl
, public ext::pattern_vis
, public ext::interactive
, public ext::interactive2
/* add stuff here */
{
public:
module_ext_impl( callback_stream_wrapper stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( std::istream & stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::vector<std::byte> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::vector<std::uint8_t> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::vector<char> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::byte * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::uint8_t * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const char * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const void * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
private:
/* add stuff here */
private:
void ctor();
public:
~module_ext_impl();
public:
void * get_interface( const std::string & interface_id );
// pattern_vis
effect_type get_pattern_row_channel_volume_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const override;
effect_type get_pattern_row_channel_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const override;
// interactive
void set_current_speed( std::int32_t speed ) override;
void set_current_tempo( std::int32_t tempo ) override;
void set_tempo_factor( double factor ) override;
double get_tempo_factor( ) const override;
void set_pitch_factor( double factor ) override;
double get_pitch_factor( ) const override;
void set_global_volume( double volume ) override;
double get_global_volume( ) const override;
void set_channel_volume( std::int32_t channel, double volume ) override;
double get_channel_volume( std::int32_t channel ) const override;
void set_channel_mute_status( std::int32_t channel, bool mute ) override;
bool get_channel_mute_status( std::int32_t channel ) const override;
void set_instrument_mute_status( std::int32_t instrument, bool mute ) override;
bool get_instrument_mute_status( std::int32_t instrument ) const override;
std::int32_t play_note( std::int32_t instrument, std::int32_t note, double volume, double panning ) override;
void stop_note( std::int32_t channel ) override;
void note_off( std::int32_t channel ) override;
void note_fade( std::int32_t channel ) override;
void set_channel_panning( std::int32_t channel, double panning ) override;
double get_channel_panning( std::int32_t channel ) override;
void set_note_finetune( std::int32_t channel, double finetune ) override;
double get_note_finetune( std::int32_t channel ) override;
/* add stuff here */
}; // class module_ext_impl
} // namespace openmpt
#endif // LIBOPENMPT_EXT_IMPL_HPP

View File

@ -0,0 +1,271 @@
/*
* libopenmpt_impl.hpp
* -------------------
* Purpose: libopenmpt private interface
* Notes : This is not a public header. Do NOT ship in distributions dev packages.
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_IMPL_HPP
#define LIBOPENMPT_IMPL_HPP
#include "libopenmpt_internal.h"
#include "libopenmpt.hpp"
#include <iosfwd>
#include <memory>
#include <utility>
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4512) // assignment operator could not be generated
#endif
// forward declarations
namespace mpt {
inline namespace mpt_libopenmpt {
namespace IO {
class FileCursorTraitsFileData;
template <typename Tpath>
class FileCursorFilenameTraits;
template <typename Ttraits, typename Tfilenametraits>
class FileCursor;
} // namespace IO
} // namespace mpt_libopenmpt
} // namespace mpt
namespace OpenMPT {
namespace detail {
template <typename Ttraits, typename Tfilenametraits>
using FileCursor = mpt::IO::FileCursor<Ttraits, Tfilenametraits>;
} // namespace detail
namespace mpt {
class PathString;
} // namespace mpt
using FileCursor = detail::FileCursor<mpt::IO::FileCursorTraitsFileData, mpt::IO::FileCursorFilenameTraits<mpt::PathString>>;
class CSoundFile;
struct DithersWrapperOpenMPT;
} // namespace OpenMPT
namespace openmpt {
namespace version {
std::uint32_t get_library_version();
std::uint32_t get_core_version();
std::string get_string( const std::string & key );
} // namespace version
class log_interface {
protected:
log_interface();
public:
virtual ~log_interface();
virtual void log( const std::string & message ) const = 0;
}; // class log_interface
class std_ostream_log : public log_interface {
private:
std::ostream & destination;
public:
std_ostream_log( std::ostream & dst );
virtual ~std_ostream_log();
void log( const std::string & message ) const override;
}; // class CSoundFileLog_std_ostream
class log_forwarder;
struct callback_stream_wrapper {
void * stream;
std::size_t (*read)( void * stream, void * dst, std::size_t bytes );
int (*seek)( void * stream, std::int64_t offset, int whence );
std::int64_t (*tell)( void * stream );
}; // struct callback_stream_wrapper
class module_impl {
public:
enum class amiga_filter_type {
a500,
a1200,
unfiltered,
auto_filter,
};
protected:
struct subsong_data {
double duration;
std::int32_t start_row;
std::int32_t start_order;
std::int32_t sequence;
subsong_data( double duration, std::int32_t start_row, std::int32_t start_order, std::int32_t sequence );
}; // struct subsong_data
typedef std::vector<subsong_data> subsongs_type;
enum class song_end_action {
fadeout_song,
continue_song,
stop_song,
};
static constexpr std::int32_t all_subsongs = -1;
enum class ctl_type {
boolean,
integer,
floatingpoint,
text,
};
struct ctl_info {
const char * name;
ctl_type type;
};
std::unique_ptr<log_interface> m_Log;
std::unique_ptr<log_forwarder> m_LogForwarder;
std::int32_t m_current_subsong;
double m_currentPositionSeconds;
std::unique_ptr<OpenMPT::CSoundFile> m_sndFile;
bool m_loaded;
bool m_mixer_initialized;
std::unique_ptr<OpenMPT::DithersWrapperOpenMPT> m_Dithers;
subsongs_type m_subsongs;
float m_Gain;
song_end_action m_ctl_play_at_end;
amiga_filter_type m_ctl_render_resampler_emulate_amiga_type = amiga_filter_type::auto_filter;
bool m_ctl_load_skip_samples;
bool m_ctl_load_skip_patterns;
bool m_ctl_load_skip_plugins;
bool m_ctl_load_skip_subsongs_init;
bool m_ctl_seek_sync_samples;
std::vector<std::string> m_loaderMessages;
public:
void PushToCSoundFileLog( const std::string & text ) const;
void PushToCSoundFileLog( int loglevel, const std::string & text ) const;
protected:
std::string mod_string_to_utf8( const std::string & encoded ) const;
void apply_mixer_settings( std::int32_t samplerate, int channels );
void apply_libopenmpt_defaults();
subsongs_type get_subsongs() const;
void init_subsongs( subsongs_type & subsongs ) const;
bool has_subsongs_inited() const;
void ctor( const std::map< std::string, std::string > & ctls );
void load( const OpenMPT::FileCursor & file, const std::map< std::string, std::string > & ctls );
bool is_loaded() const;
std::size_t read_wrapper( std::size_t count, std::int16_t * left, std::int16_t * right, std::int16_t * rear_left, std::int16_t * rear_right );
std::size_t read_wrapper( std::size_t count, float * left, float * right, float * rear_left, float * rear_right );
std::size_t read_interleaved_wrapper( std::size_t count, std::size_t channels, std::int16_t * interleaved );
std::size_t read_interleaved_wrapper( std::size_t count, std::size_t channels, float * interleaved );
std::string get_message_instruments() const;
std::string get_message_samples() const;
std::pair< std::string, std::string > format_and_highlight_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int command ) const;
std::pair< std::string, std::string > format_and_highlight_pattern_row_channel( std::int32_t p, std::int32_t r, std::int32_t c, std::size_t width, bool pad ) const;
static double could_open_probability( const OpenMPT::FileCursor & file, double effort, std::unique_ptr<log_interface> log );
public:
static std::vector<std::string> get_supported_extensions();
static bool is_extension_supported( std::string_view extension );
static double could_open_probability( callback_stream_wrapper stream, double effort, std::unique_ptr<log_interface> log );
static double could_open_probability( std::istream & stream, double effort, std::unique_ptr<log_interface> log );
static std::size_t probe_file_header_get_recommended_size();
static int probe_file_header( std::uint64_t flags, const std::byte * data, std::size_t size, std::uint64_t filesize );
static int probe_file_header( std::uint64_t flags, const std::uint8_t * data, std::size_t size, std::uint64_t filesize );
static int probe_file_header( std::uint64_t flags, const void * data, std::size_t size, std::uint64_t filesize );
static int probe_file_header( std::uint64_t flags, const std::byte * data, std::size_t size );
static int probe_file_header( std::uint64_t flags, const std::uint8_t * data, std::size_t size );
static int probe_file_header( std::uint64_t flags, const void * data, std::size_t size );
static int probe_file_header( std::uint64_t flags, std::istream & stream );
static int probe_file_header( std::uint64_t flags, callback_stream_wrapper stream );
module_impl( callback_stream_wrapper stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( std::istream & stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::vector<std::byte> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::vector<std::uint8_t> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::vector<char> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::byte * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::uint8_t * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const char * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const void * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
~module_impl();
public:
void select_subsong( std::int32_t subsong );
std::int32_t get_selected_subsong() const;
void set_repeat_count( std::int32_t repeat_count );
std::int32_t get_repeat_count() const;
double get_duration_seconds() const;
double set_position_seconds( double seconds );
double get_position_seconds() const;
double set_position_order_row( std::int32_t order, std::int32_t row );
std::int32_t get_render_param( int param ) const;
void set_render_param( int param, std::int32_t value );
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 * rear_left, std::int16_t * rear_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 * rear_left, float * rear_right );
std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_stereo );
std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_quad );
std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, float * interleaved_stereo );
std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, float * interleaved_quad );
std::vector<std::string> get_metadata_keys() const;
std::string get_metadata( const std::string & key ) const;
double get_current_estimated_bpm() 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;
float get_current_channel_vu_mono( std::int32_t channel ) const;
float get_current_channel_vu_left( std::int32_t channel ) const;
float get_current_channel_vu_right( std::int32_t channel ) const;
float get_current_channel_vu_rear_left( std::int32_t channel ) const;
float get_current_channel_vu_rear_right( std::int32_t channel ) 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 o ) const;
std::int32_t get_pattern_num_rows( std::int32_t p ) const;
std::uint8_t get_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const;
std::string format_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const;
std::string highlight_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const;
std::string format_pattern_row_channel( std::int32_t p, std::int32_t r, std::int32_t c, std::size_t width, bool pad ) const;
std::string highlight_pattern_row_channel( std::int32_t p, std::int32_t r, std::int32_t c, std::size_t width, bool pad ) const;
std::pair<const module_impl::ctl_info *, const module_impl::ctl_info *> get_ctl_infos() const;
std::vector<std::string> get_ctls() const;
std::string ctl_get( std::string ctl, bool throw_if_unknown = true ) const;
bool ctl_get_boolean( std::string_view ctl, bool throw_if_unknown = true ) const;
std::int64_t ctl_get_integer( std::string_view ctl, bool throw_if_unknown = true ) const;
double ctl_get_floatingpoint( std::string_view ctl, bool throw_if_unknown = true ) const;
std::string ctl_get_text( std::string_view ctl, bool throw_if_unknown = true ) const;
void ctl_set( std::string ctl, const std::string & value, bool throw_if_unknown = true );
void ctl_set_boolean( std::string_view ctl, bool value, bool throw_if_unknown = true );
void ctl_set_integer( std::string_view ctl, std::int64_t value, bool throw_if_unknown = true );
void ctl_set_floatingpoint( std::string_view ctl, double value, bool throw_if_unknown = true );
void ctl_set_text( std::string_view ctl, std::string_view value, bool throw_if_unknown = true );
}; // class module_impl
namespace helper {
template<typename T, typename... Args> std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
} // namespace helper
} // namespace openmpt
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#endif // LIBOPENMPT_IMPL_HPP

View File

@ -0,0 +1,25 @@
/*
* libopenmpt_internal.h
* ---------------------
* Purpose: libopenmpt internal interface configuration, overruling the public interface configuration (only used and needed when building libopenmpt)
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_INTERNAL_H
#define LIBOPENMPT_INTERNAL_H
#include "libopenmpt_config.h"
#ifdef __cplusplus
#if defined(LIBOPENMPT_BUILD_DLL) || defined(LIBOPENMPT_USE_DLL)
#if defined(_MSC_VER) && !defined(_DLL)
/* #pragma message( "libopenmpt C++ interface is disabled if libopenmpt is built as a DLL and the runtime is statically linked. This is not supported by microsoft and cannot possibly work. Ever." ) */
#undef LIBOPENMPT_CXX_API
#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#endif
#endif
#endif /* LIBOPENMPT_INTERNAL_H */

View File

@ -0,0 +1,36 @@
/*
* libopenmpt_plugin_gui.hpp
* -------------------------
* Purpose: libopenmpt plugin GUI
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_PLUGIN_GUI_HPP
#define LIBOPENMPT_PLUGIN_GUI_HPP
#include "libopenmpt_plugin_settings.hpp"
#include <windows.h>
#include <string>
namespace libopenmpt {
namespace plugin {
#if defined(MPT_WITH_MFC)
void DllMainAttach();
void DllMainDetach();
#endif // MPT_WITH_MFC
void gui_edit_settings( libopenmpt_settings * s, HWND parent, std::basic_string<TCHAR> title );
void gui_show_file_info( HWND parent, std::basic_string<TCHAR> title, std::basic_string<TCHAR> info );
} // namespace plugin
} // namespace libopenmpt
#endif // LIBOPENMPT_PLUGIN_GUI_HPP

View File

@ -0,0 +1,130 @@
/*
* libopenmpt_plugin_settings.hpp
* ------------------------------
* Purpose: libopenmpt plugin settings
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_PLUGIN_SETTINGS_HPP
#define LIBOPENMPT_PLUGIN_SETTINGS_HPP
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <string>
namespace libopenmpt {
namespace plugin {
typedef void (*changed_func)();
struct libopenmpt_settings {
bool no_default_format = true;
int samplerate = 48000;
int channels = 2;
int mastergain_millibel = 0;
int stereoseparation = 100;
int use_amiga_resampler = 0;
int amiga_filter_type = 0;
int repeatcount = 0;
int interpolationfilterlength = 8;
int ramping = -1;
int vis_allow_scroll = 1;
changed_func changed = nullptr;
};
class settings : public libopenmpt_settings {
private:
std::basic_string<TCHAR> subkey;
protected:
virtual void read_setting( const std::string & /* key */ , const std::basic_string<TCHAR> & key, int & val ) {
HKEY regkey = HKEY();
if ( RegOpenKeyEx( HKEY_CURRENT_USER, ( TEXT("Software\\libopenmpt\\") + subkey ).c_str(), 0, KEY_READ, &regkey ) == ERROR_SUCCESS ) {
DWORD v = val;
DWORD type = REG_DWORD;
DWORD typesize = sizeof(v);
if ( RegQueryValueEx( regkey, key.c_str(), NULL, &type, (BYTE *)&v, &typesize ) == ERROR_SUCCESS )
{
val = v;
}
RegCloseKey( regkey );
regkey = HKEY();
}
}
virtual void write_setting( const std::string & /* key */, const std::basic_string<TCHAR> & key, int val ) {
HKEY regkey = HKEY();
if ( RegCreateKeyEx( HKEY_CURRENT_USER, ( TEXT("Software\\libopenmpt\\") + subkey ).c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &regkey, NULL ) == ERROR_SUCCESS ) {
DWORD v = val;
DWORD type = REG_DWORD;
DWORD typesize = sizeof(v);
if ( RegSetValueEx( regkey, key.c_str(), 0, type, (const BYTE *)&v, typesize ) == ERROR_SUCCESS )
{
// ok
}
RegCloseKey( regkey );
regkey = HKEY();
}
}
public:
settings( const std::basic_string<TCHAR> & subkey, bool no_default_format_ )
: subkey(subkey)
{
no_default_format = no_default_format_;
}
void load()
{
#ifdef UNICODE
#define read_setting(a,b,c) read_setting( b , L ## b , c)
#else
#define read_setting(a,b,c) read_setting( b , b , c)
#endif
read_setting( subkey, "Samplerate_Hz", samplerate );
read_setting( subkey, "Channels", channels );
read_setting( subkey, "MasterGain_milliBel", mastergain_millibel );
read_setting( subkey, "StereoSeparation_Percent", stereoseparation );
read_setting( subkey, "RepeatCount", repeatcount );
read_setting( subkey, "InterpolationFilterLength", interpolationfilterlength );
read_setting( subkey, "UseAmigaResampler", use_amiga_resampler );
read_setting( subkey, "AmigaFilterType", amiga_filter_type );
read_setting( subkey, "VolumeRampingStrength", ramping );
read_setting( subkey, "VisAllowScroll", vis_allow_scroll );
#undef read_setting
}
void save()
{
#ifdef UNICODE
#define write_setting(a,b,c) write_setting( b , L ## b , c)
#else
#define write_setting(a,b,c) write_setting( b , b , c)
#endif
write_setting( subkey, "Samplerate_Hz", samplerate );
write_setting( subkey, "Channels", channels );
write_setting( subkey, "MasterGain_milliBel", mastergain_millibel );
write_setting( subkey, "StereoSeparation_Percent", stereoseparation );
write_setting( subkey, "RepeatCount", repeatcount );
write_setting( subkey, "InterpolationFilterLength", interpolationfilterlength );
write_setting( subkey, "UseAmigaResampler", use_amiga_resampler );
write_setting( subkey, "AmigaFilterType", amiga_filter_type );
write_setting( subkey, "VolumeRampingStrength", ramping );
write_setting( subkey, "VisAllowScroll", vis_allow_scroll );
#undef write_setting
}
virtual ~settings()
{
return;
}
};
} // namespace plugin
} // namespace libopenmpt
#endif // LIBOPENMPT_PLUGIN_SETTINGS_HPP

View File

@ -0,0 +1,198 @@
/*
* libopenmpt_stream_callbacks_buffer.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_STREAM_CALLBACKS_BUFFER_H
#define LIBOPENMPT_STREAM_CALLBACKS_BUFFER_H
#include "libopenmpt.h"
/* The use of this header requires:
#include <libopenmpt/libopenmpt.h>
#if defined( LIBOPENMPT_STREAM_CALLBACKS_BUFFER )
#include <libopenmpt/libopenmpt_stream_callbacks_buffer.h>
#else
#error "libopenmpt too old."
#endif
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
/*! \addtogroup libopenmpt_c
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef struct openmpt_stream_buffer {
const void * file_data; /* or prefix data IFF prefix_size < file_size */
int64_t file_size;
int64_t file_pos;
int64_t prefix_size;
int overflow;
} openmpt_stream_buffer;
static size_t openmpt_stream_buffer_read_func( void * stream, void * dst, size_t bytes ) {
openmpt_stream_buffer * s = (openmpt_stream_buffer*)stream;
int64_t offset = 0;
int64_t begpos = 0;
int64_t endpos = 0;
size_t valid_bytes = 0;
if ( !s ) {
return 0;
}
offset = bytes;
begpos = s->file_pos;
endpos = s->file_pos;
valid_bytes = 0;
endpos = (uint64_t)endpos + (uint64_t)offset;
if ( ( offset > 0 ) && !( (uint64_t)endpos > (uint64_t)begpos ) ) {
/* integer wrapped */
return 0;
}
if ( bytes == 0 ) {
return 0;
}
if ( begpos >= s->file_size ) {
return 0;
}
if ( endpos > s->file_size ) {
/* clip to eof */
bytes = bytes - (size_t)( endpos - s->file_size );
endpos = endpos - ( endpos - s->file_size );
}
memset( dst, 0, bytes );
if ( begpos >= s->prefix_size ) {
s->overflow = 1;
valid_bytes = 0;
} else if ( endpos > s->prefix_size ) {
s->overflow = 1;
valid_bytes = bytes - (size_t)( endpos - s->prefix_size );
} else {
valid_bytes = bytes;
}
memcpy( dst, (const char*)s->file_data + s->file_pos, valid_bytes );
s->file_pos = s->file_pos + bytes;
return bytes;
}
static int openmpt_stream_buffer_seek_func( void * stream, int64_t offset, int whence ) {
openmpt_stream_buffer * s = (openmpt_stream_buffer*)stream;
int result = -1;
if ( !s ) {
return -1;
}
switch ( whence ) {
case OPENMPT_STREAM_SEEK_SET:
if ( offset < 0 ) {
return -1;
}
if ( offset > s->file_size ) {
return -1;
}
s->file_pos = offset;
result = 0;
break;
case OPENMPT_STREAM_SEEK_CUR:
do {
int64_t oldpos = s->file_pos;
int64_t pos = s->file_pos;
pos = (uint64_t)pos + (uint64_t)offset;
if ( ( offset > 0 ) && !( (uint64_t)pos > (uint64_t)oldpos ) ) {
/* integer wrapped */
return -1;
}
if ( ( offset < 0 ) && !( (uint64_t)pos < (uint64_t)oldpos ) ) {
/* integer wrapped */
return -1;
}
s->file_pos = pos;
} while(0);
result = 0;
break;
case OPENMPT_STREAM_SEEK_END:
if ( offset > 0 ) {
return -1;
}
do {
int64_t oldpos = s->file_pos;
int64_t pos = s->file_pos;
pos = s->file_size;
pos = (uint64_t)pos + (uint64_t)offset;
if ( ( offset < 0 ) && !( (uint64_t)pos < (uint64_t)oldpos ) ) {
/* integer wrapped */
return -1;
}
s->file_pos = pos;
} while(0);
result = 0;
break;
}
return result;
}
static int64_t openmpt_stream_buffer_tell_func( void * stream ) {
openmpt_stream_buffer * s = (openmpt_stream_buffer*)stream;
if ( !s ) {
return -1;
}
return s->file_pos;
}
static void openmpt_stream_buffer_init( openmpt_stream_buffer * buffer, const void * file_data, int64_t file_size ) {
memset( buffer, 0, sizeof( openmpt_stream_buffer ) );
buffer->file_data = file_data;
buffer->file_size = file_size;
buffer->file_pos = 0;
buffer->prefix_size = file_size;
buffer->overflow = 0;
}
#define openmpt_stream_buffer_init_prefix_only( buffer_, prefix_data_, prefix_size_, file_size_ ) do { \
openmpt_stream_buffer_init( (buffer_), (prefix_data_), (file_size_) ); \
(buffer_)->prefix_size = (prefix_size_); \
} while(0)
#define openmpt_stream_buffer_overflowed( buffer_ ) ( (buffer_)->overflow )
/*! \brief Provide openmpt_stream_callbacks for in-memoy buffers
*
* Fills openmpt_stream_callbacks suitable for passing an in-memory buffer as a stream parameter to functions doing file input/output.
*
* \remarks The stream argument must be passed as `(void*)(openmpt_stream_buffer*)stream_buffer`.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
* \sa openmpt_could_open_probability2
* \sa openmpt_probe_file_header_from_stream
* \sa openmpt_module_create2
*/
static openmpt_stream_callbacks openmpt_stream_get_buffer_callbacks(void) {
openmpt_stream_callbacks retval;
memset( &retval, 0, sizeof( openmpt_stream_callbacks ) );
retval.read = openmpt_stream_buffer_read_func;
retval.seek = openmpt_stream_buffer_seek_func;
retval.tell = openmpt_stream_buffer_tell_func;
return retval;
}
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_STREAM_CALLBACKS_BUFFER_H */

View File

@ -0,0 +1,101 @@
/*
* libopenmpt_stream_callbacks_fd.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_STREAM_CALLBACKS_FD_H
#define LIBOPENMPT_STREAM_CALLBACKS_FD_H
#include "libopenmpt.h"
#ifdef _MSC_VER
#include <io.h>
#endif
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
/*! \addtogroup libopenmpt_c
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/* This stuff has to be in a header file because of possibly different MSVC CRTs which cause problems for fd crossing CRT boundaries. */
static size_t openmpt_stream_fd_read_func( void * stream, void * dst, size_t bytes ) {
int fd = 0;
#if defined(_MSC_VER)
size_t retval = 0;
int to_read = 0;
int ret_read = 0;
#else
ssize_t retval = 0;
#endif
fd = (int)(uintptr_t)stream;
if ( fd < 0 ) {
return 0;
}
#if defined(_MSC_VER)
retval = 0;
while ( bytes > 0 ) {
to_read = 0;
if ( bytes < (size_t)INT_MAX ) {
to_read = (int)bytes;
} else {
to_read = INT_MAX;
}
ret_read = _read( fd, dst, to_read );
if ( ret_read <= 0 ) {
return retval;
}
bytes -= ret_read;
retval += ret_read;
}
#else
retval = read( fd, dst, bytes );
#endif
if ( retval <= 0 ) {
return 0;
}
return retval;
}
/*! \brief Provide openmpt_stream_callbacks for standard POSIX file descriptors
*
* Fills openmpt_stream_callbacks suitable for passing a POSIX filer descriptor as a stream parameter to functions doing file input/output.
*
* \remarks The stream argument must be passed as `(void*)(uintptr_t)(int)fd`.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
* \sa openmpt_could_open_probability2
* \sa openmpt_probe_file_header_from_stream
* \sa openmpt_module_create2
*/
static openmpt_stream_callbacks openmpt_stream_get_fd_callbacks(void) {
openmpt_stream_callbacks retval;
memset( &retval, 0, sizeof( openmpt_stream_callbacks ) );
retval.read = openmpt_stream_fd_read_func;
return retval;
}
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_STREAM_CALLBACKS_FD_H */

View File

@ -0,0 +1,132 @@
/*
* libopenmpt_stream_callbacks_file.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_STREAM_CALLBACKS_FILE_H
#define LIBOPENMPT_STREAM_CALLBACKS_FILE_H
#include "libopenmpt.h"
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#ifdef _MSC_VER
#include <wchar.h> /* off_t */
#endif
/*! \addtogroup libopenmpt_c
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/* This stuff has to be in a header file because of possibly different MSVC CRTs which cause problems for FILE * crossing CRT boundaries. */
static size_t openmpt_stream_file_read_func( void * stream, void * dst, size_t bytes ) {
FILE * f = 0;
size_t retval = 0;
f = (FILE*)stream;
if ( !f ) {
return 0;
}
retval = fread( dst, 1, bytes, f );
if ( retval <= 0 ) {
return 0;
}
return retval;
}
static int openmpt_stream_file_seek_func( void * stream, int64_t offset, int whence ) {
FILE * f = 0;
int fwhence = 0;
f = (FILE*)stream;
if ( !f ) {
return -1;
}
switch ( whence ) {
#if defined(SEEK_SET)
case OPENMPT_STREAM_SEEK_SET:
fwhence = SEEK_SET;
break;
#endif
#if defined(SEEK_CUR)
case OPENMPT_STREAM_SEEK_CUR:
fwhence = SEEK_CUR;
break;
#endif
#if defined(SEEK_END)
case OPENMPT_STREAM_SEEK_END:
fwhence = SEEK_END;
break;
#endif
default:
return -1;
break;
}
#if defined(_MSC_VER)
return _fseeki64( f, offset, fwhence ) ? -1 : 0;
#elif defined(_POSIX_SOURCE) && (_POSIX_SOURCE == 1)
return fseeko( f, offset, fwhence ) ? -1 : 0;
#else
return fseek( f, offset, fwhence ) ? -1 : 0;
#endif
}
static int64_t openmpt_stream_file_tell_func( void * stream ) {
FILE * f = 0;
int64_t retval = 0;
f = (FILE*)stream;
if ( !f ) {
return -1;
}
#if defined(_MSC_VER)
retval = _ftelli64( f );
#elif defined(_POSIX_SOURCE) && (_POSIX_SOURCE == 1)
retval = ftello( f );
#else
retval = ftell( f );
#endif
if ( retval < 0 ) {
return -1;
}
return retval;
}
/*! \brief Provide openmpt_stream_callbacks for standard C FILE objects
*
* Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output.
*
* \remarks The stream argument must be passed as `(void*)(FILE*)file`.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
* \sa openmpt_could_open_probability2
* \sa openmpt_probe_file_header_from_stream
* \sa openmpt_module_create2
*/
static openmpt_stream_callbacks openmpt_stream_get_file_callbacks(void) {
openmpt_stream_callbacks retval;
memset( &retval, 0, sizeof( openmpt_stream_callbacks ) );
retval.read = openmpt_stream_file_read_func;
retval.seek = openmpt_stream_file_seek_func;
retval.tell = openmpt_stream_file_tell_func;
return retval;
}
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_STREAM_CALLBACKS_FILE_H */

View File

@ -0,0 +1,79 @@
/*
* libopenmpt_version.h
* --------------------
* Purpose: libopenmpt public interface version
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_VERSION_H
#define LIBOPENMPT_VERSION_H
/* clang-format off */
/*! \addtogroup libopenmpt
@{
*/
/*! \brief libopenmpt major version number */
#define OPENMPT_API_VERSION_MAJOR 0
/*! \brief libopenmpt minor version number */
#define OPENMPT_API_VERSION_MINOR 6
/*! \brief libopenmpt patch version number */
#define OPENMPT_API_VERSION_PATCH 4
/*! \brief libopenmpt pre-release tag */
#define OPENMPT_API_VERSION_PREREL ""
/*! \brief libopenmpt pre-release flag */
#define OPENMPT_API_VERSION_IS_PREREL 0
/*! \brief libopenmpt version number as a single integer value
* \since 0.3
* \remarks Use the following shim if you need to support earlier libopenmpt versions:
* \code
* #include <libopenmpt/libopenmpt_version.h>
* #if !defined(OPENMPT_API_VERSION_MAKE)
* #define OPENMPT_API_VERSION_MAKE(major, minor, patch) (((major)<<24)|((minor)<<16)|((patch)<<0))
* #endif
* \endcode
*/
#define OPENMPT_API_VERSION_MAKE(major, minor, patch) (((major)<<24)|((minor)<<16)|((patch)<<0))
/*! \brief libopenmpt API version number */
#define OPENMPT_API_VERSION OPENMPT_API_VERSION_MAKE(OPENMPT_API_VERSION_MAJOR, OPENMPT_API_VERSION_MINOR, OPENMPT_API_VERSION_PATCH)
/*! \brief Check whether the libopenmpt API is at least the provided version
* \since 0.3
* \remarks Use the following shim if you need to support earlier libopenmpt versions:
* \code
* #include <libopenmpt/libopenmpt_version.h>
* #if !defined(OPENMPT_API_VERSION_AT_LEAST)
* #define OPENMPT_API_VERSION_AT_LEAST(major, minor, patch) (OPENMPT_API_VERSION >= OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
* #endif
* \endcode
*/
#define OPENMPT_API_VERSION_AT_LEAST(major, minor, patch) (OPENMPT_API_VERSION >= OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
/*! \brief Check whether the libopenmpt API is before the provided version
* \since 0.3
* \remarks Use the following shim if you need to support earlier libopenmpt versions:
* \code
* #include <libopenmpt/libopenmpt_version.h>
* #if !defined(OPENMPT_API_VERSION_BEFORE)
* #define OPENMPT_API_VERSION_BEFORE(major, minor, patch) (OPENMPT_API_VERSION < OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
* #endif
* \endcode
*/
#define OPENMPT_API_VERSION_BEFORE(major, minor, patch) (OPENMPT_API_VERSION < OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
#define OPENMPT_API_VERSION_HELPER_STRINGIZE(x) #x
#define OPENMPT_API_VERSION_STRINGIZE(x) OPENMPT_API_VERSION_HELPER_STRINGIZE(x)
#define OPENMPT_API_VERSION_STRING OPENMPT_API_VERSION_STRINGIZE(OPENMPT_API_VERSION_MAJOR) "." OPENMPT_API_VERSION_STRINGIZE(OPENMPT_API_VERSION_MINOR) "." OPENMPT_API_VERSION_STRINGIZE(OPENMPT_API_VERSION_PATCH) OPENMPT_API_VERSION_PREREL
/*!
@}
*/
/* clang-format on */
#endif /* LIBOPENMPT_VERSION_H */

View File

@ -0,0 +1,27 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by libopenmpt_plugin_gui.rc
//
#define IDD_SETTINGS 101
#define IDD_FILEINFO 102
#define IDC_COMBO_SAMPLERATE 1001
#define IDC_COMBO_CHANNELS 1002
#define IDC_SLIDER_GAIN 1003
#define IDC_COMBO_INTERPOLATION 1004
#define IDC_COMBO_REPEAT 1005
#define IDC_SLIDER_STEREOSEPARATION 1006
#define IDC_COMBO_RAMPING 1007
#define IDC_FILEINFO 1008
#define IDC_COMBO_AMIGA_FILTER 1008
#define IDC_CHECK_AMIGA_RESAMPLER 1009
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

10
ThirdParty/libopenmpt_old/README.md vendored Normal file
View File

@ -0,0 +1,10 @@
Built from the latest archive, version 0.5.18 as of this writing, using the
Makefile variant:
for arch in x86_64 arm64; do
env CFLAGS="-g -Os -mmacosx-version-min=10.13 -arch $arch" CXXFLAGS="-g -Os -mmacosx-version-min=10.13 -arch $arch" LDFLAGS="-mmacosx-version-min=10.13 -arch $arch" make -j8 SHARED_LIB=0 EXAMPLES=0 OPENMPT123=0 DEBUG=1 OPTIMIZE_SIZE=1 TEST=0
cp bin/libopenmpt.a libopenmpt_$arch.a
make clean
done
lipo -create -output libopenmpt.old.a libopenmpt_x86_64.a libopenmpt_arm64.a

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,201 @@
/*
* libopenmpt_config.h
* -------------------
* Purpose: libopenmpt public interface configuration
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_CONFIG_H
#define LIBOPENMPT_CONFIG_H
/*! \defgroup libopenmpt libopenmpt */
/*! \addtogroup libopenmpt
@{
*/
/* provoke warnings if already defined */
#define LIBOPENMPT_API
#undef LIBOPENMPT_API
#define LIBOPENMPT_CXX_API
#undef LIBOPENMPT_CXX_API
/*!
@}
*/
/*! \addtogroup libopenmpt_c
@{
*/
/*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_buffer.h exists. */
#define LIBOPENMPT_STREAM_CALLBACKS_BUFFER
/*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_fd.h exists.
* \since 0.3
* \remarks
* Use the following to check for availability:
* \code
* #include <libopenmpt/libopenmpt.h>
* #if defined(LIBOPENMPT_STREAM_CALLBACKS_FD) || ((OPENMPT_API_VERSION_MAJOR == 0) && ((OPENMPT_API_VERSION_MINOR == 2) || (OPENMPT_API_VERSION_MINOR == 1)))
* #include <libopenmpt/libopenmpt_stream_callbacks_fd.h>
* #endif
* \endcode
*/
#define LIBOPENMPT_STREAM_CALLBACKS_FD
/*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_file.h exists.
* \since 0.3
* \remarks
* Use the following to check for availability:
* \code
* #include <libopenmpt/libopenmpt.h>
* #if defined(LIBOPENMPT_STREAM_CALLBACKS_FILE) || ((OPENMPT_API_VERSION_MAJOR == 0) && ((OPENMPT_API_VERSION_MINOR == 2) || (OPENMPT_API_VERSION_MINOR == 1)))
* #include <libopenmpt/libopenmpt_stream_callbacks_file.h>
* #endif
* \endcode
*/
#define LIBOPENMPT_STREAM_CALLBACKS_FILE
/*!
@}
*/
/*! \addtogroup libopenmpt
@{
*/
#if defined(__DOXYGEN__)
#define LIBOPENMPT_API_HELPER_EXPORT
#define LIBOPENMPT_API_HELPER_IMPORT
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#elif defined(_MSC_VER)
#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#elif defined(__EMSCRIPTEN__)
#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
#elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
#elif defined(__GNUC__) || defined(__clang__)
#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
#elif defined(_WIN32)
#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#else
#define LIBOPENMPT_API_HELPER_EXPORT
#define LIBOPENMPT_API_HELPER_IMPORT
#define LIBOPENMPT_API_HELPER_PUBLIC
#define LIBOPENMPT_API_HELPER_LOCAL
#endif
#if defined(LIBOPENMPT_BUILD_DLL)
#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
#elif defined(LIBOPENMPT_USE_DLL)
#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
#else
#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
#endif
#ifdef __cplusplus
#define LIBOPENMPT_CXX_API LIBOPENMPT_API
#if defined(LIBOPENMPT_USE_DLL)
#if defined(_MSC_VER) && !defined(_DLL)
#error "C++ interface is disabled if libopenmpt is built as a DLL and the runtime is statically linked. This is not supported by microsoft and cannot possibly work. Ever."
#undef LIBOPENMPT_CXX_API
#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#endif
#if defined(__EMSCRIPTEN__)
/* Only the C API is supported for emscripten. Disable the C++ API. */
#undef LIBOPENMPT_CXX_API
#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#endif
/*!
@}
*/
/* C */
#if !defined(LIBOPENMPT_NO_DEPRECATE)
#if defined(__clang__)
#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
#elif defined(__GNUC__)
#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define LIBOPENMPT_DEPRECATED __declspec(deprecated)
#else
#define LIBOPENMPT_DEPRECATED
#endif
#else
#define LIBOPENMPT_DEPRECATED
#endif
#ifndef __cplusplus
#if !defined(LIBOPENMPT_NO_DEPRECATE)
LIBOPENMPT_DEPRECATED static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT = 0;
#define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
#else
#define LIBOPENMPT_DEPRECATED_STRING( str ) str
#endif
#else
#define LIBOPENMPT_DEPRECATED_STRING( str ) str
#endif
/* C++ */
#ifdef __cplusplus
#if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
#endif
#if !defined(LIBOPENMPT_NO_DEPRECATE)
#define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
#else
#define LIBOPENMPT_ATTR_DEPRECATED
#endif
#endif
#include "libopenmpt_version.h"
#endif /* LIBOPENMPT_CONFIG_H */

View File

@ -0,0 +1,318 @@
/*
* libopenmpt_ext.h
* ----------------
* Purpose: libopenmpt public c interface for libopenmpt extensions
* Notes :
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_EXT_H
#define LIBOPENMPT_EXT_H
#include "libopenmpt_config.h"
#include "libopenmpt.h"
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \page libopenmpt_ext_c_overview libopenmpt_ext C API
*
* libopenmpt_ext is included in all builds by default.
*
* \section libopenmpt-ext-c-detailed Detailed documentation
*
* \ref libopenmpt_ext_c
*
*/
/*! \defgroup libopenmpt_ext_c libopenmpt_ext C */
/*! \addtogroup libopenmpt_ext_c
* @{
*/
/*! \brief Opaque type representing a libopenmpt extension module
*/
typedef struct openmpt_module_ext openmpt_module_ext;
/*! \brief Construct an openmpt_module_ext
*
* \param stream_callbacks Input stream callback operations.
* \param stream Input stream to load the module from.
* \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module_ext. May be NULL.
* \param loguser User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
* \param errfunc Error function to define error behaviour. May be NULL.
* \param erruser Error function user context. Used to pass any user-defined data associated with this module to the logging function.
* \param error Pointer to an integer where an error may get stored. May be NULL.
* \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
* \param ctls A map of initial ctl values, see openmpt_module_get_ctls.
* \return A pointer to the constructed openmpt_module_ext, or NULL on failure.
* \remarks The input data can be discarded after an openmpt_module_ext has been constructed successfully.
* \sa openmpt_stream_callbacks
* \sa \ref libopenmpt_c_fileio
* \since 0.3.0
*/
LIBOPENMPT_API openmpt_module_ext * openmpt_module_ext_create( openmpt_stream_callbacks stream_callbacks, void * stream, openmpt_log_func logfunc, void * loguser, openmpt_error_func errfunc, void * erruser, int * error, const char * * error_message, const openmpt_module_initial_ctl * ctls );
/*! \brief Construct an openmpt_module_ext
*
* \param filedata Data to load the module from.
* \param filesize Amount of data available.
* \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module_ext.
* \param loguser User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
* \param errfunc Error function to define error behaviour. May be NULL.
* \param erruser Error function user context. Used to pass any user-defined data associated with this module to the logging function.
* \param error Pointer to an integer where an error may get stored. May be NULL.
* \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
* \param ctls A map of initial ctl values, see openmpt_module_get_ctls.
* \return A pointer to the constructed openmpt_module_ext, or NULL on failure.
* \remarks The input data can be discarded after an openmpt_module_ext has been constructed successfully.
* \sa \ref libopenmpt_c_fileio
* \since 0.3.0
*/
LIBOPENMPT_API openmpt_module_ext * openmpt_module_ext_create_from_memory( const void * filedata, size_t filesize, openmpt_log_func logfunc, void * loguser, openmpt_error_func errfunc, void * erruser, int * error, const char * * error_message, const openmpt_module_initial_ctl * ctls );
/*! \brief Unload a previously created openmpt_module_ext from memory.
*
* \param mod_ext The module to unload.
*/
LIBOPENMPT_API void openmpt_module_ext_destroy( openmpt_module_ext * mod_ext );
/*! \brief Retrieve the openmpt_module handle from an openmpt_module_ext handle.
*
* \param mod_ext The extension module handle to convert
* \return An equivalent openmpt_module handle to pass to standard libopenmpt functions
* \since 0.3.0
*/
LIBOPENMPT_API openmpt_module * openmpt_module_ext_get_module( openmpt_module_ext * mod_ext );
/*! Retrieve a libopenmpt extension.
*
* \param mod_ext The module handle to work on.
* \param interface_id The name of the extension interface to retrieve (e.g. LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS).
* \param interface Appropriate structure of interface function pointers which is to be filled by this function (e.g. a pointer to a openmpt_module_ext_interface_pattern_vis structure).
* \param interface_size Size of the interface's structure of function pointers (e.g. sizeof(openmpt_module_ext_interface_pattern_vis)).
* \return 1 on success, 0 if the interface was not found.
* \since 0.3.0
*/
LIBOPENMPT_API int openmpt_module_ext_get_interface( openmpt_module_ext * mod_ext, const char * interface_id, void * interface, size_t interface_size );
#ifndef LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS
#define LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS "pattern_vis"
#endif
/*! Pattern command type */
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_UNKNOWN 0
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GENERAL 1
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GLOBAL 2
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_VOLUME 3
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PANNING 4
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PITCH 5
typedef struct openmpt_module_ext_interface_pattern_vis {
/*! Get pattern command type for pattern highlighting
*
* \param mod_ext The module handle to work on.
* \param pattern The pattern whose data should be retrieved.
* \param row The row from which the data should be retrieved.
* \param channel The channel from which the data should be retrieved.
* \return The command type in the effect column at the given pattern position (see OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_*)
* \sa openmpt_module_ext_interface_pattern_vis::get_pattern_row_channel_volume_effect_type
*/
int ( * get_pattern_row_channel_volume_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
/*! Get pattern command type for pattern highlighting
*
* \param mod_ext The module handle to work on.
* \param pattern The pattern whose data should be retrieved.
* \param row The row from which the data should be retrieved.
* \param channel The channel from which the data should be retrieved.
* \return The command type in the effect column at the given pattern position (see OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_*)
* \sa openmpt_module_ext_interface_pattern_vis::get_pattern_row_channel_volume_effect_type
*/
int ( * get_pattern_row_channel_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
} openmpt_module_ext_interface_pattern_vis;
#ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE
#define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE "interactive"
#endif
typedef struct openmpt_module_ext_interface_interactive {
/*! Set the current ticks per row (speed)
*
* \param mod_ext The module handle to work on.
* \param speed The new tick count in range [1, 65535].
* \return 1 on success, 0 on failure.
* \remarks The tick count may be reset by pattern commands at any time.
* \sa openmpt_module_get_current_speed
*/
int ( * set_current_speed ) ( openmpt_module_ext * mod_ext, int32_t speed );
/*! Set the current module tempo
*
* \param mod_ext The module handle to work on.
* \param tempo The new tempo in range [32, 512]. The exact meaning of the value depends on the tempo mode used by the module.
* \return 1 on success, 0 on failure.
* \remarks The tempo may be reset by pattern commands at any time. Use openmpt_module_ext_interface_interactive::set_tempo_factor to apply a tempo factor that is independent of pattern commands.
* \sa openmpt_module_get_current_tempo
*/
int ( * set_current_tempo ) ( openmpt_module_ext * mod_ext, int32_t tempo );
/*! Set the current module tempo factor without affecting playback pitch
*
* \param mod_ext The module handle to work on.
* \param factor The new tempo factor in range ]0.0, 4.0] - 1.0 means unmodified tempo.
* \return 1 on success, 0 on failure.
* \remarks Modifying the tempo without applying the same pitch factor using openmpt_module_ext_interface_interactive::set_pitch_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
* \sa openmpt_module_ext_interface_interactive::get_tempo_factor
*/
int ( * set_tempo_factor ) ( openmpt_module_ext * mod_ext, double factor );
/*! Gets the current module tempo factor
*
* \param mod_ext The module handle to work on.
* \return The current tempo factor.
* \sa openmpt_module_ext_interface_interactive::set_tempo_factor
*/
double ( * get_tempo_factor ) ( openmpt_module_ext * mod_ext );
/*! Set the current module pitch factor without affecting playback speed
*
* \param mod_ext The module handle to work on.
* \param factor The new pitch factor in range ]0.0, 4.0] - 1.0 means unmodified pitch.
* \return 1 on success, 0 on failure.
* \remarks Modifying the pitch without applying the the same tempo factor using openmpt_module_ext_interface_interactive::set_tempo_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
* \remarks To shift the pich by `n` semitones, the parameter can be calculated as follows: `pow( 2.0, n / 12.0 )`
* \sa openmpt_module_ext_interface_interactive::get_pitch_factor
*/
int ( * set_pitch_factor ) ( openmpt_module_ext * mod_ext, double factor );
/*! Gets the current module pitch factor
*
* \param mod_ext The module handle to work on.
* \return The current pitch factor.
* \sa openmpt_module_ext_interface_interactive::set_pitch_factor
*/
double ( * get_pitch_factor ) ( openmpt_module_ext * mod_ext );
/*! Set the current global volume
*
* \param mod_ext The module handle to work on.
* \param volume The new global volume in range [0.0, 1.0]
* \return 1 on success, 0 on failure.
* \remarks The global volume may be reset by pattern commands at any time. Use openmpt_module_set_render_param to apply a global overall volume factor that is independent of pattern commands.
* \sa openmpt_module_ext_interface_interactive::get_global_volume
*/
int ( * set_global_volume ) ( openmpt_module_ext * mod_ext, double volume );
/*! Get the current global volume
*
* \param mod_ext The module handle to work on.
* \return The current global volume in range [0.0, 1.0]
* \sa openmpt_module_ext_interface_interactive::set_global_volume
*/
double ( * get_global_volume ) ( openmpt_module_ext * mod_ext );
/*! Set the current channel volume for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose volume should be set, in range [0, openmpt_module_get_num_channels()[
* \param volume The new channel volume in range [0.0, 1.0]
* \return 1 on success, 0 on failure (channel out of range).
* \remarks The channel volume may be reset by pattern commands at any time.
* \sa openmpt_module_ext_interface_interactive::get_channel_volume
*/
int ( * set_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel, double volume );
/*! Get the current channel volume for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose volume should be retrieved, in range [0, openmpt_module_get_num_channels()[
* \return The current channel volume in range [0.0, 1.0]
* \sa openmpt_module_ext_interface_interactive::set_channel_volume
*/
double ( * get_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel );
/*! Set the current mute status for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose mute status should be set, in range [0, openmpt_module_get_num_channels()[
* \param mute The new mute status. true is muted, false is unmuted.
* \return 1 on success, 0 on failure (channel out of range).
* \sa openmpt_module_ext_interface_interactive::get_channel_mute_status
*/
int ( * set_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel, int mute );
/*! Get the current mute status for a channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel whose mute status should be retrieved, in range [0, openmpt_module_get_num_channels()[
* \return The current channel mute status. 1 is muted, 0 is unmuted, -1 means the instrument was out of range
* \sa openmpt_module_ext_interface_interactive::set_channel_mute_status
*/
int ( * get_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel );
/*! Set the current mute status for an instrument
*
* \param mod_ext The module handle to work on.
* \param instrument The instrument whose mute status should be set, in range [0, openmpt_module_get_num_instruments()[ if openmpt_module_get_num_instruments is not 0, otherwise in [0, openmpt_module_get_num_samples()[
* \param mute The new mute status. true is muted, false is unmuted.
* \return 1 on success, 0 on failure (instrument out of range).
* \sa openmpt_module_ext_interface_interactive::get_instrument_mute_status
*/
int ( * set_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument, int mute );
/*! Get the current mute status for an instrument
*
* \param mod_ext The module handle to work on.
* \param instrument The instrument whose mute status should be retrieved, in range [0, openmpt_module_get_num_instruments()[ if openmpt_module_get_num_instruments is not 0, otherwise in [0, openmpt_module_get_num_samples()[
* \return The current instrument mute status. 1 is muted, 0 is unmuted, -1 means the instrument was out of range
* \sa openmpt_module_ext_interface_interactive::set_instrument_mute_status
*/
int ( * get_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument );
/*! Play a note using the specified instrument
*
* \param mod_ext The module handle to work on.
* \param instrument The instrument that should be played, in range [0, openmpt_module_get_num_instruments()[ if openmpt_module_get_num_instruments is not 0, otherwise in [0, openmpt_module_get_num_samples()[
* \param note The note to play, in rage [0, 119]. 60 is the middle C.
* \param volume The volume at which the note should be triggered, in range [0.0, 1.0]
* \param panning The panning position at which the note should be triggered, in range [-1.0, 1.0], 0.0 is center.
* \return The channel on which the note is played. This can pe be passed to openmpt_module_ext_interface_interactive::stop_note to stop the note. -1 means that no channel could be allocated and the note is not played.
* \sa openmpt_module_ext_interface_interactive::stop_note
*/
int32_t ( * play_note ) ( openmpt_module_ext * mod_ext, int32_t instrument, int32_t note, double volume, double panning );
/*! Stop the note playing on the specified channel
*
* \param mod_ext The module handle to work on.
* \param channel The channel on which the note should be stopped.
* \return 1 on success, 0 on failure (channel out of range).
* \sa openmpt_module_ext_interface_interactive::play_note
*/
int ( * stop_note ) ( openmpt_module_ext * mod_ext, int32_t channel );
} openmpt_module_ext_interface_interactive;
/* add stuff here */
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_EXT_H */

View File

@ -0,0 +1,319 @@
/*
* libopenmpt_ext.hpp
* ------------------
* Purpose: libopenmpt public c++ interface for libopenmpt extensions
* Notes :
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_EXT_HPP
#define LIBOPENMPT_EXT_HPP
#include "libopenmpt_config.h"
#include "libopenmpt.hpp"
/*!
* \page libopenmpt_ext_cpp_overview libopenmpt_ext C++ API
*
* libopenmpt_ext is now included in all builds by default.
*
* \section libopenmpt-ext-cpp-detailed Detailed documentation
*
* \ref libopenmpt_ext_cpp
*
*/
/*! \defgroup libopenmpt_ext_cpp libopenmpt_ext C++ */
namespace openmpt {
/*! \addtogroup libopenmpt_ext_cpp
@{
*/
class module_ext_impl;
class LIBOPENMPT_CXX_API module_ext : public module {
private:
module_ext_impl * ext_impl;
private:
// non-copyable
module_ext( const module_ext & );
void operator = ( const module_ext & );
public:
module_ext( std::istream & stream, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::vector<std::byte> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::vector<std::uint8_t> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::vector<char> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::byte * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const std::uint8_t * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const char * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
module_ext( const void * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
virtual ~module_ext();
public:
//! Retrieve a libopenmpt extension.
/*! Example: Retrieving the interactive extension to change the tempo of a module:
\code{.cpp}
openmpt::module_ext *mod = new openmpt::module_ext( stream );
#ifdef LIBOPENMPT_EXT_INTERFACE_INTERACTIVE
openmpt::ext::interactive *interactive = static_cast<openmpt::ext::interactive *>( self->mod->get_interface( openmpt::ext::interactive_id ) );
if ( interactive ) {
interactive->set_tempo_factor( 2.0 ); // play module at double speed
} else {
// interface not available
}
#else
// interfae not available
#endif
\endcode
\param interface_id The name of the extension interface to retrieve.
\return The interface object. This may be a nullptr if the extension was not found.
*/
void * get_interface( const std::string & interface_id );
}; // class module_ext
/*!
@}
*/
namespace ext {
/*! \addtogroup libopenmpt_ext_cpp
@{
*/
#define LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE(name) \
static const char name ## _id [] = # name ; \
class name; \
/**/
#define LIBOPENMPT_EXT_CXX_INTERFACE(name) \
protected: \
name () {} \
virtual ~ name () {} \
public: \
/**/
#ifndef LIBOPENMPT_EXT_INTERFACE_PATTERN_VIS
#define LIBOPENMPT_EXT_INTERFACE_PATTERN_VIS
#endif
LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE(pattern_vis)
class pattern_vis {
LIBOPENMPT_EXT_CXX_INTERFACE(pattern_vis)
//! Pattern command type
enum effect_type {
effect_unknown = 0,
effect_general = 1,
effect_global = 2,
effect_volume = 3,
effect_panning = 4,
effect_pitch = 5
}; // enum effect_type
//! Get pattern command type for pattern highlighting
/*!
\param pattern The pattern whose data should be retrieved.
\param row The row from which the data should be retrieved.
\param channel The channel from which the data should be retrieved.
\return The command type in the effect column at the given pattern position (see openmpt::ext::pattern_vis::effect_type)
\sa openmpt::ext::pattern_vis::get_pattern_row_channel_effect_type
*/
virtual effect_type get_pattern_row_channel_volume_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const = 0;
//! Get pattern command type for pattern highlighting
/*!
\param pattern The pattern whose data should be retrieved.
\param row The row from which the data should be retrieved.
\param channel The channel from which the data should be retrieved.
\return The command type in the volume column at the given pattern position (see openmpt::ext::pattern_vis::effect_type)
\sa openmpt::ext::pattern_vis::get_pattern_row_channel_volume_effect_type
*/
virtual effect_type get_pattern_row_channel_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const = 0;
}; // class pattern_vis
#ifndef LIBOPENMPT_EXT_INTERFACE_INTERACTIVE
#define LIBOPENMPT_EXT_INTERFACE_INTERACTIVE
#endif
LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE(interactive)
class interactive {
LIBOPENMPT_EXT_CXX_INTERFACE(interactive)
//! Set the current ticks per row (speed)
/*!
\param speed The new tick count in range [1, 65535].
\throws openmpt::exception Throws an exception derived from openmpt::exception if the speed is outside the specified range.
\remarks The tick count may be reset by pattern commands at any time.
\sa openmpt::module::get_current_speed
*/
virtual void set_current_speed( std::int32_t speed ) = 0;
//! Set the current module tempo
/*!
\param tempo The new tempo in range [32, 512]. The exact meaning of the value depends on the tempo mode used by the module.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the tempo is outside the specified range.
\remarks The tempo may be reset by pattern commands at any time. Use openmpt::ext:interactive::set_tempo_factor to apply a tempo factor that is independent of pattern commands.
\sa openmpt::module::get_current_tempo
*/
virtual void set_current_tempo( std::int32_t tempo ) = 0;
//! Set the current module tempo factor without affecting playback pitch
/*!
\param factor The new tempo factor in range ]0.0, 4.0] - 1.0 means unmodified tempo.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the factor is outside the specified range.
\remarks Modifying the tempo without applying the same pitch factor using openmpt::ext::interactive::set_pitch_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
\sa openmpt::ext::interactive::get_tempo_factor
*/
virtual void set_tempo_factor( double factor ) = 0;
//! Gets the current module tempo factor
/*!
\return The current tempo factor.
\sa openmpt::ext::interactive::set_tempo_factor
*/
virtual double get_tempo_factor( ) const = 0;
//! Set the current module pitch factor without affecting playback speed
/*!
\param factor The new pitch factor in range ]0.0, 4.0] - 1.0 means unmodified pitch.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the factor is outside the specified range.
\remarks Modifying the pitch without applying the the same tempo factor using openmpt::ext::interactive::set_tempo_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
\remarks To shift the pich by `n` semitones, the parameter can be calculated as follows: `pow( 2.0, n / 12.0 )`
\sa openmpt::ext::interactive::get_pitch_factor
*/
virtual void set_pitch_factor( double factor ) = 0;
//! Gets the current module pitch factor
/*!
\return The current pitch factor.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the pitch is outside the specified range.
\sa openmpt::ext::interactive::set_pitch_factor
*/
virtual double get_pitch_factor( ) const = 0;
//! Set the current global volume
/*!
\param volume The new global volume in range [0.0, 1.0]
\throws openmpt::exception Throws an exception derived from openmpt::exception if the volume is outside the specified range.
\remarks The global volume may be reset by pattern commands at any time. Use openmpt::module::set_render_param to apply a global overall volume factor that is independent of pattern commands.
\sa openmpt::ext::interactive::get_global_volume
*/
virtual void set_global_volume( double volume ) = 0;
//! Get the current global volume
/*!
\return The current global volume in range [0.0, 1.0]
\sa openmpt::ext::interactive::set_global_volume
*/
virtual double get_global_volume( ) const = 0;
//! Set the current channel volume for a channel
/*!
\param channel The channel whose volume should be set, in range [0, openmpt::module::get_num_channels()[
\param volume The new channel volume in range [0.0, 1.0]
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel or volume is outside the specified range.
\remarks The channel volume may be reset by pattern commands at any time.
\sa openmpt::ext::interactive::get_channel_volume
*/
virtual void set_channel_volume( std::int32_t channel, double volume ) = 0;
//! Get the current channel volume for a channel
/*!
\param channel The channel whose volume should be retrieved, in range [0, openmpt::module::get_num_channels()[
\return The current channel volume in range [0.0, 1.0]
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\sa openmpt::ext::interactive::set_channel_volume
*/
virtual double get_channel_volume( std::int32_t channel ) const = 0;
//! Set the current mute status for a channel
/*!
\param channel The channel whose mute status should be set, in range [0, openmpt::module::get_num_channels()[
\param mute The new mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\sa openmpt::ext::interactive::get_channel_mute_status
*/
virtual void set_channel_mute_status( std::int32_t channel, bool mute ) = 0;
//! Get the current mute status for a channel
/*!
\param channel The channel whose mute status should be retrieved, in range [0, openmpt::module::get_num_channels()[
\return The current channel mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel is outside the specified range.
\sa openmpt::ext::interactive::set_channel_mute_status
*/
virtual bool get_channel_mute_status( std::int32_t channel ) const = 0;
//! Set the current mute status for an instrument
/*!
\param instrument The instrument whose mute status should be set, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
\param mute The new mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the instrument is outside the specified range.
\sa openmpt::ext::interactive::get_instrument_mute_status
*/
virtual void set_instrument_mute_status( std::int32_t instrument, bool mute ) = 0;
//! Get the current mute status for an instrument
/*!
\param instrument The instrument whose mute status should be retrieved, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
\return The current instrument mute status. true is muted, false is unmuted.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the instrument is outside the specified range.
\sa openmpt::ext::interactive::set_instrument_mute_status
*/
virtual bool get_instrument_mute_status( std::int32_t instrument ) const = 0;
//! Play a note using the specified instrument
/*!
\param instrument The instrument that should be played, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
\param note The note to play, in rage [0, 119]. 60 is the middle C.
\param volume The volume at which the note should be triggered, in range [0.0, 1.0]
\param panning The panning position at which the note should be triggered, in range [-1.0, 1.0], 0.0 is center.
\return The channel on which the note is played. This can pe be passed to openmpt::ext::interactive::stop_note to stop the note.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the instrument or note is outside the specified range.
\sa openmpt::ext::interactive::stop_note
*/
virtual std::int32_t play_note( std::int32_t instrument, std::int32_t note, double volume, double panning ) = 0;
//! Stop the note playing on the specified channel
/*!
\param channel The channel on which the note should be stopped. This is the value returned by a previous play_note call.
\throws openmpt::exception Throws an exception derived from openmpt::exception if the channel index is invalid.
\sa openmpt::ext::interactive::play_note
*/
virtual void stop_note( std::int32_t channel ) = 0;
}; // class interactive
/* add stuff here */
#undef LIBOPENMPT_DECLARE_EXT_CXX_INTERFACE
#undef LIBOPENMPT_EXT_CXX_INTERFACE
/*!
@}
*/
} // namespace ext
} // namespace openmpt
#endif // LIBOPENMPT_EXT_HPP

View File

@ -0,0 +1,112 @@
/*
* libopenmpt_ext_impl.hpp
* -----------------------
* Purpose: libopenmpt extensions - implementation header
* Notes :
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_EXT_IMPL_HPP
#define LIBOPENMPT_EXT_IMPL_HPP
#include "libopenmpt_internal.h"
#include "libopenmpt_impl.hpp"
#include "libopenmpt_ext.hpp"
namespace openmpt {
class module_ext_impl
: public module_impl
, public ext::pattern_vis
, public ext::interactive
/* add stuff here */
{
public:
module_ext_impl( callback_stream_wrapper stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( std::istream & stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::vector<std::byte> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::vector<std::uint8_t> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::vector<char> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::byte * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const std::uint8_t * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const char * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_ext_impl( const void * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
private:
/* add stuff here */
private:
void ctor();
public:
~module_ext_impl();
public:
void * get_interface( const std::string & interface_id );
// pattern_vis
effect_type get_pattern_row_channel_volume_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const override;
effect_type get_pattern_row_channel_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const override;
// interactive
void set_current_speed( std::int32_t speed ) override;
void set_current_tempo( std::int32_t tempo ) override;
void set_tempo_factor( double factor ) override;
double get_tempo_factor( ) const override;
void set_pitch_factor( double factor ) override;
double get_pitch_factor( ) const override;
void set_global_volume( double volume ) override;
double get_global_volume( ) const override;
void set_channel_volume( std::int32_t channel, double volume ) override;
double get_channel_volume( std::int32_t channel ) const override;
void set_channel_mute_status( std::int32_t channel, bool mute ) override;
bool get_channel_mute_status( std::int32_t channel ) const override;
void set_instrument_mute_status( std::int32_t instrument, bool mute ) override;
bool get_instrument_mute_status( std::int32_t instrument ) const override;
std::int32_t play_note( std::int32_t instrument, std::int32_t note, double volume, double panning ) override;
void stop_note( std::int32_t channel ) override;
/* add stuff here */
}; // class module_ext_impl
} // namespace openmpt
#endif // LIBOPENMPT_EXT_IMPL_HPP

View File

@ -0,0 +1,260 @@
/*
* libopenmpt_impl.hpp
* -------------------
* Purpose: libopenmpt private interface
* Notes : This is not a public header. Do NOT ship in distributions dev packages.
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_IMPL_HPP
#define LIBOPENMPT_IMPL_HPP
#include "libopenmpt_internal.h"
#include "libopenmpt.hpp"
#include <iosfwd>
#include <memory>
#include <utility>
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4512) // assignment operator could not be generated
#endif
// forward declarations
namespace OpenMPT {
class FileReaderTraitsStdStream;
typedef FileReaderTraitsStdStream FileReaderTraitsDefault;
namespace detail {
template <typename Tbase>
class FileReader;
} // namespace detail
typedef detail::FileReader<FileReaderTraitsDefault> FileReader;
class CSoundFile;
template <std::size_t channels> class DitherChannels;
using Dither = DitherChannels<4>;
} // namespace OpenMPT
namespace openmpt {
namespace version {
std::uint32_t get_library_version();
std::uint32_t get_core_version();
std::string get_string( const std::string & key );
} // namespace version
class log_interface {
protected:
log_interface();
public:
virtual ~log_interface();
virtual void log( const std::string & message ) const = 0;
}; // class log_interface
class std_ostream_log : public log_interface {
private:
std::ostream & destination;
public:
std_ostream_log( std::ostream & dst );
virtual ~std_ostream_log();
void log( const std::string & message ) const override;
}; // class CSoundFileLog_std_ostream
class log_forwarder;
struct callback_stream_wrapper {
void * stream;
std::size_t (*read)( void * stream, void * dst, std::size_t bytes );
int (*seek)( void * stream, std::int64_t offset, int whence );
std::int64_t (*tell)( void * stream );
}; // struct callback_stream_wrapper
class module_impl {
public:
enum class amiga_filter_type {
a500,
a1200,
unfiltered,
auto_filter,
};
protected:
struct subsong_data {
double duration;
std::int32_t start_row;
std::int32_t start_order;
std::int32_t sequence;
subsong_data( double duration, std::int32_t start_row, std::int32_t start_order, std::int32_t sequence );
}; // struct subsong_data
typedef std::vector<subsong_data> subsongs_type;
enum class song_end_action {
fadeout_song,
continue_song,
stop_song,
};
static constexpr std::int32_t all_subsongs = -1;
enum class ctl_type {
boolean,
integer,
floatingpoint,
text,
};
struct ctl_info {
const char * name;
ctl_type type;
};
std::unique_ptr<log_interface> m_Log;
std::unique_ptr<log_forwarder> m_LogForwarder;
std::int32_t m_current_subsong;
double m_currentPositionSeconds;
std::unique_ptr<OpenMPT::CSoundFile> m_sndFile;
bool m_loaded;
bool m_mixer_initialized;
std::unique_ptr<OpenMPT::Dither> m_Dither;
subsongs_type m_subsongs;
float m_Gain;
song_end_action m_ctl_play_at_end;
amiga_filter_type m_ctl_render_resampler_emulate_amiga_type = amiga_filter_type::auto_filter;
bool m_ctl_load_skip_samples;
bool m_ctl_load_skip_patterns;
bool m_ctl_load_skip_plugins;
bool m_ctl_load_skip_subsongs_init;
bool m_ctl_seek_sync_samples;
std::vector<std::string> m_loaderMessages;
public:
void PushToCSoundFileLog( const std::string & text ) const;
void PushToCSoundFileLog( int loglevel, const std::string & text ) const;
protected:
std::string mod_string_to_utf8( const std::string & encoded ) const;
void apply_mixer_settings( std::int32_t samplerate, int channels );
void apply_libopenmpt_defaults();
subsongs_type get_subsongs() const;
void init_subsongs( subsongs_type & subsongs ) const;
bool has_subsongs_inited() const;
void ctor( const std::map< std::string, std::string > & ctls );
void load( const OpenMPT::FileReader & file, const std::map< std::string, std::string > & ctls );
bool is_loaded() const;
std::size_t read_wrapper( std::size_t count, std::int16_t * left, std::int16_t * right, std::int16_t * rear_left, std::int16_t * rear_right );
std::size_t read_wrapper( std::size_t count, float * left, float * right, float * rear_left, float * rear_right );
std::size_t read_interleaved_wrapper( std::size_t count, std::size_t channels, std::int16_t * interleaved );
std::size_t read_interleaved_wrapper( std::size_t count, std::size_t channels, float * interleaved );
std::string get_message_instruments() const;
std::string get_message_samples() const;
std::pair< std::string, std::string > format_and_highlight_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int command ) const;
std::pair< std::string, std::string > format_and_highlight_pattern_row_channel( std::int32_t p, std::int32_t r, std::int32_t c, std::size_t width, bool pad ) const;
static double could_open_probability( const OpenMPT::FileReader & file, double effort, std::unique_ptr<log_interface> log );
public:
static std::vector<std::string> get_supported_extensions();
static bool is_extension_supported( std::string_view extension );
static double could_open_probability( callback_stream_wrapper stream, double effort, std::unique_ptr<log_interface> log );
static double could_open_probability( std::istream & stream, double effort, std::unique_ptr<log_interface> log );
static std::size_t probe_file_header_get_recommended_size();
static int probe_file_header( std::uint64_t flags, const std::byte * data, std::size_t size, std::uint64_t filesize );
static int probe_file_header( std::uint64_t flags, const std::uint8_t * data, std::size_t size, std::uint64_t filesize );
static int probe_file_header( std::uint64_t flags, const void * data, std::size_t size, std::uint64_t filesize );
static int probe_file_header( std::uint64_t flags, const std::byte * data, std::size_t size );
static int probe_file_header( std::uint64_t flags, const std::uint8_t * data, std::size_t size );
static int probe_file_header( std::uint64_t flags, const void * data, std::size_t size );
static int probe_file_header( std::uint64_t flags, std::istream & stream );
static int probe_file_header( std::uint64_t flags, callback_stream_wrapper stream );
module_impl( callback_stream_wrapper stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( std::istream & stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::vector<std::byte> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::vector<std::uint8_t> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::vector<char> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::byte * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const std::uint8_t * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const char * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
module_impl( const void * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
~module_impl();
public:
void select_subsong( std::int32_t subsong );
std::int32_t get_selected_subsong() const;
void set_repeat_count( std::int32_t repeat_count );
std::int32_t get_repeat_count() const;
double get_duration_seconds() const;
double set_position_seconds( double seconds );
double get_position_seconds() const;
double set_position_order_row( std::int32_t order, std::int32_t row );
std::int32_t get_render_param( int param ) const;
void set_render_param( int param, std::int32_t value );
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 * rear_left, std::int16_t * rear_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 * rear_left, float * rear_right );
std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_stereo );
std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_quad );
std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, float * interleaved_stereo );
std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, float * interleaved_quad );
std::vector<std::string> get_metadata_keys() const;
std::string get_metadata( const std::string & key ) const;
double get_current_estimated_bpm() 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;
float get_current_channel_vu_mono( std::int32_t channel ) const;
float get_current_channel_vu_left( std::int32_t channel ) const;
float get_current_channel_vu_right( std::int32_t channel ) const;
float get_current_channel_vu_rear_left( std::int32_t channel ) const;
float get_current_channel_vu_rear_right( std::int32_t channel ) 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 o ) const;
std::int32_t get_pattern_num_rows( std::int32_t p ) const;
std::uint8_t get_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const;
std::string format_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const;
std::string highlight_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const;
std::string format_pattern_row_channel( std::int32_t p, std::int32_t r, std::int32_t c, std::size_t width, bool pad ) const;
std::string highlight_pattern_row_channel( std::int32_t p, std::int32_t r, std::int32_t c, std::size_t width, bool pad ) const;
std::pair<const module_impl::ctl_info *, const module_impl::ctl_info *> get_ctl_infos() const;
std::vector<std::string> get_ctls() const;
std::string ctl_get( std::string ctl, bool throw_if_unknown = true ) const;
bool ctl_get_boolean( std::string_view ctl, bool throw_if_unknown = true ) const;
std::int64_t ctl_get_integer( std::string_view ctl, bool throw_if_unknown = true ) const;
double ctl_get_floatingpoint( std::string_view ctl, bool throw_if_unknown = true ) const;
std::string ctl_get_text( std::string_view ctl, bool throw_if_unknown = true ) const;
void ctl_set( std::string ctl, const std::string & value, bool throw_if_unknown = true );
void ctl_set_boolean( std::string_view ctl, bool value, bool throw_if_unknown = true );
void ctl_set_integer( std::string_view ctl, std::int64_t value, bool throw_if_unknown = true );
void ctl_set_floatingpoint( std::string_view ctl, double value, bool throw_if_unknown = true );
void ctl_set_text( std::string_view ctl, std::string_view value, bool throw_if_unknown = true );
}; // class module_impl
namespace helper {
template<typename T, typename... Args> std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
} // namespace helper
} // namespace openmpt
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#endif // LIBOPENMPT_IMPL_HPP

View File

@ -0,0 +1,36 @@
/*
* libopenmpt_internal.h
* ---------------------
* Purpose: libopenmpt internal interface configuration, overruling the public interface configuration (only used and needed when building libopenmpt)
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_INTERNAL_H
#define LIBOPENMPT_INTERNAL_H
#include "libopenmpt_config.h"
#if defined(NO_LIBOPENMPT_C)
#undef LIBOPENMPT_API
#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#if defined(NO_LIBOPENMPT_CXX)
#undef LIBOPENMPT_CXX_API
#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#ifdef __cplusplus
#if defined(LIBOPENMPT_BUILD_DLL) || defined(LIBOPENMPT_USE_DLL)
#if defined(_MSC_VER) && !defined(_DLL)
/* #pragma message( "libopenmpt C++ interface is disabled if libopenmpt is built as a DLL and the runtime is statically linked. This is not supported by microsoft and cannot possibly work. Ever." ) */
#undef LIBOPENMPT_CXX_API
#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
#endif
#endif
#endif
#endif /* LIBOPENMPT_INTERNAL_H */

View File

@ -0,0 +1,37 @@
/*
* libopenmpt_plugin_gui.hpp
* -------------------------
* Purpose: libopenmpt plugin GUI
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_PLUGIN_GUI_HPP
#define LIBOPENMPT_PLUGIN_GUI_HPP
#include "libopenmpt_plugin_settings.hpp"
#define NOMINMAX
#include <windows.h>
#include <string>
namespace libopenmpt {
namespace plugin {
void DllMainAttach();
void DllMainDetach();
void gui_edit_settings( libopenmpt_settings * s, HWND parent, std::wstring title );
void gui_show_file_info( HWND parent, std::wstring title, std::wstring info );
} // namespace plugin
} // namespace libopenmpt
#endif // LIBOPENMPT_PLUGIN_GUI_HPP

View File

@ -0,0 +1,133 @@
/*
* libopenmpt_plugin_settings.hpp
* ------------------------------
* Purpose: libopenmpt plugin settings
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_PLUGIN_SETTINGS_HPP
#define LIBOPENMPT_PLUGIN_SETTINGS_HPP
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <string>
namespace libopenmpt {
namespace plugin {
typedef void (*changed_func)();
struct libopenmpt_settings {
bool no_default_format;
int samplerate;
int channels;
int mastergain_millibel;
int stereoseparation;
int use_amiga_resampler;
int amiga_filter_type;
int repeatcount;
int interpolationfilterlength;
int ramping;
int vis_allow_scroll;
changed_func changed;
};
class settings : public libopenmpt_settings {
private:
std::wstring subkey;
protected:
virtual void read_setting( const std::string & /* key */ , const std::wstring & keyW, int & val ) {
HKEY regkey = HKEY();
if ( RegOpenKeyEx( HKEY_CURRENT_USER, ( L"Software\\libopenmpt\\" + subkey ).c_str(), 0, KEY_READ, &regkey ) == ERROR_SUCCESS ) {
DWORD v = val;
DWORD type = REG_DWORD;
DWORD typesize = sizeof(v);
if ( RegQueryValueEx( regkey, keyW.c_str(), NULL, &type, (BYTE *)&v, &typesize ) == ERROR_SUCCESS )
{
val = v;
}
RegCloseKey( regkey );
regkey = HKEY();
}
}
virtual void write_setting( const std::string & /* key */, const std::wstring & keyW, int val ) {
HKEY regkey = HKEY();
if ( RegCreateKeyEx( HKEY_CURRENT_USER, ( L"Software\\libopenmpt\\" + subkey ).c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &regkey, NULL ) == ERROR_SUCCESS ) {
DWORD v = val;
DWORD type = REG_DWORD;
DWORD typesize = sizeof(v);
if ( RegSetValueEx( regkey, keyW.c_str(), NULL, type, (const BYTE *)&v, typesize ) == ERROR_SUCCESS )
{
// ok
}
RegCloseKey( regkey );
regkey = HKEY();
}
}
public:
settings( const std::wstring & subkey, bool no_default_format )
: subkey(subkey)
{
libopenmpt_settings::no_default_format = no_default_format;
samplerate = 48000;
channels = 2;
mastergain_millibel = 0;
stereoseparation = 100;
repeatcount = 0;
interpolationfilterlength = 8;
use_amiga_resampler = 0;
amiga_filter_type = 0;
ramping = -1;
vis_allow_scroll = 1;
changed = 0;
}
void load()
{
#define read_setting(a,b,c) read_setting( b , L ## b , c)
read_setting( subkey, "Samplerate_Hz", samplerate );
read_setting( subkey, "Channels", channels );
read_setting( subkey, "MasterGain_milliBel", mastergain_millibel );
read_setting( subkey, "StereoSeparation_Percent", stereoseparation );
read_setting( subkey, "RepeatCount", repeatcount );
read_setting( subkey, "InterpolationFilterLength", interpolationfilterlength );
read_setting( subkey, "UseAmigaResampler", use_amiga_resampler );
read_setting( subkey, "AmigaFilterType", amiga_filter_type );
read_setting( subkey, "VolumeRampingStrength", ramping );
read_setting( subkey, "VisAllowScroll", vis_allow_scroll );
#undef read_setting
}
void save()
{
#define write_setting(a,b,c) write_setting( b , L ## b , c)
write_setting( subkey, "Samplerate_Hz", samplerate );
write_setting( subkey, "Channels", channels );
write_setting( subkey, "MasterGain_milliBel", mastergain_millibel );
write_setting( subkey, "StereoSeparation_Percent", stereoseparation );
write_setting( subkey, "RepeatCount", repeatcount );
write_setting( subkey, "InterpolationFilterLength", interpolationfilterlength );
write_setting( subkey, "UseAmigaResampler", use_amiga_resampler );
write_setting( subkey, "AmigaFilterType", amiga_filter_type );
write_setting( subkey, "VolumeRampingStrength", ramping );
write_setting( subkey, "VisAllowScroll", vis_allow_scroll );
#undef write_setting
}
virtual ~settings()
{
return;
}
};
} // namespace plugin
} // namespace libopenmpt
#endif // LIBOPENMPT_PLUGIN_SETTINGS_HPP

View File

@ -0,0 +1,198 @@
/*
* libopenmpt_stream_callbacks_buffer.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_STREAM_CALLBACKS_BUFFER_H
#define LIBOPENMPT_STREAM_CALLBACKS_BUFFER_H
#include "libopenmpt.h"
/* The use of this header requires:
#include <libopenmpt/libopenmpt.h>
#if defined( LIBOPENMPT_STREAM_CALLBACKS_BUFFER )
#include <libopenmpt/libopenmpt_stream_callbacks_buffer.h>
#else
#error "libopenmpt too old."
#endif
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
/*! \addtogroup libopenmpt_c
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef struct openmpt_stream_buffer {
const void * file_data; /* or prefix data IFF prefix_size < file_size */
int64_t file_size;
int64_t file_pos;
int64_t prefix_size;
int overflow;
} openmpt_stream_buffer;
static size_t openmpt_stream_buffer_read_func( void * stream, void * dst, size_t bytes ) {
openmpt_stream_buffer * s = (openmpt_stream_buffer*)stream;
int64_t offset = 0;
int64_t begpos = 0;
int64_t endpos = 0;
size_t valid_bytes = 0;
if ( !s ) {
return 0;
}
offset = bytes;
begpos = s->file_pos;
endpos = s->file_pos;
valid_bytes = 0;
endpos = (uint64_t)endpos + (uint64_t)offset;
if ( ( offset > 0 ) && !( (uint64_t)endpos > (uint64_t)begpos ) ) {
/* integer wrapped */
return 0;
}
if ( bytes == 0 ) {
return 0;
}
if ( begpos >= s->file_size ) {
return 0;
}
if ( endpos > s->file_size ) {
/* clip to eof */
bytes = bytes - (size_t)( endpos - s->file_size );
endpos = endpos - ( endpos - s->file_size );
}
memset( dst, 0, bytes );
if ( begpos >= s->prefix_size ) {
s->overflow = 1;
valid_bytes = 0;
} else if ( endpos > s->prefix_size ) {
s->overflow = 1;
valid_bytes = bytes - (size_t)( endpos - s->prefix_size );
} else {
valid_bytes = bytes;
}
memcpy( dst, (const char*)s->file_data + s->file_pos, valid_bytes );
s->file_pos = s->file_pos + bytes;
return bytes;
}
static int openmpt_stream_buffer_seek_func( void * stream, int64_t offset, int whence ) {
openmpt_stream_buffer * s = (openmpt_stream_buffer*)stream;
int result = -1;
if ( !s ) {
return -1;
}
switch ( whence ) {
case OPENMPT_STREAM_SEEK_SET:
if ( offset < 0 ) {
return -1;
}
if ( offset > s->file_size ) {
return -1;
}
s->file_pos = offset;
result = 0;
break;
case OPENMPT_STREAM_SEEK_CUR:
do {
int64_t oldpos = s->file_pos;
int64_t pos = s->file_pos;
pos = (uint64_t)pos + (uint64_t)offset;
if ( ( offset > 0 ) && !( (uint64_t)pos > (uint64_t)oldpos ) ) {
/* integer wrapped */
return -1;
}
if ( ( offset < 0 ) && !( (uint64_t)pos < (uint64_t)oldpos ) ) {
/* integer wrapped */
return -1;
}
s->file_pos = pos;
} while(0);
result = 0;
break;
case OPENMPT_STREAM_SEEK_END:
if ( offset > 0 ) {
return -1;
}
do {
int64_t oldpos = s->file_pos;
int64_t pos = s->file_pos;
pos = s->file_size;
pos = (uint64_t)pos + (uint64_t)offset;
if ( ( offset < 0 ) && !( (uint64_t)pos < (uint64_t)oldpos ) ) {
/* integer wrapped */
return -1;
}
s->file_pos = pos;
} while(0);
result = 0;
break;
}
return result;
}
static int64_t openmpt_stream_buffer_tell_func( void * stream ) {
openmpt_stream_buffer * s = (openmpt_stream_buffer*)stream;
if ( !s ) {
return -1;
}
return s->file_pos;
}
static void openmpt_stream_buffer_init( openmpt_stream_buffer * buffer, const void * file_data, int64_t file_size ) {
memset( buffer, 0, sizeof( openmpt_stream_buffer ) );
buffer->file_data = file_data;
buffer->file_size = file_size;
buffer->file_pos = 0;
buffer->prefix_size = file_size;
buffer->overflow = 0;
}
#define openmpt_stream_buffer_init_prefix_only( buffer_, prefix_data_, prefix_size_, file_size_ ) do { \
openmpt_stream_buffer_init( (buffer_), (prefix_data_), (file_size_) ); \
(buffer_)->prefix_size = (prefix_size_); \
} while(0)
#define openmpt_stream_buffer_overflowed( buffer_ ) ( (buffer_)->overflow )
/*! \brief Provide openmpt_stream_callbacks for in-memoy buffers
*
* Fills openmpt_stream_callbacks suitable for passing an in-memory buffer as a stream parameter to functions doing file input/output.
*
* \remarks The stream argument must be passed as `(void*)(openmpt_stream_buffer*)stream_buffer`.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
* \sa openmpt_could_open_probability2
* \sa openmpt_probe_file_header_from_stream
* \sa openmpt_module_create2
*/
static openmpt_stream_callbacks openmpt_stream_get_buffer_callbacks(void) {
openmpt_stream_callbacks retval;
memset( &retval, 0, sizeof( openmpt_stream_callbacks ) );
retval.read = openmpt_stream_buffer_read_func;
retval.seek = openmpt_stream_buffer_seek_func;
retval.tell = openmpt_stream_buffer_tell_func;
return retval;
}
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_STREAM_CALLBACKS_BUFFER_H */

View File

@ -0,0 +1,101 @@
/*
* libopenmpt_stream_callbacks_fd.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_STREAM_CALLBACKS_FD_H
#define LIBOPENMPT_STREAM_CALLBACKS_FD_H
#include "libopenmpt.h"
#ifdef _MSC_VER
#include <io.h>
#endif
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
/*! \addtogroup libopenmpt_c
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/* This stuff has to be in a header file because of possibly different MSVC CRTs which cause problems for fd crossing CRT boundaries. */
static size_t openmpt_stream_fd_read_func( void * stream, void * dst, size_t bytes ) {
int fd = 0;
#if defined(_MSC_VER)
size_t retval = 0;
int to_read = 0;
int ret_read = 0;
#else
ssize_t retval = 0;
#endif
fd = (int)(uintptr_t)stream;
if ( fd < 0 ) {
return 0;
}
#if defined(_MSC_VER)
retval = 0;
while ( bytes > 0 ) {
to_read = 0;
if ( bytes < (size_t)INT_MAX ) {
to_read = (int)bytes;
} else {
to_read = INT_MAX;
}
ret_read = _read( fd, dst, to_read );
if ( ret_read <= 0 ) {
return retval;
}
bytes -= ret_read;
retval += ret_read;
}
#else
retval = read( fd, dst, bytes );
#endif
if ( retval <= 0 ) {
return 0;
}
return retval;
}
/*! \brief Provide openmpt_stream_callbacks for standard POSIX file descriptors
*
* Fills openmpt_stream_callbacks suitable for passing a POSIX filer descriptor as a stream parameter to functions doing file input/output.
*
* \remarks The stream argument must be passed as `(void*)(uintptr_t)(int)fd`.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
* \sa openmpt_could_open_probability2
* \sa openmpt_probe_file_header_from_stream
* \sa openmpt_module_create2
*/
static openmpt_stream_callbacks openmpt_stream_get_fd_callbacks(void) {
openmpt_stream_callbacks retval;
memset( &retval, 0, sizeof( openmpt_stream_callbacks ) );
retval.read = openmpt_stream_fd_read_func;
return retval;
}
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_STREAM_CALLBACKS_FD_H */

View File

@ -0,0 +1,132 @@
/*
* libopenmpt_stream_callbacks_file.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_STREAM_CALLBACKS_FILE_H
#define LIBOPENMPT_STREAM_CALLBACKS_FILE_H
#include "libopenmpt.h"
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#ifdef _MSC_VER
#include <wchar.h> /* off_t */
#endif
/*! \addtogroup libopenmpt_c
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/* This stuff has to be in a header file because of possibly different MSVC CRTs which cause problems for FILE * crossing CRT boundaries. */
static size_t openmpt_stream_file_read_func( void * stream, void * dst, size_t bytes ) {
FILE * f = 0;
size_t retval = 0;
f = (FILE*)stream;
if ( !f ) {
return 0;
}
retval = fread( dst, 1, bytes, f );
if ( retval <= 0 ) {
return 0;
}
return retval;
}
static int openmpt_stream_file_seek_func( void * stream, int64_t offset, int whence ) {
FILE * f = 0;
int fwhence = 0;
f = (FILE*)stream;
if ( !f ) {
return -1;
}
switch ( whence ) {
#if defined(SEEK_SET)
case OPENMPT_STREAM_SEEK_SET:
fwhence = SEEK_SET;
break;
#endif
#if defined(SEEK_CUR)
case OPENMPT_STREAM_SEEK_CUR:
fwhence = SEEK_CUR;
break;
#endif
#if defined(SEEK_END)
case OPENMPT_STREAM_SEEK_END:
fwhence = SEEK_END;
break;
#endif
default:
return -1;
break;
}
#if defined(_MSC_VER)
return _fseeki64( f, offset, fwhence ) ? -1 : 0;
#elif defined(_POSIX_SOURCE) && (_POSIX_SOURCE == 1)
return fseeko( f, offset, fwhence ) ? -1 : 0;
#else
return fseek( f, offset, fwhence ) ? -1 : 0;
#endif
}
static int64_t openmpt_stream_file_tell_func( void * stream ) {
FILE * f = 0;
int64_t retval = 0;
f = (FILE*)stream;
if ( !f ) {
return -1;
}
#if defined(_MSC_VER)
retval = _ftelli64( f );
#elif defined(_POSIX_SOURCE) && (_POSIX_SOURCE == 1)
retval = ftello( f );
#else
retval = ftell( f );
#endif
if ( retval < 0 ) {
return -1;
}
return retval;
}
/*! \brief Provide openmpt_stream_callbacks for standard C FILE objects
*
* Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output.
*
* \remarks The stream argument must be passed as `(void*)(FILE*)file`.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
* \sa openmpt_could_open_probability2
* \sa openmpt_probe_file_header_from_stream
* \sa openmpt_module_create2
*/
static openmpt_stream_callbacks openmpt_stream_get_file_callbacks(void) {
openmpt_stream_callbacks retval;
memset( &retval, 0, sizeof( openmpt_stream_callbacks ) );
retval.read = openmpt_stream_file_read_func;
retval.seek = openmpt_stream_file_seek_func;
retval.tell = openmpt_stream_file_tell_func;
return retval;
}
#ifdef __cplusplus
}
#endif
/*!
* @}
*/
#endif /* LIBOPENMPT_STREAM_CALLBACKS_FILE_H */

View File

@ -0,0 +1,75 @@
/*
* libopenmpt_version.h
* --------------------
* Purpose: libopenmpt public interface version
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_VERSION_H
#define LIBOPENMPT_VERSION_H
/*! \addtogroup libopenmpt
@{
*/
/*! \brief libopenmpt major version number */
#define OPENMPT_API_VERSION_MAJOR 0
/*! \brief libopenmpt minor version number */
#define OPENMPT_API_VERSION_MINOR 5
/*! \brief libopenmpt patch version number */
#define OPENMPT_API_VERSION_PATCH 18
/*! \brief libopenmpt pre-release tag */
#define OPENMPT_API_VERSION_PREREL ""
/*! \brief libopenmpt pre-release flag */
#define OPENMPT_API_VERSION_IS_PREREL 0
/*! \brief libopenmpt version number as a single integer value
* \since 0.3
* \remarks Use the following shim if you need to support earlier libopenmpt versions:
* \code
* #include <libopenmpt/libopenmpt_version.h>
* #if !defined(OPENMPT_API_VERSION_MAKE)
* #define OPENMPT_API_VERSION_MAKE(major, minor, patch) (((major)<<24)|((minor)<<16)|((patch)<<0))
* #endif
* \endcode
*/
#define OPENMPT_API_VERSION_MAKE(major, minor, patch) (((major)<<24)|((minor)<<16)|((patch)<<0))
/*! \brief libopenmpt API version number */
#define OPENMPT_API_VERSION OPENMPT_API_VERSION_MAKE(OPENMPT_API_VERSION_MAJOR, OPENMPT_API_VERSION_MINOR, OPENMPT_API_VERSION_PATCH)
/*! \brief Check whether the libopenmpt API is at least the provided version
* \since 0.3
* \remarks Use the following shim if you need to support earlier libopenmpt versions:
* \code
* #include <libopenmpt/libopenmpt_version.h>
* #if !defined(OPENMPT_API_VERSION_AT_LEAST)
* #define OPENMPT_API_VERSION_AT_LEAST(major, minor, patch) (OPENMPT_API_VERSION >= OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
* #endif
* \endcode
*/
#define OPENMPT_API_VERSION_AT_LEAST(major, minor, patch) (OPENMPT_API_VERSION >= OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
/*! \brief Check whether the libopenmpt API is before the provided version
* \since 0.3
* \remarks Use the following shim if you need to support earlier libopenmpt versions:
* \code
* #include <libopenmpt/libopenmpt_version.h>
* #if !defined(OPENMPT_API_VERSION_BEFORE)
* #define OPENMPT_API_VERSION_BEFORE(major, minor, patch) (OPENMPT_API_VERSION < OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
* #endif
* \endcode
*/
#define OPENMPT_API_VERSION_BEFORE(major, minor, patch) (OPENMPT_API_VERSION < OPENMPT_API_VERSION_MAKE((major), (minor), (patch)))
#define OPENMPT_API_VERSION_HELPER_STRINGIZE(x) #x
#define OPENMPT_API_VERSION_STRINGIZE(x) OPENMPT_API_VERSION_HELPER_STRINGIZE(x)
#define OPENMPT_API_VERSION_STRING OPENMPT_API_VERSION_STRINGIZE(OPENMPT_API_VERSION_MAJOR) "." OPENMPT_API_VERSION_STRINGIZE(OPENMPT_API_VERSION_MINOR) "." OPENMPT_API_VERSION_STRINGIZE(OPENMPT_API_VERSION_PATCH) OPENMPT_API_VERSION_PREREL
/*!
@}
*/
#endif /* LIBOPENMPT_VERSION_H */

View File

@ -0,0 +1,27 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by libopenmpt_plugin_gui.rc
//
#define IDD_SETTINGS 101
#define IDD_FILEINFO 102
#define IDC_COMBO_SAMPLERATE 1001
#define IDC_COMBO_CHANNELS 1002
#define IDC_SLIDER_GAIN 1003
#define IDC_COMBO_INTERPOLATION 1004
#define IDC_COMBO_REPEAT 1005
#define IDC_SLIDER_STEREOSEPARATION 1006
#define IDC_COMBO_RAMPING 1007
#define IDC_FILEINFO 1008
#define IDC_COMBO_AMIGA_FILTER 1008
#define IDC_CHECK_AMIGA_RESAMPLER 1009
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

15
ThirdParty/mpg123/README.md vendored Normal file
View File

@ -0,0 +1,15 @@
Built from the latest version indicated by Homebrew, 1.29.3, using the
following commands:
```
for arch in x86_64 arm64; do
env CFLAGS="-g -Os -mmacosx-version-min=10.13 -arch $arch" CXXFLAGS="-g -Os -mmacosx-version-min=10.13 -arch $arch" LDFLAGS="-mmacosx-version-min=10.13 -arch $arch" ./configure
make -j8
cp src/libmpg123/.libs/libmpg123.0.dylib ./libmpg123.0_$arch.dylib
make clean
done
lipo -create -output libmpg123.0.dylib libmpg123.0_x86_64.dylib libmpg123.0_arm64.dylib
install_name_tool -id @rpath/libmpg123.0.dylib libmpg123.0.dylib
```

View File

@ -1,10 +1,14 @@
/*
mpg123lib_intern: Common non-public stuff for libmpg123
abi_align: An attempt to avoid breakage because of mixing
compilers with different alignment.
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
copyright 1995-2015 by the mpg123 project
free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
derived from the old mpg123.h
There used to be code that checks alignment, but it did not really
work anyway. The only straw we have is putting that alignment
attribute to API functions.
*/
#ifndef MPG123_H_ABI_ALIGN
@ -13,27 +17,25 @@
#include "config.h"
/* ABI conformance for other compilers.
mpg123 needs 16byte-aligned stack for SSE and friends.
mpg123 needs 16byte-aligned (or more) stack for SSE and friends.
gcc provides that, but others don't necessarily. */
#ifdef ABI_ALIGN_FUN
#ifndef attribute_align_arg
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
# define attribute_align_arg __attribute__((force_align_arg_pointer))
/* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */
#else
# define attribute_align_arg
/* Other compilers get code to catch misaligned stack.
Well, except Sun Studio, which accepts the aligned attribute but does not honor it. */
#if !defined(__SUNPRO_C)
# define NEED_ALIGNCHECK
#endif
#endif
#endif
#else
#endif /* attribute_align_arg */
#else /* ABI_ALIGN_FUN */
#define attribute_align_arg
/* We won't try the align check... */
#endif
#endif
#endif /* ABI_ALIGN_FUN */
#endif /* MPG123_H_ABI_ALIGN */

View File

@ -0,0 +1,81 @@
// cos MPEG decoding tables
// output of:
// src/libmpg123/calctables cos
#if defined(RUNTIME_TABLES)
#ifdef REAL_IS_FLOAT
// aligned to 16 bytes for vector instructions, e.g. AltiVec
static ALIGNED(16) real cos64[16];
static ALIGNED(16) real cos32[8];
static ALIGNED(16) real cos16[4];
static ALIGNED(16) real cos8[2];
static ALIGNED(16) real cos4[1];
#endif
#else
#ifdef REAL_IS_FLOAT
// aligned to 16 bytes for vector instructions, e.g. AltiVec
static const ALIGNED(16) real cos64[16] =
{
5.00602998e-01, 5.05470960e-01, 5.15447310e-01, 5.31042591e-01
, 5.53103896e-01, 5.82934968e-01, 6.22504123e-01, 6.74808341e-01
, 7.44536271e-01, 8.39349645e-01, 9.72568238e-01, 1.16943993e+00
, 1.48416462e+00, 2.05778101e+00, 3.40760842e+00, 1.01900081e+01
};
static const ALIGNED(16) real cos32[8] =
{
5.02419286e-01, 5.22498615e-01, 5.66944035e-01, 6.46821783e-01
, 7.88154623e-01, 1.06067769e+00, 1.72244710e+00, 5.10114862e+00
};
static const ALIGNED(16) real cos16[4] =
{
5.09795579e-01, 6.01344887e-01, 8.99976223e-01, 2.56291545e+00
};
static const ALIGNED(16) real cos8[2] =
{
5.41196100e-01, 1.30656296e+00
};
static const ALIGNED(16) real cos4[1] =
{
7.07106781e-01
};
#endif
#ifdef REAL_IS_FIXED
static const real cos64[16] =
{
8398725, 8480395, 8647771, 8909416
, 9279544, 9780026, 10443886, 11321405
, 12491246, 14081950, 16316987, 19619946
, 24900150, 34523836, 57170182, 170959967
};
static const real cos32[8] =
{
8429197, 8766072, 9511743, 10851869
, 13223040, 17795219, 28897867, 85583072
};
static const real cos16[4] =
{
8552951, 10088893, 15099095, 42998586
};
static const real cos8[2] =
{
9079764, 21920489
};
static const real cos4[1] =
{
11863283
};
#endif
#endif

View File

@ -0,0 +1,132 @@
/*
Some macros for printing debugging/warning/error messages with location info.
public domain (or LGPL / GPL, if you like that more;-)
generated by debugdef.pl, what was
trivially written by Thomas Orgis <thomas@orgis.org>
You decide to define DEBUG or not and write debug("foo") or
mdebug("foo: %s", message) and variants with more arguments and this
is converted to an elaborate call to fprintf(stderr, ...) that prints your
message with a line end attached and with information on where the call
occured.
*/
#include "config.h"
#ifdef ME
#define DBGPRFX ME": "
#else
#define DBGPRFX ""
#endif
#define noop ((void)0)
#ifdef XDEBUG
#define mxdebug(s, ...) mdebug(s, __VA_ARGS__)
#define xdebug(s) debug(s)
#else
#define mxdebug(s, ...) noop
#define xdebug(s) noop
#endif
// Used for debugging and warning messages.
#include <stdio.h>
#define debug_print(t, s, ...) fprintf(stderr, DBGPRFX "[" __FILE__ ":%s():%i] " t ": " s "\n", __func__, __LINE__, __VA_ARGS__)
#ifdef DEBUG
#define mdebug(s, ...) debug_print("debug", s, __VA_ARGS__)
#else
#define mdebug(s, ...) noop
#endif
#define debug(s) mdebug("%s", s)
// Print warning message.
#ifndef NO_WARNING
#define mwarning(s, ...) debug_print("warning", s, __VA_ARGS__)
#else
#define mwarning(s, ...)
#endif
#define warning(s) mwarning("%s", s)
// Print error message.
#ifndef NO_ERRORMSG
#define merror(s, ...) debug_print("error", s, __VA_ARGS__)
#else
#define merror(s, ...) noop
#endif
#define error(s) merror("%s", s)
// Print error message and return given value.
#ifndef NO_ERETURN
#define mereturn(rv, s, ...) do{ debug_print("ereturn", s, __VA_ARGS__); return rv; } while (0)
#else
#define mereturn(rv, s, ...) return rv
#endif
#define ereturn(rv, s) mereturn(rv, "%s", s)
// For old code that had to hardcode the argument number.
#define debug1(s, a) mdebug(s,a)
#define debug2(s, a, b) mdebug(s, a, b)
#define debug3(s, a, b, c) mdebug(s, a, b, c)
#define debug4(s, a, b, c, d) mdebug(s, a, b, c, d)
#define debug5(s, a, b, c, d, e) mdebug(s, a, b, c, d, e)
#define debug6(s, a, b, c, d, e, f) mdebug(s, a, b, c, d, e, f)
#define debug7(s, a, b, c, d, e, f, g) mdebug(s, a, b, c, d, e, f, g)
#define debug8(s, a, b, c, d, e, f, g, h) mdebug(s, a, b, c, d, e, f, g, h)
#define debug9(s, a, b, c, d, e, f, g, h, i) mdebug(s, a, b, c, d, e, f, g, h, i)
#define debug10(s, a, b, c, d, e, f, g, h, i, j) mdebug(s, a, b, c, d, e, f, g, h, i, j)
#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) mdebug(s, a, b, c, d, e, f, g, h, i, j, k)
#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l)
#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#define warning1(s, a) mwarning(s, a)
#define warning2(s, a, b) mwarning(s, a, b)
#define warning3(s, a, b, c) mwarning(s, a, b, c)
#define warning4(s, a, b, c, d) mwarning(s, a, b, c, d)
#define warning5(s, a, b, c, d, e) mwarning(s, a, b, c, d, e)
#define warning6(s, a, b, c, d, e, f) mwarning(s, a, b, c, d, e, f)
#define warning7(s, a, b, c, d, e, f, g) mwarning(s, a, b, c, d, e, f, g)
#define warning8(s, a, b, c, d, e, f, g, h) mwarning(s, a, b, c, d, e, f, g, h)
#define warning9(s, a, b, c, d, e, f, g, h, i) mwarning(s, a, b, c, d, e, f, g, h, i)
#define warning10(s, a, b, c, d, e, f, g, h, i, j) mwarning(s, a, b, c, d, e, f, g, h, i, j)
#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) mwarning(s, a, b, c, d, e, f, g, h, i, j, k)
#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l)
#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#define error1(s, a) merror(s, a)
#define error2(s, a, b) merror(s, a, b)
#define error3(s, a, b, c) merror(s, a, b, c)
#define error4(s, a, b, c, d) merror(s, a, b, c, d)
#define error5(s, a, b, c, d, e) merror(s, a, b, c, d, e)
#define error6(s, a, b, c, d, e, f) merror(s, a, b, c, d, e, f)
#define error7(s, a, b, c, d, e, f, g) merror(s, a, b, c, d, e, f, g)
#define error8(s, a, b, c, d, e, f, g, h) merror(s, a, b, c, d, e, f, g, h)
#define error9(s, a, b, c, d, e, f, g, h, i) merror(s, a, b, c, d, e, f, g, h, i)
#define error10(s, a, b, c, d, e, f, g, h, i, j) merror(s, a, b, c, d, e, f, g, h, i, j)
#define error11(s, a, b, c, d, e, f, g, h, i, j, k) merror(s, a, b, c, d, e, f, g, h, i, j, k)
#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) merror(s, a, b, c, d, e, f, g, h, i, j, k, l)
#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
#define ereturn1(rv, s, a) mereturn(rv, s, a)
#define ereturn2(rv, s, a, b) mereturn(rv, s, a, b)
#define ereturn3(rv, s, a, b, c) mereturn(rv, s, a, b, c)
#define ereturn4(rv, s, a, b, c, d) mereturn(rv, s, a, b, c, d)
#define ereturn5(rv, s, a, b, c, d, e) mereturn(rv, s, a, b, c, d, e)
#define ereturn6(rv, s, a, b, c, d, e, f) mereturn(rv, s, a, b, c, d, e, f)
#define ereturn7(rv, s, a, b, c, d, e, f, g) mereturn(rv, s, a, b, c, d, e, f, g)
#define ereturn8(rv, s, a, b, c, d, e, f, g, h) mereturn(rv, s, a, b, c, d, e, f, g, h)
#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) mereturn(rv, s, a, b, c, d, e, f, g, h, i)
#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j)
#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k)
#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l)
#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m)
#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)

View File

@ -58,6 +58,8 @@ int synth_1to1_stereo_avx (real*, real*, mpg123_handle*);
int synth_1to1_arm (real*, int, mpg123_handle*, int);
int synth_1to1_neon (real*, int, mpg123_handle*, int);
int synth_1to1_stereo_neon(real*, real*, mpg123_handle*);
int synth_1to1_neon64 (real*, int, mpg123_handle*, int);
int synth_1to1_stereo_neon64(real*, real*, mpg123_handle*);
/* This is different, special usage in layer3.c only.
Hence, the name... and now forget about it.
Never use it outside that special portion of code inside layer3.c! */
@ -129,11 +131,13 @@ int synth_1to1_real_stereo_sse (real*, real*, mpg123_handle*);
int synth_1to1_real_x86_64 (real*, int, mpg123_handle*, int);
int synth_1to1_real_stereo_x86_64(real*, real*, mpg123_handle*);
int synth_1to1_real_avx (real*, int, mpg123_handle*, int);
int synth_1to1_real_stereo_avx (real*, real*, mpg123_handle*);
int synth_1to1_fltst_avx (real*, real*, mpg123_handle*);
int synth_1to1_real_altivec (real*, int, mpg123_handle*, int);
int synth_1to1_real_stereo_altivec(real*, real*, mpg123_handle*);
int synth_1to1_fltst_altivec(real*, real*, mpg123_handle*);
int synth_1to1_real_neon (real*, int, mpg123_handle*, int);
int synth_1to1_real_stereo_neon(real*, real*, mpg123_handle*);
int synth_1to1_real_neon64 (real*, int, mpg123_handle*, int);
int synth_1to1_fltst_neon64(real*, real*, mpg123_handle*);
int synth_1to1_real_mono (real*, mpg123_handle*);
int synth_1to1_real_m2s(real*, mpg123_handle*);
#ifndef NO_DOWNSAMPLE
@ -167,6 +171,8 @@ int synth_1to1_s32_altivec (real*, int, mpg123_handle*, int);
int synth_1to1_s32_stereo_altivec(real*, real*, mpg123_handle*);
int synth_1to1_s32_neon (real*, int, mpg123_handle*, int);
int synth_1to1_s32_stereo_neon(real*, real*, mpg123_handle*);
int synth_1to1_s32_neon64 (real*, int, mpg123_handle*, int);
int synth_1to1_s32st_neon64(real*, real*, mpg123_handle*);
int synth_1to1_s32_mono (real*, mpg123_handle*);
int synth_1to1_s32_m2s(real*, mpg123_handle*);
#ifndef NO_DOWNSAMPLE
@ -198,12 +204,14 @@ void dct64_altivec(real *,real *,real *);
void dct64_i486(int*, int* , real*); /* Yeah, of no use outside of synth_i486.c .*/
/* This is used by the layer 3 decoder, one generic function and 3DNow variants. */
void dct36 (real *,real *,real *,real *,real *);
void dct36_3dnow (real *,real *,real *,real *,real *);
void dct36_3dnowext(real *,real *,real *,real *,real *);
void dct36_x86_64 (real *,real *,real *,real *,real *);
void dct36_sse (real *,real *,real *,real *,real *);
void dct36_avx (real *,real *,real *,real *,real *);
void dct36 (real *,real *,real *,const real *,real *);
void dct36_3dnow (real *,real *,real *,const real *,real *);
void dct36_3dnowext(real *,real *,real *,const real *,real *);
void dct36_x86_64 (real *,real *,real *,const real *,real *);
void dct36_sse (real *,real *,real *,const real *,real *);
void dct36_avx (real *,real *,real *,const real *,real *);
void dct36_neon (real *,real *,real *,const real *,real *);
void dct36_neon64 (real *,real *,real *,const real *,real *);
/* Tools for NtoM resampling synth, defined in ntom.c . */
int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */
@ -224,19 +232,26 @@ off_t ntom_frameoff(mpg123_handle *fr, off_t soff);
/* Initialization of any static data that majy be needed at runtime.
Make sure you call these once before it is too late. */
#ifndef NO_LAYER3
#ifdef RUNTIME_TABLES
void init_layer3(void);
#endif
real init_layer3_gainpow2(mpg123_handle *fr, int i);
void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i));
#endif
#ifndef NO_LAYER12
#ifdef RUNTIME_TABLES
void init_layer12(void);
#endif
real* init_layer12_table(mpg123_handle *fr, real *table, int m);
void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m));
#endif
void prepare_decode_tables(void);
extern real *pnts[5]; /* tabinit provides, dct64 needs */
#ifdef RUNTIME_TABLES
void init_costabs(void);
#else
const
#endif
extern real *pnts[5]; /* costab.h provides, dct64 needs */
/* Runtime (re)init functions; needed more often. */
void make_decode_tables(mpg123_handle *fr); /* For every volume change. */

View File

@ -0,0 +1,159 @@
/*
libmpg123: MPEG Audio Decoder library
separate header just for audio format definitions not tied to
library code
copyright 1995-2020 by the mpg123 project
free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
*/
#ifndef MPG123_ENC_H
#define MPG123_ENC_H
/** \file fmt123.h Audio format definitions. */
/** \defgroup mpg123_enc mpg123 PCM sample encodings
* These are definitions for audio formats used by libmpg123 and
* libout123.
*
* @{
*/
/** An enum over all sample types possibly known to mpg123.
* The values are designed as bit flags to allow bitmasking for encoding
* families.
* This is also why the enum is not used as type for actual encoding variables,
* plain integers (at least 16 bit, 15 bit being used) cover the possible
* combinations of these flags.
*
* Note that (your build of) libmpg123 does not necessarily support all these.
* Usually, you can expect the 8bit encodings and signed 16 bit.
* Also 32bit float will be usual beginning with mpg123-1.7.0 .
* What you should bear in mind is that (SSE, etc) optimized routines may be
* absent for some formats. We do have SSE for 16, 32 bit and float, though.
* 24 bit integer is done via postprocessing of 32 bit output -- just cutting
* the last byte, no rounding, even. If you want better, do it yourself.
*
* All formats are in native byte order. If you need different endinaness, you
* can simply postprocess the output buffers (libmpg123 wouldn't do anything
* else). The macro MPG123_SAMPLESIZE() can be helpful there.
*/
enum mpg123_enc_enum
{
/* 0000 0000 0000 1111 Some 8 bit integer encoding. */
MPG123_ENC_8 = 0x00f
/* 0000 0000 0100 0000 Some 16 bit integer encoding. */
, MPG123_ENC_16 = 0x040
/* 0100 0000 0000 0000 Some 24 bit integer encoding. */
, MPG123_ENC_24 = 0x4000
/* 0000 0001 0000 0000 Some 32 bit integer encoding. */
, MPG123_ENC_32 = 0x100
/* 0000 0000 1000 0000 Some signed integer encoding. */
, MPG123_ENC_SIGNED = 0x080
/* 0000 1110 0000 0000 Some float encoding. */
, MPG123_ENC_FLOAT = 0xe00
/* 0000 0000 1101 0000 signed 16 bit */
, MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10)
/* 0000 0000 0110 0000 unsigned 16 bit */
, MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20)
/* 0000 0000 0000 0001 unsigned 8 bit */
, MPG123_ENC_UNSIGNED_8 = 0x01
/* 0000 0000 1000 0010 signed 8 bit */
, MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02)
/* 0000 0000 0000 0100 ulaw 8 bit */
, MPG123_ENC_ULAW_8 = 0x04
/* 0000 0000 0000 1000 alaw 8 bit */
, MPG123_ENC_ALAW_8 = 0x08
/* 0001 0001 1000 0000 signed 32 bit */
, MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000
/* 0010 0001 0000 0000 unsigned 32 bit */
, MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000
/* 0101 0000 1000 0000 signed 24 bit */
, MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000
/* 0110 0000 0000 0000 unsigned 24 bit */
, MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000
/* 0000 0010 0000 0000 32bit float */
, MPG123_ENC_FLOAT_32 = 0x200
/* 0000 0100 0000 0000 64bit float */
, MPG123_ENC_FLOAT_64 = 0x400
/* Any possibly known encoding from the list above. */
, MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16
| MPG123_ENC_UNSIGNED_8 | MPG123_ENC_SIGNED_8
| MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8
| MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32
| MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24
| MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 )
};
/** Get size of one PCM sample with given encoding.
* This is included both in libmpg123 and libout123. Both offer
* an API function to provide the macro results from library
* compile-time, not that of you application. This most likely
* does not matter as I do not expect any fresh PCM sample
* encoding to appear. But who knows? Perhaps the encoding type
* will be abused for funny things in future, not even plain PCM.
* And, by the way: Thomas really likes the ?: operator.
* \param enc the encoding (mpg123_enc_enum value)
* \return size of one sample in bytes
*/
#define MPG123_SAMPLESIZE(enc) ( \
(enc) < 1 \
? 0 \
: ( (enc) & MPG123_ENC_8 \
? 1 \
: ( (enc) & MPG123_ENC_16 \
? 2 \
: ( (enc) & MPG123_ENC_24 \
? 3 \
: ( ( (enc) & MPG123_ENC_32 \
|| (enc) == MPG123_ENC_FLOAT_32 ) \
? 4 \
: ( (enc) == MPG123_ENC_FLOAT_64 \
? 8 \
: 0 \
) ) ) ) ) )
/** Representation of zero in differing encodings.
* This exists to define proper silence in various encodings without
* having to link to libsyn123 to do actual conversions at runtime.
* You have to handle big/little endian order yourself, though.
* This takes the shortcut that any signed encoding has a zero with
* all-zero bits. Unsigned linear encodings just have the highest bit set
* (2^(n-1) for n bits), while the nonlinear 8-bit ones are special.
* \param enc the encoding (mpg123_enc_enum value)
* \param siz bytes per sample (return value of MPG123_SAMPLESIZE(enc))
* \param off byte (octet) offset counted from LSB
* \return unsigned byte value for the designated octet
*/
#define MPG123_ZEROSAMPLE(enc, siz, off) ( \
(enc) == MPG123_ENC_ULAW_8 \
? (off == 0 ? 0xff : 0x00) \
: ( (enc) == MPG123_ENC_ALAW_8 \
? (off == 0 ? 0xd5 : 0x00) \
: ( (((enc) & (MPG123_ENC_SIGNED|MPG123_ENC_FLOAT)) || (siz) != ((off)+1)) \
? 0x00 \
: 0x80 \
) ) )
/** Structure defining an audio format.
* Providing the members as individual function arguments to define a certain
* output format is easy enough. This struct makes is more comfortable to deal
* with a list of formats.
* Negative values for the members might be used to communicate use of default
* values.
*/
struct mpg123_fmt
{
long rate; /**< sampling rate in Hz */
int channels; /**< channel count */
/** encoding code, can be single value or bitwise or of members of
* mpg123_enc_enum */
int encoding;
};
/** @} */
#endif

View File

@ -13,6 +13,7 @@
#include "config.h"
#include "mpg123.h"
#include "optimize.h"
#include "getcpuflags.h"
#include "id3.h"
#include "icy.h"
#include "reader.h"
@ -47,8 +48,10 @@ struct outbuffer
struct audioformat
{
int encoding;
int encoding; /* Final encoding, after post-processing. */
int encsize; /* Size of one sample in bytes, plain int should be fine here... */
int dec_enc; /* Encoding of decoder synth. */
int dec_encsize; /* Size of one decoder sample. */
int channels;
long rate;
};
@ -82,12 +85,15 @@ struct mpg123_pars_struct
long feedpool;
long feedbuffer;
#endif
long freeformat_framesize;
};
enum frame_state_flags
{
FRAME_ACCURATE = 0x1 /**< 0001 Positions are considered accurate. */
,FRAME_FRANKENSTEIN = 0x2 /**< 0010 This stream is concatenated. */
,FRAME_FRESH_DECODER = 0x4 /**< 0100 Decoder is fleshly initialized. */
,FRAME_DECODER_LIVE = 0x8 /**< 1000 Decoder can be used. */
};
/* There is a lot to condense here... many ints can be merged as flags; though the main space is still consumed by buffers. */
@ -118,9 +124,10 @@ struct mpg123_handle_struct
float *decwin_mmx;
float *decwins;
#endif
#ifndef NO_EQUALIZER
int have_eq_settings;
real equalizer[2][32];
#endif
/* for halfspeed mode */
unsigned char ssave[34];
int halfphase;
@ -134,8 +141,11 @@ struct mpg123_handle_struct
/* layer3 */
int longLimit[9][23];
int shortLimit[9][14];
#ifdef REAL_IS_FIXED
const real *gainpow2; // Actually static storage elsewhere.
#else
real gainpow2[256+118+4]; /* not really dynamic, just different for mmx */
#endif
/* layer2 */
real muls[27][64]; /* also used by layer 1 */
@ -158,16 +168,18 @@ struct mpg123_handle_struct
#ifdef OPT_MULTI
#ifndef NO_LAYER3
#if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX)
void (*the_dct36)(real *,real *,real *,real *,real *);
#if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX || defined OPT_NEON || defined OPT_NEON64)
void (*the_dct36)(real *,real *,real *,const real *,real *);
#endif
#endif
#endif
enum optdec type;
//enum optcla class;
enum optcla class;
} cpu_opts;
#ifdef OPT_CPU_FLAGS
struct cpuflags cpu_flags;
#endif
int verbose; /* 0: nothing, 1: just print chosen decoder, 2: be verbose */
const struct al_table *alloc;
@ -193,6 +205,7 @@ struct mpg123_handle_struct
int down_sample;
int header_change;
int lay;
long spf; /* cached count of samples per frame */
int (*do_layer)(mpg123_handle *);
int error_protection;
int bitrate_index;
@ -219,6 +232,7 @@ struct mpg123_handle_struct
/* bitstream info; bsi */
int bitindex;
long bits_avail;
unsigned char *wordpointer;
/* temporary storage for getbits stuff */
unsigned long ultmp;
@ -243,7 +257,7 @@ struct mpg123_handle_struct
int fsizeold;
int ssize;
unsigned int bitreservoir;
unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */
unsigned char bsspace[2][MAXFRAMESIZE+512+4]; /* MAXFRAMESIZE */
unsigned char *bsbuf;
unsigned char *bsbufold;
int bsnum;
@ -290,6 +304,8 @@ struct mpg123_handle_struct
#ifndef NO_ID3V2
mpg123_id3v2 id3v2;
#endif
unsigned char *id3v2_raw;
size_t id3v2_size;
#ifndef NO_ICY
struct icy_meta icy;
#endif
@ -328,6 +344,11 @@ struct mpg123_handle_struct
void *wrapperdata;
/* A callback used to properly destruct the wrapper data. */
void (*wrapperclean)(void*);
int enc_delay;
int enc_padding;
#ifndef NO_MOREINFO
struct mpg123_moreinfo *pinfo;
#endif
};
/* generic init, does not include dynamic buffers */
@ -370,11 +391,11 @@ MPEG 2.5
1152
576
*/
#define spf(fr) ((fr)->lay == 1 ? 384 : ((fr)->lay==2 ? 1152 : ((fr)->lsf || (fr)->mpeg25 ? 576 : 1152)))
#ifdef GAPLESS
/* well, I take that one for granted... at least layer3 */
// Well, I take that one for granted... at least layer3.
// The value is needed for mpg123_getstate() in any build.
#define GAPLESS_DELAY 529
#ifdef GAPLESS
void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip);
void frame_gapless_realinit(mpg123_handle *fr);
void frame_gapless_update(mpg123_handle *mh, off_t total_samples);

View File

@ -13,29 +13,21 @@
#define _MPG123_GETBITS_H_
#include "mpg123lib_intern.h"
#include "debug.h"
#define backbits(fr,nob) ((void)( \
fr->bits_avail += nob, \
fr->bitindex -= nob, \
fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 0x7 ))
#define getbitoffset(fr) ((-fr->bitindex)&0x7)
#define getbyte(fr) (*fr->wordpointer++)
/* There is something wrong with that macro... the function below works also for the layer1 test case. */
#define macro_getbits(fr, nob) ( \
fr->ultmp = fr->wordpointer[0],\
fr->ultmp <<= 8, \
fr->ultmp |= fr->wordpointer[1], \
fr->ultmp <<= 8, \
fr->ultmp |= fr->wordpointer[2], \
fr->ultmp <<= fr->bitindex, \
fr->ultmp &= 0xffffff, \
fr->bitindex += nob, \
fr->ultmp >>= (24-nob), \
fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 7, \
fr->ultmp)
/* Precomputing the bytes to be read is error-prone, and some over-read
is even expected for Huffman. Just play safe and return zeros in case
of overflow. This assumes you made bitindex zero already! */
#define getbyte(fr) ( (fr)->bits_avail-=8, (fr)->bits_avail >= 0 \
? *((fr)->wordpointer++) \
: 0 )
static unsigned int getbits(mpg123_handle *fr, int number_of_bits)
{
@ -44,7 +36,16 @@ static unsigned int getbits(mpg123_handle *fr, int number_of_bits)
#ifdef DEBUG_GETBITS
fprintf(stderr,"g%d",number_of_bits);
#endif
fr->bits_avail -= number_of_bits;
/* Safety catch until we got the nasty code fully figured out. */
/* No, that catch stays here, even if we think we got it figured out! */
if(fr->bits_avail < 0)
{
if(NOQUIET)
error2( "Tried to read %i bits with %li available."
, number_of_bits, fr->bits_avail );
return 0;
}
/* This is actually slow: if(!number_of_bits)
return 0; */
@ -74,14 +75,14 @@ fprintf(stderr,"g%d",number_of_bits);
fprintf(stderr,":%lx\n",rval);
#endif
return (unsigned int) rval;
return rval;
}
#define skipbits(fr, nob) fr->ultmp = ( \
fr->ultmp = fr->wordpointer[0], fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[1], \
fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[2], fr->ultmp <<= fr->bitindex, \
fr->ultmp &= 0xffffff, fr->bitindex += nob, \
fr->ultmp &= 0xffffff, fr->bitindex += nob, fr->bits_avail -= nob, \
fr->ultmp >>= (24-nob), fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 7 )
@ -89,11 +90,13 @@ fprintf(stderr,":%lx\n",rval);
fr->ultmp = (unsigned char) (fr->wordpointer[0] << fr->bitindex), \
fr->ultmp |= ((unsigned long) fr->wordpointer[1]<<fr->bitindex)>>8, \
fr->ultmp <<= nob, fr->ultmp >>= 8, \
fr->bitindex += nob, fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex += nob, fr->bits_avail -= nob, \
fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 7, fr->ultmp )
#define get1bit(fr) ( \
fr->uctmp = *fr->wordpointer << fr->bitindex, fr->bitindex++, \
fr->uctmp = *fr->wordpointer << fr->bitindex, \
++fr->bitindex, --fr->bits_avail, \
fr->wordpointer += (fr->bitindex>>3), fr->bitindex &= 7, fr->uctmp>>7 )

View File

@ -10,6 +10,8 @@
#ifndef MPG123_H_GETCPUFLAGS
#define MPG123_H_GETCPUFLAGS
#include "config.h"
/* standard level flags part 1 (ECX)*/
#define FLAG_SSE3 0x00000001
#define FLAG_SSSE3 0x00000200
@ -29,15 +31,35 @@
struct cpuflags
{
#if defined(OPT_ARM) || defined(OPT_NEON) || defined(OPT_NEON64)
unsigned int has_neon;
#else
unsigned int id;
unsigned int std;
unsigned int std2;
unsigned int ext;
unsigned int xcr0_lo;
#endif
};
unsigned int getcpuflags(struct cpuflags* cf);
#ifdef WANT_GETCPUFLAGS
#include <string.h>
// Wrapper needed for ignorant clang memory sanitizer that chokes
// because it does not know the assembly code intialized the vlaues.
static unsigned int wrap_getcpuflags(struct cpuflags* cf)
{
memset(cf, 0, sizeof(*cf));
return getcpuflags(cf);
}
#endif
#if ((defined OPT_X86) || (defined OPT_X86_64) || (defined OPT_NEON) || (defined OPT_NEON64)) && (defined OPT_MULTI)
// We really evaluate the CPU flags.
#define OPT_CPU_FLAGS
/* checks the family */
#define cpu_i586(s) ( ((s.id & 0xf00)>>8) == 0 || ((s.id & 0xf00)>>8) > 4 )
/* checking some flags... */
@ -51,5 +73,25 @@ unsigned int getcpuflags(struct cpuflags* cf);
#define cpu_avx(s) ((FLAG_AVX & s.std) == FLAG_AVX && (XCR0FLAG_AVX & s.xcr0_lo) == XCR0FLAG_AVX)
#define cpu_fast_sse(s) ((((s.id & 0xf00)>>8) == 6 && FLAG_SSSE3 & s.std) /* for Intel/VIA; family 6 CPUs with SSSE3 */ || \
(((s.id & 0xf00)>>8) == 0xf && (((s.id & 0x0ff00000)>>20) > 0 && ((s.id & 0x0ff00000)>>20) != 5))) /* for AMD; family > 0xF CPUs except Bobcat */
#define cpu_neon(s) (s.has_neon)
#else
/* Faking stuff for non-multi builds. The same code for synth function choice is used.
Just no runtime dependency of result... */
#define cpu_flags nothing
#define cpu_i586(s) 1
#define cpu_fpu(s) 1
#define cpu_mmx(s) 1
#define cpu_3dnow(s) 1
#define cpu_3dnowext(s) 1
#define cpu_sse(s) 1
#define cpu_sse2(s) 1
#define cpu_sse3(s) 1
#define cpu_avx(s) 1
#define cpu_neon(s) 1
#endif
#endif

View File

@ -0,0 +1,24 @@
/*
The function to compute the cos tables at runtime or for pregeneration.
copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp (in tabinit.c).
The type clreal is either double or float, COS() is cos() or cosf() for runtime.
*/
void init_costabs(void)
{
clreal *cpnts[] = { cos64,cos32,cos16,cos8,cos4 };
int i,k,kr,divv;
clreal *costab;
for(i=0;i<5;i++)
{
kr=0x10>>i; divv=0x40>>i;
costab = cpnts[i];
for(k=0;k<kr;k++)
costab[k] = 1.0 / (2.0 * COS(M_PI * ((clreal) k * 2.0 + 1.0) / (clreal) divv));
}
}

View File

@ -0,0 +1,58 @@
/*
The function to compute the layer I and II tables at runtime or for pregeneration.
copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp (in layer2.c).
The type clreal is either double or float. POW() is pow() or powf().
*/
void init_layer12(void)
{
const clreal mulmul[27] =
{
0.0 , -2.0/3.0 , 2.0/3.0 ,
2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 ,
2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 ,
2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 ,
-4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 ,
-8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0
};
// void init_layer12_stuff()
// real* init_layer12_table()
for(int k=0;k<27;k++)
{
int i,j;
clreal *table = layer12_table[k];
for(j=3,i=0;i<63;i++,j--)
*table++ = mulmul[k] * POW(2.0,(clreal) j / 3.0);
*table++ = 0.0;
}
// void init_layer12()
const unsigned char base[3][9] =
{
{ 1 , 0, 2 , } ,
{ 17, 18, 0 , 19, 20 , } ,
{ 21, 1, 22, 23, 0, 24, 25, 2, 26 }
};
int i,j,k,l,len;
const int tablen[3] = { 3 , 5 , 9 };
unsigned char *itable;
unsigned char *tables[3] = { grp_3tab , grp_5tab , grp_9tab };
for(i=0;i<3;i++)
{
itable = tables[i];
len = tablen[i];
for(j=0;j<len;j++)
for(k=0;k<len;k++)
for(l=0;l<len;l++)
{
*itable++ = base[i][l];
*itable++ = base[i][k];
*itable++ = base[i][j];
}
}
}

View File

@ -0,0 +1,231 @@
/*
The function to compute the layer III tables at runtime or for pregeneration.
copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp (in layer3.c).
The type clreal is either double or float.
*/
// init tables for layer-3 ... specific with the downsampling...
void init_layer3(void)
{
int i,j,k,l;
for(i=0;i<8207;i++)
ispow[i] = POW((clreal)i,(clreal)4.0/3.0);
for(i=0;i<8;i++)
{
const clreal Ci[8] = {-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
clreal sq = sqrt(1.0+Ci[i]*Ci[i]);
aa_cs[i] = 1.0/sq;
aa_ca[i] = Ci[i]/sq;
}
for(i=0;i<18;i++)
{
win[0][i] = win[1][i] =
0.5*SIN(M_PI/72.0 * (clreal)(2*(i+0) +1)) / COS(M_PI * (clreal)(2*(i+0) +19) / 72.0);
win[0][i+18] = win[3][i+18] =
0.5*SIN(M_PI/72.0 * (clreal)(2*(i+18)+1)) / COS(M_PI * (clreal)(2*(i+18)+19) / 72.0);
}
for(i=0;i<6;i++)
{
win[1][i+18] = 0.5 / COS( M_PI * (clreal) (2*(i+18)+19) / 72.0 );
win[3][i+12] = 0.5 / COS( M_PI * (clreal) (2*(i+12)+19) / 72.0 );
win[1][i+24] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+13) ) / COS( M_PI * (clreal) (2*(i+24)+19) / 72.0 );
win[1][i+30] = win[3][i] = 0.0;
win[3][i+6 ] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+1 ) ) / COS( M_PI * (clreal) (2*(i+6 )+19) / 72.0 );
}
for(i=0;i<9;i++)
COS9[i] = COS( M_PI / 18.0 * (clreal) i);
for(i=0;i<9;i++)
tfcos36[i] = 0.5 / COS( M_PI * (clreal) (i*2+1) / 36.0 );
for(i=0;i<3;i++)
tfcos12[i] = 0.5 / COS( M_PI * (clreal) (i*2+1) / 12.0 );
COS6_1 = COS( M_PI / 6.0 * (clreal) 1);
COS6_2 = COS( M_PI / 6.0 * (clreal) 2);
cos9[0] = COS(1.0*M_PI/9.0);
cos9[1] = COS(5.0*M_PI/9.0);
cos9[2] = COS(7.0*M_PI/9.0);
cos18[0] = COS(1.0*M_PI/18.0);
cos18[1] = COS(11.0*M_PI/18.0);
cos18[2] = COS(13.0*M_PI/18.0);
for(i=0;i<12;i++)
{
win[2][i] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+1) ) / COS( M_PI * (clreal) (2*i+7) / 24.0 );
}
for(i=0;i<16;i++)
{
// Special-casing possibly troublesome values where t=inf or
// t=-1 in theory. In practice, this never caused issues, but there might
// be a system with enough precision in M_PI to raise an exception.
// Actually, the special values are not excluded from use in the code, but
// in practice, they even have no effect in the compliance tests.
if(i > 11) // It's periodic!
{
tan1_1[i] = tan1_1[i-12];
tan2_1[i] = tan2_1[i-12];
tan1_2[i] = tan1_2[i-12];
tan2_2[i] = tan2_2[i-12];
} else if(i == 6) // t=inf
{
tan1_1[i] = 1.0;
tan2_1[i] = 0.0;
tan1_2[i] = M_SQRT2;
tan2_2[i] = 0.0;
} else if(i == 9) // t=-1
{
tan1_1[i] = -HUGE_VAL;
tan2_1[i] = HUGE_VAL;
tan1_2[i] = -HUGE_VAL;
tan2_2[i] = HUGE_VAL;
} else
{
clreal t = TAN( (clreal) i * M_PI / 12.0 );
tan1_1[i] = t / (1.0+t);
tan2_1[i] = 1.0 / (1.0 + t);
tan1_2[i] = M_SQRT2 * t / (1.0+t);
tan2_2[i] = M_SQRT2 / (1.0 + t);
}
}
for(i=0;i<32;i++)
{
for(j=0;j<2;j++)
{
clreal base = POW(2.0,-0.25*(j+1.0));
clreal p1=1.0,p2=1.0;
if(i > 0)
{
if( i & 1 ) p1 = POW(base,(i+1.0)*0.5);
else p2 = POW(base,i*0.5);
}
pow1_1[j][i] = p1;
pow2_1[j][i] = p2;
pow1_2[j][i] = M_SQRT2 * p1;
pow2_2[j][i] = M_SQRT2 * p2;
}
}
for(j=0;j<4;j++)
{
const int len[4] = { 36,36,12,36 };
for(i=0;i<len[j];i+=2) win1[j][i] = + win[j][i];
for(i=1;i<len[j];i+=2) win1[j][i] = - win[j][i];
}
for(j=0;j<9;j++)
{
const struct bandInfoStruct *bi = &bandInfo[j];
short *mp;
short cb,lwin;
const unsigned char *bdf;
int switch_idx;
mp = map[j][0] = mapbuf0[j];
bdf = bi->longDiff;
switch_idx = (j < 3) ? 8 : 6;
for(i=0,cb = 0; cb < switch_idx ; cb++,i+=*bdf++)
{
*mp++ = (*bdf) >> 1;
*mp++ = i;
*mp++ = 3;
*mp++ = cb;
}
bdf = bi->shortDiff+3;
for(cb=3;cb<13;cb++)
{
int l = (*bdf++) >> 1;
for(lwin=0;lwin<3;lwin++)
{
*mp++ = l;
*mp++ = i + lwin;
*mp++ = lwin;
*mp++ = cb;
}
i += 6*l;
}
mapend[j][0] = mp;
mp = map[j][1] = mapbuf1[j];
bdf = bi->shortDiff+0;
for(i=0,cb=0;cb<13;cb++)
{
int l = (*bdf++) >> 1;
for(lwin=0;lwin<3;lwin++)
{
*mp++ = l;
*mp++ = i + lwin;
*mp++ = lwin;
*mp++ = cb;
}
i += 6*l;
}
mapend[j][1] = mp;
mp = map[j][2] = mapbuf2[j];
bdf = bi->longDiff;
for(cb = 0; cb < 22 ; cb++)
{
*mp++ = (*bdf++) >> 1;
*mp++ = cb;
}
mapend[j][2] = mp;
}
/* Now for some serious loopings! */
for(i=0;i<5;i++)
for(j=0;j<6;j++)
for(k=0;k<6;k++)
{
int n = k + j * 6 + i * 36;
i_slen2[n] = i|(j<<3)|(k<<6)|(3<<12);
}
for(i=0;i<4;i++)
for(j=0;j<4;j++)
for(k=0;k<4;k++)
{
int n = k + j * 4 + i * 16;
i_slen2[n+180] = i|(j<<3)|(k<<6)|(4<<12);
}
for(i=0;i<4;i++)
for(j=0;j<3;j++)
{
int n = j + i * 3;
i_slen2[n+244] = i|(j<<3) | (5<<12);
n_slen2[n+500] = i|(j<<3) | (2<<12) | (1<<15);
}
for(i=0;i<5;i++)
for(j=0;j<5;j++)
for(k=0;k<4;k++)
for(l=0;l<4;l++)
{
int n = l + k * 4 + j * 16 + i * 80;
n_slen2[n] = i|(j<<3)|(k<<6)|(l<<9)|(0<<12);
}
for(i=0;i<5;i++)
for(j=0;j<5;j++)
for(k=0;k<4;k++)
{
int n = k + j * 4 + i * 20;
n_slen2[n+400] = i|(j<<3)|(k<<6)|(1<<12);
}
#ifdef CALCTABLES
// Only needed for fixed point.
for(int i=-256;i<118+4;i++)
gainpow2[i+256] =
DOUBLE_TO_REAL_SCALE_LAYER3(POW((clreal)2.0,-0.25 * (clreal) (i+210)),i+256);
#endif
}

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,9 @@
most other tables are calculated on program start (which is (of course) not ISO-conform)
Layer-3 huffman table is in huffman.h
Note: runtime computation of those other tables is optional now, and only for
floating point decoding.
*/

View File

@ -0,0 +1,94 @@
/*
l3bandinfo.h: the layer III bandInfo structures and gainpow2_scale
copyright 1995-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
This is separated out of layer3.c to re-use independently in calctables.
*/
struct bandInfoStruct
{
unsigned short longIdx[23];
unsigned char longDiff[22];
unsigned short shortIdx[14];
unsigned char shortDiff[13];
};
/* Techy details about our friendly MPEG data. Fairly constant over the years;-) */
static const struct bandInfoStruct bandInfo[9] =
{
{ /* MPEG 1.0 */
{0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576},
{4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158},
{0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3},
{4,4,4,4,6,8,10,12,14,18,22,30,56}
},
{
{0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576},
{4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192},
{0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3},
{4,4,4,4,6,6,10,12,14,16,20,26,66}
},
{
{0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576},
{4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26},
{0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3},
{4,4,4,4,6,8,12,16,20,26,34,42,12}
},
{ /* MPEG 2.0 */
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } ,
{0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} ,
{4,4,4,6,6,8,10,14,18,26,32,42,18 }
},
{ /* Twiddling 3 values here (not just 330->332!) fixed bug 1895025. */
{0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576},
{6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 },
{0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3},
{4,4,4,6,8,10,12,14,18,24,32,44,12 }
},
{
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 },
{0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3},
{4,4,4,6,8,10,12,14,18,24,30,40,18 }
},
{ /* MPEG 2.5 */
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
{0,12,24,36,54,78,108,144,186,240,312,402,522,576},
{4,4,4,6,8,10,12,14,18,24,30,40,18}
},
{
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
{0,12,24,36,54,78,108,144,186,240,312,402,522,576},
{4,4,4,6,8,10,12,14,18,24,30,40,18}
},
{
{0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576},
{12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2},
{0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576},
{8,8,8,12,16,20,24,28,36,2,2,2,26}
}
};
#if defined(REAL_IS_FIXED) || defined(CALCTABLES)
static const char gainpow2_scale[256+118+4+1] =
{
19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,
27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0
};
#endif

Some files were not shown because too many files have changed in this diff Show More