- Timestamp:
- 12/19/06 03:18:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StreamVision/StreamVision.py
r313 r315 41 41 42 42 def radioParadiseURL(): 43 # XXX better to use http://www2.radioparadise.com/playlist.xml ? 43 44 session = scrape.Session() 44 45 session.go('http://www2.radioparadise.com/nowplay_b.php') … … 80 81 iTunes = iTunesApp() 81 82 82 trackClass = iTunes.current_track.class_ .get()83 trackClass = iTunes.current_track.class_() 83 84 trackName = '' 84 if trackClass != k. Property:85 trackName = iTunes.current_track.name .get()86 87 if iTunes.player_state .get() != k.playing:85 if trackClass != k.property: 86 trackName = iTunes.current_track.name() 87 88 if iTunes.player_state() != k.playing: 88 89 growlNotify('iTunes is not playing.', trackName) 89 90 return 90 91 if trackClass == k.URL_track: 91 growlNotify(cleanStreamTitle(iTunes.current_stream_title .get()),92 growlNotify(cleanStreamTitle(iTunes.current_stream_title()), 92 93 cleanStreamTrackName(trackName)) 93 94 return 94 if trackClass == k. Property:95 if trackClass == k.property: 95 96 growlNotify('iTunes is playing.', '') 96 97 return … … 98 99 # XXX iTunes doesn't let you get artwork for shared tracks 99 100 if trackClass != k.shared_track: 100 artwork = iTunes.current_track.artworks .get()101 artwork = iTunes.current_track.artworks() 101 102 if artwork: 102 kw['pictImage'] = artwork[0].data .get()103 kw['pictImage'] = artwork[0].data() 103 104 growlNotify(trackName + ' ' + 104 '★' * (iTunes.current_track.rating .get() / 20),105 iTunes.current_track.album .get() + "\n" +106 iTunes.current_track.artist .get(),105 '★' * (iTunes.current_track.rating() / 20), 106 iTunes.current_track.album() + "\n" + 107 iTunes.current_track.artist(), 107 108 **kw) 108 109 109 110 def goToSite(self): 110 111 iTunes = iTunesApp() 111 if iTunes.player_state .get() == k.playing:112 url = iTunes.current_stream_URL .get()112 if iTunes.player_state() == k.playing: 113 url = iTunes.current_stream_URL() 113 114 if url: 114 115 if 'radioparadise.com' in url and 'review' not in url: … … 132 133 def incrementRatingBy(self, increment): 133 134 iTunes = iTunesApp() 134 rating = iTunes.current_track.rating .get()135 rating = iTunes.current_track.rating() 135 136 rating += increment 136 137 if rating < 0: … … 144 145 def playPause(self, useStereo=True): 145 146 iTunes = iTunesApp() 146 was_playing = (iTunes.player_state .get() == k.playing)147 was_playing = (iTunes.player_state() == k.playing) 147 148 iTunes.playpause() 148 if not was_playing and iTunes.player_state .get() == k.stopped:149 if not was_playing and iTunes.player_state() == k.stopped: 149 150 # most likely, we're focused on the iPod, so playing does nothing 150 iTunes.browser_windows[1].view.set(iTunes.user_playlists[its.name=='Stations'][1] .get())151 iTunes.browser_windows[1].view.set(iTunes.user_playlists[its.name=='Stations'][1]()) 151 152 iTunes.play() 152 153 if HAVE_XTENSION and useStereo: 153 if iTunes.player_state .get() == k.playing:154 if iTunes.player_state() == k.playing: 154 155 XTensionApp().turnon('Stereo') 155 156 else: … … 161 162 if frontName == 'RealPlayer': 162 163 realPlayer = app(id='com.RealNetworks.RealPlayer') 163 if realPlayer.players[0].state.get() == k.playing: 164 realPlayer.pause() 165 else: 166 realPlayer.play() 164 if len(realPlayer.players()) > 0: 165 if realPlayer.players[1].state() == k.playing: 166 realPlayer.pause() 167 else: 168 realPlayer.play() 169 return 167 170 elif frontName == 'VLC': 168 171 app(id='org.videolan.vlc').play() # equivalent to playpause
Note:
See TracChangeset
for help on using the changeset viewer.