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
a8b80787
Commit
a8b80787
authored
Feb 10, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Feb 11, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
midimap: Implement callback/notification.
parent
788d8720
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
midimap.c
dlls/midimap/midimap.c
+19
-5
midi.c
dlls/winmm/tests/midi.c
+0
-6
No files found.
dlls/midimap/midimap.c
View file @
a8b80787
...
...
@@ -92,6 +92,8 @@ typedef struct tagMIDIMAPDATA
{
struct
tagMIDIMAPDATA
*
self
;
MIDIOUTPORT
*
ChannelMap
[
16
];
MIDIOPENDESC
midiDesc
;
WORD
wCbFlags
;
}
MIDIMAPDATA
;
static
MIDIOUTPORT
*
midiOutPorts
;
...
...
@@ -258,6 +260,13 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
return
ret
;
}
static
void
MIDIMAP_NotifyClient
(
MIDIMAPDATA
*
mom
,
WORD
wMsg
,
DWORD_PTR
dwParam1
,
DWORD_PTR
dwParam2
)
{
DriverCallback
(
mom
->
midiDesc
.
dwCallback
,
mom
->
wCbFlags
,
(
HDRVR
)
mom
->
midiDesc
.
hMidi
,
wMsg
,
mom
->
midiDesc
.
dwInstance
,
dwParam1
,
dwParam2
);
}
static
DWORD
modOpen
(
DWORD_PTR
*
lpdwUser
,
LPMIDIOPENDESC
lpDesc
,
DWORD
dwFlags
)
{
MIDIMAPDATA
*
mom
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
MIDIMAPDATA
));
...
...
@@ -265,11 +274,9 @@ static DWORD modOpen(DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
TRACE
(
"(%p %p %08x)
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
if
(
!
mom
)
return
MMSYSERR_NOMEM
;
if
(
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
))
{
FIXME
(
"NIY callback flags %08x
\n
"
,
dwFlags
);
if
(
!
lpDesc
)
{
HeapFree
(
GetProcessHeap
(),
0
,
mom
);
return
MMSYSERR_INVAL
FLAG
;
return
MMSYSERR_INVAL
PARAM
;
}
if
(
MIDIMAP_LoadSettings
(
mom
))
...
...
@@ -277,6 +284,10 @@ static DWORD modOpen(DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
*
lpdwUser
=
(
DWORD_PTR
)
mom
;
mom
->
self
=
mom
;
mom
->
wCbFlags
=
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
);
mom
->
midiDesc
=
*
lpDesc
;
MIDIMAP_NotifyClient
(
mom
,
MOM_OPEN
,
0L
,
0L
);
return
MMSYSERR_NOERROR
;
}
HeapFree
(
GetProcessHeap
(),
0
,
mom
);
...
...
@@ -305,8 +316,10 @@ static DWORD modClose(MIDIMAPDATA* mom)
ret
=
t
;
}
}
if
(
ret
==
MMSYSERR_NOERROR
)
if
(
ret
==
MMSYSERR_NOERROR
)
{
MIDIMAP_NotifyClient
(
mom
,
MOM_CLOSE
,
0L
,
0L
);
HeapFree
(
GetProcessHeap
(),
0
,
mom
);
}
return
ret
;
}
...
...
@@ -342,6 +355,7 @@ static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwPara
}
lpMidiHdr
->
dwFlags
&=
~
MHDR_INQUEUE
;
lpMidiHdr
->
dwFlags
|=
MHDR_DONE
;
MIDIMAP_NotifyClient
(
mom
,
MOM_DONE
,
(
DWORD_PTR
)
lpMidiHdr
,
0L
);
return
ret
;
}
...
...
dlls/winmm/tests/midi.c
View file @
a8b80787
...
...
@@ -203,9 +203,6 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
rc
=
midiOutOpen
(
&
hm
,
udev
,
(
DWORD_PTR
)
hwnd
,
(
DWORD_PTR
)
MYCBINST
,
CALLBACK_WINDOW
);
else
rc
=
midiOutOpen
(
&
hm
,
udev
,
(
DWORD_PTR
)
callback_func
,
(
DWORD_PTR
)
MYCBINST
,
CALLBACK_FUNCTION
);
if
(
MIDIMAPPER
==
udev
)
todo_wine
ok
(
!
rc
,
"midiOutOpen(dev=%d) rc=%s
\n
"
,
udev
,
mmsys_error
(
rc
));
else
ok
(
!
rc
,
"midiOutOpen(dev=%d) rc=%s
\n
"
,
udev
,
mmsys_error
(
rc
));
if
(
rc
)
return
;
...
...
@@ -316,9 +313,6 @@ static void test_midiStream(UINT udev, HWND hwnd)
rc
=
midiStreamOpen
(
&
hm
,
&
udev
,
1
,
(
DWORD_PTR
)
hwnd
,
(
DWORD_PTR
)
MYCBINST
,
CALLBACK_WINDOW
);
else
rc
=
midiStreamOpen
(
&
hm
,
&
udev
,
1
,
(
DWORD_PTR
)
callback_func
,
(
DWORD_PTR
)
MYCBINST
,
CALLBACK_FUNCTION
);
if
(
MIDIMAPPER
==
udev
)
todo_wine
ok
(
!
rc
,
"midiStreamOpen(dev=%d) rc=%s
\n
"
,
udev
,
mmsys_error
(
rc
));
else
ok
(
!
rc
,
"midiStreamOpen(dev=%d) rc=%s
\n
"
,
udev
,
mmsys_error
(
rc
));
if
(
rc
)
return
;
...
...
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