preliminary client-side replay watching code

This commit is contained in:
Max-Wilhelm Bruker 2012-02-26 16:35:34 +01:00
parent 65d4c77ee8
commit 4dc712286f
13 changed files with 1449 additions and 16 deletions

View file

@ -58,6 +58,7 @@ SET(cockatrice_SOURCES
src/tab_supervisor.cpp
src/tab_admin.cpp
src/tab_userlists.cpp
src/replay_timeline_widget.cpp
src/chatview.cpp
src/userlist.cpp
src/userinfobox.cpp
@ -128,6 +129,7 @@ SET(cockatrice_HEADERS
src/tab_supervisor.h
src/tab_admin.h
src/tab_userlists.h
src/replay_timeline_widget.h
src/chatview.h
src/userlist.h
src/userinfobox.h

View file

@ -38,6 +38,14 @@
<file>resources/icon_conceded.svg</file>
<file>resources/icon_player.svg</file>
<file>resources/icon_spectator.svg</file>
<file>resources/replay_start.svg</file>
<file>resources/replay_stop.svg</file>
<file>resources/replay_fastforward.svg</file>
<file>resources/replay_rewind.svg</file>
<file>resources/replay_toend.svg</file>
<file>resources/replay_tostart.svg</file>
<file>resources/replay_pause.svg</file>
<file>resources/genders/male.svg</file>
<file>resources/genders/female.svg</file>

View file

@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg3415"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="New document 11">
<defs
id="defs3417">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient7105"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7509469,0,0,1,466.37866,-193.98279)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient2237">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop2239" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop2241" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient7107"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7509469,0,0,0.7354122,466.90866,-81.0361)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient3207">
<stop
id="stop3209"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3211"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient7109"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7509469,0,0,1,486.01576,-193.98279)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient3395">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop3397" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop3399" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient7111"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7509469,0,0,0.734661,486.54576,-80.7033)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient3402">
<stop
id="stop3404"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3406"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
y2="451.85028"
x2="581.19086"
y1="416.94766"
x1="561.24646"
gradientTransform="matrix(0.7509469,0,0,0.734661,486.54576,-80.7033)"
gradientUnits="userSpaceOnUse"
id="linearGradient3413"
xlink:href="#linearGradient3207"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="1.7561332"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="800"
inkscape:window-height="628"
inkscape:window-x="946"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata3420">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g7099"
transform="matrix(0.77034956,0,0,0.77034956,-682.67795,-169.99219)">
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="path6972"
d="m 888.47136,230.84445 -0.1313,21.48508 c -0.0519,2.75946 0.7649,3.42552 3.1952,2.65928 l 12.9804,-10.37119 c 1.9695,-1.71776 1.7878,-3.98642 0.1996,-5.31856 l -13.5794,-11.4349 c -2.2809,-0.95305 -2.6175,0.73817 -2.6645,2.98029 z"
style="fill:url(#linearGradient7105);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:0.8665719px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
id="path6974"
d="m 889.06306,231.14531 -0.1312,13.62502 c 6.5402,-8.90875 2.6913,1.16873 11.1093,-8.53132 l -8.7455,-7.28544 c -2.2809,-0.70088 -2.1856,0.54285 -2.2326,2.19174 z"
style="fill:url(#linearGradient7107);fill-opacity:1;fill-rule:evenodd;stroke:none" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="path7005"
d="m 908.10846,230.84445 -0.1313,21.48508 c -0.0519,2.75946 0.7649,3.42552 3.1952,2.65928 l 12.9804,-10.37119 c 1.9695,-1.71776 1.7878,-3.98642 0.1996,-5.31856 l -13.5794,-11.4349 c -2.2809,-0.95305 -2.6175,0.73817 -2.6645,2.98029 z"
style="fill:url(#linearGradient7109);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:0.8665719px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
id="path7007"
d="m 908.70016,231.15923 -0.1312,13.6111 c 6.5402,-8.89965 2.5318,0.85011 10.9498,-8.84003 l -8.586,-6.96057 c -2.2809,-0.70017 -2.1856,0.54229 -2.2326,2.1895 z"
style="fill:url(#linearGradient3413);fill-opacity:1;fill-rule:evenodd;stroke:none" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg3648"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="New document 17">
<defs
id="defs3650">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient5207"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2215923,0,0,0.8996584,781.52213,-119.35192)"
x1="292.30838"
y1="419.81253"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient2237">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop2239" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop2241" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient5209"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1914392,0,0,0.8996584,791.32934,-118.70141)"
x1="297.8941"
y1="424.00873"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient3207">
<stop
id="stop3209"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3211"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient5211"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2215923,0,0,0.8996584,781.52213,-119.35192)"
x1="292.30838"
y1="419.81253"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient3627">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop3629" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop3631" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient5213"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1914392,0,0,0.8996584,791.32934,-118.70141)"
x1="297.8941"
y1="424.00873"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient3634">
<stop
id="stop3636"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3638"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="16"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="849"
inkscape:window-height="609"
inkscape:window-x="842"
inkscape:window-y="83"
inkscape:window-maximized="0" />
<metadata
id="metadata3653">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g5246"
transform="matrix(0.76403568,0,0,0.76403568,-640.5195,-200.07815)">
<g
transform="translate(0.4951,0.288308)"
id="g5189">
<g
id="g5175">
<rect
ry="1.8429986"
y="268.62585"
x="847.34686"
height="27.794876"
width="6.8460755"
id="rect4006"
style="fill:url(#linearGradient5207);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
rx="1.5517035" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="rect4406"
d="m 849.53757,269.27635 3.23338,0 c 0.74268,0 0.69637,0.86122 0.69637,1.88224 l -0.10173,10.84392 c 0.20417,2.44168 -3.19894,3.13232 -5.23638,5.33738 l 0.0678,-16.22055 c 0,-1.02102 0.59787,-1.84299 1.34055,-1.84299 z"
style="fill:url(#linearGradient5209);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44649449px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
</g>
<g
transform="translate(16.522255,0.288308)"
id="g5179">
<rect
rx="1.5517035"
style="fill:url(#linearGradient5211);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect5181"
width="6.8460755"
height="27.794876"
x="847.34686"
y="268.62585"
ry="1.8429986" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient5213);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44649449px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 849.53757,269.27635 3.23338,0 c 0.74268,0 0.69637,0.86122 0.69637,1.88224 l -0.10173,10.84392 c 0.20417,2.44168 -3.19894,3.13232 -5.23638,5.33738 l 0.0678,-16.22055 c 0,-1.02102 0.59787,-1.84299 1.34055,-1.84299 z"
id="path5183"
sodipodi:nodetypes="ccccccc" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

