2 * FreeRDP: A Remote Desktop Protocol client.
3 * Video Redirection Virtual Channel - Audio Device Manager
5 * Copyright 2010-2011 Vic Lee
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __TSMF_AUDIO_H
21 #define __TSMF_AUDIO_H
23 #include "drdynvc_types.h"
25 typedef struct _ITSMFAudioDevice ITSMFAudioDevice;
27 struct _ITSMFAudioDevice
29 /* Open the audio device. */
30 boolean (*Open) (ITSMFAudioDevice* audio, const char* device);
31 /* Set the audio data format. */
32 boolean (*SetFormat) (ITSMFAudioDevice* audio, uint32 sample_rate, uint32 channels, uint32 bits_per_sample);
33 /* Play audio data. */
34 boolean (*Play) (ITSMFAudioDevice* audio, uint8* data, uint32 data_size);
35 /* Get the latency of the last written sample, in 100ns */
36 uint64 (*GetLatency) (ITSMFAudioDevice* audio);
37 /* Flush queued audio data */
38 void (*Flush) (ITSMFAudioDevice* audio);
39 /* Free the audio device */
40 void (*Free) (ITSMFAudioDevice* audio);
43 #define TSMF_AUDIO_DEVICE_EXPORT_FUNC_NAME "TSMFAudioDeviceEntry"
44 typedef ITSMFAudioDevice* (*TSMF_AUDIO_DEVICE_ENTRY) (void);
46 ITSMFAudioDevice* tsmf_load_audio_device(const char* name, const char* device);