Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45c76fc

Browse files
committed
plug/unplug()
1 parent2c71020 commit45c76fc

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

‎README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ by running `npm remove midi-test --save-dev`.
6868

6969
```html
7070
<scriptsrc="https://cdn.jsdelivr.net/npm/jzz"></script> // the latest version, or
71-
<scriptsrc="https://cdn.jsdelivr.net/npm/jzz@1.9.1"></script> // any particular version
71+
<scriptsrc="https://cdn.jsdelivr.net/npm/jzz@1.9.2"></script> // any particular version
7272
//...
7373
```
7474

7575
#####CDN (unpkg)
7676

7777
```html
7878
<scriptsrc="https://unpkg.com/jzz"></script> // the latest version, or
79-
<scriptsrc="https://unpkg.com/jzz@1.9.1"></script> // any particular version
79+
<scriptsrc="https://unpkg.com/jzz@1.9.2"></script> // any particular version
8080
//...
8181
```
8282

‎javascript/JZZ.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
})(this,function(){
1515

1616
var_scope=typeofwindow==='undefined' ?global :window;
17-
var_version='1.9.1';
17+
var_version='1.9.2';
1818
vari,j,k,m,n;
1919

2020
/* istanbul ignore next */
@@ -376,6 +376,7 @@
376376

377377
_J.prototype._close=function(){
378378
_engine._close();
379+
for(vari=0;i<_plugged.length;i++)if(_plugged[i]&&_plugged[i].close)_plugged[i].close();
379380
};
380381

381382
// _M: MIDI-In/Out object
@@ -642,8 +643,9 @@
642643
}
643644

644645
var_jzz;
645-
var_engine={_outs:[],_ins:[]};
646+
var_engine={_outs:[],_ins:[],_close:_nop};
646647
var_virtual={_outs:[],_ins:[]};
648+
var_plugged=[];
647649

648650
// Node.js
649651
function_tryNODE(){
@@ -3831,6 +3833,16 @@
38313833
}
38323834
returnfalse;
38333835
};
3836+
JZZ.lib.plug=function(x){
3837+
for(vari=0;i<_plugged.length;i++)if(_plugged[i]==x)return;
3838+
_plugged.push(x);
3839+
};
3840+
JZZ.lib.unplug=function(x){
3841+
for(vari=0;i<_plugged.length;i++)if(_plugged[i]==x){
3842+
_plugged.splice(i,1);
3843+
return;
3844+
}
3845+
};
38343846
var_ac;
38353847
function_initAudioContext(){
38363848
if(!_ac&&typeofwindow!=='undefined'){

‎minified/JZZ.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"jzz",
3-
"version":"1.9.1",
3+
"version":"1.9.2",
44
"description":"MIDI library for Node.js and web-browsers",
55
"main":"javascript/JZZ.js",
66
"scripts": {
@@ -22,7 +22,7 @@
2222
"jazz-midi":"^1.7.9"
2323
},
2424
"devDependencies": {
25-
"eslint":"^9.22.0",
25+
"eslint":"^9.23.0",
2626
"grunt":"^1.6.1",
2727
"grunt-contrib-jshint":"^3.2.0",
2828
"grunt-contrib-uglify":"^5.2.2",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp