menu = [[NSMenu alloc] initWithTitle:@""];
[[menu addItemWithTitle:@"Open iTunes" action:@selector(openiTunes:) keyEquivalent:@""] setTarget:self];
[[menu addItemWithTitle:@"Preferences" action:@selector(showPreferences:) keyEquivalent:@""] setTarget:self];
menu = [[NSMenu alloc] initWithTitle:@""];
[[menu addItemWithTitle:@"Open iTunes" action:@selector(openiTunes:) keyEquivalent:@""] setTarget:self];
[[menu addItemWithTitle:@"Preferences" action:@selector(showPreferences:) keyEquivalent:@""] setTarget:self];
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults objectForKey:@"menu"]) {
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults objectForKey:@"menu"]) {
[self setKeyEquivalentForCode:[tempCombo keyCode]
andModifiers:[tempCombo modifiers] onItem:playPauseMenuItem];
[tempCombo release];
[self setKeyEquivalentForCode:[tempCombo keyCode]
andModifiers:[tempCombo modifiers] onItem:playPauseMenuItem];
[tempCombo release];
[self setKeyEquivalentForCode:[tempCombo keyCode]
andModifiers:[tempCombo modifiers] onItem:nextTrack];
[tempCombo release];
[self setKeyEquivalentForCode:[tempCombo keyCode]
andModifiers:[tempCombo modifiers] onItem:nextTrack];
[tempCombo release];
[self setKeyEquivalentForCode:[tempCombo keyCode]
andModifiers:[tempCombo modifiers] onItem:prevTrack];
[tempCombo release];
[self setKeyEquivalentForCode:[tempCombo keyCode]
andModifiers:[tempCombo modifiers] onItem:prevTrack];
[tempCombo release];
NSString *curSongName, *curAlbumName = @"", *curArtistName = @"";
curSongName = [currentRemote currentSongTitle];
NSString *curSongName, *curAlbumName = @"", *curArtistName = @"";
curSongName = [currentRemote currentSongTitle];
int curIndex = [currentRemote currentPlaylistIndex];
int numSongs = [currentRemote numberOfSongsInPlaylistAtIndex:curIndex];
int numSongsInAdvance = [[NSUserDefaults standardUserDefaults] integerForKey:@"SongsInAdvance"];
int curIndex = [currentRemote currentPlaylistIndex];
int numSongs = [currentRemote numberOfSongsInPlaylistAtIndex:curIndex];
int numSongsInAdvance = [[NSUserDefaults standardUserDefaults] integerForKey:@"SongsInAdvance"];
NSMenuItem *songItem;
songItem = [[NSMenuItem alloc] initWithTitle:curSong action:@selector(playTrack:) keyEquivalent:@""];
[songItem setTarget:self];
NSMenuItem *songItem;
songItem = [[NSMenuItem alloc] initWithTitle:curSong action:@selector(playTrack:) keyEquivalent:@""];
[songItem setTarget:self];
NSArray *playlists = [currentRemote playlists];
int i, curPlaylist = [currentRemote currentPlaylistIndex];
NSArray *playlists = [currentRemote playlists];
int i, curPlaylist = [currentRemote currentPlaylistIndex];
NSMenuItem *tempItem;
tempItem = [[NSMenuItem alloc] initWithTitle:playlistName action:@selector(selectPlaylist:) keyEquivalent:@""];
[tempItem setTarget:self];
NSMenuItem *tempItem;
tempItem = [[NSMenuItem alloc] initWithTitle:playlistName action:@selector(selectPlaylist:) keyEquivalent:@""];
[tempItem setTarget:self];
tempItem = [[NSMenuItem alloc] initWithTitle:setName action:@selector(selectEQPreset:) keyEquivalent:@""];
[tempItem setTarget:self];
[tempItem setRepresentedObject:[NSNumber numberWithInt:i]];
[eqMenu addItem:tempItem];
[tempItem release];
tempItem = [[NSMenuItem alloc] initWithTitle:setName action:@selector(selectEQPreset:) keyEquivalent:@""];
[tempItem setTarget:self];
[tempItem setRepresentedObject:[NSNumber numberWithInt:i]];
[eqMenu addItem:tempItem];
[tempItem release];
if ([currentRemote playerState] != stopped) {
int trackPlayingIndex = [currentRemote currentSongIndex];
int playlist = [currentRemote currentPlaylistIndex];
if (trackPlayingIndex != lastSongIndex) {
if ([currentRemote playerState] != stopped) {
int trackPlayingIndex = [currentRemote currentSongIndex];
int playlist = [currentRemote currentPlaylistIndex];
if (trackPlayingIndex != lastSongIndex) {
isPlayingRadio = [[currentRemote classOfPlaylistAtIndex:playlist] isEqualToString:@"radio tuner playlist"];
if (isPlayingRadio && !wasPlayingRadio) {
int i;
isPlayingRadio = [[currentRemote classOfPlaylistAtIndex:playlist] isEqualToString:@"radio tuner playlist"];
if (isPlayingRadio && !wasPlayingRadio) {
int i;
isPlayingRadio = [[currentRemote classOfPlaylistAtIndex:playlist] isEqualToString:@"radio tuner playlist"];
if (isPlayingRadio && !wasPlayingRadio) {
int i;
isPlayingRadio = [[currentRemote classOfPlaylistAtIndex:playlist] isEqualToString:@"radio tuner playlist"];
if (isPlayingRadio && !wasPlayingRadio) {
int i;
for (i = curTrack + 1; i <= curTrack + numSongsInAdvance; i++) {
if (i <= numSongs) {
NSString *curSong = [currentRemote songTitleAtIndex:i];
for (i = curTrack + 1; i <= curTrack + numSongsInAdvance; i++) {
if (i <= numSongs) {
NSString *curSong = [currentRemote songTitleAtIndex:i];