Morph-SynRJ
view sndDetect.cxx @ 0:22de913c2d84
morph-synrj intro
| author | "Cedric Pinson <cedric.pinson@alcove.fr> <mornifle@plopbyte.net>" |
|---|---|
| date | Tue Nov 27 15:23:52 2007 +0100 (2007-11-27) |
| parents | |
| children |
line source
2 #include "sndDetect.h"
4 // MiniFmod ...
5 extern FMUSIC_MODULE * intro_mod;
8 sndDetect :: sndDetect()
9 {
10 // Nada !
11 }
13 sndDetect :: ~sndDetect()
14 {
15 // Nada !
16 }
18 SamplesData sndDetect :: GetSampleData( enum SamplesDef sample )
19 {
21 SamplesData result;
22 result.playing = false;
24 switch( sample )
25 {
26 /*
27 * Bass Sync ...
28 */
29 case INST_BASS:
31 switch( FMUSIC_GetOrder( intro_mod ) )
32 {
33 case 0:
34 case 1:
35 case 2:
37 switch( FMUSIC_GetRow( intro_mod ) )
38 {
39 case 0:
40 case 6:
41 case 12:
42 case 48:
43 case 54:
44 case 60:
45 result.playing = true;
46 result.volume = 1.0f;
47 break;
48 }
49 break;
51 case 3:
52 case 4:
53 case 5:
54 case 6:
56 switch( FMUSIC_GetRow( intro_mod ) )
57 {
58 case 0:
59 case 6:
60 case 12:
61 case 60:
62 result.playing = true;
63 result.volume = 1.0f;
64 break;
66 case 54:
67 result.playing = true;
68 result.volume = 0.6f;
69 break;
70 }
71 break;
73 case 7:
75 switch( FMUSIC_GetRow( intro_mod ) )
76 {
77 case 0:
78 case 6:
79 case 12:
80 case 32:
81 case 48:
82 result.playing = true;
83 result.volume = 1.0f;
84 break;
85 }
86 break;
88 }
89 break;
91 case INST_HHAT:
93 switch( FMUSIC_GetOrder( intro_mod ) )
94 {
95 case 2:
96 case 3:
97 case 4:
98 case 5:
99 case 6:
101 if( !( FMUSIC_GetRow( intro_mod ) % 2 ) )
102 {
103 result.playing = true;
105 if( !( FMUSIC_GetRow( intro_mod ) %4 ) )
107 result.volume = 1.0f;
108 else
109 result.volume = 0.25f;
110 }
111 else
112 {
113 if( FMUSIC_GetRow( intro_mod ) == 63 )
114 {
115 result.playing = true;
116 result.volume = 0.5f;
117 }
118 }
120 break;
122 case 7:
124 if( !( FMUSIC_GetRow( intro_mod ) % 2 ) && ( FMUSIC_GetRow( intro_mod ) <= 56 ) )
125 {
126 result.playing = true;
128 if( !( FMUSIC_GetRow( intro_mod ) %4 ) )
130 result.volume = 1.0f;
131 else
132 result.volume = 0.25f;
133 }
134 else
135 {
136 switch( FMUSIC_GetRow( intro_mod ) )
137 {
138 case 7:
139 case 23:
140 case 37:
141 case 47:
142 case 59:
143 result.playing = true;
144 result.volume = 0.5f;
145 break;
146 case 62:
147 result.playing = true;
148 result.volume = 0.25f;
149 break;
150 }
151 }
153 break;
154 }
156 break;
158 case INST_BDRUM:
160 switch( FMUSIC_GetOrder( intro_mod ) )
161 {
162 case 2:
164 switch( FMUSIC_GetRow( intro_mod ) )
165 {
166 case 62:
167 result.playing = true;
168 result.volume = 1.0f;
169 break;
170 case 61:
171 result.playing = true;
172 result.volume = 0.25f;
173 break;
174 }
175 break;
177 case 3:
178 case 5:
180 switch( FMUSIC_GetRow( intro_mod ) )
181 {
182 case 0:
183 case 6:
184 case 16:
185 case 26:
186 case 32:
187 case 42:
188 case 48:
189 case 58:
190 case 62:
191 result.playing = true;
192 result.volume = 1.0f;
193 break;
194 case 19:
195 case 61:
196 result.playing = true;
197 result.volume = 0.25f;
198 break;
199 }
200 break;
202 case 4:
203 case 6:
205 switch( FMUSIC_GetRow( intro_mod ) )
206 {
207 case 0:
208 case 10:
209 case 16:
210 case 26:
211 case 32:
212 case 42:
213 case 48:
214 case 58:
215 case 62:
216 result.playing = true;
217 result.volume = 1.0f;
218 break;
219 case 19:
220 case 61:
221 result.playing = true;
222 result.volume = 0.25f;
223 break;
224 }
225 break;
227 case 7:
229 switch( FMUSIC_GetRow( intro_mod ) )
230 {
231 case 0:
232 case 6:
233 case 16:
234 case 26:
235 case 32:
236 case 42:
237 case 48:
238 result.playing = true;
239 result.volume = 1.0f;
240 break;
241 case 3:
242 case 9:
243 case 19:
244 case 51:
245 result.playing = true;
246 result.volume = 0.25f;
247 break;
248 }
250 break;
252 case 0x0E:
253 case 0x0F:
254 case 0x10:
255 case 0x11:
256 case 0x12:
257 case 0x13:
258 case 0x14:
260 if( ( FMUSIC_GetRow( intro_mod ) % 16 ) == 0 )
261 result.playing = true;
263 break;
265 }
267 break;
269 case INST_SNARE:
271 switch( FMUSIC_GetOrder( intro_mod ) )
272 {
273 case 2:
275 switch( FMUSIC_GetRow( intro_mod ) )
276 {
277 case 60:
278 result.playing = true;
279 result.volume = 1.0f;
280 break;
281 case 63:
282 result.playing = true;
283 result.volume = 0.5f;
284 break;
285 }
287 break;
289 case 3:
290 case 5:
292 switch( FMUSIC_GetRow( intro_mod ) )
293 {
294 case 4:
295 case 10:
296 case 20:
297 case 28:
298 case 36:
299 case 44:
300 case 52:
301 case 60:
302 result.playing = true;
303 result.volume = 1.0f;
304 break;
305 case 7:
306 case 31:
307 case 47:
308 case 63:
309 result.playing = true;
310 result.volume = 0.25f;
311 break;
312 }
314 break;
316 case 4:
317 case 6:
319 switch( FMUSIC_GetRow( intro_mod ) )
320 {
321 case 4:
322 case 12:
323 case 20:
324 case 28:
325 case 36:
326 case 44:
327 case 52:
328 case 60:
329 result.playing = true;
330 result.volume = 1.0f;
331 break;
332 case 7:
333 case 27:
334 case 31:
335 case 47:
336 result.playing = true;
337 result.volume = 0.25f;
338 break;
339 }
341 break;
343 case 7:
345 switch( FMUSIC_GetRow( intro_mod ) )
346 {
347 case 4:
348 case 10:
349 case 20:
350 case 28:
351 case 36:
352 case 38:
353 case 44:
354 case 52:
355 result.playing = true;
356 result.volume = 1.0f;
357 break;
358 case 7:
359 case 13:
360 case 31:
361 case 41:
362 case 47:
363 result.playing = true;
364 result.volume = 0.25f;
365 break;
366 }
368 break;
370 case 0x0a:
371 case 0x0c:
373 switch( FMUSIC_GetRow( intro_mod ) )
374 {
375 case 4:
376 case 10:
377 case 20:
378 case 28:
379 case 31:
380 case 36:
381 case 38:
382 case 44:
383 case 52:
384 case 60:
385 case 62:
386 case 63:
387 result.playing = true;
388 break;
389 }
391 break;
393 case 0x0b:
395 switch( FMUSIC_GetRow( intro_mod ) )
396 {
397 case 4:
398 case 10:
399 case 20:
400 case 28:
401 case 31:
402 case 36:
403 case 38:
404 case 44:
405 case 52:
406 case 60:
407 case 63:
408 result.playing = true;
409 break;
410 }
412 break;
414 case 0x0d:
416 switch( FMUSIC_GetRow( intro_mod ) )
417 {
418 case 4:
419 case 10:
420 case 20:
421 case 28:
422 case 31:
423 case 36:
424 case 38:
425 case 44:
426 case 54:
427 case 57:
428 case 60:
429 result.playing = true;
430 break;
431 }
433 break;
435 }
437 break;
439 case INST_SBDRUM:
441 switch( FMUSIC_GetOrder( intro_mod ) )
442 {
443 case 3:
444 case 5:
446 switch( FMUSIC_GetRow( intro_mod ) )
447 {
448 case 12:
449 case 23:
450 case 39:
451 case 46:
452 case 55:
453 result.playing = true;
454 result.volume = 1.0f;
455 break;
456 }
458 break;
460 case 4:
461 case 6:
463 switch( FMUSIC_GetRow( intro_mod ) )
464 {
465 case 23:
466 case 30:
467 case 39:
468 case 46:
469 case 55:
470 result.playing = true;
471 result.volume = 1.0f;
472 break;
473 }
475 break;
477 case 7:
479 switch( FMUSIC_GetRow( intro_mod ) )
480 {
481 case 12:
482 case 23:
483 case 39:
484 case 46:
485 case 55:
486 result.playing = true;
487 result.volume = 1.0f;
488 break;
489 case 59:
490 result.playing = true;
491 result.volume = 0.5f;
492 break;
493 case 61:
494 result.playing = true;
495 result.volume = 0.25f;
496 break;
497 }
499 break;
501 }
503 break;
505 case INST_NAP1:
507 if( ( FMUSIC_GetRow( intro_mod ) < 32 ) && ( FMUSIC_GetOrder( intro_mod ) < 8 ) )
508 result.playing = true;
510 break;
512 case INST_NAP2:
514 if( ( FMUSIC_GetRow( intro_mod ) >= 32 ) && ( FMUSIC_GetOrder( intro_mod ) < 7 ) )
515 result.playing = true;
517 break;
519 case INST_BIGBD:
521 switch( FMUSIC_GetOrder( intro_mod ) )
522 {
523 case 10:
524 case 12:
525 switch( FMUSIC_GetRow( intro_mod ) )
526 {
527 case 0:
528 case 12:
529 case 16:
530 case 26:
531 case 32:
532 case 42:
533 case 48:
534 case 58:
535 case 61:
536 result.playing = true;
537 break;
538 }
540 break;
542 case 11:
543 switch( FMUSIC_GetRow( intro_mod ) )
544 {
545 case 0:
546 case 12:
547 case 16:
548 case 26:
549 case 32:
550 case 42:
551 case 48:
552 case 58:
553 case 62:
554 result.playing = true;
555 break;
556 }
558 break;
560 case 13:
561 switch( FMUSIC_GetRow( intro_mod ) )
562 {
563 case 0:
564 case 12:
565 case 16:
566 case 26:
567 case 32:
568 case 42:
569 case 48:
570 result.playing = true;
571 break;
572 }
574 break;
576 case 0x15:
577 case 0x16:
578 case 0x17:
579 case 0x18:
580 case 0x19:
581 case 0x1a:
582 case 0x1b:
583 case 0x1c:
584 if( ( FMUSIC_GetRow( intro_mod ) % 8 ) == 0 )
585 result.playing = true;
587 break;
588 }
591 break;
593 case INST_GROOVE:
595 switch( FMUSIC_GetOrder( intro_mod ) )
596 {
598 case 0x08:
599 case 0x09:
600 case 0x0a:
601 case 0x0b:
602 case 0x0c:
604 switch( FMUSIC_GetRow( intro_mod ) )
605 {
606 case 2:
607 case 8:
608 case 18:
609 case 24:
610 case 34:
611 case 40:
612 case 50:
613 case 56:
614 result.playing = true;
616 break;
617 }
619 break;
621 case 0x0d:
623 switch( FMUSIC_GetRow( intro_mod ) )
624 {
625 case 2:
626 case 8:
627 case 18:
628 case 24:
629 case 34:
630 case 40:
631 result.playing = true;
633 break;
634 }
636 break;
638 }
640 break;
642 }
644 return result;
646 }
648 bool sndDetect :: InFxScreen1( void )
649 {
650 if( ( FMUSIC_GetOrder( intro_mod ) >=0 ) &&
651 ( FMUSIC_GetOrder( intro_mod ) <=7 ) )
652 return true;
653 else
654 return false;
655 }
657 bool sndDetect :: InFxScreen2( void )
658 {
659 if( ( FMUSIC_GetOrder( intro_mod ) >= 8 ) &&
660 ( FMUSIC_GetOrder( intro_mod ) <= 13 ) )
661 return true;
662 else
663 return false;
664 }
