Changeset 667
- Timestamp:
- 08/06/13 23:50:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StreamVision/StreamVision.py
r666 r667 16 16 import httplib2 17 17 import os 18 import struct19 18 import scrape 20 19 import HotKey … … 67 66 url = session.region.firsttag('a')['href'] 68 67 if not url.startswith('http'): 69 70 68 url = 'http://www.radioparadise.com/rp2-' + url 69 return url 71 70 72 71 def cleanStreamTitle(title): … … 319 318 systemEvents = app(id='com.apple.systemEvents') 320 319 frontName = systemEvents.processes[its.frontmost == True][1].name() 321 322 323 324 325 326 327 328 329 330 331 332 320 if frontName == 'RealPlayer': 321 realPlayer = app(id='com.RealNetworks.RealPlayer') 322 if len(realPlayer.players()) > 0: 323 if realPlayer.players[1].state() == k.playing: 324 realPlayer.pause() 325 else: 326 realPlayer.play() 327 return 328 elif frontName == 'VLC': 329 app(id='org.videolan.vlc').play() # equivalent to playpause 330 else: 331 self.playPause(useStereo=False) 333 332 334 333 def nextTrack(self): … … 384 383 self.registerHotKey(lambda: self.incrementRatingBy(20), 103, shiftKey) # shift-F11 385 384 self.registerZoomWindowHotKey() 386 NSDistributedNotificationCenter.defaultCenter().addObserver_selector_name_object_(self, self.displayTrackInfo, 'com.apple.iTunes.playerInfo', None) 385 386 distributedNotificationCenter = NSDistributedNotificationCenter.defaultCenter() 387 distributedNotificationCenter.addObserver_selector_name_object_(self, self.displayTrackInfo, 'com.apple.iTunes.playerInfo', None) 388 distributedNotificationCenter.addObserver_selector_name_object_(self, self.terminate_, 'com.apple.logoutContinued', None) 387 389 try: 388 390 import HIDRemote
Note:
See TracChangeset
for help on using the changeset viewer.