1/*
2 * Definitions for the communications protocol between libmidi2.so
3 * and the midi_server.
4 *
5 * Copyright (c) 2002-2003 Matthijs Hollemans
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25#ifndef MIDI_PROTOCOL_H
26#define MIDI_PROTOCOL_H
27
28// MIME signature of the midi_server application.
29#define MIDI_SERVER_SIGNATURE  "application/x-vnd.Haiku-midi_server"
30
31// Timeout for delivering and responding to messages (microseconds).
32#define TIMEOUT  2000000
33
34// Received when a new app starts using the Midi Kit.
35#define MSG_REGISTER_APP  'Mapp'
36
37// Sent when we have completed a "register app" request.
38#define MSG_APP_REGISTERED  'mAPP'
39
40// Received when an app creates a new local endpoint.
41#define MSG_CREATE_ENDPOINT  'Mnew'
42
43// Sent to all other applications when an app creates a
44// new endpoint. Also sent when an application registers
45// with the midi_server (MSG_REGISTER_APP).
46#define MSG_ENDPOINT_CREATED  'mNEW'
47
48// Received when an app deletes a local endpoint.
49#define MSG_DELETE_ENDPOINT  'Mdel'
50
51// The midi_server sends this message to itself when an app
52// dies and its endpoints must be removed from the roster.
53#define MSG_PURGE_ENDPOINT  'Mdie'
54
55// Sent to all applications when an endpoint is deleted,
56// either by the app that owned it, or by the midi_server
57// if the owner app has died.
58#define MSG_ENDPOINT_DELETED  'mDEL'
59
60// Received when an app changes the attributes of one
61// of its local endpoints.
62#define MSG_CHANGE_ENDPOINT  'Mchg'
63
64// Sent to all other applications when an app changes
65// the attributes of one of its local endpoints.
66#define MSG_ENDPOINT_CHANGED  'mCHG'
67
68// Received when an app wants to establish a connection
69// between a producer and a consumer.
70#define MSG_CONNECT_ENDPOINTS  'Mcon'
71
72// Sent to all other applications when an app establishes
73// a connection between a producer and a consumer. Like
74// MSG_ENDPOINT_CREATED, this notification is also sent to
75// applications when they register with the midi_server.
76#define MSG_ENDPOINTS_CONNECTED 'mCON'
77
78// Received when an app wants to break a connection
79// between a producer and a consumer.
80#define MSG_DISCONNECT_ENDPOINTS  'Mdis'
81
82// Sent to all other applications when an app breaks
83// a connection between a producer and a consumer.
84#define MSG_ENDPOINTS_DISCONNECTED 'mDIS'
85
86#endif // MIDI_PROTOCOL_H
87