aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens/UScreenSing.pas
blob: 4d1b918c2e91a31c9a9dff4ffaabce6ed3552417 (plain) (blame)
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
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
unit UScreenSing;

interface

uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics,
  TextGL, gl, BASS, UThemes, UGraphicClasses, UVideo;

type
  THandler = record
    changed:  boolean;
    change_time:  real;
  end;

  TPlayerSkin = record
    StaticP:        real;
    StaticScoreBG : real;
    TextP:          real;
    TextPScore:     real;
  end;

  TSaveCoords = record
    Singbar:  array[1..6] of real;
    PlayerS:  array[1..6] of TPlayerSkin;
  end;

  TScreenSing = class(TMenu)
    protected
      PauseTime: Real;
      WebCam: boolean; //Try WebCam?
      paused: boolean; //Pause Mod
    public
      NumEmptySentences: array [0..1] of integer;
      //TextTime:           integer;
      MP3Volume:        integer;
      MP3VolumeHandler: THandler;

      //Lyric bars
      StaticLyricBar:     integer;
      StaticLyricDuetBar: integer;

      //TimeBar mod
      StaticTimeProgress:  integer;
      TextTimeText:        integer;
      //eoa TimeBar mod

      SaveCoords:         TSaveCoords;

      StaticP1:           integer;
      StaticP1ScoreBG:    integer;
      TextP1:             integer;
      TextP1Score:        integer;

      Alpha:  TAlpha;

      //moveable singbar mod
      StaticP1SingBar:         integer;
      StaticP1ThreePSingBar:   integer;
      StaticP1TwoPSingBar:     integer;
      StaticP2RSingBar:        integer;
      StaticP2MSingBar:        integer;
      StaticP3SingBar:         integer;

      StaticP3FourPSingbar:    integer;
      StaticP4FourPSingbar:    integer;
      StaticP4SixPSingbar:     integer;
      StaticP5Singbar:         integer;
      StaticP6Singbar:         integer;
      //eoa moveable singbar

      //Added for ps3 skin
      //shown when game is in 2/4 player modus
      StaticP1TwoP:           integer;
      StaticP1TwoPScoreBG:    integer;
      TextP1TwoP:             integer;
      TextP1TwoPScore:        integer;
      //shown when game is in 3/6 player modus
      StaticP1ThreeP:           integer;
      StaticP1ThreePScoreBG:    integer;
      TextP1ThreeP:             integer;
      TextP1ThreePScore:        integer;
      //eoa

      StaticP2R:          integer;
      StaticP2RScoreBG:   integer;
      TextP2R:            integer;
      TextP2RScore:       integer;

      StaticP2M:          integer;
      StaticP2MScoreBG:   integer;
      TextP2M:            integer;
      TextP2MScore:       integer;

      StaticP3R:          integer;
      StaticP3RScoreBG:   integer;
      TextP3R:            integer;
      TextP3RScore:       integer;

      // 4 and 6 player on one screen
      P4Mode:               boolean;
      StaticP3FourP:        integer;
      StaticP3FourPScoreBG: integer;
      TextP3FourP:          integer;
      TextP3FourPScore:     integer;

      StaticP4FourP:        integer;
      StaticP4FourPScoreBG: integer;
      TextP4FourP:          integer;
      TextP4FourPScore:     integer;

      StaticP4SixP:         integer;
      StaticP4SixPScoreBG:  integer;
      TextP4SixP:           integer;
      TextP4SixPScore:      integer;

      StaticP5:           integer;
      StaticP5ScoreBG:    integer;
      TextP5:             integer;
      TextP5Score:        integer;

      StaticP6:           integer;
      StaticP6ScoreBG:    integer;
      TextP6:             integer;
      TextP6Score:        integer;

      Tex_Background:     TTexture;
      FadeOut:            boolean;
      LyricMain:          array [0..1] of TLyric;
      LyricSub:           array [0..1] of TLyric;

      //VideoAspect
      VideoAspectText:    integer;
      VideoAspectStatic:  integer;
      AspectHandler:      THandler;

      //for Medley
      SongNameStatic:     integer;
      SongNameText:       integer;
      MedleyHandler:      THandler;

      MedleyStart, MedleyEnd: real;
      StartNote, EndNote:     TPos;

      constructor Create; override;
      procedure onShow; override;
      procedure onShowFinish; override;
      function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
      function Draw: boolean; override;
      function GetHelpID(): string;

      procedure Finish; virtual;
      procedure Pause; //Pause Mod(Toggles Pause)

      procedure SetVis();

      //OnSentenceEnd for LineBonus + Singbar
      procedure onSentenceEnd(CP: integer; S: Cardinal);
      //OnSentenceChange (for Golden Notes)
      procedure onSentenceChange(CP: integer; S: Cardinal);

      procedure SongError();
      procedure LoadNextSong;
      procedure UpdateMedleyStats(medley_end: boolean);
      procedure DrawMedleyCountdown();

      procedure SetLyricFontMain(Lyric: TLyric);
      procedure SetLyricFontSub(Lyric: TLyric);
  end;

const
  ID='ID_023';   //for help system

implementation
uses UGraphic, UDataBase, UDraw, UMain, Classes, URecord, ULanguage, UHelp, math,
  UPartyM2, UParty, UWebCam;


function TScreenSing.GetHelpID(): string;
begin
  Result := ID;
end;

// Method for input parsing. If False is returned, GetNextWindow
// should be checked to know the next window to load;
function TScreenSing.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
begin
  Result := true;
  If (PressedDown) Then
  begin // Key Down
    case PressedKey of
      //MP3-Volume Up
      SDLK_PAGEUP:
        begin
          if (MP3Volume<100) then
          begin
            MP3Volume := MP3Volume+5;
            Music.SetMusicVolume(MP3Volume);
          end;
          MP3VolumeHandler.changed := true;
          MP3VolumeHandler.change_time := 0;
        end;

      //MP3-Volume Down
      SDLK_PAGEDOWN:
        begin
          if (MP3Volume>0) then
          begin
            MP3Volume := MP3Volume-5;
            Music.SetMusicVolume(MP3Volume);
          end;
          MP3VolumeHandler.changed := true;
          MP3VolumeHandler.change_time := 0;
        end;

      SDLK_K:
        begin
          if Music.VocalRemoverActivated() then
            Music.DisableVocalRemover
          else
            Music.EnableVocalRemover;
        end;

      SDLK_N:
        begin
          if (ScreenSong.Mode <> smNormal) and (ScreenSong.Mode <> smMedley)then
            Exit;

          Inc(ShowNotes);
          if (ShowNotes>4) then
            ShowNotes:=0;
        end;

      SDLK_TAB:
        begin
          if not paused then
            Pause;
          ScreenPopupHelp.ShowPopup();
        end;

      SDLK_A:
        begin
          ToggleAspectCorrection;
          AspectHandler.changed := true;
          AspectHandler.change_time := Czas.Teraz;
          Static[VideoAspectStatic].Visible := true;
          case UVideo.fAspectCorrection of
            acoStretch: Text[VideoAspectText].Text := Language.Translate('VIDEO_ASPECT_STRETCH');
            acoCrop: Text[VideoAspectText].Text := Language.Translate('VIDEO_ASPECT_CROP');
            acoLetterBox: Text[VideoAspectText].Text := Language.Translate('VIDEO_ASPECT_LETTER_BOX');
          end;
          DataBase.SetAspect(AktSong.Artist, AktSong.Title, integer(UVideo.fAspectCorrection));
          Text[VideoAspectText].Visible := true;
        end;
      SDLK_Q:
        begin
          //When not ask before Exit then Finish now
          if (Ini.AskbeforeDel <> 1) then
            Finish
          //else just Pause and let the Popup make the Work  
          else if not paused then
            Pause;
          
          Result := false;
        end;
      SDLK_ESCAPE:
        begin
          //Record Sound Hack:
          //Sound[0].BufferLong
          if (ScreenSong.Mode=smMedley) or ScreenSong.PartyMedley then
            PlaylistMedley.CurrentMedleySong:=PlaylistMedley.NumMedleySongs+1;

          Finish;
          FadeOut := true;
          Music.PlayBack;

          if ScreenSong.Mode<>smParty then
            FadeTo(@ScreenScore);
        end;

      SDLK_P://Pause Mod
        begin
          Pause;
        end;

      SDLK_S:
        begin
          if (ScreenSong.Mode = smNormal) or (ScreenSong.Mode = smMedley) then
            Ini.PossibleScore := (Ini.PossibleScore+1) mod 4;
          //Ini.Save;
        end;

      SDLK_W:
        begin
          if WebCam then
            WebCam := false
          else
            WebCam := wStartWebCam();
        end;
        
      SDLK_RETURN:
        begin
        end;

      // Up and Down could be done at the same time,
      // but I don't want to declare variables inside
      // functions like this one, called so many times
      SDLK_DOWN :
        begin
        end;
      SDLK_UP :
        begin
        end;
    end;
  end;
end;

//Pause Mod
procedure TScreenSing.Pause;
begin
  if not paused then  //Pause einschalten
  begin
    PauseTime := Czas.Teraz;
    Paused := true;
    //stop Music
    Music.Pause;
    if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video
      acTogglePause; //Video
  end
  else            //Pause ausschalten
  begin
    Czas.Teraz := PauseTime; //Position of Notes
    Music.MoveTo (PauseTime + Ini.LipSync*0.01);//Position of Music
    Music.Play; //Play Music
    if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video
      acTogglePause;
    Paused := false;
  end;
end;
//Pause Mod End

constructor TScreenSing.Create;
begin
  inherited Create;

  LoadFromTheme(Theme.Sing);

  StaticLyricBar := AddStatic(Theme.Sing.StaticLyricBar);
  StaticLyricDuetBar := AddStatic(Theme.Sing.StaticLyricDuetBar);

  //TimeBar mod
    StaticTimeProgress :=  AddStatic(Theme.Sing.StaticTimeProgress);
    TextTimeText       :=  AddText(Theme.Sing.TextTimeText);
  //eoa TimeBar mod

  //moveable singbar mod
  StaticP1SingBar         := AddStatic(Theme.Sing.StaticP1SingBar);
  StaticP1ThreePSingBar   := AddStatic(Theme.Sing.StaticP1ThreePSingBar);
  StaticP1TwoPSingBar     := AddStatic(Theme.Sing.StaticP1TwoPSingBar);
  StaticP2RSingBar        := AddStatic(Theme.Sing.StaticP2RSingBar);
  StaticP2MSingBar        := AddStatic(Theme.Sing.StaticP2MSingBar);
  StaticP3SingBar         := AddStatic(Theme.Sing.StaticP3SingBar);

  StaticP3FourPSingbar    := AddStatic(Theme.Sing.StaticP3FourPSingbar);
  StaticP4FourPSingbar    := AddStatic(Theme.Sing.StaticP4FourPSingbar);
  StaticP4SixPSingbar     := AddStatic(Theme.Sing.StaticP4SixPSingbar);
  StaticP5Singbar         := AddStatic(Theme.Sing.StaticP5Singbar);
  StaticP6Singbar         := AddStatic(Theme.Sing.StaticP6Singbar);

  //save coordinates
  SaveCoords.Singbar[1] := Theme.Sing.StaticP1SingBar.X;
  SaveCoords.Singbar[2] := Theme.Sing.StaticP1TwoPSingBar.X;
  SaveCoords.Singbar[3] := Theme.Sing.StaticP1ThreePSingBar.X;
  SaveCoords.Singbar[4] := Theme.Sing.StaticP2RSingBar.X;
  SaveCoords.Singbar[5] := Theme.Sing.StaticP2MSingBar.X;
  SaveCoords.Singbar[6] := Theme.Sing.StaticP3SingBar.X;
  //eoa moveable singbar

  StaticP1 := AddStatic(Theme.Sing.StaticP1);
  StaticP1ScoreBG := AddStatic(Theme.Sing.StaticP1ScoreBG);
  TextP1 := AddText(Theme.Sing.TextP1);
  TextP1Score := AddText(Theme.Sing.TextP1Score);

  //Added for ps3 skin
  //This one is shown in 2/4P mode
  StaticP1TwoP := AddStatic(Theme.Sing.StaticP1TwoP);
  StaticP1TwoPScoreBG := AddStatic(Theme.Sing.StaticP1TwoPScoreBG);
  TextP1TwoP := AddText(Theme.Sing.TextP1TwoP);
  TextP1TwoPScore := AddText(Theme.Sing.TextP1TwoPScore);

  //This one is shown in 3/6P mode
  StaticP1ThreeP := AddStatic(Theme.Sing.StaticP1ThreeP);
  StaticP1ThreePScoreBG := AddStatic(Theme.Sing.StaticP1ThreePScoreBG);
  TextP1ThreeP := AddText(Theme.Sing.TextP1ThreeP);
  TextP1ThreePScore := AddText(Theme.Sing.TextP1ThreePScore);
  //eoa

  StaticP2R := AddStatic(Theme.Sing.StaticP2R);
  StaticP2RScoreBG := AddStatic(Theme.Sing.StaticP2RScoreBG);
  TextP2R := AddText(Theme.Sing.TextP2R);
  TextP2RScore := AddText(Theme.Sing.TextP2RScore);

  StaticP2M := AddStatic(Theme.Sing.StaticP2M);
  StaticP2MScoreBG := AddStatic(Theme.Sing.StaticP2MScoreBG);
  TextP2M := AddText(Theme.Sing.TextP2M);
  TextP2MScore := AddText(Theme.Sing.TextP2MScore);

  StaticP3R := AddStatic(Theme.Sing.StaticP3R);
  StaticP3RScoreBG := AddStatic(Theme.Sing.StaticP3RScoreBG);
  TextP3R := AddText(Theme.Sing.TextP3R);
  TextP3RScore := AddText(Theme.Sing.TextP3RScore);

  // 4 and 6 player on one screen:
  StaticP3FourP := AddStatic(Theme.Sing.StaticP3FourP);
  StaticP3FourPScoreBG := AddStatic(Theme.Sing.StaticP3FourPScoreBG);
  TextP3FourP := AddText(Theme.Sing.TextP3FourP);
  TextP3FourPScore := AddText(Theme.Sing.TextP3FourPScore);

  StaticP4FourP := AddStatic(Theme.Sing.StaticP4FourP);
  StaticP4FourPScoreBG := AddStatic(Theme.Sing.StaticP4FourPScoreBG);
  TextP4FourP := AddText(Theme.Sing.TextP4FourP);
  TextP4FourPScore := AddText(Theme.Sing.TextP4FourPScore);

  StaticP4SixP := AddStatic(Theme.Sing.StaticP4SixP);
  StaticP4SixPScoreBG := AddStatic(Theme.Sing.StaticP4SixPScoreBG);
  TextP4SixP := AddText(Theme.Sing.TextP4SixP);
  TextP4SixPScore := AddText(Theme.Sing.TextP4SixPScore);

  StaticP5 := AddStatic(Theme.Sing.StaticP5);
  StaticP5ScoreBG := AddStatic(Theme.Sing.StaticP5ScoreBG);
  TextP5 := AddText(Theme.Sing.TextP5);
  TextP5Score := AddText(Theme.Sing.TextP5Score);

  StaticP6 := AddStatic(Theme.Sing.StaticP6);
  StaticP6ScoreBG := AddStatic(Theme.Sing.StaticP6ScoreBG);
  TextP6 := AddText(Theme.Sing.TextP6);
  TextP6Score := AddText(Theme.Sing.TextP6Score);

  //save coordinates
  SaveCoords.PlayerS[1].StaticP := Theme.Sing.StaticP1.X;
  SaveCoords.PlayerS[1].StaticScoreBG := Theme.Sing.StaticP1ScoreBG.X;
  SaveCoords.PlayerS[1].TextP := Theme.Sing.TextP1.X;
  SaveCoords.PlayerS[1].TextPScore := Theme.Sing.TextP1Score.X;

  SaveCoords.PlayerS[2].StaticP := Theme.Sing.StaticP1TwoP.X;
  SaveCoords.PlayerS[2].StaticScoreBG := Theme.Sing.StaticP1TwoPScoreBG.X;
  SaveCoords.PlayerS[2].TextP := Theme.Sing.TextP1TwoP.X;
  SaveCoords.PlayerS[2].TextPScore := Theme.Sing.TextP1TwoPScore.X;

  SaveCoords.PlayerS[3].StaticP := Theme.Sing.StaticP1ThreeP.X;
  SaveCoords.PlayerS[3].StaticScoreBG := Theme.Sing.StaticP1ThreePScoreBG.X;
  SaveCoords.PlayerS[3].TextP := Theme.Sing.TextP1ThreeP.X;
  SaveCoords.PlayerS[3].TextPScore := Theme.Sing.TextP1ThreePScore.X;

  SaveCoords.PlayerS[4].StaticP := Theme.Sing.StaticP2R.X;
  SaveCoords.PlayerS[4].StaticScoreBG := Theme.Sing.StaticP2RScoreBG.X;
  SaveCoords.PlayerS[4].TextP := Theme.Sing.TextP2R.X;
  SaveCoords.PlayerS[4].TextPScore := Theme.Sing.TextP2RScore.X;

  SaveCoords.PlayerS[5].StaticP := Theme.Sing.StaticP2M.X;
  SaveCoords.PlayerS[5].StaticScoreBG := Theme.Sing.StaticP2MScoreBG.X;
  SaveCoords.PlayerS[5].TextP := Theme.Sing.TextP2M.X;
  SaveCoords.PlayerS[5].TextPScore := Theme.Sing.TextP2MScore.X;

  SaveCoords.PlayerS[6].StaticP := Theme.Sing.StaticP3R.X;
  SaveCoords.PlayerS[6].StaticScoreBG := Theme.Sing.StaticP3RScoreBG.X;
  SaveCoords.PlayerS[6].TextP := Theme.Sing.TextP3R.X;
  SaveCoords.PlayerS[6].TextPScore := Theme.Sing.TextP3RScore.X;

  SongNameStatic := AddStatic(Theme.Sing.StaticSongName);
  SongNameText := AddText(Theme.Sing.TextSongName);

  VideoAspectStatic:= AddStatic(Theme.Sing.VideoAspectStatic);
  VideoAspectText:=   AddText(Theme.Sing.VideoAspectText);

  LyricMain[0] := TLyric.Create;
  LyricSub[0] :=  TLyric.Create;
  LyricMain[1] := TLyric.Create;
  LyricSub[1] :=  TLyric.Create;
  UVideo.Init;

  MP3Volume := 100;
  WebCam := false;
end;

procedure TScreenSing.onShow;
var
  NR:       TRecR; //Line Bonus Mod
begin
  Log.LogStatus('Begin', 'onShow');
  if not Help.SetHelpID(ID) then
    Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenSing)');

  if Music.VocalRemoverActivated() then
    Music.DisableVocalRemover;

  GoldenRec.KillAll;

  FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented

  AspectHandler.changed := false;
  Text[VideoAspectText].Visible := false;
  Static[VideoAspectStatic].Visible := false;

  MP3VolumeHandler.changed := false;

  ShowNotes := 0;

  //Reset Player Medley stats
  if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley  then
  begin
    PlaylistMedley.CurrentMedleySong:=1;

    //max_song_score_medley := round(MAX_SONG_SCORE / NumMedleySongs);
    //max_song_line_bonus_medley := round(MAX_SONG_LINE_BONUS / NumMedleySongs);
    PlaylistMedley.NumPlayer := PlayersPlay;
    SetLength(PlaylistMedley.Stats, 0);
    //max_song_score_medley := round(MAX_SONG_SCORE / PlaylistMedley.NumMedleySongs);
    //max_song_line_bonus_medley := round(MAX_SONG_LINE_BONUS / PlaylistMedley.NumMedleySongs);
  end;

  // prepare players
  SetLength(Player, PlayersPlay);
//  Player[0].ScoreTotalI := 0;

  // positions
  if ((Screens = 1) and (PlayersPlay <= 3)) or (Screens = 2) then
  begin
    P4Mode := false;
    NR.Left := 20;
    NR.Right := 780;

    Theme.Sing.StaticP1SingBar.X := Round(SaveCoords.Singbar[1]);
    Theme.Sing.StaticP1TwoPSingBar.X := Round(SaveCoords.Singbar[2]);
    Theme.Sing.StaticP1ThreePSingBar.X := Round(SaveCoords.Singbar[3]);
    Theme.Sing.StaticP2RSingBar.X := Round(SaveCoords.Singbar[4]);
    Theme.Sing.StaticP2MSingBar.X := Round(SaveCoords.Singbar[5]);
    Theme.Sing.StaticP3SingBar.X := Round(SaveCoords.Singbar[6]);

    Theme.Sing.StaticP1.X := Round(SaveCoords.PlayerS[1].StaticP);
    Theme.Sing.StaticP1ScoreBG.X := Round(SaveCoords.PlayerS[1].StaticScoreBG);
    Theme.Sing.TextP1.X := Round(SaveCoords.PlayerS[1].TextP);
    Theme.Sing.TextP1Score.X := Round(SaveCoords.PlayerS[1].TextPScore);

    Theme.Sing.StaticP1TwoP.X := Round(SaveCoords.PlayerS[2].StaticP);
    Theme.Sing.StaticP1TwoPScoreBG.X := Round(SaveCoords.PlayerS[2].StaticScoreBG);
    Theme.Sing.TextP1TwoP.X := Round(SaveCoords.PlayerS[2].TextP);
    Theme.Sing.TextP1TwoPScore.X := Round(SaveCoords.PlayerS[2].TextPScore);

    Theme.Sing.StaticP1ThreeP.X := Round(SaveCoords.PlayerS[3].StaticP);
    Theme.Sing.StaticP1ThreePScoreBG.X := Round(SaveCoords.PlayerS[3].StaticScoreBG);
    Theme.Sing.TextP1ThreeP.X := Round(SaveCoords.PlayerS[3].TextP);
    Theme.Sing.TextP1ThreePScore.X := Round(SaveCoords.PlayerS[3].TextPScore);

    Theme.Sing.StaticP2R.X := Round(SaveCoords.PlayerS[4].StaticP);
    Theme.Sing.StaticP2RScoreBG.X := Round(SaveCoords.PlayerS[4].StaticScoreBG);
    Theme.Sing.TextP2R.X := Round(SaveCoords.PlayerS[4].TextP);
    Theme.Sing.TextP2RScore.X := Round(SaveCoords.PlayerS[4].TextPScore);

    Theme.Sing.StaticP2M.X := Round(SaveCoords.PlayerS[5].StaticP);
    Theme.Sing.StaticP2MScoreBG.X := Round(SaveCoords.PlayerS[5].StaticScoreBG);
    Theme.Sing.TextP2M.X := Round(SaveCoords.PlayerS[5].TextP);
    Theme.Sing.TextP2MScore.X := Round(SaveCoords.PlayerS[5].TextPScore);

    Theme.Sing.StaticP3R.X := Round(SaveCoords.PlayerS[6].StaticP);
    Theme.Sing.StaticP3RScoreBG.X := Round(SaveCoords.PlayerS[6].StaticScoreBG);
    Theme.Sing.TextP3R.X := Round(SaveCoords.PlayerS[6].TextP);
    Theme.Sing.TextP3RScore.X := Round(SaveCoords.PlayerS[6].TextPScore);
  end else
  begin
    P4Mode := true;

    if (PlayersPlay=6) then
      Ini.PossibleScore := 3;

    NR.Left := 10;
    NR.Right := 390;

    Theme.Sing.StaticP1SingBar.X := Round(SaveCoords.Singbar[1]);
    Theme.Sing.StaticP1TwoPSingBar.X := Round(SaveCoords.Singbar[2]-400);
    Theme.Sing.StaticP1ThreePSingBar.X := Round(SaveCoords.Singbar[3]+Theme.Sing.OFF_P1);
    Theme.Sing.StaticP2RSingBar.X := Round(SaveCoords.Singbar[4]-400);
    Theme.Sing.StaticP2MSingBar.X := Round(SaveCoords.Singbar[5]+Theme.Sing.OFF_P2);
    Theme.Sing.StaticP3SingBar.X := Round(SaveCoords.Singbar[6]+Theme.Sing.OFF_P3);

    Theme.Sing.StaticP1.X := Round(SaveCoords.PlayerS[1].StaticP);
    Theme.Sing.StaticP1ScoreBG.X := Round(SaveCoords.PlayerS[1].StaticScoreBG);
    Theme.Sing.TextP1.X := Round(SaveCoords.PlayerS[1].TextP);
    Theme.Sing.TextP1Score.X := Round(SaveCoords.PlayerS[1].TextPScore);

    Theme.Sing.StaticP1TwoP.X := Round(SaveCoords.PlayerS[2].StaticP);
    Theme.Sing.StaticP1TwoPScoreBG.X := Round(SaveCoords.PlayerS[2].StaticScoreBG-400);
    Theme.Sing.TextP1TwoP.X := Round(SaveCoords.PlayerS[2].TextP);
    Theme.Sing.TextP1TwoPScore.X := Round(SaveCoords.PlayerS[2].TextPScore-400);

    Theme.Sing.StaticP1ThreeP.X := Round(SaveCoords.PlayerS[3].StaticP+Theme.Sing.OFF_P1);
    Theme.Sing.StaticP1ThreePScoreBG.X := Round(SaveCoords.PlayerS[3].StaticScoreBG+Theme.Sing.OFF_P1);
    Theme.Sing.TextP1ThreeP.X := Round(SaveCoords.PlayerS[3].TextP+Theme.Sing.OFF_P1);
    Theme.Sing.TextP1ThreePScore.X := Round(SaveCoords.PlayerS[3].TextPScore+Theme.Sing.OFF_P1);

    Theme.Sing.StaticP2R.X := Round(SaveCoords.PlayerS[4].StaticP);
    Theme.Sing.StaticP2RScoreBG.X := Round(SaveCoords.PlayerS[4].StaticScoreBG-400);
    Theme.Sing.TextP2R.X := Round(SaveCoords.PlayerS[4].TextP);
    Theme.Sing.TextP2RScore.X := Round(SaveCoords.PlayerS[4].TextPScore-400);

    Theme.Sing.StaticP2M.X := Round(SaveCoords.PlayerS[5].StaticP+Theme.Sing.OFF_P2);
    Theme.Sing.StaticP2MScoreBG.X := Round(SaveCoords.PlayerS[5].StaticScoreBG+Theme.Sing.OFF_P2);
    Theme.Sing.TextP2M.X := Round(SaveCoords.PlayerS[5].TextP+Theme.Sing.OFF_P2);
    Theme.Sing.TextP2MScore.X := Round(SaveCoords.PlayerS[5].TextPScore+Theme.Sing.OFF_P2);

    Theme.Sing.StaticP3R.X := Round(SaveCoords.PlayerS[6].StaticP+Theme.Sing.OFF_P3);
    Theme.Sing.StaticP3RScoreBG.X := Round(SaveCoords.PlayerS[6].StaticScoreBG+Theme.Sing.OFF_P3);
    Theme.Sing.TextP3R.X := Round(SaveCoords.PlayerS[6].TextP+Theme.Sing.OFF_P3);
    Theme.Sing.TextP3RScore.X := Round(SaveCoords.PlayerS[6].TextPScore+Theme.Sing.OFF_P3);
  end;

    Static[StaticP1].Texture.X := Theme.Sing.StaticP1.X;
    Static[StaticP1ScoreBG].Texture.X := Theme.Sing.StaticP1ScoreBG.X;
    Text[TextP1].X := Theme.Sing.TextP1.X;
    Text[TextP1Score].X := Theme.Sing.TextP1Score.X;

    Static[StaticP1TwoP].Texture.X := Theme.Sing.StaticP1TwoP.X;
    Static[StaticP1TwoPScoreBG].Texture.X := Theme.Sing.StaticP1TwoPScoreBG.X;
    Text[TextP1TwoP].X := Theme.Sing.TextP1TwoP.X;
    Text[TextP1TwoPScore].X := Theme.Sing.TextP1TwoPScore.X;

    Static[StaticP1ThreeP].Texture.X := Theme.Sing.StaticP1ThreeP.X;
    Static[StaticP1ThreePScoreBG].Texture.X := Theme.Sing.StaticP1ThreePScoreBG.X;
    Text[TextP1ThreeP].X := Theme.Sing.TextP1ThreeP.X;
    Text[TextP1ThreePScore].X := Theme.Sing.TextP1ThreePScore.X;

    Static[StaticP2R].Texture.X := Theme.Sing.StaticP2R.X;
    Static[StaticP2RScoreBG].Texture.X := Theme.Sing.StaticP2RScoreBG.X;
    Text[TextP2R].X := Theme.Sing.TextP2R.X;
    Text[TextP2RScore].X := Theme.Sing.TextP2RScore.X;

    Static[StaticP2M].Texture.X := Theme.Sing.StaticP2M.X;
    Static[StaticP2MScoreBG].Texture.X := Theme.Sing.StaticP2MScoreBG.X;
    Text[TextP2M].X := Theme.Sing.TextP2M.X;
    Text[TextP2MScore].X := Theme.Sing.TextP2MScore.X;

    Static[StaticP3R].Texture.X := Theme.Sing.StaticP3R.X;
    Static[StaticP3RScoreBG].Texture.X := Theme.Sing.StaticP3RScoreBG.X;
    Text[TextP3R].X := Theme.Sing.TextP3R.X;
    Text[TextP3RScore].X := Theme.Sing.TextP3RScore.X;

  NR.Width := NR.Right - NR.Left;
  NR.WMid := NR.Width / 2;
  NR.Mid := NR.Left + NR.WMid;

  SetVis();

  //Set Position of Line Bonus - PhrasenBonus
  if (Ini.LineBonus = 1) then //Show Line Bonus at Scores
  begin
    Case PlayersPlay of
    1: begin
      Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ScoreBG.x;
      Player[0].LineBonus_TargetY := Theme.Sing.TextP1Score.Y;
      Player[0].LineBonus_StartX  := Theme.Sing.StaticP1ScoreBG.x;
      Player[0].LineBonus_StartY  := Theme.Sing.TextP1Score.Y + 65;
    end;

    2: begin
      //P1
      Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x;
      Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y;
      Player[0].LineBonus_StartX  := Theme.Sing.StaticP1TwoPScoreBG.X;
      Player[0].LineBonus_StartY  := Theme.Sing.TextP1TwoPScore.Y + 65;

      //P2
      Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.X;
      Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y;
      Player[1].LineBonus_StartX  := Theme.Sing.StaticP2RScoreBG.X;
      Player[1].LineBonus_StartY  := Theme.Sing.TextP2RScore.Y + 65;
    end;

    3: begin
      //P1
      Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x;
      Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y;
      Player[0].LineBonus_StartX  := Theme.Sing.StaticP1ThreePScoreBG.x;
      Player[0].LineBonus_StartY  := Theme.Sing.TextP1ThreePScore.Y + 65;

      //P2
      Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x;
      Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y;
      Player[1].LineBonus_StartX  := Theme.Sing.StaticP2MScoreBG.x;
      Player[1].LineBonus_StartY  := Theme.Sing.TextP2MScore.Y + 65;

      //P3
      Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x;
      Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y;
      Player[2].LineBonus_StartX  := Theme.Sing.StaticP3RScoreBG.x;
      Player[2].LineBonus_StartY  := Theme.Sing.TextP3RScore.Y + 65;
    end;

    4: begin
      //P1
      Player[0].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x;
      Player[0].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y;
      Player[0].LineBonus_StartX  := Theme.Sing.StaticP1TwoPScoreBG.x;
      Player[0].LineBonus_StartY  := Theme.Sing.TextP1TwoPScore.Y + 65;

      //P2
      Player[1].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x;
      Player[1].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y;
      Player[1].LineBonus_StartX  := Theme.Sing.StaticP2RScoreBG.x;
      Player[1].LineBonus_StartY  := Theme.Sing.TextP2RScore.Y + 65;

      if P4Mode then
      begin
        //P3
        Player[2].LineBonus_TargetX := Theme.Sing.StaticP3FourPScoreBG.x;
        Player[2].LineBonus_TargetY := Theme.Sing.TextP3FourPScore.Y;
        Player[2].LineBonus_StartX  := Theme.Sing.StaticP3FourPScoreBG.x;
        Player[2].LineBonus_StartY  := Theme.Sing.TextP3FourPScore.Y + 65;

        //P4
        Player[3].LineBonus_TargetX := Theme.Sing.StaticP4FourPScoreBG.x;
        Player[3].LineBonus_TargetY := Theme.Sing.TextP4FourPScore.Y;
        Player[3].LineBonus_StartX  := Theme.Sing.StaticP4FourPScoreBG.x;
        Player[3].LineBonus_StartY  := Theme.Sing.TextP4FourPScore.Y + 65;
      end else
      begin
        //P3
        Player[2].LineBonus_TargetX := Theme.Sing.StaticP1TwoPScoreBG.x;
        Player[2].LineBonus_TargetY := Theme.Sing.TextP1TwoPScore.Y;
        Player[2].LineBonus_StartX  := Theme.Sing.StaticP1TwoPScoreBG.x;
        Player[2].LineBonus_StartY  := Theme.Sing.TextP1TwoPScore.Y + 65;

        //P4
        Player[3].LineBonus_TargetX := Theme.Sing.StaticP2RScoreBG.x;
        Player[3].LineBonus_TargetY := Theme.Sing.TextP2RScore.Y;
        Player[3].LineBonus_StartX  := Theme.Sing.StaticP2RScoreBG.x;
        Player[3].LineBonus_StartY  := Theme.Sing.TextP2RScore.Y + 65;
      end;
    end;

    6: begin
      //P1
      Player[0].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x;
      Player[0].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y;
      Player[0].LineBonus_StartX  := Theme.Sing.StaticP1ThreePScoreBG.x;
      Player[0].LineBonus_StartY  := Theme.Sing.TextP1ThreePScore.Y + 65;

      //P2
      Player[1].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x;
      Player[1].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y;
      Player[1].LineBonus_StartX  := Theme.Sing.StaticP2MScoreBG.x;
      Player[1].LineBonus_StartY  := Theme.Sing.TextP2MScore.Y + 65;

      //P3
      Player[2].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x;
      Player[2].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y;
      Player[2].LineBonus_StartX  := Theme.Sing.StaticP3RScoreBG.x;
      Player[2].LineBonus_StartY  := Theme.Sing.TextP3RScore.Y + 65;

      if P4Mode then
      begin
        //P4
        Player[3].LineBonus_TargetX := Theme.Sing.StaticP4SixPScoreBG.x;
        Player[3].LineBonus_TargetY := Theme.Sing.TextP4SixPScore.Y;
        Player[3].LineBonus_StartX  := Theme.Sing.StaticP4SixPScoreBG.x;
        Player[3].LineBonus_StartY  := Theme.Sing.TextP4SixPScore.Y + 65;

        //P5
        Player[4].LineBonus_TargetX := Theme.Sing.StaticP5ScoreBG.x;
        Player[4].LineBonus_TargetY := Theme.Sing.TextP5Score.Y;
        Player[4].LineBonus_StartX  := Theme.Sing.StaticP5ScoreBG.x;
        Player[4].LineBonus_StartY  := Theme.Sing.TextP5Score.Y + 65;

        //P6
        Player[5].LineBonus_TargetX := Theme.Sing.StaticP6ScoreBG.x;
        Player[5].LineBonus_TargetY := Theme.Sing.TextP6Score.Y;
        Player[5].LineBonus_StartX  := Theme.Sing.StaticP6ScoreBG.x;
        Player[5].LineBonus_StartY  := Theme.Sing.TextP6Score.Y + 65;
      end else
      begin
        //P4
        Player[3].LineBonus_TargetX := Theme.Sing.StaticP1ThreePScoreBG.x;
        Player[3].LineBonus_TargetY := Theme.Sing.TextP1ThreePScore.Y;
        Player[3].LineBonus_StartX  := Theme.Sing.StaticP1ThreePScoreBG.x;
        Player[3].LineBonus_StartY  := Theme.Sing.TextP1ThreePScore.Y + 65;

        //P5
        Player[4].LineBonus_TargetX := Theme.Sing.StaticP2MScoreBG.x;
        Player[4].LineBonus_TargetY := Theme.Sing.TextP2MScore.Y;
        Player[4].LineBonus_StartX  := Theme.Sing.StaticP2MScoreBG.x;
        Player[4].LineBonus_StartY  := Theme.Sing.TextP2MScore.Y + 65;

        //P6
        Player[5].LineBonus_TargetX := Theme.Sing.StaticP3RScoreBG.x;
        Player[5].LineBonus_TargetY := Theme.Sing.TextP3RScore.Y;
        Player[5].LineBonus_StartX  := Theme.Sing.StaticP3RScoreBG.x;
        Player[5].LineBonus_StartY  := Theme.Sing.TextP3RScore.Y + 65;
      end;
      end;
    end;
  end else if (Ini.LineBonus = 2) then //Show Line Bonus at Notes
  begin
  //SingDrawNoteLines(Nr.Left + 10*ScreenX, 120, Nr.Right + 10*ScreenX, 12);
  //SingDrawNoteLines(Nr.Left + 10*ScreenX, 245, Nr.Right + 10*ScreenX, 12);
  //SingDrawNoteLines(Nr.Left + 10*ScreenX, 370, Nr.Right + 10*ScreenX, 12);

  Case PlayersPlay of
    1: begin
      Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65;
      Player[0].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_StartY  := Skin_P2_NotesB - 105;
    end;

    2: begin
      //P1
      Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28;
      Player[0].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_StartY  := Skin_P1_NotesB - 105 + 28;

      //P2
      Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28;
      Player[1].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_StartY  := Skin_P2_NotesB - 105 + 28;
    end;

    3: begin
      //P1
      Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_TargetY := 120 - 65 + 28;
      Player[0].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_StartY  := 120 + 28;

      //P2
      Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_TargetY := 245 - 65 + 28;
      Player[1].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_StartY  := 245 + 28;

      //P3
      Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[2].LineBonus_TargetY := 370 - 65 + 28;
      Player[2].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[2].LineBonus_StartY  := 370 + 28;
    end;

    4: begin
      //P1
      Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28;
      Player[0].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_StartY  := Skin_P1_NotesB - 105 + 28;

      //P2
      Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28;
      Player[1].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_StartY  := Skin_P2_NotesB - 105 + 28;

      if P4Mode then
      begin
        //P3
        Player[2].LineBonus_TargetX := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28;
        Player[2].LineBonus_StartX  := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[2].LineBonus_StartY  := Skin_P1_NotesB - 105 + 28;

        //P4
        Player[3].LineBonus_TargetX := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28;
        Player[3].LineBonus_StartX  := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_StartY  := Skin_P2_NotesB - 105 + 28;
      end else
      begin
        //P3
        Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
        Player[2].LineBonus_TargetY := Skin_P1_NotesB - 105 - 65 + 28;
        Player[2].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
        Player[2].LineBonus_StartY  := Skin_P1_NotesB - 105 + 28;

        //P4
        Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_TargetY := Skin_P2_NotesB - 105 - 65 + 28;
        Player[3].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_StartY  := Skin_P2_NotesB - 105 + 28;
      end;
    end;

    6: begin
      //P1
      Player[0].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_TargetY := 120 - 65 + 28;
      Player[0].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[0].LineBonus_StartY  := 120 + 28;

      //P2
      Player[1].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_TargetY := 245 - 65 + 28;
      Player[1].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[1].LineBonus_StartY  := 245 + 28;

      //P3
      Player[2].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
      Player[2].LineBonus_TargetY := 370 - 65 + 28;
      Player[2].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
      Player[2].LineBonus_StartY  := 370 + 28;

      if P4Mode then
      begin
        //P4
        Player[3].LineBonus_TargetX := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_TargetY := 120 - 65 + 28;
        Player[3].LineBonus_StartX  := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_StartY  := 120 + 28;

        //P5
        Player[4].LineBonus_TargetX := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[4].LineBonus_TargetY := 245 - 65 + 28;
        Player[4].LineBonus_StartX  := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[4].LineBonus_StartY  := 245 + 28;

        //P6
        Player[5].LineBonus_TargetX := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[5].LineBonus_TargetY := 370 - 65 + 28;
        Player[5].LineBonus_StartX  := Round(400 + Nr.Right + 10*ScreenX - 100);
        Player[5].LineBonus_StartY  := 370 + 28;
      end else
      begin
        //P4
        Player[3].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_TargetY := 120 - 65 + 28;
        Player[3].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
        Player[3].LineBonus_StartY  := 120 + 28;

        //P5
        Player[4].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
        Player[4].LineBonus_TargetY := 245 - 65 + 28;
        Player[4].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
        Player[4].LineBonus_StartY  := 245 + 28;

        //P6
        Player[5].LineBonus_TargetX := Round(Nr.Right + 10*ScreenX - 100);
        Player[5].LineBonus_TargetY := 370 - 65 + 28;
        Player[5].LineBonus_StartX  := Round(Nr.Right + 10*ScreenX - 100);
        Player[5].LineBonus_StartY  := 370 + 28;
      end;
    end;
  end;
  end;
  //Set Position of Line Bonus - PhrasenBonus End

  if (PlayersPlay=6) then
  begin
    LoadColor(Static[StaticP4SixP].Texture.ColR, Static[StaticP4SixP].Texture.ColG,
      Static[StaticP4SixP].Texture.ColB, 'P4Dark');
    LoadColor(Static[StaticP5].Texture.ColR, Static[StaticP5].Texture.ColG,
      Static[StaticP5].Texture.ColB, 'P5Dark');
    LoadColor(Static[StaticP6].Texture.ColR, Static[StaticP6].Texture.ColG,
      Static[StaticP6].Texture.ColB, 'P6Dark');

    LoadColor(Static[StaticP4SixPScoreBG].Texture.ColR, Static[StaticP4SixPScoreBG].Texture.ColG,
      Static[StaticP4SixPScoreBG].Texture.ColB, 'P4Dark');
    LoadColor(Static[StaticP5ScoreBG].Texture.ColR, Static[StaticP5ScoreBG].Texture.ColG,
      Static[StaticP5ScoreBG].Texture.ColB, 'P5Dark');
    LoadColor(Static[StaticP6ScoreBG].Texture.ColR, Static[StaticP6ScoreBG].Texture.ColG,
      Static[StaticP6ScoreBG].Texture.ColB, 'P6Dark');

    Text[TextP4SixP].Text := 'P4';
    Text[TextP5].Text := 'P5';
    Text[TextP6].Text := 'P6';
  end;

  if (PlayersPlay=4) then
  begin
    LoadColor(Static[StaticP3FourP].Texture.ColR, Static[StaticP3FourP].Texture.ColG,
      Static[StaticP3FourP].Texture.ColB, 'P3Dark');
    LoadColor(Static[StaticP4FourP].Texture.ColR, Static[StaticP4FourP].Texture.ColG,
      Static[StaticP4FourP].Texture.ColB, 'P4Dark');

    LoadColor(Static[StaticP3FourPScoreBG].Texture.ColR, Static[StaticP3FourPScoreBG].Texture.ColG,
      Static[StaticP3FourPScoreBG].Texture.ColB, 'P3Dark');
    LoadColor(Static[StaticP4FourPScoreBG].Texture.ColR, Static[StaticP4FourPScoreBG].Texture.ColG,
      Static[StaticP4FourPScoreBG].Texture.ColB, 'P4Dark');

    Text[TextP3FourP].Text := 'P3';
    Text[TextP4FourP].Text := 'P4';
  end;

  WebCam := false;
  LoadNextSong;

  Log.LogStatus('End', 'onShow');

  if not PerfLog.isActive and (Ini.Debug = 1) then
    PerfLog.StartNewLog;
end;

procedure TScreenSing.SetVis();
var
  V1:       boolean;
  V1TwoP:   boolean; //added for ps3 skin
  V1ThreeP: boolean; //added for ps3 skin
  V2R:      boolean;
  V2M:      boolean;
  V3R:      boolean;
  V3FourP:  boolean;
  V4FourP:  boolean;
  V4SixP:   boolean;
  V5:       boolean;
  V6:       boolean;
  vis:      boolean;
begin
  vis := (ShowNotes<2);

  if not P4Mode and vis then
  begin
    case PlayersPlay of
    1:  begin
          V1       := true;
          V1TwoP   := false;  //added for ps3 skin
          V1ThreeP := false;  //added for ps3 skin
          V2R      := false;
          V2M      := false;
          V3R      := false;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    2:  begin
          V1       := false;
          V1TwoP   := true;  //added for ps3 skin
          V1ThreeP := false; //added for ps3 skin
          V2R      := true;
          V2M      := false;
          V3R      := false;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    3:  begin
          V1       := false;
          V1TwoP   := false; //added for ps3 skin
          V1ThreeP := true;  //added for ps3 skin
          V2R      := false;
          V2M      := true;
          V3R      := true;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    4:  begin // double screen
          V1       := false;
          V1TwoP   := true;  //added for ps3 skin
          V1ThreeP := false; //added for ps3 skin
          V2R      := true;
          V2M      := false;
          V3R      := false;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    6:  begin // double screen
          V1       := false;
          V1TwoP   := false; //added for ps3 skin
          V1ThreeP := true;  //added for ps3 skin
          V2R      := false;
          V2M      := true;
          V3R      := true;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    else begin    //should not happen
          V1       := true;
          V1TwoP   := false;
          V1ThreeP := false;
          V2R      := false;
          V2M      := false;
          V3R      := false;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    end;
  end else if vis then
  begin
    case PlayersPlay of
    1:  begin
          V1       := true;
          V1TwoP   := false;  //added for ps3 skin
          V1ThreeP := false;  //added for ps3 skin
          V2R      := false;
          V2M      := false;
          V3R      := false;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    2:  begin
          V1       := false;
          V1TwoP   := true;  //added for ps3 skin
          V1ThreeP := false; //added for ps3 skin
          V2R      := true;
          V2M      := false;
          V3R      := false;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    3:  begin
          V1       := false;
          V1TwoP   := false; //added for ps3 skin
          V1ThreeP := true;  //added for ps3 skin
          V2R      := false;
          V2M      := true;
          V3R      := true;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    4:  begin
          V1       := false;
          V1TwoP   := true;  //added for ps3 skin
          V1ThreeP := false; //added for ps3 skin
          V2R      := true;
          V2M      := false;
          V3R      := false;
          V3FourP  := true;
          V4FourP  := true;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    6:  begin
          V1       := false;
          V1TwoP   := false; //added for ps3 skin
          V1ThreeP := true;  //added for ps3 skin
          V2R      := false;
          V2M      := true;
          V3R      := true;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := true;
          V5       := true;
          V6       := true;
        end;
    else begin    //should not happen
          V1       := true;
          V1TwoP   := false;
          V1ThreeP := false;
          V2R      := false;
          V2M      := false;
          V3R      := false;
          V3FourP  := false;
          V4FourP  := false;
          V4SixP   := false;
          V5       := false;
          V6       := false;
        end;
    end;
  end;

  if not vis then
  begin
    V1       := false;
    V1TwoP   := false;
    V1ThreeP := false;
    V2R      := false;
    V2M      := false;
    V3R      := false;
    V3FourP  := false;
    V4FourP  := false;
    V4SixP   := false;
    V5       := false;
    V6       := false;
  end;

  //Added for ps3 skin
  //This one is shown in 1P mode
  Static[StaticP1].Visible := V1;
  Static[StaticP1ScoreBG].Visible := V1;
  Text[TextP1].Visible := V1;
  Text[TextP1Score].Visible := V1;

  //This one is shown in 2/4P mode
  Static[StaticP1TwoP].Visible := V1TwoP;
  Static[StaticP1TwoPScoreBG].Visible := V1TwoP;
  Text[TextP1TwoP].Visible := V1TwoP;
  Text[TextP1TwoPScore].Visible := V1TwoP;

  //This one is shown in 3/6P mode
  Static[StaticP1ThreeP].Visible := V1ThreeP and not (PlayersPlay=6);
  Static[StaticP1ThreePScoreBG].Visible := V1ThreeP;
  Text[TextP1ThreeP].Visible := V1ThreeP and not (PlayersPlay=6);
  Text[TextP1ThreePScore].Visible := V1ThreeP;
  //eoa

  Static[StaticP2R].Visible := V2R;
  Static[StaticP2RScoreBG].Visible := V2R;
  Text[TextP2R].Visible := V2R;
  Text[TextP2RScore].Visible := V2R;

  Static[StaticP2M].Visible := V2M and not (PlayersPlay=6);
  Static[StaticP2MScoreBG].Visible := V2M;
  Text[TextP2M].Visible := V2M and not (PlayersPlay=6);
  Text[TextP2MScore].Visible := V2M;

  Static[StaticP3R].Visible := V3R and not (PlayersPlay=6);
  Static[StaticP3RScoreBG].Visible := V3R;
  Text[TextP3R].Visible := V3R and not (PlayersPlay=6);
  Text[TextP3RScore].Visible := V3R;

  Static[StaticP3FourP].Visible := V3FourP;
  Static[StaticP3FourPScoreBG].Visible := V3FourP;
  Text[TextP3FourP].Visible := V3FourP;
  Text[TextP3FourPScore].Visible := V3FourP;

  Static[StaticP4FourP].Visible := V4FourP;
  Static[StaticP4FourPScoreBG].Visible := V4FourP;
  Text[TextP4FourP].Visible := V4FourP;
  Text[TextP4FourPScore].Visible := V4FourP;

  Static[StaticP4SixP].Visible := false and V4SixP;
  Static[StaticP4SixPScoreBG].Visible := V4SixP;
  Text[TextP4SixP].Visible := false and V4SixP;
  Text[TextP4SixPScore].Visible := V4SixP;

  Static[StaticP5].Visible := false and V5;
  Static[StaticP5ScoreBG].Visible := V5;
  Text[TextP5].Visible := false and V5;
  Text[TextP5Score].Visible := V5;

  Static[StaticP6].Visible := false and V6;
  Static[StaticP6ScoreBG].Visible := V6;
  Text[TextP6].Visible := false and V6;
  Text[TextP6Score].Visible := V6;
end;

procedure TScreenSing.SongError;
var
  I, len:  integer;

begin
  if (not ScreenSong.PartyMedley) and (ScreenSong.Mode <> smMedley) then
  begin
    //Error Loading Song -> Go back to Song Screen and Show some Error Message

    FadeTo(@ScreenSong);
    ScreenSong.SongIndex := -1;
    ScreenSong.onShow;
    if (ScreenSong.Mode = smParty) then
      ScreenSong.SelectRandomSong;

    ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG'));
    Exit;
  end else if (ScreenSong.PartyMedley or (ScreenSong.Mode = smMedley))  then
  begin
    if (PlaylistMedley.CurrentMedleySong<PlaylistMedley.NumMedleySongs) then
    begin
      //Error Loading Song in Medley Mode -> skip actual Medley Song an go on if possible
      len := Length(PlaylistMedley.Song);
      for I := PlaylistMedley.CurrentMedleySong-1 to len - 1 do
        PlaylistMedley.Song[I] := PlaylistMedley.Song[I+1];

      SetLength(PlaylistMedley.Song, Len-1);
      Dec(PlaylistMedley.NumMedleySongs);
      LoadNextSong;
      Exit;
    end else
    begin
      if (PlaylistMedley.NumMedleySongs=1) then
      begin
        //Error Loading Song in Medley Mode -> Go back to Song Screen and Show some Error Message
        FadeTo(@ScreenSong);
        ScreenSong.SongIndex := -1;
        ScreenSong.onShow;
        ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG'));
        Exit;
      end else
      begin
        //Error Loading Song in Medley Mode -> Finish actual round
        len := Length(PlaylistMedley.Song);
        SetLength(PlaylistMedley.Song, len-1);
        Dec(PlaylistMedley.NumMedleySongs);
        Finish;
        Exit;
      end;
    end;
  end;
end;

procedure TScreenSing.SetLyricFontMain(Lyric: TLyric);
begin
  // set custom options
  case Ini.LyricsFont of
    0:
      begin
        Lyric.FontStyle := 0;
        Lyric.Size := 14; // 13
        Lyric.ColR := Skin_FontR;
        Lyric.ColG := Skin_FontG;
        Lyric.ColB := Skin_FontB;
        Lyric.ColSR := 5/255; //26
        Lyric.ColSG := 163/255; //165
        Lyric.ColSB := 210/255;  //220
      end;
    1:
      begin
        Lyric.FontStyle := 2;
        Lyric.Size := 14;
        Lyric.ColR := 0.6;
        Lyric.ColG := 0.6;
        Lyric.ColB := 1;
        Lyric.ColSR := 0.25;
        Lyric.ColSG := 0.25;
        Lyric.ColSB := 1;
      end;
    2:
      begin
        Lyric.FontStyle := 3;
        Lyric.Size := 12;
        Lyric.ColR := 0.6;
        Lyric.ColG := 0.6;
        Lyric.ColB := 1;
        Lyric.ColSR := 0.25;
        Lyric.ColSG := 0.25;
        Lyric.ColSB := 1;
      end;
    end; // case

    case Ini.LyricsEffect of
      0:  Lyric.Style := 1; // 0 - one selected, 1 - selected all to the current
      1:  Lyric.Style := 2;
      2:  Lyric.Style := 3;
      3:  Lyric.Style := 4;
    end; // case
end;

procedure TScreenSing.SetLyricFontSub(Lyric: TLyric);
begin
  // set custom options
  case Ini.LyricsFont of
    0:
      begin
        Lyric.FontStyle := 0;
        Lyric.Size := 14; // 13
        Lyric.ColR := 0.4; //0.6
        Lyric.ColG := 0.4; //0.6
        Lyric.ColB := 0.4; //0.6
      end;
    1:
      begin
        Lyric.FontStyle := 2;
        Lyric.Size := 14;
        Lyric.ColR := 0.8;
        Lyric.ColG := 0.8;
        Lyric.ColB := 0.8;
      end;
    2:
      begin
        Lyric.FontStyle := 3;
        Lyric.Size := 12;
        Lyric.ColR := 0.8;
        Lyric.ColG := 0.8;
        Lyric.ColB := 0.8;
      end;
    end; // case
end;

procedure TScreenSing.LoadNextSong;
var
  P, I:       integer;
  C, N, beat: integer;
  error:      boolean;

begin
  // load notes
  ResetSingTemp;
  PlaylistMedley.ApplausePlayed := false;
  if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
  begin
    if (length(PlaylistMedley.Song)>=PlaylistMedley.CurrentMedleySong) then
    begin
      CatSongs.Selected := PlaylistMedley.Song[PlaylistMedley.CurrentMedleySong-1];
      Music.Open(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].Mp3);
    end else
    begin
      SongError;
      Exit;
    end;
  end else
  begin
    for I := 0 to PlayersPlay - 1 do
      Player[I].VoiceFile := '';
  end;

  if not Music.isOpen then
    Music.Open(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].Mp3);

  AktSong := CatSongs.Song[CatSongs.Selected];
  try
    if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, SONG_LOAD_COMPLETE) then
    begin
      SongError;
      Exit;
    end;

  except
    SongError;
    Exit;
  end;
  
  AktSong.Path := CatSongs.Song[CatSongs.Selected].Path;

  error := false;
  for P := 0 to Length(Czesci) - 1 do
  begin
    C := Length(Czesci[P].Czesc)-1;
    N := Length(Czesci[P].Czesc[C].Nuta)-1;
    beat := Czesci[P].Czesc[C].Nuta[N].Start + Czesci[P].Czesc[C].Nuta[N].Dlugosc;
    if (Music.Length < GetTimeFromBeat(beat)) then
      error := true;
  end;

  if error then
  begin
    Log.LogError('Error: TXT is longer than the MP3 in Song: ' + AktSong.Path + AktSong.Filename);
    SongError;
    Exit;
  end;

  if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
  begin
    SetMedleyMode;
    Text[SongNameText].Text := IntToStr(PlaylistMedley.CurrentMedleySong) +
      '/' + IntToStr(PlaylistMedley.NumMedleySongs) + ': ' +
      AktSong.Artist + ' - ' + AktSong.Title;

    //medley start and end timestamps
    StartNote := FindNote(AktSong.Medley.StartBeat - round(AktSong.BPM[0].BPM*AktSong.Medley.FadeIn_time/60));
    MedleyStart := GetTimeFromBeat(Czesci[0].Czesc[StartNote.line].Nuta[0].Start);

    //check Medley-Start
    if (MedleyStart+AktSong.Medley.FadeIn_time*0.5>GetTimeFromBeat(AktSong.Medley.StartBeat)) then
      MedleyStart := GetTimeFromBeat(AktSong.Medley.StartBeat) - AktSong.Medley.FadeIn_time;
    if MedleyStart<0 then
      MedleyStart := 0;

    MedleyEnd := GetTimeFromBeat(AktSong.Medley.EndBeat) + AktSong.Medley.FadeOut_time;
  end;

  // set movie
  if (Ini.MovieSize<2) and (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then
  begin
    acOpenFile(PAnsiChar(AktSong.Path + AktSong.Video));

    if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
      acSkip2(AktSong.VideoGAP, MedleyStart)
    else
      acSkip2(AktSong.VideoGAP, AktSong.Start);

    if (UVideo.VideoOpened) then
      AktSong.VideoLoaded := true;

    UVideo.SetAspectCorrection(TAspectCorrection(
      DataBase.GetAspect(AktSong.Artist, AktSong.Title, Ini.AspectCorrect)));
  end;

  // set background
  if (AktSong.Background <> '')  and (AktSong.VideoLoaded = false) then
    try
      Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background);
    except
      log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background);
      Tex_Background.TexNum := -1;
    end
  else
    Tex_Background.TexNum := -1;

  // play music+timer (I)
  if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
  begin
    Music.MoveTo(MedleyStart);
    Czas.Teraz := MedleyStart;
    Czas.Razem := MedleyEnd;
  end else
  begin
    Music.MoveTo(AktSong.Start);

    Czas.Teraz := AktSong.Start;
    Czas.Razem := Music.Length;
    if (AktSong.Finish > 0) then
      Czas.Razem := AktSong.Finish / 1000;
  end;

  Czas.AktBeat := 0;
  Czas.AktBeatC := 0;
  Czas.AktBeatD := 0;

  // main text
  LyricMain[0].Clear;
  LyricMain[0].X := 400;
  LyricMain[0].Y := Skin_LyricsT;
  LyricMain[0].Scale := 1.4; //1.4
  LyricMain[0].Align := 1;

  // sub text
  LyricSub[0].Clear;
  LyricSub[0].X := 400;
  LyricSub[0].Y := Skin_LyricsT + 35; //42 //40
  LyricSub[0].Align := 1;

  SetLyricFontMain(LyricMain[0]);
  SetLyricFontSub(LyricSub[0]);

  if AktSong.isDuet then
  begin
    // main text
    LyricMain[1].Clear;
    LyricMain[1].X := 400;
    LyricMain[1].Y := Skin_LyricsT;
    LyricMain[0].Y := 5{Skin_LyricsT};
    LyricMain[1].Scale := 1.4;
    LyricMain[1].Align := 1;

    // sub text
    LyricSub[1].Clear;
    LyricSub[1].X := 400;
    LyricSub[0].Y := 5{Skin_LyricsT} + 35;
    LyricSub[1].Y := Skin_LyricsT + 35;
    LyricSub[1].Align := 1;

    SetLyricFontMain(LyricMain[1]);
    SetLyricFontSub(LyricSub[1]);

    Static[StaticLyricDuetBar].Visible := true;
  end else
    Static[StaticLyricDuetBar].Visible := false;

  Czas.OldBeat := -1;


  for P := 0 to High(Player) do
    ClearScores(P);

  // fill texts
  LyricMain[0].AddCzesc(0, 0);
  LyricMain[0].Selected := -1;
  LyricSub[0].AddCzesc(0, 1);
  LyricSub[0].Selected := -1;

  if AktSong.isDuet then
  begin
    // fill texts
    LyricMain[1].AddCzesc(1, 0);
    LyricMain[1].Selected := -1;
    LyricSub[1].AddCzesc(1, 1);
    LyricSub[1].Selected := -1;
  end;

  //Deactivate Pause
  Paused := False;

  //Kill all Stars not Killed yet
  //GoldenStarsTwinkle Mod
  GoldenRec.SentenceChange(0);
  if AktSong.isDuet then
    GoldenRec.SentenceChange(1);
  //GoldenStarsTwinkle Mod End

  //Set Num of Empty Sentences for Phrasen Bonus
  NumEmptySentences[0] := 0;
  NumEmptySentences[1] := 0;

  for I := 0 to Length(Czesci) - 1 do
  begin
    for P := low(Czesci[I].Czesc) to high(Czesci[I].Czesc) do
      if Czesci[I].Czesc[P].TotalNotes = 0 then Inc(NumEmptySentences[I]);
  end;

  if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
  begin
    MedleyHandler.changed := true;
    MedleyHandler.change_time := Czas.Teraz;

    Static[SongNameStatic].Visible := true;
    Text[SongNameText].Visible := true;
  end else
  begin
    Static[SongNameStatic].Visible := false;
    Text[SongNameText].Visible := false;
  end;

  Music.CaptureStart;

  for I := 0 to 3 - 1 do
    Alpha[I] := 0;
  
  if ((ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley)
    and (PlaylistMedley.CurrentMedleySong>1) then
    onShowFinish;
end;

procedure TScreenSing.onShowFinish;
begin
  // play movie (II)
  if AktSong.VideoLoaded then
  begin
    try
      acGetFrame(Czas.Teraz);
    except
      //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video
      AktSong.VideoLoaded := False;
      Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.');
      Log.LogError('Corrupted File: ' + AktSong.Video);
      try
        acClose;
      except

      end;
    end;
  end;

  if AktSong.VideoLoaded then
    WebCam := false
  else if not FGrabFrameFlag and (Ini.EnableWebCam=1) then
  begin
    //Display White Activating WebCam Text
    SetFontStyle(2); //Font: Outlined1
    SetFontSize(12);
    SetFontItalic(False);
    SetFontPos (400 - glTextWidth ('Activating Webcam ...')/2, 250); //Position
    glColor4f(1,1,1,1);
    glPrint('Activating Webcam ...');
    SwapBuffers;
    WebCam := wStartWebCam();
  end;

  // play music (II)
  if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
    Music.Fade(10, MP3Volume, AktSong.Medley.FadeIn_time)
  else
    Music.SetMusicVolume(MP3Volume);

  Music.Play;

  // prepare timer (II)
  CountSkipTimeSet;
end;

function TScreenSing.Draw: boolean;
Const
  dt = 5;

var
  Min:    integer;
  Sec:    integer;
  Tekst:  string;
  sung:   boolean;
  Flash:  real;
  S:      integer;
  T:      integer;
  I, J, K:integer;
  ab:     real;
  tt:     real;
  lastLine, LastWord:     integer;
  medley_end:             boolean;
  medley_start_applause:  boolean;
  CurTime:                real;
begin
  PerfLog.AddComment('ScreenSing: Start Draw');

  SetVis;
  //ScoreBG Mod
  // set player colors
  if PlayersPlay = 4 then
  begin
    if ScreenAct = 1 then
    begin
      LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG,
      Static[StaticP1TwoP].Texture.ColB, 'P1Dark');
      LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG,
      Static[StaticP2R].Texture.ColB, 'P2Dark');

      LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG,
      Static[StaticP1TwoPScoreBG].Texture.ColB, 'P1Dark');
      LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG,
      Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark');
    end;

    if ScreenAct = 2 then
    begin
      LoadColor(Static[StaticP1TwoP].Texture.ColR, Static[StaticP1TwoP].Texture.ColG,
        Static[StaticP1TwoP].Texture.ColB, 'P3Dark');
      LoadColor(Static[StaticP2R].Texture.ColR, Static[StaticP2R].Texture.ColG,
        Static[StaticP2R].Texture.ColB, 'P4Dark');

      LoadColor(Static[StaticP1TwoPScoreBG].Texture.ColR, Static[StaticP1TwoPScoreBG].Texture.ColG,
        Static[StaticP1TwoPScoreBG].Texture.ColB, 'P3Dark');
      LoadColor(Static[StaticP2RScoreBG].Texture.ColR, Static[StaticP2RScoreBG].Texture.ColG,
        Static[StaticP2RScoreBG].Texture.ColB, 'P4Dark');
    end;
  end;

  if PlayersPlay = 6 then
  begin
    if ScreenAct = 1 then
    begin
      LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG,
        Static[StaticP1ThreeP].Texture.ColB, 'P1Dark');
      LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG,
        Static[StaticP2R].Texture.ColB, 'P2Dark');
      LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG,
        Static[StaticP3R].Texture.ColB, 'P3Dark');

      LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG,
        Static[StaticP1ThreePScoreBG].Texture.ColB, 'P1Dark');
      LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG,
        Static[StaticP2RScoreBG].Texture.ColB, 'P2Dark');
      LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG,
        Static[StaticP3RScoreBG].Texture.ColB, 'P3Dark');
    end;

    if ScreenAct = 2 then
    begin
      LoadColor(Static[StaticP1ThreeP].Texture.ColR, Static[StaticP1ThreeP].Texture.ColG,
        Static[StaticP1ThreeP].Texture.ColB, 'P4Dark');
      LoadColor(Static[StaticP2M].Texture.ColR, Static[StaticP2M].Texture.ColG,
        Static[StaticP2R].Texture.ColB, 'P5Dark');
      LoadColor(Static[StaticP3R].Texture.ColR, Static[StaticP3R].Texture.ColG,
        Static[StaticP3R].Texture.ColB, 'P6Dark');

      LoadColor(Static[StaticP1ThreePScoreBG].Texture.ColR, Static[StaticP1ThreePScoreBG].Texture.ColG,
        Static[StaticP1ThreePScoreBG].Texture.ColB, 'P4Dark');
      LoadColor(Static[StaticP2MScoreBG].Texture.ColR, Static[StaticP2MScoreBG].Texture.ColG,
        Static[StaticP2RScoreBG].Texture.ColB, 'P5Dark');
      LoadColor(Static[StaticP3RScoreBG].Texture.ColR, Static[StaticP3RScoreBG].Texture.ColG,
        Static[StaticP3RScoreBG].Texture.ColB, 'P6Dark');
    end;
  end;

  // set player names (for 2 screens and only Singstar skin)
  if ScreenAct = 1 then begin
    Text[TextP1].Text := 'P1';
    Text[TextP1TwoP].Text := 'P1'; //added for ps3 skin
    Text[TextP1ThreeP].Text := 'P1'; //added for ps3 skin
    Text[TextP2R].Text := 'P2';
    Text[TextP2M].Text := 'P2';
    Text[TextP3R].Text := 'P3';
  end;

  if ScreenAct = 2 then begin
    case PlayersPlay of
{        1:  begin
              Text[TextP1].Text := 'P2';
            end;
        2:  begin
              Text[TextP1].Text := 'P3';
              Text[TextP2R].Text := 'P4';
            end;
        3:  begin
              Text[TextP1].Text := 'P4';
              Text[TextP2M].Text := 'P5';
              Text[TextP3R].Text := 'P6';
            end;}

      4:  begin
            Text[TextP1TwoP].Text := 'P3';
            Text[TextP2R].Text := 'P4';
          end;
      6:  begin
            Text[TextP1ThreeP].Text := 'P4';
            Text[TextP2M].Text := 'P5';
            Text[TextP3R].Text := 'P6';
          end;
    end; // case
  end; // if
  // stereo

// weird stuff, maybe this is for "dual screen?", but where is player three then?
  {Static[StaticP1].Texture.X := Static[StaticP1].Texture.X + 10*ScreenX;
  Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X + 10*ScreenX;

  Text[TextP1].X := Text[TextP1].X + 10*ScreenX;
  Text[TextP1Score].X := Text[TextP1Score].X + 10*ScreenX;


  Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X + 10*ScreenX;
  Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X + 10*ScreenX;

  Text[TextP2R].X := Text[TextP2R].X + 10*ScreenX;
  Text[TextP2RScore].X := Text[TextP2RScore].X + 10*ScreenX;
// end of weird stuff

  for S := 1 to 1 do
    Static[S].Texture.X := Static[S].Texture.X + 10*ScreenX;

  for T := 0 to 1 do
    Text[T].X := Text[T].X + 10*ScreenX;}

  // update static menu with time ...
  if ScreenSong.Mode <> smMedley then
    CurTime := Czas.Razem - Czas.Teraz
  else
    CurTime := MedleyEnd - Czas.Teraz;

  Min := Round(CurTime) div 60;
  Sec := Round(CurTime) mod 60;
  Text[TextTimeText].Text := '';
  if Min < 10 then Text[TextTimeText].Text := '0';
  Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Min) + ':';
  if Sec < 10 then Text[TextTimeText].Text := Text[TextTimeText].Text + '0';
  Text[TextTimeText].Text := Text[TextTimeText].Text + IntToStr(Sec);

  sung := true;
  for I := 0 to Length(Czesci) - 1 do
  begin
    lastLine := Length(Czesci[I].Czesc)-1;
    lastWord := Length(Czesci[I].Czesc[lastLine].Nuta)-1;

    if (lastLine>=0) and (lastWord>=0) then
    begin
      if (Czas.AktBeatD<(Czesci[I].Czesc[lastLine].Nuta[lastWord].Start+
        Czesci[I].Czesc[lastLine].Nuta[lastWord].Dlugosc)) then
        sung := false;
    end;
  end;

  ScreenSong.SungToEnd := sung;

  // for medley-mode:
  CurTime := Czas.Teraz;
  if (ScreenSong.Mode = smMedley) and (CurTime > MedleyEnd) then
    medley_end := true
  else
    medley_end := false;

  if (ScreenSong.Mode = smMedley) and (CurTime >
    GetTimeFromBeat(AktSong.Medley.EndBeat)) then
    medley_start_applause := true
  else
    medley_start_applause := false;

  // .. and scores
  if PlayersPlay = 1 then
  begin
    Tekst := IntToStr(Player[0].ScoreTotalI);
    while Length(Tekst) < 5 do Tekst := '0' + Tekst;
    Text[TextP1Score].Text := Tekst;
  end;

  if PlayersPlay = 2 then
  begin
    Tekst := IntToStr(Player[0].ScoreTotalI);
    while Length(Tekst) < 5 do Tekst := '0' + Tekst;
    Text[TextP1TwoPScore].Text := Tekst;

    Tekst := IntToStr(Player[1].ScoreTotalI);
    while Length(Tekst) < 5 do Tekst := '0' + Tekst;
    Text[TextP2RScore].Text := Tekst;
  end;

  if PlayersPlay = 3 then
  begin
    Tekst := IntToStr(Player[0].ScoreTotalI);
    while Length(Tekst) < 5 do Tekst := '0' + Tekst;
    Text[TextP1ThreePScore].Text := Tekst;

    Tekst := IntToStr(Player[1].ScoreTotalI);
    while Length(Tekst) < 5 do Tekst := '0' + Tekst;
    Text[TextP2MScore].Text := Tekst;

    Tekst := IntToStr(Player[2].ScoreTotalI);
    while Length(Tekst) < 5 do Tekst := '0' + Tekst;
    Text[TextP3RScore].Text := Tekst;
  end;

  if PlayersPlay = 4 then
  begin
    if ScreenAct = 1 then
    begin
      Tekst := IntToStr(Player[0].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP1TwoPScore].Text := Tekst;

      Tekst := IntToStr(Player[1].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP2RScore].Text := Tekst;
    end;

    if ScreenAct = 2 then
    begin
      Tekst := IntToStr(Player[2].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP1TwoPScore].Text := Tekst;

      Tekst := IntToStr(Player[3].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP2RScore].Text := Tekst;
    end;

    if P4Mode then
    begin
      Tekst := IntToStr(Player[2].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP3FourPScore].Text := Tekst;

      Tekst := IntToStr(Player[3].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP4FourPScore].Text := Tekst;
    end;
  end;

  if PlayersPlay = 6 then
  begin
    if ScreenAct = 1 then
    begin
      Tekst := IntToStr(Player[0].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP1ThreePScore].Text := Tekst;

      Tekst := IntToStr(Player[1].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP2MScore].Text := Tekst;

      Tekst := IntToStr(Player[2].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP3RScore].Text := Tekst;
    end;

    if ScreenAct = 2 then
    begin
      Tekst := IntToStr(Player[3].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP1ThreePScore].Text := Tekst;

      Tekst := IntToStr(Player[4].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP2MScore].Text := Tekst;

      Tekst := IntToStr(Player[5].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP3RScore].Text := Tekst;
    end;

    if P4Mode then
    begin
      Tekst := IntToStr(Player[3].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP4SixPScore].Text := Tekst;

      Tekst := IntToStr(Player[4].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP5Score].Text := Tekst;

      Tekst := IntToStr(Player[5].ScoreTotalI);
      while Length(Tekst) < 5 do Tekst := '0' + Tekst;
      Text[TextP6Score].Text := Tekst;
    end;
  end;

  // draw static menu (BG)
  DrawBG;
  //Draw Background
  SingDrawBackground;
  // update and draw movie
  if ShowFinish and AktSong.VideoLoaded then
  begin
    try
      acGetFrame(Music.Position + Ini.LipSync*0.01);
      acDrawGL(ScreenAct, not WebCam); // this only draws
    except
      //If an Error occurs drawing: prevent Video from being Drawn again and Close Video
      AktSong.VideoLoaded := False;
      log.LogError('Error drawing Video, Video has been disabled for this Song/Session.');
      Log.LogError('Corrupted File: ' + AktSong.Video);
      try
        acClose;
      except

      end;
    end;
  end;

  wDraw(WebCam, ScreenAct);
  // draw static menu (FG)
  if (ShowNotes<4) then
    DrawFG;

  //Medley Countdown
  if ScreenSong.Mode = smMedley then
    DrawMedleyCountdown;
    
  // check for music finish
  // Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish));
  if ShowFinish then
  begin
    if (not Music.Finished) and (not medley_end or (ScreenSong.Mode <> smMedley))
      and ((AktSong.Finish = 0) or ((Music.Position + Ini.LipSync*0.01)*1000 <= AktSong.Finish)) then
    begin
      //Pause Mod:
      if not Paused then
      begin
        Sing(Self);       // analyze song
        //Update Medley Stats
        if (ScreenSong.Mode = smMedley) and not FadeOut then
          UpdateMedleyStats(medley_start_applause);
      end;
    end else
    begin
      if not FadeOut and ((Screens=1) or (ScreenAct = 2)) then
      begin
        Finish;
        if ScreenSong.Mode = smNormal then
        begin
          FadeOut := true;
          FadeTo(@ScreenScore);
        end;
      end;
    end;
  end;

  for I := 0 to Length(Czesci) - 1 do
  begin
    //init K ...
    K := Czesci[I].Akt;

    //find actual line
    for J := 0 to Czesci[I].High do
    begin
      if Czas.AktBeat >= Czesci[I].Czesc[J].Start then
        K := J;
    end;

    //time diff
    ab := GetTimeFromBeat(Czesci[I].Czesc[K].StartNote) - Czas.Teraz;

    //last line
    if (K = Czesci[I].High) then
      ab := Czas.Teraz - GetTimeFromBeat(Czesci[I].Czesc[K].Nuta[Czesci[I].Czesc[K].HighNut].Start+
        Czesci[I].Czesc[K].Nuta[Czesci[I].Czesc[K].HighNut].Dlugosc);

    //lyric main and other nice things
    if (ab>2.3*dt) or ((K = Czesci[I].High) and (ab>dt)) then
    begin
      if (ab>3.3*dt) or (Alpha[I]<1) or (K = Czesci[I].High) then
        Alpha[I] := Alpha[I]-TimeSkip/dt;
      if (Alpha[I]<0) then
        Alpha[I] := 0;
    end else if (ab>dt) then
    begin
      tt := ab-dt;
      if (tt<0) then
        Alpha[I] := 1
      else
      begin
        if (1-tt/dt>Alpha[I]) or (K = Czesci[I].High)then
          Alpha[I] := 1-tt/dt;
      end;
    end else
      Alpha[I] := 1;

    //lyric sub
    if (K < Czesci[I].High) then
    begin
      ab := GetTimeFromBeat(Czesci[I].Czesc[K+1].StartNote) - Czas.Teraz;

      if (ab>2.5*dt) then
        Alpha[I+2] := 0
      else if (ab>dt) then
        Alpha[I+2] := (1-(ab-dt)/dt)
      else
        Alpha[I+2] := 1;
    end;
  end;

  if not AktSong.isDuet then
  begin
    Alpha[1] := Alpha[0];
    Alpha[3] := Alpha[2];
  end;

  Static[StaticLyricBar].Texture.Alpha := Alpha[1];
  if (ShowNotes<3) then
    Static[StaticLyricBar].Visible := true
  else
    Static[StaticLyricBar].Visible := false;

  if AktSong.isDuet then
  begin
    Static[StaticLyricDuetBar].Texture.Alpha := Alpha[0];

    if (ShowNotes<3) then
      Static[StaticLyricDuetBar].Visible := true
    else
      Static[StaticLyricDuetBar].Visible := false;
  end;


  // draw custom items
  SingDraw(Alpha);  // always draw

  //GoldenNoteStarsTwinkle Mod
  if (ShowNotes=0) then
    GoldenRec.SpawnRec(Alpha);
  //GoldenNoteStarsTwinkle Mod

  // back stereo

  // weird stuff, maybe this is for "dual screen?", but where is player three then?
  {Static[StaticP1].Texture.X := Static[StaticP1].Texture.X - 10*ScreenX;
  Static[StaticP1ScoreBG].Texture.X := Static[StaticP1ScoreBG].Texture.X - 10*ScreenX;

  Text[TextP1].X := Text[TextP1].X - 10*ScreenX;
  Text[TextP1Score].X := Text[TextP1Score].X - 10*ScreenX;


  Static[StaticP2R].Texture.X := Static[StaticP2R].Texture.X - 10*ScreenX;
  Static[StaticP2RScoreBG].Texture.X := Static[StaticP2RScoreBG].Texture.X - 10*ScreenX;

  Text[TextP2R].X := Text[TextP2R].X - 10*ScreenX;
  Text[TextP2RScore].X := Text[TextP2RScore].X - 10*ScreenX;}
  //weird end

  for S := 1 to 1 do
    Static[S].Texture.X := Static[S].Texture.X - 10*ScreenX;

  for T := 0 to 1 do
    Text[T].X := Text[T].X - 10*ScreenX;

  //Aspect
  if AspectHandler.changed and (Czas.Teraz>AspectHandler.change_time + 3) then
  begin
    AspectHandler.changed:=false;
    Text[VideoAspectText].Visible := false;
    Static[VideoAspectStatic].Visible := false;
  end;

  //Medley
  if MedleyHandler.changed and (Czas.Teraz>MedleyHandler.change_time + AktSong.Medley.FadeIn_time) then
  begin
    MedleyHandler.changed:=false;
    Static[SongNameStatic].Visible := false;
    Text[SongNameText].Visible := false;
  end;

  if MP3VolumeHandler.changed and (MP3VolumeHandler.change_time+TimeSkip<3) then
  begin
    MP3VolumeHandler.change_time := MP3VolumeHandler.change_time + TimeSkip;
    DrawVolumeBar(10, 475, 782, 12, MP3Volume);
  end else
    MP3VolumeHandler.changed := false;


  if (Ini.Debug=1) then
  begin
    glEnable(GL_BLEND);
    glDisable(GL_TEXTURE_2D);
    glColor4f(1, 1, 1, 0.6);
    glBegin(GL_QUADS);
      glVertex2f(0, 180);
      glVertex2f(0, 210);
      glVertex2f(400, 210);
      glVertex2f(400, 180);
    glEnd;
    glDisable(GL_BLEND);

    SetFontStyle(1);
    SetFontItalic(false);
    SetFontSize(8);
    glColor4f(0, 0, 0, 1);

    SetFontPos (5, 184);
    glPrint(PChar('lt: ' + FormatFloat('#0.00', Czas.Teraz) +
      ' mt: ' + FormatFloat('#0.00', Music.Position + Ini.LipSync*0.01) +
      ' dt: ' + FormatFloat('#0.000', Czas.Teraz-(Music.Position+Ini.LipSync*0.01))));
  end;
  PerfLog.AddComment('ScreenSing: End Draw');
end;

procedure TScreenSing.UpdateMedleyStats(medley_end: boolean);
var
  len, num, I : integer;

begin
  len := Length(PlaylistMedley.Stats);
  num := PlaylistMedley.NumPlayer;

  if (PlaylistMedley.CurrentMedleySong>len) and
    (PlaylistMedley.CurrentMedleySong<=PlaylistMedley.NumMedleySongs) then
  begin
    inc(len);
    SetLength(PlaylistMedley.Stats, len);
    SetLength(PlaylistMedley.Stats[len-1].Player, num);
    PlaylistMedley.Stats[len-1].SongArtist := AktSong.Artist;
    PlaylistMedley.Stats[len-1].SongTitle := AktSong.Title;
  end;

  if (PlaylistMedley.CurrentMedleySong<=PlaylistMedley.NumMedleySongs) then
    for I := 0 to num - 1 do
      PlaylistMedley.Stats[len-1].Player[I] := Player[I];

  if medley_end and not PlaylistMedley.ApplausePlayed and
    (PlaylistMedley.CurrentMedleySong<=PlaylistMedley.NumMedleySongs) then
  begin
    PlaylistMedley.ApplausePlayed:=true;
    Music.PlayApplause;
    Music.Fade(MP3Volume, 10, AktSong.Medley.FadeOut_time);
  end;
end;

procedure TScreenSing.Finish;
var
  I, J:     integer;
  len, num: integer;
  points:   string;
  scores:   array of string;
  names:    array of string;
  singmode: string;
  Min, Sec: integer;
  CurTime:  real;

begin
  PerfLog.StopLogging;
  Music.CaptureStop;
  Music.Stop;

  if (Ini.SavePlayback = 1) and not FadeOut then
  begin
    Log.BenchmarkStart(0);

    for I := 0 to PlayersPlay - 1 do
    begin
      points := IntToStr(Player[I].ScoreTotalI);
      while Length(points) < 5 do
        points := '0'+points;

      Player[I].VoiceFile := Log.LogVoice(I, Ini.Name[I], AktSong.Artist, AktSong.Title, points);
    end;

    Log.BenchmarkEnd(0);
    Log.LogBenchmark('Creating files', 0);
  end;

  if (Ini.LogSession=1) and not FadeOut then
  begin
    SetLength(scores, PlayersPlay);
    SetLength(names, PlayersPlay);
    for I := 0 to PlayersPlay - 1 do
    begin
      points := IntToStr(Player[I].ScoreTotalI);
      while Length(points) < 5 do
        points := '0'+points;

      scores[I] := points;
      names[I] := Ini.Name[I];
    end;

    if (ScreenSong.Mode = smParty) then
      singmode := PartySession.Plugins[PartySession.Rounds[PartySession.CurRound].PluginNr].Name
    else if (ScreenSong.Mode = smChallenge) then
      singmode := PartySessionM2.Plugins[PartySessionM2.Rounds[PartySessionM2.CurRound].PluginNr].Name;

    if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
    begin
      if (ScreenSong.Mode = smMedley) then
        singmode := 'Medley';

      if (PlaylistMedley.CurrentMedleySong<=PlaylistMedley.NumMedleySongs) then
        singmode := singmode + ' (' + IntToStr(PlaylistMedley.CurrentMedleySong) +
          '/' + IntToStr(PlaylistMedley.NumMedleySongs) + ')'
      else
        singmode := singmode + ' (' + IntToStr(PlaylistMedley.NumMedleySongs) +
          '/' + IntToStr(PlaylistMedley.NumMedleySongs) + ')';
          
    end else if(ScreenSong.Mode = smNormal) then
    begin
      singmode := 'Normal';
      if AktSong.isDuet then
        singmode := singmode + ' (Duet)';
    end;

    if not ScreenSong.SungToEnd then
    begin
      singmode := singmode + ', abort at: ';

      if ScreenSong.Mode <> smMedley then
        CurTime := Czas.Teraz
      else
        CurTime := Czas.Teraz - MedleyStart;

      Min := Round(CurTime) div 60;
      Sec := Round(CurTime) mod 60;

      if Min < 10 then singmode := singmode + '0';
      singmode := singmode + IntToStr(Min) + ':';
      if Sec < 10 then singmode := singmode + '0';
      singmode := singmode + IntToStr(Sec);
    end;

    Log.LogSession(names, scores, AktSong.Artist, AktSong.Title, singmode);
  end;

  if AktSong.VideoLoaded then
  begin
    acClose;
    AktSong.VideoLoaded := false; // to prevent drawing closed video
  end;

  SetFontItalic (False);

  if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
  begin
    if not FadeOut then
    begin
      for I := 0 to PlayersPlay - 1 do
          PlaylistMedley.Stats[Length(PlaylistMedley.Stats)-1].Player[I] := Player[I];

      inc(PlaylistMedley.CurrentMedleySong);
      if PlaylistMedley.CurrentMedleySong<=PlaylistMedley.NumMedleySongs then
      begin
        LoadNextSong;
      end else
      begin
        wStopWebCam();
        Ini.Save;
        //build sums
        len := Length(PlaylistMedley.Stats);
        num := PlaylistMedley.NumPlayer;

        SetLength(PlaylistMedley.Stats, len+1);
        SetLength(PlaylistMedley.Stats[len].Player, num);

        for J := 0 to len - 1 do
        begin
          for I := 0 to num - 1 do
          begin
            PlaylistMedley.Stats[len].Player[I].Score :=
              PlaylistMedley.Stats[len].Player[I].Score +
              PlaylistMedley.Stats[J].Player[I].Score;

            PlaylistMedley.Stats[len].Player[I].ScoreLine :=
              PlaylistMedley.Stats[len].Player[I].ScoreLine +
              PlaylistMedley.Stats[J].Player[I].ScoreLine;

            PlaylistMedley.Stats[len].Player[I].ScoreGolden :=
              PlaylistMedley.Stats[len].Player[I].ScoreGolden +
              PlaylistMedley.Stats[J].Player[I].ScoreGolden;

            PlaylistMedley.Stats[len].Player[I].ScoreI :=
              PlaylistMedley.Stats[len].Player[I].ScoreI +
              PlaylistMedley.Stats[J].Player[I].ScoreI;

            PlaylistMedley.Stats[len].Player[I].ScoreLineI :=
              PlaylistMedley.Stats[len].Player[I].ScoreLineI +
              PlaylistMedley.Stats[J].Player[I].ScoreLineI;

            PlaylistMedley.Stats[len].Player[I].ScoreGoldenI :=
              PlaylistMedley.Stats[len].Player[I].ScoreGoldenI +
              PlaylistMedley.Stats[J].Player[I].ScoreGoldenI;

            PlaylistMedley.Stats[len].Player[I].ScoreTotalI :=
              PlaylistMedley.Stats[len].Player[I].ScoreTotalI +
              PlaylistMedley.Stats[J].Player[I].ScoreTotalI;
          end; //of for I
        end; //of for J

        //build mean on sum
        for I := 0 to num - 1 do
        begin
          PlaylistMedley.Stats[len].Player[I].Score := round(
            PlaylistMedley.Stats[len].Player[I].Score / len);

          PlaylistMedley.Stats[len].Player[I].ScoreLine := round(
            PlaylistMedley.Stats[len].Player[I].ScoreLine / len);

          PlaylistMedley.Stats[len].Player[I].ScoreGolden := round(
            PlaylistMedley.Stats[len].Player[I].ScoreGolden / len);

          PlaylistMedley.Stats[len].Player[I].ScoreI := round(
            PlaylistMedley.Stats[len].Player[I].ScoreI / len);

          PlaylistMedley.Stats[len].Player[I].ScoreLineI := round(
            PlaylistMedley.Stats[len].Player[I].ScoreLineI / len);

          PlaylistMedley.Stats[len].Player[I].ScoreGoldenI := round(
            PlaylistMedley.Stats[len].Player[I].ScoreGoldenI / len);

          PlaylistMedley.Stats[len].Player[I].ScoreTotalI := round(
            PlaylistMedley.Stats[len].Player[I].ScoreTotalI / len);
        end;

        FadeOut:=true;
        if ScreenSong.PartyMedley then
        begin
          for I := 0 to PlayersPlay-1 do
          begin
            Player[I].ScoreTotalI := PlaylistMedley.Stats[Length(PlaylistMedley.Stats)-1].Player[I].ScoreTotalI;
            if(ScreenSong.Mode=smChallenge) then
              ScreenSingModi.TeamInfo.TeamInfo[I].Score:=Player[I].ScoreTotalI;
          end;

          if ScreenSong.Mode=smChallenge then
          begin
            PartySessionM2.Teams:=ScreenSingModi.TeamInfo;
            PartySessionM2.EndRound;
          end;{ else if ScreenSong.Mode = smParty then
          begin
            PartySession.Teams := ScreenSingModi.TeamInfo;
            PartySession.EndRound;
          end; }
        end;

        if (ScreenSong.Mode=smMedley) or (ScreenSong.Mode=smChallenge) then
          FadeTo(@ScreenScore)
        else
          FadeTo(@ScreenPartyScore);
      end;
    end;
  end else
  begin
    wStopWebCam();
    Ini.Save;
    SetLength(PlaylistMedley.Stats, 1);
    SetLength(PlaylistMedley.Stats[0].Player, PlayersPlay);
    for I := 0 to PlayersPlay - 1 do
      PlaylistMedley.Stats[0].Player[I] := Player[I];
    PlaylistMedley.Stats[0].SongArtist := AktSong.Artist;
    PlaylistMedley.Stats[0].SongTitle := AktSong.Title;
  end;
end;

procedure TScreenSing.onSentenceEnd(CP: integer; S: Cardinal);
var
  I: Integer;
  A: Real;
  B: integer; //Max Points for Notes

begin
  //Check for Empty Sentence
  if (Czesci[CP].Czesc[S].TotalNotes<=0) then
    exit;

  //Set Max Note Points
  if (Ini.LineBonus > 0) then
    B :=  9000
  else
    B := 10000;

  for I := 0 to High(Player) do
  begin
    if not AktSong.isDuet or (I mod 2 = CP) then
    begin
      
      A := Player[I].Score + Player[I].ScoreGolden - Player[I].ScoreLast + 2;

      //SingBar Mod
      If (Czesci[CP].Czesc[S].TotalNotes>0) then
      begin
        Player[I].ScorePercentTarget := Player[I].ScorePercentTarget +
          floor(A / (B * Czesci[CP].Czesc[S].TotalNotes / Czesci[CP].Wartosc) * 40 - 26);
        if Player[I].ScorePercentTarget < 0 then Player[I].ScorePercentTarget := 0;
        if Player[I].ScorePercentTarget > 99 then Player[I].ScorePercentTarget := 99;
      //end Singbar Mod
      end;

      //PhrasenBonus - Line Bonus Mod

      //Generate Steps 0 to 8
      A := Floor(A / (B * Czesci[CP].Czesc[S].TotalNotes / Czesci[CP].Wartosc) * 8);

      If (Ini.LineBonus > 0) then
      begin
        //Generate Text
        if A >= 8 then
          Player[I].LineBonus_Text := Theme.Sing.LineBonusText[8]
        else
          Player[I].LineBonus_Text := Theme.Sing.LineBonusText[Floor(A)];

        //PhrasenBonus give Points
        if (Length(Czesci[CP].Czesc) - NumEmptySentences[CP])>0 then
          Player[I].ScoreLine := Player[I].ScoreLine +
            (1000 / (Length(Czesci[CP].Czesc) - NumEmptySentences[CP]) * A / 8);

        Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10;
        //Update Total Score
        Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI;

        //Color
        Case Floor(A) of
          0: begin
            Player[I].LineBonus_Color.R := 1;
            Player[I].LineBonus_Color.G := 0;
            Player[I].LineBonus_Color.B := 0;
          end;
          1..3: begin
            Player[I].LineBonus_Color.R := 1;
            Player[I].LineBonus_Color.G := (A * 0.25);
            Player[I].LineBonus_Color.B := 0;
          end;
          4: begin
            Player[I].LineBonus_Color.R := 1;
            Player[I].LineBonus_Color.G := 1;
            Player[I].LineBonus_Color.B := 0;
          end;
          5..7: begin
            Player[I].LineBonus_Color.R := 1-((a-4)*0.25);
            Player[I].LineBonus_Color.G := 1;
            Player[I].LineBonus_Color.B := 0;
          end;
          8: begin
            Player[I].LineBonus_Color.R := 0;
            Player[I].LineBonus_Color.G := 1;
            Player[I].LineBonus_Color.B := 0;
          end;
        End; //Case
        //Player[I].LineBonus_Color.B := 0;
        //Player[I].LineBonus_Color.R := (8-A)/8;
        //Player[I].LineBonus_Color.G := A/10;

        Player[I].LineBonus_PosX  := Player[I].LineBonus_StartX;
        Player[I].LineBonus_PosY  := Player[I].LineBonus_StartY;
        Player[I].LineBonus_Alpha := 0.92;
        Player[I].LineBonus_Visible := True;
        Player[I].LineBonus_Age := 1;
      end;

      //PhrasenBonus - Line Bonus Mod End// }

      //PerfectLineTwinkle Mod (effect) Pt.1
      If (Ini.EffectSing=1) then
      begin
        if A >= 8 then Player[I].LastSentencePerfect := True
        else Player[I].LastSentencePerfect := False;
      end;
      //PerfectLineTwinkle Mod end

      //Refresh LastScore
      Player[I].ScoreLast := Player[I].Score + Player[I].ScoreGolden;
    end else
    begin
      Player[I].LineBonus_Visible := false;
      Player[I].LastSentencePerfect := False;
    end;
  end;

  //PerfectLineTwinkle Mod (effect) Pt.2
  if Ini.EffectSing=1 then
    GoldenRec.SpawnPerfectLineTwinkle;
  //PerfectLineTwinkle Mod end
end;

//Called on Sentence Change S= New Current Sentence
procedure TScreenSing.onSentenceChange(CP: integer; S: Cardinal);
begin
  //GoldenStarsTwinkle Mod
  GoldenRec.SentenceChange(CP);
  //GoldenStarsTwinkle Mod End
end;

procedure TScreenSing.DrawMedleyCountdown();
var
  w, h:           real;
  timeDiff:       real;
  t:              real;
  CountDownText:  string;

begin
  if (Czas.Teraz < GetTimeFromBeat(AktSong.Medley.StartBeat)) then
  begin
    timeDiff := GetTimeFromBeat(AktSong.Medley.StartBeat)-Czas.Teraz+1;
    t := frac(timeDiff);

    glColor4f(0.15, 0.30, 0.6, t);

    h := 100*t*ScreenH/RenderH;
    SetFontStyle(4);
    SetFontItalic(false);
    SetFontSize(h);
    CountDownText := IntToStr(round(timeDiff-t));
    w := glTextWidth(PChar(CountDownText));

    SetFontPos (RenderW/2-w/2, RenderH/2-h/2*3);
    glPrint(PChar(CountDownText));
  end;
end;

end.