This commit is contained in:
EillesWan 2023-11-04 22:24:02 +08:00
parent 36daf19407
commit 7fad110d47
10 changed files with 1675 additions and 231 deletions

View File

@ -1,5 +1,11 @@
<h1 align="center">伶伦转换器</h1> <h1 align="center">伶伦转换器</h1>
<p align="center">
<img width="128" height="128" src="https://gitee.com/TriM-Organization/LinglunConverter/raw/master/resources/LLC_LOGO_OK_PLAIN_BANNER.png">
</img>
</p>
<h3 align="center">一个免费开源的《我的世界》数字音频转换器</h3> <h3 align="center">一个免费开源的《我的世界》数字音频转换器</h3>
<p align="center"> <p align="center">
@ -7,7 +13,7 @@
<p> <p>
[![][Bilibili: 凌云金羿]](https://space.bilibili.com/397369002/) [![][Bilibili: 金羿ELS]](https://space.bilibili.com/397369002/)
[![][Bilibili: 诸葛亮与八卦阵]](https://space.bilibili.com/604072474) [![][Bilibili: 诸葛亮与八卦阵]](https://space.bilibili.com/604072474)
[![CodeStyle: black]](https://github.com/psf/black) [![CodeStyle: black]](https://github.com/psf/black)
[![][python]](https://www.python.org/) [![][python]](https://www.python.org/)
@ -18,7 +24,7 @@
<!-- 简体中文 | [English](README_EN.md) --> <!-- 简体中文 | [English](README_EN.md) -->
## 软件介绍🚀 ## 介绍🚀
**伶伦** 是一款免费开源的 **《我的世界》** 数字音频工作站 **伶伦** 是一款免费开源的 **《我的世界》** 数字音频工作站
@ -40,20 +46,18 @@
[转换乐器对照参考表](https://gitee.com/TriM-Organization/Musicreater/blob/master/docs/%E8%BD%AC%E6%8D%A2%E4%B9%90%E5%99%A8%E5%AF%B9%E7%85%A7%E8%A1%A8.md) [转换乐器对照参考表](https://gitee.com/TriM-Organization/Musicreater/blob/master/docs/%E8%BD%AC%E6%8D%A2%E4%B9%90%E5%99%A8%E5%AF%B9%E7%85%A7%E8%A1%A8.md)
## 致谢列表🙏 ## 致谢🙏
> 感谢广大群友为此库提供的测试和建议等 > 感谢广大群友为此软件提供的测试和建议
>
> 若您对我们有所贡献但您的名字没有出现在此列表中,请联系我们!
## 联系我们📞 ## 联系📞
QQ群 [861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr) QQ群 [861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)
电邮 [TriM-Organization@hotmail.com](mailto:TriM-Organization@hotmail.com) 电邮 [TriM-Organization@hotmail.com](mailto:TriM-Organization@hotmail.com)
[Bilibili: 凌云金羿]: https://img.shields.io/badge/Bilibili-%E5%87%8C%E4%BA%91%E9%87%91%E7%BE%BF-00A1E7?style=for-the-badge [Bilibili: 金羿ELS]: https://img.shields.io/badge/Bilibili-%E9%87%91%E7%BE%BFELS-00A1E7?style=for-the-badge
[Bilibili: 诸葛亮与八卦阵]: https://img.shields.io/badge/Bilibili-%E8%AF%B8%E8%91%9B%E4%BA%AE%E4%B8%8E%E5%85%AB%E5%8D%A6%E9%98%B5-00A1E7?style=for-the-badge [Bilibili: 诸葛亮与八卦阵]: https://img.shields.io/badge/Bilibili-%E8%AF%B8%E8%91%9B%E4%BA%AE%E4%B8%8E%E5%85%AB%E5%8D%A6%E9%98%B5-00A1E7?style=for-the-badge
[CodeStyle: black]: https://img.shields.io/badge/code%20style-black-121110.svg?style=for-the-badge [CodeStyle: black]: https://img.shields.io/badge/code%20style-black-121110.svg?style=for-the-badge
[python]: https://img.shields.io/badge/python-3.6-AB70FF?style=for-the-badge [python]: https://img.shields.io/badge/python-3.6-AB70FF?style=for-the-badge

View File

@ -1,13 +1,38 @@
## 一、运行环境安装 ## 运行打包文件(推荐)
### (一)安装 Python3.8+ ### 一、下载打包好的应用程序
1. 在[代码仓库发布页](https://gitee.com/TriM-Organization/Linglun-Converter/releases)找到最新的下载。
<img src=https://foruda.gitee.com/images/1699105959996885442/be19644e_9911226.png>
请注意选择对您合适的构建版本
### 二、开始使用
2. 将下载得到的文件解压缩后,直接运行其中的 `llc_win_wxPython.exe`
<img src=https://foruda.gitee.com/images/1699106497816902973/48dc0942_9911226.png>
<img src=https://foruda.gitee.com/images/1699106542397488143/5638cd3e_9911226.png>
<img src=https://foruda.gitee.com/images/1699106557013748881/70f90fac_9911226.png>
3. 即可开始使用
<img src=https://foruda.gitee.com/images/1699106948861444130/30c156bc_9911226.png>
## 从代码运行(最新功能)
### 一、运行环境安装
#### (一)安装 Python3.8+
1. 首先需要下载Python的安装包最好是 *Python3.10*,因为作者就用的是这个版本 1. 首先需要下载Python的安装包最好是 *Python3.10*,因为作者就用的是这个版本
注意此程序现已不支持Python3.6。请更新到至少Python3.8但是我们对于Python3.8的支持也即将停止为了更好的兼容避免不必要的麻烦我们强烈建议您更新到Python3.10。(这意味着我们即将放弃对Windows7的支持) 注意此程序现已不支持Python3.6。请更新到至少Python3.8但是我们对于Python3.8的支持也即将停止为了更好的兼容避免不必要的麻烦我们强烈建议您更新到Python3.10。(这意味着我们即将放弃对Windows7的支持)
> [下载64位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe) > [下载64位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe)
> [下载32位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe) > [下载32位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe)
2. 在安装时,最好需要勾选 `Add Python 3.X to PATH`,如下图所示: 2. 在安装时,最好需要勾选 `Add Python 3.X to PATH`,如下图所示:
@ -19,12 +44,12 @@
<img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png> <img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png>
4. 安装结束之后可以在*终端*(命令行/PowerShell/Bash/etc)中输入:`python` 试试是否安装成功成功安装之后在终端中输入python会显示诸如如下图片的提示 4. 安装结束之后可以在*终端*(命令行/PowerShell/Bash/etc)中输入:`python -V` 试试是否安装成功成功安装之后在终端中输入python会显示诸如如下图片的提示
<img src=https://foruda.gitee.com/images/1659972669907359295/cmd.png> <img src=https://foruda.gitee.com/images/1699107336707287940/1837e2f6_9911226.png>
### (二)安装依赖 #### (二)安装依赖
1. 请以管理员模式打开您的*终端*(命令行/PowerShell/Bash/etc) 1. 请以管理员模式打开您的*终端*(命令行/PowerShell/Bash/etc)
@ -42,7 +67,7 @@
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png"> <img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
## 二、本工具的下载与使用 ### 二、本工具的下载与使用
0. 下载本代码库以及演示程序 0. 下载本代码库以及演示程序
@ -66,13 +91,13 @@
<img src=https://foruda.gitee.com/images/1659974437388532868/输入.png> <img src=https://foruda.gitee.com/images/1659974437388532868/输入.png>
<img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png> <img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png>
使用以下指令: 在打开的终端中使用以下指令:
```bash ```bash
python ./llc_cli.py python ./llc_cli.py
``` ```
## 三、安装时错误的补充说明 ### 三、安装时错误的补充说明
1. Microsoft Visual C++ Redistributable 环境出错 1. Microsoft Visual C++ Redistributable 环境出错
@ -84,4 +109,4 @@
> [下载64位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe) > [下载64位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe)
> [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x86.exe) > [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x86.exe)
感谢群友*Mono*帮我们发现这个问题。 感谢群友 *Mono* 帮我们发现这个问题。

View File

@ -28,7 +28,7 @@
- 速度倍率正小数其值不可为0用以表示游戏中播放此音乐的速度倍数。 - 速度倍率正小数其值不可为0用以表示游戏中播放此音乐的速度倍数。
- 进度条:是否启用自动生成进度条。 - 启用进度条:是否启用自动生成进度条。
- 若是,则可选是否自定义进度条 - 若是,则可选是否自定义进度条

View File

View File

@ -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 ""

View File

@ -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
"""
# 下面为正文

View File

@ -717,9 +717,9 @@ class LingLunMainFrame(wx.Frame):
def onYanlunWheeled(self, event): def onYanlunWheeled(self, event):
if event.GetWheelRotation() < 0: if event.GetWheelRotation() < 0:
self.yanlun_now -= 1
else:
self.yanlun_now += 1 self.yanlun_now += 1
else:
self.yanlun_now -= 1
self.yanlun_now += ( self.yanlun_now += (
-yanlun_length -yanlun_length
if self.yanlun_now >= yanlun_length if self.yanlun_now >= yanlun_length

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 KiB