Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Commit

Permalink
Add support for AES67 SIP Sources (prefix them with 'sip:' - as in th…
Browse files Browse the repository at this point in the history
…e xNode Config).

Update sample configuration file to show a SIP source.
Bump the version number to v1.3.0.
  • Loading branch information
anthonyeden committed Jul 18, 2017
1 parent a37fc0c commit 2dd5ae9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 15 deletions.
43 changes: 32 additions & 11 deletions LW-Delegation-Switcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__copyright__ = "Copyright 2017, Anthony Eden / Media Realm"
__credits__ = ["Anthony Eden"]
__license__ = "GPL"
__version__ = "1.2"
__version__ = "1.3"

import os, sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/libs")
Expand Down Expand Up @@ -89,13 +89,24 @@ def setupConfig(self):
self.titleLabel = config['Title']

for source in config['Sources']:
self.LWRP_Sources.append(
{
"ButtonLabel": source['Name'],
"LWNumber": int(source['SourceNum']),
"LWMulticastNumber": AxiaLivewireAddressHelper.streamNumToMulticastAddr(source['SourceNum'])
}
)
if source['SourceNum'][:4] == "sip:":
self.LWRP_Sources.append(
{
"ButtonLabel": source['Name'],
"LWNumber": None,
"LWMulticastNumber": None,
"LWSipAddress": source['SourceNum']
}
)
else:
self.LWRP_Sources.append(
{
"ButtonLabel": source['Name'],
"LWNumber": int(source['SourceNum']),
"LWMulticastNumber": AxiaLivewireAddressHelper.streamNumToMulticastAddr(source['SourceNum']),
"LWSipAddress": None
}
)

return True

Expand Down Expand Up @@ -142,6 +153,10 @@ def connectLWRP(self):
def findOutputLWRP(self, destinationList, destinationNumber):
# Find the current output stream number for the specified output
for destination in destinationList:
if int(destination['num']) == destinationNumber and destination['attributes']['address'] is not None and destination['attributes']['address'][:4] == "sip:":
# The active output, in Livewire SIP format
return destination['attributes']['address']

if int(destination['num']) == destinationNumber and destination['attributes']['address'] is not None and "." in destination['attributes']['address']:
# The active output, in Multicast IP Address format
return AxiaLivewireAddressHelper.multicastAddrToStreamNum(destination['attributes']['address'])
Expand Down Expand Up @@ -225,16 +240,22 @@ def sourceBtnUpdate(self):

self.sourceButtons.append(button)

if self.LWRP_CurrentOutput == sourceData['LWNumber']:
# This channel is currently selected
if self.LWRP_CurrentOutput == sourceData['LWSipAddress']:
# This channel is currently selected - SIP
button.config(bg = "#FF0000", fg = "#FFFFFF")
elif sourceData['LWNumber'] is not None and self.LWRP_CurrentOutput == sourceData['LWNumber']:
# This channel is currently selected - multicast
button.config(bg = "#FF0000", fg = "#FFFFFF")
else:
# This channel is not currently selected
button.config(bg = "#FFFFFF", fg = "#000000")

def sourceBtnPress(self, sourceNum):
# Immediatly trigger a change to the destination/output
self.LWRP.setDestination(self.LWRP_OutputChannel, self.LWRP_Sources[sourceNum]['LWMulticastNumber'])
if self.LWRP_Sources[sourceNum]['LWSipAddress'] is not None:
self.LWRP.setDestination(self.LWRP_OutputChannel, self.LWRP_Sources[sourceNum]['LWSipAddress'])
else:
self.LWRP.setDestination(self.LWRP_OutputChannel, self.LWRP_Sources[sourceNum]['LWMulticastNumber'])

def setErrorMessage(self, message = None):
# Error Message Label
Expand Down
4 changes: 4 additions & 0 deletions config-sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
{
"Name": "Satellite",
"SourceNum": "82"
},
{
"Name": "xNode SIP Input",
"SourceNum": "sip:[email protected]"
}
]
}
8 changes: 4 additions & 4 deletions version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(1, 2, 0, 0),
prodvers=(1, 2, 0, 0),
filevers=(1, 3, 0, 0),
prodvers=(1, 3, 0, 0),
mask=0x3f,
flags=0x0,
OS=0x40004,
Expand All @@ -16,12 +16,12 @@
u'040904B0',
[StringStruct(u'CompanyName', u'Anthony Eden / Media Realm'),
StringStruct(u'FileDescription', u'Livewire Simple Delegation Switcher'),
StringStruct(u'FileVersion', u'1.2.0)'),
StringStruct(u'FileVersion', u'1.3.0)'),
StringStruct(u'InternalName', u'LivewireSimpleDelegationSwitcher'),
StringStruct(u'LegalCopyright', u'\xa9 Anthony Eden. All rights reserved.'),
StringStruct(u'OriginalFilename', u'LW-Delegation-Switcher.exe'),
StringStruct(u'ProductName', u'Livewire Simple Delegation Switcher'),
StringStruct(u'ProductVersion', u'1.2.0.0')])
StringStruct(u'ProductVersion', u'1.3.0.0')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
Expand Down

0 comments on commit 2dd5ae9

Please sign in to comment.