1 /* DirectMusicBand Private Include
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __WINE_DMBAND_PRIVATE_H
21 #define __WINE_DMBAND_PRIVATE_H
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
45 /*****************************************************************************
48 typedef struct IDirectMusicBandImpl IDirectMusicBandImpl
;
50 typedef struct IDirectMusicBandTrack IDirectMusicBandTrack
;
52 /*****************************************************************************
53 * Predeclare the interface implementation structures
55 extern IUnknownVtbl DirectMusicBand_Uknown_Vtbl
;
56 extern IDirectMusicBandVtbl DirectMusicBand_Band_Vtbl
;
57 extern IDirectMusicObjectVtbl DirectMusicBand_Object_Vtbl
;
58 extern IPersistStreamVtbl DirectMusicBand_PeristStream_Vtbl
;
60 extern IUnknownVtbl DirectMusicBandTrack_Unknown_Vtbl
;
61 extern IDirectMusicTrack8Vtbl DirectMusicBandTrack_DirectMusicTrack_Vtbl
;
62 extern IPersistStreamVtbl DirectMusicBandTrack_PersistStream_Vtbl
;
64 /*****************************************************************************
67 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicBandImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
69 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicBandTrack (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
72 /*****************************************************************************
73 * Auxiliary definitions
75 /* i don't like M$'s idea about two different band item headers, so behold: universal one */
76 typedef struct _DMUS_PRIVATE_BAND_ITEM_HEADER
{
77 DWORD dwVersion
; /* 1 or 2 */
81 MUSIC_TIME lBandTimeLogical
;
82 MUSIC_TIME lBandTimePhysical
;
83 } DMUS_PRIVATE_BAND_ITEM_HEADER
;
85 typedef struct _DMUS_PRIVATE_INSTRUMENT
{
86 struct list entry
; /* for listing elements */
87 DMUS_IO_INSTRUMENT pInstrument
;
88 IDirectMusicCollection
* ppReferenceCollection
;
89 } DMUS_PRIVATE_INSTRUMENT
, *LPDMUS_PRIVATE_INSTRUMENT
;
91 typedef struct _DMUS_PRIVATE_BAND
{
92 struct list entry
; /* for listing elements */
93 DMUS_PRIVATE_BAND_ITEM_HEADER pBandHeader
;
94 IDirectMusicBandImpl
* ppBand
;
95 } DMUS_PRIVATE_BAND
, *LPDMUS_PRIVATE_BAND
;
98 /*****************************************************************************
99 * IDirectMusicBandImpl implementation structure
101 struct IDirectMusicBandImpl
{
102 /* IUnknown fields */
103 IUnknownVtbl
*UnknownVtbl
;
104 IDirectMusicBandVtbl
*BandVtbl
;
105 IDirectMusicObjectVtbl
*ObjectVtbl
;
106 IPersistStreamVtbl
*PersistStreamVtbl
;
109 /* IDirectMusicBandImpl fields */
110 LPDMUS_OBJECTDESC pDesc
;
112 struct list Instruments
;
116 extern HRESULT WINAPI
IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
);
117 extern ULONG WINAPI
IDirectMusicBandImpl_IUnknown_AddRef (LPUNKNOWN iface
);
118 extern ULONG WINAPI
IDirectMusicBandImpl_IUnknown_Release (LPUNKNOWN iface
);
119 /* IDirectMusicBand: */
120 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_QueryInterface (LPDIRECTMUSICBAND iface
, REFIID riid
, LPVOID
*ppobj
);
121 extern ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicBand_AddRef (LPDIRECTMUSICBAND iface
);
122 extern ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicBand_Release (LPDIRECTMUSICBAND iface
);
123 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_CreateSegment (LPDIRECTMUSICBAND iface
, IDirectMusicSegment
** ppSegment
);
124 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_Download (LPDIRECTMUSICBAND iface
, IDirectMusicPerformance
* pPerformance
);
125 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_Unload (LPDIRECTMUSICBAND iface
, IDirectMusicPerformance
* pPerformance
);
126 /* IDirectMusicObject: */
127 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface
, REFIID riid
, LPVOID
*ppobj
);
128 extern ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface
);
129 extern ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface
);
130 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
);
131 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
);
132 extern HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface
, LPSTREAM pStream
, LPDMUS_OBJECTDESC pDesc
);
133 /* IPersistStream: */
134 extern HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, void** ppvObject
);
135 extern ULONG WINAPI
IDirectMusicBandImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
136 extern ULONG WINAPI
IDirectMusicBandImpl_IPersistStream_Release (LPPERSISTSTREAM iface
);
137 extern HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
);
138 extern HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface
);
139 extern HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
);
140 extern HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
);
141 extern HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
);
144 /*****************************************************************************
145 * IDirectMusicBandTrack implementation structure
147 struct IDirectMusicBandTrack
{
148 /* IUnknown fields */
149 IUnknownVtbl
*UnknownVtbl
;
150 IDirectMusicTrack8Vtbl
*TrackVtbl
;
151 IPersistStreamVtbl
*PersistStreamVtbl
;
154 /* IDirectMusicBandTrack fields */
155 LPDMUS_OBJECTDESC pDesc
;
156 DMUS_IO_BAND_TRACK_HEADER header
;
163 extern HRESULT WINAPI
IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
);
164 extern ULONG WINAPI
IDirectMusicBandTrack_IUnknown_AddRef (LPUNKNOWN iface
);
165 extern ULONG WINAPI
IDirectMusicBandTrack_IUnknown_Release (LPUNKNOWN iface
);
166 /* IDirectMusicTrack(8): */
167 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
);
168 extern ULONG WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface
);
169 extern ULONG WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface
);
170 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
);
171 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrackID
, DWORD dwFlags
);
172 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
);
173 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
);
174 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
);
175 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
);
176 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
);
177 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
);
178 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
);
179 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
);
180 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
);
181 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
);
182 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
);
183 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
);
184 extern HRESULT WINAPI
IDirectMusicBandTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
);
185 /* IPersistStream: */
186 extern HRESULT WINAPI
IDirectMusicBandTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, void** ppvObject
);
187 extern ULONG WINAPI
IDirectMusicBandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
188 extern ULONG WINAPI
IDirectMusicBandTrack_IPersistStream_Release (LPPERSISTSTREAM iface
);
189 extern HRESULT WINAPI
IDirectMusicBandTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
);
190 extern HRESULT WINAPI
IDirectMusicBandTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface
);
191 extern HRESULT WINAPI
IDirectMusicBandTrack_IPersistStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
);
192 extern HRESULT WINAPI
IDirectMusicBandTrack_IPersistStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
);
193 extern HRESULT WINAPI
IDirectMusicBandTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
);
195 /**********************************************************************
196 * Dll lifetime tracking declaration for dmband.dll
198 extern LONG DMBAND_refCount
;
199 static inline void DMBAND_LockModule() { InterlockedIncrement( &DMBAND_refCount
); }
200 static inline void DMBAND_UnlockModule() { InterlockedDecrement( &DMBAND_refCount
); }
202 /*****************************************************************************
208 #endif /* __WINE_DMBAND_PRIVATE_H */