diff --git a/llc_clgui.py b/llc_clgui.py new file mode 100644 index 0000000..c52bb87 --- /dev/null +++ b/llc_clgui.py @@ -0,0 +1,302 @@ +# -*- 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") diff --git a/llc_win_wxPython.py b/llc_win_wxPython.py index 54f13fb..2969f18 100644 --- a/llc_win_wxPython.py +++ b/llc_win_wxPython.py @@ -8,16 +8,23 @@ import sys import urllib.error import urllib.request + 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 + import TrimLog import wx -from Musicreater.plugin import ConvertConfig -from Musicreater.plugin.bdxfile import (to_BDX_file_in_delay, - to_BDX_file_in_score) -from Musicreater.plugin.funcpack import to_function_addon_in_score -from Musicreater.plugin.mcstructpack import to_mcstructure_addon_in_delay from TrimLog import Console, object_constants +from utils.io import prt + is_logging: bool = True osc = object_constants.ObjectStateConstant() @@ -27,16 +34,16 @@ logger = TrimLog.Logger( in_suffix=".llc", ) -WHITE = (242, 244, 246) # F2F4F6 -BLACK = (18, 17, 16) # 121110 +WHITE = (242, 244, 246) # F2F4F6 +BLACK = (18, 17, 16) # 121110 try: myWords = ( urllib.request.urlopen( - 'https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt' + "https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt" ) .read() - .decode('utf-8') + .decode("utf-8") .strip("\n") .split("\n") ) @@ -48,232 +55,1071 @@ except BaseException as E: logger.warning(f"读取言·论信息发生 未知 错误:\n{E}") myWords = ["灵光焕发 深艺献心"] - +__appname__ = "伶伦转换器" +__version__ = "WXGUI 0.0.1" # 创建应用程序类 class LinglunConverterApp(wx.App): def OnInit(self): # 创建主窗口 - self.frame = LinglunConverterFrame(None, title="伶伦转换器") + self.SetAppName(__appname__) + self.frame = LingLunMainFrame( + None, + ) self.SetTopWindow(self.frame) self.frame.Show() return True -# 创建主窗口类 -class LinglunConverterFrame(wx.Frame): - def __init__(self, *args, **kwargs): - super(LinglunConverterFrame, self).__init__(*args, **kwargs) - - # 设置窗口属性 - self.SetSize((500, 300)) - self.Center() - - self.panel = wx.Panel(self) - self.main_sizer = wx.BoxSizer(wx.VERTICAL) - - self.yanlun_sizer = wx.BoxSizer(wx.HORIZONTAL) - - - now_word = random.choice(myWords).split("\t——") - self.yanlun_label_a = wx.StaticText(self.panel, label=now_word[0],style=wx.ALIGN_LEFT) - self.yanlun_label_a.SetForegroundColour(WHITE) - self.yanlun_label_a.SetBackgroundColour(BLACK) - self.yanlun_sizer.Add(self.yanlun_label_a, flag=wx.ALIGN_TOP) - - if len(now_word) > 1: - self.yanlun_label_b = wx.StaticText(self.panel, label=now_word[1],style=wx.ALIGN_RIGHT) - self.yanlun_label_b.SetForegroundColour(WHITE) - self.yanlun_label_b.SetBackgroundColour(BLACK) - self.yanlun_sizer.Add(self.yanlun_label_b, flag=wx.ALIGN_TOP) - - - self.main_sizer.Add(self.yanlun_sizer, flag=wx.EXPAND) - - - # 文件选择控件 - self.file_picker = wx.FilePickerCtrl( - self.panel, - message="选择MIDI文件", - wildcard="MIDI files (*.mid;*.midi)|*.mid;*.midi", - style=wx.FLP_USE_TEXTCTRL, +class LingLunMainFrame(wx.Frame): + def __init__(self, parent): + wx.Frame.__init__( + self, + parent, + id=wx.ID_ANY, + title="{} {}".format(__appname__, __version__), + pos=wx.DefaultPosition, + size=wx.Size(651, 759), + style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL, ) - self.main_sizer.Add(self.file_picker, flag=wx.EXPAND) - # 输出结果类型下拉选择控件 - self.output_type_dropdown = wx.Choice( - self.panel, choices=["MCPACK", "BDX", "MCSTRUCTURE"] + 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.main_sizer.Add(wx.StaticText(self.panel, label="输出结果类型:")) - self.main_sizer.Add(self.output_type_dropdown, flag=wx.EXPAND) + self.SetForegroundColour(BLACK) + self.SetBackgroundColour(WHITE) - # 播放器类型下拉选择控件 - self.player_type_dropdown = wx.Choice(self.panel, choices=["计分板", "延迟"]) - self.main_sizer.Add(wx.StaticText(self.panel, label="播放器类型:")) - self.main_sizer.Add(self.player_type_dropdown, flag=wx.EXPAND) - - # 音量大小滑动条与数字输入框 - self.volume_slider = wx.Slider( - self.panel, value=100, minValue=1, maxValue=100, style=wx.SL_HORIZONTAL + self.m_statusBar2 = self.CreateStatusBar(1, wx.STB_SIZEGRIP, wx.ID_ANY) + self.m_menubar1 = wx.MenuBar(0) + self.FileMenu = wx.Menu() + self.m_Exit_menuItem1 = wx.MenuItem( + self.FileMenu, wx.ID_ANY, "退出", "这是退出按钮", wx.ITEM_NORMAL ) - self.volume_text = wx.TextCtrl(self.panel, value="1.0") - self.main_sizer.Add(wx.StaticText(self.panel, label="音量大小:")) - self.main_sizer.Add(self.volume_slider, flag=wx.EXPAND) - self.main_sizer.Add(self.volume_text, flag=wx.EXPAND) + self.FileMenu.Append(self.m_Exit_menuItem1) - # 速度倍率滑动条与数字输入框 - self.speed_slider = wx.Slider( - self.panel, value=100, minValue=1, maxValue=100, style=wx.SL_HORIZONTAL + self.m_menubar1.Append(self.FileMenu, "文件") + + self.SetMenuBar(self.m_menubar1) + + m_mainBoxSizer = wx.BoxSizer(wx.VERTICAL) + + s_yanLunbarSizer = wx.StaticBoxSizer( + wx.StaticBox(self, wx.ID_ANY, "言·论"), wx.VERTICAL ) - self.speed_text = wx.TextCtrl(self.panel, value="1.0") - self.main_sizer.Add(wx.StaticText(self.panel, label="速度倍率:")) - self.main_sizer.Add(self.speed_slider, flag=wx.EXPAND) - self.main_sizer.Add(self.speed_text, flag=wx.EXPAND) - # 自动生成进度条勾选框 - self.progressbar_checkbox = wx.CheckBox(self.panel, label="是否自动生成进度条") - self.main_sizer.Add(self.progressbar_checkbox, flag=wx.EXPAND) - - # 进度条相关控件 - self.whole_style_text = wx.TextCtrl( - self.panel, value=" %%N [ %%s/%^s %%% __________ %%t|%^t]" + self.m_LinglunWords_staticText1 = wx.StaticText( + s_yanLunbarSizer.GetStaticBox(), + wx.ID_ANY, + random.choice(myWords) + "\r", + wx.DefaultPosition, + wx.DefaultSize, + wx.ALIGN_CENTER_HORIZONTAL | wx.ST_ELLIPSIZE_MIDDLE | wx.ST_NO_AUTORESIZE, ) - self.non_played_text = wx.TextCtrl(self.panel, value="§7=§r") - self.has_played_text = wx.TextCtrl(self.panel, value="§e=§r") - self.main_sizer.Add(wx.StaticText(self.panel, label="整体样式:")) - self.main_sizer.Add(self.whole_style_text, flag=wx.EXPAND) - self.main_sizer.Add(wx.StaticText(self.panel, label="动条(未播放):")) - self.main_sizer.Add(self.non_played_text, flag=wx.EXPAND) - self.main_sizer.Add(wx.StaticText(self.panel, label="动条(已播放):")) - self.main_sizer.Add(self.has_played_text, flag=wx.EXPAND) + self.m_LinglunWords_staticText1.Wrap(-1) - # 计分板相关控件 - self.scoreboard_name_text = wx.TextCtrl(self.panel, value="mscply") - self.auto_reset_checkbox = wx.CheckBox(self.panel, label="是否结束后重置计分板") - - # 延迟相关控件 - self.selecter_text = wx.TextCtrl(self.panel, value="@a") - self.max_struct_height_slider = wx.Slider( - self.panel, value=63, minValue=4, maxValue=256, style=wx.SL_HORIZONTAL + self.m_LinglunWords_staticText1.SetFont( + wx.Font( + 12, + wx.FONTFAMILY_DEFAULT, + wx.FONTSTYLE_NORMAL, + wx.FONTWEIGHT_NORMAL, + False, + "OPPOSans B", + ) ) - self.max_struct_height_text = wx.TextCtrl(self.panel, value="63") - - # BDX相关控件 - self.author_name_text = wx.TextCtrl(self.panel, value="Unfamous") - - # 导出结果按钮 - self.export_button = wx.Button(self.panel, label="导出结果") - - # 添加控件到主sizer中 - self.main_sizer.Add(self.scoreboard_name_text, flag=wx.EXPAND) - self.main_sizer.Add(self.auto_reset_checkbox, flag=wx.EXPAND) - self.main_sizer.Add(self.selecter_text, flag=wx.EXPAND) - self.main_sizer.Add(self.max_struct_height_slider, flag=wx.EXPAND) - self.main_sizer.Add(self.max_struct_height_text, flag=wx.EXPAND) - self.main_sizer.Add(self.author_name_text, flag=wx.EXPAND) - self.main_sizer.Add(self.export_button, flag=wx.EXPAND) - - self.panel.SetSizer(self.main_sizer) - self.panel.Layout() - - # 绑定事件处理程序 - self.file_picker.Bind(wx.EVT_FILEPICKER_CHANGED, self.on_file_selected) - self.output_type_dropdown.Bind(wx.EVT_CHOICE, self.on_output_type_selected) - self.player_type_dropdown.Bind(wx.EVT_CHOICE, self.on_player_type_selected) - self.volume_slider.Bind(wx.EVT_SCROLL_CHANGED, self.on_volume_slider_changed) - self.speed_slider.Bind(wx.EVT_SCROLL_CHANGED, self.on_speed_slider_changed) - self.progressbar_checkbox.Bind( - wx.EVT_CHECKBOX, self.on_progressbar_checkbox_changed + self.m_LinglunWords_staticText1.SetForegroundColour( + wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT) ) - self.max_struct_height_slider.Bind( - wx.EVT_SCROLL_CHANGED, self.on_max_struct_height_slider_changed + self.m_LinglunWords_staticText1.SetBackgroundColour( + wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT) ) - self.export_button.Bind(wx.EVT_BUTTON, self.on_export_button_clicked) - self.HideUnnecessaryControls() + s_yanLunbarSizer.Add(self.m_LinglunWords_staticText1, 0, wx.EXPAND, 5) + + m_mainBoxSizer.Add( + s_yanLunbarSizer, + 1, + wx.ALL | wx.EXPAND | wx.RESERVE_SPACE_EVEN_IF_HIDDEN | wx.TOP, + 2, + ) + + s_midiChooseSizer = wx.BoxSizer(wx.HORIZONTAL) + + self.m_ChooseMidiTips_staticText3 = wx.StaticText( + self, wx.ID_ANY, "选择MIDI文件", wx.DefaultPosition, wx.DefaultSize, 0 + ) + self.m_ChooseMidiTips_staticText3.Wrap(-1) + + s_midiChooseSizer.Add(self.m_ChooseMidiTips_staticText3, 0, wx.ALL, 5) + + ss_MidiChooserSizer_bSizer9 = wx.BoxSizer(wx.VERTICAL) + + self.m_ChooseMIDI_filePicker1 = wx.FilePickerCtrl( + self, + wx.ID_ANY, + "./", + "选择MIDI文件", + "MIDI 序列 (*.mid;*.midi)|*.mid;*.midi", + wx.DefaultPosition, + wx.DefaultSize, + wx.FLP_DEFAULT_STYLE + | wx.FLP_FILE_MUST_EXIST + | wx.FLP_OPEN + | wx.FLP_USE_TEXTCTRL, + ) + ss_MidiChooserSizer_bSizer9.Add( + self.m_ChooseMIDI_filePicker1, 0, wx.ALL | wx.EXPAND, 5 + ) + + s_midiChooseSizer.Add(ss_MidiChooserSizer_bSizer9, 1, wx.EXPAND, 5) + + m_mainBoxSizer.Add(s_midiChooseSizer, 1, wx.EXPAND, 5) + + s_formatChooseSizer = wx.BoxSizer(wx.HORIZONTAL) + + ss_outputFormatChooseSizer = wx.StaticBoxSizer( + wx.StaticBox(self, wx.ID_ANY, "选择输出格式"), wx.VERTICAL + ) + + m_outformatChoice_choice1Choices = ["附加包", "BDX结构"] + self.m_outformatChoice_choice1 = wx.Choice( + ss_outputFormatChooseSizer.GetStaticBox(), + wx.ID_ANY, + wx.DefaultPosition, + wx.DefaultSize, + m_outformatChoice_choice1Choices, + ) + 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, "选择播放器"), wx.VERTICAL + ) + + m_playerChoice_choice2Choices = ["计分板", "延时", "中继器"] + self.m_playerChoice_choice2 = wx.Choice( + ss_playerChooseSizer.GetStaticBox(), + wx.ID_ANY, + wx.DefaultPosition, + wx.DefaultSize, + m_playerChoice_choice2Choices, + 0, + ) + self.m_playerChoice_choice2.SetSelection(0) + ss_playerChooseSizer.Add(self.m_playerChoice_choice2, 0, wx.ALL | wx.EXPAND, 5) + + s_formatChooseSizer.Add(ss_playerChooseSizer, 1, wx.ALL | wx.EXPAND, 5) + + m_mainBoxSizer.Add(s_formatChooseSizer, 1, wx.EXPAND, 5) + + s_promptSizer = wx.StaticBoxSizer( + wx.StaticBox(self, wx.ID_ANY, "转换参数"), wx.VERTICAL + ) + + ss_regularPromoptsEnteringSizer1 = wx.BoxSizer(wx.HORIZONTAL) + + sss_VolumnPersentageEnteringSizer = wx.StaticBoxSizer( + wx.StaticBox(s_promptSizer.GetStaticBox(), wx.ID_ANY, "音量大小"), 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, + "100", + wx.DefaultPosition, + wx.DefaultSize, + wx.ALIGN_CENTER_HORIZONTAL | wx.SP_ARROW_KEYS | wx.TE_PROCESS_ENTER, + 0, + 100, + 100.000000, + 0.5, + ) + self.m_volumn_spinCtrlDouble1.SetDigits(2) + sss_VolumnPersentageEnteringSizer.Add( + self.m_volumn_spinCtrlDouble1, 0, wx.ALL, 5 + ) + + ss_regularPromoptsEnteringSizer1.Add( + sss_VolumnPersentageEnteringSizer, 1, wx.ALL | wx.EXPAND, 5 + ) + + sss_SpeedEnteringSizer = wx.StaticBoxSizer( + wx.StaticBox(s_promptSizer.GetStaticBox(), wx.ID_ANY, "播放倍速"), 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, + "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, 1, wx.ALL | wx.EXPAND, 5 + ) + + self.m_oldExeFormatChecker_checkBox3 = wx.CheckBox( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "启用\n旧版\n执行\n指令\n格式", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + ss_regularPromoptsEnteringSizer1.Add( + self.m_oldExeFormatChecker_checkBox3, 0, wx.SHAPED, 0 + ) + s_promptSizer.Add(ss_regularPromoptsEnteringSizer1, 1, wx.EXPAND | wx.SHAPED, 5) + + ss_progressbarCheckingSizer = wx.StaticBoxSizer( + wx.StaticBox(s_promptSizer.GetStaticBox(), wx.ID_ANY, "进度条"), wx.HORIZONTAL + ) + + self.m_progressBarEnablingCheckBox1 = wx.CheckBox( + ss_progressbarCheckingSizer.GetStaticBox(), + wx.ID_ANY, + "启用进度条", + wx.DefaultPosition, + wx.DefaultSize, + wx.ALIGN_RIGHT, + ) + self.m_progressBarEnablingCheckBox1.SetValue(True) + ss_progressbarCheckingSizer.Add( + self.m_progressBarEnablingCheckBox1, 0, wx.ALL, 5 + ) + + sss_customProgressBarSizer_wSizer6 = wx.WrapSizer( + wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS + ) + + ssss_basicProgressStylePattle_sbSizer9 = wx.StaticBoxSizer( + wx.StaticBox( + ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, "基本样式组" + ), + wx.VERTICAL, + ) + + self.m_BasicProgressBarStyleEntering_textCtrl4 = wx.TextCtrl( + ssss_basicProgressStylePattle_sbSizer9.GetStaticBox(), + wx.ID_ANY, + r"▶ %%N [ %%s/%^s %%% __________ %%t|%^t ]", + wx.DefaultPosition, + wx.DefaultSize, + wx.TE_LEFT | wx.TE_NO_VSCROLL | wx.TE_RICH, + ) + ssss_basicProgressStylePattle_sbSizer9.Add( + self.m_BasicProgressBarStyleEntering_textCtrl4, 0, wx.ALL | wx.EXPAND, 5 + ) + + sss_customProgressBarSizer_wSizer6.Add( + ssss_basicProgressStylePattle_sbSizer9, 1, wx.EXPAND, 5 + ) + + ssss_UnplayedPartProgressbarPattle_sbSizer10 = wx.StaticBoxSizer( + wx.StaticBox( + ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, "未播放之样式" + ), + wx.VERTICAL, + ) + + self.m_unplayedProgressbarStyleEntering_textCtrl5 = wx.TextCtrl( + ssss_UnplayedPartProgressbarPattle_sbSizer10.GetStaticBox(), + wx.ID_ANY, + "§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 + ) + + sss_customProgressBarSizer_wSizer6.Add( + ssss_UnplayedPartProgressbarPattle_sbSizer10, 1, wx.EXPAND, 5 + ) + + ssss_PlayedPartProgressbarPattle_sbSizer11 = wx.StaticBoxSizer( + wx.StaticBox( + ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, "已播放之样式" + ), + wx.VERTICAL, + ) + + self.m_playedProgressbarStyleEntering_textCtrl5 = wx.TextCtrl( + ssss_PlayedPartProgressbarPattle_sbSizer11.GetStaticBox(), + wx.ID_ANY, + "§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 + ) + + sss_customProgressBarSizer_wSizer6.Add( + ssss_PlayedPartProgressbarPattle_sbSizer11, 1, wx.EXPAND, 5 + ) + + ss_progressbarCheckingSizer.Add( + sss_customProgressBarSizer_wSizer6, 1, wx.EXPAND, 5 + ) + + s_promptSizer.Add(ss_progressbarCheckingSizer, 1, wx.EXPAND, 5) + + self.ss_HideAndSeekSizer_bSizer15 = wx.BoxSizer(wx.VERTICAL) + + self.sss_ScoreboardPlayerPromptsSizer_bSizer7 = wx.BoxSizer(wx.HORIZONTAL) + + self.m_EnterScoreboardNameTip_staticText4 = wx.StaticText( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "播放计分板名称", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + self.m_EnterScoreboardNameTip_staticText4.Wrap(-1) + + self.sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( + self.m_EnterScoreboardNameTip_staticText4, 0, wx.ALL, 5 + ) + + self.m_ScoreboardNameEntering_textCtrl9 = wx.TextCtrl( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "mscplay", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + self.m_ScoreboardNameEntering_textCtrl9.SetMaxLength(10) + self.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)) + + self.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, + "自动重置计分板", + wx.DefaultPosition, + wx.DefaultSize, + wx.ALIGN_RIGHT, + ) + self.sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( + self.m_IsAutoResetScoreboard_checkBox2, 0, wx.ALL, 5 + ) + + self.ss_HideAndSeekSizer_bSizer15.Add( + self.sss_ScoreboardPlayerPromptsSizer_bSizer7, 1, wx.SHAPED, 5 + ) + + self.sss_StructurePlayerPromptsSizer_bSizer8 = wx.BoxSizer(wx.HORIZONTAL) + + self.m_PlayerSelectorEnteringTips_staticText41 = wx.StaticText( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "玩家选择器", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + self.m_PlayerSelectorEnteringTips_staticText41.Wrap(-1) + + self.sss_StructurePlayerPromptsSizer_bSizer8.Add( + self.m_PlayerSelectorEnteringTips_staticText41, 0, wx.ALL, 5 + ) + + m_PlayerSelectorEntering_comboBox1Choices = ["@a", "@p", "@e[type=player]"] + self.m_PlayerSelectorEntering_comboBox1 = wx.ComboBox( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "@a", + wx.DefaultPosition, + wx.DefaultSize, + m_PlayerSelectorEntering_comboBox1Choices, + wx.CB_DROPDOWN | wx.TE_PROCESS_ENTER, + ) + self.m_PlayerSelectorEntering_comboBox1.SetSelection(0) + self.sss_StructurePlayerPromptsSizer_bSizer8.Add( + self.m_PlayerSelectorEntering_comboBox1, 0, wx.ALL, 5 + ) + + self.m_staticline2 = wx.StaticLine( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + wx.DefaultPosition, + wx.DefaultSize, + wx.LI_HORIZONTAL, + ) + self.m_staticline2.SetMinSize(wx.Size(2, -1)) + + self.sss_StructurePlayerPromptsSizer_bSizer8.Add( + self.m_staticline2, 0, wx.ALL | wx.EXPAND, 5 + ) + + self.StructureMaxHeoghtTips_ = wx.StaticText( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "结构生成最大高度", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + self.StructureMaxHeoghtTips_.Wrap(-1) + + self.sss_StructurePlayerPromptsSizer_bSizer8.Add( + self.StructureMaxHeoghtTips_, 0, wx.ALL, 5 + ) + + self.m_StructureHeight_slider7 = wx.Slider( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + 50, + 3, + 1024, + wx.DefaultPosition, + wx.DefaultSize, + wx.SL_HORIZONTAL, + ) + self.sss_StructurePlayerPromptsSizer_bSizer8.Add( + self.m_StructureHeight_slider7, 0, wx.ALL, 5 + ) + + self.m_enteringStructureMaxHeight_spinCtrl1 = wx.SpinCtrl( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "50", + wx.DefaultPosition, + wx.DefaultSize, + wx.SP_ARROW_KEYS, + 3, + 1024, + 50, + ) + self.sss_StructurePlayerPromptsSizer_bSizer8.Add( + self.m_enteringStructureMaxHeight_spinCtrl1, 0, wx.ALL, 5 + ) + + self.ss_HideAndSeekSizer_bSizer15.Add( + self.sss_StructurePlayerPromptsSizer_bSizer8, 1, wx.SHAPED, 5 + ) + + self.sss_BDXfileSignNameSizer_bSizer13 = wx.BoxSizer(wx.HORIZONTAL) + + self.m_BDXfileSignNameTips_staticText8 = wx.StaticText( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "BDX作者署名", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + self.m_BDXfileSignNameTips_staticText8.Wrap(-1) + + self.sss_BDXfileSignNameSizer_bSizer13.Add( + self.m_BDXfileSignNameTips_staticText8, 0, wx.ALL, 5 + ) + + self.m_EnteringBDXfileSignName_textCtrl12 = wx.TextCtrl( + s_promptSizer.GetStaticBox(), + wx.ID_ANY, + "UserYou", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + self.sss_BDXfileSignNameSizer_bSizer13.Add( + self.m_EnteringBDXfileSignName_textCtrl12, 0, wx.ALL, 5 + ) + + self.ss_HideAndSeekSizer_bSizer15.Add( + self.sss_BDXfileSignNameSizer_bSizer13, 1, wx.SHAPED, 5 + ) + + s_promptSizer.Add(self.ss_HideAndSeekSizer_bSizer15, 1, wx.EXPAND, 5) + + m_mainBoxSizer.Add(s_promptSizer, 1, wx.EXPAND, 5) + + s_StartSizer_sbSizer18 = wx.StaticBoxSizer( + wx.StaticBox(self, wx.ID_ANY, "开始转换"), wx.HORIZONTAL + ) + + s_StartSizer_sbSizer18.SetMinSize(wx.Size(-1, 100)) + + s_StartSizer_sbSizer18.Add((0, 0), 1, wx.EXPAND, 5) + + self.m_button2 = wx.Button( + s_StartSizer_sbSizer18.GetStaticBox(), + wx.ID_ANY, + "转换,启动!", + wx.DefaultPosition, + wx.DefaultSize, + 0, + ) + s_StartSizer_sbSizer18.Add(self.m_button2, 0, wx.ALIGN_CENTER | wx.ALL, 5) + + m_mainBoxSizer.Add( + s_StartSizer_sbSizer18, + 1, + wx.ALL | wx.EXPAND | wx.RESERVE_SPACE_EVEN_IF_HIDDEN, + 5, + ) + + self.SetSizer(m_mainBoxSizer) self.Layout() - def HideUnnecessaryControls(self): - # 隐藏所有不需要显示的控件 - self.scoreboard_name_text.Hide() - self.auto_reset_checkbox.Hide() - self.selecter_text.Hide() - self.max_struct_height_slider.Hide() - self.max_struct_height_text.Hide() - self.author_name_text.Hide() - self.whole_style_text.Hide() - self.non_played_text.Hide() - self.has_played_text.Hide() - self.Layout() + self.Centre(wx.BOTH) - def on_file_selected(self, event): - file_to_convert = self.file_picker.GetPath() - # 处理选择的文件 + # Connect Events + self.Bind( + wx.EVT_MENU, self.onExitButtonPressed, id=self.m_Exit_menuItem1.GetId() + ) + self.m_LinglunWords_staticText1.Bind(wx.EVT_LEFT_DCLICK, self.onYanlunDClicked) + self.m_LinglunWords_staticText1.Bind(wx.EVT_MOUSEWHEEL, self.onYanlunWheeled) + self.m_ChooseMidiTips_staticText3.Bind(wx.EVT_LEFT_DCLICK, self.MidiEasterEgg) + self.m_ChooseMIDI_filePicker1.Bind(wx.EVT_FILEPICKER_CHANGED, self.onFileChosen) + self.m_outformatChoice_choice1.Bind(wx.EVT_CHOICE, self.onOutputFormatChosen) + self.m_playerChoice_choice2.Bind(wx.EVT_CHOICE, self.onPlayerChosen) + self.m_volumn_slider.Bind(wx.EVT_SCROLL, self.onVolumeScrolling) + self.m_volumn_spinCtrlDouble1.Bind( + wx.EVT_SPINCTRLDOUBLE, self.onVolumeSpinChanged + ) + self.m_speed_slider.Bind(wx.EVT_SCROLL, self.onSpeedScrolling) + self.m_speed_spinCtrlDouble.Bind(wx.EVT_SPINCTRLDOUBLE, self.onSpeedSpinChanged) + self.m_progressBarEnablingCheckBox1.Bind( + wx.EVT_CHECKBOX, self.onProgressbarChecked + ) + self.m_BasicProgressBarStyleEntering_textCtrl4.Bind( + wx.EVT_TEXT, self.onProgressbarBasicStyleUpdating + ) + self.m_unplayedProgressbarStyleEntering_textCtrl5.Bind( + wx.EVT_TEXT, self.onProgressbarUnplayedStyleUpdating + ) + self.m_playedProgressbarStyleEntering_textCtrl5.Bind( + wx.EVT_TEXT, self.onProgressbarPlayedStyleUpdating + ) + self.m_ScoreboardNameEntering_textCtrl9.Bind( + wx.EVT_TEXT, self.onScoreboredNameUpdating + ) + self.m_IsAutoResetScoreboard_checkBox2.Bind( + wx.EVT_CHECKBOX, self.onAutoResetScoreboardChecked + ) + self.m_PlayerSelectorEntering_comboBox1.Bind( + wx.EVT_TEXT, self.onPlayerSelectorUpdating + ) + self.m_StructureHeight_slider7.Bind( + wx.EVT_SCROLL, self.onStructureMaxHeightScrolling + ) + self.m_enteringStructureMaxHeight_spinCtrl1.Bind( + wx.EVT_SPINCTRL, self.onStructureMaxHeightSpinChanged + ) + self.m_EnteringBDXfileSignName_textCtrl12.Bind( + wx.EVT_TEXT, self.onBDXfileSignNameUpdating + ) + self.m_button2.Bind(wx.EVT_BUTTON, self.onStartButtonPressed) - def on_output_type_selected(self, event): - output_type = self.output_type_dropdown.GetStringSelection() - # 处理选择的输出结果类型 + # self.ss_HideAndSeekSizer_bSizer15.Hide( + # self.sss_BDXfileSignNameSizer_bSizer13 + # ) + # self.ss_HideAndSeekSizer_bSizer15.Hide( + # self.sss_StructurePlayerPromptsSizer_bSizer8 + # ) - def on_player_type_selected(self, event): - player_type = self.player_type_dropdown.GetStringSelection() - if player_type == "计分板": - # 显示计分板相关控件 - self.scoreboard_name_text.Show() - self.auto_reset_checkbox.Show() - # 隐藏延迟相关控件 - self.selecter_text.Hide() - self.max_struct_height_slider.Hide() - self.max_struct_height_text.Hide() - elif player_type == "延迟": - # 显示延迟相关控件 - self.selecter_text.Show() - self.max_struct_height_slider.Show() - self.max_struct_height_text.Show() - # 隐藏计分板相关控件 - self.scoreboard_name_text.Hide() - self.auto_reset_checkbox.Hide() - self.Layout() + self.m_EnteringBDXfileSignName_textCtrl12.Enable(False) - def on_volume_slider_changed(self, event): - volume = self.volume_slider.GetValue() - self.volume_text.SetValue(str(volume / 100)) # 更新音量大小输入框的值 + self.m_PlayerSelectorEntering_comboBox1.Enable(False) + self.m_StructureHeight_slider7.Enable(False) + self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False) - def on_speed_slider_changed(self, event): - speed = self.speed_slider.GetValue() - self.speed_text.SetValue(str(speed / 100)) # 更新速度倍率输入框的值 + def __del__(self): + pass - def on_progressbar_checkbox_changed(self, event): - is_progressbar_selected = self.progressbar_checkbox.GetValue() - if is_progressbar_selected: - # 显示进度条相关控件 - self.whole_style_text.Show() - self.non_played_text.Show() - self.has_played_text.Show() + # Virtual event handlers, override them in your derived class + def onExitButtonPressed(self, event): + self.Destroy() + + def onYanlunDClicked(self, event): + self.m_LinglunWords_staticText1.SetLabelText(random.choice(myWords) + "\r") + + def onYanlunWheeled(self, event): + self.m_LinglunWords_staticText1.SetLabelText(random.choice(myWords) + "\r") + + def MidiEasterEgg(self, event): + self.m_ChooseMIDI_filePicker1.GetTextCtrl().SetValue("诸葛亮与八卦阵-山水千年.mid") + self.Update() + + def onFileChosen(self, event): + # prt(self.m_ChooseMIDI_filePicker1.GetTextCtrl().Value) + # self.midi_cvt = Musicreater.MidiConvert.from_midi_file(self.m_ChooseMIDI_filePicker1.GetLabel(),self.m_oldExeFormatChecker_checkBox3.GetValue()) + event.Skip() + + def onOutputFormatChosen(self, event): + # 0: 附加包 + # 1: BDX + # prt("选择中:",self.m_outformatChoice_choice1.GetSelection()) + if self.m_outformatChoice_choice1.GetSelection() == 0: + self.m_EnteringBDXfileSignName_textCtrl12.Enable(False) + if self.m_playerChoice_choice2.GetSelection() == 0: + 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() == 1: + self.m_EnteringBDXfileSignName_textCtrl12.Enable(True) + self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True) + self.m_StructureHeight_slider7.Enable(True) + + def onPlayerChosen(self, event): + # 0 计分板 1 延时 2中继器 + if self.m_playerChoice_choice2.GetSelection() == 0: + self.m_PlayerSelectorEntering_comboBox1.Enable(False) + self.m_StructureHeight_slider7.Enable(False) + self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False) + self.m_ScoreboardNameEntering_textCtrl9.Enable(True) + self.m_IsAutoResetScoreboard_checkBox2.Enable(True) else: - # 隐藏进度条相关控件 - self.whole_style_text.Hide() - self.non_played_text.Hide() - self.has_played_text.Hide() - self.Layout() + self.m_PlayerSelectorEntering_comboBox1.Enable(True) + self.m_StructureHeight_slider7.Enable(True) + self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True) + self.m_ScoreboardNameEntering_textCtrl9.Enable(False) + self.m_IsAutoResetScoreboard_checkBox2.Enable(False) - def on_max_struct_height_slider_changed(self, event): - max_struct_height = self.max_struct_height_slider.GetValue() - self.max_struct_height_text.SetValue(str(max_struct_height)) # 更新结构最大高度输入框的值 + def onVolumeScrolling(self, event): + # prt(self.m_volumn_slider.Value) + self.m_volumn_spinCtrlDouble1.SetValue(self.m_volumn_slider.Value / 10) - def on_export_button_clicked(self, event): - output_path = wx.DirSelector(message="选择一个文件夹") # 选择文件夹并保存至output_path变量 - # 导出结果的操作 + def onVolumeSpinChanged(self, event): + # prt(self.m_volumn_spinCtrlDouble1.Value) + self.m_volumn_slider.SetValue(int(self.m_volumn_spinCtrlDouble1.Value * 10)) - class TextCtrlRedirector: - def __init__(self, text_ctrl): - self.text_ctrl = text_ctrl + def onSpeedScrolling(self, event): + # prt(self.m_speed_slider.Value) + if self.m_speed_slider.Value > 50: + self.m_speed_spinCtrlDouble.SetValue( + (self.m_speed_slider.Value * 9 - 400) / 50 + ) + else: + self.m_speed_spinCtrlDouble.SetValue( + (self.m_speed_slider.Value * 99 + 50) / 5000 + ) - def write(self, text): - wx.CallAfter(self.text_ctrl.WriteText, text) + def onSpeedSpinChanged(self, event): + if self.m_speed_spinCtrlDouble.Value > 1: + self.m_speed_slider.SetValue( + int((self.m_speed_spinCtrlDouble.Value + 8) * 50 / 9) + ) + else: + self.m_speed_slider.SetValue( + int((self.m_speed_spinCtrlDouble.Value - 0.01) * 5000 / 99) + ) - def flush(self): - pass + def onProgressbarChecked(self, event): + if self.m_progressBarEnablingCheckBox1.GetValue(): + self.m_BasicProgressBarStyleEntering_textCtrl4.Enable(True) + self.m_unplayedProgressbarStyleEntering_textCtrl5.Enable(True) + self.m_playedProgressbarStyleEntering_textCtrl5.Enable(True) + else: + self.m_BasicProgressBarStyleEntering_textCtrl4.Enable(False) + self.m_unplayedProgressbarStyleEntering_textCtrl5.Enable(False) + self.m_playedProgressbarStyleEntering_textCtrl5.Enable(False) + + def onProgressbarBasicStyleUpdating(self, event): + event.Skip() + + def onProgressbarUnplayedStyleUpdating(self, event): + event.Skip() + + def onProgressbarPlayedStyleUpdating(self, event): + event.Skip() + + def onScoreboredNameUpdating(self, event): + event.Skip() + + def onAutoResetScoreboardChecked(self, event): + event.Skip() + + def onPlayerSelectorUpdating(self, event): + event.Skip() + + def onStructureMaxHeightScrolling(self, event): + self.m_enteringStructureMaxHeight_spinCtrl1.SetValue( + self.m_StructureHeight_slider7.GetValue() + ) + + def onStructureMaxHeightSpinChanged(self, event): + self.m_StructureHeight_slider7.SetValue( + self.m_enteringStructureMaxHeight_spinCtrl1.GetValue() + ) + + def onBDXfileSignNameUpdating(self, event): + event.Skip() + + def onStartButtonPressed(self, event): + if self.m_ChooseMIDI_filePicker1.GetTextCtrl().Value != "诸葛亮与八卦阵-山水千年.mid": + mid_cvt = Musicreater.MidiConvert.from_midi_file( + self.m_ChooseMIDI_filePicker1.GetTextCtrl().Value, + self.m_oldExeFormatChecker_checkBox3.GetValue(), + ) + + cvt_cfg = ConvertConfig( + os.path.split(self.m_ChooseMIDI_filePicker1.GetTextCtrl().Value)[0], + self.m_volumn_spinCtrlDouble1.GetValue() / 100, + self.m_speed_spinCtrlDouble.GetValue(), + progressbar=( + self.m_BasicProgressBarStyleEntering_textCtrl4.GetValue(), + ( + self.m_playedProgressbarStyleEntering_textCtrl5.GetValue(), + self.m_unplayedProgressbarStyleEntering_textCtrl5.GetValue(), + ), + ), + ) + + # 0: 附加包 + # 1: BDX + + # 0 计分板 1 延时 2中继器 + if self.m_outformatChoice_choice1.GetSelection() == 0: + if self.m_playerChoice_choice2.GetSelection() == 0: + cmd_num, total_delay = to_addon_pack_in_score( + mid_cvt, + cvt_cfg, + self.m_ScoreboardNameEntering_textCtrl9.GetValue(), + self.m_IsAutoResetScoreboard_checkBox2.GetValue(), + ) + elif self.m_playerChoice_choice2.GetSelection() == 1: + cmd_num, total_delay = to_addon_pack_in_delay( + mid_cvt, + cvt_cfg, + self.m_PlayerSelectorEntering_comboBox1.GetValue(), + self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(), + ) + elif self.m_playerChoice_choice2.GetSelection() == 2: + cmd_num, total_delay = to_addon_pack_in_repeater( + mid_cvt, + cvt_cfg, + self.m_PlayerSelectorEntering_comboBox1.GetValue(), + self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(), + ) + else: + wx.MessageDialog( + None, "你输入的播放器有误!", "错误", wx.YES_DEFAULT | wx.ICON_ERROR + ).ShowModal() + return + wx.MessageDialog( + None, + "完成!\n指令数量:{}\n延迟总长:{}".format(cmd_num, total_delay), + "转换成功", + wx.YES_DEFAULT | wx.ICON_INFORMATION, + ).ShowModal() + elif self.m_outformatChoice_choice1.GetSelection() == 1: + if self.m_playerChoice_choice2.GetSelection() == 0: + cmd_num, total_delay, size, final_pos = to_BDX_file_in_score( + midi_cvt=mid_cvt, + data_cfg=cvt_cfg, + scoreboard_name=self.m_ScoreboardNameEntering_textCtrl9.GetValue(), + auto_reset=self.m_IsAutoResetScoreboard_checkBox2.GetValue(), + author=self.m_EnteringBDXfileSignName_textCtrl12.GetValue(), + max_height=self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(), + ) + elif self.m_playerChoice_choice2.GetSelection() == 1: + cmd_num, total_delay, size, final_pos = to_BDX_file_in_delay( + midi_cvt=mid_cvt, + data_cfg=cvt_cfg, + player=self.m_PlayerSelectorEntering_comboBox1.GetValue(), + author=self.m_EnteringBDXfileSignName_textCtrl12.GetValue(), + max_height=self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(), + ) + else: + wx.MessageDialog( + None, "你输入的播放器有误!", "错误", wx.YES_DEFAULT | wx.ICON_ERROR + ).ShowModal() + return + wx.MessageDialog( + None, + "完成!\n指令数量:{}\n延迟总长:{}\n结构大小:{}\n终点坐标:{}".format( + cmd_num, total_delay, size, final_pos + ), + "转换成功", + wx.YES_DEFAULT | wx.ICON_INFORMATION, + ).ShowModal() + + +# # 创建主窗口类 +# class LinglunConverterFrame(wx.Frame): +# def __init__(self, *args, **kwargs): +# super(LinglunConverterFrame, self).__init__(*args, **kwargs) + +# # 设置窗口属性 +# self.SetSize((750, 300)) +# self.Center() + +# self.panel = wx.Panel(self) +# self.main_sizer = wx.BoxSizer(wx.VERTICAL) + +# self.yanlun_sizer = wx.BoxSizer(wx.HORIZONTAL) + +# now_word = random.choice(myWords).split("\t——") +# self.yanlun_label_a = wx.StaticText( +# self.panel, label=now_word[0], style=wx.ALIGN_LEFT +# ) +# self.yanlun_label_a.SetForegroundColour(WHITE) +# self.yanlun_label_a.SetBackgroundColour(BLACK) +# self.yanlun_sizer.Add(self.yanlun_label_a, flag=wx.ALIGN_TOP) + +# if len(now_word) > 1: +# self.yanlun_label_b = wx.StaticText( +# self.panel, label=now_word[1], style=wx.ALIGN_RIGHT +# ) +# self.yanlun_label_b.SetForegroundColour(WHITE) +# self.yanlun_label_b.SetBackgroundColour(BLACK) +# self.yanlun_sizer.Add(self.yanlun_label_b, flag=wx.ALIGN_TOP) + +# self.main_sizer.Add(self.yanlun_sizer, flag=wx.EXPAND) + +# self.file_picker_frame = wx.StaticBoxSizer() + +# # 文件选择控件 +# self.file_picker = wx.FilePickerCtrl( +# self.panel, +# message="选择MIDI文件", +# wildcard="MIDI files (*.mid;*.midi)|*.mid;*.midi", +# style=wx.FLP_USE_TEXTCTRL, +# ) +# self.main_sizer.Add(self.file_picker, flag=wx.EXPAND) + +# # 输出结果类型下拉选择控件 +# self.output_type_dropdown = wx.Choice( +# self.panel, choices=["MCPACK", "BDX", "MCSTRUCTURE"] +# ) +# self.main_sizer.Add(wx.StaticText(self.panel, label="输出结果类型:")) +# self.main_sizer.Add(self.output_type_dropdown, flag=wx.EXPAND) + +# # 播放器类型下拉选择控件 +# self.player_type_dropdown = wx.Choice(self.panel, choices=["计分板", "延迟"]) +# self.main_sizer.Add(wx.StaticText(self.panel, label="播放器类型:")) +# self.main_sizer.Add(self.player_type_dropdown, flag=wx.EXPAND) + +# # 音量大小滑动条与数字输入框 +# self.volume_slider = wx.Slider( +# self.panel, value=100, minValue=1, maxValue=100, style=wx.SL_HORIZONTAL +# ) +# self.volume_text = wx.TextCtrl(self.panel, value="1.0") +# self.main_sizer.Add(wx.StaticText(self.panel, label="音量大小:")) +# self.main_sizer.Add(self.volume_slider, flag=wx.EXPAND) +# self.main_sizer.Add(self.volume_text, flag=wx.EXPAND) + +# # 速度倍率滑动条与数字输入框 +# self.speed_slider = wx.Slider( +# self.panel, value=100, minValue=1, maxValue=100, style=wx.SL_HORIZONTAL +# ) +# self.speed_text = wx.TextCtrl(self.panel, value="1.0") +# self.main_sizer.Add(wx.StaticText(self.panel, label="速度倍率:")) +# self.main_sizer.Add(self.speed_slider, flag=wx.EXPAND) +# self.main_sizer.Add(self.speed_text, flag=wx.EXPAND) + +# # 自动生成进度条勾选框 +# self.progressbar_checkbox = wx.CheckBox(self.panel, label="是否自动生成进度条") +# self.main_sizer.Add(self.progressbar_checkbox, flag=wx.EXPAND) + +# # 进度条相关控件 +# self.whole_style_text = wx.TextCtrl( +# self.panel, value=" %%N [ %%s/%^s %%% __________ %%t|%^t]" +# ) +# self.non_played_text = wx.TextCtrl(self.panel, value="§7=§r") +# self.has_played_text = wx.TextCtrl(self.panel, value="§e=§r") +# self.main_sizer.Add(wx.StaticText(self.panel, label="整体样式:")) +# self.main_sizer.Add(self.whole_style_text, flag=wx.EXPAND) +# self.main_sizer.Add(wx.StaticText(self.panel, label="动条(未播放):")) +# self.main_sizer.Add(self.non_played_text, flag=wx.EXPAND) +# self.main_sizer.Add(wx.StaticText(self.panel, label="动条(已播放):")) +# self.main_sizer.Add(self.has_played_text, flag=wx.EXPAND) + +# # 计分板相关控件 +# self.scoreboard_name_text = wx.TextCtrl(self.panel, value="mscply") +# self.auto_reset_checkbox = wx.CheckBox(self.panel, label="是否结束后重置计分板") + +# # 延迟相关控件 +# self.selecter_text = wx.TextCtrl(self.panel, value="@a") +# self.max_struct_height_slider = wx.Slider( +# self.panel, value=63, minValue=4, maxValue=256, style=wx.SL_HORIZONTAL +# ) +# self.max_struct_height_text = wx.TextCtrl(self.panel, value="63") + +# # BDX相关控件 +# self.author_name_text = wx.TextCtrl(self.panel, value="Unfamous") + +# # 导出结果按钮 +# self.export_button = wx.Button(self.panel, label="导出结果") + +# # 添加控件到主sizer中 +# self.main_sizer.Add(self.scoreboard_name_text, flag=wx.EXPAND) +# self.main_sizer.Add(self.auto_reset_checkbox, flag=wx.EXPAND) +# self.main_sizer.Add(self.selecter_text, flag=wx.EXPAND) +# self.main_sizer.Add(self.max_struct_height_slider, flag=wx.EXPAND) +# self.main_sizer.Add(self.max_struct_height_text, flag=wx.EXPAND) +# self.main_sizer.Add(self.author_name_text, flag=wx.EXPAND) +# self.main_sizer.Add(self.export_button, flag=wx.EXPAND) + +# self.panel.SetSizer(self.main_sizer) +# self.panel.Layout() + +# # 绑定事件处理程序 +# self.file_picker.Bind(wx.EVT_FILEPICKER_CHANGED, self.on_file_selected) +# self.output_type_dropdown.Bind(wx.EVT_CHOICE, self.on_output_type_selected) +# self.player_type_dropdown.Bind(wx.EVT_CHOICE, self.on_player_type_selected) +# self.volume_slider.Bind(wx.EVT_SCROLL_CHANGED, self.on_volume_slider_changed) +# self.speed_slider.Bind(wx.EVT_SCROLL_CHANGED, self.on_speed_slider_changed) +# self.progressbar_checkbox.Bind( +# wx.EVT_CHECKBOX, self.on_progressbar_checkbox_changed +# ) +# self.max_struct_height_slider.Bind( +# wx.EVT_SCROLL_CHANGED, self.on_max_struct_height_slider_changed +# ) +# self.export_button.Bind(wx.EVT_BUTTON, self.on_export_button_clicked) + +# self.HideUnnecessaryControls() +# self.Layout() + +# def HideUnnecessaryControls(self): +# # 隐藏所有不需要显示的控件 +# self.scoreboard_name_text.Hide() +# self.auto_reset_checkbox.Hide() +# self.selecter_text.Hide() +# self.max_struct_height_slider.Hide() +# self.max_struct_height_text.Hide() +# self.author_name_text.Hide() +# self.whole_style_text.Hide() +# self.non_played_text.Hide() +# self.has_played_text.Hide() +# self.Layout() + +# def on_file_selected(self, event): +# file_to_convert = self.file_picker.GetPath() +# # 处理选择的文件 + +# def on_output_type_selected(self, event): +# output_type = self.output_type_dropdown.GetStringSelection() +# # 处理选择的输出结果类型 + +# def on_player_type_selected(self, event): +# player_type = self.player_type_dropdown.GetStringSelection() +# if player_type == "计分板": +# # 显示计分板相关控件 +# self.scoreboard_name_text.Show() +# self.auto_reset_checkbox.Show() +# # 隐藏延迟相关控件 +# self.selecter_text.Hide() +# self.max_struct_height_slider.Hide() +# self.max_struct_height_text.Hide() +# elif player_type == "延迟": +# # 显示延迟相关控件 +# self.selecter_text.Show() +# self.max_struct_height_slider.Show() +# self.max_struct_height_text.Show() +# # 隐藏计分板相关控件 +# self.scoreboard_name_text.Hide() +# self.auto_reset_checkbox.Hide() +# self.Layout() + +# def on_volume_slider_changed(self, event): +# volume = self.volume_slider.GetValue() +# self.volume_text.SetValue(str(volume / 100)) # 更新音量大小输入框的值 + +# def on_speed_slider_changed(self, event): +# speed = self.speed_slider.GetValue() +# self.speed_text.SetValue(str(speed / 100)) # 更新速度倍率输入框的值 + +# def on_progressbar_checkbox_changed(self, event): +# is_progressbar_selected = self.progressbar_checkbox.GetValue() +# if is_progressbar_selected: +# # 显示进度条相关控件 +# self.whole_style_text.Show() +# self.non_played_text.Show() +# self.has_played_text.Show() +# else: +# # 隐藏进度条相关控件 +# self.whole_style_text.Hide() +# self.non_played_text.Hide() +# self.has_played_text.Hide() +# self.Layout() + +# def on_max_struct_height_slider_changed(self, event): +# max_struct_height = self.max_struct_height_slider.GetValue() +# self.max_struct_height_text.SetValue(str(max_struct_height)) # 更新结构最大高度输入框的值 + +# def on_export_button_clicked(self, event): +# output_path = wx.DirSelector(message="选择一个文件夹") # 选择文件夹并保存至output_path变量 +# # 导出结果的操作 + +# class TextCtrlRedirector: +# def __init__(self, text_ctrl): +# self.text_ctrl = text_ctrl + +# def write(self, text): +# wx.CallAfter(self.text_ctrl.WriteText, text) + +# def flush(self): +# pass # 启动应用程序 diff --git a/wxFB_Project/LingLunConverter.fbp b/wxFB_Project/LingLunConverter.fbp new file mode 100644 index 0000000..79328b8 --- /dev/null +++ b/wxFB_Project/LingLunConverter.fbp @@ -0,0 +1,2127 @@ + + + + + ; + Python + 1 + source_name + 0 + 0 + res + UTF-8 + connect + + 1000 + none + + + 0 + LingLunConverter + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + wxSYS_COLOUR_WINDOW + wxBOTH + + 1 + 1 + impl_virtual + + wxSYS_COLOUR_WINDOWTEXT + OPPOSans R,90,400,-1,70,0 + 0 + wxID_ANY + + + LingLunMainFrame + + 659,778 + wxDEFAULT_FRAME_STYLE + ; ; forward_declare + + + 0 + + LingLunConverter + wxTAB_TRAVERSAL + 1 + + + + 1 + 1 + + 1 + + 0 + wxID_ANY + + + m_statusBar2 + protected + + + wxSTB_SIZEGRIP + ; ; forward_declare + + + + + + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_menubar1 + protected + + + + ; ; forward_declare + + + + + + 文件 + FileMenu + protected + + + 0 + 1 + 这是退出按钮 + wxID_ANY + wxITEM_NORMAL + 退出 + m_Exit_menuItem1 + none + + + onExitButtonPressed + + + + + + m_mainBoxSizer + wxVERTICAL + none + + 2 + wxALL|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN|wxTOP + 1 + + wxID_ANY + 言·论 + -1,-1 + s_yanLunbarSizer + wxVERTICAL + 1 + none + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + wxSYS_COLOUR_WINDOWTEXT + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + wxSYS_COLOUR_HIGHLIGHTTEXT + 1 + OPPOSans B,90,400,12,70,0 + 0 + 0 + wxID_ANY + 灵光焕发 深艺献心 + 0 + + 0 + + + 0 + + 1 + m_LinglunWords_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_CENTER_HORIZONTAL|wxST_ELLIPSIZE_MIDDLE|wxST_NO_AUTORESIZE + ; ; forward_declare + 0 + + + + + -1 + onYanlunDClicked + onYanlunWheeled + + + + + + 5 + wxEXPAND + 1 + + -1,-1 + s_midiChooseSizer + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 选择MIDI文件 + 0 + + 0 + + + 0 + + 1 + m_ChooseMidiTips_staticText3 + 1 + + + protected + 1 + + Fixed + 1 + + + ; ; forward_declare + 0 + + + + + -1 + MidiEasterEgg + + + + 5 + wxEXPAND + 1 + + + ss_MidiChooserSizer_bSizer9 + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 选择MIDI文件 + + 0 + -1,-1 + 1 + m_ChooseMIDI_filePicker1 + 1 + + + protected + 1 + + Fixed + 1 + + wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + ./ + MIDI 序列 (*.mid;*.midi)|*.mid;*.midi + + + + onFileChosen + + + + + + + + 5 + wxEXPAND + 1 + + + s_formatChooseSizer + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + 选择输出格式 + + ss_outputFormatChooseSizer + wxVERTICAL + 1 + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "附加包" "BDX结构" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_outformatChoice_choice1 + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onOutputFormatChosen + + + + + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + 选择播放器 + + ss_playerChooseSizer + wxVERTICAL + 1 + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "计分板" "延时" "中继器" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_playerChoice_choice2 + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onPlayerChosen + + + + + + + + 5 + wxEXPAND + 1 + + wxID_ANY + 转换参数 + + s_promptSizer + wxVERTICAL + 1 + none + + 5 + wxEXPAND|wxSHAPED + 1 + + + ss_regularPromoptsEnteringSizer1 + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + 音量大小 + + sss_VolumnPersentageEnteringSizer + wxHORIZONTAL + 1 + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 1000 + + 0 + + 0 + + 0 + + 1 + m_volumn_slider + 1 + + + protected + 1 + + Resizable + 1 + + wxSL_HORIZONTAL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1000 + + + + onVolumeScrolling + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 2 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0.5 + 100.000000 + 100 + + 0 + + 0 + + 0 + + 1 + m_volumn_spinCtrlDouble1 + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS|wxTE_PROCESS_ENTER + ; ; forward_declare + 0 + + 100 + + + + onVolumeSpinChanged + + + + + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + 播放倍速 + + sss_SpeedEnteringSizer + wxHORIZONTAL + 1 + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 100 + + 0 + + 0 + + 0 + + 1 + m_speed_slider + 1 + + + protected + 1 + + Resizable + 1 + + wxSL_HORIZONTAL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 50 + + + + onSpeedScrolling + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 2 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0.1 + 1 + 10 + + 0 + + 0.01 + + 0 + + 1 + m_speed_spinCtrlDouble + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS|wxTE_PROCESS_ENTER + ; ; forward_declare + 0 + + 1 + + + + onSpeedSpinChanged + + + + + + 0 + wxSHAPED + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 启用 旧版 执行 指令 格式 + + 0 + + + 0 + + 1 + m_oldExeFormatChecker_checkBox3 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxEXPAND + 1 + + wxID_ANY + 进度条 + + ss_progressbarCheckingSizer + wxHORIZONTAL + 1 + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 启用进度条 + + 0 + + + 0 + + 1 + m_progressBarEnablingCheckBox1 + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_RIGHT + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onProgressbarChecked + + + + 5 + wxEXPAND + 1 + + wxWRAPSIZER_DEFAULT_FLAGS + + sss_customProgressBarSizer_wSizer6 + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + wxID_ANY + 基本样式组 + + ssss_basicProgressStylePattle_sbSizer9 + wxVERTICAL + 1 + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + -1,-1 + 1 + m_BasicProgressBarStyleEntering_textCtrl4 + 1 + + + protected + 1 + + Fixed + 1 + + wxTE_LEFT|wxTE_NO_VSCROLL|wxTE_RICH + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + ▶ %%N [ %%s/%^s %%% __________ %%t|%^t ] + + + + onProgressbarBasicStyleUpdating + + + + + + 5 + wxEXPAND + 1 + + wxID_ANY + 未播放之样式 + + ssss_UnplayedPartProgressbarPattle_sbSizer10 + wxVERTICAL + 1 + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_unplayedProgressbarStyleEntering_textCtrl5 + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_LEFT|wxTE_NO_VSCROLL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + §7=§r + + + + onProgressbarUnplayedStyleUpdating + + + + + + 5 + wxEXPAND + 1 + + wxID_ANY + 已播放之样式 + + ssss_PlayedPartProgressbarPattle_sbSizer11 + wxVERTICAL + 1 + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_playedProgressbarStyleEntering_textCtrl5 + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_LEFT|wxTE_NO_VSCROLL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + §e=§r + + + + onProgressbarPlayedStyleUpdating + + + + + + + + + + 5 + wxEXPAND + 1 + + + ss_HideAndSeekSizer_bSizer15 + wxVERTICAL + none + + 5 + wxSHAPED + 1 + + + sss_ScoreboardPlayerPromptsSizer_bSizer7 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 播放计分板名称 + 0 + + 0 + + + 0 + + 1 + m_EnterScoreboardNameTip_staticText4 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 10 + + 0 + + 1 + m_ScoreboardNameEntering_textCtrl9 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + mscplay + + + + onScoreboredNameUpdating + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 2,-1 + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 自动重置计分板 + + 0 + + + 0 + + 1 + m_IsAutoResetScoreboard_checkBox2 + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_RIGHT + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onAutoResetScoreboardChecked + + + + + + 5 + wxSHAPED + 1 + + + sss_StructurePlayerPromptsSizer_bSizer8 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 玩家选择器 + 0 + + 0 + + + 0 + + 1 + m_PlayerSelectorEnteringTips_staticText41 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "@a" "@p" "@e[type=player]" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_PlayerSelectorEntering_comboBox1 + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxCB_DROPDOWN|wxTE_PROCESS_ENTER + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + @a + + + + onPlayerSelectorUpdating + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 2,-1 + 0 + m_staticline2 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 结构生成最大高度 + 0 + + 0 + + + 0 + + 1 + StructureMaxHeoghtTips_ + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 1024 + + 0 + + 3 + + 0 + + 1 + m_StructureHeight_slider7 + 1 + + + protected + 1 + + Resizable + 1 + + wxSL_HORIZONTAL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 50 + + + + onStructureMaxHeightScrolling + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 50 + 1024 + + 0 + + 3 + + 0 + + 1 + m_enteringStructureMaxHeight_spinCtrl1 + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + 50 + + + + onStructureMaxHeightSpinChanged + + + + + + 5 + wxSHAPED + 1 + + + sss_BDXfileSignNameSizer_bSizer13 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + BDX作者署名 + 0 + + 0 + + + 0 + + 1 + m_BDXfileSignNameTips_staticText8 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_EnteringBDXfileSignName_textCtrl12 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + UserYou + + + + onBDXfileSignNameUpdating + + + + + + + + + + 5 + wxALL|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN + 1 + + wxID_ANY + 开始转换 + -1,100 + s_StartSizer_sbSizer18 + wxHORIZONTAL + 1 + none + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + 转换,启动! + + 0 + + 0 + + + 0 + + 1 + m_button2 + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onStartButtonPressed + + + + + + + + diff --git a/wxFB_Project/generated.py b/wxFB_Project/generated.py new file mode 100644 index 0000000..2e018b4 --- /dev/null +++ b/wxFB_Project/generated.py @@ -0,0 +1,352 @@ +# -*- coding: utf-8 -*- + +########################################################################### +## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +## http://www.wxformbuilder.org/ +## +## PLEASE DO *NOT* EDIT THIS FILE! +########################################################################### + +import wx +import wx.xrc + +########################################################################### +## Class LingLunMainFrame +########################################################################### + +class LingLunMainFrame ( wx.Frame ): + + def __init__( self, parent ): + wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 659,778 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL, name = u"LingLunConverter" ) + + self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) + self.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans R" ) ) + self.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) ) + self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) ) + + self.m_statusBar2 = self.CreateStatusBar( 1, wx.STB_SIZEGRIP, wx.ID_ANY ) + self.m_menubar1 = wx.MenuBar( 0 ) + self.FileMenu = wx.Menu() + self.m_Exit_menuItem1 = wx.MenuItem( self.FileMenu, wx.ID_ANY, u"退出", u"这是退出按钮", wx.ITEM_NORMAL ) + self.FileMenu.Append( self.m_Exit_menuItem1 ) + + self.m_menubar1.Append( self.FileMenu, u"文件" ) + + self.SetMenuBar( self.m_menubar1 ) + + m_mainBoxSizer = wx.BoxSizer( wx.VERTICAL ) + + s_yanLunbarSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"言·论" ), wx.VERTICAL ) + + self.m_LinglunWords_staticText1 = wx.StaticText( s_yanLunbarSizer.GetStaticBox(), wx.ID_ANY, u"灵光焕发 深艺献心", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL|wx.ST_ELLIPSIZE_MIDDLE|wx.ST_NO_AUTORESIZE ) + self.m_LinglunWords_staticText1.Wrap( -1 ) + + self.m_LinglunWords_staticText1.SetFont( wx.Font( 12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "OPPOSans B" ) ) + self.m_LinglunWords_staticText1.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHTTEXT ) ) + self.m_LinglunWords_staticText1.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) ) + + s_yanLunbarSizer.Add( self.m_LinglunWords_staticText1, 0, wx.EXPAND, 5 ) + + + m_mainBoxSizer.Add( s_yanLunbarSizer, 1, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN|wx.TOP, 2 ) + + s_midiChooseSizer = wx.BoxSizer( wx.HORIZONTAL ) + + self.m_ChooseMidiTips_staticText3 = wx.StaticText( self, wx.ID_ANY, u"选择MIDI文件", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_ChooseMidiTips_staticText3.Wrap( -1 ) + + s_midiChooseSizer.Add( self.m_ChooseMidiTips_staticText3, 0, wx.ALL, 5 ) + + ss_MidiChooserSizer_bSizer9 = wx.BoxSizer( wx.VERTICAL ) + + self.m_ChooseMIDI_filePicker1 = wx.FilePickerCtrl( self, wx.ID_ANY, u"./", u"选择MIDI文件", u"MIDI 序列 (*.mid;*.midi)|*.mid;*.midi", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE|wx.FLP_FILE_MUST_EXIST|wx.FLP_OPEN|wx.FLP_USE_TEXTCTRL ) + ss_MidiChooserSizer_bSizer9.Add( self.m_ChooseMIDI_filePicker1, 0, wx.ALL|wx.EXPAND, 5 ) + + + s_midiChooseSizer.Add( ss_MidiChooserSizer_bSizer9, 1, wx.EXPAND, 5 ) + + + m_mainBoxSizer.Add( s_midiChooseSizer, 1, wx.EXPAND, 5 ) + + s_formatChooseSizer = wx.BoxSizer( wx.HORIZONTAL ) + + ss_outputFormatChooseSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"选择输出格式" ), wx.VERTICAL ) + + m_outformatChoice_choice1Choices = [ u"附加包", u"BDX结构" ] + self.m_outformatChoice_choice1 = wx.Choice( ss_outputFormatChooseSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_outformatChoice_choice1Choices, wx.CB_SORT ) + self.m_outformatChoice_choice1.SetSelection( 0 ) + ss_outputFormatChooseSizer.Add( self.m_outformatChoice_choice1, 0, wx.ALL|wx.EXPAND, 5 ) + + + s_formatChooseSizer.Add( ss_outputFormatChooseSizer, 1, wx.ALL|wx.EXPAND, 5 ) + + ss_playerChooseSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"选择播放器" ), wx.VERTICAL ) + + m_playerChoice_choice2Choices = [ u"计分板", u"延时", u"中继器" ] + self.m_playerChoice_choice2 = wx.Choice( ss_playerChooseSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_playerChoice_choice2Choices, 0 ) + self.m_playerChoice_choice2.SetSelection( 0 ) + ss_playerChooseSizer.Add( self.m_playerChoice_choice2, 0, wx.ALL|wx.EXPAND, 5 ) + + + s_formatChooseSizer.Add( ss_playerChooseSizer, 1, wx.ALL|wx.EXPAND, 5 ) + + + m_mainBoxSizer.Add( s_formatChooseSizer, 1, wx.EXPAND, 5 ) + + s_promptSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"转换参数" ), wx.VERTICAL ) + + ss_regularPromoptsEnteringSizer1 = wx.BoxSizer( wx.HORIZONTAL ) + + sss_VolumnPersentageEnteringSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"音量大小" ), wx.HORIZONTAL ) + + self.m_volumn_slider = wx.Slider( sss_VolumnPersentageEnteringSizer.GetStaticBox(), wx.ID_ANY, 1000, 0, 1000, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL ) + sss_VolumnPersentageEnteringSizer.Add( self.m_volumn_slider, 0, wx.ALL, 5 ) + + self.m_volumn_spinCtrlDouble1 = wx.SpinCtrlDouble( sss_VolumnPersentageEnteringSizer.GetStaticBox(), wx.ID_ANY, u"100", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL|wx.SP_ARROW_KEYS|wx.TE_PROCESS_ENTER, 0, 100, 100.000000, 0.5 ) + self.m_volumn_spinCtrlDouble1.SetDigits( 2 ) + sss_VolumnPersentageEnteringSizer.Add( self.m_volumn_spinCtrlDouble1, 0, wx.ALL, 5 ) + + + ss_regularPromoptsEnteringSizer1.Add( sss_VolumnPersentageEnteringSizer, 1, wx.ALL|wx.EXPAND, 5 ) + + sss_SpeedEnteringSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"播放倍速" ), wx.HORIZONTAL ) + + self.m_speed_slider = wx.Slider( sss_SpeedEnteringSizer.GetStaticBox(), wx.ID_ANY, 50, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL ) + sss_SpeedEnteringSizer.Add( self.m_speed_slider, 0, wx.ALL, 5 ) + + self.m_speed_spinCtrlDouble = wx.SpinCtrlDouble( sss_SpeedEnteringSizer.GetStaticBox(), wx.ID_ANY, u"1", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL|wx.SP_ARROW_KEYS|wx.TE_PROCESS_ENTER, 0, 10, 1, 0.1 ) + self.m_speed_spinCtrlDouble.SetDigits( 2 ) + sss_SpeedEnteringSizer.Add( self.m_speed_spinCtrlDouble, 0, wx.ALL, 5 ) + + + ss_regularPromoptsEnteringSizer1.Add( sss_SpeedEnteringSizer, 1, wx.ALL|wx.EXPAND, 5 ) + + + s_promptSizer.Add( ss_regularPromoptsEnteringSizer1, 1, wx.EXPAND|wx.SHAPED, 5 ) + + ss_progressbarCheckingSizer = wx.StaticBoxSizer( wx.StaticBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"进度条" ), wx.HORIZONTAL ) + + self.m_progressBarEnablingCheckBox1 = wx.CheckBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"启用进度条", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) + self.m_progressBarEnablingCheckBox1.SetValue(True) + ss_progressbarCheckingSizer.Add( self.m_progressBarEnablingCheckBox1, 0, wx.ALL, 5 ) + + sss_customProgressBarSizer_wSizer6 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS ) + + ssss_basicProgressStylePattle_sbSizer9 = wx.StaticBoxSizer( wx.StaticBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"基本样式组" ), wx.VERTICAL ) + + self.m_BasicProgressBarStyleEntering_textCtrl4 = wx.TextCtrl( ssss_basicProgressStylePattle_sbSizer9.GetStaticBox(), wx.ID_ANY, u"▶ %%N [ %%s/%^s %%% __________ %%t|%^t ]", wx.DefaultPosition, wx.DefaultSize, wx.TE_LEFT|wx.TE_NO_VSCROLL|wx.TE_RICH ) + ssss_basicProgressStylePattle_sbSizer9.Add( self.m_BasicProgressBarStyleEntering_textCtrl4, 0, wx.ALL|wx.EXPAND, 5 ) + + + sss_customProgressBarSizer_wSizer6.Add( ssss_basicProgressStylePattle_sbSizer9, 1, wx.EXPAND, 5 ) + + ssss_UnplayedPartProgressbarPattle_sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"未播放之样式" ), wx.VERTICAL ) + + self.m_unplayerProgressbarStyleEntering_textCtrl5 = wx.TextCtrl( ssss_UnplayedPartProgressbarPattle_sbSizer10.GetStaticBox(), wx.ID_ANY, u"§7=§r", wx.DefaultPosition, wx.DefaultSize, wx.TE_LEFT|wx.TE_NO_VSCROLL ) + ssss_UnplayedPartProgressbarPattle_sbSizer10.Add( self.m_unplayerProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 ) + + + sss_customProgressBarSizer_wSizer6.Add( ssss_UnplayedPartProgressbarPattle_sbSizer10, 1, wx.EXPAND, 5 ) + + ssss_PlayedPartProgressbarPattle_sbSizer11 = wx.StaticBoxSizer( wx.StaticBox( ss_progressbarCheckingSizer.GetStaticBox(), wx.ID_ANY, u"已播放之样式" ), wx.VERTICAL ) + + self.m_playerProgressbarStyleEntering_textCtrl5 = wx.TextCtrl( ssss_PlayedPartProgressbarPattle_sbSizer11.GetStaticBox(), wx.ID_ANY, u"§e=§r", wx.DefaultPosition, wx.DefaultSize, wx.TE_LEFT|wx.TE_NO_VSCROLL ) + ssss_PlayedPartProgressbarPattle_sbSizer11.Add( self.m_playerProgressbarStyleEntering_textCtrl5, 0, wx.ALL, 5 ) + + + sss_customProgressBarSizer_wSizer6.Add( ssss_PlayedPartProgressbarPattle_sbSizer11, 1, wx.EXPAND, 5 ) + + + ss_progressbarCheckingSizer.Add( sss_customProgressBarSizer_wSizer6, 1, wx.EXPAND, 5 ) + + + s_promptSizer.Add( ss_progressbarCheckingSizer, 1, wx.EXPAND, 5 ) + + ss_HideAndSeekSizer_bSizer15 = wx.BoxSizer( wx.VERTICAL ) + + sss_ScoreboardPlayerPromptsSizer_bSizer7 = wx.BoxSizer( wx.HORIZONTAL ) + + self.m_EnterScoreboardNameTip_staticText4 = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"播放计分板名称", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_EnterScoreboardNameTip_staticText4.Wrap( -1 ) + + sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_EnterScoreboardNameTip_staticText4, 0, wx.ALL, 5 ) + + self.m_ScoreboardNameEntering_textCtrl9 = wx.TextCtrl( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"mscplay", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_ScoreboardNameEntering_textCtrl9.SetMaxLength( 10 ) + sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_ScoreboardNameEntering_textCtrl9, 0, wx.ALL, 5 ) + + self.m_staticline1 = wx.StaticLine( s_promptSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + self.m_staticline1.SetMinSize( wx.Size( 2,-1 ) ) + + sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_staticline1, 0, wx.ALL|wx.EXPAND, 5 ) + + self.m_IsAutoResetScoreboard_checkBox2 = wx.CheckBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"自动重置计分板", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) + sss_ScoreboardPlayerPromptsSizer_bSizer7.Add( self.m_IsAutoResetScoreboard_checkBox2, 0, wx.ALL, 5 ) + + + ss_HideAndSeekSizer_bSizer15.Add( sss_ScoreboardPlayerPromptsSizer_bSizer7, 1, wx.SHAPED, 5 ) + + sss_StructurePlayerPromptsSizer_bSizer8 = wx.BoxSizer( wx.HORIZONTAL ) + + self.m_PlayerSelectorEnteringTips_staticText41 = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"玩家选择器", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_PlayerSelectorEnteringTips_staticText41.Wrap( -1 ) + + sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_PlayerSelectorEnteringTips_staticText41, 0, wx.ALL, 5 ) + + m_PlayerSelectorEntering_comboBox1Choices = [ u"@a", u"@p", u"@e[type=player]" ] + self.m_PlayerSelectorEntering_comboBox1 = wx.ComboBox( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"@a", wx.DefaultPosition, wx.DefaultSize, m_PlayerSelectorEntering_comboBox1Choices, wx.CB_DROPDOWN|wx.TE_PROCESS_ENTER ) + self.m_PlayerSelectorEntering_comboBox1.SetSelection( 0 ) + sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_PlayerSelectorEntering_comboBox1, 0, wx.ALL, 5 ) + + self.m_staticline2 = wx.StaticLine( s_promptSizer.GetStaticBox(), wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + self.m_staticline2.SetMinSize( wx.Size( 2,-1 ) ) + + sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_staticline2, 0, wx.ALL|wx.EXPAND, 5 ) + + self.StructureMaxHeoghtTips_ = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"结构生成最大高度", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.StructureMaxHeoghtTips_.Wrap( -1 ) + + sss_StructurePlayerPromptsSizer_bSizer8.Add( self.StructureMaxHeoghtTips_, 0, wx.ALL, 5 ) + + self.m_StructureHeight_slider7 = wx.Slider( s_promptSizer.GetStaticBox(), wx.ID_ANY, 50, 3, 1024, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL ) + sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_StructureHeight_slider7, 0, wx.ALL, 5 ) + + self.m_spinCtrl1 = wx.SpinCtrl( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"50", wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 3, 1024, 50 ) + sss_StructurePlayerPromptsSizer_bSizer8.Add( self.m_spinCtrl1, 0, wx.ALL, 5 ) + + + ss_HideAndSeekSizer_bSizer15.Add( sss_StructurePlayerPromptsSizer_bSizer8, 1, wx.SHAPED, 5 ) + + sss_BDXfileSignNameSizer_bSizer13 = wx.BoxSizer( wx.HORIZONTAL ) + + self.m_BDXfileSignNameTips_staticText8 = wx.StaticText( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"BDX作者署名", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_BDXfileSignNameTips_staticText8.Wrap( -1 ) + + sss_BDXfileSignNameSizer_bSizer13.Add( self.m_BDXfileSignNameTips_staticText8, 0, wx.ALL, 5 ) + + self.m_EnteringBDXfileSignName_textCtrl12 = wx.TextCtrl( s_promptSizer.GetStaticBox(), wx.ID_ANY, u"UserYou", wx.DefaultPosition, wx.DefaultSize, 0 ) + sss_BDXfileSignNameSizer_bSizer13.Add( self.m_EnteringBDXfileSignName_textCtrl12, 0, wx.ALL, 5 ) + + + ss_HideAndSeekSizer_bSizer15.Add( sss_BDXfileSignNameSizer_bSizer13, 1, wx.SHAPED, 5 ) + + + s_promptSizer.Add( ss_HideAndSeekSizer_bSizer15, 1, wx.EXPAND, 5 ) + + + m_mainBoxSizer.Add( s_promptSizer, 1, wx.EXPAND, 5 ) + + s_StartSizer_sbSizer18 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"开始转换" ), wx.HORIZONTAL ) + + s_StartSizer_sbSizer18.SetMinSize( wx.Size( -1,100 ) ) + + s_StartSizer_sbSizer18.Add( ( 0, 0), 1, wx.EXPAND, 5 ) + + self.m_button2 = wx.Button( s_StartSizer_sbSizer18.GetStaticBox(), wx.ID_ANY, u"转换,启动!", wx.DefaultPosition, wx.DefaultSize, 0 ) + s_StartSizer_sbSizer18.Add( self.m_button2, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) + + + m_mainBoxSizer.Add( s_StartSizer_sbSizer18, 1, wx.ALL|wx.EXPAND|wx.RESERVE_SPACE_EVEN_IF_HIDDEN, 5 ) + + + self.SetSizer( m_mainBoxSizer ) + self.Layout() + + self.Centre( wx.BOTH ) + + # Connect Events + self.Bind( wx.EVT_MENU, self.onExitButtonPressed, id = self.m_Exit_menuItem1.GetId() ) + self.m_LinglunWords_staticText1.Bind( wx.EVT_LEFT_DCLICK, self.onYanlunDClicked ) + self.m_LinglunWords_staticText1.Bind( wx.EVT_MOUSEWHEEL, self.onYanlunWheeled ) + self.m_ChooseMidiTips_staticText3.Bind( wx.EVT_LEFT_DCLICK, self.MidiEasterEgg ) + self.m_ChooseMIDI_filePicker1.Bind( wx.EVT_FILEPICKER_CHANGED, self.onFileChosen ) + self.m_outformatChoice_choice1.Bind( wx.EVT_CHOICE, self.onOutputFormatChosen ) + self.m_playerChoice_choice2.Bind( wx.EVT_CHOICE, self.onPlayerChosen ) + self.m_volumn_slider.Bind( wx.EVT_SCROLL, self.onVolumeScrolling ) + self.m_volumn_spinCtrlDouble1.Bind( wx.EVT_SPINCTRLDOUBLE, self.onVolumeSpinChanged ) + self.m_speed_slider.Bind( wx.EVT_SCROLL, self.onSpeedScrolling ) + self.m_speed_spinCtrlDouble.Bind( wx.EVT_SPINCTRLDOUBLE, self.onSpeedSpinChanged ) + self.m_progressBarEnablingCheckBox1.Bind( wx.EVT_CHECKBOX, self.onProgressbarChecked ) + self.m_BasicProgressBarStyleEntering_textCtrl4.Bind( wx.EVT_TEXT, self.onProgressbarBasicStyleUpdating ) + self.m_unplayerProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarUnplayedStyleUpdating ) + self.m_playerProgressbarStyleEntering_textCtrl5.Bind( wx.EVT_TEXT, self.onProgressbarPlayedStyleUpdating ) + self.m_ScoreboardNameEntering_textCtrl9.Bind( wx.EVT_TEXT, self.onScoreboredNameUpdating ) + self.m_IsAutoResetScoreboard_checkBox2.Bind( wx.EVT_CHECKBOX, self.onAutoResetScoreboardChecked ) + self.m_PlayerSelectorEntering_comboBox1.Bind( wx.EVT_TEXT, self.onPlayerSelectorUpdating ) + self.m_StructureHeight_slider7.Bind( wx.EVT_SCROLL, self.onStructureMaxHeightScrolling ) + self.m_spinCtrl1.Bind( wx.EVT_SPINCTRL, self.onStructureMaxHeightSpinChanged ) + self.m_EnteringBDXfileSignName_textCtrl12.Bind( wx.EVT_TEXT, self.onBDXfileSignNameUpdating ) + self.m_button2.Bind( wx.EVT_BUTTON, self.onStartButtonPressed ) + + def __del__( self ): + pass + + + # Virtual event handlers, override them in your derived class + def onExitButtonPressed( self, event ): + event.Skip() + + def onYanlunDClicked( self, event ): + event.Skip() + + def onYanlunWheeled( self, event ): + event.Skip() + + def MidiEasterEgg( self, event ): + event.Skip() + + def onFileChosen( self, event ): + event.Skip() + + def onOutputFormatChosen( self, event ): + event.Skip() + + def onPlayerChosen( self, event ): + event.Skip() + + def onVolumeScrolling( self, event ): + event.Skip() + + def onVolumeSpinChanged( self, event ): + event.Skip() + + def onSpeedScrolling( self, event ): + event.Skip() + + def onSpeedSpinChanged( self, event ): + event.Skip() + + def onProgressbarChecked( self, event ): + event.Skip() + + def onProgressbarBasicStyleUpdating( self, event ): + event.Skip() + + def onProgressbarUnplayedStyleUpdating( self, event ): + event.Skip() + + def onProgressbarPlayedStyleUpdating( self, event ): + event.Skip() + + def onScoreboredNameUpdating( self, event ): + event.Skip() + + def onAutoResetScoreboardChecked( self, event ): + event.Skip() + + def onPlayerSelectorUpdating( self, event ): + event.Skip() + + def onStructureMaxHeightScrolling( self, event ): + event.Skip() + + def onStructureMaxHeightSpinChanged( self, event ): + event.Skip() + + def onBDXfileSignNameUpdating( self, event ): + event.Skip() + + def onStartButtonPressed( self, event ): + event.Skip() + +