123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- this.initialize = function () {
- if (Object.getPrototypeOf(this).id.includes('scene.vwf')) {
- console.log("Initialize of Scene...", this.id);
- this.globalTransport.init();
- this.back.back2.mask = "filter2";
- this.back.back1.mask = "filter1";
- //this.back.back1.rectangle.fill = "https://localhost:3007/defaults/assets/test/test.mp4";
- //this.back.back1.rectangle.playVideo();
- this.back.back1.rectangle.setVideoState(false, null, 0);
- this.synth.sync();
- this.future(1).setStartTime();
- this.tuning.syncStart();
- //this.synth.scheduleRepeat();
- this.synth.triggerAttackRelease(["A3"], "32n", "4n", 0.8);
- this.synth.triggerAttackRelease(["E3"], "32n", "8n", 0.8);
- this.toneTransport.setTransportState(false, null, 0);
- this.toneGUI.toneText.step();
- } else {
- console.log("Initialize proto Scene..", this.id);
- }
- }
- this.resize = function () {
- }
- this.setStartTime = function () {
- this.tuning.startTime = this.toneTransport.position;
- }
- this.toneGUI.toneText.do = function () {
- let scene = this.getScene();
- if (scene && scene.toneTransport) {
- this.text = scene.toneTransport.position;
- }
- }
- this.toneGUI.tonePlay.mousedownEvent = function () {
- let scene = this.getScene();
- if (scene.toneTransport) {
- //scene.tuning.startTime = scene.toneTransport.position;
- //scene.future(1).setStartTime();
- //scene.tuning.startTime = scene.toneTransport.position;
- scene.toneTransport.syncTransportState();
- scene.toneTransport.toggleTransport();
- }
- // let scene = this.getScene();
- // if(!scene.toneTransport.state || scene.toneTransport.state == "stopped"){
- // scene.toneTransport.start();
- // scene.toneTransport.state = "started";
- // console.log("START Transport")
- // } else if(scene.toneTransport.state == "started"){
- // scene.toneTransport.stop();
- // scene.toneTransport.state = "stopped";
- // console.log("STOP Transport")
- // } else if(scene.toneTransport.state == "paused"){
- // scene.toneTransport.state = "paused";
- // }
- }
- this.audio.mousedownEvent = function () {
- this.parent.back.back1.rectangle.unmute();
- }
- this.play.mousedownEvent = function () {
- //this.parent.back.back1.rectangle.setVideoState(true, 0, 0);
- //this.parent.back.back1.rectangle.setVideoState(this.isPlaying, this.startOffset, this.pausedTime);
- this.parent.back.back1.rectangle.syncVideoState();
- this.parent.back.back1.rectangle.playVideo();
- }
- this.ellipse.clickEvent = function () {
- this.fill = this.getRandomColor();
- console.log('CLICK ', this.id);
- }
- this.ellipse.mousedownEvent = function () {
- this.fill = this.getRandomColor();
- console.log('Mouse Down ', this.id);
- }
- this.ellipse.mouseupEvent = function () {
- this.fill = this.getRandomColor();
- console.log('Mouse Up ', this.id);
- }
- this.ellipse.overstartEvent = function (avatarID) {
- this.fill = "#e3dd24"
- }
- this.ellipse.overendEvent = function (avatarID) {
- this.fill = "white"
- }
- this.filter2.el2.overstartEvent = function (avatarID) {
- let nodeName = this.parent.maskedNode;
- if (nodeName) {
- let node = this.getScene().findNode(nodeName);
- this.viewTroughFilter(node.id, true);
- //node.visible = true;
- }
- }
- this.filter2.el2.overendEvent = function (avatarID) {
- let nodeName = this.parent.maskedNode;
- if (nodeName) {
- let node = this.getScene().findNode(nodeName);
- this.viewTroughFilter(node.id, false);
- //node.visible = false;
- }
- }
- this.filter1.el1.overstartEvent = function (avatarID) {
- let nodeName = this.parent.maskedNode;
- if (nodeName) {
- let node = this.getScene().findNode(nodeName);
- //this.viewTroughFilter(node.id, true);
- //node.visible = true;
- }
- }
- this.filter1.el1.overendEvent = function (avatarID) {
- let nodeName = this.parent.maskedNode;
- if (nodeName) {
- let node = this.getScene().findNode(nodeName);
- //this.viewTroughFilter(node.id, false);
- //node.visible = false;
- }
- }
- this.filter1.el2.overstartEvent = function (avatarID) {
- let nodeName = this.parent.maskedNode;
- if (nodeName) {
- let node = this.getScene().findNode(nodeName);
- //this.viewTroughFilter(node.id, true);
- //node.visible = true;
- }
- }
- this.filter1.el2.overendEvent = function (avatarID) {
- let nodeName = this.parent.maskedNode;
- if (nodeName) {
- let node = this.getScene().findNode(nodeName);
- //this.viewTroughFilter(node.id, false);
- //node.visible = false;
- }
- }
|