@@ -64,8 +64,12 @@ def split(project: reapy.Project) -> None:
6464 win32gui .SendMessage (hwnd , win32con .WM_COMMAND , 1 , 0 )
6565
6666
67- def normalize (command : int , project : reapy .Project , flag : str ) -> None :
68- """Функция для нормализации всего по громкости"""
67+ def normalize_loudness (
68+ command : int ,
69+ project : reapy .Project ,
70+ flag : str
71+ ) -> None :
72+ """Функция для нормализации громкости"""
6973 if flag == 'all' or flag == 'dubbers' :
7074 select_all = True
7175 else :
@@ -80,50 +84,23 @@ def normalize(command: int, project: reapy.Project, flag: str) -> None:
8084 reapy .perform_action (command )
8185
8286
83- def hidden_normalize (project : reapy .Project ) -> None :
87+ def normalize (project : reapy .Project , flag : str ) -> None :
8488 command = RPR .NamedCommandLookup (
8589 '_BR_NORMALIZE_LOUDNESS_ITEMS23'
8690 )
8791 clsname , title = '#32770' , 'SWS/BR - Normalizing loudness...'
88- if get_option ('normalize' ):
89- norm = mp .Process (
90- target = normalize ,
91- args = (command , project , 'all' )
92- )
93- hide = mp .Process (
94- target = hide_window ,
95- args = (clsname , title , 'normalize' )
96- )
97- norm .start ()
98- hide .start ()
99- norm .join ()
100- hide .join ()
101- if get_option ('normalize_dubbers' ):
102- norm = mp .Process (
103- target = normalize ,
104- args = (command , project , 'dubbers' )
105- )
106- hide = mp .Process (
107- target = hide_window ,
108- args = (clsname , title , 'normalize' )
109- )
110- norm .start ()
111- hide .start ()
112- norm .join ()
113- hide .join ()
114- if get_option ('normalize_video' ):
115- norm = mp .Process (
116- target = normalize ,
117- args = (command , project , 'video' )
118- )
119- hide = mp .Process (
120- target = hide_window ,
121- args = (clsname , title , 'normalize' )
122- )
123- norm .start ()
124- hide .start ()
125- norm .join ()
126- hide .join ()
92+ norm = mp .Process (
93+ target = normalize_loudness ,
94+ args = (command , project , flag )
95+ )
96+ hide = mp .Process (
97+ target = hide_window ,
98+ args = (clsname , title , 'normalize' )
99+ )
100+ norm .start ()
101+ hide .start ()
102+ norm .join ()
103+ hide .join ()
127104
128105
129106def subs_generator (
@@ -142,8 +119,7 @@ def subs_generator(
142119 start , end , sbttls [i ].text , (147 , 112 , 219 )
143120 )
144121 # RPR.NF_SetSWSMarkerRegionSub(sbttls[i].text, region.index)
145- # Странно себя ведёт в потоке,
146- # потому что сразу много регионов создаётся и путаются ID
122+ # Странно себя ведёт в потоке
147123 elif flag == 'item' :
148124 item = project .tracks [1 ].add_item (start , end )
149125 RPR .ULT_SetMediaItemNote (item .id , sbttls [i ].text )
@@ -166,7 +142,10 @@ def import_subs(
166142 mp .Process (
167143 target = subs_generator ,
168144 args = (
169- project , sbttls , strt_idx , end_idx ,
145+ project ,
146+ sbttls ,
147+ strt_idx ,
148+ end_idx ,
170149 flag
171150 )
172151 )
@@ -183,7 +162,7 @@ def list_generator(
183162 list : List [List [float ]],
184163 queue : mp .Queue
185164 ) -> None :
186- """Функция для создания списка айтемов/субтитров """
165+ """Функция для создания списка айтемов"""
187166 for i in range (strt_idx , end_idx ):
188167 item = RPR .GetMediaItem (0 , i )
189168 start = RPR .GetMediaItemInfo_Value (
0 commit comments