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