- add sources.
[platform/framework/web/crosswalk.git] / src / content / common / media / midi_messages.h
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // IPC messages for access to MIDI hardware.
6 // Multiply-included message file, hence no include guard.
7
8 #include "base/basictypes.h"
9 #include "content/common/content_export.h"
10 #include "ipc/ipc_message_macros.h"
11 #include "media/midi/midi_port_info.h"
12 #include "url/gurl.h"
13
14 #undef IPC_MESSAGE_EXPORT
15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
16 #define IPC_MESSAGE_START MIDIMsgStart
17
18 IPC_STRUCT_TRAITS_BEGIN(media::MIDIPortInfo)
19   IPC_STRUCT_TRAITS_MEMBER(id)
20   IPC_STRUCT_TRAITS_MEMBER(manufacturer)
21   IPC_STRUCT_TRAITS_MEMBER(name)
22   IPC_STRUCT_TRAITS_MEMBER(version)
23 IPC_STRUCT_TRAITS_END()
24
25 // Messages for IPC between MIDIDispatcher and MIDIDispatcherHost.
26
27 // Renderer request to browser for using system exclusive messages.
28 IPC_MESSAGE_CONTROL3(MIDIHostMsg_RequestSysExPermission,
29                      int /* routing id */,
30                      int /* client id */,
31                      GURL /* origin */)
32
33 // Renderer request to browser for canceling a previous permission request.
34 IPC_MESSAGE_CONTROL3(MIDIHostMsg_CancelSysExPermissionRequest,
35                      int /* render_view_id */,
36                      int /* bridge_id */,
37                      GURL /* GURL of the frame */)
38
39 // Messages sent from the browser to the renderer.
40
41 IPC_MESSAGE_ROUTED2(MIDIMsg_SysExPermissionApproved,
42                     int /* client id */,
43                     bool /* success */)
44
45 // Messages for IPC between MIDIMessageFilter and MIDIHost.
46
47 // Renderer request to browser for access to MIDI services.
48 IPC_MESSAGE_CONTROL1(MIDIHostMsg_StartSession,
49                      int /* client id */)
50
51 IPC_MESSAGE_CONTROL3(MIDIHostMsg_SendData,
52                      uint32 /* port */,
53                      std::vector<uint8> /* data */,
54                      double /* timestamp */)
55
56 // Messages sent from the browser to the renderer.
57
58 IPC_MESSAGE_CONTROL4(MIDIMsg_SessionStarted,
59                      int /* client id */,
60                      bool /* success */,
61                      media::MIDIPortInfoList /* input ports */,
62                      media::MIDIPortInfoList /* output ports */)
63
64 IPC_MESSAGE_CONTROL3(MIDIMsg_DataReceived,
65                      uint32 /* port */,
66                      std::vector<uint8> /* data */,
67                      double /* timestamp */)
68
69 IPC_MESSAGE_CONTROL1(MIDIMsg_AcknowledgeSentData,
70                      uint32 /* bytes sent */)