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
88240805
Commit
88240805
authored
May 02, 2003
by
Rok Mandeljc
Committed by
Alexandre Julliard
May 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented DirectMusic:EnumPort and DirectMusic:GetDefaultPort.
parent
d338b495
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
8 deletions
+90
-8
Makefile.in
dlls/dmusic/Makefile.in
+1
-1
dmusic.c
dlls/dmusic/dmusic.c
+80
-7
dmusic_private.h
dlls/dmusic/dmusic_private.h
+5
-0
winedefault.reg
winedefault.reg
+4
-0
No files found.
dlls/dmusic/Makefile.in
View file @
88240805
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
dmusic.dll
IMPORTS
=
dsound winmm
user
32 kernel32
IMPORTS
=
dsound winmm
ole32 user32 advapi
32 kernel32
EXTRALIBS
=
$(LIBUUID)
LDDLLFLAGS
=
@LDDLLFLAGS@
...
...
dlls/dmusic/dmusic.c
View file @
88240805
...
...
@@ -21,11 +21,22 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "mmsystem.h"
#include "winternl.h"
#include "mmddk.h"
#include "wine/windef16.h"
#include "wine/winbase16.h"
#include "wine/debug.h"
#include "dsound.h"
#include "dmusic_private.h"
...
...
@@ -69,14 +80,21 @@ ULONG WINAPI IDirectMusicImpl_Release (LPDIRECTMUSIC iface)
/* IDirectMusic Interface follow: */
HRESULT
WINAPI
IDirectMusicImpl_EnumPort
(
LPDIRECTMUSIC
iface
,
DWORD
dwIndex
,
LPDMUS_PORTCAPS
pPortCaps
)
{
/* FIXME: this is only for making DXCapsViewer display something */
static
const
WCHAR
name_WINE_SYNTHESIZER
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'S'
,
'y'
,
'n'
,
't'
,
'h'
,
'e'
,
's'
,
'i'
,
'z'
,
'e'
,
'r'
,
0
};
ICOM_THIS
(
IDirectMusicImpl
,
iface
);
int
numMIDI
=
midiOutGetNumDevs
();
int
numWAVE
=
waveOutGetNumDevs
();
int
i
;
TRACE
(
"(%p, %ld, %p)
\n
"
,
This
,
dwIndex
,
pPortCaps
);
TRACE
(
"1 software synth. + %i WAVE + %i MIDI available
\n
"
,
numWAVE
,
numMIDI
);
/* i guess the first port shown is always software synthesizer */
if
(
dwIndex
==
0
)
{
TRACE
(
"enumerating 'Microsoft Software Synthesizer' port
\n
"
);
pPortCaps
->
dwSize
=
sizeof
(
DMUS_PORTCAPS
);
pPortCaps
->
dwFlags
=
DMUS_PC_DLS
|
DMUS_PC_SOFTWARESYNTH
|
DMUS_PC_DIRECTSOUND
|
DMUS_PC_DLS2
|
DMUS_PC_AUDIOPATH
|
DMUS_PC_WAVE
;
/*pPortCaps->guidPort;*/
/* FIXME */
pPortCaps
->
guidPort
=
CLSID_DirectMusicSynth
;
pPortCaps
->
dwClass
=
DMUS_PC_OUTPUTCLASS
;
pPortCaps
->
dwType
=
DMUS_PORT_WINMM_DRIVER
;
pPortCaps
->
dwMemorySize
=
DMUS_PC_SYSTEMMEMORY
;
...
...
@@ -84,11 +102,29 @@ HRESULT WINAPI IDirectMusicImpl_EnumPort (LPDIRECTMUSIC iface, DWORD dwIndex, LP
pPortCaps
->
dwMaxVoices
=
1000
;
pPortCaps
->
dwMaxAudioChannels
=
-
1
;
pPortCaps
->
dwEffectFlags
=
DMUS_EFFECT_REVERB
|
DMUS_EFFECT_CHORUS
|
DMUS_EFFECT_DELAY
;
wsprintfW
(
pPortCaps
->
wszDescription
,
name_WINE_SYNTHESIZER
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"Microsotf Synthesizer"
,
-
1
,
pPortCaps
->
wszDescription
,
sizeof
(
pPortCaps
->
wszDescription
)
/
sizeof
(
WCHAR
)
);
return
S_OK
;
}
FIXME
(
"partial-stub (only first port supported)
\n
"
);
/* then return digital sound ports */
for
(
i
=
1
;
i
<=
numWAVE
;
i
++
)
{
TRACE
(
"enumerating 'digital sound' ports
\n
"
);
if
(
i
==
dwIndex
)
{
DirectSoundEnumerateA
((
LPDSENUMCALLBACKA
)
register_waveport
,
(
VOID
*
)
pPortCaps
);
return
S_OK
;
}
}
/* finally, list all *real* MIDI ports*/
for
(
i
=
numWAVE
+
1
;
i
<=
numWAVE
+
numMIDI
;
i
++
)
{
TRACE
(
"enumerating 'real MIDI' ports
\n
"
);
if
(
i
==
dwIndex
)
FIXME
(
"Found MIDI port, but *real* MIDI ports not supported yet
\n
"
);
}
return
S_FALSE
;
}
...
...
@@ -132,8 +168,26 @@ HRESULT WINAPI IDirectMusicImpl_Activate (LPDIRECTMUSIC iface, BOOL fEnable)
HRESULT
WINAPI
IDirectMusicImpl_GetDefaultPort
(
LPDIRECTMUSIC
iface
,
LPGUID
pguidPort
)
{
FIXME
(
"stub
\n
"
);
return
DS_OK
;
HKEY
hkGUID
;
DWORD
returnTypeGUID
,
sizeOfReturnBuffer
=
50
;
char
returnBuffer
[
51
];
GUID
defaultPortGUID
;
WCHAR
buff
[
51
];
if
(
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
DirectMusic
\\
Defaults"
,
0
,
KEY_READ
,
&
hkGUID
)
!=
ERROR_SUCCESS
)
{
ERR
(
": registry entry missing
\n
"
);
}
if
(
RegQueryValueExA
(
hkGUID
,
"DefaultOutputPort"
,
NULL
,
&
returnTypeGUID
,
returnBuffer
,
&
sizeOfReturnBuffer
)
!=
ERROR_SUCCESS
)
{
ERR
(
": missing GUID registry data members
\n
"
);
}
/* FIXME: Check return types to ensure we're interpreting data right */
MultiByteToWideChar
(
CP_ACP
,
0
,
returnBuffer
,
-
1
,
buff
,
sizeof
(
buff
)
/
sizeof
(
WCHAR
));
CLSIDFromString
((
LPCOLESTR
)
buff
,
&
defaultPortGUID
);
*
pguidPort
=
defaultPortGUID
;
return
S_OK
;
}
HRESULT
WINAPI
IDirectMusicImpl_SetDirectSound
(
LPDIRECTMUSIC
iface
,
LPDIRECTSOUND
pDirectSound
,
HWND
hWnd
)
...
...
@@ -551,3 +605,22 @@ ICOM_VTABLE(IDirectMusicObject) DirectMusicObject_Vtbl =
IDirectMusicObjectImpl_SetDescriptor
,
IDirectMusicObjectImpl_ParseDescriptor
};
/* helper stuff */
void
register_waveport
(
LPGUID
lpGUID
,
LPCSTR
lpszDesc
,
LPCSTR
lpszDrvName
,
LPVOID
lpContext
)
{
LPDMUS_PORTCAPS
pPortCaps
=
(
LPDMUS_PORTCAPS
)
lpContext
;
pPortCaps
->
dwSize
=
sizeof
(
DMUS_PORTCAPS
);
pPortCaps
->
dwFlags
=
DMUS_PC_DLS
|
DMUS_PC_SOFTWARESYNTH
|
DMUS_PC_DIRECTSOUND
|
DMUS_PC_DLS2
|
DMUS_PC_AUDIOPATH
|
DMUS_PC_WAVE
;
pPortCaps
->
guidPort
=
*
lpGUID
;
pPortCaps
->
dwClass
=
DMUS_PC_OUTPUTCLASS
;
pPortCaps
->
dwType
=
DMUS_PORT_WINMM_DRIVER
;
pPortCaps
->
dwMemorySize
=
DMUS_PC_SYSTEMMEMORY
;
pPortCaps
->
dwMaxChannelGroups
=
1000
;
pPortCaps
->
dwMaxVoices
=
1000
;
pPortCaps
->
dwMaxAudioChannels
=
-
1
;
pPortCaps
->
dwEffectFlags
=
DMUS_EFFECT_REVERB
|
DMUS_EFFECT_CHORUS
|
DMUS_EFFECT_DELAY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszDesc
,
-
1
,
pPortCaps
->
wszDescription
,
sizeof
(
pPortCaps
->
wszDescription
)
/
sizeof
(
WCHAR
));
}
dlls/dmusic/dmusic_private.h
View file @
88240805
...
...
@@ -1234,4 +1234,9 @@ extern HRESULT WINAPI IDirectMusicSongImpl_Download (LPDIRECTMUSICSONG iface, IU
extern
HRESULT
WINAPI
IDirectMusicSongImpl_Unload
(
LPDIRECTMUSICSONG
iface
,
IUnknown
*
pAudioPath
);
extern
HRESULT
WINAPI
IDirectMusicSongImpl_EnumSegment
(
LPDIRECTMUSICSONG
iface
,
DWORD
dwIndex
,
IDirectMusicSegment
**
ppSegment
);
/*****************************************************************************
* Helper Functions
*/
void
register_waveport
(
LPGUID
lpGUID
,
LPCSTR
lpszDesc
,
LPCSTR
lpszDrvName
,
LPVOID
lpContext
);
#endif
/* __WINE_DMUSIC_PRIVATE_H */
winedefault.reg
View file @
88240805
...
...
@@ -1550,6 +1550,10 @@
[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectMusic\SoftwareSynths\{58C2B4D0-46E7-11D1-89AC-00A0C9054129}]
@=""
"Description"="Microsoft Software Synthesizer"
[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectMusic\Defaults]
@=""
"DefaultOutputPort"="{58C2B4D0-46E7-11D1-89AC-00A0C9054129}"
# DirectMusicParamControlTrack
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{4BE0537B-5C19-11D3-8BDC-00600893B1B6}]
...
...
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