blob: c31164f4d2937881a0b905367dfe9b695b477535 [file] [log] [blame]
Rok Mandeljc473c5652003-07-21 22:10:14 +00001/* DirectMusicScript Private Include
2 *
Rok Mandeljc0382ea12004-01-20 00:21:40 +00003 * Copyright (C) 2003-2004 Rok Mandeljc
Rok Mandeljc473c5652003-07-21 22:10:14 +00004 *
Alexandre Julliard7718d2b2007-05-30 12:54:07 +02005 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
Rok Mandeljc473c5652003-07-21 22:10:14 +00009 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Alexandre Julliard7718d2b2007-05-30 12:54:07 +020012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
Rok Mandeljc473c5652003-07-21 22:10:14 +000014 *
Alexandre Julliard7718d2b2007-05-30 12:54:07 +020015 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Rok Mandeljc473c5652003-07-21 22:10:14 +000018 */
19
20#ifndef __WINE_DMSCRIPT_PRIVATE_H
21#define __WINE_DMSCRIPT_PRIVATE_H
22
Rok Mandeljcb26d65b2004-02-25 01:30:03 +000023#include <stdio.h>
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000024#include <stdarg.h>
Rok Mandeljcb26d65b2004-02-25 01:30:03 +000025#include <string.h>
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000026
Francois Gougetbf72af32004-08-11 19:43:45 +000027#define COBJMACROS
28
Rok Mandeljc473c5652003-07-21 22:10:14 +000029#include "windef.h"
Rok Mandeljc473c5652003-07-21 22:10:14 +000030#include "winbase.h"
31#include "winnt.h"
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000032#include "wingdi.h"
Rok Mandeljc0382ea12004-01-20 00:21:40 +000033#include "winuser.h"
34
35#include "wine/debug.h"
36#include "wine/list.h"
37#include "wine/unicode.h"
38#include "winreg.h"
Alexandre Julliard25e2a322004-08-22 21:38:46 +000039#include "objbase.h"
Rok Mandeljc0382ea12004-01-20 00:21:40 +000040
Rok Mandeljc473c5652003-07-21 22:10:14 +000041#include "dmusici.h"
Rok Mandeljc473c5652003-07-21 22:10:14 +000042#include "dmusicf.h"
Rok Mandeljc0382ea12004-01-20 00:21:40 +000043#include "dmusics.h"
Rok Mandeljc473c5652003-07-21 22:10:14 +000044
45/*****************************************************************************
46 * Interfaces
47 */
48typedef struct IDirectMusicScriptImpl IDirectMusicScriptImpl;
49
Rok Mandeljcdf167d12003-08-22 23:53:27 +000050typedef struct IDirectMusicScriptTrack IDirectMusicScriptTrack;
Rok Mandeljcdf167d12003-08-22 23:53:27 +000051
Rok Mandeljc473c5652003-07-21 22:10:14 +000052/*****************************************************************************
Rok Mandeljc473c5652003-07-21 22:10:14 +000053 * ClassFactory
Rok Mandeljc473c5652003-07-21 22:10:14 +000054 */
Marcus Meissnerf3015962011-05-13 16:58:10 +020055extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
Rok Mandeljc473c5652003-07-21 22:10:14 +000056
Marcus Meissnerf3015962011-05-13 16:58:10 +020057extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
Rok Mandeljcdf167d12003-08-22 23:53:27 +000058
Rok Mandeljc473c5652003-07-21 22:10:14 +000059/*****************************************************************************
60 * IDirectMusicScriptImpl implementation structure
61 */
Rok Mandeljc0382ea12004-01-20 00:21:40 +000062struct IDirectMusicScriptImpl {
Rok Mandeljc473c5652003-07-21 22:10:14 +000063 /* IUnknown fields */
Dmitry Timoshkov247246e2005-05-30 10:01:08 +000064 const IUnknownVtbl *UnknownVtbl;
65 const IDirectMusicScriptVtbl *ScriptVtbl;
66 const IDirectMusicObjectVtbl *ObjectVtbl;
67 const IPersistStreamVtbl *PersistStreamVtbl;
Mike McCormackc4479392005-07-12 17:03:19 +000068 LONG ref;
Rok Mandeljc473c5652003-07-21 22:10:14 +000069
70 /* IDirectMusicScriptImpl fields */
Raphael Junqueirac77788b2004-05-10 19:56:17 +000071 IDirectMusicPerformance* pPerformance;
Rok Mandeljcdf167d12003-08-22 23:53:27 +000072 LPDMUS_OBJECTDESC pDesc;
Raphael Junqueirab9989192004-03-09 19:21:33 +000073 DMUS_IO_SCRIPT_HEADER* pHeader;
74 DMUS_IO_VERSION* pVersion;
75 WCHAR* pwzLanguage;
76 WCHAR* pwzSource;
Rok Mandeljcdf167d12003-08-22 23:53:27 +000077};
78
Rok Mandeljcdf167d12003-08-22 23:53:27 +000079/*****************************************************************************
80 * IDirectMusicScriptTrack implementation structure
81 */
Rok Mandeljc0382ea12004-01-20 00:21:40 +000082struct IDirectMusicScriptTrack {
Rok Mandeljcdf167d12003-08-22 23:53:27 +000083 /* IUnknown fields */
Dmitry Timoshkov247246e2005-05-30 10:01:08 +000084 const IUnknownVtbl *UnknownVtbl;
85 const IDirectMusicTrack8Vtbl *TrackVtbl;
86 const IPersistStreamVtbl *PersistStreamVtbl;
Mike McCormackc4479392005-07-12 17:03:19 +000087 LONG ref;
Rok Mandeljcdf167d12003-08-22 23:53:27 +000088
89 /* IDirectMusicScriptTrack fields */
Rok Mandeljc0382ea12004-01-20 00:21:40 +000090 LPDMUS_OBJECTDESC pDesc;
Rok Mandeljcdf167d12003-08-22 23:53:27 +000091};
92
James Hawkins0994b852005-02-02 09:31:28 +000093/**********************************************************************
94 * Dll lifetime tracking declaration for dmscript.dll
95 */
Marcus Meissnerf3015962011-05-13 16:58:10 +020096extern LONG DMSCRIPT_refCount DECLSPEC_HIDDEN;
Stefan Huehnerac6f5622005-06-20 14:18:03 +000097static inline void DMSCRIPT_LockModule(void) { InterlockedIncrement( &DMSCRIPT_refCount ); }
98static inline void DMSCRIPT_UnlockModule(void) { InterlockedDecrement( &DMSCRIPT_refCount ); }
Rok Mandeljcdf167d12003-08-22 23:53:27 +000099
100/*****************************************************************************
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000101 * Misc.
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000102 */
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000103/* for simpler reading */
104typedef struct _DMUS_PRIVATE_CHUNK {
105 FOURCC fccID; /* FOURCC ID of the chunk */
106 DWORD dwSize; /* size of the chunk */
107} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000108
Rok Mandeljcb26d65b2004-02-25 01:30:03 +0000109/* used for generic dumping (copied from ddraw) */
110typedef struct {
111 DWORD val;
112 const char* name;
113} flag_info;
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000114
Rok Mandeljcb26d65b2004-02-25 01:30:03 +0000115typedef struct {
116 const GUID *guid;
117 const char* name;
118} guid_info;
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000119
120/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
121#define DM_STRUCT_INIT(x) \
122 do { \
123 memset((x), 0, sizeof(*(x))); \
124 (x)->dwSize = sizeof(*x); \
125 } while (0)
126
Rok Mandeljcb26d65b2004-02-25 01:30:03 +0000127#define FE(x) { x, #x }
128#define GE(x) { &x, #x }
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000129
Alexandre Julliard936198c2004-08-13 00:44:22 +0000130#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
131
Rok Mandeljcb26d65b2004-02-25 01:30:03 +0000132/* FOURCC to string conversion for debug messages */
Marcus Meissnerf3015962011-05-13 16:58:10 +0200133extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
Rok Mandeljcb26d65b2004-02-25 01:30:03 +0000134/* returns name of given GUID */
Marcus Meissnerf3015962011-05-13 16:58:10 +0200135extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
Rok Mandeljcb26d65b2004-02-25 01:30:03 +0000136/* dump whole DMUS_OBJECTDESC struct */
Marcus Meissnerf3015962011-05-13 16:58:10 +0200137extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000138
Rok Mandeljc473c5652003-07-21 22:10:14 +0000139#endif /* __WINE_DMSCRIPT_PRIVATE_H */