commit/StationPlaylist: josephsl: Merged master

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Sun, 23 Aug 2015 03:10:02 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/f0e26d0b9998/
Changeset: f0e26d0b9998
Branch: 6.0/windowStyle
User: josephsl
Date: 2015-08-23 03:09:59+00:00
Summary: Merged master

Affected #: 2 files

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index 2225b79..dd61875 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -348,9 +348,6 @@ class AppModule(appModuleHandler.AppModule):
# Do not let NvDA get name for None object when SPL window is
maximized.
if not obj.name:
return
- # Suppress announcing status messages when background
monitoring is unavailable.
- if api.getForegroundObject().processID != self.processID and
not self.backgroundStatusMonitor:
- nextHandler()
# Only announce changes in status bar objects when told to do
so.
if obj.windowClassName == "TStatusBar" and
self._TStatusBarChanged(obj):
# Special handling for Play Status
@@ -368,11 +365,10 @@ class AppModule(appModuleHandler.AppModule):
if self.productVersion not in
noLibScanMonitor:
if not
self.backgroundStatusMonitor: self.libraryScanning = True
elif "match" in obj.name:
- if
splconfig.SPLConfig["LibraryScanAnnounce"] != "off":
+ if
splconfig.SPLConfig["LibraryScanAnnounce"] != "off" and self.libraryScanning:
if
splconfig.SPLConfig["BeepAnnounce"]: tones.beep(370, 100)
else:
- count =
sendMessage(_SPLWin, 1024, 0, 32)
- ui.message("Scan
complete with {scanCount} items".format(scanCount = count))
+ ui.message("Scan
complete with {scanCount} items".format(scanCount = obj.name.split()[3]))
if self.libraryScanning:
self.libraryScanning = False
self.scanCount = 0
else:
@@ -405,14 +401,14 @@ class AppModule(appModuleHandler.AppModule):

braille.handler.message(obj.name)
if (obj.name ==
"00:{0:02d}".format(splconfig.SPLConfig["EndOfTrackTime"])
and
splconfig.SPLConfig["SayEndOfTrack"]):
- tones.beep(440, 200)
- if obj.simplePrevious.name == "Remaining Song
Ramp":
+ self.alarmAnnounce(obj.name,
440, 200)
+ elif obj.simplePrevious.name == "Remaining Song
Ramp":
# Song intro for SPL 5.x.
if splconfig.SPLConfig["BrailleTimer"]
in ("intro", "both") and api.getForegroundObject().processID == self.processID:
#and "00:00" < obj.name <= self.SPLSongRampTime:

braille.handler.message(obj.name)
if (obj.name ==
"00:{0:02d}".format(splconfig.SPLConfig["SongRampTime"])
and splconfig.SPLConfig["SaySongRamp"]):
- tones.beep(512, 400)
+ self.alarmAnnounce(obj.name,
512, 400, intro=True)
nextHandler()

# JL's additions
@@ -445,6 +441,17 @@ class AppModule(appModuleHandler.AppModule):
if micAlarmT is not None: micAlarmT.cancel()
micAlarmT = None

+ # Alarm announcement: Alarm notification via beeps, speech or both.
+ def alarmAnnounce(self, timeText, tone, duration, intro=False):
+ if splconfig.SPLConfig["AlarmAnnounce"] in ("beep", "both"):
+ tones.beep(tone, duration)
+ if splconfig.SPLConfig["AlarmAnnounce"] in ("message", "both"):
+ alarmTime = int(timeText.split(":")[1])
+ if intro:
+ ui.message("Warning: {seconds} sec left in
track introduction".format(seconds = str(alarmTime)))
+ else:
+ ui.message("Warning: {seconds} sec
remaining".format(seconds = str(alarmTime)))
+

# Hacks for gain focus events.
def event_gainFocus(self, obj, nextHandler):
@@ -453,15 +460,6 @@ class AppModule(appModuleHandler.AppModule):
return
nextHandler()

- # Continue monitoring library scans among other focus loss management.
- def event_loseFocus(self, obj, nextHandler):
- fg = api.getForegroundObject()
- if fg.windowClassName == "TTrackInsertForm" and
self.libraryScanning and not self.backgroundStatusMonitor:
- global libScanT
- if not libScanT or (libScanT and not
libScanT.isAlive()):
- self.monitorLibraryScan()
- nextHandler()
-
# Add or remove SPL-specific touch commands.
# Code comes from Enhanced Touch Gestures add-on from the same author.
# This may change if NVDA core decides to abandon touch mode concept.
@@ -940,11 +938,13 @@ class AppModule(appModuleHandler.AppModule):
return
countB = sendMessage(_SPLWin, 1024, parem, 32)
if countA == countB:
+ print "values are equal"
self.libraryScanning = False
if self.SPLCurVersion >= "5.10":
countB = sendMessage(_SPLWin, 1024, 0, 32)
# Translators: Presented when library scanning is
finished.
ui.message(_("{itemCount} items in the
library").format(itemCount = countB))
+ print "scan done"
else:
libScanT =
threading.Thread(target=self.libraryScanReporter, args=(_SPLWin, countA,
countB, parem))
libScanT.daemon = True
@@ -953,10 +953,11 @@ class AppModule(appModuleHandler.AppModule):
def libraryScanReporter(self, _SPLWin, countA, countB, parem):
scanIter = 0
while countA != countB:
+ if not self.libraryScanning: return
countA = countB
time.sleep(1)
- # Do not continue if we're back on insert tracks form.
- if api.getForegroundObject().windowClassName ==
"TTrackInsertForm":
+ # Do not continue if we're back on insert tracks form
or library scan is finished.
+ if api.getForegroundObject().windowClassName ==
"TTrackInsertForm" or not self.libraryScanning:
return
countB, scanIter = sendMessage(_SPLWin, 1024, parem,
32), scanIter+1
if countB < 0:
@@ -966,7 +967,9 @@ class AppModule(appModuleHandler.AppModule):
self.libraryScanning = False
if self.backgroundStatusMonitor: return
if splconfig.SPLConfig["LibraryScanAnnounce"] != "off":
- if splconfig.SPLConfig["BeepAnnounce"]: tones.beep(370,
100)
+ if splconfig.SPLConfig["BeepAnnounce"]:
+ tones.beep(370, 100)
+ print "scan done"
else:
# Translators: Presented after library scan is
done.
ui.message(_("Scan complete with {itemCount}
items").format(itemCount = countB))
@@ -1000,6 +1003,13 @@ class AppModule(appModuleHandler.AppModule):
self.deletedFocusObj = False
focus.setFocus()

+ # When Escape is pressed, activate background library scan if
conditions are right.
+ def script_escape(self, gesture):
+ gesture.send()
+ if self.libraryScanning:
+ if not libScanT or (libScanT and not
libScanT.isAlive()):
+ self.monitorLibraryScan()
+

# SPL Assistant: reports status on playback, operation, etc.
# Used layer command approach to save gesture assignments.
@@ -1324,5 +1334,6 @@ class AppModule(appModuleHandler.AppModule):
"kb:control+NVDA+0":"openConfigDialog",
"kb:Shift+delete":"deleteTrack",
"kb:Shift+numpadDelete":"deleteTrack",
+ "kb:escape":"escape",
#"kb:control+nvda+`":"SPLAssistantToggle"
}

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 58108a2..53afd97 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -28,6 +28,7 @@ SaySongRamp = boolean(default=true)
SongRampTime = integer(min=1, max=9, default=5)
BrailleTimer = option("off", "intro", "outro", "both", default="off")
MicAlarm = integer(min=0, default="0")
+AlarmAnnounce = option("beep", "message", "both", default="beep")
LibraryScanAnnounce = option("off", "ending", "progress", "numbers",
default="off")
TrackDial = boolean(default=false)
UseScreenColumnOrder = boolean(default=true)
@@ -357,6 +358,26 @@ class SPLConfigDialog(gui.SettingsDialog):
settingsSizer.Add(sizer, border=10, flag=wx.BOTTOM)

sizer = wx.BoxSizer(wx.HORIZONTAL)
+ # Translators: The label for a setting in SPL add-on dialog to
control alarm announcement type.
+ label = wx.StaticText(self, wx.ID_ANY, label=_("&Alarm
notification:"))
+ # Translators: One of the alarm notification options.
+ self.alarmAnnounceValues=[("beep",_("beep")),
+ # Translators: One of the alarm notification options.
+ ("message",_("message")),
+ # Translators: One of the alarm notification options.
+ ("both",_("both beep and message"))]
+ self.alarmAnnounceList = wx.Choice(self, wx.ID_ANY,
choices=[x[1] for x in self.alarmAnnounceValues])
+ alarmAnnounceCurValue=SPLConfig["AlarmAnnounce"]
+ selection = (x for x,y in enumerate(self.alarmAnnounceValues)
if y[0]==alarmAnnounceCurValue).next()
+ try:
+ self.alarmAnnounceList.SetSelection(selection)
+ except:
+ pass
+ sizer.Add(label)
+ sizer.Add(self.alarmAnnounceList)
+ settingsSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
# Translators: The label for a setting in SPL add-on dialog to
control library scan announcement.
label = wx.StaticText(self, wx.ID_ANY, label=_("&Library scan
announcement:"))
self.libScanValues=[("off",_("off")),
@@ -443,6 +464,7 @@ class SPLConfigDialog(gui.SettingsDialog):
SPLConfig["SongRampTime"] = self.songRampAlarm.Value
SPLConfig["BrailleTimer"] =
self.brailleTimerValues[self.brailleTimerList.GetSelection()][0]
SPLConfig["MicAlarm"] = self.micAlarm.Value
+ SPLConfig["AlarmAnnounce"] =
self.alarmAnnounceValues[self.alarmAnnounceList.GetSelection()][0]
SPLConfig["LibraryScanAnnounce"] =
self.libScanValues[self.libScanList.GetSelection()][0]
SPLConfig["TrackDial"] = self.trackDialCheckbox.Value
SPLConfig["UseScreenColumnOrder"] =
self.columnOrderCheckbox.Value

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: