git.ithinksw.org
/
MenuTunes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed the STUPID BUG where the multisource playlist thing would crash
[MenuTunes.git]
/
MenuController.m
diff --git
a/MenuController.m
b/MenuController.m
index
b7f8f85
..
dfd4f49
100755
(executable)
--- a/
MenuController.m
+++ b/
MenuController.m
@@
-21,8
+21,8
@@
- (NSMenu *)playlistsMenu;
- (NSMenu *)eqMenu;
- (void)setKeyEquivalentForCode:(short)code andModifiers:(long)modifiers
- (NSMenu *)playlistsMenu;
- (NSMenu *)eqMenu;
- (void)setKeyEquivalentForCode:(short)code andModifiers:(long)modifiers
- onItem:(
NSMenuItem *
)item;
-
//
- (BOOL)iPodAtPathAutomaticallyUpdates:(NSString *)name;
+ onItem:(
id <NSMenuItem>
)item;
+- (BOOL)iPodAtPathAutomaticallyUpdates:(NSString *)name;
@end
@implementation MenuController
@end
@implementation MenuController
@@
-42,7
+42,7
@@
NSArray *menuArray = [defaults arrayForKey:@"menu"];
NSEnumerator *enumerator = [menuArray objectEnumerator];
NSString *nextObject;
NSArray *menuArray = [defaults arrayForKey:@"menu"];
NSEnumerator *enumerator = [menuArray objectEnumerator];
NSString *nextObject;
-
NSMenuItem *
tempItem;
+
id <NSMenuItem>
tempItem;
NSEnumerator *itemEnum;
ITHotKey *hotKey;
NSArray *hotKeys = [[ITHotKeyCenter sharedCenter] allHotKeys];
NSEnumerator *itemEnum;
ITHotKey *hotKey;
NSArray *hotKeys = [[ITHotKeyCenter sharedCenter] allHotKeys];
@@
-399,7
+399,7
@@
- (NSMenu *)menuForNoPlayer
{
NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
- (NSMenu *)menuForNoPlayer
{
NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
-
NSMenuItem *
tempItem;
+
id <NSMenuItem>
tempItem;
ITDebugLog(@"Creating menu for when player isn't running.");
NS_DURING
ITDebugLog(@"Add \"Open %@\" menu item.", [[[MainController sharedController] currentRemote] playerSimpleName]);
ITDebugLog(@"Creating menu for when player isn't running.");
NS_DURING
ITDebugLog(@"Add \"Open %@\" menu item.", [[[MainController sharedController] currentRemote] playerSimpleName]);
@@
-497,7
+497,6
@@
if (_currentPlaylist && !_playingRadio) {
if (numSongs > 0) {
int i;
if (_currentPlaylist && !_playingRadio) {
if (numSongs > 0) {
int i;
-
for (i = _currentTrack + 1; i <= _currentTrack + numSongsInAdvance; i++) {
if (i <= numSongs) {
NSString *curSong;
for (i = _currentTrack + 1; i <= _currentTrack + numSongsInAdvance; i++) {
if (i <= numSongs) {
NSString *curSong;
@@
-506,7
+505,7
@@
NS_HANDLER
[[MainController sharedController] networkError:localException];
NS_ENDHANDLER
NS_HANDLER
[[MainController sharedController] networkError:localException];
NS_ENDHANDLER
-
NSMenuItem *
songItem;
+
id <NSMenuItem>
songItem;
ITDebugLog(@"Adding song: %@", curSong);
songItem = [upcomingSongsMenu addItemWithTitle:curSong action:@selector(performUpcomingSongsMenuAction:) keyEquivalent:@""];
[songItem setTag:i];
ITDebugLog(@"Adding song: %@", curSong);
songItem = [upcomingSongsMenu addItemWithTitle:curSong action:@selector(performUpcomingSongsMenuAction:) keyEquivalent:@""];
[songItem setTag:i];
@@
-525,11
+524,11
@@
return upcomingSongsMenu;
}
return upcomingSongsMenu;
}
-- (NSMenu *)playlistsMenu
+
/*
- (NSMenu *)playlistsMenu
{
NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""];
NSArray *playlists;
{
NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""];
NSArray *playlists;
-
NSMenuItem *
tempItem;
+
id <NSMenuItem>
tempItem;
ITMTRemotePlayerSource source = [[[MainController sharedController] currentRemote] currentSource];
int i;
NS_DURING
ITMTRemotePlayerSource source = [[[MainController sharedController] currentRemote] currentSource];
int i;
NS_DURING
@@
-563,18
+562,21
@@
}
ITDebugLog(@"Done Building \"Playlists\" menu");
return playlistsMenu;
}
ITDebugLog(@"Done Building \"Playlists\" menu");
return playlistsMenu;
-}
+}
*/
-
/*
- (NSMenu *)playlistsMenu
+- (NSMenu *)playlistsMenu
{
NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""];
NSArray *playlists;
{
NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""];
NSArray *playlists;
-
NSMenuItem *
tempItem;
+
id <NSMenuItem>
tempItem;
ITMTRemotePlayerSource source = [[[MainController sharedController] currentRemote] currentSource];
int i, j;
NS_DURING
playlists = [[[MainController sharedController] currentRemote] playlists];
ITMTRemotePlayerSource source = [[[MainController sharedController] currentRemote] currentSource];
int i, j;
NS_DURING
playlists = [[[MainController sharedController] currentRemote] playlists];
+ /*playlists = [NSArray arrayWithObjects:
+ [NSArray arrayWithObjects:@"Library", [NSNumber numberWithInt:-1], @"Library", @"Playlist", nil],
+ [NSArray arrayWithObjects:@"Radio", [NSNumber numberWithInt:1], @"Radio", nil], nil];*/
NS_HANDLER
[[MainController sharedController] networkError:localException];
NS_ENDHANDLER
NS_HANDLER
[[MainController sharedController] networkError:localException];
NS_ENDHANDLER
@@
-590,7
+592,6
@@
[tempItem setTarget:self];
}
}
[tempItem setTarget:self];
}
}
-
if ( (source == ITMTRemoteRadioSource) || ([playlists count] - 2 > 0) ) {
[playlistsMenu addItem:[NSMenuItem separatorItem]];
}
if ( (source == ITMTRemoteRadioSource) || ([playlists count] - 2 > 0) ) {
[playlistsMenu addItem:[NSMenuItem separatorItem]];
}
@@
-627,13
+628,13
@@
}
ITDebugLog(@"Done Building \"Playlists\" menu");
return playlistsMenu;
}
ITDebugLog(@"Done Building \"Playlists\" menu");
return playlistsMenu;
-}
*/
+}
- (NSMenu *)eqMenu
{
NSMenu *eqMenu = [[NSMenu alloc] initWithTitle:@""];
NSArray *eqPresets;
- (NSMenu *)eqMenu
{
NSMenu *eqMenu = [[NSMenu alloc] initWithTitle:@""];
NSArray *eqPresets;
-
NSMenuItem *
tempItem;
+
id <NSMenuItem>
tempItem;
int i;
NS_DURING
int i;
NS_DURING
@@
-761,7
+762,7
@@
}
- (void)setKeyEquivalentForCode:(short)code andModifiers:(long)modifiers
}
- (void)setKeyEquivalentForCode:(short)code andModifiers:(long)modifiers
- onItem:(
NSMenuItem *
)item
+ onItem:(
id <NSMenuItem>
)item
{
unichar charcode = 'a';
int i;
{
unichar charcode = 'a';
int i;
@@
-980,7
+981,7
@@
ITDebugLog(@"Done setting key equivalent on menu item: %@", [item title]);
}
ITDebugLog(@"Done setting key equivalent on menu item: %@", [item title]);
}
-
/*
- (BOOL)iPodAtPathAutomaticallyUpdates:(NSString *)name
+- (BOOL)iPodAtPathAutomaticallyUpdates:(NSString *)name
{
NSArray *volumes = [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths];
NSEnumerator *volEnum = [volumes objectEnumerator];
{
NSArray *volumes = [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths];
NSEnumerator *volEnum = [volumes objectEnumerator];
@@
-1010,6
+1011,7
@@
}
}
}
}
}
}
-}*/
+ return NO;
+}
@end
\ No newline at end of file
@end
\ No newline at end of file