2009-03-07 22:49:50 -03:00
|
|
|
//
|
|
|
|
// PreferencesController.m
|
|
|
|
// Preferences
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 9/4/06.
|
|
|
|
// Copyright 2006 Vincent Spader. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "GeneralPreferencesPlugin.h"
|
2022-05-22 18:26:27 -04:00
|
|
|
#import "ColorToValueTransformer.h"
|
2013-10-18 00:46:11 -03:00
|
|
|
#import "PathToFileTransformer.h"
|
2022-07-02 01:06:08 -04:00
|
|
|
#import "TimeIntervalToStringTransformer.h"
|
2009-03-07 22:49:50 -03:00
|
|
|
|
|
|
|
@implementation GeneralPreferencesPlugin
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
+ (void)initialize {
|
2016-05-05 17:05:39 -03:00
|
|
|
NSValueTransformer *pathToFileTransformer = [[PathToFileTransformer alloc] init];
|
2022-02-07 02:49:27 -03:00
|
|
|
[NSValueTransformer setValueTransformer:pathToFileTransformer
|
|
|
|
forName:@"PathToFileTransformer"];
|
2022-05-22 18:26:27 -04:00
|
|
|
|
|
|
|
NSValueTransformer *colorToValueTransformer = [[ColorToValueTransformer alloc] init];
|
|
|
|
[NSValueTransformer setValueTransformer:colorToValueTransformer
|
|
|
|
forName:@"ColorToValueTransformer"];
|
2022-07-02 01:06:08 -04:00
|
|
|
|
|
|
|
NSValueTransformer *timeIntervalToStringTransformer = [[TimeIntervalToStringTransformer alloc] init];
|
|
|
|
[NSValueTransformer setValueTransformer:timeIntervalToStringTransformer
|
|
|
|
forName:@"TimeIntervalToStringTransformer"];
|
2013-10-18 00:46:11 -03:00
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
+ (NSArray *)preferencePanes {
|
2016-05-05 17:05:39 -03:00
|
|
|
GeneralPreferencesPlugin *plugin = [[GeneralPreferencesPlugin alloc] init];
|
2021-01-08 02:25:30 -03:00
|
|
|
[[NSBundle bundleWithIdentifier:@"org.cogx.cog.preferences"] loadNibNamed:@"Preferences"
|
2022-02-07 02:49:27 -03:00
|
|
|
owner:plugin
|
|
|
|
topLevelObjects:nil];
|
2021-01-08 02:25:30 -03:00
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
return @[[plugin playlistPane],
|
|
|
|
[plugin hotKeyPane],
|
|
|
|
[plugin updatesPane],
|
|
|
|
[plugin outputPane],
|
2022-06-20 06:35:29 -04:00
|
|
|
[plugin generalPane],
|
2022-02-07 02:49:27 -03:00
|
|
|
[plugin notificationsPane],
|
|
|
|
[plugin appearancePane],
|
|
|
|
[plugin midiPane]];
|
2021-01-08 02:25:30 -03:00
|
|
|
}
|
2009-03-07 22:49:50 -03:00
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (HotKeyPane *)hotKeyPane {
|
|
|
|
return hotKeyPane;
|
2009-03-07 22:49:50 -03:00
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (OutputPane *)outputPane {
|
|
|
|
return outputPane;
|
2009-03-07 22:49:50 -03:00
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (MIDIPane *)midiPane {
|
|
|
|
return midiPane;
|
2013-10-15 11:49:53 -03:00
|
|
|
}
|
|
|
|
|
2022-06-20 06:35:29 -04:00
|
|
|
- (GeneralPane *)generalPane {
|
|
|
|
return generalPane;
|
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (GeneralPreferencePane *)updatesPane {
|
|
|
|
return [GeneralPreferencePane preferencePaneWithView:updatesView
|
|
|
|
title:NSLocalizedPrefString(@"Updates")
|
|
|
|
systemIconName:@"arrow.triangle.2.circlepath.circle.fill"
|
|
|
|
orOldIconNamed:@"updates"];
|
2009-03-07 22:49:50 -03:00
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (GeneralPreferencePane *)playlistPane {
|
|
|
|
return [GeneralPreferencePane preferencePaneWithView:playlistView
|
|
|
|
title:NSLocalizedPrefString(@"Playlist")
|
|
|
|
systemIconName:@"music.note.list"
|
|
|
|
orOldIconNamed:@"playlist"];
|
2009-03-07 22:49:50 -03:00
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (GeneralPreferencePane *)notificationsPane {
|
|
|
|
if(@available(macOS 10.14, *)) {
|
|
|
|
if(iTunesStyleCheck) {
|
|
|
|
iTunesStyleCheck.hidden = YES;
|
|
|
|
NSSize size = notificationsView.frame.size;
|
|
|
|
size.height -= 18;
|
|
|
|
[notificationsView setFrameSize:size];
|
|
|
|
}
|
|
|
|
}
|
2020-12-26 10:44:08 -03:00
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
return [GeneralPreferencePane preferencePaneWithView:notificationsView
|
|
|
|
title:NSLocalizedPrefString(@"Notifications")
|
|
|
|
systemIconName:@"bell.fill"
|
|
|
|
orOldIconNamed:@"growl"];
|
2013-10-11 12:35:57 -03:00
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (GeneralPreferencePane *)appearancePane {
|
|
|
|
return [GeneralPreferencePane preferencePaneWithView:appearanceView
|
|
|
|
title:NSLocalizedPrefString(@"Appearance")
|
|
|
|
systemIconName:@"paintpalette.fill"
|
|
|
|
orOldIconNamed:@"appearance"];
|
2013-10-11 12:35:57 -03:00
|
|
|
}
|
|
|
|
|
2009-03-07 22:49:50 -03:00
|
|
|
@end
|