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
dea9878c
Commit
dea9878c
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: Create only one MIDIOutPort and one MIDIInPort for all destinations and sources.
parent
41b8a570
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
17 deletions
+23
-17
coremidi.c
dlls/winecoreaudio.drv/coremidi.c
+1
-1
midi.c
dlls/winecoreaudio.drv/midi.c
+22
-16
No files found.
dlls/winecoreaudio.drv/coremidi.c
View file @
dea9878c
...
@@ -63,7 +63,7 @@ void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefC
...
@@ -63,7 +63,7 @@ void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefC
MIDIPacket
*
packet
=
(
MIDIPacket
*
)
pktlist
->
packet
;
MIDIPacket
*
packet
=
(
MIDIPacket
*
)
pktlist
->
packet
;
for
(
i
=
0
;
i
<
pktlist
->
numPackets
;
++
i
)
{
for
(
i
=
0
;
i
<
pktlist
->
numPackets
;
++
i
)
{
msg
.
devID
=
*
((
UInt16
*
)
r
efCon
);
msg
.
devID
=
*
((
UInt16
*
)
connR
efCon
);
msg
.
length
=
packet
->
length
;
msg
.
length
=
packet
->
length
;
memcpy
(
msg
.
data
,
packet
->
data
,
sizeof
(
packet
->
data
));
memcpy
(
msg
.
data
,
packet
->
data
,
sizeof
(
packet
->
data
));
...
...
dlls/winecoreaudio.drv/midi.c
View file @
dea9878c
...
@@ -59,14 +59,16 @@ typedef struct tagMIDIDestination {
...
@@ -59,14 +59,16 @@ typedef struct tagMIDIDestination {
AUGraph
graph
;
AUGraph
graph
;
AudioUnit
synth
;
AudioUnit
synth
;
MIDIPortRef
port
;
MIDIEndpointRef
dest
;
MIDIOUTCAPSW
caps
;
MIDIOUTCAPSW
caps
;
MIDIOPENDESC
midiDesc
;
MIDIOPENDESC
midiDesc
;
WORD
wFlags
;
WORD
wFlags
;
}
MIDIDestination
;
}
MIDIDestination
;
typedef
struct
tagMIDISource
{
typedef
struct
tagMIDISource
{
MIDIPortRef
port
;
MIDIEndpointRef
source
;
WORD
wDevID
;
WORD
wDevID
;
int
state
;
/* 0 is no recording started, 1 in recording, bit 2 set if in sys exclusive recording */
int
state
;
/* 0 is no recording started, 1 in recording, bit 2 set if in sys exclusive recording */
MIDIINCAPSW
caps
;
MIDIINCAPSW
caps
;
...
@@ -81,6 +83,9 @@ static CFStringRef MIDIInThreadPortName = NULL;
...
@@ -81,6 +83,9 @@ static CFStringRef MIDIInThreadPortName = NULL;
static
DWORD
WINAPI
MIDIIn_MessageThread
(
LPVOID
p
);
static
DWORD
WINAPI
MIDIIn_MessageThread
(
LPVOID
p
);
static
MIDIPortRef
MIDIInPort
=
NULL
;
static
MIDIPortRef
MIDIOutPort
=
NULL
;
#define MAX_MIDI_SYNTHS 1
#define MAX_MIDI_SYNTHS 1
MIDIDestination
*
destinations
;
MIDIDestination
*
destinations
;
...
@@ -123,23 +128,28 @@ LONG CoreAudio_MIDIInit(void)
...
@@ -123,23 +128,28 @@ LONG CoreAudio_MIDIInit(void)
InitializeCriticalSection
(
&
midiInLock
);
InitializeCriticalSection
(
&
midiInLock
);
MIDIInThreadPortName
=
CFStringCreateWithFormat
(
kCFAllocatorDefault
,
NULL
,
CFSTR
(
"MIDIInThreadPortName.%u"
),
getpid
());
MIDIInThreadPortName
=
CFStringCreateWithFormat
(
kCFAllocatorDefault
,
NULL
,
CFSTR
(
"MIDIInThreadPortName.%u"
),
getpid
());
CreateThread
(
NULL
,
0
,
MIDIIn_MessageThread
,
NULL
,
0
,
NULL
);
CreateThread
(
NULL
,
0
,
MIDIIn_MessageThread
,
NULL
,
0
,
NULL
);
name
=
CFStringCreateWithFormat
(
kCFAllocatorDefault
,
NULL
,
CFSTR
(
"WineInputPort.%u"
),
getpid
());
MIDIInputPortCreate
(
wineMIDIClient
,
name
,
MIDIIn_ReadProc
,
NULL
,
&
MIDIInPort
);
CFRelease
(
name
);
}
if
(
numDest
>
0
)
{
name
=
CFStringCreateWithFormat
(
kCFAllocatorDefault
,
NULL
,
CFSTR
(
"WineOutputPort.%u"
),
getpid
());
MIDIOutputPortCreate
(
wineMIDIClient
,
name
,
&
MIDIOutPort
);
CFRelease
(
name
);
}
}
/* initialize sources */
/* initialize sources */
for
(
i
=
0
;
i
<
MIDIIn_NumDevs
;
i
++
)
for
(
i
=
0
;
i
<
MIDIIn_NumDevs
;
i
++
)
{
{
MIDIEndpointRef
endpoint
=
MIDIGetSource
(
i
);
sources
[
i
].
wDevID
=
i
;
sources
[
i
].
wDevID
=
i
;
sources
[
i
].
source
=
MIDIGetSource
(
i
);
CoreMIDI_GetObjectName
(
endpoint
,
szPname
,
sizeof
(
szPname
));
CoreMIDI_GetObjectName
(
sources
[
i
].
source
,
szPname
,
sizeof
(
szPname
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szPname
,
-
1
,
sources
[
i
].
caps
.
szPname
,
sizeof
(
sources
[
i
].
caps
.
szPname
)
/
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szPname
,
-
1
,
sources
[
i
].
caps
.
szPname
,
sizeof
(
sources
[
i
].
caps
.
szPname
)
/
sizeof
(
WCHAR
));
name
=
CFStringCreateWithFormat
(
kCFAllocatorDefault
,
NULL
,
CFSTR
(
"WineInputPort.%d.%u"
),
i
,
getpid
());
MIDIPortConnectSource
(
MIDIInPort
,
sources
[
i
].
source
,
&
sources
[
i
].
wDevID
);
MIDIInputPortCreate
(
wineMIDIClient
,
name
,
MIDIIn_ReadProc
,
&
sources
[
i
].
wDevID
,
&
sources
[
i
].
port
);
CFRelease
(
name
);
MIDIPortConnectSource
(
sources
[
i
].
port
,
endpoint
,
NULL
);
sources
[
i
].
state
=
0
;
sources
[
i
].
state
=
0
;
/* FIXME */
/* FIXME */
...
@@ -168,15 +178,11 @@ LONG CoreAudio_MIDIInit(void)
...
@@ -168,15 +178,11 @@ LONG CoreAudio_MIDIInit(void)
/* initialise available destinations */
/* initialise available destinations */
for
(
i
=
MAX_MIDI_SYNTHS
;
i
<
numDest
+
MAX_MIDI_SYNTHS
;
i
++
)
for
(
i
=
MAX_MIDI_SYNTHS
;
i
<
numDest
+
MAX_MIDI_SYNTHS
;
i
++
)
{
{
MIDIEndpointRef
endpoin
t
=
MIDIGetDestination
(
i
-
MAX_MIDI_SYNTHS
);
destinations
[
i
].
des
t
=
MIDIGetDestination
(
i
-
MAX_MIDI_SYNTHS
);
CoreMIDI_GetObjectName
(
endpoin
t
,
szPname
,
sizeof
(
szPname
));
CoreMIDI_GetObjectName
(
destinations
[
i
].
des
t
,
szPname
,
sizeof
(
szPname
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szPname
,
-
1
,
destinations
[
i
].
caps
.
szPname
,
sizeof
(
destinations
[
i
].
caps
.
szPname
)
/
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szPname
,
-
1
,
destinations
[
i
].
caps
.
szPname
,
sizeof
(
destinations
[
i
].
caps
.
szPname
)
/
sizeof
(
WCHAR
));
name
=
CFStringCreateWithFormat
(
kCFAllocatorDefault
,
NULL
,
CFSTR
(
"WineOutputPort.%d.%u"
),
i
,
getpid
());
MIDIOutputPortCreate
(
wineMIDIClient
,
name
,
&
destinations
[
i
].
port
);
CFRelease
(
name
);
destinations
[
i
].
caps
.
wTechnology
=
MOD_MIDIPORT
;
destinations
[
i
].
caps
.
wTechnology
=
MOD_MIDIPORT
;
destinations
[
i
].
caps
.
wChannelMask
=
0xFFFF
;
destinations
[
i
].
caps
.
wChannelMask
=
0xFFFF
;
...
...
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