From 874877819b8d1fd89f5afa5be1ff21752519d450 Mon Sep 17 00:00:00 2001 From: "marmorkuchen.net" Date: Sun, 10 Aug 2014 22:14:27 +0200 Subject: [PATCH] fixed wrong osc send data type check --- bower.json | 2 +- dist/osc.js | 14 +++++++++----- dist/osc.min.js | 4 ++-- dist/osc.min.map | 2 +- package.json | 2 +- src/osc.js | 12 ++++++++---- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/bower.json b/bower.json index 400c188..17e0d06 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "osc-js", "description": "OSC protocol interface with address pattern matching for javascript applications", - "version": "0.1.0", + "version": "0.1.1", "authors": [ "marmorkuchen.net " ], diff --git a/dist/osc.js b/dist/osc.js index 5299ef9..be710a8 100644 --- a/dist/osc.js +++ b/dist/osc.js @@ -1,4 +1,4 @@ -/*! osc-js - v0.1.0 - 2014-05-14 by marmorkuchen.net */ +/*! osc-js - v0.1.1 - 2014-08-10 by marmorkuchen.net */ (function(window, undefined) { "use strict"; var FLAGS = { @@ -214,11 +214,15 @@ } }; OSCSocket.prototype.send = function(sData) { - if (sData && sData instanceof ArrayBuffer) { - this._socket.send(sData.buffer); - return true; + if (this._socket) { + if (sData && sData.buffer && sData.buffer instanceof ArrayBuffer) { + this._socket.send(sData.buffer); + return true; + } else { + return false; + } } else { - return false; + throw "OSCSocket Error: WebSocket is not ready to send OSC data"; } }; var OSCAtomic = {}; diff --git a/dist/osc.min.js b/dist/osc.min.js index 9164c34..880ce9d 100644 --- a/dist/osc.min.js +++ b/dist/osc.min.js @@ -1,3 +1,3 @@ -/*! osc-js - v0.1.0 - 2014-05-14 by marmorkuchen.net */ -!function(a){"use strict";function b(a){return"[object Array]"===Object.prototype.toString.call(a)}function c(a){return"number"==typeof a&&a%1===0}function d(){var a=new Date;return a.getTime()}function e(a){var b="";return"object"==typeof a?b="/"+a.join("/"):(b=a,b.length>1&&"/"===b[b.length-1]&&(b=b.slice(0,b.length-1)),b.length>1&&"/"!==b[0]&&(b="/"+b)),b}function f(a){var b;return b=a.replace(/\./g,"\\."),b=b.replace(/\(/g,"\\("),b=b.replace(/\)/g,"\\)"),b=b.replace(/\{/g,"("),b=b.replace(/\}/g,")"),b=b.replace(/\,/g,"|"),b=b.replace(/\[\!/g,"[^"),b=b.replace(/\?/g,"."),b=b.replace(/\*/g,".*")}var g={SOCKET:{IS_NOT_INITALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3}},h={discardLateMessages:!1},i="#bundle",j="127.0.0.1",k=8e3,l=function(){this.data=[],this.length=0};l.prototype.add=function(a){var b=a.encode();return this.length=this.length+b.length,this.data.push(b),!0},l.prototype.merge=function(){var a=new Int8Array(this.length),b=0;return this.data.forEach(function(c){a.set(c,b),b+=c.length}),a};var m=function(){return this._callbackHandlers={open:[],error:[],close:[]},this._addressHandlers={},this._uuid=-1,!0};m.prototype.on=function(a,c){var d,f,g,h;if("string"!=typeof a&&!b(a)||"function"!=typeof c)throw"OSCEventHandler Error: on expects string/array as eventName and function as callback";if(d=(++this._uuid).toString(),g={token:d,callback:c},"string"==typeof a&&a in this._callbackHandlers)return this._callbackHandlers[a].push(g),d;if(f=e(a),h=new RegExp(/[#*\s\[\],\/{}|\?]/g),h.test(f.split("/").join("")))throw"OSCEventHandler Error: address string contains invalid characters";return f in this._addressHandlers||(this._addressHandlers[f]=[]),this._addressHandlers[f].push(g),d},m.prototype.off=function(a,c){var d,f,g;if("string"!=typeof a&&!b(a)||!c)throw"OSCEventHandler Error: off expects string/array as eventName and a proper token";return f=!1,"string"==typeof a&&this._callbackHandlers[a]?(g=this._callbackHandlers,d=a):(d=e(a),g=this._addressHandlers),d in g&&g[d].forEach(function(a,b){a.token===c&&(g[d].splice(b,1),f=!0)}),f},m.prototype.notify=function(a,b){var c,d,g,h;if("string"!=typeof a)throw"OSCEventHandler Error: notify expects a string";if(this._callbackHandlers[a])return this._callbackHandlers[a].forEach(function(a){a.callback(b)}),!0;if(0===a.length||"/"!==a[0])throw"OSCEventHandler Error: notify expects a proper address starting with /";return d=Object.keys(this._addressHandlers),c=this,d.forEach(function(d){g=new RegExp(f(e(a)),"g"),h=g.test(d),h&&d.length===g.lastIndex&&c._addressHandlers[d].forEach(function(a){a.callback(b)})}),!0},m.prototype.notifyLater=function(b,c,e){var f,g,i;return i=c,i.timestamp=e.milliseconds,f=d(),f>=e.milliseconds?h.discardLateMessages||this.notify(b,i):(g=this,a.setTimeout(function(){g.notify(b,i)},e.milliseconds-f)),!0};var n=function(){this._socket=null};n.prototype.connect=function(a,b){if(!a||!b)throw"OSCSocket Error: missing WebSocket address or port";return this._socket&&this.disconnect(),this._socket=new WebSocket("ws://"+a+":"+b),this._socket.binaryType="arraybuffer",this._socket.onopen=function(a){s.notify("open",a)},this._socket.onclose=function(a){s.notify("close",a)},this._socket.onerror=function(a){s.notify("error",a)},this._socket.onmessage=function(a){var b=new p;b.decode(a.data)},!0},n.prototype.disconnect=function(){return this._socket.close(),!0},n.prototype.status=function(){return this._socket?this._socket.readyState:g.SOCKET.IS_NOT_INITALIZED},n.prototype.send=function(a){return a&&a instanceof ArrayBuffer?(this._socket.send(a.buffer),!0):!1};var o={};o.OSCString=function(a){this.value=a||"",this.offset=0},o.OSCString.prototype.decode=function(a,b){for(var c,d,e,f=new Int8Array(a),g=b;f[g]&&gc;c++)b[c]=this.value.charCodeAt(c)||0;return new Int8Array(b)},o.Int32=function(a){this.value=a||0,this.offset=0},o.Int32.prototype.decode=function(a,b){var c=new DataView(a,b,4);return this.value=c.getInt32(0),this.offset=b+4,this.offset},o.Int32.prototype.encode=function(){var a=new DataView(new ArrayBuffer(4));return a.setInt32(0,this.value),new Int8Array(a.buffer)},o.Float32=function(a){this.value=a||0,this.offset=0},o.Float32.prototype.decode=function(a,b){var c=new DataView(a,b,4);return this.value=c.getFloat32(0),this.offset=b+4,this.offset},o.Float32.prototype.encode=function(){var a=new DataView(new ArrayBuffer(4));return a.setFloat32(0,this.value),new Int8Array(a.buffer)},o.OSCBlob=function(a){this.value=a||new Blob,this.offset=0},o.OSCBlob.prototype.decode=function(a,b){var c=new DataView(a,b,4),d=c.getInt32(0),e=a.slice(b+4,b+4+d);return this.value=new Blob([e]),this.offset=b+4+d,this.offset},o.OSCBlob.prototype.encode=function(){var a=4*Math.ceil((this.value.size+1)/4),b=new DataView(new ArrayBuffer(a+4));return b.setInt32(0,this.value.size),b.setInt32(4,this.value),new Int8Array(b.buffer)},o.OSCTimeTag=function(){this.value="",this.seconds=0,this.fraction=0,this.offset=0,this.milliseconds=0},o.OSCTimeTag.prototype.update=function(a){var b;b=a instanceof Date?a.getTime():a;var c=(b/1e3).toString();return this.seconds=parseInt(c.split(".")[0],10),this.fraction=parseInt(c.split(".")[1],10),this.milliseconds=b,this.value=this.seconds+"."+this.fraction,!0},o.OSCTimeTag.prototype.decode=function(a,b){var c=new DataView(a,b,8);return this.seconds=c.getInt32(0),this.fraction=c.getInt32(4),this.milliseconds=1e3*this.seconds,this.value=this.seconds+"."+this.fraction,this.offset=b+8,this.offset},o.OSCTimeTag.prototype.encode=function(){var a=new DataView(new ArrayBuffer(8));return a.setInt32(0,this.seconds),a.setInt32(4,this.fraction),new Int8Array(a.buffer)};var p=function(){return!0};p.prototype.decode=function(a,b){var c,d,e;if(a.byteLength%4!==0)throw"OSCPackage Error: byteLength has to be a multiple of four";if(c=new o.OSCString,c.decode(a,0),c.value===i){if(e=new q,e.decode(a),b&&e.timeTag.value0)if(c(arguments[0])||arguments[0]instanceof Date)this.timeTag.update(arguments[0]);else{if(!b(arguments[0]))throw"OSCBundle Error: first argument of constructor must be array of OSCMessages or TimeTag";for(d=arguments[0].length,a=0;d>a;a++){if(!(arguments[0][a]instanceof r))throw"OSCBundle Error: argument must be an OSCMessage";this.bundleElements.push(arguments[0][a])}arguments.length>1&&(c(arguments[1])||arguments[1]instanceof Date)&&this.timeTag.update(arguments[1])}return!0};q.prototype.timestamp=function(a){if(!a)return this.timeTag;if(!(c(a)||a instanceof Date))throw"OSCBundle Error: timetag must be an integer (milliseconds) or Date instance";this.timeTag.update(a)},q.prototype.add=function(a){if(!a||!(a instanceof r||a instanceof q))throw"OSCBundle Error: proper OSCMessage needed for bundling";this.bundleElements.push(a)},q.prototype.decode=function(a){var b,c,d,e;c=new o.OSCTimeTag,b=c.decode(a,8),this.timeTag=c;do d=new o.Int32,b=d.decode(a,b),d.value>0&&(e=new p,this.bundleElements.push(e.decode(a.slice(b,b+d.value),c))),b+=d.value;while(b0){if("string"!=typeof arguments[0]&&!b(arguments[0]))throw"OSC.Message Error: first argument (path) must be a string or array";if(this.addressPattern=e(arguments[0]),f>1){for(g="",a=1;f>a;a++){if("number"==typeof arguments[a])g+=c(arguments[a])?"i":"f";else if("string"==typeof arguments[a])g+="s";else{if(!(arguments[a]instanceof Blob))throw"OSCMessage Error: unknown argument type";g+="b"}this.args.push(arguments[a])}this.typesString=g}}return!0};r.prototype.address=function(a){if(!a)return this.addressPattern;if("string"!=typeof a&&!b(a))throw"OSC.Message Error: first argument (path) must be a string or array";this.addressPattern=e(a)},r.prototype.add=function(a){if(!a)return!1;var b;if("number"==typeof a)b=a%1===0?"i":"f";else if("string"==typeof a)b="s";else{if(!(a instanceof Blob))throw"OSCMessage Error: unknown argument type";b="b"}this.args.push(a),this.typesString=this.typesString+b},r.prototype.decode=function(a){var b,c,d,e,f;if(b=new o.OSCString,b.decode(a,0),c=new o.OSCString,c.decode(a,b.offset),0===c.length||","!==c.value[0])throw"OSCMessage Error: malformed or missing OSC TypeString";for(e=[],f=c.offset,d=1;d0){a.add(new o.OSCString(","+this.typesString));var b;this.args.forEach(function(c){if("number"==typeof c)b=c%1===0?new o.Int32(c):new o.Float32(c);else if("string"==typeof c)b=new o.OSCString(c);else{if(!(c instanceof Blob))throw"OSCMessage Error: unknown argument type";b=new o.OSCBlob(c)}a.add(b)})}return a.merge()};var s,t,u=function(a){return a&&Object.keys(a).forEach(function(b){b in h&&(h[b]=a[b])}),this.SOCKET=g.SOCKET,s=new m,t=new n,!0};u.prototype.on=function(a,b){return s.on(a,b)},u.prototype.off=function(a,b){return s.off(a,b)},u.prototype.connect=function(a,b){var c=a||j,d=b||k;return t.connect(c,d)},u.prototype.disconnect=function(){return t.disconnect()},u.prototype.status=function(){return t.status()},u.prototype.send=function(a){if(!(a instanceof r||a instanceof q))throw"OSC Error: packet must be an OSCMessage or OSCBundle instance";var b=new p;return t.send(b.encode(a))},a.OSC=u,a.OSC.Message=r,a.OSC.Bundle=q}(window); +/*! osc-js - v0.1.1 - 2014-08-10 by marmorkuchen.net */ +!function(a){"use strict";function b(a){return"[object Array]"===Object.prototype.toString.call(a)}function c(a){return"number"==typeof a&&a%1===0}function d(){var a=new Date;return a.getTime()}function e(a){var b="";return"object"==typeof a?b="/"+a.join("/"):(b=a,b.length>1&&"/"===b[b.length-1]&&(b=b.slice(0,b.length-1)),b.length>1&&"/"!==b[0]&&(b="/"+b)),b}function f(a){var b;return b=a.replace(/\./g,"\\."),b=b.replace(/\(/g,"\\("),b=b.replace(/\)/g,"\\)"),b=b.replace(/\{/g,"("),b=b.replace(/\}/g,")"),b=b.replace(/\,/g,"|"),b=b.replace(/\[\!/g,"[^"),b=b.replace(/\?/g,"."),b=b.replace(/\*/g,".*")}var g={SOCKET:{IS_NOT_INITALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3}},h={discardLateMessages:!1},i="#bundle",j="127.0.0.1",k=8e3,l=function(){this.data=[],this.length=0};l.prototype.add=function(a){var b=a.encode();return this.length=this.length+b.length,this.data.push(b),!0},l.prototype.merge=function(){var a=new Int8Array(this.length),b=0;return this.data.forEach(function(c){a.set(c,b),b+=c.length}),a};var m=function(){return this._callbackHandlers={open:[],error:[],close:[]},this._addressHandlers={},this._uuid=-1,!0};m.prototype.on=function(a,c){var d,f,g,h;if("string"!=typeof a&&!b(a)||"function"!=typeof c)throw"OSCEventHandler Error: on expects string/array as eventName and function as callback";if(d=(++this._uuid).toString(),g={token:d,callback:c},"string"==typeof a&&a in this._callbackHandlers)return this._callbackHandlers[a].push(g),d;if(f=e(a),h=new RegExp(/[#*\s\[\],\/{}|\?]/g),h.test(f.split("/").join("")))throw"OSCEventHandler Error: address string contains invalid characters";return f in this._addressHandlers||(this._addressHandlers[f]=[]),this._addressHandlers[f].push(g),d},m.prototype.off=function(a,c){var d,f,g;if("string"!=typeof a&&!b(a)||!c)throw"OSCEventHandler Error: off expects string/array as eventName and a proper token";return f=!1,"string"==typeof a&&this._callbackHandlers[a]?(g=this._callbackHandlers,d=a):(d=e(a),g=this._addressHandlers),d in g&&g[d].forEach(function(a,b){a.token===c&&(g[d].splice(b,1),f=!0)}),f},m.prototype.notify=function(a,b){var c,d,g,h;if("string"!=typeof a)throw"OSCEventHandler Error: notify expects a string";if(this._callbackHandlers[a])return this._callbackHandlers[a].forEach(function(a){a.callback(b)}),!0;if(0===a.length||"/"!==a[0])throw"OSCEventHandler Error: notify expects a proper address starting with /";return d=Object.keys(this._addressHandlers),c=this,d.forEach(function(d){g=new RegExp(f(e(a)),"g"),h=g.test(d),h&&d.length===g.lastIndex&&c._addressHandlers[d].forEach(function(a){a.callback(b)})}),!0},m.prototype.notifyLater=function(b,c,e){var f,g,i;return i=c,i.timestamp=e.milliseconds,f=d(),f>=e.milliseconds?h.discardLateMessages||this.notify(b,i):(g=this,a.setTimeout(function(){g.notify(b,i)},e.milliseconds-f)),!0};var n=function(){this._socket=null};n.prototype.connect=function(a,b){if(!a||!b)throw"OSCSocket Error: missing WebSocket address or port";return this._socket&&this.disconnect(),this._socket=new WebSocket("ws://"+a+":"+b),this._socket.binaryType="arraybuffer",this._socket.onopen=function(a){s.notify("open",a)},this._socket.onclose=function(a){s.notify("close",a)},this._socket.onerror=function(a){s.notify("error",a)},this._socket.onmessage=function(a){var b=new p;b.decode(a.data)},!0},n.prototype.disconnect=function(){return this._socket.close(),!0},n.prototype.status=function(){return this._socket?this._socket.readyState:g.SOCKET.IS_NOT_INITALIZED},n.prototype.send=function(a){if(this._socket)return a&&a.buffer&&a.buffer instanceof ArrayBuffer?(this._socket.send(a.buffer),!0):!1;throw"OSCSocket Error: WebSocket is not ready to send OSC data"};var o={};o.OSCString=function(a){this.value=a||"",this.offset=0},o.OSCString.prototype.decode=function(a,b){for(var c,d,e,f=new Int8Array(a),g=b;f[g]&&gc;c++)b[c]=this.value.charCodeAt(c)||0;return new Int8Array(b)},o.Int32=function(a){this.value=a||0,this.offset=0},o.Int32.prototype.decode=function(a,b){var c=new DataView(a,b,4);return this.value=c.getInt32(0),this.offset=b+4,this.offset},o.Int32.prototype.encode=function(){var a=new DataView(new ArrayBuffer(4));return a.setInt32(0,this.value),new Int8Array(a.buffer)},o.Float32=function(a){this.value=a||0,this.offset=0},o.Float32.prototype.decode=function(a,b){var c=new DataView(a,b,4);return this.value=c.getFloat32(0),this.offset=b+4,this.offset},o.Float32.prototype.encode=function(){var a=new DataView(new ArrayBuffer(4));return a.setFloat32(0,this.value),new Int8Array(a.buffer)},o.OSCBlob=function(a){this.value=a||new Blob,this.offset=0},o.OSCBlob.prototype.decode=function(a,b){var c=new DataView(a,b,4),d=c.getInt32(0),e=a.slice(b+4,b+4+d);return this.value=new Blob([e]),this.offset=b+4+d,this.offset},o.OSCBlob.prototype.encode=function(){var a=4*Math.ceil((this.value.size+1)/4),b=new DataView(new ArrayBuffer(a+4));return b.setInt32(0,this.value.size),b.setInt32(4,this.value),new Int8Array(b.buffer)},o.OSCTimeTag=function(){this.value="",this.seconds=0,this.fraction=0,this.offset=0,this.milliseconds=0},o.OSCTimeTag.prototype.update=function(a){var b;b=a instanceof Date?a.getTime():a;var c=(b/1e3).toString();return this.seconds=parseInt(c.split(".")[0],10),this.fraction=parseInt(c.split(".")[1],10),this.milliseconds=b,this.value=this.seconds+"."+this.fraction,!0},o.OSCTimeTag.prototype.decode=function(a,b){var c=new DataView(a,b,8);return this.seconds=c.getInt32(0),this.fraction=c.getInt32(4),this.milliseconds=1e3*this.seconds,this.value=this.seconds+"."+this.fraction,this.offset=b+8,this.offset},o.OSCTimeTag.prototype.encode=function(){var a=new DataView(new ArrayBuffer(8));return a.setInt32(0,this.seconds),a.setInt32(4,this.fraction),new Int8Array(a.buffer)};var p=function(){return!0};p.prototype.decode=function(a,b){var c,d,e;if(a.byteLength%4!==0)throw"OSCPackage Error: byteLength has to be a multiple of four";if(c=new o.OSCString,c.decode(a,0),c.value===i){if(e=new q,e.decode(a),b&&e.timeTag.value0)if(c(arguments[0])||arguments[0]instanceof Date)this.timeTag.update(arguments[0]);else{if(!b(arguments[0]))throw"OSCBundle Error: first argument of constructor must be array of OSCMessages or TimeTag";for(d=arguments[0].length,a=0;d>a;a++){if(!(arguments[0][a]instanceof r))throw"OSCBundle Error: argument must be an OSCMessage";this.bundleElements.push(arguments[0][a])}arguments.length>1&&(c(arguments[1])||arguments[1]instanceof Date)&&this.timeTag.update(arguments[1])}return!0};q.prototype.timestamp=function(a){if(!a)return this.timeTag;if(!(c(a)||a instanceof Date))throw"OSCBundle Error: timetag must be an integer (milliseconds) or Date instance";this.timeTag.update(a)},q.prototype.add=function(a){if(!a||!(a instanceof r||a instanceof q))throw"OSCBundle Error: proper OSCMessage needed for bundling";this.bundleElements.push(a)},q.prototype.decode=function(a){var b,c,d,e;c=new o.OSCTimeTag,b=c.decode(a,8),this.timeTag=c;do d=new o.Int32,b=d.decode(a,b),d.value>0&&(e=new p,this.bundleElements.push(e.decode(a.slice(b,b+d.value),c))),b+=d.value;while(b0){if("string"!=typeof arguments[0]&&!b(arguments[0]))throw"OSC.Message Error: first argument (path) must be a string or array";if(this.addressPattern=e(arguments[0]),f>1){for(g="",a=1;f>a;a++){if("number"==typeof arguments[a])g+=c(arguments[a])?"i":"f";else if("string"==typeof arguments[a])g+="s";else{if(!(arguments[a]instanceof Blob))throw"OSCMessage Error: unknown argument type";g+="b"}this.args.push(arguments[a])}this.typesString=g}}return!0};r.prototype.address=function(a){if(!a)return this.addressPattern;if("string"!=typeof a&&!b(a))throw"OSC.Message Error: first argument (path) must be a string or array";this.addressPattern=e(a)},r.prototype.add=function(a){if(!a)return!1;var b;if("number"==typeof a)b=a%1===0?"i":"f";else if("string"==typeof a)b="s";else{if(!(a instanceof Blob))throw"OSCMessage Error: unknown argument type";b="b"}this.args.push(a),this.typesString=this.typesString+b},r.prototype.decode=function(a){var b,c,d,e,f;if(b=new o.OSCString,b.decode(a,0),c=new o.OSCString,c.decode(a,b.offset),0===c.length||","!==c.value[0])throw"OSCMessage Error: malformed or missing OSC TypeString";for(e=[],f=c.offset,d=1;d0){a.add(new o.OSCString(","+this.typesString));var b;this.args.forEach(function(c){if("number"==typeof c)b=c%1===0?new o.Int32(c):new o.Float32(c);else if("string"==typeof c)b=new o.OSCString(c);else{if(!(c instanceof Blob))throw"OSCMessage Error: unknown argument type";b=new o.OSCBlob(c)}a.add(b)})}return a.merge()};var s,t,u=function(a){return a&&Object.keys(a).forEach(function(b){b in h&&(h[b]=a[b])}),this.SOCKET=g.SOCKET,s=new m,t=new n,!0};u.prototype.on=function(a,b){return s.on(a,b)},u.prototype.off=function(a,b){return s.off(a,b)},u.prototype.connect=function(a,b){var c=a||j,d=b||k;return t.connect(c,d)},u.prototype.disconnect=function(){return t.disconnect()},u.prototype.status=function(){return t.status()},u.prototype.send=function(a){if(!(a instanceof r||a instanceof q))throw"OSC Error: packet must be an OSCMessage or OSCBundle instance";var b=new p;return t.send(b.encode(a))},a.OSC=u,a.OSC.Message=r,a.OSC.Bundle=q}(window); //# sourceMappingURL=osc.min.map \ No newline at end of file diff --git a/dist/osc.min.map b/dist/osc.min.map index bab9090..7f7e30f 100644 --- a/dist/osc.min.map +++ b/dist/osc.min.map @@ -1 +1 @@ -{"version":3,"file":"osc.min.js","sources":["../.tmp/osc.dist.js"],"names":["window","_isArray","pItem","Object","prototype","toString","call","_isInteger","_now","date","Date","getTime","_prepareAddress","pAddress","address","join","length","slice","_prepareRegExPattern","rPattern","pattern","replace","FLAGS","SOCKET","IS_NOT_INITALIZED","IS_CONNECTING","IS_OPEN","IS_CLOSING","IS_CLOSED","_options","discardLateMessages","BUNDLE_TAG","DEFAULT_ADDRESS","DEFAULT_PORT","EncodeHelper","this","data","add","aItem","buf","encode","push","merge","merged","Int8Array","offset","forEach","eItem","set","OSCEventHandler","_callbackHandlers","open","error","close","_addressHandlers","_uuid","on","sEventName","sCallback","token","regex","callback","RegExp","test","split","off","sToken","key","success","haystack","hItem","hIndex","splice","notify","sEventData","_this","addresses","cHandlerItem","keys","fAddress","lastIndex","notifyLater","sTimeTag","now","timestamp","milliseconds","setTimeout","OSCSocket","_socket","connect","sAddress","sPort","disconnect","WebSocket","binaryType","onopen","sEvent","_oscEventHandler","onclose","onerror","onmessage","message","OSCPacket","decode","status","readyState","send","sData","ArrayBuffer","buffer","OSCAtomic","OSCString","sValue","value","sOffset","i","subarray","str","end","String","fromCharCode","Math","ceil","len","Array","charCodeAt","Int32","dataView","DataView","getInt32","view","setInt32","Float32","getFloat32","setFloat32","OSCBlob","Blob","blobSize","binary","size","OSCTimeTag","seconds","fraction","update","sMilliseconds","ms","parseInt","pData","pTimeTag","first","bundle","byteLength","OSCBundle","timeTag","OSCMessage","addressPattern","bundleElements","arguments","bMilliseconds","bMessage","bData","timetag","packet","encoder","bPacket","typeString","typesString","args","mAddress","mArgument","type","mData","types","next","argument","eArgument","_oscSocket","OSC","mOptions","oKey","port","Message","Bundle"],"mappings":";CAAA,SAAWA,GAET,YAuBA,SAASC,GAASC,GAChB,MAAiD,mBAA1CC,OAAOC,UAAUC,SAASC,KAAKJ,GAGxC,QAASK,GAAWL,GAClB,MAAwB,gBAAVA,IAAsBA,EAAQ,IAAM,EAGpD,QAASM,KACP,GAAIC,GAAO,GAAIC,KACf,OAAOD,GAAKE,UAGd,QAASC,GAAgBC,GACvB,GAAIC,GAAU,EAYd,OAXwB,gBAAbD,GACTC,EAAU,IAAMD,EAASE,KAAK,MAE9BD,EAAUD,EACNC,EAAQE,OAAS,GAAqC,MAAhCF,EAAQA,EAAQE,OAAS,KAC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B,QAAQwC,GAInCZ,EAAQ9H,IAAIyI,KAKhB,MAAOX,GAAQzH,QAKjB,IAAIuD,GAAkB+E,EAElBC,EAAM,SAASC,GAuBjB,MAnBIA,IACF/K,OAAO2E,KAAKoG,GAAUpI,QAAQ,SAASqI,GACjCA,IAAQtJ,KACVA,EAASsJ,GAAQD,EAASC,MAOhChJ,KAAKZ,OAASD,EAAMC,OAIpB0E,EAAmB,GAAIhD,GACvB+H,EAAa,GAAIzF,IAIV,EAKT0F,GAAI7K,UAAUoD,GAAK,SAASC,EAAYC,GACtC,MAAOuC,GAAiBzC,GAAGC,EAAYC,IAGzCuH,EAAI7K,UAAU6D,IAAM,SAASR,EAAYS,GACvC,MAAO+B,GAAiBhC,IAAIR,EAAYS,IAK1C+G,EAAI7K,UAAUqF,QAAU,SAASC,EAAUC,GACzC,GAAI7E,GAAU4E,GAAY1D,EACtBoJ,EAAOzF,GAAS1D,CACpB,OAAO+I,GAAWvF,QAAQ3E,EAASsK,IAGrCH,EAAI7K,UAAUwF,WAAa,WACzB,MAAOoF,GAAWpF,cAGpBqF,EAAI7K,UAAUoG,OAAS,WACrB,MAAOwE,GAAWxE,UAKpByE,EAAI7K,UAAUsG,KAAO,SAASC,GAC5B,KAAOA,YAAiB+C,IAAc/C,YAAiB6C,IACrD,KAAM,+DAER,IAAIU,GAAS,GAAI5D,EACjB,OAAO0E,GAAWtE,KAAKwD,EAAO1H,OAAOmE,KAKvC3G,EAAOiL,IAAMA,EACbjL,EAAOiL,IAAII,QAAU3B,EACrB1J,EAAOiL,IAAIK,OAAS9B,GAEnBxJ"} \ No newline at end of file +{"version":3,"file":"osc.min.js","sources":["../.tmp/osc.dist.js"],"names":["window","_isArray","pItem","Object","prototype","toString","call","_isInteger","_now","date","Date","getTime","_prepareAddress","pAddress","address","join","length","slice","_prepareRegExPattern","rPattern","pattern","replace","FLAGS","SOCKET","IS_NOT_INITALIZED","IS_CONNECTING","IS_OPEN","IS_CLOSING","IS_CLOSED","_options","discardLateMessages","BUNDLE_TAG","DEFAULT_ADDRESS","DEFAULT_PORT","EncodeHelper","this","data","add","aItem","buf","encode","push","merge","merged","Int8Array","offset","forEach","eItem","set","OSCEventHandler","_callbackHandlers","open","error","close","_addressHandlers","_uuid","on","sEventName","sCallback","token","regex","callback","RegExp","test","split","off","sToken","key","success","haystack","hItem","hIndex","splice","notify","sEventData","_this","addresses","cHandlerItem","keys","fAddress","lastIndex","notifyLater","sTimeTag","now","timestamp","milliseconds","setTimeout","OSCSocket","_socket","connect","sAddress","sPort","disconnect","WebSocket","binaryType","onopen","sEvent","_oscEventHandler","onclose","onerror","onmessage","message","OSCPacket","decode","status","readyState","send","sData","buffer","ArrayBuffer","OSCAtomic","OSCString","sValue","value","sOffset","i","subarray","str","end","String","fromCharCode","Math","ceil","len","Array","charCodeAt","Int32","dataView","DataView","getInt32","view","setInt32","Float32","getFloat32","setFloat32","OSCBlob","Blob","blobSize","binary","size","OSCTimeTag","seconds","fraction","update","sMilliseconds","ms","parseInt","pData","pTimeTag","first","bundle","byteLength","OSCBundle","timeTag","OSCMessage","addressPattern","bundleElements","arguments","bMilliseconds","bMessage","bData","timetag","packet","encoder","bPacket","typeString","typesString","args","mAddress","mArgument","type","mData","types","next","argument","eArgument","_oscSocket","OSC","mOptions","oKey","port","Message","Bundle"],"mappings":";CAAA,SAAWA,GAET,YAuBA,SAASC,GAASC,GAChB,MAAiD,mBAA1CC,OAAOC,UAAUC,SAASC,KAAKJ,GAGxC,QAASK,GAAWL,GAClB,MAAwB,gBAAVA,IAAsBA,EAAQ,IAAM,EAGpD,QAASM,KACP,GAAIC,GAAO,GAAIC,KACf,OAAOD,GAAKE,UAGd,QAASC,GAAgBC,GACvB,GAAIC,GAAU,EAYd,OAXwB,gBAAbD,GACTC,EAAU,IAAMD,EAASE,KAAK,MAE9BD,EAAUD,EACNC,EAAQE,OAAS,GAAqC,MAAhCF,EAAQA,EAAQE,OAAS,KACjDF,EAAUA,EAAQG,MAAM,EAAGH,EAAQE,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AAIhE,GAAUyB,QAAQwC,GAInCZ,EAAQ9H,IAAIyI,KAKhB,MAAOX,GAAQzH,QAKjB,IAAIuD,GAAkB+E,EAElBC,EAAM,SAASC,GAuBjB,MAnBIA,IACF/K,OAAO2E,KAAKoG,GAAUpI,QAAQ,SAASqI,GACjCA,IAAQtJ,KACVA,EAASsJ,GAAQD,EAASC,MAOhChJ,KAAKZ,OAASD,EAAMC,OAIpB0E,EAAmB,GAAIhD,GACvB+H,EAAa,GAAIzF,IAIV,EAKT0F,GAAI7K,UAAUoD,GAAK,SAASC,EAAYC,GACtC,MAAOuC,GAAiBzC,GAAGC,EAAYC,IAGzCuH,EAAI7K,UAAU6D,IAAM,SAASR,EAAYS,GACvC,MAAO+B,GAAiBhC,IAAIR,EAAYS,IAK1C+G,EAAI7K,UAAUqF,QAAU,SAASC,EAAUC,GACzC,GAAI7E,GAAU4E,GAAY1D,EACtBoJ,EAAOzF,GAAS1D,CACpB,OAAO+I,GAAWvF,QAAQ3E,EAASsK,IAGrCH,EAAI7K,UAAUwF,WAAa,WACzB,MAAOoF,GAAWpF,cAGpBqF,EAAI7K,UAAUoG,OAAS,WACrB,MAAOwE,GAAWxE,UAKpByE,EAAI7K,UAAUsG,KAAO,SAASC,GAC5B,KAAOA,YAAiB+C,IAAc/C,YAAiB6C,IACrD,KAAM,+DAER,IAAIU,GAAS,GAAI5D,EACjB,OAAO0E,GAAWtE,KAAKwD,EAAO1H,OAAOmE,KAKvC3G,EAAOiL,IAAMA,EACbjL,EAAOiL,IAAII,QAAU3B,EACrB1J,EAAOiL,IAAIK,OAAS9B,GAEnBxJ"} \ No newline at end of file diff --git a/package.json b/package.json index 86f3170..0056d36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "osc-js", - "version": "0.1.0", + "version": "0.1.1", "dependencies": {}, "devDependencies": { "grunt": "~0.4.4", diff --git a/src/osc.js b/src/osc.js index 8daf769..f4b6113 100644 --- a/src/osc.js +++ b/src/osc.js @@ -310,11 +310,15 @@ }; OSCSocket.prototype.send = function(sData) { - if (sData && sData instanceof ArrayBuffer) { - this._socket.send(sData.buffer); - return true; + if (this._socket) { + if (sData && sData.buffer && sData.buffer instanceof ArrayBuffer) { + this._socket.send(sData.buffer); + return true; + } else { + return false; + } } else { - return false; + throw 'OSCSocket Error: WebSocket is not ready to send OSC data'; } };