Merged recent encoding/stability changes.
commit
ccd40d757b
|
@ -1184,6 +1184,11 @@
|
|||
HAVE_CONFIG_H,
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "Opus/Opus-Info.plist";
|
||||
INSTALL_PATH = "@loader_path/../Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
|
@ -1211,6 +1216,11 @@
|
|||
FRAMEWORK_VERSION = A;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "Opus/Opus-Info.plist";
|
||||
INSTALL_PATH = "@loader_path/../Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0600"
|
||||
LastUpgradeVersion = "0610"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0600"
|
||||
LastUpgradeVersion = "0610"
|
||||
version = "2.0">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
@ -174,6 +174,7 @@
|
|||
32AE5AFF14E70ED700420CA0 /* taglib_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE5A5914E70ED600420CA0 /* taglib_config.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32AE5B0014E70F4700420CA0 /* tlist.tcc in Headers */ = {isa = PBXBuildFile; fileRef = 32AE5A4614E70ED600420CA0 /* tlist.tcc */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32AE5B0114E70F4A00420CA0 /* tmap.tcc in Headers */ = {isa = PBXBuildFile; fileRef = 32AE5A4814E70ED600420CA0 /* tmap.tcc */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4872B8881A675CCB00674347 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4872B8871A675CCB00674347 /* libiconv.dylib */; };
|
||||
83790D241809E8CA0073CF51 /* opusfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83790D201809E8CA0073CF51 /* opusfile.cpp */; };
|
||||
83790D251809E8CA0073CF51 /* opusfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 83790D211809E8CA0073CF51 /* opusfile.h */; };
|
||||
83790D261809E8CA0073CF51 /* opusproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83790D221809E8CA0073CF51 /* opusproperties.cpp */; };
|
||||
|
@ -350,6 +351,7 @@
|
|||
32AE5A5714E70ED600420CA0 /* wavpackproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavpackproperties.cpp; sourceTree = "<group>"; };
|
||||
32AE5A5814E70ED600420CA0 /* wavpackproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavpackproperties.h; sourceTree = "<group>"; };
|
||||
32AE5A5914E70ED600420CA0 /* taglib_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = taglib_config.h; path = taglib/taglib_config.h; sourceTree = "<group>"; };
|
||||
4872B8871A675CCB00674347 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; };
|
||||
83790D201809E8CA0073CF51 /* opusfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opusfile.cpp; sourceTree = "<group>"; };
|
||||
83790D211809E8CA0073CF51 /* opusfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opusfile.h; sourceTree = "<group>"; };
|
||||
83790D221809E8CA0073CF51 /* opusproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opusproperties.cpp; sourceTree = "<group>"; };
|
||||
|
@ -363,6 +365,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4872B8881A675CCB00674347 /* libiconv.dylib in Frameworks */,
|
||||
174C7A370F4FD43100E18B0F /* libz.dylib in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -381,6 +384,7 @@
|
|||
0867D691FE84028FC02AAC07 /* TagLib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4872B8871A675CCB00674347 /* libiconv.dylib */,
|
||||
8E75700C09F318D70080F1EE /* Source */,
|
||||
089C1665FE841158C02AAC07 /* Resources */,
|
||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
|
||||
|
|
|
@ -105,7 +105,7 @@ void TextIdentificationFrame::parseFields(const ByteVector &data)
|
|||
|
||||
// read the string data type (the first byte of the field data)
|
||||
|
||||
d->textEncoding = String::Type(data[0]);
|
||||
d->textEncoding = String::Type(data[0]&3);
|
||||
|
||||
// split the byte array into chunks based on the string type (two byte delimiter
|
||||
// for unicode encodings)
|
||||
|
|
|
@ -32,7 +32,12 @@
|
|||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <iconv.h>
|
||||
|
||||
|
||||
namespace TagLib {
|
||||
char default_ascii_encoding[] = "latin1";
|
||||
char ascii_encoding[256] = "";
|
||||
|
||||
inline unsigned short byteSwap(unsigned short x)
|
||||
{
|
||||
|
@ -161,17 +166,61 @@ String::String(char c, Type t)
|
|||
prepare(t);
|
||||
}
|
||||
|
||||
|
||||
String::String(const ByteVector &v, Type t)
|
||||
{
|
||||
d = new StringPrivate;
|
||||
|
||||
if(v.isEmpty())
|
||||
return;
|
||||
|
||||
if(t == Latin1 || t == UTF8) {
|
||||
|
||||
int length = 0;
|
||||
d->data.resize(v.size());
|
||||
|
||||
iconv_t encoder = (iconv_t)-1;
|
||||
if ( t == Latin1 ) {
|
||||
encoder = iconv_open("utf-8",(*ascii_encoding)?ascii_encoding:default_ascii_encoding);
|
||||
if ( encoder == (iconv_t)-1 )
|
||||
encoder = iconv_open("utf-8",default_ascii_encoding);
|
||||
}
|
||||
|
||||
if ( t == Latin1 && encoder != (iconv_t)-1 ) {
|
||||
size_t srclen = v.size();
|
||||
char *src = new char[srclen+1];
|
||||
size_t dstlen = v.size()*6;
|
||||
char *dst = new char[dstlen+1];
|
||||
int n=0;
|
||||
|
||||
char *src_param = src;
|
||||
char *dst_param = dst;
|
||||
size_t src_remaining = srclen;
|
||||
size_t dst_remaining = dstlen;
|
||||
|
||||
for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it)
|
||||
src[n++] = *it;
|
||||
src[n++] = 0;
|
||||
|
||||
iconv(encoder, &src_param, &src_remaining, &dst_param, &dst_remaining);
|
||||
t = UTF8;
|
||||
|
||||
int length = 0;
|
||||
|
||||
d->data.resize(dstlen);
|
||||
wstring::iterator targetIt = d->data.begin();
|
||||
for ( int i=0; i<dstlen-dst_remaining; i++ ) {
|
||||
*targetIt = dst[i];
|
||||
++targetIt;
|
||||
++length;
|
||||
}
|
||||
|
||||
d->data.resize(length);
|
||||
|
||||
delete[] src;
|
||||
delete[] dst;
|
||||
|
||||
iconv_close(encoder);
|
||||
|
||||
t = UTF8;
|
||||
} else if ( t == UTF8 || ( t == Latin1 && encoder == (iconv_t)-1) ) { // UTF8 string or encoder failed to start
|
||||
int length = 0;
|
||||
d->data.resize(v.size()*2);
|
||||
wstring::iterator targetIt = d->data.begin();
|
||||
for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) {
|
||||
*targetIt = uchar(*it);
|
||||
|
@ -183,7 +232,19 @@ String::String(const ByteVector &v, Type t)
|
|||
else {
|
||||
d->data.resize(v.size() / 2);
|
||||
wstring::iterator targetIt = d->data.begin();
|
||||
|
||||
|
||||
// Cure some faulty UTF16 headers without endianness: insert endianness byte into the beginning of the dst string.
|
||||
if ( v.size() > 1 ) {
|
||||
wchar w = combine(v.data()[0], v.data()[1]);
|
||||
if ( w != 0xfeff && w != 0xfffe ) {
|
||||
d->data.resize(v.size()/2 + 1);
|
||||
targetIt = d->data.begin();
|
||||
*targetIt = 0xfffe;
|
||||
++targetIt;
|
||||
// String append will continue in the loop below.
|
||||
}
|
||||
}
|
||||
|
||||
for(ByteVector::ConstIterator it = v.begin();
|
||||
it != v.end() && it + 1 != v.end() && combine(*it, *(it + 1));
|
||||
it += 2)
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#define TStringToQString(s) QString::fromUtf8(s.toCString(true))
|
||||
|
||||
namespace TagLib {
|
||||
extern char ascii_encoding[];
|
||||
|
||||
//! A \e wide string class suitable for unicode.
|
||||
|
||||
|
|
|
@ -746,7 +746,10 @@
|
|||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
HEADER_SEARCH_PATHS = ../lib;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../lib,
|
||||
../../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@loader_path/../Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
|
@ -775,7 +778,10 @@
|
|||
FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
HEADER_SEARCH_PATHS = ../lib;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../lib,
|
||||
../../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@loader_path/../Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
|
|
|
@ -746,7 +746,10 @@
|
|||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
HEADER_SEARCH_PATHS = ../lib;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../lib,
|
||||
../../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
|
@ -775,7 +778,10 @@
|
|||
FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
HEADER_SEARCH_PATHS = ../lib;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../lib,
|
||||
../../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
48C2650F1A5D420800A0A3D6 /* vorbisfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 48C2650E1A5D420800A0A3D6 /* vorbisfile.h */; };
|
||||
830F884019C9102F00420FB0 /* Vorbis.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 830F883919C9101900420FB0 /* Vorbis.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
830F885C19C9124C00420FB0 /* Vorbis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830F883919C9101900420FB0 /* Vorbis.framework */; };
|
||||
8313E3E61902020400B4B6F1 /* mpg123.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8313E3431901FBDD00B4B6F1 /* mpg123.framework */; };
|
||||
|
@ -328,6 +329,18 @@
|
|||
83F5F8831908D0A400C8E65F /* fsb5.c in Sources */ = {isa = PBXBuildFile; fileRef = 83F5F8821908D0A400C8E65F /* fsb5.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXBuildRule section */
|
||||
48C265101A5D424500A0A3D6 /* PBXBuildRule */ = {
|
||||
isa = PBXBuildRule;
|
||||
compilerSpec = com.apple.compilers.proxy.script;
|
||||
fileType = sourcecode.swift;
|
||||
isEditable = 1;
|
||||
outputFiles = (
|
||||
);
|
||||
script = "# $(SWIFT_EXEC)\n";
|
||||
};
|
||||
/* End PBXBuildRule section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
830F883219C9101900420FB0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
|
@ -395,6 +408,7 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
48C2650E1A5D420800A0A3D6 /* vorbisfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = vorbisfile.h; path = ../Vorbis/include/vorbis/vorbisfile.h; sourceTree = "<group>"; };
|
||||
8313E33D1901FBDC00B4B6F1 /* mpg123.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mpg123.xcodeproj; path = ../mpg123/mpg123.xcodeproj; sourceTree = "<group>"; };
|
||||
8315231718BDECA1009AE289 /* VorbisNoDot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = VorbisNoDot.xcodeproj; path = ../Vorbis/macosx/VorbisNoDot.xcodeproj; sourceTree = "<group>"; };
|
||||
834D3A6D19F47C98001C54F6 /* g1l.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = g1l.c; sourceTree = "<group>"; };
|
||||
|
@ -751,6 +765,7 @@
|
|||
836F6B2F18BDB8880095E648 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
48C2650E1A5D420800A0A3D6 /* vorbisfile.h */,
|
||||
836F6B4218BDB8880095E648 /* vgmstream */,
|
||||
836F6B3B18BDB8880095E648 /* Frameworks */,
|
||||
836F6B3A18BDB8880095E648 /* Products */,
|
||||
|
@ -1158,6 +1173,7 @@
|
|||
836F6F2718BDC2190095E648 /* g72x_state.h in Headers */,
|
||||
836F705418BDC2190095E648 /* streamfile.h in Headers */,
|
||||
836F705918BDC2190095E648 /* vgmstream.h in Headers */,
|
||||
48C2650F1A5D420800A0A3D6 /* vorbisfile.h in Headers */,
|
||||
836F705718BDC2190095E648 /* util.h in Headers */,
|
||||
836F6F9A18BDC2190095E648 /* meta.h in Headers */,
|
||||
836F6F4D18BDC2190095E648 /* layout.h in Headers */,
|
||||
|
@ -1179,6 +1195,7 @@
|
|||
83979B0C18BDD93100192D2F /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
48C265101A5D424500A0A3D6 /* PBXBuildRule */,
|
||||
);
|
||||
dependencies = (
|
||||
830F883319C9101900420FB0 /* PBXTargetDependency */,
|
||||
|
@ -1696,8 +1713,15 @@
|
|||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Cog-egaqitgoybntfwaoqzgiynizucrq/Build/Products/Debug",
|
||||
../mpg123,
|
||||
);
|
||||
FRAMEWORK_VERSION = A;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../Vorbis/include,
|
||||
../Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "vgmstream/vgmstream-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = framework;
|
||||
|
@ -1713,8 +1737,15 @@
|
|||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Cog-egaqitgoybntfwaoqzgiynizucrq/Build/Products/Debug",
|
||||
../mpg123,
|
||||
);
|
||||
FRAMEWORK_VERSION = A;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../Vorbis/include,
|
||||
../Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "vgmstream/vgmstream-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = framework;
|
||||
|
|
|
@ -500,19 +500,14 @@
|
|||
{
|
||||
RepeatMode repeat = [self repeat];
|
||||
|
||||
if (i < 0)
|
||||
{
|
||||
if (repeat != RepeatNone)
|
||||
if (i < 0 || i >= [[self arrangedObjects] count] ) {
|
||||
if ( repeat != RepeatNone )
|
||||
return nil;
|
||||
|
||||
while ( i < 0 )
|
||||
i += [[self arrangedObjects] count];
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
else if (i >= [[self arrangedObjects] count])
|
||||
{
|
||||
if (repeat != RepeatNone)
|
||||
i -= [[self arrangedObjects] count];
|
||||
else
|
||||
return nil;
|
||||
if ( i >= [[self arrangedObjects] count])
|
||||
i %= [[self arrangedObjects] count];
|
||||
}
|
||||
|
||||
return [[self arrangedObjects] objectAtIndex:i];
|
||||
|
|
|
@ -310,7 +310,7 @@
|
|||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Users/Chris/Source/Repos/cog/ThirdParty/BASS,
|
||||
"$(PROJECT_DIR)/../../ThirdParty/BASS",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -329,7 +329,7 @@
|
|||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Users/Chris/Source/Repos/cog/ThirdParty/BASS,
|
||||
"$(PROJECT_DIR)/../../ThirdParty/BASS",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -356,6 +356,7 @@
|
|||
839BCFE61965133E00947767 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
|
|
@ -322,6 +322,11 @@
|
|||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Opus/Opus-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "Opus/Opus-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -338,6 +343,11 @@
|
|||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Opus/Opus-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "Opus/Opus-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
|
|
@ -273,13 +273,18 @@
|
|||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = TagLib_Prefix.pch;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"../../Frameworks/TagLib/taglib/**",
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Bundles";
|
||||
PRODUCT_NAME = TagLib;
|
||||
|
@ -293,10 +298,15 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = TagLib_Prefix.pch;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"../../Frameworks/TagLib/taglib/**",
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Bundles";
|
||||
PRODUCT_NAME = TagLib;
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
//
|
||||
|
||||
#import "TagLibMetadataReader.h"
|
||||
#import <TagLib/fileref.h>
|
||||
#import <TagLib/tag.h>
|
||||
#import <Taglib/mpegfile.h>
|
||||
#import <TagLib/mp4file.h>
|
||||
#import <Taglib/id3v2tag.h>
|
||||
#import <Taglib/attachedpictureframe.h>
|
||||
#import <taglib/fileref.h>
|
||||
#import <taglib/tag.h>
|
||||
#import <taglib/mpeg/mpegfile.h>
|
||||
#import <taglib/mp4/mp4file.h>
|
||||
#import <taglib/mpeg/id3v2/id3v2tag.h>
|
||||
#import <taglib/mpeg/id3v2/frames/attachedpictureframe.h>
|
||||
|
||||
@implementation TagLibMetadataReader
|
||||
|
||||
|
@ -24,6 +24,41 @@
|
|||
|
||||
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
|
||||
|
||||
if ( !*TagLib::ascii_encoding ) {
|
||||
NSStringEncoding enc = [NSString defaultCStringEncoding];
|
||||
CFStringEncoding cfenc = CFStringConvertNSStringEncodingToEncoding(enc);
|
||||
NSString *ref = (NSString *)CFStringConvertEncodingToIANACharSetName(cfenc);
|
||||
UInt32 cp = CFStringConvertEncodingToWindowsCodepage(cfenc);
|
||||
|
||||
// Most tags are using windows codepage, so remap OS X codepage to Windows one.
|
||||
|
||||
static struct {
|
||||
UInt32 from, to;
|
||||
} codepage_remaps[] = {
|
||||
{ 10001, 932 }, // Japanese Shift-JIS
|
||||
{ 10002, 950 }, // Traditional Chinese
|
||||
{ 10003, 949 }, // Korean
|
||||
{ 10004, 1256 }, // Arabic
|
||||
{ 10005, 1255 }, // Hebrew
|
||||
{ 10006, 1253 }, // Greek
|
||||
{ 10007, 1251 }, // Cyrillic
|
||||
{ 10008, 936 }, // Simplified Chinese
|
||||
{ 10029, 1250 }, // Central European (latin2)
|
||||
};
|
||||
|
||||
int i;
|
||||
int max = sizeof(codepage_remaps)/sizeof(codepage_remaps[0]);
|
||||
for ( i=0; i<max; i++ )
|
||||
if ( codepage_remaps[i].from == cp )
|
||||
break;
|
||||
if ( i < max )
|
||||
sprintf(TagLib::ascii_encoding, "windows-%d", codepage_remaps[i].to);
|
||||
else
|
||||
strcpy(TagLib::ascii_encoding, [ref UTF8String]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
TagLib::FileRef f((const char *)[[url path] UTF8String], false);
|
||||
if (!f.isNull())
|
||||
{
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
17C93D360B8FDA66008627D6 /* VorbisDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93D340B8FDA66008627D6 /* VorbisDecoder.m */; };
|
||||
17F563820C3BDB670019975C /* Vorbis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17F562F70C3BDAAC0019975C /* Vorbis.framework */; };
|
||||
17F563850C3BDB6C0019975C /* Vorbis.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17F562F70C3BDAAC0019975C /* Vorbis.framework */; };
|
||||
48D2EEA31A51E5C8007D6D07 /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 48D2EEA21A51E5C8007D6D07 /* Ogg.framework */; };
|
||||
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
|
@ -26,9 +27,30 @@
|
|||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 17F562EF0C3BDAAC0019975C /* Vorbis.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
|
||||
remoteGlobalIDString = 730F23A1091827B100AB638C;
|
||||
remoteInfo = Vorbis;
|
||||
};
|
||||
48D2EE9C1A51E4D4007D6D07 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 17F562EF0C3BDAAC0019975C /* Vorbis.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 738835E40B18F870005C7A69;
|
||||
remoteInfo = "libvorbis (static)";
|
||||
};
|
||||
48D2EE9E1A51E4D4007D6D07 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 17F562EF0C3BDAAC0019975C /* Vorbis.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 738836130B190488005C7A69;
|
||||
remoteInfo = "libvorbisenc (static)";
|
||||
};
|
||||
48D2EEA01A51E4D4007D6D07 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 17F562EF0C3BDAAC0019975C /* Vorbis.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 738836220B1905E5005C7A69;
|
||||
remoteInfo = "libvorbisfile (static)";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
|
@ -54,6 +76,7 @@
|
|||
17C93D340B8FDA66008627D6 /* VorbisDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisDecoder.m; sourceTree = "<group>"; };
|
||||
17F562EF0C3BDAAC0019975C /* Vorbis.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Vorbis.xcodeproj; path = ../../Frameworks/Vorbis/macosx/Vorbis.xcodeproj; sourceTree = SOURCE_ROOT; };
|
||||
32DBCF630370AF2F00C91783 /* Vorbis_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vorbis_Prefix.pch; sourceTree = "<group>"; };
|
||||
48D2EEA21A51E5C8007D6D07 /* Ogg.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Ogg.framework; path = "../../../../../Library/Developer/Xcode/DerivedData/Cog-aktkhaftjdfmnlcckzpefotmcrlq/Build/Products/Debug/Ogg.framework"; sourceTree = "<group>"; };
|
||||
8384913418081A3900E7332D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = "<group>"; };
|
||||
8D5B49B6048680CD000E48DA /* Vorbis.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Vorbis.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
|
@ -65,6 +88,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
48D2EEA31A51E5C8007D6D07 /* Ogg.framework in Frameworks */,
|
||||
17F563820C3BDB670019975C /* Vorbis.framework in Frameworks */,
|
||||
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
|
@ -76,6 +100,7 @@
|
|||
089C166AFE841209C02AAC07 /* Vorbis */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
48D2EEA21A51E5C8007D6D07 /* Ogg.framework */,
|
||||
08FB77AFFE84173DC02AAC07 /* Classes */,
|
||||
32C88E010371C26100C91783 /* Other Sources */,
|
||||
089C167CFE841241C02AAC07 /* Resources */,
|
||||
|
@ -136,6 +161,9 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
17F562F70C3BDAAC0019975C /* Vorbis.framework */,
|
||||
48D2EE9D1A51E4D4007D6D07 /* libvorbis.a */,
|
||||
48D2EE9F1A51E4D4007D6D07 /* libvorbisenc.a */,
|
||||
48D2EEA11A51E4D4007D6D07 /* libvorbisfile.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
|
@ -185,7 +213,7 @@
|
|||
089C1669FE841209C02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0500;
|
||||
LastUpgradeCheck = 0610;
|
||||
};
|
||||
buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "Vorbis" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
|
@ -217,6 +245,27 @@
|
|||
remoteRef = 17F562F60C3BDAAC0019975C /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
48D2EE9D1A51E4D4007D6D07 /* libvorbis.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libvorbis.a;
|
||||
remoteRef = 48D2EE9C1A51E4D4007D6D07 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
48D2EE9F1A51E4D4007D6D07 /* libvorbisenc.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libvorbisenc.a;
|
||||
remoteRef = 48D2EE9E1A51E4D4007D6D07 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
48D2EEA11A51E4D4007D6D07 /* libvorbisfile.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libvorbisfile.a;
|
||||
remoteRef = 48D2EEA01A51E4D4007D6D07 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
|
@ -259,6 +308,7 @@
|
|||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)",
|
||||
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Cog-aktkhaftjdfmnlcckzpefotmcrlq/Build/Products/Debug",
|
||||
);
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
|
@ -266,13 +316,16 @@
|
|||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = Vorbis_Prefix.pch;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Bundles";
|
||||
OTHER_LDFLAGS = (
|
||||
"-weak_framework",
|
||||
Vorbis,
|
||||
"-weak_framework",
|
||||
ogg,
|
||||
);
|
||||
PRODUCT_NAME = Vorbis;
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -290,17 +343,21 @@
|
|||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)",
|
||||
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Cog-aktkhaftjdfmnlcckzpefotmcrlq/Build/Products/Debug",
|
||||
);
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = Vorbis_Prefix.pch;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Bundles";
|
||||
OTHER_LDFLAGS = (
|
||||
"-weak_framework",
|
||||
Vorbis,
|
||||
"-weak_framework",
|
||||
ogg,
|
||||
);
|
||||
PRODUCT_NAME = Vorbis;
|
||||
SKIP_INSTALL = YES;
|
||||
|
|
|
@ -388,7 +388,7 @@
|
|||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Users/Chris/Source/Repos/cog/ThirdParty/BASS,
|
||||
"$(PROJECT_DIR)/../../ThirdParty/BASS",
|
||||
);
|
||||
PRODUCT_NAME = modplay;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
|
@ -405,7 +405,7 @@
|
|||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Users/Chris/Source/Repos/cog/ThirdParty/BASS,
|
||||
"$(PROJECT_DIR)/../../ThirdParty/BASS",
|
||||
);
|
||||
PRODUCT_NAME = modplay;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
|
|
|
@ -261,6 +261,11 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../Vorbis/include,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
|
@ -293,6 +298,11 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../Vorbis/include,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
|
@ -305,6 +315,12 @@
|
|||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "vgmstream/vgmstream-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Vorbis/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "vgmstream/vgmstream-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -320,6 +336,12 @@
|
|||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "vgmstream/vgmstream-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
../../Frameworks/Vorbis/include,
|
||||
../../Frameworks/Ogg/include,
|
||||
);
|
||||
INFOPLIST_FILE = "vgmstream/vgmstream-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
|
Loading…
Reference in New Issue