git.ithinksw.org
/
MenuTunes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8c2086e
)
Everything is in the plugin now, I hope
author
Kent Sutherland
<ksuther@ithinksw.com>
Sat, 15 Feb 2003 11:12:38 +0000
(11:12 +0000)
committer
Kent Sutherland
<ksuther@ithinksw.com>
Sat, 15 Feb 2003 11:12:38 +0000
(11:12 +0000)
MenuTunes.m
patch
|
blob
|
history
diff --git
a/MenuTunes.m
b/MenuTunes.m
index
ca96f36
..
4398815
100755
(executable)
--- a/
MenuTunes.m
+++ b/
MenuTunes.m
@@
-209,9
+209,8
@@
Things to do:
trackInfoIndex = -1;
lastSongIndex = -1;
trackInfoIndex = -1;
lastSongIndex = -1;
- didHaveAlbumName = ([[self runScriptAndReturnResult:@"return album of current track"] length] > 0);
- didHaveArtistName = ([[self runScriptAndReturnResult:@"return artist of current track"] length] > 0);
-
+ didHaveAlbumName = ([[currentRemote currentSongAlbum] length] > 0);
+ didHaveArtistName = ([[currentRemote currentSongArtist] length] > 0);
while ([menu numberOfItems] > 0) {
[menu removeItemAtIndex:0];
while ([menu numberOfItems] > 0) {
[menu removeItemAtIndex:0];
@@
-365,7
+364,7
@@
Things to do:
if (!isPlayingRadio) {
if ([defaults boolForKey:@"showTime"]) {
if (!isPlayingRadio) {
if ([defaults boolForKey:@"showTime"]) {
- menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", [
self runScriptAndReturnResult:@"return time of current track"
]]
+ menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", [
currentRemote currentSongLength
]]
action:nil
keyEquivalent:@""];
[menu insertItem:menuItem atIndex:trackInfoIndex + 1];
action:nil
keyEquivalent:@""];
[menu insertItem:menuItem atIndex:trackInfoIndex + 1];
@@
-654,7
+653,7
@@
Things to do:
}
//Update Play/Pause menu item
if (playPauseMenuItem){
}
//Update Play/Pause menu item
if (playPauseMenuItem){
- if ([
[self runScriptAndReturnResult:@"return player state"] isEqualToString:@"playing"]
) {
+ if ([
currentRemote playerState] == playing
) {
[playPauseMenuItem setTitle:@"Pause"];
} else {
[playPauseMenuItem setTitle:@"Play"];
[playPauseMenuItem setTitle:@"Pause"];
} else {
[playPauseMenuItem setTitle:@"Play"];
@@
-769,13
+768,11
@@
andEventID:(AEEventID)eventID
- (void)playPause:(id)sender
{
- (void)playPause:(id)sender
{
- NSString *state = [self runScriptAndReturnResult:@"return player state"];
- NSLog(@"%i", [currentRemote playerState]);
- if ([state isEqualToString:@"playing"]) {
- [currentRemote play];
+ PlayerState state = [currentRemote playerState];
+ if (state == playing) {
+ [currentRemote pause];
[playPauseMenuItem setTitle:@"Play"];
[playPauseMenuItem setTitle:@"Play"];
- } else if ([state isEqualToString:@"fast forwarding"] || [state
-isEqualToString:@"rewinding"]) {
+ } else if ((state == forwarding) || (state == rewinding)) {
[currentRemote play];
[currentRemote pause];
} else {
[currentRemote play];
[currentRemote pause];
} else {
@@
-846,7
+843,7
@@
isEqualToString:@"rewinding"]) {
- (void)showCurrentTrackInfo
{
- (void)showCurrentTrackInfo
{
- NSString *trackName = [
self runScriptAndReturnResult:@"return name of current track"
];
+ NSString *trackName = [
currentRemote currentSongTitle
];
if (!statusController && [trackName length]) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *stringToShow = @"";
if (!statusController && [trackName length]) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *stringToShow = @"";