commit/StationPlaylist: josephsl: 6.3/6.4: Audio ducking reminder dialog added for those using NVDA 2016.1 or later on Windows 8 and later.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Fri, 15 Jan 2016 05:45:21 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/59d798dcd320/
Changeset:   59d798dcd320
Branch:      6.x
User:        josephsl
Date:        2016-01-15 05:44:52+00:00
Summary:     6.3/6.4: Audio ducking reminder dialog added for those using NVDA 
2016.1 or later on Windows 8 and later.

In NVDA 2016.1 or later, it is possible to let NVDA duck background audio. 
Unfortunately, this affects Studio, thus added a reminder dialog to remind 
people to disable this functionality. This will be available in February 2016.

Affected #:  2 files

diff --git a/addon/appModules/splstudio/__init__.py 
b/addon/appModules/splstudio/__init__.py
index 1979e4b..945086b 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -1,6 +1,6 @@
 # StationPlaylist Studio
 # An app module and global plugin package for NVDA
-# Copyright 2011, 2013-2015, Geoff Shang, Joseph Lee and others, released 
under GPL.
+# Copyright 2011, 2013-2016, Geoff Shang, Joseph Lee and others, released 
under GPL.
 # The primary function of this appModule is to provide meaningful feedback to 
users of SplStudio
 # by allowing speaking of items which cannot be easily found.
 # Version 0.01 - 7 April 2011:
@@ -326,6 +326,8 @@ class AppModule(appModuleHandler.AppModule):
                # 6.1: Do not allow this thread to run forever (seen when 
evaluation times out and the app module starts).
                self.noMoreHandle = threading.Event()
                threading.Thread(target=self._locateSPLHwnd).start()
+                               # Display startup dialogs if any.
+               wx.CallAfter(splconfig.showStartupDialogs)
 
        # Locate the handle for main window for caching purposes.
        def _locateSPLHwnd(self):

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index 6609d04..a5d1dd6 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -46,6 +46,7 @@ SayPlayingTrackName = string(default="True")
 SPLConPassthrough = boolean(default=false)
 CompatibilityLayer = option("off", "jfw", default="off")
 PlaylistRemainder = option("hour", "playlist", default="hour")
+AudioDuckingReminder = boolean(default=true)
 """), encoding="UTF-8", list_values=False)
 confspec.newlines = "\r\n"
 SPLConfig = None
@@ -1354,6 +1355,55 @@ class SPLAlarmDialog(wx.Dialog):
                global _alarmDialogOpened
                _alarmDialogOpened = False
 
+
+# Startup dialogs.
+
+# Audio ducking reminder (NVDA 2016.1 and later).
+class AudioDuckingReminder(wx.Dialog):
+       """A dialog to remind users to turn off audio ducking (NVDA 2016.1 and 
later).
+       """
+
+       def __init__(self, parent):
+               super(AudioDuckingReminder, self).__init__(parent, title=_("SPL 
Studio and audio ducking"))
+
+               mainSizer = wx.BoxSizer(wx.VERTICAL)
+
+               # Translators: A message displayed if audio ducking should be 
disabled.
+               label = wx.StaticText(self, wx.ID_ANY, label=_("NVDA 2016.1 and 
later allows NVDA to decrease volume of background audio including that of 
Studio. In order to not disrupt the listening experience of your listeners, 
please disable audio ducking by opening synthesizer dialog in NVDA and 
selecting 'no ducking' from audio ducking mode combo box or press 
NVDA+Shift+D."))
+               mainSizer.Add(label,border=20,flag=wx.LEFT|wx.RIGHT|wx.TOP)
+
+               sizer = wx.BoxSizer(wx.HORIZONTAL)
+               # Translators: A checkbox to turn off audio ducking reminder 
message.
+               
self.audioDuckingReminder=wx.CheckBox(self,wx.NewId(),label=_("Do not show this 
message again"))
+               self.audioDuckingReminder.SetValue(not 
SPLConfig["AudioDuckingReminder"])
+               sizer.Add(self.audioDuckingReminder, border=10,flag=wx.TOP)
+               mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+               mainSizer.Add(self.CreateButtonSizer(wx.OK))
+               self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
+               mainSizer.Fit(self)
+               self.Sizer = mainSizer
+               self.audioDuckingReminder.SetFocus()
+               self.Center(wx.BOTH | wx.CENTER_ON_SCREEN)
+
+       def onOk(self, evt):
+               if self.audioDuckingReminder.Value:
+                       SPLConfig["AudioDuckingReminder"] = not 
self.audioDuckingReminder.Value
+                       _propagateChanges(key="AudioDuckingReminder")
+               self.Destroy()
+
+# And to open the above dialog and any other dialogs.
+def showStartupDialogs():
+       try:
+               import audioDucking
+               if SPLConfig["AudioDuckingReminder"] and 
audioDucking.isAudioDuckingSupported():
+                       gui.mainFrame.prePopup()
+                       AudioDuckingReminder(gui.mainFrame).Show()
+                       gui.mainFrame.postPopup()
+       except ImportError:
+               pass
+
+
 # Message verbosity pool.
 # To be moved to its own module in add-on 7.0.
 # This is a multimap, consisting of category, value and message.

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: 6.3/6.4: Audio ducking reminder dialog added for those using NVDA 2016.1 or later on Windows 8 and later. - commits-noreply