configure: Improve detection of ibtool
[vlc.git] / modules / audio_output / windows_audio_common.h
blob167710d4d714daeff035f923af9dd3c1a7203c93
1 /*****************************************************************************
2 * windows_audio_common.h: Windows Audio common code
3 *****************************************************************************
4 * Copyright (C) 2001-2009 VideoLAN
5 * $Id$
7 * Authors: Gildas Bazin <gbazin@videolan.org>
8 * Jean-Baptiste Kempf <jb@videolan.org>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #include <windows.h>
26 #include <mmsystem.h>
28 /*****************************************************************************
29 * DirectSound GUIDs.
30 * Defining them here allows us to get rid of the dxguid library during
31 * the linking stage.
32 *****************************************************************************/
34 #define INITGUID /* Doesn't define the DEFINE_GUID as extern */
35 #include <initguid.h>
37 #include <vlc_codecs.h>
39 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, WAVE_FORMAT_IEEE_FLOAT, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
40 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_PCM, WAVE_FORMAT_PCM, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
41 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
43 static const GUID __KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = {WAVE_FORMAT_IEEE_FLOAT, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
44 static const GUID __KSDATAFORMAT_SUBTYPE_PCM = {WAVE_FORMAT_PCM, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
45 static const GUID __KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF = {WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
47 #define FRAMES_NUM 8 /* Needs to be > 3 */
49 #include <dsound.h>
51 #ifndef SPEAKER_FRONT_LEFT
52 # define SPEAKER_FRONT_LEFT 0x1
53 # define SPEAKER_FRONT_RIGHT 0x2
54 # define SPEAKER_FRONT_CENTER 0x4
55 # define SPEAKER_LOW_FREQUENCY 0x8
56 # define SPEAKER_BACK_LEFT 0x10
57 # define SPEAKER_BACK_RIGHT 0x20
58 # define SPEAKER_FRONT_LEFT_OF_CENTER 0x40
59 # define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80
60 # define SPEAKER_BACK_CENTER 0x100
61 # define SPEAKER_SIDE_LEFT 0x200
62 # define SPEAKER_SIDE_RIGHT 0x400
63 # define SPEAKER_TOP_CENTER 0x800
64 # define SPEAKER_TOP_FRONT_LEFT 0x1000
65 # define SPEAKER_TOP_FRONT_CENTER 0x2000
66 # define SPEAKER_TOP_FRONT_RIGHT 0x4000
67 # define SPEAKER_TOP_BACK_LEFT 0x8000
68 # define SPEAKER_TOP_BACK_CENTER 0x10000
69 # define SPEAKER_TOP_BACK_RIGHT 0x20000
70 # define SPEAKER_RESERVED 0x80000000
71 #endif
73 #ifndef DSSPEAKER_DSSPEAKER_DIRECTOUT
74 # define DSSPEAKER_DSSPEAKER_DIRECTOUT 0x00000000
75 #endif
76 #ifndef DSSPEAKER_HEADPHONE
77 # define DSSPEAKER_HEADPHONE 0x00000001
78 #endif
79 #ifndef DSSPEAKER_MONO
80 # define DSSPEAKER_MONO 0x00000002
81 #endif
82 #ifndef DSSPEAKER_QUAD
83 # define DSSPEAKER_QUAD 0x00000003
84 #endif
85 #ifndef DSSPEAKER_STEREO
86 # define DSSPEAKER_STEREO 0x00000004
87 #endif
88 #ifndef DSSPEAKER_SURROUND
89 # define DSSPEAKER_SURROUND 0x00000005
90 #endif
91 #ifndef DSSPEAKER_5POINT1
92 # define DSSPEAKER_5POINT1 0x00000006
93 #endif
94 #ifndef DSSPEAKER_5POINT1_BACK
95 # define DSSPEAKER_5POINT1_BACK DSSPEAKER_5POINT1
96 #endif
97 #ifndef DSSPEAKER_7POINT1
98 # define DSSPEAKER_7POINT1 0x00000007
99 #endif
100 #ifndef DSSPEAKER_7POINT1_SURROUND
101 # define DSSPEAKER_7POINT1_SURROUND 0x00000008
102 #endif
103 #ifndef DSSPEAKER_5POINT1_SURROUND
104 # define DSSPEAKER_5POINT1_SURROUND 0x00000009
105 #endif
106 #ifndef DSSPEAKER_7POINT1_WIDE
107 # define DSSPEAKER_7POINT1_WIDE DSSPEAKER_7POINT1
108 #endif
110 static const uint32_t pi_channels_in[] =
111 { SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT,
112 SPEAKER_SIDE_LEFT, SPEAKER_SIDE_RIGHT,
113 SPEAKER_BACK_LEFT, SPEAKER_BACK_RIGHT, SPEAKER_BACK_CENTER,
114 SPEAKER_FRONT_CENTER, SPEAKER_LOW_FREQUENCY, 0 };
115 static const uint32_t pi_channels_out[] =
116 { SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT,
117 SPEAKER_FRONT_CENTER, SPEAKER_LOW_FREQUENCY,
118 SPEAKER_BACK_LEFT, SPEAKER_BACK_RIGHT,
119 SPEAKER_BACK_CENTER,
120 SPEAKER_SIDE_LEFT, SPEAKER_SIDE_RIGHT, 0 };
122 #define FLOAT_TEXT N_("Use float32 output")
123 #define FLOAT_LONGTEXT N_( \
124 "The option allows you to enable or disable the high-quality float32 " \
125 "audio output mode (which is not well supported by some soundcards)." )