From ba3aeedfd20fdc250b83b898da702a7f78483794 Mon Sep 17 00:00:00 2001 From: Aleksi Sitomaniemi Date: Sat, 12 Nov 2022 14:17:28 +0200 Subject: [PATCH] UADE integration (#17) * UADE Integration: Add preliminary replayer implementation * Integrated SamplePlayer app with uade library * 4champ integrated with uade library * UADE integration documentation + license update * Correct typo in the MIT license name --- 4champ.xcodeproj/project.pbxproj | 66 +++- 4champ/Data/Structs.swift | 2 +- 4champ/Replay/Hively/HVLReplayer.mm | 9 +- 4champ/Replay/OpenMPT/MPTReplayer.m | 58 ++- 4champ/Replay/Replay.h | 19 +- 4champ/Replay/Replay.m | 32 +- 4champ/Replay/UADE/UADEReplayer.h | 15 + 4champ/Replay/UADE/UADEReplayer.m | 374 ++++++++++++++++++ 4champ/Scenes/About/AboutInteractor.swift | 5 +- 4champ/Scenes/Local/LocalViewController.swift | 4 +- 4champ/Scenes/Radio/RadioInteractor.swift | 8 +- 4champ/l13n/da.lproj/Localizable.strings | Bin 26492 -> 26504 bytes 4champ/l13n/de.lproj/Localizable.strings | Bin 27884 -> 27896 bytes 4champ/l13n/en.lproj/Localizable.strings | Bin 27896 -> 27908 bytes 4champ/l13n/es.lproj/Localizable.strings | Bin 28928 -> 28940 bytes 4champ/l13n/fi.lproj/Localizable.strings | Bin 27824 -> 27844 bytes 4champ/l13n/nb.lproj/Localizable.strings | Bin 27258 -> 27270 bytes 4champ/l13n/ru.lproj/Localizable.strings | Bin 27900 -> 27912 bytes LICENSE | 22 +- LICENSE.GPL | 340 ++++++++++++++++ LICENSE.MIT | 21 + README.md | 36 +- .../SamplePlayer.xcodeproj/project.pbxproj | 60 ++- .../AppIcon.appiconset/Contents.json | 79 ++-- .../SamplePlayer/Base.lproj/Main.storyboard | 9 +- .../SamplePlayer/Modules.bundle/jinx.jam | Bin 0 -> 94484 bytes .../Modules.bundle/sweet_dreams.aon | Bin 0 -> 55836 bytes .../SamplePlayer/ViewController.swift | 13 + docs/app_history.md | 6 +- docs/images/appstore_badge.png | Bin 0 -> 4037 bytes docs/images/screens.png | Bin 0 -> 170385 bytes docs/journal.md | 14 + 32 files changed, 1070 insertions(+), 122 deletions(-) create mode 100644 4champ/Replay/UADE/UADEReplayer.h create mode 100644 4champ/Replay/UADE/UADEReplayer.m create mode 100644 LICENSE.GPL create mode 100644 LICENSE.MIT create mode 100644 SamplePlayer/SamplePlayer/Modules.bundle/jinx.jam create mode 100644 SamplePlayer/SamplePlayer/Modules.bundle/sweet_dreams.aon create mode 100644 docs/images/appstore_badge.png create mode 100644 docs/images/screens.png diff --git a/4champ.xcodeproj/project.pbxproj b/4champ.xcodeproj/project.pbxproj index b9f3ed3..94a46dd 100644 --- a/4champ.xcodeproj/project.pbxproj +++ b/4champ.xcodeproj/project.pbxproj @@ -67,7 +67,6 @@ 45AA90F520FF2F6600794147 /* RESTRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45AA90F420FF2F6600794147 /* RESTRoutes.swift */; }; 45AA910220FF36C200794147 /* Replay.m in Sources */ = {isa = PBXBuildFile; fileRef = 45AA90F720FF36C200794147 /* Replay.m */; }; 45AA910320FF36C200794147 /* hvl_replay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45AA90F920FF36C200794147 /* hvl_replay.cpp */; }; - 45AA910420FF36C200794147 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 45AA90FA20FF36C200794147 /* LICENSE */; }; 45AA910520FF36C200794147 /* HVLReplayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 45AA90FB20FF36C200794147 /* HVLReplayer.mm */; }; 45AA910620FF36C200794147 /* MPTReplayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 45AA910120FF36C200794147 /* MPTReplayer.m */; }; 45AA910E20FF5E8A00794147 /* Structs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45AA910D20FF5E8A00794147 /* Structs.swift */; }; @@ -94,9 +93,26 @@ 735A2742264FDFDE004EAC0C /* SwiftyBeaver in Frameworks */ = {isa = PBXBuildFile; productRef = 735A2741264FDFDE004EAC0C /* SwiftyBeaver */; }; 735A2746264FE01D004EAC0C /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 735A2745264FE01D004EAC0C /* Alamofire */; }; 73759FD228EB34DF00535F8E /* libopenmpt.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73759FD128EB34DF00535F8E /* libopenmpt.xcframework */; }; + 7397C1DE29091504002D5CDB /* UADEReplayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7397C1DC29091504002D5CDB /* UADEReplayer.m */; }; + 7397C1E629091D9D002D5CDB /* uade_ios.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7397C1E129091BC3002D5CDB /* uade_ios.xcframework */; }; + 7397C1E729091D9D002D5CDB /* uade_ios.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7397C1E129091BC3002D5CDB /* uade_ios.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 739B4BF42720850200C2D69F /* RadioSessionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739B4BF32720850200C2D69F /* RadioSessionCell.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXCopyFilesBuildPhase section */ + 7397C1E829091D9D002D5CDB /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 7397C1E729091D9D002D5CDB /* uade_ios.xcframework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 4509EA43226251EF0031408D /* ModuleInfo+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ModuleInfo+CoreDataClass.swift"; sourceTree = ""; }; 4509EA44226251EF0031408D /* ModuleInfo+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ModuleInfo+CoreDataProperties.swift"; sourceTree = ""; }; @@ -208,6 +224,9 @@ 45D61F6220E1863600869814 /* Gzip.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Gzip.framework; path = Carthage/Build/iOS/Gzip.framework; sourceTree = ""; }; 735A274D264FE9EA004EAC0C /* AmpCDModel 9 (imports).xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "AmpCDModel 9 (imports).xcdatamodel"; sourceTree = ""; }; 73759FD128EB34DF00535F8E /* libopenmpt.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libopenmpt.xcframework; path = ../openmpt/libopenmpt.xcframework; sourceTree = ""; }; + 7397C1DA29091504002D5CDB /* UADEReplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UADEReplayer.h; sourceTree = ""; }; + 7397C1DC29091504002D5CDB /* UADEReplayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UADEReplayer.m; sourceTree = ""; }; + 7397C1E129091BC3002D5CDB /* uade_ios.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = uade_ios.xcframework; path = "../uade-ios/uade_ios.xcframework"; sourceTree = ""; }; 739B4BF32720850200C2D69F /* RadioSessionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSessionCell.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -216,6 +235,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7397C1E629091D9D002D5CDB /* uade_ios.xcframework in Frameworks */, 73759FD228EB34DF00535F8E /* libopenmpt.xcframework in Frameworks */, 735A2746264FE01D004EAC0C /* Alamofire in Frameworks */, 735A273E264FDFAD004EAC0C /* Gzip in Frameworks */, @@ -383,6 +403,7 @@ 45AA90FE20FF36C200794147 /* Replay.h */, 45AA90F820FF36C200794147 /* Hively */, 45AA90FF20FF36C200794147 /* OpenMPT */, + 7397C1D929091504002D5CDB /* UADE */, ); path = Replay; sourceTree = ""; @@ -497,6 +518,7 @@ 45D61F5E20E17D9600869814 /* Frameworks */ = { isa = PBXGroup; children = ( + 7397C1E129091BC3002D5CDB /* uade_ios.xcframework */, 73759FD128EB34DF00535F8E /* libopenmpt.xcframework */, 455CC0A52104A0E20094A5D3 /* SwiftyBeaver.framework */, 45D61F6220E1863600869814 /* Gzip.framework */, @@ -505,6 +527,15 @@ name = Frameworks; sourceTree = ""; }; + 7397C1D929091504002D5CDB /* UADE */ = { + isa = PBXGroup; + children = ( + 7397C1DA29091504002D5CDB /* UADEReplayer.h */, + 7397C1DC29091504002D5CDB /* UADEReplayer.m */, + ); + path = UADE; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -515,6 +546,7 @@ 45D3929D20B1DDEC00EEF4E3 /* Sources */, 45D3929E20B1DDEC00EEF4E3 /* Frameworks */, 45D3929F20B1DDEC00EEF4E3 /* Resources */, + 7397C1E829091D9D002D5CDB /* Embed Frameworks */, ); buildRules = ( ); @@ -586,7 +618,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 45AA910420FF36C200794147 /* LICENSE in Resources */, 45D392B120B1DDEE00EEF4E3 /* LaunchScreen.storyboard in Resources */, 454F520C21610E94007011F3 /* ModuleCell.xib in Resources */, 454F520E21610F70007011F3 /* GroupCell.xib in Resources */, @@ -629,6 +660,7 @@ 451ED0B2241E8A83006CE4E8 /* PlaylistInteractor.swift in Sources */, 45D61F5320E1647300869814 /* RadioRouter.swift in Sources */, 453D9BBA241BF286002EEBAB /* PlaylistSelectorRouter.swift in Sources */, + 7397C1DE29091504002D5CDB /* UADEReplayer.m in Sources */, 453D9BBD241BF286002EEBAB /* PlaylistSelectorInteractor.swift in Sources */, 45CEA1DF2413C8E300930A72 /* SceneDelegate.swift in Sources */, 4535A4682114BB2D005FBB8B /* SearchViewController.swift in Sources */, @@ -861,18 +893,25 @@ CODE_SIGN_ENTITLEMENTS = ampplayer.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 27; + CURRENT_PROJECT_VERSION = 30; DEVELOPMENT_TEAM = 2G92PSCBJ9; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - HEADER_SEARCH_PATHS = ../openmpt/libopenmpt; + HEADER_SEARCH_PATHS = ( + ../openmpt/libopenmpt, + "../uade-ios/src/frontends/include", + "../uade-ios/src/include", + ); INFOPLIST_FILE = "$(SRCROOT)/4champ/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ../openmpt; - MARKETING_VERSION = 3.4; + LIBRARY_SEARCH_PATHS = ( + ../openmpt, + "../uade-ios", + ); + MARKETING_VERSION = 3.5; PRODUCT_BUNDLE_IDENTIFIER = com.boogiesoftware.ampplayer; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -890,18 +929,25 @@ CODE_SIGN_ENTITLEMENTS = ampplayer.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 27; + CURRENT_PROJECT_VERSION = 30; DEVELOPMENT_TEAM = 2G92PSCBJ9; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - HEADER_SEARCH_PATHS = ../openmpt/libopenmpt; + HEADER_SEARCH_PATHS = ( + ../openmpt/libopenmpt, + "../uade-ios/src/frontends/include", + "../uade-ios/src/include", + ); INFOPLIST_FILE = "$(SRCROOT)/4champ/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ../openmpt; - MARKETING_VERSION = 3.4; + LIBRARY_SEARCH_PATHS = ( + ../openmpt, + "../uade-ios", + ); + MARKETING_VERSION = 3.5; PRODUCT_BUNDLE_IDENTIFIER = com.boogiesoftware.ampplayer; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/4champ/Data/Structs.swift b/4champ/Data/Structs.swift index 1051169..51f3f18 100644 --- a/4champ/Data/Structs.swift +++ b/4champ/Data/Structs.swift @@ -30,7 +30,7 @@ struct MMD: Identifiable { init() { } - static let supportedTypes: [String] = "669, AMF, AMS, DBM, DIGI, DMF, DSM, DTM, FAR, IT, GDM, ST26, IMF, J2B, M15, MED, MDL, MOD, MTM, NST, OCT, OKT, OSS, PTM, PSM, S3M, STM, SFX, SFX2, ULT, UMX, WOW, XM, FST, STK, MMCMP, MMS, MO3, MPTM, OK, PLM, PPM, PT36, AHX, THX, HVL".split(separator: ",").map { $0.trimmingCharacters(in: .whitespacesAndNewlines) } + static let supportedTypes: [String] = Replay.supportedFormats init(cdi: ModuleInfo) { self.init() diff --git a/4champ/Replay/Hively/HVLReplayer.mm b/4champ/Replay/Hively/HVLReplayer.mm index 861e378..0bbe035 100644 --- a/4champ/Replay/Hively/HVLReplayer.mm +++ b/4champ/Replay/Hively/HVLReplayer.mm @@ -25,10 +25,11 @@ @implementation HVLReplayer { int hvlStereoSeparation; } - - static int iHivelyBufPos = 0; ++ (NSArray*)supportedFormats { + return @[@"THX", @"AHX", @"HVL"]; +} - (HVLReplayer*) init { self = [super init]; @@ -59,6 +60,10 @@ defstereo is the stereo seperation for playing AHX tunes (HVL tunes override } - (void)dealloc { + NSLog(@"HVLReplayer deallocated"); +} + +- (void) cleanup { if (currentHVLtune) { hvl_FreeTune(currentHVLtune); free(leftByte); diff --git a/4champ/Replay/OpenMPT/MPTReplayer.m b/4champ/Replay/OpenMPT/MPTReplayer.m index 42e57ee..079457b 100644 --- a/4champ/Replay/OpenMPT/MPTReplayer.m +++ b/4champ/Replay/OpenMPT/MPTReplayer.m @@ -12,19 +12,71 @@ @implementation MPTReplayer { openmpt_module* currentOMPTFile; } ++ (NSArray*)supportedFormats { + return @[@"669", + @"AMF", + @"AMS", + @"DBM", + @"DIGI", + @"DMF", + @"DSM", + @"DTM", + @"FAR", + @"IT", + @"GDM", + @"ST26", + @"IMF", + @"J2B", + @"M15", + //@"MED", Handled by UADE + @"MDL", + @"MOD", + @"MT2", + @"MTM", + @"NST", + @"OCT", + @"OKT", + @"OSS", + @"PTM", + @"PSM", + @"S3M", + @"STM", + @"SFX", + @"SFX2", + @"ULT", + @"UMX", + @"WOW", + @"XM", + @"FST", + @"STK", + @"MMCMP", + @"MMS", + @"MO3", + @"MPTM", + @"OK", + @"PLM", + @"PPM", + @"PT36"]; +} + - (bool) loadModule:(NSString *)path type:(NSString*)type { NSData* data = [[NSFileManager defaultManager] contentsAtPath:path]; if (!data) return false; + [self cleanup]; currentOMPTFile = openmpt_module_create_from_memory2(data.bytes, (uint32_t)data.length, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if (!currentOMPTFile) return false; return true; } - (void)dealloc { - if (currentOMPTFile) { - openmpt_module_destroy(currentOMPTFile); - } + NSLog(@"MTPReplayer deallocated"); +} + +- (void) cleanup { + if (currentOMPTFile) { + openmpt_module_destroy(currentOMPTFile); + } } - (int) readFrames:(size_t)count bufLeft:(int16_t*)bufLeft bufRight:(int16_t*)bufRight { diff --git a/4champ/Replay/Replay.h b/4champ/Replay/Replay.h index 0fae183..7505a61 100644 --- a/4champ/Replay/Replay.h +++ b/4champ/Replay/Replay.h @@ -7,8 +7,14 @@ #import +/// The Replay control API @protocol ReplayControl -// Control API + +/** + Supported @formats + */ +@property (class, nonatomic, strong, readonly) NSArray* supportedFormats; + /** Loads module for playback from given path. @param path identifies the module file. Path extension can identify format (type) @@ -35,10 +41,16 @@ in libpopenmpt.h */ - (void) setInterpolationFilterLength:(NSInteger)value; + +/** + Free replayer resources + */ +- (void) cleanup; + @end +/// Visualisation API getters @protocol ReplayInformation -// Visualisation API getters - (int) currentPosition; //returns current position in current module - (int) moduleLength; //returns current mod length in seconds - (NSInteger) volumeOnChannel:(NSInteger)channel; //returns current volume on requested channel @@ -47,14 +59,15 @@ - (NSArray*) getInstruments; //returns instrument names of current mod @end +/// Stream API for getting rendered frames for output @protocol ReplayerStream -// Stream API - (int) readFrames:(size_t)count bufLeft:(int16_t*)bufLeft bufRight:(int16_t*)bufRight; @end @class Replay; @protocol ReplayStreamDelegate + /** Called when replay reaches end of the module @param replay identifies the Replay object diff --git a/4champ/Replay/Replay.m b/4champ/Replay/Replay.m index 55f9ab5..eca2d05 100644 --- a/4champ/Replay/Replay.m +++ b/4champ/Replay/Replay.m @@ -7,6 +7,7 @@ #import "Replay.h" #import "MPTReplayer.h" +#import "UADEReplayer.h" #import "HVLReplayer.h" #import #import @@ -22,6 +23,7 @@ @interface Replay () { @property (nonatomic, strong) AVAudioPlayer *audioPlayer; @property (nonatomic, strong) NSDictionary* replayerMap; +@property (nonatomic, strong) NSArray* replayers; #define checkStatus( err) \ if(err) {\ NSLog(@"Error in audio %@", @(err));\ @@ -35,15 +37,19 @@ @implementation Replay static SInt16* bufLeft; static SInt16* bufRight; ++ (NSArray*)supportedFormats { + NSMutableArray* formats = [[NSMutableArray alloc] init]; + [formats addObjectsFromArray:[MPTReplayer supportedFormats]]; + [formats addObjectsFromArray:[HVLReplayer supportedFormats]]; + [formats addObjectsFromArray:[UADEReplayer supportedFormats]]; + return formats; +} + -(id)init { self=[super init]; if (self) { - //Map AHX and HVL to HVLReplayer, everything else plays with OpenMPT - self.replayerMap = @{@"AHX": [HVLReplayer class], - @"HVL": [HVLReplayer class], - @"THX": [HVLReplayer class] - }; + self.replayers = @[[MPTReplayer class], [HVLReplayer class], [UADEReplayer class]]; } return self; } @@ -126,15 +132,18 @@ - (bool) loadModule:(NSString *)path type:(NSString*)type type = [[path pathExtension] uppercaseString]; } Class replayerClass; - if ([self.replayerMap.allKeys containsObject:type]) { - replayerClass = [self.replayerMap objectForKey:type]; - } else { - replayerClass = [MPTReplayer class]; + for (int i=0; i< self.replayers.count; i++) { + if ([[self.replayers[i] supportedFormats] containsObject:(type)]) { + replayerClass = self.replayers[i]; + } } if (renderer) { [self pause]; } if (![[renderer class] isEqual:replayerClass]) { + if(renderer) { + [renderer cleanup]; + } renderer = [[replayerClass alloc] init]; } return [renderer loadModule:path type:type]; @@ -238,6 +247,11 @@ - (void) setInterpolationFilterLength:(NSInteger)value { } } +- (void)cleanup { + //noop, done in loadModule for the replayer +} + + -(void)dealloc { diff --git a/4champ/Replay/UADE/UADEReplayer.h b/4champ/Replay/UADE/UADEReplayer.h new file mode 100644 index 0000000..63f8a97 --- /dev/null +++ b/4champ/Replay/UADE/UADEReplayer.h @@ -0,0 +1,15 @@ +// +// UADEReplayer.h +// SamplePlayer +// +// Created by Aleksi Sitomaniemi on 27.8.2022. +// Copyright © 2022 4champ. All rights reserved. +// + +#import +#import +#import "Replay.h" + +@interface UADEReplayer : NSObject + +@end diff --git a/4champ/Replay/UADE/UADEReplayer.m b/4champ/Replay/UADE/UADEReplayer.m new file mode 100644 index 0000000..3f1ef4e --- /dev/null +++ b/4champ/Replay/UADE/UADEReplayer.m @@ -0,0 +1,374 @@ +// +// UADEReplayer.m +// SamplePlayer +// +// Created by Aleksi Sitomaniemi on 27.8.2022. +// Copyright © 2022 4champ. All rights reserved. +// + +#import "UADEReplayer.h" + +static volatile int uadethread_running; + +#include +#include +#include +#include +#include +#include "uae.h" +#include + +@implementation UADEReplayer{ + struct uade_config* cfg; + struct uade_state* ustate; + + int16_t* leftByte; + int16_t* rightByte; + char uadescorename[PATH_MAX]; + char basedir[PATH_MAX]; + int fds[2]; +} + ++ (NSArray*)supportedFormats { + return @[@"AAM", // ArtAndMagic, + @"ABK", // Amos ABK + @"ADPCM",// ADPCM_mono + @"ADSC", // AudioSculpture + //@"AHX" // -> HivelyPlayer + @"AMC", // A.M. Composer + @"AON", @"AON4", @"AON8", // Art of noise + @"APS", // AProSys + @"ASH", // Ashley Hogg + @"AST", // ActionAmics + @"BD", @"BDS", // Ben Daglish + @"BFC", @"BSI", // Future Composer (BSI) + @"BSS", // BeathovenSynthesizer + @"BP", @"BP3", // SoundMon + @"BYE", // Andrew Parton + @"CIN", // Chinemaware + @"CORE",// Core Design + @"DB",@"DIGI", // DigiBooster + @"DH", // David Hanney + @"DL",@"DL_DELI",@"DLN", // Dave Lowe + @"DM1", @"DM2", @"DLM1", @"DLM2", // Delta Music + @"DMU", @"DMU2", @"MUG", @"MUG2", // Mugician + //@"DIGI" OpenMPT + @"DNS", // DynamicSynthesizer + @"DSC", // DigitalSonixChrome + @"DSS", // DigitalSoundStudio + @"DSR", // Desire + @"DUM", // Infogrames + @"DW", // David Whittaker + @"DZ", // DariusZendeh + @"EA", @"MG", // EarAche + @"EMOD", @"QC", // Quadra Composer + @"EMS", @"EMSV6", // EMS + @"EX", // FashionTracker + @"FC", @"FC13", @"FC14", @"FC3", @"FC4", // Future Composer + @"FC-M",// FC-M Packer + @"FP", // Future Player + @"FRED",// Fred + @"FUZZ",// Fuzzac Packer + @"GLUE", @"GM",// GlueMon + @"GRAY",// Fred Gray + @"GMC", // GMC + @"HD", // Howie Davies + @"HIP", @"SOG", @"MCMD", // Jochen Hippel + @"HIP7", @"S7G", // Jochen Hippel 7V + @"HST", // Jochen Hippel ST + @"HOT", // Anders Øland + @"IMS", // ImageMusicSystem + @"IS", // In Stereo + @"IS20",// In Stereo 2 + @"JAM", @"JC", // JamCracker + @"JCB", @"JCBO", // Jason Brooke + @"JD", @"DODA", //Special FX + @"JO", // Jesper Olsen + @"JP", @"JPN", @"JPND", // Jason Page + @"JPO", @"JPOLD", // Steve Turner + @"JMF", // Janko Mrsic-Flogel + @"JT", @"MON_OLD", // Jeroen Tel + @"KH", // Kris Hatlelid + @"KIM", // Kim Christensen + @"KRIS",// ChipTracker + @"LME", // LegglessMusicEditor + @"MA", // Music Assembler + @"MAX", // Maximum Effect + @"MC", @"MCR", @"MCO", // Major Coooksey + @"MCMD", + @"MD", // Mike Davies + @"MMDC", + @"MM4", @"MM8", // Music Maker + @"MMS", @"SFX20", // MultiMedia Sound + @"MED", @"MMD0", @"MMD1", @"MMD2", @"OCTAMED", // Octamed + @"MK2", @"MKII", // MarkII + @"MXTX",// Maxtrax + @"MCMD",// MCMD + @"MIDI",// MIDI-loriciel + //@"ML",@"Ml" // MusicLine Editor - disabled since ML player does not handle file paths longer than 127 chars. + @"MOK", // Silmarilis + @"MON", // ManiacsOfNoise + @"MSO", // Medley + @"MTP2", @"HN", @"THN", // Major Tom's Player + @"MW", @"AVP", // Martin Walker + @"NTP", // NovoTrade Packer + @"OKT", // Oktalyzer + @"ONE", // OnEscapee + @"OSP", // Synth Pack + @"PAT", // Paul Tonge + @"PAP", // Pierre Adane + @"PM20",// Promizer + @"PM40",// Promizer + @"PN", // Pokey Noise + @"POWT", @"PT", // Laxity + @"PRU1",// ProRunner + @"PRU2",// ProRunner + @"PS", // Paul Shields + @"PSA", // ProfessionalSoundArtists + @"PSF", // SoundFactory + @"PUMA",// PumaTracker + @"PVP", // PeterVerswyvelen + @"RIFF",// Riff Raff + @"RJ", @"RJP", // Richard Joseph + @"RH", @"RHO", // Rob Hubbard + @"SC", @"SCT", // Sound Control + @"SCN", @"S-C", // Sean Connolly + @"SA", @"SONIC", // Sonic Arranger + @"SB", // SteveBarrett + @"SAS", // SpeedyA1System + @"SCR", // Sean Conran + @"SDR", // Synthdream + @"SFX", @"SFX13", // Sound-FX + @"SID1", @"SID2", @"SMN", // SidMon 1,2 + @"SJS", // SoundPlayer + @"SM", @"SM1", @"SM2", @"SM3", @"SMPRO", // SoundMaster + @"SNK", // Paul Summers + @"SNG", // ZoundMonitor + @"SNX", @"SMUS", @"TINY", // Sonix Music Driver + @"SPL", // Sound Programming Language + @"SS", // SpeedySystem + @"ST", @"SYNMOD", // SynTracker + @"SUN", // SunTronic + @"SYN", // Synth + @"SYNMOD", // Syntracker + @"TCB", // TCB Tracker + @"THM", // Thomas Hermann + @"TMK", // Time Tracker + @"TF", // Tim Follin + @"TMFX", @"TMFX1.5", @"TFHD1.5", @"TMFX7V", @"TFHD7V", @"TMFXPRO", @"MDST", @"MDAT",// TFMX + @"TME", // TheMusicalEnlightement + @"TPU", // Dirk Bialluch + @"TRC", @"TRO", @"DP", @"TRONIC", // Tronic + @"TWO", // NTSP-System + @"TW", // SoundImages + @"UFO", @"MUS", // UFO + @"VSS", // Voodoo Supreme Synthesizer + @"WB", // Wally Beben + @"YM", // YM-2149, + @"QPA", @"SQT", @"QTS", // Quartet - PSG - ST + ]; +} + +// Handle main UADE thread (amiga emu) +-(void) uadeThread:(NSArray*)params { + uadethread_running = 1; + NSLog(@"UADECore enter"); + @autoreleasepool { + const char* inParam = [[params objectAtIndex:0] UTF8String]; + const char* outParam = [[params objectAtIndex:1] UTF8String]; + + [[NSThread currentThread] setThreadPriority:0.9f]; + const char *argv[5] = {"uadecore", "-i", inParam, "-o", outParam}; + uadecore_main(5,(char**)argv); + } + NSLog(@"UADECore exit"); + uadethread_running=0; +} + +- (UADEReplayer*) init { + self = [super init]; + if (self) { + NSString* bu = [NSBundle mainBundle].resourcePath; + NSString* bd = [bu stringByAppendingString:@"/Frameworks/uade_ios.framework/UADERes.bundle"]; + + strcpy(basedir, [bd UTF8String]); + struct uade_config *cfg = uade_new_config(); + sprintf(uadescorename, "%s/score",basedir); + uade_config_set_option(cfg, UC_VERBOSE, [@"1" UTF8String]); + uade_config_set_option(cfg, UC_BASE_DIR, basedir); + uade_config_set_option(cfg, UC_SCORE_FILE, uadescorename); + ustate = [self create_state:cfg]; + free(cfg); + + } + return self; +} + +- (void)dealloc { + NSLog(@"UADEReplayer deallocated"); +} + +- (void) cleanup { + uae_quit(); + uade_stop(ustate); + uade_cleanup_state(ustate); + while(uadethread_running) { + } + quit_program = 0; + close(fds[0]); + close(fds[1]); +} + +/// Create UADE state. Implementation is identical with `uade_new_state` provided by libuade, +/// with the exception that uadecore is spawned in a thread, not a separate process. +/// @param extraconfig any client-specific configuration +- (struct uade_state*) create_state:(struct uade_config*)extraconfig { + struct uade_state *state; + DIR *bd; + char path[PATH_MAX]; + const char *basedir; + + state = calloc(1, sizeof *state); + if (!state) + return NULL; + + basedir = NULL; + if (extraconfig != NULL && extraconfig->basedir_set) + basedir = extraconfig->basedir.name; + + if (!uade_load_initial_config(state, basedir)) { + NSLog(@"Config not loaded"); + return nil; + + } + if (extraconfig) { + state->extraconfig = *extraconfig; + } + else { + uade_config_set_defaults(&state->extraconfig); + } + + state->config = state->permconfig; + uade_merge_configs(&state->config, &state->extraconfig); + + uade_load_initial_song_conf(state); + //load_content_db(state); + + bd = opendir(state->config.basedir.name); + if (bd == NULL) { + NSLog(@"Could not access dir %s", state->config.basedir.name); + return nil; + } + closedir(bd); + + uade_config_set_option(&state->config, UC_UADECORE_FILE, + UADE_CONFIG_UADE_CORE); + + snprintf(path, sizeof path, "%s/uaerc", state->config.basedir.name); + uade_config_set_option(&state->config, UC_UAE_CONFIG_FILE, path); + + uade_merge_configs(&state->config, &state->extraconfig); + + if (access(state->config.uae_config_file.name, R_OK)) { + NSLog(@"Could not read uae config file: %s", state->config.uae_config_file.name); + return nil; + } + + // set up ipc + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) { + NSLog(@"Cannot create socket pair"); + return nil; + }; + + NSArray* params = @[[NSString stringWithFormat:@"%d", fds[0]], [NSString stringWithFormat:@"%d", fds[0]]]; + [NSThread detachNewThreadSelector:@selector(uadeThread:) toTarget:self withObject:params]; + + uade_set_peer(&state->ipc, 1, fds[1], fds[1]); + if (uade_send_string(UADE_COMMAND_CONFIG, state->config.uae_config_file.name, &state->ipc)) { + NSLog(@"Can not send config name: %s", strerror(errno)); + return nil; + } + + return state; +} + +- (bool)loadModule:(NSString *)path type:(NSString *)type { + + NSData* data = [[NSFileManager defaultManager] contentsAtPath:path]; + if (!data) return false; + + + uade_stop(ustate); + + if (!uade_is_our_file_from_buffer([path UTF8String], data.bytes, data.length, ustate)) { + NSLog(@"Not our file"); + return false; + } + uade_play_from_buffer([path UTF8String], data.bytes, data.length, 0, ustate); + + return true; +} + +- (void)setCurrentPosition:(int)newPosition { +} + +- (void)setInterpolationFilterLength:(NSInteger)value { + if (value == 0 ) { + uade_config_set_option(&ustate->config, UC_FORCE_LED_ON, nil); + uade_set_filter_state(ustate, 1); + } else { + uade_config_set_option(&ustate->config, UC_FORCE_LED_OFF, nil); + uade_set_filter_state(ustate, 0); + } +} + +- (void)setStereoSeparation:(NSInteger)value { + float newValue = (float)value/100.0*2.0; // (parameter range 0-100, uade range 0-2) + uade_effect_pan_set_amount(ustate, newValue); +} + +- (int)currentPosition { + return 0; +} + +- (NSArray *)getInstruments { + return @[]; +} + +- (NSArray *)getSamples { + const struct uade_song_info *info = uade_get_song_info(ustate); + NSString* playerName = [[NSString stringWithUTF8String: info->playerfname] componentsSeparatedByString:@"/"].lastObject; + return @[@"UADE Player:", playerName]; +} + +- (int)moduleLength { + if(ustate) { + return ustate->song.info.duration; + } + return 0; +} + +- (NSInteger)numberOfChannels { + return 4; +} + +- (NSInteger)volumeOnChannel:(NSInteger)channel { + return 1; +} + +- (int)readFrames:(size_t)count bufLeft:(int16_t *)bufLeft bufRight:(int16_t *)bufRight { + int16_t buf[count*2]; + ssize_t retVal = uade_read(&buf, sizeof buf, ustate); + + if(retVal<0) { + NSLog(@"Error reading data"); + return 0; + } + for(int ptr=0; ptr<(count*2); ptr+=2) { + *bufLeft++ = buf[ptr]; + *bufRight++ = buf[ptr+1]; + } + return (int)retVal; +} + +@end diff --git a/4champ/Scenes/About/AboutInteractor.swift b/4champ/Scenes/About/AboutInteractor.swift index f027157..df5969e 100644 --- a/4champ/Scenes/About/AboutInteractor.swift +++ b/4champ/Scenes/About/AboutInteractor.swift @@ -66,11 +66,12 @@ class AboutInteractor: AboutBusinessLogic, AboutDataStore let titleKeys = [aboutTitle, "Twitter","About_Copyrights", "TabBar_Local", "TabBar_Playlist", "TabBar_Search", "TabBar_Radio", "About_Licenses"] let contentKeys = ["AboutView_Info", "AboutView_Twitter", "AboutView_Legal", "AboutView_Local","AboutView_Playlists", "AboutView_Search", "AboutView_Radio"] let imageKeys = ["about", "twitter_small", "legal", "localMods", "playlist", "search", "radio", "about"] - let lics = ["Alamofire", "GzipSwift", "HivelyTracker", "LibOpenMPT"] + let lics = ["Alamofire", "GzipSwift", "HivelyTracker", "LibOpenMPT", "UADE"] let licUrls = ["https://github.com/Alamofire/Alamofire/blob/master/LICENSE", "https://github.com/1024jp/GzipSwift/blob/develop/LICENSE", "HivelyTracker replayer source code is public domain, see http://www.hivelytracker.co.uk/forum.php?action=viewthread&id=114", - "https://lib.openmpt.org/libopenmpt/license/"] + "https://lib.openmpt.org/libopenmpt/license/", + "https://gitlab.com/uade-music-player/uade/-/blob/master/COPYING"] details = About.Details(titles: titleKeys, contents: contentKeys, images: imageKeys, licenseLinks: licUrls, licenseNames: lics) } diff --git a/4champ/Scenes/Local/LocalViewController.swift b/4champ/Scenes/Local/LocalViewController.swift index 753805f..8ac8c6f 100644 --- a/4champ/Scenes/Local/LocalViewController.swift +++ b/4champ/Scenes/Local/LocalViewController.swift @@ -146,7 +146,9 @@ class LocalViewController: UIViewController, LocalDisplayLogic } func updateBarButtons() { - let addBtn = UIBarButtonItem.init(image: UIImage.init(systemName: "square.and.arrow.down"), style: .plain, target: self, action: #selector(handleBarButtonPress(sender:))) + let config = UIImage.SymbolConfiguration(pointSize: 14, weight: .light, scale: .large) + let importImage = UIImage.init(systemName: "square.and.arrow.down", withConfiguration: config) + let addBtn = UIBarButtonItem.init(image: importImage, style: .plain, target: self, action: #selector(handleBarButtonPress(sender:))) addBtn.tag = -2 // no sort key for import button let btn1 = UIBarButtonItem.init(title: "ModuleInfo_Type".l13n(), style: .plain, target: self, action: #selector(handleBarButtonPress(sender:))) btn1.tag = LocalSortKey.type.rawValue diff --git a/4champ/Scenes/Radio/RadioInteractor.swift b/4champ/Scenes/Radio/RadioInteractor.swift index 69b2c00..4c3a1ae 100644 --- a/4champ/Scenes/Radio/RadioInteractor.swift +++ b/4champ/Scenes/Radio/RadioInteractor.swift @@ -168,9 +168,11 @@ class RadioInteractor: NSObject, RadioBusinessLogic, RadioDataStore, RadioRemote if let currentIndex = radioSessionHistory.index(of: currentMod), currentIndex >= 0 { nextIndex = currentIndex + 1 } - postFetchAction = .insertToQueue - let fetcher = ModuleFetcher.init(delegate: self) - fetcher.fetchModule(ampId: radioSessionHistory[nextIndex].id!) + if radioSessionHistory.count > nextIndex, let prevId = radioSessionHistory[nextIndex].id { + postFetchAction = .insertToQueue + let fetcher = ModuleFetcher.init(delegate: self) + fetcher.fetchModule(ampId: prevId) + } } func playFromSessionHistory(at: IndexPath) { diff --git a/4champ/l13n/da.lproj/Localizable.strings b/4champ/l13n/da.lproj/Localizable.strings index ecd325d9348aae3230ce02d6adc519ffe8380119..4b8700516a09cf524e7f71ce492b52ce409d027e 100644 GIT binary patch delta 34 pcmex!jMxDu=LGrx$4CxFC4518;3@!|=n^l9tMFG8j2^;_b delta 24 fcmeA;&-mvY;|7)>Rt1K9hV;p-LGqhTf#tq9tH*X4c69)i4M+aK~ diff --git a/4champ/l13n/en.lproj/Localizable.strings b/4champ/l13n/en.lproj/Localizable.strings index 1524b187508a55c9cc41d76d2ecdb48fc284d754..158b89a70fa685f135766dd598e285806b6282bf 100644 GIT binary patch delta 26 icmexyldLnwnIgA0S}X2Y=aQUGyR2c!T1 delta 14 VcmeBq#MtnNaf4CVX1lO+QUEck208!$ diff --git a/4champ/l13n/fi.lproj/Localizable.strings b/4champ/l13n/fi.lproj/Localizable.strings index e8133f062b9ab9507e271d22afa31150fd0e0bc2..08da68da232f59363732df52ea083fab49ae52f1 100644 GIT binary patch delta 50 zcmdmRlkvz+#tqAYloc4V7!ny27(y8w8C)1#8FU%488R7)z@o(rB@FotS(~>8{gwm( DZpsbn delta 30 kcmX?dlW_wOEeqn$X2@hHV#s1hWGH4RVaVTnGU&G?0JXsjDF6Tf diff --git a/4champ/l13n/nb.lproj/Localizable.strings b/4champ/l13n/nb.lproj/Localizable.strings index 4be22117edf3388b62d579a2340fcd1c1a5ef895..d9d531122a112f2cb97b4d5f06d25020c0e524f0 100644 GIT binary patch delta 26 icmex$g|Y1_%J}OFm8&Bmg-<2Fw5e diff --git a/4champ/l13n/ru.lproj/Localizable.strings b/4champ/l13n/ru.lproj/Localizable.strings index d63839e71b951ef97784abf710d0aa7b22e944bb..4e2612a1470601ada45a8efe4fe4b877f6536c48 100644 GIT binary patch delta 26 icmex!ld + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/LICENSE.MIT b/LICENSE.MIT new file mode 100644 index 0000000..e4b9c85 --- /dev/null +++ b/LICENSE.MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Aleksi Sitomaniemi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 7b9645a..4e3ba3a 100644 --- a/README.md +++ b/README.md @@ -2,30 +2,28 @@ 4champ is an app that provides a mobile interface to [Amiga Music Preservation](http://amp.dascene.net) database on iOS devices. +[![appstore badge](docs/images/appstore_badge.png "click to open page in appstore")](https://apps.apple.com/app/4champ/id578311010) + +![application screenshots](docs/images/screens.png "4champ search and radio screens") + Many of us who grew up with computers in the 80's and early 90's remember Amiga and particularly its mind-blowing audio capabilities which were unrivaled at the era. Amiga inspired a lot of musicians to produce a vast amount of compositions, or modules as they were called. [Amiga Music Preservation](http://amp.dascene.net) is a non-profit project that collects anything related to Amiga music production. AMP database boasts over 160 000 modules, 4champ app is your direct access to all that goodness. -### Development journal - -In this repository I'm working on rewriting the app that originally was released in AppStore in 2012. It was available in the store until late 2017, when I decided to remove the app from there as I could not release updates any more due to missing third party content license. - -In early 2020 I have set up a Sole Proprietor developer account in App Store and the third party content licensing issue has been resolved. The app is now in back in the AppStore, you can download it at [https://apps.apple.com/app/4champ/id578311010](https://apps.apple.com/app/4champ/id578311010). - If you're interested to test new features when they're getting implemented before official App Store releases, you can join the beta program at https://testflight.apple.com/join/j1yhaJQ1. -You can read more about the history of the app and follow the rewrite process on the development journal that I created for this project: [sitomani.github.io/4champ](https://sitomani.github.io/4champ). +You can read more about the history of the app and follow my work on the app at the development journal that I created for this project: [sitomani.github.io/4champ](https://sitomani.github.io/4champ). You can also follow the [@4champ_app](https://twitter.com/4champ_app) Twitter account to stay up to date on what's happening with the app. -### Main Features and their current status in this repository +### Main Features of the app -- Radio: You can listen to a random set of tunes from the whole collection of over 150000 modules, or stream from the head, i.e. the most recently added ones. You can also play from the local collection from set of modules that you've selected to keep for offline mode. This was implemented first in the rewrite. -- Search (search the AMP database by module, composer, group name or sampletexts): Implemented in October 2018. -- Playlists (build your own playlists): Playlists implemented in April 2020. -- Local Collection (store modules locally): Persistent storage for off-line listening of modules implemented June 2019. -- Settings (control stereo separation etc): Stereo separation setting implemented in November 2018. -- Import modules from filesystem (local / cloud / network). The first complete new feature that never existed in the old generation app. August 2021. +- Search: Search the AMP database by module, composer, group name or sampletexts. +- Radio: You can listen to a random set of tunes from the whole collection of over 150000 modules, or stream from the head, i.e. the most recently added ones. You can also play from the local collection from set of modules that you've selected to keep for offline mode. +- Playlists: Build your own playlists from modules. +- Local Collection: store modules locally - persistent storage for off-line listening of modules. +- Settings: Control stereo separation, sound interpolation etc. +- Import modules from filesystem (local / cloud / network) ### Dependencies @@ -37,7 +35,7 @@ You can also follow the [@4champ_app](https://twitter.com/4champ_app) Twitter ac ##### B. Module Playback Libraries -4champ uses [libOpenMPT](https://github.com/OpenMPT/openmpt) and [Hivelytracker](https://github.com/pete-gordon/hivelytracker) for module playback. +4champ uses [libOpenMPT](https://github.com/OpenMPT/openmpt), [Hivelytracker](https://github.com/pete-gordon/hivelytracker) and [UADE](https://gitlab.com/sitomani/uade-ios) for module playback. **Hivelytracker** replayer code is included in [4champ/Replay/Hively](4champ/replay/hively) folder, so it will be built automatically when you build xcode projects in this repository, no further actions needed. @@ -50,6 +48,8 @@ You can also follow the [@4champ_app](https://twitter.com/4champ_app) Twitter ac 5. Execute `iOS_build.sh` to build the fat framework file for iOS use (supports simulators on both Intel and M1 macs and all Arm64 iOS devices) 6. After successful build, the framework file `libopenmpt.framework` will be found under openmpt repository root, and 4champ repository projects are configured to find it there, provided that you have cloned this repository and openmpt repository in the same folder. +**UADE** likewise, the UADE framework implementation is my port for iOS at https://gitlab.com/sitomani/uade-ios. Clone the repository in the same parent folder and build the framework following instructions in the cloned repository before building the app. + ### Building the app After setting up the dependencies you can open 4champ.xcodeproj in Xcode and build the application. On simulator you can run the app without any further changes. @@ -60,11 +60,13 @@ The Xcode generated developer certificate will only be valid for 7 days, which m ### License -The code in this repository is copyright © Aleksi Sitomaniemi and licensed under [MIT license](LICENSE), **except** for HivelyTracker replay routine code which is by licenced under [BSD-3](4champ/replay/hively/LICENSE) by [Pete Gordon](https://github.com/pete-gordon). +The code in this repository is copyright © Aleksi Sitomaniemi and dual licensed under [GPL](LICENSE.GPL) and [MIT](LICENSE.MIT), **except** for HivelyTracker replay routine code which is by licenced under [BSD-3](4champ/replay/hively/LICENSE) by [Pete Gordon](https://github.com/pete-gordon). -Module files included under _SamplePlayer_ test project that I've used to verify the the replay routine are work of the original authors: +Module files included under _SamplePlayer_ test project that I've used to verify the the replay routines are work of the original authors: _1st_intro.mod_ by florist (Aleksi Sitomaniemi - yup that's me!)
_all.in.eightchannels.xm_ by Daze (Patrick Glasby-Baldwin)
+_jinx.jam_ by Jeff (Ingmar Hänsch)
_mislead.ahx_ by Pink (Manfred Linzner)
_peanuts!.hvl_ by Lavaburn (Dale Whinham)
+_sweet_dreams.aon_ by Toodeloo (Anders Nilsson)
diff --git a/SamplePlayer/SamplePlayer.xcodeproj/project.pbxproj b/SamplePlayer/SamplePlayer.xcodeproj/project.pbxproj index 1ea890d..81a614c 100644 --- a/SamplePlayer/SamplePlayer.xcodeproj/project.pbxproj +++ b/SamplePlayer/SamplePlayer.xcodeproj/project.pbxproj @@ -16,11 +16,28 @@ 45D707E6208B7C52004CB16A /* HVLReplayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 45D707DA208B7C52004CB16A /* HVLReplayer.mm */; }; 45D707E7208B7C52004CB16A /* MPTReplayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D707DD208B7C52004CB16A /* MPTReplayer.m */; }; 45D707E8208B7C52004CB16A /* Replay.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D707DF208B7C52004CB16A /* Replay.m */; }; - 73759FCA28EB271A00535F8E /* libopenmpt.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73759FC928EB271A00535F8E /* libopenmpt.xcframework */; }; + 735012E028EC9702003EF294 /* UADEReplayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 735012DF28EC9702003EF294 /* UADEReplayer.m */; }; + 73759FCA28EB271A00535F8E /* libopenmpt.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73759FC928EB271A00535F8E /* libopenmpt.xcframework */; settings = {ATTRIBUTES = (Required, ); }; }; 73759FD028EB2B0A00535F8E /* Modules.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 73759FCF28EB2B0A00535F8E /* Modules.bundle */; }; + 7397C1E929092561002D5CDB /* uade_ios.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73E345A6290595DA00B3C937 /* uade_ios.xcframework */; }; + 7397C1EA29092561002D5CDB /* uade_ios.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 73E345A6290595DA00B3C937 /* uade_ios.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 739D39B82652A0EC001EBC9E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 739D39B72652A0EC001EBC9E /* libz.tbd */; }; /* End PBXBuildFile section */ +/* Begin PBXCopyFilesBuildPhase section */ + 7397C1EB29092561002D5CDB /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 7397C1EA29092561002D5CDB /* uade_ios.xcframework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 45C005B1208B7B1800126E78 /* SamplePlayer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SamplePlayer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45C005B4208B7B1800126E78 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -38,9 +55,12 @@ 45D707DD208B7C52004CB16A /* MPTReplayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTReplayer.m; sourceTree = ""; }; 45D707DE208B7C52004CB16A /* Replay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Replay.h; sourceTree = ""; }; 45D707DF208B7C52004CB16A /* Replay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Replay.m; sourceTree = ""; }; + 735012DE28EC9702003EF294 /* UADEReplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UADEReplayer.h; sourceTree = ""; }; + 735012DF28EC9702003EF294 /* UADEReplayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UADEReplayer.m; sourceTree = ""; }; 73759FC928EB271A00535F8E /* libopenmpt.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libopenmpt.xcframework; path = ../../openmpt/libopenmpt.xcframework; sourceTree = ""; }; 73759FCF28EB2B0A00535F8E /* Modules.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Modules.bundle; sourceTree = ""; }; 739D39B72652A0EC001EBC9E /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + 73E345A6290595DA00B3C937 /* uade_ios.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = uade_ios.xcframework; path = "../../uade-ios/uade_ios.xcframework"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -48,6 +68,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7397C1E929092561002D5CDB /* uade_ios.xcframework in Frameworks */, 73759FCA28EB271A00535F8E /* libopenmpt.xcframework in Frameworks */, 739D39B82652A0EC001EBC9E /* libz.tbd in Frameworks */, ); @@ -78,7 +99,6 @@ isa = PBXGroup; children = ( 73759FCF28EB2B0A00535F8E /* Modules.bundle */, - 45D707EF208B7E2A004CB16A /* Modules */, 45C005B4208B7B1800126E78 /* AppDelegate.swift */, 45C005B6208B7B1800126E78 /* ViewController.swift */, 45C005B8208B7B1800126E78 /* Main.storyboard */, @@ -93,6 +113,7 @@ 45D707D5208B7C52004CB16A /* Replay */ = { isa = PBXGroup; children = ( + 735012DD28EC9702003EF294 /* UADE */, 45D707D6208B7C52004CB16A /* Hively */, 45D707DB208B7C52004CB16A /* OpenMPT */, 45D707DE208B7C52004CB16A /* Replay.h */, @@ -125,17 +146,20 @@ 45D707EA208B7CEA004CB16A /* Frameworks */ = { isa = PBXGroup; children = ( + 73E345A6290595DA00B3C937 /* uade_ios.xcframework */, 73759FC928EB271A00535F8E /* libopenmpt.xcframework */, 739D39B72652A0EC001EBC9E /* libz.tbd */, ); name = Frameworks; sourceTree = ""; }; - 45D707EF208B7E2A004CB16A /* Modules */ = { + 735012DD28EC9702003EF294 /* UADE */ = { isa = PBXGroup; children = ( + 735012DE28EC9702003EF294 /* UADEReplayer.h */, + 735012DF28EC9702003EF294 /* UADEReplayer.m */, ); - path = Modules; + path = UADE; sourceTree = ""; }; /* End PBXGroup section */ @@ -148,6 +172,7 @@ 45C005AD208B7B1800126E78 /* Sources */, 45C005AE208B7B1800126E78 /* Frameworks */, 45C005AF208B7B1800126E78 /* Resources */, + 7397C1EB29092561002D5CDB /* Embed Frameworks */, ); buildRules = ( ); @@ -216,6 +241,7 @@ 45D707E8208B7C52004CB16A /* Replay.m in Sources */, 45C005B7208B7B1800126E78 /* ViewController.swift in Sources */, 45C005B5208B7B1800126E78 /* AppDelegate.swift in Sources */, + 735012E028EC9702003EF294 /* UADEReplayer.m in Sources */, 45D707E7208B7C52004CB16A /* MPTReplayer.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -290,7 +316,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -341,7 +367,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -358,13 +384,20 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 2G92PSCBJ9; - HEADER_SEARCH_PATHS = ../../openmpt/libopenmpt; + HEADER_SEARCH_PATHS = ( + "../../uade-ios/src/frontends/include", + ../../openmpt/libopenmpt, + "../../uade-ios/src/include", + ); INFOPLIST_FILE = SamplePlayer/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ../../openmpt; + LIBRARY_SEARCH_PATHS = ( + "../../openmpt/**", + "../../uade/**", + ); PRODUCT_BUNDLE_IDENTIFIER = com.4champ.SamplePlayer; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -382,13 +415,20 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 2G92PSCBJ9; - HEADER_SEARCH_PATHS = ../../openmpt/libopenmpt; + HEADER_SEARCH_PATHS = ( + "../../uade-ios/src/frontends/include", + ../../openmpt/libopenmpt, + "../../uade-ios/src/include", + ); INFOPLIST_FILE = SamplePlayer/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ../../openmpt; + LIBRARY_SEARCH_PATHS = ( + "../../openmpt/**", + "../../uade/**", + ); PRODUCT_BUNDLE_IDENTIFIER = com.4champ.SamplePlayer; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/SamplePlayer/SamplePlayer/Assets.xcassets/AppIcon.appiconset/Contents.json b/SamplePlayer/SamplePlayer/Assets.xcassets/AppIcon.appiconset/Contents.json index 1d060ed..9221b9b 100644 --- a/SamplePlayer/SamplePlayer/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/SamplePlayer/SamplePlayer/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -2,92 +2,97 @@ "images" : [ { "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "scale" : "2x", + "size" : "60x60" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "scale" : "3x", + "size" : "60x60" }, { "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" + "scale" : "1x", + "size" : "20x20" }, { "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" + "scale" : "1x", + "size" : "29x29" }, { "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" + "scale" : "1x", + "size" : "40x40" }, { "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" + "scale" : "1x", + "size" : "76x76" }, { "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" + "scale" : "2x", + "size" : "76x76" }, { "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/SamplePlayer/SamplePlayer/Base.lproj/Main.storyboard b/SamplePlayer/SamplePlayer/Base.lproj/Main.storyboard index dafcd9e..4642d1f 100644 --- a/SamplePlayer/SamplePlayer/Base.lproj/Main.storyboard +++ b/SamplePlayer/SamplePlayer/Base.lproj/Main.storyboard @@ -16,7 +16,7 @@ -