Added Stop after Current, hooked it into Ctrl-Z for now, for lack of anything better (it needs to be easily accessible one way or the other), added image to signify status by adding a little red square to the play icon.

CQTexperiment
areff 2008-02-25 15:39:04 +00:00
parent 386078fdc5
commit 771a6de380
8 changed files with 3012 additions and 2958 deletions

View File

@ -143,6 +143,7 @@
8E9A2E860BA78B500091081B /* SecondsFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E9A2E840BA78B500091081B /* SecondsFormatter.m */; }; 8E9A2E860BA78B500091081B /* SecondsFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E9A2E840BA78B500091081B /* SecondsFormatter.m */; };
8E9A2EDA0BA78D9D0091081B /* IndexFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E9A2ED80BA78D9D0091081B /* IndexFormatter.m */; }; 8E9A2EDA0BA78D9D0091081B /* IndexFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E9A2ED80BA78D9D0091081B /* IndexFormatter.m */; };
8E9A30160BA792DC0091081B /* NSFileHandle+CreateFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E9A30140BA792DC0091081B /* NSFileHandle+CreateFile.m */; }; 8E9A30160BA792DC0091081B /* NSFileHandle+CreateFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E9A30140BA792DC0091081B /* NSFileHandle+CreateFile.m */; };
B09E93000D7316850064F138 /* stop_current.png in Resources */ = {isa = PBXBuildFile; fileRef = B09E92FF0D7316850064F138 /* stop_current.png */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -667,6 +668,7 @@
8E9A2ED80BA78D9D0091081B /* IndexFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IndexFormatter.m; sourceTree = "<group>"; }; 8E9A2ED80BA78D9D0091081B /* IndexFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IndexFormatter.m; sourceTree = "<group>"; };
8E9A30130BA792DC0091081B /* NSFileHandle+CreateFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileHandle+CreateFile.h"; sourceTree = "<group>"; }; 8E9A30130BA792DC0091081B /* NSFileHandle+CreateFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileHandle+CreateFile.h"; sourceTree = "<group>"; };
8E9A30140BA792DC0091081B /* NSFileHandle+CreateFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileHandle+CreateFile.m"; sourceTree = "<group>"; }; 8E9A30140BA792DC0091081B /* NSFileHandle+CreateFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileHandle+CreateFile.m"; sourceTree = "<group>"; };
B09E92FF0D7316850064F138 /* stop_current.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = stop_current.png; path = Images/stop_current.png; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -853,6 +855,7 @@
177EC02D0B8BC2E60000BC8C /* Images */ = { 177EC02D0B8BC2E60000BC8C /* Images */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B09E92FF0D7316850064F138 /* stop_current.png */,
17A8F7190D6A89730095DA13 /* repeat_album.png */, 17A8F7190D6A89730095DA13 /* repeat_album.png */,
17A8F6820D6A7FCA0095DA13 /* repeat_all.png */, 17A8F6820D6A7FCA0095DA13 /* repeat_all.png */,
17A8F6830D6A7FCA0095DA13 /* repeat_none.png */, 17A8F6830D6A7FCA0095DA13 /* repeat_none.png */,
@ -1612,6 +1615,7 @@
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 */, 17A8F71A0D6A89730095DA13 /* repeat_album.png in Resources */,
B09E93000D7316850064F138 /* stop_current.png in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

File diff suppressed because it is too large Load Diff

BIN
Images/stop_current.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

View File

@ -44,6 +44,7 @@ typedef enum {
//Private Methods //Private Methods
- (void)updateTotalTime; - (void)updateTotalTime;
- (void)updatePlaylistIndexes; - (void)updatePlaylistIndexes;
- (IBAction)stopAfterCurrent:(id)sender;
//PUBLIC METHODS //PUBLIC METHODS

View File

@ -382,6 +382,9 @@
- (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe - (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe
{ {
if (pe.status == kCogEntryStoppingAfterCurrent)
return nil;
if (repeat == RepeatOne) { if (repeat == RepeatOne) {
return pe; return pe;
} }
@ -720,5 +723,12 @@
return YES; return YES;
} }
- (IBAction)stopAfterCurrent:(id)sender
{
if (currentEntry.status != kCogEntryStoppingAfterCurrent)
currentEntry.status = kCogEntryStoppingAfterCurrent;
else
currentEntry.status = kCogEntryPlaying;
}
@end @end

View File

@ -13,7 +13,8 @@ typedef enum {
kCogEntryPlaying, kCogEntryPlaying,
kCogEntryError, kCogEntryError,
kCogEntryQueued, kCogEntryQueued,
kCogEntryRemoved kCogEntryRemoved,
kCogEntryStoppingAfterCurrent,
} PlaylistEntryStatus; } PlaylistEntryStatus;
@interface PlaylistEntry : NSObject { @interface PlaylistEntry : NSObject {

View File

@ -13,10 +13,11 @@
NSImage *playImage; NSImage *playImage;
NSImage *queueImage; NSImage *queueImage;
NSImage *errorImage; NSImage *errorImage;
NSImage *stopAfterCurrentImage;
} }
@property(retain) NSImage *playImage; @property(retain) NSImage *playImage;
@property(retain) NSImage *queueImage; @property(retain) NSImage *queueImage;
@property(retain) NSImage *errorImage; @property(retain) NSImage *errorImage;
@property(retain) NSImage *stopAfterCurrentImage;
@end @end

View File

@ -15,6 +15,7 @@
@synthesize playImage; @synthesize playImage;
@synthesize queueImage; @synthesize queueImage;
@synthesize errorImage; @synthesize errorImage;
@synthesize stopAfterCurrentImage;
+ (Class)transformedValueClass { return [NSImage class]; } + (Class)transformedValueClass { return [NSImage class]; }
+ (BOOL)allowsReverseTransformation { return NO; } + (BOOL)allowsReverseTransformation { return NO; }
@ -27,6 +28,7 @@
self.playImage = [NSImage imageNamed:@"play"]; self.playImage = [NSImage imageNamed:@"play"];
self.queueImage = [NSImage imageNamed:@"NSAddTemplate"]; self.queueImage = [NSImage imageNamed:@"NSAddTemplate"];
self.errorImage = [NSImage imageNamed:@"NSStopProgressTemplate"]; self.errorImage = [NSImage imageNamed:@"NSStopProgressTemplate"];
self.stopAfterCurrentImage = [NSImage imageNamed:@"stop_current"];
} }
return self; return self;
@ -46,6 +48,9 @@
else if (status == kCogEntryError) { else if (status == kCogEntryError) {
return self.errorImage; return self.errorImage;
} }
else if (status == kCogEntryStoppingAfterCurrent) {
return self.stopAfterCurrentImage;
}
return nil; return nil;
} }