commit/StationPlaylist: josephsl: Merge branch 'master' into lts

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Tue, 29 Mar 2016 04:03:25 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/e2dfb15bc970/
Changeset:   e2dfb15bc970
Branch:      lts
User:        josephsl
Date:        2016-03-28 23:30:08+00:00
Summary:     Merge branch 'master' into lts

Affected #:  3 files

diff --git a/addon/appModules/splstudio/__init__.py 
b/addon/appModules/splstudio/__init__.py
index c11ff07..0115062 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -163,6 +163,8 @@ class SPLTrackItem(IAccessible):
                                                descriptionPieces.append("%s: 
%s"%(header, content))
                        self.description = ", ".join(descriptionPieces)
                super(IAccessible, self).reportFocus()
+               # 7.0: Let the app module keep a reference to this track.
+               self.appModule._focusedTrack = self
 
        # Track Dial: using arrow keys to move through columns.
        # This is similar to enhanced arrow keys in other screen readers.
@@ -269,6 +271,8 @@ class SPLTrackItem(IAccessible):
                print time.time()-t
 
        __gestures={
+               "kb:control+alt+rightArrow":"nextColumn",
+               "kb:control+alt+leftArrow":"prevColumn",
                #"kb:control+`":"toggleTrackDial",
                "kb:downArrow":"nextTrack",
                "kb:upArrow":"prevTrack",
@@ -408,6 +412,7 @@ class AppModule(appModuleHandler.AppModule):
        SPLCurVersion = appModuleHandler.AppModule.productVersion
        _columnHeaders = None
        _columnHeaderNames = None
+       _focusedTrack = None
 
        # Prepare the settings dialog among other things.
        def __init__(self, *args, **kwargs):
@@ -702,6 +707,8 @@ class AppModule(appModuleHandler.AppModule):
                        import globalPlugins.SPLStudioUtils.encoders
                        globalPlugins.SPLStudioUtils.encoders.cleanup()
                splconfig.saveConfig()
+               # Delete focused track reference.
+               self._focusedTrack = None
                try:
                        self.prefsMenu.RemoveItem(self.SPLSettings)
                except AttributeError, wx.PyDeadObjectError:
@@ -1336,11 +1343,17 @@ class AppModule(appModuleHandler.AppModule):
 
        def script_SPLAssistantToggle(self, gesture):
                # Enter the layer command if an only if we're in the track list 
to allow easier gesture assignment.
+               # 7.0: This requirement has been relaxed (commands themselves 
will check for specific conditions).
                # Also, do not bother if the app module is not running.
+               if scriptHandler.getLastScriptRepeatCount() > 0:
+                       gesture.send()
+                       self.finish()
+                       return
                try:
-                       fg = api.getForegroundObject()
-                       if fg.windowClassName != "TStudioForm":
-                               gesture.send()
+                       # 7.0: Don't bother if handle to Studio isn't found.
+                       if _SPLWin is None:
+                               # Translators: Presented when SPL Assistant 
cannot be invoked.
+                               ui.message(_("Failed to locate Studio main 
window, cannot enter SPL Assistant"))
                                return
                        if self.SPLAssistant:
                                self.script_error(gesture)
@@ -1450,7 +1463,10 @@ class AppModule(appModuleHandler.AppModule):
                statusAPI(1, 27, self.announceTime)
 
        def script_sayPlaylistRemainingDuration(self, gesture):
-               obj = api.getFocusObject()
+               obj = api.getFocusObject() if 
api.getForegroundObject().windowClassName == "TStudioForm" else 
self._focusedTrack
+               if obj is None:
+                       ui.message("Please return to playlist viewer before 
invoking this command.")
+                       return
                if obj.role == controlTypes.ROLE_LIST:
                        ui.message("00:00")
                        return
@@ -1620,6 +1636,11 @@ class AppModule(appModuleHandler.AppModule):
                        ui.message(_("This track cannot be used as a place 
marker track"))
 
        def script_findPlaceMarker(self, gesture):
+               # 7.0: Place marker command will still be restricted to 
playlist viewer in order to prevent focus bouncing.
+               if api.getForegroundObject().windowClassName != "TStudioForm":
+                       # Translators: Presented when attempting to move to a 
place marker track when not focused in playlist viewer.
+                       ui.message(_("You cannot move to a place marker track 
outside of playlist viewer."))
+                       return
                if self.placeMarker is None:
                        # Translators: Presented when no place marker is found.
                        ui.message(_("No place marker found"))

diff --git a/addon/globalPlugins/SPLStudioUtils/__init__.py 
b/addon/globalPlugins/SPLStudioUtils/__init__.py
index f1d1fa7..f4c3ad3 100755
--- a/addon/globalPlugins/SPLStudioUtils/__init__.py
+++ b/addon/globalPlugins/SPLStudioUtils/__init__.py
@@ -227,7 +227,23 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):
                remainingTime = winUser.sendMessage(SPLWin, SPLMSG, 3, 
SPLCurTrackPlaybackTime)
                # Translators: Presented when no track is playing in Station 
Playlist Studio.
                if remainingTime < 0: ui.message(_("There is no track 
playing."))
-               else: ui.message(str(remainingTime/1000))
+               else:
+                       # 7.0: Present remaining time in hh:mm:ss format for 
enhanced experience (borrowed from the app module).
+                       remainingTime = (remainingTime/1000)+1
+                       if remainingTime == 0: ui.message("00:00")
+                       elif 1 <= remainingTime <= 59: 
ui.message("00:{0}".format(str(remainingTime).zfill(2)))
+                       else:
+                               mm, ss = divmod(remainingTime, 60)
+                               if mm > 59:
+                                       hh, mm = divmod(mm, 60)
+                                       t0 = str(hh).zfill(2)
+                                       t1 = str(mm).zfill(2)
+                                       t2 = str(ss).zfill(2)
+                                       ui.message(":".join([t0, t1, t2]))
+                               else:
+                                       t1 = str(mm).zfill(2)
+                                       t2 = str(ss).zfill(2)
+                                       ui.message(":".join([t1, t2]))
                self.finish()
 
        def script_announceNumMonitoringEncoders(self, gesture):

diff --git a/readme.md b/readme.md
index d291dbb..7d527ca 100755
--- a/readme.md
+++ b/readme.md
@@ -23,6 +23,7 @@ IMPORTANT: This add-on requires NVDA 2015.3 or later and 
StationPlaylist Studio
 * Control+NVDA+f from Studio window: Opens a dialog to find a track based on 
artist or song name. Press NvDA+F3 to find forward or NVDA+Shift+F3 to find 
backward.
 * Alt+NVDA+R from Studio window: Steps through library scan announcement 
settings.
 * Control+Shift+X from Studio window: Steps through braille timer settings.
+* Control+Alt+right/left arrow (while focused on a track): Announce 
next/previous track column.
 * Control+NVDA+0 from Studio window: Opens the Studio add-on configuration 
dialog.
 * Control+NVDA+- (hyphen) from Studio window: Send feedback to add-on 
developer using the default email client.
 
@@ -70,22 +71,23 @@ In addition, column review commands are available, 
including:
 
 ## SPL Assistant layer
 
-This layer command set allows you to obtain various status on SPL Studio, such 
as whether a track is playing, total duration of all tracks for the hour and so 
on. From SPL Studio window, press the SPL Assistant layer command, then press 
one of the keys from the list below. You can also configure NvDA to emulate 
commands from other screen readers.
+This layer command set allows you to obtain various status on SPL Studio, such 
as whether a track is playing, total duration of all tracks for the hour and so 
on. From any SPL Studio window, press the SPL Assistant layer command, then 
press one of the keys from the list below (one or more commands are exclusive 
to playlist viewer). You can also configure NvDA to emulate commands from other 
screen readers.
 
 The available commands are:
 
 * A: Automation.
 * C (Shift+C  in JAWS and Window-Eyes layouts): Title for the currently 
playing track.
-* C (JAWS and Window-Eyes layouts): Toggle cart explorer.
-* D (R in JAWS layout): Remaining duration for the playlist.
+* C (JAWS and Window-Eyes layouts): Toggle cart explorer (playlist viewer 
only).
+* D (R in JAWS layout): Remaining duration for the playlist (if an error 
message is given, move to playlist viewer and then issue this command).
 * E (G in Window-Eyes layout): Metadata streaming status.
 * Shift+1 through Shift+4, Shift+0: Status for individual metadata streaming 
URL's (0 is for DSP encoder).
 * E (Window-Eyes layout): Elapsed time for the currently playing track.
+* F: Find track (playlist viewer only).
 * H: Duration of music for the current hour slot.
 * Shift+H: Remaining track duration for the hour slot.
 * I (L in JAWS or Window-Eyes layouts): Listener count.
-* K: Move to the marked track.
-* Control+K: Set the current track as the place marker track.
+* K: Move to the marked track (playlist viewer only).
+* Control+K: Set the current track as the place marker track (playlist viewer 
only).
 * L (Shift+L in JAWS and Window-Eyes layouts): Line in.
 * M: Microphone.
 * N: Title for the next scheduled track.
@@ -101,8 +103,8 @@ The available commands are:
 * W: Weather and temperature if configured.
 * Y: Playlist modified status.
 * 1 through 0 (6 for Studio 5.0x): Announce column content for a specified 
column.
-* F9: Mark current track for track time analysis.
-* F10: Perform track time analysis.
+* F9: Mark current track for track time analysis (playlist viewer only).
+* F10: Perform track time analysis (playlist viewer only).
 * F12: Switch between current and a predefined profile.
 * F1: Layer help.
 * Shift+F1: Opens online user guide.
@@ -119,7 +121,7 @@ The available SPL Controller commands are:
 * Press M or Shift+M to turn on or off the microphone, respectively, or press 
N to enable microphone without fade.
 * Press A to enable automation or Shift+A to disable it.
 * Press L to enable line-in input or Shift+L to disable it.
-* Press R to hear remaining time for the currently playing track in seconds.
+* Press R to hear remaining time for the currently playing track.
 * Press Shift+R to get a report on library scan progress.
 * Press E to get count and labels for encoders being monitored.
 * Press F1 to show a help dialog which lists available commands.
@@ -146,7 +148,7 @@ To learn cart assignments, from SPL Studio, press 
Control+NVDA+3. Pressing the c
 
 ## Track Dial
 
-You can use arrow keys to review various information about a track. To turn 
Track Dial on, while a track is focused in the main playlist viewer, press the 
command you assigned for toggling Track Dial. Then use left and right arrow 
keys to review information such as artist, duration and so on.
+You can use arrow keys to review various information about a track. To turn 
Track Dial on, while a track is focused in the main playlist viewer, press the 
command you assigned for toggling Track Dial. Then use left and right arrow 
keys to review information such as artist, duration and so on. Alternatively, 
press Control+Alt+left or right arrows to navigate between columns without 
invoking Track Dial.
 
 ## Track time analysis
 
@@ -166,15 +168,17 @@ If you are using Studio on a touchscreen computer running 
Windows 8 or later and
 
 ## Changes for 7.0
 
-* Fixed numerous errors reported by users when installing add-on 7.0 for the 
first time when no prior version of this add-on was installed.
 * Added add-on update check feature. This can be done manually (SPL Assistant, 
Control+Shift+U) or automatically (configurable via advanced options dialog 
from add-on settings).
+* It is no longer required to stay in the playlist viewer window in order to 
invoke most SPL Assistant layer commands or obtain time announcements such as 
remaining time for the track and broadcaster time.
 * Changes to SPL Assistant commands, including playlist duration (D), 
reassignment of hour selection duration from Shift+H to Shift+S and Shift+H now 
used to announce duration of remaining tracks for the current hour slot, 
metadata streaming status command reassigned (1 through 4, 0 is now Shift+1 
through Shift+4, Shift+0).
 * It is now possible to invoke track finder via SPL Assistant (F).
 * SPL Assistant, numbers 1 through 0 (6 for Studio 5.01 and earlier) can be 
used to announce specific column information. These column slots can be changed 
under Columns Explorer item in add-on settings dialog.
+* Fixed numerous errors reported by users when installing add-on 7.0 for the 
first time when no prior version of this add-on was installed.
 * Improvements to Track Dial, including improved responsiveness when moving 
through columns and tracking how columns are presented on screen.
+* Added ability to press Control+Alt+left or right arrow keys to move between 
track columns.
 * It is now possible to use a different screen reader command layout for SPL 
Assistant commands. Go to advanced options dialog from add-on settings to 
configure this option between NVDA, JAWS and Window-Eyes layouts. See the SPL 
Assistant commands above for details.
 * NVDA can be configured to switch to a specific broadcast profile at a 
specific day and time. Use the new triggers dialog in add-on settings to 
configure this.
-* NVDA reports name of the profile one is switching to via instant switch (SPL 
Assistant, F12) or as a result of time-based profile becoming active.
+* NVDA will report name of the profile one is switching to via instant switch 
(SPL Assistant, F12) or as a result of time-based profile becoming active.
 * Moved instant switch toggle (now a checkbox) to the new triggers dialog.
 * Entries in profiles combo box in add-on settings dialog now shows profile 
flags such as active, whether it is an instant switch profile and so on.
 * If a serious problem with reading broadcast profile files are found, NVDA 
will present an error dialog and reset settings to defaults instead of doing 
nothing or sounding an error tone.
@@ -182,8 +186,8 @@ If you are using Studio on a touchscreen computer running 
Windows 8 or later and
 * In add-on settings dialog, the controls used to toggle announcement of 
scheduled time, listener count, cart name and track name has been moved to a 
dedicated status announcements dialog (select status announcement button to 
open this dialog).
 * Added a new setting in add-on settings dialog to let NVDA play beep for 
different track categories when moving between tracks in playlist viewer.
 * Attempting to open metadata configuration option in add-on settings dialog 
while quick metadata streaming dialog is open will no longer cause NVDA to do 
nothing or play an error tone. NvDA will now ask you to close metadata 
streaming dialog before you can open add-on settings.
-* It is no longer required to stay in the playlist viewer window in order to 
obtain time announcements such as remaining time for the track and broadcaster 
time.
-* When announcing time such as remaining time for the playing track, hours are 
also announced.
+* When announcing time such as remaining time for the playing track, hours are 
also announced. Consequently, the hour announcement setting is enabled by 
default.
+* Pressing SPL Controller, R now causes NVDA to announce remaining time in 
hours, minutes and seconds (minutes and seconds if this is such a case).
 * In encoders, pressing Control+NVDA+0 will present encoder settings dialog 
for configuring various options such as stream label, focusing to Studio when 
connected and so on.
 * In encoders, it is now possible to turn off connection progress tone 
(configurable from encoder settings dialog).

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: