/*
 	Copyright (C) 2004 Grame
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.
    
    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software 
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/

subsystem  JackRPCEngine 1000;

#include <mach/std_types.defs>
#include <mach/mach_types.defs>
import "Jackdefs.h";

ServerPrefix server_;

type client_name_t = c_string[128];
type client_port_name_t = c_string[128];
type client_port_type_t = c_string[128];
type so_name_t = c_string[1024];
type objet_data_t = c_string[1024];

routine rpc_jack_client_open(
	server_port	: mach_port_t;
	client_name	: client_name_t;
    pid         : int;
	out private_port : mach_port_make_send_t;
	out shared_engine : int;
	out shared_client : int;
	out shared_graph : int;
	out result : int);

routine rpc_jack_client_check(
	server_port	: mach_port_t;
	client_name	: client_name_t;
	out client_name_res	: client_name_t;
	protocol	: int;
	options		: int;
	out status	: int;
	out result : int);

routine  rpc_jack_client_close(
	server_port	: mach_port_t;
	refnum		: int;
	out result 	: int);
    
routine  rpc_jack_client_activate(
	server_port	: mach_port_t;
	refnum		: int;
    state		: int;
	out result 	: int);

routine  rpc_jack_client_deactivate(
	server_port	: mach_port_t;
	refnum		: int;
	out result 	: int);

routine rpc_jack_port_register(
	server_port	: mach_port_t;
	refnum		: int;
	name		: client_port_name_t;
	port_type	: client_port_type_t;
	flags		: unsigned;
	buffer_size : unsigned;
	out port_index : unsigned;
	out result 	: int);
	
routine rpc_jack_port_unregister(
	server_port	: mach_port_t;
	refnum		: int;
	port		: int;
	out result 	: int);	
	
routine rpc_jack_port_connect(
	server_port	: mach_port_t;
	refnum		: int;
	src         : int;
	dst         : int;
	out result 	: int);
	
routine rpc_jack_port_disconnect(
	server_port	: mach_port_t;
	refnum		: int;
	src         : int;
	dst         : int;
	out result 	: int);
    
routine rpc_jack_port_connect_name(
	server_port	: mach_port_t;
	refnum		: int;
	src         : client_port_name_t;
	dst         : client_port_name_t;
	out result 	: int);
	
routine rpc_jack_port_disconnect_name(
	server_port	: mach_port_t;
	refnum		: int;
	src         : client_port_name_t;
	dst         : client_port_name_t;
	out result 	: int);
	
routine rpc_jack_set_buffer_size(
	server_port	: mach_port_t;
	buffer_size : int;
	out result 	: int);
	
routine rpc_jack_set_freewheel(
	server_port	: mach_port_t;
	onoff		: int;
	out result 	: int);

routine rpc_jack_release_timebase(
	server_port	: mach_port_t;
	refnum		: int;
	out result 	: int);
	
routine rpc_jack_set_timebase_callback(
	server_port	: mach_port_t;
	refnum		: int;
	conditional	: int;
	out result 	: int);
	
routine rpc_jack_get_internal_clientname(
	server_port	: mach_port_t;
	refnum		: int;
	int_ref		: int;
	out client_name_res	: client_name_t;
	out result 	: int);
	
routine rpc_jack_internal_clienthandle(
	server_port	: mach_port_t;
	refnum		: int;
	client_name	: client_name_t;
	out int_ref : int;
	out status	: int;
	out result : int);
	
routine rpc_jack_internal_clientload(
	server_port	: mach_port_t;
	refnum		: int;
	client_name	: client_name_t;
	so_name		: so_name_t;
	objet_data	: objet_data_t;
	options		: int;
	out status	: int;
	out int_ref : int;
	out result	: int);
	
routine rpc_jack_internal_clientunload(
	server_port	: mach_port_t;
	refnum		: int;
	int_ref		: int;
	out status	: int;
	out result 	: int);

simpleroutine rpc_jack_client_rt_notify(
	client_port	: mach_port_t;
	refnum		: int;
	notify		: int;
    value		: int;
	waittime timeout : int);

	
