def GetFrameThread(self): if (self.threadmanager == True): try: self.threadmanager = False worker = Worker(self.GetFrameFunction) worker.signals.finished.connect(self.ReleaseThread) self.pool.start(worker) except: print("Problem with getFrame thread") else: print("A thread is already running")
def mirrorThread(self): if (self.threadmanager == True): try: self.threadmanager = False worker = Worker(self.mirrorVideo) worker.signals.finished.connect(self.ReleaseThread) self.pool.start(worker) except: print("Problem with mirror thread") else: print("A thread is already running")
def changeResolutionThread(self): if (self.threadmanager == True): try: self.threadmanager = False worker = Worker(self.changeResolutionF) worker.signals.finished.connect(self.ReleaseThread) self.pool.start(worker) except: print("Problem with resolution thread") else: print("A thread is already running")
def videoGrepThread(self): if (self.threadmanager == True): try: self.threadmanager = False worker = Worker(self.videoGrepFunction) worker.signals.finished.connect(self.ReleaseThread) worker.signals.finished.connect(self.removeSubtitlesVideoGrep) self.pool.start(worker) except: print("Problem with VideoGrep thread") else: print("A thread is already running")
def SoundReplaceThread(self): if (self.threadmanager == True): try: self.threadmanager = False worker = Worker(self.SoundReplaceFunction) worker.signals.finished.connect(self.ReleaseThread) worker.signals.finished.connect(self.removeAudioFileFunction) self.pool.start(worker) except: print("Problem with SoundReplace thread") else: print("A thread is already running")
def cutThreadFunction(self): if (self.threadmanager == True): try: self.threadmanager = False worker = Worker(self.cutFunction) worker.signals.finished.connect(self.restCutButtons) worker.signals.finished.connect(self.ReleaseThread) self.pool.start(worker) except: print("Problem with cut thread") else: print("A thread is already running")
def concatenateThreadFunction(self): #If is true that means that no thread is running and can start a thread if (self.threadmanager == True): try: #If is false that means that a thread is already executing self.threadmanager = False worker = Worker(self.concatenate) #When the thread is done threadmanager will be True worker.signals.finished.connect(self.ReleaseThread) self.pool.start(worker) except: print("Problem with concatenate thread") else: print("A thread is already running")
def closeEvent(self, event): """ Popup a dialog when the user is trying to close the main app. """ reply = QMessageBox.question( self, 'Window Close', 'Are you sure you want to close the window?', QMessageBox.Yes | QMessageBox.No, QMessageBox.No) if reply == QMessageBox.Yes: if (self.threadmanager == True): try: self.threadmanager = False worker = Worker(self.deleteAllTemp) worker.signals.finished.connect(self.ReleaseThread) self.pool.start(worker) except: print("Problem with getFrame thread") else: print("A thread is already running") event.accept() print('Window closed') else: event.ignore()