CQTexperiment
vspader 2006-04-30 13:01:33 +00:00
parent 15139ac8d5
commit 62ad443ad5
8 changed files with 56 additions and 10 deletions

View File

@ -30,6 +30,9 @@
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo;
- (IBAction)sortByPath:(id)sender;
- (IBAction)shufflePlaylist:(id)sender;
- (IBAction)donate:(id)sender;
- (IBAction)toggleInfoDrawer:(id)sender;

View File

@ -166,6 +166,16 @@
[infoButton setState:NSOffState];
}
- (IBAction)sortByPath:(id)sender
{
[playlistController sortByPath];
}
- (IBAction)shufflePlaylist:(id)sender
{
[playlistController randomizeList];
}
- (IBAction)donate:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://sourceforge.net/project/project_donations.php?group_id=140003"]];

View File

@ -58,10 +58,10 @@
// Might want to change the text color here
// NSColor *originalTextColor = [self textColor];
if (highlightPath) {
[[self backgroundColor] set];
[[[NSColor controlAlternatingRowBackgroundColors] objectAtIndex:1] set];
[highlightPath fill];
NSColor *strokeColor = [NSColor colorWithCalibratedHue:[[self backgroundColor] hueComponent] saturation:[[self backgroundColor] saturationComponent] brightness:[[self backgroundColor] brightnessComponent]-0.2 alpha:[[self backgroundColor] alphaComponent]];
NSColor *strokeColor = [NSColor secondarySelectedControlColor];
[strokeColor set];
[highlightPath stroke];

View File

@ -8,6 +8,8 @@
loadPlaylist = id;
savePlaylist = id;
savePlaylistAs = id;
shufflePlaylist = id;
sortByPath = id;
toggleInfoDrawer = id;
};
CLASS = AppController;
@ -50,7 +52,7 @@
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = InfoController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = InfoView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = InfoView; LANGUAGE = ObjC; SUPERCLASS = NSScrollView; },
{CLASS = NSSegmentedControl; LANGUAGE = ObjC; SUPERCLASS = NSControl; },
{
ACTIONS = {

View File

@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>273 33 617 240 0 0 1024 746 </string>
<string>34 369 617 240 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>649 654 346 44 0 0 1024 746 </string>
<string>98 651 409 44 0 0 1024 746 </string>
<key>463</key>
<string>336 384 352 268 0 0 1024 746 </string>
<string>358 426 308 187 0 0 1024 746 </string>
<key>513</key>
<string>639 190 125 137 0 0 1024 746 </string>
</dict>
@ -28,10 +28,11 @@
<integer>3</integer>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
<integer>513</integer>
<integer>823</integer>
<integer>513</integer>
<integer>21</integer>
<integer>463</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8I127</string>

Binary file not shown.

View File

@ -161,7 +161,9 @@
- (void)tableView:(NSTableView *)tableView
didClickTableColumn:(NSTableColumn *)tableColumn
{
NSLog(@"SORTING");
if (shuffle == YES)
[self resetShuffleList];
[self updateIndexesFromRow:0];
}
@ -287,6 +289,28 @@
[a release];
}
- (void)sortByPath
{
NSSortDescriptor *s = [[NSSortDescriptor alloc] initWithKey:@"filename" ascending:YES selector:@selector(compare:)];
[self setSortDescriptors:[NSArray arrayWithObject:s]];
[s release];
if (shuffle == YES)
[self resetShuffleList];
[self updateIndexesFromRow:0];
}
- (void)randomizeList
{
[self setSortDescriptors:nil];
[self setContent:[Shuffle shuffleList:[self content]]];
if (shuffle == YES)
[self resetShuffleList];
[self updateIndexesFromRow:0];
}
- (IBAction)takeShuffleFromObject:(id)sender
{
if( [sender respondsToSelector: @selector(boolValue)] )

View File

@ -283,9 +283,14 @@
[self setGenre:nil];
if ([artist isEqualToString:@""] || [title isEqualToString:@""])
{
[self setDisplay:[filename lastPathComponent]];
[self setTitle:[filename lastPathComponent]];
}
else
{
[self setDisplay:[NSString stringWithFormat:@"%@ - %@", artist, title]];
}
taglib_tag_free_strings();
}
@ -295,6 +300,7 @@
else
{
[self setDisplay:[filename lastPathComponent]];
[self setTitle:[filename lastPathComponent]];
}
}