2013-10-15 14:49:53 +00:00
|
|
|
//
|
|
|
|
// MIDIPane.m
|
|
|
|
// General
|
|
|
|
//
|
|
|
|
// Created by Christopher Snowhill on 10/15/13.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "MIDIPane.h"
|
|
|
|
|
|
|
|
@implementation MIDIPane
|
|
|
|
|
|
|
|
- (NSString *)title
|
|
|
|
{
|
2014-03-27 04:49:31 +00:00
|
|
|
return NSLocalizedStringFromTableInBundle(@"Synthesis", nil, [NSBundle bundleForClass:[self class]], @"");
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSImage *)icon
|
|
|
|
{
|
2016-05-05 20:05:39 +00:00
|
|
|
return [[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForImageResource:@"midi"]];
|
2013-10-15 14:49:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)setSoundFont:(id)sender
|
|
|
|
{
|
2016-06-19 20:06:55 +00:00
|
|
|
NSArray *fileTypes = [NSArray arrayWithObjects:@"sf2",@"sf2pack",@"sflist",@"json",nil];
|
2013-10-15 14:49:53 +00:00
|
|
|
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 == NSOKButton)
|
|
|
|
{
|
|
|
|
[[NSUserDefaults standardUserDefaults] setValue:[[panel URL] path] forKey:@"soundFontPath"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-13 04:16:25 +00:00
|
|
|
- (IBAction)setMidiPlugin:(id)sender
|
|
|
|
{
|
2017-12-28 02:57:41 +00:00
|
|
|
NSString * plugin = [[NSUserDefaults standardUserDefaults] stringForKey:@"midi.plugin"];
|
|
|
|
if ([plugin isEqualToString:@"Sc55rolD"] || [plugin isEqualToString:@"Sc55RoCl"])
|
2016-04-13 04:16:25 +00:00
|
|
|
[midiFlavorControl setEnabled:YES];
|
|
|
|
else
|
|
|
|
[midiFlavorControl setEnabled:NO];
|
|
|
|
}
|
|
|
|
|
2013-10-15 14:49:53 +00:00
|
|
|
@end
|