Skip to content

Commit a8b7129

Browse files
committed
✨ 更新版本至0.2.0,优化导出逻辑与界面交互,分离导出线程和ui线程
1 parent 1de18bd commit a8b7129

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

SimpleCutMainFrame.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
from command import concat_filter, merge_filestream_audio_channel
1414
from pymediainfo import MediaInfo
1515

16-
1716
VERSION = "0.2.0"
1817

18+
1919
class FileDropTarget(wx.FileDropTarget):
2020
def __init__(self, target):
2121
wx.FileDropTarget.__init__(self)
@@ -186,12 +186,15 @@ def ExportBtnOnClick(self, event):
186186
if export_name == '':
187187
export_name = str(time.strftime('No Title %Y.%m.%d - %H.%M.output.mp4'))
188188

189-
# 导出路径不为空则更改工作路径
189+
# 导出路径不为空则更改导出目录
190190
if not export_path == '':
191-
os.chdir(export_path)
191+
# os.chdir(export_path)
192+
export_name = export_path + '/' + export_name
192193
else:
193194
# 默认使用第一个文件的目录
194-
os.chdir(os.path.dirname(self.item_list[0]["path"]))
195+
# os.chdir(os.path.dirname(self.item_list[0]["path"]))
196+
path = os.path.dirname(self.item_list[0]["path"])
197+
export_name = path + '/' + export_name
195198

196199
threading.Thread(target=self.export_videofile, args=(export_amix, export_mbps, export_name)).start()
197200
self.ExportBtn.Disable()
@@ -254,15 +257,14 @@ def export_videofile(self, export_amix, export_mbps, export_name):
254257

255258
# 执行命令
256259
try:
257-
subprocess.run(console_command, shell=False, check=True)
260+
subprocess.run(console_command, shell=False, check=True, creationflags=subprocess.CREATE_NO_WINDOW)
258261

259262
# 完成命令,发送事件
260263
wx.CallAfter(self.on_export_done, ExportMessage(ExportMessageState.SUCCESS, "导出完成"))
261264
except subprocess.CalledProcessError as e:
262265
# 导出失败,发送事件
263266
wx.CallAfter(self.on_export_done, ExportMessage(ExportMessageState.ERROR, e))
264267

265-
266268
def ProjectWebBtnOnClick(self, event):
267269
# TODO: Implement ProjectWebBtnOnClick
268270
pass

SimpleCutPy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__( self, parent ):
8888
self.m_panel2.SetSizer( bSizer4 )
8989
self.m_panel2.Layout()
9090
bSizer4.Fit( self.m_panel2 )
91-
self.m_notebook1.AddPage( self.m_panel2, u"素材设置", False )
91+
self.m_notebook1.AddPage( self.m_panel2, u"素材设置", True )
9292
self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
9393
bSizer5 = wx.BoxSizer( wx.VERTICAL )
9494

@@ -187,7 +187,7 @@ def __init__( self, parent ):
187187
self.m_panel4.SetSizer( bSizer8 )
188188
self.m_panel4.Layout()
189189
bSizer8.Fit( self.m_panel4 )
190-
self.m_notebook1.AddPage( self.m_panel4, u"关于", True )
190+
self.m_notebook1.AddPage( self.m_panel4, u"关于", False )
191191

192192
bSizer3.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 )
193193

0 commit comments

Comments
 (0)