Fixed up repeat menu and added back repeat album.
parent
8434f6e3b3
commit
ae4c112076
|
@ -76,6 +76,7 @@
|
||||||
17A8F6850D6A7FCA0095DA13 /* repeat_all.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6820D6A7FCA0095DA13 /* repeat_all.png */; };
|
17A8F6850D6A7FCA0095DA13 /* repeat_all.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6820D6A7FCA0095DA13 /* repeat_all.png */; };
|
||||||
17A8F6860D6A7FCA0095DA13 /* repeat_none.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6830D6A7FCA0095DA13 /* repeat_none.png */; };
|
17A8F6860D6A7FCA0095DA13 /* repeat_none.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6830D6A7FCA0095DA13 /* repeat_none.png */; };
|
||||||
17A8F6870D6A7FCA0095DA13 /* repeat_one.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6840D6A7FCA0095DA13 /* repeat_one.png */; };
|
17A8F6870D6A7FCA0095DA13 /* repeat_one.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F6840D6A7FCA0095DA13 /* repeat_one.png */; };
|
||||||
|
17A8F71A0D6A89730095DA13 /* repeat_album.png in Resources */ = {isa = PBXBuildFile; fileRef = 17A8F7190D6A89730095DA13 /* repeat_album.png */; };
|
||||||
17B6FA7F0D48225300C3BEF1 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17BF2B270CDD77EB007E1295 /* Sparkle.framework */; };
|
17B6FA7F0D48225300C3BEF1 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17BF2B270CDD77EB007E1295 /* Sparkle.framework */; };
|
||||||
17BB5CED0B8A86010009ACB1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */; };
|
17BB5CED0B8A86010009ACB1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */; };
|
||||||
17BB5CF90B8A86350009ACB1 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */; };
|
17BB5CF90B8A86350009ACB1 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */; };
|
||||||
|
@ -571,6 +572,7 @@
|
||||||
17A8F6820D6A7FCA0095DA13 /* repeat_all.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_all.png; path = Images/repeat_all.png; sourceTree = "<group>"; };
|
17A8F6820D6A7FCA0095DA13 /* repeat_all.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_all.png; path = Images/repeat_all.png; sourceTree = "<group>"; };
|
||||||
17A8F6830D6A7FCA0095DA13 /* repeat_none.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_none.png; path = Images/repeat_none.png; sourceTree = "<group>"; };
|
17A8F6830D6A7FCA0095DA13 /* repeat_none.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_none.png; path = Images/repeat_none.png; sourceTree = "<group>"; };
|
||||||
17A8F6840D6A7FCA0095DA13 /* repeat_one.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_one.png; path = Images/repeat_one.png; sourceTree = "<group>"; };
|
17A8F6840D6A7FCA0095DA13 /* repeat_one.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_one.png; path = Images/repeat_one.png; sourceTree = "<group>"; };
|
||||||
|
17A8F7190D6A89730095DA13 /* repeat_album.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_album.png; path = Images/repeat_album.png; sourceTree = "<group>"; };
|
||||||
17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
|
17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
|
||||||
17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
||||||
17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
|
17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
|
||||||
|
@ -848,6 +850,7 @@
|
||||||
177EC02D0B8BC2E60000BC8C /* Images */ = {
|
177EC02D0B8BC2E60000BC8C /* Images */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
17A8F7190D6A89730095DA13 /* repeat_album.png */,
|
||||||
17A8F6820D6A7FCA0095DA13 /* repeat_all.png */,
|
17A8F6820D6A7FCA0095DA13 /* repeat_all.png */,
|
||||||
17A8F6830D6A7FCA0095DA13 /* repeat_none.png */,
|
17A8F6830D6A7FCA0095DA13 /* repeat_none.png */,
|
||||||
17A8F6840D6A7FCA0095DA13 /* repeat_one.png */,
|
17A8F6840D6A7FCA0095DA13 /* repeat_one.png */,
|
||||||
|
@ -1603,6 +1606,7 @@
|
||||||
17A8F6850D6A7FCA0095DA13 /* repeat_all.png in Resources */,
|
17A8F6850D6A7FCA0095DA13 /* repeat_all.png in Resources */,
|
||||||
17A8F6860D6A7FCA0095DA13 /* repeat_none.png in Resources */,
|
17A8F6860D6A7FCA0095DA13 /* repeat_none.png in Resources */,
|
||||||
17A8F6870D6A7FCA0095DA13 /* repeat_one.png in Resources */,
|
17A8F6870D6A7FCA0095DA13 /* repeat_one.png in Resources */,
|
||||||
|
17A8F71A0D6A89730095DA13 /* repeat_album.png in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 226 B |
Binary file not shown.
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 191 B |
|
@ -18,6 +18,7 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RepeatNone = 0,
|
RepeatNone = 0,
|
||||||
RepeatOne,
|
RepeatOne,
|
||||||
|
RepeatAlbum,
|
||||||
RepeatAll
|
RepeatAll
|
||||||
} RepeatMode;
|
} RepeatMode;
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ typedef enum {
|
||||||
- (NSUndoManager *)undoManager;
|
- (NSUndoManager *)undoManager;
|
||||||
|
|
||||||
- (IBAction)takeShuffleFromObject:(id)sender;
|
- (IBAction)takeShuffleFromObject:(id)sender;
|
||||||
|
|
||||||
- (IBAction)toggleRepeat:(id)sender;
|
- (IBAction)toggleRepeat:(id)sender;
|
||||||
|
|
||||||
- (IBAction)sortByPath;
|
- (IBAction)sortByPath;
|
||||||
|
|
|
@ -27,6 +27,10 @@
|
||||||
[NSValueTransformer setValueTransformer:repeatOneTransformer
|
[NSValueTransformer setValueTransformer:repeatOneTransformer
|
||||||
forName:@"RepeatOneTransformer"];
|
forName:@"RepeatOneTransformer"];
|
||||||
|
|
||||||
|
NSValueTransformer *repeatAlbumTransformer = [[[RepeatModeTransformer alloc] initWithMode:RepeatAlbum] autorelease];
|
||||||
|
[NSValueTransformer setValueTransformer:repeatAlbumTransformer
|
||||||
|
forName:@"RepeatAlbumTransformer"];
|
||||||
|
|
||||||
NSValueTransformer *repeatAllTransformer = [[[RepeatModeTransformer alloc] initWithMode:RepeatAll] autorelease];
|
NSValueTransformer *repeatAllTransformer = [[[RepeatModeTransformer alloc] initWithMode:RepeatAll] autorelease];
|
||||||
[NSValueTransformer setValueTransformer:repeatAllTransformer
|
[NSValueTransformer setValueTransformer:repeatAllTransformer
|
||||||
forName:@"RepeatAllTransformer"];
|
forName:@"RepeatAllTransformer"];
|
||||||
|
@ -303,12 +307,16 @@
|
||||||
else
|
else
|
||||||
[self setShuffle: [sender state]];
|
[self setShuffle: [sender state]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)toggleRepeat:(id)sender
|
- (IBAction)toggleRepeat:(id)sender
|
||||||
{
|
{
|
||||||
if (repeat == RepeatNone) {
|
if (repeat == RepeatNone) {
|
||||||
[self setRepeat: RepeatOne];
|
[self setRepeat: RepeatOne];
|
||||||
}
|
}
|
||||||
else if (repeat == RepeatOne) {
|
else if (repeat == RepeatOne) {
|
||||||
|
[self setRepeat: RepeatAlbum];
|
||||||
|
}
|
||||||
|
else if (repeat == RepeatAlbum) {
|
||||||
[self setRepeat: RepeatAll];
|
[self setRepeat: RepeatAll];
|
||||||
}
|
}
|
||||||
else if (repeat == RepeatAll) {
|
else if (repeat == RepeatAll) {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
@implementation RepeatModeTransformer
|
@implementation RepeatModeTransformer
|
||||||
|
|
||||||
+ (Class)transformedValueClass { return [NSNumber class]; }
|
+ (Class)transformedValueClass { return [NSNumber class]; }
|
||||||
+ (BOOL)allowsReverseTransformation { return NO; }
|
+ (BOOL)allowsReverseTransformation { return YES; }
|
||||||
|
|
||||||
- (id)initWithMode:(RepeatMode) r
|
- (id)initWithMode:(RepeatMode) r
|
||||||
{
|
{
|
||||||
|
@ -41,6 +41,21 @@
|
||||||
return [NSNumber numberWithBool:NO];
|
return [NSNumber numberWithBool:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id)reverseTransformedValue:(id)value {
|
||||||
|
if (value == nil) return nil;
|
||||||
|
|
||||||
|
BOOL enabled = [value boolValue];
|
||||||
|
if (enabled) {
|
||||||
|
return [NSNumber numberWithInt:repeatMode];
|
||||||
|
}
|
||||||
|
else if(repeatMode == RepeatNone) {
|
||||||
|
return [NSNumber numberWithInt:RepeatAll];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [NSNumber numberWithInt:RepeatNone];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation RepeatModeImageTransformer
|
@implementation RepeatModeImageTransformer
|
||||||
|
@ -62,6 +77,9 @@
|
||||||
else if (mode == RepeatOne) {
|
else if (mode == RepeatOne) {
|
||||||
return [NSImage imageNamed:@"repeat_one"];
|
return [NSImage imageNamed:@"repeat_one"];
|
||||||
}
|
}
|
||||||
|
else if (mode == RepeatAlbum) {
|
||||||
|
return [NSImage imageNamed:@"repeat_album"];
|
||||||
|
}
|
||||||
else if (mode == RepeatAll) {
|
else if (mode == RepeatAll) {
|
||||||
return [NSImage imageNamed:@"repeat_all"];
|
return [NSImage imageNamed:@"repeat_all"];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue