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 26 #ifndef MIDI_PROTOCOL_H 27 #define MIDI_PROTOCOL_H 28 29 // MIME signature of the midi_server application. 30 #define MIDI_SERVER_SIGNATURE "application/x-vnd.haiku.midi-server" 31 32 // Timeout for delivering and responding to messages (microseconds). 33 #define TIMEOUT 2000000 34 35 // Received when a new app starts using the Midi Kit. 36 #define MSG_REGISTER_APP 'Mapp' 37 38 // Sent when we have completed a "register app" request. 39 #define MSG_APP_REGISTERED 'mAPP' 40 41 // Received when an app creates a new local endpoint. 42 #define MSG_CREATE_ENDPOINT 'Mnew' 43 44 // Sent to all other applications when an app creates a 45 // new endpoint. Also sent when an application registers 46 // with the midi_server (MSG_REGISTER_APP). 47 #define MSG_ENDPOINT_CREATED 'mNEW' 48 49 // Received when an app deletes a local endpoint. 50 #define MSG_DELETE_ENDPOINT 'Mdel' 51 52 // The midi_server sends this message to itself when an app 53 // dies and its endpoints must be removed from the roster. 54 #define MSG_PURGE_ENDPOINT 'Mdie' 55 56 // Sent to all applications when an endpoint is deleted, 57 // either by the app that owned it, or by the midi_server 58 // if the owner app has died. 59 #define MSG_ENDPOINT_DELETED 'mDEL' 60 61 // Received when an app changes the attributes of one 62 // of its local endpoints. 63 #define MSG_CHANGE_ENDPOINT 'Mchg' 64 65 // Sent to all other applications when an app changes 66 // the attributes of one of its local endpoints. 67 #define MSG_ENDPOINT_CHANGED 'mCHG' 68 69 // Received when an app wants to establish a connection 70 // between a producer and a consumer. 71 #define MSG_CONNECT_ENDPOINTS 'Mcon' 72 73 // Sent to all other applications when an app establishes 74 // a connection between a producer and a consumer. Like 75 // MSG_ENDPOINT_CREATED, this notification is also sent to 76 // applications when they register with the midi_server. 77 #define MSG_ENDPOINTS_CONNECTED 'mCON' 78 79 // Received when an app wants to break a connection 80 // between a producer and a consumer. 81 #define MSG_DISCONNECT_ENDPOINTS 'Mdis' 82 83 // Sent to all other applications when an app breaks 84 // a connection between a producer and a consumer. 85 #define MSG_ENDPOINTS_DISCONNECTED 'mDIS' 86 87 #endif // MIDI_PROTOCOL_H 88