Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9aa9cde8
Commit
9aa9cde8
authored
Apr 25, 2007
by
Emmanuel Maillard
Committed by
Alexandre Julliard
Apr 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Implement MIDIOut_GetVolume and MIDIOut_SetVolume.
parent
97d5a029
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
coremidi.h
dlls/winecoreaudio.drv/coremidi.h
+3
-0
midi.c
dlls/winecoreaudio.drv/midi.c
+52
-0
No files found.
dlls/winecoreaudio.drv/coremidi.h
View file @
9aa9cde8
...
...
@@ -55,6 +55,9 @@ typedef void *AUGraph;
extern
OSStatus
MusicDeviceMIDIEvent
(
AudioUnit
au
,
UInt32
inStatus
,
UInt32
inData1
,
UInt32
inData2
,
UInt32
inOffsetSampleFrame
);
extern
OSStatus
MusicDeviceSysEx
(
AudioUnit
au
,
const
UInt8
*
inData
,
UInt32
inLength
);
/* audiounit.c */
extern
int
AudioUnit_SetVolume
(
AudioUnit
au
,
float
left
,
float
right
);
extern
int
AudioUnit_GetVolume
(
AudioUnit
au
,
float
*
left
,
float
*
right
);
#endif
/* coremidi.c */
...
...
dlls/winecoreaudio.drv/midi.c
View file @
9aa9cde8
...
...
@@ -449,6 +449,56 @@ static DWORD MIDIOut_GetNumDevs(void)
return
MIDIOut_NumDevs
;
}
static
DWORD
MIDIOut_GetVolume
(
WORD
wDevID
,
DWORD
*
lpdwVolume
)
{
TRACE
(
"%d
\n
"
,
wDevID
);
if
(
wDevID
>=
MIDIOut_NumDevs
)
{
WARN
(
"bad device ID : %d
\n
"
,
wDevID
);
return
MMSYSERR_BADDEVICEID
;
}
if
(
lpdwVolume
==
NULL
)
{
WARN
(
"Invalid Parameter
\n
"
);
return
MMSYSERR_INVALPARAM
;
}
if
(
destinations
[
wDevID
].
caps
.
wTechnology
==
MOD_SYNTH
)
{
float
left
;
float
right
;
AudioUnit_GetVolume
(
destinations
[
wDevID
].
synth
,
&
left
,
&
right
);
*
lpdwVolume
=
((
WORD
)
left
*
0xFFFFl
)
+
(((
WORD
)
right
*
0xFFFFl
)
<<
16
);
return
MMSYSERR_NOERROR
;
}
return
MMSYSERR_NOTSUPPORTED
;
}
static
DWORD
MIDIOut_SetVolume
(
WORD
wDevID
,
DWORD
dwVolume
)
{
TRACE
(
"%d
\n
"
,
wDevID
);
if
(
wDevID
>=
MIDIOut_NumDevs
)
{
WARN
(
"bad device ID : %d
\n
"
,
wDevID
);
return
MMSYSERR_BADDEVICEID
;
}
if
(
destinations
[
wDevID
].
caps
.
wTechnology
==
MOD_SYNTH
)
{
float
left
;
float
right
;
left
=
LOWORD
(
dwVolume
)
/
65535
.
0
f
;
right
=
HIWORD
(
dwVolume
)
/
65535
.
0
f
;
AudioUnit_SetVolume
(
destinations
[
wDevID
].
synth
,
left
,
right
);
return
MMSYSERR_NOERROR
;
}
return
MMSYSERR_NOTSUPPORTED
;
}
/**************************************************************************
* modMessage
*/
...
...
@@ -479,7 +529,9 @@ DWORD WINAPI CoreAudio_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dw
case
MODM_GETNUMDEVS
:
return
MIDIOut_GetNumDevs
();
case
MODM_GETVOLUME
:
return
MIDIOut_GetVolume
(
wDevID
,
(
DWORD
*
)
dwParam1
);
case
MODM_SETVOLUME
:
return
MIDIOut_SetVolume
(
wDevID
,
dwParam1
);
case
MODM_RESET
:
default:
TRACE
(
"Unsupported message (08%x)
\n
"
,
wMsg
);
...
...
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