Пример #1
0
 def on_ok(self, event):
     
     logname = 'Videomass_AudioGrab.log'
     
     if self.ffmpeg_log == 'true':
         report = '-report'
     else:
         report = ''
         
     if 'batch' in array:
         command = ("-loglevel %s -vn %s %s %s %s %s %s" % (
                         self.loglevel_batch,
                         diction_command["AudioCodec"], 
                         diction_command["AudioBitrate"], 
                         diction_command["AudioChannel"], 
                         diction_command["AudioRate"], 
                         self.threads, diction_command["testing"])
                         )
         valupdate = self.update_dict()
         ending = Formula(self, valupdate[0], valupdate[1])
         
         if ending.ShowModal() == wx.ID_OK:
             
             status = control_errors(self.text_open.GetValue(),
                                     diction_command["ext_input"],
                                     command, logname
                                     )
             if  status[0] == 'no_error':
         
                 proc_batch_thread(status[2], self.text_open.GetValue(), 
                                 diction_command["Audioext"], 
                                 self.text_save.GetValue(), command, 
                                 None, None, logname, self.ffmpeg_link
                                 )
                 dial = ProgressDialog(self, 'Videomass Batch Process', 
                                 status[1], diction_command["ext_input"],
                                 diction_command["Audioext"],
                                 self.text_save.GetValue(), self.path_log, 
                                 self.command_log, logname
                                     )
     else:
         command = ("%s %s -i '%s' -loglevel %s -vn %s %s %s %s "
                 "%s %s -y '%s'" % (self.ffmpeg_link, report, 
                     self.text_open.GetValue(), self.loglevel_type, 
                     diction_command["AudioCodec"], 
                     diction_command["AudioBitrate"], 
                     diction_command["AudioChannel"], 
                     diction_command["AudioRate"], 
                     self.threads, diction_command["testing"], 
                     self.text_save.GetValue())
                         )
         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
                             )
Пример #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,
                                )