| @@ -49,7 +49,7 @@ rename_client.argtypes = [ client_p, c_char_p, c_char_p ] | |||||
| rename_client.restype = c_int | rename_client.restype = c_int | ||||
| class jack_session_command_t( Structure ): | class jack_session_command_t( Structure ): | ||||
| _fields_ = [ ("uuid", 16*c_char ), ("command", 256*c_char ) ] | |||||
| _fields_ = [ ("uuid", 16*c_char ), ("client_name", 33*c_char), ("command", 256*c_char ) ] | |||||
| session_notify = libjack.jack_session_notify | session_notify = libjack.jack_session_notify | ||||
| session_notify.argtypes = [ client_p, c_uint, c_char_p ] | session_notify.argtypes = [ client_p, c_uint, c_char_p ] | ||||
| @@ -102,6 +102,10 @@ JackPortIsPhysical = 0x4 | |||||
| JackPortCanMonitor = 0x8 | JackPortCanMonitor = 0x8 | ||||
| JackPortIsTerminal = 0x10 | JackPortIsTerminal = 0x10 | ||||
| JackSessionSave = 1 | |||||
| JackSessionQuit = 2 | |||||
| class Port( object ): | class Port( object ): | ||||
| def __init__( self, client, name ): | def __init__( self, client, name ): | ||||
| @@ -220,6 +224,11 @@ class JackGraph( object ): | |||||
| # also needs to lock | # also needs to lock | ||||
| client.rename( "%s-%d"%(cname_prefix,num ) ) | client.rename( "%s-%d"%(cname_prefix,num ) ) | ||||
| class NotifyReply(object): | |||||
| def __init__( self, uuid, clientname, commandline ): | |||||
| self.uuid = uuid | |||||
| self.clientname = clientname | |||||
| self.commandline = commandline | |||||
| class JackClient(object): | class JackClient(object): | ||||
| @@ -249,6 +258,19 @@ class JackClient(object): | |||||
| self.port_queue.put( (port_p,reg) ) | self.port_queue.put( (port_p,reg) ) | ||||
| def session_save( self, path ): | |||||
| commands = session_notify( self.client, JackSessionSave, path ) | |||||
| i=0 | |||||
| retval = [] | |||||
| while( commands[i].uuid[0] != 0 ): | |||||
| retval.append( NotifyReply( commands[i].uuid, commands[i].clientname, commands[i].commandline ) ) | |||||
| jack_free( commands ) | |||||