View file

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg3530"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="New document 14">
<defs
id="defs3532">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient7125"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.7508448,0,0,1.0047463,1224.9887,-260.93318)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient2237">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop2239" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop2241" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient7127"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7508448,0,0,1.0047463,356.20533,-226.06053)"
x1="574.19977"
y1="386.51755"
x2="602.19623"
y2="414.91589" />
<linearGradient
id="linearGradient3207">
<stop
id="stop3209"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3211"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient7129"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.7508448,0,0,1.0047463,1224.9887,-260.93318)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient3510">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop3512" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop3514" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient7131"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7508448,0,0,1.0047463,356.20533,-226.06053)"
x1="574.19977"
y1="386.51755"
x2="602.19623"
y2="414.91589" />
<linearGradient
id="linearGradient3517">
<stop
id="stop3519"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3521"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="1.7561332"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="721"
inkscape:window-height="582"
inkscape:window-x="1025"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata3535">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g7117"
transform="matrix(0.76676112,0,0,0.76676112,-600.90663,-119.37546)">
<g
transform="translate(0.3991365,0)"
id="g7085">
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient7125);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:0.86856693px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 802.95336,165.91041 0.13124,21.58705 c 0.0519,2.77256 -0.76484,3.44178 -3.19474,2.6719 l -12.97858,-10.42041 c -1.96927,-1.72591 -1.78765,-4.00534 -0.19967,-5.34381 l 13.5776,-11.48917 c 2.28061,-0.95757 2.61716,0.74168 2.66415,2.99444 z"
id="path7045"
sodipodi:nodetypes="ccccccc" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient7127);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 802.33383,166.70719 0.0368,6.3298 c -6.54702,5.58043 -7.17964,0.0807 -10.96661,9.35453 l -3.24611,-2.72331 c -1.83699,-1.68228 -2.19329,-3.37644 -0.71199,-4.68107 l 12.66555,-11.19867 c 2.12742,-0.93337 2.17849,0.72292 2.22234,2.91872 z"
id="path7051"
sodipodi:nodetypes="ccccccc" />
</g>
<g
transform="translate(20.159898,-1.4678949e-6)"
id="g7089">
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient7129);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:0.86856693px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 802.95336,165.91041 0.13124,21.58705 c 0.0519,2.77256 -0.76484,3.44178 -3.19474,2.6719 l -12.97858,-10.42041 c -1.96927,-1.72591 -1.78765,-4.00534 -0.19967,-5.34381 l 13.5776,-11.48917 c 2.28061,-0.95757 2.61716,0.74168 2.66415,2.99444 z"
id="path7091"
sodipodi:nodetypes="ccccccc" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient7131);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 802.33383,166.70719 0.0368,6.3298 c -6.54702,5.58043 -7.17964,0.0807 -10.96661,9.35453 l -3.24611,-2.72331 c -1.83699,-1.68228 -2.19329,-3.37644 -0.71199,-4.68107 l 12.66555,-11.19867 c 2.12742,-0.93337 2.17849,0.72292 2.22234,2.91872 z"
id="path7093"
sodipodi:nodetypes="ccccccc" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg3239"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="replay_start.svg">
<defs
id="defs3241">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient12715"
id="linearGradient12804"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(636.02621,139.8406)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient12715">
<stop
style="stop-color:#000080;stop-opacity:1;"
offset="0"
id="stop12717" />
<stop
id="stop12723"
offset="0.29885057"
style="stop-color:#0000a7;stop-opacity:1;" />
<stop
style="stop-color:#2828ff;stop-opacity:1;"
offset="1"
id="stop12719" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient13568"
id="linearGradient12801"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(636.73201,141.31112)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient13568">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop13570" />
<stop
style="stop-color:#0600cf;stop-opacity:0;"
offset="1"
id="stop13572" />
</linearGradient>
<linearGradient
y2="451.85028"
x2="581.19086"
y1="416.94766"
x1="561.24646"
gradientTransform="translate(636.73201,141.31112)"
gradientUnits="userSpaceOnUse"
id="linearGradient3237"
xlink:href="#linearGradient13568"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="1.7561332"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="907"
inkscape:window-height="665"
inkscape:window-x="839"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata3244">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g13955"
transform="matrix(0.6981983,0,0,0.76802309,-828.57925,-425.81456)">
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="path12784"
d="m 1198.1068,564.66784 -0.1748,21.48508 c -0.069,2.75946 1.0186,3.42552 4.2549,2.65928 l 17.2853,-10.37119 c 2.6227,-1.71776 2.3808,-3.98642 0.2659,-5.31856 l -18.0831,-11.4349 c -3.0374,-0.95305 -3.4856,0.73817 -3.5482,2.98029 z"
style="fill:url(#linearGradient12804);fill-opacity:1;fill-rule:evenodd;stroke:#000061;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
id="path12786"
d="m 1198.8948,565.80969 -0.1748,18.52705 c 8.7093,-12.11394 4.4337,-0.58002 15.6435,-13.76997 l -12.4957,-7.73737 c -3.0374,-0.95305 -2.9104,0.73817 -2.973,2.98029 z"
style="fill:url(#linearGradient3237);fill-opacity:1;fill-rule:evenodd;stroke:none" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg3320"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="replay_stop.svg">
<defs
id="defs3322">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient3610"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8996584,0,0,0.8996584,542.1675,-118.95505)"
x1="297.8941"
y1="424.00873"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient2237">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop2239" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop2241" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient3998"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8996584,0,0,0.8996584,543.08369,-117.97095)"
x1="293.33597"
y1="423.03891"
x2="330.00668"
y2="472.74878" />
<linearGradient
id="linearGradient3207">
<stop
id="stop3209"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3211"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
y2="472.74878"
x2="330.00668"
y1="423.03891"
x1="293.33597"
gradientTransform="matrix(0.8996584,0,0,0.8996584,543.08369,-117.97095)"
gradientUnits="userSpaceOnUse"
id="linearGradient3318"
xlink:href="#linearGradient3207"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="1.7561332"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1075"
inkscape:window-height="703"
inkscape:window-x="841"
inkscape:window-y="315"
inkscape:window-maximized="0" />
<metadata
id="metadata3325">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g4000"
transform="matrix(0.76669653,0,0,0.76669653,-615.23012,-200.91391)">
<rect
ry="3.588665"
y="269.02274"
x="809.41412"
height="27.794876"
width="27.794876"
id="rect3598"
style="fill:url(#linearGradient3610);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:0.89965838px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
id="rect3612"
d="m 813.91895,270.00686 20.0068,0 c 10.54509,7.32439 -17.45185,10.45989 -23.59547,24.20621 l 0,-20.61755 c 0,-1.98812 1.60055,-3.58866 3.58867,-3.58866 z"
style="fill:url(#linearGradient3318);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg3766"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="New document 20">
<defs
id="defs3768">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient9289"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(325.22401,-152.70392)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient2237">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop2239" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop2241" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient9291"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(325.92981,-151.2334)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient3207">
<stop
id="stop3209"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3211"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient9293"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2215923,0,0,0.8996584,781.52213,-119.35192)"
x1="292.30838"
y1="419.81253"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient3747">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop3749" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop3751" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient9295"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1914392,0,0,0.8996584,791.32934,-118.70141)"
x1="297.8941"
y1="424.00873"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient3754">
<stop
id="stop3756"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3758"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="16"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="804"
inkscape:window-height="488"
inkscape:window-x="1089"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata3771">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g9274"
transform="matrix(0.76402345,0,0,0.76402345,-674.86163,-200.00285)">
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="path5221"
d="m 887.3046,272.12332 -0.17478,21.48508 c -0.0691,2.75946 1.01863,3.42552 4.25485,2.65928 l 17.28531,-10.37119 c 2.62273,-1.71776 2.38085,-3.98642 0.26593,-5.31856 l -18.0831,-11.4349 c -3.0374,-0.95305 -3.48562,0.73817 -3.54821,2.98029 z"
style="fill:url(#linearGradient9289);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
id="path5223"
d="m 888.09257,273.26517 -0.17479,18.52705 c 8.70928,-12.11394 4.43369,-0.58002 15.64354,-13.76997 l -12.49571,-7.73737 c -3.0374,-0.95305 -2.91045,0.73817 -2.97304,2.98029 z"
style="fill:url(#linearGradient9291);fill-opacity:1;fill-rule:evenodd;stroke:none" />
<g
transform="translate(67.163097,0.1942719)"
id="g5236">
<rect
rx="1.5517035"
style="fill:url(#linearGradient9293);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect5238"
width="6.8460755"
height="27.794876"
x="847.34686"
y="268.62585"
ry="1.8429986" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient9295);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44649449px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 849.53757,269.27635 3.23338,0 c 0.74268,0 0.69637,0.86122 0.69637,1.88224 l -0.10173,10.84392 c 0.20417,2.44168 -3.19894,3.13232 -5.23638,5.33738 l 0.0678,-16.22055 c 0,-1.02102 0.59787,-1.84299 1.34055,-1.84299 z"
id="path5240"
sodipodi:nodetypes="ccccccc" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg3881"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="New document 23">
<defs
id="defs3883">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient5301"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1,0,0,1,1457.2153,-101.44165)"
x1="561.24646"
y1="416.94766"
x2="581.19086"
y2="451.85028" />
<linearGradient
id="linearGradient2237">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop2239" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop2241" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2237"
id="linearGradient5295"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2215923,0,0,0.8996584,-933.75407,-67.895376)"
x1="292.30838"
y1="419.81253"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient3857">
<stop
style="stop-color:#006000;stop-opacity:1;"
offset="0"
id="stop3859" />
<stop
style="stop-color:#48ff00;stop-opacity:1;"
offset="1"
id="stop3861" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient5292"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1914392,0,0,0.8996584,805.00844,-67.244866)"
x1="297.8941"
y1="424.00873"
x2="333.20709"
y2="475.94916" />
<linearGradient
id="linearGradient3207">
<stop
id="stop3209"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3211"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3207"
id="linearGradient6073"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(300.14087,-66.733744)"
x1="574.19977"
y1="386.51755"
x2="602.19623"
y2="414.91589" />
<linearGradient
id="linearGradient3868">
<stop
id="stop3870"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3872"
offset="1"
style="stop-color:#48ff00;stop-opacity:0;" />
</linearGradient>
<linearGradient
y2="414.91589"
x2="602.19623"
y1="386.51755"
x1="574.19977"
gradientTransform="translate(300.14087,-66.733744)"
gradientUnits="userSpaceOnUse"
id="linearGradient3879"
xlink:href="#linearGradient3207"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="16"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="783"
inkscape:window-height="494"
inkscape:window-x="1110"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata3886">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g6466"
transform="matrix(0.76402304,0,0,0.76402304,-654.96343,-239.16829)">
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="path5273"
d="m 895.1347,323.38559 0.17478,21.48508 c 0.0691,2.75946 -1.01863,3.42552 -4.25485,2.65928 l -17.28531,-10.37119 c -2.62273,-1.71776 -2.38085,-3.98642 -0.26593,-5.31856 l 18.0831,-11.4349 c 3.0374,-0.95305 3.48562,0.73817 3.54821,2.98029 z"
style="fill:url(#linearGradient5301);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<rect
transform="scale(-1,1)"
ry="1.8429986"
y="320.0824"
x="-867.92932"
height="27.794876"
width="6.8460755"
id="rect5279"
style="fill:url(#linearGradient5295);fill-opacity:1;fill-rule:evenodd;stroke:#006100;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
rx="1.5517035" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="path5281"
d="m 863.21667,320.73289 3.23338,0 c 0.74268,0 0.69637,0.86122 0.69637,1.88224 l -0.10173,10.84392 c 0.20417,2.44168 -3.19894,3.13232 -5.23638,5.33738 l 0.0678,-16.22055 c 0,-1.02102 0.59787,-1.84299 1.34055,-1.84299 z"
style="fill:url(#linearGradient5292);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44649449px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
id="path5303"
d="m 894.30958,324.17861 0.049,6.2999 c -8.71954,5.55407 -9.56209,0.0803 -14.6057,9.31034 l -4.32328,-2.71045 c -2.44656,-1.67433 -2.9211,-3.36049 -0.94825,-4.65895 l 16.8684,-11.14577 c 2.83337,-0.92896 2.90139,0.7195 2.95978,2.90493 z"
style="fill:url(#linearGradient3879);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -0,0 +1,96 @@
#include "replay_timeline_widget.h"
#include <QPainter>
#include <QPalette>
#include <QTimer>
#include <math.h>
ReplayTimelineWidget::ReplayTimelineWidget(QWidget *parent)
: QWidget(parent), maxBinValue(1), maxTime(1), timeScaleFactor(1.0), currentTime(0), currentEvent(0)
{
replayTimer = new QTimer(this);
connect(replayTimer, SIGNAL(timeout()), this, SLOT(replayTimerTimeout()));
}
const int ReplayTimelineWidget::binLength = 5000;
void ReplayTimelineWidget::setTimeline(const QList<int> &_replayTimeline)
{
replayTimeline = _replayTimeline;
histogram.clear();
int binEndTime = binLength - 1;
int binValue = 0;
for (int i = 0; i < replayTimeline.size(); ++i) {
if (replayTimeline[i] > binEndTime) {
histogram.append(binValue);
if (binValue > maxBinValue)
maxBinValue = binValue;
while (replayTimeline[i] > binEndTime + binLength) {
histogram.append(0);
binEndTime += binLength;
}
binValue = 1;
binEndTime += binLength;
} else
++binValue;
}
histogram.append(binValue);
if (!replayTimeline.isEmpty())
maxTime = replayTimeline.last();
update();
}
void ReplayTimelineWidget::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.drawRect(0, 0, width() - 1, height() - 1);
qreal binWidth = (qreal) width() / histogram.size();
QPainterPath path;
path.moveTo(0, height() - 1);
for (int i = 0; i < histogram.size(); ++i)
path.lineTo(round(i * binWidth), (height() - 1) * (1.0 - (qreal) histogram[i] / maxBinValue));
path.lineTo(width() - 1, height() - 1);
path.lineTo(0, height() - 1);
painter.fillPath(path, Qt::black);
const QColor barColor = QColor::fromHsv(120, 255, 255, 100);
painter.fillRect(0, 0, (width() - 1) * currentTime / maxTime, height() - 1, barColor);
}
QSize ReplayTimelineWidget::sizeHint() const
{
return QSize(-1, 50);
}
void ReplayTimelineWidget::replayTimerTimeout()
{
currentTime += 200;
while ((currentEvent < replayTimeline.size()) && (replayTimeline[currentEvent] < currentTime)) {
emit processNextEvent();
++currentEvent;
}
if (currentEvent == replayTimeline.size()) {
emit replayFinished();
replayTimer->stop();
}
if (!(currentTime % 1000))
update();
}
void ReplayTimelineWidget::setTimeScaleFactor(qreal _timeScaleFactor)
{
timeScaleFactor = _timeScaleFactor;
replayTimer->setInterval(200 / timeScaleFactor);
}
void ReplayTimelineWidget::startReplay()
{
replayTimer->start(200 / timeScaleFactor);
}
void ReplayTimelineWidget::stopReplay()
{
replayTimer->stop();
}

View file

@ -0,0 +1,39 @@
#ifndef REPLAY_TIMELINE_WIDGET
#define REPLAY_TIMELINE_WIDGET
#include <QWidget>
#include <QList>
class QPaintEvent;
class QTimer;
class ReplayTimelineWidget : public QWidget {
Q_OBJECT
signals:
void processNextEvent();
void replayFinished();
private:
QTimer *replayTimer;
QList<int> replayTimeline;
QList<int> histogram;
static const int binLength;
int maxBinValue, maxTime;
qreal timeScaleFactor;
int currentTime;
int currentEvent;
private slots:
void replayTimerTimeout();
public:
ReplayTimelineWidget(QWidget *parent = 0);
void setTimeline(const QList<int> &_replayTimeline);
QSize sizeHint() const;
void setTimeScaleFactor(qreal _timeScaleFactor);
int getCurrentEvent() const { return currentEvent; }
public slots:
void startReplay();
void stopReplay();
protected:
void paintEvent(QPaintEvent *event);
};
#endif

View file

@ -6,6 +6,8 @@
#include <QMessageBox>
#include <QFileDialog>
#include <QTimer>
#include <QToolButton>
#include "tab_game.h"
#include "tab_supervisor.h"
#include "cardinfowidget.h"
@ -26,6 +28,7 @@
#include "main.h"
#include "settingscache.h"
#include "carddatabase.h"
#include "replay_timeline_widget.h"
#include <google/protobuf/descriptor.h>
#include "pending_command.h"
@ -195,7 +198,7 @@ void DeckViewContainer::setDeck(DeckList *deck)
deckView->setDeck(deck);
readyStartButton->setEnabled(true);
}
#include <QDebug>
TabGame::TabGame(GameReplay *_replay)
: Tab(0),
hostId(-1),
@ -213,6 +216,24 @@ TabGame::TabGame(GameReplay *_replay)
gameId = replay->game_info().game_id();
gameDescription = QString::fromStdString(replay->game_info().description());
// Create list: event number -> time [ms]
// Distribute simultaneous events evenly across 1 second.
int lastEventTimestamp = -1;
const int eventCount = replay->event_list_size();
for (int i = 0; i < eventCount; ++i) {
int j = i + 1;
while ((j < eventCount) && (replay->event_list(j).seconds_elapsed() == lastEventTimestamp))
++j;
const int numberEventsThisSecond = j - i;
for (int k = 0; k < numberEventsThisSecond; ++k)
replayTimeline.append(replay->event_list(i + k).seconds_elapsed() * 1000 + (int) ((qreal) k / (qreal) numberEventsThisSecond * 1000));
if (j < eventCount)
lastEventTimestamp = replay->event_list(j).seconds_elapsed();
i += numberEventsThisSecond - 1;
}
phasesToolbar = new PhasesToolbar;
phasesToolbar->hide();
@ -241,6 +262,40 @@ TabGame::TabGame(GameReplay *_replay)
QWidget *messageLogLayoutWidget = new QWidget;
messageLogLayoutWidget->setLayout(messageLogLayout);
timelineWidget = new ReplayTimelineWidget;
timelineWidget->setTimeline(replayTimeline);
connect(timelineWidget, SIGNAL(processNextEvent()), this, SLOT(replayNextEvent()));
connect(timelineWidget, SIGNAL(replayFinished()), this, SLOT(replayFinished()));
replayToStartButton = new QToolButton;
replayToStartButton->setIconSize(QSize(32, 32));
replayToStartButton->setIcon(QIcon(":/resources/replay_tostart.svg"));
connect(replayToStartButton, SIGNAL(clicked()), this, SLOT(replayToStartButtonClicked()));
replayStartButton = new QToolButton;
replayStartButton->setIconSize(QSize(32, 32));
replayStartButton->setIcon(QIcon(":/resources/replay_start.svg"));
connect(replayStartButton, SIGNAL(clicked()), this, SLOT(replayStartButtonClicked()));
replayPauseButton = new QToolButton;
replayPauseButton->setIconSize(QSize(32, 32));
replayPauseButton->setEnabled(false);
replayPauseButton->setIcon(QIcon(":/resources/replay_pause.svg"));
connect(replayPauseButton, SIGNAL(clicked()), this, SLOT(replayPauseButtonClicked()));
replayStopButton = new QToolButton;
replayStopButton->setIconSize(QSize(32, 32));
replayStopButton->setEnabled(false);
replayStopButton->setIcon(QIcon(":/resources/replay_stop.svg"));
connect(replayStopButton, SIGNAL(clicked()), this, SLOT(replayStopButtonClicked()));
replayFastForwardButton = new QToolButton;
replayFastForwardButton->setIconSize(QSize(32, 32));
replayFastForwardButton->setEnabled(false);
replayFastForwardButton->setIcon(QIcon(":/resources/replay_fastforward.svg"));
replayFastForwardButton->setCheckable(true);
connect(replayFastForwardButton, SIGNAL(toggled(bool)), this, SLOT(replayFastForwardButtonToggled(bool)));
replayToEndButton = new QToolButton;
replayToEndButton->setIconSize(QSize(32, 32));
replayToEndButton->setIcon(QIcon(":/resources/replay_toend.svg"));
connect(replayStopButton, SIGNAL(clicked()), this, SLOT(replayToEndButtonClicked()));
splitter = new QSplitter(Qt::Vertical);
splitter->addWidget(cardInfo);
splitter->addWidget(playerListWidget);
@ -251,6 +306,19 @@ TabGame::TabGame(GameReplay *_replay)
mainLayout->addLayout(deckViewContainerLayout, 10);
mainLayout->addWidget(splitter);
QHBoxLayout *replayControlLayout = new QHBoxLayout;
replayControlLayout->addWidget(timelineWidget, 10);
replayControlLayout->addWidget(replayToStartButton);
replayControlLayout->addWidget(replayStartButton);
replayControlLayout->addWidget(replayPauseButton);
replayControlLayout->addWidget(replayStopButton);
replayControlLayout->addWidget(replayFastForwardButton);
replayControlLayout->addWidget(replayToEndButton);
QVBoxLayout *superMainLayout = new QVBoxLayout;
superMainLayout->addLayout(mainLayout);
superMainLayout->addLayout(replayControlLayout);
aNextPhase = 0;
aNextTurn = 0;
aRemoveLocalArrows = 0;
@ -263,16 +331,11 @@ TabGame::TabGame(GameReplay *_replay)
tabMenu->addAction(aLeaveGame);
retranslateUi();
setLayout(mainLayout);
setLayout(superMainLayout);
splitter->restoreState(settingsCache->getTabGameSplitterSizes());
messageLog->logReplayStarted(gameId);
gameTimer = new QTimer(this);
gameTimer->setInterval(1000);
connect(gameTimer, SIGNAL(timeout()), this, SLOT(nextReplayStep()));
gameTimer->start();
}
TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_clients, const Event_GameJoined &event)
@ -461,15 +524,62 @@ void TabGame::closeRequest()
actLeaveGame();
}
void TabGame::nextReplayStep()
void TabGame::replayNextEvent()
{
if (replay->event_list_size() <= currentReplayStep) {
QMessageBox::information(this, "", "done");
gameTimer->stop();
return;
}
processGameEventContainer(replay->event_list(currentReplayStep), 0);
++currentReplayStep;
processGameEventContainer(replay->event_list(timelineWidget->getCurrentEvent()), 0);
}
void TabGame::replayFinished()
{
replayStartButton->setEnabled(true);
replayPauseButton->setEnabled(false);
replayStopButton->setEnabled(false);
replayFastForwardButton->setEnabled(false);
}
void TabGame::replayToStartButtonClicked()
{
// XXX
}
void TabGame::replayStartButtonClicked()
{
replayStartButton->setEnabled(false);
replayPauseButton->setEnabled(true);
replayStopButton->setEnabled(true);
replayFastForwardButton->setEnabled(true);
timelineWidget->startReplay();
}
void TabGame::replayPauseButtonClicked()
{
replayStartButton->setEnabled(true);
replayPauseButton->setEnabled(false);
replayFastForwardButton->setEnabled(false);
timelineWidget->stopReplay();
}
void TabGame::replayStopButtonClicked()
{
replayStartButton->setEnabled(true);
replayPauseButton->setEnabled(false);
replayStopButton->setEnabled(false);
replayFastForwardButton->setEnabled(false);
timelineWidget->stopReplay();
// XXX to start
}
void TabGame::replayFastForwardButtonToggled(bool checked)
{
timelineWidget->setTimeScaleFactor(checked ? 10.0 : 1.0);
}
void TabGame::replayToEndButtonClicked()
{
// XXX
}
void TabGame::incrementGameTime()

View file

@ -18,11 +18,13 @@ class QSplitter;
class QLabel;
class QLineEdit;
class QPushButton;
class QToolButton;
class QMenu;
class ZoneViewLayout;
class ZoneViewWidget;
class PhasesToolbar;
class PlayerListWidget;
class ReplayTimelineWidget;
class Response;
class GameEventContainer;
class GameEventContext;
@ -108,8 +110,13 @@ private:
QStringList phasesList;
int currentPhase;
int activePlayer;
// Replay related members
GameReplay *replay;
int currentReplayStep;
QList<int> replayTimeline;
ReplayTimelineWidget *timelineWidget;
QToolButton *replayToStartButton, *replayStartButton, *replayPauseButton, *replayStopButton, *replayFastForwardButton, *replayToEndButton;
QSplitter *splitter;
CardInfoWidget *cardInfo;
@ -158,7 +165,15 @@ signals:
void containerProcessingDone();
void openMessageDialog(const QString &userName, bool focus);
private slots:
void nextReplayStep();
void replayNextEvent();
void replayFinished();
void replayToStartButtonClicked();
void replayStartButtonClicked();
void replayPauseButtonClicked();
void replayStopButtonClicked();
void replayFastForwardButtonToggled(bool checked);
void replayToEndButtonClicked();
void incrementGameTime();
void adminLockChanged(bool lock);
void newCardAdded(AbstractCardItem *card);