xref: /haiku/headers/private/media/DataExchange.h (revision e66fda405a88e6125bf6617b15e3c32cb44f675c)
1 /*
2  * Copyright 2002, Marcus Overhagen. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #ifndef _DATA_EXCHANGE_H
7 #define _DATA_EXCHANGE_H
8 
9 #include <MediaDefs.h>
10 #include <MediaNode.h>
11 #include <MediaAddOn.h>
12 #include <Entry.h>
13 
14 namespace BPrivate {
15 namespace media {
16 namespace dataexchange {
17 
18 struct reply_data;
19 struct request_data;
20 
21 // BMessage based data exchange with the media_server
22 status_t SendToServer(BMessage *msg);
23 status_t QueryServer(BMessage *request, BMessage *reply);
24 
25 // Raw data based data exchange with the media_server
26 status_t SendToServer(int32 msgcode, void *msg, int size);
27 status_t QueryServer(int32 msgcode, request_data *request, int requestsize, reply_data *reply, int replysize);
28 
29 // Raw data based data exchange with the media_addon_server
30 status_t SendToAddonServer(int32 msgcode, void *msg, int size);
31 status_t QueryAddonServer(int32 msgcode, request_data *request, int requestsize, reply_data *reply, int replysize);
32 
33 // Raw data based data exchange with the media_server
34 status_t SendToPort(port_id sendport, int32 msgcode, void *msg, int size);
35 status_t QueryPort(port_id requestport, int32 msgcode, request_data *request, int requestsize, reply_data *reply, int replysize);
36 
37 // The base struct used for all raw requests
38 struct request_data
39 {
40 	port_id reply_port;
41 
42 	void SendReply(reply_data *reply, int replysize) const;
43 };
44 
45 // The base struct used for all raw replys
46 struct reply_data
47 {
48 	status_t result;
49 };
50 
51 
52 }; // dataexchange
53 }; // media
54 }; // BPrivate
55 
56 using namespace BPrivate::media::dataexchange;
57 
58 enum {
59 
60 	// BMediaRoster notification service
61 	MEDIA_SERVER_REQUEST_NOTIFICATIONS = 1000,
62 	MEDIA_SERVER_CANCEL_NOTIFICATIONS,
63 	MEDIA_SERVER_SEND_NOTIFICATIONS
64 
65 };
66 
67 struct request_addonserver_instantiate_dormant_node : public request_data
68 {
69 	dormant_node_info info;
70 };
71 
72 struct reply_addonserver_instantiate_dormant_node : public reply_data
73 {
74 	media_node node;
75 };
76 
77 
78 #endif // _DATA_EXCHANGE_H
79