From 8f1ce6e1fb0260bf179c20923ef6d91d366ee383 Mon Sep 17 00:00:00 2001 From: AlessandroSigna Date: Mon, 23 Nov 2015 14:42:16 -0800 Subject: [PATCH 1/4] overlay added - waiting for official logos missing null assignment --- .../entityScripts/recordingEntityScript.js | 20 +++++++++++++++++++ examples/entityScripts/recordingMaster.js | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/examples/entityScripts/recordingEntityScript.js b/examples/entityScripts/recordingEntityScript.js index 132b064997..e1e161a79d 100644 --- a/examples/entityScripts/recordingEntityScript.js +++ b/examples/entityScripts/recordingEntityScript.js @@ -21,6 +21,10 @@ var START_MESSAGE = "recordingStarted"; var STOP_MESSAGE = "recordingEnded"; var PARTICIPATING_MESSAGE = "participatingToRecording"; + var ICON_WIDTH = 60; + var ICON_HEIGHT = 60; + var overlay = null; + function recordingEntity() { _this = this; @@ -60,12 +64,22 @@ enterEntity: function (entityID) { print("entering in the recording area"); Messages.subscribe(MASTER_TO_CLIENTS_CHANNEL); + overlay = Overlays.addOverlay("image", { + imageURL: "http://wcdn2.dataknet.com/static/resources/icons/set49/1c828b8c.png", //waiting for the official logo + width: ICON_HEIGHT, + height: ICON_WIDTH, + x: 600, + y: 0, + visible: true + }); }, leaveEntity: function (entityID) { print("leaving the recording area"); _this.stopRecording(); Messages.unsubscribe(MASTER_TO_CLIENTS_CHANNEL); + Overlays.deleteOverlay(overlay); + overlay = null; }, startRecording: function (entityID) { @@ -74,6 +88,7 @@ Messages.sendMessage(CLIENTS_TO_MASTER_CHANNEL, PARTICIPATING_MESSAGE); //tell to master that I'm participating Recording.startRecording(); isAvatarRecording = true; + Overlays.editOverlay(overlay, {imageURL: "http://www.polyrythmic.org/picts/REC.png"}); //waiting for the official logo } }, @@ -88,6 +103,7 @@ Recording.saveRecording(recordingFile); //save the clip locally } Recording.saveRecordingToAsset(getClipUrl); //save the clip to the asset and link a callback to get its url + Overlays.editOverlay(overlay, {imageURL: "http://wcdn2.dataknet.com/static/resources/icons/set49/1c828b8c.png"}); //waiting for the official logo } }, @@ -96,6 +112,10 @@ _this.stopRecording(); Messages.unsubscribe(MASTER_TO_CLIENTS_CHANNEL); Messages.messageReceived.disconnect(receivingMessage); + if(overlay !== null){ + Overlays.deleteOverlay(overlay); + overlay = null; + } } } diff --git a/examples/entityScripts/recordingMaster.js b/examples/entityScripts/recordingMaster.js index 732521cff7..1eb10d9bf2 100644 --- a/examples/entityScripts/recordingMaster.js +++ b/examples/entityScripts/recordingMaster.js @@ -97,10 +97,12 @@ function update(deltaTime) { if (waitingForPerformanceFile) { totalWaitingTime += deltaTime; if (totalWaitingTime > TIMEOUT || performanceJSON.avatarClips.length === responsesExpected) { - print("UPLOADING PERFORMANCE FILE"); if (performanceJSON.avatarClips.length !== 0) { + print("UPLOADING PERFORMANCE FILE"); //I can upload the performance file on the asset Assets.uploadData(JSON.stringify(performanceJSON), extension, uploadFinished); + } else { + print("PERFORMANCE FILE EMPTY"); } //clean things after upload performance file to asset waitingForPerformanceFile = false; From 44c95c13fb32da97d61c01eb524186da5b40cfa2 Mon Sep 17 00:00:00 2001 From: AlessandroSigna Date: Mon, 23 Nov 2015 16:57:24 -0800 Subject: [PATCH 2/4] further UI fixes --- examples/entityScripts/recordingEntityScript.js | 9 ++++++--- examples/entityScripts/recordingMaster.js | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/entityScripts/recordingEntityScript.js b/examples/entityScripts/recordingEntityScript.js index e1e161a79d..8916072e39 100644 --- a/examples/entityScripts/recordingEntityScript.js +++ b/examples/entityScripts/recordingEntityScript.js @@ -21,6 +21,9 @@ var START_MESSAGE = "recordingStarted"; var STOP_MESSAGE = "recordingEnded"; var PARTICIPATING_MESSAGE = "participatingToRecording"; + var HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; + var RECORDING_ICON_URL = HIFI_PUBLIC_BUCKET + "images/tools/play.svg"; + var NOT_RECORDING_ICON_URL = HIFI_PUBLIC_BUCKET + "images/tools/ac-on-off.svg"; var ICON_WIDTH = 60; var ICON_HEIGHT = 60; var overlay = null; @@ -65,7 +68,7 @@ print("entering in the recording area"); Messages.subscribe(MASTER_TO_CLIENTS_CHANNEL); overlay = Overlays.addOverlay("image", { - imageURL: "http://wcdn2.dataknet.com/static/resources/icons/set49/1c828b8c.png", //waiting for the official logo + imageURL: NOT_RECORDING_ICON_URL, //waiting for the official logo width: ICON_HEIGHT, height: ICON_WIDTH, x: 600, @@ -88,7 +91,7 @@ Messages.sendMessage(CLIENTS_TO_MASTER_CHANNEL, PARTICIPATING_MESSAGE); //tell to master that I'm participating Recording.startRecording(); isAvatarRecording = true; - Overlays.editOverlay(overlay, {imageURL: "http://www.polyrythmic.org/picts/REC.png"}); //waiting for the official logo + Overlays.editOverlay(overlay, {imageURL: RECORDING_ICON_URL}); //waiting for the official logo } }, @@ -103,7 +106,7 @@ Recording.saveRecording(recordingFile); //save the clip locally } Recording.saveRecordingToAsset(getClipUrl); //save the clip to the asset and link a callback to get its url - Overlays.editOverlay(overlay, {imageURL: "http://wcdn2.dataknet.com/static/resources/icons/set49/1c828b8c.png"}); //waiting for the official logo + Overlays.editOverlay(overlay, {imageURL: NOT_RECORDING_ICON_URL}); //waiting for the official logo } }, diff --git a/examples/entityScripts/recordingMaster.js b/examples/entityScripts/recordingMaster.js index 1eb10d9bf2..51149991c2 100644 --- a/examples/entityScripts/recordingMaster.js +++ b/examples/entityScripts/recordingMaster.js @@ -62,6 +62,7 @@ function setupToolBar() { visible: true, }, true, isRecording); } +toolBar.selectTool(recordIcon, !isRecording); function mousePressEvent(event) { clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y }); @@ -77,6 +78,7 @@ function mousePressEvent(event) { Messages.sendMessage(MASTER_TO_CLIENTS_CHANNEL, STOP_MESSAGE); isRecording = false; } + toolBar.selectTool(recordIcon, !isRecording); } } From 489cde7269c8abbc16f2280d90120e65637e17d2 Mon Sep 17 00:00:00 2001 From: AlessandroSigna Date: Mon, 23 Nov 2015 17:51:58 -0800 Subject: [PATCH 3/4] removed the local save of the recording --- .../entityScripts/recordingEntityScript.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/examples/entityScripts/recordingEntityScript.js b/examples/entityScripts/recordingEntityScript.js index 8916072e39..a566bf96fc 100644 --- a/examples/entityScripts/recordingEntityScript.js +++ b/examples/entityScripts/recordingEntityScript.js @@ -21,9 +21,8 @@ var START_MESSAGE = "recordingStarted"; var STOP_MESSAGE = "recordingEnded"; var PARTICIPATING_MESSAGE = "participatingToRecording"; - var HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; - var RECORDING_ICON_URL = HIFI_PUBLIC_BUCKET + "images/tools/play.svg"; - var NOT_RECORDING_ICON_URL = HIFI_PUBLIC_BUCKET + "images/tools/ac-on-off.svg"; + var RECORDING_ICON_URL = "http://cdn.highfidelity.com/alan/production/icons/ICO_rec-active.svg"; + var NOT_RECORDING_ICON_URL = "http://cdn.highfidelity.com/alan/production/icons/ICO_rec-inactive.svg"; var ICON_WIDTH = 60; var ICON_HEIGHT = 60; var overlay = null; @@ -68,10 +67,10 @@ print("entering in the recording area"); Messages.subscribe(MASTER_TO_CLIENTS_CHANNEL); overlay = Overlays.addOverlay("image", { - imageURL: NOT_RECORDING_ICON_URL, //waiting for the official logo + imageURL: NOT_RECORDING_ICON_URL, width: ICON_HEIGHT, height: ICON_WIDTH, - x: 600, + x: 210, y: 0, visible: true }); @@ -91,7 +90,7 @@ Messages.sendMessage(CLIENTS_TO_MASTER_CHANNEL, PARTICIPATING_MESSAGE); //tell to master that I'm participating Recording.startRecording(); isAvatarRecording = true; - Overlays.editOverlay(overlay, {imageURL: RECORDING_ICON_URL}); //waiting for the official logo + Overlays.editOverlay(overlay, {imageURL: RECORDING_ICON_URL}); } }, @@ -100,13 +99,8 @@ print("RECORDING ENDED"); Recording.stopRecording(); isAvatarRecording = false; - - var recordingFile = Window.save("Save recording to file", "./groupRecording", "Recordings (*.hfr)"); - if (!(recordingFile === "null" || recordingFile === null || recordingFile === "")) { - Recording.saveRecording(recordingFile); //save the clip locally - } Recording.saveRecordingToAsset(getClipUrl); //save the clip to the asset and link a callback to get its url - Overlays.editOverlay(overlay, {imageURL: NOT_RECORDING_ICON_URL}); //waiting for the official logo + Overlays.editOverlay(overlay, {imageURL: NOT_RECORDING_ICON_URL}); } }, From 70cf5c672608a45d6d2192751a3a7ddcc6a85b42 Mon Sep 17 00:00:00 2001 From: AlessandroSigna Date: Mon, 23 Nov 2015 17:59:31 -0800 Subject: [PATCH 4/4] fixed icon position --- examples/entityScripts/recordingEntityScript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/entityScripts/recordingEntityScript.js b/examples/entityScripts/recordingEntityScript.js index a566bf96fc..0694ff431e 100644 --- a/examples/entityScripts/recordingEntityScript.js +++ b/examples/entityScripts/recordingEntityScript.js @@ -70,7 +70,7 @@ imageURL: NOT_RECORDING_ICON_URL, width: ICON_HEIGHT, height: ICON_WIDTH, - x: 210, + x: 275, y: 0, visible: true });