commit/StationPlaylist: josephsl: Braille Timer (4.0-dev/legacy): Added intro monitoring capability.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Mon, 10 Nov 2014 05:42:20 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/5c2fddaf7933/
Changeset:   5c2fddaf7933
Branch:      None
User:        josephsl
Date:        2014-11-10 05:40:50+00:00
Summary:     Braille Timer (4.0-dev/legacy): Added intro monitoring capability.
Braille Timer settings script now operates similar to library scan settings 
script. Also added two settings - monitor intros and monitor both intro and 
track endings, similar to Window-Eyes.

Affected #:  1 file

diff --git a/addon/appModules/splstudio.py b/addon/appModules/splstudio.py
index 6529e65..6dffaf2 100644
--- a/addon/appModules/splstudio.py
+++ b/addon/appModules/splstudio.py
@@ -76,8 +76,6 @@ class AppModule(appModuleHandler.AppModule):
 
        # Play beeps instead of announcing toggles.
        beepAnnounce = False
-       # Monitor various track times with braille.
-       brailleCounter = False
        # Actual version of the software that we are running.
        SPLCurVersion = appModuleHandler.AppModule.productVersion
 
@@ -126,6 +124,11 @@ class AppModule(appModuleHandler.AppModule):
                micAlarm = int(SPLConfig["MicAlarm"])
        except KeyError:
                micAlarm = 0
+       # Monitor various track times with braille.
+       brailleTimer = 0
+       brailleTimerEnding = 1
+       brailleTimerIntro = 2
+       brailleTimerBoth = 3 # Both as in intro and track ending.
 
        # Automatically announce mic, line in, etc changes
        # These items are static text items whose name changes.
@@ -188,22 +191,26 @@ class AppModule(appModuleHandler.AppModule):
                        elif obj.windowClassName == "TStaticText": # For future 
extensions.
                                if obj.simpleParent.name == "Remaining Time":
                                        # End of track for SPL 4.x.
-                                       if self.brailleCounter and "00:00" < 
obj.name <= self.SPLEndOfTrackTime:
+                                       if self.brailleTimer in 
[self.brailleTimerEnding, self.brailleTimerBoth] and "00:00" < obj.name <= 
self.SPLEndOfTrackTime:
                                                
braille.handler.message(obj.name)
                                        if obj.name == self.SPLEndOfTrackTime:
                                                tones.beep(440, 200)
                                elif obj.simpleParent.name == "Remaining Song 
Ramp":
                                        # Song intro for SPL 4.x.
+                                       if self.brailleTimer in 
[self.brailleTimerIntro, self.brailleTimerBoth] and "00:00" < obj.name <= 
self.SPLSongRampTime:
+                                               
braille.handler.message(obj.name)
                                        if obj.name == self.SPLSongRampTime:
                                                tones.beep(512, 400)
                                elif obj.simplePrevious != None and 
obj.simplePrevious.name == "Remaining Time":
                                        # End of track for SPL 5.x.
-                                       if self.brailleCounter and "00:00" < 
obj.name <= self.SPLEndOfTrackTime:
+                                       if self.brailleTimer in 
[self.brailleTimerEnding, self.brailleTimerBoth] and "00:00" < obj.name <= 
self.SPLEndOfTrackTime:
                                                
braille.handler.message(obj.name)
                                        if obj.name == self.SPLEndOfTrackTime:
                                                tones.beep(440, 200)
                                elif obj.simplePrevious != None and 
obj.simplePrevious.name == "Remaining Song Ramp":
                                        # Song intro for SPL 5.x.
+                                       if self.brailleTimer in 
[self.brailleTimerIntro, self.brailleTimerBoth] and "00:00" < obj.name <= 
self.SPLSongRampTime:
+                                               
braille.handler.message(obj.name)
                                        if obj.name == self.SPLSongRampTime:
                                                tones.beep(512, 400)
                        # Clean this mess with a more elegant solution.
@@ -425,17 +432,21 @@ class AppModule(appModuleHandler.AppModule):
        # Translators: Input help mode message for a command in Station 
Playlist Studio.
        script_toggleBeepAnnounce.__doc__=_("Toggles option change 
announcements between words and beeps.")
 
-       def script_toggleBrailleCounter(self, gesture):
-               if not self.brailleCounter:
-                       self.brailleCounter = True
-                       # Translators: Reported when toggle announcement is set 
to beeps in SPL Studio.
-                       ui.message(_("Braille counter on"))
-               else:
-                       self.brailleCounter = False
-                       # Translators: Reported when toggle announcement is set 
to words in SPL Studio.
-                       ui.message(_("Braille counter off"))
+       # Braille timer.
+       brailleTimerSettings=(
+               ("Braille timer off"),
+               ("Braille track endings"),
+               ("Braille intro endings"),
+               ("Braille intro and track endings")
+       )
+
+       def script_brailleTimer(self, gesture):
+               brailleTimerSetting= self.brailleTimer
+               brailleTimerSetting = brailleTimerSetting+1 if 
brailleTimerSetting < len(self.brailleTimerSettings)-1 else 0
+               ui.message(self.brailleTimerSettings[brailleTimerSetting])
+               self.brailleTimer = brailleTimerSetting
        # Translators: Input help mode message for a command in Station 
Playlist Studio.
-       script_toggleBrailleCounter.__doc__=_("Toggles option change 
announcements between words and beeps.")
+       script_brailleTimer.__doc__=_("Toggles option change announcements 
between words and beeps.")
 
        # The track finder utility for find track script.
        # Perform a linear search to locate the track name and/or description 
which matches the entered value.
@@ -907,6 +918,6 @@ class AppModule(appModuleHandler.AppModule):
                "kb:control+nvda+3":"toggleCartExplorer",
                "kb:alt+nvda+r":"setLibraryScanProgress",
                "kb:control+shift+r":"startScanFromInsertTracks",
-               "kb:control+shift+x":"toggleBrailleCounter",
+               "kb:control+shift+x":"brailleTimer",
                #"kb:control+nvda+`":"SPLAssistantToggle"
        }

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.

Other related posts:

  • » commit/StationPlaylist: josephsl: Braille Timer (4.0-dev/legacy): Added intro monitoring capability. - commits-noreply