summaryrefslogtreecommitdiff
path: root/Library/Artifacts/33/333da893aa1d8bfd17e4ef1fd2826444
blob: 8f96064ad7a31630e2459c802a91bdc5900f6904 (plain)
ofshex dumpascii
0000 00 00 0f 81 00 01 20 b8 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe ....................2019.3.6f1..
0020 ff ff ff 01 02 00 00 00 0b 04 00 00 00 ff ff 66 9a 86 21 eb 14 35 98 39 dd 34 1d 51 0e c1 f3 42 ...............f..!..5.9.4.Q...B
0040 00 00 00 ed 00 00 00 02 00 00 00 00 00 00 00 37 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 ...............7................
0060 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 ................................
0080 00 00 00 00 00 00 00 01 00 01 00 0d 00 00 00 45 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 ...............E................
00a0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 ...............#................
00c0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 ...............,................
00e0 00 00 00 00 00 00 00 01 00 01 00 35 00 00 00 61 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 ...........5...a................
0100 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 ...............#................
0120 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 ...............,................
0140 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 ...............r................
0160 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 ...............#................
0180 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 ...............,................
01a0 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 ...........H....................
01c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 ...........1...1............@...
01e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 ................................
0200 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 ...........Q...j................
0220 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 4a 00 00 00 ff ff ff ff 0f 00 00 00 00 c0 00 00 00 ...............J................
0240 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 10 00 00 00 00 80 00 00 00 ...........1...1................
0260 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 11 00 00 00 00 00 00 00 00 ................................
0280 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 12 00 00 00 00 80 00 00 00 ...............j................
02a0 00 00 00 00 00 00 00 01 00 04 00 5c 00 00 00 9b 00 00 80 ff ff ff ff 13 00 00 00 00 80 00 00 00 ...........\....................
02c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 72 00 00 00 ff ff ff ff 14 00 00 00 00 80 00 00 00 ...........H...r................
02e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 15 00 00 00 01 40 00 00 00 ...........1...1............@...
0300 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 16 00 00 00 01 00 00 00 00 ................................
0320 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 17 00 00 00 01 00 00 00 00 ...........Q...j................
0340 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 77 00 00 00 ff ff ff ff 18 00 00 00 00 80 00 00 00 ...........H...w................
0360 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 19 00 00 00 01 40 00 00 00 ...........1...1............@...
0380 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1a 00 00 00 01 00 00 00 00 ................................
03a0 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1b 00 00 00 01 00 00 00 00 ...........Q...j................
03c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 80 00 00 00 ff ff ff ff 1c 00 00 00 00 80 00 00 00 ...........H....................
03e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 1d 00 00 00 01 40 00 00 00 ...........1...1............@...
0400 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1e 00 00 00 01 00 00 00 00 ................................
0420 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1f 00 00 00 01 00 00 00 00 ...........Q...j................
0440 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 20 00 00 00 00 00 00 00 00 ...........y....................
0460 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 21 00 00 00 01 00 80 00 00 ...............#.......!........
0480 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 22 00 00 00 01 00 80 00 00 ...............,......."........
04a0 00 00 00 00 00 00 00 01 00 01 00 11 03 00 80 85 00 00 00 ff ff ff ff 23 00 00 00 01 40 08 00 00 .......................#....@...
04c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 24 00 00 00 01 00 08 00 00 ...........1...1.......$........
04e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 25 00 00 00 01 00 08 00 00 .......................%........
0500 00 00 00 00 00 00 00 01 00 03 00 2e 03 00 80 6a 00 00 80 08 00 00 00 26 00 00 00 01 00 08 00 00 ...............j.......&........
0520 00 00 00 00 00 00 00 01 00 01 00 d5 03 00 80 93 00 00 00 ff ff ff ff 27 00 00 00 00 80 00 00 00 .......................'........
0540 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 28 00 00 00 00 c0 00 00 00 ...........1...1.......(........
0560 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 29 00 00 00 00 00 00 00 00 .......................)........
0580 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 2a 00 00 00 00 80 00 00 00 ...............j.......*........
05a0 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b 00 00 80 ff ff ff ff 2b 00 00 00 00 80 00 00 00 ...........H...........+........
05c0 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 00 00 80 ff ff ff ff 2c 00 00 00 01 40 00 00 00 ...........1...1.......,....@...
05e0 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b 03 00 80 04 00 00 00 2d 00 00 00 01 00 00 00 00 .......................-........
0600 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a 00 00 80 01 00 00 00 2e 00 00 00 01 00 00 00 00 ...........Q...j................
0620 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 2f 00 00 00 00 00 00 00 00 ...........y.........../........
0640 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 30 00 00 00 01 00 80 00 00 ...............#.......0........
0660 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 31 00 00 00 01 00 80 00 00 ...............,.......1........
0680 00 00 00 00 00 00 00 01 00 01 00 20 03 00 80 a7 00 00 00 02 00 00 00 32 00 00 00 00 40 00 00 00 .......................2....@...
06a0 00 00 00 00 00 00 00 01 00 01 00 be 02 00 80 b6 00 00 00 0c 00 00 00 33 00 00 00 00 40 00 00 00 .......................3....@...
06c0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 34 00 00 00 01 00 80 00 00 ...............#.......4........
06e0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 35 00 00 00 01 00 80 00 00 ...............,.......5........
0700 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 bb 00 00 00 ff ff ff ff 36 00 00 00 01 80 00 00 00 ...........H...........6........
0720 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 37 00 00 00 01 40 00 00 00 ...........1...1.......7....@...
0740 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 38 00 00 00 01 00 00 00 00 .......................8........
0760 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 39 00 00 00 01 00 00 00 00 ...........Q...j.......9........
0780 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 c6 00 00 00 ff ff ff ff 3a 00 00 00 01 80 00 00 00 ...........H...........:........
07a0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3b 00 00 00 01 40 00 00 00 ...........1...1.......;....@...
07c0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 3c 00 00 00 01 00 00 00 00 .......................<........
07e0 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 3d 00 00 00 01 00 00 00 00 ...........Q...j.......=........
0800 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 d8 00 00 00 ff ff ff ff 3e 00 00 00 01 80 00 00 00 ...........H...........>........
0820 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3f 00 00 00 01 40 00 00 00 ...........1...1.......?....@...
0840 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 40 00 00 00 01 00 00 00 00 .......................@........
0860 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 41 00 00 00 01 00 00 00 00 ...........Q...j.......A........
0880 00 00 00 00 00 00 00 4d 6f 6e 6f 49 6d 70 6f 72 74 65 72 00 50 50 74 72 3c 45 64 69 74 6f 72 45 .......MonoImporter.PPtr<EditorE
08a0 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 50 74 72 xtension>.m_FileID.m_PathID.PPtr
08c0 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 45 78 74 65 72 6e 61 6c 4f 62 6a 65 63 <PrefabInstance>.m_ExternalObjec
08e0 74 73 00 53 6f 75 72 63 65 41 73 73 65 74 49 64 65 6e 74 69 66 69 65 72 00 74 79 70 65 00 61 73 ts.SourceAssetIdentifier.type.as
0900 73 65 6d 62 6c 79 00 6e 61 6d 65 00 6d 5f 55 73 65 64 46 69 6c 65 49 44 73 00 6d 5f 44 65 66 61 sembly.name.m_UsedFileIDs.m_Defa
0920 75 6c 74 52 65 66 65 72 65 6e 63 65 73 00 65 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 69 63 6f ultReferences.executionOrder.ico
0940 6e 00 6d 5f 55 73 65 72 44 61 74 61 00 6d 5f 41 73 73 65 74 42 75 6e 64 6c 65 4e 61 6d 65 00 6d n.m_UserData.m_AssetBundleName.m
0960 5f 41 73 73 65 74 42 75 6e 64 6c 65 56 61 72 69 61 6e 74 00 00 00 00 00 73 00 00 00 00 ff ff a3 _AssetBundleVariant.....s.......
0980 47 f1 d7 dc 8f 5a 35 36 a0 3a 21 40 69 c1 4a 2a 00 00 00 81 00 00 00 05 00 00 00 15 01 00 80 37 G....Z56.:!@i.J*...............7
09a0 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 ................................
09c0 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 45 ...............................E
09e0 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a00 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a20 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 28 00 00 00 61 ...........................(...a
0a40 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a60 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a80 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 ...............................r
0aa0 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0ac0 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0ae0 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab ...........................H....
0b00 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0b20 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0b40 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0b60 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ea ...........................H....
0b80 01 00 80 ff ff ff ff 0f 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0ba0 00 00 80 ff ff ff ff 10 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0bc0 03 00 80 04 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0be0 00 00 80 01 00 00 00 12 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 3d ...............................=
0c00 00 00 00 ff ff ff ff 13 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0c20 00 00 80 ff ff ff ff 14 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ................................
0c40 03 00 80 04 00 00 00 15 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a ...............................j
0c60 00 00 80 ff ff ff ff 16 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b ...........................H....
0c80 00 00 80 ff ff ff ff 17 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 ...........................1...1
0ca0 00 00 80 ff ff ff ff 18 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b ............@...................
0cc0 03 00 80 04 00 00 00 19 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a ...........................Q...j
0ce0 00 00 80 01 00 00 00 1a 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a ...........................y....
0d00 03 00 80 0c 00 00 00 1b 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 16 ................................
0d20 00 00 00 04 00 00 00 1c 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 1f ................................
0d40 00 00 00 08 00 00 00 1d 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 79 02 00 80 51 ...........................y...Q
0d60 00 00 00 0c 00 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0d80 00 00 00 04 00 00 00 1f 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0da0 00 00 00 08 00 00 00 20 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 de 00 00 80 58 ...............................X
0dc0 00 00 00 04 00 00 00 21 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 69 .......!...................H...i
0de0 00 00 00 ff ff ff ff 22 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ......."...................1...1
0e00 00 00 80 ff ff ff ff 23 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......#....@...................
0e20 03 00 80 04 00 00 00 24 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......$...................Q...j
0e40 00 00 80 01 00 00 00 25 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 75 .......%...................H...u
0e60 00 00 00 ff ff ff ff 26 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 .......&...................1...1
0e80 00 00 80 ff ff ff ff 27 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......'....@...................
0ea0 03 00 80 04 00 00 00 28 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......(...................Q...j
0ec0 00 00 80 01 00 00 00 29 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 50 50 74 72 3c 45 64 69 74 .......)...............PPtr<Edit
0ee0 6f 72 45 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 orExtension>.m_FileID.m_PathID.P
0f00 50 74 72 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 44 65 66 61 75 6c 74 52 65 66 Ptr<PrefabInstance>.m_DefaultRef
0f20 65 72 65 6e 63 65 73 00 6d 5f 49 63 6f 6e 00 6d 5f 45 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 erences.m_Icon.m_ExecutionOrder.
0f40 6d 5f 43 6c 61 73 73 4e 61 6d 65 00 6d 5f 4e 61 6d 65 73 70 61 63 65 00 00 00 00 00 02 00 00 00 m_ClassName.m_Namespace.........
0f60 03 00 00 00 00 00 00 00 00 00 00 00 5c 00 00 00 00 00 00 00 e0 79 af 00 00 00 00 00 60 00 00 00 ............\........y......`...
0f80 58 10 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 X...............................
0fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 e0 79 af 00 00 00 00 00 00 00 00 00 .....................y..........
1040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1080 00 00 00 00 00 00 00 00 0f 00 00 00 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 00 c9 0f 01 00 ............InputEventTrace.....
10a0 75 73 69 6e 67 20 53 79 73 74 65 6d 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c using.System;..using.System.Coll
10c0 65 63 74 69 6f 6e 73 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 6f ections;..using.System.Collectio
10e0 6e 73 2e 47 65 6e 65 72 69 63 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 49 4f 3b 0d 0a 75 ns.Generic;..using.System.IO;..u
1100 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 55 74 69 sing.UnityEngine.InputSystem.Uti
1120 6c 69 74 69 65 73 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 lities;..using.Unity.Collections
1140 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 2e 4c 6f 77 4c 65 ;..using.Unity.Collections.LowLe
1160 76 65 6c 2e 55 6e 73 61 66 65 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 vel.Unsafe;..using.UnityEngine.I
1180 6e 70 75 74 53 79 73 74 65 6d 2e 4c 61 79 6f 75 74 73 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 nputSystem.Layouts;..using.Unity
11a0 45 6e 67 69 6e 65 2e 50 72 6f 66 69 6c 69 6e 67 3b 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 20 55 Engine.Profiling;....namespace.U
11c0 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c 0d nityEngine.InputSystem.LowLevel.
11e0 0a 7b 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 49 .{......///.<summary>......///.I
1200 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 20 6c 65 74 73 20 79 6f 75 20 72 65 63 6f 72 64 20 69 nputEventTrace.lets.you.record.i
1220 6e 70 75 74 20 65 76 65 6e 74 73 20 66 6f 72 20 6c 61 74 65 72 20 70 72 6f 63 65 73 73 69 6e 67 nput.events.for.later.processing
1240 2e 20 49 74 20 61 6c 73 6f 20 68 61 73 20 66 65 61 74 75 72 65 73 20 66 6f 72 20 77 72 69 74 69 ..It.also.has.features.for.writi
1260 6e 67 20 74 72 61 63 65 73 0d 0a 20 20 20 20 2f 2f 2f 20 74 6f 20 64 69 73 6b 2c 20 66 6f 72 20 ng.traces......///.to.disk,.for.
1280 6c 6f 61 64 69 6e 67 20 74 68 65 6d 20 66 72 6f 6d 20 64 69 73 6b 2c 20 61 6e 64 20 66 6f 72 20 loading.them.from.disk,.and.for.
12a0 70 6c 61 79 69 6e 67 20 62 61 63 6b 20 70 72 65 76 69 6f 75 73 6c 79 20 72 65 63 6f 72 64 65 64 playing.back.previously.recorded
12c0 20 74 72 61 63 65 73 2e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 .traces.......///.</summary>....
12e0 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 45 76 ..///.<remarks>......///.InputEv
1300 65 6e 74 54 72 61 63 65 20 6c 65 74 73 20 79 6f 75 20 72 65 63 6f 72 64 20 69 6e 70 75 74 20 65 entTrace.lets.you.record.input.e
1320 76 65 6e 74 73 20 69 6e 74 6f 20 61 20 62 75 66 66 65 72 20 66 6f 72 20 65 69 74 68 65 72 20 61 vents.into.a.buffer.for.either.a
1340 20 73 70 65 63 69 66 69 63 20 64 65 76 69 63 65 2c 20 6f 72 20 66 6f 72 20 61 6c 6c 20 65 76 65 .specific.device,.or.for.all.eve
1360 6e 74 73 0d 0a 20 20 20 20 2f 2f 2f 20 72 65 63 65 69 76 65 64 20 62 79 20 74 68 65 20 69 6e 70 nts......///.received.by.the.inp
1380 75 74 20 73 79 73 74 65 6d 2e 20 54 68 69 73 20 69 73 20 75 73 65 66 75 6c 20 66 6f 72 20 74 65 ut.system..This.is.useful.for.te
13a0 73 74 69 6e 67 20 70 75 72 70 6f 73 65 73 20 6f 72 20 66 6f 72 20 72 65 70 6c 61 79 69 6e 67 20 sting.purposes.or.for.replaying.
13c0 72 65 63 6f 72 64 65 64 20 69 6e 70 75 74 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f recorded.input.......///......//
13e0 2f 20 4e 6f 74 65 20 74 68 61 74 20 65 76 65 6e 74 20 74 72 61 63 65 73 20 3c 65 6d 3e 6d 75 73 /.Note.that.event.traces.<em>mus
1400 74 3c 2f 65 6d 3e 20 62 65 20 64 69 73 70 6f 73 65 64 20 6f 66 20 28 62 79 20 63 61 6c 6c 69 6e t</em>.be.disposed.of.(by.callin
1420 67 20 3c 73 65 65 20 63 72 65 66 3d 22 44 69 73 70 6f 73 65 22 2f 3e 29 20 61 66 74 65 72 20 75 g.<see.cref="Dispose"/>).after.u
1440 73 65 20 6f 72 20 74 68 65 79 0d 0a 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 6c 65 61 6b 20 6d 65 se.or.they......///.will.leak.me
1460 6d 6f 72 79 20 6f 6e 20 74 68 65 20 75 6e 6d 61 6e 61 67 65 64 20 28 43 2b 2b 29 20 6d 65 6d 6f mory.on.the.unmanaged.(C++).memo
1480 72 79 20 68 65 61 70 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 ry.heap.......///......///.Event
14a0 20 74 72 61 63 65 73 20 61 72 65 20 73 65 72 69 61 6c 69 7a 61 62 6c 65 20 73 75 63 68 20 74 68 .traces.are.serializable.such.th
14c0 61 74 20 74 68 65 79 20 63 61 6e 20 73 75 72 76 69 76 65 20 64 6f 6d 61 69 6e 20 72 65 6c 6f 61 at.they.can.survive.domain.reloa
14e0 64 73 20 69 6e 20 74 68 65 20 65 64 69 74 6f 72 2e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d ds.in.the.editor.......///.</rem
1500 61 72 6b 73 3e 0d 0a 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 61 62 6c 65 5d 0d 0a 20 20 20 20 70 arks>......[Serializable]......p
1520 75 62 6c 69 63 20 73 65 61 6c 65 64 20 75 6e 73 61 66 65 20 63 6c 61 73 73 20 49 6e 70 75 74 45 ublic.sealed.unsafe.class.InputE
1540 76 65 6e 74 54 72 61 63 65 20 3a 20 49 44 69 73 70 6f 73 61 62 6c 65 2c 20 49 45 6e 75 6d 65 72 ventTrace.:.IDisposable,.IEnumer
1560 61 62 6c 65 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 3e 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 able<InputEventPtr>......{......
1580 20 20 20 20 70 72 69 76 61 74 65 20 63 6f 6e 73 74 20 69 6e 74 20 6b 44 65 66 61 75 6c 74 42 75 ....private.const.int.kDefaultBu
15a0 66 66 65 72 53 69 7a 65 20 3d 20 31 30 32 34 20 2a 20 31 30 32 34 3b 0d 0a 0d 0a 20 20 20 20 20 fferSize.=.1024.*.1024;.........
15c0 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 ...///.<summary>..........///.If
15e0 20 3c 73 65 65 20 6e 61 6d 65 3d 22 72 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 22 2f .<see.name="recordFrameMarkers"/
1600 3e 20 69 73 20 65 6e 61 62 6c 65 64 2c 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 >.is.enabled,.an.<see.cref="Inpu
1620 74 45 76 65 6e 74 22 2f 3e 20 77 69 74 68 20 74 68 69 73 20 3c 73 65 65 20 63 72 65 66 3d 22 46 tEvent"/>.with.this.<see.cref="F
1640 6f 75 72 43 43 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 6f 64 65 20 69 6e 20 69 74 ourCC"/>..........///.code.in.it
1660 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 74 79 70 65 22 2f 3e 20 s.<see.cref="InputEvent.type"/>.
1680 69 73 20 72 65 63 6f 72 64 65 64 20 77 68 65 6e 65 76 65 72 20 74 68 65 20 69 6e 70 75 74 20 73 is.recorded.whenever.the.input.s
16a0 79 73 74 65 6d 20 73 74 61 72 74 73 20 61 20 6e 65 77 20 75 70 64 61 74 65 2c 20 69 2e 65 2e 0d ystem.starts.a.new.update,.i.e..
16c0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 68 65 6e 65 76 65 72 20 3c 73 65 65 20 63 72 65 66 3d .........///.whenever.<see.cref=
16e0 22 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 22 2f 3e 20 69 "InputSystem.onBeforeUpdate"/>.i
1700 73 20 74 72 69 67 67 65 72 65 64 2e 20 54 68 69 73 20 69 73 20 75 73 65 66 75 6c 20 66 6f 72 20 s.triggered..This.is.useful.for.
1720 72 65 70 6c 61 79 69 6e 67 20 65 76 65 6e 74 73 20 69 6e 20 73 75 63 68 0d 0a 20 20 20 20 20 20 replaying.events.in.such........
1740 20 20 2f 2f 2f 20 61 20 77 61 79 20 74 68 61 74 20 74 68 65 79 20 61 72 65 20 63 6f 72 72 65 63 ..///.a.way.that.they.are.correc
1760 74 6c 79 20 73 70 61 63 65 64 20 6f 75 74 20 6f 76 65 72 20 66 72 61 6d 65 73 2e 0d 0a 20 20 20 tly.spaced.out.over.frames......
1780 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 .....///.</summary>..........pub
17a0 6c 69 63 20 73 74 61 74 69 63 20 46 6f 75 72 43 43 20 46 72 61 6d 65 4d 61 72 6b 65 72 45 76 65 lic.static.FourCC.FrameMarkerEve
17c0 6e 74 20 3d 3e 20 6e 65 77 20 46 6f 75 72 43 43 28 27 46 27 2c 20 27 52 27 2c 20 27 4d 27 2c 20 nt.=>.new.FourCC('F',.'R',.'M',.
17e0 27 45 27 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 'E');............///.<summary>..
1800 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 74 20 64 65 76 69 63 65 20 74 6f 20 72 65 63 6f 72 64 ........///.Set.device.to.record
1820 20 65 76 65 6e 74 73 20 66 6f 72 2e 20 53 65 74 20 74 6f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 .events.for..Set.to.<see.cref="I
1840 6e 70 75 74 44 65 76 69 63 65 2e 49 6e 76 61 6c 69 64 44 65 76 69 63 65 49 64 22 2f 3e 20 62 79 nputDevice.InvalidDeviceId"/>.by
1860 20 64 65 66 61 75 6c 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 20 77 68 69 63 68 20 63 .default..........///.in.which.c
1880 61 73 65 20 65 76 65 6e 74 73 20 66 72 6f 6d 20 61 6c 6c 20 64 65 76 69 63 65 73 20 61 72 65 20 ase.events.from.all.devices.are.
18a0 72 65 63 6f 72 64 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 recorded...........///.</summary
18c0 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 64 65 76 69 63 65 49 64 0d 0a >..........public.int.deviceId..
18e0 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f ........{..............get.=>.m_
1900 44 65 76 69 63 65 49 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d 3e 20 6d 5f DeviceId;..............set.=>.m_
1920 44 65 76 69 63 65 49 64 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a DeviceId.=.value;..........}....
1940 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f ........///.<summary>........../
1960 2f 2f 20 57 68 65 74 68 65 72 20 74 68 65 20 74 72 61 63 65 20 69 73 20 63 75 72 72 65 6e 74 6c //.Whether.the.trace.is.currentl
1980 79 20 72 65 63 6f 72 64 69 6e 67 20 69 6e 70 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 y.recording.input...........///.
19a0 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 54 </summary>..........///.<value>T
19c0 72 75 65 20 69 66 20 74 68 65 20 74 72 61 63 65 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20 72 65 rue.if.the.trace.is.currently.re
19e0 63 6f 72 64 69 6e 67 20 65 76 65 6e 74 73 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 cording.events.</value>.........
1a00 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 45 6e 61 62 6c 65 22 2f 3e 0d 0a 20 .///.<seealso.cref="Enable"/>...
1a20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 44 69 73 61 62 6c .......///.<seealso.cref="Disabl
1a40 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 65 6e 61 62 6c 65 e"/>..........public.bool.enable
1a60 64 20 3d 3e 20 6d 5f 45 6e 61 62 6c 65 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c d.=>.m_Enabled;............///.<
1a80 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 72 75 65 2c 20 69 summary>..........///.If.true,.i
1aa0 6e 70 75 74 20 75 70 64 61 74 65 20 62 6f 75 6e 64 61 72 69 65 73 20 77 69 6c 6c 20 62 65 20 72 nput.update.boundaries.will.be.r
1ac0 65 63 6f 72 64 65 64 20 61 73 20 65 76 65 6e 74 73 2e 20 42 79 20 64 65 66 61 75 6c 74 2c 20 74 ecorded.as.events..By.default,.t
1ae0 68 69 73 20 69 73 20 6f 66 66 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 his.is.off...........///.</summa
1b00 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 57 68 65 74 68 65 72 20 ry>..........///.<value>Whether.
1b20 66 72 61 6d 65 20 62 6f 75 6e 64 61 72 69 65 73 20 73 68 6f 75 6c 64 20 62 65 20 72 65 63 6f 72 frame.boundaries.should.be.recor
1b40 64 65 64 20 69 6e 20 74 68 65 20 74 72 61 63 65 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 ded.in.the.trace.</value>.......
1b60 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 ...///.<remarks>..........///.Wh
1b80 65 6e 20 72 65 63 6f 72 64 69 6e 67 20 77 69 74 68 20 74 68 69 73 20 6f 66 66 2c 20 61 6c 6c 20 en.recording.with.this.off,.all.
1ba0 65 76 65 6e 74 73 20 61 72 65 20 77 72 69 74 74 65 6e 20 6f 6e 65 20 61 66 74 65 72 20 74 68 65 events.are.written.one.after.the
1bc0 20 6f 74 68 65 72 20 66 6f 72 20 61 73 20 6c 6f 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .other.for.as.long..........///.
1be0 61 73 20 74 68 65 20 72 65 63 6f 72 64 69 6e 67 20 69 73 20 61 63 74 69 76 65 2e 20 54 68 69 73 as.the.recording.is.active..This
1c00 20 6d 65 61 6e 73 20 74 68 61 74 20 77 68 65 6e 20 61 20 72 65 63 6f 72 64 69 6e 67 20 72 75 6e .means.that.when.a.recording.run
1c20 73 20 6f 76 65 72 20 6d 75 6c 74 69 70 6c 65 20 66 72 61 6d 65 73 2c 0d 0a 20 20 20 20 20 20 20 s.over.multiple.frames,.........
1c40 20 2f 2f 2f 20 69 74 20 69 73 20 6e 6f 20 6c 6f 6e 67 65 72 20 70 6f 73 73 69 62 6c 65 20 66 6f .///.it.is.no.longer.possible.fo
1c60 72 20 74 68 65 20 74 72 61 63 65 20 74 6f 20 74 65 6c 6c 20 77 68 69 63 68 20 65 76 65 6e 74 73 r.the.trace.to.tell.which.events
1c80 20 68 61 70 70 65 6e 65 64 20 69 6e 20 64 69 73 74 69 6e 63 74 20 66 72 61 6d 65 73 2e 0d 0a 20 .happened.in.distinct.frames....
1ca0 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 79 20 74 75 72 6e 69 .......///..........///.By.turni
1cc0 6e 67 20 74 68 69 73 20 66 65 61 74 75 72 65 20 6f 6e 2c 20 66 72 61 6d 65 20 6d 61 72 6b 65 72 ng.this.feature.on,.frame.marker
1ce0 20 65 76 65 6e 74 73 20 28 69 2e 65 2e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 .events.(i.e..<see.cref="InputEv
1d00 65 6e 74 22 2f 3e 20 69 6e 73 74 61 6e 63 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 ent"/>.instances..........///.wi
1d20 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 74 79 70 65 22 2f 3e th.<see.cref="InputEvent.type"/>
1d40 20 73 65 74 20 74 6f 20 3c 73 65 65 20 63 72 65 66 3d 22 46 72 61 6d 65 4d 61 72 6b 65 72 45 76 .set.to.<see.cref="FrameMarkerEv
1d60 65 6e 74 22 2f 3e 29 20 77 69 6c 6c 20 62 65 20 77 72 69 74 74 65 6e 0d 0a 20 20 20 20 20 20 20 ent"/>).will.be.written.........
1d80 20 2f 2f 2f 20 74 6f 20 74 68 65 20 74 72 61 63 65 20 65 76 65 72 79 20 74 69 6d 65 20 61 6e 20 .///.to.the.trace.every.time.an.
1da0 69 6e 70 75 74 20 75 70 64 61 74 65 20 6f 63 63 75 72 73 2e 20 57 68 65 6e 20 70 6c 61 79 69 6e input.update.occurs..When.playin
1dc0 67 20 73 75 63 68 20 61 20 74 72 61 63 65 20 62 61 63 6b 20 76 69 61 20 3c 73 65 65 0d 0a 20 20 g.such.a.trace.back.via.<see....
1de0 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 ......///.cref="ReplayController
1e00 2e 50 6c 61 79 41 6c 6c 46 72 61 6d 65 73 4f 6e 65 42 79 4f 6e 65 22 2f 3e 2c 20 65 76 65 6e 74 .PlayAllFramesOneByOne"/>,.event
1e20 73 20 77 69 6c 6c 20 67 65 74 20 73 70 61 63 65 64 20 6f 75 74 20 6f 76 65 72 20 66 72 61 6d 65 s.will.get.spaced.out.over.frame
1e40 73 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 s.corresponding..........///.to.
1e60 68 6f 77 20 74 68 65 79 20 77 65 72 65 20 73 70 61 63 65 64 20 6f 75 74 20 77 68 65 6e 20 69 6e how.they.were.spaced.out.when.in
1e80 70 75 74 20 77 61 73 20 69 6e 69 74 69 61 6c 6c 79 20 72 65 63 6f 72 64 65 64 2e 0d 0a 20 20 20 put.was.initially.recorded......
1ea0 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 .....///..........///.Note.that.
1ec0 68 61 76 69 6e 67 20 74 68 69 73 20 66 65 61 74 75 72 65 20 65 6e 61 62 6c 65 64 20 77 69 6c 6c having.this.feature.enabled.will
1ee0 20 66 69 6c 6c 20 75 70 20 74 72 61 63 65 73 20 6d 75 63 68 20 71 75 69 63 6b 65 72 2e 20 49 6e .fill.up.traces.much.quicker..In
1f00 73 74 65 61 64 20 6f 66 20 62 65 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 69 6c 6c stead.of.being..........///.fill
1f20 65 64 20 75 70 20 6f 6e 6c 79 20 77 68 65 6e 20 74 68 65 72 65 20 69 73 20 69 6e 70 75 74 2c 20 ed.up.only.when.there.is.input,.
1f40 54 4f 44 4f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 TODO..........///.</remarks>....
1f60 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 70 6c 61 79 43 ......///.<seealso.cref="ReplayC
1f80 6f 6e 74 72 6f 6c 6c 65 72 2e 50 6c 61 79 41 6c 6c 46 72 61 6d 65 73 4f 6e 65 42 79 4f 6e 65 22 ontroller.PlayAllFramesOneByOne"
1fa0 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 46 />..........///.<seealso.cref="F
1fc0 72 61 6d 65 4d 61 72 6b 65 72 45 76 65 6e 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c rameMarkerEvent"/>..........publ
1fe0 69 63 20 62 6f 6f 6c 20 72 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 0d 0a 20 20 20 20 ic.bool.recordFrameMarkers......
2000 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 52 65 63 6f ....{..............get.=>.m_Reco
2020 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 rdFrameMarkers;..............set
2040 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..............{.................
2060 20 69 66 20 28 6d 5f 52 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 20 3d 3d 20 76 61 6c .if.(m_RecordFrameMarkers.==.val
2080 75 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b ue)......................return;
20a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 52 65 63 6f 72 64 46 72 61 6d 65 4d ..................m_RecordFrameM
20c0 61 72 6b 65 72 73 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 arkers.=.value;.................
20e0 20 69 66 20 28 6d 5f 45 6e 61 62 6c 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .if.(m_Enabled).................
2100 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 .{......................if.(valu
2120 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 e)..........................Inpu
2140 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 20 2b 3d 20 4f 6e 42 65 66 6f tSystem.onBeforeUpdate.+=.OnBefo
2160 72 65 55 70 64 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 reUpdate;......................e
2180 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 lse..........................Inp
21a0 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 20 2d 3d 20 4f 6e 42 65 66 utSystem.onBeforeUpdate.-=.OnBef
21c0 6f 72 65 55 70 64 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 oreUpdate;..................}...
21e0 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 ...........}..........}.........
2200 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 6f ...///.<summary>..........///.To
2220 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 65 76 65 6e 74 73 20 63 75 72 72 65 6e 74 6c 79 20 69 tal.number.of.events.currently.i
2240 6e 20 74 68 65 20 74 72 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d n.the.trace...........///.</summ
2260 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 4e 75 6d 62 65 72 20 ary>..........///.<value>Number.
2280 6f 66 20 65 76 65 6e 74 73 20 72 65 63 6f 72 64 65 64 20 69 6e 20 74 68 65 20 74 72 61 63 65 2e of.events.recorded.in.the.trace.
22a0 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6c 6f 6e 67 20 65 76 </value>..........public.long.ev
22c0 65 6e 74 43 6f 75 6e 74 20 3d 3e 20 6d 5f 45 76 65 6e 74 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 entCount.=>.m_EventCount;.......
22e0 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .....///.<summary>..........///.
2300 54 68 65 20 61 6d 6f 75 6e 74 20 6f 66 20 6d 65 6d 6f 72 79 20 63 6f 6e 73 75 6d 65 64 20 62 79 The.amount.of.memory.consumed.by
2320 20 61 6c 6c 20 65 76 65 6e 74 73 20 63 6f 6d 62 69 6e 65 64 20 74 68 61 74 20 61 72 65 20 63 75 .all.events.combined.that.are.cu
2340 72 72 65 6e 74 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 74 6f 72 65 64 20 69 6e 20 74 rrently..........///.stored.in.t
2360 68 65 20 74 72 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 he.trace...........///.</summary
2380 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 54 6f 74 61 6c 20 73 69 7a 65 >..........///.<value>Total.size
23a0 20 6f 66 20 65 76 65 6e 74 20 64 61 74 61 20 63 75 72 72 65 6e 74 6c 79 20 69 6e 20 74 72 61 63 .of.event.data.currently.in.trac
23c0 65 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6c 6f 6e 67 20 e.</value>..........public.long.
23e0 74 6f 74 61 6c 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 3e 20 6d 5f 45 76 65 6e 74 totalEventSizeInBytes.=>.m_Event
2400 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d SizeInBytes;............///.<sum
2420 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 6f 74 61 6c 20 73 69 7a 65 20 6f 66 mary>..........///.Total.size.of
2440 20 6d 65 6d 6f 72 79 20 62 75 66 66 65 72 20 28 69 6e 20 62 79 74 65 73 29 20 63 75 72 72 65 6e .memory.buffer.(in.bytes).curren
2460 74 6c 79 20 61 6c 6c 6f 63 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 tly.allocated...........///.</su
2480 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 53 69 7a 65 20 mmary>..........///.<value>Size.
24a0 6f 66 20 6d 65 6d 6f 72 79 20 63 75 72 72 65 6e 74 6c 79 20 61 6c 6c 6f 63 61 74 65 64 2e 3c 2f of.memory.currently.allocated.</
24c0 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 value>..........///.<remarks>...
24e0 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 62 75 66 66 65 72 20 69 73 20 61 6c 6c 6f 63 61 74 .......///.The.buffer.is.allocat
2500 65 64 20 6f 6e 20 74 68 65 20 75 6e 6d 61 6e 61 67 65 64 20 68 65 61 70 2e 0d 0a 20 20 20 20 20 ed.on.the.unmanaged.heap........
2520 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 ...///.</remarks>..........publi
2540 63 20 6c 6f 6e 67 20 61 6c 6c 6f 63 61 74 65 64 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 3e 20 6d c.long.allocatedSizeInBytes.=>.m
2560 5f 45 76 65 6e 74 42 75 66 66 65 72 20 21 3d 20 64 65 66 61 75 6c 74 20 3f 20 6d 5f 45 76 65 6e _EventBuffer.!=.default.?.m_Even
2580 74 42 75 66 66 65 72 53 69 7a 65 20 3a 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 tBufferSize.:.0;............///.
25a0 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 61 72 67 65 73 74 20 73 <summary>..........///.Largest.s
25c0 69 7a 65 20 28 69 6e 20 62 79 74 65 73 29 20 74 68 61 74 20 74 68 65 20 6d 65 6d 6f 72 79 20 62 ize.(in.bytes).that.the.memory.b
25e0 75 66 66 65 72 20 69 73 20 61 6c 6c 6f 77 65 64 20 74 6f 20 67 72 6f 77 20 74 6f 2e 20 42 79 20 uffer.is.allowed.to.grow.to..By.
2600 64 65 66 61 75 6c 74 2c 20 74 68 69 73 20 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 default,.this.is..........///.th
2620 65 20 73 61 6d 65 20 61 73 20 3c 73 65 65 20 63 72 65 66 3d 22 61 6c 6c 6f 63 61 74 65 64 53 69 e.same.as.<see.cref="allocatedSi
2640 7a 65 49 6e 42 79 74 65 73 22 2f 3e 20 6d 65 61 6e 69 6e 67 20 74 68 61 74 20 74 68 65 20 62 75 zeInBytes"/>.meaning.that.the.bu
2660 66 66 65 72 20 69 73 20 6e 6f 74 20 61 6c 6c 6f 77 65 64 20 74 6f 20 67 72 6f 77 20 62 75 74 20 ffer.is.not.allowed.to.grow.but.
2680 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 61 74 68 65 72 20 77 72 61 70 20 61 72 will..........///.rather.wrap.ar
26a0 6f 75 6e 64 20 77 68 65 6e 20 66 75 6c 6c 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 ound.when.full...........///.</s
26c0 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 4c 61 72 67 ummary>..........///.<value>Larg
26e0 65 73 74 20 73 69 7a 65 20 74 68 65 20 6d 65 6d 6f 72 79 20 62 75 66 66 65 72 20 69 73 20 61 6c est.size.the.memory.buffer.is.al
2700 6c 6f 77 65 64 20 74 6f 20 67 72 6f 77 20 74 6f 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 lowed.to.grow.to.</value>.......
2720 20 20 20 70 75 62 6c 69 63 20 6c 6f 6e 67 20 6d 61 78 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 3e ...public.long.maxSizeInBytes.=>
2740 20 6d 5f 4d 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 .m_MaxEventBufferSize;..........
2760 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 66 ..///.<summary>..........///.Inf
2780 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 61 6c 6c 20 64 65 76 69 63 65 73 20 66 6f 72 20 77 ormation.about.all.devices.for.w
27a0 68 69 63 68 20 65 76 65 6e 74 73 20 68 61 76 65 20 62 65 65 6e 20 72 65 63 6f 72 64 65 64 20 69 hich.events.have.been.recorded.i
27c0 6e 20 74 68 65 20 74 72 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d n.the.trace...........///.</summ
27e0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 52 65 63 6f 72 64 20 ary>..........///.<value>Record.
2800 6f 66 20 64 65 76 69 63 65 73 20 72 65 63 6f 72 64 65 64 20 69 6e 20 74 68 65 20 74 72 61 63 65 of.devices.recorded.in.the.trace
2820 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 61 64 4f 6e .</value>..........public.ReadOn
2840 6c 79 41 72 72 61 79 3c 44 65 76 69 63 65 49 6e 66 6f 3e 20 64 65 76 69 63 65 49 6e 66 6f 73 20 lyArray<DeviceInfo>.deviceInfos.
2860 3d 3e 20 6d 5f 44 65 76 69 63 65 49 6e 66 6f 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f =>.m_DeviceInfos;............///
2880 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4f 70 74 69 6f 6e 61 6c .<summary>..........///.Optional
28a0 20 64 65 6c 65 67 61 74 65 20 74 6f 20 64 65 63 69 64 65 20 77 68 65 74 68 65 72 20 61 6e 20 69 .delegate.to.decide.whether.an.i
28c0 6e 70 75 74 20 73 68 6f 75 6c 64 20 62 65 20 73 74 6f 72 65 64 20 69 6e 20 61 20 74 72 61 63 65 nput.should.be.stored.in.a.trace
28e0 2e 20 4e 75 6c 6c 20 62 79 20 64 65 66 61 75 6c 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ..Null.by.default...........///.
2900 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 44 </summary>..........///.<value>D
2920 65 6c 65 67 61 74 65 20 74 6f 20 61 63 63 65 70 74 20 6f 72 20 72 65 6a 65 63 74 20 69 6e 64 69 elegate.to.accept.or.reject.indi
2940 76 69 64 75 61 6c 20 65 76 65 6e 74 73 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 vidual.events.</value>..........
2960 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 6e 20 ///.<remarks>..........///.When.
2980 74 68 69 73 20 69 73 20 73 65 74 2c 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 77 69 6c 6c 20 62 this.is.set,.the.callback.will.b
29a0 65 20 69 6e 76 6f 6b 65 64 20 6f 6e 20 65 76 65 72 79 20 65 76 65 6e 74 20 74 68 61 74 20 77 6f e.invoked.on.every.event.that.wo
29c0 75 6c 64 20 6f 74 68 65 72 77 69 73 65 20 62 65 20 73 74 6f 72 65 64 0d 0a 20 20 20 20 20 20 20 uld.otherwise.be.stored.........
29e0 20 2f 2f 2f 20 64 69 72 65 63 74 6c 79 20 69 6e 20 74 68 65 20 74 72 61 63 65 2e 20 49 66 20 74 .///.directly.in.the.trace..If.t
2a00 68 65 20 63 61 6c 6c 62 61 63 6b 20 72 65 74 75 72 6e 73 20 3c 63 3e 74 72 75 65 3c 2f 63 3e 2c he.callback.returns.<c>true</c>,
2a20 20 74 68 65 20 74 72 61 63 65 20 77 69 6c 6c 20 63 6f 6e 74 69 6e 75 65 20 74 6f 20 72 65 63 6f .the.trace.will.continue.to.reco
2a40 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 65 76 65 6e 74 2e 20 49 66 20 74 68 rd..........///.the.event..If.th
2a60 65 20 63 61 6c 6c 62 61 63 6b 20 72 65 74 75 72 6e 73 20 3c 63 3e 66 61 6c 73 65 3c 2f 63 3e 2c e.callback.returns.<c>false</c>,
2a80 20 74 68 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 62 65 20 69 67 6e 6f 72 65 64 20 61 6e 64 20 6e .the.event.will.be.ignored.and.n
2aa0 6f 74 20 72 65 63 6f 72 64 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 ot.recorded...........///.......
2ac0 20 20 20 2f 2f 2f 20 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 73 68 6f 75 6c 64 20 67 65 6e 65 72 ...///.The.callback.should.gener
2ae0 61 6c 6c 79 20 6d 75 74 61 74 65 20 74 68 65 20 65 76 65 6e 74 2e 20 49 66 20 79 6f 75 20 64 6f ally.mutate.the.event..If.you.do
2b00 20 73 6f 2c 20 6e 6f 74 65 20 74 68 61 74 20 74 68 69 73 20 77 69 6c 6c 20 69 6d 70 61 63 74 0d .so,.note.that.this.will.impact.
2b20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 76 65 6e 74 20 70 72 6f 63 65 73 73 69 6e 67 20 69 6e .........///.event.processing.in
2b40 20 67 65 6e 65 72 61 6c 2c 20 6e 6f 74 20 6a 75 73 74 20 72 65 63 6f 72 64 69 6e 67 20 6f 66 20 .general,.not.just.recording.of.
2b60 74 68 65 20 65 76 65 6e 74 20 69 6e 20 74 68 65 20 74 72 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 the.event.in.the.trace..........
2b80 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 .///.</remarks>..........public.
2ba0 46 75 6e 63 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 2c 20 49 6e 70 75 74 44 65 76 69 63 65 2c Func<InputEventPtr,.InputDevice,
2bc0 20 62 6f 6f 6c 3e 20 6f 6e 46 69 6c 74 65 72 45 76 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d .bool>.onFilterEvent..........{.
2be0 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 4f 6e 46 69 6c 74 65 72 45 76 .............get.=>.m_OnFilterEv
2c00 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d 3e 20 6d 5f 4f 6e 46 69 6c ent;..............set.=>.m_OnFil
2c20 74 65 72 45 76 65 6e 74 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a terEvent.=.value;..........}....
2c40 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f ........///.<summary>........../
2c60 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 74 72 69 67 67 65 72 65 64 20 65 76 65 72 79 //.Event.that.is.triggered.every
2c80 20 74 69 6d 65 20 61 6e 20 65 76 65 6e 74 20 68 61 73 20 62 65 65 6e 20 72 65 63 6f 72 64 65 64 .time.an.event.has.been.recorded
2ca0 20 69 6e 20 74 68 65 20 74 72 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 .in.the.trace...........///.</su
2cc0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 65 76 65 6e 74 20 41 63 74 mmary>..........public.event.Act
2ce0 69 6f 6e 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 3e 20 6f 6e 45 76 65 6e 74 0d 0a 20 20 20 20 ion<InputEventPtr>.onEvent......
2d00 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 64 64 0d 0a 20 20 20 20 20 20 20 20 ....{..............add..........
2d20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 45 76 ....{..................if.(!m_Ev
2d40 65 6e 74 4c 69 73 74 65 6e 65 72 73 2e 43 6f 6e 74 61 69 6e 73 28 76 61 6c 75 65 29 29 0d 0a 20 entListeners.Contains(value))...
2d60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 4c 69 73 74 65 6e ...................m_EventListen
2d80 65 72 73 2e 41 70 70 65 6e 64 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ers.Append(value);..............
2da0 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 20 3d 3e 20 6d 5f 45 76 65 6e 74 }..............remove.=>.m_Event
2dc0 4c 69 73 74 65 6e 65 72 73 2e 52 65 6d 6f 76 65 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 Listeners.Remove(value);........
2de0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 45 76 65 6e 74 ..}............public.InputEvent
2e00 54 72 61 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 6c 6f 6e 67 20 62 Trace(InputDevice.device,.long.b
2e20 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 6b 44 65 66 61 75 6c 74 42 75 66 66 65 ufferSizeInBytes.=.kDefaultBuffe
2e40 72 53 69 7a 65 2c 20 62 6f 6f 6c 20 67 72 6f 77 42 75 66 66 65 72 20 3d 20 66 61 6c 73 65 2c 0d rSize,.bool.growBuffer.=.false,.
2e60 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ................................
2e80 6c 6f 6e 67 20 6d 61 78 42 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 2d 31 2c 20 long.maxBufferSizeInBytes.=.-1,.
2ea0 6c 6f 6e 67 20 67 72 6f 77 49 6e 63 72 65 6d 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 long.growIncrementSizeInBytes.=.
2ec0 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 74 68 69 73 28 62 75 66 66 65 72 53 69 -1)..............:.this(bufferSi
2ee0 7a 65 49 6e 42 79 74 65 73 2c 20 67 72 6f 77 42 75 66 66 65 72 2c 20 6d 61 78 42 75 66 66 65 72 zeInBytes,.growBuffer,.maxBuffer
2f00 53 69 7a 65 49 6e 42 79 74 65 73 2c 20 67 72 6f 77 49 6e 63 72 65 6d 65 6e 74 53 69 7a 65 49 6e SizeInBytes,.growIncrementSizeIn
2f20 42 79 74 65 73 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 Bytes)..........{..............i
2f40 66 20 28 64 65 76 69 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 f.(device.==.null)..............
2f60 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 ....throw.new.ArgumentNullExcept
2f80 69 6f 6e 28 6e 61 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ion(nameof(device));............
2fa0 20 20 20 20 6d 5f 44 65 76 69 63 65 49 64 20 3d 20 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 ....m_DeviceId.=.device.deviceId
2fc0 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d ;..........}............///.<sum
2fe0 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 72 65 61 74 65 20 61 20 64 69 73 61 mary>..........///.Create.a.disa
3000 62 6c 65 64 20 65 76 65 6e 74 20 74 72 61 63 65 20 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 70 bled.event.trace.that.does.not.p
3020 65 72 66 6f 72 6d 20 61 6e 79 20 61 6c 6c 6f 63 61 74 69 6f 6e 20 79 65 74 2e 20 41 6e 20 65 76 erform.any.allocation.yet..An.ev
3040 65 6e 74 20 74 72 61 63 65 20 6f 6e 6c 79 20 73 74 61 72 74 73 20 63 6f 6e 73 75 6d 69 6e 67 20 ent.trace.only.starts.consuming.
3060 72 65 73 6f 75 72 63 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 66 69 72 73 74 resources..........///.the.first
3080 20 74 69 6d 65 20 69 74 20 69 73 20 65 6e 61 62 6c 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .time.it.is.enabled...........//
30a0 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d /.</summary>..........///.<param
30c0 20 6e 61 6d 65 3d 22 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 22 3e 53 69 7a 65 20 6f .name="bufferSizeInBytes">Size.o
30e0 66 20 62 75 66 66 65 72 20 74 68 61 74 20 77 69 6c 6c 20 62 65 20 61 6c 6c 6f 63 61 74 65 64 20 f.buffer.that.will.be.allocated.
3100 6f 6e 20 66 69 72 73 74 20 65 76 65 6e 74 20 63 61 70 74 75 72 65 64 20 62 79 20 74 72 61 63 65 on.first.event.captured.by.trace
3120 2e 20 44 65 66 61 75 6c 74 73 20 74 6f 20 31 4d 42 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 ..Defaults.to.1MB.</param>......
3140 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 67 72 6f 77 42 75 66 66 65 72 22 ....///.<param.name="growBuffer"
3160 3e 49 66 20 74 72 75 65 2c 20 74 68 65 20 65 76 65 6e 74 20 62 75 66 66 65 72 20 77 69 6c 6c 20 >If.true,.the.event.buffer.will.
3180 62 65 20 67 72 6f 77 6e 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 77 68 65 6e 20 69 74 20 72 be.grown.automatically.when.it.r
31a0 65 61 63 68 65 73 20 63 61 70 61 63 69 74 79 2c 20 75 70 20 74 6f 20 61 20 6d 61 78 69 6d 75 6d eaches.capacity,.up.to.a.maximum
31c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 69 7a 65 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 ..........///.size.of.<paramref.
31e0 6e 61 6d 65 3d 22 6d 61 78 42 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 22 2f 3e 2e 20 54 name="maxBufferSizeInBytes"/>..T
3200 68 69 73 20 69 73 20 6f 66 66 20 62 79 20 64 65 66 61 75 6c 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a his.is.off.by.default.</param>..
3220 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 61 78 42 75 66 66 ........///.<param.name="maxBuff
3240 65 72 53 69 7a 65 49 6e 42 79 74 65 73 22 3e 49 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 erSizeInBytes">If.<paramref.name
3260 3d 22 67 72 6f 77 42 75 66 66 65 72 22 2f 3e 20 69 73 20 74 72 75 65 2c 20 74 68 69 73 20 69 73 ="growBuffer"/>.is.true,.this.is
3280 20 74 68 65 20 6d 61 78 69 6d 75 6d 20 73 69 7a 65 20 74 68 61 74 20 74 68 65 20 62 75 66 66 65 .the.maximum.size.that.the.buffe
32a0 72 20 73 68 6f 75 6c 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 67 72 6f 77 6e 20 74 r.should..........///.be.grown.t
32c0 6f 2e 20 49 66 20 74 68 65 20 6d 61 78 69 6d 75 6d 20 73 69 7a 65 20 69 73 20 72 65 61 63 68 65 o..If.the.maximum.size.is.reache
32e0 64 2c 20 6f 6c 64 20 65 76 65 6e 74 73 20 61 72 65 20 62 65 69 6e 67 20 6f 76 65 72 77 72 69 74 d,.old.events.are.being.overwrit
3300 74 65 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 ten.</param>..........public.Inp
3320 75 74 45 76 65 6e 74 54 72 61 63 65 28 6c 6f 6e 67 20 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 utEventTrace(long.bufferSizeInBy
3340 74 65 73 20 3d 20 6b 44 65 66 61 75 6c 74 42 75 66 66 65 72 53 69 7a 65 2c 20 62 6f 6f 6c 20 67 tes.=.kDefaultBufferSize,.bool.g
3360 72 6f 77 42 75 66 66 65 72 20 3d 20 66 61 6c 73 65 2c 20 6c 6f 6e 67 20 6d 61 78 42 75 66 66 65 rowBuffer.=.false,.long.maxBuffe
3380 72 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 2d 31 2c 20 6c 6f 6e 67 20 67 72 6f 77 49 6e 63 72 rSizeInBytes.=.-1,.long.growIncr
33a0 65 6d 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 ementSizeInBytes.=.-1)..........
33c0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 {..............m_EventBufferSize
33e0 20 3d 20 28 75 69 6e 74 29 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 0d 0a 20 .=.(uint)bufferSizeInBytes;.....
3400 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 67 72 6f 77 42 75 66 66 65 72 29 0d 0a 20 20 20 20 ...........if.(growBuffer)......
3420 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d ........{..................if.(m
3440 61 78 42 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 axBufferSizeInBytes.<.0)........
3460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4d 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 ..............m_MaxEventBufferSi
3480 7a 65 20 3d 20 32 35 36 20 2a 20 6b 44 65 66 61 75 6c 74 42 75 66 66 65 72 53 69 7a 65 3b 0d 0a ze.=.256.*.kDefaultBufferSize;..
34a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 ................else............
34c0 20 20 20 20 20 20 20 20 20 20 6d 5f 4d 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 20 3d ..........m_MaxEventBufferSize.=
34e0 20 6d 61 78 42 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 .maxBufferSizeInBytes;..........
3500 20 20 20 20 20 20 20 20 20 20 69 66 20 28 67 72 6f 77 49 6e 63 72 65 6d 65 6e 74 53 69 7a 65 49 ..........if.(growIncrementSizeI
3520 6e 42 79 74 65 73 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nBytes.<.0).....................
3540 20 6d 5f 47 72 6f 77 49 6e 63 72 65 6d 65 6e 74 53 69 7a 65 20 3d 20 6b 44 65 66 61 75 6c 74 42 .m_GrowIncrementSize.=.kDefaultB
3560 75 66 66 65 72 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 ufferSize;..................else
3580 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 47 72 6f 77 49 6e 63 72 ......................m_GrowIncr
35a0 65 6d 65 6e 74 53 69 7a 65 20 3d 20 67 72 6f 77 49 6e 63 72 65 6d 65 6e 74 53 69 7a 65 49 6e 42 ementSize.=.growIncrementSizeInB
35c0 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 ytes;..............}............
35e0 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 ..else..............{...........
3600 20 20 20 20 20 20 20 6d 5f 4d 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 20 3d 20 6d 5f .......m_MaxEventBufferSize.=.m_
3620 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d EventBufferSize;..............}.
3640 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 .........}............///.<summa
3660 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 72 69 74 65 20 74 68 65 20 63 6f 6e 74 65 ry>..........///.Write.the.conte
3680 6e 74 73 20 6f 66 20 74 68 65 20 65 76 65 6e 74 20 74 72 61 63 65 20 74 6f 20 61 20 66 69 6c 65 nts.of.the.event.trace.to.a.file
36a0 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 ...........///.</summary>.......
36c0 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 3e 50 61 ...///.<param.name="filePath">Pa
36e0 74 68 20 6f 66 20 74 68 65 20 66 69 6c 65 20 74 6f 20 77 72 69 74 65 2e 3c 2f 70 61 72 61 6d 3e th.of.the.file.to.write.</param>
3700 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 ..........///.<exception.cref="A
3720 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 rgumentNullException"><paramref.
3740 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e name="filePath"/>.is.<c>null</c>
3760 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 .or.empty.</exception>..........
3780 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 46 69 6c 65 4e 6f 74 46 6f 75 6e ///.<exception.cref="FileNotFoun
37a0 64 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 dException"><paramref.name="file
37c0 50 61 74 68 22 2f 3e 20 69 73 20 69 6e 76 61 6c 69 64 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d Path"/>.is.invalid.</exception>.
37e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 44 69 .........///.<exception.cref="Di
3800 72 65 63 74 6f 72 79 4e 6f 74 46 6f 75 6e 64 45 78 63 65 70 74 69 6f 6e 22 3e 41 20 64 69 72 65 rectoryNotFoundException">A.dire
3820 63 74 6f 72 79 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 ctory.in.<paramref.name="filePat
3840 68 22 2f 3e 20 69 73 20 69 6e 76 61 6c 69 64 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 h"/>.is.invalid.</exception>....
3860 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 55 6e 61 75 74 ......///.<exception.cref="Unaut
3880 68 6f 72 69 7a 65 64 41 63 63 65 73 73 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 horizedAccessException"><paramre
38a0 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 63 61 6e 6e 6f 74 20 62 65 20 61 63 f.name="filePath"/>.cannot.be.ac
38c0 63 65 73 73 65 64 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f cessed.</exception>..........///
38e0 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 61 64 46 72 6f 6d 28 73 74 72 69 6e 67 29 .<seealso.cref="ReadFrom(string)
3900 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 57 72 69 74 65 54 6f "/>..........public.void.WriteTo
3920 28 73 74 72 69 6e 67 20 66 69 6c 65 50 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 (string.filePath)..........{....
3940 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 ..........if.(string.IsNullOrEmp
3960 74 79 28 66 69 6c 65 50 61 74 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 ty(filePath))..................t
3980 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e hrow.new.ArgumentNullException(n
39a0 61 6d 65 6f 66 28 66 69 6c 65 50 61 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ameof(filePath));...............
39c0 20 75 73 69 6e 67 20 28 76 61 72 20 73 74 72 65 61 6d 20 3d 20 46 69 6c 65 2e 4f 70 65 6e 57 72 .using.(var.stream.=.File.OpenWr
39e0 69 74 65 28 66 69 6c 65 50 61 74 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ite(filePath))..................
3a00 57 72 69 74 65 54 6f 28 73 74 72 65 61 6d 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 WriteTo(stream);..........}.....
3a20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .......///.<summary>..........//
3a40 2f 20 57 72 69 74 65 20 74 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 74 68 65 20 65 76 65 6e /.Write.the.contents.of.the.even
3a60 74 20 74 72 61 63 65 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 73 74 72 65 61 6d 2e 0d 0a 20 20 t.trace.to.the.given.stream.....
3a80 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ......///.</summary>..........//
3aa0 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 3e 53 74 72 65 61 6d 20 74 6f /.<param.name="stream">Stream.to
3ac0 20 77 72 69 74 65 20 74 68 65 20 64 61 74 61 20 74 6f 2e 20 4d 75 73 74 20 73 75 70 70 6f 72 74 .write.the.data.to..Must.support
3ae0 20 73 65 65 6b 69 6e 67 20 28 69 2e 65 2e 20 3c 63 3e 53 74 72 65 61 6d 2e 63 61 6e 53 65 65 6b .seeking.(i.e..<c>Stream.canSeek
3b00 3c 2f 63 3e 20 6d 75 73 74 20 62 65 20 74 72 75 65 29 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 </c>.must.be.true).</param>.....
3b20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 .....///.<exception.cref="Argume
3b40 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d ntNullException"><paramref.name=
3b60 22 73 74 72 65 61 6d 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 "stream"/>.is.<c>null</c>.</exce
3b80 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 ption>..........///.<exception.c
3ba0 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 ref="ArgumentException"><paramre
3bc0 66 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 2f 3e 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f f.name="stream"/>.does.not.suppo
3be0 72 74 20 73 65 65 6b 69 6e 67 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 rt.seeking.</exception>.........
3c00 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 4f 45 78 63 65 70 74 69 6f .///.<exception.cref="IOExceptio
3c20 6e 22 3e 41 6e 20 65 72 72 6f 72 20 6f 63 63 75 72 72 65 64 20 74 72 79 69 6e 67 20 74 6f 20 77 n">An.error.occurred.trying.to.w
3c40 72 69 74 65 20 74 6f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 2f rite.to.<paramref.name="stream"/
3c60 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 >.</exception>..........public.v
3c80 6f 69 64 20 57 72 69 74 65 54 6f 28 53 74 72 65 61 6d 20 73 74 72 65 61 6d 29 0d 0a 20 20 20 20 oid.WriteTo(Stream.stream)......
3ca0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 65 61 6d 20 3d 3d ....{..............if.(stream.==
3cc0 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 .null)..................throw.ne
3ce0 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 73 w.ArgumentNullException(nameof(s
3d00 74 72 65 61 6d 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 73 74 72 65 61 tream));..............if.(!strea
3d20 6d 2e 43 61 6e 53 65 65 6b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f m.CanSeek)..................thro
3d40 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 53 74 72 65 61 6d 20 w.new.ArgumentException("Stream.
3d60 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 73 65 65 6b 69 6e 67 22 2c 20 6e 61 6d 65 6f does.not.support.seeking",.nameo
3d80 66 28 73 74 72 65 61 6d 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 77 f(stream));................var.w
3da0 72 69 74 65 72 20 3d 20 6e 65 77 20 42 69 6e 61 72 79 57 72 69 74 65 72 28 73 74 72 65 61 6d 29 riter.=.new.BinaryWriter(stream)
3dc0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 66 6c 61 67 73 20 3d 20 64 65 66 ;................var.flags.=.def
3de0 61 75 6c 74 28 46 69 6c 65 46 6c 61 67 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 ault(FileFlags);..............if
3e00 20 28 49 6e 70 75 74 53 79 73 74 65 6d 2e 73 65 74 74 69 6e 67 73 2e 75 70 64 61 74 65 4d 6f 64 .(InputSystem.settings.updateMod
3e20 65 20 3d 3d 20 49 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 55 70 64 61 74 65 4d 6f 64 65 2e 50 72 e.==.InputSettings.UpdateMode.Pr
3e40 6f 63 65 73 73 45 76 65 6e 74 73 49 6e 46 69 78 65 64 55 70 64 61 74 65 29 0d 0a 20 20 20 20 20 ocessEventsInFixedUpdate).......
3e60 20 20 20 20 20 20 20 20 20 20 20 66 6c 61 67 73 20 7c 3d 20 46 69 6c 65 46 6c 61 67 73 2e 46 69 ...........flags.|=.FileFlags.Fi
3e80 78 65 64 55 70 64 61 74 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 72 69 xedUpdate;................//.Wri
3ea0 74 65 20 68 65 61 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 te.header...............writer.W
3ec0 72 69 74 65 28 6b 46 69 6c 65 46 6f 72 6d 61 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 rite(kFileFormat);..............
3ee0 77 72 69 74 65 72 2e 57 72 69 74 65 28 6b 46 69 6c 65 56 65 72 73 69 6f 6e 29 3b 0d 0a 20 20 20 writer.Write(kFileVersion);.....
3f00 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 28 69 6e 74 29 66 6c 61 67 73 .........writer.Write((int)flags
3f20 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 28 69 6e );..............writer.Write((in
3f40 74 29 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 74 66 6f 72 6d 29 3b 0d 0a 20 20 20 20 20 20 t)Application.platform);........
3f60 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 28 75 6c 6f 6e 67 29 6d 5f 45 76 65 6e ......writer.Write((ulong)m_Even
3f80 74 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 tCount);..............writer.Wri
3fa0 74 65 28 28 75 6c 6f 6e 67 29 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 29 3b 0d 0a te((ulong)m_EventSizeInBytes);..
3fc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 72 69 74 65 20 65 76 65 6e 74 73 2e 0d 0a ..............//.Write.events...
3fe0 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 65 76 65 6e 74 50 74 ............foreach.(var.eventPt
4000 72 20 69 6e 20 74 68 69 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 r.in.this)..............{.......
4020 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 66 69 6e 64 20 77 61 79 20 74 6f ...........////TODO:.find.way.to
4040 20 64 69 72 65 63 74 6c 79 20 77 72 69 74 65 20 61 20 62 79 74 65 2a 20 62 75 66 66 65 72 20 74 .directly.write.a.byte*.buffer.t
4060 6f 20 74 68 65 20 73 74 72 65 61 6d 20 69 6e 73 74 65 61 64 20 6f 66 20 63 6f 70 79 69 6e 67 20 o.the.stream.instead.of.copying.
4080 74 6f 20 61 20 74 65 6d 70 20 62 79 74 65 5b 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 to.a.temp.byte[]................
40a0 20 20 20 20 76 61 72 20 73 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 65 76 65 6e 74 50 74 72 2e 73 ....var.sizeInBytes.=.eventPtr.s
40c0 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 izeInBytes;..................var
40e0 20 62 75 66 66 65 72 20 3d 20 6e 65 77 20 62 79 74 65 5b 73 69 7a 65 49 6e 42 79 74 65 73 5d 3b .buffer.=.new.byte[sizeInBytes];
4100 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 78 65 64 28 62 79 74 65 2a 20 62 75 ..................fixed(byte*.bu
4120 66 66 65 72 50 74 72 20 3d 20 62 75 66 66 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 fferPtr.=.buffer)...............
4140 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 ...{......................Unsafe
4160 55 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 62 75 66 66 65 72 50 74 72 2c 20 65 76 65 6e 74 50 Utility.MemCpy(bufferPtr,.eventP
4180 74 72 2e 64 61 74 61 2c 20 73 69 7a 65 49 6e 42 79 74 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 tr.data,.sizeInBytes);..........
41a0 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 62 75 66 66 65 72 29 ............writer.Write(buffer)
41c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 ;..................}............
41e0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 72 69 74 65 20 64 65 76 69 ..}................//.Write.devi
4200 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 46 6c 75 73 68 28 29 ces...............writer.Flush()
4220 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 6f 73 69 74 69 6f 6e 4f 66 44 65 76 ;..............var.positionOfDev
4240 69 63 65 4c 69 73 74 20 3d 20 73 74 72 65 61 6d 2e 50 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 iceList.=.stream.Position;......
4260 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 43 6f 75 6e 74 20 3d 20 6d 5f 44 65 76 69 ........var.deviceCount.=.m_Devi
4280 63 65 49 6e 66 6f 73 2e 4c 65 6e 67 74 68 53 61 66 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ceInfos.LengthSafe();...........
42a0 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 64 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 20 ...writer.Write(deviceCount);...
42c0 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 64 ...........for.(var.i.=.0;.i.<.d
42e0 65 76 69 63 65 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d eviceCount;.++i)..............{.
4300 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 76 61 72 20 64 65 76 69 63 65 20 .................ref.var.device.
4320 3d 20 72 65 66 20 6d 5f 44 65 76 69 63 65 49 6e 66 6f 73 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 =.ref.m_DeviceInfos[i];.........
4340 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 64 65 76 69 63 65 2e 64 65 76 .........writer.Write(device.dev
4360 69 63 65 49 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e iceId);..................writer.
4380 57 72 69 74 65 28 64 65 76 69 63 65 2e 6c 61 79 6f 75 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 Write(device.layout);...........
43a0 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 64 65 76 69 63 65 2e 73 74 61 74 65 .......writer.Write(device.state
43c0 46 6f 72 6d 61 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 Format);..................writer
43e0 2e 57 72 69 74 65 28 64 65 76 69 63 65 2e 73 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 29 3b .Write(device.stateSizeInBytes);
4400 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 57 72 69 74 65 28 64 ..................writer.Write(d
4420 65 76 69 63 65 2e 6d 5f 46 75 6c 6c 4c 61 79 6f 75 74 4a 73 6f 6e 20 3f 3f 20 73 74 72 69 6e 67 evice.m_FullLayoutJson.??.string
4440 2e 45 6d 70 74 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 .Empty);..............}.........
4460 20 20 20 20 20 20 20 2f 2f 20 57 72 69 74 65 20 6f 66 66 73 65 74 20 6f 66 20 64 65 76 69 63 65 .......//.Write.offset.of.device
4480 20 6c 69 73 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 65 72 2e 46 6c 75 73 68 .list...............writer.Flush
44a0 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 66 66 73 65 74 4f 66 44 65 76 ();..............var.offsetOfDev
44c0 69 63 65 4c 69 73 74 20 3d 20 73 74 72 65 61 6d 2e 50 6f 73 69 74 69 6f 6e 20 2d 20 70 6f 73 69 iceList.=.stream.Position.-.posi
44e0 74 69 6f 6e 4f 66 44 65 76 69 63 65 4c 69 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 tionOfDeviceList;..............w
4500 72 69 74 65 72 2e 57 72 69 74 65 28 6f 66 66 73 65 74 4f 66 44 65 76 69 63 65 4c 69 73 74 29 3b riter.Write(offsetOfDeviceList);
4520 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d ..........}............///.<summ
4540 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 61 64 20 74 68 65 20 63 6f 6e 74 65 ary>..........///.Read.the.conte
4560 6e 74 73 20 6f 66 20 61 6e 20 69 6e 70 75 74 20 65 76 65 6e 74 20 74 72 61 63 65 20 73 74 6f 72 nts.of.an.input.event.trace.stor
4580 65 64 20 69 6e 20 74 68 65 20 67 69 76 65 6e 20 66 69 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f ed.in.the.given.file.........../
45a0 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 //.</summary>..........///.<para
45c0 6d 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 3e 50 61 74 68 20 74 6f 20 61 20 66 69 6c 65 m.name="filePath">Path.to.a.file
45e0 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f .</param>..........///.<exceptio
4600 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c n.cref="ArgumentNullException"><
4620 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 69 73 20 3c 63 paramref.name="filePath"/>.is.<c
4640 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d >null</c>.or.empty.</exception>.
4660 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 46 69 .........///.<exception.cref="Fi
4680 6c 65 4e 6f 74 46 6f 75 6e 64 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e leNotFoundException"><paramref.n
46a0 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 69 73 20 69 6e 76 61 6c 69 64 2e 3c 2f 65 78 ame="filePath"/>.is.invalid.</ex
46c0 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e ception>..........///.<exception
46e0 20 63 72 65 66 3d 22 44 69 72 65 63 74 6f 72 79 4e 6f 74 46 6f 75 6e 64 45 78 63 65 70 74 69 6f .cref="DirectoryNotFoundExceptio
4700 6e 22 3e 41 20 64 69 72 65 63 74 6f 72 79 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 n">A.directory.in.<paramref.name
4720 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 69 73 20 69 6e 76 61 6c 69 64 2e 3c 2f 65 78 63 65 70 ="filePath"/>.is.invalid.</excep
4740 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 tion>..........///.<exception.cr
4760 65 66 3d 22 55 6e 61 75 74 68 6f 72 69 7a 65 64 41 63 63 65 73 73 45 78 63 65 70 74 69 6f 6e 22 ef="UnauthorizedAccessException"
4780 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 63 61 6e ><paramref.name="filePath"/>.can
47a0 6e 6f 74 20 62 65 20 61 63 63 65 73 73 65 64 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 not.be.accessed.</exception>....
47c0 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ......///.<remarks>..........///
47e0 20 54 68 69 73 20 6d 65 74 68 6f 64 20 72 65 70 6c 61 63 65 73 20 74 68 65 20 63 6f 6e 74 65 6e .This.method.replaces.the.conten
4800 74 73 20 6f 66 20 74 68 65 20 74 72 61 63 65 20 77 69 74 68 20 74 68 6f 73 65 20 72 65 61 64 20 ts.of.the.trace.with.those.read.
4820 66 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 66 69 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f from.the.given.file...........//
4840 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c /.</remarks>..........///.<seeal
4860 73 6f 20 63 72 65 66 3d 22 57 72 69 74 65 54 6f 28 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 so.cref="WriteTo(string)"/>.....
4880 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 52 65 61 64 46 72 6f 6d 28 73 74 72 69 6e 67 .....public.void.ReadFrom(string
48a0 20 66 69 6c 65 50 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 .filePath)..........{...........
48c0 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 66 69 6c 65 ...if.(string.IsNullOrEmpty(file
48e0 50 61 74 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 Path))..................throw.ne
4900 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 66 w.ArgumentNullException(nameof(f
4920 69 6c 65 50 61 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 73 69 6e 67 20 ilePath));................using.
4940 28 76 61 72 20 73 74 72 65 61 6d 20 3d 20 46 69 6c 65 2e 4f 70 65 6e 52 65 61 64 28 66 69 6c 65 (var.stream.=.File.OpenRead(file
4960 50 61 74 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 52 65 61 64 46 72 6f 6d Path))..................ReadFrom
4980 28 73 74 72 65 61 6d 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 (stream);..........}............
49a0 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 61 64 20 ///.<summary>..........///.Read.
49c0 74 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 61 6e 20 69 6e 70 75 74 20 65 76 65 6e 74 20 74 the.contents.of.an.input.event.t
49e0 72 61 63 65 20 66 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 73 74 72 65 61 6d 2e 0d 0a 20 20 20 race.from.the.given.stream......
4a00 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</summary>..........///
4a20 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 3e 41 20 73 74 72 65 61 6d 20 6f .<param.name="stream">A.stream.o
4a40 66 20 62 69 6e 61 72 79 20 64 61 74 61 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 20 72 65 63 6f 72 f.binary.data.containing.a.recor
4a60 64 65 64 20 65 76 65 6e 74 20 74 72 61 63 65 20 61 73 20 77 72 69 74 74 65 6e 20 6f 75 74 20 77 ded.event.trace.as.written.out.w
4a80 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 57 72 69 74 65 54 6f 28 53 74 72 65 61 6d 29 22 2f ith.<see.cref="WriteTo(Stream)"/
4aa0 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4d 75 73 74 20 73 75 70 70 6f 72 74 20 72 65 61 >...........///.Must.support.rea
4ac0 64 69 6e 67 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 ding.</param>..........///.<exce
4ae0 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f ption.cref="ArgumentNullExceptio
4b00 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 2f 3e 20 69 73 20 n"><paramref.name="stream"/>.is.
4b20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 <c>null</c>.</exception>........
4b40 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 ..///.<exception.cref="ArgumentE
4b60 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d xception"><paramref.name="stream
4b80 22 2f 3e 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 72 65 61 64 69 6e 67 2e 3c 2f 65 "/>.does.not.support.reading.</e
4ba0 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f xception>..........///.<exceptio
4bc0 6e 20 63 72 65 66 3d 22 49 4f 45 78 63 65 70 74 69 6f 6e 22 3e 41 6e 20 65 72 72 6f 72 20 6f 63 n.cref="IOException">An.error.oc
4be0 63 75 72 72 65 64 20 74 72 79 69 6e 67 20 74 6f 20 72 65 61 64 20 66 72 6f 6d 20 3c 70 61 72 61 curred.trying.to.read.from.<para
4c00 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 2f 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e mref.name="stream"/>.</exception
4c20 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 >..........///.<remarks>........
4c40 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 72 65 70 6c 61 63 65 73 20 74 68 65 20 63 ..///.This.method.replaces.the.c
4c60 6f 6e 74 65 6e 74 73 20 6f 66 20 74 68 65 20 65 76 65 6e 74 20 74 72 61 63 65 20 77 69 74 68 20 ontents.of.the.event.trace.with.
4c80 74 68 6f 73 65 20 72 65 61 64 20 66 72 6f 6d 20 74 68 65 20 73 74 72 65 61 6d 2e 20 49 74 20 64 those.read.from.the.stream..It.d
4ca0 6f 65 73 20 6e 6f 74 20 61 70 70 65 6e 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 74 oes.not.append..........///.to.t
4cc0 68 65 20 65 78 69 73 74 69 6e 67 20 74 72 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 he.existing.trace...........///.
4ce0 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f </remarks>..........///.<seealso
4d00 20 63 72 65 66 3d 22 57 72 69 74 65 54 6f 28 53 74 72 65 61 6d 29 22 2f 3e 0d 0a 20 20 20 20 20 .cref="WriteTo(Stream)"/>.......
4d20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 52 65 61 64 46 72 6f 6d 28 53 74 72 65 61 6d 20 73 ...public.void.ReadFrom(Stream.s
4d40 74 72 65 61 6d 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 tream)..........{..............i
4d60 66 20 28 73 74 72 65 61 6d 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 f.(stream.==.null)..............
4d80 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 ....throw.new.ArgumentNullExcept
4da0 69 6f 6e 28 6e 61 6d 65 6f 66 28 73 74 72 65 61 6d 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ion(nameof(stream));............
4dc0 20 20 69 66 20 28 21 73 74 72 65 61 6d 2e 43 61 6e 52 65 61 64 29 0d 0a 20 20 20 20 20 20 20 20 ..if.(!stream.CanRead)..........
4de0 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 ........throw.new.ArgumentExcept
4e00 69 6f 6e 28 22 53 74 72 65 61 6d 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 72 65 61 ion("Stream.does.not.support.rea
4e20 64 69 6e 67 22 2c 20 6e 61 6d 65 6f 66 28 73 74 72 65 61 6d 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 ding",.nameof(stream));.........
4e40 20 20 20 20 20 20 20 76 61 72 20 72 65 61 64 65 72 20 3d 20 6e 65 77 20 42 69 6e 61 72 79 52 65 .......var.reader.=.new.BinaryRe
4e60 61 64 65 72 28 73 74 72 65 61 6d 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ader(stream);................//.
4e80 52 65 61 64 20 68 65 61 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 65 Read.header...............if.(re
4ea0 61 64 65 72 2e 52 65 61 64 49 6e 74 33 32 28 29 20 21 3d 20 6b 46 69 6c 65 46 6f 72 6d 61 74 29 ader.ReadInt32().!=.kFileFormat)
4ec0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 4f 45 78 ..................throw.new.IOEx
4ee0 63 65 70 74 69 6f 6e 28 24 22 53 74 72 65 61 6d 20 64 6f 65 73 20 6e 6f 74 20 61 70 70 65 61 72 ception($"Stream.does.not.appear
4f00 20 74 6f 20 62 65 20 61 6e 20 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 20 28 6e 6f 20 27 7b .to.be.an.InputEventTrace.(no.'{
4f20 6b 46 69 6c 65 46 6f 72 6d 61 74 7d 27 20 63 6f 64 65 29 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 kFileFormat}'.code)");..........
4f40 20 20 20 20 69 66 20 28 72 65 61 64 65 72 2e 52 65 61 64 49 6e 74 33 32 28 29 20 3e 20 6b 46 69 ....if.(reader.ReadInt32().>.kFi
4f60 6c 65 56 65 72 73 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f leVersion)..................thro
4f80 77 20 6e 65 77 20 49 4f 45 78 63 65 70 74 69 6f 6e 28 24 22 53 74 72 65 61 6d 20 69 73 20 61 6e w.new.IOException($"Stream.is.an
4fa0 20 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 20 62 75 74 20 61 20 6e 65 77 65 72 20 76 65 72 .InputEventTrace.but.a.newer.ver
4fc0 73 69 6f 6e 20 28 65 78 70 65 63 74 65 64 20 76 65 72 73 69 6f 6e 20 7b 6b 46 69 6c 65 56 65 72 sion.(expected.version.{kFileVer
4fe0 73 69 6f 6e 7d 20 6f 72 20 62 65 6c 6f 77 29 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 sion}.or.below)");..............
5000 72 65 61 64 65 72 2e 52 65 61 64 49 6e 74 33 32 28 29 3b 20 2f 2f 20 46 6c 61 67 73 3b 20 69 67 reader.ReadInt32();.//.Flags;.ig
5020 6e 6f 72 65 64 20 66 6f 72 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 61 64 nored.for.now...............read
5040 65 72 2e 52 65 61 64 49 6e 74 33 32 28 29 3b 20 2f 2f 20 50 6c 61 74 66 6f 72 6d 3b 20 66 6f 72 er.ReadInt32();.//.Platform;.for
5060 20 6e 6f 77 20 77 65 27 72 65 20 6e 6f 74 20 64 6f 69 6e 67 20 61 6e 79 74 68 69 6e 67 20 77 69 .now.we're.not.doing.anything.wi
5080 74 68 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 76 65 6e 74 43 6f 75 th.it...............var.eventCou
50a0 6e 74 20 3d 20 72 65 61 64 65 72 2e 52 65 61 64 55 49 6e 74 36 34 28 29 3b 0d 0a 20 20 20 20 20 nt.=.reader.ReadUInt64();.......
50c0 20 20 20 20 20 20 20 76 61 72 20 74 6f 74 61 6c 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 .......var.totalEventSizeInBytes
50e0 20 3d 20 72 65 61 64 65 72 2e 52 65 61 64 55 49 6e 74 36 34 28 29 3b 0d 0a 20 20 20 20 20 20 20 .=.reader.ReadUInt64();.........
5100 20 20 20 20 20 76 61 72 20 6f 6c 64 42 75 66 66 65 72 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 .....var.oldBuffer.=.m_EventBuff
5120 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 65 76 65 6e 74 43 6f 75 6e er;................if.(eventCoun
5140 74 20 3e 20 30 20 26 26 20 74 6f 74 61 6c 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3e t.>.0.&&.totalEventSizeInBytes.>
5160 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .0)..............{..............
5180 20 20 20 20 2f 2f 20 41 6c 6c 6f 63 61 74 65 20 62 75 66 66 65 72 2c 20 69 66 20 6e 65 65 64 20 ....//.Allocate.buffer,.if.need.
51a0 62 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 79 74 65 2a 20 62 75 66 66 65 be...................byte*.buffe
51c0 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 r;..................if.(m_EventB
51e0 75 66 66 65 72 20 21 3d 20 6e 75 6c 6c 20 26 26 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 69 uffer.!=.null.&&.m_EventBufferSi
5200 7a 65 20 3e 3d 20 28 6c 6f 6e 67 29 74 6f 74 61 6c 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 ze.>=.(long)totalEventSizeInByte
5220 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 s)..................{...........
5240 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 45 78 69 73 74 69 6e 67 20 62 75 66 66 65 72 20 69 73 ...........//.Existing.buffer.is
5260 20 6c 61 72 67 65 20 65 6e 6f 75 67 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .large.enough...................
5280 20 20 20 20 62 75 66 66 65 72 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 ....buffer.=.m_EventBuffer;.....
52a0 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............}..................
52c0 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 else..................{.........
52e0 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 66 66 65 72 20 3d 20 28 62 79 74 65 2a 29 55 6e 73 .............buffer.=.(byte*)Uns
5300 61 66 65 55 74 69 6c 69 74 79 2e 4d 61 6c 6c 6f 63 28 28 6c 6f 6e 67 29 74 6f 74 61 6c 45 76 65 afeUtility.Malloc((long)totalEve
5320 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 2c 20 34 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e 50 65 72 73 ntSizeInBytes,.4,.Allocator.Pers
5340 69 73 74 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f istent);......................m_
5360 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 20 3d 20 28 6c 6f 6e 67 29 74 6f 74 61 6c 45 76 65 EventBufferSize.=.(long)totalEve
5380 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ntSizeInBytes;..................
53a0 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 0d 0a 20 20 20 20 20 20 20 20 }..................try..........
53c0 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ........{....................../
53e0 2f 20 52 65 61 64 20 65 76 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 /.Read.events...................
5400 20 20 20 20 76 61 72 20 74 61 69 6c 50 74 72 20 3d 20 62 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 ....var.tailPtr.=.buffer;.......
5420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 6e 64 50 74 72 20 3d 20 74 61 69 6c ...............var.endPtr.=.tail
5440 50 74 72 20 2b 20 74 6f 74 61 6c 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 Ptr.+.totalEventSizeInBytes;....
5460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 74 6f 74 61 6c 45 76 65 6e 74 ..................var.totalEvent
5480 53 69 7a 65 20 3d 20 30 4c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Size.=.0L;......................
54a0 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 75 6c 3b 20 69 20 3c 20 65 76 65 6e 74 43 6f 75 6e 74 for.(var.i.=.0ul;.i.<.eventCount
54c0 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 ;.++i)......................{...
54e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 76 65 6e 74 .......................var.event
5500 54 79 70 65 20 3d 20 72 65 61 64 65 72 2e 52 65 61 64 49 6e 74 33 32 28 29 3b 0d 0a 20 20 20 20 Type.=.reader.ReadInt32();......
5520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 76 65 6e 74 53 69 7a ....................var.eventSiz
5540 65 49 6e 42 79 74 65 73 20 3d 20 28 75 69 6e 74 29 72 65 61 64 65 72 2e 52 65 61 64 55 49 6e 74 eInBytes.=.(uint)reader.ReadUInt
5560 31 36 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 16();..........................v
5580 61 72 20 65 76 65 6e 74 44 65 76 69 63 65 49 64 20 3d 20 28 75 69 6e 74 29 72 65 61 64 65 72 2e ar.eventDeviceId.=.(uint)reader.
55a0 52 65 61 64 55 49 6e 74 31 36 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ReadUInt16();...................
55c0 20 20 20 20 20 20 20 20 20 69 66 20 28 65 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3e 20 .........if.(eventSizeInBytes.>.
55e0 65 6e 64 50 74 72 20 2d 20 74 61 69 6c 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 endPtr.-.tailPtr)...............
5600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ...............break;...........
5620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 28 69 6e 74 2a 29 74 61 69 6c 50 74 72 20 .................*(int*)tailPtr.
5640 3d 20 65 76 65 6e 74 54 79 70 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 =.eventType;....................
5660 20 20 20 20 20 20 74 61 69 6c 50 74 72 20 2b 3d 20 34 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ......tailPtr.+=.4;.............
5680 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 28 75 73 68 6f 72 74 2a 29 74 61 69 6c 50 74 72 20 3d .............*(ushort*)tailPtr.=
56a0 20 28 75 73 68 6f 72 74 29 65 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 .(ushort)eventSizeInBytes;......
56c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 61 69 6c 50 74 72 20 2b 3d 20 32 ....................tailPtr.+=.2
56e0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 28 75 73 68 ;..........................*(ush
5700 6f 72 74 2a 29 74 61 69 6c 50 74 72 20 3d 20 28 75 73 68 6f 72 74 29 65 76 65 6e 74 44 65 76 69 ort*)tailPtr.=.(ushort)eventDevi
5720 63 65 49 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 ceId;..........................t
5740 61 69 6c 50 74 72 20 2b 3d 20 32 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ailPtr.+=.2;....................
5760 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 66 69 6e 64 20 77 61 79 20 74 6f 20 64 69 ........////TODO:.find.way.to.di
5780 72 65 63 74 6c 79 20 72 65 61 64 20 66 72 6f 6d 20 73 74 72 65 61 6d 20 69 6e 74 6f 20 61 20 62 rectly.read.from.stream.into.a.b
57a0 79 74 65 2a 20 70 6f 69 6e 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 yte*.pointer....................
57c0 20 20 20 20 20 20 76 61 72 20 72 65 6d 61 69 6e 69 6e 67 53 69 7a 65 20 3d 20 28 69 6e 74 29 65 ......var.remainingSize.=.(int)e
57e0 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 2d 20 73 69 7a 65 6f 66 28 69 6e 74 29 20 2d 20 ventSizeInBytes.-.sizeof(int).-.
5800 73 69 7a 65 6f 66 28 73 68 6f 72 74 29 20 2d 20 73 69 7a 65 6f 66 28 73 68 6f 72 74 29 3b 0d 0a sizeof(short).-.sizeof(short);..
5820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 74 65 6d 70 ........................var.temp
5840 42 75 66 66 65 72 20 3d 20 72 65 61 64 65 72 2e 52 65 61 64 42 79 74 65 73 28 72 65 6d 61 69 6e Buffer.=.reader.ReadBytes(remain
5860 69 6e 67 53 69 7a 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ingSize);.......................
5880 20 20 20 66 69 78 65 64 28 62 79 74 65 2a 20 74 65 6d 70 42 75 66 66 65 72 50 74 72 20 3d 20 74 ...fixed(byte*.tempBufferPtr.=.t
58a0 65 6d 70 42 75 66 66 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 empBuffer)......................
58c0 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 74 61 69 6c 50 74 72 ....UnsafeUtility.MemCpy(tailPtr
58e0 2c 20 74 65 6d 70 42 75 66 66 65 72 50 74 72 2c 20 72 65 6d 61 69 6e 69 6e 67 53 69 7a 65 29 3b ,.tempBufferPtr,.remainingSize);
5900 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 61 69 6c ............................tail
5920 50 74 72 20 2b 3d 20 72 65 6d 61 69 6e 69 6e 67 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 Ptr.+=.remainingSize;...........
5940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6f 74 61 6c 45 76 65 6e 74 53 69 7a 65 20 2b 3d ...............totalEventSize.+=
5960 20 65 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 .eventSizeInBytes;..............
5980 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 61 69 6c 50 74 72 20 3e 3d 20 65 6e 64 ..............if.(tailPtr.>=.end
59a0 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Ptr)............................
59c0 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ..break;......................}.
59e0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 61 64 20 64 .......................//.Read.d
5a00 65 76 69 63 65 20 69 6e 66 6f 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 evice.infos.....................
5a20 20 20 76 61 72 20 64 65 76 69 63 65 43 6f 75 6e 74 20 3d 20 72 65 61 64 65 72 2e 52 65 61 64 49 ..var.deviceCount.=.reader.ReadI
5a40 6e 74 33 32 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 nt32();......................var
5a60 20 64 65 76 69 63 65 49 6e 66 6f 73 20 3d 20 6e 65 77 20 44 65 76 69 63 65 49 6e 66 6f 5b 64 65 .deviceInfos.=.new.DeviceInfo[de
5a80 76 69 63 65 43 6f 75 6e 74 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 viceCount];.....................
5aa0 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 64 65 76 69 63 65 43 6f 75 6e 74 .for.(var.i.=.0;.i.<.deviceCount
5ac0 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 ;.++i)......................{...
5ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 49 6e 66 .......................deviceInf
5b00 6f 73 5b 69 5d 20 3d 20 6e 65 77 20 44 65 76 69 63 65 49 6e 66 6f 0d 0a 20 20 20 20 20 20 20 20 os[i].=.new.DeviceInfo..........
5b20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
5b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 49 64 20 3d 20 72 65 61 64 65 72 ...............deviceId.=.reader
5b60 2e 52 65 61 64 49 6e 74 33 32 28 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .ReadInt32(),...................
5b80 20 20 20 20 20 20 20 20 20 20 20 6c 61 79 6f 75 74 20 3d 20 72 65 61 64 65 72 2e 52 65 61 64 53 ...........layout.=.reader.ReadS
5ba0 74 72 69 6e 67 28 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tring(),........................
5bc0 20 20 20 20 20 20 73 74 61 74 65 46 6f 72 6d 61 74 20 3d 20 72 65 61 64 65 72 2e 52 65 61 64 49 ......stateFormat.=.reader.ReadI
5be0 6e 74 33 32 28 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nt32(),.........................
5c00 20 20 20 20 20 73 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 72 65 61 64 65 72 2e 52 .....stateSizeInBytes.=.reader.R
5c20 65 61 64 49 6e 74 33 32 28 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eadInt32(),.....................
5c40 20 20 20 20 20 20 20 20 20 6d 5f 46 75 6c 6c 4c 61 79 6f 75 74 4a 73 6f 6e 20 3d 20 72 65 61 64 .........m_FullLayoutJson.=.read
5c60 65 72 2e 52 65 61 64 53 74 72 69 6e 67 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 er.ReadString().................
5c80 20 20 20 20 20 20 20 20 20 7d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........};.....................
5ca0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 73 .}........................//.Ins
5cc0 74 61 6c 6c 20 62 75 66 66 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tall.buffer.....................
5ce0 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 20 3d 20 62 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 ..m_EventBuffer.=.buffer;.......
5d00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 ...............m_EventBufferHead
5d20 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .=.m_EventBuffer;...............
5d40 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 20 3d 20 65 6e 64 50 74 .......m_EventBufferTail.=.endPt
5d60 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 43 r;......................m_EventC
5d80 6f 75 6e 74 20 3d 20 28 6c 6f 6e 67 29 65 76 65 6e 74 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 ount.=.(long)eventCount;........
5da0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 ..............m_EventSizeInBytes
5dc0 20 3d 20 74 6f 74 61 6c 45 76 65 6e 74 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .=.totalEventSize;..............
5de0 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 49 6e 66 6f 73 20 3d 20 64 65 76 69 63 65 49 6e ........m_DeviceInfos.=.deviceIn
5e00 66 6f 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 fos;..................}.........
5e20 20 20 20 20 20 20 20 20 20 63 61 74 63 68 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........catch..................
5e40 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 62 75 66 66 65 {......................if.(buffe
5e60 72 20 21 3d 20 6f 6c 64 42 75 66 66 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r.!=.oldBuffer).................
5e80 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 46 72 65 65 28 62 75 66 66 .........UnsafeUtility.Free(buff
5ea0 65 72 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e 50 65 72 73 69 73 74 65 6e 74 29 3b 0d 0a 20 20 20 20 er,.Allocator.Persistent);......
5ec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 3b 0d 0a 20 20 20 20 20 20 20 20 ................throw;..........
5ee0 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 ........}..............}........
5f00 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 ......else..............{.......
5f20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 20 3d 20 64 65 66 61 75 ...........m_EventBuffer.=.defau
5f40 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 lt;..................m_EventBuff
5f60 65 72 48 65 61 64 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 erHead.=.default;...............
5f80 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 20 3d 20 64 65 66 61 75 6c 74 3b 0d ...m_EventBufferTail.=.default;.
5fa0 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .............}................//
5fc0 20 52 65 6c 65 61 73 65 20 6f 6c 64 20 62 75 66 66 65 72 2c 20 69 66 20 77 65 27 76 65 20 73 77 .Release.old.buffer,.if.we've.sw
5fe0 69 74 63 68 65 64 20 74 6f 20 61 20 6e 65 77 20 6f 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 itched.to.a.new.one.............
6000 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 20 21 3d 20 6f 6c 64 42 75 66 66 65 72 ..if.(m_EventBuffer.!=.oldBuffer
6020 20 26 26 20 6f 6c 64 42 75 66 66 65 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 .&&.oldBuffer.!=.null)..........
6040 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 46 72 65 65 28 6f 6c 64 42 75 ........UnsafeUtility.Free(oldBu
6060 66 66 65 72 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e 50 65 72 73 69 73 74 65 6e 74 29 3b 0d 0a 0d 0a ffer,.Allocator.Persistent);....
6080 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 3b 0d 0a ............++m_ChangeCounter;..
60a0 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 ........}............///.<summar
60c0 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 6f 61 64 20 61 6e 20 69 6e 70 75 74 20 65 76 y>..........///.Load.an.input.ev
60e0 65 6e 74 20 74 72 61 63 65 20 66 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 66 69 6c 65 2e 0d 0a ent.trace.from.the.given.file...
6100 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</summary>..........
6120 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 3e 50 61 74 68 20 ///.<param.name="filePath">Path.
6140 74 6f 20 61 20 66 69 6c 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 to.a.file.</param>..........///.
6160 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 <exception.cref="ArgumentNullExc
6180 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 eption"><paramref.name="filePath
61a0 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 "/>.is.<c>null</c>.or.empty.</ex
61c0 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e ception>..........///.<exception
61e0 20 63 72 65 66 3d 22 46 69 6c 65 4e 6f 74 46 6f 75 6e 64 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 .cref="FileNotFoundException"><p
6200 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 69 73 20 69 6e 76 aramref.name="filePath"/>.is.inv
6220 61 6c 69 64 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c alid.</exception>..........///.<
6240 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 44 69 72 65 63 74 6f 72 79 4e 6f 74 46 6f 75 6e exception.cref="DirectoryNotFoun
6260 64 45 78 63 65 70 74 69 6f 6e 22 3e 41 20 64 69 72 65 63 74 6f 72 79 20 69 6e 20 3c 70 61 72 61 dException">A.directory.in.<para
6280 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 74 68 22 2f 3e 20 69 73 20 69 6e 76 61 6c 69 mref.name="filePath"/>.is.invali
62a0 64 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 d.</exception>..........///.<exc
62c0 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 55 6e 61 75 74 68 6f 72 69 7a 65 64 41 63 63 65 73 73 45 eption.cref="UnauthorizedAccessE
62e0 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 6c 65 50 61 xception"><paramref.name="filePa
6300 74 68 22 2f 3e 20 63 61 6e 6e 6f 74 20 62 65 20 61 63 63 65 73 73 65 64 2e 3c 2f 65 78 63 65 70 th"/>.cannot.be.accessed.</excep
6320 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 tion>..........///.<seealso.cref
6340 3d 22 57 72 69 74 65 54 6f 28 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ="WriteTo(string)"/>..........//
6360 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 61 64 46 72 6f 6d 28 73 74 72 69 6e 67 /.<seealso.cref="ReadFrom(string
6380 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 )"/>..........public.static.Inpu
63a0 74 45 76 65 6e 74 54 72 61 63 65 20 4c 6f 61 64 46 72 6f 6d 28 73 74 72 69 6e 67 20 66 69 6c 65 tEventTrace.LoadFrom(string.file
63c0 50 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 Path)..........{..............if
63e0 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 66 69 6c 65 50 61 74 68 29 .(string.IsNullOrEmpty(filePath)
6400 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 )..................throw.new.Arg
6420 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 66 69 6c 65 50 61 umentNullException(nameof(filePa
6440 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 73 69 6e 67 20 28 76 61 72 20 th));................using.(var.
6460 73 74 72 65 61 6d 20 3d 20 46 69 6c 65 2e 4f 70 65 6e 52 65 61 64 28 66 69 6c 65 50 61 74 68 29 stream.=.File.OpenRead(filePath)
6480 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 4c 6f 61 64 46 72 )..................return.LoadFr
64a0 6f 6d 28 73 74 72 65 61 6d 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 om(stream);..........}..........
64c0 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 6f 61 ..///.<summary>..........///.Loa
64e0 64 20 61 6e 20 65 76 65 6e 74 20 74 72 61 63 65 20 66 72 6f 6d 20 61 20 70 72 65 76 69 6f 75 73 d.an.event.trace.from.a.previous
6500 6c 79 20 63 61 70 74 75 72 65 64 20 65 76 65 6e 74 20 73 74 72 65 61 6d 2e 0d 0a 20 20 20 20 20 ly.captured.event.stream........
6520 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ...///.</summary>..........///.<
6540 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 3e 41 20 73 74 72 65 61 6d 20 61 73 20 param.name="stream">A.stream.as.
6560 77 72 69 74 74 65 6e 20 62 79 20 3c 73 65 65 20 63 72 65 66 3d 22 57 72 69 74 65 54 6f 28 53 74 written.by.<see.cref="WriteTo(St
6580 72 65 61 6d 29 22 2f 3e 2e 20 4d 75 73 74 20 73 75 70 70 6f 72 74 20 72 65 61 64 69 6e 67 2e 3c ream)"/>..Must.support.reading.<
65a0 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 /param>..........///.<returns>Th
65c0 65 20 6c 6f 61 64 65 64 20 65 76 65 6e 74 20 74 72 61 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d e.loaded.event.trace.</returns>.
65e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 .........///.<exception.cref="Ar
6600 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d gumentException"><paramref.name=
6620 22 73 74 72 65 61 6d 22 2f 3e 20 69 73 20 6e 6f 74 20 72 65 61 64 61 62 6c 65 2e 3c 2f 65 78 63 "stream"/>.is.not.readable.</exc
6640 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 eption>..........///.<exception.
6660 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 cref="ArgumentNullException"><pa
6680 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 72 65 61 6d 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c ramref.name="stream"/>.is.<c>nul
66a0 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 l</c>.</exception>..........///.
66c0 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 4f 45 78 63 65 70 74 69 6f 6e 22 3e 54 68 <exception.cref="IOException">Th
66e0 65 20 73 74 72 65 61 6d 20 63 61 6e 6e 6f 74 20 62 65 20 6c 6f 61 64 65 64 20 28 65 2e 67 2e 20 e.stream.cannot.be.loaded.(e.g..
6700 77 72 6f 6e 67 20 66 6f 72 6d 61 74 3b 20 64 65 74 61 69 6c 73 20 69 6e 20 74 68 65 20 65 78 63 wrong.format;.details.in.the.exc
6720 65 70 74 69 6f 6e 29 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f eption).</exception>..........//
6740 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 57 72 69 74 65 54 6f 28 53 74 72 65 61 6d 29 /.<seealso.cref="WriteTo(Stream)
6760 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 "/>..........public.static.Input
6780 45 76 65 6e 74 54 72 61 63 65 20 4c 6f 61 64 46 72 6f 6d 28 53 74 72 65 61 6d 20 73 74 72 65 61 EventTrace.LoadFrom(Stream.strea
67a0 6d 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 m)..........{..............if.(s
67c0 74 72 65 61 6d 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tream.==.null)..................
67e0 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 throw.new.ArgumentNullException(
6800 6e 61 6d 65 6f 66 28 73 74 72 65 61 6d 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 nameof(stream));..............if
6820 20 28 21 73 74 72 65 61 6d 2e 43 61 6e 52 65 61 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .(!stream.CanRead)..............
6840 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 ....throw.new.ArgumentException(
6860 22 53 74 72 65 61 6d 20 6d 75 73 74 20 62 65 20 72 65 61 64 61 62 6c 65 22 2c 20 6e 61 6d 65 6f "Stream.must.be.readable",.nameo
6880 66 28 73 74 72 65 61 6d 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 74 f(stream));................var.t
68a0 72 61 63 65 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 28 29 3b 0d 0a 20 race.=.new.InputEventTrace();...
68c0 20 20 20 20 20 20 20 20 20 20 20 74 72 61 63 65 2e 52 65 61 64 46 72 6f 6d 28 73 74 72 65 61 6d ...........trace.ReadFrom(stream
68e0 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 61 63 65 3b 0d );................return.trace;.
6900 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 .........}............///.<summa
6920 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 74 61 72 74 20 61 20 72 65 70 6c 61 79 20 ry>..........///.Start.a.replay.
6940 6f 66 20 74 68 65 20 65 76 65 6e 74 73 20 69 6e 20 74 68 65 20 74 72 61 63 65 2e 0d 0a 20 20 20 of.the.events.in.the.trace......
6960 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</summary>..........///
6980 20 3c 72 65 74 75 72 6e 73 3e 41 6e 20 6f 62 6a 65 63 74 20 74 68 61 74 20 63 6f 6e 74 72 6f 6c .<returns>An.object.that.control
69a0 73 20 70 6c 61 79 62 61 63 6b 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f s.playback.</returns>........../
69c0 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 61 6c 6c 69 6e //.<remarks>..........///.Callin
69e0 67 20 74 68 69 73 20 6d 65 74 68 6f 64 20 69 6d 70 6c 69 63 69 74 6c 79 20 74 75 72 6e 73 20 6f g.this.method.implicitly.turns.o
6a00 66 66 20 72 65 63 6f 72 64 69 6e 67 2c 20 69 66 20 63 75 72 72 65 6e 74 6c 79 20 65 6e 61 62 6c ff.recording,.if.currently.enabl
6a20 65 64 20 28 69 2e 65 2e 20 69 74 20 63 61 6c 6c 73 20 3c 73 65 65 20 63 72 65 66 3d 22 44 69 73 ed.(i.e..it.calls.<see.cref="Dis
6a40 61 62 6c 65 22 2f 3e 29 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 73 20 72 65 70 6c 61 79 able"/>),..........///.as.replay
6a60 69 6e 67 20 61 6e 20 65 76 65 6e 74 20 74 72 61 63 65 20 63 61 6e 6e 6f 74 20 62 65 20 64 6f 6e ing.an.event.trace.cannot.be.don
6a80 65 20 77 68 69 6c 65 20 69 74 20 69 73 20 61 6c 73 6f 20 63 6f 6e 63 75 72 72 65 6e 74 6c 79 20 e.while.it.is.also.concurrently.
6aa0 6d 6f 64 69 66 69 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 modified...........///.</remarks
6ac0 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c >..........public.ReplayControll
6ae0 65 72 20 52 65 70 6c 61 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 er.Replay()..........{..........
6b00 20 20 20 20 44 69 73 61 62 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 ....Disable();..............retu
6b20 72 6e 20 6e 65 77 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 28 74 68 69 73 29 3b 0d 0a rn.new.ReplayController(this);..
6b40 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 ........}............///.<summar
6b60 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 73 69 7a 65 20 74 68 65 20 63 75 72 72 65 y>..........///.Resize.the.curre
6b80 6e 74 20 65 76 65 6e 74 20 6d 65 6d 6f 72 79 20 62 75 66 66 65 72 20 74 6f 20 74 68 65 20 73 70 nt.event.memory.buffer.to.the.sp
6ba0 65 63 69 66 69 65 64 20 73 69 7a 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d ecified.size...........///.</sum
6bc0 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 mary>..........///.<param.name="
6be0 6e 65 77 42 75 66 66 65 72 53 69 7a 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 newBufferSize"></param>.........
6c00 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 .///.<returns></returns>........
6c20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 ..///.<exception.cref="ArgumentE
6c40 78 63 65 70 74 69 6f 6e 22 3e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 xception"></exception>..........
6c60 70 75 62 6c 69 63 20 62 6f 6f 6c 20 52 65 73 69 7a 65 28 6c 6f 6e 67 20 6e 65 77 42 75 66 66 65 public.bool.Resize(long.newBuffe
6c80 72 53 69 7a 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 rSize)..........{..............i
6ca0 66 20 28 6e 65 77 42 75 66 66 65 72 53 69 7a 65 20 3c 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 f.(newBufferSize.<=.0)..........
6cc0 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 ........throw.new.ArgumentExcept
6ce0 69 6f 6e 28 22 53 69 7a 65 20 6d 75 73 74 20 62 65 20 70 6f 73 69 74 69 76 65 22 2c 20 6e 61 6d ion("Size.must.be.positive",.nam
6d00 65 6f 66 28 6e 65 77 42 75 66 66 65 72 53 69 7a 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 eof(newBufferSize));............
6d20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 20 3d 3d 20 6e 65 77 ....if.(m_EventBufferSize.==.new
6d40 42 75 66 66 65 72 53 69 7a 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 BufferSize)..................ret
6d60 75 72 6e 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 6c 6c 6f urn.true;................//.Allo
6d80 63 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 77 45 76 65 6e 74 42 cate...............var.newEventB
6da0 75 66 66 65 72 20 3d 20 28 62 79 74 65 2a 29 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 61 6c uffer.=.(byte*)UnsafeUtility.Mal
6dc0 6c 6f 63 28 6e 65 77 42 75 66 66 65 72 53 69 7a 65 2c 20 34 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e loc(newBufferSize,.4,.Allocator.
6de0 50 65 72 73 69 73 74 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 Persistent);..............if.(ne
6e00 77 45 76 65 6e 74 42 75 66 66 65 72 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 wEventBuffer.==.default)........
6e20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 ..........return.false;.........
6e40 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 65 78 69 73 74 69 6e 67 20 63 6f .......//.If.we.have.existing.co
6e60 6e 74 65 6e 74 73 2c 20 6d 69 67 72 61 74 65 20 74 68 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 20 ntents,.migrate.them............
6e80 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 ...if.(m_EventCount.>.0)........
6ea0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 ......{..................//.If.w
6ec0 65 27 72 65 20 73 68 72 69 6e 6b 69 6e 67 20 74 68 65 20 62 75 66 66 65 72 20 6f 72 20 68 61 76 e're.shrinking.the.buffer.or.hav
6ee0 65 20 61 20 62 75 66 66 65 72 20 74 68 61 74 20 68 61 73 20 61 6c 72 65 61 64 79 20 77 72 61 70 e.a.buffer.that.has.already.wrap
6f00 70 65 64 20 61 72 6f 75 6e 64 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ped.around,..................//.
6f20 6d 69 67 72 61 74 65 20 65 76 65 6e 74 73 20 6f 6e 65 20 62 79 20 6f 6e 65 2e 0d 0a 20 20 20 20 migrate.events.one.by.one.......
6f40 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 77 42 75 66 66 65 72 53 69 7a 65 20 3c 20 ............if.(newBufferSize.<.
6f60 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 20 7c 7c 20 6d 5f 48 61 73 57 72 61 70 70 65 m_EventBufferSize.||.m_HasWrappe
6f80 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 d)..................{...........
6fa0 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 66 72 6f 6d 50 74 72 20 3d 20 6e 65 77 20 49 6e 70 ...........var.fromPtr.=.new.Inp
6fc0 75 74 45 76 65 6e 74 50 74 72 28 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 6d 5f 45 76 65 6e 74 42 utEventPtr((InputEvent*)m_EventB
6fe0 75 66 66 65 72 48 65 61 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ufferHead);.....................
7000 20 76 61 72 20 74 6f 50 74 72 20 3d 20 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 6e 65 77 45 76 65 .var.toPtr.=.(InputEvent*)newEve
7020 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 ntBuffer;......................v
7040 61 72 20 6e 65 77 45 76 65 6e 74 43 6f 75 6e 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 ar.newEventCount.=.0;...........
7060 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 77 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 ...........var.newEventSizeInByt
7080 65 73 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 es.=.0;......................var
70a0 20 72 65 6d 61 69 6e 69 6e 67 45 76 65 6e 74 42 79 74 65 73 20 3d 20 6d 5f 45 76 65 6e 74 53 69 .remainingEventBytes.=.m_EventSi
70c0 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 zeInBytes;......................
70e0 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 6d 5f 45 76 65 6e 74 43 6f 75 ..for.(var.i.=.0;.i.<.m_EventCou
7100 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d nt;.++i)......................{.
7120 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 76 65 .........................var.eve
7140 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 66 72 6f 6d 50 74 72 2e 73 69 7a 65 49 6e 42 79 ntSizeInBytes.=.fromPtr.sizeInBy
7160 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 tes;..........................va
7180 72 20 61 6c 69 67 6e 65 64 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 65 76 65 6e r.alignedEventSizeInBytes.=.even
71a0 74 53 69 7a 65 49 6e 42 79 74 65 73 2e 41 6c 69 67 6e 54 6f 4d 75 6c 74 69 70 6c 65 4f 66 28 34 tSizeInBytes.AlignToMultipleOf(4
71c0 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f );............................//
71e0 20 57 65 20 6f 6e 6c 79 20 73 74 61 72 74 20 63 6f 70 79 69 6e 67 20 6f 6e 63 65 20 77 65 20 6b .We.only.start.copying.once.we.k
7200 6e 6f 77 20 74 68 61 74 20 74 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 65 76 65 6e 74 73 20 77 65 now.that.the.remaining.events.we
7220 20 68 61 76 65 20 66 69 74 20 69 6e 20 74 68 65 20 6e 65 77 20 62 75 66 66 65 72 2e 0d 0a 20 20 .have.fit.in.the.new.buffer.....
7240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 68 69 73 20 77 61 ......................//.This.wa
7260 79 20 77 65 20 67 65 74 20 74 68 65 20 6e 65 77 65 73 74 20 65 76 65 6e 74 73 20 61 6e 64 20 6e y.we.get.the.newest.events.and.n
7280 6f 74 20 74 68 65 20 6f 6c 64 65 73 74 20 6f 6e 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ot.the.oldest.ones..............
72a0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 65 6d 61 69 6e 69 6e 67 45 76 65 6e 74 42 .............if.(remainingEventB
72c0 79 74 65 73 20 3c 3d 20 6e 65 77 42 75 66 66 65 72 53 69 7a 65 29 0d 0a 20 20 20 20 20 20 20 20 ytes.<=.newBufferSize)..........
72e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
7300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 65 6d ...............UnsafeUtility.Mem
7320 43 70 79 28 74 6f 50 74 72 2c 20 66 72 6f 6d 50 74 72 2e 54 6f 50 6f 69 6e 74 65 72 28 29 2c 20 Cpy(toPtr,.fromPtr.ToPointer(),.
7340 65 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 eventSizeInBytes);..............
7360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6f 50 74 72 20 3d 20 49 6e 70 75 74 45 76 65 ................toPtr.=.InputEve
7380 6e 74 2e 47 65 74 4e 65 78 74 49 6e 4d 65 6d 6f 72 79 28 74 6f 50 74 72 29 3b 0d 0a 20 20 20 20 nt.GetNextInMemory(toPtr);......
73a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 45 76 65 6e 74 ........................newEvent
73c0 53 69 7a 65 49 6e 42 79 74 65 73 20 2b 3d 20 28 69 6e 74 29 61 6c 69 67 6e 65 64 45 76 65 6e 74 SizeInBytes.+=.(int)alignedEvent
73e0 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 SizeInBytes;....................
7400 20 20 20 20 20 20 20 20 20 20 2b 2b 6e 65 77 45 76 65 6e 74 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 ..........++newEventCount;......
7420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 ....................}...........
7440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 61 69 6e 69 6e 67 45 76 65 6e 74 42 .................remainingEventB
7460 79 74 65 73 20 2d 3d 20 61 6c 69 67 6e 65 64 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 3b ytes.-=.alignedEventSizeInBytes;
7480 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 47 ..........................if.(!G
74a0 65 74 4e 65 78 74 45 76 65 6e 74 28 72 65 66 20 66 72 6f 6d 50 74 72 29 29 0d 0a 20 20 20 20 20 etNextEvent(ref.fromPtr)).......
74c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 .......................break;...
74e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ...................}............
7500 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 48 61 73 57 72 61 70 70 65 64 20 3d 20 66 61 6c 73 65 ............m_HasWrapped.=.false
7520 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 43 6f ;......................m_EventCo
7540 75 6e 74 20 3d 20 6e 65 77 45 76 65 6e 74 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 unt.=.newEventCount;............
7560 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 6e ..........m_EventSizeInBytes.=.n
7580 65 77 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ewEventSizeInBytes;.............
75a0 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 .....}..................else....
75c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..............{.................
75e0 20 20 20 20 20 2f 2f 20 53 69 6d 70 6c 65 20 63 61 73 65 20 6f 66 20 6a 75 73 74 20 68 61 76 69 .....//.Simple.case.of.just.havi
7600 6e 67 20 74 6f 20 63 6f 70 79 20 65 76 65 72 79 74 68 69 6e 67 20 62 65 74 77 65 65 6e 20 68 65 ng.to.copy.everything.between.he
7620 61 64 20 61 6e 64 20 74 61 69 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ad.and.tail.....................
7640 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 6e 65 77 45 76 65 6e 74 42 ..UnsafeUtility.MemCpy(newEventB
7660 75 66 66 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 uffer,..........................
7680 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 m_EventBufferHead,..............
76a0 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 29 3b ............m_EventSizeInBytes);
76c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................}.............
76e0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 .}................if.(m_EventBuf
7700 66 65 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e fer.!=.null)..................Un
7720 73 61 66 65 55 74 69 6c 69 74 79 2e 46 72 65 65 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 2c 20 safeUtility.Free(m_EventBuffer,.
7740 41 6c 6c 6f 63 61 74 6f 72 2e 50 65 72 73 69 73 74 65 6e 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 Allocator.Persistent);..........
7760 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 20 3d 20 6e 65 77 42 75 66 ......m_EventBufferSize.=.newBuf
7780 66 65 72 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 ferSize;..............m_EventBuf
77a0 66 65 72 20 3d 20 6e 65 77 45 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 fer.=.newEventBuffer;...........
77c0 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 20 3d 20 6e 65 77 45 76 65 6e 74 42 ...m_EventBufferHead.=.newEventB
77e0 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 uffer;..............m_EventBuffe
7800 72 54 61 69 6c 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 20 2b 20 6d 5f 45 76 65 6e 74 53 rTail.=.m_EventBuffer.+.m_EventS
7820 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d izeInBytes;................if.(m
7840 5f 4d 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 20 3c 20 6e 65 77 42 75 66 66 65 72 53 _MaxEventBufferSize.<.newBufferS
7860 69 7a 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4d 61 78 45 76 65 6e 74 ize)..................m_MaxEvent
7880 42 75 66 66 65 72 53 69 7a 65 20 3d 20 6e 65 77 42 75 66 66 65 72 53 69 7a 65 3b 0d 0a 0d 0a 20 BufferSize.=.newBufferSize;.....
78a0 20 20 20 20 20 20 20 20 20 20 20 2b 2b 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 3b 0d 0a 0d ...........++m_ChangeCounter;...
78c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 .............return.true;.......
78e0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 ...}............///.<summary>...
7900 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 73 65 74 20 74 68 65 20 74 72 61 63 65 2e 20 43 6c 65 61 .......///.Reset.the.trace..Clea
7920 72 73 20 61 6c 6c 20 72 65 63 6f 72 64 65 64 20 65 76 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 rs.all.recorded.events..........
7940 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 .///.</summary>..........public.
7960 76 6f 69 64 20 43 6c 65 61 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 void.Clear()..........{.........
7980 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 20 3d 20 6d 5f 45 76 65 6e 74 .....m_EventBufferHead.=.m_Event
79a0 42 75 66 66 65 72 54 61 69 6c 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 BufferTail.=.default;...........
79c0 20 20 20 6d 5f 45 76 65 6e 74 43 6f 75 6e 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ...m_EventCount.=.0;............
79e0 20 20 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 30 3b 0d 0a 20 20 20 20 20 ..m_EventSizeInBytes.=.0;.......
7a00 20 20 20 20 20 20 20 2b 2b 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 3b 0d 0a 20 20 20 20 20 .......++m_ChangeCounter;.......
7a20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 49 6e 66 6f 73 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 .......m_DeviceInfos.=.null;....
7a40 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e ......}............///.<summary>
7a60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 74 61 72 74 20 72 65 63 6f 72 64 69 6e 67 20 65 76 ..........///.Start.recording.ev
7a80 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 ents...........///.</summary>...
7aa0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 44 69 73 61 62 6c .......///.<seealso.cref="Disabl
7ac0 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 45 6e 61 62 6c 65 e"/>..........public.void.Enable
7ae0 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d ()..........{..............if.(m
7b00 5f 45 6e 61 62 6c 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 _Enabled)..................retur
7b20 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 n;................if.(m_EventBuf
7b40 66 65 72 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 fer.==.default).................
7b60 20 41 6c 6c 6f 63 61 74 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 .Allocate();................Inpu
7b80 74 53 79 73 74 65 6d 2e 6f 6e 45 76 65 6e 74 20 2b 3d 20 4f 6e 49 6e 70 75 74 45 76 65 6e 74 3b tSystem.onEvent.+=.OnInputEvent;
7ba0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 63 6f 72 64 46 72 61 6d 65 4d ..............if.(m_RecordFrameM
7bc0 61 72 6b 65 72 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 arkers)..................InputSy
7be0 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 20 2b 3d 20 4f 6e 42 65 66 6f 72 65 55 stem.onBeforeUpdate.+=.OnBeforeU
7c00 70 64 61 74 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 6e 61 62 6c 65 64 20 pdate;................m_Enabled.
7c20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f =.true;..........}............//
7c40 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 74 6f 70 20 72 65 /.<summary>..........///.Stop.re
7c60 63 6f 72 64 69 6e 67 20 65 76 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 cording.events...........///.</s
7c80 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 ummary>..........///.<seealso.cr
7ca0 65 66 3d 22 45 6e 61 62 6c 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f ef="Enable"/>..........public.vo
7cc0 69 64 20 44 69 73 61 62 6c 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 id.Disable()..........{.........
7ce0 20 20 20 20 20 69 66 20 28 21 6d 5f 45 6e 61 62 6c 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 .....if.(!m_Enabled)............
7d00 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 ......return;................Inp
7d20 75 74 53 79 73 74 65 6d 2e 6f 6e 45 76 65 6e 74 20 2d 3d 20 4f 6e 49 6e 70 75 74 45 76 65 6e 74 utSystem.onEvent.-=.OnInputEvent
7d40 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 ;..............InputSystem.onBef
7d60 6f 72 65 55 70 64 61 74 65 20 2d 3d 20 4f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 3b 0d 0a 0d 0a oreUpdate.-=.OnBeforeUpdate;....
7d80 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 6e 61 62 6c 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a ............m_Enabled.=.false;..
7da0 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 ........}............///.<summar
7dc0 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 61 73 65 64 20 6f 6e 20 74 68 65 20 67 69 76 y>..........///.Based.on.the.giv
7de0 65 6e 20 65 76 65 6e 74 20 70 6f 69 6e 74 65 72 2c 20 72 65 74 75 72 6e 20 61 20 70 6f 69 6e 74 en.event.pointer,.return.a.point
7e00 65 72 20 74 6f 20 74 68 65 20 6e 65 78 74 20 65 76 65 6e 74 20 69 6e 20 74 68 65 20 74 72 61 63 er.to.the.next.event.in.the.trac
7e20 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 e...........///.</summary>......
7e40 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 75 72 72 65 6e 74 22 3e 41 20 ....///.<param.name="current">A.
7e60 70 6f 69 6e 74 65 72 20 74 6f 20 61 6e 20 65 76 65 6e 74 20 69 6e 20 74 68 65 20 74 72 61 63 65 pointer.to.an.event.in.the.trace
7e80 20 6f 72 20 61 20 3c 63 3e 64 65 66 61 75 6c 74 28 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 .or.a.<c>default(InputEventTrace
7ea0 29 3c 2f 63 3e 2e 20 49 6e 20 74 68 65 20 66 6f 72 6d 65 72 20 63 61 73 65 2c 0d 0a 20 20 20 20 )</c>..In.the.former.case,......
7ec0 20 20 20 20 2f 2f 2f 20 74 68 65 20 70 6f 69 6e 74 65 72 20 77 69 6c 6c 20 62 65 20 75 70 64 61 ....///.the.pointer.will.be.upda
7ee0 74 65 64 20 74 6f 20 74 68 65 20 6e 65 78 74 20 65 76 65 6e 74 2c 20 69 66 20 74 68 65 72 65 20 ted.to.the.next.event,.if.there.
7f00 69 73 20 6f 6e 65 2e 20 49 6e 20 74 68 65 20 6c 61 74 74 65 72 20 63 61 73 65 2c 20 74 68 65 20 is.one..In.the.latter.case,.the.
7f20 70 6f 69 6e 74 65 72 20 77 69 6c 6c 20 62 65 20 75 70 64 61 74 65 64 0d 0a 20 20 20 20 20 20 20 pointer.will.be.updated.........
7f40 20 2f 2f 2f 20 74 6f 20 74 68 65 20 66 69 72 73 74 20 65 76 65 6e 74 20 69 6e 20 74 68 65 20 74 .///.to.the.first.event.in.the.t
7f60 72 61 63 65 2c 20 69 66 20 74 68 65 72 65 20 69 73 20 6f 6e 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a race,.if.there.is.one.</param>..
7f80 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 3c 63 3e ........///.<returns>True.if.<c>
7fa0 63 75 72 72 65 6e 74 3c 2f 63 3e 20 68 61 73 20 62 65 65 6e 20 73 65 74 20 74 6f 20 74 68 65 20 current</c>.has.been.set.to.the.
7fc0 6e 65 78 74 20 65 76 65 6e 74 2c 20 66 61 6c 73 65 20 6f 74 68 65 72 77 69 73 65 2e 3c 2f 72 65 next.event,.false.otherwise.</re
7fe0 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 turns>..........///.<remarks>...
8000 20 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 73 74 6f 72 61 67 65 20 69 6e 20 6d 65 6d 6f .......///.Event.storage.in.memo
8020 72 79 20 6d 61 79 20 62 65 20 63 69 72 63 75 6c 61 72 20 69 66 20 74 68 65 20 65 76 65 6e 74 20 ry.may.be.circular.if.the.event.
8040 62 75 66 66 65 72 20 69 73 20 66 69 78 65 64 20 69 6e 20 73 69 7a 65 20 6f 72 20 68 61 73 20 72 buffer.is.fixed.in.size.or.has.r
8060 65 61 63 68 65 64 20 6d 61 78 69 6d 75 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 69 7a 65 eached.maximum..........///.size
8080 20 61 6e 64 20 6e 65 77 20 65 76 65 6e 74 73 20 73 74 61 72 74 20 6f 76 65 72 77 72 69 74 69 6e .and.new.events.start.overwritin
80a0 67 20 6f 6c 64 20 65 76 65 6e 74 73 2e 20 54 68 69 73 20 6d 65 74 68 6f 64 20 77 69 6c 6c 20 61 g.old.events..This.method.will.a
80c0 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 73 74 61 72 74 20 77 69 74 68 20 74 68 65 20 66 69 72 73 utomatically.start.with.the.firs
80e0 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 76 65 6e 74 20 77 68 65 6e 20 74 68 65 20 67 69 t..........///.event.when.the.gi
8100 76 65 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 75 72 72 65 6e 74 22 2f 3e 20 65 ven.<paramref.name="current"/>.e
8120 76 65 6e 74 20 69 73 20 6e 75 6c 6c 2e 20 41 6e 79 20 73 75 62 73 65 71 75 65 6e 74 20 63 61 6c vent.is.null..Any.subsequent.cal
8140 6c 20 77 69 74 68 20 74 68 65 6e 20 6c 6f 6f 70 20 6f 76 65 72 0d 0a 20 20 20 20 20 20 20 20 2f l.with.then.loop.over........../
8160 2f 2f 20 74 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 65 76 65 6e 74 73 20 75 6e 74 69 6c 20 6e 6f //.the.remaining.events.until.no
8180 20 6d 6f 72 65 20 65 76 65 6e 74 73 20 61 72 65 20 61 76 61 69 6c 61 62 6c 65 2e 0d 0a 20 20 20 .more.events.are.available......
81a0 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 .....///..........///.Note.that.
81c0 69 74 20 69 73 20 56 45 52 59 20 49 4d 50 4f 52 54 41 4e 54 20 74 68 61 74 20 74 68 65 20 62 75 it.is.VERY.IMPORTANT.that.the.bu
81e0 66 66 65 72 20 69 73 20 6e 6f 74 20 6d 6f 64 69 66 69 65 64 20 77 68 69 6c 65 20 69 74 65 72 61 ffer.is.not.modified.while.itera
8200 74 69 6e 67 20 6f 76 65 72 20 65 76 65 6e 74 73 20 74 68 69 73 20 77 61 79 2e 0d 0a 20 20 20 20 ting.over.events.this.way.......
8220 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 69 73 20 69 73 20 6e 6f 74 20 65 6e 73 75 72 65 64 2c 20 ....///.If.this.is.not.ensured,.
8240 69 6e 76 61 6c 69 64 20 6d 65 6d 6f 72 79 20 61 63 63 65 73 73 65 73 20 6d 61 79 20 72 65 73 75 invalid.memory.accesses.may.resu
8260 6c 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 lt...........///..........///.<e
8280 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 xample>..........///.<code>.....
82a0 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4c 6f 6f 70 20 6f 76 65 72 20 61 6c 6c 20 65 76 65 6e 74 73 .....///.//.Loop.over.all.events
82c0 20 69 6e 20 74 68 65 20 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 20 69 6e 20 74 68 65 20 60 .in.the.InputEventTrace.in.the.`
82e0 74 72 61 63 65 60 20 76 61 72 69 61 62 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 trace`.variable...........///.va
8300 72 20 63 75 72 72 65 6e 74 20 3d 20 64 65 66 61 75 6c 74 28 49 6e 70 75 74 45 76 65 6e 74 50 74 r.current.=.default(InputEventPt
8320 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 68 69 6c 65 20 28 74 72 61 63 65 2e 47 65 r);..........///.while.(trace.Ge
8340 74 4e 65 78 74 45 76 65 6e 74 28 72 65 66 20 63 75 72 72 65 6e 74 29 29 0d 0a 20 20 20 20 20 20 tNextEvent(ref.current))........
8360 20 20 2f 2f 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 44 65 62 75 67 2e 4c ..///.{..........///.....Debug.L
8380 6f 67 28 63 75 72 72 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7d 0d 0a 20 20 20 og(current);..........///.}.....
83a0 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f .....///.</code>..........///.</
83c0 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e example>..........///.</remarks>
83e0 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 47 65 74 4e 65 78 74 45 76 65 ..........public.bool.GetNextEve
8400 6e 74 28 72 65 66 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 63 75 72 72 65 6e 74 29 0d 0a 20 nt(ref.InputEventPtr.current)...
8420 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e .......{..............if.(m_Even
8440 74 42 75 66 66 65 72 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tBuffer.==.default).............
8460 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 .....return.false;..............
8480 20 20 2f 2f 20 49 66 20 68 65 61 64 20 69 73 20 6e 75 6c 6c 2c 20 74 61 69 6c 20 69 73 20 74 6f ..//.If.head.is.null,.tail.is.to
84a0 6f 20 61 6e 64 20 69 74 20 6d 65 61 6e 73 20 74 68 65 72 65 27 73 20 6e 6f 74 68 69 6e 67 20 69 o.and.it.means.there's.nothing.i
84c0 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 62 75 66 66 65 72 20 79 65 74 n.the..............//.buffer.yet
84e0 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 ...............if.(m_EventBuffer
8500 48 65 61 64 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Head.==.default)................
8520 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f ..return.false;................/
8540 2f 20 49 66 20 63 75 72 72 65 6e 74 20 69 73 20 6e 75 6c 6c 2c 20 73 74 61 72 74 20 69 74 65 72 /.If.current.is.null,.start.iter
8560 61 74 69 6e 67 20 61 74 20 68 65 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ating.at.head...............if.(
8580 21 63 75 72 72 65 6e 74 2e 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a !current.valid)..............{..
85a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 20 3d 20 6e 65 77 20 49 6e ................current.=.new.In
85c0 70 75 74 45 76 65 6e 74 50 74 72 28 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 6d 5f 45 76 65 6e 74 putEventPtr((InputEvent*)m_Event
85e0 42 75 66 66 65 72 48 65 61 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 BufferHead);..................re
8600 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 turn.true;..............}.......
8620 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 74 68 65 72 77 69 73 65 20 66 65 65 6c 20 6f 75 72 20 77 .........//.Otherwise.feel.our.w
8640 61 79 20 66 6f 72 77 61 72 64 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e ay.forward.................var.n
8660 65 78 74 45 76 65 6e 74 20 3d 20 28 62 79 74 65 2a 29 63 75 72 72 65 6e 74 2e 4e 65 78 74 28 29 extEvent.=.(byte*)current.Next()
8680 2e 64 61 74 61 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 6e 64 4f 66 42 75 66 .data;..............var.endOfBuf
86a0 66 65 72 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 20 2b 20 6d 5f 45 76 65 6e 74 42 75 66 fer.=.m_EventBuffer.+.m_EventBuf
86c0 66 65 72 53 69 7a 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 ferSize;................//.If.we
86e0 27 76 65 20 72 75 6e 20 69 6e 74 6f 20 6f 75 72 20 74 61 69 6c 2c 20 74 68 65 72 65 27 73 20 6e 've.run.into.our.tail,.there's.n
8700 6f 20 6d 6f 72 65 20 65 76 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 o.more.events...............if.(
8720 6e 65 78 74 45 76 65 6e 74 20 3d 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 29 0d nextEvent.==.m_EventBufferTail).
8740 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a .................return.false;..
8760 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 27 76 65 20 72 65 61 63 68 65 ..............//.If.we've.reache
8780 64 20 62 6c 61 6e 6b 20 73 70 61 63 65 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 d.blank.space.at.the.end.of.the.
87a0 62 75 66 66 65 72 2c 20 77 72 61 70 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 72 6f buffer,.wrap..............//.aro
87c0 75 6e 64 20 74 6f 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 2e 20 49 6e 20 74 68 69 73 20 73 63 und.to.the.beginning..In.this.sc
87e0 65 6e 61 72 69 6f 20 74 68 65 72 65 20 6d 75 73 74 20 62 65 20 61 6e 20 65 76 65 6e 74 0d 0a 20 enario.there.must.be.an.event...
8800 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 74 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 6f ...........//.at.the.beginning.o
8820 66 20 74 68 65 20 62 75 66 66 65 72 3b 20 74 61 69 6c 20 77 6f 6e 27 74 20 70 6f 73 69 74 69 6f f.the.buffer;.tail.won't.positio
8840 6e 20 69 74 73 65 6c 66 20 61 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6d 5f 45 76 n.itself.at..............//.m_Ev
8860 65 6e 74 42 75 66 66 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 65 6e 64 4f entBuffer...............if.(endO
8880 66 42 75 66 66 65 72 20 2d 20 6e 65 78 74 45 76 65 6e 74 20 3c 20 49 6e 70 75 74 45 76 65 6e 74 fBuffer.-.nextEvent.<.InputEvent
88a0 2e 6b 42 61 73 65 45 76 65 6e 74 53 69 7a 65 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .kBaseEventSize.||..............
88c0 20 20 20 20 28 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 6e 65 78 74 45 76 65 6e 74 29 2d 3e 73 69 ....((InputEvent*)nextEvent)->si
88e0 7a 65 49 6e 42 79 74 65 73 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a zeInBytes.==.0)..............{..
8900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 78 74 45 76 65 6e 74 20 3d 20 6d 5f 45 76 ................nextEvent.=.m_Ev
8920 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 entBuffer;..................if.(
8940 6e 65 78 74 45 76 65 6e 74 20 3d 3d 20 63 75 72 72 65 6e 74 2e 54 6f 50 6f 69 6e 74 65 72 28 29 nextEvent.==.current.ToPointer()
8960 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 )......................return.fa
8980 6c 73 65 3b 20 2f 2f 20 54 68 65 72 65 27 73 20 6f 6e 6c 79 20 61 20 73 69 6e 67 6c 65 20 65 76 lse;.//.There's.only.a.single.ev
89a0 65 6e 74 20 69 6e 20 74 68 65 20 62 75 66 66 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ent.in.the.buffer...............
89c0 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 27 72 65 20 67 6f 6f 64 2e 20 }................//.We're.good..
89e0 54 68 65 72 65 27 73 20 73 74 69 6c 6c 20 73 70 61 63 65 20 62 65 74 77 65 65 6e 20 75 73 20 61 There's.still.space.between.us.a
8a00 6e 64 20 6f 75 72 20 74 61 69 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e nd.our.tail...............curren
8a20 74 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 28 28 49 6e 70 75 74 45 76 65 6e t.=.new.InputEventPtr((InputEven
8a40 74 2a 29 6e 65 78 74 45 76 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 t*)nextEvent);..............retu
8a60 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 rn.true;..........}............p
8a80 75 62 6c 69 63 20 49 45 6e 75 6d 65 72 61 74 6f 72 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 3e ublic.IEnumerator<InputEventPtr>
8aa0 20 47 65 74 45 6e 75 6d 65 72 61 74 6f 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 .GetEnumerator()..........{.....
8ac0 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 45 6e 75 6d 65 72 61 74 6f 72 28 74 .........return.new.Enumerator(t
8ae0 68 69 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 49 45 6e 75 his);..........}............IEnu
8b00 6d 65 72 61 74 6f 72 20 49 45 6e 75 6d 65 72 61 62 6c 65 2e 47 65 74 45 6e 75 6d 65 72 61 74 6f merator.IEnumerable.GetEnumerato
8b20 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 r()..........{..............retu
8b40 72 6e 20 47 65 74 45 6e 75 6d 65 72 61 74 6f 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a rn.GetEnumerator();..........}..
8b60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 ..........///.<summary>.........
8b80 20 2f 2f 2f 20 53 74 6f 70 20 72 65 63 6f 72 64 69 6e 67 2c 20 69 66 20 6e 65 63 65 73 73 61 72 .///.Stop.recording,.if.necessar
8ba0 79 2c 20 61 6e 64 20 63 6c 65 61 72 20 74 68 65 20 74 72 61 63 65 20 73 75 63 68 20 74 68 61 74 y,.and.clear.the.trace.such.that
8bc0 20 69 74 20 72 65 6c 65 61 73 65 64 20 75 6e 6d 61 6e 61 67 65 64 0d 0a 20 20 20 20 20 20 20 20 .it.released.unmanaged..........
8be0 2f 2f 2f 20 6d 65 6d 6f 72 79 20 77 68 69 63 68 20 6d 69 67 68 74 20 62 65 20 61 6c 6c 6f 63 61 ///.memory.which.might.be.alloca
8c00 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 ted...........///.</summary>....
8c20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ......///.<remarks>..........///
8c40 20 46 6f 72 20 61 6e 79 20 74 72 61 63 65 20 74 68 61 74 20 68 61 73 20 72 65 63 6f 72 64 65 64 .For.any.trace.that.has.recorded
8c60 20 65 76 65 6e 74 73 2c 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 20 69 73 20 .events,.calling.this.method.is.
8c80 63 72 75 63 69 61 6c 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 crucial.in.order.to.not.........
8ca0 20 2f 2f 2f 20 6c 65 61 6b 20 6d 65 6d 6f 72 79 20 6f 6e 20 74 68 65 20 75 6e 6d 61 6e 61 67 65 .///.leak.memory.on.the.unmanage
8cc0 64 20 28 43 2b 2b 29 20 6d 65 6d 6f 72 79 20 68 65 61 70 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f d.(C++).memory.heap...........//
8ce0 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 /.</remarks>..........public.voi
8d00 64 20 44 69 73 70 6f 73 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 d.Dispose()..........{..........
8d20 20 20 20 20 44 69 73 61 62 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 6c 65 ....Disable();..............Rele
8d40 61 73 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 ase();..........}............//.
8d60 57 65 20 77 61 6e 74 20 74 6f 20 6d 61 6b 65 20 73 75 72 65 20 74 68 61 74 20 69 74 27 73 20 6e We.want.to.make.sure.that.it's.n
8d80 6f 74 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 69 74 65 72 61 74 65 20 77 69 74 68 20 61 6e 20 65 ot.possible.to.iterate.with.an.e
8da0 6e 75 6d 65 72 61 62 6c 65 20 6f 76 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 61 20 74 72 61 numerable.over..........//.a.tra
8dc0 63 65 20 74 68 61 74 20 69 73 20 62 65 69 6e 67 20 63 68 61 6e 67 65 64 20 73 6f 20 77 65 20 62 ce.that.is.being.changed.so.we.b
8de0 75 6d 70 20 74 68 69 73 20 63 6f 75 6e 74 65 72 20 65 76 65 72 79 20 74 69 6d 65 20 77 65 20 6d ump.this.counter.every.time.we.m
8e00 6f 64 69 66 79 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 62 75 66 66 65 72 20 61 6e 64 odify.the..........//.buffer.and
8e20 20 63 68 65 63 6b 20 69 6e 20 74 68 65 20 65 6e 75 6d 65 72 61 74 6f 72 20 74 68 61 74 20 74 68 .check.in.the.enumerator.that.th
8e40 65 20 63 6f 75 6e 74 73 20 6d 61 74 63 68 2e 0d 0a 20 20 20 20 20 20 20 20 5b 4e 6f 6e 53 65 72 e.counts.match...........[NonSer
8e60 69 61 6c 69 7a 65 64 5d 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 43 68 61 6e 67 65 43 6f 75 ialized].private.int.m_ChangeCou
8e80 6e 74 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 5b 4e 6f 6e 53 65 72 69 61 6c 69 7a 65 64 5d 20 70 nter;..........[NonSerialized].p
8ea0 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 45 6e 61 62 6c 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 rivate.bool.m_Enabled;..........
8ec0 5b 4e 6f 6e 53 65 72 69 61 6c 69 7a 65 64 5d 20 70 72 69 76 61 74 65 20 46 75 6e 63 3c 49 6e 70 [NonSerialized].private.Func<Inp
8ee0 75 74 45 76 65 6e 74 50 74 72 2c 20 49 6e 70 75 74 44 65 76 69 63 65 2c 20 62 6f 6f 6c 3e 20 6d utEventPtr,.InputDevice,.bool>.m
8f00 5f 4f 6e 46 69 6c 74 65 72 45 76 65 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 _OnFilterEvent;............[Seri
8f20 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 44 65 76 69 63 65 alizeField].private.int.m_Device
8f40 49 64 20 3d 20 49 6e 70 75 74 44 65 76 69 63 65 2e 49 6e 76 61 6c 69 64 44 65 76 69 63 65 49 64 Id.=.InputDevice.InvalidDeviceId
8f60 3b 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 ;..........[SerializeField].priv
8f80 61 74 65 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c 41 63 74 69 6f 6e 3c 49 6e 70 75 74 45 76 65 ate.InlinedArray<Action<InputEve
8fa0 6e 74 50 74 72 3e 3e 20 6d 5f 45 76 65 6e 74 4c 69 73 74 65 6e 65 72 73 3b 0d 0a 0d 0a 20 20 20 ntPtr>>.m_EventListeners;.......
8fc0 20 20 20 20 20 2f 2f 20 42 75 66 66 65 72 20 66 6f 72 20 73 74 6f 72 69 6e 67 20 65 76 65 6e 74 .....//.Buffer.for.storing.event
8fe0 20 74 72 61 63 65 2e 20 41 6c 6c 6f 63 61 74 65 64 20 69 6e 20 6e 61 74 69 76 65 20 73 6f 20 74 .trace..Allocated.in.native.so.t
9000 68 61 74 20 77 65 20 63 61 6e 20 73 75 72 76 69 76 65 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f hat.we.can.survive.a..........//
9020 20 64 6f 6d 61 69 6e 20 72 65 6c 6f 61 64 20 77 69 74 68 6f 75 74 20 6c 6f 73 69 6e 67 20 65 76 .domain.reload.without.losing.ev
9040 65 6e 74 20 74 72 61 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 49 64 ent.traces...........//.NOTE:.Id
9060 65 61 6c 6c 79 20 74 68 69 73 20 77 6f 75 6c 64 20 73 69 6d 70 6c 79 20 75 73 65 20 49 6e 70 75 eally.this.would.simply.use.Inpu
9080 74 45 76 65 6e 74 42 75 66 66 65 72 20 62 75 74 20 77 65 20 63 61 6e 27 74 20 73 65 72 69 61 6c tEventBuffer.but.we.can't.serial
90a0 69 7a 65 20 74 68 61 74 20 6f 6e 65 20 62 65 63 61 75 73 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f ize.that.one.because..........//
90c0 20 20 20 20 20 20 20 6f 66 20 74 68 65 20 4e 61 74 69 76 65 41 72 72 61 79 20 69 74 20 68 61 73 .......of.the.NativeArray.it.has
90e0 20 69 6e 73 69 64 65 2e 20 41 6c 73 6f 2c 20 64 75 65 20 74 6f 20 74 68 65 20 77 72 61 70 2d 61 .inside..Also,.due.to.the.wrap-a
9100 72 6f 75 6e 64 20 6e 61 74 75 72 65 2c 20 73 74 6f 72 61 67 65 20 6f 66 0d 0a 20 20 20 20 20 20 round.nature,.storage.of........
9120 20 20 2f 2f 20 20 20 20 20 20 20 65 76 65 6e 74 73 20 69 6e 20 74 68 65 20 62 75 66 66 65 72 20 ..//.......events.in.the.buffer.
9140 6d 61 79 20 6e 6f 74 20 62 65 20 6c 69 6e 65 61 72 2e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 may.not.be.linear...........[Ser
9160 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 20 6c 6f 6e 67 20 6d 5f 45 76 65 6e ializeField].private.long.m_Even
9180 74 42 75 66 66 65 72 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 tBufferSize;..........[Serialize
91a0 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 20 6c 6f 6e 67 20 6d 5f 4d 61 78 45 76 65 6e 74 42 75 Field].private.long.m_MaxEventBu
91c0 66 66 65 72 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 fferSize;..........[SerializeFie
91e0 6c 64 5d 20 70 72 69 76 61 74 65 20 6c 6f 6e 67 20 6d 5f 47 72 6f 77 49 6e 63 72 65 6d 65 6e 74 ld].private.long.m_GrowIncrement
9200 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 Size;..........[SerializeField].
9220 70 72 69 76 61 74 65 20 6c 6f 6e 67 20 6d 5f 45 76 65 6e 74 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 private.long.m_EventCount;......
9240 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 20 6c 6f 6e ....[SerializeField].private.lon
9260 67 20 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 2f g.m_EventSizeInBytes;........../
9280 2f 20 54 68 65 73 65 20 61 72 65 20 75 6c 6f 6e 67 73 20 66 6f 72 20 74 68 65 20 73 61 6b 65 20 /.These.are.ulongs.for.the.sake.
92a0 6f 66 20 55 6e 69 74 79 20 73 65 72 69 61 6c 69 7a 61 74 69 6f 6e 20 77 68 69 63 68 20 63 61 6e of.Unity.serialization.which.can
92c0 27 74 20 68 61 6e 64 6c 65 20 70 6f 69 6e 74 65 72 73 20 6f 72 20 49 6e 74 50 74 72 73 2e 0d 0a 't.handle.pointers.or.IntPtrs...
92e0 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 ........[SerializeField].private
9300 20 75 6c 6f 6e 67 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 74 6f 72 61 67 65 3b 0d 0a 20 20 .ulong.m_EventBufferStorage;....
9320 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 20 75 ......[SerializeField].private.u
9340 6c 6f 6e 67 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 53 74 6f 72 61 67 65 3b 0d 0a long.m_EventBufferHeadStorage;..
9360 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 ........[SerializeField].private
9380 20 75 6c 6f 6e 67 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 53 74 6f 72 61 67 65 3b .ulong.m_EventBufferTailStorage;
93a0 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 ..........[SerializeField].priva
93c0 74 65 20 62 6f 6f 6c 20 6d 5f 48 61 73 57 72 61 70 70 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 5b te.bool.m_HasWrapped;..........[
93e0 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 52 SerializeField].private.bool.m_R
9400 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 3b 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 ecordFrameMarkers;..........[Ser
9420 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 72 69 76 61 74 65 20 44 65 76 69 63 65 49 6e 66 6f 5b ializeField].private.DeviceInfo[
9440 5d 20 6d 5f 44 65 76 69 63 65 49 6e 66 6f 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 ].m_DeviceInfos;............priv
9460 61 74 65 20 62 79 74 65 2a 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 0d 0a 20 20 20 20 20 20 20 ate.byte*.m_EventBuffer.........
9480 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 28 62 79 74 65 2a 29 6d 5f .{..............get.=>.(byte*)m_
94a0 45 76 65 6e 74 42 75 66 66 65 72 53 74 6f 72 61 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 EventBufferStorage;.............
94c0 20 73 65 74 20 3d 3e 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 74 6f 72 61 67 65 20 3d 20 28 .set.=>.m_EventBufferStorage.=.(
94e0 75 6c 6f 6e 67 29 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 ulong)value;..........}.........
9500 20 20 20 70 72 69 76 61 74 65 20 62 79 74 65 2a 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 ...private.byte*.m_EventBufferHe
9520 61 64 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d ad..........{..............get.=
9540 3e 20 28 62 79 74 65 2a 29 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 53 74 6f 72 61 67 >.(byte*)m_EventBufferHeadStorag
9560 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d 3e 20 6d 5f 45 76 65 6e 74 42 75 e;..............set.=>.m_EventBu
9580 66 66 65 72 48 65 61 64 53 74 6f 72 61 67 65 20 3d 20 28 75 6c 6f 6e 67 29 76 61 6c 75 65 3b 0d fferHeadStorage.=.(ulong)value;.
95a0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 79 .........}............private.by
95c0 74 65 2a 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 0d 0a 20 20 20 20 20 20 20 20 7b te*.m_EventBufferTail..........{
95e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 28 62 79 74 65 2a 29 6d 5f 45 76 ..............get.=>.(byte*)m_Ev
9600 65 6e 74 42 75 66 66 65 72 54 61 69 6c 53 74 6f 72 61 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 entBufferTailStorage;...........
9620 20 20 20 73 65 74 20 3d 3e 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 53 74 6f 72 61 ...set.=>.m_EventBufferTailStora
9640 67 65 20 3d 20 28 75 6c 6f 6e 67 29 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d ge.=.(ulong)value;..........}...
9660 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 41 6c 6c 6f 63 61 74 65 28 29 .........private.void.Allocate()
9680 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 ..........{..............m_Event
96a0 42 75 66 66 65 72 20 3d 20 28 62 79 74 65 2a 29 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 61 Buffer.=.(byte*)UnsafeUtility.Ma
96c0 6c 6c 6f 63 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 2c 20 34 2c 20 41 6c 6c 6f 63 lloc(m_EventBufferSize,.4,.Alloc
96e0 61 74 6f 72 2e 50 65 72 73 69 73 74 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ator.Persistent);..........}....
9700 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 52 65 6c 65 61 73 65 28 29 0d 0a ........private.void.Release()..
9720 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 43 6c 65 61 72 28 29 3b 0d ........{..............Clear();.
9740 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 ...............if.(m_EventBuffer
9760 20 21 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 .!=.default)..............{.....
9780 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 46 72 65 65 28 .............UnsafeUtility.Free(
97a0 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e 50 65 72 73 69 73 74 m_EventBuffer,.Allocator.Persist
97c0 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 ent);..................m_EventBu
97e0 66 66 65 72 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ffer.=.default;..............}..
9800 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 ........}............private.voi
9820 64 20 4f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 d.OnBeforeUpdate()..........{...
9840 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 6d 61 6b 65 20 74 68 69 73 20 77 ...........////TODO:.make.this.w
9860 6f 72 6b 20 63 6f 72 72 65 63 74 6c 79 20 77 69 74 68 20 74 68 65 20 64 69 66 66 65 72 65 6e 74 ork.correctly.with.the.different
9880 20 75 70 64 61 74 65 20 74 79 70 65 73 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 .update.types................if.
98a0 28 6d 5f 52 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 29 0d 0a 20 20 20 20 20 20 20 20 (m_RecordFrameMarkers)..........
98c0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 63 6f 72 64 ....{..................//.Record
98e0 20 66 72 61 6d 65 20 6d 61 72 6b 65 72 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 .frame.marker.event.............
9900 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 41 54 4d 20 74 68 65 73 65 20 65 76 65 6e 74 73 20 ......//.NOTE:.ATM.these.events.
9920 64 6f 6e 27 74 20 67 65 74 20 76 61 6c 69 64 20 65 76 65 6e 74 20 49 44 73 2e 20 4d 69 67 68 74 don't.get.valid.event.IDs..Might
9940 20 62 65 20 74 68 69 73 20 69 73 20 65 76 65 6e 20 75 73 65 66 75 6c 20 62 75 74 20 69 73 20 6d .be.this.is.even.useful.but.is.m
9960 6f 72 65 20 61 20 73 69 64 65 2d 65 66 66 65 63 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ore.a.side-effect...............
9980 20 20 20 2f 2f 20 20 20 20 20 20 20 6f 66 20 74 68 65 72 65 20 6e 6f 74 20 62 65 69 6e 67 20 61 ...//.......of.there.not.being.a
99a0 20 6d 65 74 68 6f 64 20 74 6f 20 6f 62 74 61 69 6e 20 61 6e 20 49 44 20 65 78 63 65 70 74 20 62 .method.to.obtain.an.ID.except.b
99c0 79 20 61 63 74 75 61 6c 6c 79 20 71 75 65 75 69 6e 67 20 61 6e 20 65 76 65 6e 74 2e 0d 0a 20 20 y.actually.queuing.an.event.....
99e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 66 72 61 6d 65 4d 61 72 6b 65 72 45 76 65 ..............var.frameMarkerEve
9a00 6e 74 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 76 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 nt.=.new.InputEvent.............
9a20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 79 70 65 .....{......................type
9a40 20 3d 20 46 72 61 6d 65 4d 61 72 6b 65 72 45 76 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 .=.FrameMarkerEvent,............
9a60 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 54 69 6d 65 20 3d 20 49 6e 70 75 74 52 75 ..........internalTime.=.InputRu
9a80 6e 74 69 6d 65 2e 73 5f 49 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 2c 0d 0a 20 ntime.s_Instance.currentTime,...
9aa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 69 7a 65 49 6e 42 79 74 65 73 20 3d ...................sizeInBytes.=
9ac0 20 28 75 69 6e 74 29 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 53 69 7a 65 4f 66 3c 49 6e 70 75 .(uint)UnsafeUtility.SizeOf<Inpu
9ae0 74 45 76 65 6e 74 3e 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 3b 0d 0a 0d tEvent>()..................};...
9b00 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 49 6e 70 75 74 45 76 65 6e 74 28 6e 65 .................OnInputEvent(ne
9b20 77 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 28 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 55 6e 73 w.InputEventPtr((InputEvent*)Uns
9b40 61 66 65 55 74 69 6c 69 74 79 2e 41 64 64 72 65 73 73 4f 66 28 72 65 66 20 66 72 61 6d 65 4d 61 afeUtility.AddressOf(ref.frameMa
9b60 72 6b 65 72 45 76 65 6e 74 29 29 2c 20 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 rkerEvent)),.null);.............
9b80 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 .}..........}............private
9ba0 20 76 6f 69 64 20 4f 6e 49 6e 70 75 74 45 76 65 6e 74 28 49 6e 70 75 74 45 76 65 6e 74 50 74 72 .void.OnInputEvent(InputEventPtr
9bc0 20 69 6e 70 75 74 45 76 65 6e 74 2c 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 .inputEvent,.InputDevice.device)
9be0 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 6e 6f ..........{..............//.Igno
9c00 72 65 20 65 76 65 6e 74 73 20 74 68 61 74 20 61 72 65 20 61 6c 72 65 61 64 79 20 6d 61 72 6b 65 re.events.that.are.already.marke
9c20 64 20 61 73 20 68 61 6e 64 6c 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 d.as.handled...............if.(i
9c40 6e 70 75 74 45 76 65 6e 74 2e 68 61 6e 64 6c 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nputEvent.handled)..............
9c60 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 ....return;................//.Ig
9c80 6e 6f 72 65 20 69 66 20 74 68 65 20 65 76 65 6e 74 20 69 73 6e 27 74 20 66 6f 72 20 6f 75 72 20 nore.if.the.event.isn't.for.our.
9ca0 64 65 76 69 63 65 20 28 65 78 63 65 70 74 20 69 66 20 69 74 27 73 20 61 20 66 72 61 6d 65 20 6d device.(except.if.it's.a.frame.m
9cc0 61 72 6b 65 72 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 44 65 76 69 63 arker)...............if.(m_Devic
9ce0 65 49 64 20 21 3d 20 49 6e 70 75 74 44 65 76 69 63 65 2e 49 6e 76 61 6c 69 64 44 65 76 69 63 65 eId.!=.InputDevice.InvalidDevice
9d00 49 64 20 26 26 20 69 6e 70 75 74 45 76 65 6e 74 2e 64 65 76 69 63 65 49 64 20 21 3d 20 6d 5f 44 Id.&&.inputEvent.deviceId.!=.m_D
9d20 65 76 69 63 65 49 64 20 26 26 20 69 6e 70 75 74 45 76 65 6e 74 2e 74 79 70 65 20 21 3d 20 46 72 eviceId.&&.inputEvent.type.!=.Fr
9d40 61 6d 65 4d 61 72 6b 65 72 45 76 65 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ameMarkerEvent).................
9d60 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 69 76 65 20 .return;................//.Give.
9d80 63 61 6c 6c 62 61 63 6b 20 61 20 63 68 61 6e 63 65 20 74 6f 20 66 69 6c 74 65 72 20 65 76 65 6e callback.a.chance.to.filter.even
9da0 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 6e 46 69 6c 74 65 72 45 76 t...............if.(m_OnFilterEv
9dc0 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 21 6d 5f 4f 6e 46 69 6c 74 65 72 45 76 65 6e 74 28 ent.!=.null.&&.!m_OnFilterEvent(
9de0 69 6e 70 75 74 45 76 65 6e 74 2c 20 64 65 76 69 63 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 inputEvent,.device))............
9e00 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ......return;................//.
9e20 54 68 69 73 20 73 68 6f 75 6c 64 6e 27 74 20 68 61 70 70 65 6e 20 62 75 74 20 69 67 6e 6f 72 65 This.shouldn't.happen.but.ignore
9e40 20 74 68 65 20 65 76 65 6e 74 20 69 66 20 77 65 27 72 65 20 6e 6f 74 20 74 72 61 63 69 6e 67 2e .the.event.if.we're.not.tracing.
9e60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 20 ..............if.(m_EventBuffer.
9e80 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 ==.default)..................ret
9ea0 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 62 79 74 65 73 4e 65 65 urn;................var.bytesNee
9ec0 64 65 64 20 3d 20 69 6e 70 75 74 45 76 65 6e 74 2e 73 69 7a 65 49 6e 42 79 74 65 73 2e 41 6c 69 ded.=.inputEvent.sizeInBytes.Ali
9ee0 67 6e 54 6f 4d 75 6c 74 69 70 6c 65 4f 66 28 34 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 gnToMultipleOf(4);..............
9f00 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 77 65 20 63 61 6e 20 66 69 74 20 74 68 65 20 65 76 ..//.Make.sure.we.can.fit.the.ev
9f20 65 6e 74 20 61 74 20 61 6c 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 62 79 74 ent.at.all...............if.(byt
9f40 65 73 4e 65 65 64 65 64 20 3e 20 6d 5f 4d 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 29 esNeeded.>.m_MaxEventBufferSize)
9f60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 ..................return;.......
9f80 20 20 20 20 20 20 20 20 20 50 72 6f 66 69 6c 65 72 2e 42 65 67 69 6e 53 61 6d 70 6c 65 28 22 49 .........Profiler.BeginSample("I
9fa0 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 nputEventTrace");...............
9fc0 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 20 3d 3d 20 64 65 66 61 75 6c .if.(m_EventBufferTail.==.defaul
9fe0 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 t)..............{...............
a000 20 20 20 2f 2f 20 46 69 72 73 74 20 65 76 65 6e 74 20 69 6e 20 62 75 66 66 65 72 2e 0d 0a 20 20 ...//.First.event.in.buffer.....
a020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 20 ..............m_EventBufferHead.
a040 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 =.m_EventBuffer;................
a060 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 ..m_EventBufferTail.=.m_EventBuf
a080 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 fer;..............}.............
a0a0 20 20 20 76 61 72 20 6e 65 77 54 61 69 6c 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 ...var.newTail.=.m_EventBufferTa
a0c0 69 6c 20 2b 20 62 79 74 65 73 4e 65 65 64 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 il.+.bytesNeeded;..............v
a0e0 61 72 20 6e 65 77 54 61 69 6c 4f 76 65 72 74 61 6b 65 73 48 65 61 64 20 3d 20 6e 65 77 54 61 69 ar.newTailOvertakesHead.=.newTai
a100 6c 20 3e 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 20 26 26 20 6d 5f 45 76 65 6e 74 l.>.m_EventBufferHead.&&.m_Event
a120 42 75 66 66 65 72 48 65 61 64 20 21 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 0d 0a BufferHead.!=.m_EventBuffer;....
a140 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 61 69 6c 20 67 6f 65 73 20 6f 75 74 20 ............//.If.tail.goes.out.
a160 6f 66 20 62 6f 75 6e 64 73 2c 20 65 6e 6c 61 72 67 65 20 74 68 65 20 62 75 66 66 65 72 20 6f 72 of.bounds,.enlarge.the.buffer.or
a180 20 77 72 61 70 20 61 72 6f 75 6e 64 20 74 6f 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 2e 0d 0a .wrap.around.to.the.beginning...
a1a0 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 77 54 61 69 6c 47 6f 65 73 50 61 73 74 45 ............var.newTailGoesPastE
a1c0 6e 64 4f 66 42 75 66 66 65 72 20 3d 20 6e 65 77 54 61 69 6c 20 3e 20 6d 5f 45 76 65 6e 74 42 75 ndOfBuffer.=.newTail.>.m_EventBu
a1e0 66 66 65 72 20 2b 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 3b 0d 0a 20 20 20 20 20 ffer.+.m_EventBufferSize;.......
a200 20 20 20 20 20 20 20 69 66 20 28 6e 65 77 54 61 69 6c 47 6f 65 73 50 61 73 74 45 6e 64 4f 66 42 .......if.(newTailGoesPastEndOfB
a220 75 66 66 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 uffer)..............{...........
a240 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 6e 27 74 20 72 65 61 63 68 65 64 20 .......//.If.we.haven't.reached.
a260 74 68 65 20 6d 61 78 20 73 69 7a 65 20 79 65 74 2c 20 67 72 6f 77 20 74 68 65 20 62 75 66 66 65 the.max.size.yet,.grow.the.buffe
a280 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 45 76 65 6e 74 42 r...................if.(m_EventB
a2a0 75 66 66 65 72 53 69 7a 65 20 3c 20 6d 5f 4d 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 ufferSize.<.m_MaxEventBufferSize
a2c0 20 26 26 20 21 6d 5f 48 61 73 57 72 61 70 70 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .&&.!m_HasWrapped)..............
a2e0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 ....{......................var.i
a300 6e 63 72 65 6d 65 6e 74 20 3d 20 4d 61 74 68 2e 4d 61 78 28 6d 5f 47 72 6f 77 49 6e 63 72 65 6d ncrement.=.Math.Max(m_GrowIncrem
a320 65 6e 74 53 69 7a 65 2c 20 62 79 74 65 73 4e 65 65 64 65 64 2e 41 6c 69 67 6e 54 6f 4d 75 6c 74 entSize,.bytesNeeded.AlignToMult
a340 69 70 6c 65 4f 66 28 34 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ipleOf(4));.....................
a360 20 76 61 72 20 6e 65 77 42 75 66 66 65 72 53 69 7a 65 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 .var.newBufferSize.=.m_EventBuff
a380 65 72 53 69 7a 65 20 2b 20 69 6e 63 72 65 6d 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 erSize.+.increment;.............
a3a0 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 77 42 75 66 66 65 72 53 69 7a 65 20 3e 20 6d 5f 4d .........if.(newBufferSize.>.m_M
a3c0 61 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 axEventBufferSize)..............
a3e0 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 42 75 66 66 65 72 53 69 7a 65 20 3d 20 6d 5f 4d 61 ............newBufferSize.=.m_Ma
a400 78 45 76 65 6e 74 42 75 66 66 65 72 53 69 7a 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 xEventBufferSize;...............
a420 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 77 42 75 66 66 65 72 53 69 7a 65 20 3c 20 62 79 74 .........if.(newBufferSize.<.byt
a440 65 73 4e 65 65 64 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 esNeeded).......................
a460 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...return;......................
a480 20 20 52 65 73 69 7a 65 28 6e 65 77 42 75 66 66 65 72 53 69 7a 65 29 3b 0d 0a 0d 0a 20 20 20 20 ..Resize(newBufferSize);........
a4a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 54 61 69 6c 20 3d 20 6d 5f 45 76 65 6e ................newTail.=.m_Even
a4c0 74 42 75 66 66 65 72 54 61 69 6c 20 2b 20 62 79 74 65 73 4e 65 65 64 65 64 3b 0d 0a 20 20 20 20 tBufferTail.+.bytesNeeded;......
a4e0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............}...................
a500 20 2f 2f 20 53 65 65 20 69 66 20 77 65 20 66 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .//.See.if.we.fit...............
a520 20 20 20 20 76 61 72 20 73 70 61 63 65 4c 65 66 74 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 ....var.spaceLeft.=.m_EventBuffe
a540 72 53 69 7a 65 20 2d 20 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 20 2d 20 6d 5f 45 rSize.-.(m_EventBufferTail.-.m_E
a560 76 65 6e 74 42 75 66 66 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 ventBuffer);..................if
a580 20 28 73 70 61 63 65 4c 65 66 74 20 3c 20 62 79 74 65 73 4e 65 65 64 65 64 29 0d 0a 20 20 20 20 .(spaceLeft.<.bytesNeeded)......
a5a0 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............{...................
a5c0 20 20 20 2f 2f 20 4e 6f 2c 20 73 6f 20 77 72 61 70 20 61 72 6f 75 6e 64 2e 0d 0a 20 20 20 20 20 ...//.No,.so.wrap.around........
a5e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 48 61 73 57 72 61 70 70 65 64 20 3d 20 74 72 ...............m_HasWrapped.=.tr
a600 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 ue;........................//.Ma
a620 6b 65 20 73 75 72 65 20 68 65 61 64 20 69 73 6e 27 74 20 74 72 79 69 6e 67 20 74 6f 20 61 64 76 ke.sure.head.isn't.trying.to.adv
a640 61 6e 63 65 20 69 6e 74 6f 20 67 61 70 20 77 65 20 6d 61 79 20 62 65 20 6c 65 61 76 69 6e 67 20 ance.into.gap.we.may.be.leaving.
a660 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 at.the.end.of.the...............
a680 20 20 20 20 20 20 20 2f 2f 20 62 75 66 66 65 72 20 62 79 20 77 69 70 69 6e 67 20 74 68 65 20 73 .......//.buffer.by.wiping.the.s
a6a0 70 61 63 65 20 69 66 20 69 74 20 63 6f 75 6c 64 20 66 69 74 20 61 6e 20 65 76 65 6e 74 2e 0d 0a pace.if.it.could.fit.an.event...
a6c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 70 61 63 65 4c 65 66 ....................if.(spaceLef
a6e0 74 20 3e 3d 20 49 6e 70 75 74 45 76 65 6e 74 2e 6b 42 61 73 65 45 76 65 6e 74 53 69 7a 65 29 0d t.>=.InputEvent.kBaseEventSize).
a700 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 .........................UnsafeU
a720 74 69 6c 69 74 79 2e 4d 65 6d 43 6c 65 61 72 28 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 tility.MemClear(m_EventBufferTai
a740 6c 2c 20 49 6e 70 75 74 45 76 65 6e 74 2e 6b 42 61 73 65 45 76 65 6e 74 53 69 7a 65 29 3b 0d 0a l,.InputEvent.kBaseEventSize);..
a760 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 ......................m_EventBuf
a780 66 65 72 54 61 69 6c 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 ferTail.=.m_EventBuffer;........
a7a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 54 61 69 6c 20 3d 20 6d 5f 45 76 65 6e 74 42 ..............newTail.=.m_EventB
a7c0 75 66 66 65 72 20 2b 20 62 79 74 65 73 4e 65 65 64 65 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 uffer.+.bytesNeeded;............
a7e0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 74 61 69 6c 20 6f 76 65 72 74 ............//.If.the.tail.overt
a800 6f 6f 6b 20 62 6f 74 68 20 74 68 65 20 68 65 61 64 20 61 6e 64 20 74 68 65 20 65 6e 64 20 6f 66 ook.both.the.head.and.the.end.of
a820 20 74 68 65 20 62 75 66 66 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .the.buffer,....................
a840 20 20 2f 2f 20 77 65 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 73 75 72 65 20 74 68 65 20 68 65 ..//.we.need.to.make.sure.the.he
a860 61 64 20 69 73 20 77 72 61 70 70 65 64 20 61 72 6f 75 6e 64 20 61 73 20 77 65 6c 6c 2e 0d 0a 20 ad.is.wrapped.around.as.well....
a880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 77 54 61 69 6c 4f 76 ...................if.(newTailOv
a8a0 65 72 74 61 6b 65 73 48 65 61 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ertakesHead)....................
a8c0 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 20 3d 20 6d 5f 45 76 65 6e ......m_EventBufferHead.=.m_Even
a8e0 74 42 75 66 66 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tBuffer;........................
a900 2f 2f 20 52 65 63 68 65 63 6b 20 77 68 65 74 68 65 72 20 77 65 27 72 65 20 6f 76 65 72 74 61 6b //.Recheck.whether.we're.overtak
a920 69 6e 67 20 68 65 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e ing.head.......................n
a940 65 77 54 61 69 6c 4f 76 65 72 74 61 6b 65 73 48 65 61 64 20 3d 20 6e 65 77 54 61 69 6c 20 3e 20 ewTailOvertakesHead.=.newTail.>.
a960 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 m_EventBufferHead;..............
a980 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ....}..............}............
a9a0 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 6e 65 77 20 74 61 69 6c 20 72 75 6e 73 20 69 6e 74 6f ....//.If.the.new.tail.runs.into
a9c0 20 68 65 61 64 2c 20 62 75 6d 70 20 68 65 61 64 20 61 73 20 6d 61 6e 79 20 74 69 6d 65 73 20 61 .head,.bump.head.as.many.times.a
a9e0 73 20 77 65 20 6e 65 65 64 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6d 61 6b s.we.need.to..............//.mak
aa00 65 20 72 6f 6f 6d 20 66 6f 72 20 74 68 65 20 65 76 65 6e 74 2e 20 48 65 61 64 20 6d 61 79 20 69 e.room.for.the.event..Head.may.i
aa20 74 73 65 6c 66 20 77 72 61 70 20 61 72 6f 75 6e 64 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 tself.wrap.around.here..........
aa40 20 20 20 20 20 69 66 20 28 6e 65 77 54 61 69 6c 4f 76 65 72 74 61 6b 65 73 48 65 61 64 29 0d 0a .....if.(newTailOvertakesHead)..
aa60 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 ............{..................v
aa80 61 72 20 6e 65 77 48 65 61 64 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 3b 0d ar.newHead.=.m_EventBufferHead;.
aaa0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 6e 64 4f 66 42 75 66 66 65 72 .................var.endOfBuffer
aac0 4d 69 6e 75 73 4f 6e 65 45 76 65 6e 74 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 MinusOneEvent.=.................
aae0 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 20 2b 20 6d 5f 45 76 65 6e 74 42 75 66 66 .....m_EventBuffer.+.m_EventBuff
ab00 65 72 53 69 7a 65 20 2d 20 49 6e 70 75 74 45 76 65 6e 74 2e 6b 42 61 73 65 45 76 65 6e 74 53 69 erSize.-.InputEvent.kBaseEventSi
ab20 7a 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 6e 65 ze;....................while.(ne
ab40 77 48 65 61 64 20 3c 20 6e 65 77 54 61 69 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 wHead.<.newTail)................
ab60 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 75 6d ..{......................var.num
ab80 42 79 74 65 73 20 3d 20 28 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 6e 65 77 48 65 61 64 29 2d 3e Bytes.=.((InputEvent*)newHead)->
aba0 73 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 sizeInBytes;....................
abc0 20 20 6e 65 77 48 65 61 64 20 2b 3d 20 6e 75 6d 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 ..newHead.+=.numBytes;..........
abe0 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 6d 5f 45 76 65 6e 74 43 6f 75 6e 74 3b 0d 0a 20 20 20 ............--m_EventCount;.....
ac00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 .................m_EventSizeInBy
ac20 74 65 73 20 2d 3d 20 6e 75 6d 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tes.-=.numBytes;................
ac40 20 20 20 20 20 20 69 66 20 28 6e 65 77 48 65 61 64 20 3e 20 65 6e 64 4f 66 42 75 66 66 65 72 4d ......if.(newHead.>.endOfBufferM
ac60 69 6e 75 73 4f 6e 65 45 76 65 6e 74 20 7c 7c 20 28 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 6e 65 inusOneEvent.||.((InputEvent*)ne
ac80 77 48 65 61 64 29 2d 3e 73 69 7a 65 49 6e 42 79 74 65 73 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 wHead)->sizeInBytes.==.0).......
aca0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...............{................
acc0 20 20 20 20 20 20 20 20 20 20 6e 65 77 48 65 61 64 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 ..........newHead.=.m_EventBuffe
ace0 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 r;..........................brea
ad00 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 k;......................}.......
ad20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........}....................
ad40 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 48 65 61 64 20 3d 20 6e 65 77 48 65 61 64 3b 0d 0a 20 20 m_EventBufferHead.=.newHead;....
ad60 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 62 ..........}................var.b
ad80 75 66 66 65 72 20 3d 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 3b 0d 0a 20 20 20 20 uffer.=.m_EventBufferTail;......
ada0 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 42 75 66 66 65 72 54 61 69 6c 20 3d 20 6e 65 77 54 ........m_EventBufferTail.=.newT
adc0 61 69 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 70 79 20 64 61 74 61 ail;................//.Copy.data
ade0 20 74 6f 20 62 75 66 66 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 .to.buffer...............UnsafeU
ae00 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 62 75 66 66 65 72 2c 20 69 6e 70 75 74 45 76 65 6e 74 tility.MemCpy(buffer,.inputEvent
ae20 2e 64 61 74 61 2c 20 69 6e 70 75 74 45 76 65 6e 74 2e 73 69 7a 65 49 6e 42 79 74 65 73 29 3b 0d .data,.inputEvent.sizeInBytes);.
ae40 0a 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 3b 0d .............++m_ChangeCounter;.
ae60 0a 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 6d 5f 45 76 65 6e 74 43 6f 75 6e 74 3b 0d 0a 20 20 .............++m_EventCount;....
ae80 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 53 69 7a 65 49 6e 42 79 74 65 73 20 2b 3d 20 ..........m_EventSizeInBytes.+=.
aea0 62 79 74 65 73 4e 65 65 64 65 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d bytesNeeded;................//.M
aec0 61 6b 65 20 73 75 72 65 20 77 65 20 68 61 76 65 20 61 20 72 65 63 6f 72 64 20 66 6f 72 20 74 68 ake.sure.we.have.a.record.for.th
aee0 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 e.device...............if.(devic
af00 65 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 e.!=.null)..............{.......
af20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 68 61 76 65 52 65 63 6f 72 64 20 3d 20 66 61 6c 73 ...........var.haveRecord.=.fals
af40 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 44 65 76 69 63 65 e;..................if.(m_Device
af60 49 6e 66 6f 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Infos.!=.null)..................
af80 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 6d 5f 44 65 76 69 63 65 ....for.(var.i.=.0;.i.<.m_Device
afa0 49 6e 66 6f 73 2e 4c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 Infos.Length;.++i)..............
afc0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 44 65 76 69 63 65 49 6e 66 6f 73 5b 69 5d ............if.(m_DeviceInfos[i]
afe0 2e 64 65 76 69 63 65 49 64 20 3d 3d 20 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 29 0d 0a 20 .deviceId.==.device.deviceId)...
b000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .......................{........
b020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 76 65 52 65 63 6f 72 64 ......................haveRecord
b040 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .=.true;........................
b060 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......break;....................
b080 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 68 61 ......}..................if.(!ha
b0a0 76 65 52 65 63 6f 72 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 veRecord)......................A
b0c0 72 72 61 79 48 65 6c 70 65 72 73 2e 41 70 70 65 6e 64 28 72 65 66 20 6d 5f 44 65 76 69 63 65 49 rrayHelpers.Append(ref.m_DeviceI
b0e0 6e 66 6f 73 2c 20 6e 65 77 20 44 65 76 69 63 65 49 6e 66 6f 0d 0a 20 20 20 20 20 20 20 20 20 20 nfos,.new.DeviceInfo............
b100 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........{.....................
b120 20 20 20 20 20 6d 5f 44 65 76 69 63 65 49 64 20 3d 20 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 .....m_DeviceId.=.device.deviceI
b140 64 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 61 d,..........................m_La
b160 79 6f 75 74 20 3d 20 64 65 76 69 63 65 2e 6c 61 79 6f 75 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 yout.=.device.layout,...........
b180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 61 74 65 46 6f 72 6d 61 74 20 3d 20 64 ...............m_StateFormat.=.d
b1a0 65 76 69 63 65 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 6d 61 74 2c 0d 0a 20 20 20 20 20 20 evice.stateBlock.format,........
b1c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 ..................m_StateSizeInB
b1e0 79 74 65 73 20 3d 20 28 69 6e 74 29 64 65 76 69 63 65 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 61 6c ytes.=.(int)device.stateBlock.al
b200 69 67 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 2c 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ignedSizeInBytes,...............
b220 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 69 74 27 73 20 61 20 67 65 6e 65 72 61 .............//.If.it's.a.genera
b240 74 65 64 20 6c 61 79 6f 75 74 2c 20 73 74 6f 72 65 20 74 68 65 20 66 75 6c 6c 20 6c 61 79 6f 75 ted.layout,.store.the.full.layou
b260 74 20 4a 53 4f 4e 20 69 6e 20 74 68 65 20 64 65 76 69 63 65 20 69 6e 66 6f 2e 20 57 65 20 64 6f t.JSON.in.the.device.info..We.do
b280 20 74 68 69 73 20 73 6f 20 74 68 61 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .this.so.that...................
b2a0 20 20 20 20 20 20 20 2f 2f 20 77 68 65 6e 20 73 61 76 69 6e 67 20 74 72 61 63 65 73 20 66 6f 72 .......//.when.saving.traces.for
b2c0 20 74 68 69 73 20 6b 69 6e 64 20 6f 66 20 69 6e 70 75 74 2c 20 77 65 20 63 61 6e 20 72 65 63 72 .this.kind.of.input,.we.can.recr
b2e0 65 61 74 65 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eate.the.device.................
b300 20 20 20 20 20 20 20 20 20 20 6d 5f 46 75 6c 6c 4c 61 79 6f 75 74 4a 73 6f 6e 20 3d 20 49 6e 70 ..........m_FullLayoutJson.=.Inp
b320 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 73 5f 4c 61 79 6f 75 74 73 2e 49 73 47 65 6e 65 utControlLayout.s_Layouts.IsGene
b340 72 61 74 65 64 4c 61 79 6f 75 74 28 64 65 76 69 63 65 2e 6d 5f 4c 61 79 6f 75 74 29 0d 0a 20 20 ratedLayout(device.m_Layout)....
b360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 49 6e 70 75 ..........................?.Inpu
b380 74 53 79 73 74 65 6d 2e 4c 6f 61 64 4c 61 79 6f 75 74 28 64 65 76 69 63 65 2e 6c 61 79 6f 75 74 tSystem.LoadLayout(device.layout
b3a0 29 2e 54 6f 4a 73 6f 6e 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ).ToJson()......................
b3c0 20 20 20 20 20 20 20 20 3a 20 6e 75 6c 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ........:.null..................
b3e0 20 20 20 20 7d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 ....});..............}..........
b400 20 20 20 20 20 20 2f 2f 20 4e 6f 74 69 66 79 20 6c 69 73 74 65 6e 65 72 73 2e 0d 0a 20 20 20 20 ......//.Notify.listeners.......
b420 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 6d 5f 45 76 ........for.(var.i.=.0;.i.<.m_Ev
b440 65 6e 74 4c 69 73 74 65 6e 65 72 73 2e 6c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 entListeners.length;.++i).......
b460 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 4c 69 73 74 65 6e 65 72 73 5b 69 5d 28 6e ...........m_EventListeners[i](n
b480 65 77 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 28 28 49 6e 70 75 74 45 76 65 6e 74 2a 29 62 75 ew.InputEventPtr((InputEvent*)bu
b4a0 66 66 65 72 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 72 6f 66 69 6c 65 72 2e ffer));................Profiler.
b4c0 45 6e 64 53 61 6d 70 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 EndSample();..........}.........
b4e0 20 20 20 70 72 69 76 61 74 65 20 63 6c 61 73 73 20 45 6e 75 6d 65 72 61 74 6f 72 20 3a 20 49 45 ...private.class.Enumerator.:.IE
b500 6e 75 6d 65 72 61 74 6f 72 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 3e 0d 0a 20 20 20 20 20 20 numerator<InputEventPtr>........
b520 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 45 76 ..{..............private.InputEv
b540 65 6e 74 54 72 61 63 65 20 6d 5f 54 72 61 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 entTrace.m_Trace;..............p
b560 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 3b 0d 0a 20 20 20 rivate.int.m_ChangeCounter;.....
b580 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 .........internal.InputEventPtr.
b5a0 6d 5f 43 75 72 72 65 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 m_Current;................public
b5c0 20 45 6e 75 6d 65 72 61 74 6f 72 28 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 20 74 72 61 63 .Enumerator(InputEventTrace.trac
b5e0 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 e)..............{...............
b600 20 20 20 6d 5f 54 72 61 63 65 20 3d 20 74 72 61 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ...m_Trace.=.trace;.............
b620 20 20 20 20 20 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 20 3d 20 74 72 61 63 65 2e 6d 5f 43 .....m_ChangeCounter.=.trace.m_C
b640 68 61 6e 67 65 43 6f 75 6e 74 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a hangeCounter;..............}....
b660 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 44 69 73 70 6f 73 65 28 ............public.void.Dispose(
b680 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )..............{................
b6a0 20 20 6d 5f 54 72 61 63 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ..m_Trace.=.null;...............
b6c0 20 20 20 6d 5f 43 75 72 72 65 6e 74 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 ...m_Current.=.new.InputEventPtr
b6e0 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ();..............}..............
b700 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 4d 6f 76 65 4e 65 78 74 28 29 0d 0a 20 20 20 20 20 20 ..public.bool.MoveNext()........
b720 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 ......{..................if.(m_T
b740 72 61 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 race.==.null)...................
b760 20 20 20 74 68 72 6f 77 20 6e 65 77 20 4f 62 6a 65 63 74 44 69 73 70 6f 73 65 64 45 78 63 65 70 ...throw.new.ObjectDisposedExcep
b780 74 69 6f 6e 28 54 6f 53 74 72 69 6e 67 28 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 tion(ToString());...............
b7a0 20 20 20 69 66 20 28 6d 5f 54 72 61 63 65 2e 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 20 21 ...if.(m_Trace.m_ChangeCounter.!
b7c0 3d 20 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 =.m_ChangeCounter)..............
b7e0 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 ........throw.new.InvalidOperati
b800 6f 6e 45 78 63 65 70 74 69 6f 6e 28 22 54 72 61 63 65 20 68 61 73 20 62 65 65 6e 20 6d 6f 64 69 onException("Trace.has.been.modi
b820 66 69 65 64 20 77 68 69 6c 65 20 65 6e 75 6d 65 72 61 74 69 6e 67 21 22 29 3b 0d 0a 0d 0a 20 20 fied.while.enumerating!");......
b840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 54 72 61 63 65 2e 47 65 74 ..............return.m_Trace.Get
b860 4e 65 78 74 45 76 65 6e 74 28 72 65 66 20 6d 5f 43 75 72 72 65 6e 74 29 3b 0d 0a 20 20 20 20 20 NextEvent(ref.m_Current);.......
b880 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 .......}................public.v
b8a0 6f 69 64 20 52 65 73 65 74 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 oid.Reset()..............{......
b8c0 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 75 72 72 65 6e 74 20 3d 20 64 65 66 61 75 6c 74 3b ............m_Current.=.default;
b8e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 ..................m_ChangeCounte
b900 72 20 3d 20 6d 5f 54 72 61 63 65 2e 6d 5f 43 68 61 6e 67 65 43 6f 75 6e 74 65 72 3b 0d 0a 20 20 r.=.m_Trace.m_ChangeCounter;....
b920 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 ..........}................publi
b940 63 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 43 75 72 72 65 6e 74 20 3d 3e 20 6d 5f 43 75 72 c.InputEventPtr.Current.=>.m_Cur
b960 72 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 49 45 6e 75 6d 65 rent;..............object.IEnume
b980 72 61 74 6f 72 2e 43 75 72 72 65 6e 74 20 3d 3e 20 43 75 72 72 65 6e 74 3b 0d 0a 20 20 20 20 20 rator.Current.=>.Current;.......
b9a0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 46 ...}............private.static.F
b9c0 6f 75 72 43 43 20 6b 46 69 6c 65 46 6f 72 6d 61 74 20 3d 3e 20 6e 65 77 20 46 6f 75 72 43 43 28 ourCC.kFileFormat.=>.new.FourCC(
b9e0 27 49 27 2c 20 27 45 27 2c 20 27 56 27 2c 20 27 54 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 'I',.'E',.'V',.'T');..........pr
ba00 69 76 61 74 65 20 73 74 61 74 69 63 20 69 6e 74 20 6b 46 69 6c 65 56 65 72 73 69 6f 6e 20 3d 20 ivate.static.int.kFileVersion.=.
ba20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 46 6c 61 67 73 5d 0d 0a 20 20 20 20 20 20 20 20 70 1;............[Flags]..........p
ba40 72 69 76 61 74 65 20 65 6e 75 6d 20 46 69 6c 65 46 6c 61 67 73 0d 0a 20 20 20 20 20 20 20 20 7b rivate.enum.FileFlags..........{
ba60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 46 69 78 65 64 55 70 64 61 74 65 20 3d 20 31 20 3c 3c ..............FixedUpdate.=.1.<<
ba80 20 30 2c 20 2f 2f 20 45 76 65 6e 74 73 20 77 65 72 65 20 72 65 63 6f 72 64 65 64 20 77 69 74 68 .0,.//.Events.were.recorded.with
baa0 20 73 79 73 74 65 6d 20 62 65 69 6e 67 20 69 6e 20 66 69 78 65 64 2d 75 70 64 61 74 65 20 6d 6f .system.being.in.fixed-update.mo
bac0 64 65 2e 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 de...........}............///.<s
bae0 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 6f 6e 74 72 6f 6c 73 20 72 65 ummary>..........///.Controls.re
bb00 70 6c 61 79 69 6e 67 20 6f 66 20 65 76 65 6e 74 73 20 72 65 63 6f 72 64 65 64 20 69 6e 20 61 6e playing.of.events.recorded.in.an
bb20 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 22 2f 3e 2e 0d .<see.cref="InputEventTrace"/>..
bb40 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 .........///.</summary>.........
bb60 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 50 6c 61 79 .///.<remarks>..........///.Play
bb80 62 61 63 6b 20 63 61 6e 20 62 65 20 63 6f 6e 74 72 6f 6c 6c 65 64 20 65 69 74 68 65 72 20 6f 6e back.can.be.controlled.either.on
bba0 20 61 20 70 65 72 2d 65 76 65 6e 74 20 6f 72 20 61 20 70 65 72 2d 66 72 61 6d 65 20 62 61 73 69 .a.per-event.or.a.per-frame.basi
bbc0 73 2e 20 4e 6f 74 65 20 74 68 61 74 20 70 6c 61 79 69 6e 67 20 62 61 63 6b 20 65 76 65 6e 74 73 s..Note.that.playing.back.events
bbe0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 72 61 6d 65 20 62 79 20 66 72 61 6d 65 20 72 65 71 ..........///.frame.by.frame.req
bc00 75 69 72 65 73 20 66 72 61 6d 65 20 6d 61 72 6b 65 72 73 20 74 6f 20 62 65 20 70 72 65 73 65 6e uires.frame.markers.to.be.presen
bc20 74 20 69 6e 20 74 68 65 20 74 72 61 63 65 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 72 t.in.the.trace.(see.<see.cref="r
bc40 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 ecordFrameMarkers"/>)...........
bc60 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 79 20 64 65 66 61 75 6c 74 2c 20 65 76 65 ///..........///.By.default,.eve
bc80 6e 74 73 20 77 69 6c 6c 20 62 65 20 71 75 65 75 65 64 20 61 73 20 69 73 20 65 78 63 65 70 74 20 nts.will.be.queued.as.is.except.
bca0 66 6f 72 20 74 68 65 69 72 20 74 69 6d 65 73 74 61 6d 70 73 20 77 68 69 63 68 20 77 69 6c 6c 20 for.their.timestamps.which.will.
bcc0 62 65 20 73 65 74 20 74 6f 20 74 68 65 20 63 75 72 72 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f be.set.to.the.current........../
bce0 2f 2f 20 74 69 6d 65 20 74 68 61 74 20 65 61 63 68 20 65 76 65 6e 74 20 69 73 20 71 75 65 75 65 //.time.that.each.event.is.queue
bd00 64 20 61 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 d.at...........///..........///.
bd20 57 68 61 74 20 74 68 69 73 20 6d 65 61 6e 73 20 69 73 20 74 68 61 74 20 65 76 65 6e 74 73 20 72 What.this.means.is.that.events.r
bd40 65 70 6c 61 79 20 77 69 74 68 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 20 49 44 20 28 73 eplay.with.the.same.device.ID.(s
bd60 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 64 65 76 69 63 65 49 ee.<see.cref="InputEvent.deviceI
bd80 64 22 2f 3e 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 79 20 77 65 72 65 20 63 61 70 d"/>)..........///.they.were.cap
bda0 74 75 72 65 64 20 6f 6e 2e 20 49 66 20 74 68 65 20 74 72 61 63 65 20 69 73 20 72 65 70 6c 61 79 tured.on..If.the.trace.is.replay
bdc0 65 64 20 69 6e 20 74 68 65 20 73 61 6d 65 20 73 65 73 73 69 6f 6e 20 74 68 61 74 20 69 74 20 77 ed.in.the.same.session.that.it.w
bde0 61 73 20 72 65 63 6f 72 64 65 64 20 69 6e 2c 20 74 68 69 73 20 6d 65 61 6e 73 0d 0a 20 20 20 20 as.recorded.in,.this.means......
be00 20 20 20 20 2f 2f 2f 20 74 68 61 74 20 74 68 65 20 65 76 65 6e 74 73 20 77 69 6c 6c 20 72 65 70 ....///.that.the.events.will.rep
be20 6c 61 79 20 6f 6e 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 20 28 69 66 20 69 74 20 73 74 lay.on.the.same.device.(if.it.st
be40 69 6c 6c 20 65 78 69 73 74 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 ill.exists)...........///.......
be60 20 20 20 2f 2f 2f 20 54 6f 20 6d 61 70 20 72 65 63 6f 72 64 65 64 20 65 76 65 6e 74 73 20 74 6f ...///.To.map.recorded.events.to
be80 20 61 20 64 69 66 66 65 72 65 6e 74 20 64 65 76 69 63 65 2c 20 79 6f 75 20 63 61 6e 20 65 69 74 .a.different.device,.you.can.eit
bea0 68 65 72 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 57 69 74 68 44 65 76 69 63 65 4d 61 her.call.<see.cref="WithDeviceMa
bec0 70 70 65 64 46 72 6f 6d 54 6f 28 69 6e 74 2c 69 6e 74 29 22 2f 3e 20 74 6f 0d 0a 20 20 20 20 20 ppedFromTo(int,int)"/>.to.......
bee0 20 20 20 2f 2f 2f 20 6d 61 70 20 61 6e 20 61 72 62 69 74 72 61 72 79 20 64 65 76 69 63 65 20 49 ...///.map.an.arbitrary.device.I
bf00 44 20 74 6f 20 61 20 6e 65 77 20 6f 6e 65 20 6f 72 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 D.to.a.new.one.or.call.<see.cref
bf20 3d 22 57 69 74 68 41 6c 6c 44 65 76 69 63 65 73 4d 61 70 70 65 64 54 6f 4e 65 77 49 6e 73 74 61 ="WithAllDevicesMappedToNewInsta
bf40 6e 63 65 73 22 2f 3e 20 74 6f 20 63 72 65 61 74 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e nces"/>.to.create..........///.n
bf60 65 77 20 28 74 65 6d 70 6f 72 61 72 79 29 20 64 65 76 69 63 65 73 20 66 6f 72 20 74 68 65 20 64 ew.(temporary).devices.for.the.d
bf80 75 72 61 74 69 6f 6e 20 6f 66 20 70 6c 61 79 62 61 63 6b 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f uration.of.playback...........//
bfa0 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 /..........///.<example>........
bfc0 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 74 72 ..///.<code>..........///.var.tr
bfe0 61 63 65 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 28 6d 79 44 65 76 69 ace.=.new.InputEventTrace(myDevi
c000 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 72 61 63 65 2e 45 6e 61 62 6c 65 28 29 ce);..........///.trace.Enable()
c020 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 2e ;..........///..........///.//..
c040 2e 2e 20 72 75 6e 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 66 72 61 6d 65 73 20 2e 2e 2e 0d 0a 20 ...run.one.or.more.frames.......
c060 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 72 61 63 65 2e 52 65 .......///..........///.trace.Re
c080 70 6c 61 79 28 29 2e 4f 6e 65 46 72 61 6d 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 play().OneFrame();..........///.
c0a0 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d </code>..........///.</example>.
c0c0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 .........///.</remarks>.........
c0e0 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 54 72 .///.<seealso.cref="InputEventTr
c100 61 63 65 2e 52 65 70 6c 61 79 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6c ace.Replay"/>..........public.cl
c120 61 73 73 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 3a 20 49 44 69 73 70 6f 73 61 62 ass.ReplayController.:.IDisposab
c140 6c 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c le..........{..............///.<
c160 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 65 76 summary>..............///.The.ev
c180 65 6e 74 20 74 72 61 63 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 72 65 ent.trace.associated.with.the.re
c1a0 70 6c 61 79 20 63 6f 6e 74 72 6f 6c 6c 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f play.controller...............//
c1c0 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 /.</summary>..............///.<v
c1e0 61 6c 75 65 3e 54 72 61 63 65 20 66 72 6f 6d 20 77 68 69 63 68 20 65 76 65 6e 74 73 20 61 72 65 alue>Trace.from.which.events.are
c200 20 72 65 70 6c 61 79 65 64 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .replayed.</value>..............
c220 70 75 62 6c 69 63 20 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 20 74 72 61 63 65 20 3d 3e 20 public.InputEventTrace.trace.=>.
c240 6d 5f 45 76 65 6e 74 54 72 61 63 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f m_EventTrace;................///
c260 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 74 .<summary>..............///.Whet
c280 68 65 72 20 72 65 70 6c 61 79 20 68 61 73 20 66 69 6e 69 73 68 65 64 2e 0d 0a 20 20 20 20 20 20 her.replay.has.finished.........
c2a0 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 ......///.</summary>............
c2c0 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 54 72 75 65 20 69 66 20 72 65 70 6c 61 79 20 68 61 73 20 ..///.<value>True.if.replay.has.
c2e0 66 69 6e 69 73 68 65 64 20 6f 72 20 69 73 20 6e 6f 74 20 69 6e 20 70 72 6f 67 72 65 73 73 2e 3c finished.or.is.not.in.progress.<
c300 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 /value>..............///.<seeals
c320 6f 20 63 72 65 66 3d 22 50 6c 61 79 41 6c 6c 46 72 61 6d 65 73 4f 6e 65 42 79 4f 6e 65 22 2f 3e o.cref="PlayAllFramesOneByOne"/>
c340 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d ..............///.<seealso.cref=
c360 22 50 6c 61 79 41 6c 6c 45 76 65 6e 74 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 "PlayAllEvents"/>..............p
c380 75 62 6c 69 63 20 62 6f 6f 6c 20 66 69 6e 69 73 68 65 64 20 7b 20 67 65 74 3b 20 70 72 69 76 61 ublic.bool.finished.{.get;.priva
c3a0 74 65 20 73 65 74 3b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 te.set;.}................///.<su
c3c0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 74 68 65 72 20 mmary>..............///.Whether.
c3e0 72 65 70 6c 61 79 20 69 73 20 70 61 75 73 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f replay.is.paused.............../
c400 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c //.</summary>..............///.<
c420 76 61 6c 75 65 3e 54 72 75 65 20 69 66 20 72 65 70 6c 61 79 20 69 73 20 63 75 72 72 65 6e 74 6c value>True.if.replay.is.currentl
c440 79 20 70 61 75 73 65 64 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 y.paused.</value>..............p
c460 75 62 6c 69 63 20 62 6f 6f 6c 20 70 61 75 73 65 64 20 7b 20 67 65 74 3b 20 73 65 74 3b 20 7d 0d ublic.bool.paused.{.get;.set;.}.
c480 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 ...............///.<summary>....
c4a0 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 75 72 72 65 6e 74 20 70 6f 73 69 74 69 6f 6e 20 69 ..........///.Current.position.i
c4c0 6e 20 74 68 65 20 65 76 65 6e 74 20 73 74 72 65 61 6d 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n.the.event.stream..............
c4e0 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f .///.</summary>..............///
c500 20 3c 76 61 6c 75 65 3e 49 6e 64 65 78 20 6f 66 20 63 75 72 72 65 6e 74 20 65 76 65 6e 74 20 69 .<value>Index.of.current.event.i
c520 6e 20 74 72 61 63 65 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 n.trace.</value>..............pu
c540 62 6c 69 63 20 69 6e 74 20 70 6f 73 69 74 69 6f 6e 20 7b 20 67 65 74 3b 20 70 72 69 76 61 74 65 blic.int.position.{.get;.private
c560 20 73 65 74 3b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d .set;.}................///.<summ
c580 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 69 73 74 20 6f 66 20 64 65 ary>..............///.List.of.de
c5a0 76 69 63 65 73 20 63 72 65 61 74 65 64 20 62 79 20 74 68 65 20 72 65 70 6c 61 79 20 63 6f 6e 74 vices.created.by.the.replay.cont
c5c0 72 6f 6c 6c 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 roller...............///.</summa
c5e0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 44 65 76 69 ry>..............///.<value>Devi
c600 63 65 73 20 63 72 65 61 74 65 64 20 62 79 20 74 68 65 20 72 65 70 6c 61 79 20 63 6f 6e 74 72 6f ces.created.by.the.replay.contro
c620 6c 6c 65 72 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ller.</value>..............///.<
c640 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 79 20 64 65 66 remarks>..............///.By.def
c660 61 75 6c 74 2c 20 61 20 72 65 70 6c 61 79 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 77 69 6c 6c 20 71 ault,.a.replay.controller.will.q
c680 75 65 75 65 20 65 76 65 6e 74 73 20 61 73 20 69 73 2c 20 69 2e 65 2e 20 77 69 74 68 20 3c 73 65 ueue.events.as.is,.i.e..with.<se
c6a0 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 64 65 76 69 63 65 49 64 22 2f 3e 20 6f e.cref="InputEvent.deviceId"/>.o
c6c0 66 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 61 63 68 20 65 76 65 6e 74 20 6c 65 f..............///.each.event.le
c6e0 66 74 20 61 73 20 69 73 2e 20 54 68 69 73 20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 65 20 65 76 ft.as.is..This.means.that.the.ev
c700 65 6e 74 73 20 77 69 6c 6c 20 74 61 72 67 65 74 20 65 78 69 73 74 69 6e 67 20 64 65 76 69 63 65 ents.will.target.existing.device
c720 73 20 28 69 66 20 61 6e 79 29 20 74 68 61 74 20 68 61 76 65 20 74 68 65 0d 0a 20 20 20 20 20 20 s.(if.any).that.have.the........
c740 20 20 20 20 20 20 2f 2f 2f 20 72 65 73 70 65 63 74 69 76 65 20 49 44 2e 0d 0a 20 20 20 20 20 20 ......///.respective.ID.........
c760 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 73 69 6e 67 ......///..............///.Using
c780 20 3c 73 65 65 20 63 72 65 66 3d 22 57 69 74 68 41 6c 6c 44 65 76 69 63 65 73 4d 61 70 70 65 64 .<see.cref="WithAllDevicesMapped
c7a0 54 6f 4e 65 77 49 6e 73 74 61 6e 63 65 73 22 2f 3e 2c 20 61 20 72 65 70 6c 61 79 20 63 6f 6e 74 ToNewInstances"/>,.a.replay.cont
c7c0 72 6f 6c 6c 65 72 20 63 61 6e 20 62 65 20 69 6e 73 74 72 75 63 74 65 64 20 74 6f 20 63 72 65 61 roller.can.be.instructed.to.crea
c7e0 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 65 77 2c 20 74 65 6d 70 6f 72 61 te..............///.new,.tempora
c800 72 79 20 64 65 76 69 63 65 73 20 69 6e 73 74 65 61 64 20 66 6f 72 20 65 61 63 68 20 75 6e 69 71 ry.devices.instead.for.each.uniq
c820 75 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 64 65 76 69 63 65 49 ue.<see.cref="InputEvent.deviceI
c840 64 22 2f 3e 20 65 6e 63 6f 75 6e 74 65 72 65 64 20 69 6e 20 74 68 65 20 73 74 72 65 61 6d 2e 0d d"/>.encountered.in.the.stream..
c860 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 6c 6c 20 64 65 76 69 63 65 73 20 63 72 65 .............///.All.devices.cre
c880 61 74 65 64 20 62 79 20 74 68 65 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 74 68 69 73 20 77 61 79 20 ated.by.the.controller.this.way.
c8a0 77 69 6c 6c 20 62 65 20 70 75 74 20 6f 6e 20 74 68 69 73 20 6c 69 73 74 2e 0d 0a 20 20 20 20 20 will.be.put.on.this.list........
c8c0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 .......///.</remarks>...........
c8e0 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 57 69 74 68 41 6c 6c 44 65 76 ...///.<seealso.cref="WithAllDev
c900 69 63 65 73 4d 61 70 70 65 64 54 6f 4e 65 77 49 6e 73 74 61 6e 63 65 73 22 2f 3e 0d 0a 20 20 20 icesMappedToNewInstances"/>.....
c920 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 3c 49 6e 70 75 .........public.IEnumerable<Inpu
c940 74 44 65 76 69 63 65 3e 20 63 72 65 61 74 65 64 44 65 76 69 63 65 73 20 3d 3e 20 6d 5f 43 72 65 tDevice>.createdDevices.=>.m_Cre
c960 61 74 65 64 44 65 76 69 63 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 atedDevices;................priv
c980 61 74 65 20 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 20 6d 5f 45 76 65 6e 74 54 72 61 63 65 ate.InputEventTrace.m_EventTrace
c9a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 45 6e 75 6d 65 72 61 74 6f ;..............private.Enumerato
c9c0 72 20 6d 5f 45 6e 75 6d 65 72 61 74 6f 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 r.m_Enumerator;..............pri
c9e0 76 61 74 65 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c 4b 65 79 56 61 6c 75 65 50 61 69 72 3c 69 vate.InlinedArray<KeyValuePair<i
ca00 6e 74 2c 20 69 6e 74 3e 3e 20 6d 5f 44 65 76 69 63 65 49 44 4d 61 70 70 69 6e 67 73 3b 0d 0a 20 nt,.int>>.m_DeviceIDMappings;...
ca20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 43 72 65 61 74 65 ...........private.bool.m_Create
ca40 4e 65 77 44 65 76 69 63 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 NewDevices;..............private
ca60 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c 49 6e 70 75 74 44 65 76 69 63 65 3e 20 6d 5f 43 72 65 .InlinedArray<InputDevice>.m_Cre
ca80 61 74 65 64 44 65 76 69 63 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 atedDevices;..............privat
caa0 65 20 41 63 74 69 6f 6e 20 6d 5f 4f 6e 46 69 6e 69 73 68 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 e.Action.m_OnFinished;..........
cac0 20 20 20 20 70 72 69 76 61 74 65 20 41 63 74 69 6f 6e 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 ....private.Action<InputEventPtr
cae0 3e 20 6d 5f 4f 6e 45 76 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 >.m_OnEvent;..............privat
cb00 65 20 64 6f 75 62 6c 65 20 6d 5f 53 74 61 72 74 54 69 6d 65 41 73 50 65 72 46 69 72 73 74 45 76 e.double.m_StartTimeAsPerFirstEv
cb20 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 64 6f 75 62 6c 65 ent;..............private.double
cb40 20 6d 5f 53 74 61 72 74 54 69 6d 65 41 73 50 65 72 52 75 6e 74 69 6d 65 3b 0d 0a 20 20 20 20 20 .m_StartTimeAsPerRuntime;.......
cb60 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 .......private.int.m_AllEventsBy
cb80 54 69 6d 65 49 6e 64 65 78 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 TimeIndex.=.0;..............priv
cba0 61 74 65 20 4c 69 73 74 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 3e 20 6d 5f 41 6c 6c 45 76 65 ate.List<InputEventPtr>.m_AllEve
cbc0 6e 74 73 42 79 54 69 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e ntsByTime;................intern
cbe0 61 6c 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 28 49 6e 70 75 74 45 76 65 6e 74 54 72 al.ReplayController(InputEventTr
cc00 61 63 65 20 74 72 61 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 ace.trace)..............{.......
cc20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 72 61 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 ...........if.(trace.==.null)...
cc40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 ...................throw.new.Arg
cc60 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 74 72 61 63 65 29 umentNullException(nameof(trace)
cc80 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 76 65 6e 74 54 72 61 );....................m_EventTra
cca0 63 65 20 3d 20 74 72 61 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ce.=.trace;..............}......
ccc0 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 ..........///.<summary>.........
cce0 20 20 20 20 20 2f 2f 2f 20 52 65 6d 6f 76 65 73 20 64 65 76 69 63 65 73 20 63 72 65 61 74 65 64 .....///.Removes.devices.created
cd00 20 62 79 20 74 68 65 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 77 68 65 6e 20 75 73 69 6e 67 20 3c 73 .by.the.controller.when.using.<s
cd20 65 65 20 63 72 65 66 3d 22 57 69 74 68 41 6c 6c 44 65 76 69 63 65 73 4d 61 70 70 65 64 54 6f 4e ee.cref="WithAllDevicesMappedToN
cd40 65 77 49 6e 73 74 61 6e 63 65 73 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f ewInstances"/>...............///
cd60 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 .</summary>..............public.
cd80 76 6f 69 64 20 44 69 73 70 6f 73 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 void.Dispose()..............{...
cda0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 ...............InputSystem.onBef
cdc0 6f 72 65 55 70 64 61 74 65 20 2d 3d 20 4f 6e 42 65 67 69 6e 46 72 61 6d 65 3b 0d 0a 20 20 20 20 oreUpdate.-=.OnBeginFrame;......
cde0 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6e 69 73 68 65 64 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a ............finished.=.true;....
ce00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 64 65 76 ................foreach.(var.dev
ce20 69 63 65 20 69 6e 20 6d 5f 43 72 65 61 74 65 64 44 65 76 69 63 65 73 29 0d 0a 20 20 20 20 20 20 ice.in.m_CreatedDevices)........
ce40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 52 65 6d 6f 76 65 ..............InputSystem.Remove
ce60 44 65 76 69 63 65 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Device(device);.................
ce80 20 6d 5f 43 72 65 61 74 65 64 44 65 76 69 63 65 73 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 .m_CreatedDevices.=.default;....
cea0 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ..........}................///.<
cec0 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 70 6c 61 79 summary>..............///.Replay
cee0 20 65 76 65 6e 74 73 20 72 65 63 6f 72 64 65 64 20 66 72 6f 6d 20 3c 70 61 72 61 6d 72 65 66 20 .events.recorded.from.<paramref.
cf00 6e 61 6d 65 3d 22 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 22 2f 3e 20 6f 6e 20 64 65 76 69 63 name="recordedDevice"/>.on.devic
cf20 65 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 e.<paramref.name="playbackDevice
cf40 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e "/>...............///.</summary>
cf60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 72 ..............///.<param.name="r
cf80 65 63 6f 72 64 65 64 44 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 65 76 65 6e 74 73 20 68 61 76 ecordedDevice">Device.events.hav
cfa0 65 20 62 65 65 6e 20 72 65 63 6f 72 64 65 64 20 66 72 6f 6d 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 e.been.recorded.from.</param>...
cfc0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6c 61 79 ...........///.<param.name="play
cfe0 62 61 63 6b 44 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 65 76 65 6e 74 73 20 73 68 6f 75 6c 64 backDevice">Device.events.should
d000 20 62 65 20 70 6c 61 79 65 64 20 62 61 63 6b 20 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 .be.played.back.on.</param>.....
d020 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 73 61 6d 65 20 52 .........///.<returns>The.same.R
d040 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 69 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 74 75 72 eplayController.instance.</retur
d060 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 ns>..............///.<exception.
d080 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 cref="ArgumentNullException"><pa
d0a0 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 22 2f 3e 20 69 ramref.name="recordedDevice"/>.i
d0c0 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 2d 6f 72 2d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 s.<c>null</c>.-or-..............
d0e0 2f 2f 2f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 6c 61 79 62 61 63 6b 44 65 76 69 ///.<paramref.name="playbackDevi
d100 63 65 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e ce"/>.is.<c>null</c>.</exception
d120 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 >..............///.<remarks>....
d140 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 63 61 75 73 65 73 ..........///.This.method.causes
d160 20 61 6c 6c 20 65 76 65 6e 74 73 20 77 69 74 68 20 61 20 64 65 76 69 63 65 20 49 44 20 28 73 65 .all.events.with.a.device.ID.(se
d180 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 2e 64 65 76 69 63 65 49 e.<see.cref="InputDevice.deviceI
d1a0 64 22 2f 3e 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 64 d"/>.and.<see.cref="InputEvent.d
d1c0 65 76 69 63 65 49 64 22 2f 3e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 6f 72 eviceId"/>)..............///.cor
d1e0 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 6f 6e 65 20 6f 66 20 3c 70 61 72 61 6d 72 responding.to.the.one.of.<paramr
d200 65 66 20 63 72 65 66 3d 22 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 22 2f 3e 20 74 6f 20 62 65 ef.cref="recordedDevice"/>.to.be
d220 20 71 75 65 75 65 64 20 77 69 74 68 20 74 68 65 20 64 65 76 69 63 65 20 49 44 20 6f 66 20 3c 70 .queued.with.the.device.ID.of.<p
d240 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 22 2f 3e 2e aramref.name="playbackDevice"/>.
d260 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 ..............///.</remarks>....
d280 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 ..........public.ReplayControlle
d2a0 72 20 57 69 74 68 44 65 76 69 63 65 4d 61 70 70 65 64 46 72 6f 6d 54 6f 28 49 6e 70 75 74 44 65 r.WithDeviceMappedFromTo(InputDe
d2c0 76 69 63 65 20 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 2c 20 49 6e 70 75 74 44 65 76 69 63 65 vice.recordedDevice,.InputDevice
d2e0 20 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d .playbackDevice)..............{.
d300 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 65 63 6f 72 64 65 64 44 65 76 .................if.(recordedDev
d320 69 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ice.==.null)....................
d340 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f ..throw.new.ArgumentNullExceptio
d360 6e 28 6e 61 6d 65 6f 66 28 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 29 29 3b 0d 0a 20 20 20 20 n(nameof(recordedDevice));......
d380 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 20 3d ............if.(playbackDevice.=
d3a0 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 =.null)......................thr
d3c0 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d ow.new.ArgumentNullException(nam
d3e0 65 6f 66 28 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 eof(playbackDevice));...........
d400 20 20 20 20 20 20 20 20 20 57 69 74 68 44 65 76 69 63 65 4d 61 70 70 65 64 46 72 6f 6d 54 6f 28 .........WithDeviceMappedFromTo(
d420 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 2c 20 70 6c 61 79 62 61 63 recordedDevice.deviceId,.playbac
d440 6b 44 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 kDevice.deviceId);..............
d460 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ....return.this;..............}.
d480 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 ...............///.<summary>....
d4a0 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 70 6c 61 63 65 20 3c 73 65 65 20 63 72 65 66 3d ..........///.Replace.<see.cref=
d4c0 22 49 6e 70 75 74 45 76 65 6e 74 2e 64 65 76 69 63 65 49 64 22 2f 3e 20 76 61 6c 75 65 73 20 6f "InputEvent.deviceId"/>.values.o
d4e0 66 20 65 76 65 6e 74 73 20 74 68 61 74 20 61 72 65 20 65 71 75 61 6c 20 74 6f 20 3c 70 61 72 61 f.events.that.are.equal.to.<para
d500 6d 72 65 66 20 6e 61 6d 65 3d 22 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 49 64 22 2f 3e 0d 0a mref.name="recordedDeviceId"/>..
d520 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 74 68 20 64 65 76 69 63 65 20 49 44 20 3c ............///.with.device.ID.<
d540 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 49 64 22 paramref.name="playbackDeviceId"
d560 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d />...............///.</summary>.
d580 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 72 65 .............///.<param.name="re
d5a0 63 6f 72 64 65 64 44 65 76 69 63 65 49 64 22 3e 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 cordedDeviceId"><see.cref="Input
d5c0 44 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 22 2f 3e 20 74 6f 20 6d 61 70 20 66 72 6f 6d 2e 3c Device.deviceId"/>.to.map.from.<
d5e0 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 /param>..............///.<param.
d600 6e 61 6d 65 3d 22 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 49 64 22 3e 3c 73 65 65 20 63 72 65 name="playbackDeviceId"><see.cre
d620 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 22 2f 3e 20 74 6f 20 6d 61 f="InputDevice.deviceId"/>.to.ma
d640 70 20 74 6f 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c p.to.</param>..............///.<
d660 72 65 74 75 72 6e 73 3e 54 68 65 20 73 61 6d 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 returns>The.same.ReplayControlle
d680 72 20 69 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 r.instance.</returns>...........
d6a0 20 20 20 70 75 62 6c 69 63 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 57 69 74 68 44 ...public.ReplayController.WithD
d6c0 65 76 69 63 65 4d 61 70 70 65 64 46 72 6f 6d 54 6f 28 69 6e 74 20 72 65 63 6f 72 64 65 64 44 65 eviceMappedFromTo(int.recordedDe
d6e0 76 69 63 65 49 64 2c 20 69 6e 74 20 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 49 64 29 0d 0a 20 viceId,.int.playbackDeviceId)...
d700 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f ...........{..................//
d720 20 49 66 20 74 68 65 72 65 27 73 20 61 6e 20 65 78 69 73 74 69 6e 67 20 6d 61 70 70 69 6e 67 20 .If.there's.an.existing.mapping.
d740 65 6e 74 72 79 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 2c 20 75 70 64 61 74 65 20 69 74 2e entry.for.the.device,.update.it.
d760 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 ..................for.(var.i.=.0
d780 3b 20 69 20 3c 20 6d 5f 44 65 76 69 63 65 49 44 4d 61 70 70 69 6e 67 73 2e 6c 65 6e 67 74 68 3b ;.i.<.m_DeviceIDMappings.length;
d7a0 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .++i)..................{........
d7c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 44 65 76 69 63 65 49 44 4d 61 70 70 ..............if.(m_DeviceIDMapp
d7e0 69 6e 67 73 5b 69 5d 2e 4b 65 79 20 21 3d 20 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 49 64 29 ings[i].Key.!=.recordedDeviceId)
d800 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e ..........................contin
d820 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 ue;........................if.(r
d840 65 63 6f 72 64 65 64 44 65 76 69 63 65 49 64 20 3d 3d 20 70 6c 61 79 62 61 63 6b 44 65 76 69 63 ecordedDeviceId.==.playbackDevic
d860 65 49 64 29 20 2f 2f 20 44 65 76 69 63 65 20 6d 61 70 70 65 64 20 62 61 63 6b 20 74 6f 20 69 74 eId).//.Device.mapped.back.to.it
d880 73 65 6c 66 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d self...........................m
d8a0 5f 44 65 76 69 63 65 49 44 4d 61 70 70 69 6e 67 73 2e 52 65 6d 6f 76 65 41 74 57 69 74 68 43 61 _DeviceIDMappings.RemoveAtWithCa
d8c0 70 61 63 69 74 79 28 69 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 pacity(i);......................
d8e0 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f else..........................m_
d900 44 65 76 69 63 65 49 44 4d 61 70 70 69 6e 67 73 5b 69 5d 20 3d 20 6e 65 77 20 4b 65 79 56 61 6c DeviceIDMappings[i].=.new.KeyVal
d920 75 65 50 61 69 72 3c 69 6e 74 2c 20 69 6e 74 3e 28 72 65 63 6f 72 64 65 64 44 65 76 69 63 65 49 uePair<int,.int>(recordedDeviceI
d940 64 2c 20 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 49 64 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 d,.playbackDeviceId);...........
d960 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 .............return.this;.......
d980 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........}....................
d9a0 2f 2f 20 49 67 6e 6f 72 65 20 69 66 20 6d 61 70 70 65 64 20 74 6f 20 69 74 73 65 6c 66 2e 0d 0a //.Ignore.if.mapped.to.itself...
d9c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 65 63 6f 72 64 65 64 44 65 76 69 ................if.(recordedDevi
d9e0 63 65 49 64 20 3d 3d 20 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 49 64 29 0d 0a 20 20 20 20 20 ceId.==.playbackDeviceId).......
da00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 0d 0a 20 ...............return.this;.....
da20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 63 6f 72 64 20 6d 61 70 70 69 6e 67 ...............//.Record.mapping
da40 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 49 44 4d 61 70 ...................m_DeviceIDMap
da60 70 69 6e 67 73 2e 41 70 70 65 6e 64 57 69 74 68 43 61 70 61 63 69 74 79 28 6e 65 77 20 4b 65 79 pings.AppendWithCapacity(new.Key
da80 56 61 6c 75 65 50 61 69 72 3c 69 6e 74 2c 20 69 6e 74 3e 28 72 65 63 6f 72 64 65 64 44 65 76 69 ValuePair<int,.int>(recordedDevi
daa0 63 65 49 64 2c 20 70 6c 61 79 62 61 63 6b 44 65 76 69 63 65 49 64 29 29 3b 0d 0a 20 20 20 20 20 ceId,.playbackDeviceId));.......
dac0 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 20 20 ...........return.this;.........
dae0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 .....}................///.<summa
db00 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 61 6c 6c 20 65 76 65 ry>..............///.For.all.eve
db20 6e 74 73 2c 20 63 72 65 61 74 65 20 6e 65 77 20 64 65 76 69 63 65 73 20 74 6f 20 72 65 70 6c 61 nts,.create.new.devices.to.repla
db40 79 20 74 68 65 20 65 76 65 6e 74 73 20 6f 6e 20 69 6e 73 74 65 61 64 20 6f 66 20 72 65 70 6c 61 y.the.events.on.instead.of.repla
db60 79 69 6e 67 20 74 68 65 20 65 76 65 6e 74 73 20 6f 6e 20 65 78 69 73 74 69 6e 67 20 64 65 76 69 ying.the.events.on.existing.devi
db80 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e ces...............///.</summary>
dba0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 73 ..............///.<returns>The.s
dbc0 61 6d 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 69 6e 73 74 61 6e 63 65 2e 3c 2f ame.ReplayController.instance.</
dbe0 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 returns>..............///.<remar
dc00 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 64 ks>..............///.Note.that.d
dc20 65 76 69 63 65 73 20 63 72 65 61 74 65 64 20 62 79 20 74 68 65 20 3c 63 3e 52 65 70 6c 61 79 43 evices.created.by.the.<c>ReplayC
dc40 6f 6e 74 72 6f 6c 6c 65 72 3c 2f 63 3e 20 77 69 6c 6c 20 73 74 69 63 6b 20 61 72 6f 75 6e 64 20 ontroller</c>.will.stick.around.
dc60 66 6f 72 20 61 73 20 6c 6f 6e 67 20 61 73 20 74 68 65 20 72 65 70 6c 61 79 0d 0a 20 20 20 20 20 for.as.long.as.the.replay.......
dc80 20 20 20 20 20 20 20 2f 2f 2f 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 69 73 20 6e 6f 74 20 64 69 73 .......///.controller.is.not.dis
dca0 70 6f 73 65 64 20 6f 66 2e 20 54 68 69 73 20 6d 65 61 6e 73 20 74 68 61 74 20 6d 75 6c 74 69 70 posed.of..This.means.that.multip
dcc0 6c 65 20 73 75 63 63 65 73 73 69 76 65 20 72 65 70 6c 61 79 73 20 75 73 69 6e 67 20 74 68 65 20 le.successive.replays.using.the.
dce0 73 61 6d 65 20 3c 63 3e 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 3c 2f 63 3e 0d 0a 20 20 same.<c>ReplayController</c>....
dd00 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 72 65 70 6c 61 79 20 74 68 65 20 65 76 ..........///.will.replay.the.ev
dd20 65 6e 74 73 20 6f 6e 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 73 20 74 68 61 74 20 77 65 ents.on.the.same.devices.that.we
dd40 72 65 20 63 72 65 61 74 65 64 20 6f 6e 20 74 68 65 20 66 69 72 73 74 20 72 65 70 6c 61 79 2e 20 re.created.on.the.first.replay..
dd60 49 74 20 61 6c 73 6f 20 6d 65 61 6e 73 20 74 68 61 74 20 69 6e 20 6f 72 64 65 72 0d 0a 20 20 20 It.also.means.that.in.order.....
dd80 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 64 6f 20 61 77 61 79 20 77 69 74 68 20 74 68 65 .........///.to.do.away.with.the
dda0 20 63 72 65 61 74 65 64 20 64 65 76 69 63 65 73 2c 20 69 74 20 69 73 20 6e 65 63 65 73 73 61 72 .created.devices,.it.is.necessar
ddc0 79 20 74 6f 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 44 69 73 70 6f 73 65 22 2f 3e 2e y.to.call.<see.cref="Dispose"/>.
dde0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 ..............///.</remarks>....
de00 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 44 69 73 ..........///.<seealso.cref="Dis
de20 70 6f 73 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 pose"/>..............///.<seeals
de40 6f 20 63 72 65 66 3d 22 63 72 65 61 74 65 64 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 o.cref="createdDevices"/>.......
de60 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 57 .......public.ReplayController.W
de80 69 74 68 41 6c 6c 44 65 76 69 63 65 73 4d 61 70 70 65 64 54 6f 4e 65 77 49 6e 73 74 61 6e 63 65 ithAllDevicesMappedToNewInstance
dea0 73 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 s()..............{..............
dec0 20 20 20 20 6d 5f 43 72 65 61 74 65 4e 65 77 44 65 76 69 63 65 73 20 3d 20 74 72 75 65 3b 0d 0a ....m_CreateNewDevices.=.true;..
dee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 ................return.this;....
df00 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ..........}................///.<
df20 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 76 6f 6b 65 summary>..............///.Invoke
df40 20 74 68 65 20 67 69 76 65 6e 20 63 61 6c 6c 62 61 63 6b 20 77 68 65 6e 20 70 6c 61 79 62 61 63 .the.given.callback.when.playbac
df60 6b 20 66 69 6e 69 73 68 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 k.finishes...............///.</s
df80 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 ummary>..............///.<param.
dfa0 6e 61 6d 65 3d 22 61 63 74 69 6f 6e 22 3e 41 20 63 61 6c 6c 62 61 63 6b 20 74 6f 20 69 6e 76 6f name="action">A.callback.to.invo
dfc0 6b 65 20 77 68 65 6e 20 70 6c 61 79 62 61 63 6b 20 66 69 6e 69 73 68 65 73 2e 3c 2f 70 61 72 61 ke.when.playback.finishes.</para
dfe0 6d 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 m>..............///.<returns>The
e000 20 73 61 6d 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 69 6e 73 74 61 6e 63 65 2e .same.ReplayController.instance.
e020 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 </returns>..............public.R
e040 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 4f 6e 46 69 6e 69 73 68 65 64 28 41 63 74 69 6f eplayController.OnFinished(Actio
e060 6e 20 61 63 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 n.action)..............{........
e080 20 20 20 20 20 20 20 20 20 20 6d 5f 4f 6e 46 69 6e 69 73 68 65 64 20 3d 20 61 63 74 69 6f 6e 3b ..........m_OnFinished.=.action;
e0a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a ..................return.this;..
e0c0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f ............}................///
e0e0 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 76 6f .<summary>..............///.Invo
e100 6b 65 20 74 68 65 20 67 69 76 65 6e 20 63 61 6c 6c 62 61 63 6b 20 77 68 65 6e 20 61 6e 20 65 76 ke.the.given.callback.when.an.ev
e120 65 6e 74 20 69 73 20 61 62 6f 75 74 20 74 6f 20 62 65 20 71 75 65 75 65 64 2e 0d 0a 20 20 20 20 ent.is.about.to.be.queued.......
e140 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</summary>..........
e160 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 61 63 74 69 6f 6e 22 3e 41 20 63 ....///.<param.name="action">A.c
e180 61 6c 6c 62 61 63 6b 20 74 6f 20 69 6e 76 6f 6b 65 20 77 68 65 6e 20 61 6e 20 65 76 65 6e 74 20 allback.to.invoke.when.an.event.
e1a0 69 73 20 67 65 74 74 69 6e 67 20 71 75 65 75 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 is.getting.queued.</param>......
e1c0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 73 61 6d 65 20 52 65 ........///.<returns>The.same.Re
e1e0 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 69 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 74 75 72 6e playController.instance.</return
e200 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 70 6c 61 79 43 6f 6e s>..............public.ReplayCon
e220 74 72 6f 6c 6c 65 72 20 4f 6e 45 76 65 6e 74 28 41 63 74 69 6f 6e 3c 49 6e 70 75 74 45 76 65 6e troller.OnEvent(Action<InputEven
e240 74 50 74 72 3e 20 61 63 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 tPtr>.action)..............{....
e260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4f 6e 45 76 65 6e 74 20 3d 20 61 63 74 69 6f 6e ..............m_OnEvent.=.action
e280 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d ;..................return.this;.
e2a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .............}................//
e2c0 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 61 6b /.<summary>..............///.Tak
e2e0 65 73 20 74 68 65 20 6e 65 78 74 20 65 76 65 6e 74 20 66 72 6f 6d 20 74 68 65 20 74 72 61 63 65 es.the.next.event.from.the.trace
e300 20 61 6e 64 20 71 75 65 75 65 73 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f .and.queues.it...............///
e320 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 .</summary>..............///.<re
e340 74 75 72 6e 73 3e 54 68 65 20 73 61 6d 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 turns>The.same.ReplayController.
e360 69 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 instance.</returns>.............
e380 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 6e 76 61 6c 69 64 4f 70 65 .///.<exception.cref="InvalidOpe
e3a0 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 22 3e 54 68 65 72 65 20 61 72 65 20 6e 6f 20 6d 6f rationException">There.are.no.mo
e3c0 72 65 20 65 76 65 6e 74 73 20 69 6e 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 74 72 61 63 re.events.in.the.<see.cref="trac
e3e0 65 22 2f 3e 20 2d 6f 72 2d 20 74 68 65 20 6f 6e 6c 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 e"/>.-or-.the.only..............
e400 2f 2f 2f 20 65 76 65 6e 74 73 20 6c 65 66 74 20 61 72 65 20 66 72 61 6d 65 20 6d 61 72 6b 65 72 ///.events.left.are.frame.marker
e420 20 65 76 65 6e 74 73 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 .events.(see.<see.cref="InputEve
e440 6e 74 54 72 61 63 65 2e 46 72 61 6d 65 4d 61 72 6b 65 72 45 76 65 6e 74 22 2f 3e 29 2e 3c 2f 65 ntTrace.FrameMarkerEvent"/>).</e
e460 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 xception>..............///.<rema
e480 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f rks>..............///.This.metho
e4a0 64 20 74 61 6b 65 73 20 74 68 65 20 6e 65 78 74 20 65 76 65 6e 74 20 61 74 20 74 68 65 20 63 75 d.takes.the.next.event.at.the.cu
e4c0 72 72 65 6e 74 20 72 65 61 64 20 70 6f 73 69 74 69 6f 6e 20 61 6e 64 20 71 75 65 75 65 73 20 69 rrent.read.position.and.queues.i
e4e0 74 20 75 73 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 79 73 74 65 6d 2e 51 t.using.<see.cref="InputSystem.Q
e500 75 65 75 65 45 76 65 6e 74 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 ueueEvent"/>...............///.T
e520 68 65 20 72 65 61 64 20 70 6f 73 69 74 69 6f 6e 20 69 73 20 61 64 76 61 6e 63 65 64 20 70 61 73 he.read.position.is.advanced.pas
e540 74 20 74 68 65 20 74 61 6b 65 6e 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 t.the.taken.event...............
e560 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 72 61 6d 65 20 6d 61 72 6b 65 ///..............///.Frame.marke
e580 72 20 65 76 65 6e 74 73 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 r.events.(see.<see.cref="InputEv
e5a0 65 6e 74 54 72 61 63 65 2e 46 72 61 6d 65 4d 61 72 6b 65 72 45 76 65 6e 74 22 2f 3e 29 20 61 72 entTrace.FrameMarkerEvent"/>).ar
e5c0 65 20 73 6b 69 70 70 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 e.skipped...............///.</re
e5e0 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 70 6c 61 marks>..............public.Repla
e600 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 50 6c 61 79 4f 6e 65 45 76 65 6e 74 28 29 0d 0a 20 20 20 20 yController.PlayOneEvent()......
e620 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6b ........{..................//.Sk
e640 69 70 20 65 76 65 6e 74 73 20 75 6e 74 69 6c 20 77 65 20 68 69 74 20 73 6f 6d 65 74 68 69 6e 67 ip.events.until.we.hit.something
e660 20 74 68 61 74 20 69 73 6e 27 74 20 61 20 66 72 61 6d 65 20 6d 61 72 6b 65 72 2e 0d 0a 20 20 20 .that.isn't.a.frame.marker......
e680 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 4d 6f 76 65 4e 65 78 74 28 74 72 75 65 2c .............if.(!MoveNext(true,
e6a0 20 6f 75 74 20 76 61 72 20 65 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .out.var.eventPtr)).............
e6c0 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 .........throw.new.InvalidOperat
e6e0 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 22 4e 6f 20 6d 6f 72 65 20 65 76 65 6e 74 73 22 29 3b 0d ionException("No.more.events");.
e700 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 51 75 65 75 65 45 76 65 6e 74 28 65 76 ...................QueueEvent(ev
e720 65 6e 74 50 74 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 entPtr);....................retu
e740 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 rn.this;..............}.........
e760 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 4f 6e 65 46 72 61 6d 65 0d 0a 20 20 20 20 20 .......////TODO:.OneFrame.......
e780 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 52 65 77 69 6e 64 4f 6e 65 45 76 65 6e 74 0d .......////TODO:.RewindOneEvent.
e7a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 52 65 77 69 6e 64 4f 6e 65 .............////TODO:.RewindOne
e7c0 46 72 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 53 74 6f Frame..............////TODO:.Sto
e7e0 70 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a p................///.<summary>..
e800 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 77 69 6e 64 20 70 6c 61 79 62 61 63 6b 20 ............///.Rewind.playback.
e820 61 6c 6c 20 74 68 65 20 77 61 79 20 74 6f 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 6f 66 20 all.the.way.to.the.beginning.of.
e840 74 68 65 20 65 76 65 6e 74 20 74 72 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f the.event.trace...............//
e860 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 /.</summary>..............///.<r
e880 65 74 75 72 6e 73 3e 54 68 65 20 73 61 6d 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 eturns>The.same.ReplayController
e8a0 20 69 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 .instance.</returns>............
e8c0 20 20 70 75 62 6c 69 63 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 52 65 77 69 6e 64 ..public.ReplayController.Rewind
e8e0 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ()..............{...............
e900 20 20 20 6d 5f 45 6e 75 6d 65 72 61 74 6f 72 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 ...m_Enumerator.=.default;......
e920 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 20 3d 20 ............m_AllEventsByTime.=.
e940 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 41 6c 6c 45 76 65 6e null;..................m_AllEven
e960 74 73 42 79 54 69 6d 65 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tsByTimeIndex.=.-1;.............
e980 20 20 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .....position.=.0;..............
e9a0 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ....return.this;..............}.
e9c0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 ...............///.<summary>....
e9e0 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 70 6c 61 79 20 61 6c 6c 20 66 72 61 6d 65 73 20 ..........///.Replay.all.frames.
ea00 6f 6e 65 20 62 79 20 6f 6e 65 20 66 72 6f 6d 20 74 68 65 20 63 75 72 72 65 6e 74 20 70 6c 61 79 one.by.one.from.the.current.play
ea20 62 61 63 6b 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 back.position...............///.
ea40 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 </summary>..............///.<ret
ea60 75 72 6e 73 3e 54 68 65 20 73 61 6d 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 69 urns>The.same.ReplayController.i
ea80 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nstance.</returns>..............
eaa0 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 ///.<remarks>..............///.E
eac0 76 65 6e 74 73 20 77 69 6c 6c 20 62 65 20 66 65 64 20 74 6f 20 74 68 65 20 69 6e 70 75 74 20 73 vents.will.be.fed.to.the.input.s
eae0 79 73 74 65 6d 20 66 72 6f 6d 20 77 69 74 68 69 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 ystem.from.within.<see.cref="Inp
eb00 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 22 2f 3e 2e 20 45 61 63 68 utSystem.onBeforeUpdate"/>..Each
eb20 20 75 70 64 61 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 72 65 .update..............///.will.re
eb40 63 65 69 76 65 20 65 76 65 6e 74 73 20 66 6f 72 20 6f 6e 65 20 66 72 61 6d 65 2e 0d 0a 20 20 20 ceive.events.for.one.frame......
eb60 20 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f .........///..............///.No
eb80 74 65 20 74 68 61 74 20 66 6f 72 20 74 68 69 73 20 6d 65 74 68 6f 64 20 74 6f 20 63 6f 72 72 65 te.that.for.this.method.to.corre
eba0 63 74 6c 79 20 73 70 61 63 65 20 6f 75 74 20 65 76 65 6e 74 73 20 61 6e 64 20 64 69 73 74 72 69 ctly.space.out.events.and.distri
ebc0 62 75 74 65 20 74 68 65 6d 20 74 6f 20 66 72 61 6d 65 73 2c 20 66 72 61 6d 65 20 6d 61 72 6b 65 bute.them.to.frames,.frame.marke
ebe0 72 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 75 73 74 20 62 65 20 70 72 65 73 rs..............///.must.be.pres
ec00 65 6e 74 20 69 6e 20 74 68 65 20 74 72 61 63 65 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d ent.in.the.trace.(see.<see.cref=
ec20 22 72 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 22 2f 3e 29 2e 20 49 66 20 6e 6f 74 20 "recordFrameMarkers"/>)..If.not.
ec40 70 72 65 73 65 6e 74 2c 20 61 6c 6c 20 65 76 65 6e 74 73 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 present,.all.events.will........
ec60 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 66 65 64 20 69 6e 74 6f 20 66 69 72 73 74 20 66 72 61 6d ......///.be.fed.into.first.fram
ec80 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a e...............///.</remarks>..
eca0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 72 ............///.<seealso.cref="r
ecc0 65 63 6f 72 64 46 72 61 6d 65 4d 61 72 6b 65 72 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 ecordFrameMarkers"/>............
ece0 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 53 79 73 74 65 6d ..///.<seealso.cref="InputSystem
ed00 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .onBeforeUpdate"/>..............
ed20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 6c 61 79 41 6c 6c 45 76 65 6e 74 73 ///.<seealso.cref="PlayAllEvents
ed40 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 "/>..............///.<seealso.cr
ed60 65 66 3d 22 50 6c 61 79 41 6c 6c 45 76 65 6e 74 73 41 63 63 6f 72 64 69 6e 67 54 6f 54 69 6d 65 ef="PlayAllEventsAccordingToTime
ed80 73 74 61 6d 70 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 stamps"/>..............public.Re
eda0 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 50 6c 61 79 41 6c 6c 46 72 61 6d 65 73 4f 6e 65 42 playController.PlayAllFramesOneB
edc0 79 4f 6e 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 yOne()..............{...........
ede0 20 20 20 20 20 20 20 66 69 6e 69 73 68 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 .......finished.=.false;........
ee00 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 65 55 70 ..........InputSystem.onBeforeUp
ee20 64 61 74 65 20 2b 3d 20 4f 6e 42 65 67 69 6e 46 72 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 date.+=.OnBeginFrame;...........
ee40 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .......return.this;.............
ee60 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d .}................///.<summary>.
ee80 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 47 6f 20 74 68 72 6f 75 67 68 20 61 6c 6c 20 .............///.Go.through.all.
eea0 72 65 6d 61 69 6e 69 6e 67 20 65 76 65 6e 74 20 69 6e 20 74 68 65 20 74 72 61 63 65 20 73 74 61 remaining.event.in.the.trace.sta
eec0 72 74 69 6e 67 20 61 74 20 74 68 65 20 63 75 72 72 65 6e 74 20 72 65 61 64 20 70 6f 73 69 74 69 rting.at.the.current.read.positi
eee0 6f 6e 20 61 6e 64 20 71 75 65 75 65 20 74 68 65 6d 20 75 73 69 6e 67 0d 0a 20 20 20 20 20 20 20 on.and.queue.them.using.........
ef00 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 79 73 74 65 6d 2e .....///.<see.cref="InputSystem.
ef20 51 75 65 75 65 45 76 65 6e 74 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 QueueEvent"/>...............///.
ef40 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 </summary>..............///.<ret
ef60 75 72 6e 73 3e 54 68 65 20 73 61 6d 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 69 urns>The.same.ReplayController.i
ef80 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nstance.</returns>..............
efa0 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 ///.<remarks>..............///.U
efc0 6e 6c 69 6b 65 20 6d 65 74 68 6f 64 73 20 73 75 63 68 20 61 73 20 3c 73 65 65 20 63 72 65 66 3d nlike.methods.such.as.<see.cref=
efe0 22 50 6c 61 79 41 6c 6c 46 72 61 6d 65 73 4f 6e 65 42 79 4f 6e 65 22 2f 3e 2c 20 74 68 69 73 20 "PlayAllFramesOneByOne"/>,.this.
f000 6d 65 74 68 6f 64 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 71 75 65 75 65 73 20 65 76 65 6e 74 73 method.immediately.queues.events
f020 20 61 6e 64 20 69 6d 6d 65 64 69 61 74 65 6c 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .and.immediately..............//
f040 2f 20 63 6f 6d 70 6c 65 74 65 73 20 70 6c 61 79 62 61 63 6b 20 75 70 6f 6e 20 72 65 74 75 72 6e /.completes.playback.upon.return
f060 20 66 72 6f 6d 20 74 68 65 20 6d 65 74 68 6f 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f .from.the.method.............../
f080 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c //.</remarks>..............///.<
f0a0 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 6c 61 79 41 6c 6c 46 72 61 6d 65 73 4f 6e 65 42 79 seealso.cref="PlayAllFramesOneBy
f0c0 4f 6e 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f One"/>..............///.<seealso
f0e0 20 63 72 65 66 3d 22 50 6c 61 79 41 6c 6c 45 76 65 6e 74 73 41 63 63 6f 72 64 69 6e 67 54 6f 54 .cref="PlayAllEventsAccordingToT
f100 69 6d 65 73 74 61 6d 70 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 imestamps"/>..............public
f120 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 50 6c 61 79 41 6c 6c 45 76 65 6e 74 73 28 .ReplayController.PlayAllEvents(
f140 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )..............{................
f160 20 20 66 69 6e 69 73 68 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..finished.=.false;.............
f180 20 20 20 20 20 74 72 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 .....try..................{.....
f1a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 4d 6f 76 65 4e 65 78 74 .................while.(MoveNext
f1c0 28 74 72 75 65 2c 20 6f 75 74 20 76 61 72 20 65 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 (true,.out.var.eventPtr)).......
f1e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 51 75 65 75 65 45 76 65 6e 74 28 65 76 ...................QueueEvent(ev
f200 65 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 entPtr);..................}.....
f220 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6e 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 20 20 .............finally............
f240 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 69 6e ......{......................Fin
f260 69 73 68 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 ished();..................}.....
f280 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 .............return.this;.......
f2a0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d .......}................///.<sum
f2c0 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 70 6c 61 79 20 65 76 mary>..............///.Replay.ev
f2e0 65 6e 74 73 20 69 6e 20 61 20 77 61 79 20 74 68 61 74 20 74 72 69 65 73 20 74 6f 20 70 72 65 73 ents.in.a.way.that.tries.to.pres
f300 65 72 76 65 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 74 69 6d 69 6e 67 20 73 65 71 75 65 6e 63 erve.the.original.timing.sequenc
f320 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a e...............///.</summary>..
f340 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 73 61 6d ............///.<returns>The.sam
f360 65 20 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 69 6e 73 74 61 6e 63 65 2e 3c 2f 72 65 e.ReplayController.instance.</re
f380 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 turns>..............///.<remarks
f3a0 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 77 >..............///.This.method.w
f3c0 69 6c 6c 20 74 61 6b 65 20 74 68 65 20 63 75 72 72 65 6e 74 20 74 69 6d 65 20 61 73 20 74 68 65 ill.take.the.current.time.as.the
f3e0 20 73 74 61 72 74 69 6e 67 20 74 69 6d 65 20 74 6f 20 77 68 69 63 68 20 6d 61 6b 65 20 61 6c 6c .starting.time.to.which.make.all
f400 20 65 76 65 6e 74 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 6c 61 74 69 76 .events..............///.relativ
f420 65 20 74 6f 2e 20 42 61 73 65 64 20 6f 6e 20 74 68 69 73 20 74 69 6d 65 2c 20 69 74 20 77 69 6c e.to..Based.on.this.time,.it.wil
f440 6c 20 74 72 79 20 74 6f 20 63 6f 72 72 65 6c 61 74 65 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 l.try.to.correlate.the.original.
f460 65 76 65 6e 74 20 74 69 6d 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 event.timing..............///.wi
f480 74 68 20 74 68 65 20 74 69 6d 69 6e 67 20 6f 66 20 69 6e 70 75 74 20 75 70 64 61 74 65 73 20 61 th.the.timing.of.input.updates.a
f4a0 73 20 74 68 65 79 20 68 61 70 70 65 6e 2e 20 57 68 65 6e 20 73 75 63 63 65 73 73 66 75 6c 2c 20 s.they.happen..When.successful,.
f4c0 74 68 69 73 20 77 69 6c 6c 20 63 6f 6d 70 65 6e 73 61 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 this.will.compensate............
f4e0 20 20 2f 2f 2f 20 66 6f 72 20 64 69 66 66 65 72 65 6e 63 65 73 20 69 6e 20 66 72 61 6d 65 20 74 ..///.for.differences.in.frame.t
f500 69 6d 69 6e 67 73 20 63 6f 6d 70 61 72 65 64 20 74 6f 20 77 68 65 6e 20 69 6e 70 75 74 20 77 61 imings.compared.to.when.input.wa
f520 73 20 72 65 63 6f 72 64 65 64 20 61 6e 64 20 69 6e 73 74 65 61 64 20 71 75 65 75 65 0d 0a 20 20 s.recorded.and.instead.queue....
f540 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 70 75 74 20 69 6e 20 66 72 61 6d 65 73 20 74 68 ..........///.input.in.frames.th
f560 61 74 20 61 72 65 20 63 6c 6f 73 65 72 20 74 6f 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 74 69 at.are.closer.to.the.original.ti
f580 6d 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 ming...............///..........
f5a0 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 74 68 69 73 20 6d 65 74 68 6f 64 20 77 69 ....///.Note.that.this.method.wi
f5c0 6c 6c 20 70 65 72 66 6f 72 6d 20 6f 6e 65 20 69 6e 69 74 69 61 6c 20 73 63 61 6e 20 6f 66 20 74 ll.perform.one.initial.scan.of.t
f5e0 68 65 20 74 72 61 63 65 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 61 20 6c 69 6e 65 61 72 0d 0a he.trace.to.determine.a.linear..
f600 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 72 64 65 72 69 6e 67 20 6f 66 20 74 68 65 20 ............///.ordering.of.the.
f620 65 76 65 6e 74 73 20 62 79 20 74 69 6d 65 20 28 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d events.by.time.(the.input.system
f640 20 64 6f 65 73 20 6e 6f 74 20 72 65 71 75 69 72 65 20 61 6e 79 20 73 75 63 68 20 6f 72 64 65 72 .does.not.require.any.such.order
f660 69 6e 67 20 6f 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 76 65 6e ing.on.the..............///.even
f680 74 73 20 69 6e 20 69 74 73 20 71 75 65 75 65 20 61 6e 64 20 74 68 75 73 20 65 76 65 6e 74 73 20 ts.in.its.queue.and.thus.events.
f6a0 69 6e 20 61 20 74 72 61 63 65 2c 20 65 73 70 65 63 69 61 6c 6c 79 20 69 66 20 74 68 65 72 65 20 in.a.trace,.especially.if.there.
f6c0 61 72 65 20 6d 75 6c 74 69 70 6c 65 20 64 65 76 69 63 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 are.multiple.devices............
f6e0 20 20 2f 2f 2f 20 69 6e 76 6f 6c 76 65 64 2c 20 6d 61 79 20 62 65 20 6f 75 74 20 6f 66 20 6f 72 ..///.involved,.may.be.out.of.or
f700 64 65 72 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 der)...............///.</remarks
f720 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 >..............///.<seealso.cref
f740 3d 22 50 6c 61 79 41 6c 6c 46 72 61 6d 65 73 4f 6e 65 42 79 4f 6e 65 22 2f 3e 0d 0a 20 20 20 20 ="PlayAllFramesOneByOne"/>......
f760 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 6c 61 79 41 ........///.<seealso.cref="PlayA
f780 6c 6c 45 76 65 6e 74 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 llEvents"/>..............public.
f7a0 52 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 6c 65 72 20 50 6c 61 79 41 6c 6c 45 76 65 6e 74 73 41 63 ReplayController.PlayAllEventsAc
f7c0 63 6f 72 64 69 6e 67 54 6f 54 69 6d 65 73 74 61 6d 70 73 28 29 0d 0a 20 20 20 20 20 20 20 20 20 cordingToTimestamps()...........
f7e0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6f 72 74 20 72 65 ...{..................//.Sort.re
f800 6d 61 69 6e 69 6e 67 20 65 76 65 6e 74 73 20 62 79 20 74 69 6d 65 2e 0d 0a 20 20 20 20 20 20 20 maining.events.by.time..........
f820 20 20 20 20 20 20 20 20 20 76 61 72 20 65 76 65 6e 74 73 42 79 54 69 6d 65 20 3d 20 6e 65 77 20 .........var.eventsByTime.=.new.
f840 4c 69 73 74 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 List<InputEventPtr>();..........
f860 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 4d 6f 76 65 4e 65 78 74 28 74 72 75 65 2c 20 6f 75 ........while.(MoveNext(true,.ou
f880 74 20 76 61 72 20 65 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 t.var.eventPtr))................
f8a0 20 20 20 20 20 20 65 76 65 6e 74 73 42 79 54 69 6d 65 2e 41 64 64 28 65 76 65 6e 74 50 74 72 29 ......eventsByTime.Add(eventPtr)
f8c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 73 42 79 54 69 6d 65 2e ;..................eventsByTime.
f8e0 53 6f 72 74 28 28 61 2c 20 62 29 20 3d 3e 20 61 2e 74 69 6d 65 2e 43 6f 6d 70 61 72 65 54 6f 28 Sort((a,.b).=>.a.time.CompareTo(
f900 62 2e 74 69 6d 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 6e 75 b.time));..................m_Enu
f920 6d 65 72 61 74 6f 72 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 merator.Dispose();..............
f940 20 20 20 20 6d 5f 45 6e 75 6d 65 72 61 74 6f 72 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 ....m_Enumerator.=.null;........
f960 20 20 20 20 20 20 20 20 20 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 20 3d 20 65 76 ..........m_AllEventsByTime.=.ev
f980 65 6e 74 73 42 79 54 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 73 entsByTime;..................pos
f9a0 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f ition.=.0;....................//
f9c0 20 53 74 61 72 74 20 70 6c 61 79 62 61 63 6b 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .Start.playback.................
f9e0 20 20 66 69 6e 69 73 68 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..finished.=.false;.............
fa00 20 20 20 20 20 6d 5f 53 74 61 72 74 54 69 6d 65 41 73 50 65 72 46 69 72 73 74 45 76 65 6e 74 20 .....m_StartTimeAsPerFirstEvent.
fa20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 41 6c 6c 45 76 65 6e =.-1;..................m_AllEven
fa40 74 73 42 79 54 69 6d 65 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tsByTimeIndex.=.-1;.............
fa60 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 20 .....InputSystem.onBeforeUpdate.
fa80 2b 3d 20 4f 6e 42 65 67 69 6e 46 72 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 +=.OnBeginFrame;................
faa0 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d ..return.this;..............}...
fac0 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4f 6e 42 65 67 69 .............private.void.OnBegi
fae0 6e 46 72 61 6d 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 nFrame()..............{.........
fb00 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 75 73 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 .........if.(paused)............
fb20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..........return;...............
fb40 20 20 20 20 20 69 66 20 28 21 4d 6f 76 65 4e 65 78 74 28 66 61 6c 73 65 2c 20 6f 75 74 20 76 61 .....if.(!MoveNext(false,.out.va
fb60 72 20 63 75 72 72 65 6e 74 45 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 r.currentEventPtr)).............
fb80 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 .....{......................if.(
fba0 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 6d 5f 41 m_AllEventsByTime.==.null.||.m_A
fbc0 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 49 6e 64 65 78 20 3e 3d 20 6d 5f 41 6c 6c 45 76 65 6e llEventsByTimeIndex.>=.m_AllEven
fbe0 74 73 42 79 54 69 6d 65 2e 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tsByTime.Count).................
fc00 20 20 20 20 20 20 20 20 20 46 69 6e 69 73 68 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .........Finished();............
fc20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........return;...............
fc40 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b ...}....................//.Check
fc60 20 66 6f 72 20 65 6d 70 74 79 20 66 72 61 6d 65 20 28 6e 6f 74 65 3a 20 77 68 65 6e 20 70 6c 61 .for.empty.frame.(note:.when.pla
fc80 79 69 6e 67 20 62 61 63 6b 20 65 76 65 6e 74 73 20 62 79 20 74 69 6d 65 2c 20 77 65 20 77 6f 6e ying.back.events.by.time,.we.won
fca0 27 74 20 73 65 65 20 66 72 61 6d 65 20 6d 61 72 6b 65 72 20 65 76 65 6e 74 73 0d 0a 20 20 20 20 't.see.frame.marker.events......
fcc0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 72 65 74 75 72 6e 65 64 20 66 72 6f 6d 20 4d 6f 76 ............//.returned.from.Mov
fce0 65 4e 65 78 74 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 75 72 eNext)...................if.(cur
fd00 72 65 6e 74 45 76 65 6e 74 50 74 72 2e 74 79 70 65 20 3d 3d 20 46 72 61 6d 65 4d 61 72 6b 65 72 rentEventPtr.type.==.FrameMarker
fd20 45 76 65 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 Event)..................{.......
fd40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 4d 6f 76 65 4e 65 78 74 28 66 61 6c ...............if.(!MoveNext(fal
fd60 73 65 2c 20 6f 75 74 20 63 75 72 72 65 6e 74 45 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 se,.out.currentEventPtr)).......
fd80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...............{................
fda0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 66 72 61 6d 65 2e 0d 0a 20 20 20 20 20 20 ..........//.Last.frame.........
fdc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 69 6e 69 73 68 65 64 28 29 3b 0d 0a 20 ..................Finished();...
fde0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a .......................return;..
fe00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 ....................}...........
fe20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 65 6d 70 74 79 20 .............//.Check.for.empty.
fe40 66 72 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 frame.......................if.(
fe60 63 75 72 72 65 6e 74 45 76 65 6e 74 50 74 72 2e 74 79 70 65 20 3d 3d 20 46 72 61 6d 65 4d 61 72 currentEventPtr.type.==.FrameMar
fe80 6b 65 72 45 76 65 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 kerEvent).......................
fea0 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d ...return;..................}...
fec0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 6a 65 63 74 20 6f 75 72 20 65 .................//.Inject.our.e
fee0 76 65 6e 74 73 20 69 6e 74 6f 20 74 68 65 20 66 72 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 vents.into.the.frame............
ff00 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 74 72 75 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .......while.(true).............
ff20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 51 75 65 75 .....{......................Queu
ff40 65 45 76 65 6e 74 28 63 75 72 72 65 6e 74 45 76 65 6e 74 50 74 72 29 3b 0d 0a 0d 0a 20 20 20 20 eEvent(currentEventPtr);........
ff60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 74 6f 70 20 69 66 20 77 65 20 72 65 ................//.Stop.if.we.re
ff80 61 63 68 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 73 74 72 65 61 6d 2e 0d 0a 20 20 20 20 ach.the.end.of.the.stream.......
ffa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 4d 6f 76 65 4e 65 78 74 28 66 61 ................if.(!MoveNext(fa
ffc0 6c 73 65 2c 20 6f 75 74 20 76 61 72 20 6e 65 78 74 45 76 65 6e 74 29 29 0d 0a 20 20 20 20 20 20 lse,.out.var.nextEvent))........
ffe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..............{.................
10000 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 20 3d .........if.(m_AllEventsByTime.=
10020 3d 20 6e 75 6c 6c 20 7c 7c 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 49 6e 64 65 78 =.null.||.m_AllEventsByTimeIndex
10040 20 3e 3d 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 2e 43 6f 75 6e 74 29 0d 0a 20 20 .>=.m_AllEventsByTime.Count)....
10060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 69 6e 69 73 68 ..........................Finish
10080 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 ed();..........................b
100a0 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a reak;......................}....
100c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 74 6f 70 20 69 66 20 77 ....................//.Stop.if.w
100e0 65 27 76 65 20 72 65 61 63 68 65 64 20 74 68 65 20 6e 65 78 74 20 66 72 61 6d 65 20 28 77 6f 6e e've.reached.the.next.frame.(won
10100 27 74 20 68 61 70 70 65 6e 20 69 66 20 77 65 27 72 65 20 70 6c 61 79 69 6e 67 20 65 76 65 6e 74 't.happen.if.we're.playing.event
10120 73 20 62 79 20 74 69 6d 65 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 s.by.time)......................
10140 20 69 66 20 28 6e 65 78 74 45 76 65 6e 74 2e 74 79 70 65 20 3d 3d 20 46 72 61 6d 65 4d 61 72 6b .if.(nextEvent.type.==.FrameMark
10160 65 72 45 76 65 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d erEvent)......................{.
10180 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 42 61 63 6b .........................//.Back
101a0 20 75 70 20 6f 6e 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .up.one.event...................
101c0 20 20 20 20 20 20 20 20 6d 5f 45 6e 75 6d 65 72 61 74 6f 72 2e 6d 5f 43 75 72 72 65 6e 74 20 3d ........m_Enumerator.m_Current.=
101e0 20 63 75 72 72 65 6e 74 45 76 65 6e 74 50 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .currentEventPtr;...............
10200 20 20 20 20 20 20 20 20 20 20 20 2d 2d 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 ...........--position;..........
10220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 ................break;..........
10240 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............}...................
10260 20 20 20 20 20 63 75 72 72 65 6e 74 45 76 65 6e 74 50 74 72 20 3d 20 6e 65 78 74 45 76 65 6e 74 .....currentEventPtr.=.nextEvent
10280 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 ;..................}............
102a0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 ..}................private.void.
102c0 46 69 6e 69 73 68 65 64 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 Finished()..............{.......
102e0 20 20 20 20 20 20 20 20 20 20 20 66 69 6e 69 73 68 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 ...........finished.=.true;.....
10300 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 42 65 66 6f 72 .............InputSystem.onBefor
10320 65 55 70 64 61 74 65 20 2d 3d 20 4f 6e 42 65 67 69 6e 46 72 61 6d 65 3b 0d 0a 20 20 20 20 20 20 eUpdate.-=.OnBeginFrame;........
10340 20 20 20 20 20 20 20 20 20 20 6d 5f 4f 6e 46 69 6e 69 73 68 65 64 3f 2e 49 6e 76 6f 6b 65 28 29 ..........m_OnFinished?.Invoke()
10360 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ;..............}................
10380 70 72 69 76 61 74 65 20 76 6f 69 64 20 51 75 65 75 65 45 76 65 6e 74 28 49 6e 70 75 74 45 76 65 private.void.QueueEvent(InputEve
103a0 6e 74 50 74 72 20 65 76 65 6e 74 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ntPtr.eventPtr)..............{..
103c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 68 69 66 74 20 74 69 6d 65 20 6f 6e ................//.Shift.time.on
103e0 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 72 69 .event...................var.ori
10400 67 69 6e 61 6c 54 69 6d 65 73 74 61 6d 70 20 3d 20 65 76 65 6e 74 50 74 72 2e 69 6e 74 65 72 6e ginalTimestamp.=.eventPtr.intern
10420 61 6c 54 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 41 alTime;..................if.(m_A
10440 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 llEventsByTime.!=.null).........
10460 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 50 74 72 2e 69 6e 74 65 72 6e 61 6c 54 69 .............eventPtr.internalTi
10480 6d 65 20 3d 20 6d 5f 53 74 61 72 74 54 69 6d 65 41 73 50 65 72 52 75 6e 74 69 6d 65 20 2b 20 28 me.=.m_StartTimeAsPerRuntime.+.(
104a0 65 76 65 6e 74 50 74 72 2e 69 6e 74 65 72 6e 61 6c 54 69 6d 65 20 2d 20 6d 5f 53 74 61 72 74 54 eventPtr.internalTime.-.m_StartT
104c0 69 6d 65 41 73 50 65 72 46 69 72 73 74 45 76 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 imeAsPerFirstEvent);............
104e0 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......else......................
10500 65 76 65 6e 74 50 74 72 2e 69 6e 74 65 72 6e 61 6c 54 69 6d 65 20 3d 20 49 6e 70 75 74 52 75 6e eventPtr.internalTime.=.InputRun
10520 74 69 6d 65 2e 73 5f 49 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 3b 0d 0a 0d 0a time.s_Instance.currentTime;....
10540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 6d 65 6d 62 65 72 20 6f 72 69 67 ................//.Remember.orig
10560 69 6e 61 6c 20 65 76 65 6e 74 20 49 44 2e 20 51 75 65 75 65 45 76 65 6e 74 20 77 69 6c 6c 20 61 inal.event.ID..QueueEvent.will.a
10580 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 75 70 64 61 74 65 20 74 68 65 20 65 76 65 6e 74 20 49 44 utomatically.update.the.event.ID
105a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 6e 64 20 61 63 74 75 61 6c 6c ..................//.and.actuall
105c0 79 20 64 6f 20 73 6f 20 69 6e 20 70 6c 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 y.do.so.in.place................
105e0 20 20 20 76 61 72 20 6f 72 69 67 69 6e 61 6c 45 76 65 6e 74 49 64 20 3d 20 65 76 65 6e 74 50 74 ...var.originalEventId.=.eventPt
10600 72 2e 69 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 70 20 r.id;....................//.Map.
10620 64 65 76 69 63 65 20 49 44 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 device.ID...................var.
10640 6f 72 69 67 69 6e 61 6c 44 65 76 69 63 65 49 64 20 3d 20 65 76 65 6e 74 50 74 72 2e 64 65 76 69 originalDeviceId.=.eventPtr.devi
10660 63 65 49 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 50 74 72 2e ceId;..................eventPtr.
10680 64 65 76 69 63 65 49 64 20 3d 20 41 70 70 6c 79 44 65 76 69 63 65 4d 61 70 70 69 6e 67 28 6f 72 deviceId.=.ApplyDeviceMapping(or
106a0 69 67 69 6e 61 6c 44 65 76 69 63 65 49 64 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 iginalDeviceId);................
106c0 20 20 20 20 2f 2f 20 4e 6f 74 69 66 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....//.Notify...................
106e0 6d 5f 4f 6e 45 76 65 6e 74 3f 2e 49 6e 76 6f 6b 65 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a 0d 0a m_OnEvent?.Invoke(eventPtr);....
10700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 51 75 65 75 65 20 65 76 65 6e 74 2e 0d ................//.Queue.event..
10720 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 0d 0a 20 20 20 20 20 20 20 20 20 20 .................try............
10740 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 ......{......................Inp
10760 75 74 53 79 73 74 65 6d 2e 51 75 65 75 65 45 76 65 6e 74 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a utSystem.QueueEvent(eventPtr);..
10780 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................}...............
107a0 20 20 20 66 69 6e 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 ...finally..................{...
107c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 73 74 6f 72 65 20 6d 6f ...................//.Restore.mo
107e0 64 69 66 69 63 61 74 69 6f 6e 20 77 65 20 6d 61 64 65 20 74 6f 20 74 68 65 20 65 76 65 6e 74 20 dification.we.made.to.the.event.
10800 62 75 66 66 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 buffer.......................eve
10820 6e 74 50 74 72 2e 69 6e 74 65 72 6e 61 6c 54 69 6d 65 20 3d 20 6f 72 69 67 69 6e 61 6c 54 69 6d ntPtr.internalTime.=.originalTim
10840 65 73 74 61 6d 70 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 estamp;......................eve
10860 6e 74 50 74 72 2e 69 64 20 3d 20 6f 72 69 67 69 6e 61 6c 45 76 65 6e 74 49 64 3b 0d 0a 20 20 20 ntPtr.id.=.originalEventId;.....
10880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 50 74 72 2e 64 65 76 69 63 65 .................eventPtr.device
108a0 49 64 20 3d 20 6f 72 69 67 69 6e 61 6c 44 65 76 69 63 65 49 64 3b 0d 0a 20 20 20 20 20 20 20 20 Id.=.originalDeviceId;..........
108c0 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 ........}..............}........
108e0 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 4d 6f 76 65 4e 65 78 74 28 62 6f ........private.bool.MoveNext(bo
10900 6f 6c 20 73 6b 69 70 46 72 61 6d 65 45 76 65 6e 74 73 2c 20 6f 75 74 20 49 6e 70 75 74 45 76 65 ol.skipFrameEvents,.out.InputEve
10920 6e 74 50 74 72 20 65 76 65 6e 74 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ntPtr.eventPtr)..............{..
10940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 50 74 72 20 3d 20 64 65 66 61 75 ................eventPtr.=.defau
10960 6c 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 41 6c 6c lt;....................if.(m_All
10980 45 76 65 6e 74 73 42 79 54 69 6d 65 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 EventsByTime.!=.null)...........
109a0 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 .......{......................if
109c0 20 28 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 49 6e 64 65 78 20 2b 20 31 20 3e 3d 20 .(m_AllEventsByTimeIndex.+.1.>=.
109e0 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 2e 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 m_AllEventsByTime.Count)........
10a00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..............{.................
10a20 20 20 20 20 20 20 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 .........position.=.m_AllEventsB
10a40 79 54 69 6d 65 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 yTime.Count;....................
10a60 20 20 20 20 20 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 49 6e 64 65 78 20 3d 20 6d ......m_AllEventsByTimeIndex.=.m
10a80 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 _AllEventsByTime.Count;.........
10aa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a .................return.false;..
10ac0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 ....................}...........
10ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 .............if.(m_AllEventsByTi
10b00 6d 65 49 6e 64 65 78 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 meIndex.<.0)....................
10b20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 ..{..........................m_S
10b40 74 61 72 74 54 69 6d 65 41 73 50 65 72 46 69 72 73 74 45 76 65 6e 74 20 3d 20 6d 5f 41 6c 6c 45 tartTimeAsPerFirstEvent.=.m_AllE
10b60 76 65 6e 74 73 42 79 54 69 6d 65 5b 30 5d 2e 69 6e 74 65 72 6e 61 6c 54 69 6d 65 3b 0d 0a 20 20 ventsByTime[0].internalTime;....
10b80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 61 72 74 54 69 6d ......................m_StartTim
10ba0 65 41 73 50 65 72 52 75 6e 74 69 6d 65 20 3d 20 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 49 eAsPerRuntime.=.InputRuntime.s_I
10bc0 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 nstance.currentTime;............
10be0 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........}.....................
10c00 20 65 6c 73 65 20 69 66 20 28 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 49 6e 64 65 78 .else.if.(m_AllEventsByTimeIndex
10c20 20 3c 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 2e 43 6f 75 6e 74 20 2d 20 31 20 26 .<.m_AllEventsByTime.Count.-.1.&
10c40 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &...............................
10c60 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 5b 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 m_AllEventsByTime[m_AllEventsByT
10c80 69 6d 65 49 6e 64 65 78 20 2b 20 31 5d 2e 69 6e 74 65 72 6e 61 6c 54 69 6d 65 20 3e 20 6d 5f 53 imeIndex.+.1].internalTime.>.m_S
10ca0 74 61 72 74 54 69 6d 65 41 73 50 65 72 46 69 72 73 74 45 76 65 6e 74 20 2b 20 28 49 6e 70 75 74 tartTimeAsPerFirstEvent.+.(Input
10cc0 52 75 6e 74 69 6d 65 2e 73 5f 49 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 20 2d Runtime.s_Instance.currentTime.-
10ce0 20 6d 5f 53 74 61 72 74 54 69 6d 65 41 73 50 65 72 52 75 6e 74 69 6d 65 29 29 0d 0a 20 20 20 20 .m_StartTimeAsPerRuntime))......
10d00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
10d20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 27 72 65 20 71 75 65 75 69 6e 67 20 62 79 20 6f ...........//.We're.queuing.by.o
10d40 72 69 67 69 6e 61 6c 20 74 69 6d 65 20 61 6e 64 20 74 68 65 20 6e 65 78 74 20 65 76 65 6e 74 20 riginal.time.and.the.next.event.
10d60 69 73 6e 27 74 20 75 70 20 79 65 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 isn't.up.yet,...................
10d80 20 20 20 20 20 20 20 2f 2f 20 73 6f 20 65 61 72 6c 79 20 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 .......//.so.early.out..........
10da0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a .................return.false;..
10dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 ....................}...........
10de0 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 .............++m_AllEventsByTime
10e00 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 70 6f Index;......................++po
10e20 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 sition;......................eve
10e40 6e 74 50 74 72 20 3d 20 6d 5f 41 6c 6c 45 76 65 6e 74 73 42 79 54 69 6d 65 5b 6d 5f 41 6c 6c 45 ntPtr.=.m_AllEventsByTime[m_AllE
10e60 76 65 6e 74 73 42 79 54 69 6d 65 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ventsByTimeIndex];..............
10e80 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 ....}..................else.....
10ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............{..................
10ec0 20 20 20 20 69 66 20 28 6d 5f 45 6e 75 6d 65 72 61 74 6f 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 ....if.(m_Enumerator.==.null)...
10ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 6e 75 6d 65 72 61 .......................m_Enumera
10f00 74 6f 72 20 3d 20 6e 65 77 20 45 6e 75 6d 65 72 61 74 6f 72 28 6d 5f 45 76 65 6e 74 54 72 61 63 tor.=.new.Enumerator(m_EventTrac
10f20 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 6f 0d 0a 20 e);........................do...
10f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ...................{............
10f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 45 6e 75 6d 65 72 61 74 6f 72 2e ..............if.(!m_Enumerator.
10f80 4d 6f 76 65 4e 65 78 74 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 MoveNext()).....................
10fa0 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 .........return.false;..........
10fc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 ..................++position;...
10fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 50 74 72 20 .......................eventPtr.
11000 3d 20 6d 5f 45 6e 75 6d 65 72 61 74 6f 72 2e 43 75 72 72 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 =.m_Enumerator.Current;.........
11020 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............}..................
11040 20 20 20 20 77 68 69 6c 65 20 28 73 6b 69 70 46 72 61 6d 65 45 76 65 6e 74 73 20 26 26 20 65 76 ....while.(skipFrameEvents.&&.ev
11060 65 6e 74 50 74 72 2e 74 79 70 65 20 3d 3d 20 46 72 61 6d 65 4d 61 72 6b 65 72 45 76 65 6e 74 29 entPtr.type.==.FrameMarkerEvent)
11080 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ;..................}............
110a0 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ........return.true;............
110c0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 41 ..}................private.int.A
110e0 70 70 6c 79 44 65 76 69 63 65 4d 61 70 70 69 6e 67 28 69 6e 74 20 6f 72 69 67 69 6e 61 6c 44 65 pplyDeviceMapping(int.originalDe
11100 76 69 63 65 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 viceId)..............{..........
11120 20 20 20 20 20 20 20 20 2f 2f 20 4c 6f 6f 6b 20 75 70 20 69 6e 20 6d 61 70 70 69 6e 67 73 2e 0d ........//.Look.up.in.mappings..
11140 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b .................for.(var.i.=.0;
11160 20 69 20 3c 20 6d 5f 44 65 76 69 63 65 49 44 4d 61 70 70 69 6e 67 73 2e 6c 65 6e 67 74 68 3b 20 .i.<.m_DeviceIDMappings.length;.
11180 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 ++i)..................{.........
111a0 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 6e 74 72 79 20 3d 20 6d 5f 44 65 76 69 63 .............var.entry.=.m_Devic
111c0 65 49 44 4d 61 70 70 69 6e 67 73 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eIDMappings[i];.................
111e0 20 20 20 20 20 69 66 20 28 65 6e 74 72 79 2e 4b 65 79 20 3d 3d 20 6f 72 69 67 69 6e 61 6c 44 65 .....if.(entry.Key.==.originalDe
11200 76 69 63 65 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 viceId).........................
11220 20 72 65 74 75 72 6e 20 65 6e 74 72 79 2e 56 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .return.entry.Value;............
11240 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 72 ......}....................//.Cr
11260 65 61 74 65 20 64 65 76 69 63 65 2c 20 69 66 20 6e 65 65 64 65 64 2e 0d 0a 20 20 20 20 20 20 20 eate.device,.if.needed..........
11280 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 72 65 61 74 65 4e 65 77 44 65 76 69 63 65 73 29 .........if.(m_CreateNewDevices)
112a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................{.............
112c0 20 20 20 20 20 20 20 20 20 74 72 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........try....................
112e0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ..{..........................//.
11300 46 69 6e 64 20 64 65 76 69 63 65 20 69 6e 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 Find.device.info................
11320 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 49 6e 64 65 78 20 3d 20 6d 5f 45 ...........var.deviceIndex.=.m_E
11340 76 65 6e 74 54 72 61 63 65 2e 64 65 76 69 63 65 49 6e 66 6f 73 2e 49 6e 64 65 78 4f 66 28 78 20 ventTrace.deviceInfos.IndexOf(x.
11360 3d 3e 20 78 2e 64 65 76 69 63 65 49 64 20 3d 3d 20 6f 72 69 67 69 6e 61 6c 44 65 76 69 63 65 49 =>.x.deviceId.==.originalDeviceI
11380 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 d);..........................if.
113a0 28 64 65 76 69 63 65 49 6e 64 65 78 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 (deviceIndex.!=.-1).............
113c0 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............{..................
113e0 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 49 6e 66 6f 20 3d 20 6d 5f 45 ............var.deviceInfo.=.m_E
11400 76 65 6e 74 54 72 61 63 65 2e 64 65 76 69 63 65 49 6e 66 6f 73 5b 64 65 76 69 63 65 49 6e 64 65 ventTrace.deviceInfos[deviceInde
11420 78 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 x];.............................
11440 20 20 20 2f 2f 20 49 66 20 77 65 20 64 6f 6e 27 74 20 68 61 76 65 20 74 68 65 20 6c 61 79 6f 75 ...//.If.we.don't.have.the.layou
11460 74 2c 20 74 72 79 20 74 6f 20 61 64 64 20 69 74 20 66 72 6f 6d 20 74 68 65 20 70 65 72 73 69 73 t,.try.to.add.it.from.the.persis
11480 74 65 64 20 6c 61 79 6f 75 74 20 69 6e 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ted.layout.info.................
114a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 6e ..............var.layoutName.=.n
114c0 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 64 65 76 69 63 65 49 6e 66 6f 2e 6c 61 79 ew.InternedString(deviceInfo.lay
114e0 6f 75 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 out);...........................
11500 20 20 20 69 66 20 28 21 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 73 5f 4c 61 79 ...if.(!InputControlLayout.s_Lay
11520 6f 75 74 73 2e 48 61 73 4c 61 79 6f 75 74 28 6c 61 79 6f 75 74 4e 61 6d 65 29 29 0d 0a 20 20 20 outs.HasLayout(layoutName)).....
11540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 .........................{......
11560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ............................if.(
11580 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 64 65 76 69 63 65 49 6e 66 6f 2e string.IsNullOrEmpty(deviceInfo.
115a0 6d 5f 46 75 6c 6c 4c 61 79 6f 75 74 4a 73 6f 6e 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 m_FullLayoutJson))..............
115c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6f ........................return.o
115e0 72 69 67 69 6e 61 6c 44 65 76 69 63 65 49 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 riginalDeviceId;................
11600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e ....................InputSystem.
11620 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 28 64 65 76 69 63 65 49 6e 66 6f 2e 6d 5f 46 75 6c 6c RegisterLayout(deviceInfo.m_Full
11640 4c 61 79 6f 75 74 4a 73 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 LayoutJson);....................
11660 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........}.....................
11680 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 72 65 61 74 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 ...........//.Create.device.....
116a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 ..........................var.de
116c0 76 69 63 65 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 41 64 64 44 65 76 69 63 65 28 6c 61 79 vice.=.InputSystem.AddDevice(lay
116e0 6f 75 74 4e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 outName);.......................
11700 20 20 20 20 20 20 20 57 69 74 68 44 65 76 69 63 65 4d 61 70 70 65 64 46 72 6f 6d 54 6f 28 6f 72 .......WithDeviceMappedFromTo(or
11720 69 67 69 6e 61 6c 44 65 76 69 63 65 49 64 2c 20 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 29 iginalDeviceId,.device.deviceId)
11740 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d ;..............................m
11760 5f 43 72 65 61 74 65 64 44 65 76 69 63 65 73 2e 41 70 70 65 6e 64 57 69 74 68 43 61 70 61 63 69 _CreatedDevices.AppendWithCapaci
11780 74 79 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ty(device);.....................
117a0 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 3b .........return.device.deviceId;
117c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 ..........................}.....
117e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .................}..............
11800 20 20 20 20 20 20 20 20 63 61 74 63 68 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ........catch...................
11820 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f ...{..........................//
11840 20 53 77 61 6c 6c 6f 77 20 61 6e 64 20 6a 75 73 74 20 72 65 74 75 72 6e 20 6f 72 69 67 69 6e 61 .Swallow.and.just.return.origina
11860 6c 44 65 76 69 63 65 49 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lDeviceId.......................
11880 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 }..................}............
118a0 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6f 72 69 67 69 6e 61 6c 44 65 76 69 63 65 49 64 3b ........return.originalDeviceId;
118c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ..............}..........}......
118e0 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ......///.<summary>..........///
11900 20 49 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 61 20 64 65 76 69 63 65 20 77 68 6f 73 .Information.about.a.device.whos
11920 65 20 69 6e 70 75 74 20 68 61 73 20 62 65 65 6e 20 63 61 70 74 75 72 65 64 20 69 6e 20 61 6e 20 e.input.has.been.captured.in.an.
11940 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 22 2f 3e 0d 0a 20 <see.cref="InputEventTrace"/>...
11960 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</summary>........../
11980 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 //.<seealso.cref="InputEventTrac
119a0 65 2e 64 65 76 69 63 65 49 6e 66 6f 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 e.deviceInfos"/>..........[Seria
119c0 6c 69 7a 61 62 6c 65 5d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 75 63 74 20 lizable]..........public.struct.
119e0 44 65 76 69 63 65 49 6e 66 6f 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 DeviceInfo..........{...........
11a00 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f ...///.<summary>..............//
11a20 2f 20 49 64 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 61 73 20 73 74 6f 72 65 64 20 69 6e 20 /.Id.of.the.device.as.stored.in.
11a40 74 68 65 20 65 76 65 6e 74 73 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 the.events.for.the.device.......
11a60 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</summary>..........
11a80 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 ....///.<seealso.cref="InputDevi
11aa0 63 65 2e 64 65 76 69 63 65 49 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c ce.deviceId"/>..............publ
11ac0 69 63 20 69 6e 74 20 64 65 76 69 63 65 49 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ic.int.deviceId..............{..
11ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 44 65 76 69 63 65 49 ................get.=>.m_DeviceI
11b00 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d 3e 20 6d 5f 44 65 76 d;..................set.=>.m_Dev
11b20 69 63 65 49 64 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d iceId.=.value;..............}...
11b40 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 .............///.<summary>......
11b60 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 61 6d 65 20 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 75 ........///.Name.of.the.layout.u
11b80 73 65 64 20 62 79 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 sed.by.the.device...............
11ba0 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 ///.</summary>..............///.
11bc0 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 6c 61 79 6f <seealso.cref="InputControl.layo
11be0 75 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 69 6e 67 ut"/>..............public.string
11c00 20 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 .layout..............{..........
11c20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 4c 61 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 ........get.=>.m_Layout;........
11c40 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d 3e 20 6d 5f 4c 61 79 6f 75 74 20 3d 20 76 61 6c 75 ..........set.=>.m_Layout.=.valu
11c60 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 e;..............}...............
11c80 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 .///.<summary>..............///.
11ca0 54 61 67 20 66 6f 72 20 74 68 65 20 66 6f 72 6d 61 74 20 69 6e 20 77 68 69 63 68 20 73 74 61 74 Tag.for.the.format.in.which.stat
11cc0 65 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 20 69 73 20 73 74 6f 72 65 64 2e 0d 0a 20 20 20 e.for.the.device.is.stored......
11ce0 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 .........///.</summary>.........
11d00 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e .....///.<seealso.cref="InputCon
11d20 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 trol.stateBlock"/>..............
11d40 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 53 74 61 74 65 42 6c 6f ///.<seealso.cref="InputStateBlo
11d60 63 6b 2e 66 6f 72 6d 61 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 ck.format"/>..............public
11d80 20 46 6f 75 72 43 43 20 73 74 61 74 65 46 6f 72 6d 61 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .FourCC.stateFormat.............
11da0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 53 74 61 .{..................get.=>.m_Sta
11dc0 74 65 46 6f 72 6d 61 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d teFormat;..................set.=
11de0 3e 20 6d 5f 53 74 61 74 65 46 6f 72 6d 61 74 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 >.m_StateFormat.=.value;........
11e00 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d ......}................///.<summ
11e20 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 69 7a 65 20 6f 66 20 61 20 ary>..............///.Size.of.a.
11e40 66 75 6c 6c 20 73 74 61 74 65 20 73 6e 61 70 73 68 6f 74 20 6f 66 20 74 68 65 20 64 65 76 69 63 full.state.snapshot.of.the.devic
11e60 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a e...............///.</summary>..
11e80 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 73 74 61 74 65 53 69 7a 65 ............public.int.stateSize
11ea0 49 6e 42 79 74 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 InBytes..............{..........
11ec0 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 ........get.=>.m_StateSizeInByte
11ee0 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d 3e 20 6d 5f 53 74 61 s;..................set.=>.m_Sta
11f00 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 teSizeInBytes.=.value;..........
11f20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 ....}................[SerializeF
11f40 69 65 6c 64 5d 20 69 6e 74 65 72 6e 61 6c 20 69 6e 74 20 6d 5f 44 65 76 69 63 65 49 64 3b 0d 0a ield].internal.int.m_DeviceId;..
11f60 20 20 20 20 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 69 6e 74 ............[SerializeField].int
11f80 65 72 6e 61 6c 20 73 74 72 69 6e 67 20 6d 5f 4c 61 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 ernal.string.m_Layout;..........
11fa0 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 69 6e 74 65 72 6e 61 6c 20 46 6f ....[SerializeField].internal.Fo
11fc0 75 72 43 43 20 6d 5f 53 74 61 74 65 46 6f 72 6d 61 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 urCC.m_StateFormat;.............
11fe0 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 69 6e 74 65 72 6e 61 6c 20 69 6e 74 20 6d .[SerializeField].internal.int.m
12000 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 _StateSizeInBytes;..............
12020 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 69 6e 74 65 72 6e 61 6c 20 73 74 72 69 6e 67 [SerializeField].internal.string
12040 20 6d 5f 46 75 6c 6c 4c 61 79 6f 75 74 4a 73 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 .m_FullLayoutJson;..........}...
12060 20 20 20 7d 0d 0a 7d 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...}..}.........................
12080 0f 00 00 00 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 00 20 00 00 00 55 6e 69 74 79 45 6e 67 ....InputEventTrace.....UnityEng
120a0 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c ine.InputSystem.LowLevel