1 /* DirectMusic Wave 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_DSWAVE_PRIVATE_H
21 #define __WINE_DSWAVE_PRIVATE_H
33 #include "wine/debug.h"
34 #include "wine/list.h"
35 #include "wine/unicode.h"
43 /*****************************************************************************
46 typedef struct IDirectMusicWaveImpl IDirectMusicWaveImpl
;
49 /*****************************************************************************
50 * Predeclare the interface implementation structures
52 extern IUnknownVtbl DirectMusicWave_Unknown_Vtbl
;
53 extern IDirectMusicObjectVtbl DirectMusicWave_Object_Vtbl
;
54 extern IPersistStreamVtbl DirectMusicWave_PersistStream_Vtbl
;
55 extern IDirectMusicSegment8Vtbl DirectMusicWave_Segment_Vtbl
;
58 /*****************************************************************************
61 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicWaveImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
64 /*****************************************************************************
65 * IDirectMusicWaveImpl implementation structure
67 struct IDirectMusicWaveImpl
{
69 IUnknownVtbl
*UnknownVtbl
;
70 IDirectMusicSegment8Vtbl
*SegmentVtbl
;
71 IDirectMusicObjectVtbl
*ObjectVtbl
;
72 IPersistStreamVtbl
*PersistStreamVtbl
;
75 /* IDirectMusicWaveImpl fields */
76 LPDMUS_OBJECTDESC pDesc
;
81 extern HRESULT WINAPI
IDirectMusicWaveImpl_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
);
82 extern ULONG WINAPI
IDirectMusicWaveImpl_IUnknown_AddRef (LPUNKNOWN iface
);
83 extern ULONG WINAPI
IDirectMusicWaveImpl_IUnknown_Release (LPUNKNOWN iface
);
84 /* IDirectMusicSegment(8): */
85 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_QueryInterface (LPDIRECTMUSICSEGMENT8 iface
, REFIID riid
, LPVOID
*ppobj
);
86 extern ULONG WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_AddRef (LPDIRECTMUSICSEGMENT8 iface
);
87 extern ULONG WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_Release (LPDIRECTMUSICSEGMENT8 iface
);
88 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetLength (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME
* pmtLength
);
89 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetLength (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME mtLength
);
90 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetRepeats (LPDIRECTMUSICSEGMENT8 iface
, DWORD
* pdwRepeats
);
91 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetRepeats (LPDIRECTMUSICSEGMENT8 iface
, DWORD dwRepeats
);
92 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface
, DWORD
* pdwResolution
);
93 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface
, DWORD dwResolution
);
94 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetTrack (LPDIRECTMUSICSEGMENT8 iface
, REFGUID rguidType
, DWORD dwGroupBits
, DWORD dwIndex
, IDirectMusicTrack
** ppTrack
);
95 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetTrackGroup (LPDIRECTMUSICSEGMENT8 iface
, IDirectMusicTrack
* pTrack
, DWORD
* pdwGroupBits
);
96 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_InsertTrack (LPDIRECTMUSICSEGMENT8 iface
, IDirectMusicTrack
* pTrack
, DWORD dwGroupBits
);
97 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_RemoveTrack (LPDIRECTMUSICSEGMENT8 iface
, IDirectMusicTrack
* pTrack
);
98 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_InitPlay (LPDIRECTMUSICSEGMENT8 iface
, IDirectMusicSegmentState
** ppSegState
, IDirectMusicPerformance
* pPerformance
, DWORD dwFlags
);
99 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetGraph (LPDIRECTMUSICSEGMENT8 iface
, IDirectMusicGraph
** ppGraph
);
100 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetGraph (LPDIRECTMUSICSEGMENT8 iface
, IDirectMusicGraph
* pGraph
);
101 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_AddNotificationType (LPDIRECTMUSICSEGMENT8 iface
, REFGUID rguidNotificationType
);
102 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_RemoveNotificationType (LPDIRECTMUSICSEGMENT8 iface
, REFGUID rguidNotificationType
);
103 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetParam (LPDIRECTMUSICSEGMENT8 iface
, REFGUID rguidType
, DWORD dwGroupBits
, DWORD dwIndex
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
);
104 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetParam (LPDIRECTMUSICSEGMENT8 iface
, REFGUID rguidType
, DWORD dwGroupBits
, DWORD dwIndex
, MUSIC_TIME mtTime
, void* pParam
);
105 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_Clone (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicSegment
** ppSegment
);
106 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetStartPoint (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME mtStart
);
107 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetStartPoint (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME
* pmtStart
);
108 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetLoopPoints (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
);
109 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetLoopPoints (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME
* pmtStart
, MUSIC_TIME
* pmtEnd
);
110 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetPChannelsUsed (LPDIRECTMUSICSEGMENT8 iface
, DWORD dwNumPChannels
, DWORD
* paPChannels
);
111 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_SetTrackConfig (LPDIRECTMUSICSEGMENT8 iface
, REFGUID rguidTrackClassID
, DWORD dwGroupBits
, DWORD dwIndex
, DWORD dwFlagsOn
, DWORD dwFlagsOff
);
112 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_GetAudioPathConfig (LPDIRECTMUSICSEGMENT8 iface
, IUnknown
** ppAudioPathConfig
);
113 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_Compose (LPDIRECTMUSICSEGMENT8 iface
, MUSIC_TIME mtTime
, IDirectMusicSegment
* pFromSegment
, IDirectMusicSegment
* pToSegment
, IDirectMusicSegment
** ppComposedSegment
);
114 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_Download (LPDIRECTMUSICSEGMENT8 iface
, IUnknown
*pAudioPath
);
115 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicSegment8_Unload (LPDIRECTMUSICSEGMENT8 iface
, IUnknown
*pAudioPath
);
116 /* IDirectMusicObject: */
117 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface
, REFIID riid
, LPVOID
*ppobj
);
118 extern ULONG WINAPI
IDirectMusicWaveImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface
);
119 extern ULONG WINAPI
IDirectMusicWaveImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface
);
120 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
);
121 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
);
122 extern HRESULT WINAPI
IDirectMusicWaveImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface
, LPSTREAM pStream
, LPDMUS_OBJECTDESC pDesc
);
123 /* IPersistStream: */
124 extern HRESULT WINAPI
IDirectMusicWaveImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, void** ppvObject
);
125 extern ULONG WINAPI
IDirectMusicWaveImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
126 extern ULONG WINAPI
IDirectMusicWaveImpl_IPersistStream_Release (LPPERSISTSTREAM iface
);
127 extern HRESULT WINAPI
IDirectMusicWaveImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
);
128 extern HRESULT WINAPI
IDirectMusicWaveImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface
);
129 extern HRESULT WINAPI
IDirectMusicWaveImpl_IPersistStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
);
130 extern HRESULT WINAPI
IDirectMusicWaveImpl_IPersistStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
);
131 extern HRESULT WINAPI
IDirectMusicWaveImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
);
134 /*****************************************************************************
137 /* for simpler reading */
138 typedef struct _DMUS_PRIVATE_CHUNK
{
139 FOURCC fccID
; /* FOURCC ID of the chunk */
140 DWORD dwSize
; /* size of the chunk */
141 } DMUS_PRIVATE_CHUNK
, *LPDMUS_PRIVATE_CHUNK
;
143 /* used for generic dumping (copied from ddraw) */
154 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
155 #define DM_STRUCT_INIT(x) \
157 memset((x), 0, sizeof(*(x))); \
158 (x)->dwSize = sizeof(*x); \
161 #define FE(x) { x, #x }
162 #define GE(x) { &x, #x }
164 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
166 /* check whether the given DWORD is even (return 0) or odd (return 1) */
167 extern int even_or_odd (DWORD number
);
168 /* FOURCC to string conversion for debug messages */
169 extern const char *debugstr_fourcc (DWORD fourcc
);
170 /* DMUS_VERSION struct to string conversion for debug messages */
171 extern const char *debugstr_dmversion (LPDMUS_VERSION version
);
172 /* returns name of given GUID */
173 extern const char *debugstr_dmguid (const GUID
*id
);
174 /* returns name of given error code */
175 extern const char *debugstr_dmreturn (DWORD code
);
176 /* generic flags-dumping function */
177 extern const char *debugstr_flags (DWORD flags
, const flag_info
* names
, size_t num_names
);
178 extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask
);
179 /* dump whole DMUS_OBJECTDESC struct */
180 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc
);
182 #endif /* __WINE_DSWAVE_PRIVATE_H */