diff --git a/Application/AppController.m b/Application/AppController.m index f7e2801b1..0e2018500 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -1,5 +1,4 @@ #import "AppController.h" -#import "KFTypeSelectTableView.h"" #import "PlaybackController.h" #import "PlaylistController.h" #import "PlaylistView.h" @@ -18,12 +17,7 @@ if (self) { [self initDefaults]; - - /* Use KFTypeSelectTableView as our NSTableView base class to allow type-select searching of all - * table and outline views. - */ - [[KFTypeSelectTableView class] poseAsClass:[NSTableView class]]; - + remote = [[AppleRemote alloc] init]; [remote setDelegate: self]; } diff --git a/Application/InvertedToolbarWindow.h b/Application/InvertedToolbarWindow.h new file mode 100644 index 000000000..f446921d8 --- /dev/null +++ b/Application/InvertedToolbarWindow.h @@ -0,0 +1,17 @@ +// +// InvertedToolbarWindow.h +// Cog +// +// Created by Vincent Spader on 10/31/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface InvertedToolbarWindow : NSWindow { + BOOL contentHidden; + double contentHeight; +} + +@end diff --git a/Application/InvertedToolbarWindow.m b/Application/InvertedToolbarWindow.m new file mode 100644 index 000000000..cf31c1860 --- /dev/null +++ b/Application/InvertedToolbarWindow.m @@ -0,0 +1,59 @@ +// +// InvertedToolbarWindow.m +// Cog +// +// Created by Vincent Spader on 10/31/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "InvertedToolbarWindow.h" + + +@implementation InvertedToolbarWindow + +- (void)awakeFromNib +{ + contentHidden = NO; +} + +- (void)toggleToolbarShown:(id)sender +{ + NSLog(@"Size: %lf %lf", [self minSize].width, [self minSize].height); + + if (contentHidden) { + NSRect newFrame = [self frame]; + + newFrame.origin.y -= contentHeight; + newFrame.size.height += contentHeight; + + [self setFrame:newFrame display:YES animate:YES]; + + [self setShowsResizeIndicator:YES]; + } + else { + NSRect newFrame = [self frame]; + + contentHeight = [[self contentView] bounds].size.height; + + newFrame.origin.y += contentHeight; + newFrame.size.height -= contentHeight; + + [self setShowsResizeIndicator:NO]; + + [self setFrame:newFrame display:YES animate:YES]; + + [self setShowsResizeIndicator:NO]; + } + + contentHidden = !contentHidden; +} + +- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize { + if (contentHidden) { + proposedFrameSize.height = [self frame].size.height; + } + + return proposedFrameSize; +} + +@end diff --git a/Application/PlaybackController.h b/Application/PlaybackController.h index 819dce218..2b20d3a77 100644 --- a/Application/PlaybackController.h +++ b/Application/PlaybackController.h @@ -19,10 +19,8 @@ IBOutlet TrackingSlider *positionSlider; IBOutlet NSSlider *volumeSlider; IBOutlet NSTextField *timeField; - IBOutlet NSTextField *lengthField; - IBOutlet NSTextField *bitrateField; - IBOutlet NSButton *playButton; + IBOutlet NSSegmentedControl *playbackButtons; IBOutlet NSArrayController *outputDevices; @@ -48,6 +46,8 @@ - (IBAction)playPauseResume:(id)sender; - (IBAction)pauseResume:(id)sender; +- (IBAction)playbackButtonClick:(id)sender; + - (IBAction)play:(id)sender; - (IBAction)pause:(id)sender; - (IBAction)resume:(id)sender; diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 661c815f7..c0eac5388 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -52,7 +52,7 @@ - (void)awakeFromNib { currentVolume = 100.0; - [volumeSlider setDoubleValue:pow(10.0, log10(0.5)/4.0)*[volumeSlider maxValue]]; + [volumeSlider setDoubleValue:pow(10.0, log10(0.5)/4.0)*100]; [positionSlider setEnabled:NO]; } @@ -109,6 +109,27 @@ [self playEntry:pe]; } + +- (IBAction)playbackButtonClick:(id)sender +{ + int clickedSegment = [sender selectedSegment]; + if (clickedSegment == 0) //Previous + { + [sender setSelected:YES forSegment:0]; + [sender setSelected:YES forSegment:1]; + [self prev:sender]; + } + else if (clickedSegment == 1) //Play + { + [self playPauseResume:sender]; + } + else if (clickedSegment == 2) //Next + { + [self next:sender]; + } +} + + - (IBAction)play:(id)sender { if ([playlistView selectedRow] == -1) @@ -175,21 +196,15 @@ - (void)changePlayButtonImage:(NSString *)name { - NSImage *img = [NSImage imageNamed:[name stringByAppendingString:@"_gray"]]; - NSImage *alt = [NSImage imageNamed:[name stringByAppendingString:@"_blue"]]; - [img retain]; - [alt retain]; + NSImage *img = [NSImage imageNamed:name]; +// [img retain]; + if (img == nil) { NSLog(@"Error loading image!"); } - if (alt == nil) - { - NSLog(@"Error loading alt image..."); - } - [playButton setImage:img]; - [playButton setAlternateImage:alt]; + [playbackButtons setImage:img forSegment:1]; } - (IBAction)changeVolume:(id)sender @@ -197,7 +212,7 @@ double percent; //Approximated log - percent = (float)[sender doubleValue]/[sender maxValue]; + percent = (float)[sender doubleValue]/100.0; percent = percent * percent * percent * percent; //gravitates at the 100% mark @@ -206,10 +221,10 @@ { percent = 0.5; v = pow(10.0, log10(percent)/4.0); - [sender setDoubleValue:v*[sender maxValue]]; + [sender setDoubleValue:v*100.0]; } - currentVolume = percent * [sender maxValue]; + currentVolume = percent * 100.0; [audioPlayer setVolume:currentVolume]; } @@ -220,10 +235,10 @@ [volumeSlider setDoubleValue:([volumeSlider doubleValue] - 5)]; - percent = (float)[volumeSlider doubleValue]/[volumeSlider maxValue]; + percent = (float)[volumeSlider doubleValue]/100.0; percent = percent * percent * percent * percent; - currentVolume = percent * [volumeSlider maxValue]; + currentVolume = percent * 100.0; [audioPlayer setVolume:currentVolume]; } diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index 9eba2f373..2a02f4779 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -34,7 +34,6 @@ 177EBFA00B8BC2A70000BC8C /* AMRemovableTableColumn.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF7C0B8BC2A70000BC8C /* AMRemovableTableColumn.m */; }; 177EBFA20B8BC2A70000BC8C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF7F0B8BC2A70000BC8C /* AppleRemote.m */; }; 177EBFA70B8BC2A70000BC8C /* ImageTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF870B8BC2A70000BC8C /* ImageTextCell.m */; }; - 177EBFA90B8BC2A70000BC8C /* KFTypeSelectTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF8A0B8BC2A70000BC8C /* KFTypeSelectTableView.m */; }; 177EBFAB0B8BC2A70000BC8C /* NDHotKeyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF8D0B8BC2A70000BC8C /* NDHotKeyControl.m */; }; 177EBFAD0B8BC2A70000BC8C /* NDHotKeyEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF8F0B8BC2A70000BC8C /* NDHotKeyEvent.m */; }; 177EBFAF0B8BC2A70000BC8C /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF920B8BC2A70000BC8C /* UKFileWatcher.m */; }; @@ -48,14 +47,10 @@ 177EC0290B8BC2CF0000BC8C /* TrackingSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EC01D0B8BC2CF0000BC8C /* TrackingSlider.m */; }; 177EC0440B8BC2FF0000BC8C /* add_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC02E0B8BC2FF0000BC8C /* add_blue.png */; }; 177EC0450B8BC2FF0000BC8C /* add_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC02F0B8BC2FF0000BC8C /* add_gray.png */; }; - 177EC04A0B8BC2FF0000BC8C /* next_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0340B8BC2FF0000BC8C /* next_blue.png */; }; - 177EC04B0B8BC2FF0000BC8C /* next_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0350B8BC2FF0000BC8C /* next_gray.png */; }; - 177EC04C0B8BC2FF0000BC8C /* pause_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0360B8BC2FF0000BC8C /* pause_blue.png */; }; - 177EC04D0B8BC2FF0000BC8C /* pause_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0370B8BC2FF0000BC8C /* pause_gray.png */; }; - 177EC04E0B8BC2FF0000BC8C /* play_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0380B8BC2FF0000BC8C /* play_blue.png */; }; - 177EC04F0B8BC2FF0000BC8C /* play_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0390B8BC2FF0000BC8C /* play_gray.png */; }; - 177EC0500B8BC2FF0000BC8C /* prev_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC03A0B8BC2FF0000BC8C /* prev_blue.png */; }; - 177EC0510B8BC2FF0000BC8C /* prev_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC03B0B8BC2FF0000BC8C /* prev_gray.png */; }; + 177EC04B0B8BC2FF0000BC8C /* next.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0350B8BC2FF0000BC8C /* next.png */; }; + 177EC04D0B8BC2FF0000BC8C /* pause.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0370B8BC2FF0000BC8C /* pause.png */; }; + 177EC04F0B8BC2FF0000BC8C /* play.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0390B8BC2FF0000BC8C /* play.png */; }; + 177EC0510B8BC2FF0000BC8C /* previous.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC03B0B8BC2FF0000BC8C /* previous.png */; }; 177EC0520B8BC2FF0000BC8C /* remove_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC03C0B8BC2FF0000BC8C /* remove_blue.png */; }; 177EC0530B8BC2FF0000BC8C /* remove_gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC03D0B8BC2FF0000BC8C /* remove_gray.png */; }; 177EC0580B8BC2FF0000BC8C /* volume_high.png in Resources */ = {isa = PBXBuildFile; fileRef = 177EC0420B8BC2FF0000BC8C /* volume_high.png */; }; @@ -67,6 +62,9 @@ 17818A990C0B27AC001C4916 /* shn.icns in Resources */ = {isa = PBXBuildFile; fileRef = 17818A920C0B27AC001C4916 /* shn.icns */; }; 17818A9A0C0B27AC001C4916 /* wav.icns in Resources */ = {isa = PBXBuildFile; fileRef = 17818A930C0B27AC001C4916 /* wav.icns */; }; 17818A9B0C0B27AC001C4916 /* wv.icns in Resources */ = {isa = PBXBuildFile; fileRef = 17818A940C0B27AC001C4916 /* wv.icns */; }; + 178BAB990CD4E1B700B33D47 /* GCOneShotEffectTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 178BAB940CD4E1B700B33D47 /* GCOneShotEffectTimer.m */; }; + 178BAB9A0CD4E1B700B33D47 /* GCWindowMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 178BAB960CD4E1B700B33D47 /* GCWindowMenu.m */; }; + 178BAB9B0CD4E1B700B33D47 /* PopupButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 178BAB980CD4E1B700B33D47 /* PopupButton.m */; }; 1791005E0CB44D6D0070BC5C /* Cog.scriptSuite in Resources */ = {isa = PBXBuildFile; fileRef = 1791005C0CB44D6D0070BC5C /* Cog.scriptSuite */; }; 1791005F0CB44D6D0070BC5C /* Cog.scriptTerminology in Resources */ = {isa = PBXBuildFile; fileRef = 1791005D0CB44D6D0070BC5C /* Cog.scriptTerminology */; }; 1791FF8F0CB43A2C0070BC5C /* MediaKeysApplication.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1791FF8D0CB43A2C0070BC5C /* MediaKeysApplication.h */; }; @@ -82,6 +80,7 @@ 17BB5CFA0B8A86350009ACB1 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */; }; 17BB5CFB0B8A86350009ACB1 /* CoreAudioKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF80B8A86350009ACB1 /* CoreAudioKit.framework */; }; 17BB5EA60B8A87850009ACB1 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5EA50B8A87850009ACB1 /* IOKit.framework */; }; + 17BBE5BC0CD95CFA00258F7A /* InvertedToolbarWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 17BBE5BB0CD95CFA00258F7A /* InvertedToolbarWindow.m */; }; 17C809910C3BD201005707C4 /* WavPack.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17C808C80C3BD1DD005707C4 /* WavPack.bundle */; }; 17C809920C3BD206005707C4 /* Vorbis.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17C808BF0C3BD1D2005707C4 /* Vorbis.bundle */; }; 17C809930C3BD21D005707C4 /* TagLib.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17C808B60C3BD1C5005707C4 /* TagLib.bundle */; }; @@ -503,8 +502,6 @@ 177EBF7F0B8BC2A70000BC8C /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AppleRemote.m; sourceTree = ""; }; 177EBF860B8BC2A70000BC8C /* ImageTextCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageTextCell.h; sourceTree = ""; }; 177EBF870B8BC2A70000BC8C /* ImageTextCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ImageTextCell.m; sourceTree = ""; }; - 177EBF890B8BC2A70000BC8C /* KFTypeSelectTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KFTypeSelectTableView.h; sourceTree = ""; }; - 177EBF8A0B8BC2A70000BC8C /* KFTypeSelectTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KFTypeSelectTableView.m; sourceTree = ""; }; 177EBF8C0B8BC2A70000BC8C /* NDHotKeyControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NDHotKeyControl.h; sourceTree = ""; }; 177EBF8D0B8BC2A70000BC8C /* NDHotKeyControl.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NDHotKeyControl.m; sourceTree = ""; }; 177EBF8E0B8BC2A70000BC8C /* NDHotKeyEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NDHotKeyEvent.h; sourceTree = ""; }; @@ -530,14 +527,10 @@ 177EC01D0B8BC2CF0000BC8C /* TrackingSlider.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = TrackingSlider.m; sourceTree = ""; }; 177EC02E0B8BC2FF0000BC8C /* add_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = add_blue.png; path = Images/add_blue.png; sourceTree = ""; }; 177EC02F0B8BC2FF0000BC8C /* add_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = add_gray.png; path = Images/add_gray.png; sourceTree = ""; }; - 177EC0340B8BC2FF0000BC8C /* next_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = next_blue.png; path = Images/next_blue.png; sourceTree = ""; }; - 177EC0350B8BC2FF0000BC8C /* next_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = next_gray.png; path = Images/next_gray.png; sourceTree = ""; }; - 177EC0360B8BC2FF0000BC8C /* pause_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = pause_blue.png; path = Images/pause_blue.png; sourceTree = ""; }; - 177EC0370B8BC2FF0000BC8C /* pause_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = pause_gray.png; path = Images/pause_gray.png; sourceTree = ""; }; - 177EC0380B8BC2FF0000BC8C /* play_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = play_blue.png; path = Images/play_blue.png; sourceTree = ""; }; - 177EC0390B8BC2FF0000BC8C /* play_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = play_gray.png; path = Images/play_gray.png; sourceTree = ""; }; - 177EC03A0B8BC2FF0000BC8C /* prev_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = prev_blue.png; path = Images/prev_blue.png; sourceTree = ""; }; - 177EC03B0B8BC2FF0000BC8C /* prev_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = prev_gray.png; path = Images/prev_gray.png; sourceTree = ""; }; + 177EC0350B8BC2FF0000BC8C /* next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = next.png; path = Images/next.png; sourceTree = ""; }; + 177EC0370B8BC2FF0000BC8C /* pause.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = pause.png; path = Images/pause.png; sourceTree = ""; }; + 177EC0390B8BC2FF0000BC8C /* play.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = play.png; path = Images/play.png; sourceTree = ""; }; + 177EC03B0B8BC2FF0000BC8C /* previous.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = previous.png; path = Images/previous.png; sourceTree = ""; }; 177EC03C0B8BC2FF0000BC8C /* remove_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = remove_blue.png; path = Images/remove_blue.png; sourceTree = ""; }; 177EC03D0B8BC2FF0000BC8C /* remove_gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = remove_gray.png; path = Images/remove_gray.png; sourceTree = ""; }; 177EC0420B8BC2FF0000BC8C /* volume_high.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = volume_high.png; path = Images/volume_high.png; sourceTree = ""; }; @@ -549,6 +542,12 @@ 17818A920C0B27AC001C4916 /* shn.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = shn.icns; sourceTree = ""; }; 17818A930C0B27AC001C4916 /* wav.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = wav.icns; sourceTree = ""; }; 17818A940C0B27AC001C4916 /* wv.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = wv.icns; sourceTree = ""; }; + 178BAB930CD4E1B700B33D47 /* GCOneShotEffectTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCOneShotEffectTimer.h; sourceTree = ""; }; + 178BAB940CD4E1B700B33D47 /* GCOneShotEffectTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GCOneShotEffectTimer.m; sourceTree = ""; }; + 178BAB950CD4E1B700B33D47 /* GCWindowMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCWindowMenu.h; sourceTree = ""; }; + 178BAB960CD4E1B700B33D47 /* GCWindowMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GCWindowMenu.m; sourceTree = ""; }; + 178BAB970CD4E1B700B33D47 /* PopupButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopupButton.h; sourceTree = ""; }; + 178BAB980CD4E1B700B33D47 /* PopupButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopupButton.m; sourceTree = ""; }; 1791005C0CB44D6D0070BC5C /* Cog.scriptSuite */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Cog.scriptSuite; sourceTree = ""; }; 1791005D0CB44D6D0070BC5C /* Cog.scriptTerminology */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Cog.scriptTerminology; sourceTree = ""; }; 1791FF8D0CB43A2C0070BC5C /* MediaKeysApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeysApplication.h; sourceTree = ""; }; @@ -565,6 +564,8 @@ 17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 17BB5CF80B8A86350009ACB1 /* CoreAudioKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudioKit.framework; path = /System/Library/Frameworks/CoreAudioKit.framework; sourceTree = ""; }; 17BB5EA50B8A87850009ACB1 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; + 17BBE5BA0CD95CFA00258F7A /* InvertedToolbarWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InvertedToolbarWindow.h; sourceTree = ""; }; + 17BBE5BB0CD95CFA00258F7A /* InvertedToolbarWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InvertedToolbarWindow.m; sourceTree = ""; }; 17C4D3D10C3EF130004D0867 /* Swedish */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Swedish; path = Swedish.lproj/Help; sourceTree = ""; }; 17C4D3E00C3EF133004D0867 /* German */ = {isa = PBXFileReference; lastKnownFileType = folder; name = German; path = German.lproj/Help; sourceTree = ""; }; 17C4D3EF0C3EF135004D0867 /* Greek */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Greek; path = Greek.lproj/Help; sourceTree = ""; }; @@ -732,6 +733,8 @@ 1770429A0B8BC53600B86321 /* PlaybackController.m */, 1791FF8D0CB43A2C0070BC5C /* MediaKeysApplication.h */, 1791FF8E0CB43A2C0070BC5C /* MediaKeysApplication.m */, + 17BBE5BA0CD95CFA00258F7A /* InvertedToolbarWindow.h */, + 17BBE5BB0CD95CFA00258F7A /* InvertedToolbarWindow.m */, ); path = Application; sourceTree = ""; @@ -739,10 +742,10 @@ 177EBF770B8BC2A70000BC8C /* ThirdParty */ = { isa = PBXGroup; children = ( + 178BAB920CD4E1B700B33D47 /* GCWindowMenu */, 177EBF780B8BC2A70000BC8C /* AMRemovableColumnsTableView */, 177EBF7D0B8BC2A70000BC8C /* AppleRemote */, 177EBF850B8BC2A70000BC8C /* ImageTextCell */, - 177EBF880B8BC2A70000BC8C /* KFTypeSelectTableView */, 179790DD0C087AB7001D6996 /* OpenURLPanel */, 177EBF8B0B8BC2A70000BC8C /* NDHotKeys */, 177EBF900B8BC2A70000BC8C /* UKKQueue */, @@ -779,15 +782,6 @@ path = ImageTextCell; sourceTree = ""; }; - 177EBF880B8BC2A70000BC8C /* KFTypeSelectTableView */ = { - isa = PBXGroup; - children = ( - 177EBF890B8BC2A70000BC8C /* KFTypeSelectTableView.h */, - 177EBF8A0B8BC2A70000BC8C /* KFTypeSelectTableView.m */, - ); - path = KFTypeSelectTableView; - sourceTree = ""; - }; 177EBF8B0B8BC2A70000BC8C /* NDHotKeys */ = { isa = PBXGroup; children = ( @@ -847,14 +841,10 @@ 1766C8910B912FB4004A7AE4 /* shuffle_on.png */, 177EC02E0B8BC2FF0000BC8C /* add_blue.png */, 177EC02F0B8BC2FF0000BC8C /* add_gray.png */, - 177EC0340B8BC2FF0000BC8C /* next_blue.png */, - 177EC0350B8BC2FF0000BC8C /* next_gray.png */, - 177EC0360B8BC2FF0000BC8C /* pause_blue.png */, - 177EC0370B8BC2FF0000BC8C /* pause_gray.png */, - 177EC0380B8BC2FF0000BC8C /* play_blue.png */, - 177EC0390B8BC2FF0000BC8C /* play_gray.png */, - 177EC03A0B8BC2FF0000BC8C /* prev_blue.png */, - 177EC03B0B8BC2FF0000BC8C /* prev_gray.png */, + 177EC0350B8BC2FF0000BC8C /* next.png */, + 177EC0370B8BC2FF0000BC8C /* pause.png */, + 177EC0390B8BC2FF0000BC8C /* play.png */, + 177EC03B0B8BC2FF0000BC8C /* previous.png */, 177EC03C0B8BC2FF0000BC8C /* remove_blue.png */, 177EC03D0B8BC2FF0000BC8C /* remove_gray.png */, 177EC0420B8BC2FF0000BC8C /* volume_high.png */, @@ -863,6 +853,19 @@ name = Images; sourceTree = ""; }; + 178BAB920CD4E1B700B33D47 /* GCWindowMenu */ = { + isa = PBXGroup; + children = ( + 178BAB930CD4E1B700B33D47 /* GCOneShotEffectTimer.h */, + 178BAB940CD4E1B700B33D47 /* GCOneShotEffectTimer.m */, + 178BAB950CD4E1B700B33D47 /* GCWindowMenu.h */, + 178BAB960CD4E1B700B33D47 /* GCWindowMenu.m */, + 178BAB970CD4E1B700B33D47 /* PopupButton.h */, + 178BAB980CD4E1B700B33D47 /* PopupButton.m */, + ); + path = GCWindowMenu; + sourceTree = ""; + }; 179790DD0C087AB7001D6996 /* OpenURLPanel */ = { isa = PBXGroup; children = ( @@ -1494,14 +1497,10 @@ 8E7575DB09F31E930080F1EE /* Localizable.strings in Resources */, 177EC0440B8BC2FF0000BC8C /* add_blue.png in Resources */, 177EC0450B8BC2FF0000BC8C /* add_gray.png in Resources */, - 177EC04A0B8BC2FF0000BC8C /* next_blue.png in Resources */, - 177EC04B0B8BC2FF0000BC8C /* next_gray.png in Resources */, - 177EC04C0B8BC2FF0000BC8C /* pause_blue.png in Resources */, - 177EC04D0B8BC2FF0000BC8C /* pause_gray.png in Resources */, - 177EC04E0B8BC2FF0000BC8C /* play_blue.png in Resources */, - 177EC04F0B8BC2FF0000BC8C /* play_gray.png in Resources */, - 177EC0500B8BC2FF0000BC8C /* prev_blue.png in Resources */, - 177EC0510B8BC2FF0000BC8C /* prev_gray.png in Resources */, + 177EC04B0B8BC2FF0000BC8C /* next.png in Resources */, + 177EC04D0B8BC2FF0000BC8C /* pause.png in Resources */, + 177EC04F0B8BC2FF0000BC8C /* play.png in Resources */, + 177EC0510B8BC2FF0000BC8C /* previous.png in Resources */, 177EC0520B8BC2FF0000BC8C /* remove_blue.png in Resources */, 177EC0530B8BC2FF0000BC8C /* remove_gray.png in Resources */, 177EC0580B8BC2FF0000BC8C /* volume_high.png in Resources */, @@ -1560,7 +1559,6 @@ 177EBFA00B8BC2A70000BC8C /* AMRemovableTableColumn.m in Sources */, 177EBFA20B8BC2A70000BC8C /* AppleRemote.m in Sources */, 177EBFA70B8BC2A70000BC8C /* ImageTextCell.m in Sources */, - 177EBFA90B8BC2A70000BC8C /* KFTypeSelectTableView.m in Sources */, 177EBFAB0B8BC2A70000BC8C /* NDHotKeyControl.m in Sources */, 177EBFAD0B8BC2A70000BC8C /* NDHotKeyEvent.m in Sources */, 177EBFAF0B8BC2A70000BC8C /* UKFileWatcher.m in Sources */, @@ -1585,6 +1583,10 @@ 1769D7D20CC2BFF7003F455B /* FileTreeDataSource.m in Sources */, 17BA9FBF0CC431890015F804 /* ContainerNode.m in Sources */, 17BA9FC80CC432060015F804 /* ContainedNode.m in Sources */, + 178BAB990CD4E1B700B33D47 /* GCOneShotEffectTimer.m in Sources */, + 178BAB9A0CD4E1B700B33D47 /* GCWindowMenu.m in Sources */, + 178BAB9B0CD4E1B700B33D47 /* PopupButton.m in Sources */, + 17BBE5BC0CD95CFA00258F7A /* InvertedToolbarWindow.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index fa99befd3..b25c5231a 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/FileDrawer/FileOutlineView.m b/FileDrawer/FileOutlineView.m index f7fa7d472..d3bcb66a8 100644 --- a/FileDrawer/FileOutlineView.m +++ b/FileDrawer/FileOutlineView.m @@ -10,12 +10,6 @@ #import "FileIconCell.h" #import "FileTreeDataSource.h" -@interface FileOutlineView (KFTypeSelectTableViewSupport) -- (void)findPrevious:(id)sender; -- (void)findNext:(id)sender; -- (void)kfResetSearch; -@end - @implementation FileOutlineView - (void) awakeFromNib @@ -69,18 +63,6 @@ [super keyDown:theEvent]; [self kfResetSearch]; - } else if ((pressedChar == '\031') && // backtab - ([self respondsToSelector:@selector(findPrevious:)])) { - /* KFTypeSelectTableView supports findPrevious; backtab is added to AIOutlineView as a find previous action - * if KFTypeSelectTableView is being used via posing */ - [self findPrevious:self]; - - } else if ((pressedChar == '\t') && - ([self respondsToSelector:@selector(findNext:)])) { - /* KFTypeSelectTableView supports findNext; tab is added to AIOutlineView as a find next action - * if KFTypeSelectTableView is being used via posing */ - [self findNext:self]; - } else { [super keyDown:theEvent]; } diff --git a/Hebrew.lproj/MainMenu.nib/classes.nib b/Hebrew.lproj/MainMenu.nib/classes.nib index c279543b4..70aac28a5 100644 --- a/Hebrew.lproj/MainMenu.nib/classes.nib +++ b/Hebrew.lproj/MainMenu.nib/classes.nib @@ -1,217 +1,380 @@ -{ - IBClasses = ( - { - CLASS = AMRemovableColumnsTableView; - LANGUAGE = ObjC; - OUTLETS = {obligatoryColumnIdentifiers = id; }; - SUPERCLASS = NSTableView; - }, - { - CLASS = AMRemovableTableColumn; - LANGUAGE = ObjC; - OUTLETS = {mainTableView = AMRemovableColumnsTableView; }; - SUPERCLASS = NSTableColumn; - }, - { - ACTIONS = { - delEntries = id; - donate = id; - openFiles = id; - openURL = id; - savePlaylist = id; - toggleFileDrawer = id; - toggleInfoDrawer = id; - }; - CLASS = AppController; - LANGUAGE = ObjC; - OUTLETS = { - addURLPanel = NSPanel; - fileButton = NSButton; - fileDrawer = NSDrawer; - fileOutlineView = FileOutlineView; - fileTreeController = FileTreeController; - infoButton = NSButton; - infoDrawer = NSDrawer; - mainWindow = NSPanel; - nextButton = NSButton; - playButton = NSButton; - playbackController = PlaybackController; - playlistController = PlaylistController; - playlistLoader = PlaylistLoader; - playlistView = PlaylistView; - prevButton = NSButton; - repeatButton = NSButton; - showAlbumColumn = NSMenuItem; - showArtistColumn = NSMenuItem; - showGenreColumn = NSMenuItem; - showIndexColumn = NSMenuItem; - showLengthColumn = NSMenuItem; - showTitleColumn = NSMenuItem; - showTrackColumn = NSMenuItem; - showYearColumn = NSMenuItem; - shuffleButton = NSButton; - urlComboBox = NSComboBox; - }; - SUPERCLASS = NSObject; - }, - {CLASS = ClickField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; }, - { - CLASS = DNDArrayController; - LANGUAGE = ObjC; - OUTLETS = {tableView = NSTableView; }; - SUPERCLASS = NSArrayController; - }, - {CLASS = DragScrollView; LANGUAGE = ObjC; SUPERCLASS = NSScrollView; }, - { - ACTIONS = {cancel = id; openFeedbackWindow = id; sendFeedback = id; }; - CLASS = FeedbackController; - LANGUAGE = ObjC; - OUTLETS = { - feedbackWindow = NSWindow; - fromView = NSTextField; - messageView = NSTextView; - sendingIndicator = NSProgressIndicator; - subjectView = NSTextField; - }; - SUPERCLASS = NSObject; - }, - { - CLASS = FileOutlineView; - LANGUAGE = ObjC; - OUTLETS = {fileDrawer = NSDrawer; }; - SUPERCLASS = NSOutlineView; - }, - { - CLASS = FileTreeController; - LANGUAGE = ObjC; - OUTLETS = {playlistLoader = PlaylistLoader; }; - SUPERCLASS = NSTreeController; - }, - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = InfoController; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = InfoView; LANGUAGE = ObjC; SUPERCLASS = NSScrollView; }, - {CLASS = NSSegmentedControl; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, - {CLASS = PathNode; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = { - changeVolume = id; - next = id; - pause = id; - pauseResume = id; - play = id; - playPauseResume = id; - prev = id; - resume = id; - seek = id; - stop = id; - toggleShowTimeRemaining = id; - volumeDown = id; - volumeUp = id; - }; - CLASS = PlaybackController; - LANGUAGE = ObjC; - OUTLETS = { - bitrateField = NSTextField; - lengthField = NSTextField; - outputDevices = NSArrayController; - playButton = NSButton; - playlistController = PlaylistController; - playlistView = PlaylistView; - positionSlider = TrackingSlider; - timeField = NSTextField; - volumeSlider = NSSlider; - }; - SUPERCLASS = NSObject; - }, - { - ACTIONS = { - clear = id; - clearFilterPredicate = id; - showEntryInFinder = id; - takeRepeatFromObject = id; - takeShuffleFromObject = id; - }; - CLASS = PlaylistController; - LANGUAGE = ObjC; - OUTLETS = {playlistLoader = PlaylistLoader; }; - SUPERCLASS = DNDArrayController; - }, - {CLASS = PlaylistEntry; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - CLASS = PlaylistLoader; - LANGUAGE = ObjC; - OUTLETS = {playlistController = PlaylistController; }; - SUPERCLASS = NSObject; - }, - { - ACTIONS = { - scrollToCurrentEntry = id; - shufflePlaylist = id; - sortByPath = id; - toggleColumn = id; - }; - CLASS = PlaylistView; - LANGUAGE = ObjC; - OUTLETS = { - playbackController = PlaybackController; - playlistController = PlaylistController; - }; - SUPERCLASS = AMRemovableColumnsTableView; - }, - { - ACTIONS = {showPrefs = id; }; - CLASS = PreferencesController; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - ACTIONS = {checkForUpdates = id; }; - CLASS = SUUpdater; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - {CLASS = SecondsFormatter; LANGUAGE = ObjC; SUPERCLASS = NSFormatter; }, - { - ACTIONS = { - changeVolume = id; - next = id; - pause = id; - pauseResume = id; - play = id; - playPauseResume = id; - prev = id; - resume = id; - seek = id; - stop = id; - toggleShowTimeRemaining = id; - }; - CLASS = SoundController; - LANGUAGE = ObjC; - OUTLETS = { - bitrateField = NSTextField; - lengthField = NSTextField; - playButton = NSButton; - playlistController = PlaylistController; - playlistView = PlaylistView; - positionSlider = TrackingSlider; - timeField = NSTextField; - }; - SUPERCLASS = NSObject; - }, - {CLASS = TrackingSlider; LANGUAGE = ObjC; SUPERCLASS = NSSlider; }, - { - ACTIONS = {okay = id; openUpdateWindow = id; takeBoolFromObject = id; }; - CLASS = UpdateController; - LANGUAGE = ObjC; - OUTLETS = { - autoCheckButton = NSButton; - checkingIndicator = NSProgressIndicator; - okayButton = NSButton; - statusView = NSTextField; - updateWindow = NSWindow; - }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file + + + + + IBClasses + + + CLASS + DNDArrayController + LANGUAGE + ObjC + OUTLETS + + tableView + NSTableView + + SUPERCLASS + NSArrayController + + + CLASS + TrackingSlider + LANGUAGE + ObjC + SUPERCLASS + NSSlider + + + CLASS + FileTreeController + LANGUAGE + ObjC + OUTLETS + + playlistLoader + PlaylistLoader + + SUPERCLASS + NSTreeController + + + ACTIONS + + scrollToCurrentEntry + id + shufflePlaylist + id + sortByPath + id + toggleColumn + id + + CLASS + PlaylistView + LANGUAGE + ObjC + OUTLETS + + playbackController + PlaybackController + playlistController + PlaylistController + + SUPERCLASS + AMRemovableColumnsTableView + + + CLASS + AMRemovableColumnsTableView + LANGUAGE + ObjC + OUTLETS + + obligatoryColumnIdentifiers + id + + SUPERCLASS + NSTableView + + + CLASS + PlaylistLoader + LANGUAGE + ObjC + OUTLETS + + playlistController + PlaylistController + + SUPERCLASS + NSObject + + + ACTIONS + + showPrefs + id + + CLASS + PreferencesController + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + CLASS + FirstResponder + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + ACTIONS + + changeVolume + id + next + id + pause + id + pauseResume + id + play + id + playPauseResume + id + prev + id + resume + id + seek + id + stop + id + toggleShowTimeRemaining + id + volumeDown + id + volumeUp + id + + CLASS + PlaybackController + LANGUAGE + ObjC + OUTLETS + + bitrateField + NSTextField + lengthField + NSTextField + outputDevices + NSArrayController + playButton + NSButton + playlistController + PlaylistController + playlistView + PlaylistView + positionSlider + TrackingSlider + timeField + NSTextField + volumeSlider + NSSlider + + SUPERCLASS + NSObject + + + CLASS + NSObject + LANGUAGE + ObjC + + + CLASS + ClickField + LANGUAGE + ObjC + SUPERCLASS + NSTextField + + + ACTIONS + + cancel + id + openFeedbackWindow + id + sendFeedback + id + + CLASS + FeedbackController + LANGUAGE + ObjC + OUTLETS + + feedbackWindow + NSWindow + fromView + NSTextField + messageView + NSTextView + sendingIndicator + NSProgressIndicator + subjectView + NSTextField + + SUPERCLASS + NSObject + + + ACTIONS + + checkForUpdates + id + + CLASS + SUUpdater + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + ACTIONS + + clear + id + clearFilterPredicate + id + showEntryInFinder + id + takeRepeatFromObject + id + takeShuffleFromObject + id + + CLASS + PlaylistController + LANGUAGE + ObjC + OUTLETS + + playlistLoader + PlaylistLoader + + SUPERCLASS + DNDArrayController + + + CLASS + FileOutlineView + LANGUAGE + ObjC + OUTLETS + + fileDrawer + NSDrawer + + SUPERCLASS + NSOutlineView + + + CLASS + FileTreeDataSource + LANGUAGE + ObjC + OUTLETS + + outlineView + NSOutlineView + + SUPERCLASS + NSObject + + + CLASS + AMRemovableTableColumn + LANGUAGE + ObjC + OUTLETS + + mainTableView + AMRemovableColumnsTableView + + SUPERCLASS + NSTableColumn + + + ACTIONS + + delEntries + id + donate + id + openFiles + id + openURL + id + savePlaylist + id + toggleFileDrawer + id + toggleInfoDrawer + id + + CLASS + AppController + LANGUAGE + ObjC + OUTLETS + + addURLPanel + NSPanel + fileButton + NSButton + fileDrawer + NSDrawer + fileOutlineView + FileOutlineView + fileTreeController + FileTreeController + fileTreeDataSource + FileTreeDataSource + infoButton + NSButton + infoDrawer + NSDrawer + mainWindow + NSPanel + nextButton + NSButton + playButton + NSButton + playbackController + PlaybackController + playlistController + PlaylistController + playlistLoader + PlaylistLoader + playlistView + PlaylistView + prevButton + NSButton + repeatButton + NSButton + showAlbumColumn + NSMenuItem + showArtistColumn + NSMenuItem + showGenreColumn + NSMenuItem + showIndexColumn + NSMenuItem + showLengthColumn + NSMenuItem + showTitleColumn + NSMenuItem + showTrackColumn + NSMenuItem + showYearColumn + NSMenuItem + shuffleButton + NSButton + urlComboBox + NSComboBox + + SUPERCLASS + NSObject + + + IBVersion + 1 + + diff --git a/Hebrew.lproj/MainMenu.nib/info.nib b/Hebrew.lproj/MainMenu.nib/info.nib index 9daedca86..afe74a63a 100644 --- a/Hebrew.lproj/MainMenu.nib/info.nib +++ b/Hebrew.lproj/MainMenu.nib/info.nib @@ -1,45 +1,18 @@ - + - IBDocumentLocation - 274 244 639 388 0 0 1680 1028 - IBEditorPositions - - 1063 - 549 810 136 68 0 0 1440 878 - 1156 - 633 402 241 366 0 0 1440 878 - 1324 - 664 542 137 182 0 0 1440 878 - 29 - 157 976 390 44 0 0 1680 1028 - 463 - 669 640 341 145 0 0 1680 1028 - 513 - 320 525 131 168 0 0 1440 878 - IBFramework Version - 446.1 - IBLockedObjects - - 484 - 606 - - IBLockedTabItems - - 564 - + 629 + IBLastKnownRelativeProjectPath + ../../Cog.xcodeproj IBOldestOS - 4 + 5 IBOpenObjects - - 463 - 21 - 268 - 29 - + IBSystem Version - 8R2218 + 9A581 + targetFramework + IBCocoaFramework diff --git a/Hebrew.lproj/MainMenu.nib/keyedobjects.nib b/Hebrew.lproj/MainMenu.nib/keyedobjects.nib index 620e83c3a..46d1574bd 100644 Binary files a/Hebrew.lproj/MainMenu.nib/keyedobjects.nib and b/Hebrew.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Images/info_off.png b/Images/info_off.png index 9149509eb..907c1c357 100644 Binary files a/Images/info_off.png and b/Images/info_off.png differ diff --git a/Images/next_gray.png b/Images/next_gray.png deleted file mode 100644 index 4bc36cec5..000000000 Binary files a/Images/next_gray.png and /dev/null differ diff --git a/Images/pause_gray.png b/Images/pause_gray.png deleted file mode 100644 index 58e2247c2..000000000 Binary files a/Images/pause_gray.png and /dev/null differ diff --git a/Images/play_gray.png b/Images/play_gray.png deleted file mode 100644 index 938c9b90c..000000000 Binary files a/Images/play_gray.png and /dev/null differ diff --git a/Images/prev_gray.png b/Images/prev_gray.png deleted file mode 100644 index aa1cac9dc..000000000 Binary files a/Images/prev_gray.png and /dev/null differ diff --git a/Images/repeat_off.png b/Images/repeat_off.png index 94cc5ca96..6662b9904 100644 Binary files a/Images/repeat_off.png and b/Images/repeat_off.png differ diff --git a/Images/repeat_on.png b/Images/repeat_on.png index ec4f6d894..58dd23176 100644 Binary files a/Images/repeat_on.png and b/Images/repeat_on.png differ diff --git a/Images/shuffle_on.png b/Images/shuffle_on.png index 55595a83b..2d95d4892 100644 Binary files a/Images/shuffle_on.png and b/Images/shuffle_on.png differ diff --git a/Playlist/PlaylistEntry.h b/Playlist/PlaylistEntry.h index 3e1a7f346..07ba3c03c 100644 --- a/Playlist/PlaylistEntry.h +++ b/Playlist/PlaylistEntry.h @@ -71,6 +71,8 @@ - (void)setSampleRate:(NSNumber *)s; - (NSNumber *)sampleRate; +- (NSString *)display; + - (void)setSeekable:(NSNumber *)s; - (NSNumber *)seekable; diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index 5042daaef..cd6ffa4d5 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -12,6 +12,10 @@ @implementation PlaylistEntry ++ (void)initialize { + [self setKeys:[NSArray arrayWithObjects:@"artist",@"title",nil] triggerChangeNotificationsForDependentKey:@"display"]; +} + - (id)init { self = [super init]; @@ -271,6 +275,16 @@ return sampleRate; } +- (NSString *)display +{ + if ([[self artist] isEqualToString:@""]) { + return title; + } + else { + return [NSString stringWithFormat:@"%@ - %@", artist, title]; + } +} + - (void)setSeekable:(NSNumber *)s { [s retain];