Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3ba100d8
Commit
3ba100d8
authored
Jan 06, 2015
by
Mark Harmstone
Committed by
Alexandre Julliard
Jan 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Support quadraphonic sound.
parent
b81e79ed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
3 deletions
+51
-3
dsound.c
dlls/dsound/dsound.c
+13
-0
dsound_convert.c
dlls/dsound/dsound_convert.c
+19
-0
dsound_private.h
dlls/dsound/dsound_private.h
+3
-1
mixer.c
dlls/dsound/mixer.c
+10
-1
primary.c
dlls/dsound/primary.c
+6
-1
No files found.
dlls/dsound/dsound.c
View file @
3ba100d8
...
...
@@ -606,6 +606,19 @@ void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device)
device
->
lfe_channel
=
-
1
;
break
;
case
DSSPEAKER_QUAD
:
device
->
speaker_angles
[
0
]
=
M_PI
/
180
.
0
f
*
-
135
.
0
f
;
device
->
speaker_angles
[
1
]
=
M_PI
/
180
.
0
f
*
-
45
.
0
f
;
device
->
speaker_angles
[
2
]
=
M_PI
/
180
.
0
f
*
45
.
0
f
;
device
->
speaker_angles
[
3
]
=
M_PI
/
180
.
0
f
*
135
.
0
f
;
device
->
speaker_num
[
0
]
=
2
;
/* Rear left */
device
->
speaker_num
[
1
]
=
0
;
/* Front left */
device
->
speaker_num
[
2
]
=
1
;
/* Front right */
device
->
speaker_num
[
3
]
=
3
;
/* Rear right */
device
->
num_speakers
=
4
;
device
->
lfe_channel
=
-
1
;
break
;
default:
WARN
(
"unknown speaker_config %u
\n
"
,
device
->
speaker_config
);
}
...
...
dlls/dsound/dsound_convert.c
View file @
3ba100d8
...
...
@@ -165,6 +165,25 @@ void put_mono2stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel
dsb
->
put_aux
(
dsb
,
pos
,
1
,
value
);
}
void
put_mono2quad
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
{
dsb
->
put_aux
(
dsb
,
pos
,
0
,
value
);
dsb
->
put_aux
(
dsb
,
pos
,
1
,
value
);
dsb
->
put_aux
(
dsb
,
pos
,
2
,
value
);
dsb
->
put_aux
(
dsb
,
pos
,
3
,
value
);
}
void
put_stereo2quad
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
{
if
(
channel
==
0
)
{
/* Left */
dsb
->
put_aux
(
dsb
,
pos
,
0
,
value
);
/* Front left */
dsb
->
put_aux
(
dsb
,
pos
,
2
,
value
);
/* Back left */
}
else
if
(
channel
==
1
)
{
/* Right */
dsb
->
put_aux
(
dsb
,
pos
,
1
,
value
);
/* Front right */
dsb
->
put_aux
(
dsb
,
pos
,
3
,
value
);
/* Back right */
}
}
void
mixieee32
(
float
*
src
,
float
*
dst
,
unsigned
samples
)
{
TRACE
(
"%p - %p %d
\n
"
,
src
,
dst
,
samples
);
...
...
dlls/dsound/dsound_private.h
View file @
3ba100d8
...
...
@@ -30,7 +30,7 @@
#include "wine/list.h"
#define DS_MAX_CHANNELS
2
#define DS_MAX_CHANNELS
4
extern
int
ds_hel_buflen
DECLSPEC_HIDDEN
;
extern
int
ds_snd_queue_max
DECLSPEC_HIDDEN
;
...
...
@@ -179,6 +179,8 @@ struct IDirectSoundBufferImpl
float
get_mono
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
)
DECLSPEC_HIDDEN
;
void
put_mono2stereo
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
DECLSPEC_HIDDEN
;
void
put_mono2quad
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
DECLSPEC_HIDDEN
;
void
put_stereo2quad
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
DECLSPEC_HIDDEN
;
HRESULT
IDirectSoundBufferImpl_Create
(
DirectSoundDevice
*
device
,
...
...
dlls/dsound/mixer.c
View file @
3ba100d8
...
...
@@ -151,13 +151,22 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb)
else
if
(
ichannels
==
1
)
{
dsb
->
mix_channels
=
1
;
dsb
->
put
=
put_mono2stereo
;
if
(
ochannels
==
2
)
dsb
->
put
=
put_mono2stereo
;
else
if
(
ochannels
==
4
)
dsb
->
put
=
put_mono2quad
;
}
else
if
(
ochannels
==
1
)
{
dsb
->
mix_channels
=
1
;
dsb
->
get
=
get_mono
;
}
else
if
(
ichannels
==
2
&&
ochannels
==
4
)
{
dsb
->
mix_channels
=
2
;
dsb
->
put
=
put_stereo2quad
;
}
else
{
if
(
ichannels
>
2
)
...
...
dlls/dsound/primary.c
View file @
3ba100d8
...
...
@@ -67,6 +67,9 @@ static DWORD speaker_config_to_channel_mask(DWORD speaker_config)
case
DSSPEAKER_STEREO
:
case
DSSPEAKER_HEADPHONE
:
return
SPEAKER_FRONT_LEFT
|
SPEAKER_FRONT_RIGHT
;
case
DSSPEAKER_QUAD
:
return
SPEAKER_FRONT_LEFT
|
SPEAKER_FRONT_RIGHT
|
SPEAKER_BACK_LEFT
|
SPEAKER_BACK_RIGHT
;
}
WARN
(
"unknown speaker_config %u
\n
"
,
speaker_config
);
...
...
@@ -192,7 +195,9 @@ static DWORD DSOUND_FindSpeakerConfig(IMMDevice *mmdevice)
PropVariantClear
(
&
pv
);
IPropertyStore_Release
(
store
);
if
((
phys_speakers
&
KSAUDIO_SPEAKER_STEREO
)
==
KSAUDIO_SPEAKER_STEREO
)
if
((
phys_speakers
&
KSAUDIO_SPEAKER_QUAD
)
==
KSAUDIO_SPEAKER_QUAD
)
return
DSSPEAKER_QUAD
;
else
if
((
phys_speakers
&
KSAUDIO_SPEAKER_STEREO
)
==
KSAUDIO_SPEAKER_STEREO
)
return
DSSPEAKER_COMBINED
(
DSSPEAKER_STEREO
,
DSSPEAKER_GEOMETRY_WIDE
);
else
if
((
phys_speakers
&
KSAUDIO_SPEAKER_MONO
)
==
KSAUDIO_SPEAKER_MONO
)
return
DSSPEAKER_MONO
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment