-
Notifications
You must be signed in to change notification settings - Fork 9
/
126f9792-4493-44e9-9c66-e3364773f388.mop
985 lines (985 loc) · 58.3 KB
/
126f9792-4493-44e9-9c66-e3364773f388.mop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
{
"Name": "SOAStateMachine",
"_id": "126f9792-4493-44e9-9c66-e3364773f388",
"Namespace": "projects.scene-org.logic",
"Description": "Selects one input by using index of the given inputs.\r\nIndex 0 selects the first given input.",
"Inputs": [
{
"Name": "Input",
"MetaInstanceID": "3af3cb69-8145-45ba-ae17-48f10b38131d",
"DefaultValue": {
"Type": "Generic",
"Value": "Framefield.Core.Generic"
},
"MetaID": "9f831cf2-a1ec-41f4-ba80-cced9736af6b",
"IsMultiInput": "False",
"Relevance": "Required",
"Description": "",
"Min": "-100000",
"Max": "100000",
"Scale": "0.1",
"ScaleType": "Linear",
"EnumValues": []
},
{
"Name": "Index",
"MetaInstanceID": "a1a70538-1abc-4fc6-b458-fb5bcab90877",
"DefaultValue": {
"Type": "Float",
"Value": "0"
},
"MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
"IsMultiInput": "False",
"Relevance": "Relevant",
"Description": "",
"Min": "0",
"Max": "100000",
"Scale": "1",
"ScaleType": "Linear",
"EnumValues": []
},
{
"Name": "CategoriesCSV",
"MetaInstanceID": "fa4a3811-53cc-40a3-a02e-521036aeec53",
"DefaultValue": {
"Type": "Text",
"Value": ""
},
"MetaID": "c522a66e-3260-4692-b3e3-79fd0361fa3d",
"IsMultiInput": "False",
"Relevance": "Required",
"Description": "",
"Min": "-100000",
"Max": "100000",
"Scale": "0.1",
"ScaleType": "Linear",
"EnumValues": []
}
],
"Outputs": [
{
"Name": "Output",
"MetaInstanceID": "43850c12-31eb-4f9e-b1f0-46cd826a77f6",
"MetaID": "9f831cf2-a1ec-41f4-ba80-cced9736af6b"
}
],
"OperatorParts": [
{
"MetaInstanceID": "2d8c339f-153e-40e8-98cd-16b0ca36099d",
"MetaID": "6fc49842-5352-422a-967f-9d9b6e09255f",
"Name": "SOAStateMachineFunc",
"Version": "be210b44-a0d2-4c78-8e6e-d5fc907a413d",
"Type": "Generic",
"IsMultiInput": "True",
"Script": [
"//>>> _using",
"using System;",
"using System.Collections.Generic;",
"using System.Linq;",
"using System.Text;",
"using SharpDX;",
"using SharpDX.Direct3D11;",
"using SharpDX.Windows;",
"//<<< _using",
"using System.ComponentModel;",
"using Framefield.Core;",
"using System.IO;",
"using Un4seen.Bass;",
"using System.Windows.Forms;",
"using Framefield.Core.Inputs;",
"",
"namespace Framefield.Core.ID6fc49842_5352_422a_967f_9d9b6e09255f",
"{",
"",
" ",
" public static class MainScenes",
" {",
" static public int",
" OFF=0,",
" INTRO=1,",
" BACKGROUND=2;",
" }",
"",
" public class Nominee",
" {",
" public Nominee() {",
" if(Width == 0) Width= 1280;",
" if(Height == 0) Height = 720;",
" }",
" public string Name { get; set; }",
" public string Group { get; set; }",
" public string FileName { get; set; } /* .mp4, *.mp3, *.wav */",
" public float ExtractStart { get; set; }",
" public int Height {get; set;}",
" public int Width {get; set;}",
" }",
"",
" public class Category",
" {",
" public string Name { get; set; }",
" public string FileName { get; set; }",
" public List<Nominee> Nominees { get; set; }",
" public string Description {get;set;}",
" public int Winner { get; set; }",
" }",
"",
" public class Class_SOAStateMachine : OperatorPart.Function, Framefield.Core.OperatorPartTraits.ITimeAccessor",
" {",
" //>>> _inputids",
" private enum InputId",
" {",
" Input = 0,",
" Index = 1,",
" CategoriesCSV = 2",
" }",
" //<<< _inputids",
"",
" static public bool InvalidData { get; set; }",
" ",
" static public List<Category> CategoriesAndNominees = new List<Category> {",
" new Category(){ Name = \"Breakthrough Performance\", FileName=\"BreakthruPerformance\", Winner=4,",
" Description=\"A person or group who raised their personal bar significantly during the year. This can be a newcomer group or someone receiving deserved attention after rising above mediocrity.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Base Case\", Group=\"Live!\", FileName=\"base-case-by-live\", Width= 800, Height=544, ExtractStart=5 },",
" new Nominee() { Name=\"Batman Forever\", Group=\"Batman Group\", FileName=\"batman-forever-by-batman-group\" , Width= 1024, Height=720},",
" new Nominee() { Name=\"Confetti\", Group=\"Nonoil & Brainstorm\", FileName=\"confetti-by-nonoil-and-brainstorm\", ExtractStart=72},",
" new Nominee() { Name=\"Exodus\", Group=\"#cubernicus\", FileName=\"exodus-by-cubernicus\", Width= 640, Height=480, ExtractStart=121 },",
" new Nominee() { Name=\"MGC 2011 Demo\", Group=\"Retroactive\", FileName=\"mgc-by-retroactive\", Width= 640, Height=334, ExtractStart=123},",
" new Nominee() { Name=\"Calyx\", Group=\"Penumbra\", FileName=\"calyx-by-penumbra\", ExtractStart=121 },",
" }},",
" ",
" new Category(){ Name = \"Most Original Concept\", FileName=\"MostOriginalConcept\", Winner=0,",
" Description=\"Most original work in the context of the demoscene. New ideas, innovative use of technology or a new approach in direction or overall style. Can include experimental works or doing simply the unexpected.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Beta\", Group=\"Still\", FileName=\"beta-by-still\", ExtractStart=35},",
" new Nominee() { Name=\"Earworm\", Group=\"JCO & Neuro\", FileName=\"earworm-by-jco\", ExtractStart=15},",
" new Nominee() { Name=\"Haxholm\", Group=\"Loonies & Brainstorm\", FileName=\"haxholm-by-loonies-and-brainstorm\", ExtractStart=128},",
" new Nominee() { Name=\"Spheres on a Plane\", Group=\"Dead Roman\", FileName=\"sphere-on-a-plane-by-dead-roman\", ExtractStart=188},",
" new Nominee() { Name=\"You Are Lucy\", Group=\"Spaceballs\", FileName=\"you-are-lucy-by-spaceballs\", Width= 640, Height=383, ExtractStart=121},",
" new Nominee() { Name=\"D - Four\", Group=\"Ctrl-Alt-Test\", FileName=\"d-four-by-ctrl-alt-test\", ExtractStart=76},",
" }},",
" new Category(){ Name = \"Best Technical Achievement\", FileName=\"BestTechnicalAchievement\", Winner=0,",
" Description=\"Most technically advanced or impressive work. This could be cramming lots of stuff into a really small space, doing crazy things on crazy platforms, or having complex and impressive rendering techniques in a demo.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Batman Forever\", Group=\"Batman Group\", FileName=\"batman-forever-by-batman-group\", Width= 1024, Height=720, ExtractStart=360},",
" new Nominee() { Name=\"Code Is My Pron\", Group=\"Nuance\", FileName=\"code-is-my-pron-by-nuance\", ExtractStart=70},",
" new Nominee() { Name=\"Numb Res\", Group=\"CNCD & Fairlight\", FileName=\"numb-res-by-fairlight\", ExtractStart=213},",
" new Nominee() { Name=\"Prince of Persia C64\", Group=\"Mr. SID\", FileName=\"prince-of-persia-by-mr-sid\", Width= 480, Height=340},",
" new Nominee() { Name=\"Uncovering Static\", Group=\"Fairlight & Alcatraz\", FileName=\"uncovering-static-by-fairlight\", ExtractStart=35},",
" new Nominee() { Name=\"Just Dance 64\", Group=\"Algotech\", FileName=\"just-dance-by-algotech\", Width= 640, Height=480, ExtractStart=92},",
" }},",
" ",
" new Category(){ Name = \"Best Effects\", FileName=\"BestEffects\", Winner=1, ",
" Description=\"The most innovative use of new effects, pushing the boundaries of existing effects or making something amazing within the context of realtime graphics. Effects can be technically advanced rendering or simply a novel visual expression.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"DUBrovnik\", Group=\"Gammel Opland af 1891\", FileName=\"dubrovnik-by-gammel-opland\", ExtractStart=72},",
" new Nominee() { Name=\"Numb Res\", Group=\"CNCD & Fairlight\", FileName=\"numb-res-by-fairlight\", ExtractStart=214},",
" new Nominee() { Name=\"Shake off the Dust\", Group=\"Elude\", FileName=\"shake-off-the-dust-by-elude\", ExtractStart=225},",
" new Nominee() { Name=\"Spin\", Group=\"Andromeda Software Development\", FileName=\"spin-by-asd\", ExtractStart=165},",
" new Nominee() { Name=\"Uncovering Static\", Group=\"Fairlight & Alcatraz\", FileName=\"uncovering-static-by-fairlight\", ExtractStart=228},",
" new Nominee() { Name=\"Fermion\", Group=\"Kewlers\", FileName=\"fermion-by-kewlers\", ExtractStart=192},",
" }},",
"",
" new Category(){ Name = \"Best Graphics\", FileName=\"BestGraphics\", Winner=5,",
" Description=\"The highest quality and most innovative use of graphical content in a demo. This includes painted 2D graphics, 3D modelling and texturing.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Azathioprine\", Group=\"Alcatraz\", FileName=\"azathioprine-by-alcatraz\", Width= 1024, Height=720, ExtractStart=110},",
" new Nominee() { Name=\"Batman Forever\", Group=\"Batman Group\", FileName=\"batman-forever-by-batman-group\", ExtractStart=197},",
" new Nominee() { Name=\"Dream Travel 90%\", Group=\"Samar Productions\", FileName=\"dream-travel-by-samar-productions\", Width= 480, Height=340, ExtractStart=422},",
" new Nominee() { Name=\"Grandma\", Group=\"Rustbloom\", FileName=\"grandma-by-rustbloom\"},",
" new Nominee() { Name=\"Superhero vs Supervillain tUM 2011 invitation\", Group=\"Rebels\", FileName=\"superhero-vs-supervillain-by-rebels\", ExtractStart=90},",
" new Nominee() { Name=\"Human Traffic\", Group=\"Ghostown & Loonies\", FileName=\"human-traffic-by-ghostown-and-loonies\", ExtractStart=35},",
" }},",
"",
" new Category(){ Name = \"Best Soundtrack\", FileName=\"BestSoundtrack\", Winner=5,",
" Description=\"The most outstanding soundtrack in a demo. A solid work both when it comes to craftmanship (mixing, quality of sound) and originality. A soundtrack that supports its demo well and contributes to the viewing experience.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Haxholm\", Group=\"Loonies & Brainstorm\", FileName=\"haxholm-by-loonies-and-brainstorm\", ExtractStart=35},",
" new Nominee() { Name=\"Human Traffic\", Group=\"Ghostown & Loonies\", FileName=\"human-traffic-by-ghostown-and-loonies\", ExtractStart=90},",
" new Nominee() { Name=\"Shake off the Dust\", Group=\"Elude\", FileName=\"shake-off-the-dust-by-elude\", ExtractStart=97},",
" new Nominee() { Name=\"Spin\", Group=\"Andromeda Software Development\", FileName=\"spin-by-asd\", ExtractStart=134},",
" new Nominee() { Name=\"Struct\", Group=\"Outracks\", FileName=\"struct-by-outracks\"},",
" new Nominee() { Name=\"Numb Res\", Group=\"CNCD & Fairlight\", FileName=\"numb-res-by-fairlight\", ExtractStart=245},",
" }},",
" new Category(){ Name = \"Best Direction\", FileName=\"BestDirection\", Winner=1,",
" Description=\"The most outstanding direction in a demo. Direction is about execution, story or flow - about making all the elements of a production fit together in a coherent way.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Beta\", Group=\"Still\", FileName=\"beta-by-still\"},",
" new Nominee() { Name=\"Numb Res\", Group=\"CNCD & Fairlight\", FileName=\"numb-res-by-fairlight\", ExtractStart=190},",
" new Nominee() { Name=\"Spin\", Group=\"Andromeda Software Development\", FileName=\"spin-by-asd\", ExtractStart=204}, ",
" new Nominee() { Name=\"The Butterfly Effect\", Group=\"Andromeda Software Development\", FileName=\"the-butterfly-effect-by-asd\", ExtractStart=200},",
" new Nominee() { Name=\"Uncovering Static\", Group=\"Fairlight & Alcatraz\", FileName=\"uncovering-static-by-fairlight\", ExtractStart=35},",
" new Nominee() { Name=\"Spheres on a Plane\", Group=\"Dead Roman\", FileName=\"sphere-on-a-plane-by-dead-roman\", ExtractStart=91},",
" }},",
" new Category(){ Name = \"Best 4k Intro\", FileName=\"Best4k\", Winner=0,",
" Description=\"Most outstanding intro of the year in 4 kilobytes. A work that is aesthetically on a new level, considering the limits of 4k, or is otherwise pushing the limits of 4k intros.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Chaos Theory 4k (KK remix)\", Group=\"DMA\", FileName=\"chaos-theory-remix-by-dma\"},",
" new Nominee() { Name=\"Code Is My Pron\", Group=\"Nuance\", FileName=\"code-is-my-pron-by-nuance\", ExtractStart=97},",
" new Nominee() { Name=\"Michigan\", Group=\"Loonies\", FileName=\"michigan-by-loonies\"},",
" new Nominee() { Name=\"Sumu\", Group=\"Cubicle\", FileName=\"sumu-by-cubicle\", ExtractStart=97},",
" new Nominee() { Name=\"Wishful Seedling\", Group=\"Fnuque & Loonies\", FileName=\"wishful-seedling-by-funque-and-loonies\", ExtractStart=128},",
" new Nominee() { Name=\"Anglerfish\", Group=\"Cubicle\", FileName=\"anglerfish-by-cubicle\", ExtractStart=65},",
" }},",
" new Category(){ Name = \"Best 64k Intro\", FileName=\"Best64k\", Winner=3,",
" Description=\"Most outstanding intro of the year in 64 kilobytes. An intro that has an impressive amount of content for its size, as well as being entertaining in its own right.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Epsilon\", Group=\"Mercury\", FileName=\"epsilon-by-mercury\"},",
" new Nominee() { Name=\"Pandora\", Group=\"Brain Control\", FileName=\"pandora-by-brain-control\"},",
" new Nominee() { Name=\"Transplant\", Group=\"Brain Control & Still\", FileName=\"transplant-by-brain-control\"},",
" new Nominee() { Name=\"Uncovering Static\", Group=\"Fairlight & Alcatraz\", FileName=\"uncovering-static-by-fairlight\"},",
" new Nominee() { Name=\"Chaos Constructions 2011 Invitation\", Group=\"Quite\", FileName=\"chaos-constructions-invitation-by-quite\"},",
" }},",
" new Category(){ Name = \"Oldschool Platform\", FileName=\"BestOldschool\", Winner=3,",
" Description=\"Most outstanding demo on an oldschool platform. Limited to old platforms from the early nineties or before with very limited computational power, where special hardware tricks are necessary to produce a pleasing result.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"2011 - A Press Space Odyssey\", Group=\"Offence\", FileName=\"a-press-space-odyssey-by-offence\", Width= 480, Height=360, ExtractStart=434},",
" new Nominee() { Name=\"Apparatus\", Group=\"Miracles & Lepsi Developments\", FileName=\"apparatus-by-miracle-and-lepsi-developments\", ExtractStart=102},",
" new Nominee() { Name=\"Base Case\", Group=\"Live!\", FileName=\"base-case-by-live\", Width= 800, Height=544, ExtractStart=3 },",
" new Nominee() { Name=\"Batman Forever\", Group=\"Batman Group\", FileName=\"batman-forever-by-batman-group\", Width= 1024, Height=720, ExtractStart=488 },",
" new Nominee() { Name=\"Dream Travel 90%\", Group=\"Samar Productions\", FileName=\"dream-travel-by-samar-productions\", Width= 480, Height=340, ExtractStart=72 },",
" new Nominee() { Name=\"We Are Mature\", Group=\"Fairlight\", FileName=\"we-are-mature-by-fairlight\", ExtractStart=285},",
" }},",
" new Category(){ Name = \"Best Demo\", FileName=\"BestDemo\", Winner=1,",
" Description=\"Most outstanding realtime demo of the year. A work that is solid on all fronts - visually, musically and direction-wise - and gives a good overall viewing experience.\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Human Traffic\", Group=\"Ghostown & Loonies\", FileName=\"human-traffic-by-ghostown-and-loonies\", Width= 1152, Height=720 , ExtractStart=147},",
" new Nominee() { Name=\"Numb Res\", Group=\"CNCD & Fairlight\", FileName=\"numb-res-by-fairlight\", ExtractStart=128},",
" new Nominee() { Name=\"Shake off the Dust\", Group=\"Elude\", FileName=\"shake-off-the-dust-by-elude\", ExtractStart=60},",
" new Nominee() { Name=\"Struct\", Group=\"Outracks\", FileName=\"struct-by-outracks\", ExtractStart=120},",
" new Nominee() { Name=\"We Crave Sustenance\", Group=\"PlayPsyCo\", FileName=\"we-crave-substance-by-playpsyco\", ExtractStart=180},",
" new Nominee() { Name=\"Spin\", Group=\"Andromeda Software Development\", FileName=\"spin-by-asd\"},",
" }},",
" new Category(){ Name = \"Public Choice\", FileName=\"PublicChoice\", Winner=0,",
" Description=\"Most popular demoscene release of the year voted by the public audience. That means YOU!\",",
" Nominees= new List<Nominee> {",
" new Nominee() { Name=\"Batman Forever\", Group=\"Batman Group\", FileName=\"batman-forever-by-batman-group\", Width= 1024, Height=720, ExtractStart=455},",
" new Nominee() { Name=\"D - Four\", Group=\"Ctrl-Alt-Test\", FileName=\"d-four-by-ctrl-alt-test\", ExtractStart=35},",
" new Nominee() { Name=\"Human Traffic\", Group=\"Ghostown & Loonies\", FileName=\"human-traffic-by-ghostown-and-loonies\", Width= 1152, Height=720, ExtractStart=125 },",
" new Nominee() { Name=\"Numb Res\", Group=\"CNCD & Fairlight\", FileName=\"numb-res-by-fairlight\", ExtractStart=240},",
" new Nominee() { Name=\"Pirates of the 777 Seas\", Group=\"Razor 1911\", FileName=\"pirates-of-the-777-seas-by-razor1911\", ExtractStart=240},",
" new Nominee() { Name=\"Shake off the Dust\", Group=\"Elude\", FileName=\"shake-off-the-dust-by-elude\", ExtractStart=65},",
" new Nominee() { Name=\"Spin\", Group=\"Andromeda Software Development\", FileName=\"spin-by-asd\", ExtractStart=185},",
" new Nominee() { Name=\"The Butterfly Effect\", Group=\"Andromeda Software Development\", FileName=\"the-butterfly-effect-by-asd\", ExtractStart=120},",
" new Nominee() { Name=\"Uncovering Static\", Group=\"Fairlight & Alcatraz\", FileName=\"uncovering-static-by-fairlight\", ExtractStart=219},",
" new Nominee() { Name=\"We Have Accidently Borrowed Your Votedisk\", Group=\"Razor 1911\", FileName=\"we-have-accidently-borrowed-your-votedisk-by-razor1911\"},",
" }}, ",
" };",
"",
" static public int CategoryIndex = 0;",
" static public int NomineeIndex = 0;",
"",
" public Class_SOAStateMachine() {",
" Input.Keyboard.KeyPressedEvent += new KeyboardInput.KeyDelegate(HandleKeyboardKeyPressedEvent);",
" Input.Keyboard.KeyReleasedEvent += new KeyboardInput.KeyDelegate(HandleKeyboardKeyReleasedEvent);",
"",
" //SoundPlayers[\"intro\"] = new SoundPlayer(\"./assets-scene-awards/voiceovers/BaseCase_by_Live.wav\");",
" SoundPlayers[\"intro\"] = new SoundPlayer(\"./assets/awards/music/soa_intro.mp3\");",
" SoundPlayers[\"bg\"] = new SoundPlayer(\"./assets/awards/music/soa_bg.mp3\");",
" SoundPlayers[\"voiceover\"] = new SoundPlayer(\"./assets/awards/music/soa_bg.mp3\");",
" SoundPlayers[\"soundtrack\"] = new SoundPlayer(\"./assets/awards/music/soa_bg.mp3\");",
"",
" currentState = new OffState();",
" currentState.OnEnter();",
" }",
"",
" public static void SetState(Type newState) {",
" currentState.OnPass();",
" Logger.Info(\"StateMachine >> Enter state {0}\", newState);",
" currentState = Activator.CreateInstance(newState) as SimpleState;",
" currentState.OnEnter();",
" StateSwitchTime= currentTime;",
" }",
"",
" bool _ExitTriggered = false;",
" bool _ContinueTriggered = false;",
"",
"",
" void HandleKeyboardKeyPressedEvent(object o, KeyboardInput.KeyEventArgs e) {",
" if (currentState != null) {",
" if (!currentState.OnKeyPressed(e)) {",
" if (e.Keys == Keys.Enter) {",
" _ContinueTriggered = true;",
" }",
" else if (e.Keys == Keys.Q) {",
" if (currentState.ExitState != null) {",
" _ExitTriggered=true;",
" ",
" }",
" }",
" }",
" }",
" }",
" void HandleKeyboardKeyReleasedEvent(object o, KeyboardInput.KeyEventArgs e) {",
" }",
"",
"",
" List<List<string>> SplitCSV(string line)",
" {",
" bool escapeActive = false;",
" bool quoteActive = false;",
" List<List<string>> result = new List<List<string>>();",
" var lineStrings = new List<string>();",
" string token = \"\";",
" foreach (char c in line)",
" {",
" if (c == '\\\\') {",
" if (escapeActive) {",
" token += c; ",
" }",
" else {",
" escapeActive = true;",
" }",
" } ",
" else if (c == '\"') {",
" if (escapeActive) {",
" token += c;",
" } else if (quoteActive) {",
" quoteActive = false;",
" } else {",
" quoteActive = true;",
" }",
" } else if (c == ',') {",
" if (quoteActive) {",
" token += c;",
" } else {",
" lineStrings.Add(token);",
" token = \"\";",
" }",
" }",
" else if (c == '\\n') {",
" if (quoteActive) {",
" token += c;",
" }",
" else {",
" lineStrings.Add(token);",
" token = String.Empty;",
" result.Add(lineStrings);",
" lineStrings = new List<string>();",
" }",
" }",
" else {",
" token += c;",
" }",
" }",
" if (!String.IsNullOrEmpty(token)) {",
" lineStrings.Add(token);",
" result.Add(lineStrings);",
" }",
" return result;",
" }",
"",
" Dictionary<string, int> KeysFromHeadline(List<string> headlineStrings) {",
" int id = 0;",
" Dictionary<string, int> result = new Dictionary<string, int>();",
" foreach (var s in headlineStrings) {",
" result[s] = id++;",
" }",
" return result;",
" }",
"",
" public void UpdateWinnersFromCSV(string csv) {",
" return;",
"// if(csv != _keepCategoriesCSV) {",
"// InvalidData = false;",
"// _keepCategoriesCSV = csv;",
"// Logger.Info(this,\"Updateing winners from CSV\");",
"//",
"// if (csv != \"\") {",
"// var lineStrings = SplitCSV(csv);",
"// var keyIds = KeysFromHeadline(lineStrings[0]);",
"// if (!keyIds.ContainsKey(\"CategoryID\") || !keyIds.ContainsKey(\"WinnerID\")) {",
"// Logger.Warn(this,\"Invalid category csv fileformat. CategoryID or WinnerID not found\");",
"// InvalidData = true;",
"// }",
"// else {",
"//",
"// Dictionary<string, string> categoryWinnerIds = new Dictionary<string, string>();",
"//",
"// for (int i = 1; i < lineStrings.Count; i++) {",
"// var ls = lineStrings[i];",
"// string catId = ls[keyIds[\"CategoryID\"]];",
"// string winnerId = ls[keyIds[\"WinnerID\"]];",
"// categoryWinnerIds[catId] = winnerId;",
"// }",
"//",
"// foreach (var c in CategoriesAndNominees) {",
"// if (categoryWinnerIds.ContainsKey(c.FileName)) {",
"// int id = 0;",
"// foreach (var n in c.Nominees) {",
"// if (n.FileName == categoryWinnerIds[c.FileName]) {",
"// break;",
"// }",
"// else {",
"// id++; ",
"// }",
"// }",
"// if (id < c.Nominees.Count) {",
"// c.Winner = id;",
"// }",
"// else {",
"// Logger.Warn(this,String.Format(\"WinnerID {0} not found in Category {1}\", categoryWinnerIds[c.FileName], c.FileName));",
"// InvalidData = true;",
"// }",
"// }",
"// }",
"// }",
"// }",
"// Logger.Info(this,\"...completed\");",
"// }",
" }",
"// private string _keepCategoriesCSV=\"\";",
"",
" public override OperatorPartContext Eval(OperatorPartContext context, List<OperatorPart> inputs, int outputIdx) {",
" ",
" //>>> _params",
" var Input = inputs[(int)InputId.Input];",
" var Index = inputs[(int)InputId.Index].Eval(context).Value;",
" var CategoriesCSV = inputs[(int)InputId.CategoriesCSV].Eval(context).Text;",
" //<<< _params ",
" ",
" //UpdateWinnersFromCSV(CategoriesCSV);",
" ",
" currentTime= context.Time;",
"",
" if (currentState != null) {",
" currentState.OnFrame();",
"",
" if (currentState.Duration != 0 && currentState.NextState != null) {",
" if (currentTime - StateSwitchTime > currentState.Duration) {",
" SetState(currentState.NextState);",
" }",
" }",
" }",
"",
" if (_ExitTriggered) {",
" currentState.OnExit();",
" SetState(currentState.ExitState);",
" _ExitTriggered = false;",
" }",
" if (_ContinueTriggered) {",
" if (currentState.NextState != null) {",
" SetState(currentState.NextState);",
" }",
" _ContinueTriggered= false;",
" }",
"",
" SoundPlayers[\"bg\"].SetVolume((float)backgroundLoopVolumeAnimator.GetValue(currentTime));",
"",
" context.Variables[\"RingFocus\"] = (float) ringFocusAnimator.GetValue(context.Time);",
" context.Variables[\"CategoryTypeAnim\"] = (float) categoryDescriptionAnimator.GetValue(context.Time);",
" context.Variables[\"CategoryId\"] = CategoryIndex;",
" context.Variables[\"NomineeId\"] = NomineeIndex;",
" context.Variables[\"InvalidData\"] = InvalidData?1:0;",
"",
" NomineeIndex = Math.Min(NomineeIndex, CategoriesAndNominees[CategoryIndex].Nominees.Count);",
" NomineeFileName= CategoriesAndNominees[CategoryIndex].Nominees[NomineeIndex].FileName;",
" context.Objects[\"NomineeFileName\"] = NomineeFileName;",
" context.Objects[\"CategoryName\"] = CategoriesAndNominees[CategoryIndex].Name;",
" context.Objects[\"CategoryDescription\"] = CategoriesAndNominees[CategoryIndex].Description;",
" context.Objects[\"ReleaseName\"] = CategoriesAndNominees[CategoryIndex].Nominees[NomineeIndex].Name;",
" context.Objects[\"GroupName\"] = CategoriesAndNominees[CategoryIndex].Nominees[NomineeIndex].Group;",
"",
"",
" foreach (var k in FloatVariables.Keys) {",
" context.Variables[k]= FloatVariables[k];",
" }",
" foreach (var k in StringVariables.Keys) {",
" context.Objects[k]= StringVariables[k];",
" }",
"",
" Input.Eval(context);",
" return context;",
" }",
" static public string NomineeFileName { get; set; }",
" static public Dictionary<String, float> FloatVariables = new Dictionary<string, float>();",
" static public Dictionary<String, string> StringVariables = new Dictionary<string, string>();",
" //static public Dictionary<String, object> GenericVariables = new Dictionary<string, object>();",
" static public Dictionary<String, SoundPlayer> SoundPlayers = new Dictionary<string, SoundPlayer>();",
"",
" static public SmoothInterpolator ringFocusAnimator = new SmoothInterpolator(defaultValue:0, acceleration:0.4, delta:0.001);",
" static public SmoothInterpolator categoryDescriptionAnimator = new SmoothInterpolator(0, acceleration:0.6, delta:0.001);",
" static public SmoothInterpolator backgroundLoopVolumeAnimator = new SmoothInterpolator(defaultValue:1, acceleration:0.1 );",
"",
" static public SimpleState currentState { get; set; }",
" static public float currentTime = 0;",
" static public float StateSwitchTime { get; set; }",
" }",
"",
" //---------------------------------------------------------------------------------",
"",
"",
" public class OffState : SimpleState",
" {",
" public OffState()",
" : base() {",
" NextState= typeof(IntroState);",
" }",
" override public void OnEnter() {",
" Class_SOAStateMachine.FloatVariables[\"MainSceneId\"] = MainScenes.OFF;",
" Class_SOAStateMachine.SoundPlayers[\"intro\"].Stop();",
" Class_SOAStateMachine.SoundPlayers[\"bg\"].Stop();",
" Class_SOAStateMachine.SoundPlayers[\"voiceover\"].Stop();",
" }",
" }",
"",
"",
" public class IntroState : SimpleState",
" {",
" public IntroState()",
" : base() {",
" NextState= typeof(BackgroundState);",
" ExitState= typeof(OffState);",
" Duration = 185.0; ",
" }",
"",
" override public void OnEnter() {",
" Class_SOAStateMachine.FloatVariables[\"MainSceneId\"] = MainScenes.INTRO;",
" Class_SOAStateMachine.FloatVariables[\"StateEnterTime\"] = Class_SOAStateMachine.currentTime;",
" Class_SOAStateMachine.SoundPlayers[\"intro\"].Play(); ",
" }",
"",
" public override void OnPass() {",
" base.OnPass();",
" Class_SOAStateMachine.SoundPlayers[\"bg\"].Play(loop: true);",
" Class_SOAStateMachine.SoundPlayers[\"bg\"].SetVolume(0.2f);",
" //SOAStateMachine.FloatVariables[\"StateEnterTime\"] = SOAStateMachine.currentTime;",
" }",
"",
" public override void OnExit() {",
" base.OnExit();",
" Class_SOAStateMachine.SoundPlayers[\"intro\"].Stop();",
" }",
" }",
"",
"",
" public class BackgroundState : SimpleState",
" {",
" public static int _autoTestCategoryIndex=0;",
"",
" public BackgroundState()",
" : base() {",
" //NextState= typeof(CategoryIntroState);",
" ExitState = typeof(OffState);",
" }",
"",
" override public void OnEnter() {",
" Class_SOAStateMachine.FloatVariables[\"MainSceneId\"] = MainScenes.BACKGROUND;",
"",
" Class_SOAStateMachine.FloatVariables[\"NomineeMaxTime\"] = 0.0f;",
" Class_SOAStateMachine.SoundPlayers[\"intro\"].Stop();",
" Class_SOAStateMachine.ringFocusAnimator.AnimateTo(0);",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(0);",
"",
" // Continue on caps lock (autotest)",
" if( Control.IsKeyLocked(Keys.CapsLock) ) {",
" Class_SOAStateMachine.CategoryIndex = _autoTestCategoryIndex;",
" _autoTestCategoryIndex++;",
" if (_autoTestCategoryIndex > 11) {",
" _autoTestCategoryIndex =0;",
" }",
" NextState = typeof(CategoryIntroState);",
" Duration = 2;",
" }",
"",
" }",
" // Toggle categories by keyboard",
" public override bool OnKeyPressed(KeyboardInput.KeyEventArgs e) {",
" switch (e.Keys) {",
" case Keys.D1: Class_SOAStateMachine.CategoryIndex = 0; break;",
" case Keys.D2: Class_SOAStateMachine.CategoryIndex = 1; break;",
" case Keys.D3: Class_SOAStateMachine.CategoryIndex = 2; break;",
" case Keys.D4: Class_SOAStateMachine.CategoryIndex = 3; break;",
" case Keys.D5: Class_SOAStateMachine.CategoryIndex = 4; break;",
" case Keys.D6: Class_SOAStateMachine.CategoryIndex = 5; break;",
" case Keys.D7: Class_SOAStateMachine.CategoryIndex = 6; break;",
" case Keys.D8: Class_SOAStateMachine.CategoryIndex = 7; break;",
" case Keys.D9: Class_SOAStateMachine.CategoryIndex = 8; break;",
" case Keys.D0: Class_SOAStateMachine.CategoryIndex = 9; break;",
" case Keys.A: Class_SOAStateMachine.CategoryIndex = 10; break;",
" case Keys.B: Class_SOAStateMachine.CategoryIndex = 11; break;",
" default: return false;",
" }",
" Class_SOAStateMachine.SetState(typeof(CategoryIntroState)); ",
" return true;",
" }",
"",
"",
" }",
"",
" /**",
" * \"Best Demo!\"",
" */",
" public class CategoryIntroState : SimpleState",
" {",
" public CategoryIntroState()",
" : base() {",
" ExitState= typeof(BackgroundState);",
" NextState= typeof(CategoryDescriptionState);",
" Duration=3.0;",
" Class_SOAStateMachine.categoryDescriptionAnimator.SetValue(0);",
" }",
" public override void OnEnter() {",
" Class_SOAStateMachine.NomineeIndex=0;",
" Class_SOAStateMachine.FloatVariables[\"NomineeMaxTime\"] = 0.0f;",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(1);",
" Class_SOAStateMachine.backgroundLoopVolumeAnimator.AnimateTo(0.02);",
" Class_SOAStateMachine.FloatVariables[\"NominleeStartTime\"] = Class_SOAStateMachine.currentTime-7.5f;",
" ",
" Class_SOAStateMachine.ringFocusAnimator.AnimateTo(1);",
" Class_SOAStateMachine.SoundPlayers[\"voiceover\"].Play(",
" filepath: String.Format(\"./assets-scene-awards/voiceovers-misc/{0}.wav\", Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].FileName));",
" } ",
" }",
"",
" /**",
" * \"This category blah, blah blah...\"",
" */",
" public class CategoryDescriptionState : SimpleState",
" {",
" public CategoryDescriptionState()",
" : base() {",
" ExitState= typeof(BackgroundState);",
" NextState = typeof(CategoryNomineesIntroState);",
"",
" // Continue on caps lock (autotest)",
" if (Control.IsKeyLocked(Keys.CapsLock)) {",
" Duration=5;",
" }",
" }",
"",
" public override void OnEnter() {",
" base.OnEnter(); ",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(2);",
" Class_SOAStateMachine.SoundPlayers[\"voiceover\"].Play(",
" filepath: String.Format(\"./assets-scene-awards/voiceovers-misc/{0}Description.wav\", Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].FileName));",
" }",
" }",
"",
" /**",
" * \"And the nominees are...\"",
" */",
" public class CategoryNomineesIntroState : SimpleState",
" {",
" public CategoryNomineesIntroState()",
" : base() {",
" ExitState= typeof(CategoryBackgroundState);",
" NextState = typeof(CategoryNomineesState);",
" Duration = 2;",
" }",
"",
" public override void OnEnter() {",
" base.OnEnter();",
" Class_SOAStateMachine.backgroundLoopVolumeAnimator.AnimateTo(0.0);",
" //SOAStateMachine.ringFocusAnimator.AnimateTo(2);",
" //SOAStateMachine.categoryDescriptionAnimator.AnimateTo(3);",
" //SOAStateMachine.SoundPlayers[\"voiceover\"].Play(filepath: \"./assets-scene-awards/voiceovers-misc/AndTheNomineesAre.wav\");",
" //SOAStateMachine.FloatVariables[\"NomineeStartTime\"] = SOAStateMachine.currentTime;",
" //SOAStateMachine.NomineeIndex=1;",
" Class_SOAStateMachine.ringFocusAnimator.AnimateTo(2);",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(3);",
" }",
" }",
"",
" /**",
" * \"Blah! by XYZ...\"",
" */",
" public class CategoryNomineesState : SimpleState",
" {",
" public CategoryNomineesState()",
" : base() {",
" ExitState= typeof(CategoryBackgroundState);",
" Duration=10;",
"",
" if (Class_SOAStateMachine.NomineeIndex < Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Nominees.Count - 1) {",
" NextState = typeof(CategoryNomineesState);",
" }",
" else {",
" NextState = typeof(CategoryBackgroundState);",
" }",
" }",
"",
" public override void OnEnter() {",
" base.OnEnter();",
" Class_SOAStateMachine.FloatVariables[\"NomineeMaxTime\"] = 10.0f;",
" Class_SOAStateMachine.FloatVariables[\"NomineeStartTime\"] = Class_SOAStateMachine.currentTime;",
" Class_SOAStateMachine.SoundPlayers[\"voiceover\"].Play(",
" filepath: String.Format(\"./assets-scene-awards/voiceovers-nominees/{0}.wav\",",
" Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Nominees[Class_SOAStateMachine.NomineeIndex].FileName));",
" Class_SOAStateMachine.FloatVariables[\"NomineeWidth\"] = Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Nominees[Class_SOAStateMachine.NomineeIndex].Width;",
" Class_SOAStateMachine.FloatVariables[\"NomineeHeight\"] = Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Nominees[Class_SOAStateMachine.NomineeIndex].Height;",
" Class_SOAStateMachine.FloatVariables[\"ExtractStart\"] = Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Nominees[Class_SOAStateMachine.NomineeIndex].ExtractStart;",
"",
"",
"",
" //SOAStateMachine.SoundPlayers[\"soundtrack\"].Play(",
" // filepath: String.Format(\"./assets-scene-awards/soundtracks/{0}.mp3\",",
" // SOAStateMachine.CategoriesAndNominees[SOAStateMachine.CategoryIndex].Nominees[SOAStateMachine.NomineeIndex].FileName), loop:false, seektime:90);",
" ",
" }",
" public override void OnPass() {",
" Class_SOAStateMachine.NomineeIndex++;",
" }",
" }",
"",
" /**",
" * ...waiting for winner...",
" */",
" public class CategoryBackgroundState : SimpleState",
" {",
" public CategoryBackgroundState()",
" : base() {",
" ExitState= typeof(BackgroundState);",
" NextState = typeof(CategoryWinnerState);",
" // Continue on caps lock (autotest)",
" if (Control.IsKeyLocked(Keys.CapsLock)) {",
" Duration=2;",
" }",
" }",
"",
" public override void OnEnter() {",
" Class_SOAStateMachine.NomineeIndex=0;",
" Class_SOAStateMachine.FloatVariables[\"NomineeMaxTime\"] = 0f;",
" Class_SOAStateMachine.backgroundLoopVolumeAnimator.AnimateTo(0.1);",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(4);",
" Class_SOAStateMachine.ringFocusAnimator.AnimateTo(1);",
" base.OnEnter();",
" }",
" }",
"",
" /**",
" * \"The the winner is...\"",
" */",
" public class CategoryWinnerState : SimpleState",
" {",
" public CategoryWinnerState()",
" : base() {",
" ExitState= typeof(CategoryBackgroundState);",
" NextState = typeof(CategoryWinnerState2);",
" Duration= 2.0;",
" }",
"",
" public override void OnEnter() {",
" base.OnEnter();",
" Class_SOAStateMachine.backgroundLoopVolumeAnimator.AnimateTo(0.02);",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(5);",
" //SOAStateMachine.SoundPlayers[\"voiceover\"].Play(filepath: \"./assets-scene-awards/voiceovers-misc/AndTheNomineesAre.wav\");",
" //SOAStateMachine.SoundPlayers[\"voiceover\"].Play(",
" // filepath: String.Format(\"./assets-scene-awards/voiceovers-misc/TheWinnerIs.wav\", SOAStateMachine.CategoriesAndNominees[SOAStateMachine.CategoryIndex].FileName));",
"",
" }",
" }",
"",
" /**",
" * \"The the winner is 2\"",
" */",
" public class CategoryWinnerState2 : SimpleState",
" {",
" public CategoryWinnerState2()",
" : base() {",
" ExitState= typeof(CategoryBackgroundState);",
" NextState = typeof(CategoryExitState);",
" // Continue on caps lock (autotest)",
" if (Control.IsKeyLocked(Keys.CapsLock)) {",
" Duration=10;",
" }",
" }",
"",
" public override void OnEnter() {",
" base.OnEnter();",
"",
" int winnerId= (int) Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Winner;",
" Class_SOAStateMachine.NomineeIndex= winnerId;",
"",
" Class_SOAStateMachine.backgroundLoopVolumeAnimator.AnimateTo(0.0);",
" Class_SOAStateMachine.FloatVariables[\"NomineeStartTime\"] = Class_SOAStateMachine.currentTime;",
" Class_SOAStateMachine.FloatVariables[\"NomineeMaxTime\"] = 7.5f;",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(6);",
" Class_SOAStateMachine.ringFocusAnimator.AnimateTo(2);",
" //SOAStateMachine.SoundPlayers[\"voiceover\"].Play(",
" // filepath: String.Format(\"./assets-scene-awards/voiceovers-nominees/{0}.wav\",",
" // SOAStateMachine.CategoriesAndNominees[SOAStateMachine.CategoryIndex].Nominees[winnerId].FileName));",
"",
" Class_SOAStateMachine.FloatVariables[\"NomineeWidth\"] = Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Nominees[Class_SOAStateMachine.NomineeIndex].Width;",
" Class_SOAStateMachine.FloatVariables[\"NomineeHeight\"] = Class_SOAStateMachine.CategoriesAndNominees[Class_SOAStateMachine.CategoryIndex].Nominees[Class_SOAStateMachine.NomineeIndex].Height;",
"",
" //SOAStateMachine.SoundPlayers[\"soundtrack\"].Play(",
" // filepath: String.Format(\"./assets-scene-awards/soundtracks/{0}.mp3\",",
" // SOAStateMachine.CategoriesAndNominees[SOAStateMachine.CategoryIndex].Nominees[winnerId].FileName));",
" }",
"",
" public override void OnPass() { ",
" base.OnPass();",
" Class_SOAStateMachine.categoryDescriptionAnimator.AnimateTo(7);",
" Class_SOAStateMachine.ringFocusAnimator.AnimateTo(0);",
" Class_SOAStateMachine.backgroundLoopVolumeAnimator.AnimateTo(0.4);",
" Class_SOAStateMachine.FloatVariables[\"NomineeStartTime\"] = Class_SOAStateMachine.currentTime-7.5f;",
" Class_SOAStateMachine.FloatVariables[\"NomineeMaxTime\"] = 10000.0f; ",
" }",
" public override void OnExit() {",
" Logger.Info(\"StateMachine >> CategoryWinnerState2.OnExit()\");",
" } ",
" }",
" ",
"",
" /**",
" * \"...back to idle mode\"",
" */",
" public class CategoryExitState : SimpleState",
" {",
" public CategoryExitState()",
" : base() {",
" ExitState= typeof(BackgroundState);",
" NextState = typeof(BackgroundState);",
" Duration= 2.5;",
" }",
"",
" public override void OnEnter() {",
" base.OnEnter();",
" //SOAStateMachine.backgroundLoopVolumeAnimator.AnimateTo(0.02);",
" //SOAStateMachine.categoryDescriptionAnimator.AnimateTo(5);",
" Class_SOAStateMachine.FloatVariables[\"NomineeStartTime\"] = Class_SOAStateMachine.currentTime-7.5f;",
" Class_SOAStateMachine.FloatVariables[\"NomineeMaxTime\"] = 10.0f;",
" //SOAStateMachine.SoundPlayers[\"voiceover\"].Play(filepath: \"./assets-scene-awards/voiceovers-misc/AndTheNomineesAre.wav\");",
" //SOAStateMachine.SoundPlayers[\"voiceover\"].Play(",
" // filepath: String.Format(\"./assets-scene-awards/voiceovers-misc/TheWinnerIs.wav\", SOAStateMachine.CategoriesAndNominees[SOAStateMachine.CategoryIndex].FileName));",
"",
" }",
" } ",
"",
"",
"",
" //---------------------------------------------------------------------------------",
"",
" public class SimpleState",
" {",
" public Type NextState { get; set; }",
" public Type ExitState { get; set; }",
" public Double Duration { get; set; }",
"",
" public virtual void OnEnter() { }",
" public virtual void OnPass() { } // Triggered when jumping leaving the state (e.g. always)",
" public virtual void OnExit() { } // Triggered only when when q is pressed while state is active",
"",
" public virtual void OnFrame() { }",
"",
" public virtual bool OnKeyPressed(KeyboardInput.KeyEventArgs e) {",
" return false; // not handled",
" }",
"",
" public virtual bool OnKeyReleased(KeyboardInput.KeyEventArgs e) {",
" return false; // not handled",
" }",
" }",
"",
" /**",
" * Simple sound Player",
" */",
" public class SoundPlayer",
" {",
" public SoundPlayer(string filepath) {",
" FilePath = filepath;",
" }",
"",
" public void Load(string filepath) {",
" FilePath = filepath;",
" _stream=0;",
" }",
"",
"",
" public void Pause() {",
" Bass.BASS_ChannelPause(_stream);",
" }",
"",
"",
"",
" public void Play(string filepath=null, bool loop= false, double seektime=0) {",
" Stop();",
" if (filepath != null && filepath != FilePath) {",
" FilePath= filepath;",
" _stream=0;",
" }",
"",
" if (_stream == 0) {",
" if (File.Exists(FilePath)) {",
" _fileName = FilePath;",
" _stream = Bass.BASS_StreamCreateFile(_fileName, 0, 0, BASSFlag.BASS_STREAM_PRESCAN);",
" _channelInfo = Bass.BASS_ChannelGetInfo(_stream);",
" Logger.Debug(\"StateMachine >> Opened sound: {0}\", _fileName);",
" }",
" }",
"",
" Bass.BASS_ChannelPlay(_stream, true);",
" Bass.BASS_ChannelSetPosition(_stream, seektime);",
" //Bass.BASS_ChannelSetAttribute(_stream, BASSAttribute.BASS_ATTRIB_FREQ, _channelInfo.freq*PlaySpeed);",
" if (loop) {",
" Bass.BASS_ChannelFlags(_stream, BASSFlag.BASS_MUSIC_LOOP, BASSFlag.BASS_MUSIC_LOOP);",
" }",
" }",
"",
" public void SetVolume(float v) {",
" Bass.BASS_ChannelSetAttribute(_stream, BASSAttribute.BASS_ATTRIB_VOL, v);",
" }",
"",
"",
" public float GetPlayTime() {",
" return (float) Bass.BASS_ChannelBytes2Seconds(_stream, Bass.BASS_ChannelGetPosition(_stream, BASSMode.BASS_POS_BYTES));",
" }",
"",
" public void Stop() {",
" if (_stream != 0) {",
" Bass.BASS_ChannelPause(_stream);",
" Bass.BASS_ChannelStop(_stream);",
" //Bass.BASS_StreamFree(_stream);",
" Logger.Debug(\"StateMachine >> closed sound: {0}\", _fileName);",
" }",
" }",
" private bool IsSoundInitialized() {",
" return Bass.BASS_GetInfo() != null;",
" }",
"",
" private bool IsPlaying() {",
" return Bass.BASS_ChannelIsActive(_stream) == Un4seen.Bass.BASSActive.BASS_ACTIVE_PLAYING;",
" }",
"",
" public string FilePath { get; set; }",
"",
" string _fileName;",
" int _stream;",
" BASS_CHANNELINFO _channelInfo;",
" }",
"} "
],
"AdditionalAssemblies": [
"Libs/Bass.net.dll"
]
}
],
"Operators": [],
"Connections": [
{
"SourceOp": "00000000-0000-0000-0000-000000000000",
"SourceOpPart": "2d8c339f-153e-40e8-98cd-16b0ca36099d",
"TargetOp": "00000000-0000-0000-0000-000000000000",
"TargetOpPart": "43850c12-31eb-4f9e-b1f0-46cd826a77f6"
},
{
"SourceOp": "00000000-0000-0000-0000-000000000000",
"SourceOpPart": "3af3cb69-8145-45ba-ae17-48f10b38131d",
"TargetOp": "00000000-0000-0000-0000-000000000000",
"TargetOpPart": "2d8c339f-153e-40e8-98cd-16b0ca36099d"
},
{
"SourceOp": "00000000-0000-0000-0000-000000000000",
"SourceOpPart": "a1a70538-1abc-4fc6-b458-fb5bcab90877",
"TargetOp": "00000000-0000-0000-0000-000000000000",
"TargetOpPart": "2d8c339f-153e-40e8-98cd-16b0ca36099d"
},
{
"SourceOp": "00000000-0000-0000-0000-000000000000",
"SourceOpPart": "fa4a3811-53cc-40a3-a02e-521036aeec53",
"TargetOp": "00000000-0000-0000-0000-000000000000",
"TargetOpPart": "2d8c339f-153e-40e8-98cd-16b0ca36099d"
}
]
}