mirror of
https://github.com/TriM-Organization/Linglun-Converter.git
synced 2025-12-17 09:57:01 +00:00
Compare commits
17 Commits
LLC_GUI_v0
...
v1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c64d9c440f | ||
|
|
28ec743b86 | ||
|
|
0139d0f130 | ||
|
|
24cf054cf0 | ||
|
|
81b824feed | ||
|
|
cb3c84d4ef | ||
|
|
264d1ec11c | ||
|
|
eaefb6f987 | ||
|
|
67ea8e1bf5 | ||
|
|
5c2a56dd50 | ||
|
|
0e36dd2418 | ||
|
|
50f1b08fc7 | ||
|
|
68d93068bb | ||
|
|
7d74b89649 | ||
|
|
7fad110d47 | ||
|
|
36daf19407 | ||
|
|
a2c2afaede |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -11,7 +11,12 @@ __pycache__/
|
||||
*.bdx
|
||||
*.json
|
||||
/Musicreater
|
||||
/TrimLog
|
||||
/logs
|
||||
*.llc.config
|
||||
/MSCT
|
||||
|
||||
salt.py
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
Copyright 2022 Team-Ryoun 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray")
|
||||
Copyright © 2024 Team-Ryoun 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray")
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
24
README.md
24
README.md
@@ -1,5 +1,11 @@
|
||||
<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>
|
||||
|
||||
<p align="center">
|
||||
@@ -7,18 +13,18 @@
|
||||
<p>
|
||||
|
||||
|
||||
[![][Bilibili: 凌云金羿]](https://space.bilibili.com/397369002/)
|
||||
[![][Bilibili: 金羿ELS]](https://space.bilibili.com/397369002/)
|
||||
[![][Bilibili: 诸葛亮与八卦阵]](https://space.bilibili.com/604072474)
|
||||
[![CodeStyle: black]](https://github.com/psf/black)
|
||||
[![][python]](https://www.python.org/)
|
||||
[![][license]](LICENSE)
|
||||
[![][release]](../../releases)
|
||||
<!-- [![][release]](../../releases) -->
|
||||
|
||||
|
||||
<!-- 简体中文 | [English](README_EN.md) -->
|
||||
|
||||
|
||||
## 软件介绍🚀
|
||||
## 介绍🚀
|
||||
|
||||
**伶伦** 是一款免费开源的 **《我的世界》** 数字音频工作站
|
||||
|
||||
@@ -40,22 +46,20 @@
|
||||
|
||||
[转换乐器对照参考表](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)
|
||||
|
||||
电邮 [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
|
||||
[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
|
||||
[release]: https://img.shields.io/github/v/release/EillesWan/Musicreater?style=for-the-badge
|
||||
<!-- [release]: https://img.shields.io//TriM-Organization/Linglun-Converter?style=for-the-badge -->
|
||||
[license]: https://img.shields.io/badge/Licence-Apache-228B22?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*,因为作者就用的是这个版本
|
||||
|
||||
!注意!此程序现已不支持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)
|
||||
> [下载32位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe)
|
||||
> [下载64位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.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`,如下图所示:
|
||||
|
||||
@@ -19,12 +44,12 @@
|
||||
|
||||
<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)
|
||||
|
||||
@@ -42,7 +67,7 @@
|
||||
|
||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||
|
||||
## 二、本工具的下载与使用
|
||||
### 二、本工具的下载与使用
|
||||
|
||||
0. 下载本代码库以及演示程序
|
||||
|
||||
@@ -66,13 +91,13 @@
|
||||
<img src=https://foruda.gitee.com/images/1659974437388532868/输入.png>
|
||||
<img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png>
|
||||
|
||||
使用以下指令:
|
||||
在打开的终端中使用以下指令:
|
||||
|
||||
```bash
|
||||
python ./llc_cli.py
|
||||
```
|
||||
|
||||
## 三、安装时错误的补充说明
|
||||
### 三、安装时错误的补充说明
|
||||
|
||||
1. Microsoft Visual C++ Redistributable 环境出错
|
||||
|
||||
@@ -84,4 +109,4 @@
|
||||
> [下载64位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
> [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x86.exe)
|
||||
|
||||
感谢群友*Mono*帮我们发现这个问题。
|
||||
感谢群友 *Mono* 帮我们发现这个问题。
|
||||
@@ -1,8 +1,32 @@
|
||||
## Install Runtime Environment
|
||||
## Use a Pre-Built Release (Recommended)
|
||||
|
||||
### Install Python 3.6+
|
||||
### 一、Download the Packed Program
|
||||
|
||||
1. First of all, you need to install the runtime environment of this library, *Python*. And a Installation Pack maybe the best choice:
|
||||
1. Fne the newest release in [The Release Page](https://gitee.com/TriM-Organization/Linglun-Converter/releases)
|
||||
|
||||
<img src=https://foruda.gitee.com/images/1699105959996885442/be19644e_9911226.png>
|
||||
|
||||
Please consider a proper build release that satisfy your device.
|
||||
|
||||
### 二、Start Using
|
||||
|
||||
2. After downloading, extract the files and then double click `llc_win_wxPython.exe` to run.
|
||||
|
||||
<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. Start to use now.
|
||||
|
||||
<img src=https://foruda.gitee.com/images/1699106948861444130/30c156bc_9911226.png>
|
||||
|
||||
## Run From Source Code (latest functions provided)
|
||||
|
||||
### Install Runtime Environment
|
||||
|
||||
#### Install Python 3.8+
|
||||
|
||||
1. First of all, you need to install the runtime environment of this library, *Python*. But please ensure that the version is above 3.8. Maybe a Installation Pack could be one of the choices:
|
||||
|
||||
> [Downloading Python 64-bit](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)
|
||||
> [Downloading Python 32-bit](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe)
|
||||
@@ -22,7 +46,7 @@
|
||||
<img src=https://foruda.gitee.com/images/1659972669907359295/cmd.png>
|
||||
|
||||
|
||||
### Installing Requirements
|
||||
#### Installing Requirements
|
||||
|
||||
1. It's better to open your *Terminal*(CMD/PowerShell/Bash/etc) under Administrator Mode.
|
||||
|
||||
@@ -42,14 +66,14 @@
|
||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||
|
||||
|
||||
## Downloading & Using of this tool
|
||||
### Downloading & Using of this tool
|
||||
|
||||
1. Download This Package and Demo(s)
|
||||
1. Download This Package
|
||||
|
||||
- If you use Git, you can clone this lib via the following commands:
|
||||
|
||||
```bash
|
||||
git clone -b pkgver https://github.com/TriM-Organization/Musicreater.git
|
||||
git clone https://github.com/TriM-Organization/Linglun-Converter.git
|
||||
```
|
||||
|
||||
- If Git is not installed, you can download the zip package from the code page(from [GitHub](https://github.com/TriM-Organization/Musicreater.git) or [Gitee](https://gitee.com/TriM-Organization/Musicreater.git)). Or you are a Chinese fan having a QQ account, you can [Join the QQ Group 861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr) and get it from our GroupFiles.
|
||||
@@ -59,9 +83,9 @@
|
||||
But it should be noticed that you're clear instructed to choose the branch "pkgver" first instead of downloading it directly from the "master" branch, the master branch is now under developing and has no practical use.
|
||||
|
||||
|
||||
2. Start Using Demo(s)
|
||||
2. Start Using
|
||||
|
||||
You can directly double click `magicDemo.py` to run the demo, or follow instructions below using Terminal APP to run it.
|
||||
You can directly double click `llc_xxx(_xxx).py` to run the demo, or follow instructions below using Terminal APP to run it.
|
||||
|
||||
Open your terminal in the directory of this, taking CMD, for example, just enter the directory and enter `cmd` in the path box:
|
||||
|
||||
@@ -71,11 +95,11 @@
|
||||
And enter the commands below:
|
||||
|
||||
```bash
|
||||
python ./magicDemo.py
|
||||
python ./llc_win_wxPython.py
|
||||
```
|
||||
|
||||
|
||||
## Addition for Error(s) Using or Installing
|
||||
### Addition for Error(s) Using or Installing
|
||||
|
||||
1. Environment Error of Microsoft Visual C++ Redistributable
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
- 速度倍率:正小数,其值不可为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 ""
|
||||
302
llc_clgui.py
302
llc_clgui.py
@@ -1,302 +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
|
||||
|
||||
import Musicreater
|
||||
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
||||
from Musicreater.plugin import ConvertConfig
|
||||
from Musicreater.plugin.addonpack import (
|
||||
to_addon_pack_in_delay,
|
||||
to_addon_pack_in_repeater,
|
||||
to_addon_pack_in_score,
|
||||
)
|
||||
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
|
||||
|
||||
|
||||
MainConsole.print(
|
||||
"[#121110 on #F0F2F4] ",
|
||||
style="#121110 on #F0F2F4",
|
||||
justify="center",
|
||||
)
|
||||
|
||||
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.rule(title="[bold #AB70FF]欢迎使用伶伦独立转换器", characters="=", style="#26E2FF")
|
||||
# MainConsole.rule(title="[bold #AB70FF]Welcome to Linglun Converter", characters="-")
|
||||
MainConsole.rule(
|
||||
title="[#AB70FF]版本{} | 音·创内核版本{}".format(__version__, Musicreater.__version__),
|
||||
characters="-",
|
||||
style="#26E2FF",
|
||||
)
|
||||
|
||||
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 format_ipt(
|
||||
notice: str,
|
||||
fun,
|
||||
err_note: str = "输入内容有误,请重新输入。",
|
||||
*extraArg,
|
||||
):
|
||||
"""循环输入,以某种格式
|
||||
notice: 输入时的提示
|
||||
fun: 格式函数
|
||||
err_note: 输入不符格式时的提示
|
||||
*extraArg: 对于函数的其他参数"""
|
||||
while True:
|
||||
result = ipt(notice)
|
||||
try:
|
||||
fun_result = fun(result, *extraArg)
|
||||
break
|
||||
except ValueError:
|
||||
prt(err_note)
|
||||
continue
|
||||
return result, fun_result
|
||||
|
||||
|
||||
# 获取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
|
||||
|
||||
# 获取输出地址
|
||||
while True:
|
||||
out_path = ipt(f"文件生成输出地址:")
|
||||
try:
|
||||
if not os.path.exists(out_path):
|
||||
prt("该地址不存在,或无法访问该地址,请重新输入。")
|
||||
continue
|
||||
except PermissionError:
|
||||
prt("无法访问该地址,请检查是否给予程序相关文件的访问权限。")
|
||||
continue
|
||||
break
|
||||
|
||||
|
||||
# 选择输出格式
|
||||
|
||||
|
||||
def is_in_bdx_mcpack(sth: str):
|
||||
return isin(sth, {1: ("bdx", "1", "币帝查", "币帝·艾克斯"), 0: ("mcpack", "0", "唉姆西·派克")})
|
||||
|
||||
|
||||
def is_in_player(sth: str):
|
||||
return isin(
|
||||
sth,
|
||||
{
|
||||
0: ("delay", "0", "延迟", "帝蕾"),
|
||||
1: ("score", "1", "计分板", "积分", "积分板", "计分", "斯阔尔"),
|
||||
2: ("repeater", "2", "中继器", "瑞皮特"),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
output_file_format = format_ipt(
|
||||
"输出文件类型 (mcpack/0|bdx/1)",
|
||||
is_in_bdx_mcpack,
|
||||
"输入内容有误,请重新输入。",
|
||||
)[1]
|
||||
|
||||
if output_file_format == 0:
|
||||
player_format = format_ipt(
|
||||
"播放器类型 (延迟/0|计分板/1|中继器/2)",
|
||||
is_in_player,
|
||||
"输入内容有误,请重新输入。",
|
||||
)[1]
|
||||
else:
|
||||
player_format = format_ipt(
|
||||
"播放器类型 (延迟/0|计分板/1)",
|
||||
is_in_player,
|
||||
"输入内容有误,请重新输入。",
|
||||
)[1]
|
||||
|
||||
old_exe_enabled = not format_ipt(
|
||||
"启用新版代执行指令 (否/0|是/1):", bool_str, "输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n"
|
||||
)[1]
|
||||
|
||||
|
||||
if os.path.exists("./demo_config.json"):
|
||||
import json
|
||||
|
||||
prompts = json.load(open("./demo_config.json", "r", encoding="utf-8"))
|
||||
|
||||
prompts = prompts[:-1]
|
||||
else:
|
||||
prompts = []
|
||||
# 提示语 检测函数 错误提示语
|
||||
for args in [
|
||||
(
|
||||
"音量大小 (0,1]:",
|
||||
float_str,
|
||||
),
|
||||
(
|
||||
"速度倍率 (0,+∞):",
|
||||
float_str,
|
||||
),
|
||||
(
|
||||
"自动生成进度条 (否/0|是/1):",
|
||||
bool_str,
|
||||
),
|
||||
(
|
||||
"计分板名称:",
|
||||
str,
|
||||
)
|
||||
if player_format == 1
|
||||
else (
|
||||
"受播放玩家的选择器:",
|
||||
str,
|
||||
),
|
||||
(
|
||||
"自动重置计分板 (否/0|是/1):",
|
||||
bool_str,
|
||||
)
|
||||
if player_format == 1
|
||||
else (),
|
||||
(
|
||||
"BDX作者署名:",
|
||||
str,
|
||||
)
|
||||
if output_file_format == 1
|
||||
else (),
|
||||
(
|
||||
"结构生成最大高度 (0,+∞):",
|
||||
int,
|
||||
)
|
||||
if player_format == 0
|
||||
else (),
|
||||
]:
|
||||
if args:
|
||||
prompts.append(
|
||||
format_ipt(*args, err_note="输入内容格式错误,应符合 {}".format(args[1]))[1]
|
||||
)
|
||||
|
||||
if prompts[2]:
|
||||
costom_pgb_enabled = format_ipt(
|
||||
"自定义进度条样式 (否/0|是/1):", bool_str, "输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n"
|
||||
)[1]
|
||||
if costom_pgb_enabled:
|
||||
style = ipt("基本样式组 (回车默认):")
|
||||
if not style:
|
||||
style = DEFAULT_PROGRESSBAR_STYLE[0]
|
||||
yet_part = ipt("未播放样式 (回车默认):")
|
||||
if not yet_part:
|
||||
yet_part = DEFAULT_PROGRESSBAR_STYLE[1][1]
|
||||
done_part = ipt("已播放样式 (回车默认):")
|
||||
if not done_part:
|
||||
done_part = DEFAULT_PROGRESSBAR_STYLE[1][0]
|
||||
|
||||
if player_format == 1:
|
||||
cvt_method = to_addon_pack_in_score
|
||||
elif player_format == 0:
|
||||
cvt_method = to_addon_pack_in_delay
|
||||
elif player_format == 2:
|
||||
cvt_method = to_addon_pack_in_repeater
|
||||
|
||||
|
||||
for singleMidi in midis:
|
||||
prt("\n" f"正在处理 {singleMidi}")
|
||||
cvt_mid = Musicreater.MidiConvert.from_midi_file(
|
||||
singleMidi, old_exe_format=old_exe_enabled
|
||||
)
|
||||
cvt_cfg = ConvertConfig(out_path, *prompts[:2], progressbar=((style, (done_part, yet_part)) if costom_pgb_enabled else True) if prompts[2] else False) # type: ignore
|
||||
|
||||
conversion_result = (
|
||||
(cvt_method(cvt_mid, cvt_cfg, *prompts[3:])) # type: ignore
|
||||
if output_file_format == 0
|
||||
else (
|
||||
to_BDX_file_in_score(cvt_mid, cvt_cfg, *prompts[3:])
|
||||
if player_format == 1
|
||||
else to_BDX_file_in_delay(cvt_mid, cvt_cfg, *prompts[3:])
|
||||
)
|
||||
)
|
||||
|
||||
prt(
|
||||
f" 指令总长:{conversion_result[0]},播放刻数:{conversion_result[1]}{f''',结构大小:{conversion_result[2]},末点坐标:{conversion_result[3]}''' if output_file_format == 1 else ''}" # type: ignore
|
||||
)
|
||||
|
||||
exitSth = ipt("结束。换行以退出程序。")
|
||||
if exitSth == "record":
|
||||
import json
|
||||
|
||||
with open("./demo_config.json", "w", encoding="utf-8") as f:
|
||||
json.dump(prompts, f)
|
||||
elif exitSth == "delrec":
|
||||
os.remove("./demo_config.json")
|
||||
227
llc_cli.py
227
llc_cli.py
@@ -4,22 +4,23 @@
|
||||
|
||||
|
||||
"""
|
||||
伶伦转换器
|
||||
Linglun Converter
|
||||
伶伦转换器 命令行
|
||||
Linglun Converter CLI
|
||||
|
||||
版权所有 © 2023 金羿 & 睿穆开发组
|
||||
Copyright © 2023 EillesWan & TriM Org.
|
||||
版权所有 © 2024 金羿 & 睿乐开发组
|
||||
Copyright © 2024 EillesWan & TriM Org.
|
||||
|
||||
开源相关声明请见 ./License.md
|
||||
Terms & Conditions: ./Lisense.md
|
||||
"""
|
||||
|
||||
__version__ = "0.0.6"
|
||||
__version__ = "0.0.7"
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
|
||||
# import sys
|
||||
|
||||
import Musicreater
|
||||
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
||||
@@ -29,8 +30,14 @@ from Musicreater.plugin.addonpack import (
|
||||
to_addon_pack_in_repeater,
|
||||
to_addon_pack_in_score,
|
||||
)
|
||||
|
||||
from Musicreater.plugin.mcstructfile import (
|
||||
to_mcstructure_file_in_delay,
|
||||
to_mcstructure_file_in_repeater,
|
||||
# to_mcstructure_file_in_score,
|
||||
)
|
||||
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
|
||||
from utils.io import *
|
||||
from utils.io import MainConsole, int_str, prt, ipt, myWords, isin, bool_str, float_str
|
||||
|
||||
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
|
||||
|
||||
@@ -41,26 +48,30 @@ MainConsole.print(
|
||||
justify="center",
|
||||
)
|
||||
|
||||
osc.project_name = "伶伦转换器"
|
||||
osc.version = __version__
|
||||
# osc.project_name = "伶伦转换器"
|
||||
# osc.version = __version__
|
||||
|
||||
|
||||
if len(sys.argv) > 0:
|
||||
# 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
|
||||
# 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)
|
||||
# go_for_args(*sys.argv)
|
||||
|
||||
|
||||
# 显示大标题
|
||||
MainConsole.rule(title="[bold #AB70FF]欢迎使用伶伦独立转换器", characters="=", style="#26E2FF")
|
||||
MainConsole.rule(
|
||||
title="[bold #AB70FF]欢迎使用伶伦独立转换器", characters="=", style="#26E2FF"
|
||||
)
|
||||
# MainConsole.rule(title="[bold #AB70FF]Welcome to Linglun Converter", characters="-")
|
||||
MainConsole.rule(
|
||||
title="[#AB70FF]版本{} | 音·创内核版本{}".format(__version__, Musicreater.__version__),
|
||||
title="[#AB70FF]版本{} | 音·创内核版本{}".format(
|
||||
__version__, Musicreater.__version__
|
||||
),
|
||||
characters="-",
|
||||
style="#26E2FF",
|
||||
)
|
||||
@@ -70,14 +81,18 @@ nowYang = datetime.datetime.now()
|
||||
if nowYang.month == 8 and nowYang.day == 6:
|
||||
# 诸葛八卦生日
|
||||
MainConsole.print(
|
||||
"[#7DB5F0 on #121110]今天可不是催更的日子!\n诸葛亮与八卦阵{}岁生日快乐!".format(nowYang.year - 2008),
|
||||
"[#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),
|
||||
"[#0089F2 on #F0F2F4]今天就不要催更啦!\n金羿{}岁生日快乐!".format(
|
||||
nowYang.year - 2006
|
||||
),
|
||||
style="#0089F2 on #F0F2F4",
|
||||
justify="center",
|
||||
)
|
||||
@@ -155,20 +170,36 @@ while True:
|
||||
|
||||
|
||||
def is_in_bdx_mcpack(sth: str):
|
||||
return isin(sth, {1: ("bdx", "1", "币帝查", "币帝·艾克斯"), 0: ("mcpack", "0", "唉姆西·派克")})
|
||||
|
||||
|
||||
def is_in_player(sth: str):
|
||||
return isin(
|
||||
sth,
|
||||
{
|
||||
0: ("delay", "0", "延迟", "帝蕾"),
|
||||
1: ("score", "1", "计分板", "积分", "积分板", "计分", "斯阔尔"),
|
||||
2: ("repeater", "2", "中继器", "瑞皮特"),
|
||||
1: ("bdx", "1", "币帝查", "币帝·艾克斯", "一", "幺"),
|
||||
0: ("mcpack", "0", "唉姆西·派克", "零", "〇"),
|
||||
2: ("MCSTRUCTURE", "2", "二", "麦块结构", "MC结构", "两", "我的世界结构"),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def is_in_player(sth: str, in_ok: tuple):
|
||||
return isin(
|
||||
sth,
|
||||
dict(
|
||||
[
|
||||
(i, v)
|
||||
for i, v in [
|
||||
0,
|
||||
("delay", "0", "延迟", "帝蕾"),
|
||||
1,
|
||||
("score", "1", "计分板", "积分", "积分板", "计分", "斯阔尔"),
|
||||
2,
|
||||
("repeater", "2", "中继器", "瑞皮特"),
|
||||
]
|
||||
if i in in_ok
|
||||
]
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
output_file_format = format_ipt(
|
||||
"输出文件类型 (mcpack/0|bdx/1)",
|
||||
is_in_bdx_mcpack,
|
||||
@@ -181,15 +212,23 @@ if output_file_format == 0:
|
||||
is_in_player,
|
||||
"输入内容有误,请重新输入。",
|
||||
)[1]
|
||||
else:
|
||||
elif output_file_format == 1:
|
||||
player_format = format_ipt(
|
||||
"播放器类型 (延迟/0|计分板/1)",
|
||||
is_in_player,
|
||||
lambda a: is_in_player(a, (0, 1)),
|
||||
"输入内容有误,请重新输入。",
|
||||
)[1]
|
||||
else:
|
||||
player_format = format_ipt(
|
||||
"播放器类型 (延迟/0|中继器/2)",
|
||||
lambda a: is_in_player(a, (0, 2)),
|
||||
"输入内容有误,请重新输入。",
|
||||
)[1]
|
||||
|
||||
old_exe_enabled = not format_ipt(
|
||||
"启用新版代执行指令 (否/0|是/1):", bool_str, "输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n"
|
||||
"启用新版代执行指令 (否/0|是/1):",
|
||||
bool_str,
|
||||
"输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n",
|
||||
)[1]
|
||||
|
||||
|
||||
@@ -216,41 +255,75 @@ else:
|
||||
bool_str,
|
||||
),
|
||||
(
|
||||
"计分板名称:",
|
||||
str,
|
||||
)
|
||||
if player_format == 1
|
||||
else (
|
||||
"受播放玩家的选择器:",
|
||||
str,
|
||||
(
|
||||
"计分板名称:",
|
||||
str,
|
||||
)
|
||||
if player_format == 1
|
||||
else (
|
||||
"受播放玩家的选择器:",
|
||||
str,
|
||||
)
|
||||
),
|
||||
(
|
||||
"自动重置计分板 (否/0|是/1):",
|
||||
bool_str,
|
||||
)
|
||||
if player_format == 1
|
||||
else (),
|
||||
(
|
||||
"自动重置计分板 (否/0|是/1):",
|
||||
bool_str,
|
||||
)
|
||||
if player_format == 1
|
||||
else ()
|
||||
),
|
||||
(
|
||||
"BDX作者署名:",
|
||||
str,
|
||||
)
|
||||
if output_file_format == 1
|
||||
else (),
|
||||
(
|
||||
"BDX作者署名:",
|
||||
str,
|
||||
)
|
||||
if output_file_format == 1
|
||||
else (
|
||||
(
|
||||
"结构延展方向(x+|z+|x-|z-):",
|
||||
lambda a: isin(
|
||||
a,
|
||||
{
|
||||
"z+": ["z+", "Z+"],
|
||||
"x+": ["X+", "x+"],
|
||||
"z-": ["Z-", "z-"],
|
||||
"x-": ["x-", "X-"],
|
||||
},
|
||||
),
|
||||
)
|
||||
if (player_format == 2 and output_file_format == 2)
|
||||
else ()
|
||||
)
|
||||
),
|
||||
(
|
||||
"结构生成最大高度 (0,+∞):",
|
||||
int,
|
||||
)
|
||||
if player_format == 0
|
||||
else (),
|
||||
(
|
||||
"结构生成最大高度 (0,+∞):",
|
||||
int_str,
|
||||
)
|
||||
if player_format == 0
|
||||
else (
|
||||
(
|
||||
"基础空白方块(例:concrete):",
|
||||
str,
|
||||
)
|
||||
if (player_format == 2 and output_file_format == 2)
|
||||
else ()
|
||||
)
|
||||
),
|
||||
]:
|
||||
if args:
|
||||
prompts.append(
|
||||
format_ipt(*args, err_note="输入内容格式错误,应符合 {}".format(args[1]))[1]
|
||||
format_ipt(
|
||||
*args, err_note="输入内容格式错误,应符合 {}".format(args[1])
|
||||
)[1]
|
||||
)
|
||||
|
||||
if prompts[2]:
|
||||
costom_pgb_enabled = format_ipt(
|
||||
"自定义进度条样式 (否/0|是/1):", bool_str, "输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n"
|
||||
"自定义进度条样式 (否/0|是/1):",
|
||||
bool_str,
|
||||
"输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n",
|
||||
)[1]
|
||||
if costom_pgb_enabled:
|
||||
style = ipt("基本样式组 (回车默认):")
|
||||
@@ -263,12 +336,20 @@ if prompts[2]:
|
||||
if not done_part:
|
||||
done_part = DEFAULT_PROGRESSBAR_STYLE[1][0]
|
||||
|
||||
if player_format == 1:
|
||||
cvt_method = to_addon_pack_in_score
|
||||
elif player_format == 0:
|
||||
cvt_method = to_addon_pack_in_delay
|
||||
elif player_format == 2:
|
||||
cvt_method = to_addon_pack_in_repeater
|
||||
if output_file_format == 0:
|
||||
if player_format == 1:
|
||||
cvt_method = to_addon_pack_in_score
|
||||
elif player_format == 0:
|
||||
cvt_method = to_addon_pack_in_delay
|
||||
elif player_format == 2:
|
||||
cvt_method = to_addon_pack_in_repeater
|
||||
elif output_file_format == 2:
|
||||
# if player_format == 1:
|
||||
# cvt_method = to_mcstructure_file_in_score
|
||||
if player_format == 0:
|
||||
cvt_method = to_mcstructure_file_in_delay
|
||||
elif player_format == 2:
|
||||
cvt_method = to_mcstructure_file_in_repeater
|
||||
|
||||
|
||||
for singleMidi in midis:
|
||||
@@ -276,20 +357,34 @@ for singleMidi in midis:
|
||||
cvt_mid = Musicreater.MidiConvert.from_midi_file(
|
||||
singleMidi, old_exe_format=old_exe_enabled
|
||||
)
|
||||
cvt_cfg = ConvertConfig(out_path, *prompts[:2], progressbar=((style, (done_part, yet_part)) if costom_pgb_enabled else True) if prompts[2] else False) # type: ignore
|
||||
cvt_cfg = ConvertConfig(
|
||||
out_path,
|
||||
*prompts[:2],
|
||||
progressbar=(
|
||||
((style, (done_part, yet_part)) if costom_pgb_enabled else True) # type: ignore
|
||||
if prompts[2]
|
||||
else False
|
||||
),
|
||||
)
|
||||
|
||||
conversion_result = (
|
||||
(cvt_method(cvt_mid, cvt_cfg, *prompts[3:])) # type: ignore
|
||||
(cvt_method(cvt_mid, cvt_cfg, *prompts[3:])) # type: ignore
|
||||
if output_file_format == 0
|
||||
else (
|
||||
to_BDX_file_in_score(cvt_mid, cvt_cfg, *prompts[3:])
|
||||
if player_format == 1
|
||||
else to_BDX_file_in_delay(cvt_mid, cvt_cfg, *prompts[3:])
|
||||
(
|
||||
to_BDX_file_in_score(cvt_mid, cvt_cfg, *prompts[3:])
|
||||
if player_format == 1
|
||||
else to_BDX_file_in_delay(cvt_mid, cvt_cfg, *prompts[3:])
|
||||
)
|
||||
if output_file_format == 1
|
||||
else (cvt_method(cvt_mid, cvt_cfg, *prompts[3:])) # type: ignore
|
||||
)
|
||||
)
|
||||
|
||||
prt(
|
||||
f" 指令总长:{conversion_result[0]},播放刻数:{conversion_result[1]}{f''',结构大小:{conversion_result[2]},末点坐标:{conversion_result[3]}''' if output_file_format == 1 else ''}" # type: ignore
|
||||
f" 结构大小:{conversion_result[0]},播放刻数:{conversion_result[1]}"
|
||||
if output_file_format == 2
|
||||
else f" 指令总长:{conversion_result[0]},播放刻数:{conversion_result[1]}{f''',结构大小:{conversion_result[2]},末点坐标:{conversion_result[3]}''' if output_file_format == 1 else ''}" # type: ignore
|
||||
)
|
||||
|
||||
exitSth = ipt("结束。换行以退出程序。")
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
|
||||
|
||||
# 下面为正文
|
||||
@@ -7,8 +7,8 @@
|
||||
伶伦转换器暨模组特用奇巧
|
||||
Linglun Converter for Special Use with addons
|
||||
|
||||
版权所有 © 2023 金羿 & 睿穆开发组
|
||||
Copyright © 2023 EillesWan & TriM Org.
|
||||
版权所有 © 2024 金羿 & 睿乐开发组
|
||||
Copyright © 2024 EillesWan & TriM Org.
|
||||
|
||||
开源相关声明请见 ./License.md
|
||||
Terms & Conditions: ./Lisense.md
|
||||
|
||||
110
llc_win_tk.py
110
llc_win_tk.py
@@ -1,110 +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
|
||||
|
||||
|
||||
import Musicreater
|
||||
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 (
|
||||
to_addon_pack_in_delay,
|
||||
to_addon_pack_in_repeater,
|
||||
to_addon_pack_in_score,
|
||||
)
|
||||
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
||||
|
||||
|
||||
from utils.io import *
|
||||
|
||||
osc.project_name = "伶伦转换器"
|
||||
osc.version = __version__
|
||||
|
||||
|
||||
def __main__():
|
||||
MainConsole.print(
|
||||
"[#121110 on #F0F2F4] ",
|
||||
style="#121110 on #F0F2F4",
|
||||
justify="center",
|
||||
)
|
||||
|
||||
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.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("伶伦转换器简易版 正在启动……")
|
||||
|
||||
prt("更新执行位置...")
|
||||
if sys.platform == "win32":
|
||||
try:
|
||||
os.chdir(
|
||||
__file__[: len(__file__) - __file__[len(__file__) :: -1].index("\\")]
|
||||
)
|
||||
logger.info("Win32 更新执行位置,当前文件位置 {}".format(__file__))
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
os.chdir(
|
||||
__file__[: len(__file__) - __file__[len(__file__) :: -1].index("/")]
|
||||
)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
log("其他平台:{} 更新执行位置,当前文件位置 {}".format(sys.platform, __file__))
|
||||
prt("完成!")
|
||||
|
||||
prt("载入功能……")
|
||||
1768
llc_win_wxPython.py
1768
llc_win_wxPython.py
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,3 @@
|
||||
Musicreater>=1.0.0
|
||||
TrimLog>=0.7.2
|
||||
Musicreater>=1.7.2.1
|
||||
TrimLog>=0.8.3
|
||||
requests>=2.0.0
|
||||
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 |
137
utils/io.py
137
utils/io.py
@@ -1,32 +1,52 @@
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any, Callable, Dict, List, Literal, Optional, Set, TextIO, Tuple
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import TrimLog
|
||||
from TrimLog import Console, object_constants
|
||||
"""
|
||||
伶伦转换器 命令行组件
|
||||
Linglun Converter Command Line IO Component
|
||||
|
||||
is_logging: bool = True
|
||||
版权所有 © 2024 金羿 & 睿乐开发组
|
||||
Copyright © 2024 EillesWan & TriM Org.
|
||||
|
||||
MainConsole = Console()
|
||||
osc = object_constants.ObjectStateConstant()
|
||||
logger = TrimLog.Logger(
|
||||
is_logging=is_logging,
|
||||
printing=not osc.isRelease,
|
||||
in_suffix=".llc",
|
||||
开源相关声明请见 ./License.md
|
||||
Terms & Conditions: ./Lisense.md
|
||||
"""
|
||||
|
||||
|
||||
import requests
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Literal,
|
||||
Optional,
|
||||
Set,
|
||||
TextIO,
|
||||
Tuple,
|
||||
Iterable,
|
||||
Sequence,
|
||||
Union,
|
||||
)
|
||||
|
||||
import TrimLog
|
||||
from TrimLog import object_constants, logger, log__init__
|
||||
|
||||
|
||||
logger.is_logging = True
|
||||
logger.suffix = ".llc"
|
||||
logger.is_tips = True
|
||||
|
||||
logger.info("读取 言·论 信息……")
|
||||
|
||||
try:
|
||||
myWords = (
|
||||
urllib.request.urlopen(
|
||||
"https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt"
|
||||
)
|
||||
.read()
|
||||
.decode("utf-8")
|
||||
requests.get(
|
||||
"https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt",
|
||||
).text
|
||||
.strip("\n")
|
||||
.split("\n")
|
||||
)
|
||||
except (ConnectionError, urllib.error.HTTPError) as E:
|
||||
except (ConnectionError, requests.HTTPError, requests.RequestException) as E:
|
||||
logger.warning(f"读取言·论信息发生 互联网连接 错误:\n{E}")
|
||||
myWords = ["以梦想为驱使 创造属于自己的未来"]
|
||||
# noinspection PyBroadException
|
||||
@@ -35,6 +55,9 @@ except BaseException as E:
|
||||
myWords = ["灵光焕发 深艺献心"]
|
||||
|
||||
|
||||
|
||||
logger.info("注册出入方法……")
|
||||
|
||||
JustifyMethod = Literal["default", "left", "center", "right", "full"]
|
||||
OverflowMethod = Literal["fold", "crop", "ellipsis", "ignore"]
|
||||
|
||||
@@ -74,7 +97,7 @@ def prt(
|
||||
soft_wrap (bool, 可选): 启用软包装模式,禁止文字包装和裁剪,或`None``用于 控制台默认值。默认为`None`。
|
||||
new_line_start (bool, False): 如果输出包含多行,在开始时插入一个新行。默认值为`False`。
|
||||
"""
|
||||
MainConsole.print(
|
||||
logger.console.print(
|
||||
*objects,
|
||||
sep=sep,
|
||||
end=end,
|
||||
@@ -135,7 +158,7 @@ def ipt(
|
||||
Returns:
|
||||
str: 从stdin读取的字符串
|
||||
"""
|
||||
MainConsole.print(
|
||||
logger.console.print(
|
||||
*objects,
|
||||
sep=sep,
|
||||
end="",
|
||||
@@ -153,7 +176,7 @@ def ipt(
|
||||
new_line_start=new_line_start,
|
||||
)
|
||||
|
||||
return MainConsole.input(password=password, stream=stream)
|
||||
return logger.console.input(password=password, stream=stream)
|
||||
|
||||
|
||||
def format_ipt(
|
||||
@@ -189,61 +212,57 @@ def isin(sth: str, range_list: dict):
|
||||
for bool_value, res_list in range_list.items():
|
||||
if sth in res_list:
|
||||
return bool_value
|
||||
raise ValueError
|
||||
raise ValueError(
|
||||
"不在可选范围内:{}".format([j for i in range_list.values() for j in i])
|
||||
)
|
||||
|
||||
|
||||
# 真假字符串判断
|
||||
def bool_str(sth: str):
|
||||
try:
|
||||
return bool(float(sth))
|
||||
except:
|
||||
except ValueError:
|
||||
if str(sth).lower() in ("true", "真", "是", "y", "t"):
|
||||
return True
|
||||
elif str(sth).lower() in ("false", "假", "否", "f", "n"):
|
||||
return False
|
||||
else:
|
||||
raise ValueError
|
||||
raise ValueError("非法逻辑字串")
|
||||
|
||||
|
||||
def float_str(sth: str):
|
||||
try:
|
||||
return float(sth)
|
||||
except ValueError:
|
||||
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("点", ".")
|
||||
)
|
||||
except:
|
||||
raise ValueError
|
||||
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("点", ".")
|
||||
)
|
||||
|
||||
|
||||
def int_str(sth: str):
|
||||
try:
|
||||
return int(float_str(sth))
|
||||
except ValueError:
|
||||
raise ValueError
|
||||
return int(float_str(sth))
|
||||
|
||||
29
utils/localize.py
Normal file
29
utils/localize.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
伶伦转换器 本地化组件
|
||||
Linglun Converter Language Localization Component
|
||||
|
||||
版权所有 © 2024 金羿 & 睿乐开发组
|
||||
Copyright © 2024 EillesWan & TriM Org.
|
||||
|
||||
开源相关声明请见 ./License.md
|
||||
Terms & Conditions: ./Lisense.md
|
||||
"""
|
||||
|
||||
|
||||
|
||||
from .io import logger, Any
|
||||
|
||||
|
||||
|
||||
def _() -> str:
|
||||
return ""
|
||||
|
||||
def main():
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
120
utils/packdata.py
Normal file
120
utils/packdata.py
Normal file
@@ -0,0 +1,120 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
伶伦转换器 打包存档组件
|
||||
Linglun Converter Language Localization Component
|
||||
|
||||
版权所有 © 2024 金羿 & 睿乐开发组
|
||||
Copyright © 2024 EillesWan & TriM Org.
|
||||
|
||||
开源相关声明请见 ./License.md
|
||||
Terms & Conditions: ./Lisense.md
|
||||
"""
|
||||
|
||||
|
||||
import hashlib
|
||||
|
||||
import dill
|
||||
import brotli
|
||||
|
||||
from .salt import salt
|
||||
from .io import Any
|
||||
|
||||
|
||||
def unpack_llc_pack(from_dist: str, raise_error: bool = True):
|
||||
with open(from_dist, "rb") as f:
|
||||
salty_sha256_value, md5_value, packed_bytes = f.read().split(b" | \n", 2)
|
||||
|
||||
if (md5_value == hashlib.md5(packed_bytes).digest()) and (
|
||||
salty_sha256_value
|
||||
== hashlib.pbkdf2_hmac("sha256", md5_value + packed_bytes, salt, 16)
|
||||
):
|
||||
return dill.loads(
|
||||
brotli.decompress(packed_bytes),
|
||||
)
|
||||
else:
|
||||
if raise_error:
|
||||
raise ValueError("文件读取失败:签名不一致,可能存在注入风险。")
|
||||
else:
|
||||
return ValueError("文件读取失败:签名不一致,可能存在注入风险。")
|
||||
|
||||
|
||||
def enpack_llc_pack(sth: Any, to_dist: str):
|
||||
packing_bytes = brotli.compress(
|
||||
dill.dumps(
|
||||
sth,
|
||||
)
|
||||
)
|
||||
|
||||
md5_value = hashlib.md5(packing_bytes).digest() # 长度 16
|
||||
|
||||
salty_sha256_value = hashlib.pbkdf2_hmac(
|
||||
"sha256", md5_value + packing_bytes, salt, 16
|
||||
) # 长度 32
|
||||
|
||||
with open(
|
||||
to_dist,
|
||||
"wb",
|
||||
) as f:
|
||||
f.write(salty_sha256_value)
|
||||
f.write(b" | \n")
|
||||
f.write(md5_value)
|
||||
f.write(b" | \n")
|
||||
f.write(packing_bytes)
|
||||
|
||||
|
||||
def enpack_msct_pack(sth, to_dist: str):
|
||||
packing_bytes = brotli.compress(
|
||||
dill.dumps(
|
||||
sth,
|
||||
)
|
||||
)
|
||||
with open(
|
||||
to_dist,
|
||||
"wb",
|
||||
) as f:
|
||||
f.write(packing_bytes)
|
||||
|
||||
return hashlib.sha256(packing_bytes)
|
||||
|
||||
|
||||
def unpack_msct_pack(from_dist: str, hash_value: str, raise_error: bool = True):
|
||||
with open(from_dist, "rb") as f:
|
||||
packed_data = f.read()
|
||||
now_hash = hashlib.sha256(packed_data).hexdigest()
|
||||
if now_hash == hash_value:
|
||||
return dill.loads(brotli.decompress(packed_data))
|
||||
else:
|
||||
if raise_error:
|
||||
raise ValueError(
|
||||
"文件读取失败:\n传入:{}\n需求:{}\n签名不一致,可能存在注入风险。".format(
|
||||
now_hash, hash_value
|
||||
)
|
||||
)
|
||||
else:
|
||||
return ValueError(
|
||||
"文件读取失败:\n传入:{}\n需求:{}\n签名不一致,可能存在注入风险。".format(
|
||||
now_hash, hash_value
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def load_msct_packed_data(
|
||||
packed_data: bytes, hash_value: str, raise_error: bool = True
|
||||
):
|
||||
now_hash = hashlib.sha256(packed_data).hexdigest()
|
||||
if now_hash == hash_value:
|
||||
return dill.loads(brotli.decompress(packed_data))
|
||||
else:
|
||||
if raise_error:
|
||||
raise ValueError(
|
||||
"文件读取失败:\n传入:{}\n需求:{}\n签名不一致,可能存在注入风险。".format(
|
||||
now_hash, hash_value
|
||||
)
|
||||
)
|
||||
else:
|
||||
return ValueError(
|
||||
"文件读取失败:\n传入:{}\n需求:{}\n签名不一致,可能存在注入风险。".format(
|
||||
now_hash, hash_value
|
||||
)
|
||||
)
|
||||
158
utils/update_check.py
Normal file
158
utils/update_check.py
Normal file
@@ -0,0 +1,158 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
伶伦转换器 版本检查组件
|
||||
Linglun Converter Version Checking Component
|
||||
|
||||
版权所有 © 2024 金羿 & 睿乐开发组
|
||||
Copyright © 2024 EillesWan & TriM Org.
|
||||
|
||||
开源相关声明请见 ./License.md
|
||||
Terms & Conditions: ./Lisense.md
|
||||
"""
|
||||
|
||||
from .io import TrimLog, requests, Sequence, Iterable, Callable, Optional, Dict, Union
|
||||
|
||||
|
||||
def is_ver_char(text: str) -> bool:
|
||||
return text.isnumeric() or text == "."
|
||||
|
||||
|
||||
def cut_ver_str(text: str) -> str:
|
||||
text += " "
|
||||
len_of_text = len(text) - 1
|
||||
i = 0
|
||||
while i <= len_of_text:
|
||||
if is_ver_char(text[i]) and (text[i + 1] if i < len_of_text else False):
|
||||
j = i
|
||||
while is_ver_char(text[j]) and j < len_of_text:
|
||||
j += 1
|
||||
temp_str = text[i:j].strip()
|
||||
if ("." in temp_str) and (temp_str[0] != ".") and (temp_str[-1] != "."):
|
||||
return temp_str
|
||||
i = j
|
||||
i += 1
|
||||
return ""
|
||||
|
||||
|
||||
def get_ver_str(text: str) -> Iterable[str]:
|
||||
text += " "
|
||||
all_ver_str = []
|
||||
len_of_text = len(text) - 1
|
||||
i = 0
|
||||
while i <= len_of_text:
|
||||
if is_ver_char(text[i]) and (text[i + 1] if i < len_of_text else False):
|
||||
j = i
|
||||
while is_ver_char(text[j]) and j < len_of_text:
|
||||
j += 1
|
||||
temp_str = text[i:j].strip()
|
||||
if ("." in temp_str) and (temp_str[0] != ".") and (temp_str[-1] != "."):
|
||||
all_ver_str.append(temp_str)
|
||||
i = j
|
||||
i += 1
|
||||
return all_ver_str
|
||||
|
||||
|
||||
def is_ver_bigger(ver_1: Sequence[int], ver_2: Sequence[int]) -> bool:
|
||||
len_v1 = len(ver_1)
|
||||
len_v2 = len(ver_2)
|
||||
for i in range(min(len_v1, len_v2)):
|
||||
if ver_1[i] == ver_2[i]:
|
||||
continue
|
||||
else:
|
||||
return ver_1[i] > ver_2[i]
|
||||
return len_v1 > len_v2
|
||||
|
||||
|
||||
def check_update_repo(
|
||||
appname: str,
|
||||
get_text_url: str,
|
||||
version_now: str,
|
||||
message_show_fun: Callable,
|
||||
logger: TrimLog.Logger,
|
||||
version_disp: Optional[str] = None,
|
||||
version_renew_tip: str = "!有新版本!\n最新的 {app} 已经是 {latest} 版本,当前您正在使用的仍是 {current} 版本,您可以前往下载地址更新。",
|
||||
):
|
||||
if not version_disp:
|
||||
version_disp = version_now
|
||||
|
||||
logger.info("当前 {} 版本:{}".format(appname,version_now))
|
||||
try:
|
||||
code_content: str = requests.get(get_text_url).text
|
||||
except Exception as E: # noinspection PyBroadException
|
||||
logger.warning("无法获取更新版本信息:{}".format(E))
|
||||
return
|
||||
|
||||
code_content = code_content[code_content.find("__version__") :]
|
||||
code_content = code_content[code_content.find('"') + 1 :]
|
||||
version_content = code_content[: code_content.find('"')]
|
||||
|
||||
logger.info("已获取 {} 新版本信息:{}".format(appname,version_content))
|
||||
|
||||
if is_ver_bigger(
|
||||
[int(v) for v in cut_ver_str(version_content).split(".")],
|
||||
[int(v) for v in cut_ver_str(version_now).split(".")],
|
||||
):
|
||||
if "__zhver__" in code_content:
|
||||
code_content = code_content[code_content.find("__zhver__") :]
|
||||
code_content = code_content[code_content.find('"') + 1 :]
|
||||
version_content = code_content[: code_content.find('"')]
|
||||
|
||||
message_show_fun(
|
||||
version_renew_tip.format(
|
||||
app=appname, latest=version_content, current=version_disp
|
||||
)
|
||||
)
|
||||
|
||||
# code_content = code_content[code_content.find('"')+1:]
|
||||
|
||||
# version_content = code_content[:code_content.find('"')]
|
||||
|
||||
# version_content_len = len(version_content)
|
||||
|
||||
# for i in range(version_content_len):
|
||||
# if is_ver_char(version_content[i]) and (version_content[i+1] if i < version_content.__len__() else False):
|
||||
# j = i
|
||||
# while is_ver_char(version_content[j]):j+=1
|
||||
# return version_content[i:j]
|
||||
|
||||
# "".join([version_content[i] for i in range(version_content.__len__()) if is_ver_char(version_content[i]) and ((version_content[i-1] if i > 0 else False) or (version_content[i+1] if i < version_content.__len__() else False))]).split('.')
|
||||
|
||||
|
||||
def check_update_release(
|
||||
appname: str,
|
||||
get_release_url: str,
|
||||
version_now: str,
|
||||
notice_fun: Callable[[str, str], bool],
|
||||
logger: TrimLog.Logger,
|
||||
version_renew_tip: str = "!有新版本!\n最新的 {app} 已经是 {latest} 版本,当前您正在使用的仍是 {current} 版本,是否更新?",
|
||||
) -> Union[None, Dict[str, str]]:
|
||||
|
||||
logger.info("当前 {} 版本:{}".format(appname,version_now))
|
||||
try:
|
||||
code_content: Dict = requests.get(get_release_url).json()
|
||||
except Exception as E: # noinspection PyBroadException
|
||||
logger.warning("无法获取更新版本信息:{}".format(E))
|
||||
return
|
||||
|
||||
version_content = code_content["release"]["tag"]["name"]
|
||||
|
||||
logger.info("已获取 {} 新版本信息:{}".format(appname,version_content))
|
||||
|
||||
if is_ver_bigger(
|
||||
[int(v) for v in cut_ver_str(version_content).split(".")],
|
||||
[int(v) for v in cut_ver_str(version_now).split(".")],
|
||||
):
|
||||
|
||||
if notice_fun(
|
||||
version_renew_tip.format(
|
||||
app=appname, latest=version_content, current=version_now
|
||||
),
|
||||
code_content["release"]["release"]["description"],
|
||||
):
|
||||
return dict(
|
||||
[
|
||||
(d["name"], d["download_url"])
|
||||
for d in code_content["release"]["release"]["attach_files"]
|
||||
]
|
||||
)
|
||||
147
utils/webview.py
Normal file
147
utils/webview.py
Normal file
@@ -0,0 +1,147 @@
|
||||
import wx
|
||||
import wx.html
|
||||
|
||||
|
||||
class HTMLFrame(wx.Frame):
|
||||
"""桌面程序主窗口类"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent,
|
||||
tip_text,
|
||||
web_text,
|
||||
window_title: str = "新版本已发布",
|
||||
bg_colour: tuple = (0, 0, 0),
|
||||
window_size: tuple = (800, 480),
|
||||
):
|
||||
"""构造函数"""
|
||||
|
||||
wx.Frame.__init__(
|
||||
self,
|
||||
parent,
|
||||
id=wx.ID_ANY,
|
||||
title=window_title,
|
||||
pos=wx.DefaultPosition,
|
||||
size=window_size,
|
||||
style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL,
|
||||
)
|
||||
|
||||
# self.SetIcon(wx.Icon('', wx.BITMAP_TYPE_ICO))
|
||||
self.SetBackgroundColour(bg_colour)
|
||||
self.Center()
|
||||
|
||||
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
|
||||
|
||||
bSizer1 = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.m_staticText1 = wx.StaticText(
|
||||
self,
|
||||
wx.ID_ANY,
|
||||
tip_text,
|
||||
wx.DefaultPosition,
|
||||
wx.DefaultSize,
|
||||
wx.ALIGN_CENTER_HORIZONTAL,
|
||||
)
|
||||
self.m_staticText1.Wrap(-1)
|
||||
|
||||
self.m_staticText1.SetFont(
|
||||
wx.Font(
|
||||
wx.NORMAL_FONT.GetPointSize() * 2,
|
||||
wx.FONTFAMILY_DEFAULT,
|
||||
wx.FONTSTYLE_NORMAL,
|
||||
wx.FONTWEIGHT_NORMAL,
|
||||
False,
|
||||
"OPPOSans M",
|
||||
)
|
||||
)
|
||||
|
||||
bSizer1.Add(self.m_staticText1, 3, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5)
|
||||
|
||||
self.m_htmlWin1 = wx.html.HtmlWindow(
|
||||
self,
|
||||
wx.ID_ANY,
|
||||
wx.DefaultPosition,
|
||||
wx.DefaultSize,
|
||||
wx.html.HW_SCROLLBAR_AUTO,
|
||||
)
|
||||
self.m_htmlWin1.SetFont(
|
||||
wx.Font(
|
||||
wx.NORMAL_FONT.GetPointSize(),
|
||||
wx.FONTFAMILY_DEFAULT,
|
||||
wx.FONTSTYLE_NORMAL,
|
||||
wx.FONTWEIGHT_NORMAL,
|
||||
False,
|
||||
"OPPOSans R",
|
||||
)
|
||||
)
|
||||
self.m_htmlWin1.SetStandardFonts(normal_face="OPPOSans R")
|
||||
|
||||
bSizer1.Add(self.m_htmlWin1, 5, wx.EXPAND | wx.RESERVE_SPACE_EVEN_IF_HIDDEN, 5)
|
||||
|
||||
bSizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.m_button1 = wx.Button(
|
||||
self, wx.ID_ANY, "取消", wx.DefaultPosition, wx.DefaultSize, 0
|
||||
)
|
||||
bSizer2.Add(self.m_button1, 0, wx.ALL, 5)
|
||||
|
||||
self.m_button2 = wx.Button(
|
||||
self, wx.ID_ANY, "更新", wx.DefaultPosition, wx.DefaultSize, 0
|
||||
)
|
||||
bSizer2.Add(self.m_button2, 0, wx.ALL, 5)
|
||||
|
||||
bSizer1.Add(bSizer2, 0, wx.ALIGN_RIGHT, 5)
|
||||
|
||||
self.SetSizer(bSizer1)
|
||||
self.Layout()
|
||||
|
||||
self.Centre(wx.BOTH)
|
||||
|
||||
self.m_htmlWin1.SetPage(web_text)
|
||||
|
||||
# Connect Events
|
||||
self.m_button1.Bind(wx.EVT_BUTTON, self.on_Cancel_Click)
|
||||
self.m_button2.Bind(wx.EVT_BUTTON, self.on_Update_Click)
|
||||
|
||||
self.ok = False
|
||||
|
||||
def __del__(self):
|
||||
# return self.ok
|
||||
pass
|
||||
|
||||
def getok(self) -> bool:
|
||||
return self.ok
|
||||
|
||||
# Virtual event handlers, override them in your derived class
|
||||
def on_Cancel_Click(self, event):
|
||||
self.ok = False
|
||||
self.Destroy()
|
||||
|
||||
def on_Update_Click(self, event):
|
||||
self.ok = True
|
||||
self.Destroy()
|
||||
|
||||
|
||||
def go_update_tip(tip_text: str, html_context: str) -> bool:
|
||||
app = wx.App()
|
||||
frame = HTMLFrame(
|
||||
None,
|
||||
tip_text,
|
||||
html_context,
|
||||
bg_colour=wx.SystemSettings.GetColour(wx.SYS_COLOUR_MENU),
|
||||
)
|
||||
frame.Show()
|
||||
app.MainLoop()
|
||||
return frame.getok()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
go_update_tip(
|
||||
"!有新版本!\n最新的 {app} 已经是 {latest} 版本,当前您正在使用的仍是 {current} 版本,是否更新?",
|
||||
'<ol>\n<li>\n<strong>[修复]</strong> 完成<ahref="https://gitee.com/TriM-Organization/Linglun-Converter/issues/I8YN22" rel="nofollow noreferrer noopener"target="_blank">#I8YN22</a>问题的修复,解决转换错误的问题</li>\n<li>\n<strong>[新增]</strong>支持选择自定的乐器对照表</li>\n<li>\n<strong>[新增]</strong>支持自选距离音量算法</li>\n<li>\n<strong>[新增]</strong>使用Packer以打包发行版(详情如下方说明)</li>\n<li>\n<strong>[优化]</strong>提高调用效率,优化代码结构</li>\n<li>\n<strong>[优化]</strong>提升部分注释可读性</li>\n</ol>\n',
|
||||
)
|
||||
|
||||
go_update_tip(
|
||||
"!有新版本!\n最新的 音·创 已经是 1.7.3 版本,当前您正在使用的仍是 1.7.0 版本,是否更新?",
|
||||
'<ol>\n<li>\n<strong>[修复]</strong> 完成<a href="https://gitee.com/TriM-Organization/Linglun-Converter/issues/I8YN22" rel="nofollow noreferrer noopener" target="_blank">#I8YN22</a>问题的修复,解决转换错误的问题</li>\n<li>\n<strong>[新增]</strong> 支持选择自定的乐器对照表</li>\n<li>\n<strong>[新增]</strong> 支持自选距离音量算法</li>\n<li>\n<strong>[新增]</strong> 使用Packer以打包发行版(详情如下方说明)</li>\n<li>\n<strong>[优化]</strong> 提高调用效率,优 化代码结构</li>\n<li>\n<strong>[优化]</strong> 提升部分注释可读性</li>\n</ol>\n<h2>打包文件结构</h2>\n<p>我们使用Python库 <code>dill</code> 和 <code>Brotli</code> 对整个库的包体进行打包,方式如下:</p>\n<div class="markdown-code-block">\n<pre lang="python" class="python"><code>packing_bytes = brotli.compress(dill.dumps(sth,))\n</code></pre>\n<div class="markdown-code-block-copy-btn"></div>\n</div>\n<p>每个包中的内容为:</p>\n<div class="markdown-code-block">\n<pre lang="python" class="python"><code>MSCT_MAIN = (\n Musicreater,\n Musicreater.experiment,\n Musicreater.previous,\n)\n\nMSCT_PLUGIN = (Musicreater.plugin,)\n\nMSCT_PLUGIN_FUNCTION = (\n to_addon_pack_in_delay,\n to_addon_pack_in_repeater,\n to_addon_pack_in_score,\n to_mcstructure_file_in_delay,\n to_mcstructure_file_in_repeater,\n to_mcstructure_file_in_score,\n to_BDX_file_in_delay,\n to_BDX_file_in_score,\n)\n</code></pre>\n<div class="markdown-code-block-copy-btn"></div>\n</div>',
|
||||
)
|
||||
@@ -47,7 +47,7 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">LingLunMainFrame</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">659,778</property>
|
||||
<property name="size">660,780</property>
|
||||
<property name="style">wxDEFAULT_FRAME_STYLE</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="title"></property>
|
||||
@@ -126,11 +126,11 @@
|
||||
<property name="name">m_mainBoxSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxALL|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="0">
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">言·论</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
@@ -214,7 +214,7 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -244,7 +244,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">选择MIDI文件</property>
|
||||
<property name="label">选择MIDI文件
(双击移除)</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
@@ -283,11 +283,11 @@
|
||||
<property name="name">ss_MidiChooserSizer_bSizer9</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">0</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxFilePickerCtrl" expanded="0">
|
||||
<object class="wxListBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@@ -301,6 +301,7 @@
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices"></property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
@@ -318,22 +319,21 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="message">选择MIDI文件</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_ChooseMIDI_filePicker1</property>
|
||||
<property name="name">m_midiFilesList_listBox2</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Fixed</property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL</property>
|
||||
<property name="style">wxLB_HSCROLL|wxLB_SORT</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
@@ -341,16 +341,89 @@
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value">./</property>
|
||||
<property name="wildcard">MIDI 序列 (*.mid;*.midi)|*.mid;*.midi</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnFileChanged">onFileChosen</event>
|
||||
<event name="OnListBox">onFileListUpdated</event>
|
||||
<event name="OnListBoxDClick">onFileDoubleClicked</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">打开…</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_midiBroseButton_button21</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">openFile</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@@ -1048,7 +1121,7 @@
|
||||
<property name="resize">Fixed</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_LEFT|wxTE_NO_VSCROLL|wxTE_RICH</property>
|
||||
<property name="style">wxTE_LEFT|wxTE_NO_VSCROLL</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
@@ -2083,7 +2156,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">转换,启动!</property>
|
||||
<property name="label">开始转换</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
@@ -2093,7 +2166,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_button2</property>
|
||||
<property name="name">m_start_button2</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
3131
wxFB_Project/LingLunConverter1.fbp
Normal file
3131
wxFB_Project/LingLunConverter1.fbp
Normal file
File diff suppressed because it is too large
Load Diff
3567
wxFB_Project/LingLunConverter1_1.fbp
Normal file
3567
wxFB_Project/LingLunConverter1_1.fbp
Normal file
File diff suppressed because it is too large
Load Diff
478
wxFB_Project/generated1.py
Normal file
478
wxFB_Project/generated1.py
Normal file
@@ -0,0 +1,478 @@
|
||||
# -*- 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
|
||||
import wx.propgrid as pg
|
||||
|
||||
###########################################################################
|
||||
## 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( 660,723 ), 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_statusBar2.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_menubar1 = wx.MenuBar( 0 )
|
||||
self.m_menubar1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
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, 0, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN|wx.TOP, 2 )
|
||||
|
||||
self.mian_notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.mian_notebook.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.convert_page = wx.Panel( self.mian_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
main_page_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
s_midiChooseSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||
|
||||
self.m_ChooseMidiTips_staticText3 = wx.StaticText( self.convert_page, wx.ID_ANY, u"选择MIDI文件\n(双击移除)", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_ChooseMidiTips_staticText3.Wrap( -1 )
|
||||
|
||||
s_midiChooseSizer.Add( self.m_ChooseMidiTips_staticText3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
ss_MidiChooserSizer_bSizer9 = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_midiFilesList_listBox2Choices = []
|
||||
self.m_midiFilesList_listBox2 = wx.ListBox( self.convert_page, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_midiFilesList_listBox2Choices, wx.LB_HSCROLL|wx.LB_SORT )
|
||||
ss_MidiChooserSizer_bSizer9.Add( self.m_midiFilesList_listBox2, 0, wx.EXPAND, 0 )
|
||||
|
||||
|
||||
s_midiChooseSizer.Add( ss_MidiChooserSizer_bSizer9, 1, wx.EXPAND, 5 )
|
||||
|
||||
self.m_midiBroseButton_button21 = wx.Button( self.convert_page, wx.ID_ANY, u"打开…", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
s_midiChooseSizer.Add( self.m_midiBroseButton_button21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_midiChooseSizer, 0, wx.EXPAND, 5 )
|
||||
|
||||
s_formatChooseSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||
|
||||
ss_outputFormatChooseSizer = wx.StaticBoxSizer( wx.StaticBox( self.convert_page, 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, 0 )
|
||||
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.convert_page, 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( 2 )
|
||||
ss_playerChooseSizer.Add( self.m_playerChoice_choice2, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
s_formatChooseSizer.Add( ss_playerChooseSizer, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_formatChooseSizer, 0, wx.EXPAND, 5 )
|
||||
|
||||
s_promptSizer = wx.StaticBoxSizer( wx.StaticBox( self.convert_page, 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, 0, wx.ALL|wx.EXPAND|wx.SHAPED|wx.ALIGN_CENTER_VERTICAL, 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.01, 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, 0, wx.ALL|wx.EXPAND|wx.SHAPED|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_regularPromoptsEnteringSizer1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 )
|
||||
|
||||
ss_commandCheckingSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"指令设置" ), wx.HORIZONTAL )
|
||||
|
||||
self.m_progressBarEnablingCheckBox1 = wx.CheckBox( ss_commandCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用进度条", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
ss_commandCheckingSizer.Add( self.m_progressBarEnablingCheckBox1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_oldExeFormatChecker_checkBox3 = wx.CheckBox( ss_commandCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用旧版执行指令格式", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
ss_commandCheckingSizer.Add( self.m_oldExeFormatChecker_checkBox3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_commandCheckingSizer, 0, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
ss_HideAndSeekSizer_bSizer15.Add( sss_ScoreboardPlayerPromptsSizer_bSizer7, 0, wx.SHAPED|wx.EXPAND, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 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_enteringStructureMaxHeight_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_enteringStructureMaxHeight_spinCtrl1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
ss_HideAndSeekSizer_bSizer15.Add( sss_StructurePlayerPromptsSizer_bSizer8, 0, wx.SHAPED|wx.EXPAND, 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|wx.ALIGN_CENTER_VERTICAL, 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, 0, wx.SHAPED|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_HideAndSeekSizer_bSizer15, 0, wx.EXPAND, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_promptSizer, 0, wx.SHAPED|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
s_StartSizer_sbSizer18 = wx.StaticBoxSizer( wx.StaticBox( self.convert_page, 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_start_button2 = wx.Button( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"开始转换", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
s_StartSizer_sbSizer18.Add( self.m_start_button2, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_StartSizer_sbSizer18, 1, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN, 5 )
|
||||
|
||||
|
||||
self.convert_page.SetSizer( main_page_sizer )
|
||||
self.convert_page.Layout()
|
||||
main_page_sizer.Fit( self.convert_page )
|
||||
self.mian_notebook.AddPage( self.convert_page, u"开始转换", False )
|
||||
self.setting_page = wx.Panel( self.mian_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
setting_page_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
self.setting_notebook = wx.Notebook( self.setting_page, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.NB_FIXEDWIDTH|wx.NB_MULTILINE|wx.NB_RIGHT )
|
||||
self.setting_notebook.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "@OPPOSans R" ) )
|
||||
self.setting_notebook.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )
|
||||
|
||||
self.setting_page1 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.setting_page1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page1_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
sss_customProgressBarSizer_wSizer6 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )
|
||||
|
||||
setting_page1_progressbar_style = wx.StaticBoxSizer( wx.StaticBox( self.setting_page1, wx.ID_ANY, u"进度条" ), wx.HORIZONTAL )
|
||||
|
||||
ssss_basicProgressStylePattle_sbSizer9 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.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 )
|
||||
ssss_basicProgressStylePattle_sbSizer9.Add( self.m_BasicProgressBarStyleEntering_textCtrl4, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_basicProgressStylePattle_sbSizer9, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
ssss_UnplayedPartProgressbarPattle_sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.GetStaticBox(), wx.ID_ANY, u"未播放之样式" ), wx.VERTICAL )
|
||||
|
||||
self.m_unplayedProgressbarStyleEntering_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_unplayedProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_UnplayedPartProgressbarPattle_sbSizer10, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
ssss_PlayedPartProgressbarPattle_sbSizer11 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.GetStaticBox(), wx.ID_ANY, u"已播放之样式" ), wx.VERTICAL )
|
||||
|
||||
self.m_playedProgressbarStyleEntering_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_playedProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_PlayedPartProgressbarPattle_sbSizer11, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
sss_customProgressBarSizer_wSizer6.Add( setting_page1_progressbar_style, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
setting_page1_experiment_style = wx.StaticBoxSizer( wx.StaticBox( self.setting_page1, wx.ID_ANY, u"实验性功能" ), wx.HORIZONTAL )
|
||||
|
||||
self.m_enable_experiment_checkBox = wx.CheckBox( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, u"启用实验性功能", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
setting_page1_experiment_style.Add( self.m_enable_experiment_checkBox, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
experiment_type_choiceChoices = [ u"常规转换", u"长音插值", u"同刻偏移" ]
|
||||
self.experiment_type_choice = wx.Choice( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, experiment_type_choiceChoices, 0 )
|
||||
self.experiment_type_choice.SetSelection( 0 )
|
||||
setting_page1_experiment_style.Add( self.experiment_type_choice, 2, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_ignore_midi_error_checkBox = wx.CheckBox( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, u"忽略MIDI错误", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_ignore_midi_error_checkBox.SetValue(True)
|
||||
setting_page1_experiment_style.Add( self.m_ignore_midi_error_checkBox, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
|
||||
|
||||
|
||||
sss_customProgressBarSizer_wSizer6.Add( setting_page1_experiment_style, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
setting_page1_box_sizer.Add( sss_customProgressBarSizer_wSizer6, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
self.setting_page1.SetSizer( setting_page1_box_sizer )
|
||||
self.setting_page1.Layout()
|
||||
setting_page1_box_sizer.Fit( self.setting_page1 )
|
||||
self.setting_notebook.AddPage( self.setting_page1, u"基本信息", True )
|
||||
self.setting_page2 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.setting_page2.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, wx.EmptyString ) )
|
||||
|
||||
setting_page2_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_pitched_instrument_table_choiceChoices = [ u"“偷吃”的对照表", u"“经典”对照表" ]
|
||||
self.m_pitched_instrument_table_choice = wx.Choice( self.setting_page2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_pitched_instrument_table_choiceChoices, 0 )
|
||||
self.m_pitched_instrument_table_choice.SetSelection( 0 )
|
||||
self.m_pitched_instrument_table_choice.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page2_box_sizer.Add( self.m_pitched_instrument_table_choice, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 )
|
||||
|
||||
self.m_pitched_notes_table_propertyGrid1 = pg.PropertyGrid(self.setting_page2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.propgrid.PG_BOLD_MODIFIED|wx.propgrid.PG_DEFAULT_STYLE)
|
||||
self.m_pitched_notes_table_propertyGrid1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_propertyGridItem1 = self.m_pitched_notes_table_propertyGrid1.Append( pg.StringProperty( u"乐音乐器1", u"乐音乐器1" ) )
|
||||
self.m_propertyGridItem2 = self.m_pitched_notes_table_propertyGrid1.Append( pg.StringProperty( u"乐音乐器2", u"乐音乐器2" ) )
|
||||
setting_page2_box_sizer.Add( self.m_pitched_notes_table_propertyGrid1, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
|
||||
self.setting_page2.SetSizer( setting_page2_box_sizer )
|
||||
self.setting_page2.Layout()
|
||||
setting_page2_box_sizer.Fit( self.setting_page2 )
|
||||
self.setting_notebook.AddPage( self.setting_page2, u"乐音乐器对照表", False )
|
||||
self.setting_page3 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
setting_page3_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_percussion_instrument_table_choice1Choices = [ u"“偷吃”的对照表", u"“经典”对照表" ]
|
||||
self.m_percussion_instrument_table_choice1 = wx.Choice( self.setting_page3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_percussion_instrument_table_choice1Choices, 0 )
|
||||
self.m_percussion_instrument_table_choice1.SetSelection( 0 )
|
||||
self.m_percussion_instrument_table_choice1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page3_box_sizer.Add( self.m_percussion_instrument_table_choice1, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
self.m_percussion_notes_table_propertyGrid11 = pg.PropertyGrid(self.setting_page3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.propgrid.PG_BOLD_MODIFIED|wx.propgrid.PG_DEFAULT_STYLE)
|
||||
self.m_percussion_notes_table_propertyGrid11.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_propertyGridItem11 = self.m_percussion_notes_table_propertyGrid11.Append( pg.StringProperty( u"打击乐器1", u"打击乐器1" ) )
|
||||
self.m_propertyGridItem21 = self.m_percussion_notes_table_propertyGrid11.Append( pg.StringProperty( u"打击乐器2", u"打击乐器2" ) )
|
||||
setting_page3_box_sizer.Add( self.m_percussion_notes_table_propertyGrid11, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
|
||||
self.setting_page3.SetSizer( setting_page3_box_sizer )
|
||||
self.setting_page3.Layout()
|
||||
setting_page3_box_sizer.Fit( self.setting_page3 )
|
||||
self.setting_notebook.AddPage( self.setting_page3, u"打击乐器对照表", False )
|
||||
|
||||
setting_page_sizer.Add( self.setting_notebook, 1, wx.EXPAND |wx.ALL, 5 )
|
||||
|
||||
|
||||
self.setting_page.SetSizer( setting_page_sizer )
|
||||
self.setting_page.Layout()
|
||||
setting_page_sizer.Fit( self.setting_page )
|
||||
self.mian_notebook.AddPage( self.setting_page, u"数据设置", True )
|
||||
|
||||
m_mainBoxSizer.Add( self.mian_notebook, 1, wx.EXPAND |wx.ALL, 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_midiFilesList_listBox2.Bind( wx.EVT_LISTBOX, self.onFileListUpdated )
|
||||
self.m_midiFilesList_listBox2.Bind( wx.EVT_LISTBOX_DCLICK, self.onFileDoubleClicked )
|
||||
self.m_midiBroseButton_button21.Bind( wx.EVT_BUTTON, self.openFile )
|
||||
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_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_enteringStructureMaxHeight_spinCtrl1.Bind( wx.EVT_SPINCTRL, self.onStructureMaxHeightSpinChanged )
|
||||
self.m_EnteringBDXfileSignName_textCtrl12.Bind( wx.EVT_TEXT, self.onBDXfileSignNameUpdating )
|
||||
self.m_start_button2.Bind( wx.EVT_BUTTON, self.onStartButtonPressed )
|
||||
self.m_BasicProgressBarStyleEntering_textCtrl4.Bind( wx.EVT_TEXT, self.onProgressbarBasicStyleUpdating )
|
||||
self.m_unplayedProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarUnplayedStyleUpdating )
|
||||
self.m_playedProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarPlayedStyleUpdating )
|
||||
|
||||
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 onFileListUpdated( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onFileDoubleClicked( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def openFile( 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 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()
|
||||
|
||||
def onProgressbarBasicStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onProgressbarUnplayedStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onProgressbarPlayedStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
|
||||
514
wxFB_Project/generated1_1.py
Normal file
514
wxFB_Project/generated1_1.py
Normal file
@@ -0,0 +1,514 @@
|
||||
# -*- 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
|
||||
import wx.propgrid as pg
|
||||
|
||||
###########################################################################
|
||||
## 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( 660,723 ), 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_statusBar2.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_menubar1 = wx.MenuBar( 0 )
|
||||
self.m_menubar1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
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, 0, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN|wx.TOP, 2 )
|
||||
|
||||
self.mian_notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.mian_notebook.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.convert_page = wx.Panel( self.mian_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.mian_notebook.AddPage( self.convert_page, u"开始转换", False )
|
||||
self.setting_page = wx.Panel( self.mian_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.mian_notebook.AddPage( self.setting_page, u"数据设置", True )
|
||||
|
||||
m_mainBoxSizer.Add( self.mian_notebook, 1, wx.EXPAND |wx.ALL, 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 )
|
||||
|
||||
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()
|
||||
|
||||
|
||||
###########################################################################
|
||||
## Class convert_page_panel
|
||||
###########################################################################
|
||||
|
||||
class convert_page_panel ( wx.Panel ):
|
||||
|
||||
def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 565,540 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ):
|
||||
wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name )
|
||||
|
||||
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )
|
||||
|
||||
main_page_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
s_midiChooseSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||
|
||||
self.m_ChooseMidiTips_staticText3 = wx.StaticText( self, wx.ID_ANY, u"选择MIDI文件\n(双击移除)", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_ChooseMidiTips_staticText3.Wrap( -1 )
|
||||
|
||||
s_midiChooseSizer.Add( self.m_ChooseMidiTips_staticText3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
ss_MidiChooserSizer_bSizer9 = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_midiFilesList_listBox2Choices = []
|
||||
self.m_midiFilesList_listBox2 = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_midiFilesList_listBox2Choices, wx.LB_HSCROLL|wx.LB_SORT )
|
||||
ss_MidiChooserSizer_bSizer9.Add( self.m_midiFilesList_listBox2, 0, wx.EXPAND, 0 )
|
||||
|
||||
|
||||
s_midiChooseSizer.Add( ss_MidiChooserSizer_bSizer9, 1, wx.EXPAND, 5 )
|
||||
|
||||
self.m_midiBroseButton_button21 = wx.Button( self, wx.ID_ANY, u"打开…", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
s_midiChooseSizer.Add( self.m_midiBroseButton_button21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_midiChooseSizer, 0, 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, 0 )
|
||||
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( 2 )
|
||||
ss_playerChooseSizer.Add( self.m_playerChoice_choice2, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
s_formatChooseSizer.Add( ss_playerChooseSizer, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_formatChooseSizer, 0, 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, 0, wx.ALL|wx.EXPAND|wx.SHAPED|wx.ALIGN_CENTER_VERTICAL, 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.01, 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, 0, wx.ALL|wx.EXPAND|wx.SHAPED|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_regularPromoptsEnteringSizer1, 0, wx.EXPAND, 5 )
|
||||
|
||||
ss_commandCheckingSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"指令设置" ), wx.HORIZONTAL )
|
||||
|
||||
self.m_progressBarEnablingCheckBox1 = wx.CheckBox( ss_commandCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用进度条", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
ss_commandCheckingSizer.Add( self.m_progressBarEnablingCheckBox1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_oldExeFormatChecker_checkBox3 = wx.CheckBox( ss_commandCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用旧版执行指令格式", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
ss_commandCheckingSizer.Add( self.m_oldExeFormatChecker_checkBox3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_commandCheckingSizer, 0, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
ss_HideAndSeekSizer_bSizer15.Add( sss_ScoreboardPlayerPromptsSizer_bSizer7, 0, wx.SHAPED|wx.EXPAND, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 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_enteringStructureMaxHeight_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_enteringStructureMaxHeight_spinCtrl1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
ss_HideAndSeekSizer_bSizer15.Add( sss_StructurePlayerPromptsSizer_bSizer8, 0, wx.SHAPED|wx.EXPAND, 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|wx.ALIGN_CENTER_VERTICAL, 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, 0, wx.SHAPED|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_HideAndSeekSizer_bSizer15, 0, wx.EXPAND, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_promptSizer, 0, wx.SHAPED|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 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_start_button2 = wx.Button( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"开始转换", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
s_StartSizer_sbSizer18.Add( self.m_start_button2, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_StartSizer_sbSizer18, 1, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN, 5 )
|
||||
|
||||
|
||||
self.SetSizer( main_page_sizer )
|
||||
self.Layout()
|
||||
|
||||
# Connect Events
|
||||
self.m_ChooseMidiTips_staticText3.Bind( wx.EVT_LEFT_DCLICK, self.MidiEasterEgg )
|
||||
self.m_midiFilesList_listBox2.Bind( wx.EVT_LISTBOX, self.onFileListUpdated )
|
||||
self.m_midiFilesList_listBox2.Bind( wx.EVT_LISTBOX_DCLICK, self.onFileDoubleClicked )
|
||||
self.m_midiBroseButton_button21.Bind( wx.EVT_BUTTON, self.openFile )
|
||||
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_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_enteringStructureMaxHeight_spinCtrl1.Bind( wx.EVT_SPINCTRL, self.onStructureMaxHeightSpinChanged )
|
||||
self.m_EnteringBDXfileSignName_textCtrl12.Bind( wx.EVT_TEXT, self.onBDXfileSignNameUpdating )
|
||||
self.m_start_button2.Bind( wx.EVT_BUTTON, self.onStartButtonPressed )
|
||||
|
||||
def __del__( self ):
|
||||
pass
|
||||
|
||||
|
||||
# Virtual event handlers, override them in your derived class
|
||||
def MidiEasterEgg( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onFileListUpdated( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onFileDoubleClicked( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def openFile( 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 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()
|
||||
|
||||
|
||||
###########################################################################
|
||||
## Class setting_page_pannel
|
||||
###########################################################################
|
||||
|
||||
class setting_page_pannel ( wx.Panel ):
|
||||
|
||||
def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 565,540 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ):
|
||||
wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name )
|
||||
|
||||
setting_page_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
self.setting_notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.NB_FIXEDWIDTH|wx.NB_MULTILINE|wx.NB_RIGHT )
|
||||
self.setting_notebook.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "@OPPOSans R" ) )
|
||||
self.setting_notebook.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )
|
||||
|
||||
self.setting_page1 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.setting_page1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page1_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
sss_customProgressBarSizer_wSizer6 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )
|
||||
|
||||
setting_page1_progressbar_style = wx.StaticBoxSizer( wx.StaticBox( self.setting_page1, wx.ID_ANY, u"进度条" ), wx.HORIZONTAL )
|
||||
|
||||
ssss_basicProgressStylePattle_sbSizer9 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.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 )
|
||||
ssss_basicProgressStylePattle_sbSizer9.Add( self.m_BasicProgressBarStyleEntering_textCtrl4, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_basicProgressStylePattle_sbSizer9, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
ssss_UnplayedPartProgressbarPattle_sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.GetStaticBox(), wx.ID_ANY, u"未播放之样式" ), wx.VERTICAL )
|
||||
|
||||
self.m_unplayedProgressbarStyleEntering_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_unplayedProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_UnplayedPartProgressbarPattle_sbSizer10, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
ssss_PlayedPartProgressbarPattle_sbSizer11 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.GetStaticBox(), wx.ID_ANY, u"已播放之样式" ), wx.VERTICAL )
|
||||
|
||||
self.m_playedProgressbarStyleEntering_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_playedProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_PlayedPartProgressbarPattle_sbSizer11, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
sss_customProgressBarSizer_wSizer6.Add( setting_page1_progressbar_style, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
setting_page1_experiment_style = wx.StaticBoxSizer( wx.StaticBox( self.setting_page1, wx.ID_ANY, u"实验性功能" ), wx.HORIZONTAL )
|
||||
|
||||
self.m_enable_experiment_checkBox = wx.CheckBox( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, u"启用实验性功能", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
setting_page1_experiment_style.Add( self.m_enable_experiment_checkBox, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
experiment_type_choiceChoices = [ u"常规转换", u"长音插值", u"同刻偏移" ]
|
||||
self.experiment_type_choice = wx.Choice( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, experiment_type_choiceChoices, 0 )
|
||||
self.experiment_type_choice.SetSelection( 0 )
|
||||
setting_page1_experiment_style.Add( self.experiment_type_choice, 2, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_ignore_midi_error_checkBox = wx.CheckBox( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, u"忽略MIDI错误", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_ignore_midi_error_checkBox.SetValue(True)
|
||||
setting_page1_experiment_style.Add( self.m_ignore_midi_error_checkBox, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
|
||||
|
||||
|
||||
sss_customProgressBarSizer_wSizer6.Add( setting_page1_experiment_style, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
setting_page1_box_sizer.Add( sss_customProgressBarSizer_wSizer6, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
self.setting_page1.SetSizer( setting_page1_box_sizer )
|
||||
self.setting_page1.Layout()
|
||||
setting_page1_box_sizer.Fit( self.setting_page1 )
|
||||
self.setting_notebook.AddPage( self.setting_page1, u"基本信息", True )
|
||||
self.setting_page2 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.setting_page2.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, wx.EmptyString ) )
|
||||
|
||||
setting_page2_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_pitched_instrument_table_choiceChoices = [ u"“偷吃”的对照表", u"“经典”对照表" ]
|
||||
self.m_pitched_instrument_table_choice = wx.Choice( self.setting_page2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_pitched_instrument_table_choiceChoices, 0 )
|
||||
self.m_pitched_instrument_table_choice.SetSelection( 0 )
|
||||
self.m_pitched_instrument_table_choice.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page2_box_sizer.Add( self.m_pitched_instrument_table_choice, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 )
|
||||
|
||||
self.m_pitched_notes_table_propertyGrid1 = pg.PropertyGrid(self.setting_page2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.propgrid.PG_BOLD_MODIFIED|wx.propgrid.PG_DEFAULT_STYLE)
|
||||
self.m_pitched_notes_table_propertyGrid1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_propertyGridItem1 = self.m_pitched_notes_table_propertyGrid1.Append( pg.StringProperty( u"乐音乐器1", u"乐音乐器1" ) )
|
||||
self.m_propertyGridItem2 = self.m_pitched_notes_table_propertyGrid1.Append( pg.StringProperty( u"乐音乐器2", u"乐音乐器2" ) )
|
||||
setting_page2_box_sizer.Add( self.m_pitched_notes_table_propertyGrid1, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
|
||||
self.setting_page2.SetSizer( setting_page2_box_sizer )
|
||||
self.setting_page2.Layout()
|
||||
setting_page2_box_sizer.Fit( self.setting_page2 )
|
||||
self.setting_notebook.AddPage( self.setting_page2, u"乐音乐器对照表", False )
|
||||
self.setting_page3 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
setting_page3_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_percussion_instrument_table_choice1Choices = [ u"“偷吃”的对照表", u"“经典”对照表" ]
|
||||
self.m_percussion_instrument_table_choice1 = wx.Choice( self.setting_page3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_percussion_instrument_table_choice1Choices, 0 )
|
||||
self.m_percussion_instrument_table_choice1.SetSelection( 0 )
|
||||
self.m_percussion_instrument_table_choice1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page3_box_sizer.Add( self.m_percussion_instrument_table_choice1, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
self.m_percussion_notes_table_propertyGrid11 = pg.PropertyGrid(self.setting_page3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.propgrid.PG_BOLD_MODIFIED|wx.propgrid.PG_DEFAULT_STYLE)
|
||||
self.m_percussion_notes_table_propertyGrid11.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_propertyGridItem11 = self.m_percussion_notes_table_propertyGrid11.Append( pg.StringProperty( u"打击乐器1", u"打击乐器1" ) )
|
||||
self.m_propertyGridItem21 = self.m_percussion_notes_table_propertyGrid11.Append( pg.StringProperty( u"打击乐器2", u"打击乐器2" ) )
|
||||
setting_page3_box_sizer.Add( self.m_percussion_notes_table_propertyGrid11, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
|
||||
self.setting_page3.SetSizer( setting_page3_box_sizer )
|
||||
self.setting_page3.Layout()
|
||||
setting_page3_box_sizer.Fit( self.setting_page3 )
|
||||
self.setting_notebook.AddPage( self.setting_page3, u"打击乐器对照表", False )
|
||||
|
||||
setting_page_sizer.Add( self.setting_notebook, 1, wx.EXPAND |wx.ALL, 5 )
|
||||
|
||||
|
||||
self.SetSizer( setting_page_sizer )
|
||||
self.Layout()
|
||||
|
||||
# Connect Events
|
||||
self.m_BasicProgressBarStyleEntering_textCtrl4.Bind( wx.EVT_TEXT, self.onProgressbarBasicStyleUpdating )
|
||||
self.m_unplayedProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarUnplayedStyleUpdating )
|
||||
self.m_playedProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarPlayedStyleUpdating )
|
||||
|
||||
def __del__( self ):
|
||||
pass
|
||||
|
||||
|
||||
# Virtual event handlers, override them in your derived class
|
||||
def onProgressbarBasicStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onProgressbarUnplayedStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onProgressbarPlayedStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
|
||||
612
wxFB_Project/noname.py
Normal file
612
wxFB_Project/noname.py
Normal file
@@ -0,0 +1,612 @@
|
||||
# -*- 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
|
||||
import wx.propgrid as pg
|
||||
|
||||
###########################################################################
|
||||
## 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( 660,723 ), 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_statusBar2.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_menubar1 = wx.MenuBar( 0 )
|
||||
self.m_menubar1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.FileMenu = wx.Menu()
|
||||
self.m_ClearSetting_menuItem2 = wx.MenuItem( self.FileMenu, wx.ID_ANY, u"重置设置", u"将全部数据设置重置为默认值(下次启动时生效)", wx.ITEM_CHECK )
|
||||
self.FileMenu.Append( self.m_ClearSetting_menuItem2 )
|
||||
|
||||
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, 0, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN|wx.TOP, 2 )
|
||||
|
||||
self.mian_notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.mian_notebook.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.convert_page = wx.Panel( self.mian_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.mian_notebook.AddPage( self.convert_page, u"开始转换", True )
|
||||
self.setting_page = wx.Panel( self.mian_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.mian_notebook.AddPage( self.setting_page, u"数据设置", False )
|
||||
|
||||
m_mainBoxSizer.Add( self.mian_notebook, 1, wx.EXPAND |wx.ALL, 5 )
|
||||
|
||||
|
||||
self.SetSizer( m_mainBoxSizer )
|
||||
self.Layout()
|
||||
|
||||
self.Centre( wx.BOTH )
|
||||
|
||||
# Connect Events
|
||||
self.Bind( wx.EVT_MENU, self.onResetSettingButtonSelection, id = self.m_ClearSetting_menuItem2.GetId() )
|
||||
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 )
|
||||
|
||||
def __del__( self ):
|
||||
pass
|
||||
|
||||
|
||||
# Virtual event handlers, override them in your derived class
|
||||
def onResetSettingButtonSelection( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onExitButtonPressed( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onYanlunDClicked( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onYanlunWheeled( self, event ):
|
||||
event.Skip()
|
||||
|
||||
|
||||
###########################################################################
|
||||
## Class ConvertPagePanel
|
||||
###########################################################################
|
||||
|
||||
class ConvertPagePanel ( wx.Panel ):
|
||||
|
||||
def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 652,588 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ):
|
||||
wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name )
|
||||
|
||||
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )
|
||||
|
||||
main_page_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
s_midiChooseSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||
|
||||
MidiChooser_Delete_and_Tips_bSizer15 = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
self.m_ChooseMidiTips_staticText3 = wx.StaticText( self, wx.ID_ANY, u"选择MIDI文件\n(双击移除)", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_ChooseMidiTips_staticText3.Wrap( -1 )
|
||||
|
||||
MidiChooser_Delete_and_Tips_bSizer15.Add( self.m_ChooseMidiTips_staticText3, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
|
||||
|
||||
self.m_done_then_remove_checkBox6 = wx.CheckBox( self, wx.ID_ANY, u"完成后移除", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
MidiChooser_Delete_and_Tips_bSizer15.Add( self.m_done_then_remove_checkBox6, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
s_midiChooseSizer.Add( MidiChooser_Delete_and_Tips_bSizer15, 0, wx.SHAPED|wx.EXPAND, 0 )
|
||||
|
||||
ss_MidiChooserSizer_bSizer9 = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_midiFilesList_listBox2Choices = []
|
||||
self.m_midiFilesList_listBox2 = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_midiFilesList_listBox2Choices, wx.LB_HSCROLL|wx.LB_SORT )
|
||||
ss_MidiChooserSizer_bSizer9.Add( self.m_midiFilesList_listBox2, 1, wx.EXPAND, 0 )
|
||||
|
||||
|
||||
s_midiChooseSizer.Add( ss_MidiChooserSizer_bSizer9, 1, wx.EXPAND, 5 )
|
||||
|
||||
MidiChooser_Open_and_Clear_Buttons_bSizer16 = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
self.m_midiBroseButton_button21 = wx.Button( self, wx.ID_ANY, u"打开…", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
MidiChooser_Open_and_Clear_Buttons_bSizer16.Add( self.m_midiBroseButton_button21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_midiChooser_Clear_button3 = wx.Button( self, wx.ID_ANY, u"清空文件", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
MidiChooser_Open_and_Clear_Buttons_bSizer16.Add( self.m_midiChooser_Clear_button3, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
s_midiChooseSizer.Add( MidiChooser_Open_and_Clear_Buttons_bSizer16, 0, wx.EXPAND, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_midiChooseSizer, 0, 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, 0 )
|
||||
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( 2 )
|
||||
ss_playerChooseSizer.Add( self.m_playerChoice_choice2, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
s_formatChooseSizer.Add( ss_playerChooseSizer, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_formatChooseSizer, 0, 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, 0, 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.01, 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, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_regularPromoptsEnteringSizer1, 0, wx.EXPAND, 5 )
|
||||
|
||||
ss_commandCheckingSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"指令设置" ), wx.HORIZONTAL )
|
||||
|
||||
self.m_progressBarEnablingCheckBox1 = wx.CheckBox( ss_commandCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用进度条", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
ss_commandCheckingSizer.Add( self.m_progressBarEnablingCheckBox1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_oldExeFormatChecker_checkBox3 = wx.CheckBox( ss_commandCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用旧版执行指令格式", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
ss_commandCheckingSizer.Add( self.m_oldExeFormatChecker_checkBox3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_commandCheckingSizer, 0, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
ss_HideAndSeekSizer_bSizer15.Add( sss_ScoreboardPlayerPromptsSizer_bSizer7, 0, wx.SHAPED|wx.EXPAND, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 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|wx.ALIGN_CENTER_VERTICAL, 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_enteringStructureMaxHeight_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_enteringStructureMaxHeight_spinCtrl1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
ss_HideAndSeekSizer_bSizer15.Add( sss_StructurePlayerPromptsSizer_bSizer8, 0, wx.SHAPED|wx.EXPAND, 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|wx.ALIGN_CENTER_VERTICAL, 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, 0, wx.SHAPED|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
s_promptSizer.Add( ss_HideAndSeekSizer_bSizer15, 0, wx.EXPAND, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_promptSizer, 0, wx.ALL|wx.EXPAND|wx.SHAPED, 5 )
|
||||
|
||||
s_StartSizer_sbSizer18 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"开始转换" ), wx.HORIZONTAL )
|
||||
|
||||
s_StartSizer_sbSizer18.SetMinSize( wx.Size( -1,100 ) )
|
||||
ss_Midi_Convert_distPath_bSizer17 = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
ss_Dest_chooser_Sizer_in_bSizer18 = wx.BoxSizer( wx.HORIZONTAL )
|
||||
|
||||
self.m_tip_Change_Dest_staticText7 = wx.StaticText( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"指定输出路径", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_tip_Change_Dest_staticText7.Wrap( -1 )
|
||||
|
||||
ss_Dest_chooser_Sizer_in_bSizer18.Add( self.m_tip_Change_Dest_staticText7, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_Convertion_Destination_Picker_dirPicker1 = wx.DirPickerCtrl( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"./", u"选择目标目录", wx.DefaultPosition, wx.DefaultSize, wx.DIRP_DEFAULT_STYLE )
|
||||
ss_Dest_chooser_Sizer_in_bSizer18.Add( self.m_Convertion_Destination_Picker_dirPicker1, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
ss_Midi_Convert_distPath_bSizer17.Add( ss_Dest_chooser_Sizer_in_bSizer18, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
self.m_Check_Every_Their_Path_checkBox7 = wx.CheckBox( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"输出到每个文件所在目录", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_Check_Every_Their_Path_checkBox7.SetValue(True)
|
||||
ss_Midi_Convert_distPath_bSizer17.Add( self.m_Check_Every_Their_Path_checkBox7, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
s_StartSizer_sbSizer18.Add( ss_Midi_Convert_distPath_bSizer17, 1, wx.EXPAND, 5 )
|
||||
|
||||
self.m_start_button2 = wx.Button( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"开始转换", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
s_StartSizer_sbSizer18.Add( self.m_start_button2, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
|
||||
|
||||
|
||||
main_page_sizer.Add( s_StartSizer_sbSizer18, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
self.SetSizer( main_page_sizer )
|
||||
self.Layout()
|
||||
|
||||
# Connect Events
|
||||
self.m_ChooseMidiTips_staticText3.Bind( wx.EVT_LEFT_DCLICK, self.MidiEasterEgg )
|
||||
self.m_done_then_remove_checkBox6.Bind( wx.EVT_CHECKBOX, self.on_Done_Then_Remove_Clicked )
|
||||
self.m_midiFilesList_listBox2.Bind( wx.EVT_LISTBOX, self.onFileListUpdated )
|
||||
self.m_midiFilesList_listBox2.Bind( wx.EVT_LISTBOX_DCLICK, self.onFileDoubleClicked )
|
||||
self.m_midiBroseButton_button21.Bind( wx.EVT_BUTTON, self.openFile )
|
||||
self.m_midiChooser_Clear_button3.Bind( wx.EVT_BUTTON, self.on_Chooer_Clear_Button_Pressed )
|
||||
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_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_enteringStructureMaxHeight_spinCtrl1.Bind( wx.EVT_SPINCTRL, self.onStructureMaxHeightSpinChanged )
|
||||
self.m_EnteringBDXfileSignName_textCtrl12.Bind( wx.EVT_TEXT, self.onBDXfileSignNameUpdating )
|
||||
self.m_tip_Change_Dest_staticText7.Bind( wx.EVT_LEFT_DCLICK, self.on_Change_to_Default_Path )
|
||||
self.m_Convertion_Destination_Picker_dirPicker1.Bind( wx.EVT_DIRPICKER_CHANGED, self.on_Convert_Dest_Changed )
|
||||
self.m_Check_Every_Their_Path_checkBox7.Bind( wx.EVT_CHECKBOX, self.On_Their_Path_Checked )
|
||||
self.m_start_button2.Bind( wx.EVT_BUTTON, self.onStartButtonPressed )
|
||||
|
||||
def __del__( self ):
|
||||
pass
|
||||
|
||||
|
||||
# Virtual event handlers, override them in your derived class
|
||||
def MidiEasterEgg( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def on_Done_Then_Remove_Clicked( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onFileListUpdated( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onFileDoubleClicked( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def openFile( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def on_Chooer_Clear_Button_Pressed( 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 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 on_Change_to_Default_Path( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def on_Convert_Dest_Changed( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def On_Their_Path_Checked( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onStartButtonPressed( self, event ):
|
||||
event.Skip()
|
||||
|
||||
|
||||
###########################################################################
|
||||
## Class SettingPagePannel
|
||||
###########################################################################
|
||||
|
||||
class SettingPagePannel ( wx.Panel ):
|
||||
|
||||
def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 565,540 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ):
|
||||
wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name )
|
||||
|
||||
setting_page_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
self.setting_notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.NB_FIXEDWIDTH|wx.NB_MULTILINE|wx.NB_RIGHT )
|
||||
self.setting_notebook.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "@OPPOSans R" ) )
|
||||
self.setting_notebook.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )
|
||||
|
||||
self.setting_page1 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.setting_page1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page1_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
sss_customProgressBarSizer_wSizer6 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )
|
||||
|
||||
setting_page1_progressbar_style = wx.StaticBoxSizer( wx.StaticBox( self.setting_page1, wx.ID_ANY, u"进度条" ), wx.HORIZONTAL )
|
||||
|
||||
ssss_basicProgressStylePattle_sbSizer9 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.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 )
|
||||
ssss_basicProgressStylePattle_sbSizer9.Add( self.m_BasicProgressBarStyleEntering_textCtrl4, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_basicProgressStylePattle_sbSizer9, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
ssss_UnplayedPartProgressbarPattle_sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.GetStaticBox(), wx.ID_ANY, u"未播放之样式" ), wx.VERTICAL )
|
||||
|
||||
self.m_unplayedProgressbarStyleEntering_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_unplayedProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_UnplayedPartProgressbarPattle_sbSizer10, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
ssss_PlayedPartProgressbarPattle_sbSizer11 = wx.StaticBoxSizer( wx.StaticBox( setting_page1_progressbar_style.GetStaticBox(), wx.ID_ANY, u"已播放之样式" ), wx.VERTICAL )
|
||||
|
||||
self.m_playedProgressbarStyleEntering_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_playedProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 )
|
||||
|
||||
|
||||
setting_page1_progressbar_style.Add( ssss_PlayedPartProgressbarPattle_sbSizer11, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
sss_customProgressBarSizer_wSizer6.Add( setting_page1_progressbar_style, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
setting_page1_experiment_style = wx.StaticBoxSizer( wx.StaticBox( self.setting_page1, wx.ID_ANY, u"实验性功能" ), wx.HORIZONTAL )
|
||||
|
||||
self.m_enable_experiment_checkBox = wx.CheckBox( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, u"启用实验性功能", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
setting_page1_experiment_style.Add( self.m_enable_experiment_checkBox, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
experiment_type_choiceChoices = [ u"常规转换", u"长音插值", u"同刻偏移" ]
|
||||
self.experiment_type_choice = wx.Choice( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, experiment_type_choiceChoices, 0 )
|
||||
self.experiment_type_choice.SetSelection( 0 )
|
||||
setting_page1_experiment_style.Add( self.experiment_type_choice, 2, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
self.m_ignore_midi_error_checkBox = wx.CheckBox( setting_page1_experiment_style.GetStaticBox(), wx.ID_ANY, u"忽略MIDI错误", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_ignore_midi_error_checkBox.SetValue(True)
|
||||
setting_page1_experiment_style.Add( self.m_ignore_midi_error_checkBox, 1, wx.ALL, 5 )
|
||||
|
||||
|
||||
sss_customProgressBarSizer_wSizer6.Add( setting_page1_experiment_style, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
setting_page1_box_sizer.Add( sss_customProgressBarSizer_wSizer6, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
self.setting_page1.SetSizer( setting_page1_box_sizer )
|
||||
self.setting_page1.Layout()
|
||||
setting_page1_box_sizer.Fit( self.setting_page1 )
|
||||
self.setting_notebook.AddPage( self.setting_page1, u"基本信息", True )
|
||||
self.setting_page2 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
self.setting_page2.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, wx.EmptyString ) )
|
||||
|
||||
setting_page2_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_pitched_instrument_table_choiceChoices = [ u"“偷吃”的对照表", u"“经典”对照表" ]
|
||||
self.m_pitched_instrument_table_choice = wx.Choice( self.setting_page2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_pitched_instrument_table_choiceChoices, 0 )
|
||||
self.m_pitched_instrument_table_choice.SetSelection( 0 )
|
||||
self.m_pitched_instrument_table_choice.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page2_box_sizer.Add( self.m_pitched_instrument_table_choice, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
self.m_pitched_notes_table_propertyGrid1 = pg.PropertyGrid(self.setting_page2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.propgrid.PG_BOLD_MODIFIED|wx.propgrid.PG_DEFAULT_STYLE)
|
||||
self.m_pitched_notes_table_propertyGrid1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_propertyGridItem1 = self.m_pitched_notes_table_propertyGrid1.Append( pg.StringProperty( u"乐音乐器1", u"乐音乐器1" ) )
|
||||
self.m_propertyGridItem2 = self.m_pitched_notes_table_propertyGrid1.Append( pg.StringProperty( u"乐音乐器2", u"乐音乐器2" ) )
|
||||
setting_page2_box_sizer.Add( self.m_pitched_notes_table_propertyGrid1, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
self.setting_page2.SetSizer( setting_page2_box_sizer )
|
||||
self.setting_page2.Layout()
|
||||
setting_page2_box_sizer.Fit( self.setting_page2 )
|
||||
self.setting_notebook.AddPage( self.setting_page2, u"乐音乐器对照表", False )
|
||||
self.setting_page3 = wx.Panel( self.setting_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
|
||||
setting_page3_box_sizer = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
m_percussion_instrument_table_choice1Choices = [ u"“偷吃”的对照表", u"“经典”对照表" ]
|
||||
self.m_percussion_instrument_table_choice1 = wx.Choice( self.setting_page3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_percussion_instrument_table_choice1Choices, 0 )
|
||||
self.m_percussion_instrument_table_choice1.SetSelection( 0 )
|
||||
self.m_percussion_instrument_table_choice1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
setting_page3_box_sizer.Add( self.m_percussion_instrument_table_choice1, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
self.m_percussion_notes_table_propertyGrid11 = pg.PropertyGrid(self.setting_page3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.propgrid.PG_BOLD_MODIFIED|wx.propgrid.PG_DEFAULT_STYLE)
|
||||
self.m_percussion_notes_table_propertyGrid11.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) )
|
||||
|
||||
self.m_propertyGridItem11 = self.m_percussion_notes_table_propertyGrid11.Append( pg.StringProperty( u"打击乐器1", u"打击乐器1" ) )
|
||||
self.m_propertyGridItem21 = self.m_percussion_notes_table_propertyGrid11.Append( pg.StringProperty( u"打击乐器2", u"打击乐器2" ) )
|
||||
setting_page3_box_sizer.Add( self.m_percussion_notes_table_propertyGrid11, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
self.setting_page3.SetSizer( setting_page3_box_sizer )
|
||||
self.setting_page3.Layout()
|
||||
setting_page3_box_sizer.Fit( self.setting_page3 )
|
||||
self.setting_notebook.AddPage( self.setting_page3, u"打击乐器对照表", False )
|
||||
|
||||
setting_page_sizer.Add( self.setting_notebook, 1, wx.EXPAND |wx.ALL, 5 )
|
||||
|
||||
|
||||
self.SetSizer( setting_page_sizer )
|
||||
self.Layout()
|
||||
|
||||
# Connect Events
|
||||
self.m_BasicProgressBarStyleEntering_textCtrl4.Bind( wx.EVT_TEXT, self.onProgressbarBasicStyleUpdating )
|
||||
self.m_unplayedProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarUnplayedStyleUpdating )
|
||||
self.m_playedProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarPlayedStyleUpdating )
|
||||
self.m_enable_experiment_checkBox.Bind( wx.EVT_CHECKBOX, self.onExperimentEnableUpdating )
|
||||
self.experiment_type_choice.Bind( wx.EVT_CHOICE, self.onConvertMethodUpdating )
|
||||
self.m_ignore_midi_error_checkBox.Bind( wx.EVT_CHECKBOX, self.onMidiFaultIgnoranceChecking )
|
||||
self.m_pitched_instrument_table_choice.Bind( wx.EVT_CHOICE, self.onPitchedInstListChanging )
|
||||
self.m_pitched_notes_table_propertyGrid1.Bind( pg.EVT_PG_CHANGED, self.onPitchedInstTableChanged )
|
||||
self.m_pitched_notes_table_propertyGrid1.Bind( pg.EVT_PG_CHANGING, self.onPitchedInstTableChanging )
|
||||
self.m_percussion_instrument_table_choice1.Bind( wx.EVT_CHOICE, self.onPercussionInstListChanging )
|
||||
self.m_percussion_notes_table_propertyGrid11.Bind( pg.EVT_PG_CHANGED, self.onPercussionInstTableChanged )
|
||||
self.m_percussion_notes_table_propertyGrid11.Bind( pg.EVT_PG_CHANGING, self.onPercussionInstTableChanging )
|
||||
|
||||
def __del__( self ):
|
||||
pass
|
||||
|
||||
|
||||
# Virtual event handlers, override them in your derived class
|
||||
def onProgressbarBasicStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onProgressbarUnplayedStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onProgressbarPlayedStyleUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onExperimentEnableUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onConvertMethodUpdating( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onMidiFaultIgnoranceChecking( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onPitchedInstListChanging( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onPitchedInstTableChanged( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onPitchedInstTableChanging( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onPercussionInstListChanging( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onPercussionInstTableChanged( self, event ):
|
||||
event.Skip()
|
||||
|
||||
def onPercussionInstTableChanging( self, event ):
|
||||
event.Skip()
|
||||
|
||||
|
||||
23
自我陶醉.py
Normal file
23
自我陶醉.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- conding: utf8 -*-
|
||||
|
||||
import os
|
||||
|
||||
m = 0
|
||||
|
||||
for path, dir_list, file_list in os.walk(r"./"):
|
||||
for file_name in file_list:
|
||||
if file_name.endswith('.py'):
|
||||
file = os.path.join(path, file_name)
|
||||
print("得到文件名:" + str(file))
|
||||
for i in open(file, 'r', encoding="utf-8"):
|
||||
code = i.strip()
|
||||
|
||||
if code.startswith('#'):
|
||||
pass
|
||||
elif code:
|
||||
print("\t" + code)
|
||||
m += 1
|
||||
else:
|
||||
pass
|
||||
|
||||
input("\n最终代码行数为:" + str(m))
|
||||
Reference in New Issue
Block a user