Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / channels / rdpsnd / rdpsnd_main.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol client.
3  * Audio Output Virtual Channel
4  *
5  * Copyright 2010-2011 Vic Lee
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __RDPSND_MAIN_H
21 #define __RDPSND_MAIN_H
22
23 typedef struct rdpsnd_plugin rdpsndPlugin;
24
25 typedef struct rdpsnd_format rdpsndFormat;
26 struct rdpsnd_format
27 {
28         uint16 wFormatTag;
29         uint16 nChannels;
30         uint32 nSamplesPerSec;
31         uint16 nBlockAlign;
32         uint16 wBitsPerSample;
33         uint16 cbSize;
34         uint8* data;
35 };
36
37 typedef struct rdpsnd_device_plugin rdpsndDevicePlugin;
38
39 typedef boolean (*pcFormatSupported) (rdpsndDevicePlugin* device, rdpsndFormat* format);
40 typedef void (*pcOpen) (rdpsndDevicePlugin* device, rdpsndFormat* format, int latency);
41 typedef void (*pcSetFormat) (rdpsndDevicePlugin* device, rdpsndFormat* format, int latency);
42 typedef void (*pcSetVolume) (rdpsndDevicePlugin* device, uint32 value);
43 typedef void (*pcPlay) (rdpsndDevicePlugin* device, uint8* data, int size);
44 typedef void (*pcStart) (rdpsndDevicePlugin* device);
45 typedef void (*pcClose) (rdpsndDevicePlugin* device);
46 typedef void (*pcFree) (rdpsndDevicePlugin* device);
47
48 struct rdpsnd_device_plugin
49 {
50         pcFormatSupported FormatSupported;
51         pcOpen Open;
52         pcSetFormat SetFormat;
53         pcSetVolume SetVolume;
54         pcPlay Play;
55         pcStart Start;
56         pcClose Close;
57         pcFree Free;
58 };
59
60 #define RDPSND_DEVICE_EXPORT_FUNC_NAME "FreeRDPRdpsndDeviceEntry"
61
62 typedef void (*PREGISTERRDPSNDDEVICE)(rdpsndPlugin* rdpsnd, rdpsndDevicePlugin* device);
63
64 struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS
65 {
66         rdpsndPlugin* rdpsnd;
67         PREGISTERRDPSNDDEVICE pRegisterRdpsndDevice;
68         RDP_PLUGIN_DATA* plugin_data;
69 };
70 typedef struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS FREERDP_RDPSND_DEVICE_ENTRY_POINTS;
71 typedef FREERDP_RDPSND_DEVICE_ENTRY_POINTS* PFREERDP_RDPSND_DEVICE_ENTRY_POINTS;
72
73 typedef int (*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints);
74
75 #endif /* __RDPSND_MAIN_H */
76