Merge branch 'master' of https://github.com/highfidelity/hifi into authentication
|
@ -20,7 +20,7 @@ else ()
|
|||
|
||||
find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
|
||||
find_library(GLEW_LIBRARY glew32s PATH_SUFFIXES "lib/Release/Win32" HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
find_library(GLEW_LIBRARY glew32s PATH_SUFFIXES "lib/Release/Win32" "lib" HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
|
12
interface/resources/images/audio-box.svg
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="265px" height="44px" viewBox="0 0 265 44" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Slice 1</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs></defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="audio-box" sketch:type="MSLayerGroup" fill="#FFFFFF">
|
||||
<rect id="rect2985" sketch:type="MSShapeGroup" x="0" y="0" width="265" height="44" rx="10.666199"></rect>
|
||||
<rect id="rect3879" sketch:type="MSShapeGroup" x="0" y="0" width="265" height="27"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 814 B |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
|
@ -1,14 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 15.9 15.9" enable-background="new 0 0 15.9 15.9" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#666666" d="M15.5,13.7l-1.8,1.8c-0.2,0.2-0.6,0.4-0.9,0.4s-0.7-0.1-0.9-0.4L8,11.6L4,15.5c-0.2,0.2-0.6,0.4-0.9,0.4
|
||||
s-0.7-0.1-0.9-0.4l-1.8-1.8C0.1,13.5,0,13.1,0,12.8s0.1-0.7,0.4-0.9L4.3,8L0.4,4C0.1,3.8,0,3.4,0,3.1s0.1-0.7,0.4-0.9l1.8-1.8
|
||||
C2.4,0.1,2.8,0,3.1,0S3.8,0.1,4,0.4L8,4.3l3.9-3.9C12.1,0.1,12.5,0,12.8,0s0.7,0.1,0.9,0.4l1.8,1.8c0.2,0.2,0.4,0.6,0.4,0.9
|
||||
S15.8,3.8,15.5,4L11.6,8l3.9,3.9c0.2,0.2,0.4,0.6,0.4,0.9S15.8,13.5,15.5,13.7z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="44px" height="44px" viewBox="0 0 44 44" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Slice 1</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs></defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="close" sketch:type="MSLayerGroup" fill="#CCCCCC">
|
||||
<path d="M0.286382588,32.6200761 L32.6200759,0.286382745 C33.0019275,-0.0954590326 33.6210173,-0.0954590326 34.0028688,0.286382745 L43.380667,9.66418097 C43.7625088,10.0460227 43.7625088,10.6651125 43.380667,11.0469543 L43.380667,11.0469543 L11.0469639,43.3806574 C10.6651221,43.7624992 10.0460226,43.7624992 9.66418081,43.3806574 L0.286382588,34.0028592 C-0.0954591894,33.6210076 -0.0954591894,33.0019179 0.286382588,32.6200761 L0.286382588,32.6200761 L0.286382588,32.6200761 Z" id="path16" sketch:type="MSShapeGroup"></path>
|
||||
<path d="M32.6200759,43.3806574 L0.286382588,11.0469543 C-0.0954591894,10.6651125 -0.0954591894,10.0460227 0.286382588,9.66418097 L9.66418081,0.286382745 C10.0460226,-0.0954590326 10.6651221,-0.0954590326 11.0469639,0.286382745 L43.380667,32.6200761 C43.7625088,33.0019179 43.7625088,33.6210076 43.380667,34.0028592 L34.0028688,43.3806574 C33.6210173,43.7624992 33.0019275,43.7624992 32.6200759,43.3806574 L32.6200759,43.3806574 Z" id="path18" sketch:type="MSShapeGroup"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.3 KiB |
115
interface/resources/images/mic-mute.svg
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
|
||||
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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 45 45"
|
||||
enable-background="new 0 0 45 45"
|
||||
xml:space="preserve"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.2 r9819"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="mic-mute.svg"><metadata
|
||||
id="metadata27"><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><defs
|
||||
id="defs25" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:window-height="752"
|
||||
id="namedview23"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.866667"
|
||||
inkscape:cx="22.5"
|
||||
inkscape:cy="22.5"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"><sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="22.58427,21.994382"
|
||||
id="guide3004" /><sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="1.9382022,22.41573"
|
||||
id="guide2997" /></sodipodi:namedview>
|
||||
<g
|
||||
id="Layer_3"
|
||||
transform="matrix(1.0539137,0,0,1.0513476,-0.63340535,-1.2603481)">
|
||||
<g
|
||||
id="Layer_2">
|
||||
<path
|
||||
stroke-miterlimit="10"
|
||||
d="M 42.3,22.6 C 42.3,33.7 33.2,42.9 21.9,43 10.7,43 1.6,33.9 1.6,22.6 1.6,11.3 10.7,2.2 21.9,2.2 c 11.2,0 20.4,9.2 20.4,20.4 z"
|
||||
id="path6"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ff0000;stroke:#000000;stroke-width:2;stroke-miterlimit:10" />
|
||||
<line
|
||||
stroke-miterlimit="10"
|
||||
x1="8.1000004"
|
||||
y1="7.6999998"
|
||||
x2="36.799999"
|
||||
y2="36.400002"
|
||||
id="line8"
|
||||
style="fill:#ff0000;stroke:#000000;stroke-width:2;stroke-miterlimit:10" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="Layer_1"
|
||||
transform="translate(0.75280932,-0.01573)">
|
||||
<title
|
||||
id="title11">Mic</title>
|
||||
<description
|
||||
id="description13">Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<g
|
||||
id="Page-1_2_"
|
||||
sketch:type="MSPage">
|
||||
<g
|
||||
id="mic-tool_1_"
|
||||
sketch:type="MSLayerGroup">
|
||||
<g
|
||||
id="Page-1_3_"
|
||||
sketch:type="MSShapeGroup">
|
||||
<g
|
||||
id="Group_1_">
|
||||
<g
|
||||
id="mic_1_"
|
||||
transform="translate(3,2)">
|
||||
<path
|
||||
id="Shape_1_"
|
||||
d="M 25.4,36.7"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="Shape_4_"
|
||||
d="m 12,36.7 c 1.3,-2.2 3.5,-3.7 5.9,-4 V 29.5 C 13.5,29 10,25.2 10,20.5 v -2 c 0,-0.6 0.4,-1 1,-1 0.5,0 1,0.5 1,1 v 2 c 0,3.9 3.1,7.1 6.9,7.1 3.8,0 6.9,-3.2 6.9,-7.1 v -2 c 0,-0.6 0.4,-1 1,-1 0.5,0 1,0.5 1,1 v 2 c 0,4.7 -3.5,8.5 -7.9,9 v 3.2 c 2.5,0.3 4.7,1.8 5.9,4 H 22 c -0.5,-1.2 -1.7,-2 -3,-2 -1.3,0 -2.5,0.8 -3,2 h -4 l 0,0 0,0 0,0 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="Shape_3_"
|
||||
d="m 18.9,4.5 c -2.7,0 -4.9,2.3 -4.9,5 v 5 6.1 c 0,2.8 2.2,5 4.9,5 2.7,0 4.9,-2.3 4.9,-5 v -6.1 -5 c 0.1,-2.8 -2.1,-5 -4.9,-5 l 0,0 0,0 0,0 0,0 z M 16,14.7 v -5 c 0,-1.7 1.3,-3 3,-3 1.6,0 3,1.4 3,3 v 5 h -6 l 0,0 0,0 0,0 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.6 KiB |
|
@ -1,20 +1,105 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="45px" height="45px" viewBox="0 0 45 45" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Mic</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs></defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="mic-tool" sketch:type="MSLayerGroup">
|
||||
<g id="Page-1" sketch:type="MSShapeGroup">
|
||||
<g id="Group">
|
||||
<rect d="M0,0 L0,45 L45,45 L45,0 L0,0 Z M0,0" id="Rectangle-1" fill="#000000" x="0" y="0" width="45" height="45"></rect>
|
||||
<g id="mic" transform="translate(3.000000, 2.000000)" fill="#CACACA">
|
||||
<path d="M23.1863426,39.2982456 L27.9259259,39.2982456" id="Shape"></path>
|
||||
<path d="M11.0740741,39.2982456 C12.6269271,36.6118421 15.3070486,34.8441118 18.2962963,34.4674781 L18.2962963,30.5769518 C12.8949016,29.9582346 8.66666667,25.3241886 8.66666667,19.6491228 L8.66666667,17.1929824 C8.66666667,16.5141667 9.20502316,15.9649123 9.87037034,15.9649123 C10.5357176,15.9649123 11.0740741,16.5141667 11.0740741,17.1929824 L11.0740741,19.6491228 C11.0740741,24.3887061 14.854456,28.2456141 19.5,28.2456141 C24.145544,28.2456141 27.9259259,24.3887061 27.9259259,19.6491228 L27.9259259,17.1929824 C27.9259259,16.5141667 28.4642824,15.9649123 29.1296297,15.9649123 C29.7949768,15.9649123 30.3333333,16.5141667 30.3333333,17.1929824 L30.3333333,19.6491228 C30.3333333,25.3241886 26.1062268,29.9582346 20.7037037,30.5770285 L20.7037037,34.4675548 C23.6941551,34.8441118 26.3742766,36.6118421 27.9259259,39.2982456 L23.1863426,39.2982456 C22.5586111,37.8207237 21.1386169,36.8589145 19.561088,36.8421053 C17.9858912,36.8252961 16.5447569,37.8351535 15.8888136,39.2982456 L11.0740741,39.2982456 L11.0740741,39.2982456 L11.0740741,39.2982456 L11.0740741,39.2982456 Z M11.0740741,39.2982456" id="Shape"></path>
|
||||
<path d="M19.5,0 C16.1756713,0 13.4814815,2.74880483 13.4814815,6.14035088 L13.4814815,12.2807018 L13.4814815,19.6491228 C13.4814815,23.0407456 16.1757465,25.7894737 19.5,25.7894737 C22.8242535,25.7894737 25.5185185,23.0406689 25.5185185,19.6491228 L25.5185185,12.2807018 L25.5185185,6.14035088 C25.5185185,2.74880483 22.8243287,0 19.5,0 L19.5,0 L19.5,0 L19.5,0 L19.5,0 Z M15.8888889,12.4342105 L15.8888889,6.29385962 C15.8888889,4.26224781 17.5086979,2.60964912 19.5,2.60964912 C21.4913021,2.60964912 23.1111111,4.26224781 23.1111111,6.29385962 L23.1111111,12.4342105 L15.8888889,12.4342105 L15.8888889,12.4342105 L15.8888889,12.4342105 L15.8888889,12.4342105 Z M15.8888889,12.4342105" id="Shape"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
|
||||
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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 45 45"
|
||||
enable-background="new 0 0 45 45"
|
||||
xml:space="preserve"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.2 r9819"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="mic-mute.svg"><metadata
|
||||
id="metadata27"><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><defs
|
||||
id="defs25">
|
||||
|
||||
|
||||
|
||||
|
||||
</defs><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:window-height="752"
|
||||
id="namedview23"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.866667"
|
||||
inkscape:cx="7.5842701"
|
||||
inkscape:cy="22.5"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"><sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="22.58427,21.994382"
|
||||
id="guide3004" /><sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="1.9382022,22.41573"
|
||||
id="guide2997" /></sodipodi:namedview>
|
||||
<path
|
||||
stroke-miterlimit="10"
|
||||
d="m 43.947144,22.500108 c 0,11.669958 -9.590615,21.342356 -21.499839,21.447491 -11.803834,0 -21.3944484,-9.567263 -21.3944484,-21.447491 0,-11.880228 9.5906144,-21.4474914 21.3944484,-21.4474914 11.803833,0 21.499839,9.6723984 21.499839,21.4474914 z"
|
||||
id="path6"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;stroke:#000000;stroke-width:2.10525966000000020;stroke-miterlimit:10;fill-opacity:1" />
|
||||
<g
|
||||
id="Layer_1"
|
||||
transform="translate(0.75280932,-0.01573)">
|
||||
<title
|
||||
id="title11">Mic</title>
|
||||
<description
|
||||
id="description13">Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<g
|
||||
id="Page-1_2_"
|
||||
sketch:type="MSPage">
|
||||
<g
|
||||
id="mic-tool_1_"
|
||||
sketch:type="MSLayerGroup">
|
||||
<g
|
||||
id="Page-1_3_"
|
||||
sketch:type="MSShapeGroup">
|
||||
<g
|
||||
id="Group_1_">
|
||||
<g
|
||||
id="mic_1_"
|
||||
transform="translate(3,2)">
|
||||
<path
|
||||
id="Shape_1_"
|
||||
d="M 25.4,36.7"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="Shape_4_"
|
||||
d="m 12,36.7 c 1.3,-2.2 3.5,-3.7 5.9,-4 V 29.5 C 13.5,29 10,25.2 10,20.5 v -2 c 0,-0.6 0.4,-1 1,-1 0.5,0 1,0.5 1,1 v 2 c 0,3.9 3.1,7.1 6.9,7.1 3.8,0 6.9,-3.2 6.9,-7.1 v -2 c 0,-0.6 0.4,-1 1,-1 0.5,0 1,0.5 1,1 v 2 c 0,4.7 -3.5,8.5 -7.9,9 v 3.2 c 2.5,0.3 4.7,1.8 5.9,4 H 22 c -0.5,-1.2 -1.7,-2 -3,-2 -1.3,0 -2.5,0.8 -3,2 h -4 l 0,0 0,0 0,0 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="Shape_3_"
|
||||
d="m 18.9,4.5 c -2.7,0 -4.9,2.3 -4.9,5 v 5 6.1 c 0,2.8 2.2,5 4.9,5 2.7,0 4.9,-2.3 4.9,-5 v -6.1 -5 c 0.1,-2.8 -2.1,-5 -4.9,-5 l 0,0 0,0 0,0 0,0 z M 16,14.7 v -5 c 0,-1.7 1.3,-3 3,-3 1.6,0 3,1.4 3,3 v 5 h -6 l 0,0 0,0 0,0 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.5 KiB |
11
interface/resources/images/minus.svg
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="50px" height="50px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Slice 1</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs></defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="minus" sketch:type="MSLayerGroup" fill="#CCCCCC">
|
||||
<path d="M1.02040816,17 L48.7408061,17 C49.3043673,17 49.7612143,17.4487665 49.7612143,18.0023375 L49.7612143,31.5976625 C49.7612143,32.1512334 49.3043673,32.6 48.7408061,32.6 L1.02040816,32.6 C0.456857143,32.6 0,32.1512334 0,31.5976625 L0,18.0023375 C0,17.4487665 0.456857143,17 1.02040816,17 L1.02040816,17 Z" id="path16" sketch:type="MSShapeGroup"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 958 B |
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="45px" height="45px" viewBox="0 0 45 45" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>mute</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs></defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="mic-tool" sketch:type="MSLayerGroup" stroke-width="4" stroke="#CB0011">
|
||||
<g id="Page-1" sketch:type="MSShapeGroup">
|
||||
<g id="Group">
|
||||
<g id="mic" transform="translate(3.000000, 2.000000)">
|
||||
<g id="muted" transform="translate(0.000000, 1.250000)">
|
||||
<ellipse d="M19.5,36.25 C30.2695532,36.25 39,28.1351616 39,18.125 C39,8.11483841 30.2695532,0 19.5,0 C8.73044685,0 0,8.11483841 0,18.125 C0,28.1351616 8.73044685,36.25 19.5,36.25 Z M19.5,36.25" id="Oval-1" cx="19.5" cy="18.125" rx="19.5" ry="18.125"></ellipse>
|
||||
<path d="M6.65836705,31.3171677 L32.4462334,4.98158885" id="Line"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB |
12
interface/resources/images/plus.svg
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="50px" height="50px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Slice 1</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs></defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="plus" sketch:type="MSLayerGroup" fill="#CCCCCC">
|
||||
<path d="M1.0252973,17.0212568 L48.9746866,17.0212568 C49.5409522,17.0212568 49.9999913,17.4803063 49.9999913,18.0465617 L49.9999913,31.9534077 C49.9999913,32.5196631 49.5409522,32.9787126 48.9746866,32.9787126 L1.0252973,32.9787126 C0.459042018,32.9787126 -7.40226494e-06,32.5196631 -7.40226494e-06,31.9534077 L-7.40226494e-06,18.0465617 C-7.40226494e-06,17.4803063 0.459042018,17.0212568 1.0252973,17.0212568 L1.0252973,17.0212568 Z" id="path16" sketch:type="MSShapeGroup"></path>
|
||||
<path d="M17.0212707,48.9746789 L17.0212707,1.0252905 C17.0212707,0.459024856 17.4803202,-1.44007019e-05 18.0465754,-1.44007019e-05 L31.9534085,-1.44007019e-05 C32.519674,-1.44007019e-05 32.9787132,0.459024856 32.9787132,1.0252905 L32.9787132,48.9746789 C32.9787132,49.5409548 32.519674,49.9999838 31.9534085,49.9999838 L18.0465754,49.9999838 C17.4803202,49.9999838 17.0212707,49.5409548 17.0212707,48.9746789 L17.0212707,48.9746789 Z" id="path18" sketch:type="MSShapeGroup"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -235,6 +235,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
|||
connect(nodeList, SIGNAL(nodeAdded(SharedNodePointer)), &_voxels, SLOT(nodeAdded(SharedNodePointer)));
|
||||
connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), &_voxels, SLOT(nodeKilled(SharedNodePointer)));
|
||||
connect(nodeList, &NodeList::uuidChanged, this, &Application::updateWindowTitle);
|
||||
connect(nodeList, SIGNAL(uuidChanged(const QUuid&)), _myAvatar, SLOT(setSessionUUID(const QUuid&)));
|
||||
connect(nodeList, &NodeList::limitOfSilentDomainCheckInsReached, nodeList, &NodeList::reset);
|
||||
|
||||
// connect to appropriate slots on AccountManager
|
||||
|
@ -529,10 +530,22 @@ void Application::paintGL() {
|
|||
|
||||
} else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||
_myCamera.setTightness(0.0f);
|
||||
float headHeight = _myAvatar->getHead()->calculateAverageEyePosition().y - _myAvatar->getPosition().y;
|
||||
glm::vec3 eyePosition = _myAvatar->getHead()->calculateAverageEyePosition();
|
||||
float headHeight = eyePosition.y - _myAvatar->getPosition().y;
|
||||
_myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale());
|
||||
_myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0));
|
||||
_myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f)));
|
||||
|
||||
// if the head would intersect the near clip plane, we must push the camera out
|
||||
glm::vec3 relativePosition = glm::inverse(_myCamera.getTargetRotation()) *
|
||||
(eyePosition - _myCamera.getTargetPosition());
|
||||
const float PUSHBACK_RADIUS = 0.2f;
|
||||
float pushback = relativePosition.z + _myCamera.getNearClip() +
|
||||
_myAvatar->getScale() * PUSHBACK_RADIUS - _myCamera.getDistance();
|
||||
if (pushback > 0.0f) {
|
||||
_myCamera.setTargetPosition(_myCamera.getTargetPosition() +
|
||||
_myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback));
|
||||
}
|
||||
}
|
||||
|
||||
// Update camera position
|
||||
|
@ -1209,8 +1222,6 @@ void Application::timer() {
|
|||
|
||||
// ask the node list to check in with the domain server
|
||||
NodeList::getInstance()->sendDomainServerCheckIn();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Application::idle() {
|
||||
|
@ -2511,20 +2522,19 @@ void Application::displayOverlay() {
|
|||
// Audio VU Meter and Mute Icon
|
||||
const int MUTE_ICON_SIZE = 24;
|
||||
const int AUDIO_METER_INSET = 2;
|
||||
const int AUDIO_METER_WIDTH = MIRROR_VIEW_WIDTH - MUTE_ICON_SIZE - AUDIO_METER_INSET;
|
||||
const int MUTE_ICON_PADDING = 10;
|
||||
const int AUDIO_METER_WIDTH = MIRROR_VIEW_WIDTH - MUTE_ICON_SIZE - AUDIO_METER_INSET - MUTE_ICON_PADDING;
|
||||
const int AUDIO_METER_SCALE_WIDTH = AUDIO_METER_WIDTH - 2 * AUDIO_METER_INSET;
|
||||
const int AUDIO_METER_HEIGHT = 8;
|
||||
const int AUDIO_METER_Y_GAP = 8;
|
||||
const int AUDIO_METER_X = MIRROR_VIEW_LEFT_PADDING + MUTE_ICON_SIZE + AUDIO_METER_INSET;
|
||||
const int AUDIO_METER_GAP = 5;
|
||||
const int AUDIO_METER_X = MIRROR_VIEW_LEFT_PADDING + MUTE_ICON_SIZE + AUDIO_METER_INSET + AUDIO_METER_GAP;
|
||||
|
||||
int audioMeterY;
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
||||
audioMeterY = MIRROR_VIEW_HEIGHT + AUDIO_METER_Y_GAP;
|
||||
audioMeterY = MIRROR_VIEW_HEIGHT + AUDIO_METER_GAP + MUTE_ICON_PADDING;
|
||||
} else {
|
||||
audioMeterY = AUDIO_METER_Y_GAP;
|
||||
audioMeterY = AUDIO_METER_GAP + MUTE_ICON_PADDING;
|
||||
}
|
||||
_audio.renderMuteIcon(MIRROR_VIEW_LEFT_PADDING, audioMeterY);
|
||||
|
||||
|
||||
const float AUDIO_METER_BLUE[] = {0.0, 0.0, 1.0};
|
||||
const float AUDIO_METER_GREEN[] = {0.0, 1.0, 0.0};
|
||||
|
@ -2553,18 +2563,27 @@ void Application::displayOverlay() {
|
|||
|
||||
bool isClipping = ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME));
|
||||
|
||||
_audio.renderToolBox(MIRROR_VIEW_LEFT_PADDING + AUDIO_METER_GAP,
|
||||
audioMeterY,
|
||||
Menu::getInstance()->isOptionChecked(MenuOption::Mirror));
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
if (isClipping) {
|
||||
glColor3f(1, 0, 0);
|
||||
} else {
|
||||
glColor3f(0, 0, 0);
|
||||
glColor3f(0.475f, 0.475f, 0.475f);
|
||||
}
|
||||
|
||||
audioMeterY += AUDIO_METER_HEIGHT;
|
||||
|
||||
glColor3f(0, 0, 0);
|
||||
// Draw audio meter background Quad
|
||||
glVertex2i(AUDIO_METER_X, audioMeterY);
|
||||
glVertex2i(AUDIO_METER_X + AUDIO_METER_WIDTH, audioMeterY);
|
||||
glVertex2i(AUDIO_METER_X + AUDIO_METER_WIDTH, audioMeterY + AUDIO_METER_HEIGHT);
|
||||
glVertex2i(AUDIO_METER_X, audioMeterY + AUDIO_METER_HEIGHT);
|
||||
|
||||
|
||||
if (audioLevel > AUDIO_RED_START) {
|
||||
if (!isClipping) {
|
||||
glColor3fv(AUDIO_METER_RED);
|
||||
|
@ -2604,6 +2623,7 @@ void Application::displayOverlay() {
|
|||
glVertex2i(AUDIO_METER_X + AUDIO_METER_INSET, audioMeterY + AUDIO_METER_HEIGHT - AUDIO_METER_INSET);
|
||||
glEnd();
|
||||
|
||||
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::HeadMouse)) {
|
||||
_myAvatar->renderHeadMouse();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,15 @@
|
|||
#include <CoreAudio/AudioHardware.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <Mmsystem.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <devicetopology.h>
|
||||
#include <Functiondiscoverykeys_devpkey.h>
|
||||
#endif
|
||||
|
||||
#include <QtCore/QBuffer>
|
||||
#include <QtMultimedia/QAudioInput>
|
||||
#include <QtMultimedia/QAudioOutput>
|
||||
|
@ -86,7 +95,8 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* p
|
|||
|
||||
void Audio::init(QGLWidget *parent) {
|
||||
_micTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mic.svg"));
|
||||
_muteTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mute.svg"));
|
||||
_muteTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mic-mute.svg"));
|
||||
_boxTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/audio-box.svg"));
|
||||
}
|
||||
|
||||
void Audio::reset() {
|
||||
|
@ -147,24 +157,56 @@ QAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
|||
#endif
|
||||
#ifdef WIN32
|
||||
QString deviceName;
|
||||
if (mode == QAudio::AudioInput) {
|
||||
WAVEINCAPS wic;
|
||||
// first use WAVE_MAPPER to get the default devices manufacturer ID
|
||||
waveInGetDevCaps(WAVE_MAPPER, &wic, sizeof(wic));
|
||||
//Use the received manufacturer id to get the device's real name
|
||||
waveInGetDevCaps(wic.wMid, &wic, sizeof(wic));
|
||||
qDebug() << "input device:" << wic.szPname;
|
||||
deviceName = wic.szPname;
|
||||
//Check for Windows Vista or higher, IMMDeviceEnumerator doesn't work below that.
|
||||
OSVERSIONINFO osvi;
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&osvi);
|
||||
const DWORD VISTA_MAJOR_VERSION = 6;
|
||||
if (osvi.dwMajorVersion < VISTA_MAJOR_VERSION) {// lower then vista
|
||||
if (mode == QAudio::AudioInput) {
|
||||
WAVEINCAPS wic;
|
||||
// first use WAVE_MAPPER to get the default devices manufacturer ID
|
||||
waveInGetDevCaps(WAVE_MAPPER, &wic, sizeof(wic));
|
||||
//Use the received manufacturer id to get the device's real name
|
||||
waveInGetDevCaps(wic.wMid, &wic, sizeof(wic));
|
||||
qDebug() << "input device:" << wic.szPname;
|
||||
deviceName = wic.szPname;
|
||||
} else {
|
||||
WAVEOUTCAPS woc;
|
||||
// first use WAVE_MAPPER to get the default devices manufacturer ID
|
||||
waveOutGetDevCaps(WAVE_MAPPER, &woc, sizeof(woc));
|
||||
//Use the received manufacturer id to get the device's real name
|
||||
waveOutGetDevCaps(woc.wMid, &woc, sizeof(woc));
|
||||
qDebug() << "output device:" << woc.szPname;
|
||||
deviceName = woc.szPname;
|
||||
}
|
||||
} else {
|
||||
WAVEOUTCAPS woc;
|
||||
// first use WAVE_MAPPER to get the default devices manufacturer ID
|
||||
waveOutGetDevCaps(WAVE_MAPPER, &woc, sizeof(woc));
|
||||
//Use the received manufacturer id to get the device's real name
|
||||
waveOutGetDevCaps(woc.wMid, &woc, sizeof(woc));
|
||||
qDebug() << "output device:" << woc.szPname;
|
||||
deviceName = woc.szPname;
|
||||
HRESULT hr = S_OK;
|
||||
CoInitialize(NULL);
|
||||
IMMDeviceEnumerator* pMMDeviceEnumerator = NULL;
|
||||
CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&pMMDeviceEnumerator);
|
||||
IMMDevice* pEndpoint;
|
||||
pMMDeviceEnumerator->GetDefaultAudioEndpoint(mode == QAudio::AudioOutput ? eRender : eCapture, eMultimedia, &pEndpoint);
|
||||
IPropertyStore* pPropertyStore;
|
||||
pEndpoint->OpenPropertyStore(STGM_READ, &pPropertyStore);
|
||||
pEndpoint->Release();
|
||||
pEndpoint = NULL;
|
||||
PROPVARIANT pv;
|
||||
PropVariantInit(&pv);
|
||||
hr = pPropertyStore->GetValue(PKEY_Device_FriendlyName, &pv);
|
||||
pPropertyStore->Release();
|
||||
pPropertyStore = NULL;
|
||||
//QAudio devices seems to only take the 31 first characters of the Friendly Device Name.
|
||||
const DWORD QT_WIN_MAX_AUDIO_DEVICENAME_LEN = 31;
|
||||
deviceName = QString::fromWCharArray((wchar_t*)pv.pwszVal).left(QT_WIN_MAX_AUDIO_DEVICENAME_LEN);
|
||||
qDebug() << (mode == QAudio::AudioOutput ? "output" : "input") << " device:" << deviceName;
|
||||
PropVariantClear(&pv);
|
||||
pMMDeviceEnumerator->Release();
|
||||
pMMDeviceEnumerator = NULL;
|
||||
CoUninitialize();
|
||||
}
|
||||
qDebug() << "DEBUG [" << deviceName << "] [" << getNamedAudioDeviceForMode(mode, deviceName).deviceName() << "]";
|
||||
qDebug() << "DEBUG [" << deviceName << "] [" << getNamedAudioDeviceForMode(mode, deviceName).deviceName() << "]";
|
||||
|
||||
return getNamedAudioDeviceForMode(mode, deviceName);
|
||||
#endif
|
||||
|
@ -817,13 +859,52 @@ void Audio::handleAudioByteArray(const QByteArray& audioByteArray) {
|
|||
// or send to the mixer and use delayed loopback
|
||||
}
|
||||
|
||||
void Audio::renderMuteIcon(int x, int y) {
|
||||
void Audio::renderToolBox(int x, int y, bool boxed) {
|
||||
|
||||
_iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, _micTextureId);
|
||||
glColor3f(.93f, .93f, .93f);
|
||||
if (boxed) {
|
||||
|
||||
bool isClipping = ((getTimeSinceLastClip() > 0.f) && (getTimeSinceLastClip() < 1.f));
|
||||
const int BOX_LEFT_PADDING = 5;
|
||||
const int BOX_TOP_PADDING = 10;
|
||||
const int BOX_WIDTH = 266;
|
||||
const int BOX_HEIGHT = 44;
|
||||
|
||||
QRect boxBounds = QRect(x - BOX_LEFT_PADDING, y - BOX_TOP_PADDING, BOX_WIDTH, BOX_HEIGHT);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, _boxTextureId);
|
||||
|
||||
if (isClipping) {
|
||||
glColor3f(1.f,0.f,0.f);
|
||||
} else {
|
||||
glColor3f(.41f,.41f,.41f);
|
||||
}
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
glTexCoord2f(1, 1);
|
||||
glVertex2f(boxBounds.left(), boxBounds.top());
|
||||
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2f(boxBounds.right(), boxBounds.top());
|
||||
|
||||
glTexCoord2f(0, 0);
|
||||
glVertex2f(boxBounds.right(), boxBounds.bottom());
|
||||
|
||||
glTexCoord2f(1, 0);
|
||||
glVertex2f(boxBounds.left(), boxBounds.bottom());
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
_iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE);
|
||||
if (!_muted) {
|
||||
glBindTexture(GL_TEXTURE_2D, _micTextureId);
|
||||
} else {
|
||||
glBindTexture(GL_TEXTURE_2D, _muteTextureId);
|
||||
}
|
||||
|
||||
glColor3f(1,1,1);
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
glTexCoord2f(1, 1);
|
||||
|
@ -840,25 +921,6 @@ void Audio::renderMuteIcon(int x, int y) {
|
|||
|
||||
glEnd();
|
||||
|
||||
if (_muted) {
|
||||
glBindTexture(GL_TEXTURE_2D, _muteTextureId);
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
glTexCoord2f(1, 1);
|
||||
glVertex2f(_iconBounds.left(), _iconBounds.top());
|
||||
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2f(_iconBounds.right(), _iconBounds.top());
|
||||
|
||||
glTexCoord2f(0, 0);
|
||||
glVertex2f(_iconBounds.right(), _iconBounds.bottom());
|
||||
|
||||
glTexCoord2f(1, 0);
|
||||
glVertex2f(_iconBounds.left(), _iconBounds.bottom());
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
void init(QGLWidget *parent = 0);
|
||||
bool mousePressEvent(int x, int y);
|
||||
|
||||
void renderMuteIcon(int x, int y);
|
||||
void renderToolBox(int x, int y, bool boxed);
|
||||
|
||||
int getNetworkSampleRate() { return SAMPLE_RATE; }
|
||||
int getNetworkBufferLengthSamplesPerChannel() { return NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL; }
|
||||
|
@ -161,6 +161,7 @@ private:
|
|||
bool _localEcho;
|
||||
GLuint _micTextureId;
|
||||
GLuint _muteTextureId;
|
||||
GLuint _boxTextureId;
|
||||
QRect _iconBounds;
|
||||
|
||||
// Audio callback in class context.
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
const glm::quat& getRotation() const { return _rotation; }
|
||||
CameraMode getMode() const { return _mode; }
|
||||
float getModeShiftPeriod() const { return _modeShiftPeriod; }
|
||||
float getDistance() const { return _distance; }
|
||||
const glm::vec3& getTargetPosition() const { return _targetPosition; }
|
||||
const glm::quat& getTargetRotation() const { return _targetRotation; }
|
||||
float getFieldOfView() const { return _fieldOfView; }
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
#include <QTextStream>
|
||||
#include <QVariant>
|
||||
|
||||
#include "AccountManager.h"
|
||||
#include <AccountManager.h>
|
||||
|
||||
#include "renderer/FBXReader.h"
|
||||
#include "ModelUploader.h"
|
||||
|
||||
|
||||
|
@ -59,11 +61,14 @@ bool ModelUploader::zip() {
|
|||
"Select your .fst file ...",
|
||||
QStandardPaths::writableLocation(QStandardPaths::HomeLocation),
|
||||
"*.fst");
|
||||
qDebug() << QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
if (filename == "") {
|
||||
// If the user canceled we return.
|
||||
return false;
|
||||
}
|
||||
bool _nameIsPresent = false;
|
||||
QString texDir;
|
||||
QString fbxFile;
|
||||
|
||||
|
||||
// First we check the FST file
|
||||
QFile fst(filename);
|
||||
|
@ -99,23 +104,26 @@ bool ModelUploader::zip() {
|
|||
textPart.setBody(line[1].toUtf8());
|
||||
_dataMultiPart->append(textPart);
|
||||
_url = S3_URL + ((_isHead)? "/models/heads/" : "/models/skeletons/") + line[1].toUtf8() + ".fst";
|
||||
_nameIsPresent = true;
|
||||
} else if (line[0] == FILENAME_FIELD) {
|
||||
QFileInfo fbx(QFileInfo(fst).path() + "/" + line[1]);
|
||||
if (!fbx.exists() || !fbx.isFile()) { // Check existence
|
||||
fbxFile = QFileInfo(fst).path() + "/" + line[1];
|
||||
QFileInfo fbxInfo(fbxFile);
|
||||
if (!fbxInfo.exists() || !fbxInfo.isFile()) { // Check existence
|
||||
QMessageBox::warning(NULL,
|
||||
QString("ModelUploader::zip()"),
|
||||
QString("FBX file %1 could not be found.").arg(fbx.fileName()),
|
||||
QString("FBX file %1 could not be found.").arg(fbxInfo.fileName()),
|
||||
QMessageBox::Ok);
|
||||
qDebug() << "[Warning] " << QString("FBX file %1 could not be found.").arg(fbx.fileName());
|
||||
qDebug() << "[Warning] " << QString("FBX file %1 could not be found.").arg(fbxInfo.fileName());
|
||||
return false;
|
||||
}
|
||||
// Compress and copy
|
||||
if (!addPart(fbx.filePath(), "fbx")) {
|
||||
if (!addPart(fbxInfo.filePath(), "fbx")) {
|
||||
return false;
|
||||
}
|
||||
} else if (line[0] == TEXDIR_FIELD) { // Check existence
|
||||
QFileInfo texdir(QFileInfo(fst).path() + "/" + line[1]);
|
||||
if (!texdir.exists() || !texdir.isDir()) {
|
||||
texDir = QFileInfo(fst).path() + "/" + line[1];
|
||||
QFileInfo texInfo(texDir);
|
||||
if (!texInfo.exists() || !texInfo.isDir()) {
|
||||
QMessageBox::warning(NULL,
|
||||
QString("ModelUploader::zip()"),
|
||||
QString("Texture directory could not be found."),
|
||||
|
@ -123,18 +131,14 @@ bool ModelUploader::zip() {
|
|||
qDebug() << "[Warning] " << QString("Texture directory could not be found.");
|
||||
return false;
|
||||
}
|
||||
if (!addTextures(texdir)) { // Recursive compress and copy
|
||||
return false;
|
||||
}
|
||||
} else if (line[0] == LOD_FIELD) {
|
||||
QFileInfo lod(QFileInfo(fst).path() + "/" + line[1]);
|
||||
if (!lod.exists() || !lod.isFile()) { // Check existence
|
||||
QMessageBox::warning(NULL,
|
||||
QString("ModelUploader::zip()"),
|
||||
QString("FBX file %1 could not be found.").arg(lod.fileName()),
|
||||
QString("LOD file %1 could not be found.").arg(lod.fileName()),
|
||||
QMessageBox::Ok);
|
||||
qDebug() << "[Warning] " << QString("FBX file %1 could not be found.").arg(lod.fileName());
|
||||
return false;
|
||||
}
|
||||
// Compress and copy
|
||||
if (!addPart(lod.filePath(), QString("lod%1").arg(++_lodCount))) {
|
||||
|
@ -143,6 +147,10 @@ bool ModelUploader::zip() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!addTextures(texDir, fbxFile)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QHttpPart textPart;
|
||||
textPart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data;"
|
||||
" name=\"model_category\"");
|
||||
|
@ -153,12 +161,22 @@ bool ModelUploader::zip() {
|
|||
}
|
||||
_dataMultiPart->append(textPart);
|
||||
|
||||
if (!_nameIsPresent) {
|
||||
QMessageBox::warning(NULL,
|
||||
QString("ModelUploader::zip()"),
|
||||
QString("Model name is missing in the .fst file."),
|
||||
QMessageBox::Ok);
|
||||
qDebug() << "[Warning] " << QString("Model name is missing in the .fst file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
_readyToSend = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ModelUploader::send() {
|
||||
if (!zip()) {
|
||||
deleteLater();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -202,7 +220,7 @@ void ModelUploader::uploadSuccess(const QJsonObject& jsonResponse) {
|
|||
}
|
||||
QMessageBox::information(NULL,
|
||||
QString("ModelUploader::uploadSuccess()"),
|
||||
QString("Your model is being processed by the system."),
|
||||
QString("We are reading your model information."),
|
||||
QMessageBox::Ok);
|
||||
qDebug() << "Model sent with success";
|
||||
checkS3();
|
||||
|
@ -214,7 +232,7 @@ void ModelUploader::uploadFailed(QNetworkReply::NetworkError errorCode, const QS
|
|||
}
|
||||
QMessageBox::warning(NULL,
|
||||
QString("ModelUploader::uploadFailed()"),
|
||||
QString("Model could not be sent to the data server."),
|
||||
QString("There was a problem with your upload, please try again later."),
|
||||
QMessageBox::Ok);
|
||||
qDebug() << "Model upload failed (" << errorCode << "): " << errorString;
|
||||
deleteLater();
|
||||
|
@ -247,7 +265,8 @@ void ModelUploader::processCheck() {
|
|||
default:
|
||||
QMessageBox::warning(NULL,
|
||||
QString("ModelUploader::processCheck()"),
|
||||
QString("Could not verify that the model is present on the server."),
|
||||
QString("We could not verify that your model was sent sucessfully\n"
|
||||
"but it may have. If you do not see it in the model browser, try to upload again."),
|
||||
QMessageBox::Ok);
|
||||
deleteLater();
|
||||
break;
|
||||
|
@ -256,24 +275,29 @@ void ModelUploader::processCheck() {
|
|||
delete reply;
|
||||
}
|
||||
|
||||
bool ModelUploader::addTextures(const QFileInfo& texdir) {
|
||||
QStringList filter;
|
||||
filter << "*.png" << "*.tif" << "*.jpg" << "*.jpeg";
|
||||
bool ModelUploader::addTextures(const QString& texdir, const QString fbxFile) {
|
||||
QFile fbx(fbxFile);
|
||||
if (!fbx.open(QIODevice::ReadOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QFileInfoList list = QDir(texdir.filePath()).entryInfoList(filter,
|
||||
QDir::Files |
|
||||
QDir::AllDirs |
|
||||
QDir::NoDotAndDotDot |
|
||||
QDir::NoSymLinks);
|
||||
foreach (QFileInfo info, list) {
|
||||
if (info.isFile()) {
|
||||
// Compress and copy
|
||||
if (!addPart(info.filePath(), QString("texture%1").arg(++_texturesCount))) {
|
||||
return false;
|
||||
QByteArray buffer = fbx.readAll();
|
||||
QVariantHash variantHash = readMapping(buffer);
|
||||
FBXGeometry geometry = readFBX(buffer, variantHash);
|
||||
|
||||
foreach (FBXMesh mesh, geometry.meshes) {
|
||||
foreach (FBXMeshPart part, mesh.parts) {
|
||||
if (!part.diffuseFilename.isEmpty()) {
|
||||
if (!addPart(QFileInfo(fbxFile).path() + "/" + part.diffuseFilename,
|
||||
QString("texture%1").arg(++_texturesCount))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (info.isDir()) {
|
||||
if (!addTextures(info)) {
|
||||
return false;
|
||||
if (!part.normalFilename.isEmpty()) {
|
||||
if (!addPart(QFileInfo(fbxFile).path() + "/" + part.normalFilename,
|
||||
QString("texture%1").arg(++_texturesCount))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,8 +17,6 @@ class QFileInfo;
|
|||
class QHttpMultiPart;
|
||||
class QProgressBar;
|
||||
|
||||
class TemporaryDir;
|
||||
|
||||
class ModelUploader : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -55,7 +53,7 @@ private:
|
|||
|
||||
|
||||
bool zip();
|
||||
bool addTextures(const QFileInfo& texdir);
|
||||
bool addTextures(const QString& texdir, const QString fbxFile);
|
||||
bool addPart(const QString& path, const QString& name);
|
||||
};
|
||||
|
|
@ -123,8 +123,8 @@ void AvatarManager::renderAvatarFades(const glm::vec3& cameraPosition, Avatar::R
|
|||
}
|
||||
}
|
||||
|
||||
AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& nodeUUID, const QWeakPointer<Node>& mixerWeakPointer) {
|
||||
AvatarSharedPointer matchingAvatar = _avatarHash.value(nodeUUID);
|
||||
AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& sessionUUID, const QWeakPointer<Node>& mixerWeakPointer) {
|
||||
AvatarSharedPointer matchingAvatar = _avatarHash.value(sessionUUID);
|
||||
|
||||
if (!matchingAvatar) {
|
||||
// construct a new Avatar for this node
|
||||
|
@ -133,9 +133,9 @@ AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& nodeUUID, co
|
|||
|
||||
// insert the new avatar into our hash
|
||||
matchingAvatar = AvatarSharedPointer(avatar);
|
||||
_avatarHash.insert(nodeUUID, matchingAvatar);
|
||||
_avatarHash.insert(sessionUUID, matchingAvatar);
|
||||
|
||||
qDebug() << "Adding avatar with UUID" << nodeUUID << "to AvatarManager hash.";
|
||||
qDebug() << "Adding avatar with sessionUUID " << sessionUUID << "to AvatarManager hash.";
|
||||
}
|
||||
|
||||
return matchingAvatar;
|
||||
|
@ -166,10 +166,10 @@ void AvatarManager::processAvatarDataPacket(const QByteArray &datagram, const QW
|
|||
// enumerate over all of the avatars in this packet
|
||||
// only add them if mixerWeakPointer points to something (meaning that mixer is still around)
|
||||
while (bytesRead < datagram.size() && mixerWeakPointer.data()) {
|
||||
QUuid nodeUUID = QUuid::fromRfc4122(datagram.mid(bytesRead, NUM_BYTES_RFC4122_UUID));
|
||||
QUuid sessionUUID = QUuid::fromRfc4122(datagram.mid(bytesRead, NUM_BYTES_RFC4122_UUID));
|
||||
bytesRead += NUM_BYTES_RFC4122_UUID;
|
||||
|
||||
AvatarSharedPointer matchingAvatarData = matchingOrNewAvatar(nodeUUID, mixerWeakPointer);
|
||||
AvatarSharedPointer matchingAvatarData = matchingOrNewAvatar(sessionUUID, mixerWeakPointer);
|
||||
|
||||
// have the matching (or new) avatar parse the data from the packet
|
||||
bytesRead += matchingAvatarData->parseDataAtOffset(datagram, bytesRead);
|
||||
|
@ -188,16 +188,16 @@ void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet, const
|
|||
QDataStream identityStream(packet);
|
||||
identityStream.skipRawData(numBytesForPacketHeader(packet));
|
||||
|
||||
QUuid nodeUUID;
|
||||
QUuid sessionUUID;
|
||||
|
||||
while (!identityStream.atEnd()) {
|
||||
|
||||
QUrl faceMeshURL, skeletonURL;
|
||||
QString displayName;
|
||||
identityStream >> nodeUUID >> faceMeshURL >> skeletonURL >> displayName;
|
||||
identityStream >> sessionUUID >> faceMeshURL >> skeletonURL >> displayName;
|
||||
|
||||
// mesh URL for a UUID, find avatar in our list
|
||||
AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(nodeUUID, mixerWeakPointer);
|
||||
AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionUUID, mixerWeakPointer);
|
||||
if (matchingAvatar) {
|
||||
Avatar* avatar = static_cast<Avatar*>(matchingAvatar.data());
|
||||
|
||||
|
@ -218,9 +218,9 @@ void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet, const
|
|||
|
||||
void AvatarManager::processAvatarBillboardPacket(const QByteArray& packet, const QWeakPointer<Node>& mixerWeakPointer) {
|
||||
int headerSize = numBytesForPacketHeader(packet);
|
||||
QUuid nodeUUID = QUuid::fromRfc4122(QByteArray::fromRawData(packet.constData() + headerSize, NUM_BYTES_RFC4122_UUID));
|
||||
QUuid sessionUUID = QUuid::fromRfc4122(QByteArray::fromRawData(packet.constData() + headerSize, NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(nodeUUID, mixerWeakPointer);
|
||||
AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionUUID, mixerWeakPointer);
|
||||
if (matchingAvatar) {
|
||||
Avatar* avatar = static_cast<Avatar*>(matchingAvatar.data());
|
||||
QByteArray billboard = packet.mid(headerSize + NUM_BYTES_RFC4122_UUID);
|
||||
|
@ -232,10 +232,10 @@ void AvatarManager::processAvatarBillboardPacket(const QByteArray& packet, const
|
|||
|
||||
void AvatarManager::processKillAvatar(const QByteArray& datagram) {
|
||||
// read the node id
|
||||
QUuid nodeUUID = QUuid::fromRfc4122(datagram.mid(numBytesForPacketHeader(datagram), NUM_BYTES_RFC4122_UUID));
|
||||
QUuid sessionUUID = QUuid::fromRfc4122(datagram.mid(numBytesForPacketHeader(datagram), NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
// remove the avatar with that UUID from our hash, if it exists
|
||||
AvatarHash::iterator matchedAvatar = _avatarHash.find(nodeUUID);
|
||||
AvatarHash::iterator matchedAvatar = _avatarHash.find(sessionUUID);
|
||||
if (matchedAvatar != _avatarHash.end()) {
|
||||
erase(matchedAvatar);
|
||||
}
|
||||
|
|
|
@ -18,9 +18,8 @@
|
|||
|
||||
const char SETTINGS_GROUP_NAME[] = "Rear View Tools";
|
||||
const char ZOOM_LEVEL_SETTINGS[] = "ZoomLevel";
|
||||
const int ICON_SIZE = 20;
|
||||
const int ICON_SIZE = 24;
|
||||
const int ICON_PADDING = 5;
|
||||
const int MID_ICON_PADDING = 70;
|
||||
|
||||
RearMirrorTools::RearMirrorTools(QGLWidget* parent, QRect& bounds, QSettings* settings) :
|
||||
_parent(parent),
|
||||
|
@ -29,16 +28,19 @@ RearMirrorTools::RearMirrorTools(QGLWidget* parent, QRect& bounds, QSettings* se
|
|||
_fullScreen(false)
|
||||
{
|
||||
_zoomLevel = HEAD;
|
||||
_closeTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/close.png"));
|
||||
_resetTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/reset.png"));
|
||||
_zoomHeadTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/head.png"));
|
||||
_zoomBodyTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/body.png"));
|
||||
_closeTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/close.svg"));
|
||||
|
||||
// Disabled for now https://worklist.net/19548
|
||||
// _resetTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/reset.png"));
|
||||
|
||||
_zoomHeadTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/plus.svg"));
|
||||
_zoomBodyTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/minus.svg"));
|
||||
|
||||
_shrinkIconRect = QRect(ICON_PADDING, ICON_PADDING, ICON_SIZE, ICON_SIZE);
|
||||
_closeIconRect = QRect(_bounds.left() + ICON_PADDING, _bounds.top() + ICON_PADDING, ICON_SIZE, ICON_SIZE);
|
||||
_resetIconRect = QRect(_bounds.width() - ICON_SIZE - ICON_PADDING, _bounds.top() + ICON_PADDING, ICON_SIZE, ICON_SIZE);
|
||||
_bodyZoomIconRect = QRect(_bounds.width() - MID_ICON_PADDING - ICON_SIZE, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE);
|
||||
_headZoomIconRect = QRect(_bounds.left() + MID_ICON_PADDING, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE);
|
||||
_bodyZoomIconRect = QRect(_bounds.width() - ICON_SIZE - ICON_PADDING, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE);
|
||||
_headZoomIconRect = QRect(_bounds.left() + ICON_PADDING, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE);
|
||||
|
||||
settings->beginGroup(SETTINGS_GROUP_NAME);
|
||||
_zoomLevel = loadSetting(settings, ZOOM_LEVEL_SETTINGS, 0) == HEAD ? HEAD : BODY;
|
||||
|
@ -55,7 +57,10 @@ void RearMirrorTools::render(bool fullScreen) {
|
|||
_windowed = _bounds.contains(mousePosition.x(), mousePosition.y());
|
||||
if (_windowed) {
|
||||
displayIcon(_bounds, _closeIconRect, _closeTextureId);
|
||||
displayIcon(_bounds, _resetIconRect, _resetTextureId);
|
||||
|
||||
// Disabled for now https://worklist.net/19548
|
||||
// displayIcon(_bounds, _resetIconRect, _resetTextureId);
|
||||
|
||||
displayIcon(_bounds, _headZoomIconRect, _zoomHeadTextureId, _zoomLevel == HEAD);
|
||||
displayIcon(_bounds, _bodyZoomIconRect, _zoomBodyTextureId, _zoomLevel == BODY);
|
||||
}
|
||||
|
@ -69,11 +74,13 @@ bool RearMirrorTools::mousePressEvent(int x, int y) {
|
|||
emit closeView();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Disabled for now https://worklist.net/19548
|
||||
if (_resetIconRect.contains(x, y)) {
|
||||
emit resetView();
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
if (_headZoomIconRect.contains(x, y)) {
|
||||
_zoomLevel = HEAD;
|
||||
|
@ -84,7 +91,7 @@ bool RearMirrorTools::mousePressEvent(int x, int y) {
|
|||
_zoomLevel = BODY;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (_bounds.contains(x, y)) {
|
||||
_windowed = false;
|
||||
emit restoreView();
|
||||
|
@ -120,7 +127,7 @@ void RearMirrorTools::displayIcon(QRect bounds, QRect iconBounds, GLuint texture
|
|||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
if (selected) {
|
||||
glColor3f(1, 1, 0);
|
||||
glColor3f(.5f, .5f, .5f);
|
||||
} else {
|
||||
glColor3f(1, 1, 1);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ using namespace std;
|
|||
QNetworkAccessManager* AvatarData::networkAccessManager = NULL;
|
||||
|
||||
AvatarData::AvatarData() :
|
||||
_sessionUUID(),
|
||||
_handPosition(0,0,0),
|
||||
_bodyYaw(-90.f),
|
||||
_bodyPitch(0.0f),
|
||||
|
|
|
@ -37,6 +37,7 @@ typedef unsigned long long quint64;
|
|||
#include <QtCore/QVector>
|
||||
#include <QtCore/QVariantMap>
|
||||
#include <QRect>
|
||||
#include <QUuid>
|
||||
|
||||
#include <CollisionInfo.h>
|
||||
#include <RegisteredMetaTypes.h>
|
||||
|
@ -94,10 +95,14 @@ class AvatarData : public QObject {
|
|||
Q_PROPERTY(QString faceModelURL READ getFaceModelURLFromScript WRITE setFaceModelURLFromScript)
|
||||
Q_PROPERTY(QString skeletonModelURL READ getSkeletonModelURLFromScript WRITE setSkeletonModelURLFromScript)
|
||||
Q_PROPERTY(QString billboardURL READ getBillboardURL WRITE setBillboardFromURL)
|
||||
|
||||
Q_PROPERTY(QUuid sessionUUID READ getSessionUUID);
|
||||
public:
|
||||
AvatarData();
|
||||
virtual ~AvatarData();
|
||||
|
||||
const QUuid& getSessionUUID() { return _sessionUUID; }
|
||||
|
||||
const glm::vec3& getPosition() const { return _position; }
|
||||
void setPosition(const glm::vec3 position) { _position = position; }
|
||||
|
||||
|
@ -219,7 +224,9 @@ public slots:
|
|||
void sendBillboardPacket();
|
||||
void setBillboardFromNetworkReply();
|
||||
void setJointMappingsFromNetworkReply();
|
||||
void setSessionUUID(const QUuid& id) { _sessionUUID = id; }
|
||||
protected:
|
||||
QUuid _sessionUUID;
|
||||
glm::vec3 _position;
|
||||
glm::vec3 _handPosition;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ AvatarHashMap::AvatarHashMap() :
|
|||
|
||||
void AvatarHashMap::insert(const QUuid& id, AvatarSharedPointer avatar) {
|
||||
_avatarHash.insert(id, avatar);
|
||||
avatar->setSessionUUID(id);
|
||||
}
|
||||
|
||||
AvatarHash::iterator AvatarHashMap::erase(const AvatarHash::iterator& iterator) {
|
||||
|
|
|
@ -60,7 +60,8 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam
|
|||
_scriptName(),
|
||||
_fileNameString(fileNameString),
|
||||
_quatLibrary(),
|
||||
_vec3Library()
|
||||
_vec3Library(),
|
||||
_uuidLibrary()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -83,7 +84,8 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL,
|
|||
_scriptName(),
|
||||
_fileNameString(),
|
||||
_quatLibrary(),
|
||||
_vec3Library()
|
||||
_vec3Library(),
|
||||
_uuidLibrary()
|
||||
{
|
||||
QString scriptURLString = scriptURL.toString();
|
||||
_fileNameString = scriptURLString;
|
||||
|
@ -197,6 +199,7 @@ void ScriptEngine::init() {
|
|||
registerGlobalObject("Particles", &_particlesScriptingInterface);
|
||||
registerGlobalObject("Quat", &_quatLibrary);
|
||||
registerGlobalObject("Vec3", &_vec3Library);
|
||||
registerGlobalObject("Uuid", &_uuidLibrary);
|
||||
|
||||
registerGlobalObject("Voxels", &_voxelsScriptingInterface);
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "AbstractControllerScriptingInterface.h"
|
||||
#include "Quat.h"
|
||||
#include "ScriptUUID.h"
|
||||
#include "Vec3.h"
|
||||
|
||||
class ParticlesScriptingInterface;
|
||||
|
@ -121,6 +122,7 @@ private:
|
|||
QString _fileNameString;
|
||||
Quat _quatLibrary;
|
||||
Vec3 _vec3Library;
|
||||
ScriptUUID _uuidLibrary;
|
||||
};
|
||||
|
||||
#endif /* defined(__hifi__ScriptEngine__) */
|
||||
|
|
40
libraries/script-engine/src/ScriptUUID.cpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// ScriptUUID.cpp
|
||||
// libraries/script-engine/src/
|
||||
//
|
||||
// Created by Andrew Meadows on 2014-04-07
|
||||
// Copyright (c) 2014 High Fidelity, Inc. All rights reserved.
|
||||
//
|
||||
// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "ScriptUUID.h"
|
||||
|
||||
QUuid ScriptUUID::fromString(const QString& s) {
|
||||
return QUuid(s);
|
||||
}
|
||||
|
||||
QString ScriptUUID::toString(const QUuid& id) {
|
||||
return id.toString();
|
||||
}
|
||||
|
||||
QUuid ScriptUUID::generate() {
|
||||
return QUuid::createUuid();
|
||||
}
|
||||
|
||||
bool ScriptUUID::isEqual(const QUuid& idA, const QUuid& idB) {
|
||||
return idA == idB;
|
||||
}
|
||||
|
||||
bool ScriptUUID::isNull(const QUuid& id) {
|
||||
return id.isNull();
|
||||
}
|
||||
|
||||
void ScriptUUID::print(const QString& lable, const QUuid& id) {
|
||||
qDebug() << qPrintable(lable) << id.toString();
|
||||
}
|
32
libraries/script-engine/src/ScriptUUID.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// ScriptUUID.h
|
||||
// libraries/script-engine/src/
|
||||
//
|
||||
// Created by Andrew Meadows on 2014-04-07
|
||||
// Copyright (c) 2014 High Fidelity, Inc. All rights reserved.
|
||||
//
|
||||
// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef hifi_ScriptUUID_h
|
||||
#define hifi_ScriptUUID_h
|
||||
|
||||
#include <QUuid>
|
||||
|
||||
/// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API
|
||||
class ScriptUUID : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
QUuid fromString(const QString& string);
|
||||
QString toString(const QUuid& id);
|
||||
QUuid generate();
|
||||
bool isEqual(const QUuid& idA, const QUuid& idB);
|
||||
bool isNull(const QUuid& id);
|
||||
void print(const QString& lable, const QUuid& id);
|
||||
};
|
||||
|
||||
#endif // hifi_ScriptUUID_h
|
|
@ -143,13 +143,15 @@ void generateOutput (QTextStream& out, const QList<Streamable>& streamables) {
|
|||
out << " }\n";
|
||||
out << " index = nextIndex;\n";
|
||||
}
|
||||
out << " switch (index) {\n";
|
||||
for (int i = 0; i < str.fields.size(); i++) {
|
||||
out << " case " << i << ":\n";
|
||||
out << " this->" << str.fields.at(i).name << " = value.value<" << str.fields.at(i).type << ">();\n";
|
||||
out << " break;\n";
|
||||
if (!str.fields.isEmpty()) {
|
||||
out << " switch (index) {\n";
|
||||
for (int i = 0; i < str.fields.size(); i++) {
|
||||
out << " case " << i << ":\n";
|
||||
out << " this->" << str.fields.at(i).name << " = value.value<" << str.fields.at(i).type << ">();\n";
|
||||
out << " break;\n";
|
||||
}
|
||||
out << " }\n";
|
||||
}
|
||||
out << " }\n";
|
||||
out << "}\n";
|
||||
|
||||
out << "QVariant " << name << "::getField(int index) const {\n";
|
||||
|
@ -162,12 +164,14 @@ void generateOutput (QTextStream& out, const QList<Streamable>& streamables) {
|
|||
out << " }\n";
|
||||
out << " index = nextIndex;\n";
|
||||
}
|
||||
out << " switch (index) {\n";
|
||||
for (int i = 0; i < str.fields.size(); i++) {
|
||||
out << " case " << i << ":\n";
|
||||
out << " return QVariant::fromValue(this->" << str.fields.at(i).name << ");\n";
|
||||
if (!str.fields.isEmpty()) {
|
||||
out << " switch (index) {\n";
|
||||
for (int i = 0; i < str.fields.size(); i++) {
|
||||
out << " case " << i << ":\n";
|
||||
out << " return QVariant::fromValue(this->" << str.fields.at(i).name << ");\n";
|
||||
}
|
||||
out << " }\n";
|
||||
}
|
||||
out << " }\n";
|
||||
out << " return QVariant();\n";
|
||||
out << "}\n";
|
||||
|
||||
|
|