Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
accessibility_movie_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵心治
accessibility_movie_2
Commits
5d3fc565
Commit
5d3fc565
authored
Nov 15, 2022
by
xuanweiace
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat_1' of
http://gitlab.uiiai.com/xuanweiace/accessibility_movie_2
into feat_1
Conflicts: main_window.py
parents
93b9f63c
19ad4f0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
main_window.py
main_window.py
+14
-8
operation_dialog.py
operation_dialog.py
+3
-3
No files found.
main_window.py
View file @
5d3fc565
...
@@ -229,10 +229,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -229,10 +229,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self
.
pb_tableWidget
.
itemDoubleClicked
.
connect
(
self
.
writeHistory
)
self
.
pb_tableWidget
.
itemDoubleClicked
.
connect
(
self
.
writeHistory
)
self
.
pb_tableWidget
.
itemDoubleClicked
.
connect
(
self
.
pb_item_changed_by_double_clicked_slot
)
self
.
pb_tableWidget
.
itemDoubleClicked
.
connect
(
self
.
pb_item_changed_by_double_clicked_slot
)
self
.
pb_tableWidget
.
itemChanged
.
connect
(
self
.
rewriteHistory
)
# todo 现在只在【旁白】tab上双击修改,会保存表格到本地,【字幕旁白】tab上不行。(【字幕旁白】tab上无法修改旁白)
# todo 现在只在【旁白】tab上双击修改,会保存表格到本地,【字幕旁白】tab上不行。(【字幕旁白】tab上无法修改旁白)
self
.
pb_tableWidget
.
itemChanged
.
connect
(
self
.
write2ProjectFromAside
)
self
.
pb_tableWidget
.
itemChanged
.
connect
(
self
.
write2ProjectFromAside
)
self
.
pb_tableWidget
.
itemChanged
.
connect
(
self
.
generate_audio_slot
)
self
.
pb_tableWidget
.
itemChanged
.
connect
(
self
.
generate_audio_slot
)
self
.
pb_tableWidget
.
itemChanged
.
connect
(
self
.
rewriteHistory
)
self
.
pb_tableWidget
.
itemDoubleClicked
.
connect
(
self
.
change_video_time
)
self
.
pb_tableWidget
.
itemDoubleClicked
.
connect
(
self
.
change_video_time
)
# 其他变量
# 其他变量
...
@@ -776,7 +776,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -776,7 +776,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
for
j
in
range
(
len
(
elem_list
)):
for
j
in
range
(
len
(
elem_list
)):
text
=
elem_list
[
j
]
text
=
elem_list
[
j
]
if
type
(
text
)
==
str
and
'插入旁白,推荐'
in
text
:
if
type
(
text
)
==
str
and
'插入旁白,推荐'
in
text
:
text
=
re
.
findall
(
"
\
d+"
,
text
)[
0
]
text
=
re
.
findall
(
"
\
d+"
,
text
)
if
len
(
text
)
==
0
:
text
=
0
else
:
text
=
text
[
0
]
# text = text[text.index('推荐'):]
# text = text[text.index('推荐'):]
# 需要格式化成hh:mm:ss格式
# 需要格式化成hh:mm:ss格式
if
j
in
time_format_col_list
and
type
(
text
)
==
str
and
len
(
text
)
!=
0
:
if
j
in
time_format_col_list
and
type
(
text
)
==
str
and
len
(
text
)
!=
0
:
...
@@ -904,6 +908,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -904,6 +908,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
if
self
.
is_user_editing
()
==
False
:
if
self
.
is_user_editing
()
==
False
:
return
return
self
.
set_user_edit
(
False
)
# 不需要set为False
# 不需要set为False
row
=
item
.
row
()
# 获取行数
row
=
item
.
row
()
# 获取行数
col
=
item
.
column
()
# 获取列数 注意是column而不是col
col
=
item
.
column
()
# 获取列数 注意是column而不是col
...
@@ -930,7 +936,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -930,7 +936,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
print
(
"wav_path:"
,
wav_path
)
print
(
"wav_path:"
,
wav_path
)
# speed_info = self.projectContext.speaker_speed
# speed_info = self.projectContext.speaker_speed
# 使用私有 语速
# 使用私有 语速
speed_info
=
self
.
p
b_tableWidget
.
cellWidget
(
int
(
row
),
constant
.
Aside
.
SpeedColumnNumber
)
.
currentText
()
speed_info
=
self
.
p
rojectContext
.
aside_list
[
int
(
row
)]
.
speed
speaker_info
=
self
.
projectContext
.
speaker_info
speaker_info
=
self
.
projectContext
.
speaker_info
speed
=
float
(
speed_info
.
split
(
'('
)[
0
])
speed
=
float
(
speed_info
.
split
(
'('
)[
0
])
speaker_name
=
speaker_info
.
split
(
","
)[
0
]
speaker_name
=
speaker_info
.
split
(
","
)[
0
]
...
@@ -938,7 +944,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -938,7 +944,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
speaker
=
self
.
projectContext
.
choose_speaker
(
speaker_name
)
speaker
=
self
.
projectContext
.
choose_speaker
(
speaker_name
)
text
=
self
.
projectContext
.
aside_list
[
int
(
row
)]
.
aside
text
=
self
.
projectContext
.
aside_list
[
int
(
row
)]
.
aside
# 如果目前wav_path存在,且旁白字数清空了,那就把已生成wav删掉
# 如果目前wav_path存在,且旁白字数清空了,那就把已生成wav删掉
if
len
(
text
)
==
0
:
if
text
is
None
or
len
(
text
)
==
0
:
if
os
.
path
.
exists
(
wav_path
):
if
os
.
path
.
exists
(
wav_path
):
os
.
remove
(
wav_path
)
os
.
remove
(
wav_path
)
return
return
...
@@ -968,8 +974,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -968,8 +974,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
return
return
if
self
.
is_user_editing
()
==
False
:
if
self
.
is_user_editing
()
==
False
:
return
return
# 这里不需要加,因为按照槽函数的顺序 还有一个要执行的
self
.
set_user_edit
(
False
)
#
self.set_user_edit(False)
if
item
is
None
:
if
item
is
None
:
print
(
"WRONG!!!! item Is None"
)
print
(
"WRONG!!!! item Is None"
)
return
return
...
@@ -1035,8 +1041,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -1035,8 +1041,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
return
return
if
self
.
is_user_editing
()
==
False
:
if
self
.
is_user_editing
()
==
False
:
return
return
# 这里不需要加,因为按照槽函数的顺序 还有一个要执行的
# self.set_user_edit(False)
if
item
is
None
:
if
item
is
None
:
print
(
"WRONG!!!! item Is None"
)
print
(
"WRONG!!!! item Is None"
)
return
return
...
@@ -1326,4 +1330,5 @@ class MainWindow(QMainWindow, Ui_MainWindow):
...
@@ -1326,4 +1330,5 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 将audio_player的资源置空
# 将audio_player的资源置空
print
(
"释放当前播放的音频文件"
)
print
(
"释放当前播放的音频文件"
)
self
.
audio_player
.
setMedia
(
QMediaContent
())
self
.
audio_player
.
setMedia
(
QMediaContent
())
self
.
projectContext
.
aside_list
[
idx
.
row
()]
.
speed
=
combo
.
currentText
()
self
.
do_generate_audio_by_aside_row
(
idx
.
row
())
self
.
do_generate_audio_by_aside_row
(
idx
.
row
())
\ No newline at end of file
operation_dialog.py
View file @
5d3fc565
...
@@ -159,8 +159,8 @@ class Operation_Dialog(QDialog, Ui_Dialog):
...
@@ -159,8 +159,8 @@ class Operation_Dialog(QDialog, Ui_Dialog):
# self.mainWindow.prompt_dialog.show_with_msg(
# self.mainWindow.prompt_dialog.show_with_msg(
# "校验失败!推荐字数填入有误!!")
# "校验失败!推荐字数填入有误!!")
# return False
# return False
# 这些是只有
【modify】
才需要检测的
# 这些是只有
[modify] | [delete]
才需要检测的
if
self
.
comboBox_2
.
currentText
()
==
"修改
一行"
:
if
self
.
comboBox_2
.
currentText
()
!=
"增加
一行"
:
try
:
try
:
suggest
=
self
.
mainWindow
.
projectContext
.
all_elements
[
row_number
-
1
]
.
suggest
suggest
=
self
.
mainWindow
.
projectContext
.
all_elements
[
row_number
-
1
]
.
suggest
print
(
"suggest:"
,
suggest
)
print
(
"suggest:"
,
suggest
)
...
@@ -171,7 +171,7 @@ class Operation_Dialog(QDialog, Ui_Dialog):
...
@@ -171,7 +171,7 @@ class Operation_Dialog(QDialog, Ui_Dialog):
assert
self
.
comboBox
.
currentText
()
==
"字幕"
assert
self
.
comboBox
.
currentText
()
==
"字幕"
except
Exception
as
e
:
except
Exception
as
e
:
self
.
mainWindow
.
prompt_dialog
.
show_with_msg
(
self
.
mainWindow
.
prompt_dialog
.
show_with_msg
(
"校验失败!待
修改
的行不是[
%
s]"
%
(
self
.
comboBox
.
currentText
()))
"校验失败!待
操作
的行不是[
%
s]"
%
(
self
.
comboBox
.
currentText
()))
return
False
return
False
# 检测通过
# 检测通过
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment