|
13 | 13 | from command import concat_filter, merge_filestream_audio_channel |
14 | 14 | from pymediainfo import MediaInfo |
15 | 15 |
|
16 | | - |
17 | 16 | VERSION = "0.2.0" |
18 | 17 |
|
| 18 | + |
19 | 19 | class FileDropTarget(wx.FileDropTarget): |
20 | 20 | def __init__(self, target): |
21 | 21 | wx.FileDropTarget.__init__(self) |
@@ -186,12 +186,15 @@ def ExportBtnOnClick(self, event): |
186 | 186 | if export_name == '': |
187 | 187 | export_name = str(time.strftime('No Title %Y.%m.%d - %H.%M.output.mp4')) |
188 | 188 |
|
189 | | - # 导出路径不为空则更改工作路径 |
| 189 | + # 导出路径不为空则更改导出目录 |
190 | 190 | if not export_path == '': |
191 | | - os.chdir(export_path) |
| 191 | + # os.chdir(export_path) |
| 192 | + export_name = export_path + '/' + export_name |
192 | 193 | else: |
193 | 194 | # 默认使用第一个文件的目录 |
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 |
195 | 198 |
|
196 | 199 | threading.Thread(target=self.export_videofile, args=(export_amix, export_mbps, export_name)).start() |
197 | 200 | self.ExportBtn.Disable() |
@@ -254,15 +257,14 @@ def export_videofile(self, export_amix, export_mbps, export_name): |
254 | 257 |
|
255 | 258 | # 执行命令 |
256 | 259 | try: |
257 | | - subprocess.run(console_command, shell=False, check=True) |
| 260 | + subprocess.run(console_command, shell=False, check=True, creationflags=subprocess.CREATE_NO_WINDOW) |
258 | 261 |
|
259 | 262 | # 完成命令,发送事件 |
260 | 263 | wx.CallAfter(self.on_export_done, ExportMessage(ExportMessageState.SUCCESS, "导出完成")) |
261 | 264 | except subprocess.CalledProcessError as e: |
262 | 265 | # 导出失败,发送事件 |
263 | 266 | wx.CallAfter(self.on_export_done, ExportMessage(ExportMessageState.ERROR, e)) |
264 | 267 |
|
265 | | - |
266 | 268 | def ProjectWebBtnOnClick(self, event): |
267 | 269 | # TODO: Implement ProjectWebBtnOnClick |
268 | 270 | pass |
|
0 commit comments