2013-10-15 14:49:53 +00:00
|
|
|
//
|
|
|
|
// MIDIDecoder.mm
|
|
|
|
// MIDI
|
|
|
|
//
|
|
|
|
// Created by Christopher Snowhill on 10/15/13.
|
|
|
|
// Copyright 2013 __NoWork, Inc__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "MIDIDecoder.h"
|
|
|
|
|
2016-01-21 05:11:05 +00:00
|
|
|
#import "AUPlayer.h"
|
2022-02-09 02:29:03 +00:00
|
|
|
#import "BMPlayer.h"
|
2016-05-29 04:39:10 +00:00
|
|
|
#import "MSPlayer.h"
|
2013-10-15 14:49:53 +00:00
|
|
|
|
|
|
|
#import "Logging.h"
|
|
|
|
|
|
|
|
#import <midi_processing/midi_processor.h>
|
|
|
|
|
2014-02-14 05:16:18 +00:00
|
|
|
#import "PlaylistController.h"
|
|
|
|
|
2022-06-20 10:35:29 +00:00
|
|
|
#import "SandboxBroker.h"
|
|
|
|
|
2021-08-11 00:35:03 +00:00
|
|
|
#import <dlfcn.h>
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
static OSType getOSType(const char *in_) {
|
|
|
|
const unsigned char *in = (const unsigned char *)in_;
|
|
|
|
OSType v = (in[0] << 24) + (in[1] << 16) + (in[2] << 8) + in[3];
|
|
|
|
return v;
|
2016-01-21 05:11:05 +00:00
|
|
|
}
|
|
|
|
|
2013-10-15 14:49:53 +00:00
|
|
|
@implementation MIDIDecoder
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (NSInteger)testExtensions:(NSString *)pathMinusExtension extensions:(NSArray *)extensionsToTest {
|
|
|
|
NSInteger i = 0;
|
|
|
|
for(NSString *extension in extensionsToTest) {
|
|
|
|
if([[NSFileManager defaultManager] fileExistsAtPath:[pathMinusExtension stringByAppendingPathExtension:extension]])
|
|
|
|
return i;
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
return -1;
|
2013-10-24 05:53:39 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (BOOL)open:(id<CogSource>)s {
|
|
|
|
// We need file-size to use midi_processing
|
|
|
|
if(![s seekable]) {
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2022-07-02 05:06:08 +00:00
|
|
|
sampleRate = [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] valueForKey:@"synthSampleRate"] doubleValue];
|
|
|
|
if(sampleRate < 8000.0) {
|
|
|
|
sampleRate = 44100.0;
|
|
|
|
} else if(sampleRate > 192000.0) {
|
|
|
|
sampleRate = 192000.0;
|
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
source = s;
|
|
|
|
|
|
|
|
std::vector<uint8_t> file_data;
|
|
|
|
|
|
|
|
[s seek:0 whence:SEEK_END];
|
|
|
|
size_t size = [s tell];
|
|
|
|
[s seek:0 whence:SEEK_SET];
|
|
|
|
file_data.resize(size);
|
|
|
|
[s read:&file_data[0] amount:size];
|
|
|
|
|
|
|
|
if(!midi_processor::process_file(file_data, [[[s url] pathExtension] UTF8String], midi_file))
|
|
|
|
return NO;
|
|
|
|
|
|
|
|
if(!midi_file.get_timestamp_end(track_num))
|
2013-10-15 14:49:53 +00:00
|
|
|
return NO;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
track_num = [[[s url] fragment] intValue]; // What if theres no fragment? Assuming we get 0.
|
|
|
|
|
|
|
|
midi_file.scan_for_loops(true, true, true, true);
|
|
|
|
|
|
|
|
framesLength = midi_file.get_timestamp_end(track_num, true);
|
|
|
|
|
|
|
|
unsigned long loopStart = midi_file.get_timestamp_loop_start(track_num, true);
|
|
|
|
unsigned long loopEnd = midi_file.get_timestamp_loop_end(track_num, true);
|
|
|
|
|
|
|
|
if(loopStart == ~0UL) loopStart = 0;
|
|
|
|
if(loopEnd == ~0UL) loopEnd = framesLength;
|
|
|
|
|
|
|
|
if(loopStart != 0 || loopEnd != framesLength) {
|
|
|
|
// two loops and a fade
|
2022-07-02 05:06:08 +00:00
|
|
|
double defaultFade = [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] valueForKey:@"synthDefaultFadeSeconds"] doubleValue];
|
|
|
|
if(defaultFade < 0.0) {
|
|
|
|
defaultFade = 0.0;
|
|
|
|
}
|
2022-02-07 05:49:27 +00:00
|
|
|
framesLength = loopStart + (loopEnd - loopStart) * 2;
|
2022-07-02 05:06:08 +00:00
|
|
|
framesFade = (int)ceil(defaultFade * 1000.0);
|
2022-02-07 05:49:27 +00:00
|
|
|
isLooped = YES;
|
|
|
|
} else {
|
|
|
|
framesLength += 1000;
|
|
|
|
framesFade = 0;
|
|
|
|
isLooped = NO;
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2022-07-02 05:06:08 +00:00
|
|
|
framesLength = (int)ceil(framesLength * sampleRate * 0.001);
|
|
|
|
framesFade = (int)ceil(framesFade * sampleRate * 0.001);
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
totalFrames = framesLength + framesFade;
|
|
|
|
|
|
|
|
framesRead = 0;
|
|
|
|
|
2016-06-30 05:12:58 +00:00
|
|
|
[self willChangeValueForKey:@"properties"];
|
|
|
|
[self didChangeValueForKey:@"properties"];
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2016-06-30 05:12:58 +00:00
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (NSDictionary *)properties {
|
2022-06-17 13:39:02 +00:00
|
|
|
return @{ @"bitrate": @(0),
|
2022-07-02 05:06:08 +00:00
|
|
|
@"sampleRate": @(sampleRate),
|
2022-06-17 13:39:02 +00:00
|
|
|
@"totalFrames": @(totalFrames),
|
|
|
|
@"bitsPerSample": @(32),
|
|
|
|
@"floatingPoint": @(YES),
|
|
|
|
@"channels": @(2),
|
|
|
|
@"seekable": @(YES),
|
|
|
|
@"codec": @"MIDI",
|
|
|
|
@"endian": @"host",
|
|
|
|
@"encoding": @"synthesized" };
|
2016-06-30 05:12:58 +00:00
|
|
|
}
|
|
|
|
|
2022-02-09 03:56:39 +00:00
|
|
|
- (NSDictionary *)metadata {
|
|
|
|
return @{};
|
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (BOOL)initDecoder {
|
|
|
|
NSString *soundFontPath = @"";
|
|
|
|
|
|
|
|
if([[source url] isFileURL]) {
|
|
|
|
// Let's check for a SoundFont
|
2022-06-30 06:25:59 +00:00
|
|
|
NSArray *extensions = @[@"sflist", @"sf2pack", @"sf2", @"sf3"];
|
2022-02-07 05:49:27 +00:00
|
|
|
NSString *filePath = [[source url] path];
|
|
|
|
NSString *fileNameBase = [filePath lastPathComponent];
|
|
|
|
filePath = [filePath stringByDeletingLastPathComponent];
|
|
|
|
soundFontPath = [filePath stringByAppendingPathComponent:fileNameBase];
|
|
|
|
NSInteger extFound;
|
|
|
|
if((extFound = [MIDIDecoder testExtensions:soundFontPath extensions:extensions]) < 0) {
|
|
|
|
fileNameBase = [fileNameBase stringByDeletingPathExtension];
|
|
|
|
soundFontPath = [filePath stringByAppendingPathComponent:fileNameBase];
|
|
|
|
if((extFound = [MIDIDecoder testExtensions:soundFontPath extensions:extensions]) < 0) {
|
|
|
|
fileNameBase = [filePath lastPathComponent];
|
|
|
|
soundFontPath = [filePath stringByAppendingPathComponent:fileNameBase];
|
|
|
|
extFound = [MIDIDecoder testExtensions:soundFontPath extensions:extensions];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(extFound >= 0) {
|
|
|
|
soundFontPath = [soundFontPath stringByAppendingPathExtension:[extensions objectAtIndex:extFound]];
|
|
|
|
} else
|
|
|
|
soundFontPath = @"";
|
|
|
|
}
|
|
|
|
|
|
|
|
DLog(@"Length: %li", totalFrames);
|
|
|
|
|
|
|
|
DLog(@"Track num: %i", track_num);
|
|
|
|
|
|
|
|
MIDIPlayer::filter_mode mode = MIDIPlayer::filter_sc55;
|
|
|
|
|
|
|
|
NSString *flavor = [[NSUserDefaults standardUserDefaults] stringForKey:@"midi.flavor"];
|
|
|
|
if([flavor isEqualToString:@"default"])
|
|
|
|
mode = MIDIPlayer::filter_default;
|
|
|
|
else if([flavor isEqualToString:@"gm"])
|
|
|
|
mode = MIDIPlayer::filter_gm;
|
|
|
|
else if([flavor isEqualToString:@"gm2"])
|
|
|
|
mode = MIDIPlayer::filter_gm2;
|
|
|
|
else if([flavor isEqualToString:@"sc55"])
|
|
|
|
mode = MIDIPlayer::filter_sc55;
|
|
|
|
else if([flavor isEqualToString:@"sc88"])
|
|
|
|
mode = MIDIPlayer::filter_sc88;
|
|
|
|
else if([flavor isEqualToString:@"sc88pro"])
|
|
|
|
mode = MIDIPlayer::filter_sc88pro;
|
|
|
|
else if([flavor isEqualToString:@"sc8850"])
|
|
|
|
mode = MIDIPlayer::filter_sc8850;
|
|
|
|
else if([flavor isEqualToString:@"xg"])
|
|
|
|
mode = MIDIPlayer::filter_xg;
|
|
|
|
|
|
|
|
globalSoundFontPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"soundFontPath"];
|
|
|
|
|
2022-06-20 10:35:29 +00:00
|
|
|
if(globalSoundFontPath && [globalSoundFontPath length] > 0) {
|
2022-06-21 05:10:43 +00:00
|
|
|
NSURL *sandboxURL = [NSURL fileURLWithPath:[globalSoundFontPath stringByDeletingLastPathComponent]];
|
2022-06-20 10:35:29 +00:00
|
|
|
|
|
|
|
id sandboxBrokerClass = NSClassFromString(@"SandboxBroker");
|
|
|
|
id sandboxBroker = [sandboxBrokerClass sharedSandboxBroker];
|
|
|
|
|
2022-06-21 05:10:43 +00:00
|
|
|
sbHandle = [sandboxBroker beginFolderAccess:sandboxURL];
|
|
|
|
} else {
|
|
|
|
sbHandle = NULL;
|
2022-06-20 10:35:29 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
// First detect if soundfont has gone AWOL
|
|
|
|
if(![[NSFileManager defaultManager] fileExistsAtPath:globalSoundFontPath]) {
|
|
|
|
globalSoundFontPath = nil;
|
|
|
|
[[NSUserDefaults standardUserDefaults] setValue:globalSoundFontPath forKey:@"soundFontPath"];
|
|
|
|
}
|
|
|
|
|
|
|
|
NSString *plugin = [[NSUserDefaults standardUserDefaults] stringForKey:@"midiPlugin"];
|
|
|
|
|
|
|
|
// Then detect if we should force the DLSMusicSynth, which has its own bank
|
2022-02-09 02:29:03 +00:00
|
|
|
if(!plugin || [plugin isEqualToString:@"BASSMIDI"]) {
|
2022-02-07 05:49:27 +00:00
|
|
|
if(!globalSoundFontPath || [globalSoundFontPath isEqualToString:@""]) {
|
|
|
|
plugin = @"dls appl"; // Apple DLSMusicSynth if soundfont doesn't exist
|
|
|
|
[[NSUserDefaults standardUserDefaults] setValue:plugin forKey:@"midiPlugin"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-09 02:29:03 +00:00
|
|
|
if(!plugin || [plugin isEqualToString:@"BASSMIDI"]) {
|
|
|
|
bmplayer = new BMPlayer;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2022-02-09 02:29:03 +00:00
|
|
|
bool resamplingSinc = false;
|
2022-02-07 05:49:27 +00:00
|
|
|
NSString *resampling = [[NSUserDefaults standardUserDefaults] stringForKey:@"resampling"];
|
2022-02-09 02:29:03 +00:00
|
|
|
if([resampling isEqualToString:@"sinc"])
|
|
|
|
resamplingSinc = true;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2022-02-09 02:29:03 +00:00
|
|
|
bmplayer->setSincInterpolation(resamplingSinc);
|
2022-07-02 05:06:08 +00:00
|
|
|
bmplayer->setSampleRate(sampleRate);
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
if([soundFontPath length])
|
2022-02-09 02:29:03 +00:00
|
|
|
bmplayer->setFileSoundFont([soundFontPath UTF8String]);
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2022-02-09 02:29:03 +00:00
|
|
|
player = bmplayer;
|
2022-02-07 05:49:27 +00:00
|
|
|
} else if([[plugin substringToIndex:4] isEqualToString:@"DOOM"]) {
|
|
|
|
MSPlayer *msplayer = new MSPlayer;
|
|
|
|
player = msplayer;
|
|
|
|
|
|
|
|
msplayer->set_synth(0);
|
|
|
|
|
|
|
|
msplayer->set_bank([[plugin substringFromIndex:4] intValue]);
|
|
|
|
|
|
|
|
msplayer->set_extp(1);
|
|
|
|
|
2022-07-02 05:06:08 +00:00
|
|
|
msplayer->setSampleRate(sampleRate);
|
2022-02-07 05:49:27 +00:00
|
|
|
} else if([[plugin substringToIndex:5] isEqualToString:@"OPL3W"]) {
|
|
|
|
MSPlayer *msplayer = new MSPlayer;
|
|
|
|
player = msplayer;
|
|
|
|
|
|
|
|
msplayer->set_synth(1);
|
|
|
|
|
|
|
|
msplayer->set_bank([[plugin substringFromIndex:5] intValue]);
|
|
|
|
|
|
|
|
msplayer->set_extp(1);
|
|
|
|
|
2022-07-02 05:06:08 +00:00
|
|
|
msplayer->setSampleRate(sampleRate);
|
2022-02-07 05:49:27 +00:00
|
|
|
} else {
|
|
|
|
const char *cplugin = [plugin UTF8String];
|
|
|
|
OSType componentSubType;
|
|
|
|
OSType componentManufacturer;
|
|
|
|
|
|
|
|
componentSubType = getOSType(cplugin);
|
|
|
|
componentManufacturer = getOSType(cplugin + 4);
|
|
|
|
|
|
|
|
{
|
|
|
|
auplayer = new AUPlayer;
|
|
|
|
|
|
|
|
auplayer->setComponent(componentSubType, componentManufacturer);
|
2022-07-02 05:06:08 +00:00
|
|
|
auplayer->setSampleRate(sampleRate);
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
if([soundFontPath length]) {
|
|
|
|
auplayer->setSoundFont([soundFontPath UTF8String]);
|
|
|
|
soundFontsAssigned = YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
player = auplayer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
player->setFilterMode(mode, false);
|
|
|
|
|
|
|
|
unsigned int loop_mode = framesFade ? MIDIPlayer::loop_mode_enable | MIDIPlayer::loop_mode_force : 0;
|
|
|
|
unsigned int clean_flags = midi_container::clean_flag_emidi;
|
|
|
|
|
|
|
|
if(!player->Load(midi_file, track_num, loop_mode, clean_flags))
|
|
|
|
return NO;
|
|
|
|
|
|
|
|
return YES;
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
|
|
|
|
2022-07-10 22:14:47 +00:00
|
|
|
- (AudioChunk *)readAudio {
|
2022-02-07 05:49:27 +00:00
|
|
|
BOOL repeatone = IsRepeatOneSet();
|
|
|
|
long localFramesLength = framesLength;
|
|
|
|
long localTotalFrames = totalFrames;
|
|
|
|
|
|
|
|
if(!player) {
|
|
|
|
if(![self initDecoder])
|
2022-07-10 22:14:47 +00:00
|
|
|
return nil;
|
2022-02-07 05:49:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
player->setLoopMode((repeatone || isLooped) ? (MIDIPlayer::loop_mode_enable | MIDIPlayer::loop_mode_force) : 0);
|
|
|
|
|
|
|
|
if(!repeatone && framesRead >= localTotalFrames)
|
|
|
|
return 0;
|
|
|
|
|
2022-02-09 02:29:03 +00:00
|
|
|
if((bmplayer || auplayer) && !soundFontsAssigned) {
|
2022-02-07 05:49:27 +00:00
|
|
|
if(globalSoundFontPath != nil) {
|
2022-02-09 02:29:03 +00:00
|
|
|
if(bmplayer)
|
|
|
|
bmplayer->setSoundFont([globalSoundFontPath UTF8String]);
|
2022-02-07 05:49:27 +00:00
|
|
|
else if(auplayer)
|
|
|
|
auplayer->setSoundFont([globalSoundFontPath UTF8String]);
|
|
|
|
}
|
|
|
|
|
|
|
|
soundFontsAssigned = YES;
|
|
|
|
}
|
|
|
|
|
2022-07-10 22:14:47 +00:00
|
|
|
int frames = 1024;
|
|
|
|
float buffer[frames * 2];
|
|
|
|
|
|
|
|
UInt32 frames_done = player->Play(buffer, frames);
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
if(!frames_done)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
frames = frames_done;
|
|
|
|
|
|
|
|
if(!repeatone && framesRead + frames > localFramesLength) {
|
|
|
|
if(framesFade) {
|
|
|
|
long fadeStart = (localFramesLength > framesRead) ? localFramesLength : framesRead;
|
|
|
|
long fadeEnd = (framesRead + frames > localTotalFrames) ? localTotalFrames : (framesRead + frames);
|
|
|
|
long fadePos;
|
|
|
|
|
2022-07-10 22:14:47 +00:00
|
|
|
float *buff = buffer;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
float fadeScale = (float)(framesFade - (fadeStart - localFramesLength)) / framesFade;
|
|
|
|
float fadeStep = 1.0 / (float)framesFade;
|
|
|
|
for(fadePos = fadeStart; fadePos < fadeEnd; ++fadePos) {
|
|
|
|
buff[0] *= fadeScale;
|
|
|
|
buff[1] *= fadeScale;
|
|
|
|
buff += 2;
|
|
|
|
fadeScale -= fadeStep;
|
|
|
|
if(fadeScale < 0) {
|
|
|
|
fadeScale = 0;
|
|
|
|
fadeStep = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
frames = (int)(fadeEnd - framesRead);
|
|
|
|
} else {
|
|
|
|
frames = (int)(localTotalFrames - framesRead);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-15 14:49:53 +00:00
|
|
|
framesRead += frames;
|
2022-07-10 22:14:47 +00:00
|
|
|
|
|
|
|
id audioChunkClass = NSClassFromString(@"AudioChunk");
|
|
|
|
AudioChunk *chunk = [[audioChunkClass alloc] initWithProperties:[self properties]];
|
|
|
|
[chunk assignSamples:buffer frameCount:frames];
|
|
|
|
|
|
|
|
return chunk;
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (long)seek:(long)frame {
|
|
|
|
if(!player) {
|
2022-07-10 22:14:47 +00:00
|
|
|
if(![self readAudio])
|
2022-02-07 05:49:27 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
player->Seek(frame);
|
|
|
|
|
|
|
|
framesRead = frame;
|
|
|
|
|
2013-10-15 14:49:53 +00:00
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (void)close {
|
|
|
|
delete player;
|
|
|
|
player = NULL;
|
2022-06-20 10:35:29 +00:00
|
|
|
|
2022-06-21 05:10:43 +00:00
|
|
|
if(sbHandle) {
|
2022-06-20 10:35:29 +00:00
|
|
|
id sandboxBrokerClass = NSClassFromString(@"SandboxBroker");
|
|
|
|
id sandboxBroker = [sandboxBrokerClass sharedSandboxBroker];
|
|
|
|
|
2022-06-21 05:10:43 +00:00
|
|
|
[sandboxBroker endFolderAccess:sbHandle];
|
|
|
|
sbHandle = NULL;
|
2022-06-20 10:35:29 +00:00
|
|
|
}
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (void)dealloc {
|
|
|
|
[self close];
|
2016-06-19 20:05:30 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (NSArray *)fileTypes {
|
2022-01-19 02:12:57 +00:00
|
|
|
return @[@"mid", @"midi", @"kar", @"rmi", @"mids", @"mds", @"hmi", @"hmp", @"hmq", @"mus", @"xmi", @"lds"];
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (NSArray *)mimeTypes {
|
2022-01-19 02:12:57 +00:00
|
|
|
return @[@"audio/midi", @"audio/x-midi"];
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (float)priority {
|
|
|
|
return 1.0;
|
Implemented support for multiple decoders per file name extension, with a floating point priority control per interface. In the event that more than one input is registered to a given extension, and we match that extension, it will be passed off to an instance of the multi-decoder wrapper, which will try opening the file with all of the decoders in order of priority, until either one of them accepts it, or all of them have failed. This paves the way for adding a VGMSTREAM input, so I can give it a very low priority, since it has several formats that are verified by file name extension only. All current inputs have been given a priority of 1.0, except for CoreAudio, which was given a priority of 0.5, because it contains an MP3 and AC3 decoders that I'd rather not use if I don't have to.
2013-10-21 17:54:11 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (NSArray *)fileTypeAssociations {
|
|
|
|
return @[
|
|
|
|
@[@"General MIDI File", @"song.icns", @"mid", @"midi", @"kar"],
|
|
|
|
@[@"RIFF MIDI File", @"song.icns", @"rmi"],
|
|
|
|
@[@"MIDS MIDI File", @"song.icns", @"mids", @"mds"],
|
|
|
|
@[@"HMI MIDI File", @"song.icns", @"hmi", @"hmp", @"hmq"],
|
|
|
|
@[@"id Software MUS MIDI File", @"song.icns", @"mus"],
|
|
|
|
@[@"XMI MIDI File", @"song.icns", @"xmi"],
|
|
|
|
@[@"Loudness MIDI File", @"song.icns", @"lds"]
|
|
|
|
];
|
2022-01-18 11:06:03 +00:00
|
|
|
}
|
|
|
|
|
2013-10-15 14:49:53 +00:00
|
|
|
@end
|