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
622ee1c4
Commit
622ee1c4
authored
Apr 30, 2007
by
Emmanuel Maillard
Committed by
Alexandre Julliard
May 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio.drv: Implement MIDIOut_Data when device is a MOD_MIDIPORT.
Implement MIDIOut_Send.
parent
dea9878c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
12 deletions
+28
-12
coremidi.c
dlls/winecoreaudio.drv/coremidi.c
+13
-0
coremidi.h
dlls/winecoreaudio.drv/coremidi.h
+2
-0
midi.c
dlls/winecoreaudio.drv/midi.c
+13
-12
No files found.
dlls/winecoreaudio.drv/coremidi.c
View file @
622ee1c4
...
...
@@ -26,6 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(midi);
#ifdef HAVE_COREAUDIO_COREAUDIO_H
#include <CoreMIDI/CoreMIDI.h>
#include <mach/mach_time.h>
#include "coremidi.h"
...
...
@@ -72,4 +73,16 @@ void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefC
packet
=
MIDIPacketNext
(
packet
);
}
}
void
MIDIOut_Send
(
MIDIPortRef
port
,
MIDIEndpointRef
dest
,
UInt8
*
buffer
,
unsigned
length
)
{
Byte
packetBuff
[
512
];
MIDIPacketList
*
packetList
=
(
MIDIPacketList
*
)
packetBuff
;
MIDIPacket
*
packet
=
MIDIPacketListInit
(
packetList
);
packet
=
MIDIPacketListAdd
(
packetList
,
sizeof
(
packetBuff
),
packet
,
mach_absolute_time
(),
length
,
buffer
);
if
(
packet
)
MIDISend
(
port
,
dest
,
packetList
);
}
#endif
/* HAVE_COREAUDIO_COREAUDIO_H */
dlls/winecoreaudio.drv/coremidi.h
View file @
622ee1c4
...
...
@@ -76,6 +76,8 @@ extern MIDIClientRef CoreMIDI_CreateClient(CFStringRef name);
extern
void
CoreMIDI_GetObjectName
(
MIDIObjectRef
obj
,
char
*
name
,
int
size
);
extern
void
MIDIIn_ReadProc
(
const
MIDIPacketList
*
pktlist
,
void
*
refCon
,
void
*
connRefCon
);
extern
void
MIDIOut_Send
(
MIDIPortRef
port
,
MIDIEndpointRef
dest
,
UInt8
*
buffer
,
unsigned
length
);
/* midi.c */
void
MIDIIn_SendMessage
(
MIDIMessage
msg
);
...
...
dlls/winecoreaudio.drv/midi.c
View file @
622ee1c4
...
...
@@ -303,10 +303,6 @@ static DWORD MIDIOut_Open(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
return
MMSYSERR_ERROR
;
}
}
else
{
FIXME
(
"MOD_MIDIPORT
\n
"
);
}
dest
->
wFlags
=
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
);
dest
->
midiDesc
=
*
lpDesc
;
...
...
@@ -326,8 +322,6 @@ static DWORD MIDIOut_Close(WORD wDevID)
if
(
destinations
[
wDevID
].
caps
.
wTechnology
==
MOD_SYNTH
)
SynthUnit_Close
(
destinations
[
wDevID
].
graph
);
else
FIXME
(
"MOD_MIDIPORT
\n
"
);
destinations
[
wDevID
].
graph
=
0
;
destinations
[
wDevID
].
synth
=
0
;
...
...
@@ -344,10 +338,7 @@ static DWORD MIDIOut_Close(WORD wDevID)
static
DWORD
MIDIOut_Data
(
WORD
wDevID
,
DWORD
dwParam
)
{
WORD
evt
=
LOBYTE
(
LOWORD
(
dwParam
));
WORD
d1
=
HIBYTE
(
LOWORD
(
dwParam
));
WORD
d2
=
LOBYTE
(
HIWORD
(
dwParam
));
UInt8
chn
=
(
evt
&
0x0F
);
OSStatus
err
=
noErr
;
TRACE
(
"wDevID=%d dwParam=%08X
\n
"
,
wDevID
,
dwParam
);
...
...
@@ -356,10 +347,12 @@ static DWORD MIDIOut_Data(WORD wDevID, DWORD dwParam)
return
MMSYSERR_BADDEVICEID
;
}
TRACE
(
"evt=%08x d1=%04x d2=%04x (evt & 0xF0)=%04x chn=%d
\n
"
,
evt
,
d1
,
d2
,
(
evt
&
0xF0
),
chn
);
if
(
destinations
[
wDevID
].
caps
.
wTechnology
==
MOD_SYNTH
)
{
WORD
d1
=
HIBYTE
(
LOWORD
(
dwParam
));
WORD
d2
=
LOBYTE
(
HIWORD
(
dwParam
));
OSStatus
err
=
noErr
;
err
=
MusicDeviceMIDIEvent
(
destinations
[
wDevID
].
synth
,
(
evt
&
0xF0
)
|
chn
,
d1
,
d2
,
0
);
if
(
err
!=
noErr
)
{
...
...
@@ -367,7 +360,15 @@ static DWORD MIDIOut_Data(WORD wDevID, DWORD dwParam)
return
MMSYSERR_ERROR
;
}
}
else
FIXME
(
"MOD_MIDIPORT
\n
"
);
else
{
UInt8
buffer
[
3
];
buffer
[
0
]
=
(
evt
&
0xF0
)
|
chn
;
buffer
[
1
]
=
HIBYTE
(
LOWORD
(
dwParam
));
buffer
[
2
]
=
LOBYTE
(
HIWORD
(
dwParam
));
MIDIOut_Send
(
MIDIOutPort
,
destinations
[
wDevID
].
dest
,
buffer
,
3
);
}
return
MMSYSERR_NOERROR
;
}
...
...
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