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
7c9e8b9c
Commit
7c9e8b9c
authored
Oct 17, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dswave: Use the dmusic wave object implementation.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55792
parent
80e6310a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
205 deletions
+14
-205
dmusic_wave.h
dlls/dmusic/dmusic_wave.h
+1
-0
wave.c
dlls/dmusic/wave.c
+1
-1
Makefile.in
dlls/dswave/Makefile.in
+2
-2
dswave.c
dlls/dswave/dswave.c
+0
-191
dswave_main.c
dlls/dswave/dswave_main.c
+10
-6
dswave_private.h
dlls/dswave/dswave_private.h
+0
-5
No files found.
dlls/dmusic/dmusic_wave.h
View file @
7c9e8b9c
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
struct
soundfont
;
struct
soundfont
;
struct
chunk_entry
;
struct
chunk_entry
;
extern
HRESULT
wave_create
(
IDirectMusicObject
**
ret_iface
);
extern
HRESULT
wave_create_from_soundfont
(
struct
soundfont
*
soundfont
,
UINT
index
,
IDirectMusicObject
**
out
);
extern
HRESULT
wave_create_from_soundfont
(
struct
soundfont
*
soundfont
,
UINT
index
,
IDirectMusicObject
**
out
);
extern
HRESULT
wave_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
IDirectMusicObject
**
out
);
extern
HRESULT
wave_create_from_chunk
(
IStream
*
stream
,
struct
chunk_entry
*
parent
,
IDirectMusicObject
**
out
);
extern
HRESULT
wave_download_to_port
(
IDirectMusicObject
*
iface
,
IDirectMusicPortDownload
*
port
,
DWORD
*
id
);
extern
HRESULT
wave_download_to_port
(
IDirectMusicObject
*
iface
,
IDirectMusicPortDownload
*
port
,
DWORD
*
id
);
...
...
dlls/dmusic/wave.c
View file @
7c9e8b9c
...
@@ -264,7 +264,7 @@ static const IPersistStreamVtbl wave_persist_stream_vtbl =
...
@@ -264,7 +264,7 @@ static const IPersistStreamVtbl wave_persist_stream_vtbl =
unimpl_IPersistStream_GetSizeMax
,
unimpl_IPersistStream_GetSizeMax
,
};
};
static
HRESULT
wave_create
(
IDirectMusicObject
**
ret_iface
)
HRESULT
wave_create
(
IDirectMusicObject
**
ret_iface
)
{
{
struct
wave
*
obj
;
struct
wave
*
obj
;
...
...
dlls/dswave/Makefile.in
View file @
7c9e8b9c
...
@@ -4,8 +4,8 @@ PARENTSRC = ../dmusic
...
@@ -4,8 +4,8 @@ PARENTSRC = ../dmusic
C_SRCS
=
\
C_SRCS
=
\
dmobject.c
\
dmobject.c
\
dswave.c
\
dswave
_main
.c
\
dswave_main
.c
wave
.c
IDL_SRCS
=
dswave.idl
IDL_SRCS
=
dswave.idl
...
...
dlls/dswave/dswave.c
deleted
100644 → 0
View file @
80e6310a
/* IDirectMusicWave Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dswave_private.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dswave
);
/* an interface that is, according to my tests, obtained by loader after loading object; is it acting
as some sort of bridge between object and loader? */
static
const
GUID
IID_IDirectMusicWavePRIVATE
=
{
0x69e934e4
,
0x97f1
,
0x4f1d
,{
0x88
,
0xe8
,
0xf2
,
0xac
,
0x88
,
0x67
,
0x13
,
0x27
}};
/*****************************************************************************
* IDirectMusicWaveImpl implementation
*/
typedef
struct
IDirectMusicWaveImpl
{
IUnknown
IUnknown_iface
;
struct
dmobject
dmobj
;
LONG
ref
;
}
IDirectMusicWaveImpl
;
/* IDirectMusicWaveImpl IUnknown part: */
static
inline
IDirectMusicWaveImpl
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectMusicWaveImpl
,
IUnknown_iface
);
}
static
HRESULT
WINAPI
IUnknownImpl_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
IDirectMusicWaveImpl
*
This
=
impl_from_IUnknown
(
iface
);
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ret_iface
);
*
ret_iface
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
*
ret_iface
=
iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IDirectMusicObject
))
*
ret_iface
=
&
This
->
dmobj
.
IDirectMusicObject_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IPersistStream
))
*
ret_iface
=
&
This
->
dmobj
.
IPersistStream_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IDirectMusicWavePRIVATE
))
{
FIXME
(
"(%p, %s, %p): Unsupported private interface
\n
"
,
This
,
debugstr_guid
(
riid
),
ret_iface
);
return
E_NOINTERFACE
;
}
else
{
WARN
(
"(%p, %s, %p): not found
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ret_iface
);
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ret_iface
);
return
S_OK
;
}
static
ULONG
WINAPI
IUnknownImpl_AddRef
(
IUnknown
*
iface
)
{
IDirectMusicWaveImpl
*
This
=
impl_from_IUnknown
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
IUnknownImpl_Release
(
IUnknown
*
iface
)
{
IDirectMusicWaveImpl
*
This
=
impl_from_IUnknown
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
free
(
This
);
return
ref
;
}
static
const
IUnknownVtbl
unknown_vtbl
=
{
IUnknownImpl_QueryInterface
,
IUnknownImpl_AddRef
,
IUnknownImpl_Release
};
/* IDirectMusicWaveImpl IDirectMusicObject part: */
static
HRESULT
WINAPI
wave_IDirectMusicObject_ParseDescriptor
(
IDirectMusicObject
*
iface
,
IStream
*
stream
,
DMUS_OBJECTDESC
*
desc
)
{
struct
chunk_entry
riff
=
{
0
};
HRESULT
hr
;
TRACE
(
"(%p, %p, %p)
\n
"
,
iface
,
stream
,
desc
);
if
(
!
stream
||
!
desc
)
return
E_POINTER
;
if
((
hr
=
stream_get_chunk
(
stream
,
&
riff
))
!=
S_OK
)
return
hr
;
if
(
riff
.
id
!=
FOURCC_RIFF
||
riff
.
type
!=
mmioFOURCC
(
'W'
,
'A'
,
'V'
,
'E'
))
{
TRACE
(
"loading failed: unexpected %s
\n
"
,
debugstr_chunk
(
&
riff
));
stream_skip_chunk
(
stream
,
&
riff
);
return
DMUS_E_CHUNKNOTFOUND
;
}
hr
=
dmobj_parsedescriptor
(
stream
,
&
riff
,
desc
,
DMUS_OBJ_NAME_INFO
|
DMUS_OBJ_OBJECT
|
DMUS_OBJ_VERSION
);
if
(
FAILED
(
hr
))
return
hr
;
TRACE
(
"returning descriptor:
\n
"
);
dump_DMUS_OBJECTDESC
(
desc
);
return
S_OK
;
}
static
const
IDirectMusicObjectVtbl
dmobject_vtbl
=
{
dmobj_IDirectMusicObject_QueryInterface
,
dmobj_IDirectMusicObject_AddRef
,
dmobj_IDirectMusicObject_Release
,
dmobj_IDirectMusicObject_GetDescriptor
,
dmobj_IDirectMusicObject_SetDescriptor
,
wave_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicWaveImpl IPersistStream part: */
static
inline
IDirectMusicWaveImpl
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectMusicWaveImpl
,
dmobj
.
IPersistStream_iface
);
}
static
HRESULT
WINAPI
wave_IPersistStream_Load
(
IPersistStream
*
iface
,
IStream
*
stream
)
{
IDirectMusicWaveImpl
*
This
=
impl_from_IPersistStream
(
iface
);
struct
chunk_entry
riff
=
{
0
};
/* Without the private interface the implementation should go to dmime/segment.c */
FIXME
(
"(%p, %p): loading not implemented (only descriptor is loaded)
\n
"
,
This
,
stream
);
if
(
!
stream
)
return
E_POINTER
;
if
(
stream_get_chunk
(
stream
,
&
riff
)
!=
S_OK
||
riff
.
id
!=
FOURCC_RIFF
||
riff
.
type
!=
mmioFOURCC
(
'W'
,
'A'
,
'V'
,
'E'
))
return
DMUS_E_UNSUPPORTED_STREAM
;
stream_reset_chunk_start
(
stream
,
&
riff
);
return
IDirectMusicObject_ParseDescriptor
(
&
This
->
dmobj
.
IDirectMusicObject_iface
,
stream
,
&
This
->
dmobj
.
desc
);
}
static
const
IPersistStreamVtbl
persiststream_vtbl
=
{
dmobj_IPersistStream_QueryInterface
,
dmobj_IPersistStream_AddRef
,
dmobj_IPersistStream_Release
,
dmobj_IPersistStream_GetClassID
,
unimpl_IPersistStream_IsDirty
,
wave_IPersistStream_Load
,
unimpl_IPersistStream_Save
,
unimpl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT
create_dswave
(
REFIID
lpcGUID
,
void
**
ppobj
)
{
IDirectMusicWaveImpl
*
obj
;
HRESULT
hr
;
*
ppobj
=
NULL
;
if
(
!
(
obj
=
calloc
(
1
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
obj
->
IUnknown_iface
.
lpVtbl
=
&
unknown_vtbl
;
obj
->
ref
=
1
;
dmobject_init
(
&
obj
->
dmobj
,
&
CLSID_DirectSoundWave
,
&
obj
->
IUnknown_iface
);
obj
->
dmobj
.
IDirectMusicObject_iface
.
lpVtbl
=
&
dmobject_vtbl
;
obj
->
dmobj
.
IPersistStream_iface
.
lpVtbl
=
&
persiststream_vtbl
;
hr
=
IUnknown_QueryInterface
(
&
obj
->
IUnknown_iface
,
lpcGUID
,
ppobj
);
IUnknown_Release
(
&
obj
->
IUnknown_iface
);
return
hr
;
}
dlls/dswave/dswave_main.c
View file @
7c9e8b9c
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "dmusici.h"
#include "dmusici.h"
#include "dswave_private.h"
#include "dswave_private.h"
#include "dmusic_wave.h"
#include "dmobject.h"
#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dswave
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dswave
);
...
@@ -79,14 +80,17 @@ static ULONG WINAPI WaveCF_Release(IClassFactory * iface)
...
@@ -79,14 +80,17 @@ static ULONG WINAPI WaveCF_Release(IClassFactory * iface)
static
HRESULT
WINAPI
WaveCF_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer_unk
,
REFIID
riid
,
static
HRESULT
WINAPI
WaveCF_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
outer_unk
,
REFIID
riid
,
void
**
ret_iface
)
void
**
ret_iface
)
{
{
TRACE
(
"(%p, %s, %p)
\n
"
,
outer_unk
,
debugstr_dmguid
(
riid
),
ret_iface
);
IDirectMusicObject
*
object
;
HRESULT
hr
;
if
(
outer_unk
)
{
TRACE
(
"(%p, %s, %p)
\n
"
,
outer_unk
,
debugstr_dmguid
(
riid
),
ret_iface
);
*
ret_iface
=
NULL
;
return
CLASS_E_NOAGGREGATION
;
}
return
create_dswave
(
riid
,
ret_iface
);
*
ret_iface
=
NULL
;
if
(
outer_unk
)
return
CLASS_E_NOAGGREGATION
;
if
(
FAILED
(
hr
=
wave_create
(
&
object
)))
return
hr
;
hr
=
IDirectMusicObject_QueryInterface
(
object
,
riid
,
ret_iface
);
IDirectMusicObject_Release
(
object
);
return
hr
;
}
}
static
HRESULT
WINAPI
WaveCF_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
static
HRESULT
WINAPI
WaveCF_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
...
...
dlls/dswave/dswave_private.h
View file @
7c9e8b9c
...
@@ -39,9 +39,4 @@
...
@@ -39,9 +39,4 @@
#include "dmusicf.h"
#include "dmusicf.h"
#include "dmusics.h"
#include "dmusics.h"
/*****************************************************************************
* ClassFactory
*/
extern
HRESULT
create_dswave
(
REFIID
lpcGUID
,
void
**
ret_iface
);
#endif
/* __WINE_DSWAVE_PRIVATE_H */
#endif
/* __WINE_DSWAVE_PRIVATE_H */
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