| 138 | | - (void)setiTunesCurrentInfo:(NSDictionary *)newInfo |
|---|
| 139 | | { |
|---|
| 140 | | if (newInfo != iTunesCurrentInfo) { |
|---|
| 141 | | [iTunesCurrentInfo release]; |
|---|
| 142 | | iTunesCurrentInfo = [newInfo retain]; |
|---|
| 143 | | |
|---|
| 144 | | [self setiTunesIsStopped:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_STOPPED]]; |
|---|
| 145 | | [self setiTunesIsPaused:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_PAUSED]]; |
|---|
| 146 | | |
|---|
| 147 | | [[adium notificationCenter] postNotificationName:Adium_RequestImmediateDynamicContentUpdate object:nil]; |
|---|
| 148 | | } |
|---|
| 149 | | } |
|---|
| | 138 | - (void)setiTunesCurrentInfo:(NSDictionary *)newInfo |
|---|
| | 139 | { |
|---|
| | 140 | if (newInfo != iTunesCurrentInfo) { |
|---|
| | 141 | NSTimeInterval time = 5.0; |
|---|
| | 142 | [iTunesCurrentInfo release]; |
|---|
| | 143 | iTunesCurrentInfo = [newInfo retain]; |
|---|
| | 144 | |
|---|
| | 145 | [self setiTunesIsStopped:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_STOPPED]]; |
|---|
| | 146 | [self setiTunesIsPaused:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_PAUSED]]; |
|---|
| | 147 | |
|---|
| | 148 | //Cancel any requests we had to fire updates. |
|---|
| | 149 | [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(fireUpdateiTunesInfo) object:nil]; |
|---|
| | 150 | //fire an iTunes update in three seconds. |
|---|
| | 151 | [self performSelector:@selector(fireUpdateiTunesInfo) withObject:nil afterDelay:3.0]; |
|---|
| | 152 | } |
|---|
| | 153 | } |
|---|
| | 154 | |
|---|
| | 155 | -(void)fireUpdateiTunesInfo |
|---|
| | 156 | { |
|---|
| | 157 | [[adium notificationCenter] postNotificationName:Adium_RequestImmediateDynamicContentUpdate object:nil]; |
|---|
| | 158 | } |
|---|