commit/StationPlaylist: 2 new changesets

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Fri, 14 Aug 2015 00:37:04 -0000

2 new commits in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/bee6df01d09f/
Changeset: bee6df01d09f
Branch: None
User: josephsl
Date: 2015-08-14 00:26:30+00:00
Summary: Merged 5.3, encoder columns and Track Tool optimizations

Affected #: 4 files

diff --git a/addon/appModules/splstudio/splmisc.py
b/addon/appModules/splstudio/splmisc.py
index 2780407..23329ba 100755
--- a/addon/appModules/splstudio/splmisc.py
+++ b/addon/appModules/splstudio/splmisc.py
@@ -19,7 +19,7 @@ import winKernel
# Locate column content.
# Given an object and the column number, locate text in the given column.
# This is the module level version of column content getter found in the app
module.
-# This is used by the track item class as well as in track finder.
+# This is used by the track item class, Track Tool items and in track finder.
# In track finder, this is used when encountering the track item but NVDA says
otherwise.
def _getColumnContent(obj, col):
# Borrowed from SysListView32 implementation.

diff --git a/addon/appModules/tracktool.py b/addon/appModules/tracktool.py
index 0de2eb7..c1cd08e 100755
--- a/addon/appModules/tracktool.py
+++ b/addon/appModules/tracktool.py
@@ -16,12 +16,11 @@ import winKernel
from winUser import sendMessage
from NVDAObjects.IAccessible import IAccessible, sysListView32
from splstudio import splconfig
+from splstudio.splmisc import _getColumnContent
addonHandler.initTranslation()

# Track Tool allows a broadcaster to manage track intros, cues and so forth.
Each track is a list item with descriptions such as title, file name, intro
time and so forth.
# One can press TAB to move along the controls for Track Tool.
-# The below code is an unoptimized version for add-on 5.0.
-# Add-on 5.1 will enable Track Dial, and 6.0 will feature optimized code,
deriving from SPL Studio code.

