self.nsmOSCUrl=self.getNsmOSCUrl()#this fails and raises NSMNotRunningError if NSM is not available. Host programs can ignore it or exit their program.
@ -263,13 +281,16 @@ class NSMClient(object):
self.saveCallback=saveCallback
self.exitProgramCallback=exitProgramCallback
self.openOrNewCallback=openOrNewCallback#The host needs to: Create a jack client with ourClientNameUnderNSM - Open the saved file and all its resources
self.hideGUICallback=hideGUICallbackifhideGUICallbackelseNone#if this stays None we don't ever need to check for it. This function will never be called by NSM anyway.
self.showGUICallback=showGUICallbackifshowGUICallbackelseNone#if this stays None we don't ever need to check for it. This function will never be called by NSM anyway.
exceptBlockingIOError:#happens while no data is received. Has nothing to do with blocking or not.
returnNone
msg=_IncomingMessage(data)#However, messages will crash the program if they are bigger than 4096.
msg=_IncomingMessage(data)#However, messages will crash the program if they are bigger than 4096.
ifmsg.oscpathinself.reactions:
self.reactions[msg.oscpath]()
elifmsg.oscpathinself.discardReactions:
@ -425,9 +446,15 @@ class NSMClient(object):
logging.info(self.ourClientNameUnderNSM+":pynsm2: Got /reply Loaded from NSM Server")
elifmsg.oscpath=="/reply"andmsg.params==["/nsm/server/save","Saved."]:#NSM sends that all program-states are saved. Does only happen from the general save instruction, not when saving our client individually
logging.info(self.ourClientNameUnderNSM+":pynsm2: Got /reply Saved from NSM Server")
elifmsg.isBroadcast:
ifself.broadcastCallback:
logging.info(self.ourClientNameUnderNSM+f":pynsm2: Got broadcast with messagePath {msg.oscpath} and listOfArguments {msg.params}")