更新依赖、窗口内支持mcstructure、协议更新、命令行docker构建

This commit is contained in:
EillesWan 2025-05-09 01:59:04 +08:00
parent 59f5615a80
commit e3b94f7445
16 changed files with 217 additions and 96 deletions

41
Dockerfile Normal file
View File

@ -0,0 +1,41 @@
FROM docker.1ms.run/library/python:3.10-slim-bullseye
ENV TZ Asia/Taipei
WORKDIR /app
# RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak
RUN touch /etc/apt/sources.list
RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" > /etc/apt/sources.list && \
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" >> /etc/apt/sources.list && \
echo "deb https://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
echo "deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
echo "deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \
echo "deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list && \
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y git && \
# 清理 apt 缓存
rm -rf /var/lib/apt/lists/*
# 克隆指定的 git 仓库
RUN git clone https://gitee.com/TriM-Organization/Linglun-Converter.git
# 创建 Python 虚拟环境
RUN python3 -m venv /app/venv
RUN . /app/venv/bin/activate && \
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
/app/venv/bin/python3 -m pip install --upgrade pip && \
pip install --no-cache-dir --upgrade "Musicreater[full]" TrimLog requests zhDateTime
# 切换到克隆下来的仓库目录
WORKDIR /app/Linglun-Converter
# 设置容器启动时执行的默认命令,使用虚拟环境中的 python
CMD ["/app/venv/bin/python3", "llc_cli.py"]

View File

@ -1,8 +1,8 @@
<h1 align="center"><b><i>在 Gitee Push #4791dcd(不含)之后本仓库使用</i>《汉钰律许可协议 第一版》<i>开源</i></b></h1> <h1 align="center"><b><i>在 Gitee Push #4791dcd(不含)之后本仓库使用</i>《汉钰律许可协议,第一版》<i>授权开源</i></b></h1>
# 汉钰律许可协议 # 汉钰律许可协议,第一版
**总第一版 · 二〇二四年七月七日编** **总第一版 第二次修订 · 二〇二四年七月七日编 二〇二五年四月二十六日修订**
## 一、重要须知 ## 一、重要须知
@ -14,13 +14,13 @@
4. 由于互联网服务、互联网内容的特殊性,若本协议以电子协议形式分发并签订,其依然有效。您一旦开始对本协议所授权之作品进行本协议所授权的行为,即视为您已经阅读、理解并同意并已经接受本协议的全部条款。 4. 由于互联网服务、互联网内容的特殊性,若本协议以电子协议形式分发并签订,其依然有效。您一旦开始对本协议所授权之作品进行本协议所授权的行为,即视为您已经阅读、理解并同意并已经接受本协议的全部条款。
5. 本协议的订立、履行、解释及争议的解决均**适用中华人民共和国法律并排除其他一切冲突法的适用**。_本协议订立于许可证最初的颁发者的地址。若为自然人则订立于该自然人户籍所在地若为法人或非法人组织则订立于其注册地_。本协议的订立各方应友好协商解决于协议所规定之行为的履行相关的争议如协商不成任何一方均可向合同签订地有管辖权的人民法院提起诉讼。 5. 本协议的订立、履行、解释及争议的解决均**适用中华人民共和国法律并排除其他一切冲突法的适用**。_本协议订立于许可证最初的颁发者的地址。若颁发者为自然人则订立于该自然人户籍所在地若为法人或非法人组织则订立于其注册地_。本协议的订立各方应友好协商解决于协议所规定之行为的履行相关的争议如协商不成任何一方均可向合同签订地有管辖权的人民法院提起诉讼。
6. 本协议的原本仅为现代汉语,书写于简体中文。若存在其他语言的翻译或其他同等语言但非简体中文文本的版本,应当无法律效力。 6. 本协议的原本仅为现代汉语,书写于简体中文。若存在其他语言的翻译或其他同等语言但非简体中文文本的版本,应当无法律效力。
## 二、术语定义 ## 二、术语定义
1. “**许可证**”、“**协议**”(后文称“本协议”)是指根据本文档中所列举的全部术语、定义、条款、限制等文本,是本合同的简称称谓。本合同全称是“汉钰律许可协议”。 1. “**许可证**”、“**协议**”(后文称“本协议”)是指根据本文档中所列举的全部术语、定义、条款、限制等文本,是本合同的简称称谓。本合同全称是 **“汉钰律许可协议,第一版**
2. “**协议颁发者**”(后文称“颁发者”)是将条款或协议应用于其拥有著作财产权的作品的民事主体,或由其指定从而拥有颁发者身份的民事主体。 2. “**协议颁发者**”(后文称“颁发者”)是将条款或协议应用于其拥有著作财产权的作品的民事主体,或由其指定从而拥有颁发者身份的民事主体。
@ -30,13 +30,13 @@
5. “**采用本协议的作品**”(后文称“此作品”)是指经颁发者授权而使用本协议进行授权的任何作品,该作品应在自然人可见处明确附加一个自然人可读的版权通知(可以参考文末附录中提供的示例);若在一个可分割的作品中,部分地采用本协议进行授权,则该部分应当视为一个独立的采用本协议的作品,该作品应当在自然人可见处明确附加一个自然人可读的范围限定和版权通知(同样可以参考文末附录中提供的示例)。 5. “**采用本协议的作品**”(后文称“此作品”)是指经颁发者授权而使用本协议进行授权的任何作品,该作品应在自然人可见处明确附加一个自然人可读的版权通知(可以参考文末附录中提供的示例);若在一个可分割的作品中,部分地采用本协议进行授权,则该部分应当视为一个独立的采用本协议的作品,该作品应当在自然人可见处明确附加一个自然人可读的范围限定和版权通知(同样可以参考文末附录中提供的示例)。
6. “**贡献**”是指对作品进行的,意在提交给此作品颁发者以让著作权人包含在其作品中的任何修订或补充,该修订或补充同样属于一种作品。依据此定义,“提交”一词表示经由此作品颁发者所指定的形式,将其所进行的修改发送给此作品颁发者。该形式应当包括在此作品颁发者指定的平台内发送易于编辑的修改信息、在此作品颁发者指定的电子邮箱中发送易于编辑的修改信息、在此作品颁发者指定的源码控制系统或发布跟踪系统上提交的易于编辑的修改信息,但由著作权人以明显标注或指定为“非贡献”的活动除外。颁发者自己对作品进行的修改同样视作对作品的贡献。 6. “**贡献**”是指对作品进行的,意在提交给此作品颁发者以让著作权人包含在其作品中的任何修订或补充,该修订或补充同样属于一种作品。依据此定义,**“提交”**一词表示经由此作品颁发者所指定的形式,将其所进行的修改发送给此作品颁发者。该形式应当包括在此作品颁发者指定的平台内发送易于编辑的修改信息、在此作品颁发者指定的电子邮箱中发送易于编辑的修改信息、在此作品颁发者指定的源码控制系统或发布跟踪系统上提交的易于编辑的修改信息,但由著作权人以明显标注或指定为“非贡献”的活动除外。颁发者自己对作品进行的修改同样视作对作品的贡献。
7. “**贡献者**”是指此作品颁发者接受的贡献的提交者,或包含在作品的贡献清单中的民事主体。贡献者在提交贡献并经此作品颁发者通过且该贡献已经被应用于此作品中后,该贡献者应当视为此作品的著作权人之一,但不应视为此作品非其贡献的部分的著作权人。一个作品的颁发者同样属于其贡献者。**请注意**,针对贡献者提交的贡献,该贡献者应被视为该贡献的协议颁发者,但不应视作本作品的颁发者。 7. “**贡献者**”是指此作品颁发者接受的贡献的提交者,或包含在作品的贡献清单中的民事主体。贡献者在提交贡献并经此作品颁发者通过且该贡献已经被应用于此作品中后,该贡献者应当视为此作品的著作权人之一,但不应视为此作品非其贡献的部分的著作权人。一个作品的颁发者同样属于其贡献者。**请注意**,针对贡献者提交的贡献,该贡献者应被视为该贡献的协议颁发者,但不应视作本作品的颁发者。
8. “**用户**”、“**使用者**”是指行使本协议所授权之行为的民事主体。据此,贡献者亦属于用户。 8. “**用户**”、“**使用者**”是指行使本协议所授权之行为的民事主体。据此,贡献者亦属于用户。
9. “**商业性使用**”、“**商用**”是指任何以谋取利益为目的的使用,包括但不限于以贩卖、出租的形式对作品进行使用;但若将该牟利活动明确指示为“捐赠”,且在牟利者进行本协议所授权的活动时不以捐赠数额为标准,则此种的获取利益的“捐赠”行为不属于商业性使用。 9. “**商业性使用**”、“**商用**”是指任何以谋取利益为目的的使用,包括但不限于以贩卖、出租的形式对作品进行使用;但若将该获取利益之活动明确指示为“捐赠”,且在获利者在进行本协议所授权的活动时不以捐赠数额为标准而区别之,则此种的获取利益的“捐赠”行为不属于商业性使用。
## 三、权利授予 ## 三、权利授予
@ -84,7 +84,7 @@
该通知的内容仅供信息提供,不应对许可证进行任何文字上的修改。用户可在其分发的作品中,在不构成修改本协议的前提下,在作品自身的声明通知或属性描述后或作为附录添加。 该通知的内容仅供信息提供,不应对许可证进行任何文字上的修改。用户可在其分发的作品中,在不构成修改本协议的前提下,在作品自身的声明通知或属性描述后或作为附录添加。
6. 依据本款第 3 条,若用户二次分发此作品时,选择向作品的接收者提供收费的担保服务,则必须明确告知该接收者本协议全部内容与此作品原出处,并确保其知悉上述内容;但若用户在二次分发此作品,不选择提供任何服务,则该用户不允许向作品的接收者收取任何费用,除非该用户获得了此作品颁发者的特殊许可、或该用户即为此作品颁发者本人。 6. 依据本款第3条若用户二次分发此作品时选择向作品的接收者提供收费的担保服务则必须明确告知该接收者本协议全部内容与此作品原出处并确保其知悉上述内容但若用户在二次分发此作品,不选择提供任何服务,则该用户不允许向作品的接收者收取任何费用,除非该用户获得了此作品颁发者的特殊许可、或该用户即为此作品颁发者本人。
## 五、提交贡献 ## 五、提交贡献
@ -96,7 +96,7 @@
## 七、免责声明 ## 七、免责声明
1. 若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,**不予提供任何形式的担保、任何明示、任何暗示或类似承诺**,此类包括但不限于担保此作品毫无缺陷、担保此作品适于贩卖、担保此作品适于特定目的、担保使用此作品绝不侵权。用户将自行承担因此作品的质量或性能问题而产生的全部风险。若此作品在任何方面欠妥,将由用户(而非任何贡献者、而非任何颁发者)承担所有必要的服务、维修或除错的任何成本。本免责声明本许可的重要组成部分。当且仅当遵守本免责声明时,本协议的其他条款中对本作品的使用授权方可生效。 1. 若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,**不予提供任何形式的担保、任何明示、任何暗示或类似承诺**,此类包括但不限于担保此作品毫无缺陷、担保此作品适于贩卖、担保此作品适于特定目的、担保使用此作品绝不侵权。用户将自行承担因此作品的质量或性能问题而产生的全部风险。若此作品在任何方面欠妥,将由用户(而非任何贡献者、而非任何颁发者)承担所有必要的服务、维修或除错的任何成本。本免责声明本许可的重要组成部分。当且仅当遵守本免责声明时,本协议的其他条款中对本作品的使用授权方可生效。
2. 无论是因何种原因,如果不是在法律规定的特殊情况(如,确为贡献者的故意或重大过失)下或者经过了特殊准许,即使贡献者事先已知发生损害的可能,在使用本作品时,用户产生的任何直接、间接、特殊、偶然或必然造成的损失(包括但不限于商誉损失、工作延误、计算机系统故障等),**均不由任一贡献者承担**。 2. 无论是因何种原因,如果不是在法律规定的特殊情况(如,确为贡献者的故意或重大过失)下或者经过了特殊准许,即使贡献者事先已知发生损害的可能,在使用本作品时,用户产生的任何直接、间接、特殊、偶然或必然造成的损失(包括但不限于商誉损失、工作延误、计算机系统故障等),**均不由任一贡献者承担**。
@ -118,7 +118,7 @@
版权所有 © 〔年份〕 〔著作权人〕 版权所有 © 〔年份〕 〔著作权人〕
〔或者:版权所有 (C) 〔年份〕 〔著作权人〕〕 〔或者:版权所有 (C) 〔年份〕 〔著作权人〕〕
〔该作品〕根据 第一版 汉钰律许可协议(“本协议”)授权。 〔该作品〕根据 汉钰律许可协议,第一版(“本协议”)授权。
任何人皆可从以下地址获得本协议副本:〔本协议副本所在地址〕。 任何人皆可从以下地址获得本协议副本:〔本协议副本所在地址〕。
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。 若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
详细的准许和限制条款请见原协议文本。 详细的准许和限制条款请见原协议文本。
@ -330,7 +330,7 @@
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
Copyright © 2024 Team-Ryoun 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray") Copyright © 2025 Team-Ryoun 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray")
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -45,6 +45,10 @@
## 致谢 🙏 ## 致谢 🙏
- 感谢由 **𝘼𝙪𝙤 “可白”**\<QQ2425476216\> 带来的 Dockerfile 文件参考;
在此特别授予其利用本软件进行商业使用之权利:
特别声明:依据《汉钰律许可协议,第一版》,准许**可白**\<QQ2425476216\>在中国大陆范围内非专有地对本作品进行商业性使用,包括但不限于:出售本作品之副本、将本作品嵌入云平台后租赁等。
> 感谢广大群友为此软件提供的测试和建议 > 感谢广大群友为此软件提供的测试和建议
## 联系 📞 ## 联系 📞
@ -56,8 +60,8 @@ QQ 群 [861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)
[Bilibili: 金羿ELS]: https://img.shields.io/badge/Bilibili-%E9%87%91%E7%BE%BFELS-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.8-AB70FF?style=for-the-badge
<!-- [release]: https://img.shields.io//TriM-Organization/Linglun-Converter?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 [license]: https://img.shields.io/badge/Licence-%E6%B1%89%E9%92%B0%E5%BE%8B%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE-228B22?style=for-the-badge

View File

@ -101,8 +101,7 @@
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/ pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
# 然后安装(依次执行下面的指令) # 然后安装(依次执行下面的指令)
apt-get install python-numpy apt-get install python-numpy
pip install brotli TrimMCStruct pip install Musicreater[full] TrimLog
pip install Musicreater TrimLog
python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade pip setuptools wheel
``` ```
@ -119,8 +118,7 @@
之后再来安装即可 之后再来安装即可
```bash ```bash
pip install brotli TrimMCStruct pip install Musicreater[full] TrimLog
pip install Musicreater TrimLog
python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade pip setuptools wheel
``` ```
@ -133,7 +131,7 @@
既然已经有了运行环境,那么我们就需要下载一个用来下载我们的**伶伦转换器**的工具,我非常推崇**Git**这种方便快捷好用还能下载仓库的代码管理器,这个世界上你也找不到第二个,所以我们来安装一下: 既然已经有了运行环境,那么我们就需要下载一个用来下载我们的**伶伦转换器**的工具,我非常推崇**Git**这种方便快捷好用还能下载仓库的代码管理器,这个世界上你也找不到第二个,所以我们来安装一下:
```bash ```bash
pkg install git apt install git
``` ```
安装完成后记得测试一下: 安装完成后记得测试一下:

View File

@ -69,9 +69,7 @@
2. 确认完成之后,我们来安装一下依赖库: 2. 确认完成之后,我们来安装一下依赖库:
```bash ```bash
pip install mido -i https://mirrors.aliyun.com/pypi/simple/ pip install Musicreater[full] -i https://mirrors.aliyun.com/pypi/simple/
pip install brotli -i https://mirrors.aliyun.com/pypi/simple/
pip install Musicreater -i https://mirrors.aliyun.com/pypi/simple/
pip install TrimLog -i https://mirrors.aliyun.com/pypi/simple/ pip install TrimLog -i https://mirrors.aliyun.com/pypi/simple/
``` ```

View File

@ -7,26 +7,24 @@
伶伦转换器 命令行 伶伦转换器 命令行
Linglun Converter CLI Linglun Converter CLI
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
伶伦转换器命令行版本本项目的协议颁发者为 金羿 伶伦转换器命令行版本本项目的协议颁发者为 金羿
The Licensor of _Linglun Converter CLI_("this project") is Eilles Wan. The Licensor of _Linglun Converter CLI_("this project") is Eilles Wan.
本项目根据 第一版 汉钰律许可协议本协议授权 本项目根据 汉钰律许可协议第一版本协议授权
任何人皆可从以下地址获得本协议副本https://gitee.com/EillesWan/YulvLicenses 任何人皆可从以下地址获得本协议副本https://gitee.com/EillesWan/YulvLicenses
若非因法律要求或经过了特殊准许此作品在根据本协议原样提供的基础上不予提供任何形式的担保任何明示任何暗示或类似承诺也就是说用户将自行承担因此作品的质量或性能问题而产生的全部风险 若非因法律要求或经过了特殊准许此作品在根据本协议原样提供的基础上不予提供任何形式的担保任何明示任何暗示或类似承诺也就是说用户将自行承担因此作品的质量或性能问题而产生的全部风险
详细的准许和限制条款请见原协议文本 详细的准许和限制条款请见原协议文本
""" """
__version__ = "0.0.8" __version__ = "0.0.9"
import os import os
import random import random
# import sys
import Musicreater import Musicreater
from Musicreater import DEFAULT_PROGRESSBAR_STYLE from Musicreater import DEFAULT_PROGRESSBAR_STYLE
from Musicreater.plugin.addonpack import ( from Musicreater.plugin.addonpack import (
@ -34,15 +32,19 @@ from Musicreater.plugin.addonpack import (
to_addon_pack_in_repeater, to_addon_pack_in_repeater,
to_addon_pack_in_score, to_addon_pack_in_score,
) )
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
from Musicreater.plugin.mcstructfile import ( from Musicreater.plugin.mcstructfile import (
to_mcstructure_file_in_delay, to_mcstructure_file_in_delay,
to_mcstructure_file_in_repeater, to_mcstructure_file_in_repeater,
to_mcstructure_file_in_score, to_mcstructure_file_in_score,
) )
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
from utils.io import logger, int_str, prt, ipt, isin, bool_str, float_str from utils.io import bool_str, float_str, int_str, ipt, isin, logger, prt
from utils.yanlun import yanlun_texts, solar_date from utils.yanlun import solar_date, yanlun_texts
# import sys
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure # from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
@ -204,7 +206,7 @@ def is_in_player(sth: str, in_ok: tuple = (0, 1, 2)):
output_file_format = format_ipt( output_file_format = format_ipt(
"输出文件类型 (mcpack/0|bdx/1|mcstructure/2)", "输出文件类型 (mcpack/0|bdx/1|mcstructure/2)",
is_in_bdx_mcpack, is_in_bdx_mcpack,
"输入内容有误,请重新输入。", "输入内容有误,请重新输入。",
)[1] )[1]
@ -348,6 +350,7 @@ if output_file_format == 0:
cvt_method = to_addon_pack_in_delay cvt_method = to_addon_pack_in_delay
elif player_format == 2: elif player_format == 2:
cvt_method = to_addon_pack_in_repeater cvt_method = to_addon_pack_in_repeater
elif output_file_format == 2: elif output_file_format == 2:
if player_format == 1: if player_format == 1:
cvt_method = to_mcstructure_file_in_score cvt_method = to_mcstructure_file_in_score

View File

@ -7,13 +7,13 @@
伶伦转换器暨模组特用奇巧 伶伦转换器暨模组特用奇巧
Linglun Converter for Special Use with addons Linglun Converter for Special Use with addons
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
伶伦转换器暨模组特用奇巧版本本项目的协议颁发者为 金羿 伶伦转换器暨模组特用奇巧版本本项目的协议颁发者为 金羿
The Licensor of _Linglun Converter for Special Use with addons_("this project") is Eilles Wan. The Licensor of _Linglun Converter for Special Use with addons_("this project") is Eilles Wan.
本项目根据 第一版 汉钰律许可协议本协议授权 本项目根据 汉钰律许可协议第一版本协议授权
任何人皆可从以下地址获得本协议副本https://gitee.com/EillesWan/YulvLicenses 任何人皆可从以下地址获得本协议副本https://gitee.com/EillesWan/YulvLicenses
若非因法律要求或经过了特殊准许此作品在根据本协议原样提供的基础上不予提供任何形式的担保任何明示任何暗示或类似承诺也就是说用户将自行承担因此作品的质量或性能问题而产生的全部风险 若非因法律要求或经过了特殊准许此作品在根据本协议原样提供的基础上不予提供任何形式的担保任何明示任何暗示或类似承诺也就是说用户将自行承担因此作品的质量或性能问题而产生的全部风险
详细的准许和限制条款请见原协议文本 详细的准许和限制条款请见原协议文本

View File

@ -4,13 +4,13 @@
伶伦转换器 WXGUI 伶伦转换器 WXGUI
Linglun Converter WxPython GUI Linglun Converter WxPython GUI
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
伶伦转换器WXGUI版本本项目的协议颁发者为 金羿 伶伦转换器WXGUI版本本项目的协议颁发者为 金羿
The Licensor of _Linglun Converter WxPython GUI_("this project") is Eilles Wan. The Licensor of _Linglun Converter WxPython GUI_("this project") is Eilles Wan.
本项目根据 第一版 汉钰律许可协议本协议授权 本项目根据 汉钰律许可协议第一版本协议授权
任何人皆可从以下地址获得本协议副本https://gitee.com/EillesWan/YulvLicenses 任何人皆可从以下地址获得本协议副本https://gitee.com/EillesWan/YulvLicenses
若非因法律要求或经过了特殊准许此作品在根据本协议原样提供的基础上不予提供任何形式的担保任何明示任何暗示或类似承诺也就是说用户将自行承担因此作品的质量或性能问题而产生的全部风险 若非因法律要求或经过了特殊准许此作品在根据本协议原样提供的基础上不予提供任何形式的担保任何明示任何暗示或类似承诺也就是说用户将自行承担因此作品的质量或性能问题而产生的全部风险
详细的准许和限制条款请见原协议文本 详细的准许和限制条款请见原协议文本
@ -21,7 +21,6 @@ The Licensor of _Linglun Converter WxPython GUI_("this project") is Eilles Wan.
import os import os
import random import random
import sys import sys
import threading import threading
# from types import ModuleType # from types import ModuleType
@ -40,25 +39,28 @@ if sys.argv:
import Musicreater import Musicreater
import Musicreater.experiment as Musicreater_experiment import Musicreater.experiment as Musicreater_experiment
import Musicreater.plugin import Musicreater.plugin
import wx
import wx.propgrid as pg
import wx.xrc
from Musicreater.plugin.addonpack import ( from Musicreater.plugin.addonpack import (
to_addon_pack_in_delay, to_addon_pack_in_delay,
to_addon_pack_in_repeater, to_addon_pack_in_repeater,
to_addon_pack_in_score, to_addon_pack_in_score,
) )
from Musicreater.plugin.websocket import to_websocket_server
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_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.websocket import to_websocket_server
import wx
import wx.xrc
import wx.propgrid as pg
from utils.io import logger, object_constants, log__init__, TrimLog
from utils.yanlun import yanlun_texts, yanlun_fg_colour, yanlun_bg_colour
from utils.authorp import go_author_page from utils.authorp import go_author_page
from utils.io import TrimLog, log__init__, logger, object_constants
from utils.packdata import enpack_llc_pack, load_msct_packed_data, unpack_llc_pack
from utils.update_check import check_update_release from utils.update_check import check_update_release
from utils.packdata import enpack_llc_pack, unpack_llc_pack, load_msct_packed_data
from utils.webview import go_update_tip from utils.webview import go_update_tip
from utils.yanlun import yanlun_bg_colour, yanlun_fg_colour, yanlun_texts
WHITE = (242, 244, 246) # F2F4F6 WHITE = (242, 244, 246) # F2F4F6
# WHITE2 = (248, 252, 255) # WHITE2 = (248, 252, 255)
@ -74,8 +76,8 @@ BLACK = (18, 17, 16) # 121110
__appname__ = "伶伦转换器" __appname__ = "伶伦转换器"
__version__ = "WXGUI 1.2.0.2" __version__ = "WXGUI 1.2.1"
__zhver__ = "WX图形界面 初代次版" __zhver__ = "WX图形界面 初代次版一编"
logger.info("检查更新") logger.info("检查更新")
@ -286,10 +288,14 @@ convert_tables = {
"PITCHED": { "PITCHED": {
"“偷吃”对照表": Musicreater.MM_TOUCH_PITCHED_INSTRUMENT_TABLE, "“偷吃”对照表": Musicreater.MM_TOUCH_PITCHED_INSTRUMENT_TABLE,
"“经典”对照表": Musicreater.MM_CLASSIC_PITCHED_INSTRUMENT_TABLE, "“经典”对照表": Musicreater.MM_CLASSIC_PITCHED_INSTRUMENT_TABLE,
"“断联”对照表": Musicreater.MM_DISLINK_PITCHED_INSTRUMENT_TABLE,
"“NBS”对照表": Musicreater.MM_NBS_PITCHED_INSTRUMENT_TABLE,
}, },
"PERCUSSION": { "PERCUSSION": {
"“偷吃”对照表": Musicreater.MM_TOUCH_PERCUSSION_INSTRUMENT_TABLE, "“偷吃”对照表": Musicreater.MM_TOUCH_PERCUSSION_INSTRUMENT_TABLE,
"“经典”对照表": Musicreater.MM_CLASSIC_PERCUSSION_INSTRUMENT_TABLE, "“经典”对照表": Musicreater.MM_CLASSIC_PERCUSSION_INSTRUMENT_TABLE,
"“断联”对照表": Musicreater.MM_DISLINK_PERCUSSION_INSTRUMENT_TABLE,
"“NBS”对照表": Musicreater.MM_NBS_PERCUSSION_INSTRUMENT_TABLE,
}, },
} }
convert_table_selection = { convert_table_selection = {
@ -745,7 +751,7 @@ class ConvertPagePanel(wx.Panel):
wx.StaticBox(self, wx.ID_ANY, "选择输出格式"), wx.VERTICAL wx.StaticBox(self, wx.ID_ANY, "选择输出格式"), wx.VERTICAL
) )
m_outformatChoice_choice1Choices = ["附加包", "BDX结构"] m_outformatChoice_choice1Choices = ["附加包", "MCSTRUCTURE结构", "BDX结构"]
self.m_outformatChoice_choice1 = wx.Choice( self.m_outformatChoice_choice1 = wx.Choice(
ss_outputFormatChooseSizer.GetStaticBox(), ss_outputFormatChooseSizer.GetStaticBox(),
wx.ID_ANY, wx.ID_ANY,
@ -774,7 +780,7 @@ class ConvertPagePanel(wx.Panel):
m_playerChoice_choice2Choices, m_playerChoice_choice2Choices,
0, 0,
) )
self.m_playerChoice_choice2.SetSelection(2) self.m_playerChoice_choice2.SetSelection(1)
ss_playerChooseSizer.Add(self.m_playerChoice_choice2, 0, wx.ALL | wx.EXPAND, 5) ss_playerChooseSizer.Add(self.m_playerChoice_choice2, 0, wx.ALL | wx.EXPAND, 5)
s_formatChooseSizer.Add(ss_playerChooseSizer, 1, wx.ALL | wx.EXPAND, 5) s_formatChooseSizer.Add(ss_playerChooseSizer, 1, wx.ALL | wx.EXPAND, 5)
@ -1271,17 +1277,30 @@ class ConvertPagePanel(wx.Panel):
def onOutputFormatChosen(self, event): def onOutputFormatChosen(self, event):
# 0: 附加包 # 0: 附加包
# 1: BDX # 1: MCSTRUCTURE
# 2: BDX
# prt("选择中:",self.m_outformatChoice_choice1.GetSelection()) # prt("选择中:",self.m_outformatChoice_choice1.GetSelection())
if self.m_outformatChoice_choice1.GetSelection() == 0: if self.m_outformatChoice_choice1.GetSelection() == 0:
self.m_EnteringBDXfileSignName_textCtrl12.Enable(False) self.m_EnteringBDXfileSignName_textCtrl12.Enable(False)
if self.m_playerChoice_choice2.GetSelection() == 0: if self.m_playerChoice_choice2.GetSelection() == 0:
self.m_StructureHeight_slider7.Enable(False) self.m_StructureHeight_slider7.Enable(False)
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False) self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
else: else:
self.m_StructureHeight_slider7.Enable(True) self.m_StructureHeight_slider7.Enable(True)
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True) self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
elif self.m_outformatChoice_choice1.GetSelection() == 1:
if self.m_outformatChoice_choice1.GetSelection() == 1:
self.m_EnteringBDXfileSignName_textCtrl12.Enable(False)
if self.m_playerChoice_choice2.GetSelection() == 2:
self.m_StructureHeight_slider7.Enable(False)
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
else:
self.m_StructureHeight_slider7.Enable(True)
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
elif self.m_outformatChoice_choice1.GetSelection() == 2:
self.m_EnteringBDXfileSignName_textCtrl12.Enable(True) self.m_EnteringBDXfileSignName_textCtrl12.Enable(True)
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True) self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
self.m_StructureHeight_slider7.Enable(True) self.m_StructureHeight_slider7.Enable(True)
@ -1290,19 +1309,26 @@ class ConvertPagePanel(wx.Panel):
# 0 计分板 1 延时 2中继器 # 0 计分板 1 延时 2中继器
if self.m_playerChoice_choice2.GetSelection() == 0: if self.m_playerChoice_choice2.GetSelection() == 0:
self.m_PlayerSelectorEntering_comboBox1.Enable(False) self.m_PlayerSelectorEntering_comboBox1.Enable(False)
self.m_StructureHeight_slider7.Enable(False)
if self.m_outformatChoice_choice1.GetSelection() == 0: if self.m_outformatChoice_choice1.GetSelection() == 0:
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False) self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
elif self.m_outformatChoice_choice1.GetSelection() == 1: self.m_StructureHeight_slider7.Enable(False)
else:
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True) self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
self.m_StructureHeight_slider7.Enable(True)
self.m_ScoreboardNameEntering_textCtrl9.Enable(True) self.m_ScoreboardNameEntering_textCtrl9.Enable(True)
self.m_IsAutoResetScoreboard_checkBox2.Enable(True) self.m_IsAutoResetScoreboard_checkBox2.Enable(True)
else: else:
self.m_PlayerSelectorEntering_comboBox1.Enable(True) self.m_PlayerSelectorEntering_comboBox1.Enable(True)
self.m_StructureHeight_slider7.Enable(True)
if (self.m_outformatChoice_choice1.GetSelection() == 1) and (
self.m_playerChoice_choice2.GetSelection() == 2
):
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
self.m_StructureHeight_slider7.Enable(False)
else:
self.m_StructureHeight_slider7.Enable(True)
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True) self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
self.m_ScoreboardNameEntering_textCtrl9.Enable(False) self.m_ScoreboardNameEntering_textCtrl9.Enable(False)
@ -1420,7 +1446,8 @@ class ConvertPagePanel(wx.Panel):
) )
# 0: 附加包 # 0: 附加包
# 1: BDX # 1: mcstructure
# 2: BDX
# 0 计分板 1 延时 2中继器 # 0 计分板 1 延时 2中继器
if self.m_outformatChoice_choice1.GetSelection() == 0: if self.m_outformatChoice_choice1.GetSelection() == 0:
@ -1463,6 +1490,50 @@ class ConvertPagePanel(wx.Panel):
wx.YES_DEFAULT | wx.ICON_INFORMATION, wx.YES_DEFAULT | wx.ICON_INFORMATION,
).ShowModal() ).ShowModal()
elif self.m_outformatChoice_choice1.GetSelection() == 1: elif self.m_outformatChoice_choice1.GetSelection() == 1:
if self.m_playerChoice_choice2.GetSelection() == 0:
size, total_delay, cmd_num = to_mcstructure_file_in_score(
midi_cvt=mid_cvt,
dist_path=cvt_dist,
scoreboard_name=self.m_ScoreboardNameEntering_textCtrl9.GetValue(),
auto_reset=self.m_IsAutoResetScoreboard_checkBox2.GetValue(),
max_height=self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(),
)
elif self.m_playerChoice_choice2.GetSelection() == 1:
size, total_delay = to_mcstructure_file_in_delay(
midi_cvt=mid_cvt,
dist_path=cvt_dist,
player=self.m_PlayerSelectorEntering_comboBox1.GetValue(),
max_height=self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(),
)
elif self.m_playerChoice_choice2.GetSelection() == 2:
size, total_delay = to_mcstructure_file_in_repeater(
midi_cvt=mid_cvt,
dist_path=cvt_dist,
player=self.m_PlayerSelectorEntering_comboBox1.GetValue(),
)
else:
wx.MessageDialog(
None,
"你输入的播放器有误!",
"错误",
wx.YES_DEFAULT | wx.ICON_ERROR,
).ShowModal()
return
wx.MessageDialog(
None,
"完成!\n结构大小:{}\n延迟总长:{}{}".format(
size,
total_delay,
(
"\n指令数量:{}".format(cmd_num)
if self.m_playerChoice_choice2.GetSelection() == 0
else ""
),
),
"转换成功",
wx.YES_DEFAULT | wx.ICON_INFORMATION,
).ShowModal()
elif self.m_outformatChoice_choice1.GetSelection() == 2:
if self.m_playerChoice_choice2.GetSelection() == 0: if self.m_playerChoice_choice2.GetSelection() == 0:
cmd_num, total_delay, size, final_pos = to_BDX_file_in_score( cmd_num, total_delay, size, final_pos = to_BDX_file_in_score(
midi_cvt=mid_cvt, midi_cvt=mid_cvt,
@ -2034,7 +2105,7 @@ class SettingPagePannel(wx.Panel):
) )
if "自定义对照表" not in self.m_pitched_instrument_table_choice.Items: if "自定义对照表" not in self.m_pitched_instrument_table_choice.Items:
self.m_pitched_instrument_table_choice.Append("自定义对照表") self.m_pitched_instrument_table_choice.Append("自定义对照表")
self.m_pitched_instrument_table_choice.SetSelection(2) self.m_pitched_instrument_table_choice.SetSelection(4)
def onPitchedInstTableChanging(self, event): def onPitchedInstTableChanging(self, event):
event.Skip() event.Skip()
@ -2083,7 +2154,7 @@ class SettingPagePannel(wx.Panel):
) )
if "自定义对照表" not in self.m_percussion_instrument_table_choice1.Items: if "自定义对照表" not in self.m_percussion_instrument_table_choice1.Items:
self.m_percussion_instrument_table_choice1.Append("自定义对照表") self.m_percussion_instrument_table_choice1.Append("自定义对照表")
self.m_percussion_instrument_table_choice1.SetSelection(2) self.m_percussion_instrument_table_choice1.SetSelection(4)
def onPercussionInstTableChanging(self, event): def onPercussionInstTableChanging(self, event):
event.Skip() event.Skip()

View File

@ -1,10 +1,7 @@
Musicreater>=2.1.0.1 Musicreater[full]>=2.1.0.1
TrimLog>=0.8.3 TrimLog>=0.8.3
requests>=2.0.0 requests>=2.0.0
TrimMCStruct>=1.0.0
rich
wxPython wxPython
dill dill
brotli # fcwslib=3.0.1
fcwslib=3.0.1 zhDateTime>=2.0.0
zhDateTime>=1.0.3

View File

@ -4,8 +4,8 @@
伶伦转换器 作者信息组件 伶伦转换器 作者信息组件
Linglun Converter Author Page Component Linglun Converter Author Page Component
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
开源相关声明请见 仓库根目录下的 License.md 开源相关声明请见 仓库根目录下的 License.md
Terms & Conditions: License.md in the root directory Terms & Conditions: License.md in the root directory
@ -13,9 +13,8 @@ Terms & Conditions: License.md in the root directory
import wx import wx
import wx.xrc
import wx.media import wx.media
import wx.xrc
########################################################################### ###########################################################################
## Class LingLunAuthorPageFrame ## Class LingLunAuthorPageFrame

View File

@ -4,8 +4,8 @@
伶伦转换器 命令行组件 伶伦转换器 命令行组件
Linglun Converter Command Line IO Component Linglun Converter Command Line IO Component
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
开源相关声明请见 仓库根目录下的 License.md 开源相关声明请见 仓库根目录下的 License.md
Terms & Conditions: License.md in the root directory Terms & Conditions: License.md in the root directory
@ -16,20 +16,19 @@ from typing import (
Any, Any,
Callable, Callable,
Dict, Dict,
Iterable,
List, List,
Literal, Literal,
Optional, Optional,
Sequence,
Set, Set,
TextIO, TextIO,
Tuple, Tuple,
Iterable,
Sequence,
Union, Union,
) )
import TrimLog import TrimLog
from TrimLog import object_constants, logger, log__init__ from TrimLog import log__init__, logger, object_constants
logger.is_logging = True logger.is_logging = True
logger.suffix = ".llc" logger.suffix = ".llc"

View File

@ -4,15 +4,15 @@
伶伦转换器 本地化组件 伶伦转换器 本地化组件
Linglun Converter Language Localization Component Linglun Converter Language Localization Component
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
开源相关声明请见 仓库根目录下的 License.md 开源相关声明请见 仓库根目录下的 License.md
Terms & Conditions: License.md in the root directory Terms & Conditions: License.md in the root directory
""" """
from .io import logger, Any from .io import Any, logger
def _() -> str: def _() -> str:

View File

@ -4,8 +4,8 @@
伶伦转换器 打包存档组件 伶伦转换器 打包存档组件
Linglun Converter Data Package Component Linglun Converter Data Package Component
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
开源相关声明请见 仓库根目录下的 License.md 开源相关声明请见 仓库根目录下的 License.md
Terms & Conditions: License.md in the root directory Terms & Conditions: License.md in the root directory
@ -14,11 +14,11 @@ Terms & Conditions: License.md in the root directory
import hashlib import hashlib
import dill
import brotli import brotli
import dill
from .salt import salt
from .io import Any from .io import Any
from .salt import salt
def unpack_llc_pack(from_dist: str, raise_error: bool = True): def unpack_llc_pack(from_dist: str, raise_error: bool = True):
@ -27,7 +27,12 @@ def unpack_llc_pack(from_dist: str, raise_error: bool = True):
if (md5_value == hashlib.md5(packed_bytes).digest()) and ( if (md5_value == hashlib.md5(packed_bytes).digest()) and (
salty_sha256_value salty_sha256_value
== hashlib.pbkdf2_hmac("sha256", md5_value + packed_bytes, salt, 16) == hashlib.pbkdf2_hmac(
"sha256",
md5_value + packed_bytes,
salt(hashlib.sha256(brotli.__version__)),
16,
)
): ):
return dill.loads( return dill.loads(
brotli.decompress(packed_bytes), brotli.decompress(packed_bytes),
@ -49,7 +54,10 @@ def enpack_llc_pack(sth: Any, to_dist: str):
md5_value = hashlib.md5(packing_bytes).digest() # 长度 16 md5_value = hashlib.md5(packing_bytes).digest() # 长度 16
salty_sha256_value = hashlib.pbkdf2_hmac( salty_sha256_value = hashlib.pbkdf2_hmac(
"sha256", md5_value + packing_bytes, salt, 16 "sha256",
md5_value + packing_bytes,
salt(hashlib.md5(salt(salt(brotli.__version__)))),
16,
) # 长度 32 ) # 长度 32
with open( with open(

View File

@ -4,8 +4,8 @@
伶伦转换器 版本检查组件 伶伦转换器 版本检查组件
Linglun Converter Version Checking Component Linglun Converter Version Checking Component
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
开源相关声明请见 仓库根目录下的 License.md 开源相关声明请见 仓库根目录下的 License.md
Terms & Conditions: License.md in the root directory Terms & Conditions: License.md in the root directory
@ -13,7 +13,7 @@ Terms & Conditions: License.md in the root directory
import requests import requests
from .io import TrimLog, Sequence, Iterable, Callable, Optional, Dict, Union from .io import Callable, Dict, Iterable, Optional, Sequence, TrimLog, Union
def is_ver_char(text: str) -> bool: def is_ver_char(text: str) -> bool:

View File

@ -4,8 +4,8 @@
伶伦转换器 HTML页组件 伶伦转换器 HTML页组件
Linglun Converter HTML Component Linglun Converter HTML Component
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
开源相关声明请见 仓库根目录下的 License.md 开源相关声明请见 仓库根目录下的 License.md
Terms & Conditions: License.md in the root directory Terms & Conditions: License.md in the root directory

View File

@ -4,8 +4,8 @@
伶伦转换器 言论版组件 伶伦转换器 言论版组件
Linglun Converter Yan Lun Component Linglun Converter Yan Lun Component
版权所有 © 2024 金羿 版权所有 © 2025 金羿
Copyright © 2024 EillesWan Copyright © 2025 EillesWan
开源相关声明请见 仓库根目录下的 License.md 开源相关声明请见 仓库根目录下的 License.md
Terms & Conditions: License.md in the root directory Terms & Conditions: License.md in the root directory
@ -25,9 +25,12 @@ yanlun_bg_colour = STANDART_BLACK
logger.info("获取 言·论 信息……") logger.info("获取 言·论 信息……")
solar_datetime = zhDateTime.DateTime.now() solar_datetime = zhDateTime.DateTime.now()
lunar_datetime = solar_datetime.to_lunar() lunar_datetime = solar_datetime.to_chinese_format()
solar_date = (solar_datetime.month, solar_datetime.day) solar_date = (solar_datetime.month, solar_datetime.day)
lunar_date = (lunar_datetime.lunar_month, lunar_datetime.lunar_day) lunar_date = (
lunar_datetime.chinese_calendar_month,
lunar_datetime.chinese_calendar_day,
)
if solar_date == (4, 3): if solar_date == (4, 3):
yanlun_texts = ["金羿ELS 生日快乐~", "Happy Birthday, Eilles!"] yanlun_texts = ["金羿ELS 生日快乐~", "Happy Birthday, Eilles!"]