mirror of
https://github.com/TriM-Organization/Linglun-Converter.git
synced 2025-12-22 12:27:02 +00:00
Compare commits
7 Commits
v0.0.6_Bet
...
LLC_GUI_v0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d74b89649 | ||
|
|
7fad110d47 | ||
|
|
36daf19407 | ||
|
|
a2c2afaede | ||
|
|
626be309c2 | ||
|
|
5806916551 | ||
|
|
cd3dc6fcaa |
20
README.md
20
README.md
@@ -1,5 +1,11 @@
|
|||||||
<h1 align="center">伶伦转换器</h1>
|
<h1 align="center">伶伦转换器</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img width="128" height="128" src="https://gitee.com/TriM-Organization/Linglun-Converter/raw/master/resources/LLC_LOGO_OK_PLAIN_BANNER.png">
|
||||||
|
</img>
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3 align="center">一个免费开源的《我的世界》数字音频转换器</h3>
|
<h3 align="center">一个免费开源的《我的世界》数字音频转换器</h3>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -7,7 +13,7 @@
|
|||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
|
||||||
[![][Bilibili: 凌云金羿]](https://space.bilibili.com/397369002/)
|
[![][Bilibili: 金羿ELS]](https://space.bilibili.com/397369002/)
|
||||||
[![][Bilibili: 诸葛亮与八卦阵]](https://space.bilibili.com/604072474)
|
[![][Bilibili: 诸葛亮与八卦阵]](https://space.bilibili.com/604072474)
|
||||||
[![CodeStyle: black]](https://github.com/psf/black)
|
[![CodeStyle: black]](https://github.com/psf/black)
|
||||||
[![][python]](https://www.python.org/)
|
[![][python]](https://www.python.org/)
|
||||||
@@ -18,7 +24,7 @@
|
|||||||
<!-- 简体中文 | [English](README_EN.md) -->
|
<!-- 简体中文 | [English](README_EN.md) -->
|
||||||
|
|
||||||
|
|
||||||
## 软件介绍🚀
|
## 介绍🚀
|
||||||
|
|
||||||
**伶伦** 是一款免费开源的 **《我的世界》** 数字音频工作站
|
**伶伦** 是一款免费开源的 **《我的世界》** 数字音频工作站
|
||||||
|
|
||||||
@@ -40,20 +46,18 @@
|
|||||||
|
|
||||||
[转换乐器对照参考表](https://gitee.com/TriM-Organization/Musicreater/blob/master/docs/%E8%BD%AC%E6%8D%A2%E4%B9%90%E5%99%A8%E5%AF%B9%E7%85%A7%E8%A1%A8.md)
|
[转换乐器对照参考表](https://gitee.com/TriM-Organization/Musicreater/blob/master/docs/%E8%BD%AC%E6%8D%A2%E4%B9%90%E5%99%A8%E5%AF%B9%E7%85%A7%E8%A1%A8.md)
|
||||||
|
|
||||||
## 致谢列表🙏
|
## 致谢🙏
|
||||||
|
|
||||||
> 感谢广大群友为此库提供的测试和建议等
|
> 感谢广大群友为此软件提供的测试和建议
|
||||||
>
|
|
||||||
> 若您对我们有所贡献但您的名字没有出现在此列表中,请联系我们!
|
|
||||||
|
|
||||||
## 联系我们📞
|
## 联系📞
|
||||||
|
|
||||||
QQ群 [861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)
|
QQ群 [861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)
|
||||||
|
|
||||||
电邮 [TriM-Organization@hotmail.com](mailto:TriM-Organization@hotmail.com)
|
电邮 [TriM-Organization@hotmail.com](mailto:TriM-Organization@hotmail.com)
|
||||||
|
|
||||||
|
|
||||||
[Bilibili: 凌云金羿]: https://img.shields.io/badge/Bilibili-%E5%87%8C%E4%BA%91%E9%87%91%E7%BE%BF-00A1E7?style=for-the-badge
|
[Bilibili: 金羿ELS]: https://img.shields.io/badge/Bilibili-%E9%87%91%E7%BE%BFELS-00A1E7?style=for-the-badge
|
||||||
[Bilibili: 诸葛亮与八卦阵]: https://img.shields.io/badge/Bilibili-%E8%AF%B8%E8%91%9B%E4%BA%AE%E4%B8%8E%E5%85%AB%E5%8D%A6%E9%98%B5-00A1E7?style=for-the-badge
|
[Bilibili: 诸葛亮与八卦阵]: https://img.shields.io/badge/Bilibili-%E8%AF%B8%E8%91%9B%E4%BA%AE%E4%B8%8E%E5%85%AB%E5%8D%A6%E9%98%B5-00A1E7?style=for-the-badge
|
||||||
[CodeStyle: black]: https://img.shields.io/badge/code%20style-black-121110.svg?style=for-the-badge
|
[CodeStyle: black]: https://img.shields.io/badge/code%20style-black-121110.svg?style=for-the-badge
|
||||||
[python]: https://img.shields.io/badge/python-3.6-AB70FF?style=for-the-badge
|
[python]: https://img.shields.io/badge/python-3.6-AB70FF?style=for-the-badge
|
||||||
|
|||||||
@@ -1,13 +1,38 @@
|
|||||||
## 一、运行环境安装
|
## 运行打包文件(推荐)
|
||||||
|
|
||||||
### (一)安装 Python3.8+
|
### 一、下载打包好的应用程序
|
||||||
|
|
||||||
|
1. 在[代码仓库发布页](https://gitee.com/TriM-Organization/Linglun-Converter/releases)找到最新的下载。
|
||||||
|
|
||||||
|
<img src=https://foruda.gitee.com/images/1699105959996885442/be19644e_9911226.png>
|
||||||
|
|
||||||
|
请注意选择对您合适的构建版本
|
||||||
|
|
||||||
|
### 二、开始使用
|
||||||
|
|
||||||
|
2. 将下载得到的文件解压缩后,直接运行其中的 `llc_win_wxPython.exe`
|
||||||
|
|
||||||
|
<img src=https://foruda.gitee.com/images/1699106497816902973/48dc0942_9911226.png>
|
||||||
|
<img src=https://foruda.gitee.com/images/1699106542397488143/5638cd3e_9911226.png>
|
||||||
|
<img src=https://foruda.gitee.com/images/1699106557013748881/70f90fac_9911226.png>
|
||||||
|
|
||||||
|
3. 即可开始使用
|
||||||
|
|
||||||
|
<img src=https://foruda.gitee.com/images/1699106948861444130/30c156bc_9911226.png>
|
||||||
|
|
||||||
|
|
||||||
|
## 从代码运行(最新功能)
|
||||||
|
|
||||||
|
### 一、运行环境安装
|
||||||
|
|
||||||
|
#### (一)安装 Python3.8+
|
||||||
|
|
||||||
1. 首先需要下载Python的安装包,最好是 *Python3.10*,因为作者就用的是这个版本
|
1. 首先需要下载Python的安装包,最好是 *Python3.10*,因为作者就用的是这个版本
|
||||||
|
|
||||||
!注意!此程序现已不支持Python3.6。请更新到至少Python3.8,但是,我们对于Python3.8的支持也即将停止,为了更好的兼容,避免不必要的麻烦,我们强烈建议您更新到Python3.10。(这意味着我们即将放弃对Windows7的支持)
|
!注意!此程序现已不支持Python3.6。请更新到至少Python3.8,但是,我们对于Python3.8的支持也即将停止,为了更好的兼容,避免不必要的麻烦,我们强烈建议您更新到Python3.10。(这意味着我们即将放弃对Windows7的支持)
|
||||||
|
|
||||||
> [下载64位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)
|
> [下载64位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe)
|
||||||
> [下载32位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe)
|
> [下载32位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe)
|
||||||
|
|
||||||
2. 在安装时,最好需要勾选 `Add Python 3.X to PATH`,如下图所示:
|
2. 在安装时,最好需要勾选 `Add Python 3.X to PATH`,如下图所示:
|
||||||
|
|
||||||
@@ -19,12 +44,12 @@
|
|||||||
|
|
||||||
<img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png>
|
<img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png>
|
||||||
|
|
||||||
4. 安装结束之后可以在*终端*(命令行/PowerShell/Bash/etc)中输入:`python` 试试是否安装成功,成功安装之后,在终端中输入python会显示诸如如下图片的提示:
|
4. 安装结束之后可以在*终端*(命令行/PowerShell/Bash/etc)中输入:`python -V` 试试是否安装成功,成功安装之后,在终端中输入python会显示诸如如下图片的提示:
|
||||||
|
|
||||||
<img src=https://foruda.gitee.com/images/1659972669907359295/cmd.png>
|
<img src=https://foruda.gitee.com/images/1699107336707287940/1837e2f6_9911226.png>
|
||||||
|
|
||||||
|
|
||||||
### (二)安装依赖
|
#### (二)安装依赖
|
||||||
|
|
||||||
1. 请以管理员模式打开您的*终端*(命令行/PowerShell/Bash/etc)
|
1. 请以管理员模式打开您的*终端*(命令行/PowerShell/Bash/etc)
|
||||||
|
|
||||||
@@ -42,7 +67,7 @@
|
|||||||
|
|
||||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||||
|
|
||||||
## 二、本工具的下载与使用
|
### 二、本工具的下载与使用
|
||||||
|
|
||||||
0. 下载本代码库以及演示程序
|
0. 下载本代码库以及演示程序
|
||||||
|
|
||||||
@@ -66,13 +91,13 @@
|
|||||||
<img src=https://foruda.gitee.com/images/1659974437388532868/输入.png>
|
<img src=https://foruda.gitee.com/images/1659974437388532868/输入.png>
|
||||||
<img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png>
|
<img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png>
|
||||||
|
|
||||||
使用以下指令:
|
在打开的终端中使用以下指令:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python ./llc_cli.py
|
python ./llc_cli.py
|
||||||
```
|
```
|
||||||
|
|
||||||
## 三、安装时错误的补充说明
|
### 三、安装时错误的补充说明
|
||||||
|
|
||||||
1. Microsoft Visual C++ Redistributable 环境出错
|
1. Microsoft Visual C++ Redistributable 环境出错
|
||||||
|
|
||||||
@@ -84,4 +109,4 @@
|
|||||||
> [下载64位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
> [下载64位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||||
> [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x86.exe)
|
> [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x86.exe)
|
||||||
|
|
||||||
感谢群友*Mono*帮我们发现这个问题。
|
感谢群友 *Mono* 帮我们发现这个问题。
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
- 速度倍率:正小数,其值不可为0,用以表示游戏中播放此音乐的速度倍数。
|
- 速度倍率:正小数,其值不可为0,用以表示游戏中播放此音乐的速度倍数。
|
||||||
|
|
||||||
- 进度条:是否启用自动生成进度条。
|
- 启用进度条:是否启用自动生成进度条。
|
||||||
|
|
||||||
- 若是,则可选是否自定义进度条
|
- 若是,则可选是否自定义进度条
|
||||||
|
|
||||||
|
|||||||
@@ -1,190 +0,0 @@
|
|||||||
# -*- coding:utf-8 -*-
|
|
||||||
"""对于伶伦的语言支持兼语言文件编辑器"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
Copyright © 2023 all the developers of LinglunStudio
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
DEFAULTLANGUAGE = "ZH-CN"
|
|
||||||
|
|
||||||
LANGUAGELIST = {
|
|
||||||
# 第一个是语言的中文名称和地区
|
|
||||||
# 第二个是语言的英文名称和地区
|
|
||||||
# 第三个是语言的本地名称和地区
|
|
||||||
"ZH-CN": (
|
|
||||||
"简体中文 中国大陆",
|
|
||||||
"Simplified Chinese - China Mainland",
|
|
||||||
"简体中文 中国大陆",
|
|
||||||
),
|
|
||||||
"ZH-TW": (
|
|
||||||
"繁体中文 中国台湾",
|
|
||||||
"Traditional Chinese - Taiwan Province, China",
|
|
||||||
"正體中文,中国台灣省",
|
|
||||||
),
|
|
||||||
# 'ZH-HK': (
|
|
||||||
# "繁体中文 香港",
|
|
||||||
# "Traditional Chinese - Hong Kong SAR",
|
|
||||||
# "繁體中文,香港特別行政區",
|
|
||||||
# ),
|
|
||||||
# 'ZH-MO': (
|
|
||||||
# "繁体中文 澳门",
|
|
||||||
# "Traditional Chinese - Macau SAR",
|
|
||||||
# "繁體中文,澳門特別行政區",
|
|
||||||
# ),
|
|
||||||
"EN-GB": (
|
|
||||||
"英语 英国",
|
|
||||||
"British English - the United Kingdom",
|
|
||||||
"British English - the United Kingdom",
|
|
||||||
),
|
|
||||||
"ZH-ME": ("喵喵文 中国大陆", "Meow Catsnese - China Mainland" "喵喵喵~ 种花家~"),
|
|
||||||
}
|
|
||||||
|
|
||||||
languages = {
|
|
||||||
"ZH-CN": {
|
|
||||||
"MSCT": "音·创",
|
|
||||||
"ChooseLang": "选择语言",
|
|
||||||
"LangChd": "当前语言已经切换为",
|
|
||||||
"ZH-CN": "简体中文",
|
|
||||||
"ZH-TW": "繁体中文(台湾)",
|
|
||||||
"EN-GB": "英语(英国)",
|
|
||||||
"EN-US": "英语(美国)",
|
|
||||||
":": ":",
|
|
||||||
",": ",",
|
|
||||||
".": "。",
|
|
||||||
"ChoosePath": "请输入MIDI路径或所在文件夹",
|
|
||||||
"ChooseFileFormat": "请输入输出格式[BDX(1) 或 MCPACK(0)]",
|
|
||||||
"EnterMethod": "请输入转换算法[{}~{}]",
|
|
||||||
"MethodRangeErr": "输入的转换算法应为 [{},{}](首尾皆含)之间的一个整数。",
|
|
||||||
"ChoosePlayer": "请选择播放方式[红石(2) 或 计分板(1) 或 延迟(0)]",
|
|
||||||
"WhetherArgEntering": "是否为文件夹内文件的转换统一参数[是(1) 或 否(0)]",
|
|
||||||
"EnterArgs": "请输入转换参数",
|
|
||||||
"noteofArgs": "注:文件夹内的全部midi将统一以此参数转换",
|
|
||||||
"EnterVolume": "请输入音量大小(0~1)",
|
|
||||||
"EnterSpeed": "请输入速度倍率",
|
|
||||||
"WhetherPgb": "是否自动生成进度条[是(1) 或 否(0)]",
|
|
||||||
"WhetherCstmProgressBar": "是否自定义进度条[是(1) 或 否(0)]",
|
|
||||||
"EnterProgressBarStyle": "请输入进度条样式",
|
|
||||||
"EnterSbName": "请输入计分板名称",
|
|
||||||
"EnterSelecter": "请输入播放者选择器",
|
|
||||||
"WhetherSbReset": "是否自动重置计分板[是(1) 或 否(0)]",
|
|
||||||
"EnterAuthor": "请输入作者",
|
|
||||||
"EnterMaxHeight": "请输入指令结构最大生成高度",
|
|
||||||
"ErrEnter": "输入错误",
|
|
||||||
"Re-Enter": "请重新输入",
|
|
||||||
"Dealing": "正在处理",
|
|
||||||
"FileNotFound": "文件(夹)不存在",
|
|
||||||
"ChooseOutPath": "请输入结果输出路径",
|
|
||||||
"Saying": "言·论",
|
|
||||||
"Failed": "失败",
|
|
||||||
"CmdLength": "指令数量",
|
|
||||||
"MaxDelay": "曲目时间(游戏刻)",
|
|
||||||
"PlaceSize": "结构占用大小",
|
|
||||||
"LastPos": "最末方块坐标",
|
|
||||||
"PressEnterExit": "请按下回车键退出。",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class Lang:
|
|
||||||
def __init__(self, lang: str = "ZH-CN", debug: bool = False) -> None:
|
|
||||||
self.local = lang
|
|
||||||
self.debug = debug
|
|
||||||
|
|
||||||
def __load_language(self, language_file_name: str):
|
|
||||||
global logger
|
|
||||||
with open(language_file_name, "r", encoding="utf-8") as languageFile:
|
|
||||||
_text = {}
|
|
||||||
for line in languageFile:
|
|
||||||
if line.startswith("#"):
|
|
||||||
continue
|
|
||||||
line = line.split(" ", 1)
|
|
||||||
_text[line[0]] = line[1].replace("\n", "")
|
|
||||||
langkeys = _text.keys()
|
|
||||||
with open(
|
|
||||||
language_file_name.replace(language_file_name[-10:-5], "ZH-CN"),
|
|
||||||
"r",
|
|
||||||
encoding="utf-8",
|
|
||||||
) as defaultLangFile:
|
|
||||||
for line in defaultLangFile:
|
|
||||||
if line.startswith("#"):
|
|
||||||
continue
|
|
||||||
line = line.split(" ", 1)
|
|
||||||
if not line[0] in langkeys:
|
|
||||||
_text[line[0]] = line[1].replace("\n", "")
|
|
||||||
logger.warning(
|
|
||||||
f"丢失对于 {line[0]} 的本地化文本",
|
|
||||||
)
|
|
||||||
langkeys = _text.keys()
|
|
||||||
# print(_text)
|
|
||||||
return _text
|
|
||||||
|
|
||||||
|
|
||||||
# 这个函数是不被加载的
|
|
||||||
def passbt():
|
|
||||||
|
|
||||||
from utils.io import logger
|
|
||||||
try:
|
|
||||||
from utils.io import requests
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def __loadLanguage(languageFilename: str):
|
|
||||||
with open(languageFilename, "r", encoding="utf-8") as languageFile:
|
|
||||||
_text = {}
|
|
||||||
for line in languageFile:
|
|
||||||
if line.startswith("#"):
|
|
||||||
continue
|
|
||||||
line = line.split(" ", 1)
|
|
||||||
_text[line[0]] = line[1].replace("\n", "")
|
|
||||||
langkeys = _text.keys()
|
|
||||||
with open(
|
|
||||||
languageFilename.replace(languageFilename[-10:-5], "ZH-CN"),
|
|
||||||
"r",
|
|
||||||
encoding="utf-8",
|
|
||||||
) as defaultLangFile:
|
|
||||||
for line in defaultLangFile:
|
|
||||||
if line.startswith("#"):
|
|
||||||
continue
|
|
||||||
line = line.split(" ", 1)
|
|
||||||
if not line[0] in langkeys:
|
|
||||||
_text[line[0]] = line[1].replace("\n", "")
|
|
||||||
logger.warning(
|
|
||||||
f"丢失对于 {line[0]} 的本地化文本",
|
|
||||||
)
|
|
||||||
langkeys = _text.keys()
|
|
||||||
# print(_text)
|
|
||||||
return _text
|
|
||||||
|
|
||||||
if DEFAULTLANGUAGE in LANGUAGELIST.keys():
|
|
||||||
_TEXT = __loadLanguage("./languages/" + DEFAULTLANGUAGE + ".lang")
|
|
||||||
else:
|
|
||||||
logger.error(f"无法打开当前本地化文本{DEFAULTLANGUAGE}")
|
|
||||||
raise KeyError(f"无法打开默认语言{DEFAULTLANGUAGE}")
|
|
||||||
|
|
||||||
def wordTranslate(singleWord: str, debug: bool = False):
|
|
||||||
try:
|
|
||||||
return (
|
|
||||||
requests.post(
|
|
||||||
"https://fanyi.baidu.com/sug", data={"kw": f"{singleWord}"}
|
|
||||||
)
|
|
||||||
.json()["data"][0]["v"]
|
|
||||||
.split("; ")[0]
|
|
||||||
)
|
|
||||||
except:
|
|
||||||
logger.warning(
|
|
||||||
f"无法翻译文本{singleWord}",
|
|
||||||
)
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _(text: str, debug: bool = False):
|
|
||||||
try:
|
|
||||||
return _TEXT[text]
|
|
||||||
except:
|
|
||||||
if debug:
|
|
||||||
raise KeyError(f"无法找到本地化文本{text}")
|
|
||||||
else:
|
|
||||||
logger.warning(
|
|
||||||
f"无法找到本地化文本{text}",
|
|
||||||
)
|
|
||||||
return ""
|
|
||||||
20
llc_cli.py
20
llc_cli.py
@@ -22,18 +22,18 @@ import random
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import Musicreater
|
import Musicreater
|
||||||
|
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
||||||
from Musicreater.plugin import ConvertConfig
|
from Musicreater.plugin import ConvertConfig
|
||||||
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
|
|
||||||
from Musicreater.plugin.addonpack import (
|
from Musicreater.plugin.addonpack import (
|
||||||
to_addon_pack_in_delay,
|
to_addon_pack_in_delay,
|
||||||
to_addon_pack_in_repeater,
|
to_addon_pack_in_repeater,
|
||||||
to_addon_pack_in_score,
|
to_addon_pack_in_score,
|
||||||
)
|
)
|
||||||
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
|
||||||
|
from utils.io import *
|
||||||
|
|
||||||
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
|
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
|
||||||
|
|
||||||
from utils.io import *
|
|
||||||
|
|
||||||
MainConsole.print(
|
MainConsole.print(
|
||||||
"[#121110 on #F0F2F4] ",
|
"[#121110 on #F0F2F4] ",
|
||||||
@@ -116,7 +116,7 @@ def format_ipt(
|
|||||||
|
|
||||||
# 获取midi列表
|
# 获取midi列表
|
||||||
while True:
|
while True:
|
||||||
midi_path = ipt(f"请键入MIDI地址或所在目录地址:")
|
midi_path = ipt(f"MIDI地址或所在目录地址:")
|
||||||
try:
|
try:
|
||||||
if os.path.exists(midi_path):
|
if os.path.exists(midi_path):
|
||||||
if os.path.isfile(midi_path):
|
if os.path.isfile(midi_path):
|
||||||
@@ -140,7 +140,7 @@ while True:
|
|||||||
|
|
||||||
# 获取输出地址
|
# 获取输出地址
|
||||||
while True:
|
while True:
|
||||||
out_path = ipt(f"请键入文件生成输出地址:")
|
out_path = ipt(f"文件生成输出地址:")
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(out_path):
|
if not os.path.exists(out_path):
|
||||||
prt("该地址不存在,或无法访问该地址,请重新输入。")
|
prt("该地址不存在,或无法访问该地址,请重新输入。")
|
||||||
@@ -170,26 +170,26 @@ def is_in_player(sth: str):
|
|||||||
|
|
||||||
|
|
||||||
output_file_format = format_ipt(
|
output_file_format = format_ipt(
|
||||||
"请键入输出文件类型 (mcpack/0|bdx/1)",
|
"输出文件类型 (mcpack/0|bdx/1)",
|
||||||
is_in_bdx_mcpack,
|
is_in_bdx_mcpack,
|
||||||
"输入内容有误,请重新输入。",
|
"输入内容有误,请重新输入。",
|
||||||
)[1]
|
)[1]
|
||||||
|
|
||||||
if output_file_format == 0:
|
if output_file_format == 0:
|
||||||
player_format = format_ipt(
|
player_format = format_ipt(
|
||||||
"请选择播放器类型 (延迟/0|计分板/1|中继器/2)",
|
"播放器类型 (延迟/0|计分板/1|中继器/2)",
|
||||||
is_in_player,
|
is_in_player,
|
||||||
"输入内容有误,请重新输入。",
|
"输入内容有误,请重新输入。",
|
||||||
)[1]
|
)[1]
|
||||||
else:
|
else:
|
||||||
player_format = format_ipt(
|
player_format = format_ipt(
|
||||||
"请选择播放器类型 (延迟/0|计分板/1)",
|
"播放器类型 (延迟/0|计分板/1)",
|
||||||
is_in_player,
|
is_in_player,
|
||||||
"输入内容有误,请重新输入。",
|
"输入内容有误,请重新输入。",
|
||||||
)[1]
|
)[1]
|
||||||
|
|
||||||
old_exe_enabled = format_ipt(
|
old_exe_enabled = not format_ipt(
|
||||||
"启用1.19以前的旧版execute指令格式 (否/0|是/1):", bool_str, "输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n"
|
"启用新版代执行指令 (否/0|是/1):", bool_str, "输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n"
|
||||||
)[1]
|
)[1]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# 伶伦 开发交流群 861684859
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
伶伦转换器安装器(视窗操作系统)
|
|
||||||
Linglun Converter Installer for Windows
|
|
||||||
|
|
||||||
版权所有 © 2023 金羿 & 睿穆开发组
|
|
||||||
Copyright © 2023 EillesWan & TriM Org.
|
|
||||||
|
|
||||||
开源相关声明请见 ../License.md
|
|
||||||
Terms & Conditions: ../Lisense.md
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 下面为正文
|
|
||||||
225
llc_spec_Creeper.py
Normal file
225
llc_spec_Creeper.py
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# 伶伦 开发交流群 861684859
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
伶伦转换器暨模组特用奇巧
|
||||||
|
Linglun Converter for Special Use with addons
|
||||||
|
|
||||||
|
版权所有 © 2023 金羿 & 睿穆开发组
|
||||||
|
Copyright © 2023 EillesWan & TriM Org.
|
||||||
|
|
||||||
|
开源相关声明请见 ./License.md
|
||||||
|
Terms & Conditions: ./Lisense.md
|
||||||
|
"""
|
||||||
|
|
||||||
|
__version__ = "0.0.1"
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from rich.table import Table
|
||||||
|
|
||||||
|
import Musicreater
|
||||||
|
from Musicreater.constants import MIDI_PITCH_NAME_TABLE, PERCUSSION_INSTRUMENT_LIST
|
||||||
|
from utils.io import *
|
||||||
|
|
||||||
|
osc.project_name = "伶伦暨模组特用奇巧"
|
||||||
|
osc.version = __version__
|
||||||
|
|
||||||
|
|
||||||
|
if len(sys.argv) > 0:
|
||||||
|
|
||||||
|
def go_for_args(debugMode: str = "False", logfile: str = "True"):
|
||||||
|
global logger
|
||||||
|
osc.isRelease = False if debugMode.lower() in ("true", "1") else True
|
||||||
|
logger.printing = not osc.isRelease
|
||||||
|
logger.writing = True if logfile.lower() in ("true", "1") else False
|
||||||
|
|
||||||
|
go_for_args(*sys.argv)
|
||||||
|
|
||||||
|
|
||||||
|
# 显示大标题
|
||||||
|
|
||||||
|
MainConsole.print(
|
||||||
|
"[#121110 on #F0F2F4] ",
|
||||||
|
style="#121110 on #F0F2F4",
|
||||||
|
justify="center",
|
||||||
|
)
|
||||||
|
MainConsole.rule(
|
||||||
|
title="[bold #AB70FF]欢迎使用{}".format(osc.project_name),
|
||||||
|
characters="=",
|
||||||
|
style="#26E2FF",
|
||||||
|
)
|
||||||
|
# MainConsole.rule(title="[bold #AB70FF]Welcome to Linglun Converter", characters="-")
|
||||||
|
MainConsole.rule(
|
||||||
|
title="[#AB70FF]版本{} | 音·创内核版本{}".format(__version__, Musicreater.__version__),
|
||||||
|
characters="-",
|
||||||
|
style="#26E2FF",
|
||||||
|
)
|
||||||
|
MainConsole.print(
|
||||||
|
"[#121110 on #F0F2F4] ",
|
||||||
|
style="#121110 on #F0F2F4",
|
||||||
|
justify="center",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# 获取midi列表
|
||||||
|
while True:
|
||||||
|
midi_path = ipt(f"MIDI地址或所在目录地址:")
|
||||||
|
try:
|
||||||
|
if os.path.exists(midi_path):
|
||||||
|
if os.path.isfile(midi_path):
|
||||||
|
midis = (midi_path,)
|
||||||
|
elif os.path.isdir(midi_path):
|
||||||
|
midis = (
|
||||||
|
os.path.join(midi_path, i)
|
||||||
|
for i in os.listdir(midi_path)
|
||||||
|
if i.lower().endswith(".mid") or i.lower().endswith(".midi")
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
prt("输入内容有误,请重新输入。")
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
prt("该地址不存在,或无法访问该地址,请重新输入。")
|
||||||
|
continue
|
||||||
|
except PermissionError:
|
||||||
|
prt("无法访问该地址,请检查是否给予程序相关文件的访问权限。")
|
||||||
|
continue
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
# percussion_only = format_ipt(
|
||||||
|
# "仅处理打击乐器 (否/0|是/1):", bool_str, "输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n"
|
||||||
|
# )[1]
|
||||||
|
|
||||||
|
speed: float = format_ipt("播放速度", float_str, "错误,需要浮点型数据;请重新输入。")[1]
|
||||||
|
|
||||||
|
|
||||||
|
final_result: Dict[str, Dict[int, List[Tuple[str, int, str]]]] = {}
|
||||||
|
|
||||||
|
for single_midi in midis:
|
||||||
|
fn = os.path.splitext(os.path.split(single_midi)[-1])[0]
|
||||||
|
midi_cvt = Musicreater.MidiConvert.from_midi_file(
|
||||||
|
single_midi,
|
||||||
|
)
|
||||||
|
midi_cvt.to_music_channels()
|
||||||
|
|
||||||
|
max_delay = 0
|
||||||
|
instrument_ID = -1
|
||||||
|
total_track = {}
|
||||||
|
instriments = {}
|
||||||
|
|
||||||
|
# 此处 我们把通道视为音轨
|
||||||
|
for i in midi_cvt.channels.keys():
|
||||||
|
# 如果当前通道为空 则跳过
|
||||||
|
if not midi_cvt.channels[i]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
# 第十通道是打击乐通道
|
||||||
|
SpecialBits = True if i == 9 else False
|
||||||
|
|
||||||
|
for track_no, track in midi_cvt.channels[i].items():
|
||||||
|
for msg in track:
|
||||||
|
if msg[0] == "PgmC":
|
||||||
|
instrument_ID = msg[1]
|
||||||
|
|
||||||
|
if msg[0] == "NoteS":
|
||||||
|
soundID, _X = (
|
||||||
|
midi_cvt.perc_inst_to_soundID_withX(msg[1])
|
||||||
|
if SpecialBits
|
||||||
|
else midi_cvt.inst_to_souldID_withX(instrument_ID)
|
||||||
|
)
|
||||||
|
score_now = round(msg[-1] / float(speed) / 50)
|
||||||
|
max_delay = max(max_delay, score_now)
|
||||||
|
mc_pitch = "" if SpecialBits else 2 ** ((msg[1] - 60 - _X) / 12)
|
||||||
|
try:
|
||||||
|
total_track[score_now].append(
|
||||||
|
(MIDI_PITCH_NAME_TABLE[msg[1]], mc_pitch, soundID),
|
||||||
|
)
|
||||||
|
except (IndexError, KeyError):
|
||||||
|
total_track[score_now] = [
|
||||||
|
(MIDI_PITCH_NAME_TABLE[msg[1]], mc_pitch, soundID),
|
||||||
|
]
|
||||||
|
|
||||||
|
try:
|
||||||
|
instriments[soundID] += 1
|
||||||
|
except (IndexError, KeyError):
|
||||||
|
instriments[soundID] = 1
|
||||||
|
|
||||||
|
del midi_cvt
|
||||||
|
|
||||||
|
table = Table(
|
||||||
|
*instriments.keys(),
|
||||||
|
title="[bold #AB70FF on #121110]{} 乐器统计".format(fn),
|
||||||
|
title_style="#26E2FF on #121110",
|
||||||
|
)
|
||||||
|
table.add_row(*[str(i) for i in instriments.values()])
|
||||||
|
|
||||||
|
MainConsole.print(
|
||||||
|
"[bold #8B50DF on #F0F2F4]-={}=-".format(fn),
|
||||||
|
style="#AB70FF on #F0F2F4",
|
||||||
|
justify="center",
|
||||||
|
)
|
||||||
|
|
||||||
|
prt(table)
|
||||||
|
|
||||||
|
inst_selected: Set[str] = format_ipt(
|
||||||
|
"""请选择需要保留的乐器;以空格作分割;以 percussion 表示全部打击乐器|以 pitched 表示全部乐音乐器|以 all 表示所有乐器\n:""",
|
||||||
|
lambda x: set(
|
||||||
|
[
|
||||||
|
i.lower()
|
||||||
|
for i in x.split(" ")
|
||||||
|
if isin(
|
||||||
|
i,
|
||||||
|
{
|
||||||
|
True: (
|
||||||
|
list(instriments.keys()) + ["all", "pitched", "percussion"]
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"输入错误,需要在已有的乐器范围之内。",
|
||||||
|
strict_mode=True,
|
||||||
|
)[1]
|
||||||
|
|
||||||
|
if "all" in inst_selected:
|
||||||
|
inst_selected.remove("all")
|
||||||
|
for i in instriments.keys():
|
||||||
|
inst_selected.add(i)
|
||||||
|
|
||||||
|
if "percussion" in inst_selected:
|
||||||
|
inst_selected.remove("percussion")
|
||||||
|
for i in instriments.keys():
|
||||||
|
if i in PERCUSSION_INSTRUMENT_LIST:
|
||||||
|
inst_selected.add(i)
|
||||||
|
|
||||||
|
if "pitched" in inst_selected:
|
||||||
|
inst_selected.remove("pitched")
|
||||||
|
for i in instriments.keys():
|
||||||
|
if i not in PERCUSSION_INSTRUMENT_LIST:
|
||||||
|
inst_selected.add(i)
|
||||||
|
|
||||||
|
result_piece = []
|
||||||
|
for i, ele in total_track.items():
|
||||||
|
this_ele = [k for k in ele if k[-1] in inst_selected]
|
||||||
|
if this_ele:
|
||||||
|
result_piece.append((i, this_ele))
|
||||||
|
|
||||||
|
result_piece.sort(key=lambda x: x[0])
|
||||||
|
|
||||||
|
final_result[fn] = {}
|
||||||
|
for ind, ele in result_piece:
|
||||||
|
final_result[fn][ind - result_piece[0][0]] = ele
|
||||||
|
|
||||||
|
with open("result.json", "w", encoding="utf-8") as f:
|
||||||
|
json.dump(
|
||||||
|
final_result,
|
||||||
|
f,
|
||||||
|
ensure_ascii=False,
|
||||||
|
indent=3,
|
||||||
|
sort_keys=True,
|
||||||
|
)
|
||||||
119
llc_win_tk.py
119
llc_win_tk.py
@@ -1,119 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# 伶伦 开发交流群 861684859
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
伶伦转换器
|
|
||||||
Linglun Converter
|
|
||||||
|
|
||||||
版权所有 © 2023 金羿 & 睿穆开发组
|
|
||||||
Copyright © 2023 EillesWan & TriM Org.
|
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
|
||||||
Terms & Conditions: ./Lisense.md
|
|
||||||
"""
|
|
||||||
|
|
||||||
__version__ = "0.0.1"
|
|
||||||
|
|
||||||
import datetime
|
|
||||||
import os
|
|
||||||
import random
|
|
||||||
import sys
|
|
||||||
|
|
||||||
print("小贴:不妨试试Mid-BDX转换网页:在线的多功能Midi转换器")
|
|
||||||
print("https://dislink.github.io/midi2bdx/")
|
|
||||||
|
|
||||||
import Musicreater
|
|
||||||
|
|
||||||
from utils.io import *
|
|
||||||
from languages.lang import languages
|
|
||||||
|
|
||||||
MainConsole.print(
|
|
||||||
"[#121110 on #F0F2F4] ",
|
|
||||||
style="#121110 on #F0F2F4",
|
|
||||||
justify="center",
|
|
||||||
)
|
|
||||||
|
|
||||||
osc.project_name = "伶伦转换器"
|
|
||||||
osc.version = __version__
|
|
||||||
|
|
||||||
|
|
||||||
def go_for_args(
|
|
||||||
languageChange: str = "ZH-CN", debugMode: str = "False", logfile: str = "True"
|
|
||||||
):
|
|
||||||
global currentLang
|
|
||||||
global logger
|
|
||||||
currentLang = (
|
|
||||||
languageChange.upper()
|
|
||||||
if languageChange.upper() in languages.keys()
|
|
||||||
else "ZH-CN"
|
|
||||||
)
|
|
||||||
osc.isRelease = False if debugMode.lower() in ("true", "1") else True
|
|
||||||
logger.printing = not osc.isRelease
|
|
||||||
logger.writing = True if logfile.lower() in ("true", "1") else False
|
|
||||||
|
|
||||||
|
|
||||||
if len(sys.argv) > 0:
|
|
||||||
go_for_args(*sys.argv)
|
|
||||||
|
|
||||||
|
|
||||||
def _(__):
|
|
||||||
"""
|
|
||||||
`languages`
|
|
||||||
"""
|
|
||||||
return languages[currentLang][__]
|
|
||||||
|
|
||||||
|
|
||||||
# 显示大标题
|
|
||||||
MainConsole.rule(title="[bold #AB70FF]欢迎使用伶伦独立转换器", characters="=", style="#26E2FF")
|
|
||||||
MainConsole.rule(title="[bold #AB70FF]Welcome to Linglun Converter", characters="-")
|
|
||||||
|
|
||||||
nowYang = datetime.datetime.now()
|
|
||||||
|
|
||||||
if nowYang.month == 8 and nowYang.day == 6:
|
|
||||||
# 诸葛八卦生日
|
|
||||||
MainConsole.print(
|
|
||||||
"[#7DB5F0 on #121110]今天可不是催更的日子!\n诸葛亮与八卦阵{}岁生日快乐!".format(nowYang.year - 2008),
|
|
||||||
style="#7DB5F0 on #121110",
|
|
||||||
justify="center",
|
|
||||||
)
|
|
||||||
elif nowYang.month == 4 and nowYang.day == 3:
|
|
||||||
# 金羿生日快乐
|
|
||||||
MainConsole.print(
|
|
||||||
"[#0089F2 on #F0F2F4]今天就不要催更啦!\n金羿{}岁生日快乐!".format(nowYang.year - 2006),
|
|
||||||
style="#0089F2 on #F0F2F4",
|
|
||||||
justify="center",
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
# 显示箴言部分
|
|
||||||
MainConsole.print(
|
|
||||||
"[#121110 on #F0F2F4]{}".format(random.choice(myWords)),
|
|
||||||
style="#121110 on #F0F2F4",
|
|
||||||
justify="center",
|
|
||||||
)
|
|
||||||
|
|
||||||
prt(f"{_('LangChd')}{_(':')}{_(currentLang)}")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __main__():
|
|
||||||
|
|
||||||
print('伶伦转换器简易版 正在启动……')
|
|
||||||
|
|
||||||
|
|
||||||
print('更新执行位置...')
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
try:
|
|
||||||
os.chdir(__file__[:len(__file__) - __file__[len(__file__)::-1].index('\\')])
|
|
||||||
logger.info('更新执行位置,当前文件位置 {}'.format(__file__))
|
|
||||||
except FileNotFoundError: # 程序规范修改:根据新的语法标准:except后面不能没有错误类型,所以既然是pass就随便填一个错误
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
os.chdir(__file__[:len(__file__) - __file__[len(__file__)::-1].index('/')])
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
log('其他平台:{} 更新执行位置,当前文件位置 {}'.format(sys.platform, __file__))
|
|
||||||
print('完成!')
|
|
||||||
1095
llc_win_wxPython.py
1095
llc_win_wxPython.py
File diff suppressed because it is too large
Load Diff
BIN
resources/LLC_LOGO_OK_PLAIN_BANNER.ico
Normal file
BIN
resources/LLC_LOGO_OK_PLAIN_BANNER.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
1624
resources/LLC_LOGO_OK_PLAIN_BANNER.pdn
Normal file
1624
resources/LLC_LOGO_OK_PLAIN_BANNER.pdn
Normal file
File diff suppressed because one or more lines are too long
BIN
resources/LLC_LOGO_OK_PLAIN_BANNER.png
Normal file
BIN
resources/LLC_LOGO_OK_PLAIN_BANNER.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 535 KiB |
69
utils/io.py
69
utils/io.py
@@ -1,7 +1,7 @@
|
|||||||
from typing import Any, Literal, Optional, TextIO
|
|
||||||
|
|
||||||
import urllib.request
|
|
||||||
import urllib.error
|
import urllib.error
|
||||||
|
import urllib.request
|
||||||
|
from typing import Any, Callable, Dict, List, Literal, Optional, Set, TextIO, Tuple
|
||||||
|
|
||||||
import TrimLog
|
import TrimLog
|
||||||
from TrimLog import Console, object_constants
|
from TrimLog import Console, object_constants
|
||||||
|
|
||||||
@@ -19,10 +19,10 @@ logger = TrimLog.Logger(
|
|||||||
try:
|
try:
|
||||||
myWords = (
|
myWords = (
|
||||||
urllib.request.urlopen(
|
urllib.request.urlopen(
|
||||||
'https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt'
|
"https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt"
|
||||||
)
|
)
|
||||||
.read()
|
.read()
|
||||||
.decode('utf-8')
|
.decode("utf-8")
|
||||||
.strip("\n")
|
.strip("\n")
|
||||||
.split("\n")
|
.split("\n")
|
||||||
)
|
)
|
||||||
@@ -158,27 +158,32 @@ def ipt(
|
|||||||
|
|
||||||
def format_ipt(
|
def format_ipt(
|
||||||
notice: str,
|
notice: str,
|
||||||
fun,
|
fun: Callable,
|
||||||
err_note: str = "",
|
err_note: str = "{}",
|
||||||
|
strict_mode: bool = False,
|
||||||
*extraArg,
|
*extraArg,
|
||||||
):
|
) -> Tuple[str, Any]:
|
||||||
"""循环输入,以某种格式
|
"""循环输入,以某种格式
|
||||||
notice: 输入时的提示
|
notice: 输入时的提示
|
||||||
fun: 格式函数
|
fun: 格式函数
|
||||||
err_note: 输入不符格式时的提示
|
err_note: 输入不符格式时的提示
|
||||||
|
strict_mode: 是否将函数值作为结束循环的判断依据之一
|
||||||
*extraArg: 对于函数的其他参数"""
|
*extraArg: 对于函数的其他参数"""
|
||||||
while True:
|
while True:
|
||||||
result = ipt(notice)
|
result = ipt(notice)
|
||||||
# noinspection PyBroadException
|
|
||||||
try:
|
try:
|
||||||
fun_result = fun(result, *extraArg)
|
if strict_mode:
|
||||||
break
|
if fun_result := fun(result, *extraArg):
|
||||||
# noinspection PyBroadException
|
break
|
||||||
except BaseException:
|
else:
|
||||||
prt(err_note)
|
fun_result = fun(result, *extraArg)
|
||||||
|
break
|
||||||
|
except ValueError as E:
|
||||||
|
prt(err_note.format(E))
|
||||||
continue
|
continue
|
||||||
return result, fun_result
|
return result, fun_result
|
||||||
|
|
||||||
|
|
||||||
def isin(sth: str, range_list: dict):
|
def isin(sth: str, range_list: dict):
|
||||||
sth = sth.lower()
|
sth = sth.lower()
|
||||||
for bool_value, res_list in range_list.items():
|
for bool_value, res_list in range_list.items():
|
||||||
@@ -192,9 +197,9 @@ def bool_str(sth: str):
|
|||||||
try:
|
try:
|
||||||
return bool(float(sth))
|
return bool(float(sth))
|
||||||
except:
|
except:
|
||||||
if str(sth).lower() in ("true", "真", "是", 'y', 't'):
|
if str(sth).lower() in ("true", "真", "是", "y", "t"):
|
||||||
return True
|
return True
|
||||||
elif str(sth).lower() in ("false", "假", "否", 'f', 'n'):
|
elif str(sth).lower() in ("false", "假", "否", "f", "n"):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
@@ -205,12 +210,40 @@ def float_str(sth: str):
|
|||||||
return float(sth)
|
return float(sth)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
try:
|
try:
|
||||||
return float(sth.replace("壹", "1").replace("贰", "2").replace("叁", "3").replace("肆", "4").replace("伍", "5").replace("陆", "6").replace("柒", "7").replace("捌", "8").replace("玖", "9").replace("零", "0").replace("一", "1").replace("二",'2').replace("三", "3").replace("四", "4").replace("五", "5").replace("六", "6").replace("七", "7").replace("八", "8").replace("九", "9").replace("〇", "0").replace("洞", "0").replace("幺", "1").replace("俩", "2").replace("两", "2").replace("拐","7").replace("点",'.'))
|
return float(
|
||||||
|
sth.replace("壹", "1")
|
||||||
|
.replace("贰", "2")
|
||||||
|
.replace("叁", "3")
|
||||||
|
.replace("肆", "4")
|
||||||
|
.replace("伍", "5")
|
||||||
|
.replace("陆", "6")
|
||||||
|
.replace("柒", "7")
|
||||||
|
.replace("捌", "8")
|
||||||
|
.replace("玖", "9")
|
||||||
|
.replace("零", "0")
|
||||||
|
.replace("一", "1")
|
||||||
|
.replace("二", "2")
|
||||||
|
.replace("三", "3")
|
||||||
|
.replace("四", "4")
|
||||||
|
.replace("五", "5")
|
||||||
|
.replace("六", "6")
|
||||||
|
.replace("七", "7")
|
||||||
|
.replace("八", "8")
|
||||||
|
.replace("九", "9")
|
||||||
|
.replace("〇", "0")
|
||||||
|
.replace("洞", "0")
|
||||||
|
.replace("幺", "1")
|
||||||
|
.replace("俩", "2")
|
||||||
|
.replace("两", "2")
|
||||||
|
.replace("拐", "7")
|
||||||
|
.replace("点", ".")
|
||||||
|
)
|
||||||
except:
|
except:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
|
|
||||||
def int_str(sth: str):
|
def int_str(sth: str):
|
||||||
try:
|
try:
|
||||||
return int(float_str(sth))
|
return int(float_str(sth))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|||||||
2200
wxFB_Project/LingLunConverter.fbp
Normal file
2200
wxFB_Project/LingLunConverter.fbp
Normal file
File diff suppressed because it is too large
Load Diff
352
wxFB_Project/generated.py
Normal file
352
wxFB_Project/generated.py
Normal file
@@ -0,0 +1,352 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||||
|
## http://www.wxformbuilder.org/
|
||||||
|
##
|
||||||
|
## PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
import wx
|
||||||
|
import wx.xrc
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
## Class LingLunMainFrame
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
class LingLunMainFrame ( wx.Frame ):
|
||||||
|
|
||||||
|
def __init__( self, parent ):
|
||||||
|
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 659,778 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL, name = u"LingLunConverter" )
|
||||||
|
|
||||||
|
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
|
||||||
|
self.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||||
|
self.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
|
||||||
|
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )
|
||||||
|
|
||||||
|
self.m_statusBar2 = self.CreateStatusBar( 1, wx.STB_SIZEGRIP, wx.ID_ANY )
|
||||||
|
self.m_menubar1 = wx.MenuBar( 0 )
|
||||||
|
self.FileMenu = wx.Menu()
|
||||||
|
self.m_Exit_menuItem1 = wx.MenuItem( self.FileMenu, wx.ID_ANY, u"退出", u"这是退出按钮", wx.ITEM_NORMAL )
|
||||||
|
self.FileMenu.Append( self.m_Exit_menuItem1 )
|
||||||
|
|
||||||
|
self.m_menubar1.Append( self.FileMenu, u"文件" )
|
||||||
|
|
||||||
|
self.SetMenuBar( self.m_menubar1 )
|
||||||
|
|
||||||
|
m_mainBoxSizer = wx.BoxSizer( wx.VERTICAL )
|
||||||
|
|
||||||
|
s_yanLunbarSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"言·论" ), wx.VERTICAL )
|
||||||
|
|
||||||
|
self.m_LinglunWords_staticText1 = wx.StaticText( s_yanLunbarSizer.GetStaticBox(), wx.ID_ANY, u"灵光焕发 深艺献心", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL|wx.ST_ELLIPSIZE_MIDDLE|wx.ST_NO_AUTORESIZE )
|
||||||
|
self.m_LinglunWords_staticText1.Wrap( -1 )
|
||||||
|
|
||||||
|
self.m_LinglunWords_staticText1.SetFont( wx.Font( 12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans B" ) )
|
||||||
|
self.m_LinglunWords_staticText1.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHTTEXT ) )
|
||||||
|
self.m_LinglunWords_staticText1.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
|
||||||
|
|
||||||
|
s_yanLunbarSizer.Add( self.m_LinglunWords_staticText1, 0, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
m_mainBoxSizer.Add( s_yanLunbarSizer, 1, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN|wx.TOP, 2 )
|
||||||
|
|
||||||
|
s_midiChooseSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||||
|
|
||||||
|
self.m_ChooseMidiTips_staticText3 = wx.StaticText( self, wx.ID_ANY, u"选择MIDI文件", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
self.m_ChooseMidiTips_staticText3.Wrap( -1 )
|
||||||
|
|
||||||
|
s_midiChooseSizer.Add( self.m_ChooseMidiTips_staticText3, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
ss_MidiChooserSizer_bSizer9 = wx.BoxSizer( wx.VERTICAL )
|
||||||
|
|
||||||
|
self.m_ChooseMIDI_filePicker1 = wx.FilePickerCtrl( self, wx.ID_ANY, u"./", u"选择MIDI文件", u"MIDI 序列 (*.mid;*.midi)|*.mid;*.midi", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE|wx.FLP_FILE_MUST_EXIST|wx.FLP_OPEN|wx.FLP_USE_TEXTCTRL )
|
||||||
|
ss_MidiChooserSizer_bSizer9.Add( self.m_ChooseMIDI_filePicker1, 0, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
s_midiChooseSizer.Add( ss_MidiChooserSizer_bSizer9, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
m_mainBoxSizer.Add( s_midiChooseSizer, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
s_formatChooseSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||||
|
|
||||||
|
ss_outputFormatChooseSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"选择输出格式" ), wx.VERTICAL )
|
||||||
|
|
||||||
|
m_outformatChoice_choice1Choices = [ u"附加包", u"BDX结构" ]
|
||||||
|
self.m_outformatChoice_choice1 = wx.Choice( ss_outputFormatChooseSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_outformatChoice_choice1Choices, wx.CB_SORT )
|
||||||
|
self.m_outformatChoice_choice1.SetSelection( 0 )
|
||||||
|
ss_outputFormatChooseSizer.Add( self.m_outformatChoice_choice1, 0, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
s_formatChooseSizer.Add( ss_outputFormatChooseSizer, 1, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
ss_playerChooseSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"选择播放器" ), wx.VERTICAL )
|
||||||
|
|
||||||
|
m_playerChoice_choice2Choices = [ u"计分板", u"延时", u"中继器" ]
|
||||||
|
self.m_playerChoice_choice2 = wx.Choice( ss_playerChooseSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_playerChoice_choice2Choices, 0 )
|
||||||
|
self.m_playerChoice_choice2.SetSelection( 0 )
|
||||||
|
ss_playerChooseSizer.Add( self.m_playerChoice_choice2, 0, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
s_formatChooseSizer.Add( ss_playerChooseSizer, 1, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
m_mainBoxSizer.Add( s_formatChooseSizer, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
s_promptSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"转换参数" ), wx.VERTICAL )
|
||||||
|
|
||||||
|
ss_regularPromoptsEnteringSizer1 = wx.BoxSizer( wx.HORIZONTAL )
|
||||||
|
|
||||||
|
sss_VolumnPersentageEnteringSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"音量大小" ), wx.HORIZONTAL )
|
||||||
|
|
||||||
|
self.m_volumn_slider = wx.Slider( sss_VolumnPersentageEnteringSizer.GetStaticBox(), wx.ID_ANY, 1000, 0, 1000, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL )
|
||||||
|
sss_VolumnPersentageEnteringSizer.Add( self.m_volumn_slider, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_volumn_spinCtrlDouble1 = wx.SpinCtrlDouble( sss_VolumnPersentageEnteringSizer.GetStaticBox(), wx.ID_ANY, u"100", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL|wx.SP_ARROW_KEYS|wx.TE_PROCESS_ENTER, 0, 100, 100.000000, 0.5 )
|
||||||
|
self.m_volumn_spinCtrlDouble1.SetDigits( 2 )
|
||||||
|
sss_VolumnPersentageEnteringSizer.Add( self.m_volumn_spinCtrlDouble1, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
ss_regularPromoptsEnteringSizer1.Add( sss_VolumnPersentageEnteringSizer, 1, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
sss_SpeedEnteringSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"播放倍速" ), wx.HORIZONTAL )
|
||||||
|
|
||||||
|
self.m_speed_slider = wx.Slider( sss_SpeedEnteringSizer.GetStaticBox(), wx.ID_ANY, 50, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL )
|
||||||
|
sss_SpeedEnteringSizer.Add( self.m_speed_slider, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_speed_spinCtrlDouble = wx.SpinCtrlDouble( sss_SpeedEnteringSizer.GetStaticBox(), wx.ID_ANY, u"1", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL|wx.SP_ARROW_KEYS|wx.TE_PROCESS_ENTER, 0, 10, 1, 0.1 )
|
||||||
|
self.m_speed_spinCtrlDouble.SetDigits( 2 )
|
||||||
|
sss_SpeedEnteringSizer.Add( self.m_speed_spinCtrlDouble, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
ss_regularPromoptsEnteringSizer1.Add( sss_SpeedEnteringSizer, 1, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
s_promptSizer.Add( ss_regularPromoptsEnteringSizer1, 1, wx.EXPAND|wx.SHAPED, 5 )
|
||||||
|
|
||||||
|
ss_progressbarCheckingSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"进度条" ), wx.HORIZONTAL )
|
||||||
|
|
||||||
|
self.m_progressBarEnablingCheckBox1 = wx.CheckBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用进度条", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT )
|
||||||
|
self.m_progressBarEnablingCheckBox1.SetValue(True)
|
||||||
|
ss_progressbarCheckingSizer.Add( self.m_progressBarEnablingCheckBox1, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
sss_customProgressBarSizer_wSizer6 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )
|
||||||
|
|
||||||
|
ssss_basicProgressStylePattle_sbSizer9 = wx.StaticBoxSizer( wx.StaticBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"基本样式组" ), wx.VERTICAL )
|
||||||
|
|
||||||
|
self.m_BasicProgressBarStyleEntering_textCtrl4 = wx.TextCtrl( ssss_basicProgressStylePattle_sbSizer9.GetStaticBox(), wx.ID_ANY, u"▶ %%N [ %%s/%^s %%% __________ %%t|%^t ]", wx.DefaultPosition, wx.DefaultSize, wx.TE_LEFT|wx.TE_NO_VSCROLL|wx.TE_RICH )
|
||||||
|
ssss_basicProgressStylePattle_sbSizer9.Add( self.m_BasicProgressBarStyleEntering_textCtrl4, 0, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
sss_customProgressBarSizer_wSizer6.Add( ssss_basicProgressStylePattle_sbSizer9, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
ssss_UnplayedPartProgressbarPattle_sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"未播放之样式" ), wx.VERTICAL )
|
||||||
|
|
||||||
|
self.m_unplayerProgressbarStyleEntering_textCtrl5 = wx.TextCtrl( ssss_UnplayedPartProgressbarPattle_sbSizer10.GetStaticBox(), wx.ID_ANY, u"§7=§r", wx.DefaultPosition, wx.DefaultSize, wx.TE_LEFT|wx.TE_NO_VSCROLL )
|
||||||
|
ssss_UnplayedPartProgressbarPattle_sbSizer10.Add( self.m_unplayerProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
sss_customProgressBarSizer_wSizer6.Add( ssss_UnplayedPartProgressbarPattle_sbSizer10, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
ssss_PlayedPartProgressbarPattle_sbSizer11 = wx.StaticBoxSizer( wx.StaticBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"已播放之样式" ), wx.VERTICAL )
|
||||||
|
|
||||||
|
self.m_playerProgressbarStyleEntering_textCtrl5 = wx.TextCtrl( ssss_PlayedPartProgressbarPattle_sbSizer11.GetStaticBox(), wx.ID_ANY, u"§e=§r", wx.DefaultPosition, wx.DefaultSize, wx.TE_LEFT|wx.TE_NO_VSCROLL )
|
||||||
|
ssss_PlayedPartProgressbarPattle_sbSizer11.Add( self.m_playerProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
sss_customProgressBarSizer_wSizer6.Add( ssss_PlayedPartProgressbarPattle_sbSizer11, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
ss_progressbarCheckingSizer.Add( sss_customProgressBarSizer_wSizer6, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
s_promptSizer.Add( ss_progressbarCheckingSizer, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
ss_HideAndSeekSizer_bSizer15 = wx.BoxSizer( wx.VERTICAL )
|
||||||
|
|
||||||
|
sss_ScoreboardPlayerPromptsSizer_bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
|
||||||
|
|
||||||
|
self.m_EnterScoreboardNameTip_staticText4 = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"播放计分板名称", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
self.m_EnterScoreboardNameTip_staticText4.Wrap( -1 )
|
||||||
|
|
||||||
|
sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_EnterScoreboardNameTip_staticText4, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_ScoreboardNameEntering_textCtrl9 = wx.TextCtrl( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"mscplay", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
self.m_ScoreboardNameEntering_textCtrl9.SetMaxLength( 10 )
|
||||||
|
sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_ScoreboardNameEntering_textCtrl9, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_staticline1 = wx.StaticLine( s_promptSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
|
||||||
|
self.m_staticline1.SetMinSize( wx.Size( 2,-1 ) )
|
||||||
|
|
||||||
|
sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_staticline1, 0, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
self.m_IsAutoResetScoreboard_checkBox2 = wx.CheckBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"自动重置计分板", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT )
|
||||||
|
sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_IsAutoResetScoreboard_checkBox2, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
ss_HideAndSeekSizer_bSizer15.Add( sss_ScoreboardPlayerPromptsSizer_bSizer7, 1, wx.SHAPED, 5 )
|
||||||
|
|
||||||
|
sss_StructurePlayerPromptsSizer_bSizer8 = wx.BoxSizer( wx.HORIZONTAL )
|
||||||
|
|
||||||
|
self.m_PlayerSelectorEnteringTips_staticText41 = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"玩家选择器", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
self.m_PlayerSelectorEnteringTips_staticText41.Wrap( -1 )
|
||||||
|
|
||||||
|
sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_PlayerSelectorEnteringTips_staticText41, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
m_PlayerSelectorEntering_comboBox1Choices = [ u"@a", u"@p", u"@e[type=player]" ]
|
||||||
|
self.m_PlayerSelectorEntering_comboBox1 = wx.ComboBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"@a", wx.DefaultPosition, wx.DefaultSize, m_PlayerSelectorEntering_comboBox1Choices, wx.CB_DROPDOWN|wx.TE_PROCESS_ENTER )
|
||||||
|
self.m_PlayerSelectorEntering_comboBox1.SetSelection( 0 )
|
||||||
|
sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_PlayerSelectorEntering_comboBox1, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_staticline2 = wx.StaticLine( s_promptSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
|
||||||
|
self.m_staticline2.SetMinSize( wx.Size( 2,-1 ) )
|
||||||
|
|
||||||
|
sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_staticline2, 0, wx.ALL|wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
self.StructureMaxHeoghtTips_ = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"结构生成最大高度", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
self.StructureMaxHeoghtTips_.Wrap( -1 )
|
||||||
|
|
||||||
|
sss_StructurePlayerPromptsSizer_bSizer8.Add( self.StructureMaxHeoghtTips_, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_StructureHeight_slider7 = wx.Slider( s_promptSizer.GetStaticBox(), wx.ID_ANY, 50, 3, 1024, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL )
|
||||||
|
sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_StructureHeight_slider7, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_spinCtrl1 = wx.SpinCtrl( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"50", wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 3, 1024, 50 )
|
||||||
|
sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_spinCtrl1, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
ss_HideAndSeekSizer_bSizer15.Add( sss_StructurePlayerPromptsSizer_bSizer8, 1, wx.SHAPED, 5 )
|
||||||
|
|
||||||
|
sss_BDXfileSignNameSizer_bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
|
||||||
|
|
||||||
|
self.m_BDXfileSignNameTips_staticText8 = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"BDX作者署名", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
self.m_BDXfileSignNameTips_staticText8.Wrap( -1 )
|
||||||
|
|
||||||
|
sss_BDXfileSignNameSizer_bSizer13.Add( self.m_BDXfileSignNameTips_staticText8, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.m_EnteringBDXfileSignName_textCtrl12 = wx.TextCtrl( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"UserYou", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
sss_BDXfileSignNameSizer_bSizer13.Add( self.m_EnteringBDXfileSignName_textCtrl12, 0, wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
ss_HideAndSeekSizer_bSizer15.Add( sss_BDXfileSignNameSizer_bSizer13, 1, wx.SHAPED, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
s_promptSizer.Add( ss_HideAndSeekSizer_bSizer15, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
m_mainBoxSizer.Add( s_promptSizer, 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
s_StartSizer_sbSizer18 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"开始转换" ), wx.HORIZONTAL )
|
||||||
|
|
||||||
|
s_StartSizer_sbSizer18.SetMinSize( wx.Size( -1,100 ) )
|
||||||
|
|
||||||
|
s_StartSizer_sbSizer18.Add( ( 0, 0), 1, wx.EXPAND, 5 )
|
||||||
|
|
||||||
|
self.m_button2 = wx.Button( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"转换,启动!", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||||
|
s_StartSizer_sbSizer18.Add( self.m_button2, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
m_mainBoxSizer.Add( s_StartSizer_sbSizer18, 1, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN, 5 )
|
||||||
|
|
||||||
|
|
||||||
|
self.SetSizer( m_mainBoxSizer )
|
||||||
|
self.Layout()
|
||||||
|
|
||||||
|
self.Centre( wx.BOTH )
|
||||||
|
|
||||||
|
# Connect Events
|
||||||
|
self.Bind( wx.EVT_MENU, self.onExitButtonPressed, id = self.m_Exit_menuItem1.GetId() )
|
||||||
|
self.m_LinglunWords_staticText1.Bind( wx.EVT_LEFT_DCLICK, self.onYanlunDClicked )
|
||||||
|
self.m_LinglunWords_staticText1.Bind( wx.EVT_MOUSEWHEEL, self.onYanlunWheeled )
|
||||||
|
self.m_ChooseMidiTips_staticText3.Bind( wx.EVT_LEFT_DCLICK, self.MidiEasterEgg )
|
||||||
|
self.m_ChooseMIDI_filePicker1.Bind( wx.EVT_FILEPICKER_CHANGED, self.onFileChosen )
|
||||||
|
self.m_outformatChoice_choice1.Bind( wx.EVT_CHOICE, self.onOutputFormatChosen )
|
||||||
|
self.m_playerChoice_choice2.Bind( wx.EVT_CHOICE, self.onPlayerChosen )
|
||||||
|
self.m_volumn_slider.Bind( wx.EVT_SCROLL, self.onVolumeScrolling )
|
||||||
|
self.m_volumn_spinCtrlDouble1.Bind( wx.EVT_SPINCTRLDOUBLE, self.onVolumeSpinChanged )
|
||||||
|
self.m_speed_slider.Bind( wx.EVT_SCROLL, self.onSpeedScrolling )
|
||||||
|
self.m_speed_spinCtrlDouble.Bind( wx.EVT_SPINCTRLDOUBLE, self.onSpeedSpinChanged )
|
||||||
|
self.m_progressBarEnablingCheckBox1.Bind( wx.EVT_CHECKBOX, self.onProgressbarChecked )
|
||||||
|
self.m_BasicProgressBarStyleEntering_textCtrl4.Bind( wx.EVT_TEXT, self.onProgressbarBasicStyleUpdating )
|
||||||
|
self.m_unplayerProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarUnplayedStyleUpdating )
|
||||||
|
self.m_playerProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarPlayedStyleUpdating )
|
||||||
|
self.m_ScoreboardNameEntering_textCtrl9.Bind( wx.EVT_TEXT, self.onScoreboredNameUpdating )
|
||||||
|
self.m_IsAutoResetScoreboard_checkBox2.Bind( wx.EVT_CHECKBOX, self.onAutoResetScoreboardChecked )
|
||||||
|
self.m_PlayerSelectorEntering_comboBox1.Bind( wx.EVT_TEXT, self.onPlayerSelectorUpdating )
|
||||||
|
self.m_StructureHeight_slider7.Bind( wx.EVT_SCROLL, self.onStructureMaxHeightScrolling )
|
||||||
|
self.m_spinCtrl1.Bind( wx.EVT_SPINCTRL, self.onStructureMaxHeightSpinChanged )
|
||||||
|
self.m_EnteringBDXfileSignName_textCtrl12.Bind( wx.EVT_TEXT, self.onBDXfileSignNameUpdating )
|
||||||
|
self.m_button2.Bind( wx.EVT_BUTTON, self.onStartButtonPressed )
|
||||||
|
|
||||||
|
def __del__( self ):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Virtual event handlers, override them in your derived class
|
||||||
|
def onExitButtonPressed( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onYanlunDClicked( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onYanlunWheeled( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def MidiEasterEgg( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onFileChosen( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onOutputFormatChosen( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onPlayerChosen( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onVolumeScrolling( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onVolumeSpinChanged( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onSpeedScrolling( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onSpeedSpinChanged( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onProgressbarChecked( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onProgressbarBasicStyleUpdating( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onProgressbarUnplayedStyleUpdating( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onProgressbarPlayedStyleUpdating( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onScoreboredNameUpdating( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onAutoResetScoreboardChecked( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onPlayerSelectorUpdating( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onStructureMaxHeightScrolling( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onStructureMaxHeightSpinChanged( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onBDXfileSignNameUpdating( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
def onStartButtonPressed( self, event ):
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user