2003-03-02 14:38:34 +03:00
|
|
|
/*
|
2003-03-11 23:38:00 +03:00
|
|
|
* Definitions for the communications protocol between libmidi2.so
|
|
|
|
* and the midi_server.
|
2002-12-31 17:26:15 +03:00
|
|
|
*
|
2003-03-02 14:38:34 +03:00
|
|
|
* Copyright (c) 2002-2003 Matthijs Hollemans
|
2003-03-11 23:38:00 +03:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
2002-12-31 17:26:15 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MIDI_PROTOCOL_H
|
|
|
|
#define MIDI_PROTOCOL_H
|
|
|
|
|
2003-03-02 14:41:50 +03:00
|
|
|
// MIME signature of the midi_server application.
|
2004-06-25 12:47:00 +04:00
|
|
|
#define MIDI_SERVER_SIGNATURE "application/x-vnd.haiku.midi-server"
|
2002-12-31 17:26:15 +03:00
|
|
|
|
2003-03-02 14:41:50 +03:00
|
|
|
// Timeout for delivering and responding to messages (microseconds).
|
2002-12-31 17:26:15 +03:00
|
|
|
#define TIMEOUT 2000000
|
|
|
|
|
2003-03-02 14:41:50 +03:00
|
|
|
// Received when a new app starts using the Midi Kit.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_REGISTER_APP 'Mapp'
|
|
|
|
|
2003-03-02 14:41:50 +03:00
|
|
|
// Sent when we have completed a "register app" request.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_APP_REGISTERED 'mAPP'
|
|
|
|
|
2003-03-02 14:41:50 +03:00
|
|
|
// Received when an app creates a new local endpoint.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_CREATE_ENDPOINT 'Mnew'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Sent to all other applications when an app creates a
|
|
|
|
// new endpoint. Also sent when an application registers
|
|
|
|
// with the midi_server (MSG_REGISTER_APP).
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_ENDPOINT_CREATED 'mNEW'
|
|
|
|
|
2003-03-02 14:41:50 +03:00
|
|
|
// Received when an app deletes a local endpoint.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_DELETE_ENDPOINT 'Mdel'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// The midi_server sends this message to itself when an app
|
|
|
|
// dies and its endpoints must be removed from the roster.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_PURGE_ENDPOINT 'Mdie'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Sent to all applications when an endpoint is deleted,
|
|
|
|
// either by the app that owned it, or by the midi_server
|
|
|
|
// if the owner app has died.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_ENDPOINT_DELETED 'mDEL'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Received when an app changes the attributes of one
|
|
|
|
// of its local endpoints.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_CHANGE_ENDPOINT 'Mchg'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Sent to all other applications when an app changes
|
|
|
|
// the attributes of one of its local endpoints.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_ENDPOINT_CHANGED 'mCHG'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Received when an app wants to establish a connection
|
|
|
|
// between a producer and a consumer.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_CONNECT_ENDPOINTS 'Mcon'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Sent to all other applications when an app establishes
|
|
|
|
// a connection between a producer and a consumer. Like
|
|
|
|
// MSG_ENDPOINT_CREATED, this notification is also sent to
|
|
|
|
// applications when they register with the midi_server.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_ENDPOINTS_CONNECTED 'mCON'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Received when an app wants to break a connection
|
|
|
|
// between a producer and a consumer.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_DISCONNECT_ENDPOINTS 'Mdis'
|
|
|
|
|
2003-03-02 14:38:34 +03:00
|
|
|
// Sent to all other applications when an app breaks
|
|
|
|
// a connection between a producer and a consumer.
|
2002-12-31 17:26:15 +03:00
|
|
|
#define MSG_ENDPOINTS_DISCONNECTED 'mDIS'
|
|
|
|
|
|
|
|
#endif // MIDI_PROTOCOL_H
|