commit/StationPlaylist: 2 new changesets

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 19 Aug 2015 16:59:01 -0000

2 new commits in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/c3531e3a9746/
Changeset: c3531e3a9746
Branch: None
User: josephsl
Date: 2015-08-18 02:29:01+00:00
Summary: Alarm UI message (6.6-dev): Initial foundation to allow alarm
notification to be spoken and/or brailled and the GUI for it.

Currently NVDA only plays beep when end of track or song intro alarm kicks in.
In 6.0, this will be extended to let NVDA announce messages. To handle this, a
new setting called AlarmAnnounce will be introduced, along with a combo box to
choose alarm notification (beep only, message only or both).

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 4f3219a..ec2893d 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)
@@ -351,6 +352,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")),
@@ -437,6 +458,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


https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/ae083bfd41dd/
Changeset: ae083bfd41dd
Branch: 6.0/alarmUIMessage
User: josephsl
Date: 2015-08-19 16:58:37+00:00
Summary: Alarm message (6.0-dev): Provide a new function in Studio app
module to announce alarms either as a beep or as a message.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index 0996a2d..9ec4600 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -406,14 +406,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
@@ -446,6 +446,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):

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: