1 new commit in StationPlaylist: https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/30f31692aacd/ Changeset: 30f31692aacd Branch: master User: josephsl Date: 2015-03-22 22:23:18+00:00 Summary: Encoders package (5.0-dev): added a command to clear background encoder set and take care of exceptions raised when one of the SPL encoders is monitored and deleted. Affected #: 1 file diff --git a/addon/globalPlugins/SPLStudioUtils/encoders.py b/addon/globalPlugins/SPLStudioUtils/encoders.py index e710f9d..af22426 100755 --- a/addon/globalPlugins/SPLStudioUtils/encoders.py +++ b/addon/globalPlugins/SPLStudioUtils/encoders.py @@ -134,25 +134,31 @@ class Encoder(IAccessible): script_togglePlay.__doc__=_("Toggles whether Studio will play the first song when connected to a streaming server.") def script_toggleBackgroundEncoderMonitor(self, gesture): - if not self.backgroundMonitor: - self.backgroundMonitor = True - encoderMonCount[self.encoderType] += 1 # Multiple encoders. - ui.message("Monitoring encoder {encoderNumber}".format(encoderNumber = self.IAccessibleChildID)) + if scriptHandler.getLastScriptRepeatCount()==0: + if not self.backgroundMonitor: + self.backgroundMonitor = True + encoderMonCount[self.encoderType] += 1 # Multiple encoders. + ui.message("Monitoring encoder {encoderNumber}".format(encoderNumber = self.IAccessibleChildID)) + else: + self.backgroundMonitor = False + encoderMonCount[self.encoderType] -= 1 + ui.message("Encoder {encoderNumber} will not be monitored".format(encoderNumber = self.IAccessibleChildID)) + threadPool = self.setBackgroundMonitor() + if self.backgroundMonitor: + try: + monitoring = threadPool[self.IAccessibleChildID].isAlive() + except KeyError: + monitoring = False + if not monitoring: + statusThread = threading.Thread(target=self.reportConnectionStatus) + statusThread.name = "Connection Status Reporter " + str(self.IAccessibleChildID) + statusThread.start() + threadPool[self.IAccessibleChildID] = statusThread else: - self.backgroundMonitor = False - encoderMonCount[self.encoderType] -= 1 - ui.message("Encoder {encoderNumber} will not be monitored".format(encoderNumber = self.IAccessibleChildID)) - threadPool = self.setBackgroundMonitor() - if self.backgroundMonitor: - try: - monitoring = threadPool[self.IAccessibleChildID].isAlive() - except KeyError: - monitoring = False - if not monitoring: - statusThread = threading.Thread(target=self.reportConnectionStatus) - statusThread.name = "Connection Status Reporter " + str(self.IAccessibleChildID) - statusThread.start() - threadPool[self.IAccessibleChildID] = statusThread + for encoderType in encoderMonCount: + encoderMonCount[encoderType] = 0 + SPLBackgroundMonitor.clear() + ui.message("Encoder monitoring canceled") def script_streamLabeler(self, gesture): curStreamLabel, title = self.getStreamLabel(getTitle=True) @@ -419,6 +425,7 @@ class SPLEncoder(Encoder): return # Don't leave zombie objects around. if messageCache != statChild.name: messageCache = statChild.name + if not messageCache: return if "Kbps" not in messageCache: self.encoderStatusMessage(messageCache, self.IAccessibleChildID) if messageCache == "Disconnected": Repository URL: https://bitbucket.org/nvdaaddonteam/stationplaylist/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.