commit/StationPlaylist: josephsl: Merged master

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

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/7f57900a106f/
Changeset: 7f57900a106f
Branch: 6.0/libraryScanR2
User: josephsl
Date: 2015-08-23 03:08:29+00:00
Summary: Merged master

Affected #: 2 files

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index 3faaaf0..0d506b1 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -402,14 +402,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
@@ -442,6 +442,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):

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: