File size: 170,900 Bytes
727f3a5 9c8ce9c 727f3a5 ac8d79d 4a99b0a ac8d79d 4a99b0a ebd2a16 ac8d79d ebd2a16 ac8d79d 030937e ac8d79d 4071499 64d0f7c eb8fd5f 64d0f7c eb8fd5f 64d0f7c eb8fd5f 64d0f7c eb8fd5f 64d0f7c eb8fd5f 64d0f7c eb8fd5f ac8d79d eb8fd5f ac8d79d eb8fd5f ac8d79d eb8fd5f ac8d79d 7e000db eb8fd5f ac8d79d ebd2a16 ac8d79d e6124d1 ac8d79d 9a59c78 ac8d79d 030937e f98a5f5 ac8d79d f98a5f5 030937e ac8d79d 030937e ebd5e89 8e0f8c4 030937e d5c67cd 030937e d5c67cd ac8d79d 030937e ac8d79d 030937e ac8d79d e6124d1 ac8d79d c705f96 ac8d79d c705f96 ac8d79d 4071499 ac8d79d 030937e ac8d79d e6124d1 ac8d79d 7e99bdd ac8d79d 030937e ac8d79d 397811d ac8d79d 7e2db94 ac8d79d a34d5ba 030937e ec2f77a ac8d79d 5bc4f36 19be69c ac8d79d 5e7d5ec ac8d79d dc60816 ac8d79d 5b2bf27 ac8d79d 2a85e84 ac8d79d 2a85e84 ac8d79d 2a85e84 ac8d79d 2a85e84 ac8d79d 8e0f8c4 ac8d79d 325cde1 030937e 325cde1 ac8d79d b6a3415 9a59c78 b6a3415 7e2db94 b6a3415 7e2db94 b6a3415 a34d5ba b6a3415 ac8d79d eb8fd5f ac8d79d 66a30fc eb8fd5f ac8d79d eb8fd5f c7d96ec 58994f6 7e2db94 325cde1 7e2db94 325cde1 5aed0b4 df14fc7 5aed0b4 77ca7f8 6b26d51 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 030937e 325cde1 030937e 325cde1 030937e 325cde1 030937e 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 325cde1 7e2db94 4071499 7e2db94 cc20984 7e2db94 cc20984 7e2db94 9a59c78 7e2db94 fb78e33 7e2db94 6caf479 7e2db94 c0f3c6a 7e2db94 c0f3c6a 7e2db94 c0f3c6a 7e2db94 c0f3c6a 7e2db94 4071499 7e2db94 be31d75 7e2db94 c0f3c6a 7e2db94 c0f3c6a 7e2db94 c0f3c6a 7e2db94 be31d75 7e2db94 fb78e33 7e2db94 ac8d79d 7e2db94 dc60816 7e2db94 dc60816 7e2db94 dc60816 7e2db94 dc60816 22ede60 7e2db94 dc60816 7e2db94 22ede60 7e2db94 22ede60 7e2db94 dc60816 7e2db94 22ede60 7e2db94 dc60816 22ede60 7e2db94 22ede60 7e2db94 22ede60 7e2db94 22ede60 7e2db94 dc60816 7e2db94 22ede60 7e2db94 22ede60 7e2db94 dc60816 7e2db94 dc60816 7e2db94 dc60816 7e2db94 22ede60 7e2db94 22ede60 7e2db94 dc60816 7e2db94 22ede60 7e2db94 22ede60 7e2db94 22ede60 7e2db94 eb8fd5f b6a3415 eb8fd5f a854d24 eb8fd5f a854d24 eb8fd5f b6a3415 ac8d79d eb8fd5f ac8d79d 030937e ac8d79d 030937e ac8d79d 030937e ac8d79d 30e1678 030937e 30e1678 ac8d79d 66a30fc ac8d79d 030937e ac8d79d 030937e 22ede60 030937e 22ede60 7e2db94 9a59c78 7e2db94 030937e 7e2db94 030937e 7e2db94 030937e 7e2db94 22ede60 7e2db94 22ede60 ac8d79d 66a30fc ac8d79d b52c3ce ac8d79d eb8fd5f ac8d79d b52c3ce ac8d79d eb8fd5f ac8d79d eb8fd5f ac8d79d eb8fd5f b52c3ce eb8fd5f ac8d79d f26cd16 7e2db94 f26cd16 7e2db94 f26cd16 7e2db94 f26cd16 7e2db94 f26cd16 ac8d79d 7e2db94 0029e3a 7e2db94 2ed8d91 7e2db94 f26cd16 7e2db94 f26cd16 eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f ac8d79d eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f ac8d79d 0029e3a ac8d79d b519260 0029e3a eb8fd5f ac8d79d eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f 0029e3a eb8fd5f ac8d79d 38afd0e ac8d79d eb8fd5f ac8d79d 38afd0e ac8d79d 7e2db94 38afd0e 7e2db94 38afd0e 7e2db94 38afd0e 7e2db94 ac8d79d c705f96 ac8d79d c705f96 ac8d79d 7e2db94 92dc3ef eb8fd5f 92dc3ef eb8fd5f 92dc3ef ac8d79d c705f96 ac8d79d c705f96 ac8d79d eb8fd5f ac8d79d 38afd0e ac8d79d 38afd0e ac8d79d 7e2db94 38afd0e 7e2db94 38afd0e 7e2db94 38afd0e 7e2db94 ac8d79d 5d57288 ac8d79d 38afd0e ac8d79d 38afd0e ac8d79d eb8fd5f ac8d79d eb8fd5f c705f96 eb8fd5f b519260 eb8fd5f ac8d79d eb8fd5f b52c3ce eb8fd5f ac8d79d b6a3415 eb8fd5f b6a3415 a34d5ba b6a3415 eb8fd5f b6a3415 030937e b6a3415 a34d5ba b6a3415 030937e b6a3415 a34d5ba ac8d79d a34d5ba b6a3415 ac8d79d 7e2db94 ac8d79d e648bdd 7e2db94 b6a3415 7e2db94 b6a3415 7e2db94 b6a3415 7e2db94 b6a3415 7e2db94 b6a3415 7e2db94 b6a3415 7e2db94 b6a3415 7e99bdd b6a3415 48a0709 b6a3415 48a0709 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 48a0709 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 48a0709 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 48a0709 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd 48a0709 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd 48a0709 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 48a0709 b6a3415 7e99bdd b6a3415 48a0709 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 48a0709 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 4071499 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 4071499 7e2db94 e648bdd 7e2db94 9a59c78 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 48a0709 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 9a59c78 7e2db94 7e99bdd 7e2db94 7e99bdd 7e2db94 e648bdd 48a0709 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 48a0709 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 48a0709 e648bdd 7e2db94 e648bdd 7e2db94 e648bdd 7e2db94 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e2db94 b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 7e99bdd b6a3415 f98a5f5 4593aca f98a5f5 030937e eb8fd5f ac8d79d 89cabfd 9c8ce9c 2010df5 | 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 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 | <!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<script src="/eruda.js"></script>
<script>
eruda.init();
</script>
<script src="/draggabilly.pkgd.min.js"></script>
<script src="/midipane.js"></script>
<script src="/musicxmlpane.js"></script>
<script src="/tools-bg-sw-metronome.js"></script>
<script src="/Midi.js"></script>
<script src="/verovio-toolkit-wasm.js" defer></script>
<link rel="icon" type="image/svg+xml" href='data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgbGFuZz0iamEiPjxkZWZzPiA8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWQxIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+IDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMzNDc0ZWIiIC8+IDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzM0YThlYiIgLz4gPC9saW5lYXJHcmFkaWVudD4gPC9kZWZzPiA8IS0tIOWQhOS6uuWbvuWkjeS9nOWumuS7tuWkjeaWsOWIl+OBjOaWsOWIl+OBq+OBhOOBq+OBvuOBq+OCi+OCieWbvuWkjeOBjOOCjOOCieOCk+ODq+ODvOODrOODs+ODg+OCiwotLT4gPHBvbHlnb24gcG9pbnRzPSI1MCw1MCA1MCwxNTAgMTUwLDEwMCIgZmlsbD0idXJsKCNncmFkMSkiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgLz48L3N2Zz4=' />
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgbGFuZz0iamEiPjxkZWZzPiA8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWQxIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+IDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMzNDc0ZWIiIC8+IDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzM0YThlYiIgLz4gPC9saW5lYXJHcmFkaWVudD4gPC9kZWZzPiA8IS0tIOWQhOS6uuWbvuWkjeS9nOWumuS7tuWkjeaWsOWIl+OBjOaWsOWIl+OBq+OBhOOBq+OBvuOBq+OCi+OCieWbvuWkjeOBjOOCjOOCieOCk+ODq+ODvOODrOODs+ODg+OCiwotLT4gPHBvbHlnb24gcG9pbnRzPSI1MCw1MCA1MCwxNTAgMTUwLDEwMCIgZmlsbD0idXJsKCNncmFkMSkiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgLz48L3N2Zz4=">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
@font-face {
font-family: "M PLUS Rounded 1c";
src: url("/fonts/MPLUSRounded1c-Medium.ttf") format("truetype");
font-weight: 500;
font-style: normal;
}
body {
font-family: "M PLUS Rounded 1c", sans-serif;
}
</style>
<title>文化発表会動画プレイヤー</title>
<style>
/* 既存のスタイルの後に追加 */
.player-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(10, 25, 47, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 20;
border-radius: 8px;
transition: opacity 0.5s ease;
pointer-events: none;
/* クリックを透過しないようにするため */
}
.player-overlay.active {
pointer-events: auto;
/* 表示中はクリックをブロック */
}
.player-overlay .overlay-message {
background-color: rgba(30, 42, 71, 0.95);
padding: 30px 40px;
border-radius: 12px;
text-align: center;
border: 1px solid rgba(100, 255, 218, 0.3);
box-shadow: 0 0 40px rgba(100, 255, 218, 0.1);
}
.player-overlay .overlay-message h2 {
color: #64ffda;
margin: 0 0 15px 0;
font-size: 24px;
}
.player-overlay .overlay-message p {
color: #ccd6f6;
margin: 5px 0;
font-size: 16px;
}
.player-overlay .overlay-message .spinner-text {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
margin-top: 15px;
}
.player-overlay .overlay-message .spinner-text .loader {
width: 30px;
height: 30px;
border-width: 4px;
filter: blur(2px) contrast(10);
}
/* 小さいローダー用 */
.loader-small {
width: 30px;
aspect-ratio: 1;
border: 4px solid #000;
box-sizing: border-box;
background: radial-gradient(farthest-side, #64ffda 98%, #0000) 50%/10px 10px,
radial-gradient(farthest-side, #64ffda 98%, #0000) 50%/10px 10px,
radial-gradient(farthest-side, #64ffda 98%, #0000) 50%/10px 10px,
radial-gradient(farthest-side, #64ffda 98%, #0000) 50%/10px 10px,
radial-gradient(farthest-side, #64ffda 98%, #0000) 50%/80% 80%, #000;
background-repeat: no-repeat;
filter: blur(3px) contrast(10);
animation: squarePulse 0.8s infinite alternate;
}
body {
font-family: "M PLUS Rounded 1c", 'Arial', sans-serif;
background-color: rgba(0, 0, 15, 1);
color: #e6f1ff;
margin: 0;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh
}
h1 {
color: #a2c2e8;
text-align: center;
margin-bottom: 30px;
border-bottom: 1px solid #64ffda;
padding-bottom: 10px;
width: 100%
}
.container {
display: flex;
flex-direction: column;
width: 100%;
max-width: 1000px;
background-color: rgba(17, 34, 64, 0.3);
border-radius: 10px;
padding: 20px;
box-shadow: 0 0 20px rgba(100, 255, 218, 0.2);
backdrop-filter: blur(1.7px);
border: 1px solid rgba(100, 255, 218, 0.1)
}
.video-container {
position: relative;
width: 100%;
margin-bottom: 20px
}
video {
width: 100%;
border-radius: 5px;
background-color: #000;
display: block;
cursor: pointer
}
.video-controls {
background-color: rgba(17, 34, 64, 0.2);
padding: 10px;
border-radius: 0 0 5px 5px;
display: flex;
flex-direction: column;
gap: 10px;
transition: opacity 0.3s
}
.progress-container {
width: 100%;
height: 10px;
background-color: #1e2a47;
border-radius: 5px;
cursor: pointer;
position: relative
}
.progress-bar {
height: 100%;
background-color: #64ffda;
border-radius: 5px;
width: 0%;
position: relative
}
.progress-time {
position: absolute;
top: -25px;
transform: translateX(-50%);
background-color: rgba(30, 42, 71, 0.9);
padding: 3px 6px;
border-radius: 3px;
font-size: 12px;
display: none;
white-space: nowrap
}
.progress-marker {
position: absolute;
bottom: 0px;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 10px solid #ff5555;
transform: translateX(-50%);
z-index: 2
}
.main-controls {
display: flex;
align-items: center;
gap: 15px
}
.control-button {
background: none;
border: none;
color: #e6f1ff;
font-size: 18px;
cursor: pointer;
padding: 5px;
border-radius: 50%;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.3s
}
.control-button:hover {
background-color: rgba(100, 255, 218, 0.2)
}
.time-display {
font-size: 14px;
color: #ccd6f6;
white-space: nowrap
}
.volume-control {
display: flex;
align-items: center;
gap: 5px;
margin-left: auto
}
.volume-button {
background: none;
border: none;
color: #e6f1ff;
font-size: 18px;
cursor: pointer;
padding: 5px
}
.volume-slider {
width: 80px;
height: 6px;
-webkit-appearance: none;
background: #1e2a47;
border-radius: 3px;
outline: none;
opacity: 0;
transition: opacity 0.3s, width 0.3s;
background-image: linear-gradient(#6aebfc, #6aebfc);
background-size: 100% 100%;
background-repeat: no-repeat
}
.volume-control:hover .volume-slider {
opacity: 1;
width: 100px
}
.volume-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 12px;
height: 12px;
background: #6aebfc;
border-radius: 50%;
cursor: pointer
}
.speed-control {
display: flex;
align-items: center;
gap: 5px
}
.speed-slider {
width: 120px;
height: 6px;
-webkit-appearance: none;
background: #1e2a47;
border-radius: 3px;
outline: none;
background-image: linear-gradient(#64d1ff, #64d1ff);
background-size: 100% 100%;
background-repeat: no-repeat
}
.speed-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 12px;
height: 12px;
background: #5bb7de;
border-radius: 50%;
cursor: pointer
}
.speed-value {
font-size: 14px;
min-width: 30px;
text-align: center
}
.fullscreen-button {
margin-left: 10px
}
.audio-controls {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 15px
}
.audio-item {
display: flex;
align-items: center;
gap: 10px
}
.audio-item label {
min-width: 50px;
color: #9ab3d9
}
.audio-slider {
flex-grow: 1;
height: 8px;
-webkit-appearance: none;
background: #1e2a47;
border-radius: 5px;
outline: none;
background-image: linear-gradient(#64ffda, #64ffda);
background-size: 100% 100%;
background-repeat: no-repeat
}
.audio-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
background: #64ffda;
border-radius: 50%;
cursor: pointer
}
.settings {
background-color: rbga(30, 42, 71, 0.3);
padding: 15px;
border-radius: 5px;
margin-bottom: 20px
}
.setting-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px
}
.setting-item:last-child {
margin-bottom: 0
}
.setting-item label {
color: #ccd6f6
}
.global-volume-container,
.playback-speed-container {
display: flex;
align-items: center;
gap: 10px;
width: 100%
}
.global-volume-slider,
.playback-speed-slider {
flex-grow: 1;
height: 8px;
-webkit-appearance: none;
background: #1e2a47;
border-radius: 5px;
outline: none;
background-image: linear-gradient(#64ffda, #64ffda);
background-size: 100% 100%;
background-repeat: no-repeat
}
.global-volume-slider::-webkit-slider-thumb,
.playback-speed-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 16px;
height: 16px;
background: #64ffda;
border-radius: 50%;
cursor: pointer
}
.slider-value {
min-width: 40px;
text-align: right
}
input[type="number"],
input[type="checkbox"],
select {
background-color: #112240;
border: 1px solid #64ffda;
color: #e6f1ff;
padding: 5px;
border-radius: 3px
}
.tech-decoration {
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #64ffda, transparent);
margin: 20px 0
}
.video-container:-webkit-full-screen {
width: 100%;
height: 100%;
background-color: black
}
.video-container:-webkit-full-screen video {
width: 100%;
height: 100%
}
.video-container:-webkit-full-screen .video-controls {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
border-radius: 0
}
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 9998;
transition: opacity 1s ease-out
}
.spinner-box {
width: 300px;
height: 300px;
display: flex;
justify-content: center;
align-items: center;
background-color: transparent
}
.leo {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%
}
.blue-orbit {
width: 165px;
height: 165px;
border: 1px solid #91daffa5;
animation: spin3D 3s linear .2s infinite
}
.green-orbit {
width: 120px;
height: 120px;
border: 1px solid #91ffbfa5;
animation: spin3D 2s linear 0s infinite
}
.red-orbit {
width: 90px;
height: 90px;
border: 1px solid #ffca91a5;
animation: spin3D 1s linear 0s infinite
}
.white-orbit {
width: 60px;
height: 60px;
border: 2px solid #ffffff;
animation: spin3D 10s linear 0s infinite
}
.w1 {
transform: rotate3D(1, 1, 1, 90deg)
}
.w2 {
transform: rotate3D(1, 2, .5, 90deg)
}
.w3 {
transform: rotate3D(.5, 1, 2, 90deg)
}
@keyframes spin3D {
from {
transform: rotate3d(.5, .5, .5, 360deg)
}
to {
transform: rotate3d(0, 0, 0, 0deg)
}
}
@keyframes spin {
from {
transform: rotate(0deg)
}
to {
transform: rotate(360deg)
}
}
.time-set-button {
background-color: #112240;
border: 1px solid #64ffda;
color: #e6f1ff;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
font-size: 12px;
margin-left: 5px;
transition: background-color 0.3s
}
.time-set-button:hover {
background-color: rgba(100, 255, 218, 0.2)
}
.combine-button {
background-color: #97c2f0;
color: #0a192f;
border: none;
padding: 7px 14px;
border-radius: 5px;
font-size: 15px;
cursor: pointer;
transition: all 0.3s;
font-weight: bold
}
.combine-button:hover {
background-color: #52e0c4;
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(100, 255, 218, 0.4)
}
.combine-button:disabled {
background-color: #3a5a78;
cursor: not-allowed;
transform: none;
box-shadow: none
}
.combine-status {
margin-top: 10px;
color: #97c2f0;
font-size: 14px;
height: 20px
}
.preview-section {
margin-top: 20px;
padding: 15px;
background-color: rgba(17, 34, 64, 0.7);
border-radius: 5px;
display: none
}
.preview-section h3 {
margin-top: 0;
color: #97c2f0;
border-bottom: 1px solid #64ffda;
padding-bottom: 5px
}
.disabled-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(10, 25, 47, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
border-radius: 5px
}
.disabled-message {
background-color: rgba(30, 42, 71, 0.9);
padding: 20px;
border-radius: 5px;
text-align: center;
max-width: 80%
}
.disabled-message p {
margin-bottom: 15px
}
.loader {
width: 80px;
aspect-ratio: 1;
border: 10px solid #000;
box-sizing: border-box;
background: radial-gradient(farthest-side, #fff 98%, #0000) 50%/20px 20px,
radial-gradient(farthest-side, #fff 98%, #0000) 50%/20px 20px,
radial-gradient(farthest-side, #fff 98%, #0000) 50%/20px 20px,
radial-gradient(farthest-side, #fff 98%, #0000) 50%/20px 20px,
radial-gradient(farthest-side, #fff 98%, #0000) 50%/80% 80%, #000;
background-repeat: no-repeat;
filter: blur(4px) contrast(10);
animation: squarePulse 1s infinite alternate
}
@keyframes squarePulse {
0% {
background-position: 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%
}
25% {
background-position: 50% 0, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%
}
50% {
background-position: 50% 0, 50% 100%, 50% 50%, 50% 50%, 50% 50%, 50% 50%
}
75% {
background-position: 50% 0, 50% 100%, 0 50%, 50% 50%, 50% 50%, 50% 50%
}
100% {
background-position: 50% 0, 50% 100%, 0 50%, 100% 50%, 50% 50%, 50% 50%
}
}
#buffering-indicator {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 10;
display: none
}
.sync-status {
position: absolute;
bottom: 100px;
left: 10px;
width: 150px;
height: 30px;
background-color: rgba(0, 0, 0, 0.7);
color: #97c2f0;
padding: 5px 10px;
border-radius: 3px;
font-size: 12px;
z-index: 5;
display: flex;
align-items: center;
gap: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
user-select: none;
contain: strict
}
.sync-status button {
background: none;
border: none;
color: #fff;
cursor: pointer;
font-size: 12px
}
.lock-controls-btn {
position: fixed;
bottom: 20px;
right: 20px;
background-color: rgba(0, 0, 0, 0.7);
border: none;
color: #fff;
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 100;
display: none
}
.lock-controls-btn.locked {
color: #97c2f0
}
.time-markers-container {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin: 15px 0;
padding: 15px;
background-color: rgba(17, 34, 64, 0.8);
border-radius: 5px
}
.time-marker {
font-size: 80%;
padding: 6px 8px;
background-color: rgba(100, 255, 218, 0.05);
border: 1px solid #64ffda;
border-radius: 4px;
cursor: grab;
user-select: none;
transition: background-color 0.3s
}
.time-marker:hover {
background-color: rgba(100, 255, 218, 0.1)
}
.time-marker.dragging {
opacity: 0.7;
cursor: grabbing
}
.time-input-container {
display: flex;
align-items: center;
gap: 5px
}
.time-input-container input {
width: 80px
}
.container-a {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1
}
canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%
}
#starCanvas,
#effectCanvas {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
display: block
}
#starCanvas {
z-index: 99998
}
#effectCanvas {
z-index: 99999
}
.grid {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(rgba(0, 100, 255, 0.1) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 100, 255, 0.1) 1px, transparent 1px);
background-size: 50px 50px;
z-index: 3;
pointer-events: none
}
.audio-item {
display: flex;
align-items: center;
gap: 10px
}
.audio-item label {
min-width: 50px;
color: #9ab3d9
}
.audio-slider {
flex-grow: 1;
height: 8px;
-webkit-appearance: none;
background: #1e2a47;
border-radius: 5px;
outline: none;
background-image: linear-gradient(#64ffda, #64ffda);
background-size: 100% 100%;
background-repeat: no-repeat
}
.audio-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
background: #64ffda;
border-radius: 10%;
cursor: pointer
}
.slider-value {
min-width: 40px;
text-align: right
}
#lightweight-button {
position: fixed;
top: 10px;
right: 10px;
z-index: 9999999;
padding: 8px 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 15px;
cursor: pointer;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
transition: background-color 0.3s ease
}
#lightweight-button:hover {
background-color: #0056b3
}
.pane-container {
position: relative;
width: 1000px;
/* 固定 */
height: 600px;
/* 固定 */
min-height: 600px;
max-width: 100%;
/* 親要素を超えないように */
margin: 0 auto;
/* 中央寄せ */
background: #0a192f;
border-radius: 8px;
overflow: hidden;
border: 1px solid rgba(100, 255, 218, 0.2);
}
.pane {
position: absolute;
border: 1px solid rgba(100, 255, 218, 0.4);
background: rgba(10, 25, 47, 0.9);
border-radius: 4px;
min-width: 120px;
min-height: 80px;
overflow: hidden;
cursor: move;
}
.pane .pane-header {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 32px;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
padding: 0 8px;
gap: 6px;
z-index: 10;
cursor: grab;
user-select: none;
border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}
.pane .pane-header:active {
cursor: grabbing;
}
.pane .pane-header .pane-title {
color: #e6f1ff;
font-size: 11px;
font-weight: bold;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.pane .pane-header .pane-zoom {
display: flex;
align-items: center;
gap: 4px;
}
.pane .pane-header .pane-zoom button {
width: 20px;
height: 20px;
font-size: 12px;
background: rgba(100, 255, 218, 0.15);
border: 1px solid rgba(100, 255, 218, 0.3);
color: #e6f1ff;
border-radius: 3px;
cursor: pointer;
padding: 0;
line-height: 1;
}
.pane .pane-header .pane-zoom button:hover {
background: rgba(100, 255, 218, 0.3);
}
.pane .pane-header .pane-zoom .zoom-level {
color: #e6f1ff;
font-size: 10px;
min-width: 32px;
text-align: center;
}
.pane .pane-content {
position: absolute;
top: 32px;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
/* このまま */
background: #000;
cursor: grab;
/* ← 追加 */
}
.pane .pane-content:active {
cursor: grabbing;
/* ← 追加 */
}
.pane .pane-content>* {
width: 100%;
height: 100%;
}
.pane .pane-content .zoom-wrapper {
width: 100%;
height: 100%;
transform-origin: 0 0;
will-change: transform;
position: relative;
overflow: visible;
/* ← 追加: 拡大時にコンテンツがはみ出るように */
}
/* MIDI ペイン用 */
.pane.midi-pane .pane-content {
background: #0a0a0a;
}
.pane.midi-pane .midi-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
background: #0a0a0a;
}
.pane.midi-pane .midi-container canvas {
flex: 1;
width: 100% !important;
height: auto !important;
pointer-events: none;
/* ← 追加 */
}
.pane.midi-pane .midi-container .midi-keyboard {
height: 50px;
min-height: 50px;
position: relative;
background: #000;
overflow: hidden;
}
.pane.midi-pane .midi-container .midi-keyboard .key {
position: absolute;
box-sizing: border-box;
border-radius: 2px;
}
.pane.midi-pane .midi-container .midi-keyboard .key.white {
background: #f5f5f5;
border: 1px solid rgba(0, 0, 0, 0.2);
height: 100%;
z-index: 1;
}
.pane.midi-pane .midi-container .midi-keyboard .key.black {
background: #222;
height: 55%;
z-index: 3;
border: 1px solid #000;
}
.pane.midi-pane .midi-container .midi-keyboard .key.active {
background: #64ffda !important;
}
.pane.midi-pane .midi-controls {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 8px;
background: rgba(0, 0, 0, 0.8);
border-top: 1px solid rgba(100, 255, 218, 0.1);
}
.pane.midi-pane .midi-controls button {
background: rgba(100, 255, 218, 0.15);
border: 1px solid rgba(100, 255, 218, 0.3);
color: #e6f1ff;
border-radius: 3px;
padding: 2px 8px;
font-size: 12px;
cursor: pointer;
}
.pane.midi-pane .midi-controls button:hover {
background: rgba(100, 255, 218, 0.3);
}
.pane.midi-pane .midi-controls .midi-time {
color: #ccd6f6;
font-size: 11px;
font-family: monospace;
min-width: 60px;
}
/* MusicXML ペイン用 */
.pane.xml-pane .pane-content {
background: #fff;
}
.pane.xml-pane .xml-container {
width: 100%;
height: 100%;
overflow: auto;
background: #fff;
}
.pane.xml-pane .xml-container .xml-sheet {
width: 100%;
height: 100%;
}
.pane.xml-pane .xml-controls {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 8px;
background: rgba(0, 0, 0, 0.8);
border-top: 1px solid rgba(100, 255, 218, 0.1);
}
.pane.xml-pane .xml-controls button {
background: rgba(100, 255, 218, 0.15);
border: 1px solid rgba(100, 255, 218, 0.3);
color: #e6f1ff;
border-radius: 3px;
padding: 2px 8px;
font-size: 12px;
cursor: pointer;
}
.pane.xml-pane .xml-controls button:hover {
background: rgba(100, 255, 218, 0.3);
}
.pane.xml-pane .xml-controls .xml-time {
color: #ccd6f6;
font-size: 11px;
font-family: monospace;
min-width: 60px;
}
/* リサイズハンドル */
.pane .resize-handle {
position: absolute;
bottom: 0;
right: 0;
width: 20px;
height: 20px;
cursor: nwse-resize;
z-index: 10;
background: rgba(100, 255, 218, 0.1);
border-radius: 0 0 4px 0;
}
.pane .resize-handle::after {
content: "";
position: absolute;
bottom: 4px;
right: 4px;
width: 10px;
height: 10px;
border-right: 2px solid rgba(100, 255, 218, 0.5);
border-bottom: 2px solid rgba(100, 255, 218, 0.5);
}
.pane .pane-controls {
position: absolute;
top: 0;
right: 0;
display: flex;
align-items: center;
gap: 2px;
background: rgba(0, 0, 0, 0.6);
padding: 2px 4px;
border-radius: 0 0 0 4px;
z-index: 5;
}
.pane-controls button,
.pane-controls select {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
font-size: 12px;
background: #112240;
color: #e6f1ff;
border: 1px solid #64ffda;
border-radius: 3px;
}
.pane-controls select {
width: auto;
height: 28px;
padding: 0 4px;
font-size: 11px;
}
.pane-controls button:hover {
background: rgba(100, 255, 218, 0.2);
}
.pane .resize-handle {
position: absolute;
bottom: 0;
right: 0;
width: 16px;
height: 16px;
cursor: nw-resize;
background: rgba(100, 255, 218, 0.3);
border-radius: 0 0 4px 0;
}
.pane .resize-handle::after {
content: "";
position: absolute;
bottom: 4px;
right: 4px;
width: 8px;
height: 8px;
border-right: 2px solid #64ffda;
border-bottom: 2px solid #64ffda;
}
/* 設定ポップアップ */
.settings-popup {
position: absolute;
bottom: 100%;
right: 0;
background: #112240;
border: 1px solid #64ffda;
border-radius: 8px;
padding: 16px;
z-index: 50;
min-width: 280px;
display: none;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}
.settings-popup.visible {
display: block;
}
.settings-popup .popup-row {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 10px;
}
.settings-popup .popup-row label {
min-width: 70px;
color: #ccd6f6;
font-size: 14px;
}
.settings-popup .popup-row input[type="range"] {
flex: 1;
height: 6px;
-webkit-appearance: none;
background: #1e2a47;
border-radius: 3px;
outline: none;
background-image: linear-gradient(#64ffda, #64ffda);
background-size: 100% 100%;
background-repeat: no-repeat;
}
.settings-popup .popup-row input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 14px;
height: 14px;
background: #64ffda;
border-radius: 50%;
cursor: pointer;
}
.settings-popup .popup-row input[type="number"] {
width: 70px;
background: #0a192f;
border: 1px solid #64ffda;
color: #e6f1ff;
border-radius: 3px;
padding: 4px;
}
.settings-popup .popup-row .value {
min-width: 40px;
text-align: right;
color: #ccd6f6;
font-size: 14px;
}
/* プリセット関連 */
.presets-bar {
display: flex;
gap: 8px;
padding: 8px 4px;
flex-wrap: wrap;
align-items: center;
border-bottom: 1px solid rgba(100, 255, 218, 0.2);
margin-bottom: 8px;
}
.preset-item {
position: relative;
background: rgba(100, 255, 218, 0.1);
border: 1px solid rgba(100, 255, 218, 0.3);
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
cursor: pointer;
color: #e6f1ff;
display: inline-flex;
align-items: center;
gap: 6px;
}
.preset-item:hover {
background: rgba(100, 255, 218, 0.2);
}
.preset-item .preset-delete {
display: none;
background: none;
border: none;
color: #ff6b6b;
cursor: pointer;
font-size: 14px;
padding: 0 2px;
}
.preset-item:hover .preset-delete {
display: inline;
}
.preset-save-btn {
background: #64ffda;
color: #0a192f;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 13px;
cursor: pointer;
font-weight: bold;
}
.preset-save-btn:hover {
background: #52e0c4;
}
/* ドロップダウン選択用 */
.preset-selector {
background: #112240;
color: #e6f1ff;
border: 1px solid #64ffda;
border-radius: 3px;
padding: 4px 8px;
font-size: 13px;
}
/* ドラッグ可能なコンテナ全体 */
.player-wrapper {
position: relative;
}
.player-wrapper:-webkit-full-screen {
background-color: #000;
display: flex;
justify-content: center;
align-items: center;
}
.player-wrapper:-webkit-full-screen .pane-container {
width: 1000px;
height: 600px;
max-width: 1000px;
max-height: 600px;
}
.player-wrapper:-moz-full-screen {
background-color: #000;
display: flex;
justify-content: center;
align-items: center;
}
.player-wrapper:-moz-full-screen .pane-container {
width: 1000px;
height: 600px;
max-width: 1000px;
max-height: 600px;
}
.player-wrapper:fullscreen {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #000;
position: relative;
}
.player-wrapper:fullscreen .pane-container {
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
transform: none;
/* スケールを無効化 */
flex-shrink: 0;
/* 必要に応じて position: absolute; など */
}
.player-wrapper:fullscreen .video-controls {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
background: rgba(0, 0, 0, 0.7);
border-radius: 8px;
padding: 12px 20px;
transition: opacity 0.4s ease;
opacity: 1;
z-index: 20;
pointer-events: auto;
}
.player-wrapper:fullscreen .video-controls.hidden {
opacity: 0;
pointer-events: none;
}
.player-wrapper:fullscreen .control-button {
color: #fff;
}
.player-wrapper:fullscreen .time-display {
color: #fff;
}
.pane video {
width: 100%;
height: 100%;
object-fit: contain;
background: #000;
display: block;
pointer-events: none;
/* ← 追加: 動画がマウスイベントを奪わないように */
}
.pane .pane-controls {
position: absolute;
top: 0;
right: 0;
display: flex;
align-items: center;
gap: 2px;
background: rgba(0, 0, 0, 0.6);
padding: 2px 4px;
border-radius: 0 0 0 4px;
z-index: 5;
}
.pane-controls button,
.pane-controls select {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
font-size: 12px;
background: #112240;
color: #e6f1ff;
border: 1px solid #64ffda;
border-radius: 3px;
}
.pane-controls select {
width: auto;
height: 28px;
padding: 0 4px;
font-size: 11px;
}
.pane-controls button:hover {
background: rgba(100, 255, 218, 0.2);
}
.pane .resize-handle {
position: absolute;
bottom: 0;
right: 0;
width: 16px;
height: 16px;
cursor: nw-resize;
background: rgba(100, 255, 218, 0.3);
border-radius: 0 0 4px 0;
}
.pane .resize-handle::after {
content: "";
position: absolute;
bottom: 4px;
right: 4px;
width: 8px;
height: 8px;
border-right: 2px solid #64ffda;
border-bottom: 2px solid #64ffda;
}
/* ペインコンテナのスタイル */
.pane-container {
position: relative;
width: 100%;
min-height: 400px;
background: #0a192f;
border-radius: 8px;
overflow: hidden;
border: 1px solid rgba(100, 255, 218, 0.2);
}
/* メインコントロール内のボタン調整 */
.main-controls .control-button {
font-size: 20px;
}
/* 設定ポップアップ表示位置 */
.settings-wrapper {
position: relative;
display: inline-block;
}
/* 再生開始に戻るボタン */
.reset-start-btn {
font-size: 18px;
}
#bpmInput {
margin-top: 10px;
background: #222;
border: none;
color: #fff;
font-size: 16px;
text-align: center;
width: 80px;
padding: 4px;
border-radius: 4px;
}
</style>
</head>
<body>
<button id="lightweight-button"><b>動画なしの<br>軽量化バージョン</b></button>
<script>
document.getElementById("lightweight-button").addEventListener("click", function() {
window.location.href = "/sender.html" + window.location.search;
});
</script>
<div class="container-a">
<canvas id="starCanvas"></canvas>
<canvas id="effectCanvas"></canvas>
<div class="grid"></div>
</div>
<!-- ローディングオーバーレイ -->
<div class="loading-overlay" id="loadingOverlay">
<div class="spinner-box">
<div class="blue-orbit leo"></div>
<div class="green-orbit leo"></div>
<div class="red-orbit leo"></div>
<div class="white-orbit w1 leo"></div>
<div class="white-orbit w2 leo"></div>
<div class="white-orbit w3 leo"></div>
</div>
<div id="loading-progress" style="color:#fff;font-size:1.2rem;margin-top:20px;text-align:center;">
読み込み中 0/3
</div>
</div>
<h1 id="title-name">文化発表会動画プレイヤー</h1>
<div class="details-container">
<details id="usageDetails">
<summary style="font-size: 25px">使い方</summary>
<hr>
<p>プリセット:配置をすぐに呼び出せるプリセットがあります。事前に準備されているプリセットの他に、「保存」ボタンから現在のプリセットを名前を付けて保存することができます。<br>
・すべて:すべてのパートの動画とコンテンツが配置されています。<br>
・合唱練習:すべてのパートと、楽譜が配置されています。<br>
・1パート練習:一つのパートと楽譜が配置されています。パートはデフォルトではテノールです。<br>
</p>
<hr>
<h3>プレイヤーの使い方</h3>
<p>・▶/⏸:再生 / 一時停止 (ショートカット:スペースキーまたはkキー)<br>
・↺:最初から再生 (ショートカットキー:0キー)<br>
・🔇/🔊:消音の切り替え(横のスライダーから詳細な調整ができます。) (ショートカット:mキー)<br>
・⚙️:設定<br>
・設定メニュー:<br>
・再生速度/BPM:再生速度とテンポをそれぞれ変更できます。テンポは自動で変換され、テンポを入力することもできます。1倍速のテンポを基準に計算します。<br>
・再生開始秒数/再生終了秒数:再生する範囲を設定できます。ループの場合はその間を繰り返し再生します。プレイヤーの下のボックスをドラッグアンドドロップすることもできます。<br>
※「再生範囲を適用」を押すまで反映されません。<br>
・ループ:最後まで再生すると最初に戻って繰り返し再生します。<br>
・+:コンテンツを追加します。<br>
・⛶:全画面 (ショートカット:fキー)</p>
<hr>
<h3>コンテンツ</h3>
<p>
すべてのコンテンツで、左下のドラッグハンドルをドラッグするとサイズを変更できます。また、上部のヘッダー部分をドラッグすると位置を変更できます。コンテンツ内でズームイン・ズームアウトすることができます。ヘッダーの+・ーボタンでも調整できます。<br>
・歌唱映像:ソプラノ・アルト・テノールの歌唱動画です。<br>
・MIDI:ピアノ演奏を見れます。鍵盤は鳴っている音に色が付きます。<br>
・設定ボタンでパートの表示を切り替えたり、色を変更したりできます。Trackは声部です。<br>
・鍵盤の上の部分をドラッグすると鍵盤の高さを変更できます。<br>
・スクロールしたりドラッグしたりすることで音の部分を上下に移動できます。<br>
・楽譜:楽譜を再生します。現在再生中の場所に自動スクロールされます。鳴っている音に色が付きます。楽譜をドラッグすると位置を移動できます。<br>
</p>
<hr>
<h3>オフライン設定</h3>
<p>ページをオフラインで使用できるようにします。ただし、保存されるキャッシュが古い場合、更新プログラムがなかったため、正常に動作しない可能性があります。</p>
<hr>
<h3>キーボードショートカット</h3>
<p>
・5秒戻る:左矢印キーまたはjキー(長押し可)<br>
・5秒進む:右矢印キーまたはkキー(長押し可)<br>
・再生/一時停止:スペースキーまたはkキー<br>
・開始~終了を10分割した位置に移動:0~9キー<br>
・フルスクリーン切り替え:fキー<br>
・音量を10%上げる:上向き矢印キー<br>
・音量を10%下げる:下向き矢印キー<br>
・ミュートの切り替え:mキー<br>
・再生速度を5%遅くする:,または<キー<br>
・再生速度を5%速くする:.または>キー<br>
</p>
</details>
</div>
<div class="container">
<span style="font-size: 1.2em;">オフライン設定</span>
<div class="swsettings" id="swsettings">
<a>サービスワーカーでページをオフラインで使用できるようにします。<br>
ブラウザの仕様で、オフラインで開く際に最初のみ二回再読み込みボタンを押してください。<br>
不安定な機能で、ページの更新などができなくなるバグが発生する可能性があります。</a>
<br>
<button class="combine-button" id="sw-register-btn" disabled>登録を開始</button>
<div class="combine-status" id="sw-status"></div>
</div>
<br>
<!-- 音声コントロール -->
<div class="audio-controls">
<h2>音声コントロール</h2>
<span>各パートの練習用では、他のパートのタイミングを確認しながら練習できます。<br>
※合成音量係数は大きくすると全体の音量が大きくなります。Chromebookの限界はおおよそ5倍で、それ以上は音割れします。</span>
<!-- プリセットドロップダウン -->
<div class="audio-item">
<label>プリセット</label>
<select id="preset-select">
<option value="custom">カスタム</option>
<option value="soprano">ソプラノ練習用</option>
<option value="alto">アルト練習用</option>
<option value="tenor">テノール練習用</option>
<option value="piano">ピアノ練習用</option>
</select>
</div>
<div class="audio-item">
<label>ソプラノ</label>
<input type="range" class="audio-slider" data-audio="s" min="0" max="1" step="0.01" value="1">
<span class="slider-value volume-value">1.00</span>
</div>
<div class="audio-item">
<label>アルト </label>
<input type="range" class="audio-slider" data-audio="a" min="0" max="1" step="0.01" value="1">
<span class="slider-value volume-value">1.00</span>
</div>
<div class="audio-item">
<label>テノール</label>
<input type="range" class="audio-slider" data-audio="t" min="0" max="1" step="0.01" value="1">
<span class="slider-value volume-value">1.00</span>
</div>
<div class="audio-item">
<label>ピアノ </label>
<input type="range" class="audio-slider" data-audio="p" min="0" max="1" step="0.01" value="1">
<span class="slider-value volume-value">1.00</span>
</div>
<div class="audio-item">
<label>合成音量係数:</label>
<input type="range" class="audio-slider" id="ffmpeg-volume" min="0" max="10" step="0.01" value="1">
<span class="slider-value" id="ffmpeg-volume-value">1.00</span>
</div>
<!-- 合成ボタンとステータス -->
<button class="combine-button" id="combine-button">音声を合成</button>
<div class="combine-status" id="combine-status"></div>
</div>
<div class="tech-decoration"></div>
<!-- プリセット保存バー -->
<div class="presets-bar" id="presets-bar">
<span style="color:#ccd6f6;font-size:14px;">プリセット:</span>
<div id="preset-list" style="display:flex;gap:6px;flex-wrap:wrap;align-items:center;"></div>
<button class="preset-save-btn" id="save-preset-btn">💾 保存</button>
</div>
<!-- プレイヤー部分 -->
<div class="player-wrapper">
<!-- ペインコンテナ -->
<div class="pane-container" id="pane-container">
<!-- ペインはJSで動的に追加 -->
</div>
<!-- ビデオコントロール -->
<div class="video-controls" id="video-controls">
<div class="progress-container" id="progress-container">
<div class="progress-bar" id="progress-bar"></div>
<div class="progress-time" id="progress-time">00:00</div>
<div class="progress-marker" id="start-marker" style="left: 0%; display: none;"></div>
<div class="progress-marker" id="end-marker" style="left: 100%; display: none;"></div>
</div>
<div class="main-controls">
<!-- 再生/一時停止 -->
<button class="control-button" id="play-pause-btn" disabled>▶</button>
<!-- 開始位置に戻る -->
<button class="control-button reset-start-btn" id="reset-start-btn" disabled title="再生開始秒数に戻る">↺</button>
<!-- 時間表示 -->
<div class="time-display" id="time-display">00:00.00 / 00:00.00</div>
<!-- 音量 -->
<div class="volume-control">
<button class="volume-button" id="volume-btn" disabled>🔊</button>
<input type="range" class="volume-slider" id="volume-slider" min="0" max="1" step="0.01" value="1" disabled>
</div>
<!-- 設定ボタン (ポップアップ) -->
<div class="settings-wrapper">
<button class="control-button" id="settings-toggle-btn" disabled>⚙</button>
<div class="settings-popup" id="settings-popup">
<div class="popup-row">
<label>再生速度</label>
<input type="range" id="popup-speed" min="0.01" max="5" step="0.01" value="1">
<span class="value" id="popup-speed-value">1.00x</span>
</div>
<div class="popup-row">
<label>テンポ(BPM)</label>
<input type="number" id="popup-tempo" value="84" step="0.1" min="20" max="300">
<span class="value" id="popup-tempo-value">1.00x</span>
</div>
<div class="popup-row">
<label>開始秒数</label>
<input type="number" id="popup-start-time" value="0" step="0.01" min="0">
</div>
<div class="popup-row">
<label>終了秒数</label>
<input type="number" id="popup-end-time" value="0" step="0.01" min="0">
</div>
<div class="popup-row">
<label>ループ</label>
<input type="checkbox" id="popup-loop" checked>
</div>
<div class="popup-row" style="justify-content:flex-end;">
<button class="combine-button" id="popup-apply-time" style="font-size:13px;padding:4px 12px;">再生範囲を適用</button>
</div>
</div>
</div>
<!-- 要素追加ボタン -->
<button class="control-button" id="add-pane-btn" title="要素を追加">+</button>
<!-- 全画面 -->
<button class="control-button fullscreen-button" id="fullscreen-btn" disabled>⛶</button>
</div>
</div>
</div>
<div class="tech-decoration"></div>
<!-- 従来の設定エリア (ほぼ変更なし) -->
<div class="settings">
<div class="time-markers-container" id="time-markers-container">
<span>このボックスをドラッグして「再生開始秒数」や「再生終了秒数」の入力ボックスの上で離すと秒数を簡単に変更できます。</span>
</div>
<div class="setting-item">
<label for="start-time">再生開始秒数:</label>
<div class="time-input-container">
<input type="number" id="start-time" min="0" value="0" step="0.01" disabled>
<button class="time-set-button" id="set-start-time" disabled>現在の秒数に設定</button>
</div>
</div>
<div class="setting-item">
<label for="end-time">再生終了秒数:</label>
<div class="time-input-container">
<input type="number" id="end-time" min="0" value="0" step="0.01" disabled>
<button class="time-set-button" id="set-end-time" disabled>現在の秒数に設定</button>
<button class="time-set-button" id="reset-end-time" disabled>動画の長さに戻す</button>
</div>
</div>
<div class="setting-item">
<label for="loop">ループ再生:</label>
<input type="checkbox" id="loop" disabled>
</div>
<div class="setting-item">
<button class="combine-button" id="apply-time-btn" disabled>時間設定を適用</button>
</div>
<h2>設定</h2>
<div class="setting-item">
<div class="global-volume-container">
<label>全体音量係数:</label>
<input type="range" class="global-volume-slider" id="global-volume" min="0" max="10" step="0.01" value="5" disabled>
<span class="slider-value" id="global-volume-value">0.5</span>
</div>
</div>
<div class="setting-item">
<div class="playback-speed-container">
<label>再生速度:</label>
<input type="range" class="playback-speed-slider" id="playback-speed" min="0.01" max="5" step="0.001" value="1" disabled>
<span class="slider-value" id="playback-speed-value">1.00x</span>
</div>
</div>
<div class="setting-item">
<label for="tempo">テンポ (BPM):</label>
<input type="number" id="tempo" min="40" max="200" value="84" step="0.1">
<span id="tempo-speed-value">1.00x</span>
</div>
<span>↑練習したいテンポを入力するとそのテンポに合わせて再生速度スライダーが調整されます。1倍速のテンポを基準に計算します。</span>
<br>
<div class="setting-item">
<button class="combine-button" id="refresh-background-btn">おまけ:背景を更新</button>
</div>
</div>
<!-- 全画面時のロックボタン -->
<button class="lock-controls-btn" id="lock-controls-btn" title="コントロールバーを固定">🔒</button>
</div>
<!-- メトロノーム -->
<div id="app" style="position:fixed;top:50%;left:50%;width:280px;height:40px;background:rgba(0,0,0,0.5);color:#fff;border-radius:10px;box-sizing:border-box;box-shadow:0 0 20px rgba(0,0,0,0.7);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px;overflow:hidden;z-index:999999;cursor:move;">
<div id="header" style="cursor:pointer;user-select:none;font-size:24px;color:#fff;z-index:10;display:flex;align-items:center;justify-content:center;">▼メトロノーム</div>
<div id="content" style="display:none;flex:1;flex-direction:column;align-items:center;justify-content:center;width:100%;user-select:none;">
<svg width="108" height="150" fill="none" stroke="#fff" stroke-width="4" stroke-linecap="round">
<path id="tip" d="M55,1c22,0,0,48,0,48S33,1,55,1z" fill="none" />
<path d="M21.3,117.5c0-17.4,14.1-31.5,31.5-31.5s31.5,14.1,31.5,31.5" stroke="#333" />
<path id="lvl" d="M21.3,117.5c0-17.4,14.1-31.5,31.5-31.5s31.5,14.1,31.5,31.5" />
<g id="arm">
<path d="M2,65 55,117" />
<circle cx="2" cy="65" r="2" />
</g>
<g id="toggle">
<path d="M45.5,145 60.5,145" stroke-width="20" stroke="#444" />
<circle cx="45.5" cy="145" r="8" stroke="none" fill="#000" />
</g>
</svg>
<input id="bpmInput" type="number" value="84" /> BPM
</div>
<audio id="snd" src="data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0UAAAAOAAADTGF2ZjYxLjEuMTAwAAAAAAAAAAAAAAD/+1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAAAUAAASAAFVVVVVVVVVVVVVVVVVVVVVVVVWAgICAgICAgICAgICAgICAgICAgKqqqqqqqqqqqqqqqqqqqqqqqqqq1dXV1dXV1dXV1dXV1dXV1dXV1dX//////////////////////////wAAAABMYXZjNjEuMy4AAAAAAAAAAAAAAAAkAkAAAAAAAAAEgFJnjCP/+1RkAA/wDQCAAeAACAAADSAAAAEASAIADQAAIAAANIAAAAQD+c9Ur/f39/KLpNtVUpRoKhWoMy4UxKDYGAlmATReypqYqNWo+bVVKUZuovOVsYm4fiQntX6bb+vS6FVUoptu/tmZzvpdCqrM0iW1UxiThsDAPzC/K1BmhWAwOCkgrLbHh29sDrznj/qFIc6kdIe+OiLrGtwIkCn/9NMc8TLx48muiDgf2/RBODoZIFX9JUPc6f41SqLFvEPMuf7/+1RkTA/y3TsugYVlEgAADSAAAAENJQz0FGeACAAANIKAAARb1XDj0vAruHuBEgOH1tjT87z6h3U6xTqQghLKv46ncz8OhQaY2f7xm9PAiEICgUDAV0irYCAMBAAADwt5A73wJGAN/ijDg8BqgCONoHkwtMA3ED3PsQcPSAUAzJoVmZw0LhmF1ZKHgIm/RuyZuB+wFrBExSY0wbL/9buwGMYYXC2ZtLpX//1pmgNggOhBsWFyxOhfACv///i3uMz/+1RkN4ADhEjMbkpgAAAADSDAAAAOEPt9uPeAEAAANIMAAAAef19jsZigQCAUBgMCkABIwuN3LMqhG36c3GNxNIZDg1VL9VQbZP8cCxnN3tt0yr76xnGIDneOOSlM7gXlo9O41VQQhkXC/q+s59Lb+byPMel73vTO4mpa4ta2buHVkmsMn/znO9YtrGfjwb4eROGX8i22d2VUVDbcYTAIImcXTQlEE8LqR19UYqMXXuVcZb9xd9XU8ces0s3df3f/+1RkFQDx2x5jfzEABAAADSDgAAEHnHVxx6RmwAAANIAAAAQOAiaTAUBpMqhxt///7m+Bot83TS7MiyMMDaXyOT0eJuHofDzYXiwaHmlm2DHQRrKjGv9//I3tpEf9hgRHfEQ4gR1KEQdQepGsvt/JZWSqyXqniHQ1SSSwMAsGgVBFwlLwRPrWOicfLlyGus0DQNQ6dPA0JgaeIhKFRjyoLR534h8sDRUqC1MS//8qEnifewZ1n+So1zXK1P9MrP3/+1RkJoDx7QrZeYlgEAAADSAAAAEGROUOAIxHQAAANIAAAAQskwY5djO3+UKzpqz1KGOJM7br5SkFBSGXzBSCg0/2gyCQakxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo="></audio>
</div>
<script src="/gsap.js"></script>
<script src="/CustomEase.min.js"></script>
<script>
// ---- メイン機能: ペイン管理, 音声合成, プレイヤー制御 ----
document.addEventListener('DOMContentLoaded', function() {
let isInitialized = false;
let overlayElement = null;
// ---------- グローバル変数 ----------
const meiOffset = 1.75;
const midioffset = 1.85;
let audioContext;
try {
audioContext = new(window.AudioContext || window.webkitAudioContext)();
} catch (e) {
console.error('Web Audio API not supported', e);
}
const BASE_PATH = './f/';
const videoFiles = {
s: 'sv.mp4',
a: 'av.mp4',
t: 'tv.mp4'
};
const audioFiles = ['s', 'a', 't', 'p'];
const audioFileMap = {
s: 'sa.opus',
a: 'aa.opus',
t: 'ta.opus',
p: 'pa.opus'
};
const videoBlobCache = {}; // fileName -> blob URL
const pendingFetches = {}; // fileName -> Promise (fetch中)
let isLooping = false;
// ペイン管理
let panes = [];
let paneIdCounter = 0;
let isPlaying = false;
let currentPlaybackRate = 1;
let combinedAudioElement = null;
let isAudioCombined = false;
let videoDuration = 0; // 音声の長さ(合成後)
let startTime = 0;
let endTime = 0;
let loopEnabled = false;
let isDragging = false;
let draggingMarker = null; // 'start' or 'end'
let isDraggingMarker = false;
// DOM参照
const paneContainer = document.getElementById('pane-container');
const playPauseBtn = document.getElementById('play-pause-btn');
const resetStartBtn = document.getElementById('reset-start-btn');
const timeDisplay = document.getElementById('time-display');
const progressBar = document.getElementById('progress-bar');
const progressContainer = document.getElementById('progress-container');
const progressTime = document.getElementById('progress-time');
const volumeSlider = document.getElementById('volume-slider');
const volumeBtn = document.getElementById('volume-btn');
const fullscreenBtn = document.getElementById('fullscreen-btn');
const settingsToggleBtn = document.getElementById('settings-toggle-btn');
const settingsPopup = document.getElementById('settings-popup');
const addPaneBtn = document.getElementById('add-pane-btn');
const startMarker = document.getElementById('start-marker');
const endMarker = document.getElementById('end-marker');
const loopCheckbox = document.getElementById('loop');
const applyTimeBtn = document.getElementById('apply-time-btn');
const startTimeInput = document.getElementById('start-time');
const endTimeInput = document.getElementById('end-time');
const setStartTimeBtn = document.getElementById('set-start-time');
const setEndTimeBtn = document.getElementById('set-end-time');
const resetEndTimeBtn = document.getElementById('reset-end-time');
const globalVolumeSlider = document.getElementById('global-volume');
const globalVolumeValue = document.getElementById('global-volume-value');
const playbackSpeedSlider = document.getElementById('playback-speed');
const playbackSpeedValue = document.getElementById('playback-speed-value');
const tempoInput = document.getElementById('tempo');
const tempoSpeedValue = document.getElementById('tempo-speed-value');
const combineButton = document.getElementById('combine-button');
const combineStatus = document.getElementById('combine-status');
const presetSelect = document.getElementById('preset-select');
const presetList = document.getElementById('preset-list');
const savePresetBtn = document.getElementById('save-preset-btn');
const lockControlsBtn = document.getElementById('lock-controls-btn');
// ポップアップ用
const popupSpeed = document.getElementById('popup-speed');
const popupSpeedValue = document.getElementById('popup-speed-value');
const popupTempo = document.getElementById('popup-tempo');
const popupTempoValue = document.getElementById('popup-tempo-value');
const popupStartTime = document.getElementById('popup-start-time');
const popupEndTime = document.getElementById('popup-end-time');
const popupLoop = document.getElementById('popup-loop');
const popupApplyTime = document.getElementById('popup-apply-time');
// 音声スライダー
const audioSliders = document.querySelectorAll('.audio-slider');
const ffmpegVolumeSlider = document.getElementById('ffmpeg-volume');
const ffmpegVolumeValue = document.getElementById('ffmpeg-volume-value');
const timeMarkers = [{
label: "最初",
time: 0.0
},
{
label: "A",
time: 13.1
},
{
label: "B",
time: 58.9
},
{
label: "C",
time: 81.5
},
{
label: "D",
time: 127.3
},
{
label: "E",
time: 150.1
},
{
label: "F",
time: 173.0
},
{
label: "G",
time: 194.6
},
{
label: "最後",
time: 230.5
}
];
// ---------- プリセット定義 ----------
const PRESET_VOLUMES = {
soprano: {
s: 1,
a: 0.5,
t: 0.5,
p: 1
},
alto: {
s: 0.5,
a: 1,
t: 0.5,
p: 1
},
tenor: {
s: 0.5,
a: 0.5,
t: 1,
p: 1
},
piano: {
s: 0.3,
a: 0.3,
t: 0.3,
p: 1
},
custom: {
s: 1,
a: 1,
t: 1,
p: 1
}
};
// デフォルトプリセット(配置)
const defaultPresets = [{
name: 'すべて',
panes: [{
type: 'sing',
file: 's',
x: 31,
y: 0,
w: 23,
h: 43
},
{
type: 'musicxml',
x: 0,
y: 0,
w: 31,
h: 100
},
{
type: 'sing',
file: 'a',
x: 54,
y: 0,
w: 23,
h: 43
},
{
type: 'midi',
file: 'p',
x: 31,
y: 43,
w: 69,
h: 57
},
{
type: 'sing',
file: 't',
x: 77,
y: 0,
w: 23,
h: 43
}
],
},
{
name: '合唱練習',
panes: [{
type: 'sing',
file: 's',
x: 46,
y: 0,
w: 27,
h: 50
},
{
type: 'musicxml',
file: 's',
x: 0,
y: 0,
w: 46,
h: 100
},
{
type: 'sing',
file: 'a',
x: 73,
y: 0,
w: 27,
h: 50
},
{
type: 'sing',
file: 't',
x: 46,
y: 50,
w: 27,
h: 50
}
]
},
{
name: '1パート練習',
panes: [{
type: 'sing',
file: 's',
x: 63,
y: 0,
w: 36,
h: 52
},
{
type: 'musicxml',
file: 's',
x: 0,
y: 0,
w: 63,
h: 100
}
]
}
];
// 保存されたプリセットをロード
let savedPresets = JSON.parse(localStorage.getItem('playerPresets') || '[]');
// デフォルトがなければ追加
if (savedPresets.length === 0) {
savedPresets = defaultPresets;
localStorage.setItem('playerPresets', JSON.stringify(savedPresets));
}
async function preloadVideos() {
const requiredFiles = ['sv.mp4', 'av.mp4', 'tv.mp4'];
const total = requiredFiles.length;
let loaded = 0;
const progressEl = document.getElementById('loading-progress');
const updateProgress = (message) => {
if (progressEl) progressEl.textContent = message;
};
updateProgress(`動画読み込み中 0/${total}`);
// 既にキャッシュ済みのものをカウント
requiredFiles.forEach(file => {
if (videoBlobCache[file]) loaded++;
});
if (loaded > 0) updateProgress(`動画読み込み中 ${loaded}/${total}`);
const promises = requiredFiles.map(async (file) => {
// 既にキャッシュ済みなら即座に解決
if (videoBlobCache[file]) {
return videoBlobCache[file];
}
// 既にフェッチ中ならそのPromiseを待つ
if (pendingFetches[file]) {
const url = await pendingFetches[file];
loaded++;
updateProgress(`動画読み込み中 ${loaded}/${total}`);
return url;
}
// 新規フェッチ
const fullPath = BASE_PATH + file;
const fetchPromise = fetch(fullPath)
.then(res => {
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.blob();
})
.then(blob => {
const url = URL.createObjectURL(blob);
videoBlobCache[file] = url;
delete pendingFetches[file];
loaded++;
updateProgress(`動画読み込み中 ${loaded}/${total}`);
return url;
})
.catch(err => {
delete pendingFetches[file];
console.error(`Failed to preload ${file}:`, err);
loaded++;
updateProgress(`動画読み込み中 ${loaded}/${total} (エラー)`);
throw err;
});
pendingFetches[file] = fetchPromise;
return fetchPromise;
});
// すべての完了(一部失敗も含む)を待つ
await Promise.allSettled(promises);
updateProgress(`動画読み込み完了 ${loaded}/${total}`);
}
function setVideoSource(video, fileName) {
if (videoBlobCache[fileName]) {
const url = videoBlobCache[fileName];
if (video.src !== url) {
video.src = url;
video.load(); // ← 追加: 明示的に読み込み開始
console.log(`📹 キャッシュから設定: ${fileName}`);
}
return;
}
// フェッチ中なら待機
if (pendingFetches[fileName]) {
console.log(`⏳ フェッチ完了を待機: ${fileName}`);
pendingFetches[fileName]
.then(url => {
if (video.src !== url) {
video.src = url;
console.log(`📹 フェッチ完了後に設定: ${fileName}`);
}
})
.catch(err => console.error('動画読み込みエラー:', fileName, err));
return;
}
// キャッシュもフェッチもない場合のみ新規フェッチ
console.log(`🔄 新規フェッチ開始: ${fileName}`);
const fullPath = BASE_PATH + fileName;
const fetchPromise = fetch(fullPath)
.then(res => {
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.blob();
})
.then(blob => {
const url = URL.createObjectURL(blob);
videoBlobCache[fileName] = url;
delete pendingFetches[fileName];
if (video.src !== url) {
video.src = url;
}
video.load();
console.log(`✅ フェッチ完了: ${fileName}`);
return url;
})
.catch(err => {
delete pendingFetches[fileName];
console.error('Failed to load video:', fileName, err);
throw err;
});
pendingFetches[fileName] = fetchPromise;
}
function updatePaneZIndex() {
// クリックされたら最前面にする処理は別途
}
function createPane(type, file, x, y, w, h) {
try {
console.log('🛠 createPane 開始', type, file, x, y, w, h);
const id = paneIdCounter++;
const pane = document.createElement('div');
pane.className = 'pane';
pane.dataset.paneId = id;
pane.dataset.type = type;
pane.style.left = x + '%';
pane.style.top = y + '%';
pane.style.width = w + '%';
pane.style.height = h + '%';
// ---- ペインヘッダー(ドラッグハンドル) ----
const header = document.createElement('div');
header.className = 'pane-header';
// タイトル(動的に更新)
const title = document.createElement('span');
title.className = 'pane-title';
const typeNames = {
sing: '🎤 歌唱',
other: '🎵 その他',
midi: '🎹 MIDI',
musicxml: '📄 楽譜'
};
title.textContent = typeNames[type] || 'ペイン';
header.appendChild(title);
// ---- ズームコントロール ----
const zoomDiv = document.createElement('div');
zoomDiv.className = 'pane-zoom';
const zoomOutBtn = document.createElement('button');
zoomOutBtn.textContent = '−';
zoomOutBtn.title = 'ズームアウト';
const zoomLevelSpan = document.createElement('span');
zoomLevelSpan.className = 'zoom-level';
zoomLevelSpan.textContent = '100%';
const zoomInBtn = document.createElement('button');
zoomInBtn.textContent = '+';
zoomInBtn.title = 'ズームイン';
// ズーム状態
let zoomLevel = 1.0;
const zoomWrapper = document.createElement('div');
zoomWrapper.className = 'zoom-wrapper';
let wrapperStyle = `
position: relative;
overflow: visible;
display: flex;
justify-content: center;
align-items: center;
transform-origin: center center;
`;
if (type === 'musicxml') {
wrapperStyle += `width: 100%; height: 100%; transform: none;`;
} else {
wrapperStyle += `width: 100%; height: 100%;`;
}
zoomWrapper.style.cssText = wrapperStyle;
function updateZoom() {
zoomLevelSpan.textContent = Math.round(zoomLevel * 100) + '%';
const info = panes.find(p => p.id === id);
if (!info) return;
const wrapper = info.zoomWrapper;
if (!wrapper) return;
const isMusicXML = (info.type === 'musicxml');
if (isMusicXML) {
wrapper.style.transform = 'none';
wrapper.style.width = '100%';
wrapper.style.height = '100%';
if (info.contentInstance && info.contentInstance.setZoom) {
info.contentInstance.setZoom(zoomLevel);
}
} else {
// ★ transform-origin を center に設定
wrapper.style.transformOrigin = 'center center';
wrapper.style.transform = `scale(${zoomLevel})`;
wrapper.style.width = '100%';
wrapper.style.height = '100%';
if (info.contentInstance && info.contentInstance.setZoom) {
info.contentInstance.setZoom(zoomLevel);
}
}
}
// ズームボタンのイベント
zoomInBtn.addEventListener('click', () => {
zoomLevel = Math.min(3.0, zoomLevel + 0.1);
updateZoom();
});
zoomOutBtn.addEventListener('click', () => {
zoomLevel = Math.max(0.3, zoomLevel - 0.1);
updateZoom();
});
zoomLevelSpan.addEventListener('dblclick', () => {
zoomLevel = 1.0;
updateZoom();
});
zoomDiv.appendChild(zoomOutBtn);
zoomDiv.appendChild(zoomLevelSpan);
zoomDiv.appendChild(zoomInBtn);
header.appendChild(zoomDiv);
// ---- タイプとファイル選択(動画ペイン用) ----
const typeSelect = document.createElement('select');
typeSelect.style.cssText = 'background:#112240;color:#e6f1ff;border:1px solid #64ffda;border-radius:3px;font-size:11px;padding:1px 4px;height:22px;';
const typeOptions = [{
value: 'sing',
label: '歌唱'
},
{
value: 'other',
label: 'その他'
},
{
value: 'midi',
label: 'MIDI'
},
{
value: 'musicxml',
label: '楽譜'
}
];
typeOptions.forEach(opt => {
const option = document.createElement('option');
option.value = opt.value;
option.textContent = opt.label;
if (opt.value === type) option.selected = true;
typeSelect.appendChild(option);
});
header.appendChild(typeSelect);
// ファイル選択(動画ペインのみ表示)
const fileSelect = document.createElement('select');
fileSelect.style.cssText = 'background:#112240;color:#e6f1ff;border:1px solid #64ffda;border-radius:3px;font-size:11px;padding:1px 4px;height:22px;';
fileSelect.style.display = (type === 'sing' || type === 'other') ? 'inline-block' : 'none';
function updateFileOptions(selectedType) {
fileSelect.innerHTML = '';
let files;
if (selectedType === 'sing') {
files = [{
value: 's',
label: 'ソプラノ'
},
{
value: 'a',
label: 'アルト'
},
{
value: 't',
label: 'テノール'
}
];
} else if (selectedType === 'other') {
files = [{
value: 'p',
label: 'ピアノ'
}];
} else {
files = [];
}
files.forEach(f => {
const opt = document.createElement('option');
opt.value = f.value;
opt.textContent = f.label;
if (f.value === file) opt.selected = true;
fileSelect.appendChild(opt);
});
fileSelect.style.display = (selectedType === 'sing' || selectedType === 'other') ? 'inline-block' : 'none';
}
updateFileOptions(type);
header.appendChild(fileSelect);
// 閉じるボタン
const closeBtn = document.createElement('button');
closeBtn.textContent = '✕';
closeBtn.style.cssText = 'background:none;border:none;color:#ff6b6b;cursor:pointer;font-size:14px;padding:0 4px;';
closeBtn.title = 'ペインを削除';
closeBtn.addEventListener('click', function(e) {
e.stopPropagation();
const info = panes.find(p => p.id === id);
if (info) {
if (info._cleanup) info._cleanup();
if (type === 'midi' && window.MIDIPane && info.contentInstance) {
const content = pane.querySelector('.pane-content');
if (content) window.MIDIPane.dispose(content);
} else if (type === 'musicxml' && window.MusicXMLPane && info.contentInstance) {
const content = pane.querySelector('.pane-content');
if (content) window.MusicXMLPane.dispose(content);
}
}
pane.remove();
panes = panes.filter(p => p.id !== id);
});
header.appendChild(closeBtn);
pane.appendChild(header);
// ---- コンテンツ領域 ----
const content = document.createElement('div');
content.className = 'pane-content';
content.style.top = '32px';
content.style.height = 'calc(100% - 32px)';
content.style.overflow = 'auto'; // スクロール可能に
content.style.background = (type === 'musicxml') ? '#fff' : '#000';
// ズームラッパー(100%固定)
zoomWrapper.style.width = '100%';
zoomWrapper.style.height = '100%';
content.appendChild(zoomWrapper);
pane.appendChild(content);
// ---- リサイズハンドル ----
const resizeHandle = document.createElement('div');
resizeHandle.className = 'resize-handle';
pane.appendChild(resizeHandle);
// ---- パン操作(スクロールベース) ----
let isPanning = false;
let panStartX = 0;
let panStartY = 0;
let startScrollLeft = 0;
let startScrollTop = 0;
content.addEventListener('wheel', function(e) {
if (!e.ctrlKey) {
return;
}
e.preventDefault();
// ズーム前の状態を保存
const rect = content.getBoundingClientRect();
const mouseX = e.clientX - rect.left;
const mouseY = e.clientY - rect.top;
// ズーム前の相対位置(0〜1)
const relX = mouseX / rect.width;
const relY = mouseY / rect.height;
// ズームレベルを変更
const delta = e.deltaY > 0 ? -0.1 : 0.1;
const oldZoom = zoomLevel;
zoomLevel = Math.max(0.3, Math.min(3.0, zoomLevel + delta));
// ズーム後の位置を計算
const newRect = content.getBoundingClientRect();
const targetX = relX * newRect.width;
const targetY = relY * newRect.height;
// スクロール位置を調整(カーソル位置を維持)
content.scrollLeft += (targetX - mouseX);
content.scrollTop += (targetY - mouseY);
// ズームを適用
const info = panes.find(p => p.id === id);
if (info) {
info.zoomLevel = zoomLevel;
if (info.updateZoom) {
info.updateZoom();
}
}
}, {
passive: false
});
// ペインコンテンツ上でマウスダウン(パン開始) - 右クリック/ホイールボタンのみ
content.addEventListener('mousedown', function(e) {
if (e.button === 1 || e.button === 2) {
e.preventDefault();
isPanning = true;
panStartX = e.clientX;
panStartY = e.clientY;
startScrollLeft = content.scrollLeft;
startScrollTop = content.scrollTop;
content.style.cursor = 'grabbing';
}
});
// コンテキストメニューを無効化(右クリックパン用)
content.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
// グローバルイベント(ペインごとに独立)
const onMouseMove = function(e) {
if (!isPanning) return;
const dx = e.clientX - panStartX;
const dy = e.clientY - panStartY;
content.scrollLeft = startScrollLeft - dx;
content.scrollTop = startScrollTop - dy;
};
const onMouseUp = function() {
if (isPanning) {
isPanning = false;
content.style.cursor = 'default';
}
};
document.addEventListener('mousemove', onMouseMove);
document.addEventListener('mouseup', onMouseUp);
// ---- リサイズ機能(右下ハンドル) ----
let isResizing = false;
let resizeStartX = 0;
let resizeStartY = 0;
let resizeStartW = 0;
let resizeStartH = 0;
const containerRect = paneContainer.getBoundingClientRect();
resizeHandle.addEventListener('mousedown', function(e) {
e.preventDefault();
e.stopPropagation();
isResizing = true;
resizeStartX = e.clientX;
resizeStartY = e.clientY;
resizeStartW = pane.offsetWidth;
resizeStartH = pane.offsetHeight;
document.addEventListener('mousemove', onResizeMove);
document.addEventListener('mouseup', onResizeUp);
});
function onResizeMove(e) {
if (!isResizing) return;
const dx = e.clientX - resizeStartX;
const dy = e.clientY - resizeStartY;
let newW = resizeStartW + dx;
let newH = resizeStartH + dy;
// 最小サイズ
newW = Math.max(120, newW);
newH = Math.max(80, newH);
// パーセントに変換して設定
const containerW = paneContainer.clientWidth;
const containerH = paneContainer.clientHeight;
const wPercent = (newW / containerW) * 100;
const hPercent = (newH / containerH) * 100;
pane.style.width = wPercent + '%';
pane.style.height = hPercent + '%';
}
function onResizeUp() {
if (isResizing) {
isResizing = false;
document.removeEventListener('mousemove', onResizeMove);
document.removeEventListener('mouseup', onResizeUp);
}
}
typeSelect.addEventListener('change', function() {
const newType = this.value;
const info = panes.find(p => p.id === id);
if (!info) return;
// ★ 古いタイプを保存
const oldType = info.type;
// ファイル選択肢を更新
updateFileOptions(newType);
let newFile = file;
if (newType === 'sing') {
if (!['s', 'a', 't'].includes(newFile)) newFile = 's';
} else if (newType === 'other') {
newFile = 'p';
} else {
newFile = '';
}
// ★ 古いタイプを渡してコンテンツを再生成(この時点では info.type はまだ古い)
regeneratePaneContent(id, newType, newFile, oldType);
// ★ コンテンツ再生成後に info を更新
info.type = newType;
info.file = newFile;
// タイトル更新
const titleSpan = pane.querySelector('.pane-title');
if (titleSpan) titleSpan.textContent = typeNames[newType] || 'ペイン';
// ズームを再適用
if (info.contentInstance && info.contentInstance.setZoom) {
info.contentInstance.setZoom(1);
}
// updateZoom は regeneratePaneContent 内で呼ばれるので、ここでは不要な場合がある
// ただし、確実に呼ぶ
if (info.updateZoom) info.updateZoom();
});
// ---- ファイル切り替えイベント(動画ペイン用) ----
fileSelect.addEventListener('change', function() {
const newFile = this.value;
const info = panes.find(p => p.id === id);
if (!info) return;
// 動画ペインのみ
if (info.type === 'sing' || info.type === 'other') {
info.file = newFile;
// 動画ソースを切り替え
const video = info.contentInstance;
if (video && video.tagName === 'VIDEO') {
const fileName = info.type === 'sing' ? videoFiles[newFile] || 'sv.mp4' : videoFiles[newFile] || 'av.mp4';
setVideoSource(video, fileName);
// 現在の時刻を維持
if (combinedAudioElement) {
video.currentTime = combinedAudioElement.currentTime;
}
}
}
});
// ============================================
// ★★★ ペインをDOMに追加 ★★★
// ============================================
if (paneContainer) {
paneContainer.appendChild(pane);
} else {
console.error('paneContainer が見つかりません');
return null;
}
// ---- Draggabilly でドラッグ移動(ヘッダーをハンドルに) ----
if (typeof Draggabilly === 'function') {
const draggie = new Draggabilly(pane, {
handle: '.pane-header',
containment: paneContainer
});
// ドラッグ中はペインを最前面に
draggie.on('dragStart', function() {
panes.forEach(p => {
p.element.style.zIndex = 1;
});
pane.style.zIndex = 10;
});
// クリーンアップ用に保存
const info = panes.find(p => p.id === id);
if (info) {
const oldCleanup = info._cleanup || function() {};
info._cleanup = function() {
draggie.destroy();
oldCleanup();
};
}
} else {
console.warn('Draggabilly が読み込まれていません。ペインの移動はできません。');
}
// ============================================
// コンテンツを生成
// ============================================
let contentInstance = null;
let videoElement = null;
if (type === 'midi') {
pane.classList.add('midi-pane');
if (window.MIDIPane) {
contentInstance = window.MIDIPane.create(zoomWrapper, './f/piano.mid', header, midioffset);
} else {
zoomWrapper.innerHTML = '<div style="color:#ff6b6b;padding:20px;">MIDIPane が読み込まれていません</div>';
}
} else if (type === 'musicxml') {
pane.classList.add('xml-pane');
if (window.MusicXMLPane) {
// ★ MusicXML は内部スケールを1倍固定(親要素のサイズ変更で拡大させる)
contentInstance = window.MusicXMLPane.create(zoomWrapper, './mei-ver.mei', {
offset: meiOffset
});
// 内部スケールは1倍固定
if (contentInstance && contentInstance.setZoom) {
contentInstance.setZoom(1);
}
const currentTime = combinedAudioElement ? combinedAudioElement.currentTime : 0;
if (contentInstance && contentInstance.syncTo) {
contentInstance.syncTo(currentTime);
}
const controls = zoomWrapper.closest('.pane').querySelector('.xml-controls');
if (controls) controls.style.display = 'none';
// 初期ズームを適用(サイズ100% = 実寸)
updateZoom();
} else {
zoomWrapper.innerHTML = '<div style="color:#ff6b6b;padding:20px;">MusicXMLPane が読み込まれていません</div>';
}
} else {
// 動画ペイン
videoElement = document.createElement('video');
videoElement.muted = true;
videoElement.playsInline = true;
videoElement.preload = 'auto';
videoElement.style.width = '100%';
videoElement.style.height = '100%';
videoElement.style.objectFit = 'contain';
videoElement.style.background = '#000';
videoElement.style.pointerEvents = 'none';
const fileName = type === 'sing' ? videoFiles[file] || 'sv.mp4' : videoFiles[file] || 'av.mp4';
setVideoSource(videoElement, fileName);
zoomWrapper.appendChild(videoElement);
contentInstance = videoElement;
videoElement.addEventListener('loadedmetadata', () => {
if (combinedAudioElement) {
videoElement.currentTime = combinedAudioElement.currentTime;
}
});
// 動画ペインにも初期ズームを適用
updateZoom();
}
// ---- ペイン情報を保存 ----
const paneInfo = {
id: id,
type: type,
file: file,
element: pane,
content: content,
contentInstance: contentInstance,
zoomWrapper: zoomWrapper,
zoomLevel: zoomLevel,
updateZoom: updateZoom,
_cleanup: function() {
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', onMouseUp);
document.removeEventListener('mousemove', onResizeMove);
document.removeEventListener('mouseup', onResizeUp);
}
};
// 既存の panes に追加(既に存在する場合は上書き)
const existingIdx = panes.findIndex(p => p.id === id);
if (existingIdx >= 0) {
panes[existingIdx] = paneInfo;
} else {
panes.push(paneInfo);
}
return paneInfo;
} catch (err) {
console.error('❌ createPane でエラーが発生:', err);
// エラーが起きても DOM に何も追加されないので、必要に応じてエラー表示
return null;
}
}
function regeneratePaneContent(paneId, type, file, oldType) {
const info = panes.find(p => p.id === paneId);
if (!info) return;
const pane = info.element;
const content = pane.querySelector('.pane-content');
// --- 1. 古いコンテンツのインスタンスを破棄 ---
if (oldType === 'midi' && window.MIDIPane) {
content.querySelectorAll('.zoom-wrapper').forEach(w => {
window.MIDIPane.dispose(w);
});
} else if (oldType === 'musicxml' && window.MusicXMLPane) {
content.querySelectorAll('.zoom-wrapper').forEach(w => {
window.MusicXMLPane.dispose(w);
});
}
// --- 2. content を完全にクリア(古い zoom-wrapper も含めてすべて削除) ---
content.innerHTML = '';
// --- 2. 新しい zoom-wrapper を作成 ---
const zoomWrapper = document.createElement('div');
zoomWrapper.className = 'zoom-wrapper';
let wrapperStyle = `
position: relative;
overflow: visible;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
`;
if (type === 'musicxml') {
wrapperStyle += 'transform: none;';
}
zoomWrapper.style.cssText = wrapperStyle;
content.appendChild(zoomWrapper);
info.zoomWrapper = zoomWrapper;
zoomWrapper.innerHTML = '';
info.contentInstance = null;
// --- 3. 新しいコンテンツを生成(以下、元のコードと同じ) ---
if (type === 'midi') {
pane.classList.add('midi-pane');
if (window.MIDIPane) {
info.contentInstance = window.MIDIPane.create(zoomWrapper, './f/piano.mid', pane.querySelector('.pane-header'), midioffset);
} else {
zoomWrapper.innerHTML = '<div style="color:#ff6b6b;padding:20px;">MIDIPane が読み込まれていません</div>';
}
} else if (type === 'musicxml') {
pane.classList.add('xml-pane');
if (window.MusicXMLPane) {
info.contentInstance = window.MusicXMLPane.create(zoomWrapper, './mei-ver.mei', {
offset: meiOffset
});
const currentTime = combinedAudioElement ? combinedAudioElement.currentTime : 0;
if (info.contentInstance && info.contentInstance.syncTo) {
info.contentInstance.syncTo(currentTime);
}
const controls = zoomWrapper.closest('.pane').querySelector('.xml-controls');
if (controls) controls.style.display = 'none';
} else {
zoomWrapper.innerHTML = '<div style="color:#ff6b6b;padding:20px;">MusicXMLPane が読み込まれていません</div>';
}
} else {
// 動画ペイン
pane.classList.remove('midi-pane', 'xml-pane');
const videoElement = document.createElement('video');
videoElement.muted = true;
videoElement.playsInline = true;
videoElement.preload = 'auto';
videoElement.style.width = '100%';
videoElement.style.height = '100%';
videoElement.style.objectFit = 'contain';
videoElement.style.background = '#000';
videoElement.style.pointerEvents = 'none';
const fileName = type === 'sing' ? videoFiles[file] || 'sv.mp4' : videoFiles[file] || 'av.mp4';
setVideoSource(videoElement, fileName);
zoomWrapper.appendChild(videoElement);
info.contentInstance = videoElement;
if (combinedAudioElement) {
videoElement.currentTime = combinedAudioElement.currentTime;
}
videoElement.addEventListener('loadedmetadata', () => {
if (combinedAudioElement) {
videoElement.currentTime = combinedAudioElement.currentTime;
}
});
}
// --- 4. ズーム状態をリセットして適用 ---
info.zoomLevel = 1.0;
if (info.updateZoom) {
info.updateZoom();
}
}
function syncAllVideos(seekTime) {
return new Promise((resolve) => {
const videos = panes.map(p => p.element.querySelector('video')).filter(v => v);
const audio = combinedAudioElement;
const mediaElements = [audio, ...videos].filter(el => el !== null);
if (mediaElements.length === 0) {
resolve();
return;
}
// すべての要素が準備完了しているかチェック
const allReady = mediaElements.every(el => {
if (!el) return false;
if (el.tagName === 'VIDEO') {
return el.readyState >= HTMLMediaElement.HAVE_ENOUGH_DATA;
}
return el.duration > 0;
});
if (allReady) {
const time = seekTime !== undefined ? seekTime : (audio ? audio.currentTime : 0);
videos.forEach(v => {
v.currentTime = time;
});
if (audio) audio.currentTime = time;
resolve();
return;
}
// 準備ができていない要素を待機
let pending = mediaElements.filter(el => {
if (!el) return false;
if (el.tagName === 'VIDEO') {
return el.readyState < HTMLMediaElement.HAVE_ENOUGH_DATA;
}
return el.duration === 0;
}).length;
if (pending === 0) {
const time = seekTime !== undefined ? seekTime : (audio ? audio.currentTime : 0);
videos.forEach(v => {
v.currentTime = time;
});
if (audio) audio.currentTime = time;
resolve();
return;
}
const indicator = document.getElementById('buffering-indicator');
if (indicator) indicator.style.display = 'block';
let resolved = false;
const onReady = () => {
if (resolved) return;
pending--;
if (pending === 0) {
resolved = true;
if (indicator) indicator.style.display = 'none';
const time = seekTime !== undefined ? seekTime : (audio ? audio.currentTime : 0);
videos.forEach(v => {
v.currentTime = time;
});
if (audio) audio.currentTime = time;
resolve();
}
};
mediaElements.forEach(el => {
if (!el) return;
if (el.tagName === 'VIDEO' && el.readyState < HTMLMediaElement.HAVE_ENOUGH_DATA) {
el.addEventListener('canplaythrough', onReady, {
once: true
});
el.addEventListener('loadeddata', onReady, {
once: true
});
el.addEventListener('error', onReady, {
once: true
});
} else if (el.tagName !== 'VIDEO' && el.duration === 0) {
el.addEventListener('loadedmetadata', onReady, {
once: true
});
el.addEventListener('canplaythrough', onReady, {
once: true
});
el.addEventListener('error', onReady, {
once: true
});
}
});
// タイムアウト (10秒)
setTimeout(() => {
if (!resolved) {
resolved = true;
if (indicator) indicator.style.display = 'none';
console.warn('syncAllVideos: タイムアウト、強制実行');
const time = seekTime !== undefined ? seekTime : (audio ? audio.currentTime : 0);
videos.forEach(v => {
v.currentTime = time;
});
if (audio) audio.currentTime = time;
resolve();
}
}, 10000);
});
}
function clearPanesOnly() {
// 各ペインのリソースを解放(音声関連は触らない)
panes.forEach(p => {
if (p.type === 'midi' && window.MIDIPane && p.contentInstance) {
const content = p.element.querySelector('.pane-content');
if (content) window.MIDIPane.dispose(content);
} else if (p.type === 'musicxml' && window.MusicXMLPane && p.contentInstance) {
const content = p.element.querySelector('.pane-content');
if (content) window.MusicXMLPane.dispose(content);
}
p.element.remove();
});
panes = [];
paneIdCounter = 0;
}
// 元の clearPanes 関数は保持(必要に応じて使用)
function clearPanes() {
// 音声も破棄
if (combinedAudioElement) {
combinedAudioElement.pause();
URL.revokeObjectURL(combinedAudioElement.src);
combinedAudioElement = null;
}
isAudioCombined = false;
clearPanesOnly();
}
function loadPreset(preset) {
const wasPlaying = isPlaying;
const currentTime = combinedAudioElement ? combinedAudioElement.currentTime : 0;
// ペインだけをクリア(音声はそのまま)
clearPanesOnly(); // 新しく作成する関数
if (!preset || !preset.panes) {
return;
}
// ペインを作成
preset.panes.forEach((p, index) => {
setTimeout(() => {
createPane(p.type, p.file || 's', p.x ?? (50 + index * 30), p.y ?? (50 + index * 20), p.w ?? 300, p.h ?? 200);
}, index * 70);
});
// 音声の状態を復元
if (combinedAudioElement) {
combinedAudioElement.currentTime = currentTime;
if (wasPlaying) {
combinedAudioElement.play().catch(() => {});
}
}
}
// 音量プリセット適用
function applyVolumePreset(vol) {
audioSliders.forEach(slider => {
const key = slider.dataset.audio;
if (vol && vol[key] !== undefined) {
slider.value = vol[key];
const val = parseFloat(vol[key]);
const display = slider.parentElement.querySelector('.volume-value');
if (display) display.textContent = val.toFixed(2);
const percent = val * 100;
slider.style.backgroundSize = `${percent}% 100%`;
}
});
}
function getCurrentPaneData() {
const containerRect = paneContainer.getBoundingClientRect();
return panes.map(p => {
const rect = p.element.getBoundingClientRect();
const left = (rect.left - containerRect.left) / containerRect.width * 100;
const top = (rect.top - containerRect.top) / containerRect.height * 100;
const w = rect.width / containerRect.width * 100;
const h = rect.height / containerRect.height * 100;
return {
type: p.type,
file: p.file,
x: left,
y: top,
w,
h
};
});
}
// 現在の音量を取得
function getCurrentVolumes() {
const vols = {};
audioSliders.forEach(slider => {
vols[slider.dataset.audio] = parseFloat(slider.value);
});
return vols;
}
// ---------- プリセット保存 ----------
function savePreset() {
const name = prompt('プリセット名を入力してください');
if (!name) return;
const data = {
name: name,
panes: getCurrentPaneData(),
volumes: getCurrentVolumes()
};
// 既存を置き換え or 追加
const idx = savedPresets.findIndex(p => p.name === name);
if (idx >= 0) {
savedPresets[idx] = data;
} else {
savedPresets.push(data);
}
localStorage.setItem('playerPresets', JSON.stringify(savedPresets));
renderPresets();
}
function deletePreset(name) {
savedPresets = savedPresets.filter(p => p.name !== name);
localStorage.setItem('playerPresets', JSON.stringify(savedPresets));
renderPresets();
}
function renderPresets() {
presetList.innerHTML = '';
savedPresets.forEach(p => {
const el = document.createElement('span');
el.className = 'preset-item';
el.textContent = p.name;
el.addEventListener('click', () => loadPreset(p));
const del = document.createElement('button');
del.className = 'preset-delete';
del.textContent = '×';
del.addEventListener('click', (e) => {
e.stopPropagation();
deletePreset(p.name);
});
el.appendChild(del);
presetList.appendChild(el);
});
}
async function combineAudio() {
const ffmpegVolume = parseFloat(ffmpegVolumeSlider.value);
combineButton.disabled = true;
combineStatus.textContent = "音声を合成中...";
// ★ オーバーレイ表示(処理中メッセージ)
showOverlay('音声を合成中...');
try {
const vols = {};
audioSliders.forEach(slider => {
vols[slider.dataset.audio] = parseFloat(slider.value);
});
// 各音声ファイルをデコード
const audioBufferPromises = audioFiles.map(async file => {
if (vols[file] === 0) return null;
const resp = await fetch(BASE_PATH + audioFileMap[file]);
const arrayBuffer = await resp.arrayBuffer();
return await audioContext.decodeAudioData(arrayBuffer);
});
const buffers = await Promise.all(audioBufferPromises);
const validBuffers = buffers.filter(b => b);
if (validBuffers.length === 0) {
throw new Error('有効な音声ファイルがありません');
}
const maxDuration = Math.max(...validBuffers.map(b => b.duration));
const combined = audioContext.createBuffer(2, audioContext.sampleRate * maxDuration, audioContext.sampleRate);
audioFiles.forEach((file, idx) => {
const buf = buffers[idx];
if (!buf || vols[file] === 0) return;
let vol = vols[file] * ffmpegVolume;
if (file === 'p') {
vol = vol * 2;
console.log(`🎹 ピアノ音量を2倍に調整: ${vols[file]} → ${vols[file] * 2}`);
}
for (let ch = 0; ch < 2; ch++) {
const input = buf.getChannelData(ch % buf.numberOfChannels);
const output = combined.getChannelData(ch);
for (let i = 0; i < input.length; i++) {
output[i] += input[i] * vol;
}
}
});
// WAV変換
const blob = bufferToWave(combined);
const url = URL.createObjectURL(blob);
if (combinedAudioElement) {
combinedAudioElement.pause();
URL.revokeObjectURL(combinedAudioElement.src);
}
combinedAudioElement = new Audio(url);
combinedAudioElement.preservesPitch = true;
combinedAudioElement.mozPreservesPitch = true;
combinedAudioElement.webkitPreservesPitch = true;
combinedAudioElement.playbackRate = currentPlaybackRate;
combinedAudioElement.volume = parseFloat(volumeSlider.value) * (parseFloat(globalVolumeSlider.value) / 10);
isAudioCombined = true;
videoDuration = maxDuration;
endTime = maxDuration;
endTimeInput.value = maxDuration.toFixed(2);
popupEndTime.value = maxDuration.toFixed(2);
// ★ オーバーレイ更新(動画読み込み中)
updateOverlayMessage('動画を読み込み中...');
combineStatus.textContent = "音声の合成が完了しました。動画を読み込み中です。";
const videoElements = panes.map(p => p.element.querySelector('video')).filter(v => v);
if (videoElements.length > 0) {
let loadedCount = 0;
const totalVideos = videoElements.length;
videoElements.forEach(video => {
if (video.readyState >= HTMLMediaElement.HAVE_ENOUGH_DATA) {
loadedCount++;
checkAllLoaded();
} else {
video.addEventListener('canplaythrough', function onCanPlay() {
loadedCount++;
checkAllLoaded();
video.removeEventListener('canplaythrough', onCanPlay);
});
video.addEventListener('error', function onError() {
loadedCount++;
checkAllLoaded();
video.removeEventListener('error', onError);
});
}
});
function checkAllLoaded() {
if (loadedCount >= totalVideos) {
combineStatus.textContent = "音声の合成と動画の読み込みが完了しました";
// ★ オーバーレイを非表示(完了)
updateOverlayMessage('完了');
enablePlayerControls();
} else {
// ★ 進捗表示
updateOverlayMessage(`動画読み込み中... ${loadedCount}/${totalVideos}`);
}
}
// タイムアウト: 5秒待っても読み込めない場合は強制的に有効化
setTimeout(() => {
if (loadedCount < totalVideos) {
combineStatus.textContent = "音声の合成が完了しました(一部動画は読み込み中)";
// ★ 警告メッセージだが、操作は許可
updateOverlayMessage('完了(一部動画読み込み中)');
enablePlayerControls();
}
}, 5000);
} else {
// 動画ペインがない場合は即座に有効化
enablePlayerControls();
}
// 音声の終了検知
combinedAudioElement.addEventListener('ended', function() {
if (loopEnabled) {
const st = parseFloat(startTimeInput.value) || 0;
combinedAudioElement.currentTime = st;
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid) vid.currentTime = st;
});
combinedAudioElement.play().catch(e => {});
} else {
pauseMedia();
}
});
combinedAudioElement.addEventListener('timeupdate', function() {
updateProgress();
if (isLooping) return;
const current = this.currentTime;
const start = parseFloat(startTimeInput.value) || 0;
const end = parseFloat(endTimeInput.value) || videoDuration;
if (current >= end) {
// end 超過時の処理(ループ or 停止)
isLooping = true;
if (loopEnabled) {
this.currentTime = start;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime = start;
});
} else {
this.pause();
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.pause();
});
isPlaying = false;
playPauseBtn.textContent = '▶';
}
setTimeout(() => {
isLooping = false;
}, 50);
} else if (current < start) {
// start 未満になったら強制的に start に戻す
isLooping = true;
this.currentTime = start;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime = start;
});
setTimeout(() => {
isLooping = false;
}, 50);
}
});
// ペインの動画を同期
syncAllVideos();
} catch (error) {
console.error('音声合成エラー:', error);
combineStatus.textContent = "音声の合成に失敗しました: " + error.message;
} finally {
combineButton.disabled = false;
}
}
function bufferToWave(abuffer) {
const numOfChan = abuffer.numberOfChannels;
const length = abuffer.length * numOfChan * 2 + 44;
const buffer = new ArrayBuffer(length);
const view = new DataView(buffer);
let pos = 0;
function setUint16(data) {
view.setUint16(pos, data, true);
pos += 2;
}
function setUint32(data) {
view.setUint32(pos, data, true);
pos += 4;
}
setUint32(0x46464952);
setUint32(length - 8);
setUint32(0x45564157);
setUint32(0x20746d66);
setUint32(16);
setUint16(1);
setUint16(numOfChan);
setUint32(abuffer.sampleRate);
setUint32(abuffer.sampleRate * 2 * numOfChan);
setUint16(numOfChan * 2);
setUint16(16);
setUint32(0x61746164);
setUint32(length - pos - 4);
for (let i = 0; i < abuffer.length; i++) {
for (let ch = 0; ch < numOfChan; ch++) {
let sample = abuffer.getChannelData(ch)[i] * 0x7fff;
sample = Math.max(-32768, Math.min(32767, sample));
view.setInt16(pos, sample, true);
pos += 2;
}
}
return new Blob([buffer], {
type: 'audio/wav'
});
}
function togglePlayPause() {
if (!isAudioCombined || !combinedAudioElement) return;
if (isPlaying) {
pauseMedia();
} else {
playMedia();
}
}
function playMedia() {
if (!isAudioCombined || !combinedAudioElement) return;
const et = parseFloat(endTimeInput.value) || videoDuration;
// 末尾を超えていたら先頭に戻す
if (combinedAudioElement.currentTime >= et) {
const st = parseFloat(startTimeInput.value) || 0;
combinedAudioElement.currentTime = st;
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid) vid.currentTime = st;
});
}
const currentTime = combinedAudioElement.currentTime; // ← これを使う
combinedAudioElement.play().catch(e => {});
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid) {
vid.currentTime = currentTime;
vid.play().catch(e => {});
vid.playbackRate = currentPlaybackRate;
}
if (p.type === 'musicxml' && p.contentInstance && p.contentInstance.play) {
p.contentInstance.play();
}
});
// MIDI も現在時間にシークしてから再生
if (window.MIDIPane) {
window.MIDIPane.seekAll(currentTime);
window.MIDIPane.playAll();
}
if (window.MusicXMLPane) window.MusicXMLPane.playAll();
isPlaying = true;
playPauseBtn.textContent = '⏸';
}
function pauseMedia() {
if (!isAudioCombined || !combinedAudioElement) return;
combinedAudioElement.pause();
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid) vid.pause();
// ★ MusicXML ペインの一時停止
if (p.type === 'musicxml' && p.contentInstance && p.contentInstance.pause) {
p.contentInstance.pause();
}
});
// MIDI一時停止
if (window.MIDIPane) window.MIDIPane.pauseAll();
// ★ MusicXML 全体一時停止
if (window.MusicXMLPane) window.MusicXMLPane.pauseAll();
isPlaying = false;
playPauseBtn.textContent = '▶';
}
function resetToStart() {
const st = parseFloat(startTimeInput.value) || 0;
if (combinedAudioElement) {
combinedAudioElement.currentTime = st;
}
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid) vid.currentTime = st;
// ★ MusicXML ペインのシーク
if (p.type === 'musicxml' && p.contentInstance && p.contentInstance.seekTo) {
p.contentInstance.seekTo(st);
}
});
// MIDIシーク
if (window.MIDIPane) window.MIDIPane.seekAll(st);
// ★ MusicXML 全体シーク
if (window.MusicXMLPane) window.MusicXMLPane.seekAll(st);
updateProgress();
if (!isPlaying) {
// 停止中ならそのまま
}
}
function updateProgress() {
if (!combinedAudioElement) return;
if (isDraggingMarker) return;
const current = combinedAudioElement.currentTime;
const duration = combinedAudioElement.duration || videoDuration;
const percent = duration > 0 ? (current / duration) * 100 : 0;
progressBar.style.width = percent + '%';
const mins = Math.floor(current / 60);
const secs = Math.floor(current % 60);
const ms = Math.floor((current % 1) * 100);
const dmins = Math.floor(duration / 60);
const dsecs = Math.floor(duration % 60);
timeDisplay.textContent =
`${String(mins).padStart(2,'0')}:${String(secs).padStart(2,'0')}.${String(ms).padStart(2,'0')} / ${String(dmins).padStart(2,'0')}:${String(dsecs).padStart(2,'0')}`;
// マーカー更新
const st = parseFloat(startTimeInput.value) || 0;
const et = parseFloat(endTimeInput.value) || duration;
if (duration > 0) {
startMarker.style.left = (st / duration * 100) + '%';
endMarker.style.left = (et / duration * 100) + '%';
startMarker.style.display = 'block';
endMarker.style.display = 'block';
}
}
function seekFromProgress(e) {
if (!combinedAudioElement) return;
const rect = progressContainer.getBoundingClientRect();
const pos = (e.clientX - rect.left) / rect.width;
const duration = combinedAudioElement.duration || videoDuration;
let seekTime = pos * duration;
const start = parseFloat(startTimeInput.value) || 0;
const end = parseFloat(endTimeInput.value) || duration;
if (seekTime < start) seekTime = start;
if (seekTime > end) seekTime = end;
combinedAudioElement.currentTime = seekTime;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime = seekTime;
// ★ MusicXML ペインのシーク
if (p.type === 'musicxml' && p.contentInstance && p.contentInstance.seekTo) {
p.contentInstance.seekTo(seekTime);
}
});
// MIDIシーク
if (window.MIDIPane) window.MIDIPane.seekAll(seekTime);
// ★ MusicXML 全体シーク
if (window.MusicXMLPane) window.MusicXMLPane.seekAll(seekTime);
updateProgress();
if (!isPlaying) {
playMedia();
}
}
// 音量適用
function applyVolume() {
if (!combinedAudioElement) return;
const baseVol = parseFloat(volumeSlider.value);
const globalVol = parseFloat(globalVolumeSlider.value) / 10;
const finalVol = Math.min(1, baseVol * globalVol);
combinedAudioElement.volume = finalVol;
volumeBtn.textContent = finalVol === 0 ? '🔇' : (finalVol < 0.3 ? '🔈' : '🔊');
}
let isUpdating = false;
function applyPlaybackRate(speed) {
if (isUpdating) return;
isUpdating = true;
currentPlaybackRate = speed;
if (combinedAudioElement) {
combinedAudioElement.playbackRate = speed;
}
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid) {
vid.playbackRate = speed;
vid.preservesPitch = true;
vid.mozPreservesPitch = true;
vid.webkitPreservesPitch = true;
}
// ★ MusicXML ペインの速度設定
if (p.type === 'musicxml' && p.contentInstance && p.contentInstance.setSpeed) {
p.contentInstance.setSpeed(speed);
}
});
// MIDI速度同期
if (window.MIDIPane) window.MIDIPane.setPlaybackRate(speed);
// ★ MusicXML 全体速度
if (window.MusicXMLPane) window.MusicXMLPane.setPlaybackRate(speed);
playbackSpeedSlider.value = speed;
playbackSpeedValue.textContent = speed.toFixed(2) + 'x';
popupSpeed.value = speed;
popupSpeedValue.textContent = speed.toFixed(2) + 'x';
const baseTempo = 84;
const tempo = speed * baseTempo;
tempoInput.value = (speed * 84).toFixed(1);
tempoSpeedValue.textContent = speed.toFixed(2) + 'x';
popupTempo.value = (speed * 84).toFixed(1);
popupTempoValue.textContent = speed.toFixed(2) + 'x';
isUpdating = false;
}
let lastMusicXMLSyncTime = 0;
if (combinedAudioElement) {
combinedAudioElement.addEventListener('timeupdate', function() {
const t = this.currentTime;
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid && Math.abs(vid.currentTime - t) > 0.1) {
vid.currentTime = t;
}
});
// MIDI同期(適度な間隔)
if (window.MIDIPane && Math.floor(t * 10) % 2 === 0) {
window.MIDIPane.syncAll(t);
}
// ★ MusicXML 同期(10fps に制限)
const now = Date.now();
if (now - lastMusicXMLSyncTime > 100) {
if (window.MusicXMLPane) {
window.MusicXMLPane.syncAll(t);
}
lastMusicXMLSyncTime = now;
}
});
}
// テンポ→速度変換
function applyTempo(tempo) {
const baseTempo = 84;
const speed = Math.max(0.01, Math.min(5, tempo / baseTempo));
applyPlaybackRate(speed);
}
// ---------- イベントリスナー設定 ----------
// 再生/一時停止
playPauseBtn.addEventListener('click', togglePlayPause);
// 開始位置に戻る
resetStartBtn.addEventListener('click', resetToStart);
// プログレスバー
progressContainer.addEventListener('click', seekFromProgress);
progressContainer.addEventListener('mousemove', function(e) {
if (!combinedAudioElement) return;
const rect = progressContainer.getBoundingClientRect();
const pos = (e.clientX - rect.left) / rect.width;
const duration = combinedAudioElement.duration || videoDuration;
const time = pos * duration;
const mins = Math.floor(time / 60);
const secs = Math.floor(time % 60);
progressTime.textContent = `${String(mins).padStart(2,'0')}:${String(secs).padStart(2,'0')}`;
progressTime.style.display = 'block';
progressTime.style.left = (pos * 100) + '%';
});
progressContainer.addEventListener('mouseleave', function() {
progressTime.style.display = 'none';
});
// 音量
volumeSlider.addEventListener('change', function() {
applyVolume();
});
volumeBtn.addEventListener('click', function() {
const vol = parseFloat(volumeSlider.value);
volumeSlider.value = vol > 0 ? 0 : 1;
applyVolume();
});
// 全画面時のスケールを計算して適用
function updateFullscreenScale() {}
// 全画面切り替えとリサイズでスケール更新
document.addEventListener('fullscreenchange', updateFullscreenScale);
window.addEventListener('resize', updateFullscreenScale);
// 全画面
fullscreenBtn.addEventListener('click', function() {
const container = document.querySelector('.player-wrapper');
if (!document.fullscreenElement) {
container.requestFullscreen().catch(e => {});
} else {
document.exitFullscreen().catch(e => {});
}
});
let controlsTimeout = null;
function showControls() {
const controls = document.querySelector('.player-wrapper:fullscreen .video-controls');
if (controls) {
controls.classList.remove('hidden');
clearTimeout(controlsTimeout);
controlsTimeout = setTimeout(() => {
controls.classList.add('hidden');
}, 3000);
}
}
// 全画面になったらイベントを設定、解除されたら削除
document.addEventListener('fullscreenchange', () => {
const wrapper = document.querySelector('.player-wrapper');
if (document.fullscreenElement === wrapper) {
wrapper.addEventListener('mousemove', showControls);
wrapper.addEventListener('touchstart', showControls);
wrapper.addEventListener('click', showControls);
showControls(); // 初期表示
} else {
wrapper.removeEventListener('mousemove', showControls);
wrapper.removeEventListener('touchstart', showControls);
wrapper.removeEventListener('click', showControls);
const controls = document.querySelector('.video-controls');
if (controls) controls.classList.remove('hidden');
}
});
// 設定ポップアップトグル
settingsToggleBtn.addEventListener('click', function(e) {
e.stopPropagation();
settingsPopup.classList.toggle('visible');
});
document.addEventListener('click', function(e) {
if (!settingsPopup.contains(e.target) && e.target !== settingsToggleBtn) {
settingsPopup.classList.remove('visible');
}
});
// ポップアップ内速度
popupSpeed.addEventListener('change', function() {
const speed = parseFloat(this.value);
applyPlaybackRate(speed);
});
popupTempo.addEventListener('change', function() {
const tempo = parseFloat(this.value);
if (!isNaN(tempo) && tempo > 0) {
const speed = tempo / 84;
if (speed >= 0.25 && speed <= 4.0) {
applyPlaybackRate(speed);
} else {
const clampedSpeed = Math.max(0.25, Math.min(4.0, speed));
applyPlaybackRate(clampedSpeed);
}
}
});
// ポップアップ適用
popupApplyTime.addEventListener('click', function() {
const st = parseFloat(popupStartTime.value) || 0;
const et = parseFloat(popupEndTime.value) || videoDuration;
startTimeInput.value = st;
endTimeInput.value = et;
loopCheckbox.checked = popupLoop.checked;
loopEnabled = popupLoop.checked;
// 現在位置調整
if (combinedAudioElement) {
const current = combinedAudioElement.currentTime;
if (current < st) {
combinedAudioElement.currentTime = st;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime =
st;
});
} else if (current > et) {
combinedAudioElement.currentTime = st;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime =
st;
});
}
}
updateProgress();
settingsPopup.classList.remove('visible');
});
addPaneBtn.addEventListener('click', function() {
console.log('追加ボタンがクリックされました');
const containerRect = paneContainer.getBoundingClientRect();
const maxX = Math.max(100, containerRect.width - 320);
const maxY = Math.max(100, containerRect.height - 220);
const x = 20 + Math.random() * maxX;
const y = 20 + Math.random() * maxY;
const w = 280 + Math.random() * 200;
const h = 180 + Math.random() * 150;
// ピクセル → パーセントに変換
const xPercent = (x / containerRect.width) * 100;
const yPercent = (y / containerRect.height) * 100;
const wPercent = (w / containerRect.width) * 100;
const hPercent = (h / containerRect.height) * 100;
const types = ['sing', 'sing', 'sing', 'other', 'midi', 'musicxml'];
const type = types[Math.floor(Math.random() * types.length)];
const file = type === 'sing' ? ['s', 'a', 't'][Math.floor(Math.random() * 3)] : 'p';
createPane(type, file, xPercent, yPercent, wPercent, hPercent);
});
// 右クリックメニューで追加 (簡易)
paneContainer.addEventListener('contextmenu', function(e) {
e.preventDefault();
const rect = paneContainer.getBoundingClientRect();
const x = e.clientX - rect.left - 50;
const y = e.clientY - rect.top - 50;
const type = Math.random() > 0.5 ? 'sing' : 'other';
const file = type === 'sing' ? ['s', 'a', 't'][Math.floor(Math.random() * 3)] : 'p';
createPane(type, file, Math.max(0, x), Math.max(0, y), 300, 200);
});
// 従来の設定
setStartTimeBtn.addEventListener('click', function() {
if (combinedAudioElement) {
startTimeInput.value = combinedAudioElement.currentTime.toFixed(2);
popupStartTime.value = combinedAudioElement.currentTime.toFixed(2);
updateProgress();
}
});
setEndTimeBtn.addEventListener('click', function() {
if (combinedAudioElement) {
endTimeInput.value = combinedAudioElement.currentTime.toFixed(2);
popupEndTime.value = combinedAudioElement.currentTime.toFixed(2);
updateProgress();
}
});
resetEndTimeBtn.addEventListener('click', function() {
endTimeInput.value = videoDuration.toFixed(2);
popupEndTime.value = videoDuration.toFixed(2);
updateProgress();
});
applyTimeBtn.addEventListener('click', function() {
let st = parseFloat(startTimeInput.value) || 0;
let et = parseFloat(endTimeInput.value) || videoDuration;
if (st > et) {
[st, et] = [et, st];
startTimeInput.value = st;
endTimeInput.value = et;
}
loopEnabled = loopCheckbox.checked;
popupLoop.checked = loopEnabled;
popupStartTime.value = st;
popupEndTime.value = et;
if (combinedAudioElement) {
const current = combinedAudioElement.currentTime;
if (current < st) {
combinedAudioElement.currentTime = st;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime =
st;
});
} else if (current > et) {
combinedAudioElement.currentTime = st;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime =
st;
});
}
}
updateProgress();
});
loopCheckbox.addEventListener('change', function() {
loopEnabled = this.checked;
popupLoop.checked = this.checked;
});
// 全体音量
globalVolumeSlider.addEventListener('change', function() {
const val = parseFloat(this.value);
globalVolumeValue.textContent = (val / 10).toFixed(1);
applyVolume();
});
// 再生速度(従来)
playbackSpeedSlider.addEventListener('change', function() {
const speed = parseFloat(this.value);
applyPlaybackRate(speed);
});
tempoInput.addEventListener('change', function() {
if (isUpdating) return;
const tempo = parseFloat(this.value);
if (!isNaN(tempo) && tempo > 0) {
const speed = tempo / 84;
// ブラウザのサポート範囲内かチェック
if (speed >= 0.25 && speed <= 4.0) {
applyPlaybackRate(speed);
} else {
// 範囲外の場合は警告を表示
console.warn(`速度 ${speed.toFixed(4)} はサポート範囲外です (0.25~4.0)`);
// 範囲内に補正
const clampedSpeed = Math.max(0.25, Math.min(4.0, speed));
applyPlaybackRate(clampedSpeed);
}
}
});
// 音声合成ボタン
combineButton.addEventListener('click', combineAudio);
// プリセット選択
presetSelect.addEventListener('change', function() {
const val = this.value;
if (val === 'custom') return;
const vols = PRESET_VOLUMES[val];
if (vols) {
applyVolumePreset(vols);
}
});
// プリセット保存/レンダリング
savePresetBtn.addEventListener('click', savePreset);
renderPresets();
// ロックボタン
lockControlsBtn.addEventListener('click', function() {
// 簡易
});
// ペインクリックで最前面
paneContainer.addEventListener('click', function(e) {
const pane = e.target.closest('.pane');
if (pane) {
panes.forEach(p => {
p.element.style.zIndex = 1;
});
pane.style.zIndex = 10;
}
});
// デフォルトプリセットをロード
loadPreset(savedPresets[0] || defaultPresets[0]);
const markerContainer = document.getElementById('time-markers-container');
timeMarkers.forEach(m => {
const el = document.createElement('div');
el.className = 'time-marker';
el.innerHTML = `<b>${m.label}</b>(${m.time}秒)`;
el.dataset.time = m.time;
el.draggable = true;
el.addEventListener('dragstart', function(e) {
e.dataTransfer.setData('text/plain', m.time);
});
el.addEventListener('click', function() {
startTimeInput.value = m.time;
popupStartTime.value = m.time;
updateProgress();
});
markerContainer.appendChild(el);
});
// ドロップターゲット
[startTimeInput, endTimeInput, popupStartTime, popupEndTime].forEach(input => {
input.addEventListener('dragover', e => e.preventDefault());
input.addEventListener('drop', function(e) {
e.preventDefault();
const time = parseFloat(e.dataTransfer.getData('text/plain'));
if (!isNaN(time)) {
this.value = time;
updateProgress();
}
});
});
// 音声スライダー更新
audioSliders.forEach(slider => {
slider.addEventListener('change', function() {
const val = parseFloat(this.value);
const display = this.parentElement.querySelector('.volume-value');
if (display) display.textContent = val.toFixed(2);
const percent = val * 100;
this.style.backgroundSize = `${percent}% 100%`;
});
});
ffmpegVolumeSlider.addEventListener('change', function() {
const val = parseFloat(this.value);
ffmpegVolumeValue.textContent = val.toFixed(2);
const percent = (val / 10) * 100;
this.style.backgroundSize = `${percent}% 100%`;
});
// 初期化
disablePlayerControls();
// 全画面終了時の処理
document.addEventListener('fullscreenchange', function() {
//
});
// timeupdate 更新ループ (UI用)
setInterval(() => {
if (combinedAudioElement && !isDragging) {
updateProgress();
}
}, 100);
if (combinedAudioElement) {
combinedAudioElement.addEventListener('timeupdate', function() {
const t = this.currentTime;
panes.forEach(p => {
const vid = p.element.querySelector('video');
if (vid && Math.abs(vid.currentTime - t) > 0.1) {
vid.currentTime = t;
}
});
// MIDI同期(ただし頻繁すぎるので適度に)
if (window.MIDIPane && Math.floor(t * 10) % 2 === 0) {
window.MIDIPane.syncAll(t);
}
});
}
function initMarkerDrag() {
const startMarker = document.getElementById('start-marker');
const endMarker = document.getElementById('end-marker');
function onMarkerMouseDown(e, type) {
e.preventDefault();
e.stopPropagation();
isDraggingMarker = true;
draggingMarker = type;
const onMove = (ev) => {
const rect = progressContainer.getBoundingClientRect();
let percent = (ev.clientX - rect.left) / rect.width;
percent = Math.max(0, Math.min(1, percent));
const duration = combinedAudioElement ? combinedAudioElement.duration : videoDuration;
if (!duration) return;
const time = percent * duration;
// マーカー位置を更新(表示のみ)
const marker = type === 'start' ? startMarker : endMarker;
marker.style.left = (percent * 100) + '%';
// 入力フィールドにも反映(後で確定)
};
const onUp = () => {
document.removeEventListener('mousemove', onMove);
document.removeEventListener('mouseup', onUp);
const marker = type === 'start' ? startMarker : endMarker;
const percent = parseFloat(marker.style.left) / 100;
const duration = combinedAudioElement ? combinedAudioElement.duration : videoDuration;
let time = percent * duration;
// --- 範囲補正 ---
let start = parseFloat(startTimeInput.value) || 0;
let end = parseFloat(endTimeInput.value) || videoDuration;
if (type === 'start') {
// start を end より大きくならないように制限
if (time > end) time = end;
startTimeInput.value = time.toFixed(2);
popupStartTime.value = time.toFixed(2);
} else {
// end を start より小さくならないように制限
if (time < start) time = start;
endTimeInput.value = time.toFixed(2);
popupEndTime.value = time.toFixed(2);
}
// --- 現在時刻が新しい範囲外なら補正 ---
if (combinedAudioElement) {
let cur = combinedAudioElement.currentTime;
if (cur < parseFloat(startTimeInput.value)) {
cur = parseFloat(startTimeInput.value);
} else if (cur > parseFloat(endTimeInput.value)) {
cur = parseFloat(endTimeInput.value);
}
combinedAudioElement.currentTime = cur;
panes.forEach(p => {
const v = p.element.querySelector('video');
if (v) v.currentTime = cur;
});
}
draggingMarker = null;
isDraggingMarker = false;
updateProgress();
};
document.addEventListener('mousemove', onMove);
document.addEventListener('mouseup', onUp);
}
startMarker.addEventListener('mousedown', (e) => onMarkerMouseDown(e, 'start'));
endMarker.addEventListener('mousedown', (e) => onMarkerMouseDown(e, 'end'));
}
function waitForScripts() {
return new Promise((resolve) => {
// 必要なスクリプトのリスト
const requiredScripts = [
'Draggabilly', // ドラッグ可能にするライブラリ
'MIDIPane', // MIDI表示
'MusicXMLPane' // 楽譜表示
];
let allLoaded = false;
function checkScripts() {
const loaded = requiredScripts.every(name => {
if (name === 'Draggabilly') {
return typeof Draggabilly === 'function';
} else if (name === 'MIDIPane') {
return window.MIDIPane && typeof window.MIDIPane.create === 'function';
} else if (name === 'MusicXMLPane') {
return window.MusicXMLPane && typeof window.MusicXMLPane.create === 'function';
}
return false;
});
if (loaded) {
allLoaded = true;
resolve();
} else {
// まだ読み込まれていない場合は再チェック
setTimeout(checkScripts, 100);
}
}
// まず一度チェック
checkScripts();
// タイムアウト(10秒で強制終了)
setTimeout(() => {
if (!allLoaded) {
console.warn('⚠️ スクリプト読み込みタイムアウト、強制続行');
resolve();
}
}, 10000);
});
}
async function initializePlayer() {
// 既に初期化済みなら二重実行しない
if (isInitialized) {
console.log('⚠️ 既に初期化済みです');
return;
}
console.log('🚀 プレイヤー初期化開始...');
createOverlay();
showOverlay('音声を合成してください');
// ローディングオーバーレイを表示(初期状態)
const loadingOverlay = document.getElementById('loadingOverlay');
const loadingProgress = document.getElementById('loading-progress');
if (loadingOverlay) {
loadingOverlay.style.display = 'flex';
loadingOverlay.style.opacity = '1';
}
// 進捗表示の更新関数
function updateLoadingStatus(message) {
if (loadingProgress) {
loadingProgress.textContent = message;
}
console.log(`📊 ${message}`);
}
try {
// 1. 必要なJSスクリプトが読み込まれるのを待機
updateLoadingStatus('スクリプトを読み込み中...');
await waitForScripts();
updateLoadingStatus('スクリプト読み込み完了 ✅');
// 2. 動画をプリロード
updateLoadingStatus('動画ファイルをプリロード中...');
await preloadVideos();
updateLoadingStatus(`動画プリロード完了 ✅ (${Object.keys(videoBlobCache).length}ファイル)`);
} catch (e) {
console.error('プリロード中にエラー:', e);
updateLoadingStatus('⚠️ 読み込みエラーが発生しました');
}
try {
/* // 3. 保存されたプリセットを読み込み
updateLoadingStatus('プリセットを読み込み中...');
console.log('📂 プリセットをロード...');
const saved = JSON.parse(localStorage.getItem('playerPresets') || '[]');
let presetToLoad;
if (saved.length > 0) {
presetToLoad = saved[0];
} else {
presetToLoad = defaultPresets[0];
}
// プリセット読み込み(同期的に実行)
if (presetToLoad && presetToLoad.panes) {
presetToLoad.panes.forEach((p, index) => {
createPane(p.type, p.file || 's', p.x ?? (50 + index * 30), p.y ?? (50 + index * 20), p.w ?? 300, p.h ?? 200);
});
// 音量プリセット適用
if (presetToLoad.volumes) {
applyVolumePreset(presetToLoad.volumes);
}
}*/
// 音声合成状態をリセット
isAudioCombined = false;
combinedAudioElement = null;
disablePlayerControls();
updateLoadingStatus('プリセット読み込み完了 ✅');
console.log('✅ プリセット読み込み完了');
} catch (e) {
console.error('プリセット読み込み中にエラー:', e);
updateLoadingStatus('⚠️ プリセット読み込みエラー');
// フォールバック:デフォルトプリセットを直接ロード
if (defaultPresets[0] && defaultPresets[0].panes) {
defaultPresets[0].panes.forEach((p, index) => {
createPane(p.type, p.file || 's', p.x ?? (50 + index * 30), p.y ?? (50 + index * 20), p.w ?? 300, p.h ?? 200);
});
}
}
// 4. すべての準備が完了したらローディングオーバーレイを非表示
updateLoadingStatus('準備完了!');
if (loadingOverlay) {
// 少し待ってからフェードアウト(ユーザーに完了を認識させる)
await new Promise(resolve => setTimeout(resolve, 500));
loadingOverlay.style.transition = 'opacity 0.8s ease-out';
loadingOverlay.style.opacity = '0';
setTimeout(() => {
loadingOverlay.style.display = 'none';
}, 800);
}
// 5. 初期化完了フラグを設定
isInitialized = true;
console.log('✅ プレイヤー初期化完了');
}
setTimeout(() => {
const loadingOverlay = document.getElementById('loadingOverlay');
if (loadingOverlay && loadingOverlay.style.display !== 'none') {
console.warn('⚠️ 強制タイムアウト: ローディング画面を強制終了');
loadingOverlay.style.transition = 'opacity 0.5s';
loadingOverlay.style.opacity = '0';
setTimeout(() => {
loadingOverlay.style.display = 'none';
}, 500);
}
}, 15000);
// DOMContentLoaded の最後に追加
initializePlayer().catch(console.error);
initMarkerDrag();
// ========== キーボードショートカット ==========
// ----- シーク用のヘルパー関数(読み込み完了を待機) -----
async function seekToWithLoading(time, showNotification = true) {
if (!combinedAudioElement) return;
const duration = combinedAudioElement.duration || videoDuration;
const start = parseFloat(startTimeInput.value) || 0;
const end = parseFloat(endTimeInput.value) || duration;
// 範囲制限
const clampedTime = Math.max(start, Math.min(end, time));
// 既に同じ時間なら何もしない
if (Math.abs(combinedAudioElement.currentTime - clampedTime) < 0.01) return;
// マスター音声をシーク
combinedAudioElement.currentTime = clampedTime;
// ---- ここから最適化: ずれているペインだけを個別シーク ----
const syncPromises = [];
const desyncedPanes = [];
// 1. 動画ペインのチェック
panes.forEach(p => {
if (p.type === 'sing' || p.type === 'other') {
const video = p.element.querySelector('video');
if (video) {
const diff = Math.abs(video.currentTime - clampedTime);
if (diff > 0.1) {
desyncedPanes.push({
pane: p,
element: video,
type: 'video',
diff: diff
});
}
}
}
});
// 2. MusicXMLペインのチェック
panes.forEach(p => {
if (p.type === 'musicxml' && p.contentInstance) {
const current = p.contentInstance.currentTime;
if (current !== undefined && Math.abs(current - clampedTime) > 0.1) {
desyncedPanes.push({
pane: p,
element: p.contentInstance,
type: 'musicxml',
diff: Math.abs(current - clampedTime)
});
}
}
});
// 3. MIDIペインのチェック
panes.forEach(p => {
if (p.type === 'midi' && p.contentInstance) {
let current = null;
if (typeof p.contentInstance.getCurrentTime === 'function') {
current = p.contentInstance.getCurrentTime();
}
if (current !== null && Math.abs(current - clampedTime) > 0.1) {
desyncedPanes.push({
pane: p,
element: p.contentInstance,
type: 'midi',
diff: Math.abs(current - clampedTime)
});
}
}
});
// ずれているペインがあれば個別にシーク
if (desyncedPanes.length > 0) {
console.log(`🎯 シーク: ${desyncedPanes.length}個のペインがずれています (しきい値: 0.1秒)`);
desyncedPanes.forEach(({
pane,
element,
type,
diff
}) => {
console.log(` → ペイン${pane.id}(${type}): ずれ ${diff.toFixed(3)}秒を修正`);
if (type === 'video') {
// 動画のシーク
element.currentTime = clampedTime;
// 読み込みが完了していない場合は待機
if (element.readyState < HTMLMediaElement.HAVE_ENOUGH_DATA) {
const promise = new Promise((resolve) => {
let resolved = false;
const onReady = () => {
if (!resolved) {
resolved = true;
resolve();
}
};
element.addEventListener('canplaythrough', onReady, {
once: true
});
element.addEventListener('loadeddata', onReady, {
once: true
});
element.addEventListener('error', () => {
if (!resolved) {
resolved = true;
resolve();
}
}, {
once: true
});
setTimeout(() => {
if (!resolved) {
resolved = true;
resolve();
}
}, 300);
});
syncPromises.push(promise);
}
} else if (type === 'musicxml' && typeof element.seekTo === 'function') {
// MusicXMLのシーク
element.seekTo(clampedTime);
} else if (type === 'midi' && typeof element.seekTo === 'function') {
// MIDIのシーク
element.seekTo(clampedTime);
}
});
// すべてのシーク完了を待機(動画の読み込み待ち)
if (syncPromises.length > 0) {
await Promise.all(syncPromises);
}
console.log(`✅ ${desyncedPanes.length}個のペインを個別シーク完了`);
} else {
// ずれているペインがない場合は、一括シーク(従来通り)
console.log('✅ ずれているペインはありません(一括シークはスキップ)');
}
// ---- MIDI/MusicXML全体シーク(念のため) ----
// 全体シークは必要な場合のみ実行(ずれが大きい場合のフォールバック)
// 通常は個別シークで対応済みなので、ここでは軽く調整
if (window.MIDIPane && typeof window.MIDIPane.seekAll === 'function') {
// MIDI全体のシークは、個別シークで対応しているので、ずれが大きい場合のみ
const midiPanes = panes.filter(p => p.type === 'midi');
let needGlobalSeek = false;
midiPanes.forEach(p => {
if (p.contentInstance) {
const current = typeof p.contentInstance.getCurrentTime === 'function' ?
p.contentInstance.getCurrentTime() :
null;
if (current !== null && Math.abs(current - clampedTime) > 0.1) {
needGlobalSeek = true;
}
}
});
if (needGlobalSeek) {
window.MIDIPane.seekAll(clampedTime);
}
}
if (window.MusicXMLPane && typeof window.MusicXMLPane.seekAll === 'function') {
const xmlPanes = panes.filter(p => p.type === 'musicxml');
let needGlobalSeek = false;
xmlPanes.forEach(p => {
if (p.contentInstance) {
const current = p.contentInstance.currentTime;
if (current !== undefined && Math.abs(current - clampedTime) > 0.1) {
needGlobalSeek = true;
}
}
});
if (needGlobalSeek) {
window.MusicXMLPane.seekAll(clampedTime);
}
}
// ペインごとのMusicXMLも念のため調整(個別シークで対応済みだが、安全のため)
panes.forEach(p => {
if (p.type === 'musicxml' && p.contentInstance && typeof p.contentInstance.seekTo === 'function') {
const current = p.contentInstance.currentTime;
if (current !== undefined && Math.abs(current - clampedTime) > 0.1) {
p.contentInstance.seekTo(clampedTime);
}
}
});
// 通知表示(必要な場合)
if (showNotification) {
showSeekNotification(null, clampedTime);
}
updateProgress();
}
// ----- シーク用ヘルパー(相対移動) -----
async function seekRelative(amount) {
if (!combinedAudioElement) return;
const duration = combinedAudioElement.duration || videoDuration;
const start = parseFloat(startTimeInput.value) || 0;
const end = parseFloat(endTimeInput.value) || duration;
let newTime = combinedAudioElement.currentTime + amount;
newTime = Math.max(start, Math.min(end, newTime));
await seekToWithLoading(newTime, true);
// 移動量を表示するために別途通知
showSeekNotification(amount, newTime);
}
// ----- キーボードイベントリスナー -----
document.addEventListener('keydown', function(event) {
// テキスト入力中は無効化
const target = event.target;
if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.tagName === 'SELECT') {
return;
}
if (target.closest('details')) {
return;
}
const key = event.key;
const ctrl = event.ctrlKey || event.metaKey;
const shift = event.shiftKey;
// シーク中フラグ(連続実行防止)
if (window._isSeeking) {
event.preventDefault();
return;
}
// ----- 再生・停止の切り替え (k, Space) -----
if (key === 'k' || key === ' ') {
event.preventDefault();
togglePlayPause();
return;
}
// ----- 左右キー / j / l: 5秒移動 (長押し対応) -----
const SEEK_STEP = 5;
let seekAmount = 0;
let seekDirection = null;
if (key === 'ArrowRight' || key === 'l' || key === 'L') {
seekDirection = 'forward';
} else if (key === 'ArrowLeft' || key === 'j' || key === 'J') {
seekDirection = 'backward';
}
if (seekDirection) {
event.preventDefault();
if (!combinedAudioElement) return;
// 長押し検出
if (!event.repeat) {
seekAmount = SEEK_STEP;
} else {
seekAmount = SEEK_STEP * 2;
}
if (seekDirection === 'backward') {
seekAmount = -seekAmount;
}
window._isSeeking = true;
seekRelative(seekAmount).finally(() => {
window._isSeeking = false;
});
return;
}
// ----- 0~9キー: 10分割移動 -----
if (key >= '0' && key <= '9') {
event.preventDefault();
if (!combinedAudioElement) return;
const duration = combinedAudioElement.duration || videoDuration;
const start = parseFloat(startTimeInput.value) || 0;
const end = parseFloat(endTimeInput.value) || duration;
const range = end - start;
const num = parseInt(key);
let newTime;
if (num === 0) {
newTime = start;
} else if (num === 9) {
newTime = end;
} else {
newTime = start + (range * (num / 10));
}
window._isSeeking = true;
seekToWithLoading(newTime, true).finally(() => {
window._isSeeking = false;
});
return;
}
// ----- fキー: フルスクリーン -----
if (key === 'f' || key === 'F') {
event.preventDefault();
const container = document.querySelector('.player-wrapper');
if (!document.fullscreenElement) {
container.requestFullscreen().catch(e => {});
} else {
document.exitFullscreen().catch(e => {});
}
return;
}
// ----- 上下キー: 音量調整 -----
if (key === 'ArrowUp') {
event.preventDefault();
let vol = parseFloat(volumeSlider.value) + 0.1;
vol = Math.min(1, Math.max(0, vol));
volumeSlider.value = vol;
applyVolume();
showVolumeNotification(vol, vol === 0);
return;
}
if (key === 'ArrowDown') {
event.preventDefault();
let vol = parseFloat(volumeSlider.value) - 0.1;
vol = Math.min(1, Math.max(0, vol));
volumeSlider.value = vol;
applyVolume();
showVolumeNotification(vol, vol === 0);
return;
}
// ----- mキー: ミュート -----
if (key === 'm' || key === 'M') {
event.preventDefault();
const vol = parseFloat(volumeSlider.value);
if (vol > 0) {
volumeSlider.dataset.previousVol = vol;
volumeSlider.value = 0;
applyVolume();
showVolumeNotification(0, true);
} else {
const prev = parseFloat(volumeSlider.dataset.previousVol) || 0.5;
volumeSlider.value = Math.min(1, prev);
applyVolume();
showVolumeNotification(parseFloat(volumeSlider.value), false);
}
return;
}
// ----- 速度調整 (,. <>) -----
if (key === ',' || key === '<') {
event.preventDefault();
let speed = parseFloat(playbackSpeedSlider.value) - 0.1;
speed = Math.max(0.01, Math.min(5, speed));
applyPlaybackRate(speed);
showSpeedNotification(speed);
return;
}
if (key === '.' || key === '>') {
event.preventDefault();
let speed = parseFloat(playbackSpeedSlider.value) + 0.1;
speed = Math.max(0.01, Math.min(5, speed));
applyPlaybackRate(speed);
showSpeedNotification(speed);
return;
}
});
// ----- 通知表示用関数(変更なし) -----
function showSeekNotification(amount, time) {
const oldNotify = document.querySelector('.seek-notification');
if (oldNotify) oldNotify.remove();
const notif = document.createElement('div');
notif.className = 'seek-notification';
const mins = Math.floor(time / 60);
const secs = Math.floor(time % 60);
const ms = Math.floor((time % 1) * 100);
let text = `${String(mins).padStart(2,'0')}:${String(secs).padStart(2,'0')}.${String(ms).padStart(2,'0')}`;
if (amount !== null) {
const sign = amount > 0 ? '+' : '';
text = `${sign}${amount.toFixed(1)}s → ${text}`;
}
notif.textContent = text;
notif.style.cssText = `
position: fixed;
bottom: 80px;
left: 50%;
transform: translateX(-50%);
background: rgba(0,0,0,0.85);
color: #64ffda;
padding: 8px 20px;
border-radius: 8px;
font-size: 20px;
font-family: monospace;
z-index: 9999;
pointer-events: none;
opacity: 0;
transition: opacity 0.15s ease;
border: 1px solid rgba(100,255,218,0.3);
user-select: none;
`;
document.body.appendChild(notif);
requestAnimationFrame(() => {
notif.style.opacity = '1';
});
setTimeout(() => {
notif.style.opacity = '0';
setTimeout(() => notif.remove(), 300);
}, 1200);
}
function showVolumeNotification(vol, isMuted) {
const oldNotify = document.querySelector('.volume-notification');
if (oldNotify) oldNotify.remove();
const notif = document.createElement('div');
notif.className = 'volume-notification';
const icon = isMuted ? '🔇' : (vol === 0 ? '🔇' : (vol < 0.3 ? '🔈' : (vol < 0.7 ? '🔉' : '🔊')));
notif.textContent = `${icon} ${Math.round(vol * 100)}%`;
notif.style.cssText = `
position: fixed;
bottom: 130px;
left: 50%;
transform: translateX(-50%);
background: rgba(0,0,0,0.85);
color: #e6f1ff;
padding: 6px 16px;
border-radius: 8px;
font-size: 18px;
font-family: sans-serif;
z-index: 9999;
pointer-events: none;
opacity: 0;
transition: opacity 0.15s ease;
border: 1px solid rgba(100,255,218,0.2);
user-select: none;
`;
document.body.appendChild(notif);
requestAnimationFrame(() => {
notif.style.opacity = '1';
});
setTimeout(() => {
notif.style.opacity = '0';
setTimeout(() => notif.remove(), 300);
}, 1000);
}
function showSpeedNotification(speed) {
const oldNotify = document.querySelector('.speed-notification');
if (oldNotify) oldNotify.remove();
const notif = document.createElement('div');
notif.className = 'speed-notification';
notif.textContent = `⏱ ${speed.toFixed(2)}x`;
notif.style.cssText = `
position: fixed;
bottom: 180px;
left: 50%;
transform: translateX(-50%);
background: rgba(0,0,0,0.85);
color: #97c2f0;
padding: 6px 16px;
border-radius: 8px;
font-size: 18px;
font-family: sans-serif;
z-index: 9999;
pointer-events: none;
opacity: 0;
transition: opacity 0.15s ease;
border: 1px solid rgba(100,255,218,0.2);
user-select: none;
`;
document.body.appendChild(notif);
requestAnimationFrame(() => {
notif.style.opacity = '1';
});
setTimeout(() => {
notif.style.opacity = '0';
setTimeout(() => notif.remove(), 300);
}, 1000);
}
// 個別のペインをシークする関数
function syncSinglePane(paneInfo, seekTime) {
return new Promise((resolve) => {
if (!paneInfo || seekTime === undefined) {
resolve();
return;
}
let element = null;
let needsWait = false;
// ペインの種類に応じて対象要素を取得
if (paneInfo.type === 'sing' || paneInfo.type === 'other') {
element = paneInfo.element.querySelector('video');
if (element) {
element.currentTime = seekTime;
if (element.readyState < HTMLMediaElement.HAVE_ENOUGH_DATA) {
needsWait = true;
const onReady = () => {
element.removeEventListener('canplaythrough', onReady);
element.removeEventListener('loadeddata', onReady);
resolve();
};
element.addEventListener('canplaythrough', onReady, {
once: true
});
element.addEventListener('loadeddata', onReady, {
once: true
});
setTimeout(resolve, 500);
}
}
} else if (paneInfo.type === 'musicxml' && paneInfo.contentInstance) {
if (typeof paneInfo.contentInstance.seekTo === 'function') {
paneInfo.contentInstance.seekTo(seekTime);
}
} else if (paneInfo.type === 'midi' && paneInfo.contentInstance) {
if (typeof paneInfo.contentInstance.seekTo === 'function') {
paneInfo.contentInstance.seekTo(seekTime);
}
}
if (!needsWait) {
resolve();
}
});
}
// ずれているペインだけを同期する関数(新規追加)
async function syncOnlyDesyncedPanes(masterTime, threshold = 0.12) {
const desyncedPanes = [];
const syncPromises = [];
// ずれているペインを検出
panes.forEach(p => {
let currentTime = null;
if (p.type === 'sing' || p.type === 'other') {
const video = p.element.querySelector('video');
if (video) currentTime = video.currentTime;
} else if (p.type === 'musicxml' && p.contentInstance) {
currentTime = p.contentInstance.currentTime;
} else if (p.type === 'midi' && p.contentInstance) {
if (typeof p.contentInstance.getCurrentTime === 'function') {
currentTime = p.contentInstance.getCurrentTime();
}
}
if (currentTime !== null && !isNaN(currentTime)) {
const diff = Math.abs(currentTime - masterTime);
if (diff > threshold) {
desyncedPanes.push({
pane: p,
currentTime: currentTime,
diff: diff
});
}
}
});
// ずれているペインがあれば個別にシーク
if (desyncedPanes.length > 0) {
console.log(`🔄 ${desyncedPanes.length}個のペインがずれています。個別にシークします。`);
desyncedPanes.forEach(({
pane,
currentTime,
diff
}) => {
console.log(` ペイン${pane.id}(${pane.type}): ${currentTime.toFixed(3)} (ずれ ${diff.toFixed(3)}) → シーク`);
syncPromises.push(syncSinglePane(pane, masterTime));
});
// すべてのシーク完了を待機
await Promise.all(syncPromises);
console.log(`✅ ${desyncedPanes.length}個のペインをシーク完了`);
} else {
console.log('✅ ずれているペインはありません');
}
return desyncedPanes.length;
}
// ========== ずれ監視ループ(修正版) ==========
let isSyncing = false;
setInterval(async () => {
if (!combinedAudioElement || !isPlaying || isSyncing) return;
const masterTime = combinedAudioElement.currentTime;
if (masterTime === 0) return;
// ずれをチェック
let maxDiff = 0;
const diffs = [];
panes.forEach(p => {
let currentTime = null;
if (p.type === 'sing' || p.type === 'other') {
const video = p.element.querySelector('video');
if (video) currentTime = video.currentTime;
} else if (p.type === 'musicxml' && p.contentInstance) {
currentTime = p.contentInstance.currentTime;
} else if (p.type === 'midi' && p.contentInstance && typeof p.contentInstance.getCurrentTime === 'function') {
currentTime = p.contentInstance.getCurrentTime();
}
if (currentTime !== null && !isNaN(currentTime)) {
const diff = Math.abs(currentTime - masterTime);
diffs.push({
id: p.id,
type: p.type,
diff,
currentTime
});
if (diff > maxDiff) maxDiff = diff;
}
});
// ずれが大きい場合のみ処理
if (maxDiff > 0.12 && !isSyncing) {
isSyncing = true;
console.log('⚠️ ずれが大きいため再シークします');
// ★ 修正: ずれているペインだけを個別にシーク
await syncOnlyDesyncedPanes(masterTime, 0.12);
// 再生状態を維持
if (isPlaying) {
// 音声は既に再生中なので、ペインの再生を再開
panes.forEach(p => {
const video = p.element.querySelector('video');
if (video && video.paused) {
video.play().catch(() => {});
}
if (p.type === 'musicxml' && p.contentInstance && typeof p.contentInstance.play === 'function') {
p.contentInstance.play();
}
});
if (window.MIDIPane && typeof window.MIDIPane.playAll === 'function') {
window.MIDIPane.playAll();
}
if (window.MusicXMLPane && typeof window.MusicXMLPane.playAll === 'function') {
window.MusicXMLPane.playAll();
}
}
isSyncing = false;
}
}, 4000);
// ---- オーバーレイ関連関数(先に定義) ----
function createOverlay() {
// 既存のオーバーレイを削除
if (overlayElement) {
overlayElement.remove();
overlayElement = null;
}
// プレイヤーラッパーを取得
const wrapper = document.querySelector('.player-wrapper');
if (!wrapper) return;
// 既存のオーバーレイをチェック
const existingOverlay = wrapper.querySelector('.player-overlay');
if (existingOverlay) {
overlayElement = existingOverlay;
return;
}
// オーバーレイを作成
overlayElement = document.createElement('div');
overlayElement.className = 'player-overlay active';
overlayElement.id = 'player-overlay';
overlayElement.innerHTML = `
<div class="overlay-message">
<h2>音声を合成してください</h2>
<p>「音声を合成」ボタンを押してください</p>
<div class="spinner-text">
<div class="loader-small"></div>
<span style="color:#97c2f0;font-size:14px;">...</span>
</div>
</div>
`;
// ラッパーに追加(video-controlsの前に配置)
const videoControls = wrapper.querySelector('.video-controls');
if (videoControls) {
wrapper.insertBefore(overlayElement, videoControls);
} else {
wrapper.appendChild(overlayElement);
}
}
function updateOverlayMessage(status, isError = false) {
if (!overlayElement) {
createOverlay();
}
if (!overlayElement) return;
const messageDiv = overlayElement.querySelector('.overlay-message');
if (!messageDiv) return;
let html = '';
if (isError) {
html = `
<h2 style="color:#ff6b6b;">⚠️ エラーが発生しました</h2>
<p>${status}</p>
<p style="font-size:14px;margin-top:10px;color:#97c2f0;">もう一度「音声を合成」を押してください</p>
`;
} else if (status.includes('完了') || status.includes('完了(一部動画読み込み中)')) {
// 完了時はオーバーレイを非表示にする
hideOverlay();
return;
} else {
html = `
<h2>${status}</h2>
<div class="spinner-text">
<div class="loader-small"></div>
</div>
`;
}
messageDiv.innerHTML = html;
overlayElement.classList.add('active');
overlayElement.style.display = 'flex';
overlayElement.style.opacity = '1';
}
function hideOverlay() {
if (overlayElement) {
overlayElement.classList.remove('active');
overlayElement.style.opacity = '0';
setTimeout(() => {
if (overlayElement) {
overlayElement.style.display = 'none';
}
}, 500);
}
}
function showOverlay(message) {
if (!overlayElement) {
createOverlay();
}
if (!overlayElement) return;
overlayElement.style.display = 'flex';
overlayElement.style.opacity = '1';
overlayElement.classList.add('active');
const messageDiv = overlayElement.querySelector('.overlay-message');
if (messageDiv) {
messageDiv.innerHTML = `
<h2>${message}</h2>
<div class="spinner-text">
<div class="loader-small"></div>
</div>
`;
}
}
function enablePlayerControls() {
playPauseBtn.disabled = false;
resetStartBtn.disabled = false;
volumeBtn.disabled = false;
volumeSlider.disabled = false;
fullscreenBtn.disabled = false;
settingsToggleBtn.disabled = false;
addPaneBtn.disabled = false;
startTimeInput.disabled = false;
endTimeInput.disabled = false;
resetEndTimeBtn.disabled = false;
loopCheckbox.disabled = false;
globalVolumeSlider.disabled = false;
setStartTimeBtn.disabled = false;
setEndTimeBtn.disabled = false;
playbackSpeedSlider.disabled = false;
applyTimeBtn.disabled = false;
// ★ オーバーレイを非表示
hideOverlay();
}
function disablePlayerControls() {
playPauseBtn.disabled = true;
resetStartBtn.disabled = true;
volumeBtn.disabled = true;
volumeSlider.disabled = true;
fullscreenBtn.disabled = true;
settingsToggleBtn.disabled = true;
addPaneBtn.disabled = true;
startTimeInput.disabled = true;
endTimeInput.disabled = true;
resetEndTimeBtn.disabled = true;
loopCheckbox.disabled = true;
globalVolumeSlider.disabled = true;
setStartTimeBtn.disabled = true;
setEndTimeBtn.disabled = true;
playbackSpeedSlider.disabled = true;
applyTimeBtn.disabled = true;
// ★ オーバーレイを表示(初期メッセージ)
showOverlay('音声を合成してください');
}
});
</script>
</body>
</html> |