Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

395 lines
11 KiB

  1. //
  2. // DMStyleP.H
  3. //
  4. // Private include for DMStyle.DLL
  5. //
  6. // Copyright (c) 1997-1999 Microsoft Corporation
  7. //
  8. //
  9. #ifndef _DMSTYLEP_
  10. #define _DMSTYLEP_
  11. #include "dmusicf.h"
  12. #define SUBCHORD_BASS 0
  13. #define SUBCHORD_STANDARD_CHORD 1
  14. extern long g_cComponent;
  15. // Class factory
  16. //
  17. class CDirectMusicStyleFactory : public IClassFactory
  18. {
  19. public:
  20. // IUnknown
  21. //
  22. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  23. virtual STDMETHODIMP_(ULONG) AddRef();
  24. virtual STDMETHODIMP_(ULONG) Release();
  25. // Interface IClassFactory
  26. //
  27. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  28. virtual STDMETHODIMP LockServer(BOOL bLock);
  29. // Constructor
  30. //
  31. CDirectMusicStyleFactory() : m_cRef(1) {}
  32. // Destructor
  33. // ~CDirectMusicStyleFactory() {}
  34. private:
  35. long m_cRef;
  36. };
  37. class CDirectMusicSectionFactory : public IClassFactory
  38. {
  39. public:
  40. // IUnknown
  41. //
  42. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  43. virtual STDMETHODIMP_(ULONG) AddRef();
  44. virtual STDMETHODIMP_(ULONG) Release();
  45. // Interface IClassFactory
  46. //
  47. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  48. virtual STDMETHODIMP LockServer(BOOL bLock);
  49. // Constructor
  50. //
  51. CDirectMusicSectionFactory() : m_cRef(1) {}
  52. // Destructor
  53. // ~CDirectMusicSectionFactory() {}
  54. private:
  55. long m_cRef;
  56. };
  57. class CDirectMusicStyleTrackFactory : public IClassFactory
  58. {
  59. public:
  60. // IUnknown
  61. //
  62. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  63. virtual STDMETHODIMP_(ULONG) AddRef();
  64. virtual STDMETHODIMP_(ULONG) Release();
  65. // Interface IClassFactory
  66. //
  67. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  68. virtual STDMETHODIMP LockServer(BOOL bLock);
  69. // Constructor
  70. //
  71. CDirectMusicStyleTrackFactory() : m_cRef(1) {}
  72. // Destructor
  73. // ~CDirectMusicStyleTrackFactory() {}
  74. private:
  75. long m_cRef;
  76. };
  77. class CDirectMusicCommandTrackFactory : public IClassFactory
  78. {
  79. public:
  80. // IUnknown
  81. //
  82. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  83. virtual STDMETHODIMP_(ULONG) AddRef();
  84. virtual STDMETHODIMP_(ULONG) Release();
  85. // Interface IClassFactory
  86. //
  87. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  88. virtual STDMETHODIMP LockServer(BOOL bLock);
  89. // Constructor
  90. //
  91. CDirectMusicCommandTrackFactory() : m_cRef(1) {}
  92. // Destructor
  93. // ~CDirectMusicCommandTrackFactory() {}
  94. private:
  95. long m_cRef;
  96. };
  97. class CDirectMusicChordTrackFactory : public IClassFactory
  98. {
  99. public:
  100. // IUnknown
  101. //
  102. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  103. virtual STDMETHODIMP_(ULONG) AddRef();
  104. virtual STDMETHODIMP_(ULONG) Release();
  105. // Interface IClassFactory
  106. //
  107. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  108. virtual STDMETHODIMP LockServer(BOOL bLock);
  109. // Constructor
  110. //
  111. CDirectMusicChordTrackFactory() : m_cRef(1) {}
  112. // Destructor
  113. // ~CDirectMusicChordTrackFactory() {}
  114. private:
  115. long m_cRef;
  116. };
  117. class CDirectMusicMotifTrackFactory : public IClassFactory
  118. {
  119. public:
  120. // IUnknown
  121. //
  122. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  123. virtual STDMETHODIMP_(ULONG) AddRef();
  124. virtual STDMETHODIMP_(ULONG) Release();
  125. // Interface IClassFactory
  126. //
  127. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  128. virtual STDMETHODIMP LockServer(BOOL bLock);
  129. // Constructor
  130. //
  131. CDirectMusicMotifTrackFactory() : m_cRef(1) {}
  132. // Destructor
  133. // ~CDirectMusicMotifTrackFactory() {}
  134. private:
  135. long m_cRef;
  136. };
  137. class CDirectMusicMuteTrackFactory : public IClassFactory
  138. {
  139. public:
  140. // IUnknown
  141. //
  142. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  143. virtual STDMETHODIMP_(ULONG) AddRef();
  144. virtual STDMETHODIMP_(ULONG) Release();
  145. // Interface IClassFactory
  146. //
  147. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  148. virtual STDMETHODIMP LockServer(BOOL bLock);
  149. // Constructor
  150. //
  151. CDirectMusicMuteTrackFactory() : m_cRef(1) {}
  152. // Destructor
  153. // ~CDirectMusicMuteTrackFactory() {}
  154. private:
  155. long m_cRef;
  156. };
  157. class CDirectMusicAuditionTrackFactory : public IClassFactory
  158. {
  159. public:
  160. // IUnknown
  161. //
  162. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  163. virtual STDMETHODIMP_(ULONG) AddRef();
  164. virtual STDMETHODIMP_(ULONG) Release();
  165. // Interface IClassFactory
  166. //
  167. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  168. virtual STDMETHODIMP LockServer(BOOL bLock);
  169. // Constructor
  170. //
  171. CDirectMusicAuditionTrackFactory() : m_cRef(1) {}
  172. // Destructor
  173. // ~CDirectMusicAuditionTrackFactory() {}
  174. private:
  175. long m_cRef;
  176. };
  177. class CDirectMusicMelodyFormulationTrackFactory : public IClassFactory
  178. {
  179. public:
  180. // IUnknown
  181. //
  182. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  183. virtual STDMETHODIMP_(ULONG) AddRef();
  184. virtual STDMETHODIMP_(ULONG) Release();
  185. // Interface IClassFactory
  186. //
  187. virtual STDMETHODIMP CreateInstance(IUnknown* pUnknownOuter, const IID& iid, void** ppv);
  188. virtual STDMETHODIMP LockServer(BOOL bLock);
  189. // Constructor
  190. //
  191. CDirectMusicMelodyFormulationTrackFactory() : m_cRef(1) {}
  192. private:
  193. long m_cRef;
  194. };
  195. // private interfaces
  196. interface IDMSection : IUnknown
  197. {
  198. virtual HRESULT STDMETHODCALLTYPE CreateSegment(IDirectMusicSegment* pSegment)=0;
  199. virtual HRESULT STDMETHODCALLTYPE GetStyle(IUnknown** ppStyle)=0;
  200. };
  201. interface IStyleTrack : IUnknown
  202. {
  203. virtual HRESULT STDMETHODCALLTYPE SetTrack(IUnknown *pStyle)=0;
  204. virtual HRESULT STDMETHODCALLTYPE GetStyle(IUnknown **ppStyle)=0;
  205. };
  206. interface IDMStyle : IUnknown
  207. {
  208. // virtual HRESULT STDMETHODCALLTYPE GetPatternName (DWORD dwIndex, WCHAR *wszName)=0;
  209. virtual HRESULT STDMETHODCALLTYPE EnumPartGuid(
  210. DWORD dwIndex, WCHAR* wszName, DWORD dwPatternType, GUID& rGuid)=0;
  211. virtual HRESULT STDMETHODCALLTYPE GetPatternStream(
  212. WCHAR* wszName, DWORD dwPatternType, IStream** ppStream)=0;
  213. virtual HRESULT STDMETHODCALLTYPE GetStyleInfo(void **pData)=0;
  214. virtual HRESULT STDMETHODCALLTYPE IsDX8()=0;
  215. virtual HRESULT STDMETHODCALLTYPE CritSec(bool fEnter)=0;
  216. virtual HRESULT STDMETHODCALLTYPE EnumStartTime(DWORD dwIndex, DMUS_COMMAND_PARAM* pCommand, MUSIC_TIME* pmtStartTime)=0;
  217. virtual HRESULT STDMETHODCALLTYPE GenerateTrack(
  218. IDirectMusicSegment* pTempSeg,
  219. IDirectMusicSong* pSong,
  220. DWORD dwTrackGroup,
  221. IDirectMusicStyle* pStyle,
  222. IDirectMusicTrack* pMelGenTrack,
  223. MUSIC_TIME mtLength,
  224. IDirectMusicTrack*& pNewTrack)=0;
  225. // this will go into dmusici.h when melody formulation is made public
  226. /* virtual HRESULT STDMETHODCALLTYPE ComposeMelodyFromTemplate(
  227. IDirectMusicStyle* pStyle,
  228. IDirectMusicSegment* pTemplate,
  229. IDirectMusicSegment** ppSegment) = 0;*/
  230. /* Interface needs to look like this in dmusici.h
  231. STDMETHOD(ComposeMelodyFromTemplate) (THIS_ IDirectMusicStyle* pStyle,
  232. IDirectMusicSegment* pTemplate,
  233. IDirectMusicSegment** ppSegment) PURE;
  234. */
  235. };
  236. interface IMotifTrack : IUnknown
  237. {
  238. virtual HRESULT STDMETHODCALLTYPE SetTrack(IUnknown *pStyle, void* pPattern)=0;
  239. };
  240. interface IPrivatePatternTrack : IUnknown
  241. {
  242. virtual HRESULT STDMETHODCALLTYPE SetPattern(
  243. IDirectMusicSegmentState* pSegState,
  244. IStream* pStream,
  245. DWORD* pdwLength)=0;
  246. virtual HRESULT STDMETHODCALLTYPE SetVariationByGUID(
  247. IDirectMusicSegmentState* pSegState,
  248. DWORD dwVariationFlags,
  249. REFGUID rguidPart,
  250. DWORD dwPChannel)=0;
  251. };
  252. ///////////////////////////////////////////////////////////////////////////////////////
  253. /*
  254. #define IAuditionTrack IDirectMusicPatternTrack
  255. #define IID_IAuditionTrack IID_IDirectMusicPatternTrack
  256. */
  257. DEFINE_GUID( IID_IAuditionTrack,
  258. 0x9dc278c0, 0x9cb0, 0x11d1, 0xa7, 0xce, 0x0, 0xa0, 0xc9, 0x13, 0xf7, 0x3c );
  259. interface IAuditionTrack : IUnknown
  260. {
  261. virtual HRESULT STDMETHODCALLTYPE CreateSegment(
  262. IDirectMusicStyle* pStyle, IDirectMusicSegment** ppSegment)=0;
  263. virtual HRESULT STDMETHODCALLTYPE SetPattern(
  264. IDirectMusicSegmentState* pSegState, IStream* pStream, DWORD* pdwLength)=0;
  265. virtual HRESULT STDMETHODCALLTYPE SetVariation(
  266. IDirectMusicSegmentState* pSegState, DWORD dwVariationFlags, WORD wPart)=0;
  267. };
  268. #define CLSID_DirectMusicAuditionTrack CLSID_DirectMusicPatternTrack
  269. #define DMUS_PCHANNEL_MUTE 0xffffffff
  270. // the following constants represent time in 100 nanosecond increments
  271. #define REF_PER_MIL 10000 // For converting from reference time to mils
  272. #define MARGIN_MIN (100 * REF_PER_MIL) //
  273. #define MARGIN_MAX (400 * REF_PER_MIL) //
  274. #define PREPARE_TIME (m_dwPrepareTime * REF_PER_MIL) // Time
  275. #define NEARTIME (100 * REF_PER_MIL)
  276. #define NEARMARGIN (REALTIME_RES * REF_PER_MIL)
  277. // private CLSIDs and IIDs
  278. DEFINE_GUID(IID_IDMSection,
  279. 0x3F037240,0x414E,0x11D1, 0xA7,0xCE,0x00,0xA0,0xC9,0x13,0xF7,0x3C);
  280. DEFINE_GUID(IID_IStyleTrack,
  281. 0x3F037246,0x414E,0x11D1, 0xA7,0xCE,0x00,0xA0,0xC9,0x13,0xF7,0x3C);
  282. DEFINE_GUID(IID_IDMStyle,
  283. 0x4D7F3661,0x43D6,0x11D1, 0xA7,0xCE,0x00,0xA0,0xC9,0x13,0xF7,0x3C);
  284. DEFINE_GUID(IID_IMotifTrack,
  285. 0x7AE499C1,0x51FE,0x11D1, 0xA7,0xCE,0x00,0xA0,0xC9,0x13,0xF7,0x3C);
  286. DEFINE_GUID(IID_IMuteTrack,
  287. 0xbc242fc1, 0xad1d, 0x11d1, 0xa7, 0xce, 0x0, 0xa0, 0xc9, 0x13, 0xf7, 0x3c);
  288. DEFINE_GUID(IID_IPrivatePatternTrack,
  289. 0x7a8e9c33, 0x5901, 0x4f20, 0x92, 0xde, 0x3a, 0x5b, 0x3e, 0x33, 0xe2, 0x14);
  290. DEFINE_GUID(CLSID_DMSection,
  291. 0x3F037241,0x414E,0x11D1, 0xA7,0xCE,0x00,0xA0,0xC9,0x13,0xF7,0x3C);
  292. // GUID and param struct for private version of GetParam (get style Time Signature,
  293. // getting commands and chords from current segment)
  294. struct SegmentTimeSig
  295. {
  296. IDirectMusicSegment* pSegment; // Segment passed in
  297. DMUS_TIMESIGNATURE TimeSig; // Time sig returned
  298. };
  299. DEFINE_GUID(GUID_SegmentTimeSig, 0x76612507, 0x4f37, 0x4b35, 0x80, 0x92, 0x50, 0x48, 0x4e, 0xd4, 0xba, 0x92);
  300. // Private melody fragment stuff
  301. // Used to get a repeated melody fragment
  302. DEFINE_GUID(GUID_MelodyFragmentRepeat, 0x8cc92764, 0xf81c, 0x11d2, 0x81, 0x45, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
  303. // This is obslolete and should not be public
  304. #define DMUS_FOURCC_MELODYGEN_TRACK_CHUNK mmioFOURCC( 'm', 'g', 'e', 'n' )
  305. /*
  306. // This is obslolete and should not be public
  307. // <mgen-ck>
  308. 'mgen'
  309. (
  310. //sizeof DMUS_IO_MELODY_FRAGMENT: DWORD
  311. <DMUS_IO_MELODY_FRAGMENT>...
  312. )
  313. */
  314. // GUID for private chord notifications
  315. DEFINE_GUID(GUID_NOTIFICATION_PRIVATE_CHORD, 0xf5c19571, 0x7e1e, 0x4fff, 0xb9, 0x49, 0x7f, 0x74, 0xa6, 0x6f, 0xdf, 0xc0);
  316. // (Private) Guid for getting a style from a pattern track
  317. DEFINE_GUID(GUID_IDirectMusicPatternStyle, 0x689821f4, 0xb3bc, 0x44dd, 0x80, 0xd4, 0xc, 0xf3, 0x2f, 0xe4, 0xd2, 0x1b);
  318. #endif