Ejemplo n.º 1
0
 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")
Ejemplo n.º 2
0
 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")
Ejemplo n.º 3
0
 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")
Ejemplo n.º 4
0
 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")
Ejemplo n.º 5
0
 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")
Ejemplo n.º 6
0
 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")
Ejemplo n.º 7
0
 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")
Ejemplo n.º 8
0
    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()