commit/StationPlaylist: josephsl: Final major feature in 7.0: COlumns Explorer.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Fri, 22 Jan 2016 03:41:56 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/16ff4130da58/
Changeset:   16ff4130da58
Branch:      master
User:        josephsl
Date:        2016-01-22 03:41:26+00:00
Summary:     Final major feature in 7.0: COlumns Explorer.

Affected #:  3 files

diff --git a/addon/appModules/splstudio/__init__.py 
b/addon/appModules/splstudio/__init__.py
index 895ac59..eedf4af 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -277,7 +277,7 @@ A: Automation.
 C: Announce name of the currently playing track.
 D: Remaining time for the playlist.
 E: Overall metadata streaming status.
-1 through 4, 0: Metadata streaming status for DSP encoder and four additional 
URL's.
+Shift+1 through shift+4, shift+0: Metadata streaming status for DSP encoder 
and four additional URL's.
 H: Duration of trakcs in this hour slot.
 Shift+H: Duration of remaining trakcs in this hour slot.
 I: Listener count.
@@ -296,6 +296,7 @@ T: Cart edit mode.
 U: Studio up time.
 W: Weather and temperature.
 Y: Playlist modification.
+1 through 0 (6 for Studio 5.01 and earlier): Announce columns via Columns 
Explorer (0 is tenth column slot).
 F9: Mark current track as start of track time analysis.
 F10: Perform track time analysis.
 F12: Switch to an instant switch profile.
@@ -306,7 +307,7 @@ A: Automation.
 C: Toggle cart explorer.
 Shift+C: Announce name of the currently playing track.
 E: Overall metadata streaming status.
-1 through 4, 0: Metadata streaming status for DSP encoder and four additional 
URL's.
+Shift+1 through shift+4, shift+0: Metadata streaming status for DSP encoder 
and four additional URL's.
 Shift+E: Record to file.
 F: Track finder.
 H: Duration of trakcs in this hour slot.
@@ -327,6 +328,7 @@ T: Cart edit mode.
 U: Studio up time.
 W: Weather and temperature.
 Y: Playlist modification.
+1 through 0 (6 for Studio 5.01 and earlier): Announce columns via Columns 
Explorer (0 is tenth column slot).
 F9: Mark current track as start of track time analysis.
 F10: Perform track time analysis.
 F12: Switch to an instant switch profile.
@@ -341,7 +343,7 @@ E: Elapsed time.
 F: Track finder.
 R: Remaining time for the currently playing track.
 G: Overall metadata streaming status.
-1 through 4, 0: Metadata streaming status for DSP encoder and four additional 
URL's.
+Shift+1 through shift+4, shift+0: Metadata streaming status for DSP encoder 
and four additional URL's.
 H: Duration of trakcs in this hour slot.
 Shift+H: Duration of remaining trakcs in this hour slot.
 K: Move to place marker track.
@@ -360,6 +362,7 @@ T: Cart edit mode.
 U: Studio up time.
 W: Weather and temperature.
 Y: Playlist modification.
+1 through 0 (6 for Studio 5.01 and earlier): Announce columns via Columns 
Explorer (0 is tenth column slot).
 F9: Mark current track as start of track time analysis.
 F10: Perform track time analysis.
 F12: Switch to an instant switch profile.
@@ -406,6 +409,8 @@ class AppModule(appModuleHandler.AppModule):
                        queueHandler.queueFunction(queueHandler.eventQueue, 
splconfig.updateInit)
                # Display startup dialogs if any.
                wx.CallAfter(splconfig.showStartupDialogs)
+               # Cache start and end range for column exploration.
+               splconfig.SPLConfig["ColumnExpRange"] = (1, 7) if 
self.SPLCurVersion < "5.1" else (0, 10)
 
        # Locate the handle for main window for caching purposes.
        def _locateSPLHwnd(self):
@@ -1347,6 +1352,12 @@ class AppModule(appModuleHandler.AppModule):
                        if 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "off": 
self.bindGestures(self.__SPLAssistantGestures)
                        elif 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "jfw": 
self.bindGestures(self.__SPLAssistantJFWGestures)
                        elif 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "wineyes": 
