-
Notifications
You must be signed in to change notification settings - Fork 2
/
edit.htm
287 lines (279 loc) · 13.9 KB
/
edit.htm
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html>
<html lang="zh">
<!--
The file is a part of Foolplay(傻瓜弹曲)
Foolplay is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
for sources and more information, check https://gitee.com/asdfqw/FoolPlay
-->
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<meta name="color-scheme" content="light dark" />
<title>傻瓜弹曲</title>
<link rel="stylesheet" href="style.css" />
<link rel="manifest" href="manifest.json" />
</head>
<body>
<div class="window loading on destroy" style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);display:block">
<div class="content"><h1>傻瓜弹曲</h1><p align="right">正在加载<span id="loadfile">......</span>…… </p></div>
</div> <div class="window loading nojs" style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);display:block;opacity:1">
<div class="content"><h1>傻瓜弹曲</h1><p align="right">JavaScript已被禁用,因此本程序无法运行。 </p></div>
</div>
<script>loadfile.innerHTML = "网页内容布局"</script>
<script>document.querySelector('.nojs').outerHTML = '';</script>
<div class="menu line" style="position:fixed">
<div class="item">
文件
<div class="menu">
<a href="javascript:UI.new();">新建</a>
<a href="javascript:UI.open();">打开...</a>
<a href="javascript:UI.saveAs();">另存为...</a>
<hr>
<a href="javascript:Player.saveWav();">导出音频...</a>
<a href="javascript:void(UI.exportMidi(confirm('启用 UTF-8 支持?\n\n支持 UTF-8 的软件将显示中文歌词,而不支持 UTF-8 的软件会乱码。')));">导出 MIDI...</a>
<hr>
<a href="javascript:window.print();">打印...</a>
</div>
</div>
<div class="item">
编辑
<div class="menu">
<a href="javascript:UI.cut();">剪切</a>
<a href="javascript:UI.copy();">复制</a>
<a href="javascript:UI.paste();">粘贴</a>
<hr>
<div class="item">
输入
<div class="menu">
<label><input onclick="UI.defaultLength = parseInt(this.value)" type="radio" value="4" name="eightorfore"/>输入默认八分音符</label>
<label><input onclick="UI.defaultLength = parseInt(this.value)" type="radio" selected value="8" name="eightorfore"/>输入默认四分音符</label>
</div>
</div>
<div class="item">
音符操作
<div class="menu">
<a href="javascript:(function(){for(var i=UI.selStart;i<UI.selEnd;i++){Music.music[i].octave = Math.min(Music.music[i].octave+1,1)};UI.render();}())">升高八度</a>
<a href="javascript:(function(){for(var i=UI.selStart;i<UI.selEnd;i++){Music.music[i].octave = Math.max(Music.music[i].octave-1,-1)};UI.render();})()">降低八度</a>
<a href="javascript:(function(){if(!Music.music[UI.selStart])PopupWindow.alert('无选择。');Music.music[UI.selStart].fx.triplets = true;UI.render()})();">制作三连音...</a>
</div>
</div>
<a href="javascript:UI.switchLine(false)" >下移词光标</a>
<a href="javascript:UI.switchLine(true)" >上移词光标</a>
<hr>
<a href="javascript:UI.editPinyinGUI(Math.min(Math.max(UI.selStart - Number(UI.selStart ==UI.selEnd),0),Music.music.length-1))">修改拼音...</a>
</div>
</div>
<div class="item">
播放
<div class="menu">
<a href="javascript:(function(){Player.play();})();">播放</a>
<a href="javascript:(function(){Player.stop();})();">停止</a>
<hr>
<a href="javascript:(function(){Player.showVoiceWindow()})();">选择音源</a>
<a id="loadme" href="javascript:(function(){})();">英语支持未加载...</a>
<hr>
<label><input type="checkbox" checked autocomplete="off" onclick="Player.enableSMPlay = this.checked"/>编辑时奏音乐</label>
<hr>
<label><input type="checkbox" checked autocomplete="off" onclick="Player.enableMusic = this.checked"/>奏旋律</label>
<label><input type="checkbox" checked autocomplete="off" onclick="Player.enableVoice = this.checked"/>唱人声</label>
<label><input type="checkbox" checked autocomplete="off" onclick="Player.enableChord = this.checked"/>奏伴奏</label>
</div>
</div>
<div class="item">
视图
<div class="menu">
<label><input type="checkbox" autocomplete="off" onclick="document.body.className=( this.checked?'fensanalign':'');UI.layout();"/>对齐最后一行</label>
<label><input type="checkbox" autocomplete="off" onclick="UI.touchEnabled = this.checked"/>触摸启用选择</label>
<a onclick="UI.render()">重新渲染</a>
</div>
</div>
<div class="item">
帮助
<div class="menu">
<a href="javascript:UI.about('faq.html');" >FAQ...</a>
<a href="javascript:UI.about('index.html');" >关于...</a>
</div>
</div>
<div class="item">和弦
<div class="menu">
<a onclick="tagCur()">查看和弦计算结果</a>
<a onclick="Music.music = Music.flat();Music.loops = [];UI.render()">展开循环</a>
<hr>
<div style="color: gray">相关功能正在改进...</div>
</div>
</div>
</div>
<div class="header">
<center><input class="title" type="text" onchange="Music.title = this.value;document.title = this.value + ' - 傻瓜弹曲'" placeholder="请输入标题..."/></center>
<br/><label>1 =
<select class="arpeggio" size="1" style="max-width:2.3em;padding-left:0; padding-right: 0" onchange="Music.arpeggio = +this.value;">
<optgroup label="低八度⬇️">
<option value="-16">Ab</option>
<option value="-15">A</option>
<option value="-14">Bb</option>
<option value="-13">B ( bC )</option>
<option value="-12">C</option>
<option value="-11">Db ( C# )</option>
<option value="-10">D</option>
<option value="-9">Eb</option>
<option value="-8">E</option>
<option value="-7">F</option>
<option value="-6">F# ( bG )</option>
<option value="-5">G</option>
</optgroup>
<optgroup label="⬇️标准|低八度⬆️">
<option value="-4">Ab</option>
<option value="-3">A</option>
<option value="-2">Bb</option>
<option value="-1">B ( bC )</option>
<option selected value="0">C</option>
<option value="1">Db ( C# )</option>
<option value="2">D</option>
<option value="3">Eb</option>
<option value="4">E</option>
<option value="5">F</option>
<option value="6">F# ( bG )</option>
<option value="7">G</option>
</optgroup>
<optgroup label="⬆️标准|高八度⬇️">
<option value="8">Ab</option>
<option value="9">A</option>
<option value="10">Bb</option>
<option value="11">B ( bC )</option>
<option value="12">C</option>
<option value="13">Db ( C# )</option>
<option value="14">D</option>
<option value="15">Eb</option>
<option value="16">E</option>
<option value="17">F</option>
<option value="18">F# ( bG )</option>
<option value="19">G</option>
</optgroup>
</select>
</label><table style="display:inline-table">
<tr>
<td style="border-bottom:solid 1px">
<input type="number" class="tempo1" onchange="Music.tempo[1] = parseInt(this.value);UI.render();" required value="4" max="12" min="1">
</td>
</tr>
<tr>
<td>
<input type="number" class="tempo0" onchange="Music.tempo[0] = parseInt(this.value);UI.render();" required value="4" max="8" min="1" >
</td>
</tr>
</table>
 <label id="speedLabel" for="speed">速度:</label><input id="speed" class="spin" required value="120" min="10" max="400" size="3" step="1" oninput="Music.speed=this.value" style="text-align:left" type="number">
<textarea class="author" style="font-family: '宋体',monospace;float:right;text-align:right;overflow:hidden;" oninput='Music.author = this.value;' rows="3" cols="19"></textarea>
</div>
<div style="clear:both"></div>
<br>
<div id="coverOn" class="coverOn">
<div id="caret" class="caret"></div>
<div id="anoCaret" class="caret"></div>
<textarea class="editbox"></textarea>
<span id="imetip" ></span>
</div>
<div class="container">
</div>
<div class="status">
<div>就绪</div>
</div>
<div class="menu" id="contextMenu" style="display:none;position:fixed;">
<a href="javascript:UI.copy()">复制</a>
<a href="javascript:UI.paste()">粘贴</a>
<a href="javascript:UI.selStart = 0;UI.selEnd = 999999999999;UI.redraw();">全选</a>
<a href="javascript:UI.delete();">删除</a>
<a href="javascript:UI.editPinyinGUI(UI.contextMenuNote)">修改拼音...</a>
<hr>
<a href="javascript:(function(){for(var i=UI.selStart;i<UI.selEnd;i++){Music.music[i].octave = Math.min(Music.music[i].octave+1,1)};UI.render();}())">升高八度</a>
<a href="javascript:(function(){for(var i=UI.selStart;i<UI.selEnd;i++){Music.music[i].octave = Math.max(Music.music[i].octave-1,-1)};UI.render();})()">降低八度</a>
<a href="javascript:(function(){if(UI.selStart == -1){UI.selStart = UI.selEnd};Music.music[UI.selStart].fx.triplets = true;UI.render()})();">制作三连音...</a>
</div>
<form style="display:none">
<input type="file" id="openFile" onchange="UI.openListener(this)"/>
</form>
<script>
//if(! "eruda" in window)
window.onerror = function(message, source, lineno, colno, error) {
var ele2 = document.createElement("div");
var ele = document.createElement("pre");
ele2.appendChild(ele);
ele2.className = "error";
ele.style.overflow = "auto"
ele.style.clear = "both"
ele.innerHTML += "程序内部错误:<br />"+error+"<br />";
ele.innerHTML += message;
ele.innerHTML += "<br />在脚本文件 " + source + " 中<br /><br />";
ele.innerHTML += "<br />第 " + lineno + " 行,第 " + colno + " 列<br /><br />";
try{
ele.innerHTML += error.stack;
}catch(e){};
ele2.innerHTML = '错误<div style="float:right;" ><input type="button" value="关闭全部" onclick="var a;while(a = document.querySelector(`.error`))a.parentNode.removeChild(a);"><input type="button" value="关闭" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode)"></div>' + ele2.innerHTML;
document.body.appendChild(ele2);
ele.scrollIntoView();
}
</script>
<script>loadfile.innerHTML = "调试器"</script>
<script src="js/eruda.js"></script>
<script>eruda.init();setTimeout("document.querySelectorAll('c-toggler').forEach((a)=>{a.style.display = 'none';});",1000)</script>
<script>loadfile.innerHTML = "程序主逻辑"</script>
<script src="js/Music.js"></script>
<script>loadfile.innerHTML = "拼音数据"</script>
<script src="js/TinyPY.js"></script>
<script>loadfile.innerHTML = "缓存库"</script>
<script src="js/lf-storage.js"></script>
<script>loadfile.innerHTML = "播放器"</script>
<script src="js/Player.js"></script>
<script>loadfile.innerHTML = "自动和弦器"</script>
<script src="js/Chord.js"></script>
<script>loadfile.innerHTML = "触摸兼容程序"</script>
<script src="js/touchShim.js"></script>
<script>loadfile.innerHTML = "meSpeak 适配器"</script>
<script src="js/mespeak/transplant.js"></script>
<script>
/* 一个有 Bug 的本地服务器真很闹人 */
var classlist = ['Music','Player','AsyncStorage','Chord','Pinyin','Transplant'];
classlist.forEach(function(a){
if(!(a in window)){
confirm(`${a} 没有正常加载。
刷新吗?`) && (location.reload(true),PopupWindow.alert('正在刷新...'));
}
})
PopupWindow.close(document.querySelector(".loading"));
</script>
<div class="window on" id="chordWindow">
<div class="windowtitle">手动输入和弦<button class="close"><b>×</b></button></div>
<div class="content">
<input id="chordinput" oninput=""/>
</div>
</div>
<div class="window on" id="voiceWindow">
<div class="windowtitle">加载音源文件<button class="close"><b>×</b></button></div>
<div class="content">
<p>本程序使用袅袅中文音源,但不附带音源文件。你可以到<a href="https://dsailab.com/voice/">https://dsailab.com/voice/</a>下载</p>
<hr>
<button id="b_inf" onclick="f_inf.click()">inf.d?</button><button id="b_voi" onclick="f_voi.click()">voice.d?</button>|<label><input type="checkbox" id="c_man" style="vertical-align:middle" />降八度</label>|<button id="b_app">应用</button>||<button id="b_def" style="float: right">默认音源</button>
<input type="file" hidden onchange="(this.files[0] && (this.files[0].name.toLowerCase().indexOf('inf')==-1) && alert('您选择的文件名是' + this.files[0].name + ',这应该是你想要加载的 inf.d 文件吧?')),b_inf.className = this.files[0]?'append-yes':''" id="f_inf"/>
<input type="file" hidden onchange="(this.files[0] && (this.files[0].name.toLowerCase().indexOf('voice')==-1) && alert('您选择的文件名是' + this.files[0].name + ',这应该是你想要加载的 voice.d 文件吧?')),b_voi.className = this.files[0]?'append-yes':''" id="f_voi"/>
<div style="clear:both"></div>
</div>
</div>
<div class="window on" id="showDownloadWindow">
<div class="windowtitle">文件保存提示<button class="close" onclick="UI.releaseDownload()"><b>×</b></button></div>
<div class="content">
<p>请确认文件是否成功保存。</p>
<center><button onclick="UI.releaseDownload()">是的</button> | <button onclick="UI.tryDownload()">不是,再次尝试保存!</button></center>
</div>
</div>
</body>
</html>