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
494fbc69
Commit
494fbc69
authored
Dec 24, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Dec 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Move IDirectMusicDownloadedInstrument to port.c since it is port…
dmusic: Move IDirectMusicDownloadedInstrument to port.c since it is port dependant and perform COM cleanup.
parent
0f7ed96f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
95 deletions
+81
-95
Makefile.in
dlls/dmusic/Makefile.in
+0
-1
dmusic_private.h
dlls/dmusic/dmusic_private.h
+4
-5
downloadedinstrument.c
dlls/dmusic/downloadedinstrument.c
+0
-88
port.c
dlls/dmusic/port.c
+77
-1
No files found.
dlls/dmusic/Makefile.in
View file @
494fbc69
...
...
@@ -8,7 +8,6 @@ C_SRCS = \
dmusic.c
\
dmusic_main.c
\
download.c
\
downloadedinstrument.c
\
instrument.c
\
port.c
...
...
dlls/dmusic/dmusic_private.h
View file @
494fbc69
...
...
@@ -95,7 +95,6 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl(LPCGUID lpcGUID, LP
/* Internal */
extern
HRESULT
DMUSIC_CreateDirectMusicBufferImpl
(
LPDMUS_BUFFERDESC
desc
,
LPVOID
*
ret_iface
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DMUSIC_CreateDirectMusicDownloadedInstrumentImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DMUSIC_CreateDirectMusicDownloadImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DMUSIC_CreateReferenceClockImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DMUSIC_CreateDirectMusicInstrumentImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
DECLSPEC_HIDDEN
;
...
...
@@ -136,11 +135,11 @@ struct IDirectMusicBufferImpl {
* IDirectMusicDownloadedInstrumentImpl implementation structure
*/
struct
IDirectMusicDownloadedInstrumentImpl
{
/* IUnknown fields */
const
IDirectMusicDownloadedInstrumentVtbl
*
lpVtbl
;
LONG
ref
;
/* IUnknown fields */
IDirectMusicDownloadedInstrument
IDirectMusicDownloadedInstrument_iface
;
LONG
ref
;
/* IDirectMusicDownloadedInstrumentImpl fields */
/* IDirectMusicDownloadedInstrumentImpl fields */
};
/*****************************************************************************
...
...
dlls/dmusic/downloadedinstrument.c
deleted
100644 → 0
View file @
0f7ed96f
/* IDirectMusicDownloadedInstrument 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 "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
/* IDirectMusicDownloadedInstrumentImpl IUnknown part: */
static
HRESULT
WINAPI
IDirectMusicDownloadedInstrumentImpl_QueryInterface
(
LPDIRECTMUSICDOWNLOADEDINSTRUMENT
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirectMusicDownloadedInstrumentImpl
*
This
=
(
IDirectMusicDownloadedInstrumentImpl
*
)
iface
;
TRACE
(
"(%p, %s, %p)
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDirectMusicDownloadedInstrument
)
||
IsEqualIID
(
riid
,
&
IID_IDirectMusicDownloadedInstrument8
))
{
IUnknown_AddRef
(
iface
);
*
ppobj
=
This
;
return
S_OK
;
}
WARN
(
"(%p, %s, %p): not found
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirectMusicDownloadedInstrumentImpl_AddRef
(
LPDIRECTMUSICDOWNLOADEDINSTRUMENT
iface
)
{
IDirectMusicDownloadedInstrumentImpl
*
This
=
(
IDirectMusicDownloadedInstrumentImpl
*
)
iface
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%u)
\n
"
,
This
,
refCount
-
1
);
DMUSIC_LockModule
();
return
refCount
;
}
static
ULONG
WINAPI
IDirectMusicDownloadedInstrumentImpl_Release
(
LPDIRECTMUSICDOWNLOADEDINSTRUMENT
iface
)
{
IDirectMusicDownloadedInstrumentImpl
*
This
=
(
IDirectMusicDownloadedInstrumentImpl
*
)
iface
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%u)
\n
"
,
This
,
refCount
+
1
);
if
(
!
refCount
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMUSIC_UnlockModule
();
return
refCount
;
}
/* IDirectMusicDownloadedInstrumentImpl IDirectMusicDownloadedInstrument part: */
/* none at this time */
static
const
IDirectMusicDownloadedInstrumentVtbl
DirectMusicDownloadedInstrument_Vtbl
=
{
IDirectMusicDownloadedInstrumentImpl_QueryInterface
,
IDirectMusicDownloadedInstrumentImpl_AddRef
,
IDirectMusicDownloadedInstrumentImpl_Release
};
/* for ClassFactory */
HRESULT
DMUSIC_CreateDirectMusicDownloadedInstrumentImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
{
IDirectMusicDownloadedInstrumentImpl
*
dmdlinst
;
dmdlinst
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicDownloadedInstrumentImpl
));
if
(
NULL
==
dmdlinst
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
dmdlinst
->
lpVtbl
=
&
DirectMusicDownloadedInstrument_Vtbl
;
dmdlinst
->
ref
=
0
;
/* will be inited by QueryInterface */
return
IDirectMusicDownloadedInstrumentImpl_QueryInterface
((
LPDIRECTMUSICDOWNLOADEDINSTRUMENT
)
dmdlinst
,
lpcGUID
,
ppobj
);
}
dlls/dmusic/port.c
View file @
494fbc69
...
...
@@ -23,6 +23,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dmusic
);
static
inline
IDirectMusicDownloadedInstrumentImpl
*
impl_from_IDirectMusicDownloadedInstrument
(
IDirectMusicDownloadedInstrument
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectMusicDownloadedInstrumentImpl
,
IDirectMusicDownloadedInstrument_iface
);
}
static
inline
SynthPortImpl
*
impl_from_SynthPortImpl_IDirectMusicPort
(
IDirectMusicPort
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
SynthPortImpl
,
IDirectMusicPort_iface
);
...
...
@@ -38,6 +43,77 @@ static inline SynthPortImpl *impl_from_SynthPortImpl_IDirectMusicThru(IDirectMus
return
CONTAINING_RECORD
(
iface
,
SynthPortImpl
,
IDirectMusicThru_iface
);
}
/* IDirectMusicDownloadedInstrument IUnknown part follows: */
static
HRESULT
WINAPI
IDirectMusicDownloadedInstrumentImpl_QueryInterface
(
IDirectMusicDownloadedInstrument
*
iface
,
REFIID
riid
,
VOID
**
ret_iface
)
{
TRACE
(
"(%p, %s, %p)
\n
"
,
iface
,
debugstr_dmguid
(
riid
),
ret_iface
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDirectMusicDownloadedInstrument
)
||
IsEqualIID
(
riid
,
&
IID_IDirectMusicDownloadedInstrument8
))
{
IDirectMusicDownloadedInstrument_AddRef
(
iface
);
*
ret_iface
=
iface
;
return
S_OK
;
}
WARN
(
"(%p, %s, %p): not found
\n
"
,
iface
,
debugstr_dmguid
(
riid
),
ret_iface
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirectMusicDownloadedInstrumentImpl_AddRef
(
LPDIRECTMUSICDOWNLOADEDINSTRUMENT
iface
)
{
IDirectMusicDownloadedInstrumentImpl
*
This
=
impl_from_IDirectMusicDownloadedInstrument
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
DMUSIC_LockModule
();
return
ref
;
}
static
ULONG
WINAPI
IDirectMusicDownloadedInstrumentImpl_Release
(
LPDIRECTMUSICDOWNLOADEDINSTRUMENT
iface
)
{
IDirectMusicDownloadedInstrumentImpl
*
This
=
impl_from_IDirectMusicDownloadedInstrument
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
DMUSIC_UnlockModule
();
return
ref
;
}
static
const
IDirectMusicDownloadedInstrumentVtbl
DirectMusicDownloadedInstrument_Vtbl
=
{
IDirectMusicDownloadedInstrumentImpl_QueryInterface
,
IDirectMusicDownloadedInstrumentImpl_AddRef
,
IDirectMusicDownloadedInstrumentImpl_Release
};
HRESULT
DMUSIC_CreateDirectMusicDownloadedInstrumentImpl
(
IDirectMusicDownloadedInstrument
**
instrument
)
{
IDirectMusicDownloadedInstrumentImpl
*
object
;
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
));
if
(
!
object
)
{
*
instrument
=
NULL
;
return
E_OUTOFMEMORY
;
}
object
->
IDirectMusicDownloadedInstrument_iface
.
lpVtbl
=
&
DirectMusicDownloadedInstrument_Vtbl
;
object
->
ref
=
1
;
*
instrument
=
&
object
->
IDirectMusicDownloadedInstrument_iface
;
return
S_OK
;
}
/* SynthPortImpl IDirectMusicPort IUnknown part follows: */
static
HRESULT
WINAPI
SynthPortImpl_IDirectMusicPort_QueryInterface
(
LPDIRECTMUSICPORT
iface
,
REFIID
riid
,
LPVOID
*
ret_iface
)
{
...
...
@@ -157,7 +233,7 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_DownloadInstrument(LPDIRECT
if
(
!
instrument
||
!
downloaded_instrument
||
(
num_note_ranges
&&
!
note_ranges
))
return
E_POINTER
;
return
DMUSIC_CreateDirectMusicDownloadedInstrumentImpl
(
&
IID_IDirectMusicDownloadedInstrument
,
(
LPVOID
*
)
downloaded_instrument
,
NULL
);
return
DMUSIC_CreateDirectMusicDownloadedInstrumentImpl
(
downloaded_instrument
);
}
static
HRESULT
WINAPI
SynthPortImpl_IDirectMusicPort_UnloadInstrument
(
LPDIRECTMUSICPORT
iface
,
IDirectMusicDownloadedInstrument
*
downloaded_instrument
)
...
...
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