Changeset 656
- Timestamp:
- 04/07/13 20:14:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StreamVision/StreamVision.py
r655 r656 40 40 def growlNotify(title, description, **kw): 41 41 try: 42 if usingStereo: 43 description += '\n(AirPlay)' 44 42 45 growl.notify( 43 46 with_name=NOTIFICATION_TRACK_INFO, … … 98 101 99 102 needsStereoPowerOn = HAVE_XTENSION 103 usingStereo = False 100 104 101 105 def mayUseStereo(): … … 111 115 return remote_speakers and remote_speakers[0] not in (None, k.missing_value) 112 116 113 def turnStereoOn(): 114 global needsStereoPowerOn 117 def turnStereoOnOrOff(): 118 global needsStereoPowerOn, usingStereo 119 usingStereo = False 115 120 if not default_output_device_is_airplay() and not mayUseStereo(): 116 121 if HAVE_XTENSION and XTensionApp().status('Stereo'): … … 119 124 if not XTensionApp().status('Stereo'): 120 125 XTensionApp().turnon('Stereo') 126 usingStereo = True 121 127 needsStereoPowerOn = False 122 128 123 129 def turnStereoOff(): 124 global needsStereoPowerOn 130 global needsStereoPowerOn, usingStereo 131 usingStereo = False 125 132 if default_output_device_is_airplay() or not mayUseStereo(): 126 133 return … … 182 189 turnStereoOff() 183 190 return 184 turnStereoOn ()191 turnStereoOnOrOff() 185 192 if trackClass == k.URL_track: 186 193 if amuaPlaying(): … … 221 228 **kw) 222 229 230 def defaultOutputDeviceChanged(self): 231 turnStereoOnOrOff() 232 self.displayTrackInfo() 233 223 234 def goToSite(self): 224 235 iTunes = iTunesApp() … … 285 296 return 286 297 if iTunes.player_state() == k.playing: 287 turnStereoOn ()298 turnStereoOnOrOff() 288 299 else: 289 300 turnStereoOff() … … 366 377 print "failed to connect to remote: ", e 367 378 368 set_default_output_device_changed_callback(turnStereoOn) 369 turnStereoOn() 379 set_default_output_device_changed_callback( 380 self.defaultOutputDeviceChanged) 381 turnStereoOnOrOff() 370 382 371 383 def sendEvent_(self, theEvent):
Note:
See TracChangeset
for help on using the changeset viewer.