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
0110dc24
Commit
0110dc24
authored
Sep 06, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Get rid of the IDirectMusicInstrumentImpl typedef.
parent
9abd659e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
26 deletions
+20
-26
collection.c
dlls/dmusic/collection.c
+2
-2
dmusic_private.h
dlls/dmusic/dmusic_private.h
+4
-10
instrument.c
dlls/dmusic/instrument.c
+13
-13
port.c
dlls/dmusic/port.c
+1
-1
No files found.
dlls/dmusic/collection.c
View file @
0110dc24
...
...
@@ -140,7 +140,7 @@ static HRESULT WINAPI collection_EnumInstrument(IDirectMusicCollection *iface,
LIST_FOR_EACH
(
list_entry
,
&
This
->
Instruments
)
{
inst_entry
=
LIST_ENTRY
(
list_entry
,
DMUS_PRIVATE_INSTRUMENTENTRY
,
entry
);
if
(
i
==
index
)
{
IDirectMusicInstrumentImpl
*
instrument
=
impl_from_IDirectMusicInstrument
(
inst_entry
->
pInstrument
);
struct
instrument
*
instrument
=
impl_from_IDirectMusicInstrument
(
inst_entry
->
pInstrument
);
IDirectMusicInstrument_GetPatch
(
inst_entry
->
pInstrument
,
patch
);
if
(
name
)
{
length
=
min
(
lstrlenW
(
instrument
->
wszName
),
name_length
-
1
);
...
...
@@ -379,7 +379,7 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface,
/* Only way to create this one... even M$ does it discretely */
instrument_create
(
&
new_instrument
->
pInstrument
);
{
IDirectMusicInstrumentImpl
*
instrument
=
impl_from_IDirectMusicInstrument
(
new_instrument
->
pInstrument
);
struct
instrument
*
instrument
=
impl_from_IDirectMusicInstrument
(
new_instrument
->
pInstrument
);
/* Store offset and length, they will be needed when loading the instrument */
liMove
.
QuadPart
=
0
;
IStream_Seek
(
stream
,
liMove
,
STREAM_SEEK_CUR
,
&
dlibInstrumentPosition
);
...
...
dlls/dmusic/dmusic_private.h
View file @
0110dc24
...
...
@@ -49,8 +49,6 @@ typedef struct IDirectMusicBufferImpl IDirectMusicBufferImpl;
typedef
struct
IDirectMusicDownloadedInstrumentImpl
IDirectMusicDownloadedInstrumentImpl
;
typedef
struct
IReferenceClockImpl
IReferenceClockImpl
;
typedef
struct
IDirectMusicInstrumentImpl
IDirectMusicInstrumentImpl
;
/*****************************************************************************
* Some stuff to make my life easier :=)
*/
...
...
@@ -175,15 +173,11 @@ typedef struct _DMUS_PRIVATE_POOLCUE {
struct
list
entry
;
/* for listing elements */
}
DMUS_PRIVATE_POOLCUE
,
*
LPDMUS_PRIVATE_POOLCUE
;
/*****************************************************************************
* IDirectMusicInstrumentImpl implementation structure
*/
struct
IDirectMusicInstrumentImpl
{
/* IUnknown fields */
struct
instrument
{
IDirectMusicInstrument
IDirectMusicInstrument_iface
;
LONG
ref
;
/* IDirectMusicInstrumentImpl fields */
LARGE_INTEGER
liInstrumentPosition
;
/* offset in a stream where instrument chunk can be found */
ULONG
length
;
/* Length of the instrument in the stream */
GUID
id
;
...
...
@@ -196,9 +190,9 @@ struct IDirectMusicInstrumentImpl {
instrument_articulation
*
articulations
;
};
static
inline
IDirectMusicInstrumentImpl
*
impl_from_IDirectMusicInstrument
(
IDirectMusicInstrument
*
iface
)
static
inline
struct
instrument
*
impl_from_IDirectMusicInstrument
(
IDirectMusicInstrument
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectMusicInstrumentImpl
,
IDirectMusicInstrument_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
instrument
,
IDirectMusicInstrument_iface
);
}
extern
HRESULT
instrument_load
(
IDirectMusicInstrument
*
iface
,
IStream
*
stream
);
...
...
dlls/dmusic/instrument.c
View file @
0110dc24
...
...
@@ -57,7 +57,7 @@ static HRESULT WINAPI instrument_QueryInterface(LPDIRECTMUSICINSTRUMENT iface, R
static
ULONG
WINAPI
instrument_AddRef
(
LPDIRECTMUSICINSTRUMENT
iface
)
{
IDirectMusicInstrumentImpl
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
struct
instrument
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p): new ref = %lu
\n
"
,
iface
,
ref
);
...
...
@@ -67,7 +67,7 @@ static ULONG WINAPI instrument_AddRef(LPDIRECTMUSICINSTRUMENT iface)
static
ULONG
WINAPI
instrument_Release
(
LPDIRECTMUSICINSTRUMENT
iface
)
{
IDirectMusicInstrumentImpl
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
struct
instrument
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p): new ref = %lu
\n
"
,
iface
,
ref
);
...
...
@@ -88,7 +88,7 @@ static ULONG WINAPI instrument_Release(LPDIRECTMUSICINSTRUMENT iface)
static
HRESULT
WINAPI
instrument_GetPatch
(
LPDIRECTMUSICINSTRUMENT
iface
,
DWORD
*
pdwPatch
)
{
IDirectMusicInstrumentImpl
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
struct
instrument
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pdwPatch
);
...
...
@@ -99,7 +99,7 @@ static HRESULT WINAPI instrument_GetPatch(LPDIRECTMUSICINSTRUMENT iface, DWORD*
static
HRESULT
WINAPI
instrument_SetPatch
(
LPDIRECTMUSICINSTRUMENT
iface
,
DWORD
dwPatch
)
{
IDirectMusicInstrumentImpl
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
struct
instrument
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
TRACE
(
"(%p, %ld): stub
\n
"
,
This
,
dwPatch
);
...
...
@@ -119,15 +119,15 @@ static const IDirectMusicInstrumentVtbl instrument_vtbl =
HRESULT
instrument_create
(
IDirectMusicInstrument
**
ret_iface
)
{
IDirectMusicInstrumentImpl
*
dmins
t
;
struct
instrument
*
instrumen
t
;
*
ret_iface
=
NULL
;
if
(
!
(
dminst
=
calloc
(
1
,
sizeof
(
*
dmins
t
))))
return
E_OUTOFMEMORY
;
dmins
t
->
IDirectMusicInstrument_iface
.
lpVtbl
=
&
instrument_vtbl
;
dmins
t
->
ref
=
1
;
if
(
!
(
instrument
=
calloc
(
1
,
sizeof
(
*
instrumen
t
))))
return
E_OUTOFMEMORY
;
instrumen
t
->
IDirectMusicInstrument_iface
.
lpVtbl
=
&
instrument_vtbl
;
instrumen
t
->
ref
=
1
;
TRACE
(
"Created DirectMusicInstrument %p
\n
"
,
dmins
t
);
*
ret_iface
=
&
dmins
t
->
IDirectMusicInstrument_iface
;
TRACE
(
"Created DirectMusicInstrument %p
\n
"
,
instrumen
t
);
*
ret_iface
=
&
instrumen
t
->
IDirectMusicInstrument_iface
;
return
S_OK
;
}
...
...
@@ -172,7 +172,7 @@ static inline HRESULT advance_stream(IStream *stream, ULONG bytes)
return
ret
;
}
static
HRESULT
load_region
(
IDirectMusicInstrumentImpl
*
This
,
IStream
*
stream
,
instrument_region
*
region
,
ULONG
length
)
static
HRESULT
load_region
(
struct
instrument
*
This
,
IStream
*
stream
,
instrument_region
*
region
,
ULONG
length
)
{
HRESULT
ret
;
DMUS_PRIVATE_CHUNK
chunk
;
...
...
@@ -242,7 +242,7 @@ static HRESULT load_region(IDirectMusicInstrumentImpl *This, IStream *stream, in
return
S_OK
;
}
static
HRESULT
load_articulation
(
IDirectMusicInstrumentImpl
*
This
,
IStream
*
stream
,
ULONG
length
)
static
HRESULT
load_articulation
(
struct
instrument
*
This
,
IStream
*
stream
,
ULONG
length
)
{
HRESULT
ret
;
instrument_articulation
*
articulation
;
...
...
@@ -278,7 +278,7 @@ static HRESULT load_articulation(IDirectMusicInstrumentImpl *This, IStream *stre
/* Function that loads all instrument data and which is called from IDirectMusicCollection_GetInstrument as in native */
HRESULT
instrument_load
(
IDirectMusicInstrument
*
iface
,
IStream
*
stream
)
{
IDirectMusicInstrumentImpl
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
struct
instrument
*
This
=
impl_from_IDirectMusicInstrument
(
iface
);
HRESULT
hr
;
DMUS_PRIVATE_CHUNK
chunk
;
ULONG
i
=
0
;
...
...
dlls/dmusic/port.c
View file @
0110dc24
...
...
@@ -266,7 +266,7 @@ static HRESULT WINAPI synth_port_DownloadInstrument(IDirectMusicPort *iface, IDi
IDirectMusicDownloadedInstrument
**
downloaded_instrument
,
DMUS_NOTERANGE
*
note_ranges
,
DWORD
num_note_ranges
)
{
struct
synth_port
*
This
=
synth_from_IDirectMusicPort
(
iface
);
IDirectMusicInstrumentImpl
*
instrument_object
;
struct
instrument
*
instrument_object
;
HRESULT
ret
;
BOOL
on_heap
;
HANDLE
download
;
...
...
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