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.

323 lines
14 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) 1998-1998 Microsoft Corporation
  6. //
  7. // File: score.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef __SCORE_H__
  11. #define __SCORE_H__
  12. /* Defines ============================================================*/
  13. #define INUM 16 // Number of band members
  14. #define PPQN 192 // Pulses per quarter note
  15. #define PPQNx4 ( PPQN << 2 )
  16. #define PPQN_2 ( PPQN >> 1 )
  17. #define ROOT_MIN 0 // Scale (or chord) root min and max
  18. #define ROOT_MAX 23
  19. // Section Flags, WPARAM of SECTION_STARTED/ENDED
  20. #define SECF_STOPPED_EARLY 0x0001
  21. #define SECF_IS_TRANSITION 0x0002
  22. /* Section Commands ===================================================*/
  23. #define SCTSEC_PLAY_SECTION 2
  24. #define SCTSEC_SET_ROOT 4
  25. //#define SCTSEC_SET_STYLE 6
  26. #define SCTSEC_SET_LENGTH 8
  27. #define SCTSEC_SET_REPEATS 9
  28. //#define SCTSEC_SET_PERSONALITY 15
  29. #define BAND_MELODY 0 // Use BAND flags with RTC_SET_VOLUME,
  30. #define BAND_STRING 1 // RTC_SET_PAN, RTC_SET_PATCH, SCTSEC_SET_VOLUME,
  31. #define BAND_GUITAR 2 // SCTSEC_SET_PAN and SCTSEC_SET_PATCH
  32. #define BAND_PIANO 3
  33. #define BAND_BASS 4 // These are the default SCT band members
  34. #define BAND_DRUM 5
  35. #define BAND_ALL 50
  36. #define BAND_NONE 51
  37. #define SP_A 1 // Use SP flags for templates
  38. #define SP_B 2
  39. #define SP_C 4
  40. #define SP_D 8
  41. #define SP_E 0x10
  42. #define SP_F 0x20
  43. #define SP_LETTER (SP_A | SP_B | SP_C | SP_D | SP_E | SP_F)
  44. #define SP_1 0x100
  45. #define SP_2 0x200
  46. #define SP_3 0x400
  47. #define SP_4 0x800
  48. #define SP_5 0x1000
  49. #define SP_6 0x2000
  50. #define SP_7 0x4000
  51. #define SP_ROOT (SP_1 | SP_2 | SP_3 | SP_4 | SP_5 | SP_6 | SP_7)
  52. #define SP_CADENCE 0x8000
  53. /* Band member mute flags =============================================*/
  54. #define MUTE_MELODY 0x0001 // Use MUTE flags with sctSetMutes()
  55. #define MUTE_STRING 0x0002
  56. #define MUTE_GUITAR 0x0004
  57. #define MUTE_PIANO 0x0008
  58. #define MUTE_BASS 0x0010
  59. #define MUTE_DRUM 0x0020
  60. #define MUTE_ALL 0xFFFF
  61. /* SCTchord bBits flags ===============================================*/
  62. #define CHORD_INVERT 0x10 /* This chord may be inverted */
  63. #define CHORD_FOUR 0x20 /* This should be a 4 note chord */
  64. #define CHORD_UPPER 0x40 /* Shift upper octave down */
  65. #define CHORD_SIMPLE 0x80 /* This is a simple chord */
  66. #define CHORD_COUNT 0x0F /* Number of notes in chord (up to 15) */
  67. /* MIDI status bytes ==================================================*/
  68. #define MIDI_NOTEOFF 0x80
  69. #define MIDI_NOTEON 0x90
  70. #define MIDI_PTOUCH 0xA0
  71. #define MIDI_CCHANGE 0xB0
  72. #define MIDI_PCHANGE 0xC0
  73. #define MIDI_MTOUCH 0xD0
  74. #define MIDI_PBEND 0xE0
  75. #define MIDI_SYSX 0xF0
  76. #define MIDI_MTC 0xF1
  77. #define MIDI_SONGPP 0xF2
  78. #define MIDI_SONGS 0xF3
  79. #define MIDI_EOX 0xF7
  80. #define MIDI_CLOCK 0xF8
  81. #define MIDI_START 0xFA
  82. #define MIDI_CONTINUE 0xFB
  83. #define MIDI_STOP 0xFC
  84. #define MIDI_SENSE 0xFE
  85. // Options for sctComposeTransitionEx
  86. #define TRANS_CHANGE 1 // Chord transitions to next section instead of resolving
  87. #define TRANS_LONG 2 // Transition lasts two measures, not one
  88. /* Structures maintained by SuperJAM! Technology Engine ==============*/
  89. #pragma pack(1)
  90. typedef struct SCTchord FAR *LPSCTCHORD ;
  91. typedef struct SCTchord
  92. {
  93. LPSCTCHORD pNext; /* The next chord in the list. */
  94. long lDLL1; /* Reserved for use by score.dll */
  95. long lPattern; /* Pattern that defines chord. */
  96. char achName[12]; /* Chord name. */
  97. char chDLL2; /* Reserved for use by score.dll */
  98. char chRoot; /* Root note of chord. */
  99. char chDLL3; /* Reserved for use by score.dll */
  100. char chFlat; /* Indicates root is flat. */
  101. short nDLL4; /* Reserved for use by score.dll */
  102. short nMeasure; /* Measure this chord occurs. */
  103. char chBeat; /* Beat this chord falls on. */
  104. BYTE bBits; /* Flags used when playing chord */
  105. long lScalePattern; /* Scale Pattern for the chord. */
  106. long lMelodyPattern; /* Melody Pattern for the chord. */
  107. } SCTchord ;
  108. typedef struct SCTpersonality FAR *LPSCTPERSONALITY ;
  109. typedef struct SCTpersonality
  110. {
  111. LPSCTPERSONALITY pNext ; /* Next SCTpersonality in the list. */
  112. char achName[20] ; /* Name of composition personality. */
  113. char achDescription[80];/* Description of personality. */
  114. char achUserName[20];/* Description of personality. */
  115. LPVOID lpDLL1 ; /* Reserved for use by score.dll */
  116. long lScalePattern ; /* Scale pattern used by personality*/
  117. SCTchord chord[24] ; /* 24 note chord palette. */
  118. char chDefault ; /* 0=Not default. 1=Default. */
  119. char chDLL1 ; /* Reserved for use by score.dll */
  120. } SCTpersonality ;
  121. typedef struct SCTstyle FAR *LPSCTSTYLE ;
  122. typedef struct SCTstyle
  123. {
  124. LPSCTSTYLE pNext ; /* Pointer to next SCTstyle. */
  125. LPSTR lpszFileName ; /* File name of style. */
  126. LPSTR lpszName ; /* Style name. */
  127. LPVOID lpDLL1 ; /* Reserved for use by score.dll */
  128. LPSCTPERSONALITY lpSCTpersonalityList ; /* Available personalities.*/
  129. short nBeatNote ; /* Note receiving one beat. */
  130. short nBeatsPerMeasure ; /* Beats per measure. */
  131. short nMusicTimePerBeat ;/* Music time per beat. */
  132. short nClicksPerMeasure ;/* Clicks per measure. */
  133. short nMusicTimePerClick;/* Music time per click. */
  134. short nClicksPerBeat ; /* Clicks per beat. */
  135. short nDefaultTempo ; /* Style's default tempo. */
  136. void* pIStyle; // pointer to interface, used by AA 2.0+
  137. } SCTstyle ;
  138. typedef struct SCTrealtime FAR *LPSCTREALTIME ;
  139. typedef struct SCTrealtime
  140. {
  141. short nSizeofStruct ; /* sizeof(struct SCTrealtime) */
  142. LPSCTSTYLE lpSCTstyle ; /* Style played by house band */
  143. LPSCTPERSONALITY lpSCTpersonality ; /* Active personality */
  144. short nTempo ; /* Current tempo */
  145. WORD wTempoFract ; /* Current tempo fraction (0-65535) */
  146. DWORD dwGroove ; /* Current groove */
  147. char chRoot ; /* Root note of key */
  148. char chFlat ; /* Indicates whether key is flat */
  149. char chAutoChord ; /* 0=Off, 1=On */
  150. char chAutoChordActivity ; /* Amount of chord activity */
  151. } SCTrealtime ;
  152. typedef struct SCTsectionInfo FAR *LPSCTSECTIONINFO ;
  153. typedef struct SCTsectionInfo
  154. {
  155. short nSizeofStruct ; /* sizeof(struct SCTsectionInfo) */
  156. char achName[16] ; /* Section name. */
  157. LPSCTSTYLE lpSCTstyle ; /* Style played by the section. */
  158. LPSCTPERSONALITY lpSCTpersonality ; /* Active personality. */
  159. short nTempo ; /* Section tempo. */
  160. WORD wTempoFract ; /* Section tempo fraction (0-65535) */
  161. short nNbrMeasures ; /* Nbr of measures in section. */
  162. WORD nNbrRepeats ; /* Nbr of times section repeats. */
  163. char chRoot ; /* Root note of section key. */
  164. char chFlat ; /* Indicates whether key is flat. */
  165. } SCTsectionInfo ;
  166. typedef struct SCTperformance FAR *LPSCTPERFORMANCE ;
  167. typedef struct SCTsection FAR *LPSCTSECTION ;
  168. typedef struct SCTsection
  169. {
  170. LPSCTSECTION pNext ; /* Pointer to next SCTsection */
  171. LPSTR lpszName ; /* Section name. */
  172. LPVOID lpDLL1 ; /* Reserved for use by score.dll */
  173. LPSCTPERFORMANCE lpSCTperf ; /* Section belongs to this perf. */
  174. LPSCTSTYLE lpSCTstyle ; /* Style played by the section. */
  175. LPSCTPERSONALITY lpSCTpersonality ;/* Active personality. */
  176. short nTempo ; /* Section tempo. */
  177. WORD wTempoFract ; /* Section tempo fraction (0-65535)*/
  178. short nStartingMeasure ;/* Starting measure of section. */
  179. short nNbrMeasures ; /* Nbr of measures in section. */
  180. WORD nNbrRepeats ; /* Nbr of times section repeats. */
  181. char chRoot ; /* Root note of section key. */
  182. char chFlat ; /* Indicates whether key is flat */
  183. long lStartTime ; /* Music start time of section. */
  184. void* pISection; // pointer to interface, used by AA 2.0+
  185. } SCTsection ;
  186. //DM
  187. typedef struct SCTmotif* LPSCTMOTIF;
  188. typedef struct SCTmotif
  189. {
  190. LPSCTMOTIF pNext;
  191. LPVOID lpDLL1;
  192. LPCSTR lpszName;
  193. short nMeasures;
  194. short nBeatsPerMeasure;
  195. short nClicksPerBeat;
  196. } SCTmotif;
  197. //DM - END
  198. typedef struct SCTperformance
  199. {
  200. LPSCTPERFORMANCE pNext ; /* Pointer to next SCTperformance.*/
  201. // char achSongName[20] ; /* Name of song. */
  202. LPSCTREALTIME lpSCTrealtime ; /* RealTime information. */
  203. LPVOID lpDLL1 ; /* Reserved for use by score.dll*/
  204. // short nRelVolume ; /* Relative volume. */
  205. // short nRelTempo ; /* Relative tempo. */
  206. // LPSTR lpszSongTitle;
  207. // LPSTR lpszSongAuthor;
  208. // LPSTR lpszSongCopyright;
  209. } SCTperformance ;
  210. typedef struct SCTdata FAR *LPSCTDATA ;
  211. typedef struct SCTdata
  212. {
  213. LPSCTSTYLE lpSCTstyleList ; /* List of opened styles. */
  214. LPSCTPERFORMANCE lpSCTperformanceList ; /* List of performances. */
  215. //DM
  216. LPSCTMOTIF lpSCTmotif; // pointer to list of motifs
  217. // DM - END
  218. } SCTdata ;
  219. typedef struct SCTcommand FAR *LPSCTCOMMAND ;
  220. typedef struct SCTcommand
  221. {
  222. LPSCTCOMMAND pNext ; /* The next command in the list. */
  223. long lDLL1 ; /* Reserved for use by score.dll. */
  224. short nMeasure ; /* Measure this command occurs. */
  225. DWORD dwCommand ; /* Command type. */
  226. DWORD dwChord ; /* Signpost chord. */
  227. } SCTcommand ;
  228. typedef struct SCTtemplate FAR *LPSCTTEMPLATE ;
  229. typedef struct SCTtemplate
  230. {
  231. LPSCTTEMPLATE pNext ; /* The next template in the list. */
  232. char achName[20] ; /* Template name. */
  233. char achType[20] ; /* Template type. */
  234. short nMeasures ;
  235. LPSCTCOMMAND lpSCTcommandList ; /* Template commands. */
  236. } SCTtemplate ;
  237. #pragma pack()
  238. /* Function prototypes ============================================*/
  239. LPSCTDATA WINAPI sctRegisterApplication(HWND,HWND,HINSTANCE,LPCSTR,LPDWORD,short);
  240. void WINAPI sctUnregisterApplication(LPSCTDATA);
  241. LPSCTSECTIONINFO WINAPI sctAllocSectionInfo(LPSCTPERFORMANCE,short);
  242. void WINAPI sctFreeSectionInfo(LPSCTDATA,LPSCTSECTIONINFO);
  243. DWORD WINAPI sctTimeToMeasure(LPSCTDATA,LPSCTSTYLE,DWORD);
  244. DWORD WINAPI sctTimeToMils(LPSCTDATA,DWORD,short,unsigned short);
  245. LPSCTCHORD WINAPI sctAllocChord(LPSCTDATA);
  246. void WINAPI sctFreeChord(LPSCTDATA,LPSCTCHORD);
  247. void WINAPI sctFreeChordList(LPSCTDATA,LPSCTCHORD);
  248. LPSCTCHORD WINAPI sctGetChordListCopy(LPSCTDATA,LPSCTSECTION);
  249. BOOL WINAPI sctSetChordList(LPSCTDATA,LPSCTSECTION,LPSCTCHORD);
  250. void WINAPI sctFreeCommandList(LPSCTDATA,LPSCTCOMMAND);
  251. LPSCTCOMMAND WINAPI sctGetCommandListCopy(LPSCTDATA,LPSCTSECTION);
  252. BOOL WINAPI sctSetCommandList(LPSCTDATA,LPSCTSECTION,LPSCTCOMMAND);
  253. LPSCTTEMPLATE WINAPI sctAllocTemplate(LPSCTDATA);
  254. void WINAPI sctFreeTemplate(LPSCTDATA,LPSCTTEMPLATE);
  255. BOOL WINAPI sctCreateTemplateSignPosts(LPSCTDATA,LPSCTTEMPLATE);
  256. BOOL WINAPI sctCreateTemplateEmbellishments(LPSCTDATA,LPSCTTEMPLATE,short);
  257. BOOL WINAPI sctBuildSection(LPSCTDATA,LPSCTSECTION,LPSCTPERSONALITY,short,short,short,DWORD);
  258. BOOL WINAPI sctComposeSection(LPSCTDATA,LPSCTSECTION,LPSCTTEMPLATE,LPSCTPERSONALITY,short);
  259. BOOL WINAPI sctComposeTransition(LPSCTDATA,LPSCTSECTION,LPSCTPERSONALITY,LPSCTCHORD,short,DWORD);
  260. LPSCTSECTION WINAPI sctComposeTransitionEx( LPSCTDATA, LPSCTSECTION, LPSCTSECTION, short, DWORD, DWORD );
  261. LPSCTSECTION WINAPI sctCreateSection(LPSCTPERFORMANCE,LPSCTSECTIONINFO);
  262. void WINAPI sctDeleteSection(LPSCTDATA,LPSCTSECTION, BOOL fStop = TRUE);
  263. LPSCTSECTION WINAPI sctDuplicateSection(LPSCTDATA,LPSCTSECTION);
  264. BOOL WINAPI sctQueueSectionEx( LPSCTDATA lpSCTdata, LPSCTSECTION lpSCTsection, DWORD dwStartTime );
  265. BOOL WINAPI sctSectionCommand(LPSCTDATA,LPSCTSECTION,WORD,WORD,LONG,LONG);
  266. BOOL WINAPI sctStopCurSectionASAP(LPSCTDATA);
  267. BOOL WINAPI sctStopCurSection(LPSCTDATA,short);
  268. LPSCTPERFORMANCE WINAPI sctCreatePerformance(LPSCTDATA,LPVOID);
  269. //DM
  270. BOOL WINAPI sctFreeMotif( LPSCTDATA, LPSCTMOTIF );
  271. BOOL WINAPI sctSwitchPersonality( LPSCTDATA, LPSCTSECTION, LPSCTPERSONALITY, BOOL );
  272. BOOL WINAPI sctSetQueuePrepareTime( WORD wPrepareTime );
  273. //DM - END
  274. #endif // __SCORE_H__