-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepo.js
44 lines (41 loc) · 1.24 KB
/
repo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict';
function play_audio(){
core_storage_save([
'duration',
'frequency',
'type',
'volume',
]);
audio_create({
'test': {
'duration': core_storage_data['duration'],
'frequency': core_storage_data['frequency'],
'type': core_storage_data['type'],
'volume': core_storage_data['volume'],
},
});
audio_start('test');
}
function repo_init(){
core_repo_init({
'events': {
'audio-play': {
'onclick': play_audio,
},
},
'info': '<button id=audio-play type=button>Play</button><br>',
'menu-block-events': false,
'menu-lock': true,
'storage': {
'duration': .1,
'frequency': 100,
'type': 'sine',
'volume': 1,
},
'storage-menu': '<table><tr><td><input id=duration min=0 step=any type=number><td>Duration'
+ '<tr><td><input id=frequency min=0 step=any type=number><td>Frequency'
+ '<tr><td><select id=type><option value=sawtooth>sawtooth<option value=sine>sine<option value=square>square<option value=triangle>triangle</select><td>Type'
+ '<tr><td><input id=volume min=0 step=any type=number><td>Volume</table>',
'title': 'AudioEditor.htm',
});
}