self.bindGestures(self.__SPLAssistantWEGestures)
+                       # 7.0: Certain commands involving number row.
+                       # 7.x only: Take care of both Studio 5.0x and 5.1x.
+                       # 8.0: Remove tuple unpack routine below, as all ten 
keys are available.
+                       start, end = splconfig.SPLConfig["ColumnExpRange"]
+                       for i in xrange(start, end):
+                               self.bindGesture("kb:%s"%(i), "columnExplorer")
                        self.SPLAssistant = True
                        tones.beep(512, 50)
                        if 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "jfw": 
ui.message("JAWS")
@@ -1640,6 +1651,16 @@ class AppModule(appModuleHandler.AppModule):
                                status = _("Metadata streaming on DSP encoder 
disabled")
                ui.message(status)
 
+       def script_columnExplorer(self, gesture):
+               if gesture.displayName.isdigit():
+                       columnPos = int(gesture.displayName)-1
+                       focus = api.getFocusObject()
+                       if not isinstance(focus, SPLTrackItem):
+                               # Translators: Presented when attempting to 
announce specific columns but the focused item isn't a track.
+                               ui.message(_("Not a track"))
+                       else:
+                               
focus.announceColumnContent(focus._indexOf(splconfig.SPLConfig["General"]["ExploreColumns"][columnPos]))
+
        def script_layerHelp(self, gesture):
                compatibility = 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"]
                # Translators: The title for SPL Assistant help dialog.
@@ -1685,11 +1706,11 @@ class AppModule(appModuleHandler.AppModule):
                "kb:Control+k":"setPlaceMarker",
                "kb:k":"findPlaceMarker",
                "kb:e":"metadataStreamingAnnouncer",
-               "kb:1":"metadataEnabled",
-               "kb:2":"metadataEnabled",
-               "kb:3":"metadataEnabled",
-               "kb:4":"metadataEnabled",
-               "kb:0":"metadataEnabled",
+               "kb:shift+1":"metadataEnabled",
+               "kb:shift+2":"metadataEnabled",
+               "kb:shift+3":"metadataEnabled",
+               "kb:shift+4":"metadataEnabled",
+               "kb:shift+0":"metadataEnabled",
                "kb:f1":"layerHelp",
                "kb:shift+f1":"openOnlineDoc",
                "kb:control+shift+u":"updateCheck",
@@ -1723,11 +1744,11 @@ class AppModule(appModuleHandler.AppModule):
                "kb:Control+k":"setPlaceMarker",
                "kb:k":"findPlaceMarker",
                "kb:e":"metadataStreamingAnnouncer",
-               "kb:1":"metadataEnabled",
-               "kb:2":"metadataEnabled",
-               "kb:3":"metadataEnabled",
-               "kb:4":"metadataEnabled",
-               "kb:0":"metadataEnabled",
+               "kb:shift+1":"metadataEnabled",
+               "kb:shift+2":"metadataEnabled",
+               "kb:shift+3":"metadataEnabled",
+               "kb:shift+4":"metadataEnabled",
+               "kb:shift+0":"metadataEnabled",
                "kb:f1":"layerHelp",
                "kb:shift+f1":"openOnlineDoc",
        }
@@ -1762,11 +1783,11 @@ class AppModule(appModuleHandler.AppModule):
                "kb:Control+k":"setPlaceMarker",
                "kb:k":"findPlaceMarker",
                "kb:g":"metadataStreamingAnnouncer",
-               "kb:1":"metadataEnabled",
-               "kb:2":"metadataEnabled",
-               "kb:3":"metadataEnabled",
-               "kb:4":"metadataEnabled",
-               "kb:0":"metadataEnabled",
+               "kb:shift+1":"metadataEnabled",
+               "kb:shift+2":"metadataEnabled",
+               "kb:shift+3":"metadataEnabled",
+               "kb:shift+4":"metadataEnabled",
+               "kb:shift+0":"metadataEnabled",
                "kb:f1":"layerHelp",
                "kb:shift+f1":"openOnlineDoc",
                "kb:control+shift+u":"updateCheck",

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index b19bf08..1905741 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -69,6 +69,7 @@ TrackDial = boolean(default=false)
 CategorySounds = boolean(default=false)
 MetadataReminder = option("off", "startup", "instant", default="off")
 TimeHourAnnounce = boolean(default=false)
+ExploreColumns = 
string_list(default=list("Artist","Title","Duration","Intro","Category","Filename","Year","Album","Genre","Time
 Scheduled"))
 [IntroOutroAlarms]
 SayEndOfTrack = boolean(default=true)
 EndOfTrackTime = integer(min=1, max=59, default=5)
@@ -592,6 +593,7 @@ def saveConfig():
        # Global flags, be gone.
        if "Reset" in SPLConfigPool[0]:
                del SPLConfigPool[0]["Reset"]
+       del SPLConfig["ColumnExpRange"]
        # Convert keys back to 5.x format.
        for section in SPLConfigPool[0].keys():
                if isinstance(SPLConfigPool[0][section], dict):
@@ -1032,6 +1034,11 @@ class SPLConfigDialog(gui.SettingsDialog):
                item = manageColumnsButton = wx.Button(self, label=_("&Manage 
track column announcements..."))
                item.Bind(wx.EVT_BUTTON, self.onManageColumns)
                settingsSizer.Add(item)
+               # Translators: The label of a button to configure columns 
explorer slots (SPL Assistant, number row keys to announce specific columns).
+               item = columnsExplorerButton = wx.Button(self, label=_("Columns 
E&xplorer..."))
+               item.Bind(wx.EVT_BUTTON, self.onColumnsExplorer)
+               self.exploreColumns = SPLConfig["General"]["ExploreColumns"]
+               settingsSizer.Add(item)
 
                # Translators: the label for a setting in SPL add-on settings 
to announce scheduled time.
                
self.scheduledForCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Announce 
&scheduled time for the selected track"))
@@ -1123,6 +1130,7 @@ class SPLConfigDialog(gui.SettingsDialog):
                SPLConfig["ColumnAnnouncement"]["UseScreenColumnOrder"] = 
self.columnOrderCheckbox.Value
                SPLConfig["ColumnAnnouncement"]["ColumnOrder"] = 
self.columnOrder
                SPLConfig["ColumnAnnouncement"]["IncludedColumns"] = 
self.includedColumns
+               SPLConfig["General"]["ExploreColumns"] = self.exploreColumns
                SPLConfig["SayStatus"]["SayScheduledFor"] = 
self.scheduledForCheckbox.Value
                SPLConfig["SayStatus"]["SayListenerCount"] = 
self.listenerCountCheckbox.Value
                SPLConfig["SayStatus"]["SayPlayingCartName"] = 
self.cartNameCheckbox.Value
@@ -1387,6 +1395,11 @@ class SPLConfigDialog(gui.SettingsDialog):
                self.Disable()
                ColumnAnnouncementsDialog(self).Show()
 
+       # Columns Explorer configuration.
+       def onColumnsExplorer(self, evt):
+               self.Disable()
+               ColumnsExplorerDialog(self).Show()
+
        # Status announcement dialog.
        def onStatusAnnouncement(self, evt):
                self.Disable()
@@ -1408,11 +1421,14 @@ class SPLConfigDialog(gui.SettingsDialog):
                _("Warning"),wx.YES_NO|wx.NO_DEFAULT|wx.ICON_WARNING,self
                )==wx.YES:
                        # Reset all profiles.
-                       resetAllConfig()
+                       # Save some flags from death.
                        global SPLConfig, SPLConfigPool, SPLActiveProfile, 
_configDialogOpened, SPLSwitchProfile, SPLPrevProfile
+                       colRange = SPLConfig["ColumnExpRange"]
+                       resetAllConfig()
                        SPLConfig = dict(_SPLDefaults7)
                        SPLConfig["ActiveIndex"] = 0
                        SPLActiveProfile = SPLConfigPool[0].name
+                       SPLConfig["ColumnExpRange"] = colRange
                        # Workaround: store the reset flag in the normal 
profile to prevent config databases from becoming references to old generation.
                        SPLConfigPool[0]["Reset"] = True
                if SPLSwitchProfile is not None:
@@ -1846,6 +1862,73 @@ class ColumnAnnouncementsDialog(wx.Dialog):
                        if self.FindFocus().GetId() == wx.ID_OK:
                                self.upButton.SetFocus()
 
+# Columns Explorer.
+# Configure which column will be announced when SPL Assistnat, number keys are 
pressed.
+class ColumnsExplorerDialog(wx.Dialog):
+
+       def __init__(self, parent):
+               # Translators: The title of Columns Explorer configuration 
dialog.
+               super(ColumnsExplorerDialog, self).__init__(parent, 
title=_("Columns Explorer"))
+
+               # Gather column slots.
+               # 7.0: First six slots are reserved for Studio 5.0x columns.
+               self.columnSlots = []
+
+               mainSizer = wx.BoxSizer(wx.VERTICAL)
+
+               # 7.0: Studio 5.0x columns.
+               # 8.0: Remove the below code.
+               oldStudioColumns = ["Artist", "Title", "Duration", "Intro", 
"Category", "Filename"]
+               sizer = wx.BoxSizer(wx.HORIZONTAL)
+               for slot in xrange(6):
+                       # Translators: The label for a setting in SPL add-on 
dialog to select column for this column slot.
+                       label = wx.StaticText(self, wx.ID_ANY, label=_("Slot 
{position}").format(position = slot+1))
+                       columns = wx.Choice(self, wx.ID_ANY, 
choices=oldStudioColumns)
+                       try:
+                               
columns.SetSelection(oldStudioColumns.index(parent.exploreColumns[slot]))
+                       except:
+                               pass
+                       sizer.Add(label)
+                       sizer.Add(columns)
+                       self.columnSlots.append(columns)
+               mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+               # For Studio 5.10 and later.
+               if SPLConfig["ColumnExpRange"] == (0, 10):
+                       sizer = wx.BoxSizer(wx.HORIZONTAL)
+                       for slot in xrange(6, 10):
+                               label = wx.StaticText(self, wx.ID_ANY, 
label=_("Slot {position}").format(position = slot+1))
+                               columns = wx.Choice(self, wx.ID_ANY, 
choices=_SPLDefaults7["ColumnAnnouncement"]["ColumnOrder"])
+                               try:
+                                       
columns.SetSelection(_SPLDefaults7["ColumnAnnouncement"]["ColumnOrder"].index(parent.exploreColumns[slot]))
+                               except:
+                                       pass
+                               sizer.Add(label)
+                               sizer.Add(columns)
+                               self.columnSlots.append(columns)
+                       mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+               mainSizer.Add(self.CreateButtonSizer(wx.OK | wx.CANCEL))
+               self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
+               self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)
+               mainSizer.Fit(self)
+               self.Sizer = mainSizer
+               self.columnSlots[0].SetFocus()
+               self.Center(wx.BOTH | wx.CENTER_ON_SCREEN)
+
+       def onOk(self, evt):
+               parent = self.Parent
+               for slot in xrange(len(self.columnSlots)):
+                       parent.exploreColumns[slot] = 
self.columnSlots[slot].GetStringSelection()
+               parent.profiles.SetFocus()
+               parent.Enable()
+               self.Destroy()
+               return
+
+       def onCancel(self, evt):
+               self.Parent.Enable()
+               self.Destroy()
+
 # Say status dialog.
 # Houses options such as announcing cart names.
 class SayStatusDialog(wx.Dialog):

diff --git a/readme.md b/readme.md
index 203bd7d..c56e49c 100755
--- a/readme.md
+++ b/readme.md
@@ -150,6 +150,10 @@ You can use arrow keys to review various information about 
a track. To turn Trac
 
 To obtain length to play selected tracks, mark current track for start of 
track time analysis (SPL Assistant, F9), then press SPL Assistant, F10 when 
reaching end of selection.
 
+## Columns Explorer
+
+By pressing SPL Assistant, 1 through 0 (6 for Studio 5.01 and earlier), you 
can obtain contents of specific columns. By default, these are artist, title, 
duration, intro, category and filename (Studio 5.10 adds year, album, genre and 
time scheduled). You can configure which columns will be explored via columns 
explorer dialog found in add-on settings dialog.
+
 ## Configuration dialog
 
 From studio window, you can press Control+NVDA+0 to open the add-on 
configuration dialog. Alternatively, go to NVDA's preferences menu and select 
SPL Studio Settings item. This dialog is also used to manage broadcast profiles.

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: Final major feature in 7.0: COlumns Explorer. - commits-noreply