Updated playptmod plugin to handle MO3 and UMX archives.

CQTexperiment
Christopher Snowhill 2016-12-22 20:43:11 -08:00
parent 07fef42863
commit 68f8979bbe
3 changed files with 92 additions and 2 deletions

View File

@ -7,6 +7,12 @@
objects = {
/* Begin PBXBuildFile section */
8354948C1E0CD9B3003BEFCB /* mo3.c in Sources */ = {isa = PBXBuildFile; fileRef = 835494831E0CD9B3003BEFCB /* mo3.c */; };
8354948D1E0CD9B3003BEFCB /* umx.mm in Sources */ = {isa = PBXBuildFile; fileRef = 835494881E0CD9B3003BEFCB /* umx.mm */; };
8354948E1E0CD9B3003BEFCB /* unrealfmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 835494891E0CD9B3003BEFCB /* unrealfmt.cpp */; };
8354948F1E0CD9B3003BEFCB /* unrealfmtdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8354948A1E0CD9B3003BEFCB /* unrealfmtdata.cpp */; };
835494921E0CDB93003BEFCB /* libunmo3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 835494911E0CDB93003BEFCB /* libunmo3.dylib */; };
835494941E0CDD23003BEFCB /* libunmo3.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 835494911E0CDB93003BEFCB /* libunmo3.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83A0F4731816CE5E00119DB4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83A0F4721816CE5E00119DB4 /* Cocoa.framework */; };
83A0F47D1816CE5E00119DB4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 83A0F47B1816CE5E00119DB4 /* InfoPlist.strings */; };
83A0F4D91816D03C00119DB4 /* playptmod.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83A0F4CC1816CEAE00119DB4 /* playptmod.framework */; };
@ -32,6 +38,16 @@
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
835494931E0CDD16003BEFCB /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
835494941E0CDD23003BEFCB /* libunmo3.dylib in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
83A0F4DA1816D04400119DB4 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@ -46,6 +62,16 @@
/* Begin PBXFileReference section */
833F68451CDBCABF00AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
835494831E0CD9B3003BEFCB /* mo3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mo3.c; sourceTree = "<group>"; };
835494841E0CD9B3003BEFCB /* mo3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mo3.h; sourceTree = "<group>"; };
835494861E0CD9B3003BEFCB /* umr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = umr.h; sourceTree = "<group>"; };
835494871E0CD9B3003BEFCB /* umx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = umx.h; sourceTree = "<group>"; };
835494881E0CD9B3003BEFCB /* umx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = umx.mm; sourceTree = "<group>"; };
835494891E0CD9B3003BEFCB /* unrealfmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unrealfmt.cpp; sourceTree = "<group>"; };
8354948A1E0CD9B3003BEFCB /* unrealfmtdata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unrealfmtdata.cpp; sourceTree = "<group>"; };
8354948B1E0CD9B3003BEFCB /* urf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = urf.h; sourceTree = "<group>"; };
835494901E0CDB6D003BEFCB /* unmo3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unmo3.h; path = ../../../../ThirdParty/BASS/unmo3.h; sourceTree = "<group>"; };
835494911E0CDB93003BEFCB /* libunmo3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libunmo3.dylib; path = ../../../../ThirdParty/BASS/libunmo3.dylib; sourceTree = "<group>"; };
83A0F46F1816CE5E00119DB4 /* playptmod.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = playptmod.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
83A0F4721816CE5E00119DB4 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
83A0F4751816CE5E00119DB4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@ -69,12 +95,48 @@
files = (
83A0F4D91816D03C00119DB4 /* playptmod.framework in Frameworks */,
83A0F4731816CE5E00119DB4 /* Cocoa.framework in Frameworks */,
835494921E0CDB93003BEFCB /* libunmo3.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
835494811E0CD945003BEFCB /* archive */ = {
isa = PBXGroup;
children = (
835494821E0CD9B3003BEFCB /* mo3 */,
835494851E0CD9B3003BEFCB /* umx */,
);
name = archive;
sourceTree = "<group>";
};
835494821E0CD9B3003BEFCB /* mo3 */ = {
isa = PBXGroup;
children = (
835494831E0CD9B3003BEFCB /* mo3.c */,
835494841E0CD9B3003BEFCB /* mo3.h */,
835494911E0CDB93003BEFCB /* libunmo3.dylib */,
835494901E0CDB6D003BEFCB /* unmo3.h */,
);
name = mo3;
path = ../../Dumb/archive/mo3;
sourceTree = "<group>";
};
835494851E0CD9B3003BEFCB /* umx */ = {
isa = PBXGroup;
children = (
835494861E0CD9B3003BEFCB /* umr.h */,
835494871E0CD9B3003BEFCB /* umx.h */,
835494881E0CD9B3003BEFCB /* umx.mm */,
835494891E0CD9B3003BEFCB /* unrealfmt.cpp */,
8354948A1E0CD9B3003BEFCB /* unrealfmtdata.cpp */,
8354948B1E0CD9B3003BEFCB /* urf.h */,
);
name = umx;
path = ../../Dumb/archive/umx;
sourceTree = "<group>";
};
83A0F4661816CE5E00119DB4 = {
isa = PBXGroup;
children = (
@ -120,6 +182,7 @@
83A0F4DF1816D0AF00119DB4 /* Plugin.h */,
83A0F4DC1816D09000119DB4 /* ptmodDecoder.h */,
83A0F4DD1816D09000119DB4 /* ptmodDecoder.m */,
835494811E0CD945003BEFCB /* archive */,
83A0F4791816CE5E00119DB4 /* Supporting Files */,
);
path = playptmod;
@ -154,6 +217,7 @@
83A0F46C1816CE5E00119DB4 /* Frameworks */,
83A0F46D1816CE5E00119DB4 /* Resources */,
83A0F4DA1816D04400119DB4 /* CopyFiles */,
835494931E0CDD16003BEFCB /* CopyFiles */,
);
buildRules = (
);
@ -230,7 +294,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8354948E1E0CD9B3003BEFCB /* unrealfmt.cpp in Sources */,
8354948F1E0CD9B3003BEFCB /* unrealfmtdata.cpp in Sources */,
83A0F4DE1816D09000119DB4 /* ptmodDecoder.m in Sources */,
8354948D1E0CD9B3003BEFCB /* umx.mm in Sources */,
8354948C1E0CD9B3003BEFCB /* mo3.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -350,6 +418,7 @@
GCC_PREFIX_HEADER = "playptmod/playptmod-Prefix.pch";
INFOPLIST_FILE = "playptmod/playptmod-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/../../ThirdParty/BASS";
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.playptmod;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
@ -365,6 +434,7 @@
GCC_PREFIX_HEADER = "playptmod/playptmod-Prefix.pch";
INFOPLIST_FILE = "playptmod/playptmod-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/../../ThirdParty/BASS";
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.playptmod;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;

View File

@ -18,6 +18,7 @@
long size;
int track_num;
int isMo3;
int isVblank;
long framesLength;

View File

@ -8,6 +8,9 @@
#import "ptmodDecoder.h"
#import "umx.h"
#import "mo3.h"
#import "Logging.h"
#import "PlaylistController.h"
@ -64,6 +67,21 @@ BOOL probe_length( void * ptmod, unsigned long * intro_length, unsigned long * l
data = malloc(size);
[s read:data amount:size];
isMo3 = 0;
char * try_data = unpackMo3( data, &size );
if ( try_data ) {
free( data );
data = try_data;
isMo3 = 1;
}
else {
try_data = unpackUmx( data, &size );
if ( try_data ) {
free( data );
data = try_data;
}
}
if ([[[s url] fragment] length] == 0)
track_num = 0;
else
@ -243,7 +261,8 @@ BOOL probe_length( void * ptmod, unsigned long * intro_length, unsigned long * l
[self decoderShutdown];
if (data) {
free( data );
if (isMo3) freeMo3( data );
else free( data );
data = NULL;
}
}
@ -255,7 +274,7 @@ BOOL probe_length( void * ptmod, unsigned long * intro_length, unsigned long * l
+ (NSArray *)fileTypes
{
return [NSArray arrayWithObjects:@"mod", @"mdz", @"stk", @"m15", @"fst", nil];
return [NSArray arrayWithObjects:@"mod", @"mdz", @"stk", @"m15", @"fst", @"mo3", @"umx", nil];
}
+ (NSArray *)mimeTypes