Cog/Preferences/Preferences/MIDIPane.m
Christopher Snowhill 838b31a6e8 MIDI: Replaced FluidSynth with BASSMIDI again
FluidSynth is just too unstable, and also just bad in general.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-08 18:29:03 -08:00

43 lines
1.2 KiB
Objective-C

//
// MIDIPane.m
// General
//
// Created by Christopher Snowhill on 10/15/13.
//
//
#import "MIDIPane.h"
@implementation MIDIPane
- (NSString *)title {
return NSLocalizedPrefString(@"Synthesis");
}
- (NSImage *)icon {
if(@available(macOS 11.0, *))
return [NSImage imageWithSystemSymbolName:@"pianokeys" accessibilityDescription:nil];
return [[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForImageResource:@"midi"]];
}
- (IBAction)setSoundFont:(id)sender {
NSArray *fileTypes = @[@"sf2", @"sf2pack", @"sflist"];
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:NO];
[panel setCanChooseDirectories:NO];
[panel setCanChooseFiles:YES];
[panel setFloatingPanel:YES];
[panel setAllowedFileTypes:fileTypes];
NSString *oldPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"soundFontPath"];
if(oldPath != nil)
[panel setDirectoryURL:[NSURL fileURLWithPath:oldPath]];
NSInteger result = [panel runModal];
if(result == NSModalResponseOK) {
[[NSUserDefaults standardUserDefaults] setValue:[[panel URL] path] forKey:@"soundFontPath"];
}
}
- (IBAction)setMidiPlugin:(id)sender {
}
@end