19dec2310SAxel Dörfler/*
29dec2310SAxel Dörfler * Copyright 2002, Marcus Overhagen. All Rights Reserved.
39dec2310SAxel Dörfler * Copyright 2009, Axel D��rfler, axeld@pinc-software.de.
49dec2310SAxel Dörfler * Distributed under the terms of the MIT License.
59dec2310SAxel Dörfler */
69dec2310SAxel Dörfler#ifndef _SERVER_INTERFACE_H_
79dec2310SAxel Dörfler#define _SERVER_INTERFACE_H_
89dec2310SAxel Dörfler
99dec2310SAxel Dörfler
10e973f15aSIngo Weinhold#include <string.h>
11e973f15aSIngo Weinhold
125f207b83SAxel Dörfler#include <Buffer.h>
139dec2310SAxel Dörfler#include <Entry.h>
145f207b83SAxel Dörfler#include <MediaAddOn.h>
159dec2310SAxel Dörfler#include <MediaDefs.h>
165f207b83SAxel Dörfler#include <MediaFormats.h>
179dec2310SAxel Dörfler#include <MediaNode.h>
185f207b83SAxel Dörfler#include <Messenger.h>
195f207b83SAxel Dörfler
205f207b83SAxel Dörfler
215f207b83SAxel Dörfler// BMessage based server communication
225f207b83SAxel Dörflerenum {
235f207b83SAxel Dörfler	// BMediaRoster notification service
245f207b83SAxel Dörfler	MEDIA_SERVER_REQUEST_NOTIFICATIONS = 1000,
255f207b83SAxel Dörfler	MEDIA_SERVER_CANCEL_NOTIFICATIONS,
265f207b83SAxel Dörfler	MEDIA_SERVER_SEND_NOTIFICATIONS,
275f207b83SAxel Dörfler
285f207b83SAxel Dörfler	// add_system_beep_event()
295f207b83SAxel Dörfler	MEDIA_SERVER_ADD_SYSTEM_BEEP_EVENT,
309dec2310SAxel Dörfler
3153c3fa51SDario Casalinuovo	// sent by the rescan thread
3253c3fa51SDario Casalinuovo	MEDIA_SERVER_RESCAN_COMPLETED,
3311c7bd86SDario Casalinuovo	// sent to rosters when rescan is completed
3411c7bd86SDario Casalinuovo	MEDIA_SERVER_ALIVE,
3553c3fa51SDario Casalinuovo
365f207b83SAxel Dörfler	// media add-on server
375f207b83SAxel Dörfler	MEDIA_ADD_ON_SERVER_PLAY_MEDIA = '_TRU'
385f207b83SAxel Dörfler};
395f207b83SAxel Dörfler
4032afe10aSDario Casalinuovoenum {
4132afe10aSDario Casalinuovo	// local media services status notification service
4232afe10aSDario Casalinuovo	MEDIA_ROSTER_REQUEST_NOTIFICATIONS = 2000,
4376889670SDario Casalinuovo	MEDIA_ROSTER_CANCEL_NOTIFICATIONS,
4476889670SDario Casalinuovo
4576889670SDario Casalinuovo	// used to sync with media services startup
4676889670SDario Casalinuovo	MEDIA_ROSTER_REGISTER_SYNC
4732afe10aSDario Casalinuovo};
4832afe10aSDario Casalinuovo
495f207b83SAxel Dörfler// Raw port based communication
509dec2310SAxel Dörflerenum {
51ba5e652dSAdrien Destugues	GENERAL_PURPOSE_WAKEUP = 0,	// when no action but wait termination needed
52ba5e652dSAdrien Destugues
535f207b83SAxel Dörfler	ADD_ON_SERVER_RESCAN_ADD_ON_FLAVORS = 0x50,
545f207b83SAxel Dörfler	ADD_ON_SERVER_RESCAN_FINISHED_NOTIFY,
559c3b4706SAxel Dörfler	ADD_ON_SERVER_INSTANTIATE_DORMANT_NODE,
565f207b83SAxel Dörfler
575f207b83SAxel Dörfler	SERVER_MESSAGE_START = 0x100,
585f207b83SAxel Dörfler	SERVER_REGISTER_APP,
595f207b83SAxel Dörfler	SERVER_UNREGISTER_APP,
605f207b83SAxel Dörfler	SERVER_GET_NODE,
615f207b83SAxel Dörfler	SERVER_SET_NODE,
625f207b83SAxel Dörfler	SERVER_PUBLISH_INPUTS,
635f207b83SAxel Dörfler	SERVER_PUBLISH_OUTPUTS,
645f207b83SAxel Dörfler	SERVER_NODE_ID_FOR,
655f207b83SAxel Dörfler	SERVER_GET_LIVE_NODE_INFO,
665f207b83SAxel Dörfler	SERVER_GET_LIVE_NODES,
675f207b83SAxel Dörfler	SERVER_GET_NODE_FOR,
685f207b83SAxel Dörfler	SERVER_RELEASE_NODE,
696aee58a4SJérôme Duval	SERVER_RELEASE_NODE_ALL,
705f207b83SAxel Dörfler	SERVER_REGISTER_NODE,
715f207b83SAxel Dörfler	SERVER_UNREGISTER_NODE,
725f207b83SAxel Dörfler	SERVER_GET_DORMANT_NODE_FOR,
735f207b83SAxel Dörfler	SERVER_GET_INSTANCES_FOR,
745f207b83SAxel Dörfler	SERVER_GET_SHARED_BUFFER_AREA,
755f207b83SAxel Dörfler	SERVER_REGISTER_BUFFER,
765f207b83SAxel Dörfler	SERVER_UNREGISTER_BUFFER,
775f207b83SAxel Dörfler	SERVER_RESCAN_DEFAULTS,
785f207b83SAxel Dörfler	SERVER_SET_NODE_CREATOR,
795f207b83SAxel Dörfler	SERVER_CHANGE_FLAVOR_INSTANCES_COUNT,
805f207b83SAxel Dörfler	SERVER_GET_MEDIA_FILE_TYPES,
815f207b83SAxel Dörfler	SERVER_GET_MEDIA_FILE_ITEMS,
825f207b83SAxel Dörfler	SERVER_GET_REF_FOR,
835f207b83SAxel Dörfler	SERVER_SET_REF_FOR,
845f207b83SAxel Dörfler	SERVER_INVALIDATE_MEDIA_ITEM,
855f207b83SAxel Dörfler	SERVER_REMOVE_MEDIA_ITEM,
865f207b83SAxel Dörfler	SERVER_GET_ITEM_AUDIO_GAIN,
875f207b83SAxel Dörfler	SERVER_SET_ITEM_AUDIO_GAIN,
885f207b83SAxel Dörfler	SERVER_GET_FORMAT_FOR_DESCRIPTION,
895f207b83SAxel Dörfler	SERVER_GET_DESCRIPTION_FOR_FORMAT,
909c3b4706SAxel Dörfler	SERVER_REGISTER_ADD_ON,
919c3b4706SAxel Dörfler	SERVER_UNREGISTER_ADD_ON,
929c3b4706SAxel Dörfler	SERVER_GET_ADD_ON_REF,
939dec2310SAxel Dörfler	SERVER_REGISTER_DORMANT_NODE,
949dec2310SAxel Dörfler	SERVER_GET_DORMANT_NODES,
959dec2310SAxel Dörfler	SERVER_GET_DORMANT_FLAVOR_INFO,
967bcdb362SDario Casalinuovo	SERVER_SET_NODE_TIMESOURCE,
975f207b83SAxel Dörfler	SERVER_MESSAGE_END,
985f207b83SAxel Dörfler
995f207b83SAxel Dörfler	NODE_MESSAGE_START = 0x200,
1005f207b83SAxel Dörfler	NODE_START,
1015f207b83SAxel Dörfler	NODE_STOP,
1025f207b83SAxel Dörfler	NODE_SEEK,
1035f207b83SAxel Dörfler	NODE_SET_RUN_MODE,
1045f207b83SAxel Dörfler	NODE_TIME_WARP,
1055f207b83SAxel Dörfler	NODE_PREROLL,
10614896b93SDario Casalinuovo	NODE_ROLL,
10775486484SDario Casalinuovo	NODE_SYNC_TO,
1085f207b83SAxel Dörfler	NODE_SET_TIMESOURCE,
1095f207b83SAxel Dörfler	NODE_GET_TIMESOURCE,
110c079d8d6SDario Casalinuovo	NODE_GET_ATTRIBUTES_FOR,
1115f207b83SAxel Dörfler	NODE_REQUEST_COMPLETED,
1125f207b83SAxel Dörfler	NODE_FINAL_RELEASE,
1135f207b83SAxel Dörfler	NODE_MESSAGE_END,
1145f207b83SAxel Dörfler
1155f207b83SAxel Dörfler	CONSUMER_MESSAGE_START = 0x300,
1165f207b83SAxel Dörfler	CONSUMER_GET_NEXT_INPUT,
1175f207b83SAxel Dörfler	CONSUMER_DISPOSE_INPUT_COOKIE,
1185f207b83SAxel Dörfler	CONSUMER_ACCEPT_FORMAT,
1195f207b83SAxel Dörfler	CONSUMER_CONNECTED,
1205f207b83SAxel Dörfler	CONSUMER_DISCONNECTED,
1215f207b83SAxel Dörfler	CONSUMER_BUFFER_RECEIVED,
1225f207b83SAxel Dörfler	CONSUMER_PRODUCER_DATA_STATUS,
1235f207b83SAxel Dörfler	CONSUMER_GET_LATENCY_FOR,
1245f207b83SAxel Dörfler	CONSUMER_FORMAT_CHANGED,
1255f207b83SAxel Dörfler	CONSUMER_SEEK_TAG_REQUESTED,
1265f207b83SAxel Dörfler	CONSUMER_MESSAGE_END,
1275f207b83SAxel Dörfler
1285f207b83SAxel Dörfler	PRODUCER_MESSAGE_START = 0x400,
1295f207b83SAxel Dörfler	PRODUCER_GET_NEXT_OUTPUT,
1305f207b83SAxel Dörfler	PRODUCER_DISPOSE_OUTPUT_COOKIE,
1315f207b83SAxel Dörfler	PRODUCER_FORMAT_PROPOSAL,
1325f207b83SAxel Dörfler	PRODUCER_PREPARE_TO_CONNECT,
1335f207b83SAxel Dörfler	PRODUCER_CONNECT,
1345f207b83SAxel Dörfler	PRODUCER_DISCONNECT,
1355f207b83SAxel Dörfler	PRODUCER_LATE_NOTICE_RECEIVED,
1365f207b83SAxel Dörfler	PRODUCER_LATENCY_CHANGED,
1375f207b83SAxel Dörfler	PRODUCER_ADDITIONAL_BUFFER_REQUESTED,
1385f207b83SAxel Dörfler	PRODUCER_VIDEO_CLIPPING_CHANGED,
1395f207b83SAxel Dörfler	PRODUCER_FORMAT_CHANGE_REQUESTED,
1405f207b83SAxel Dörfler	PRODUCER_SET_BUFFER_GROUP,
1415f207b83SAxel Dörfler	PRODUCER_GET_LATENCY,
1425f207b83SAxel Dörfler	PRODUCER_GET_INITIAL_LATENCY,
1435f207b83SAxel Dörfler	PRODUCER_FORMAT_SUGGESTION_REQUESTED,
1445f207b83SAxel Dörfler	PRODUCER_SET_PLAY_RATE,
1455f207b83SAxel Dörfler	PRODUCER_ENABLE_OUTPUT,
1465f207b83SAxel Dörfler	PRODUCER_SET_RUN_MODE_DELAY,
1475f207b83SAxel Dörfler	PRODUCER_MESSAGE_END,
1485f207b83SAxel Dörfler
1495f207b83SAxel Dörfler	FILEINTERFACE_MESSAGE_START = 0x500,
1505f207b83SAxel Dörfler	FILEINTERFACE_SET_REF,
1515f207b83SAxel Dörfler	FILEINTERFACE_GET_REF,
1525f207b83SAxel Dörfler	FILEINTERFACE_SNIFF_REF,
153b6f0f884SDario Casalinuovo	FILEINTERFACE_GET_FORMATS,
1545f207b83SAxel Dörfler	FILEINTERFACE_MESSAGE_END,
1555f207b83SAxel Dörfler
1565f207b83SAxel Dörfler	CONTROLLABLE_MESSAGE_START = 0x600,
1575f207b83SAxel Dörfler	CONTROLLABLE_GET_PARAMETER_WEB,
1585f207b83SAxel Dörfler	CONTROLLABLE_GET_PARAMETER_DATA,
1595f207b83SAxel Dörfler	CONTROLLABLE_SET_PARAMETER_DATA,
1605f207b83SAxel Dörfler	CONTROLLABLE_START_CONTROL_PANEL,
1615f207b83SAxel Dörfler	CONTROLLABLE_MESSAGE_END,
1625f207b83SAxel Dörfler
1635f207b83SAxel Dörfler	TIMESOURCE_MESSAGE_START = 0x700,
1645f207b83SAxel Dörfler	TIMESOURCE_OP, // datablock is a struct time_source_op_info
1655f207b83SAxel Dörfler	TIMESOURCE_ADD_SLAVE_NODE,
1665f207b83SAxel Dörfler	TIMESOURCE_REMOVE_SLAVE_NODE,
1675f207b83SAxel Dörfler	TIMESOURCE_GET_START_LATENCY,
1685f207b83SAxel Dörfler	TIMESOURCE_MESSAGE_END,
1695f207b83SAxel Dörfler};
1705f207b83SAxel Dörfler
1715f207b83SAxel Dörfler
1726cafce94SAxel Dörflernamespace BPrivate {
1736cafce94SAxel Dörflernamespace media {
1746cafce94SAxel Dörfler
1756cafce94SAxel Dörfler
1765f207b83SAxel Dörflerstruct reply_data;
1775f207b83SAxel Dörflerstruct request_data;
1785f207b83SAxel Dörflerstruct command_data;
1795f207b83SAxel Dörfler
1805f207b83SAxel Dörfler
1815f207b83SAxel Dörfler// The base struct used for all raw requests
1825f207b83SAxel Dörflerstruct request_data {
1835f207b83SAxel Dörfler	port_id					reply_port;
1845f207b83SAxel Dörfler
1856cafce94SAxel Dörfler	request_data();
1866cafce94SAxel Dörfler	~request_data();
1876cafce94SAxel Dörfler
1885f207b83SAxel Dörfler	status_t SendReply(status_t result, reply_data* reply,
1895f207b83SAxel Dörfler		size_t replySize) const;
1905f207b83SAxel Dörfler};
1915f207b83SAxel Dörfler
1925f207b83SAxel Dörfler// The base struct used for all raw replys
1935f207b83SAxel Dörflerstruct reply_data {
1945f207b83SAxel Dörfler	status_t				result;
1955f207b83SAxel Dörfler};
1965f207b83SAxel Dörfler
1975f207b83SAxel Dörfler// The base struct used for all raw commands (asynchronous, no answer)
1985f207b83SAxel Dörflerstruct command_data {
1995f207b83SAxel Dörfler	// yes, it's empty ;)
2005f207b83SAxel Dörfler
201949cf6acSMurai Takashi#if __GNUC__ >= 4
2025f207b83SAxel Dörfler	int32 _padding;
2035f207b83SAxel Dörfler		// GCC 2 and GCC 4 treat empty structures differently
2045f207b83SAxel Dörfler#endif
2055f207b83SAxel Dörfler};
2065f207b83SAxel Dörfler
2075f207b83SAxel Dörfler// The base struct used for all requests using an area
2085f207b83SAxel Dörflerstruct area_request_data : request_data {
2095f207b83SAxel Dörfler	area_id					area;
2105f207b83SAxel Dörfler};
2115f207b83SAxel Dörfler
2125f207b83SAxel Dörfler// The base struct used for all requests requesting an area
2135f207b83SAxel Dörflerstruct request_area_data : request_data {
2145f207b83SAxel Dörfler	team_id					team;
2155f207b83SAxel Dörfler};
2165f207b83SAxel Dörfler
2175f207b83SAxel Dörfler// The base struct used for all replies using an area
2185f207b83SAxel Dörflerstruct area_reply_data : reply_data {
2195f207b83SAxel Dörfler	area_id					area;
2205f207b83SAxel Dörfler	void*					address;
2215f207b83SAxel Dörfler};
2225f207b83SAxel Dörfler
2235f207b83SAxel Dörfler
2245f207b83SAxel Dörfler/* We can't send an entry_ref through a port to another team,
2255f207b83SAxel Dörfler * but we can assign it to an xfer_entry_ref and send this one,
2265f207b83SAxel Dörfler * when we receive it we can assign it to a normal entry_ref
2275f207b83SAxel Dörfler */
2285f207b83SAxel Dörflerstruct xfer_entry_ref {
2295f207b83SAxel Dörflerpublic:
2305f207b83SAxel Dörfler	xfer_entry_ref()
2315f207b83SAxel Dörfler	{
2325f207b83SAxel Dörfler		device = -1;
2335f207b83SAxel Dörfler		directory = -1;
2345f207b83SAxel Dörfler		name[0] = 0;
2355f207b83SAxel Dörfler	}
2365f207b83SAxel Dörfler
2375f207b83SAxel Dörfler	operator entry_ref() const
2385f207b83SAxel Dörfler	{
2395f207b83SAxel Dörfler		entry_ref ref(device, directory, name);
2405f207b83SAxel Dörfler		return ref;
2415f207b83SAxel Dörfler	}
2425f207b83SAxel Dörfler
2435f207b83SAxel Dörfler	xfer_entry_ref& operator=(const entry_ref& ref)
2445f207b83SAxel Dörfler	{
2455f207b83SAxel Dörfler		device = ref.device;
2465f207b83SAxel Dörfler		directory = ref.directory;
2479b193544SAdrien Destugues		if (ref.name == NULL)
2489b193544SAdrien Destugues			name[0] = 0;
2499b193544SAdrien Destugues		else if (strlen(ref.name) > B_FILE_NAME_LENGTH) {
2509b193544SAdrien Destugues			debugger("File name too long!");
2515f207b83SAxel Dörfler			name[0] = 0;
2529b193544SAdrien Destugues		} else
2539b193544SAdrien Destugues			strcpy(name, ref.name);
2545f207b83SAxel Dörfler
2555f207b83SAxel Dörfler		return *this;
2565f207b83SAxel Dörfler	}
2575f207b83SAxel Dörfler
2585f207b83SAxel Dörflerprivate:
2595f207b83SAxel Dörfler	dev_t	device;
2605f207b83SAxel Dörfler	ino_t	directory;
2615f207b83SAxel Dörfler	char	name[B_FILE_NAME_LENGTH];
2625f207b83SAxel Dörfler};
2635f207b83SAxel Dörfler
2646cafce94SAxel Dörfler
2656cafce94SAxel Dörfler}	// namespace media
2666cafce94SAxel Dörfler}	// namespace BPrivate
2676cafce94SAxel Dörfler
2686cafce94SAxel Dörflerusing namespace BPrivate::media;
2696cafce94SAxel Dörfler
2705f207b83SAxel Dörfler// used by SERVER_GET_NODE and SERVER_SET_NODE
2715f207b83SAxel Dörflerenum node_type {
2725f207b83SAxel Dörfler	VIDEO_INPUT,
2735f207b83SAxel Dörfler	AUDIO_INPUT,
2745f207b83SAxel Dörfler	VIDEO_OUTPUT,
2755f207b83SAxel Dörfler	AUDIO_MIXER,
2765f207b83SAxel Dörfler	AUDIO_OUTPUT,
2775f207b83SAxel Dörfler	AUDIO_OUTPUT_EX,
2785f207b83SAxel Dörfler	TIME_SOURCE,
2795f207b83SAxel Dörfler	SYSTEM_TIME_SOURCE
2805f207b83SAxel Dörfler};
2815f207b83SAxel Dörfler
2825f207b83SAxel Dörfler// used by SERVER_PUBLISH_INPUTS and SERVER_PUBLISH_OUTPUTS
2835f207b83SAxel Dörflerenum {
2845f207b83SAxel Dörfler	MAX_OUTPUTS = 8,
2855f207b83SAxel Dörfler	MAX_INPUTS = 8,
2865f207b83SAxel Dörfler};
2875f207b83SAxel Dörfler
2885f207b83SAxel Dörfler// used by SERVER_GET_LIVE_NODES
2895f207b83SAxel Dörflerenum {
2905f207b83SAxel Dörfler	MAX_LIVE_INFO = 16,
2915f207b83SAxel Dörfler};
2925f207b83SAxel Dörfler
2935f207b83SAxel Dörfler// used by SERVER_GET_INSTANCES_FOR
2945f207b83SAxel Dörflerenum {
2955f207b83SAxel Dörfler	MAX_NODE_ID = 4000,
2965f207b83SAxel Dörfler};
2975f207b83SAxel Dörfler
2985f207b83SAxel Dörfler// used by SERVER_GET_READERS
2995f207b83SAxel Dörflerenum {
3005f207b83SAxel Dörfler	MAX_READERS = 40,
3015f207b83SAxel Dörfler};
3025f207b83SAxel Dörfler
3035f207b83SAxel Dörfler
3045f207b83SAxel Dörfler// #pragma mark - media add-on server commands
3055f207b83SAxel Dörfler
3065f207b83SAxel Dörfler
3075f207b83SAxel Dörflerstruct add_on_server_instantiate_dormant_node_request : request_data {
3085f207b83SAxel Dörfler	media_addon_id			add_on_id;
3095f207b83SAxel Dörfler	int32					flavor_id;
3105f207b83SAxel Dörfler	team_id					creator_team;
3115f207b83SAxel Dörfler};
3125f207b83SAxel Dörfler
3135f207b83SAxel Dörflerstruct add_on_server_instantiate_dormant_node_reply : reply_data {
3145f207b83SAxel Dörfler	media_node				node;
3155f207b83SAxel Dörfler};
3165f207b83SAxel Dörfler
3175f207b83SAxel Dörflerstruct add_on_server_rescan_flavors_command : command_data {
3185f207b83SAxel Dörfler	media_addon_id			add_on_id;
3195f207b83SAxel Dörfler};
3205f207b83SAxel Dörfler
3215f207b83SAxel Dörflerstruct add_on_server_rescan_finished_notify_command : command_data {
3225f207b83SAxel Dörfler};
3235f207b83SAxel Dörfler
3245f207b83SAxel Dörfler
3255f207b83SAxel Dörfler// #pragma mark - media server commands
3265f207b83SAxel Dörfler
3275f207b83SAxel Dörfler
3285f207b83SAxel Dörflerstruct server_set_node_request : request_data {
3295f207b83SAxel Dörfler	node_type				type;
3305f207b83SAxel Dörfler	bool					use_node;
3315f207b83SAxel Dörfler	media_node				node;
3325f207b83SAxel Dörfler	bool					use_dni;
3335f207b83SAxel Dörfler	dormant_node_info		dni;
3345f207b83SAxel Dörfler	bool					use_input;
3355f207b83SAxel Dörfler	media_input				input;
3365f207b83SAxel Dörfler};
3375f207b83SAxel Dörfler
3385f207b83SAxel Dörflerstruct server_set_node_reply : reply_data {
3395f207b83SAxel Dörfler};
3405f207b83SAxel Dörfler
3415f207b83SAxel Dörflerstruct server_get_node_request : request_data {
3425f207b83SAxel Dörfler	node_type				type;
3435f207b83SAxel Dörfler	team_id					team;
3445f207b83SAxel Dörfler};
3455f207b83SAxel Dörfler
3465f207b83SAxel Dörflerstruct server_get_node_reply : public reply_data {
3475f207b83SAxel Dörfler	media_node				node;
3485f207b83SAxel Dörfler
3495f207b83SAxel Dörfler	// for AUDIO_OUTPUT_EX
3505f207b83SAxel Dörfler	char					input_name[B_MEDIA_NAME_LENGTH];
3515f207b83SAxel Dörfler	int32					input_id;
3525f207b83SAxel Dörfler};
3535f207b83SAxel Dörfler
3545f207b83SAxel Dörflerstruct server_publish_inputs_request : request_data {
3555f207b83SAxel Dörfler	media_node				node;
3565f207b83SAxel Dörfler	int32					count;
3575f207b83SAxel Dörfler	area_id area;	// if count > MAX_INPUTS, inputs are in the area
3585f207b83SAxel Dörfler					// area is created in the library, and also deleted
3595f207b83SAxel Dörfler					// in the library after the reply has been received
3605f207b83SAxel Dörfler	media_input inputs[MAX_INPUTS];
3615f207b83SAxel Dörfler};
3625f207b83SAxel Dörfler
3635f207b83SAxel Dörflerstruct server_publish_inputs_reply : reply_data {
3645f207b83SAxel Dörfler};
3655f207b83SAxel Dörfler
3665f207b83SAxel Dörflerstruct server_publish_outputs_request : area_request_data {
3675f207b83SAxel Dörfler	media_node				node;
3685f207b83SAxel Dörfler	int32					count;
3695f207b83SAxel Dörfler		// if count > MAX_OUTPUTS, outputs are in the area
3705f207b83SAxel Dörfler		// area is created in the library, and also deleted
3715f207b83SAxel Dörfler		// in the library after the reply has been received
3725f207b83SAxel Dörfler	media_output outputs[MAX_OUTPUTS];
3735f207b83SAxel Dörfler};
3745f207b83SAxel Dörfler
3755f207b83SAxel Dörflerstruct server_publish_outputs_reply : reply_data {
3765f207b83SAxel Dörfler};
3775f207b83SAxel Dörfler
3785f207b83SAxel Dörflerstruct server_register_app_request : request_data {
3795f207b83SAxel Dörfler	team_id					team;
3805f207b83SAxel Dörfler	BMessenger				messenger;
3815f207b83SAxel Dörfler};
3825f207b83SAxel Dörfler
3835f207b83SAxel Dörflerstruct server_register_app_reply : reply_data {
3845f207b83SAxel Dörfler};
3855f207b83SAxel Dörfler
3865f207b83SAxel Dörflerstruct server_unregister_app_request : request_data {
3875f207b83SAxel Dörfler	team_id					team;
3885f207b83SAxel Dörfler};
3895f207b83SAxel Dörfler
3905f207b83SAxel Dörflerstruct server_unregister_app_reply : reply_data {
3915f207b83SAxel Dörfler};
3925f207b83SAxel Dörfler
3935f207b83SAxel Dörflerstruct server_set_node_creator_request : request_data {
3945f207b83SAxel Dörfler	media_node_id			node;
3955f207b83SAxel Dörfler	team_id					creator;
3965f207b83SAxel Dörfler};
3975f207b83SAxel Dörfler
3985f207b83SAxel Dörflerstruct server_set_node_creator_reply : reply_data {
3995f207b83SAxel Dörfler};
4005f207b83SAxel Dörfler
4015f207b83SAxel Dörflerstruct server_change_flavor_instances_count_request : request_data {
4025f207b83SAxel Dörfler	media_addon_id			add_on_id;
4035f207b83SAxel Dörfler	int32					flavor_id;
4045f207b83SAxel Dörfler	int32					delta; // must be +1 or -1
4055f207b83SAxel Dörfler	team_id					team;
4065f207b83SAxel Dörfler};
4075f207b83SAxel Dörfler
4085f207b83SAxel Dörflerstruct server_change_flavor_instances_count_reply : reply_data {
4095f207b83SAxel Dörfler};
4105f207b83SAxel Dörfler
4115f207b83SAxel Dörflerstruct server_register_node_request : request_data {
4125f207b83SAxel Dörfler	media_addon_id			add_on_id;
4135f207b83SAxel Dörfler	int32					flavor_id;
4147bcdb362SDario Casalinuovo	media_node_id			timesource_id;
4155f207b83SAxel Dörfler	char					name[B_MEDIA_NAME_LENGTH];
4165f207b83SAxel Dörfler	uint64					kinds;
4175f207b83SAxel Dörfler	port_id					port;
4185f207b83SAxel Dörfler	team_id					team;
4195f207b83SAxel Dörfler};
4205f207b83SAxel Dörfler
4215f207b83SAxel Dörflerstruct server_register_node_reply : reply_data {
4225f207b83SAxel Dörfler	media_node_id			node_id;
4235f207b83SAxel Dörfler};
4245f207b83SAxel Dörfler
4255f207b83SAxel Dörflerstruct server_unregister_node_request : request_data {
4265f207b83SAxel Dörfler	media_node_id			node_id;
4275f207b83SAxel Dörfler	team_id					team;
4285f207b83SAxel Dörfler};
4295f207b83SAxel Dörfler
4305f207b83SAxel Dörflerstruct server_unregister_node_reply : reply_data {
4315f207b83SAxel Dörfler	media_addon_id			add_on_id;
4325f207b83SAxel Dörfler	int32					flavor_id;
4335f207b83SAxel Dörfler};
4345f207b83SAxel Dörfler
4355f207b83SAxel Dörflerstruct server_get_live_node_info_request : request_data {
4365f207b83SAxel Dörfler	media_node				node;
4375f207b83SAxel Dörfler};
4385f207b83SAxel Dörfler
4395f207b83SAxel Dörflerstruct server_get_live_node_info_reply : reply_data {
4405f207b83SAxel Dörfler	live_node_info			live_info;
4415f207b83SAxel Dörfler};
4425f207b83SAxel Dörfler
4435f207b83SAxel Dörflerstruct server_get_live_nodes_request : request_area_data {
4445f207b83SAxel Dörfler	int32					max_count;
4455f207b83SAxel Dörfler	bool					has_input;
4465f207b83SAxel Dörfler	bool					has_output;
4475f207b83SAxel Dörfler	bool					has_name;
4485f207b83SAxel Dörfler	media_format			input_format;
4495f207b83SAxel Dörfler	media_format			output_format;
4505f207b83SAxel Dörfler	char					name[B_MEDIA_NAME_LENGTH + 1];
4515f207b83SAxel Dörfler								// +1 for a trailing "*"
4525f207b83SAxel Dörfler	uint64					require_kinds;
4535f207b83SAxel Dörfler};
4545f207b83SAxel Dörfler
4555f207b83SAxel Dörflerstruct server_get_live_nodes_reply : area_reply_data {
4565f207b83SAxel Dörfler	int32					count;
4575f207b83SAxel Dörfler		// if count > MAX_LIVE_INFO, live_node_infos are in the area
4585f207b83SAxel Dörfler		// area is created in the server, but deleted in the library
4595f207b83SAxel Dörfler	live_node_info			live_info[MAX_LIVE_INFO];
4605f207b83SAxel Dörfler};
4615f207b83SAxel Dörfler
4625f207b83SAxel Dörflerstruct server_node_id_for_request : request_data {
4635f207b83SAxel Dörfler	port_id					port;
4645f207b83SAxel Dörfler};
4655f207b83SAxel Dörfler
4665f207b83SAxel Dörflerstruct server_node_id_for_reply : reply_data {
4675f207b83SAxel Dörfler	media_node_id			node_id;
4685f207b83SAxel Dörfler};
4695f207b83SAxel Dörfler
4705f207b83SAxel Dörflerstruct server_get_node_for_request : request_data {
4715f207b83SAxel Dörfler	media_node_id			node_id;
4725f207b83SAxel Dörfler	team_id					team;
4735f207b83SAxel Dörfler};
4745f207b83SAxel Dörfler
4755f207b83SAxel Dörflerstruct server_get_node_for_reply : reply_data {
4765f207b83SAxel Dörfler	media_node				clone;
4775f207b83SAxel Dörfler};
4785f207b83SAxel Dörfler
4795f207b83SAxel Dörflerstruct server_release_node_request : request_data {
4805f207b83SAxel Dörfler	media_node				node;
4815f207b83SAxel Dörfler	team_id					team;
4825f207b83SAxel Dörfler};
4835f207b83SAxel Dörfler
4845f207b83SAxel Dörflerstruct server_release_node_reply : reply_data {
4855f207b83SAxel Dörfler};
4865f207b83SAxel Dörfler
4875f207b83SAxel Dörflerstruct server_get_dormant_node_for_request : request_data {
4885f207b83SAxel Dörfler	media_node				node;
4895f207b83SAxel Dörfler};
4905f207b83SAxel Dörfler
4915f207b83SAxel Dörflerstruct server_get_dormant_node_for_reply : reply_data {
4925f207b83SAxel Dörfler	dormant_node_info		node_info;
4935f207b83SAxel Dörfler};
4945f207b83SAxel Dörfler
4955f207b83SAxel Dörflerstruct server_get_instances_for_request : request_data {
4965f207b83SAxel Dörfler	media_addon_id			add_on_id;
4975f207b83SAxel Dörfler	int32					flavor_id;
4985f207b83SAxel Dörfler	int32					max_count;
4995f207b83SAxel Dörfler};
5005f207b83SAxel Dörfler
5015f207b83SAxel Dörflerstruct server_get_instances_for_reply : reply_data {
5025f207b83SAxel Dörfler	int32					count;
5035f207b83SAxel Dörfler	media_node_id			node_id[MAX_NODE_ID];
5045f207b83SAxel Dörfler		// no area here, MAX_NODE_ID is really large
5055f207b83SAxel Dörfler};
5065f207b83SAxel Dörfler
5075f207b83SAxel Dörflerstruct server_rescan_defaults_command : command_data {
5085f207b83SAxel Dörfler};
5095f207b83SAxel Dörfler
5105f207b83SAxel Dörflerstruct server_register_add_on_request : request_data {
5115f207b83SAxel Dörfler	xfer_entry_ref			ref;
5125f207b83SAxel Dörfler};
5135f207b83SAxel Dörfler
5145f207b83SAxel Dörflerstruct server_register_add_on_reply : reply_data {
5155f207b83SAxel Dörfler	media_addon_id			add_on_id;
5165f207b83SAxel Dörfler};
5175f207b83SAxel Dörfler
5185f207b83SAxel Dörflerstruct server_unregister_add_on_command : command_data {
5195f207b83SAxel Dörfler	media_addon_id			add_on_id;
5205f207b83SAxel Dörfler};
5215f207b83SAxel Dörfler
5225f207b83SAxel Dörflerstruct server_get_add_on_ref_request : request_data {
5235f207b83SAxel Dörfler	media_addon_id			add_on_id;
5245f207b83SAxel Dörfler};
5255f207b83SAxel Dörfler
5265f207b83SAxel Dörflerstruct server_get_add_on_ref_reply : reply_data {
5275f207b83SAxel Dörfler	xfer_entry_ref			ref;
5285f207b83SAxel Dörfler};
5295f207b83SAxel Dörfler
5305f207b83SAxel Dörflerstruct server_get_shared_buffer_area_request : request_data {
5315f207b83SAxel Dörfler};
5325f207b83SAxel Dörfler
5335f207b83SAxel Dörflerstruct server_get_shared_buffer_area_reply : area_reply_data {
5345f207b83SAxel Dörfler};
5355f207b83SAxel Dörfler
5365f207b83SAxel Dörflerstruct server_register_buffer_request : request_data {
5375f207b83SAxel Dörfler	team_id					team;
5385f207b83SAxel Dörfler	buffer_clone_info		info;
5395f207b83SAxel Dörfler		// either info.buffer is != 0, or the area, size, offset is used
5405f207b83SAxel Dörfler};
5415f207b83SAxel Dörfler
5425f207b83SAxel Dörflerstruct server_register_buffer_reply : reply_data {
5435f207b83SAxel Dörfler	buffer_clone_info		info;
5445f207b83SAxel Dörfler};
5455f207b83SAxel Dörfler
5465f207b83SAxel Dörflerstruct server_unregister_buffer_command : command_data {
5475f207b83SAxel Dörfler	team_id					team;
5485f207b83SAxel Dörfler	media_buffer_id			buffer_id;
5495f207b83SAxel Dörfler};
5505f207b83SAxel Dörfler
5515f207b83SAxel Dörflerstruct server_get_media_types_request : request_area_data {
5525f207b83SAxel Dörfler};
5535f207b83SAxel Dörfler
5545f207b83SAxel Dörflerstruct server_get_media_types_reply : area_reply_data {
5555f207b83SAxel Dörfler	int32					count;
5565f207b83SAxel Dörfler};
5575f207b83SAxel Dörfler
5585f207b83SAxel Dörflerstruct server_get_media_items_request : request_area_data {
5595f207b83SAxel Dörfler	char					type[B_MEDIA_NAME_LENGTH];
5605f207b83SAxel Dörfler};
5615f207b83SAxel Dörfler
5625f207b83SAxel Dörflerstruct server_get_media_items_reply : area_reply_data {
5635f207b83SAxel Dörfler	int32					count;
5645f207b83SAxel Dörfler};
5655f207b83SAxel Dörfler
5665f207b83SAxel Dörflerstruct server_get_ref_for_request : request_data {
5675f207b83SAxel Dörfler	char					type[B_MEDIA_NAME_LENGTH];
5685f207b83SAxel Dörfler	char					item[B_MEDIA_NAME_LENGTH];
5695f207b83SAxel Dörfler};
5705f207b83SAxel Dörfler
5715f207b83SAxel Dörflerstruct server_get_ref_for_reply : reply_data {
5725f207b83SAxel Dörfler	xfer_entry_ref			ref;
5735f207b83SAxel Dörfler};
5745f207b83SAxel Dörfler
5755f207b83SAxel Dörflerstruct server_set_ref_for_request : request_data {
5765f207b83SAxel Dörfler	char					type[B_MEDIA_NAME_LENGTH];
5775f207b83SAxel Dörfler	char					item[B_MEDIA_NAME_LENGTH];
5785f207b83SAxel Dörfler	xfer_entry_ref			ref;
5795f207b83SAxel Dörfler};
5805f207b83SAxel Dörfler
5815f207b83SAxel Dörflerstruct server_set_ref_for_reply : reply_data {
5825f207b83SAxel Dörfler};
5835f207b83SAxel Dörfler
5845f207b83SAxel Dörflerstruct server_invalidate_item_request : request_data {
5855f207b83SAxel Dörfler	char					type[B_MEDIA_NAME_LENGTH];
5865f207b83SAxel Dörfler	char					item[B_MEDIA_NAME_LENGTH];
5875f207b83SAxel Dörfler};
5885f207b83SAxel Dörfler
5895f207b83SAxel Dörflerstruct server_invalidate_item_reply : reply_data {
5905f207b83SAxel Dörfler};
5915f207b83SAxel Dörfler
5925f207b83SAxel Dörflerstruct server_remove_media_item_request : request_data {
5935f207b83SAxel Dörfler	char					type[B_MEDIA_NAME_LENGTH];
5945f207b83SAxel Dörfler	char					item[B_MEDIA_NAME_LENGTH];
5955f207b83SAxel Dörfler};
5965f207b83SAxel Dörfler
5975f207b83SAxel Dörflerstruct server_remove_media_item_reply : reply_data {
5985f207b83SAxel Dörfler};
5995f207b83SAxel Dörfler
6005f207b83SAxel Dörflerstruct server_get_item_audio_gain_request : request_data {
6015f207b83SAxel Dörfler	char					type[B_MEDIA_NAME_LENGTH];
6025f207b83SAxel Dörfler	char					item[B_MEDIA_NAME_LENGTH];
6035f207b83SAxel Dörfler};
6045f207b83SAxel Dörfler
6055f207b83SAxel Dörflerstruct server_get_item_audio_gain_reply : reply_data {
6065f207b83SAxel Dörfler	float					gain;
6075f207b83SAxel Dörfler};
6085f207b83SAxel Dörfler
6095f207b83SAxel Dörflerstruct server_set_item_audio_gain_request : request_data {
6105f207b83SAxel Dörfler	char					type[B_MEDIA_NAME_LENGTH];
6115f207b83SAxel Dörfler	char					item[B_MEDIA_NAME_LENGTH];
6125f207b83SAxel Dörfler	float					gain;
6135f207b83SAxel Dörfler};
6145f207b83SAxel Dörfler
6155f207b83SAxel Dörflerstruct server_set_item_audio_gain_reply : reply_data {
6169dec2310SAxel Dörfler};
6179dec2310SAxel Dörfler
6189dec2310SAxel Dörfler
619e4c87231SAxel Dörflerstruct server_get_dormant_flavor_info_request : request_data {
6201fcbc547SAxel Dörfler	media_addon_id	add_on_id;
6219dec2310SAxel Dörfler	int32			flavor_id;
6229dec2310SAxel Dörfler};
6239dec2310SAxel Dörfler
624e4c87231SAxel Dörflerstruct server_get_dormant_flavor_info_reply : reply_data {
6259dec2310SAxel Dörfler	type_code		type; // the flatten type_code
6269dec2310SAxel Dörfler	size_t 			flattened_size;
6279dec2310SAxel Dörfler	char 			flattened_data[1];
6289dec2310SAxel Dörfler		// a flattened dormant_flavor_info, flattened_size large
6299dec2310SAxel Dörfler};
6309dec2310SAxel Dörfler
631e4c87231SAxel Dörflerstruct server_get_dormant_nodes_request : request_data {
6329dec2310SAxel Dörfler	int32			max_count;
6339dec2310SAxel Dörfler	bool			has_input;
6349dec2310SAxel Dörfler	media_format	input_format;
6359dec2310SAxel Dörfler	bool			has_output;
6369dec2310SAxel Dörfler	media_format	output_format;
6379dec2310SAxel Dörfler	bool			has_name;
6389dec2310SAxel Dörfler	char			name[B_MEDIA_NAME_LENGTH + 1]; // 1 for a trailing "*"
6399dec2310SAxel Dörfler	uint64			require_kinds;
6409dec2310SAxel Dörfler	uint64			deny_kinds;
6419dec2310SAxel Dörfler};
6429dec2310SAxel Dörfler
643e4c87231SAxel Dörflerstruct server_get_dormant_nodes_reply : reply_data {
6449dec2310SAxel Dörfler	int32			count;
6459dec2310SAxel Dörfler		// if count > 0, a second reply containing count dormant_node_infos
6469dec2310SAxel Dörfler		// is send
6479dec2310SAxel Dörfler};
6489dec2310SAxel Dörfler
649e4c87231SAxel Dörflerstruct server_register_dormant_node_command : command_data {
6509dec2310SAxel Dörfler	media_addon_id	purge_id;
6519dec2310SAxel Dörfler		// if > 0, server must first remove all dormant_flavor_infos
6529dec2310SAxel Dörfler		// belonging to that id
6539dec2310SAxel Dörfler	type_code		type; // the flatten type_code
6549dec2310SAxel Dörfler	size_t 			flattened_size;
6559dec2310SAxel Dörfler	char 			flattened_data[1];
6569dec2310SAxel Dörfler		// a flattened dormant_flavor_info, flattened_size large
6579dec2310SAxel Dörfler};
6589dec2310SAxel Dörfler
6597bcdb362SDario Casalinuovostruct server_set_node_timesource_request : request_data {
6607bcdb362SDario Casalinuovo	media_node_id			node_id;
6617bcdb362SDario Casalinuovo	media_node_id			timesource_id;
6627bcdb362SDario Casalinuovo};
6637bcdb362SDario Casalinuovo
6647bcdb362SDario Casalinuovostruct server_set_node_timesource_reply : reply_data {
6657bcdb362SDario Casalinuovo};
6667bcdb362SDario Casalinuovo
6675f207b83SAxel Dörfler
6685f207b83SAxel Dörfler// #pragma mark - buffer producer commands
6695f207b83SAxel Dörfler
6705f207b83SAxel Dörfler
6715f207b83SAxel Dörflerstruct producer_format_proposal_request : public request_data {
6725f207b83SAxel Dörfler	media_source			output;
6735f207b83SAxel Dörfler	media_format			format;
6745f207b83SAxel Dörfler};
6755f207b83SAxel Dörfler
6765f207b83SAxel Dörflerstruct producer_format_proposal_reply : reply_data {
6775f207b83SAxel Dörfler	media_format			format;
6785f207b83SAxel Dörfler};
6795f207b83SAxel Dörfler
6805f207b83SAxel Dörflerstruct producer_prepare_to_connect_request : request_data {
6815f207b83SAxel Dörfler	media_source			source;
6825f207b83SAxel Dörfler	media_destination		destination;
6835f207b83SAxel Dörfler	media_format			format;
6845f207b83SAxel Dörfler	char					name[B_MEDIA_NAME_LENGTH];
6855f207b83SAxel Dörfler};
6865f207b83SAxel Dörfler
6875f207b83SAxel Dörflerstruct producer_prepare_to_connect_reply : reply_data {
6885f207b83SAxel Dörfler	media_format			format;
6895f207b83SAxel Dörfler	media_source			out_source;
6905f207b83SAxel Dörfler	char					name[B_MEDIA_NAME_LENGTH];
6915f207b83SAxel Dörfler};
6925f207b83SAxel Dörfler
6935f207b83SAxel Dörflerstruct producer_connect_request : request_data {
6945f207b83SAxel Dörfler	status_t				error;
6955f207b83SAxel Dörfler	media_source			source;
6965f207b83SAxel Dörfler	media_destination		destination;
6975f207b83SAxel Dörfler	media_format			format;
6985f207b83SAxel Dörfler	char					name[B_MEDIA_NAME_LENGTH];
6995f207b83SAxel Dörfler};
7005f207b83SAxel Dörfler
7015f207b83SAxel Dörflerstruct producer_connect_reply : reply_data {
7025f207b83SAxel Dörfler	char					name[B_MEDIA_NAME_LENGTH];
7035f207b83SAxel Dörfler};
7045f207b83S