Пример #1
0
 def on_audio_analyzes(self, event):  
     
     filepath = self.text_path_open.GetValue()
     # I call os_processing.proc_volumedetect:
     alias_vol = proc_volumedetect(filepath, self.ffmpeg_link)
     self.text_dbMax.SetValue(""), self.text_dbMedium.SetValue("")
     
     if  alias_vol == None:
         return
     else:
         #max_volume = alias_vol[0]
         #mean_volume = alias_vol[1]
         maxvol_append = alias_vol[2]
         medvol_append = alias_vol[3]
         #raw_list = alias_vol[4]
         self.text_dbMax.AppendText(maxvol_append)
         self.text_dbMedium.AppendText(medvol_append)
Пример #2
0
    def on_ok(self, event):
        
        logname = 'Videomass_Normalizer.log'
        #overwrite = ""
        
        if self.ffmpeg_log == 'true':
            report = '-report'
        else:
            report = ''
            
        #if self.checkbox_overwrite.GetValue() is True:
                #overwrite = "-y"
        #else:

        if 'batch' in array:########### BATCH MODE ACTIVE
        
            #if self.text_path_open.GetValue() == self.text_path_save.GetValue():
                #wx.MessageBox("Warning, you're overwriting all the imported "
                                #"files. if you want to allow overwriting must "
                                #"first check the checkbox on, otherwise change "
                                #"the name or destination directory.", 'Warning', 
                                #wx.ICON_EXCLAMATION, self)
                #return
            
            if self.text_group_ext.GetValue() == "":
                wx.MessageBox("Please, write in the box 'Group' the extension "
                              "of the files to be processed.", 'Warning', 
                              wx.ICON_EXCLAMATION, self)
                return

            valupdate = self.update_dict()
            ending = Formula(self, valupdate[0], valupdate[1])
            
            if ending.ShowModal() == wx.ID_OK:
                log_command = "%s -i '%s' -loglevel error -af volume=%sdB %s '%s'" % (
                                            self.ffmpeg_link,
                                            self.text_path_open.GetValue(), 
                                            diction_command["Normalize"], 
                                            self.threads,
                                            self.text_path_save.GetValue(),
                                                        )
                status = control_errors(self.text_path_open.GetValue(),
                                            diction_command["ext_input"],
                                            log_command, logname,
                                        )
                if  status[0] == 'no_error':
                    proc_normalize_batch_thread(
                                    status[2], self.text_path_open.GetValue(), 
                                    self.threads, diction_command["ext_input"], 
                                    self.text_path_save.GetValue(), 
                                    diction_command["limited"],
                                    diction_command["Normalize"], logname,
                                    self.ffmpeg_link
                                    )
                    dial = ProgressDialog(self, 'Videomass Batch Process', 
                                        status[1], diction_command["ext_input"],
                                        diction_command["Audioext"],
                                        self.text_path_save.GetValue(),
                                        self.path_log, self.command_log,
                                        logname
                                            )
        else:  ########### STANDARD MODE
            inputfile = self.text_path_open.GetValue() 
            outputfile = diction_command["OutputDir"]
            limited = diction_command["limited"]
            normalize = diction_command["Normalize"]
            
            alias_vol = proc_volumedetect(inputfile, self.ffmpeg_link) # chiamo os_processing.proc_volumedetect
            raw_list = alias_vol[4] # list
            index_maxvol = alias_vol[0] # index int of raw_list
            maxvol = raw_list[index_maxvol + 1] # next item of index
            
            if float(maxvol) < limited: # if vol max is inferior at..
                result = float(maxvol) - float(normalize)
                result_str = str(result)
                command = ("%s %s -i '%s' -loglevel %s "
                        "-af volume=%sdB %s -y '%s'" % (self.ffmpeg_link, 
                        report, inputfile, self.loglevel_type, 
                        result_str[1:], self.threads, outputfile)
                        )
            valupdate = self.update_dict()
            ending = Formula(self, valupdate[0], valupdate[1])
            
            if ending.ShowModal() == wx.ID_OK:
                dial = proc_std(self, 'Videomass - Run single process', command,
                                self.path_log, logname, self.command_log,
                                )