class TrackToolItem(IAccessible):
"""An entry in Track Tool, used to implement some exciting features.
@@ -38,7 +37,7 @@ class TrackToolItem(IAccessible):
self.bindGesture("kb:rightArrow", "nextColumn")
self.bindGesture("kb:leftArrow", "prevColumn")

- # Add-on 5.1: Track Dial for Track Tool.
+ # Track Dial for Track Tool.

def script_toggleTrackDial(self, gesture):
if splconfig.SPLConfig is None:
@@ -73,38 +72,20 @@ class TrackToolItem(IAccessible):
script_toggleTrackDial.__doc__=_("Toggles track dial on and off.")
script_toggleTrackDial.category = "StationPlaylist Studio"

- # Locate column content.
- def _getColumnContent(self, col):
- # See main splstudio app module.
- buffer=None
- processHandle=self.processHandle
- sizeofLVITEM = ctypes.sizeof(sysListView32.LVITEM)
-
internalItem=winKernel.virtualAllocEx(processHandle,None,sizeofLVITEM,winKernel.MEM_COMMIT,winKernel.PAGE_READWRITE)
- try:
-
internalText=winKernel.virtualAllocEx(processHandle,None,520,winKernel.MEM_COMMIT,winKernel.PAGE_READWRITE)
- try:
-
item=sysListView32.LVITEM(iItem=self.IAccessibleChildID-1,mask=sysListView32.LVIF_TEXT|sysListView32.LVIF_COLUMNS,iSubItem=col,pszText=internalText,cchTextMax=260)
-
winKernel.writeProcessMemory(processHandle,internalItem,ctypes.byref(item),sizeofLVITEM,None)
- len =
sendMessage(self.windowHandle,sysListView32.LVM_GETITEMTEXTW,
(self.IAccessibleChildID-1), internalItem)
- if len:
-
winKernel.readProcessMemory(processHandle,internalItem,ctypes.byref(item),sizeofLVITEM,None)
- buffer=ctypes.create_unicode_buffer(len)
-
winKernel.readProcessMemory(processHandle,item.pszText,buffer,ctypes.sizeof(buffer),None)
- finally:
-
winKernel.virtualFreeEx(processHandle,internalText,0,winKernel.MEM_RELEASE)
- finally:
-
winKernel.virtualFreeEx(processHandle,internalItem,0,winKernel.MEM_RELEASE)
- return buffer.value if buffer else None
-
# Tweak for Track Tool: Announce column header if given.
- def announceColumnContent(self, colNumber, columnHeader=None):
+ # Also take care of this when specific columns are asked.
+ def announceColumnContent(self, colNumber, columnHeader=None,
individualColumns=False):
if not columnHeader: columnHeader =
self.columnHeaders.children[colNumber].name
- columnContent = self._getColumnContent(colNumber)
+ columnContent = _getColumnContent(self, colNumber)
if columnContent:
ui.message("{header}: {content}".format(header =
columnHeader, content = columnContent))
else:
- speech.speakMessage("{header}: blank".format(header =
columnHeader))
- braille.handler.message("{header}: ()".format(header =
columnHeader))
+ if individualColumns:
+ # Translators: Presented when some info is not
defined for a track in Track Tool (example: cue not found)
+ ui.message("{header} not found".format(header =
columnHeader))
+ else:
+ speech.speakMessage("{header}:
blank".format(header = columnHeader))
+ braille.handler.message("{header}:
()".format(header = columnHeader))

# Now the scripts.

@@ -139,94 +120,69 @@ class AppModule(appModuleHandler.AppModule):
clsList.insert(0, TrackToolItem)

# Various column reading scripts (row with fake navigation should not
be used).
- # Add-on 5.0: Keep the below routine.
- # 5.1/6.0: Use SysListView32.
-
- # Columns headers list:
- # Number: start substring, ending substring.
- columnHeaders = {
- 2: ["Title:", ", Duration:"], #Title
- 3: ["Duration:", ", "], #Duration
- 4: ["Cue:", ", "], #Cue
- 5: ["Overlap:", ", "], #Overlap
- 6: ["Intro:", ", "], #Intro
- 7: ["Segue:", ", "], # Segue
- 8: ["Filename:", None] # Actual file name.
- }
+ # 6.0: Cache column header indecies.
+ headerToIndex={}

- # Up to add-on 5.0.
- def announceColumnHeader(self, column):
- focus = api.getFocusObject()
- if focus.windowClassName not in ("TListView",
"TTntListView.UnicodeClass") and focus.role != ROLE_LISTITEM:
+ def announceColumnContent(self, headerText):
+ item = api.getFocusObject()
+ if not isinstance(item, TrackToolItem):
# Translators: Presented when trying to perform Track
Tool commands when not focused in the track list.
ui.message(_("Not in tracks list"))
- elif focus.name is None and focus.description is None:
+ elif item.name is None and item.description is None:
# Translators: Presented when no tracks are added to
Track Tool.
ui.message(_("No tracks added"))
else:
- if column != 1:
- desc = focus.description
- colstr = self.columnHeaders[column][0]
- if colstr not in desc:
- if colstr == "Intro:":
- # Translators: Presented when
intro is not defined for a track in Track Tool.
- columnInfo = _("Introduction
not set")
- else:
- # Translators: Presented when
some info is not defined for a track in Track Tool (example: cue not found)
- columnInfo = _("{columnInfo}
not found").format(columnInfo = colstr[:-1])
- else:
- colstrindex = desc.find(colstr)
- if column == 8:
- columnInfo = desc[colstrindex:]
- else:
- colstrend =
colstrindex+desc[colstrindex:].find(self.columnHeaders[column][1])
- columnInfo =
desc[colstrindex:colstrend]
- else:
- if focus.name is None:
- # Translators: Presented when artist
information is not found for a track in Track Tool.
- columnInfo = _("No artist")
- else:
- # Translators: Presents artist
information for a track in Track Tool.
- columnInfo = _("Artist:
{artistName}").format(artistName = focus.name)
- ui.message(columnInfo)
-
- # 5.1: Superseeds column announcement method.
- # 6.0: Cache column header indecies.
- #headerToIndex={}
-
- """def announceColumnContent(self, headerText):
- item = api.getFocusObject()
- columnHeaders = item.parent.children[-1].children
- for header in columnHeaders:
- if header.name == headerText:
- pos = columnHeaders.index(header)
- item.announceColumnContent(pos, columnHeader=headerText)"""
+ # Cached values always takes precedence.
+ if headerText not in self.headerToIndex:
+ columnHeaders =
item.parent.children[-1].children
+ for header in columnHeaders:
+ if header.name == headerText:
+ self.headerToIndex[headerText]
= columnHeaders.index(header)
+ pos = self.headerToIndex[headerText]
+ try:
+ item.announceColumnContent(pos,
columnHeader=headerText)
+ except AttributeError:
+ ui.message(_("Not in tracks list"))


def script_announceArtist(self, gesture):
- self.announceColumnHeader(1)
- #self.announceColumnContent("Artist")
+ # Special case for artist field to make it compatible with old
add-on releases.
+ item = api.getFocusObject()
+ if isinstance(item, TrackToolItem):
+ if item.name is None:
+ # Translators: Presented when artist
information is not found for a track in Track Tool.
+ ui.message(_("No artist"))
+ else:
+ # Translators: Presents artist information for
a track in Track Tool.
+ ui.message(_("Artist:
{artistName}").format(artistName = item.name))
+ else:
+ ui.message(_("Not in tracks list"))

def script_announceTitle(self, gesture):
- self.announceColumnHeader(2)
+ self.announceColumnContent("Title")

def script_announceDuration(self, gesture):
- self.announceColumnHeader(3)
+ self.announceColumnContent("Duration")

def script_announceCue(self, gesture):
- self.announceColumnHeader(4)
+ self.announceColumnContent("Cue")

def script_announceOverlap(self, gesture):
- self.announceColumnHeader(5)
+ self.announceColumnContent("Overlap")

def script_announceIntro(self, gesture):
- self.announceColumnHeader(6)
+ # Special case for intro to make it compatible with old add-on
releases.
+ item = api.getFocusObject()
+ if isinstance(item, TrackToolItem) and "Intro:" not in
item.description:
+ # Translators: Presented when intro is not defined for
a track in Track Tool.
+ ui.message(_("Introduction not set"))
+ else: self.announceColumnContent("Intro")

def script_announceSegue(self, gesture):
- self.announceColumnHeader(7)
+ self.announceColumnContent("Segue")

def script_announceFilename(self, gesture):
- self.announceColumnHeader(8)
+ self.announceColumnContent("Filename")

__gestures={
"kb:control+NVDA+1":"announceArtist",

diff --git a/addon/globalPlugins/SPLStudioUtils/encoders.py
b/addon/globalPlugins/SPLStudioUtils/encoders.py
index 4dfaf20..c44f56b 100755
--- a/addon/globalPlugins/SPLStudioUtils/encoders.py
+++ b/addon/globalPlugins/SPLStudioUtils/encoders.py
@@ -522,7 +522,8 @@ class SPLEncoder(Encoder):
except AttributeError:
pass
if self.playAfterConnecting and not connected:
- winUser.sendMessage(SPLWin, SPLMSG, 0,
SPLPlay)
+ if winUser.sendMessage(SPLWin, SPLMSG,
0, SPL_TrackPlaybackStatus) == 0:
+ winUser.sendMessage(SPLWin,
SPLMSG, 0, SPLPlay)
if not connected: connected = True
elif "Unable to connect" in messageCache or "Failed" in
messageCache:
if connected: connected = False

diff --git a/readme.md b/readme.md
index 36c8234..27daff2 100755
--- a/readme.md
+++ b/readme.md
@@ -143,6 +143,7 @@ From studio window, you can press Control+NVDA+0 to open
the add-on configuratio

If you are using Studio on a touchscreen computer running Windows 8 or later
and have NVDA 2012.3 or later installed, you can perform some Studio commands
from the touchscreen. First use three finger tap to switch to SPL mode, then
use the touch commands listed above to perform commands.

+<<<<<<< .merge_file_TnKUYW
## Changes for 6.0-dev

* New SPL Assistant commands, including announcing title of the currently
playing track (C) and opening the online user guide (Shift+F1).
@@ -152,6 +153,12 @@ If you are using Studio on a touchscreen computer running
Windows 8 or later and
* Added ability to reorder track column announcement and to suppress
announcement of specific columns if "use screen order" is unchecked from add-on
settings dialog. Use "manage column announcement" dialog to reorder columns.
* In SAM Encoders, settings such as focusing to Studio when connected is now
remembered.
* Added ability to use SPL Controller layer command to invoke SPL Assistant
layer.
+=======
+## Changes for 5.3/3
+
+* The fix for SAM Encoder (not playing the next track if a track is playing
and when the encoder connects) is now available for SPL Encoder users.
+* NVDA no longer plays errors or does not do anything when SPL Assistant, F1
(Assistant help dialog) is pressed.
+>>>>>>> .merge_file_rgkYIz

## Changes for 5.2



https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/afb8259d654b/
Changeset: afb8259d654b
Branch: master
User: josephsl
Date: 2015-08-14 00:35:48+00:00
Summary: Readme for 6.0-dev August snapshot 2

Affected #: 1 file

diff --git a/readme.md b/readme.md
index 27daff2..d2afc48 100755
--- a/readme.md
+++ b/readme.md
@@ -54,9 +54,19 @@ The following commands are available when using Sam or SPL
encoders:
* F11: Toggles whether NVDA will switch to Studio window for the selected
encoder if connected.
* Shift+F11: Toggles whether Studio will play the first selected track when
encoder is connected to a streaming server.
* Control+F11: Toggles background monitoring of the selected encoder.
-* F12: Opens a dialog to enter custom label for the selected encoder or stream.
+* F12/Control+NVDA+0: Opens a dialog to enter custom label for the selected
encoder or stream.
* Control+F12: opens a dialog to select the encoder you have deleted (to
realign stream labels).

+In addition, column review commands are available, including:
+
+* Control+NVDA+1: Encoder position.
+* Control+NVDA+2: stream label.
+* Control+NVDA+3 from SAM Encoder: Encoder format.
+* Control+NVDA+3 from SPL Encoder: Encoder settings.
+* Control+NvDA+4 from SAM Encoder: Encoder connection status.
+* Control+NVDA+4 from SPL Encoder: Transfer rate or connection status.
+* Control+NVDA+5 from SAM Encoder: Connection status description.
+
## 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.
@@ -85,6 +95,7 @@ The available status information are:
* F10: Perform track time analysis.
* F12: Switch between current and a predefined profile.
* F1: Layer help.
+* Shift+F1: Opens online user guide.

## SPL Controller

@@ -143,7 +154,6 @@ From studio window, you can press Control+NVDA+0 to open
the add-on configuratio

If you are using Studio on a touchscreen computer running Windows 8 or later
and have NVDA 2012.3 or later installed, you can perform some Studio commands
from the touchscreen. First use three finger tap to switch to SPL mode, then
use the touch commands listed above to perform commands.

-<<<<<<< .merge_file_TnKUYW
## Changes for 6.0-dev

* New SPL Assistant commands, including announcing title of the currently
playing track (C) and opening the online user guide (Shift+F1).
@@ -151,9 +161,10 @@ If you are using Studio on a touchscreen computer running
Windows 8 or later and
* You can now ask NVDA to report total length of a range of tracks via track
time analysis feature. Press SPL Assistant, F9 to mark current track as start
marker, move to end of track range and press SPL Assistant, F10. These commands
can be reassigned so one doesn't have to invoke SPL Assistant layer to perform
track time analysis.
* Added a column search dialog (command unassigned) to find text in specific
columns such as artist or part of file name.
* Added ability to reorder track column announcement and to suppress
announcement of specific columns if "use screen order" is unchecked from add-on
settings dialog. Use "manage column announcement" dialog to reorder columns.
-* In SAM Encoders, settings such as focusing to Studio when connected is now
remembered.
* Added ability to use SPL Controller layer command to invoke SPL Assistant
layer.
-=======
+* In SAM Encoders, settings such as focusing to Studio when connected is now
remembered.
+* It is now possible to view various columns from encoder window (such as
encoder connection status) via Control+NVDA+number command; consult the encoder
commands above.
+
## Changes for 5.3/3

* The fix for SAM Encoder (not playing the next track if a track is playing
and when the encoder connects) is now available for SPL Encoder users.

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: