28 Commits
v18 ... v20

Author SHA1 Message Date
StageGuard
6eb41d212d fix 2020-12-02 23:40:48 +08:00
StageGuard
a197b02fdf fix 2020-12-02 23:39:13 +08:00
StageGuard
526c07fcde Update README.md 2020-12-02 18:39:56 +08:00
StageGuard
9252f74d81 Update version 20 2020-12-02 18:38:22 +08:00
StageGuard
c2b393274a Merge pull request #3 from tiaod/master
添加连续随机播放功能
2020-12-02 04:33:34 -06:00
hackerMei
a708d72b49 set default keyCount. 2020-12-02 11:27:13 +08:00
tiaod
4a333ab0b2 Add auto play randomly. 2020-12-01 18:22:39 +08:00
StageGuard
caa9364e28 Correct outdated notice 2020-11-22 10:08:08 +08:00
StageGuard
285e5f9b1b fix: stop when pause 2020-11-19 23:37:14 +08:00
StageGuard
9e2668c7fd fix: stop when pause 2020-11-19 23:36:02 +08:00
StageGuard
e6fb1926d8 Update version 19 2020-11-19 21:36:36 +08:00
StageGuard
e6a8caa696 Update version 19 2020-11-19 21:35:50 +08:00
StageGuard
08a970c7ae Update version 19 2020-11-19 21:27:59 +08:00
StageGuard
46abcf97a5 Update version 19 2020-11-19 21:27:27 +08:00
StageGuard
d42c80b9c2 fix incorrect information. 2020-11-19 21:17:18 +08:00
StageGuard
db9910451d Add resources 2020-11-19 21:13:42 +08:00
StageGuard
d31063c2c2 Change social list format and fix incorrect information. 2020-11-19 20:16:30 +08:00
StageGuard
9bcf78bb30 Update shared sheet list. 2020-11-19 18:54:36 +08:00
StageGuard
1fe35c8258 Add social link icons 2020-11-19 18:52:43 +08:00
StageGuard
cd644fe8c1 Upload user shared sheets. 2020-11-19 16:38:03 +08:00
StageGuard
9dc48de772 Upload user shared sheets. 2020-11-19 16:34:50 +08:00
StageGuard
777c5ca376 improve parsing note process 2020-11-17 09:39:12 +08:00
StageGuard
7998af8dd5 improve parsing note process 2020-11-17 09:33:00 +08:00
StageGuard
1b13fb295d Upload user shared sheets 2020-11-17 09:32:27 +08:00
StageGuard
c1a383f5bb Update uesr shared sheets 2020-10-05 22:37:37 +08:00
StageGuard
05eb9b03d5 Upload user shared sheets 2020-10-05 13:29:17 +08:00
StageGuard
416715e28c Upload user shared sheets 2020-10-04 21:00:09 +08:00
StageGuard
937334be46 Change LICENSE to LGPL 2020-10-04 12:24:43 +08:00
18 changed files with 2467 additions and 1674 deletions

1017
LICENSE

File diff suppressed because it is too large Load Diff

View File

@@ -95,7 +95,8 @@ files.removeDir("/storage/emulated/0/Documents/SkyAutoPlayer/");
### 请仔细阅读以下使用须知!
1. 未充分测试若遇到BUG请酷安私信@StageGuard或新建Issue来反馈BUG
2. **SkyAutoPlayer是完全免费且开源的软件/脚本([https://github.com/StageGuard/SkyAutoPlayerScript](https://github.com/StageGuard/SkyAutoPlayerScript))禁止使用本脚本作为盈利用途!**
2. **SkyAutoPlayer是完全免费且开源的软件/脚本([https://github.com/StageGuard/SkyAutoPlayerScript](https://github.com/StageGuard/SkyAutoPlayerScript))使用SkyAutoPlayer盈利的同时请标注源项目链接。**
3. **共享乐谱不遵守LGPL-2.1协议如您想在SkyAutoPlayer以外使用这些乐谱请自行找乐谱作者授权**
3. 本脚本仅可用作娱乐用途,请不要在正规场合使用本脚本(请自行体会\"正规场合\"是什么意思)若因使用本脚本所出现了一些不友好的问题与脚本作者StageGuard无关。
4. 脚本只能给你一时满足感而不能使你进步,请适当使用,只有真正的技术才是王道,才能使你感到快乐。
5. 本脚本只是一个"弹奏机"并不内置曲谱请在GooglePlay下载[SkyStudio](https://play.google.com/store/apps/details?id=com.Maple.SkyStudio)编谱。
@@ -107,7 +108,8 @@ files.removeDir("/storage/emulated/0/Documents/SkyAutoPlayer/");
## 贡献者名单(按照首次贡献时间排序)
### SkyAutoPlayerScript
[@tiaod](https://github.com/tiaod)<br>
<br>
### 共享乐谱
酷安[@Aex技术总监](http://www.coolapk.com/u/1286879)<br>
@@ -123,6 +125,9 @@ files.removeDir("/storage/emulated/0/Documents/SkyAutoPlayer/");
哔哩哔哩[@UTF16](https://space.bilibili.com/623364258)<br>
酷安[@Syngenex](http://www.coolapk.com/u/1093421)<br>
Twitter[Phoebe@huunhut1217](https://mobile.twitter.com/huunhut1217)<br>
酷安[@终究是错付了](http://www.coolapk.com/u/2293899)<br>
酷安[@DesperatU](http://www.coolapk.com/u/1075889)<br>
酷安[@明明酱](http://www.coolapk.com/u/1706128)<br>
<br>
# 图标来源
@@ -135,19 +140,21 @@ Twitter[Phoebe@huunhut1217](https://mobile.twitter.com/huunhut1217)<br>
# 许可证协议
```
SkyAutoPlayer (Auto.js script)
Copyright © 2020 StageGuard
This program 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.
SkyAutoPlayer (Auto.js script)
Copyright © 2020 StageGuard
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.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
```

View File

@@ -1 +1 @@
46162649517a1318c176a3808b932ec96dcce96b
a197b02fdf36e282ff3180caab0d4248eb8f2b40

BIN
resources/bilibili.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
resources/coolapk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
resources/douyin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
resources/github.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
resources/twitter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

BIN
shared_sheets/凉凉.txt Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,28 +1,30 @@
"ui";
"use strict";
/*
Sky Auto Player (Auto.js script)
SkyAutoPlayer (Auto.js script)
Copyright © 2020 StageGuard
Contact :
(QQ: 1355416608)
(Email: beamiscool@qq.com)
(BaiduTieba@拐角处_等你)
(Weibo@StageGuard)
(CoolApk@StageGuard)
(Twiter@stageguardcn)
This program 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.
Contact :
(QQ: 1355416608)
(Email: beamiscool@qq.com)
(BaiduTieba@拐角处_等你)
(Weibo@StageGuard)
(CoolApk@StageGuard)
(Twiter@stageguardcn)
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.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
const user_agreements =
@@ -33,7 +35,7 @@ const user_agreements =
"3. 脚本只能给你一时满足感而不能使你进步,请适当使用,只有真正的技术才是王道,才能使你感到快乐。\n\n" +
"4. 本脚本只是一个\"弹奏机\"并不内置曲谱请在GooglePlay下载SkyStudio编谱。\n\n" +
"5. 本脚本不会增加解密乐谱功能包括但不限于加密的SkyStudio乐谱加密的JS等也不接受加密乐谱的共享。\n\n" +
"6. 本脚本的发行遵守GPLv3协议,若你不了解协议内容,请访问 https://www.gnu.org/licenses 查看"
"6. 本脚本的发行遵守LGPL-2.1协议,若你不了解协议内容,请访问 https://www.gnu.org/licenses 查看"
;
//Script global scope
@@ -157,8 +159,9 @@ sheetmgr = {
var r = [];
var t_time = 0;
var t_sets = [];
const regexp = /^(\d)Key(\d{1,})$/;
for(var i in raw) {
var key = Number(raw[i].key.replace(/^(\d)Key(\d{1,})$/, "$2"));
var key = Number(raw[i].key.replace(regexp, "$2"));
if(raw[i].time != t_time) {
r.push({time: t_time, keys: t_sets});
t_sets = [];
@@ -282,8 +285,31 @@ sheetplayer = {
java.lang.Thread.sleep(sheetplayer.nextInterval = Math.round(sheetplayer.nextInterval * sheetplayer.speed));
sheetplayer.currentNote ++;
}
// 播放完自动下一首
if(!(sheetplayer.currentNote < sheetplayer.noteCount)) {
if(config.values.autoPlay && gui.player_panel.isShowing) {
gui.player_panel.__internal_dismiss();
sheetplayer.stop();
// gui.main.show(0);
if(sheetmgr.cachedLocalSheetList.length>0){
setTimeout(function(){
let sheet = sheetmgr.cachedLocalSheetList[random(0, sheetmgr.cachedLocalSheetList.length-1)]
if(!sheet.keyCount){
sheet.keyCount = 15 //默认键位
}
gui.player_panel.__internal_showPanel(sheet);
// sheetplayer.stop();
setTimeout(function(){
sheetplayer.play(gui.player_panel.refreshStatus);
}, 1500)
}, 500)
}
} else {
sheetplayer.stop();
}
}
});
},
stop: function() {
@@ -345,9 +371,9 @@ config = {
_global_storage: null,
values: {
currentVersion: 18,
currentVersion: 20,
gitVersion: "",
key_coordinates15: [],
key_coordinates8: [],
skipRunScriptTip: false,
@@ -360,6 +386,7 @@ config = {
showFailedSheets: true,
tipOnAndroidR: true,
theme: "dark",
autoPlay: false
},
bitmaps: {},
@@ -379,7 +406,7 @@ config = {
this.values.showFailedSheets = this._global_storage.get("show_failed_sheets", this.values.showFailedSheets);
this.values.tipOnAndroidR = this._global_storage.get("tip_storage_on_android_r", this.values.tipOnAndroidR);
this.values.theme = this._global_storage.get("theme", this.values.theme);
this.values.autoPlay = this._global_storage.get("auto_play", this.values.autoPlay);
try {
android.os.Build.VERSION_CODES.R
sheetmgr.rootDir = android.os.Environment.getExternalStorageDirectory() + "/Documents/SkyAutoPlayer/sheets/";
@@ -417,7 +444,7 @@ config = {
fetchResources: function(listener) {
var remoteHost = "https://cdn.jsdelivr.net/gh/StageGuard/SkyAutoPlayerScript@" + this.values.gitVersion + "/resources/";
var resourceList = ["local.png", "online.png", "play.png", "pause.png", "refresh.png", "settings.png", "info.png", "download.png", "bin.png", "speedup.png", "search.png", "note.png", "user.png", "piano.png", "clock.png"/*, "filter.png"*/];
var resourceList = ["local.png", "online.png", "play.png", "pause.png", "refresh.png", "settings.png", "info.png", "download.png", "bin.png", "speedup.png", "search.png", "note.png", "user.png", "piano.png", "clock.png"/*, "filter.png"*/, "coolapk.png", "douyin.png", "github.png", "twitter.png", "bilibili.png"];
var localRootDir = android.os.Environment.getExternalStorageDirectory() + "/Documents/SkyAutoPlayer/bitmaps/";
var downloadQueue = [];
var tryCount = 1;
@@ -2009,7 +2036,6 @@ gui = {
};
gui.run(function(){
ui.setContentView((function(){
var layout = new android.widget.LinearLayout(ctx);
@@ -2212,9 +2238,99 @@ gui.dialogs.showProgressDialog(function(o) {
sug.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
sug.setTextColor(gui.config.colors[config.values.theme].sec_text);
sug.setTextSize(15);
sug.getLayoutParams().setMargins(7 * dp, 5 * dp, 0, 0);
sug.getLayoutParams().setMargins(7 * dp, 5 * dp, 0, 7 * dp);
layout.addView(sug);
if(item.social) {
var colorPicker = function(platform) {
switch(platform) {
case "coolapk": return "#11B566";
case "twitter": return "#1DA1F2";
case "douyin": return (function(){
if(config.values.theme == "light") {
return "#1F0B1A";
} else {
return "#FFFFFF";
}
}());
case "github": return (function(){
if(config.values.theme == "light") {
return "#24292E";
} else {
return "#FFFFFF";
}
}());
case "bilibili": return "#FB7299";
}
}
var filterBitmap = function(bitmap, replacedColor) {
var rBitmap = android.graphics.Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), android.graphics.Bitmap.Config.ARGB_8888);
var canvas = new android.graphics.Canvas(rBitmap);
var paint = new android.graphics.Paint();
var rect = new android.graphics.Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColorFilter(new android.graphics.PorterDuffColorFilter(replacedColor, android.graphics.PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
return rBitmap;
};
var socialPrompt = new android.widget.TextView(ctx);
socialPrompt.setText("查看作者:");
socialPrompt.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
socialPrompt.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
socialPrompt.setTextColor(gui.config.colors[config.values.theme].text);
socialPrompt.setTextSize(16);
socialPrompt.getLayoutParams().setMargins(0, 5 * dp, 0, 5 * dp);
layout.addView(socialPrompt);
var socialLayout = new android.widget.LinearLayout(ctx);
socialLayout.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
socialLayout.setOrientation(android.widget.LinearLayout.HORIZONTAL);
socialLayout.setGravity(android.view.Gravity.CENTER | android.view.Gravity.CENTER);
socialLayout.getLayoutParams().setMargins(dp * 2, dp * 6, dp * 2, 0);
socialLayout.setPadding(5 * dp, 5 * dp, 5 * dp, 5 * dp);
socialLayout.measure(0, 0);
if(item.social.length == 1) {
var socialImage = new android.widget.ImageView(ctx);
socialImage.setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
socialImage.setLayoutParams(new android.widget.LinearLayout.LayoutParams(dp * 34, dp * 34));
socialImage.getLayoutParams().setMargins(0, 0, dp * 5, 0);
socialImage.setImageBitmap(filterBitmap(config.bitmaps[item.social[0].platform], android.graphics.Color.parseColor(colorPicker(item.social[0].platform))));
socialLayout.addView(socialImage);
var socialPrompt1 = new android.widget.TextView(ctx);
socialPrompt1.setText(android.text.Html.fromHtml(("在 <font color=" + colorPicker(item.social[0].platform) + ">" + item.social[0].name +"</font> 查看作者")));
socialPrompt1.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, dp * 34));
socialPrompt1.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
socialPrompt1.setTextColor(gui.config.colors[config.values.theme].text);
socialPrompt1.setTextSize(14);
socialLayout.addView(socialPrompt1);
socialLayout.setBackgroundDrawable(gui.utils.ripple_drawable(socialLayout.getMeasuredWidth(), socialLayout.getMeasuredHeight(), "rect"));
socialLayout.setOnClickListener(new android.view.View.OnClickListener({
onClick: function() {
app.openUrl(item.social[0].link);
}
}));
} else {
for(var i in item.social) {
var socialImage = new android.widget.ImageView(ctx);
socialImage.setId(i);
socialImage.setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
socialImage.setLayoutParams(new android.widget.LinearLayout.LayoutParams(dp * 34, dp * 34));
socialImage.getLayoutParams().setMargins(dp * 5, 0, dp * 5, 0);
socialImage.setImageBitmap(filterBitmap(config.bitmaps[item.social[i].platform], android.graphics.Color.parseColor(colorPicker(item.social[i].platform))));
socialImage.measure(0, 0);
socialImage.setBackgroundDrawable(gui.utils.ripple_drawable(socialImage.getMeasuredWidth(), socialImage.getMeasuredHeight(), "rect"));
socialImage.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(view) {
print(view.getId())
app.openUrl(item.social[view.getId()].link);
}
}));
socialLayout.addView(socialImage);
}
}
layout.addView(socialLayout);
}
scr.addView(layout);
return scr;
});
gui.main.addPage({
@@ -2442,9 +2558,10 @@ gui.dialogs.showProgressDialog(function(o) {
canExit: true,
buttons: ["确认"]
});
return;
} else {
gui.dialogs.showDialog(gui.getViewMaker("sheetInfo")(item), -2, -2, null, true);
}
gui.dialogs.showDialog(gui.getViewMaker("sheetInfo")(item), -2, -2, null, true);
}
}));
s.ns0_listView.setOnItemLongClickListener(new android.widget.AdapterView.OnItemLongClickListener({
@@ -2988,6 +3105,13 @@ gui.dialogs.showProgressDialog(function(o) {
toast("坐标设置已保存至存储!");
});
}
}, {
type: "checkbox",
name: "连续随机播放",
check: config.values.autoPlay,
onClick: function(checked) {
config.values.autoPlay = config.save("auto_play", checked);
}
}, {
type: "checkbox",
name: "显示加载失败的乐谱",
@@ -3078,7 +3202,7 @@ gui.dialogs.showProgressDialog(function(o) {
try {
android.os.Build.VERSION_CODES.R
} catch (e) {
sList.list.splice(4, 1);
sList.list.splice(5, 1);
}
return sList.list;
}()), function self(element) {

View File

@@ -1,5 +1,33 @@
"ui";
"use strict";
/*
SkyAutoPlayer (Auto.js script)
Copyright © 2020 StageGuard
Contact :
(QQ: 1355416608)
(Email: beamiscool@qq.com)
(BaiduTieba@拐角处_等你)
(Weibo@StageGuard)
(CoolApk@StageGuard)
(Twiter@stageguardcn)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
var emitter = events.emitter(threads.currentThread());
threads.start(function() {
emitter.emit("evaluate", (function(){

View File

@@ -1,3 +1,14 @@
版本: 20
更新时间: 2020.12.02 18:40
更新内容:
* 新增:增加当前乐谱弹奏完成后自动随机弹奏下一首本地乐谱的选项(@tiaod)。
版本: 19
更新时间: 2020.11.19 21:25
更新内容:
* 修复:自然弹奏完成后再次点击播放按钮不会重新开始
* 新增:共享乐谱的详细界面添加作者社交链接跳转
版本: 18
更新时间: 2020.10.04 10:30
更新内容: