Fixed playlist sorting by path/shuffle
parent
e919340f6d
commit
b596f19c81
|
@ -30,9 +30,6 @@
|
||||||
|
|
||||||
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo;
|
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo;
|
||||||
|
|
||||||
- (IBAction)sortByPath:(id)sender;
|
|
||||||
- (IBAction)shufflePlaylist:(id)sender;
|
|
||||||
|
|
||||||
- (IBAction)donate:(id)sender;
|
- (IBAction)donate:(id)sender;
|
||||||
|
|
||||||
- (IBAction)toggleInfoDrawer:(id)sender;
|
- (IBAction)toggleInfoDrawer:(id)sender;
|
||||||
|
|
|
@ -166,16 +166,6 @@
|
||||||
[infoButton setState:NSOffState];
|
[infoButton setState:NSOffState];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)sortByPath:(id)sender
|
|
||||||
{
|
|
||||||
[playlistController sortByPath];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (IBAction)shufflePlaylist:(id)sender
|
|
||||||
{
|
|
||||||
[playlistController randomizeList];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (IBAction)donate:(id)sender
|
- (IBAction)donate:(id)sender
|
||||||
{
|
{
|
||||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://sourceforge.net/project/project_donations.php?group_id=140003"]];
|
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://sourceforge.net/project/project_donations.php?group_id=140003"]];
|
||||||
|
|
|
@ -99,7 +99,6 @@
|
||||||
8E757B5709F326710080F1EE /* OggFLAC.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E75773809F31F1F0080F1EE /* OggFLAC.framework */; };
|
8E757B5709F326710080F1EE /* OggFLAC.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E75773809F31F1F0080F1EE /* OggFLAC.framework */; };
|
||||||
8E757C7C09F32F070080F1EE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E757C7A09F32F070080F1EE /* AudioToolbox.framework */; };
|
8E757C7C09F32F070080F1EE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E757C7A09F32F070080F1EE /* AudioToolbox.framework */; };
|
||||||
8E757C7D09F32F070080F1EE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E757C7B09F32F070080F1EE /* AudioUnit.framework */; };
|
8E757C7D09F32F070080F1EE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E757C7B09F32F070080F1EE /* AudioUnit.framework */; };
|
||||||
8EEBC1B50A177D70006F6251 /* PlaylistEntry.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 8EEBC1B40A177D70006F6251 /* PlaylistEntry.xcdatamodel */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXBuildStyle section */
|
/* Begin PBXBuildStyle section */
|
||||||
|
@ -278,7 +277,6 @@
|
||||||
8E75777809F320D50080F1EE /* SndFile.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SndFile.framework; path = Libraries/SndFile/build/Release/SndFile.framework; sourceTree = "<group>"; };
|
8E75777809F320D50080F1EE /* SndFile.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SndFile.framework; path = Libraries/SndFile/build/Release/SndFile.framework; sourceTree = "<group>"; };
|
||||||
8E757C7A09F32F070080F1EE /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
|
8E757C7A09F32F070080F1EE /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
|
||||||
8E757C7B09F32F070080F1EE /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
8E757C7B09F32F070080F1EE /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
||||||
8EEBC1B40A177D70006F6251 /* PlaylistEntry.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = PlaylistEntry.xcdatamodel; sourceTree = "<group>"; };
|
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
@ -348,7 +346,6 @@
|
||||||
29B97314FDCFA39411CA2CEA /* Cog */ = {
|
29B97314FDCFA39411CA2CEA /* Cog */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
8EEBC1AF0A177D14006F6251 /* Models */,
|
|
||||||
080E96DDFE201D6D7F000001 /* Classes */,
|
080E96DDFE201D6D7F000001 /* Classes */,
|
||||||
8E75751809F31D5A0080F1EE /* AppController.h */,
|
8E75751809F31D5A0080F1EE /* AppController.h */,
|
||||||
8E75751909F31D5A0080F1EE /* AppController.m */,
|
8E75751909F31D5A0080F1EE /* AppController.m */,
|
||||||
|
@ -576,14 +573,6 @@
|
||||||
name = "Codec Frameworks";
|
name = "Codec Frameworks";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
8EEBC1AF0A177D14006F6251 /* Models */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
8EEBC1B40A177D70006F6251 /* PlaylistEntry.xcdatamodel */,
|
|
||||||
);
|
|
||||||
name = Models;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
|
@ -713,7 +702,6 @@
|
||||||
8E4C7F090A0509FC003BE25F /* DragScrollView.m in Sources */,
|
8E4C7F090A0509FC003BE25F /* DragScrollView.m in Sources */,
|
||||||
8E6A8E2C0A0D8A68002ABE9C /* CoreAudioFile.m in Sources */,
|
8E6A8E2C0A0D8A68002ABE9C /* CoreAudioFile.m in Sources */,
|
||||||
8E6A8E380A0D8AD8002ABE9C /* CoreAudioUtils.m in Sources */,
|
8E6A8E380A0D8AD8002ABE9C /* CoreAudioUtils.m in Sources */,
|
||||||
8EEBC1B50A177D70006F6251 /* PlaylistEntry.xcdatamodel in Sources */,
|
|
||||||
8E1296DB0A2BA9CE00443124 /* PlaylistHeaderView.m in Sources */,
|
8E1296DB0A2BA9CE00443124 /* PlaylistHeaderView.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
|
|
@ -95,10 +95,10 @@
|
||||||
},
|
},
|
||||||
{CLASS = PlaylistEntry; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
{CLASS = PlaylistEntry; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||||
{
|
{
|
||||||
|
ACTIONS = {shufflePlaylist = id; sortByPath = id; };
|
||||||
CLASS = PlaylistView;
|
CLASS = PlaylistView;
|
||||||
LANGUAGE = ObjC;
|
LANGUAGE = ObjC;
|
||||||
OUTLETS = {
|
OUTLETS = {
|
||||||
appController = AppController;
|
|
||||||
playbackController = PlaybackController;
|
playbackController = PlaybackController;
|
||||||
playlistController = PlaylistController;
|
playlistController = PlaylistController;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
<key>IBEditorPositions</key>
|
<key>IBEditorPositions</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>1063</key>
|
<key>1063</key>
|
||||||
<string>0 312 189 49 0 0 1280 1002 </string>
|
<string>0 228 136 49 0 0 1024 746 </string>
|
||||||
<key>29</key>
|
<key>29</key>
|
||||||
<string>139 888 409 44 0 0 1280 1002 </string>
|
<string>98 651 409 44 0 0 1024 746 </string>
|
||||||
<key>463</key>
|
<key>463</key>
|
||||||
<string>486 586 308 187 0 0 1280 1002 </string>
|
<string>358 426 308 187 0 0 1024 746 </string>
|
||||||
<key>513</key>
|
<key>513</key>
|
||||||
<string>821 270 125 137 0 0 1280 1002 </string>
|
<string>639 190 125 137 0 0 1024 746 </string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>IBFramework Version</key>
|
<key>IBFramework Version</key>
|
||||||
<string>443.0</string>
|
<string>443.0</string>
|
||||||
|
@ -30,12 +30,12 @@
|
||||||
<integer>3</integer>
|
<integer>3</integer>
|
||||||
<key>IBOpenObjects</key>
|
<key>IBOpenObjects</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>1063</integer>
|
<integer>29</integer>
|
||||||
<integer>513</integer>
|
|
||||||
<integer>21</integer>
|
|
||||||
<integer>463</integer>
|
<integer>463</integer>
|
||||||
<integer>823</integer>
|
<integer>823</integer>
|
||||||
<integer>29</integer>
|
<integer>21</integer>
|
||||||
|
<integer>1063</integer>
|
||||||
|
<integer>513</integer>
|
||||||
</array>
|
</array>
|
||||||
<key>IBSystem Version</key>
|
<key>IBSystem Version</key>
|
||||||
<string>8I127</string>
|
<string>8I127</string>
|
||||||
|
|
Binary file not shown.
|
@ -321,17 +321,16 @@
|
||||||
- (void)setSortDescriptors:(NSArray *)sortDescriptors
|
- (void)setSortDescriptors:(NSArray *)sortDescriptors
|
||||||
{
|
{
|
||||||
//Cheap hack so the index column isn't sorted
|
//Cheap hack so the index column isn't sorted
|
||||||
NSLog(@"KEY: %@", [[sortDescriptors objectAtIndex:0] key]);
|
if (([sortDescriptors count] != 0) && [[[sortDescriptors objectAtIndex:0] key] caseInsensitiveCompare:@"displayIndex"] == NSOrderedSame)
|
||||||
if ([[[sortDescriptors objectAtIndex:0] key] caseInsensitiveCompare:@"displayIndex"] != NSOrderedSame)
|
|
||||||
{
|
{
|
||||||
[super setSortDescriptors:sortDescriptors];
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[super setSortDescriptors:sortDescriptors];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sortByPath
|
- (void)sortByPath
|
||||||
{
|
{
|
||||||
[self setSortDescriptors:nil];
|
|
||||||
|
|
||||||
NSSortDescriptor *s = [[NSSortDescriptor alloc] initWithKey:@"filename" ascending:YES selector:@selector(compare:)];
|
NSSortDescriptor *s = [[NSSortDescriptor alloc] initWithKey:@"filename" ascending:YES selector:@selector(compare:)];
|
||||||
// [self setSortDescriptors:[NSArray arrayWithObject:s]];
|
// [self setSortDescriptors:[NSArray arrayWithObject:s]];
|
||||||
[self setContent:[[self content] sortedArrayUsingDescriptors:[NSArray arrayWithObject:s]]];
|
[self setContent:[[self content] sortedArrayUsingDescriptors:[NSArray arrayWithObject:s]]];
|
||||||
|
|
|
@ -19,4 +19,8 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)sortByPath:(id)sender;
|
||||||
|
- (IBAction)shufflePlaylist:(id)sender;
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -127,4 +127,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)sortByPath:(id)sender
|
||||||
|
{
|
||||||
|
[self setSortDescriptors:nil];
|
||||||
|
[playlistController sortByPath];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (IBAction)shufflePlaylist:(id)sender
|
||||||
|
{
|
||||||
|
[self setSortDescriptors:nil];
|
||||||
|
[playlistController randomizeList];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue