解决办法,在.eslintrc.js文件里添加规则禁用ta
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
解决办法,在.eslintrc.js文件里添加规则禁用ta "rules": { "@typescript-eslint/explicit-module-boundary-types": "off" },
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define;.amd?define([],e):"object"==typeof exports?exports.Hls=e():t.Hls=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/hls.js/dist/",e(e.s=7)}([function(t,e,r){"use strict";function i(){}function a(t,e){return e="["+t+"] > "+e}function n(t){var e=self.console[t];return e?function(){for(var r=arguments.length,i=Array(r),n=0;n1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];r.forEach(function(e){u[e]=t[e]?t[e].bind(t):n(e)})}r.d(e,"a",function(){return d}),r.d(e,"b",function(){return h});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l={trace:i,debug:i,log:i,warn:i,info:i,error:i},u=l,d=function(t){if(!0===t||"object"===(void 0===t?"undefined":s(t))){o(t,"debug","log","info","warn","error");try{u.log()}catch(t){u=l}}else u=l},h=u},function(t,e,r){"use strict";e.a={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCH:"hlsLevelSwitch",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",LEVEL_REMOVED:"hlsLevelRemoved",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCH:"hlsAudioTrackSwitch",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",CUES_PARSED:"hlsCuesParsed",NON_NATIVE_TEXT_TRACKS_FOUND:"hlsNonNativeTextTracksFound",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPT_STARTED:"hlsFragDecryptStarted",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},function(t,e,r){"use strict";r.d(e,"b",function(){return i}),r.d(e,"a",function(){return a});var i={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},a={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",MANIFEST_EMPTY_ERROR:"manifestEmptyError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException",WEBVTT_EXCEPTION:"webVTTException"}},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(){i(this,t)}return t.isHeader=function(t,e){return e+10<=t.length&&73;===t[e]&&68;===t[e+1]&&51;===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.isFooter=function(t,e){return e+10<=t.length&&51;===t[e]&&68;===t[e+1]&&73;===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]0)return e.subarray(i,i+a)},t._readSize=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,r|=(127&t[e+2])<<7,r|=127&t[e+3]},t.getTimeStamp=function(e){for(var r=t.getID3Frames(e),i=0;i<r.length;i++){var a=r[i];if(t.isTimeStampFrame(a))return t._readTimeStamp(a)}},t.isTimeStampFrame=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},t._getFrameData=function(e){var r=String.fromCharCode(e[0],e[1],e[2],e[3]),i=t._readSize(e,4);return{type:r,size:i,data:e.subarray(10,10+i)}},t.getID3Frames=function(e){for(var r=0,i=[];t.isHeader(e,r);){var a=t._readSize(e,r+6);r+=10;for(var n=r+a;r+8<n;){var o=t._getFrameData(e.subarray(r)),s=t._decodeFrame(o);s&&i.push(s),r+=o.size+10}t.isFooter(e,r)&&(r+=10)}return i},t._decodeFrame=function(e){return"PRIV"===e.type?t._decodePrivFrame(e):"T"===e.type[0]?t._decodeTextFrame(e):"W"===e.type[0]?t._decodeURLFrame(e):void 0},t._readTimeStamp=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),r=1&e[3],i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},t._decodePrivFrame=function(e){if(!(e.size<2)){var r=t._utf8ArrayToStr(e.data),i=new Uint8Array(e.data.subarray(r.length+1));return{key:e.type,info:r,data:i.buffer}}},t._decodeTextFrame=function(e){if(!(e.size<2)){if("TXXX"===e.type){var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var a=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:a}}var n=t._utf8ArrayToStr(e.data.subarray(1));return{key:e.type,data:n}}},t._decodeURLFrame=function(e){if("WXXX"===e.type){if(e.size<2)return;var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var a=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:a}}var n=t._utf8ArrayToStr(e.data);return{key:e.type,data:n}},t._utf8ArrayToStr=function(t){for(var e=void 0,r=void 0,i="",a=0,n=t.length;a>4){case 0:return i;case 1:case 2:case 3:case 4:case 5:case 6:case 7:i+=String.fromCharCode(o);break;case 12:case 13:e=t[a++],i+=String.fromCharCode((31&o)<<6|63&e);break;case 14:e=t[a++],r=t[a++],i+=String.fromCharCode((15&o)<<12|(63&e)<<6|(63&r)<<0)}}return i},t}();e.a=a},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function a(t){return"number"==typeof t}function n(t){return"object"==typeof t&&null;!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!a(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,a,s,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var d=new Error('Uncaught, unspecified "error" event. ('+e+")");throw d.context=e,d}if(r=this._events[t],o(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(n(r))for(s=Array.prototype.slice.call(arguments,1),u=r.slice(),a=u.length,l=0;l0&&this;._events[t].length>a&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console;.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),a||(a=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var a=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,a,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,a=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this;.emit("removeListener",t,e);else if(n(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){a=s;break}if(a>>6),(n=(60&e[r+2])>>>2)>h.length-1?void t.trigger(Event.ERROR,{type:k.b.MEDIA_ERROR,details:k.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+n}):(s=(1&e[r+2])<>>6,N.b.log("manifest codec:"+i+",ADTS data:type:"+a+",sampleingIndex:"+n+"["+h[n]+"Hz],channelConfig:"+s),/firefox/i.test(u)?n>=6?(a=5,l=new Array(4),o=n-3):(a=2,l=new Array(2),o=n):-1!==u.indexOf("android")?(a=2,l=new Array(2),o=n):(a=5,l=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&n>=6?o=n-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(n>=6&&1===s||/vivaldi/i.test(u))||!i&&1===s)&&(a=2,l=new Array(2)),o=n)),l[0]=a<>1,l[1]|=(1&n)<<7,l[1]|=s<>1,l[2]=(1&o)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:h[n],channelCount:s,codec:"mp4a.40."+a,manifestCodec:d})}function l(t,e){return 255===t[e]&&240;==(246&t[e+1])}function u(t,e){return 1&t[e+1]?7:9}function d(t,e){return(3&t[e+3])<<11|t[e+4]<>>5}function h(t,e){return!!(e+1<t.length&&l(t,e))}function c(t,e){if(e+1<t.length&&l(t,e)){var r=u(t,e),i=r;e+5<t.length&&(i=d(t,e));var a=e+i;if(a===t.length||a+10&&e+n+o<=l)return s=r+i*a,{headerLength:n,frameLength:o,stamp:s}}function v(t,e,r,i,a){var n=p(t.samplerate),o=g(e,r,i,a,n);if(o){var s=o.stamp,l=o.headerLength,u=o.frameLength,d={unit:e.subarray(r+l,r+l+u),pts:s,dts:s};return t.samples.push(d),t.len+=u,{sample:d,length:u+l}}}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var D=r(1),k=r(2),I=function(){function t(e,r){i(this,t),this.subtle=e,this.aesIV=r}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}(),O=I,C=function(){function t(e,r){a(this,t),this.subtle=e,this.key=r}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}(),P=C,x=function(){function t(){n(this,t),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return t.prototype.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),r=new Uint32Array(4),i=0;i<4;i++)r[i]=e.getUint32(4*i);return r},t.prototype.initTable=function(){var t=this.sBox,e=this.invSBox,r=this.subMix,i=r[0],a=r[1],n=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],d=s[2],h=s[3],c=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)c[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var v=p^p<<1^p<<2^p<<3^p<>>8^255&v^99,t[f]=v,e[v]=f;var y=c[f],m=c[y],b=c[m],E=257*c[v]^16843008*v;i[f]=E<>>8,a[f]=E<>>16,n[f]=E<>>24,o[f]=E,E=16843009*b^65537*m^257*y^16843008*f,l[v]=E<>>8,u[v]=E<>>16,d[v]=E<>>24,h[v]=E,f?(f=y^c[c[c[b^y]]],p^=c[c[p]]):f=p=1}},t.prototype.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i<e.length&&r;)r=e[i]===this.key[i],i++;if(!r){this.key=e;var a=this.keySize=e.length;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size="+a);var n=this.ksRows=4*(a+6+1),o=void 0,s=void 0,l=this.keySchedule=new Uint32Array(n),u=this.invKeySchedule=new Uint32Array(n),d=this.sBox,h=this.rcon,c=this.invSubMix,f=c[0],p=c[1],g=c[2],v=c[3],y=void 0,m=void 0;for(o=0;o<n;o++)o<a?y=l[o]=e[o]:(m=y,o%a==0?(m=m<>>24,m=d[m>>>24]<>>16&255;]<>>8&255;]<<8|d[255&m],m^=h[o/a|0]<6&&o%a==4&&(m=d[m>>>24]<>>16&255;]<>>8&255;]<>>0);for(s=0;s<n;s++)o=n-s,m=3&s?l[o]:l[o-4],u[s]=s<4||o>>24]]^p[d[m>>>16&255;]]^g[d[m>>>8&255;]]^v[d[255&m]],u[s]=u[s]>>>0}},t.prototype.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<>8|t>>>24},t.prototype.decrypt=function(t,e,r){for(var i,a,n=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,u=l[0],d=l[1],h=l[2],c=l[3],f=this.uint8ArrayToUint32Array_(r),p=f[0],g=f[1],v=f[2],y=f[3],m=new Int32Array(t),b=new Int32Array(m.length),E=void 0,T=void 0,R=void 0,S=void 0,A=void 0,_=void 0,L=void 0,w=void 0,D=void 0,k=void 0,I=void 0,O=void 0,C=this.networkToHostOrderSwap;e<m.length;){for(D=C(m[e]),k=C(m[e+1]),I=C(m[e+2]),O=C(m[e+3]),A=D^o[0],_=O^o[1],L=I^o[2],w=k^o[3],i=4,a=1;a>>24]^d[_>>16&255;]^h[L>>8&255;]^c[255&w]^o[i],T=u[_>>>24]^d[L>>16&255;]^h[w>>8&255;]^c[255&A]^o[i+1],R=u[L>>>24]^d[w>>16&255;]^h[A>>8&255;]^c[255&_]^o[i+2],S=u[w>>>24]^d[A>>16&255;]^h[_>>8&255;]^c[255&L]^o[i+3],A=E,_=T,L=R,w=S,i+=4;E=s[A>>>24]<>16&255;]<>8&255;]<>>24]<>16&255;]<>8&255;]<>>24]<>16&255;]<>8&255;]<>>24]<>16&255;]<>8&255;]<<8^s[255&L]^o[i+3],i+=3,b[e]=C(E^p),b[e+1]=C(S^g),b[e+2]=C(R^v),b[e+3]=C(T^y),p=D,g=k,v=I,y=O,e+=4}return b.buffer},t.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},t}(),F=x,N=r(0),M=function(){function t(e,r){o(this,t),this.observer=e,this.config=r,this.logEnabled=!0;try{var i=crypto||self.crypto;this.subtle=i.subtle||i.webkitSubtle}catch(t){}this.disableWebCrypto=!this.subtle}return t.prototype.isSync=function(){return this.disableWebCrypto&&this;.config.enableSoftwareAES},t.prototype.decrypt=function(t,e,r,i){var a=this;if(this.disableWebCrypto&&this;.config.enableSoftwareAES){this.logEnabled&&(N.b.log("JS AES decrypt"),this.logEnabled=!1);var n=this.decryptor;n||(this.decryptor=n=new F),n.expandKey(e),i(n.decrypt(t,0,r))}else{this.logEnabled&&(N.b.log("WebCrypto AES decrypt"),this.logEnabled=!1);var o=this.subtle;this.key!==e&&(this.key=e,this.fastAesKey=new P(o,e)),this.fastAesKey.expandKey().then(function(n){new O(o,r).decrypt(t,n).catch(function(n){a.onWebCryptoError(n,t,e,r,i)}).then(function(t){i(t)})}).catch(function(n){a.onWebCryptoError(n,t,e,r,i)})}},t.prototype. Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(e,r,i,a)):(N.b.error("decrypting error : "+t.message),this.observer.trigger(Event.ERROR,{type:k.b.MEDIA_ERROR,details:k.a.FRAG_DECRYPT_ERROR,fatal:!0,reason:t.message}))},t.prototype.destroy=function(){var t=this.decryptor;t&&(t.destroy(),this.decryptor=void 0)},t}(),U=M,B=r(3),G=function(){function t(e,r,i){y(this,t),this.observer=e,this.config=i,this.remuxer=r}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:"audio/adts",type:"audio",id:-1,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){if(!t)return!1;for(var e=B.a.getID3Data(t,0)||[],r=e.length,i=t.length;r<i;r++)if(c(t,r))return N.b.log("ADTS sync word found !"),!0;return!1},t.prototype.append=function(t,e,r,i){for(var a=this._audioTrack,n=B.a.getID3Data(t,0)||[],o=B.a.getTimeStamp(n),s=o?90*o:9e4*e,l=0,u=s,d=t.length,c=n.length,p=[{pts:u,dts:u,data:n}];c<d-1;)if(h(t,c)&&c+5=8){return["moof","ftyp","styp"].indexOf(t.bin2str(e.subarray(4,8)))>=0}return!1},t.bin2str=function(t){return String.fromCharCode.apply(null,t)},t.readUint32=function(t,e){t.data&&(e+=t.start,t=t.data);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return r>24,t[e+1]=r>>16&255;,t[e+2]=r>>8&255;,t[e+3]=255&r},t.findBox=function(e,r){var i,a,n,o,s,l,u,d=[];if(e.data?(l=e.start,o=e.end,e=e.data):(l=0,o=e.byteLength),!r.length)return null;for(i=l;i1?i+a:o,n===r[0]&&(1===r.length?d.push({data:e,start:i+8,end:u}):(s=t.findBox({data:e,start:i+8,end:u},r.slice(1)),s.length&&(d=d.concat(s)))),i=u;return d},t.parseInitSegment=function(e){var r=[];return t.findBox(e,["moov","trak"]).forEach(function(e){var i=t.findBox(e,["tkhd"])[0];if(i){var a=i.data[i.start],n=0===a?12:20,o=t.readUint32(i,n),s=t.findBox(e,["mdia","mdhd"])[0];if(s){a=s.data[s.start],n=0===a?12:20;var l=t.readUint32(s,n),u=t.findBox(e,["mdia","hdlr"])[0];if(u){var d=t.bin2str(u.data.subarray(u.start+8,u.start+12)),h={soun:"audio",vide:"video"}[d];h&&(r[o]={timescale:l,type:h},r[h]={timescale:l,id:o})}}}}),r},t.getStartDTS=function(e,r){var i,a,n;return i=t.findBox(r,["moof","traf"]),a=[].concat.apply([],i.map(function(r){return t.findBox(r,["tfhd"]).map(function(i){var a,n,o;return a=t.readUint32(i,4),n=e[a].timescale||9e4,o=t.findBox(r,["tfdt"]).map(function(e){var r,i;return r=e.data[e.start],i=t.readUint32(e,4),1===r&&(i*=Math.pow(2,32),i+=t.readUint32(e,8)),i})[0],(o=o||1/0)/n})})),n=Math.min.apply(null,a),isFinite(n)?n:0},t.offsetStartDTS=function(e,r,i){t.findBox(r,["moof","traf"]).map(function(r){return t.findBox(r,["tfhd"]).map(function(a){var n=t.readUint32(a,4),o=e[n].timescale||9e4;t.findBox(r,["tfdt"]).map(function(e){var r=e.data[e.start],a=t.readUint32(e,4);if(0===r)t.writeUint32(e,4,a-i*o);else{a*=Math.pow(2,32),a+=t.readUint32(e,8),a-=i*o;var n=Math.floor(a/(j+1)),s=Math.floor(a%(j+1));t.writeUint32(e,4,n),t.writeUint32(e,8,s)}})})})},t.prototype.append=function(e,r,i,a){var n=this.initData;n||(this.resetInitSegment(e,this.audioCodec,this.videoCodec),n=this.initData);var o=void 0,s=this.initPTS;if(void 0===s){var l=t.getStartDTS(n,e);this.initPTS=s=l-r,this.observer.trigger(D.a.INIT_PTS_FOUND,{initPTS:s})}t.offsetStartDTS(n,e,s),o=t.getStartDTS(n,e),this.remuxer.remux(n.audio,n.video,null,null,o,i,a,e)},t.prototype.destroy=function(){},t}(),W=K,V={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],appendFrame:function(t,e,r,i,a){if(!(r+24>e.length)){var n=this.parseHeader(e,r);if(n&&r+n.frameLength>3&3,i=t[e+1]>>1&3,a=t[e+2]>>4&15;,n=t[e+2]>>2&3,o=!!(2&t[e+2]);if(1!==r&&0!==a&&15;!==a&&3!==n){var s=3===r?3-i:3===i?3:4,l=1e3*V.BitratesMap[14*s+a-1],u=3===r?0:2===r?1:2,d=V.SamplingRateMap[3*u+n],h=o?1:0;return{sampleRate:d,channelCount:t[e+3]>>6==3?1:2,frameLength:3===i?(3===r?12:6)*l/d+h<<2:(3===r?144:72)*l/d+h|0}}},isHeaderPattern:function(t,e){return 255===t[e]&&224;==(224&t[e+1])&&0!=(6&t[e+1])},isHeader:function(t,e){return!!(e+1<t.length&&this;.isHeaderPattern(t,e))},probe:function(t,e){if(e+1<t.length&&this;.isHeaderPattern(t,e)){var r=this.parseHeader(t,e),i=4;r&&r.frameLength&&(i=r.frameLength);var a=e+i;if(a===t.length||a+1t?(this.word<>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<>>32-e;return t>32&&N.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<0&&this;.loadWord(),e=t-e,e>0&&this;.bitsAvailable?r<<e|this.readBits(e):r},t.prototype.skipLZ=function(){var t;for(t=0;t>>t))return this.word<>>1:-1*(t>>>1)},t.prototype.readBoolean=function(){return 1===this.readBits(1)},t.prototype.readUByte=function(){return this.readBits(8)},t.prototype.readUShort=function(){return this.readBits(16)},t.prototype.readUInt=function(){return this.readBits(32)},t.prototype.skipScalingList=function(t){var e,r,i=8,a=8;for(e=0;e<t;e++)0!==a&&(r=this.readEG(),a=(i+r+256)%6),i=0===a?i:a},t.prototype.readSPS=function(){var t,e,r,i,a,n,o,s=0,l=0,u=0,d=0,h=this.readUByte.bind(this),c=this.readBits.bind(this),f=this.readUEG.bind(this),p=this.readBoolean.bind(this),g=this.skipBits.bind(this),v=this.skipEG.bind(this),y=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);if(h(),t=h(),c(5),g(3),h(),y(),100===t||110===t||122===t||244===t||44===t||83===t||86===t||118===t||128===t){var b=f();if(3===b&&g(1),y(),y(),g(1),p())for(n=3!==b?8:12,o=0;o<n;o++)p()&&m(o<6?16:64)}y();var E=f();if(0===E)f();else if(1===E)for(g(1),v(),v(),e=f(),o=0;o<e;o++)v();y(),g(1),r=f(),i=f(),a=c(1),0===a&&g(1),g(1),p()&&(s=f(),l=f(),u=f(),d=f());var T=[1,1];if(p()&&p()){switch(h()){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:T=[h()<<8|h(),h()<=t.length)return void r();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,i),!i)return}}},t.prototype.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,a=32;a<=t.length-16;a+=160,i+=16)r.set(t.subarray(a,a+16),i);return r},t.prototype.getAvcDecryptedUnit=function(t,e){e=new Uint8Array(e);for(var r=0,i=32;i=t.length)return void i();for(var a=t[e].units;!(r>=a.length);r++){var n=a[r];if(!(n.length=564&&71;===t[0]&&71;===t[188]&&71;===t[376]},t.prototype.resetInitSegment=function(t,e,r,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack={container:"video/mp2t",type:"video",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:0},this._audioTrack={container:"video/mp2t",type:"audio",id:-1,inputTimeScale:9e4,duration:i,sequenceNumber:0,samples:[],len:0,isAAC:!0},this._id3Track={type:"id3",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this._txtTrack={type:"text",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=e,this.videoCodec=r,this._duration=i},t.prototype.resetTimeStamp=function(){},t.prototype.append=function(t,e,r,i){var a,n,o,s,l,u=t.length,d=!1;this.contiguous=r;var h=this.pmtParsed,c=this._avcTrack,f=this._audioTrack,p=this._id3Track,g=c.id,v=f.id,y=p.id,m=this._pmtId,b=c.pesData,E=f.pesData,T=p.pesData,R=this._parsePAT,S=this._parsePMT,A=this._parsePES,_=this._parseAVCPES.bind(this),L=this._parseAACPES.bind(this),w=this._parseMPEGPES.bind(this),I=this._parseID3PES.bind(this);for(u-=u8,a=0;a<u;a+=188)if(71===t[a]){if(n=!!(64&t[a+1]),o=((31&t[a+1])<>4>1){if((s=a+5+t[a+4])===a+188)continue}else s=a+4;switch(o){case g:n&&(b&&(l=A(b))&&_(l,!1),b={data:[],size:0}),b&&(b.data.push(t.subarray(s,a+188)),b.size+=a+188-s);break;case v:n&&(E&&(l=A(E))&&(f.isAAC?L(l):w(l)),E={data:[],size:0}),E&&(E.data.push(t.subarray(s,a+188)),E.size+=a+188-s);break;case y:n&&(T&&(l=A(T))&&I(l),T={data:[],size:0}),T&&(T.data.push(t.subarray(s,a+188)),T.size+=a+188-s);break;case 0:n&&(s+=t[s]+1),m=this._pmtId=R(t,s);break;case m:n&&(s+=t[s]+1);var O=S(t,s,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);g=O.avc,g>0&&(c.id=g),v=O.audio,v>0&&(f.id=v,f.isAAC=O.isAAC),y=O.id3,y>0&&(p.id=y),d&&!h&&(N.b.log("reparse from beginning"),d=!1,a=-188),h=this.pmtParsed=!0;break;case 17:case 8191:break;default:d=!0}}else this.observer.trigger(D.a.ERROR,{type:k.b.MEDIA_ERROR,details:k.a.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b&&(l=A(b))?(_(l,!0),c.pesData=null):c.pesData=b,E&&(l=A(E))?(f.isAAC?L(l):w(l),f.pesData=null):(E&&E.size&&N.b.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=E),T&&(l=A(T))?(I(l),p.pesData=null):p.pesData=T,null==this.sampleAes?this.remuxer.remux(f,c,p,this._txtTrack,e,r,i):this.decryptAndRemux(f,c,p,this._txtTrack,e,r,i)},t.prototype.decryptAndRemux=function(t,e,r,i,a,n,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,r,i,a,n,o)})}else this.decryptAndRemuxAvc(t,e,r,i,a,n,o)},t.prototype.decryptAndRemuxAvc=function(t,e,r,i,a,n,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,r,i,a,n,o)})}else this.remuxer.remux(t,e,r,i,a,n,o)},t.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},t.prototype._parsePAT=function(t,e){return(31&t[e+10])<<8|t[e+11]},t.prototype._parsePMT=function(t,e,r,i){var a,n,o,s,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=(15&t[e+1])<<8|t[e+2],n=e+3+a-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e<n;){switch(s=(31&t[e+1])<<8|t[e+2],t[e]){case 207:if(!i){N.b.log("unkown stream type:"+t[e]);break}case 15:-1===l.audio&&(l.audio=s);break;case 21:-1===l.id3&&(l.id3=s);break;case 219:if(!i){N.b.log("unkown stream type:"+t[e]);break}case 27:-1===l.avc&&(l.avc=s);break;case 3:case 4:r?-1===l.audio&&(l.audio=s,l.isAAC=!1):N.b.log("MPEG audio found, not supported in this browser for now");break;case 36:N.b.warn("HEVC stream type found, not supported for now");break;default:N.b.log("unkown stream type:"+t[e])}e+=5+((15&t[e+3])<<8|t[e+4])}return l},t.prototype._parsePES=function(t){var e,r,i,a,n,o,s,l,u=0,d=t.data;if(!t||0===t.size)return null;for(;d[0].length1;){var h=new Uint8Array(d[0].length+d[1].length);h.set(d[0]),h.set(d[1],d[0].length),d[0]=h,d.splice(1,1)}if(e=d[0],1===(e[0]<<16)+(e[1]<<8)+e[2]){if((i=(e[4]<t.size-6)return null;r=e[7],192&r&&(o=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,o>4294967295&&(o-=8589934592),64&r?(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,s>4294967295&&(s-=8589934592),o-s>54e5&&(N.b.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),a=e[8],l=a+9,t.size-=l,n=new Uint8Array(t.size);for(var c=0,f=d.length;cp){l-=p;continue}e=e.subarray(l),p-=l,l=0}n.set(e,u),u+=p}return i&&(i-=a+3),{data:n,pts:o,dts:s,len:i}}return null},t.prototype.pushAccesUnit=function(t,e){if(t.units.length&&t.frame){var r=e.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===t.key||e.sps&&(i||this.contiguous)?(t.id=i,r.push(t)):e.dropped++}t.debug.length&&N.b.log(t.pts+"/"+t.dts+":"+t.debug)},t.prototype._parseAVCPES=function(t,e){var r,i,a,n=this,o=this._avcTrack,s=this._parseAVCNALu(t.data),l=this.avcSample,u=!1,d=this.pushAccesUnit.bind(this),h=function(t,e,r,i){return{key:t,pts:e,dts:r,units:[],debug:i}};t.data=null,l&&s.length&&(d(l,o),l=this.avcSample=h(!1,t.pts,t.dts,"")),s.forEach(function(e){switch(e.type){case 1:i=!0,l.frame=!0;var s=e.data;if(u&&s.length>4){var c=new z(s).readSliceType();2!==c&&4!==c&&7!==c&&9!==c||(l.key=!0)}break;case 5:i=!0,l||(l=n.avcSample=h(!0,t.pts,t.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0,r=new z(n.discardEPB(e.data)),r.readUByte();for(var f=0,p=0,g=!1,v=0;!g&&r.bytesAvailable>1;){f=0;do{v=r.readUByte(),f+=v}while(255===v);p=0;do{v=r.readUByte(),p+=v}while(255===v);if(4===f&&0!==r.bytesAvailable){g=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var y=r.readUByte(),m=r.readUByte(),b=31&y,E=[y,m];for(a=0;a<b;a++)E.push(r.readUByte()),E.push(r.readUByte()),E.push(r.readUByte());n._insertSampleInOrder(n._txtTrack.samples,{type:3,pts:t.pts,bytes:E})}}}}}else if(p<r.bytesAvailable)for(a=0;a<p;a++)r.readUByte()}break;case 7:if(i=!0,u=!0,!o.sps){r=new z(e.data);var T=r.readSPS();o.width=T.width,o.height=T.height,o.pixelRatio=T.pixelRatio,o.sps=[e.data],o.duration=n._duration;var R=e.data.subarray(1,4),S="avc1.";for(a=0;a<3;a++){var A=R[a].toString(16);A.length0){if(e.pts>=t[r-1].pts)t.push(e);else for(var i=r-1;i>=0;i--)if(e.pts<t[i].pts){t.splice(i,0,e);break}}else t.push(e)},t.prototype._getLastNalUnit=function(){var t=this.avcSample,e=void 0;if(!t||0===t.units.length){var r=this._avcTrack,i=r.samples;t=i[i.length-1]}if(t){var a=t.units;e=a[a.length-1]}return e},t.prototype._parseAVCNALu=function(t){var e,r,i,a,n,o=0,s=t.byteLength,l=this._avcTrack,u=l.naluState||0,d=u,h=[],c=-1;for(-1===u&&(c=0,n=31&t[0],u=0,o=1);o=0)i={data:t.subarray(c,o-u-1),type:n},h.push(i);else{var f=this._getLastNalUnit();if(f&&(d&&o0)){var p=new Uint8Array(f.data.byteLength+r);p.set(f.data,0),p.set(t.subarray(0,r),f.data.byteLength),f.data=p}}o=0&&u>=0&&(i={data:t.subarray(c,s),type:n,state:u},h.push(i)),0===h.length){var g=this._getLastNalUnit();if(g){var v=new Uint8Array(g.data.byteLength+t.byteLength);v.set(g.data,0),v.set(t,g.data.byteLength),g.data=v}}return l.naluState=u,h},t.prototype.discardEPB=function(t){for(var e,r,i=t.byteLength,a=[],n=1;n<i-2;)0===t[n]&&0===t[n+1]&&3===t[n+2]?(a.push(n+2),n+=2):n++;if(0===a.length)return t;e=i-a.length,r=new Uint8Array(e);var o=0;for(n=0;n<e;o++,n++)o===a[0]&&(o++,a.shift()),r[n]=t[o];return r},t.prototype._parseAACPES=function(t){var e,r,i,a,n,o=this._audioTrack,s=t.data,l=t.pts,u=this.aacOverFlow,d=this.aacLastPTS;if(u){var c=new Uint8Array(u.byteLength+s.byteLength);c.set(u,0),c.set(s,u.byteLength),s=c}for(i=0,n=s.length;i<n-1&&!h(s,i);i++);if(i){var g,y;if(i1&&(N.b.log("AAC: align PTS for overlapping frames by "+Math.round((m-l)/90)),l=m)}for(;i<n;)if(h(s,i)&&i+5<n){var b=v(o,s,i,l,r);if(!b)break;i+=b.length,a=b.sample.pts,r++}else i++;u=i<n?s.subarray(i,n):null,this.aacOverFlow=u,this.aacLastPTS=a},t.prototype._parseMPEGPES=function(t){for(var e=t.data,r=e.length,i=0,a=0,n=t.pts;a<r;)if(Y.isHeader(e,a)){var o=Y.appendFrame(this._audioTrack,e,a,n,i);if(!o)break;a+=o.length,i++}else a++},t.prototype._parseID3PES=function(t){this._id3Track.samples.push(t)},t}(),$=J,Z=function(){function t(e,r,i){R(this,t),this.observer=e,this.config=i,this.remuxer=r}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){var e,r,i=B.a.getID3Data(t,0);if(i&&void; 0!==B.a.getTimeStamp(i))for(e=i.length,r=Math.min(t.length-1,e+100);e<r;e++)if(Y.probe(t,e))return N.b.log("MPEG Audio sync word found !"),!0;return!1},t.prototype.append=function(t,e,r,i){for(var a=B.a.getID3Data(t,0),n=90*B.a.getTimeStamp(a),o=a.length,s=t.length,l=0,u=0,d=this._audioTrack,h=[{pts:n,dts:n,data:a}];o>24&255;,e[1]=i>>16&255;,e[2]=i>>8&255;,e[3]=255&i,e.set(t,4),a=0,i=8;a>24&255;,e>>16&255;,e>>8&255;,255&e,i>>24,i>>16&255;,i>>8&255;,255&i,a>>24,a>>16&255;,a>>8&255;,255&a,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255;,e>>8&255;,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(it+1)),a=Math.floor(r%(it+1)),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255;,e>>16&255;,e>>8&255;,255&e,i>>24,i>>16&255;,i>>8&255;,255&i,a>>24,a>>16&255;,a>>8&255;,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,n)},t.sdtp=function(e){var r,i,a=e.samples||[],n=new Uint8Array(4+a.length);for(i=0;i<a.length;i++)r=a[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return t.box(t.types.sdtp,n)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var r,i,a,n=[],o=[];for(r=0;r>>8&255;),n.push(255&a),n=n.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255;),o.push(255&a),o=o.concat(Array.prototype.slice.call(i));var s=t.box(t.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|e.sps.length].concat(n).concat([e.pps.length]).concat(o))),l=e.width,u=e.height,d=e.pixelRatio[0],h=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255;,255&l,u>>8&255;,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([d>>24,d>>16&255;,d>>8&255;,255&d,h>>24,h>>16&255;,h>>8&255;,255&h])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255;,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255;,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,i=e.duration*e.timescale,a=e.width,n=e.height,o=Math.floor(i/(it+1)),s=Math.floor(i%(it+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255;,r>>16&255;,r>>8&255;,255&r,0,0,0,0,o>>24,o>>16&255;,o>>8&255;,255&o,s>>24,s>>16&255;,s>>8&255;,255&s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255;,255&a,0,0,n>>8&255;,255&n,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),a=e.id,n=Math.floor(r/(it+1)),o=Math.floor(r%(it+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255;,a>>8&255;,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255;,n>>8&255;,255&n,o>>24,o>>16&255;,o>>8&255;,255&o])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255;,r>>8&255;,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var i,a,n,o,s,l,u=e.samples||[],d=u.length,h=12+16*d,c=new Uint8Array(h);for(r+=8+h,c.set([0,0,15,1,d>>>24&255;,d>>>16&255;,d>>>8&255;,255&d,r>>>24&255;,r>>>16&255;,r>>>8&255;,255&r],0),i=0;i>>24&255;,n>>>16&255;,n>>>8&255;,255&n,o>>>24&255;,o>>>16&255;,o>>>8&255;,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<>>24&255;,l>>>16&255;,l>>>8&255;,255&l],12+16*i);return t.box(t.types.trun,c)},t.initSegment=function(e){t.types||t.init();var r,i=t.moov(e);return r=new Uint8Array(t.FTYP.byteLength+i.byteLength),r.set(t.FTYP),r.set(i,t.FTYP.byteLength),r},t}(),nt=at,ot=function(){function t(e,r,i,a){_(this,t),this.observer=e,this.config=r,this.typeSupported=i;var n=navigator.userAgent;this.isSafari=a&&a.indexOf("Apple")>-1&&n&&!n.match("CriOS"),this.ISGenerated=!1}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(t){this._initPTS=this._initDTS=t},t.prototype.resetInitSegment=function(){this.ISGenerated=!1},t.prototype.remux=function(t,e,r,i,a,n,o){if(this.ISGenerated){if(o){var s=this._initPTS,l=this._PTSNormalize,u=t.inputTimeScale||e.inputTimeScale,d=1/0,h=1/0,c=t.samples;if(c.length&&(d=h=l(c[0].pts-u*a,s)),c=e.samples,c.length){var f=c[0];d=Math.min(d,l(f.pts-u*a,s)),h=Math.min(h,l(f.dts-u*a,s))}if(d!==1/0){var p=s-d;Math.abs(p)>10*u&&(N.b.warn("timestamp inconsistency, "+(p/u).toFixed(3)+"s delta against expected value: missing discontinuity ? reset initPTS/initDTS"),this._initPTS=d,this._initDTS=h,this.observer.trigger(D.a.INIT_PTS_FOUND,{initPTS:d}))}}}else this.generateIS(t,e,a);if(this.ISGenerated)if(t.samples.length){t.timescale||(N.b.warn("regenerate InitSegment as audio detected"),this.generateIS(t,e,a));var g=this.remuxAudio(t,a,n,o);if(e.samples.length){var v=void 0;g&&(v=g.endPTS-g.startPTS),e.timescale||(N.b.warn("regenerate InitSegment as video detected"),this.generateIS(t,e,a)),this.remuxVideo(e,a,n,v,o)}}else{var y=void 0;e.samples.length&&(y=this.remuxVideo(e,a,n,o)),y&&t.codec&&this;.remuxEmptyAudio(t,a,n,y)}r.samples.length&&this;.remuxID3(r,a),i.samples.length&&this;.remuxText(i,a),this.observer.trigger(D.a.FRAG_PARSED)},t.prototype.generateIS=function(t,e,r){var i,a,n=this.observer,o=t.samples,s=e.samples,l=this.typeSupported,u="audio/mp4",d={},h={tracks:d},c=void 0===this._initPTS;if(c&&(i=a=1/0),t.config&&o.length&&(t.timescale=t.samplerate,N.b.log("audio sampling rate : "+t.samplerate),t.isAAC||(l.mpeg?(u="audio/mpeg",t.codec=""):l.mp3&&(t.codec="mp3")),d.audio={container:u,codec:t.codec,initSegment:!t.isAAC&&l.mpeg?new Uint8Array:nt.initSegment([t]),metadata:{channelCount:t.channelCount}},c&&(i=a=o[0].pts-t.inputTimeScale*r)),e.sps&&e.pps&&s.length){var f=e.inputTimeScale;e.timescale=f,d.video={container:"video/mp4",codec:e.codec,initSegment:nt.initSegment([e]),metadata:{width:e.width,height:e.height}},c&&(i=Math.min(i,s[0].pts-f*r),a=Math.min(a,s[0].dts-f*r),this.observer.trigger(D.a.INIT_PTS_FOUND,{initPTS:i}))}Object.keys(d).length?(n.trigger(D.a.FRAG_PARSING_INIT_SEGMENT,h),this.ISGenerated=!0,c&&(this._initPTS=i,this._initDTS=a)):n.trigger(D.a.ERROR,{type:k.b.MEDIA_ERROR,details:k.a.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},t.prototype.remuxVideo=function(t,e,r,i,a){var n,o,s,l,u,d,h,c=8,f=t.timescale,p=t.samples,g=[],v=p.length,y=this._PTSNormalize,m=this._initDTS,b=this.nextAvcDts,E=this.isSafari;E&&(r|=p.length&&b&&(a&&Math;.abs(e-b/f)<.1||Math.abs(p[0].pts-b-m)<f/5)),r||(b=e*f),p.forEach(function(t){t.pts=y(t.pts-m,b),t.dts=y(t.dts-m,b)}),p.sort(function(t,e){var r=t.dts-e.dts,i=t.pts-e.pts;return r||(i||t.id-e.id)});var T=p.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(T<0){N.b.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(T/90)+" ms to overcome this issue");for(var R=0;R1?N.b.log("AVC:"+A+" ms hole between fragments detected,filling it"):A<-1&&N.b.log("AVC:"+-A+" ms overlapping between fragments detected"),u=b,p[0].dts=u,l=Math.max(l-A,b),p[0].pts=l,N.b.log("Video/PTS/DTS adjusted: "+Math.round(l/90)+"/"+Math.round(u/90)+",delta:"+A+" ms")),S=p[p.length-1],h=Math.max(S.dts,0),d=Math.max(S.pts,0,h),E&&(n=Math.round((h-u)/(p.length-1)));for(var _=0,L=0,w=0;w<v;w++){for(var I=p[w],O=I.units,C=O.length,P=0,x=0;x<C;x++)P+=O[x].data.length;L+=P,_+=C,I.length=P,I.dts=E?u+w*n:Math.max(I.dts,u),I.pts=Math.max(I.pts,I.dts)}var F=L+4*_+8;try{o=new Uint8Array(F)}catch(t){return void this.observer.trigger(D.a.ERROR,{type:k.b.MUX_ERROR,details:k.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:F,reason:"fail allocating video mdat "+F})}var M=new DataView(o.buffer);M.setUint32(0,F),o.set(nt.types.mdat,4);for(var U=0;U<v;U++){for(var B=p[U],G=B.units,H=0,j=void 0,K=0,W=G.length;K<W;K++){var V=G[K],Y=V.data,X=V.data.byteLength;M.setUint32(c,X),c+=4,o.set(Y,c),c+=X,H+=4+X}if(E)j=Math.max(0,n*Math.round((B.pts-B.dts)/n));else{if(U0?U-1:U].dts;if(z.stretchShortVideoTrack){var Q=z.maxBufferHole,J=z.maxSeekHole,$=Math.floor(Math.min(Q,J)*f),Z=(i?l+i*f:this.nextAudioPts)-B.pts;Z>$?(n=Z-q,n-1){var et=g[0].flags;et.dependsOn=2,et.isNonSync=0}t.samples=g,s=nt.moof(t.sequenceNumber++,u,t),t.samples=[];var rt={data1:s,data2:o,startPTS:l/f,endPTS:(d+n)/f,startDTS:u/f,endDTS:this.nextAvcDts/f,type:"video",nb:g.length,dropped:tt};return this.observer.trigger(D.a.FRAG_PARSING_DATA,rt),rt},t.prototype.remuxAudio=function(t,e,r,i){var a,n,o,s,l,u,d,h=t.inputTimeScale,c=t.timescale,f=h/c,p=t.isAAC?1024:1152,g=p*f,v=this._PTSNormalize,y=this._initDTS,m=!t.isAAC&&this;.typeSupported.mpeg,b=t.samples,E=[],T=this.nextAudioPts;if(r|=b.length&&T&&(i&&Math;.abs(e-T/h)<.1||Math.abs(b[0].pts-T-y)<20*g),r||(T=e*h),b.forEach(function(t){t.pts=t.dts=v(t.pts-y,T)}),b.sort(function(t,e){return t.pts-e.pts}),i&&t.isAAC)for(var R=0,S=T;R<b.length;){var A,_=b[R],L=_.pts;A=L-S;var w=Math.abs(1e3*A/h);if(A=g&&w<1e4&&S){var I=Math.round(A/g);N.b.warn("Injecting "+I+" audio frame @ "+(S/h).toFixed(3)+"s due to "+Math.round(1e3*A/h)+" ms gap.");for(var O=0;O<I;O++){var C=Math.max(S,0);o=rt.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(N.b.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),o=_.unit.subarray()),b.splice(R,0,{unit:o,pts:C,dts:C}),t.len+=o.length,S+=g,R++}_.pts=_.dts=S,S+=g,R++}else Math.abs(A),_.pts=_.dts=S,S+=g,R++}for(var P=0,x=b.length;P0&&B0&&(o=rt.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(o=M.subarray()),t.len+=G*o.length);else if(B0))return;var H=m?t.len:t.len+8;a=m?0:8;try{s=new Uint8Array(H)}catch(t){return void this.observer.trigger(D.a.ERROR,{type:k.b.MUX_ERROR,details:k.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H})}if(!m){new DataView(s.buffer).setUint32(0,H),s.set(nt.types.mdat,4)}for(var j=0;j=2&&(W=E[V-2].duration,n.duration=W),V){this.nextAudioPts=T=d+f*W,t.len=0,t.samples=E,l=m?new Uint8Array:nt.moof(t.sequenceNumber++,u/f,t),t.samples=[];var Y=u/h,X=T/h,z={data1:l,data2:s,startPTS:Y,endPTS:X,startDTS:Y,endDTS:X,type:"audio",nb:V};return this.observer.trigger(D.a.FRAG_PARSING_DATA,z),z}return null},t.prototype.remuxEmptyAudio=function(t,e,r,i){var a=t.inputTimeScale,n=t.samplerate?t.samplerate:a,o=a/n,s=this.nextAudioPts,l=(void 0!==s?s:i.startDTS*a)+this._initDTS,u=i.endDTS*a+this._initDTS,d=1024*o,h=Math.ceil((u-l)/d),c=rt.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(N.b.warn("remux empty Audio"),!c)return void N.b.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var f=[],p=0;p<h;p++){var g=l+p*d;f.push({unit:c,pts:g,dts:g}),t.len+=c.length}t.samples=f,this.remuxAudio(t,e,r)},t.prototype.remuxID3=function(t,e){var r,i=t.samples.length,a=t.inputTimeScale,n=this._initPTS,o=this._initDTS;if(i){for(var s=0;s<i;s++)r=t.samples[s],r.pts=(r.pts-n)/a,r.dts=(r.dts-o)/a;this.observer.trigger(D.a.FRAG_PARSING_METADATA,{samples:t.samples})}t.samples=[],e=e},t.prototype.remuxText=function(t,e){t.samples.sort(function(t,e){return t.pts-e.pts});var r,i=t.samples.length,a=t.inputTimeScale,n=this._initPTS;if(i){for(var o=0;o<i;o++)r=t.samples[o],r.pts=(r.pts-n)/a;this.observer.trigger(D.a.FRAG_PARSING_USERDATA,{samples:t.samples})}t.samples=[],e=e},t.prototype._PTSNormalize=function(t,e){var r;if(void 0===e)return t;for(r=e4294967296;)t+=r;return t},t}(),st=ot,lt=function(){function t(e){L(this,t),this.observer=e}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(){},t.prototype.resetInitSegment=function(){},t.prototype.remux=function(t,e,r,i,a,n,o,s){var l=this.observer,u="";t&&(u+="audio"),e&&(u+="video"),l.trigger(D.a.FRAG_PARSING_DATA,{data1:s,startPTS:a,startDTS:a,type:u,nb:1,dropped:0}),l.trigger(D.a.FRAG_PARSED)},t}(),ut=lt,dt=function(){function t(e,r,i,a){w(this,t),this.observer=e,this.typeSupported=r,this.config=i,this.vendor=a}return t.prototype.destroy=function(){var t=this.demuxer;t&&t.destroy()},t.prototype.push=function(t,e,r,i,a,n,o,s,l,u,d,h){if(t.byteLength>0&&null;!=e&&null;!=e.key&&"AES-128"===e.method){var c=this.decrypter;null==c&&(c=this.decrypter=new U(this.observer,this.config));var f,p=this;try{f=performance.now()}catch(t){f=Date.now()}c.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var c;try{c=performance.now()}catch(t){c=Date.now()}p.observer.trigger(D.a.FRAG_DECRYPTED,{stats:{tstart:f,tdecrypt:c}}),p.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,n,o,s,l,u,d,h)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,n,o,s,l,u,d,h)},t.prototype.pushDecrypted=function(t,e,r,i,a,n,o,s,l,u,d,h){var c=this.demuxer;if(!c||o&&!this.probe(t)){for(var f=this.observer,p=this.typeSupported,g=this.config,v=[{demux:$,remux:st},{demux:H,remux:st},{demux:tt,remux:st},{demux:W,remux:ut}],y=0,m=v.length;ye?i.start+i.duration:Math.max(i.start-a.duration,0):r>e?(i.duration=n-i.start,i.duration<0&&wt;.b.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.start-n,a.duration<0&&wt;.b.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!"))}function v(t,e,r,i,a,n){if(!isNaN(e.startPTS)){var o=Math.abs(e.startPTS-r);isNaN(e.deltaPTS)?e.deltaPTS=o:e.deltaPTS=Math.max(o,e.deltaPTS),r=Math.min(r,e.startPTS),i=Math.max(i,e.endPTS),a=Math.min(a,e.startDTS),n=Math.max(n,e.endDTS)}var s=r-e.start;e.start=e.startPTS=r,e.endPTS=i,e.startDTS=a,e.endDTS=n,e.duration=i-r;var l=e.sn;if(!t||lt.endSN)return 0;var u,d,h;for(u=l-t.startSN,d=t.fragments,e=d[u],h=u;h>0;h--)g(d,h,h-1);for(h=u;h<d.length-1;h++)g(d,h,h+1);return t.PTSKnown=!0,s}function y(t,e){var r,i=Math.max(t.startSN,e.startSN)-e.startSN,a=Math.min(t.endSN,e.endSN)-e.startSN,n=e.startSN-t.startSN,o=t.fragments,s=e.fragments,l=0;if(a<i)return void(e.PTSKnown=!1);for(var u=i;u<=a;u++){var d=o[n+u],h=s[u];h&&d&&(l=d.cc-h.cc,isNaN(d.startPTS)||(h.start=h.startPTS=d.startPTS,h.endPTS=d.endPTS,h.duration=d.duration,h.backtracked=d.backtracked,h.dropped=d.dropped,r=h))}if(l)for(wt.b.log("discontinuity sliding from playlist, take drift into account"),u=0;u=0&&n<o.length){var c=o[n].start;for(u=0;u<s.length;u++)s[u].start+=c}e.PTSKnown=t.PTSKnown}function m(t,
- ADD: Delphi/CBuilder 10.2 Tokyo now supported.
- ADD: Delphi/CBuilder 10.1 Berlin now supported.
- ADD: Delphi/CBuilder 10 Seattle now supported.
- ADD: Delphi/CBuilder XE8 now supported.
- ADD: Delphi/CBuilder XE7 now supported.
- ADD: Delphi/CBuilder XE6 now supported.
- ADD: Delphi/CBuilder XE5 now supported.
- ADD: Delphi/CBuilder XE4 now supported.
- ADD: Delphi/CBuilder XE3 now supported.
- ADD: Delphi/CBuilder XE2 now supported.
- ADD: Delphi/CBuilder XE now supported.
- ADD: Delphi/CBuilder 2010 now supported.
- ADD: Delphi/CBuilder 2009 now supported.
- ADD: New demo project FlexCADImport.
- FIX: The height of the TFlexRegularPolygon object incorrectly changes with its rotation.
- FIX: Added division by zero protect in method TFlexControl.MovePathSegment.
- FIX: The background beyond docuemnt wasn't filled when TFlexPanel.DocClipping=True.
- FIX: In "Windows ClearType" font rendering mode (OS Windows mode) the "garbage" pixels can appear from the right and from the bottom sides of the painted rectangle of the TFlexText object.
- FIX: The result rectangle incorrectly calculated in the TFlexText.GetRefreshRect method.
- FIX: Added FPaintCache.rcPaint cleanup in the TFlexPanel.WMPaint method. Now it is possible to define is the drawing take place via WMPaint or via the PaintTo direct call (if rcPaint contain non-empty rectangle then WMPaint in progress).
- FIX: The TFlexPanel.FPaintCache field moved in the protected class section. Added rcPaint field in FPaintCache that represents drawing rectangle.
- ADD: In the text prcise mode (TFlexText.Precise=True) takes into account the rotation angle (TFlexText.Angle).
- FIX: Removed FG_NEWTEXTROTATE directive (the TFlexText Precise mode should be used instead).
- FIX: The TFlexRegularPolygon object clones incorrectly drawed in case when TFlexRegularPolygon have alternative brush (gradient, texture).
- ADD: Add TFlexPanel.InvalidateControl virtual method which calls from TFle
V7.3 Released on 14 Apr 2011
• New Feature: TJamFileList and TJamShellList now include a context menu for the column headers that allows turning on or off certain columns.
• New Feature: TJamDriveList has the new properties “WarnLevelPercent” and “ErrorLevelPercent”. They can be used to change the color of the small bar chart which shows the free space in yellow or red, dependant on the percentage of free space. The default values are 8 and 2 percent. Set these properies to 0 if you do not want the color to be changed.
• New Feature: The property “IconsBasedOnFileExtension” has been added to TJamShellList and TJamFileList. If set to True, icons will be queried from the system based on the file extension only. This is usually faster compared to using the full path. The most noticeable difference is for executable files, which will no longer show the included icon but a standard icon.
• New Feature: The method AutoAdjustColumnWidths() has been added to TJamShellList and TJamFileList. If called, it adjusts the column width to an optimal value, just like the shortcut Ctrl + Num+ does in every ListView.
• New Feature: The menu item “Paste Shortcut” has been added to the background context menu of the TJamShellList, just like it exists in the Windows Explorer. The chosen view type and sort column are now marked in the background context menu of TJamShellList.
• New Feature: The new property TJamFileList.AllowDropToBackground lets you decide if files can be added to the list using drag and drop. The default value is True.
• Improvement: The controls TJamShellCombo and TJamFolderCombo are now derived from TComboBoxEx instead of TComboBox. Since TComboBoxEx supports images and indents, we were able to remove our code for custom-drawing the items. The Windows XP Explorer also uses the Windows ComboBoxEx control for its address bar, that means our TJamShellCombo now looks more like the original Explorer control.
• Improvement: The type of the property BackgroundImage in TJamS
Revised February 11, 2012
This specification was developed in response to a perceived need for a standardized programming inter-face to digitizing tablets, three dimensional position sensors, and other pointing devices by a group of lead-ing digitizer manufacturers and applications developers. The availability of drivers that support the features of the specification will simplify the process of developing Windows appli¬cation programs that in-corporate absolute coordinate input, and enhance the acceptance of ad¬vanced pointing de¬vices among users.
This specification is intended to be an open standard, and as such the text and information contained herein may be freely used, copied, or distributed without compensation or licensing restrictions.
This document is copyright 1991-2012 by LCS/Telegraphics.*
Address questions and comments to:
LCS/Telegraphics
150 Rogers St.
Cambridge, MA 02142
(617)225-7970
(617)225-7969 FAX
Compuserve: 76506,1676
Internet: wintab@pointing.com
Note: sections marked with the “(1.1)” are new sections added for specification version 1.1. Sec-tions bearing the “(1.1 modified)” notation contain updated information for specification version 1.1.
Version 1.1 Update Notation Conventions 1
1. Background Information 1
1.1. Features of Digitizers 1
1.2. The Windows Environment 1
2. Design Goals 2
2.1. User Control 2
2.2. Ease of Programming 2
2.3. Tablet Sharing 3
2.4. Tablet Feature Support 3
3. Design Concepts 3
3.1. Device Conventions 3
3.2. Device Information 4
3.3. Tablet Contexts 4
3.4. Event Packets 4
3.5. Tablet Managers 5
3.6. Extensions 5
3.7. Persistent Binding of Interface Features (1.1) 6
4. Interface Implementations 6
4.1. File and Module Conventions 6
4.2. Feature Support Options 6
5. Function Reference 7
5.1. Basic Functions 7
5.1.1. WTInfo 8
5.1.2. WTOpen 9
5.1.3. WTClose 10
5.1.4. WTPacketsGet 10
5.1.5. WTPacket 11
5.2. Visibility Functions 11
5.2.1. WTEnable 11
5.2.2. WTOverlap 12
5.3. Context Editing Functions 12
5.3.1. WTConfig 12
5.3.2. WTGet 13
5.3.3. WTSet (1.1 modified) 13
5.3.4. WTExtGet 14
5.3.5. WTExtSet 14
5.3.6. WTSave 15
5.3.7. WTRestore 15
5.4. Advanced Packet and Queue Functions 16
5.4.1. WTPacketsPeek 16
5.4.2. WTDataGet 17
5.4.3. WTDataPeek 17
5.4.4. WTQueuePackets (16-bit only) 18
5.4.5. WTQueuePacketsEx 18
5.4.6. WTQueueSizeGet 19
5.4.7. WTQueueSizeSet 19
5.5. Manager Handle Functions 19
5.5.1. WTMgrOpen 19
5.5.2. WTMgrClose 20
5.6. Manager Context Functions 20
5.6.1. WTMgrContextEnum 20
5.6.2. WTMgrContextOwner 21
5.6.3. WTMgrDefContext 22
5.6.4. WTMgrDefContextEx (1.1) 22
5.7. Manager Configuration Functions 23
5.7.1. WTMgrDeviceConfig 23
5.7.2. WTMgrConfigReplace (16-bit only) 24
5.7.3. WTMgrConfigReplaceEx 24
5.8. Manager Packet Hook Functions 25
5.8.1. WTMgrPacketHook (16-bit only) 26
5.8.2. WTMgrPacketHookEx 26
5.8.3. WTMgrPacketUnhook 29
5.8.4. WTMgrPacketHookDefProc (16-bit only) 30
5.8.5. WTMgrPacketHookNext 30
5.9. Manager Preference Data Functions 31
5.9.1. WTMgrExt 31
5.9.2. WTMgrCsrEnable 32
5.9.3. WTMgrCsrButtonMap 32
5.9.4. WTMgrCsrPressureBtnMarks (16-bit only) 33
5.9.5. WTMgrCsrPressureBtnMarksEx 33
5.9.6. WTMgrCsrPressureResponse 34
5.9.7. WTMgrCsrExt 35
6. Message Reference 36
6.1. Event Messages 36
6.1.1. WT_PACKET 36
6.1.2. WT_CSRCHANGE (1.1) 37
6.2. Context Messages 37
6.2.1. WT_CTXOPEN 37
6.2.2. WT_CTXCLOSE 37
6.2.3. WT_CTXUPDATE 38
6.2.4. WT_CTXOVERLAP 38
6.2.5. WT_PROXIMITY 38
6.3. Information Change Messages 39
6.3.1. WT_INFOCHANGE 39
7. Data Reference 39
7.1. Common Data Types (1.1 modified) 39
7.2. Information Data Structures 41
7.2.1. AXIS 41
7.2.2. Information Categories and Indices (1.1 modified) 42
7.3. Context Data Structures 50
7.3.1. LOGCONTEXT (1.1 modified) 50
7.4. Event Data Structures 55
7.4.1. PACKET (1.1 modified) 55
7.4.2. ORIENTATION 57
7.4.3. ROTATION (1.1) 58
Appendix A. Using PKTDEF.H 59
Appendix B. Extension Definitions 60
B.1. Extensions Programming 60
B.2. Out of Bounds Tracking 61
OBT Programming 61
Information Category 61
Turning OBT On and Off 61
B.3. Function Keys 62
FKEYS Programming 62
Information Category 62
B.4. Tilt 62
TILT Programming 63
Information Category 63
B.5. Cursor Mask 63
CSRMASK Programming 64
Information Category 64
B.6. Extended Button Masks 64
XBTNMASK Programming 64
Information Category 65
VERSION 1.1 UPDATE NOTATION CONVENTIONS
Sections marked with the “(1.1)” are new sections added for specification version 1.1. Sections bearing the “(1.1 modified)” notation contain updated information for specification version 1.1.
The “(1.1)” notation also marks the definitions of new functions, messages, and data structures. The nota-tion “1.1:” marks new text or commentaries explaining new functionality added to existing features.
1 BACKGROUND INFORMATION
This document describes a programming interface for using digitizing tablets and other advanced pointing de¬vices with Microsoft Windows Version 3.0 and above. The design presented here is based on the input of numerous professionals from the pointing device manufacturing and Windows soft¬ware development industries.
In this document, the words "tablet" and "digitizer" are used interchange¬ably to mean all absolute point¬ing or digitizing devices that can be made to work with this interface. The definition is not lim¬ited to de¬vices that use a physical tablet. In fact, this specification can support de¬vices that combine rela¬tive and absolute pointing as well as purely relative devices.
The following sections describe features of tablets and of the Windows environment that helped mo¬tivate the design.
1.1 Features of Digitizers
Digitizing tablets present several problems to device interface authors.
• Many tablets have a very high report rate.
• Many tablets have many configurable features and types of input information.
• Tablets often control the system cursor, provide additional digitizing input, and provide template or macro functions.
1.2 The Windows Environment
Programming for tablets in the Windows environment presents additional problems.
• Multitasking means multiple applications may have to share the tablet.
• The tablet must also be able to control the system cursor and/or the pen (in Pen Windows).
• The tablet must work with legacy applications, and with applications written to take advan¬tage of tablet services.
• The tablet driver must add minimal speed and memory overhead, so as many applications as possible can run as efficiently as possible.
• The user should be able to control how applications use the tablet. The user interface must be ef-ficient, consistent, and customizable.
2 DESIGN GOALS
While the tablet interface design must address the technical problems stated above, it must also be useful to the programmers who will write tablet programs, and ultimately, to the tablet users. Four design goals will help clarify these needs, and provide some criteria for evaluating the interface speci¬fication. The goals are user control, ease of programming, tablet sharing, and tablet feature support.
2.1 User Control
The user should be able to use and control the tablet in as natural and easy a manner as possible. The user's preferences should take precedence over application requests, where possible.
Here are questions to ask when thinking about user control as a design goal:
• Can the user understand how applications use the tablet?
• Is the interface for controlling tablet functions natural and unobtrusive?
• Is the user allowed to change things that help to customize the work environment, but pre¬vented from changing things over which applications must have control?
2.2 Ease of Programming
Programming is easiest when the amount of knowledge and effort required matches the task at hand. Writing simple programs should require only a few lines of code and a minimal understanding of the en-vironment. On the other hand, more advanced features and functions should be available to those who need them. The interface should accommodate three kinds of programmers: those who wish to write sim-ple tablet programs, programmers who wish to write complex applications that take full ad¬vantage of tab-let capabilities, and programmers who wish to provide tablet device control features. In addition, the inter-face should accommodate programmers in as many different programming lan¬guages, situations, and en-vironments as possible.
Questions to ask when thinking about ease of programming include:
• How hard is it to learn the interface and write a simple program that uses tablet input?
• Can programmers of complex applications control the features they need?
• Are more powerful tablet device control features available?
• Can the interface be used in different programming environments?
• Is the interface logical, consistent, and robust?
2.3 Tablet Sharing
In the Windows environment, multiple applications that use the tablet may be running at once. Each ap-plication will require different services. Applications must be able to get the services they need without getting in each others' way.
Questions to ask when thinking about tablet sharing include:
• Can tablet applications use the tablet features they need, independent of other applications?
• Does the interface prevent a rogue application from "hijacking" the tablet, or causing dead¬locks?
• Does the sharing architecture promote efficiency?
2.4 Tablet Feature Support
The interface gives standard access to as many features as possible, while leaving room for future ex¬ten-sions and vendor-specific customizations. Applications should be able to get the tablet informa¬tion and services they want, just the way they want them. Users should be able to use the tablet to set up an effi-cient, comfortable work environment.
Questions to ask when thinking about tablet feature support include:
• Does the interface provide the features applications need? Are any commonly available fea¬tures not supported?
• Does the interface provide what users need? Is anything missing?
• Are future extensions possible and fairly easy?
• Are vendor-specific extensions possible?
3 DESIGN CONCEPTS
The proposed interface design depends on several fundamental concepts. Devices and cursor types de-scribe physical hardware configurations. The interface publishes read-only information through a single information interface. Applications interact with the interface by setting up tablet contexts and consuming event packets. Applications may assume interface and hardware control functions by be¬coming tablet managers. The interface provides explicit support for future extensions.
3.1 Device Conventions
The interface provides access to one or more devices that produce pointing input. Devices sup¬ported by this interface have some common characteristics. The device must define an absolute or relative coordi-nate space in at least two dimensions for which it can return position data. The device must have a point-ing ap¬para¬tus or method (such as a stylus, or a finger touching a touch pad), called the cursor, that de¬fines the current position. The cursor must be able to return at least one bit of additional state (via a but¬ton, touching a digitizing surface, etc.).
Devices may have multiple cursor types that have different physical configurations, or that have differ¬ent numbers of buttons, or return auxiliary information, such as pressure information. Cursor types may also describe different optional hardware configurations.
The interface defines a standard orientation for reporting device native coordinates. When the user is viewing the device in its normal position, the coordinate origin will be at the lower left of the device. The coordinate system will be right-handed, that is, the positive x axis points from left to right, and the posi¬tive y axis points either upward or away from the user. The z axis, if supported, points either to¬ward the user or upward. For devices that lay flat on a table top, the x-y plane will be horizontal and the z axis will point upward. For devices that are oriented vertically (for example, a touch screen on a conventional dis¬play), the x-y plane will be vertical, and the z axis will point toward the user.
3.2 Device Information
Any program can get descriptive information about the tablet via the WTInfo function. The interface specifies certain information that must be available, but allows new implementations to add new types of information. The basic information includes device identifiers, version numbers, and overall ca¬pabilities.
The information items are organized by category and index numbers. The combination of a category and index specifies a single information data item, which may be a scalar value, string, structure, or array. Applica¬tions may retrieve single items or whole categories at once.
Some categories are multiplexed. A single category code represents the first of a group of identically in-dexed categories, one for each of a set of similar objects. Multiplexed categories in¬clude those for devices and cur¬sor types. One constructs the category number by adding the defined cate¬gory code to a zero-based device or cursor identification number.
The information is read-only for normal tablet applications. Some information items may change during the course of a Windows session; tablet applications receive messages notifying them of changes in tablet information.
3.3 Tablet Contexts
Tablet contexts play a central role in the interface; they are the objects that applications use to specify their use of the tablet. Con¬texts include not only the physical area of the tablet that the application will use, but also information about the type, con¬tents, and delivery method for tablet events, as well as other information. Tablet contexts are somewhat analo¬gous to display contexts in the GDI interface model; they contain context information about a spe¬cific application's use of the tablet.
An application can open more than one context, but most only need one. Applications can customize their contexts, or they can open a context using a default context specification that is always available. The WTInfo function provides access to the default context specification.
Opening a context requires a window handle. The window handle becomes the context's owner and will receive any window messages associated with the context.
Contexts are remotely similar to screen windows in that they can physically overlap. The tablet inter¬face uses a combination of context overlap order and context attributes to decide which context will process a given event. The topmost context in the overlap order whose input context encompasses the event, and whose event masks select the event, will process the event. (Note that the notion of overlap order is sepa-rate from the notion of the physical z dimension.) Tablet managers (described below) provide a way to modify and overlap contexts.
3.4 Event Packets
Tablet contexts generate and report tablet activity via event packets. Applications can control how they receive events, which events they receive, and what information they contain.
Applications may receive events either by polling, or via Windows messages.
• Polling: Any application that has opened a context can call the WTPacketsGet function to get the next state of the tablet for that context.
• Window Messages: Applications that request messages will receive the WT_PACKET mes¬sage (described below), which indicates that something happened in the context and provides a refer-ence to more information.
Applications can control which events they receive by using event masks. For example, some appli¬ca¬tions may only need to know when a button is pressed, while others may need to receive an event every time the cursor moves. Tablet context event masks implement this type of control.
Applications can control the contents of the event packets they receive. Some tablets can return data that many applications will not need, like button pressure and three dimensional position and orien¬tation in-formation. The context object provides a way of specifying which data items the appli¬cation needs. This allows the driver to improve the efficiency of packet delivery to applications that only need a few items per packet.
Packets are stored in context-specific packet queues and retrieved by explicit function calls. The interface provides ways to peek at and get packets, to query the size and contents of the queue, and to re-size the queue.
3.5 Tablet Managers
The interface provides functions for tablet management. An application can become a tablet manager by opening a tablet manager handle. This handle allows the manager access to spe¬cial functions. These man-agement functions allow the application to arrange, overlap, and modify tablet contexts. Man¬agers may also perform other functions, such as changing default values used by applica¬tions, chang¬ing ergo¬nomic, preference, and configuration settings, controlling tablet behavior with non-tablet aware applica¬tions, modi¬fy¬ing user dialogs, and recording and playing back tablet packets. Opening a manager handle re¬quires a window handle. The window becomes a manager window and receives window messages about interface and con¬text activity.
3.6 Extensions
The interface allows implementations to define additional features called extensions. Extensions can be made available to new applications without the need to modify ex¬isting applications. Extensions are sup-ported through the information categories, through the flexible definition of packets, and through special context and manager functions.
Designing an extension involves defining the meaning and behavior of the extension packet and/or prefer-ence data, filling in the information category, defining the extension's interface with the special functions, and possibly defining additional functions to support the extension. Each extension will be assigned a unique tag for identification. Not all implementations will support all extensions.
A multiplexed information category contains descriptive data about extensions. Note that applica¬tions must find their extensions by iterating through the categories and matching tags. While tags are fixed across all implementations, category numbers may vary among implementations.
3.7 Persistent Binding of Interface Features (1.1)
The interface provides access to many of its features using consecutive numeric indices whose value is not guaranteed from session to session. However, sufficient information is provided to create unique identifi¬ers for devices, cursors, and interface extensions. Devices should be uniquely identified by the contents of their name strings. If multiple identical devices are present, implementation providers should provide unique, persistent id strings to the extent possible. Identical devices that return unique serial numbers are ideal. If supported by the hardware, cursors also may have a physical cursor id that uniquely identifies the cursor in a persistent and stable manner. Interface extensions are uniquely identified by their tag.
4 INTERFACE IMPLEMENTATIONS
Implementations of this interface usually support one specific device, a class of similar devices, or a com-mon combination of devices. The following sections discuss guidelines for implementations.
4.1 File and Module Conventions
For 16-bit implementations, the interface functions, and any additional vendor- or device-specific func-tions, reside in a dynamic link library with the file name "WINTAB.DLL" and module name "WINTAB"; 32-bit implementations use the file name "WINTAB32.DLL" and module name "WINTAB32." Any other file or module con¬ventions are implementation specific. Implementations may include other library mod-ules or data files as necessary. Installation processes are likewise implementa¬tion-specific.
Wintab programs written in the C language require two header files. WINTAB.H contains definitions of all of the functions, constants, and fixed data types. PKTDEF.H contains a parameterized definition of the PACKET data structure, that can be tailored to fit the application. The Wintab Programmer's Kit con¬tains these and other files necessary for Wintab programming, plus several example programs with C-lan¬guage source files. The Wintab Programmer's Kit is available from the author.
4.2 Feature Support Options
Some features of the interface are optional and may be left out by some implementations.
Support of defined data items other than x, y, and buttons is optional. Many devices only report x, y, and button information.
Support of system-cursor contexts is optional. This option relieves implementations of replacing the sys¬tem mouse driver in Windows versions before 3.1.
Support of Pen Windows contexts is optional. Not all systems will have the Pen Windows hardware and software necessary.
Support of external tablet manager applications is optional, and the number of manager handles is imple-mentation-dependent. However, the manager functions should be present in all implementa¬tions, return¬ing appropriate failure codes if not fully implemented. An implementation may provide context- and hardware-management support internally only, if desired. On the other hand, providing the external man-ager interface may relieve the implementation of a considerable amount of user in¬terface code, and make improvements to the manager interface easier to implement and distribute later.
Support of extension data items is optional. Most extensions will be geared to unusual hardware features.
5 FUNCTION REFERENCE
All tablet function names have the prefix "WT" and have attributes equivalent to WINAPI. Applica¬tions gain access to the tablet interface functions through a dynamic-link library with standard file and module names, as defined in the previous section. Applications may link to the functions by using the Windows functions LoadLibrary, FreeLibrary, and GetProcAddress, or use an import library.
Specific to 32-bit Wintab: The functions WTInfo, WTOpen, WTGet, and WTSet have both ANSI and Unicode versions, using the same ANSI/Unicode porting conventions used in the Win32 API. Five non-portable functions, WTQueuePackets, WTMgrCsrPressureBtnMarks, WTMgrConfigReplace, WTMgrPacketHook, and WTMgrPacketHookDefProc are replaced by new portable functions WTQueuePacketsEx, WTMgrCsrPressureBtnMarksEx, WTMgrConfigReplaceEx, WTMgrPack-etHookEx, WTMgrPacketUnhook, and WTMgrPacketHookNext. WTMgrConfigReplaceEx and WTMgrPacketHookEx have both ANSI and Unicode versions.
Table 5.1. Ordinal Function Numbers for Dynamic Linking
Ordinal numbers for dynamic linking are defined in the table below. Where two ordinal entries appear, the first entry identifies the 16-bit and 32-bit ANSI versions of the function. The second entry identifies the 32-bit Unicode version.
Function Name Ordinal Function Name Ordinal
WTInfo 20, 1020 WTMgrOpen 100
WTOpen 21, 1021 WTMgrClose 101
WTClose 22 WTMgrContextEnum 120
WTPacketsGet 23 WTMgrContextOwner 121
WTPacket 24 WTMgrDefContext 122
WTEnable 40 WTMgrDefContextEx (1.1) 206
WTOverlap 41 WTMgrDeviceConfig 140
WTConfig 60 WTMgrConfigReplace 141
WTGet 61, 1061 WTMgrConfigReplaceEx 202, 1202
WTSet 62, 1062 WTMgrPacketHook 160
WTExtGet 63 WTMgrPacketHookEx 203, 1203
WTExtSet 64 WTMgrPacketUnhook 204
WTSave 65 WTMgrPacketHookDefProc 161
WTRestore 66 WTMgrPacketHookNext 205
WTPacketsPeek 80 WTMgrExt 180
WTDataGet 81 WTMgrCsrEnable 181
WTDataPeek 82 WTMgrCsrButtonMap 182
WTQueuePackets 83 WTMgrCsrPressureBtnMarks 183
WTQueuePacketsEx 200 WTMgrCsrPressureBtnMarksEx 201
WTQueueSizeGet 84 WTMgrCsrPressureResponse 184
WTQueueSizeSet 85 WTMgrCsrExt 185
5.1 Basic Functions
The functions in the following section will be used by most tablet-aware applications. They include getting interface and device information, opening and closing contexts, and retrieving packets by polling or via Windows messages.
5.1.1 WTInfo
Syntax UINT WTInfo(wCategory, nIndex, lpOutput)
This function returns global information about the interface in an application-sup-plied buffer. Different types of information are specified by different index argu-ments. Applications use this function to receive information about tablet coordi-nates, physical dimensions, capabilities, and cursor types.
Parameter Type/Description
wCategory UINT Identifies the category from which information is being re-quested.
nIndex UINT Identifies which information is being requested from within the category.
lpOutput LPVOID Points to a buffer to hold the requested information.
Return Value The return value specifies the size of the returned information in bytes. If the infor-mation is not supported, the function returns zero. If a tablet is not physi¬cally pres-ent, this function always returns zero.
Comments Several important categories of information are available through this function. First, the function provides identification information, including specification and software version numbers, and tablet vendor and model information. Sec¬ond, the function provides general capability information, including dimensions, resolutions, optional features, and cursor types. Third, the function provides categories that give defaults for all tablet context attributes. Finally, the func¬tion may provide any other implementation- or vendor-specific information cat¬egories necessary.
The information returned by this function is subject to change during a Win¬dows session. Applications cannot change the information returned here, but tablet man-ager applications or hardware changes or errors can. Applications can respond to information changes by fielding the WT_INFOCHANGE message. The parameters of the message indicate which information has changed.
If the wCategory argument is zero, the function copies no data to the output buffer, but returns the size in bytes of the buffer necessary to hold the largest complete category. If the nIndex argument is zero, the function returns all of the information entries in the category in a single data structure.
If the lpOutput argument is NULL, the function just returns the required buffer size.
See Also Category and index definitions in tables 7.3 through 7.9, and the WT_INFOCHANGE message in section 6.3.1.
5.1.2 WTOpen
Syntax HCTX WTOpen(hWnd, lpLogCtx, fEnable)
This function establishes an active context on the tablet. On successful comple¬tion of this function, the application may begin receiving tablet events via mes¬sages (if they were requested), and may use the handle returned to poll the con¬text, or to per-form other context-related functions.
Parameter Type/Description
hWnd HWND Identifies the window that owns the tablet context, and receives messages from the context.
lpLogCtx LPLOGCONTEXT Points to an application-provided LOGCONTEXT data structure describing the context to be opened.
fEnable BOOL Specifies whether the new context will immediately begin processing input data.
Return Value The return value identifies the new context. It is NULL if the context is not opened.
Comments Opening a new context allows the application to receive tablet input or creates a context that controls the system cursor or Pen Windows pen. The owning window (and all manager windows) will immediately receive a WT_CTXOPEN message when the context has been opened.
If the fEnable argument is zero, the context will be created, but will not process input. The context can be enabled using the WTEnable function.
If tablet event messages were requested in the context specification, the owning window will receive them. The application can control the message numbers used the lcMsgBase field of the LOGCONTEXT structure.
The window that owns the new context will receive context and information change messages even if event messages were not requested. It is not necessary to handle these in many cases, but some applications may wish to do so.
The newly opened tablet context will be placed on the top of the context overlap or-der.
Invalid or out-of-range attribute values in the logical context structure will ei¬ther be validated, or cause the open to fail, depending on the attributes involved. Upon a successful return from the function, the context specification pointed to by lpLogCtx will contain the validated values.
See Also The WTEnable function in section 5.2.1, the LOGCONTEXT data structure in section 7.3.1, and the context and infor¬mation change messages in sections 6.2 and 6.3.
5.1.3 WTClose
Syntax BOOL WTClose(hCtx)
This function closes and destroys the tablet context object.
Parameter Type/Description
hCtx HCTX Identifies the context to be closed.
Return Value The function returns a non-zero value if the context was valid and was destroyed. Otherwise, it returns zero.
Comments After a call to this function, the passed handle is no longer valid. The owning win¬dow (and all manager windows) will receive a WT_CTXCLOSE message when the context has been closed.
See Also The WTOpen function in section 5.1.2.
5.1.4 WTPacketsGet
Syntax int WTPacketsGet(hCtx, cMaxPkts, lpPkts)
This function copies the next cMaxPkts events from the packet queue of context hCtx to the passed lpPkts buffer and removes them from the queue.
Parameter Type/Description
hCtx HCTX Identifies the context whose packets are being returned.
cMaxPkts int Specifies the maximum number of packets to return.
lpPkts LPVOID Points to a buffer to receive the event packets.
Return Value The return value is the number of packets copied in the buffer.
Comments The exact structure of the returned packet is determined by the packet infor¬mation that was requested when the context was opened.
The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow.
Applications may flush packets from the queue by calling this function with a NULL lpPkt argument.
See Also The WTPacketsPeek function in section 5.4.1, and the descriptions of the LOGCONTEXT (section 7.3.1) and PACKET (section 7.4.1) data structures.
5.1.5 WTPacket
Syntax BOOL WTPacket(hCtx, wSerial, lpPkt)
This function fills in the passed lpPkt buffer with the context event packet having the specified serial number. The returned packet and any older packets are removed from the context's internal queue.
Parameter Type/Description
hCtx HCTX Identifies the context whose packets are being returned.
wSerial UINT Serial number of the tablet event to return.
lpPkt LPVOID Points to a buffer to receive the event packet.
Return Value The return value is non-zero if the specified packet was found and returned. It is zero if the specified packet was not found in the queue.
Comments The exact structure of the returned packet is determined by the packet infor¬mation that was requested when the context was opened.
The buffer pointed to by lpPkts must be at least sizeof(PACKET) bytes long to pre-vent overflow.
Applications may flush packets from the queue by calling this function with a NULL lpPkts argument.
See Also The descriptions of the LOGCONTEXT (section 7.3.1) and PACKET (section 7.4.1) data structures.
5.2 Visibility Functions
The functions in this section allow applications to control contexts' visibility, whether or not they are pro-cessing input, and their overlap order.
5.2.1 WTEnable
Syntax BOOL WTEnable(hCtx, fEnable)
This function enables or disables a tablet context, temporarily turning on or off the processing of packets.
Parameter Type/Description
hCtx HCTX Identifies the context to be enabled or disabled.
fEnable BOOL Specifies enabling if non-zero, disabling if zero.
Return Value The function returns a non-zero value if the enable or disable request was satis¬fied, zero otherwise.
Comments Calls to this function to enable an already enabled context, or to disable an al¬ready disabled context will return a non-zero value, but otherwise do nothing.
The context’s packet queue is flushed on disable.
Applications can determine whether a context is currently enabled by using the WTGet function and examining the lcStatus field of the LOGCONTEXT struc¬ture.
See Also The WTGet function in section 5.3.2, and the LOGCONTEXT structure in sec¬tion 7.3.1.
5.2.2 WTOverlap
Syntax BOOL WTOverlap(hCtx, fToTop)
This function sends a tablet context to the top or bottom of the order of over¬lapping tablet contexts.
Parameter Type/Description
hCtx HCTX Identifies the context to move within the overlap order.
fToTop BOOL Specifies sending the context to the top of the overlap or-der if non-zero, or to the bottom if zero.
Return Value The function returns non-zero if successful, zero otherwise.
Comments Tablet contexts' input areas are allowed to overlap. The tablet interface main¬tains an overlap order that helps determine which context will process a given event. The topmost context in the overlap order whose input context encom¬passes the event, and whose event masks select the event will process the event.
This function is useful for getting access to input events when the application's con-text is overlapped by other contexts.
The function will fail only if the context argument is invalid.
5.3 Context Editing Functions
This group of functions allows applications to edit, save, and restore contexts.
5.3.1 WTConfig
Syntax BOOL WTConfig(hCtx, hWnd)
This function prompts the user for changes to the passed context via a dialog box.
Parameter Type/Description
hCtx HCTX Identifies the context that the user will modify via the dialog box.
hWnd HWND Identifies the window that will be the parent window of the dialog box.
Return Value The function returns a non-zero value if the tablet context was changed, zero oth-erwise.
Comments Tablet applications can use this function to let the user choose context attributes that the application doesn't need to control. Applications can control the editing of con¬text attributes via the lcLocks logical context structure member.
Applications should consider providing access to this function through a menu item or command.
See Also The LOGCONTEXT structure in section 7.3.1 and the context lock values in table 7.13.
5.3.2 WTGet
Syntax BOOL WTGet(hCtx, lpLogCtx)
This function fills the passed structure with the current context attributes for the passed handle.
Parameter Type/Description
hCtx HCTX Identifies the context whose attributes are to be copied.
lpLogCtx LPLOGCONTEXT Points to a LOGCONTEXT data structure to which the context attributes are to be copied.
Return Value The function returns a non-zero value if the data is retrieved successfully. Oth¬er¬wise, it returns zero.
See Also The LOGCONTEXT structure in section 7.3.1.
5.3.3 WTSet (1.1 modified)
Syntax BOOL WTSet(hCtx, lpLogCtx)
This function allows some of the context's attributes to be changed on the fly.
Parameter Type/Description
hCtx HCTX Identifies the context whose attributes are being changed.
lpLogCtx LPLOGCONTEXT Points to a LOGCONTEXT data structure containing the new context attributes.
Return Value The function returns a non-zero value if the context was changed to match the passed context specification; it returns zero if any of the requested changes could not be made.
Comments If this function is called by the task or process that owns the context, any context attribute may be changed. Otherwise, the function can change attributes that do not affect the format or meaning of the context's event packets and that were not speci-fied as locked when the context was opened. Context lock values can only be changed by the context’s owner.
1.1: If the hCtx argument is a default context handle returned from WTMgrDef-Context or WTMgrDefContextEx, and the lpLogCtx argument is WTP_LPDEFAULT, the default context will be reset to its initial factory default values.
See Also The LOGCONTEXT structure in section 7.3.1 and the context lock values in table 7.13.
5.3.4 WTExtGet
Syntax BOOL WTExtGet(hCtx, wExt, lpData)
This function retrieves any context-specific data for an extension.
Parameter Type/Description
hCtx HCTX Identifies the context whose extension attributes are being retrieved.
wExt UINT Identifies the extension tag for which context-specific data is being retrieved.
lpData LPVOID Points to a buffer to hold the retrieved data.
Return Value The function returns a non-zero value if the data is retrieved successfully. Oth¬er¬wise, it returns zero.
See Also The extension definitions in Appendix B.
5.3.5 WTExtSet
Syntax BOOL WTExtSet(hCtx, wExt, lpData)
This function sets any context-specific data for an extension.
Parameter Type/Description
hCtx HCTX Identifies the context whose extension attributes are being modified.
wExt UINT Identifies the extension tag for which context-specific data is being modified.
lpData LPVOID Points to the new data.
Return Value The function returns a non-zero value if the data is modified successfully. Oth¬er¬wise, it returns zero.
Comments Extensions may forbid their context-specific data to be changed during the life¬time of a context. For such extensions, calls to this function would always fail.
Extensions may also limit context data editing to the task of the owning window, as with the context locks.
See Also The extension definitions in Appendix B, the LOGCONTEXT data structure in section 7.3.1 and the context locking values in table 7.13.
5.3.6 WTSave
Syntax BOOL WTSave(hCtx, lpSaveInfo)
This function fills the passed buffer with binary save information that can be used to restore the equivalent context in a subsequent Windows session.
Parameter Type/Description
hCtx HCTX Identifies the context that is being saved.
lpSaveInfo LPVOID Points to a buffer to contain the save information.
Return Value The function returns non-zero if the save information is successfully retrieved. Oth-erwise, it returns zero.
Comments The size of the save information buffer can be determined by calling the WTInfo function with category WTI_INTERFACE, index IFC_CTXSAVESIZE.
The save information is returned in a private binary data format. Applications should store the information unmodified and recreate the context by passing the save information to the WTRestore function.
Using WTSave and WTRestore allows applications to easily save and restore ex-tension data bound to contexts.
See Also The WTRestore function in section 5.3.7.
5.3.7 WTRestore
Syntax HCTX WTRestore(hWnd, lpSaveInfo, fEnable)
This function creates a tablet context from save information returned from the WTSave function.
Parameter Type/Description
hWnd HWND Identifies the window that owns the tablet context, and receives messages from the context.
lpSaveInfo LPVOID Points to a buffer containing save information.
fEnable BOOL Specifies whether the new context will immediately begin processing input data.
Return Value The function returns a valid context handle if successful. If a context equivalent to the save information could not be created, the function returns NULL.
Comments The save information is in a private binary data format. Applications should only pass save information retrieved by the WTSave function.
This function is much like WTOpen, except that it uses save in¬formation for input instead of a logical context. In particular, it will generate a WT_CTXOPEN mes¬sage for the new context.
See Also The WTOpen function in section 5.1.2, the WTSave function in section 5.3.6, and the WT_CTXOPEN message in section 6.2.1.
5.4 Advanced Packet and Queue Functions
These functions provide advanced packet retrieval and queue manipulation. The packet retrieval functions require the application to provide a packet output buffer. To prevent overflow, the buffer must be large enough to hold the requested number of packets from the specified context. It is up to the caller to deter¬mine the packet size (by interrogating the context, if necessary), and to allocate a large enough buffer. Ap¬plications may flush packets from the queue by passing a NULL buffer pointer.
5.4.1 WTPacketsPeek
Syntax int WTPacketsPeek(hCtx, cMaxPkts, lpPkts)
This function copies the next cMaxPkts events from the packet queue of context hCtx to the passed lpPkts buffer without removing them from the queue.
Parameter Type/Description
hCtx HCTX Identifies the context whose packets are being read.
cMaxPkts int Specifies the maximum number of packets to return.
lpPkts LPVOID Points to a buffer to receive the event packets.
Return Value The return value is the number of packets copied in the buffer.
Comments The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow.
See Also the WTPacketsGet function in section 5.1.4.
5.4.2 WTDataGet
Syntax int WTDataGet(hCtx, wBegin, wEnd, cMaxPkts, lpPkts, lpNPkts)
This function copies all packets with serial numbers between wBegin and wEnd in-clusive from the context's queue to the passed buffer and removes them from the queue.
Parameter Type/Description
hCtx HCTX Identifies the context whose packets are being returned.
wBegin UINT Serial number of the oldest tablet event to return.
wEnd UINT Serial number of the newest tablet event to return.
cMaxPkts int Specifies the maximum number of packets to return.
lpPkts LPVOID Points to a buffer to receive the event packets.
lpNPkts LPINT Points to an integer to receive the number of packets ac-tually copied.
Return Value The return value is the total number of packets found in the queue between wBegin and wEnd.
Comments The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow.
See Also The WTDataPeek function in section 5.4.3, and the WTQueuePacketsEx function in section 5.4.5.
5.4.3 WTDataPeek
Syntax int WTDataPeek(hCtx, wBegin, wEnd, cMaxPkts, lpPkts, lpNPkts)
This function copies all packets with serial numbers between wBegin and wEnd in-clusive, from the context's queue to the passed buffer without removing them from the queue.
Parameter Type/Description
hCtx HCTX Identifies the context whose packets are being read.
wBegin UINT Serial number of the oldest tablet event to return.
wEnd UINT Serial number of the newest tablet event to return.
cMaxPkts int Specifies the maximum number of packets to return.
lpPkts LPVOID Points to a buffer to receive the event packets.
lpNPkts LPINT Points to an integer to receive the number of packets ac-tually copied.
Return Value The return value is the total number of packets found in the queue between wBegin and wEnd.
Comments The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow.
See Also The WTDataGet function in section 5.4.2, and the WTQueuePacketsEx function in section 5.4.5.
5.4.4 WTQueuePackets (16-bit only)
Syntax DWORD WTQueuePackets(hCtx)
This function returns the serial numbers of the oldest and newest packets cur¬rently in the queue.
Parameter Type/Description
hCtx HCTX Identifies the context whose queue is being queried.
Return Value The high word of the return value contains the newest packet's serial number; the low word contains the oldest.
Comments This function is non-portable and is superseded by WTQueuePacketsEx.
See Also The WTQueuePacketsEx function in section 5.4.5.
5.4.5 WTQueuePacketsEx
Syntax BOOL WTQueuePacketsEx(hCtx, lpOld, lpNew)
This function returns the serial numbers of the oldest and newest packets cur¬rently in the queue.
Parameter Type/Description
hCtx HCTX Identifies the context whose queue is being queried.
lpOld UINT FAR * Points to an unsigned integer to receive the oldest packet's serial number.
lpNew UINT FAR * Points to an unsigned integer to receive the newest packet's serial number.
Return Value The function returns non-zero if successful, zero otherwise.
5.4.6 WTQueueSizeGet
Syntax int WTQueueSizeGet(hCtx)
This function returns the number of packets the context's queue can hold.
Parameter Type/Description
hCtx HCTX Identifies the context whose queue size is being re¬turned.
Return Value The return value is the number of packet the queue can hold.
See Also The WTQueueSizeSet function in section 5.4.7.
5.4.7 WTQueueSizeSet
Syntax BOOL WTQueueSizeSet(hCtx, nPkts)
This function attempts to change the context's queue size to the value specified in nPkts.
Parameter Type/Description
hCtx HCTX Identifies the context whose queue size is being set.
nPkts int Specifies the requested queue size.
Return Value The return value is non-zero if the queue size was successfully changed. Other¬wise, it is zero.
Comments If the return value is zero, the context has no queue because the function deletes the original queue before attempting to create a new one. The application must continue calling the function with a smaller queue size until the function returns a non-zero value.
See Also The WTQueueSizeGet function in section 5.4.6.
5.5 Manager Handle Functions
The functions described in this and subsequent sections are for use by tablet manager applications. The functions of this section create and destroy manager handles. These handles allow the interface code to limit the degree of simultaneous access to the powerful manager functions. Also, opening a manager handle lets the application receive messages about tablet interface activity.
5.5.1 WTMgrOpen
Syntax HMGR WTMgrOpen(hWnd, wMsgBase)
This function opens a tablet manager handle for use by tablet manager and con¬figu-ration applications. This handle is required to call the tablet management func¬tions.
Parameter Type/Description
hWnd HWND Identifies the window which owns the manager handle.
wMsgBase UINT Specifies the message base number to use when notifying the manager window.
Return Value The function returns a manager handle if successful, otherwise it returns NULL.
Comments While the manager handle is open, the manager window will receive context mes-sages from all tablet contexts. Manager windows also receive information change messages.
The number of manager handles available is interface implementation-dependent, and can be determined by calling the WTInfo function with category WTI_INTERFACE and index IFC_NMANAGERS.
See Also The WTInfo function in section 5.1.1, the WTMgrClose function in section 5.5.2, the description of message base numbers in section 6 and the context and in¬for¬ma-tion change messages in sections 6.2 and 6.3.
5.5.2 WTMgrClose
Syntax BOOL WTMgrClose(hMgr)
This function closes a tablet manager handle. After this function returns, the passed manager handle is no longer valid.
Parameter Type/Description
hMgr HMGR Identifies the manager handle to close.
Return Value The function returns non-zero if the handle was valid; otherwise, it returns zero.
5.6 Manager Context Functions
These functions provide access to all open contexts and their owners, and allow changing context de¬faults. Only tablet managers are allowed to manipulate tablet contexts belonging to other applica¬tions.
5.6.1 WTMgrContextEnum
Syntax BOOL WTMgrContextEnum(hMgr, lpEnumFunc, lParam)
This function enumerates all tablet context handles by passing the handle of each context, in turn, to the callback function pointed to by the lpEnumFunc pa¬rameter.
The enumeration terminates when the callback function returns zero.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
lpEnumFunc WTENUMPROC Is the procedure-instance address of the call-back function. See the following "Comments" section for details.
lParam LPARAM Specifies the value to be passed to the callback func-tion for the application's use.
Return Value The return value specifies the outcome of the function. It is non-zero if all con¬texts have been enumerated. Otherwise, it is zero.
Comments The address passed as the lpEnumFunc parameter must be created by using the MakeProcInstance function.
The callback function must have attributes equivalent to WINAPI. The callback function must have the following form:
Callback BOOL WINAPI EnumFunc(hCtx, lParam)
HCTX hCtx;
LPARAM lParam;
EnumFunc is a place holder for the application-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the applica-tion's module-definition file.
Parameter Description
hCtx Identifies the context.
lParam Specifies the 32-bit argument of the WTMgrContextEnum func-tion.
Return Value
The function must return a non-zero value to continue enumeration, or zero to stop it.
5.6.2 WTMgrContextOwner
Syntax HWND WTMgrContextOwner(hMgr, hCtx)
This function returns the handle of the window that owns a tablet context.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
hCtx HCTX Identifies the context whose owner is to be returned.
Return Value The function returns the context owner's window handle if the passed arguments are valid. Otherwise, it returns NULL.
Comments This function allows the tablet manager to coordinate tablet context manage¬ment with the states of the context-owning windows.
5.6.3 WTMgrDefContext
Syntax HCTX WTMgrDefContext(hMgr, fSystem)
This function retrieves a context handle that allows setting values for the current default digit¬izing or system context.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
fSystem BOOL Specifies retrieval of the default system context if non-zero, or the default digitizing context if zero.
Return Value The return value is the context handle for the specified default context, or NULL if the arguments were invalid.
Comments The default digitizing context is the context whose attributes are returned by the WTInfo function WTI_DEFCONTEXT category. The default system context is the context whose attributes are returned by the WTInfo function WTI_DEFSYSCTX category.
Editing operations on the retrieved handles will fail if the new default contexts do not meet certain requirements. The digitizing context must include at least buttons, x, and y in its packet data, and must return absolute coordinates.
1.1: Editing the current default digitizing context will also update the device-spe¬cific default context for the device listed in the lcDevice field of the default con¬text’s LOGCONTEXT structure.
See Also The WTInfo function in section 5.1.1 the WTMgrDefContextEx function in section 5.6.4, and the category and index definitions in tables 7.3 through 7.9.
5.6.4 WTMgrDefContextEx (1.1)
Syntax HCTX WTMgrDefContextEx(hMgr, wDevice, fSystem)
This function retrieves a context handle that allows setting values for the default digit¬izing or system context for a specified device.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
wDevice UINT Specifies the device for which a default context handle will be returned.
fSystem BOOL Specifies retrieval of the default system context if non-zero, or the default digitizing context if zero.
Return Value The return value is the context handle for the specified default context, or NULL if the arguments were invalid.
Comments The default digitizing contexts are contexts whose attributes are returned by the WTInfo function WTI_DDCTXS multiplexed category. The default system con-texts are contexts whose attributes are returned by the WTInfo function WTI_DSCTXS multiplexed category.
Editing operations on the retrieved handles will fail if the new default contexts do not meet certain requirements. The digitizing context must include at least buttons, x, and y in its packet data, and must return absolute coordinates.
See Also The WTInfo function in section 5.1.1, and the category and index definitions in tables 7.3 through 7.9.
5.7 Manager Configuration Functions
These functions allow manager applications to replace the default context configuration dialog and to display a configuration dialog for each hardware device.
5.7.1 WTMgrDeviceConfig
Syntax UINT WTMgrDeviceConfig(hMgr, wDevice, hWnd)
This function displays a custom modal tablet-hardware configuration dialog box, if one is supported.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
wDevice UINT Identifies the device that the user will configure via the dialog box.
hWnd HWND Identifies the window that will be the parent window of the dialog box. If this argument is NULL, the function will return non-zero if the dialog is supported, or zero otherwise.
Return Value The return value is zero if the dialog box is not supported. Otherwise, it is one of the following non-zero values.
Value Meaning
WTDC_CANCEL The user canceled the dialog without making any changes.
WTDC_OK The user made and confirmed changes.
WTDC_RESTART The user made and confirmed changes that require a sys-tem restart in order to take effect. The calling program should query the user to determine whether to restart. Restart Windows using the function call ExitWin-dows(EW_RESTARTWINDOWS, 0);.
5.7.2 WTMgrConfigReplace (16-bit only)
Syntax BOOL WTMgrConfigReplace(hMgr, fInstall, lpConfigProc)
This function allows a manager application to replace the default behavior of the WTConfig function.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
fInstall BOOL Specifies installation of a replacement function if non-zero, or removal of the current replacement if zero.
lpConfigProc WTCONFIGPROC Is the procedure-instance address of the new configuration function. This argument is ignored during a re¬moval request.
Return Value The function return non-zero if the installation or removal request succeeded. Oth-erwise, it returns zero.
Comments This function is non-portable and is superseded by WTMgrConfigReplaceEx.
See Also The WTConfig function in section 5.3.1, and for a description of the configuration callback function, see the WTMgrConfigReplaceEx function in section 5.7.3.
5.7.3 WTMgrConfigReplaceEx
Syntax BOOL WTMgrConfigReplaceEx(hMgr, fInstall, lpszModule, lpszCfgProc)
This function allows a manager application to replace the default behavior of the WTConfig function.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
fInstall BOOL Specifies installation of a replacement function if non-zero, or removal of the current replacement if zero.
lpszModule LPCTSTR Points to a null-terminated string that names a DLL module containing the new configuration function. This argument is ignored during a re¬moval request
lpszCfgProc LPCSTR Points to a null-terminated string that names the new configuration function. This argument is ignored during a re¬moval request.
Return Value The function return non-zero if the installation or removal request succeeded. Oth-erwise, it returns zero.
Comments The configuration callback function must have attributes equivalent to WINAPI.
Only one callback function may be installed at a time. The manager handle passed with the removal request must match the handle passed with the corre¬sponding in-stallation request.
Tablet managers that install a replacement context configuration function must re-move it before exiting.
Callback BOOL WINAPI ConfigProc(hWnd, hCtx)
HWND hWnd;
HCTX hCtx;
ConfigProc is a place holder for the application-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the applica-tion's module-definition file.
Parameter Description
hWnd Identifies the window that will be the parent window of the dialog box.
hCtx Identifies the context that the user will modify via the dialog box.
Return Value
The function returns a non-zero value if the tablet context was changed, zero oth-erwise.
Comments
The configuration function and resulting dialog box should analyze the lcLocks context structure member, and only allow editing of unlocked context attributes.
See Also
The WTConfig function in section 5.3.1.
5.8 Manager Packet Hook Functions
These functions allow manager applications to monitor, record, and play back sequences of tablet packets.
5.8.1 WTMgrPacketHook (16-bit only)
Syntax WTHOOKPROC WTMgrPacketHook(hMgr, fInstall, nType, lpFunc)
This function installs or removes a packet hook function.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
fInstall BOOL Specifies installation of a hook function if non-zero, or removal of the specified hook if zero.
nType int Specifies the packet hook to be installed. It can be any one of the following values:
Value Meaning
WTH_PLAYBACK Installs a packet playback hook.
WTH_RECORD Installs a packet record hook.
lpFunc WTHOOKPROC Is the procedure-instance address of the hook function to be installed. See the "Comments" section under WTMgrPacketHookEx for details.
Return Value When installing a hook, the return value points to the procedure-instance ad¬dress of the previously installed hook (if any). It is NULL if there is no previous hook; it is negative one if the hook cannot be installed. The application or library that calls this func¬tion should save this return value in the library's data segment. The fourth argument of the WTPacketHookDefProc function points to the location in memory where the library saves this return value.
When removing a hook, the return value is the passed lpFunc if successful, NULL otherwise.
Comments This function is non-portable and is superseded by WTMgrPacketHookEx and WTMgrPacketUnhook.
See Also the WTMgrPacketHookEx function in section 5.8.2, and the WTMgrPacketUn-hook function in section 5.8.3.
5.8.2 WTMgrPacketHookEx
Syntax HWTHOOK WTMgrPacketHookEx(hMgr, nType, lpszModule, lpszHookProc)
This function installs a packet hook function.
Parameter Type/Description
hMgr HMGR Is the valid manager handle that identifies the caller as a manager application.
nType int Specifies the packet hook to be installed. It can be any one of the following values:
Value Meaning
WTH_PLAYBACK Installs a packet playback hook.
WTH_RECORD Installs a packet record hook.
lpszModule LPCTSTR Points to a null-terminated string that names a DLL module containing the new hook function. See the following "Comments" section for details.
lpszHookProc LPCSTR Points to a null-terminated string that names the new hook function. See the following "Comments" section for details.
Return Value If the function succeeds, the return value is the handle of the installed hook func-tion. Otherwise, the return value is NULL.
Comments Packet hooks are a shared resource. Installing a hook affects all applications using the interface.
All Wintab hook functions must be exported functions residing in a DLL module.
The following section describes how to support the individual hook functions.
WTH_PLAYBACK
Wintab calls the WTH_PLAYBACK hook whenever a request for an event packet is made. The function is intended to be used to supply a previously recorded event packet for a compatible context.
The hook function must have attributes equivalent to WINAPI. The filter function must have the following form:
Hook Function
LRESULT WINAPI HookFunc(nCode, wParam, lParam);
int nCode;
WPARAM wParam;
LPARAM lParam;
HookFunc is a place holder for the library-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the library's mod¬ule-definition file.
Parameter Description
nCode Specifies whether the hook function should process the mes¬sage or call the WTMgrPacketHookDefProc (if installed by WTMgrPacketHook)or WTMgrPacketHookNext (if installed by WTMgrPacketHookEx) function. If the nCode parame¬ter is less than zero, the hook function should pass the message to the appropriate function without further process¬ing.
wParam Specifies the context handle whose event is being requested.
lParam Points to the packet being processed by the hook function.
Comments
The WTH_PLAYBACK function should copy an event packet to the buffer pointed to by the lParam pa¬rameter. The packet must have been previously recorded by us-ing the WTH_RECORD hook. It should not modify the packet. The return value should be the amount of time (in milliseconds) Wintab should wait before pro¬cess¬ing the mes¬sage. This time can be computed by calculation the difference between the time stamps of the current and previous packets. If the function returns zero, the message is processed immediately. Once it returns control to Wintab, the packet continues to be processed. If the nCode parameter is WTHC_SKIP, the hook func-tion should prepare to return the next recorded event message on its next call.
The packet pointed to by lParam will have the same structure as packets re¬trieved from the context normally. Wintab will validate the following packet items to en¬sure consistency: context handle, time stamp, and serial number. The remaining fields will be valid if the context used for playback is equivalent to the context from which the events were recorded.
The WTH_PLAYBACK hook will not be called to notify it of the display or re¬moval of system modal dialog boxes. It is expected that applications playing back packets will also be playing back window event messages using Windows' own hook functions.
While the WTH_PLAYBACK function is in effect, Wintab ignores all hardware in-put.
WTH_RECORD
The interface calls the WTH_RECORD hook whenever it processes a packet from a context event queue. The hook can be used to record the packet for later playback.
The hook function must have attributes equivalent to WINAPI. The hook function must have the following form:
Hook Function
LRESULT WINAPI HookFunc(nCode, wParam, lParam);
int nCode;
WPARAM wParam;
LPARAM lParam;
HookFunc is a place holder for the library-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the library's mod¬ule-definition file.
Parameter Description
nCode Specifies whether the hook function should process the mes¬sage or call the WTMgrPacketHookDefProc (if installed by WTMgrPacketHook)or WTMgrPacketHookNext (if installed by WTMgrPacketHookEx) function. If the nCode parame¬ter is less than zero, the hook function should pass the message to the appropriate function without further process¬ing.
wParam Specifies the context handle whose event is being processed.
lParam Points to the packet being processed by the hook function.
Comments
The WTH_RECORD function should save a copy of the packet for later play¬back. It should not modify the packet. Once it returns control to Wintab, the message con-tinues to be processed. The filter function does not require a return value.
The packet pointed to by lParam will have the same structure as packets re¬trieved from the context normally.
The WTH_RECORD hook will not be called to notify it of the display or re¬moval of system modal dialog boxes. It is expected that applications recording packets will also be recording window event messages using Windows' own hook functions.
5.8.3 WTMgrPacketUnhook
Syntax BOOL WTMgrPacketUnhook(hHook)
This function removes a hook function installed by the WTMgrPacketHookEx function.
Parameter Type/Description
hHook HWTHOOK Identifies the hook function to be removed.
Return Value The function returns a non-zero value if successful, zero otherwise.
See Also The WTMgrPacketHookEx function in section 5.8.2, and the WTMgrPack-etHookNext function in section 5.8.5.
5.8.4 WTMgrPacketHookDefProc (16-bit only)
Syntax LRESULT WTMgrPacketHookDefProc(nCode, wParam, lParam, lplpFunc)
This function calls the next function in a chain of packet hook functions. A packet hook function is a function that processes packets before they are re¬trieved from a context's queue. When applications define more than one hook function by using the WTMgrPacketHook function, Wintab places func¬tions of the same type in a chain.
Parameter Type/Description
nCode int Specifies a code used by the hook function to determine how to process the message.
wParam WPARAM Specifies the word parameter of the message that the hook function is processing.
lParam LPARAM Specifies the long parameter of the message that the hook function is processing.
lplpFunc WTHOOKPROC FAR * Points to a memory location that con-tains the WTHOOKPROC returned by the WTMgrPacketHook function. Wintab changes the value at this location after an appli-cation unhooks the hook using the WTMgrPacketHook function.
Return Value The return value specifies a value that is directly related to the nCode parameter.
Comments This function is non-portable and is superseded by the WTMgrPacketHookNext function.
See Also The WTMgrPacketHookNext function in section 5.8.5.
5.8.5 WTMgrPacketHookNext
Syntax LRESULT WTMgrPacketHookNext(hHook, nCode, wParam, lParam)
This function passes the hook information to the next hook function in the current hook chain.
Parameter Type/Description
hHook HWTHOOK Identifies the current hook.
nCode int Specifies the hook code passed to the current hook function.
wParam WPARAM Specifies the wParam value
Visual Assist Build 2107 支持vs2017 官方原版加破解补丁
requires software maintenance through 2016.07.15 (General release.)
NEW Added new refactoring Move Implementation to Header File. (case=10239) 6999, 8255, 8286, 9006, 9830, 10741, 10905, 11311, 11976, 12293
NEW Sort Selected Lines now supports ascending and descending options, as well as case-sensitive and case-insensitive options. (case=29858) 8876, 9194, 12143
NEW Smart Select now supports more granular selection when starting to grow a selection (enabled by default; reg value named SmartSelectEnableGranularStart). (case=90797) 12544
NEW Smart Select supports sub-word selection (disabled by default and dependent upon reg value SmartSelectEnableWordStart; reg values named SmartSelectSplitWordByCase and SmartSelectSplitWordByUnderscore). (case=97531)
NEW Support for disabling multithreaded parse during solution load (Performance page of VA Options dialog). (case=97903)
NEW Find Symbol in Solution dialog now optionally supports display of file and directory in dedicated columns (via context menu). (case=35181) 12054, 12566
NEW Added support for filtering hashtag cross-references from VA Hashtags toolwindow (via context menu). (case=96785)
NEW Added button to open File Explorer to VA File History directory (Performance page of VA Options dialog). (case=98234) 12686
NEW Option to disable spontaneous tooltips in Open File in Solution, Find Symbol in Solution and Goto Member dialogs (via context menu). (case=98240)
NEW Enhanced Open Corresponding File (alt+o) to support directory structure of some additional libraries. (case=96426)
[VS2010+] Fix for VA Navigate Back (alt+left arrow) failing to return to recorded column position. (case=97613) 12649
Fix for Smart Suggestion of vector of shared_ptr. (case=96425) 12604
Fixed Smart Suggestion namespace qualification of enum values in user-provided sample. (case=98073) 12661
Fix for failure to deduce auto rvalue ref type in range-based for loop. (case=96952) 12617
Sort Selected Lines honors system locale. (case=97868)
Fix for Create Declaration being confused by a function try block. (case=93234)
Fix for failure of Goto to work with variable defined using decltype expression. (case=93387) 12485
Various fixes for Smart Select selections. (case=94946, case=95812)
Improved auto type deduction in range-based for loops. (case=86248)
Improved Smart Suggestions of template variables in certain scenarios. (case=91733)
Fixed case in which parentheses were not automatically matched when complete with any character was enabled and '(' was used to commit the listbox selection. (case=97044)
Improved results of Goto and Goto Related on namespace usages that reference nested namespaces. (case=68241)
Fix for snippets inserted with incorrect line endings in empty files. (case=97752) 12655
Fixed case in which VA incorrectly handled static_assert in a class definition. (case=97232)
When Goto is invoked on an external type in XAML, VA prompts to open the Object Browser (instead of searching it without prompting). (case=96541)
Find Symbol in Solution dialog lists symbols defined in source files imported via nuget packages. (case=97175)
Fixed case in which VA Outline reported incorrect range of a #define in certain situations. (case=97224)
Add Missing Case Statements now supports switches on properties. (case=96542)
Fixed parsing of D2D interfaces and types that implement them. (case=97120)
Fixed case in which symbols defined via system include directories might be recognized in one solution but not in another. (case=97154, case=97190)
Fix for Move Implementation commands not properly selecting moved code in some cases. (case=96852)
Fixed case in which include resolution of files in system include directories might not be properly resolved. (case=97154)
Fixed case in which VA Snippet was processed with different end results when executed with in-editor placeholder expansion vs placeholder expansion via dialog. (case=96968)
Disabled implementation of case=4568 due to unexplained lag while typing templates in a specific situation (can be re-enabled via edit of reg value ReparseIfNeededMaxFileSize2). (case=98305)
[VS2015 Update 3] Enabled in-editor expansion of snippet input placeholders. (case=95894)
[VS2015 Update 3] When changing the state of the automatically extend multi-line comments setting, VA prompts to make the opposite action with the IDE provided feature in C#. (case=95605)
[VS2012+] Fixed positioning of Goto and Goto Related menus when invoked in XAML files. (case=98462)
[VS2010+] Fixed tab order in Snippet Editor. (case=98606)
[VC6] Fix for deadlock in some situations after using Add Class. (case=98643) 12701
"singleQuote":false,//singleQuote用单引号代替双引号。此值为true时<script>中的双引号全部变为单引号
"semi":false//使用分号
在.eslintrc.js文件里添加规则禁用
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off"