Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 1 | /* DirectMusicScript Private Include |
| 2 | * |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 3 | * Copyright (C) 2003-2004 Rok Mandeljc |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 4 | * |
Alexandre Julliard | 7718d2b | 2007-05-30 12:54:07 +0200 | [diff] [blame] | 5 | * 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 Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 9 | * |
| 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 Julliard | 7718d2b | 2007-05-30 12:54:07 +0200 | [diff] [blame] | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 14 | * |
Alexandre Julliard | 7718d2b | 2007-05-30 12:54:07 +0200 | [diff] [blame] | 15 | * 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 Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef __WINE_DMSCRIPT_PRIVATE_H |
| 21 | #define __WINE_DMSCRIPT_PRIVATE_H |
| 22 | |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 23 | #include <stdio.h> |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 24 | #include <stdarg.h> |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 25 | #include <string.h> |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 26 | |
Francois Gouget | bf72af3 | 2004-08-11 19:43:45 +0000 | [diff] [blame] | 27 | #define COBJMACROS |
| 28 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 29 | #include "windef.h" |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 30 | #include "winbase.h" |
| 31 | #include "winnt.h" |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 32 | #include "wingdi.h" |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 33 | #include "winuser.h" |
| 34 | |
| 35 | #include "wine/debug.h" |
| 36 | #include "wine/list.h" |
| 37 | #include "wine/unicode.h" |
| 38 | #include "winreg.h" |
Alexandre Julliard | 25e2a32 | 2004-08-22 21:38:46 +0000 | [diff] [blame] | 39 | #include "objbase.h" |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 40 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 41 | #include "dmusici.h" |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 42 | #include "dmusicf.h" |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 43 | #include "dmusics.h" |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 44 | |
| 45 | /***************************************************************************** |
| 46 | * Interfaces |
| 47 | */ |
| 48 | typedef struct IDirectMusicScriptImpl IDirectMusicScriptImpl; |
| 49 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 50 | typedef struct IDirectMusicScriptTrack IDirectMusicScriptTrack; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 51 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 52 | /***************************************************************************** |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 53 | * ClassFactory |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 54 | */ |
Marcus Meissner | f301596 | 2011-05-13 16:58:10 +0200 | [diff] [blame] | 55 | extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN; |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 56 | |
Marcus Meissner | f301596 | 2011-05-13 16:58:10 +0200 | [diff] [blame] | 57 | extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 58 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 59 | /***************************************************************************** |
| 60 | * IDirectMusicScriptImpl implementation structure |
| 61 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 62 | struct IDirectMusicScriptImpl { |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 63 | /* IUnknown fields */ |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 64 | const IUnknownVtbl *UnknownVtbl; |
| 65 | const IDirectMusicScriptVtbl *ScriptVtbl; |
| 66 | const IDirectMusicObjectVtbl *ObjectVtbl; |
| 67 | const IPersistStreamVtbl *PersistStreamVtbl; |
Mike McCormack | c447939 | 2005-07-12 17:03:19 +0000 | [diff] [blame] | 68 | LONG ref; |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 69 | |
| 70 | /* IDirectMusicScriptImpl fields */ |
Raphael Junqueira | c77788b | 2004-05-10 19:56:17 +0000 | [diff] [blame] | 71 | IDirectMusicPerformance* pPerformance; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 72 | LPDMUS_OBJECTDESC pDesc; |
Raphael Junqueira | b998919 | 2004-03-09 19:21:33 +0000 | [diff] [blame] | 73 | DMUS_IO_SCRIPT_HEADER* pHeader; |
| 74 | DMUS_IO_VERSION* pVersion; |
| 75 | WCHAR* pwzLanguage; |
| 76 | WCHAR* pwzSource; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 77 | }; |
| 78 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 79 | /***************************************************************************** |
| 80 | * IDirectMusicScriptTrack implementation structure |
| 81 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 82 | struct IDirectMusicScriptTrack { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 83 | /* IUnknown fields */ |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 84 | const IUnknownVtbl *UnknownVtbl; |
| 85 | const IDirectMusicTrack8Vtbl *TrackVtbl; |
| 86 | const IPersistStreamVtbl *PersistStreamVtbl; |
Mike McCormack | c447939 | 2005-07-12 17:03:19 +0000 | [diff] [blame] | 87 | LONG ref; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 88 | |
| 89 | /* IDirectMusicScriptTrack fields */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 90 | LPDMUS_OBJECTDESC pDesc; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 91 | }; |
| 92 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 93 | /********************************************************************** |
| 94 | * Dll lifetime tracking declaration for dmscript.dll |
| 95 | */ |
Marcus Meissner | f301596 | 2011-05-13 16:58:10 +0200 | [diff] [blame] | 96 | extern LONG DMSCRIPT_refCount DECLSPEC_HIDDEN; |
Stefan Huehner | ac6f562 | 2005-06-20 14:18:03 +0000 | [diff] [blame] | 97 | static inline void DMSCRIPT_LockModule(void) { InterlockedIncrement( &DMSCRIPT_refCount ); } |
| 98 | static inline void DMSCRIPT_UnlockModule(void) { InterlockedDecrement( &DMSCRIPT_refCount ); } |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 99 | |
| 100 | /***************************************************************************** |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 101 | * Misc. |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 102 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 103 | /* for simpler reading */ |
| 104 | typedef 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 Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 108 | |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 109 | /* used for generic dumping (copied from ddraw) */ |
| 110 | typedef struct { |
| 111 | DWORD val; |
| 112 | const char* name; |
| 113 | } flag_info; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 114 | |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 115 | typedef struct { |
| 116 | const GUID *guid; |
| 117 | const char* name; |
| 118 | } guid_info; |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 119 | |
| 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 Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 127 | #define FE(x) { x, #x } |
| 128 | #define GE(x) { &x, #x } |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 129 | |
Alexandre Julliard | 936198c | 2004-08-13 00:44:22 +0000 | [diff] [blame] | 130 | #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) |
| 131 | |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 132 | /* FOURCC to string conversion for debug messages */ |
Marcus Meissner | f301596 | 2011-05-13 16:58:10 +0200 | [diff] [blame] | 133 | extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN; |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 134 | /* returns name of given GUID */ |
Marcus Meissner | f301596 | 2011-05-13 16:58:10 +0200 | [diff] [blame] | 135 | extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN; |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 136 | /* dump whole DMUS_OBJECTDESC struct */ |
Marcus Meissner | f301596 | 2011-05-13 16:58:10 +0200 | [diff] [blame] | 137 | extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 138 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 139 | #endif /* __WINE_DMSCRIPT_PRIVATE_H */ |