ming пре 3 година
родитељ
комит
246edb1977
50 измењених фајлова са 1193 додато и 1193 уклоњено
  1. 0 0
      composer/pytranscriber/.DS_Store
  2. 0 0
      composer/pytranscriber/control/__init__.py
  3. 0 0
      composer/pytranscriber/control/__pycache__/__init__.cpython-37.pyc
  4. 0 0
      composer/pytranscriber/control/__pycache__/__init__.cpython-38.pyc
  5. 0 0
      composer/pytranscriber/control/__pycache__/__init__.cpython-39.pyc
  6. 0 0
      composer/pytranscriber/control/__pycache__/ctr_autosub.cpython-37.pyc
  7. 0 0
      composer/pytranscriber/control/__pycache__/ctr_autosub.cpython-38.pyc
  8. 0 0
      composer/pytranscriber/control/__pycache__/ctr_autosub.cpython-39.pyc
  9. 0 0
      composer/pytranscriber/control/__pycache__/ctr_main.cpython-37.pyc
  10. 0 0
      composer/pytranscriber/control/__pycache__/ctr_main.cpython-38.pyc
  11. 0 0
      composer/pytranscriber/control/__pycache__/ctr_main.cpython-39.pyc
  12. 0 0
      composer/pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-37.pyc
  13. 0 0
      composer/pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-38.pyc
  14. 0 0
      composer/pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-39.pyc
  15. 0 0
      composer/pytranscriber/control/__pycache__/thread_exec_autosub.cpython-37.pyc
  16. 0 0
      composer/pytranscriber/control/__pycache__/thread_exec_autosub.cpython-38.pyc
  17. 0 0
      composer/pytranscriber/control/__pycache__/thread_exec_autosub.cpython-39.pyc
  18. 145 145
      composer/pytranscriber/control/ctr_autosub.py
  19. 413 413
      composer/pytranscriber/control/ctr_main.py
  20. 14 14
      composer/pytranscriber/control/thread_cancel_autosub.py
  21. 120 120
      composer/pytranscriber/control/thread_exec_autosub.py
  22. 0 0
      composer/pytranscriber/gui/__init__.py
  23. 0 0
      composer/pytranscriber/gui/__pycache__/__init__.cpython-37.pyc
  24. 0 0
      composer/pytranscriber/gui/__pycache__/__init__.cpython-38.pyc
  25. 0 0
      composer/pytranscriber/gui/__pycache__/__init__.cpython-39.pyc
  26. 0 0
      composer/pytranscriber/gui/__pycache__/gui.cpython-37.pyc
  27. 0 0
      composer/pytranscriber/gui/__pycache__/gui.cpython-38.pyc
  28. 0 0
      composer/pytranscriber/gui/__pycache__/gui.cpython-39.pyc
  29. 120 120
      composer/pytranscriber/gui/gui.py
  30. 266 266
      composer/pytranscriber/gui/gui.ui
  31. 0 0
      composer/pytranscriber/model/__init__.py
  32. 0 0
      composer/pytranscriber/model/__pycache__/__init__.cpython-37.pyc
  33. 0 0
      composer/pytranscriber/model/__pycache__/__init__.cpython-38.pyc
  34. 0 0
      composer/pytranscriber/model/__pycache__/__init__.cpython-39.pyc
  35. 0 0
      composer/pytranscriber/model/__pycache__/param_autosub.cpython-37.pyc
  36. 0 0
      composer/pytranscriber/model/__pycache__/param_autosub.cpython-38.pyc
  37. 0 0
      composer/pytranscriber/model/__pycache__/param_autosub.cpython-39.pyc
  38. 22 22
      composer/pytranscriber/model/param_autosub.py
  39. 0 0
      composer/pytranscriber/util/__init__.py
  40. 0 0
      composer/pytranscriber/util/__pycache__/__init__.cpython-37.pyc
  41. 0 0
      composer/pytranscriber/util/__pycache__/__init__.cpython-38.pyc
  42. 0 0
      composer/pytranscriber/util/__pycache__/__init__.cpython-39.pyc
  43. 0 0
      composer/pytranscriber/util/__pycache__/srtparser.cpython-37.pyc
  44. 0 0
      composer/pytranscriber/util/__pycache__/srtparser.cpython-38.pyc
  45. 0 0
      composer/pytranscriber/util/__pycache__/srtparser.cpython-39.pyc
  46. 0 0
      composer/pytranscriber/util/__pycache__/util.cpython-37.pyc
  47. 0 0
      composer/pytranscriber/util/__pycache__/util.cpython-38.pyc
  48. 0 0
      composer/pytranscriber/util/__pycache__/util.cpython-39.pyc
  49. 49 49
      composer/pytranscriber/util/srtparser.py
  50. 44 44
      composer/pytranscriber/util/util.py

+ 0 - 0
pytranscriber/.DS_Store → composer/pytranscriber/.DS_Store


+ 0 - 0
pytranscriber/control/__init__.py → composer/pytranscriber/control/__init__.py


+ 0 - 0
pytranscriber/control/__pycache__/__init__.cpython-37.pyc → composer/pytranscriber/control/__pycache__/__init__.cpython-37.pyc


+ 0 - 0
pytranscriber/control/__pycache__/__init__.cpython-38.pyc → composer/pytranscriber/control/__pycache__/__init__.cpython-38.pyc


+ 0 - 0
pytranscriber/control/__pycache__/__init__.cpython-39.pyc → composer/pytranscriber/control/__pycache__/__init__.cpython-39.pyc


+ 0 - 0
pytranscriber/control/__pycache__/ctr_autosub.cpython-37.pyc → composer/pytranscriber/control/__pycache__/ctr_autosub.cpython-37.pyc


+ 0 - 0
pytranscriber/control/__pycache__/ctr_autosub.cpython-38.pyc → composer/pytranscriber/control/__pycache__/ctr_autosub.cpython-38.pyc


+ 0 - 0
pytranscriber/control/__pycache__/ctr_autosub.cpython-39.pyc → composer/pytranscriber/control/__pycache__/ctr_autosub.cpython-39.pyc


+ 0 - 0
pytranscriber/control/__pycache__/ctr_main.cpython-37.pyc → composer/pytranscriber/control/__pycache__/ctr_main.cpython-37.pyc


+ 0 - 0
pytranscriber/control/__pycache__/ctr_main.cpython-38.pyc → composer/pytranscriber/control/__pycache__/ctr_main.cpython-38.pyc


+ 0 - 0
pytranscriber/control/__pycache__/ctr_main.cpython-39.pyc → composer/pytranscriber/control/__pycache__/ctr_main.cpython-39.pyc


+ 0 - 0
pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-37.pyc → composer/pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-37.pyc


+ 0 - 0
pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-38.pyc → composer/pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-38.pyc


+ 0 - 0
pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-39.pyc → composer/pytranscriber/control/__pycache__/thread_cancel_autosub.cpython-39.pyc


+ 0 - 0
pytranscriber/control/__pycache__/thread_exec_autosub.cpython-37.pyc → composer/pytranscriber/control/__pycache__/thread_exec_autosub.cpython-37.pyc


+ 0 - 0
pytranscriber/control/__pycache__/thread_exec_autosub.cpython-38.pyc → composer/pytranscriber/control/__pycache__/thread_exec_autosub.cpython-38.pyc


+ 0 - 0
pytranscriber/control/__pycache__/thread_exec_autosub.cpython-39.pyc → composer/pytranscriber/control/__pycache__/thread_exec_autosub.cpython-39.pyc


+ 145 - 145
pytranscriber/control/ctr_autosub.py → composer/pytranscriber/control/ctr_autosub.py

@@ -1,145 +1,145 @@
-from autosub import FLACConverter
-from autosub import SpeechRecognizer
-from autosub import extract_audio
-from autosub import find_speech_regions
-from autosub import DEFAULT_CONCURRENCY
-from autosub import DEFAULT_SUBTITLE_FORMAT
-from autosub import GOOGLE_SPEECH_API_KEY
-from autosub.formatters import FORMATTERS
-
-import multiprocessing
-import time
-import os
-
-from pytranscriber.util.util import MyUtil
-
-
-class Ctr_Autosub():
-
-    cancel = False
-
-    @staticmethod
-    def init():
-        Ctr_Autosub.cancel = False
-
-    @staticmethod
-    def is_operation_canceled():
-        return Ctr_Autosub.cancel
-
-
-    @staticmethod
-    def output_progress(listener_progress, str_task, progress_percent):
-        # only update progress if not requested to cancel
-        if not Ctr_Autosub.cancel:
-            listener_progress(str_task, progress_percent)
-
-    @staticmethod
-    def cancel_operation():
-        Ctr_Autosub.cancel = True
-
-        while Ctr_Autosub.step == 0:
-            time.sleep(0.1)
-
-        # the first step involves ffmpeg and cannot be stopped safely
-        if Ctr_Autosub.step == 1:
-            # close wait for threads to finish their work first
-            Ctr_Autosub.pool.close()
-            Ctr_Autosub.pool.join()
-
-        else:
-            # terminates the threads immediately
-            Ctr_Autosub.pool.terminate()
-            Ctr_Autosub.pool.join()
-
-    @staticmethod
-    def generate_subtitles(# pylint: disable=too-many-locals,too-many-arguments
-            source_path,
-            src_language,
-            listener_progress,
-            output=None,
-            concurrency=DEFAULT_CONCURRENCY,
-            subtitle_file_format=DEFAULT_SUBTITLE_FORMAT
-        ):
-
-        # windows not support forkserver... only spawn
-        if os.name != "nt" and "Darwin" in os.uname():
-            # necessary for running on MacOS
-            # method can be set only once, otherwise crash
-            #from python 3.8 above the default for macos is spawn and not fork
-            if 'spawn' != multiprocessing.get_start_method(allow_none=True):
-                multiprocessing.set_start_method('spawn')
-        Ctr_Autosub.cancel = False
-        Ctr_Autosub.step = 0
-        """
-        Given an input audio/video file, generate subtitles in the specified language and format.
-        """
-        audio_filename, audio_rate = extract_audio(source_path)
-
-        regions = find_speech_regions(audio_filename)
-
-        converter = FLACConverter(source_path=audio_filename)
-        recognizer = SpeechRecognizer(language=src_language, rate=audio_rate,
-                                      api_key=GOOGLE_SPEECH_API_KEY)
-        transcripts = []
-        if regions:
-            try:
-                if Ctr_Autosub.cancel:
-                    return -1
-
-                str_task_1 = "Step 1 of 2: Converting speech regions to FLAC files "
-                len_regions = len(regions)
-                extracted_regions = []
-                Ctr_Autosub.pool = multiprocessing.Pool(concurrency)
-                for i, extracted_region in enumerate(Ctr_Autosub.pool.imap(converter, regions)):
-                    Ctr_Autosub.step = 1
-                    extracted_regions.append(extracted_region)
-                    progress_percent = MyUtil.percentage(i, len_regions)
-                    Ctr_Autosub.output_progress(listener_progress, str_task_1, progress_percent)
-                if Ctr_Autosub.cancel:
-                    return -1
-                else:
-                    Ctr_Autosub.pool.close()
-                    Ctr_Autosub.pool.join()
-
-                str_task_2 = "Step 2 of 2: Performing speech recognition "
-                Ctr_Autosub.pool = multiprocessing.Pool(concurrency)
-                for i, transcript in enumerate(Ctr_Autosub.pool.imap(recognizer, extracted_regions)):
-                    Ctr_Autosub.step = 2
-                    transcripts.append(transcript)
-                    progress_percent = MyUtil.percentage(i, len_regions)
-                    Ctr_Autosub.output_progress(listener_progress, str_task_2, progress_percent)
-
-                if Ctr_Autosub.cancel:
-                    return -1
-                else:
-                    Ctr_Autosub.pool.close()
-                    Ctr_Autosub.pool.join()
-
-            except KeyboardInterrupt:
-                Ctr_Autosub.pbar.finish()
-                Ctr_Autosub.pool.terminate()
-                Ctr_Autosub.pool.join()
-                raise
-
-        timed_subtitles = [(r, t) for r, t in zip(regions, transcripts) if t]
-        formatter = FORMATTERS.get(subtitle_file_format)
-        formatted_subtitles = formatter(timed_subtitles)
-
-        dest = output
-
-        if not dest:
-            base = os.path.splitext(source_path)[0]
-            dest = "{base}.{format}".format(base=base, format=subtitle_file_format)
-
-        with open(dest, 'wb') as output_file:
-            output_file.write(formatted_subtitles.encode("utf-8"))
-
-        os.remove(audio_filename)
-
-        if Ctr_Autosub.cancel:
-            return -1
-        else:
-            Ctr_Autosub.pool.close()
-            Ctr_Autosub.pool.join()
-
-        return dest
+from autosub import FLACConverter
+from autosub import SpeechRecognizer
+from autosub import extract_audio
+from autosub import find_speech_regions
+from autosub import DEFAULT_CONCURRENCY
+from autosub import DEFAULT_SUBTITLE_FORMAT
+from autosub import GOOGLE_SPEECH_API_KEY
+from autosub.formatters import FORMATTERS
+
+import multiprocessing
+import time
+import os
+
+from pytranscriber.util.util import MyUtil
+
+
+class Ctr_Autosub():
+
+    cancel = False
+
+    @staticmethod
+    def init():
+        Ctr_Autosub.cancel = False
+
+    @staticmethod
+    def is_operation_canceled():
+        return Ctr_Autosub.cancel
+
+
+    @staticmethod
+    def output_progress(listener_progress, str_task, progress_percent):
+        # only update progress if not requested to cancel
+        if not Ctr_Autosub.cancel:
+            listener_progress(str_task, progress_percent)
+
+    @staticmethod
+    def cancel_operation():
+        Ctr_Autosub.cancel = True
+
+        while Ctr_Autosub.step == 0:
+            time.sleep(0.1)
+
+        # the first step involves ffmpeg and cannot be stopped safely
+        if Ctr_Autosub.step == 1:
+            # close wait for threads to finish their work first
+            Ctr_Autosub.pool.close()
+            Ctr_Autosub.pool.join()
+
+        else:
+            # terminates the threads immediately
+            Ctr_Autosub.pool.terminate()
+            Ctr_Autosub.pool.join()
+
+    @staticmethod
+    def generate_subtitles(# pylint: disable=too-many-locals,too-many-arguments
+            source_path,
+            src_language,
+            listener_progress,
+            output=None,
+            concurrency=DEFAULT_CONCURRENCY,
+            subtitle_file_format=DEFAULT_SUBTITLE_FORMAT
+        ):
+
+        # windows not support forkserver... only spawn
+        if os.name != "nt" and "Darwin" in os.uname():
+            # necessary for running on MacOS
+            # method can be set only once, otherwise crash
+            #from python 3.8 above the default for macos is spawn and not fork
+            if 'spawn' != multiprocessing.get_start_method(allow_none=True):
+                multiprocessing.set_start_method('spawn')
+        Ctr_Autosub.cancel = False
+        Ctr_Autosub.step = 0
+        """
+        Given an input audio/video file, generate subtitles in the specified language and format.
+        """
+        audio_filename, audio_rate = extract_audio(source_path)
+
+        regions = find_speech_regions(audio_filename)
+
+        converter = FLACConverter(source_path=audio_filename)
+        recognizer = SpeechRecognizer(language=src_language, rate=audio_rate,
+                                      api_key=GOOGLE_SPEECH_API_KEY)
+        transcripts = []
+        if regions:
+            try:
+                if Ctr_Autosub.cancel:
+                    return -1
+
+                str_task_1 = "Step 1 of 2: Converting speech regions to FLAC files "
+                len_regions = len(regions)
+                extracted_regions = []
+                Ctr_Autosub.pool = multiprocessing.Pool(concurrency)
+                for i, extracted_region in enumerate(Ctr_Autosub.pool.imap(converter, regions)):
+                    Ctr_Autosub.step = 1
+                    extracted_regions.append(extracted_region)
+                    progress_percent = MyUtil.percentage(i, len_regions)
+                    Ctr_Autosub.output_progress(listener_progress, str_task_1, progress_percent)
+                if Ctr_Autosub.cancel:
+                    return -1
+                else:
+                    Ctr_Autosub.pool.close()
+                    Ctr_Autosub.pool.join()
+
+                str_task_2 = "Step 2 of 2: Performing speech recognition "
+                Ctr_Autosub.pool = multiprocessing.Pool(concurrency)
+                for i, transcript in enumerate(Ctr_Autosub.pool.imap(recognizer, extracted_regions)):
+                    Ctr_Autosub.step = 2
+                    transcripts.append(transcript)
+                    progress_percent = MyUtil.percentage(i, len_regions)
+                    Ctr_Autosub.output_progress(listener_progress, str_task_2, progress_percent)
+
+                if Ctr_Autosub.cancel:
+                    return -1
+                else:
+                    Ctr_Autosub.pool.close()
+                    Ctr_Autosub.pool.join()
+
+            except KeyboardInterrupt:
+                Ctr_Autosub.pbar.finish()
+                Ctr_Autosub.pool.terminate()
+                Ctr_Autosub.pool.join()
+                raise
+
+        timed_subtitles = [(r, t) for r, t in zip(regions, transcripts) if t]
+        formatter = FORMATTERS.get(subtitle_file_format)
+        formatted_subtitles = formatter(timed_subtitles)
+
+        dest = output
+
+        if not dest:
+            base = os.path.splitext(source_path)[0]
+            dest = "{base}.{format}".format(base=base, format=subtitle_file_format)
+
+        with open(dest, 'wb') as output_file:
+            output_file.write(formatted_subtitles.encode("utf-8"))
+
+        os.remove(audio_filename)
+
+        if Ctr_Autosub.cancel:
+            return -1
+        else:
+            Ctr_Autosub.pool.close()
+            Ctr_Autosub.pool.join()
+
+        return dest

+ 413 - 413
pytranscriber/control/ctr_main.py → composer/pytranscriber/control/ctr_main.py

@@ -1,413 +1,413 @@
-'''
-   (C) 2019 Raryel C. Souza
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-'''
-
-from PyQt5 import QtCore, QtWidgets
-from PyQt5.QtWidgets import QFileDialog, QMessageBox
-from PyQt5.QtCore import Qt
-from pathlib import Path
-from pytranscriber.model.param_autosub import Param_Autosub
-from pytranscriber.util.util import MyUtil
-from pytranscriber.control.thread_exec_autosub import Thread_Exec_Autosub
-from pytranscriber.control.thread_cancel_autosub import Thread_Cancel_Autosub
-from pytranscriber.gui.gui import Ui_window
-import os
-
-
-class Ctr_Main():
-
-    def __init__(self):
-        import sys
-        app = QtWidgets.QApplication(sys.argv)
-        window = QtWidgets.QMainWindow()
-        self.objGUI = Ui_window()
-        self.objGUI.setupUi(window)
-        self.__initGUI()
-        window.setFixedSize(window.size())
-        window.show()
-        sys.exit(app.exec_())
-
-
-
-    def __initGUI(self):
-
-        #language selection list
-        list_languages =  [ "en-US - English (United States)",
-                            "en-AU - English (Australia)",
-                            "en-CA - English (Canada)",
-                            "en-GB - English (United Kingdom)",
-                            "en-HK - English (Hong Kong)",
-                            "en-IN - English (India)",
-                            "en-GB - English (Ireland)",
-                            "en-NZ - English (New Zealand)",
-                            "en-PH - English (Philippines)",
-                            "en-SG - English (Singapore)",
-                            "af - Afrikaans",
-                            "ar - Arabic",
-                            'ar-DZ - Arabic (Algeria)',
-                            'ar-EG - Arabic (Egypt)',
-                            'ar-IQ - Arabic (Iraq)',
-                            'ar-IS - Arabic (Israel)',
-                            'ar-JO - Arabic (Jordan)',
-                            'ar-KW - Arabic (Kuwait)',
-                            'ar-LB - Arabic (Lebanon)',
-                            'ar-MA - Arabic (Morocco)',
-                            'ar-OM - Arabic (Oman)',
-                            'ar-QA - Arabic (Qatar)',
-                            'ar-SA - Arabic (Saudi Arabia)',
-                            'ar-PS - Arabic (State of Palestine)',
-                            'ar-TN - Arabic (Tunisia)',
-                            'ar-AE - Arabic (United Arab Emirates)',
-                            'ar-YE - Arabic (Yemen)',
-                            "az - Azerbaijani",
-                            "be - Belarusian",
-                            "bg - Bulgarian",
-                            "bn - Bengali",
-                            "bs - Bosnian",
-                            "ca - Catalan",
-                            "ceb -Cebuano",
-                            "cs - Czech",
-                            "cy - Welsh",
-                            "da - Danish",
-                            "de - German",
-                            'de-AT - German (Austria)',
-                            'de-CH - German (Switzerland)',
-                            "el - Greek",
-                            "eo - Esperanto",
-                            'es-ES - Spanish (Spain)',
-                            'es-AR - Spanish (Argentina)',
-                            'es-BO - Spanish (Bolivia)',
-                            'es-CL - Spanish (Chile)',
-                            'es-CO - Spanish (Colombia)',
-                            'es-CR - Spanish (Costa Rica)',
-                            'es-DO - Spanish (Dominican Republic)',
-                            'es-EC - Spanish (Ecuador)',
-                            'es-GT - Spanish (Guatemala)',
-                            'es-HN - Spanish (Honduras)',
-                            'es-MX - Spanish (Mexico)',
-                            'es-NI - Spanish (Nicaragua)',
-                            'es-PA - Spanish (Panama)',
-                            'es-PE - Spanish (Peru)',
-                            'es-PR - Spanish (Puerto Rico)',
-                            'es-PY - Spanish (Paraguay)',
-                            'es-SV - Spanish (El Salvador)',
-                            'es-UY - Spanish (Uruguay)',
-                            'es-US - Spanish (United States)',
-                            'es-VE - Spanish (Venezuela)',
-                            "et - Estonian",
-                            "eu - Basque",
-                            "fa - Persian",
-                            'fil-PH - Filipino (Philippines)',
-                            "fi - Finnish",
-                            "fr - French",
-                            'fr-BE - French (Belgium)',
-                            'fr-CA - French (Canada)',
-                            'fr-CH - French (Switzerland)',
-                            "ga - Irish",
-                            "gl - Galician",
-                            "gu -Gujarati",
-                            "ha - Hausa",
-                            "hi - Hindi",
-                            "hmn - Hmong",
-                            "hr - Croatian",
-                            "ht - Haitian Creole",
-                            "hu - Hungarian",
-                            "hy - Armenian",
-                            "id - Indonesian",
-                            "ig - Igbo",
-                            "is - Icelandic",
-                            "it - Italian",
-                            'it-CH - Italian (Switzerland)',
-                            "iw - Hebrew",
-                            "ja - Japanese",
-                            "jw - Javanese",
-                            "ka - Georgian",
-                            "kk - Kazakh",
-                            "km - Khmer",
-                            "kn - Kannada",
-                            "ko - Korean",
-                            "la - Latin",
-                            "lo - Lao",
-                            "lt - Lithuanian",
-                            "lv - Latvian",
-                            "mg - Malagasy",
-                            "mi - Maori",
-                            "mk - Macedonian",
-                            "ml - Malayalam",
-                            "mn - Mongolian",
-                            "mr - Marathi",
-                            "ms - Malay",
-                            "mt - Maltese",
-                            "my - Myanmar (Burmese)",
-                            "ne - Nepali",
-                            "nl - Dutch",
-                            "no - Norwegian",
-                            "ny - Chichewa",
-                            "pa - Punjabi",
-                            "pl - Polish",
-                            "pt-BR - Portuguese (Brazil)",
-                            "pt-PT - Portuguese (Portugal)",
-                            "ro - Romanian",
-                            "ru - Russian",
-                            "si - Sinhala",
-                            "sk - Slovak",
-                            "sl - Slovenian",
-                            "so - Somali",
-                            "sq - Albanian",
-                            "sr - Serbian",
-                            "st - Sesotho",
-                            "su - Sudanese",
-                            "sv - Swedish",
-                            "sw - Swahili",
-                            "ta - Tamil",
-                            'ta-IN - Tamil (India)',
-                            'ta-MY - Tamil (Malaysia)',
-                            'ta-SG - Tamil (Singapore)',
-                            'ta-LK - Tamil (Sri Lanka)',
-                            "te - Telugu",
-                            "tg - Tajik",
-                            "th - Thai",
-                            "tl - Filipino",
-                            "tr - Turkish",
-                            "uk - Ukrainian",
-                            "ur - Urdu",
-                            "uz - Uzbek",
-                            "vi - Vietnamese",
-                            "yi - Yiddish",
-                            "yo - Yoruba",
-                            "yue-Hant-HK - Cantonese (Traditional, HK)",
-                            "zh - Chinese (Simplified, China)",
-                            "zh-HK - Chinese (Simplified, Hong Kong)",
-                            "zh-TW - Chinese (Traditional, Taiwan)",
-                            "zu - Zulu" ]
-
-        self.objGUI.cbSelectLang.addItems(list_languages)
-        self.__listenerProgress("", 0)
-
-        #default output folder at user desktop
-        userHome = Path.home()
-        pathOutputFolder = userHome / 'Desktop' / 'pyTranscriber'
-        self.objGUI.qleOutputFolder.setText(str(pathOutputFolder))
-
-        self.objGUI.bRemoveFile.setEnabled(False)
-
-        self.objGUI.bCancel.hide()
-
-        #button listeners
-        self.objGUI.bConvert.clicked.connect(self.__listenerBExec)
-        self.objGUI.bCancel.clicked.connect(self.__listenerBCancel)
-        self.objGUI.bRemoveFile.clicked.connect(self.__listenerBRemove)
-        self.objGUI.bSelectOutputFolder.clicked.connect(self.__listenerBSelectOuputFolder)
-        self.objGUI.bOpenOutputFolder.clicked.connect(self.__listenerBOpenOutputFolder)
-        self.objGUI.bSelectMedia.clicked.connect(self.__listenerBSelectMedia)
-
-        self.objGUI.actionLicense.triggered.connect(self.__listenerBLicense)
-        self.objGUI.actionDonation.triggered.connect(self.__listenerBDonation)
-        self.objGUI.actionAbout_pyTranscriber.triggered.connect(self.__listenerBAboutpyTranscriber)
-
-    def __resetGUIAfterSuccess(self):
-        self.__resetGUIAfterCancel()
-
-        self.objGUI.qlwListFilesSelected.clear()
-        self.objGUI.bConvert.setEnabled(False)
-        self.objGUI.bRemoveFile.setEnabled(False)
-
-    def __resetGUIAfterCancel(self):
-
-        self.__resetProgressBar()
-
-        self.objGUI.bSelectMedia.setEnabled(True)
-        self.objGUI.bSelectOutputFolder.setEnabled(True)
-        self.objGUI.cbSelectLang.setEnabled(True)
-        self.objGUI.chbxOpenOutputFilesAuto.setEnabled(True)
-
-        self.objGUI.bCancel.hide()
-        self.objGUI.bConvert.setEnabled(True)
-        self.objGUI.bRemoveFile.setEnabled(True)
-
-    def __lockButtonsDuringOperation(self):
-        self.objGUI.bConvert.setEnabled(False)
-        self.objGUI.bRemoveFile.setEnabled(False)
-        self.objGUI.bSelectMedia.setEnabled(False)
-        self.objGUI.bSelectOutputFolder.setEnabled(False)
-        self.objGUI.cbSelectLang.setEnabled(False)
-        self.objGUI.chbxOpenOutputFilesAuto.setEnabled(False)
-        QtCore.QCoreApplication.processEvents()
-
-    def __listenerProgress(self, str, percent):
-        self.objGUI.labelCurrentOperation.setText(str)
-        self.objGUI.progressBar.setProperty("value", percent)
-        QtCore.QCoreApplication.processEvents()
-
-    def __setProgressBarIndefinite(self):
-        self.objGUI.progressBar.setMinimum(0)
-        self.objGUI.progressBar.setMaximum(0)
-        self.objGUI.progressBar.setValue(0)
-
-    def __resetProgressBar(self):
-        self.objGUI.progressBar.setMinimum(0)
-        self.objGUI.progressBar.setMaximum(100)
-        self.objGUI.progressBar.setValue(0)
-        self.__listenerProgress("", 0)
-
-    def __updateProgressFileYofN(self, str):
-        self.objGUI.labelProgressFileIndex.setText(str)
-        QtCore.QCoreApplication.processEvents()
-
-    def __listenerBSelectOuputFolder(self):
-        fSelectDir = QFileDialog.getExistingDirectory(self.objGUI.centralwidget)
-        if fSelectDir:
-            self.objGUI.qleOutputFolder.setText(fSelectDir)
-
-    def __listenerBSelectMedia(self):
-        #options = QFileDialog.Options()
-        options = QFileDialog.DontUseNativeDialog
-        files, _ = QFileDialog.getOpenFileNames(self.objGUI.centralwidget, "Select media", "","All Media Files (*.mp3 *.mp4 *.wav *.m4a *.wma)")
-
-        if files:
-            self.objGUI.qlwListFilesSelected.addItems(files)
-
-            #enable the convert button only if list of files is not empty
-            self.objGUI.bConvert.setEnabled(True)
-            self.objGUI.bRemoveFile.setEnabled(True)
-
-
-    def __listenerBExec(self):
-        if not MyUtil.is_internet_connected():
-            self.__showErrorMessage("Error! Cannot reach Google Speech Servers. \n\n1) Please make sure you are connected to the internet. \n2) If you are in China or other place that blocks access to Google servers: please install and enable a desktop-wide VPN app like Windscribe before trying to use pyTranscriber!")
-        else:
-            #extracts the two letter lang_code from the string on language selection
-            selectedLanguage = self.objGUI.cbSelectLang.currentText()
-            indexSpace = selectedLanguage.index(" ")
-            langCode = selectedLanguage[:indexSpace]
-
-            listFiles = []
-            for i in range(self.objGUI.qlwListFilesSelected.count()):
-                listFiles.append(str(self.objGUI.qlwListFilesSelected.item(i).text()))
-
-            outputFolder = self.objGUI.qleOutputFolder.text()
-
-            if self.objGUI.chbxOpenOutputFilesAuto.checkState() == Qt.Checked:
-                boolOpenOutputFilesAuto = True
-            else:
-                boolOpenOutputFilesAuto = False
-
-            objParamAutosub = Param_Autosub(listFiles, outputFolder, langCode,
-                                            boolOpenOutputFilesAuto)
-
-            #execute the main process in separate thread to avoid gui lock
-            self.thread_exec = Thread_Exec_Autosub(objParamAutosub)
-
-            #connect signals from work thread to gui controls
-            self.thread_exec.signalLockGUI.connect(self.__lockButtonsDuringOperation)
-            self.thread_exec.signalResetGUIAfterSuccess.connect(self.__resetGUIAfterSuccess)
-            self.thread_exec.signalResetGUIAfterCancel.connect(self.__resetGUIAfterCancel)
-            self.thread_exec.signalProgress.connect(self.__listenerProgress)
-            self.thread_exec.signalProgressFileYofN.connect(self.__updateProgressFileYofN)
-            self.thread_exec.signalErrorMsg.connect(self.__showErrorMessage)
-            self.thread_exec.start()
-
-            #Show the cancel button
-            self.objGUI.bCancel.show()
-            self.objGUI.bCancel.setEnabled(True)
-
-    def __listenerBCancel(self):
-        self.objGUI.bCancel.setEnabled(False)
-        self.thread_cancel = Thread_Cancel_Autosub(self.thread_exec)
-
-        #Only if worker thread is running
-        if self.thread_exec and self.thread_exec.isRunning():
-            #reset progress indicator
-            self.__listenerProgress("Cancelling", 0)
-            self.__setProgressBarIndefinite()
-            self.__updateProgressFileYofN("")
-
-            #connect the terminate signal to resetGUI
-            self.thread_cancel.signalTerminated.connect(self.__resetGUIAfterCancel)
-            #run the cancel autosub operation in new thread
-            #to avoid progressbar freezing
-            self.thread_cancel.start()
-            self.thread_exec = None
-
-    def __listenerBRemove(self):
-        indexSelected = self.objGUI.qlwListFilesSelected.currentRow()
-        if indexSelected >= 0:
-            self.objGUI.qlwListFilesSelected.takeItem(indexSelected)
-
-        #if no items left disables the remove and convert button
-        if self.objGUI.qlwListFilesSelected.count() == 0:
-            self.objGUI.bRemoveFile.setEnabled(False)
-            self.objGUI.bConvert.setEnabled(False)
-
-    def __listenerBOpenOutputFolder(self):
-        pathOutputFolder = Path(self.objGUI.qleOutputFolder.text())
-
-        #if folder exists and is valid directory
-        if os.path.exists(pathOutputFolder) and os.path.isdir(pathOutputFolder):
-            MyUtil.open_file(pathOutputFolder)
-        else:
-            self.__showErrorMessage("Error! Invalid output folder.")
-
-    def __listenerBLicense(self):
-        self.__showInfoMessage("<html><body><a href=\"https://www.gnu.org/licenses/gpl-3.0.html\">GPL License</a><br><br>"
-                + "Copyright (C) 2019 Raryel C. Souza <raryel.costa at gmail.com><br>"
-                + "<br>This program is free software: you can redistribute it and/or modify<br>"
-                + "it under the terms of the GNU General Public License as published by<br>"
-                + "the Free Software Foundation, either version 3 of the License, or<br>"
-                + " any later version<br>"
-                + "<br>"
-                + "This program is distributed in the hope that it will be useful,<br>"
-                + "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>"
-                + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>"
-                + "GNU General Public License for more details.<br>"
-                + "<br>"
-                + "You should have received a copy of the GNU General Public License<br>"
-                + "along with this program.  If not, see <a href=\"https://www.gnu.org/licenses\">www.gnu.org/licenses</a>."
-                + "</body></html>", "License")
-
-    def __listenerBDonation(self):
-        self.__showInfoMessage("<html><body>"
-                + "pyTranscriber is developed as a hobby, so donations of any value are welcomed and essential for further improvements and fixes."
-                + "<br><br>If you feel that this software has been useful and would like to contribute for it to continue improve and have more features and fixes you can <a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YHB854YHPJCU8&item_name=Donation+pyTranscriber&currency_code=BRL\">DONATE VIA PAYPAL</a> or <a href=\"https://blockchain.com/btc/payment_request?address=153LcqV59paxEEJX7riLrEHQbE54vhcko9&amount=0.00026351&message=Donation to support pyTranscriber development\"> DONATE US$5 VIA BITCOIN</a>."
-                + "<br><br>Thanks in advance!"
-                + "</body></html>", "DONATIONS")
-
-    def __listenerBAboutpyTranscriber(self):
-        self.__showInfoMessage("<html><body>"
-                + "<a href=\"https://github.com/raryelcostasouza/pyTranscriber\">pyTranscriber</a> is an application that can be used "
-                + "to generate <b>automatic transcription / automatic subtitles </b>"
-                + "for audio/video files through a friendly graphical user interface. "
-                + "<br><br>"
-                + "The hard work of speech recognition is made by the <a href=\"https://cloud.google.com/speech/\">Google Speech Recognition API</a> "
-                + "using <a href=\"https://github.com/agermanidis/autosub\">Autosub</a>"
-                + "<br><br>pyTranscriber is developed as a hobby, so donations of any value are welcomed and essential for further improvements and fixes."
-                + "<br><br>If you feel that this software has been useful and would like to contribute for it to continue improve and have more features and fixes you can <a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YHB854YHPJCU8&item_name=Donation+pyTranscriber&currency_code=BRL\">DONATE VIA PAYPAL</a> or <a href=\"https://blockchain.com/btc/payment_request?address=153LcqV59paxEEJX7riLrEHQbE54vhcko9&amount=0.00026351&message=Donation to support pyTranscriber development\"> DONATE US$5 VIA BITCOIN</a>."
-                + "<br><br>Thanks in advance!"
-                + "</body></html>", "About pyTranscriber")
-
-
-    def __showInfoMessage(self, info_msg, title):
-        msg = QMessageBox()
-        msg.setIcon(QMessageBox.Information)
-
-        msg.setWindowTitle(title)
-        msg.setText(info_msg)
-        msg.exec()
-
-    def __showErrorMessage(self, errorMsg):
-        msg = QMessageBox()
-        msg.setIcon(QMessageBox.Critical)
-
-        msg.setWindowTitle("Error!")
-        msg.setText(errorMsg)
-        msg.exec()
+'''
+   (C) 2019 Raryel C. Souza
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+'''
+
+from PyQt5 import QtCore, QtWidgets
+from PyQt5.QtWidgets import QFileDialog, QMessageBox
+from PyQt5.QtCore import Qt
+from pathlib import Path
+from pytranscriber.model.param_autosub import Param_Autosub
+from pytranscriber.util.util import MyUtil
+from pytranscriber.control.thread_exec_autosub import Thread_Exec_Autosub
+from pytranscriber.control.thread_cancel_autosub import Thread_Cancel_Autosub
+from pytranscriber.gui.gui import Ui_window
+import os
+
+
+class Ctr_Main():
+
+    def __init__(self):
+        import sys
+        app = QtWidgets.QApplication(sys.argv)
+        window = QtWidgets.QMainWindow()
+        self.objGUI = Ui_window()
+        self.objGUI.setupUi(window)
+        self.__initGUI()
+        window.setFixedSize(window.size())
+        window.show()
+        sys.exit(app.exec_())
+
+
+
+    def __initGUI(self):
+
+        #language selection list
+        list_languages =  [ "en-US - English (United States)",
+                            "en-AU - English (Australia)",
+                            "en-CA - English (Canada)",
+                            "en-GB - English (United Kingdom)",
+                            "en-HK - English (Hong Kong)",
+                            "en-IN - English (India)",
+                            "en-GB - English (Ireland)",
+                            "en-NZ - English (New Zealand)",
+                            "en-PH - English (Philippines)",
+                            "en-SG - English (Singapore)",
+                            "af - Afrikaans",
+                            "ar - Arabic",
+                            'ar-DZ - Arabic (Algeria)',
+                            'ar-EG - Arabic (Egypt)',
+                            'ar-IQ - Arabic (Iraq)',
+                            'ar-IS - Arabic (Israel)',
+                            'ar-JO - Arabic (Jordan)',
+                            'ar-KW - Arabic (Kuwait)',
+                            'ar-LB - Arabic (Lebanon)',
+                            'ar-MA - Arabic (Morocco)',
+                            'ar-OM - Arabic (Oman)',
+                            'ar-QA - Arabic (Qatar)',
+                            'ar-SA - Arabic (Saudi Arabia)',
+                            'ar-PS - Arabic (State of Palestine)',
+                            'ar-TN - Arabic (Tunisia)',
+                            'ar-AE - Arabic (United Arab Emirates)',
+                            'ar-YE - Arabic (Yemen)',
+                            "az - Azerbaijani",
+                            "be - Belarusian",
+                            "bg - Bulgarian",
+                            "bn - Bengali",
+                            "bs - Bosnian",
+                            "ca - Catalan",
+                            "ceb -Cebuano",
+                            "cs - Czech",
+                            "cy - Welsh",
+                            "da - Danish",
+                            "de - German",
+                            'de-AT - German (Austria)',
+                            'de-CH - German (Switzerland)',
+                            "el - Greek",
+                            "eo - Esperanto",
+                            'es-ES - Spanish (Spain)',
+                            'es-AR - Spanish (Argentina)',
+                            'es-BO - Spanish (Bolivia)',
+                            'es-CL - Spanish (Chile)',
+                            'es-CO - Spanish (Colombia)',
+                            'es-CR - Spanish (Costa Rica)',
+                            'es-DO - Spanish (Dominican Republic)',
+                            'es-EC - Spanish (Ecuador)',
+                            'es-GT - Spanish (Guatemala)',
+                            'es-HN - Spanish (Honduras)',
+                            'es-MX - Spanish (Mexico)',
+                            'es-NI - Spanish (Nicaragua)',
+                            'es-PA - Spanish (Panama)',
+                            'es-PE - Spanish (Peru)',
+                            'es-PR - Spanish (Puerto Rico)',
+                            'es-PY - Spanish (Paraguay)',
+                            'es-SV - Spanish (El Salvador)',
+                            'es-UY - Spanish (Uruguay)',
+                            'es-US - Spanish (United States)',
+                            'es-VE - Spanish (Venezuela)',
+                            "et - Estonian",
+                            "eu - Basque",
+                            "fa - Persian",
+                            'fil-PH - Filipino (Philippines)',
+                            "fi - Finnish",
+                            "fr - French",
+                            'fr-BE - French (Belgium)',
+                            'fr-CA - French (Canada)',
+                            'fr-CH - French (Switzerland)',
+                            "ga - Irish",
+                            "gl - Galician",
+                            "gu -Gujarati",
+                            "ha - Hausa",
+                            "hi - Hindi",
+                            "hmn - Hmong",
+                            "hr - Croatian",
+                            "ht - Haitian Creole",
+                            "hu - Hungarian",
+                            "hy - Armenian",
+                            "id - Indonesian",
+                            "ig - Igbo",
+                            "is - Icelandic",
+                            "it - Italian",
+                            'it-CH - Italian (Switzerland)',
+                            "iw - Hebrew",
+                            "ja - Japanese",
+                            "jw - Javanese",
+                            "ka - Georgian",
+                            "kk - Kazakh",
+                            "km - Khmer",
+                            "kn - Kannada",
+                            "ko - Korean",
+                            "la - Latin",
+                            "lo - Lao",
+                            "lt - Lithuanian",
+                            "lv - Latvian",
+                            "mg - Malagasy",
+                            "mi - Maori",
+                            "mk - Macedonian",
+                            "ml - Malayalam",
+                            "mn - Mongolian",
+                            "mr - Marathi",
+                            "ms - Malay",
+                            "mt - Maltese",
+                            "my - Myanmar (Burmese)",
+                            "ne - Nepali",
+                            "nl - Dutch",
+                            "no - Norwegian",
+                            "ny - Chichewa",
+                            "pa - Punjabi",
+                            "pl - Polish",
+                            "pt-BR - Portuguese (Brazil)",
+                            "pt-PT - Portuguese (Portugal)",
+                            "ro - Romanian",
+                            "ru - Russian",
+                            "si - Sinhala",
+                            "sk - Slovak",
+                            "sl - Slovenian",
+                            "so - Somali",
+                            "sq - Albanian",
+                            "sr - Serbian",
+                            "st - Sesotho",
+                            "su - Sudanese",
+                            "sv - Swedish",
+                            "sw - Swahili",
+                            "ta - Tamil",
+                            'ta-IN - Tamil (India)',
+                            'ta-MY - Tamil (Malaysia)',
+                            'ta-SG - Tamil (Singapore)',
+                            'ta-LK - Tamil (Sri Lanka)',
+                            "te - Telugu",
+                            "tg - Tajik",
+                            "th - Thai",
+                            "tl - Filipino",
+                            "tr - Turkish",
+                            "uk - Ukrainian",
+                            "ur - Urdu",
+                            "uz - Uzbek",
+                            "vi - Vietnamese",
+                            "yi - Yiddish",
+                            "yo - Yoruba",
+                            "yue-Hant-HK - Cantonese (Traditional, HK)",
+                            "zh - Chinese (Simplified, China)",
+                            "zh-HK - Chinese (Simplified, Hong Kong)",
+                            "zh-TW - Chinese (Traditional, Taiwan)",
+                            "zu - Zulu" ]
+
+        self.objGUI.cbSelectLang.addItems(list_languages)
+        self.__listenerProgress("", 0)
+
+        #default output folder at user desktop
+        userHome = Path.home()
+        pathOutputFolder = userHome / 'Desktop' / 'pyTranscriber'
+        self.objGUI.qleOutputFolder.setText(str(pathOutputFolder))
+
+        self.objGUI.bRemoveFile.setEnabled(False)
+
+        self.objGUI.bCancel.hide()
+
+        #button listeners
+        self.objGUI.bConvert.clicked.connect(self.__listenerBExec)
+        self.objGUI.bCancel.clicked.connect(self.__listenerBCancel)
+        self.objGUI.bRemoveFile.clicked.connect(self.__listenerBRemove)
+        self.objGUI.bSelectOutputFolder.clicked.connect(self.__listenerBSelectOuputFolder)
+        self.objGUI.bOpenOutputFolder.clicked.connect(self.__listenerBOpenOutputFolder)
+        self.objGUI.bSelectMedia.clicked.connect(self.__listenerBSelectMedia)
+
+        self.objGUI.actionLicense.triggered.connect(self.__listenerBLicense)
+        self.objGUI.actionDonation.triggered.connect(self.__listenerBDonation)
+        self.objGUI.actionAbout_pyTranscriber.triggered.connect(self.__listenerBAboutpyTranscriber)
+
+    def __resetGUIAfterSuccess(self):
+        self.__resetGUIAfterCancel()
+
+        self.objGUI.qlwListFilesSelected.clear()
+        self.objGUI.bConvert.setEnabled(False)
+        self.objGUI.bRemoveFile.setEnabled(False)
+
+    def __resetGUIAfterCancel(self):
+
+        self.__resetProgressBar()
+
+        self.objGUI.bSelectMedia.setEnabled(True)
+        self.objGUI.bSelectOutputFolder.setEnabled(True)
+        self.objGUI.cbSelectLang.setEnabled(True)
+        self.objGUI.chbxOpenOutputFilesAuto.setEnabled(True)
+
+        self.objGUI.bCancel.hide()
+        self.objGUI.bConvert.setEnabled(True)
+        self.objGUI.bRemoveFile.setEnabled(True)
+
+    def __lockButtonsDuringOperation(self):
+        self.objGUI.bConvert.setEnabled(False)
+        self.objGUI.bRemoveFile.setEnabled(False)
+        self.objGUI.bSelectMedia.setEnabled(False)
+        self.objGUI.bSelectOutputFolder.setEnabled(False)
+        self.objGUI.cbSelectLang.setEnabled(False)
+        self.objGUI.chbxOpenOutputFilesAuto.setEnabled(False)
+        QtCore.QCoreApplication.processEvents()
+
+    def __listenerProgress(self, str, percent):
+        self.objGUI.labelCurrentOperation.setText(str)
+        self.objGUI.progressBar.setProperty("value", percent)
+        QtCore.QCoreApplication.processEvents()
+
+    def __setProgressBarIndefinite(self):
+        self.objGUI.progressBar.setMinimum(0)
+        self.objGUI.progressBar.setMaximum(0)
+        self.objGUI.progressBar.setValue(0)
+
+    def __resetProgressBar(self):
+        self.objGUI.progressBar.setMinimum(0)
+        self.objGUI.progressBar.setMaximum(100)
+        self.objGUI.progressBar.setValue(0)
+        self.__listenerProgress("", 0)
+
+    def __updateProgressFileYofN(self, str):
+        self.objGUI.labelProgressFileIndex.setText(str)
+        QtCore.QCoreApplication.processEvents()
+
+    def __listenerBSelectOuputFolder(self):
+        fSelectDir = QFileDialog.getExistingDirectory(self.objGUI.centralwidget)
+        if fSelectDir:
+            self.objGUI.qleOutputFolder.setText(fSelectDir)
+
+    def __listenerBSelectMedia(self):
+        #options = QFileDialog.Options()
+        options = QFileDialog.DontUseNativeDialog
+        files, _ = QFileDialog.getOpenFileNames(self.objGUI.centralwidget, "Select media", "","All Media Files (*.mp3 *.mp4 *.wav *.m4a *.wma)")
+
+        if files:
+            self.objGUI.qlwListFilesSelected.addItems(files)
+
+            #enable the convert button only if list of files is not empty
+            self.objGUI.bConvert.setEnabled(True)
+            self.objGUI.bRemoveFile.setEnabled(True)
+
+
+    def __listenerBExec(self):
+        if not MyUtil.is_internet_connected():
+            self.__showErrorMessage("Error! Cannot reach Google Speech Servers. \n\n1) Please make sure you are connected to the internet. \n2) If you are in China or other place that blocks access to Google servers: please install and enable a desktop-wide VPN app like Windscribe before trying to use pyTranscriber!")
+        else:
+            #extracts the two letter lang_code from the string on language selection
+            selectedLanguage = self.objGUI.cbSelectLang.currentText()
+            indexSpace = selectedLanguage.index(" ")
+            langCode = selectedLanguage[:indexSpace]
+
+            listFiles = []
+            for i in range(self.objGUI.qlwListFilesSelected.count()):
+                listFiles.append(str(self.objGUI.qlwListFilesSelected.item(i).text()))
+
+            outputFolder = self.objGUI.qleOutputFolder.text()
+
+            if self.objGUI.chbxOpenOutputFilesAuto.checkState() == Qt.Checked:
+                boolOpenOutputFilesAuto = True
+            else:
+                boolOpenOutputFilesAuto = False
+
+            objParamAutosub = Param_Autosub(listFiles, outputFolder, langCode,
+                                            boolOpenOutputFilesAuto)
+
+            #execute the main process in separate thread to avoid gui lock
+            self.thread_exec = Thread_Exec_Autosub(objParamAutosub)
+
+            #connect signals from work thread to gui controls
+            self.thread_exec.signalLockGUI.connect(self.__lockButtonsDuringOperation)
+            self.thread_exec.signalResetGUIAfterSuccess.connect(self.__resetGUIAfterSuccess)
+            self.thread_exec.signalResetGUIAfterCancel.connect(self.__resetGUIAfterCancel)
+            self.thread_exec.signalProgress.connect(self.__listenerProgress)
+            self.thread_exec.signalProgressFileYofN.connect(self.__updateProgressFileYofN)
+            self.thread_exec.signalErrorMsg.connect(self.__showErrorMessage)
+            self.thread_exec.start()
+
+            #Show the cancel button
+            self.objGUI.bCancel.show()
+            self.objGUI.bCancel.setEnabled(True)
+
+    def __listenerBCancel(self):
+        self.objGUI.bCancel.setEnabled(False)
+        self.thread_cancel = Thread_Cancel_Autosub(self.thread_exec)
+
+        #Only if worker thread is running
+        if self.thread_exec and self.thread_exec.isRunning():
+            #reset progress indicator
+            self.__listenerProgress("Cancelling", 0)
+            self.__setProgressBarIndefinite()
+            self.__updateProgressFileYofN("")
+
+            #connect the terminate signal to resetGUI
+            self.thread_cancel.signalTerminated.connect(self.__resetGUIAfterCancel)
+            #run the cancel autosub operation in new thread
+            #to avoid progressbar freezing
+            self.thread_cancel.start()
+            self.thread_exec = None
+
+    def __listenerBRemove(self):
+        indexSelected = self.objGUI.qlwListFilesSelected.currentRow()
+        if indexSelected >= 0:
+            self.objGUI.qlwListFilesSelected.takeItem(indexSelected)
+
+        #if no items left disables the remove and convert button
+        if self.objGUI.qlwListFilesSelected.count() == 0:
+            self.objGUI.bRemoveFile.setEnabled(False)
+            self.objGUI.bConvert.setEnabled(False)
+
+    def __listenerBOpenOutputFolder(self):
+        pathOutputFolder = Path(self.objGUI.qleOutputFolder.text())
+
+        #if folder exists and is valid directory
+        if os.path.exists(pathOutputFolder) and os.path.isdir(pathOutputFolder):
+            MyUtil.open_file(pathOutputFolder)
+        else:
+            self.__showErrorMessage("Error! Invalid output folder.")
+
+    def __listenerBLicense(self):
+        self.__showInfoMessage("<html><body><a href=\"https://www.gnu.org/licenses/gpl-3.0.html\">GPL License</a><br><br>"
+                + "Copyright (C) 2019 Raryel C. Souza <raryel.costa at gmail.com><br>"
+                + "<br>This program is free software: you can redistribute it and/or modify<br>"
+                + "it under the terms of the GNU General Public License as published by<br>"
+                + "the Free Software Foundation, either version 3 of the License, or<br>"
+                + " any later version<br>"
+                + "<br>"
+                + "This program is distributed in the hope that it will be useful,<br>"
+                + "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>"
+                + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>"
+                + "GNU General Public License for more details.<br>"
+                + "<br>"
+                + "You should have received a copy of the GNU General Public License<br>"
+                + "along with this program.  If not, see <a href=\"https://www.gnu.org/licenses\">www.gnu.org/licenses</a>."
+                + "</body></html>", "License")
+
+    def __listenerBDonation(self):
+        self.__showInfoMessage("<html><body>"
+                + "pyTranscriber is developed as a hobby, so donations of any value are welcomed and essential for further improvements and fixes."
+                + "<br><br>If you feel that this software has been useful and would like to contribute for it to continue improve and have more features and fixes you can <a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YHB854YHPJCU8&item_name=Donation+pyTranscriber&currency_code=BRL\">DONATE VIA PAYPAL</a> or <a href=\"https://blockchain.com/btc/payment_request?address=153LcqV59paxEEJX7riLrEHQbE54vhcko9&amount=0.00026351&message=Donation to support pyTranscriber development\"> DONATE US$5 VIA BITCOIN</a>."
+                + "<br><br>Thanks in advance!"
+                + "</body></html>", "DONATIONS")
+
+    def __listenerBAboutpyTranscriber(self):
+        self.__showInfoMessage("<html><body>"
+                + "<a href=\"https://github.com/raryelcostasouza/pyTranscriber\">pyTranscriber</a> is an application that can be used "
+                + "to generate <b>automatic transcription / automatic subtitles </b>"
+                + "for audio/video files through a friendly graphical user interface. "
+                + "<br><br>"
+                + "The hard work of speech recognition is made by the <a href=\"https://cloud.google.com/speech/\">Google Speech Recognition API</a> "
+                + "using <a href=\"https://github.com/agermanidis/autosub\">Autosub</a>"
+                + "<br><br>pyTranscriber is developed as a hobby, so donations of any value are welcomed and essential for further improvements and fixes."
+                + "<br><br>If you feel that this software has been useful and would like to contribute for it to continue improve and have more features and fixes you can <a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YHB854YHPJCU8&item_name=Donation+pyTranscriber&currency_code=BRL\">DONATE VIA PAYPAL</a> or <a href=\"https://blockchain.com/btc/payment_request?address=153LcqV59paxEEJX7riLrEHQbE54vhcko9&amount=0.00026351&message=Donation to support pyTranscriber development\"> DONATE US$5 VIA BITCOIN</a>."
+                + "<br><br>Thanks in advance!"
+                + "</body></html>", "About pyTranscriber")
+
+
+    def __showInfoMessage(self, info_msg, title):
+        msg = QMessageBox()
+        msg.setIcon(QMessageBox.Information)
+
+        msg.setWindowTitle(title)
+        msg.setText(info_msg)
+        msg.exec()
+
+    def __showErrorMessage(self, errorMsg):
+        msg = QMessageBox()
+        msg.setIcon(QMessageBox.Critical)
+
+        msg.setWindowTitle("Error!")
+        msg.setText(errorMsg)
+        msg.exec()

+ 14 - 14
pytranscriber/control/thread_cancel_autosub.py → composer/pytranscriber/control/thread_cancel_autosub.py

@@ -1,14 +1,14 @@
-from PyQt5.QtCore import QThread
-from PyQt5.QtCore import pyqtSignal
-
-
-class Thread_Cancel_Autosub(QThread):
-    signalTerminated = pyqtSignal()
-
-    def __init__(self, pObjWT):
-        self.objWT = pObjWT
-        QThread.__init__(self)
-
-    def run(self):
-        self.objWT.cancel()
-        self.signalTerminated.emit()
+from PyQt5.QtCore import QThread
+from PyQt5.QtCore import pyqtSignal
+
+
+class Thread_Cancel_Autosub(QThread):
+    signalTerminated = pyqtSignal()
+
+    def __init__(self, pObjWT):
+        self.objWT = pObjWT
+        QThread.__init__(self)
+
+    def run(self):
+        self.objWT.cancel()
+        self.signalTerminated.emit()

+ 120 - 120
pytranscriber/control/thread_exec_autosub.py → composer/pytranscriber/control/thread_exec_autosub.py

@@ -1,120 +1,120 @@
-'''
-   (C) 2019 Raryel C. Souza
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-'''
-
-from PyQt5.QtCore import QThread
-from PyQt5.QtCore import pyqtSignal
-from pathlib import Path
-from pytranscriber.util.srtparser import SRTParser
-from pytranscriber.util.util import MyUtil
-from pytranscriber.control.ctr_autosub import Ctr_Autosub
-import os
-
-
-class Thread_Exec_Autosub(QThread):
-    signalLockGUI = pyqtSignal()
-    signalResetGUIAfterCancel = pyqtSignal()
-    signalResetGUIAfterSuccess = pyqtSignal()
-    signalProgress = pyqtSignal(str, int)
-    signalProgressFileYofN = pyqtSignal(str)
-    signalErrorMsg = pyqtSignal(str)
-
-    def __init__(self, objParamAutosub):
-        self.objParamAutosub = objParamAutosub
-        self.running = True
-        QThread.__init__(self)
-
-    def __updateProgressFileYofN(self, currentIndex, countFiles ):
-        self.signalProgressFileYofN.emit("File " + str(currentIndex+1) + " of " +str(countFiles))
-
-    def listenerProgress(self, string, percent):
-        self.signalProgress.emit(string, percent)
-
-    def __generatePathOutputFile(self, sourceFile):
-        #extract the filename without extension from the path
-        base = os.path.basename(sourceFile)
-        #[0] is filename, [1] is file extension
-        fileName = os.path.splitext(base)[0]
-
-        #the output file has same name as input file, located on output Folder
-        #with extension .srt
-        pathOutputFolder = Path(self.objParamAutosub.outputFolder)
-        outputFileSRT = pathOutputFolder / (fileName + ".srt")
-        outputFileTXT = pathOutputFolder / (fileName + ".txt")
-        return [outputFileSRT, outputFileTXT]
-
-    def __runAutosubForMedia(self, index, langCode):
-        sourceFile = self.objParamAutosub.listFiles[index]
-        outputFiles = self.__generatePathOutputFile(sourceFile)
-        outputFileSRT = outputFiles[0]
-        outputFileTXT = outputFiles[1]
-
-        #run autosub
-        fOutput = Ctr_Autosub.generate_subtitles(source_path = sourceFile,
-                                    output = outputFileSRT,
-                                    src_language = langCode,
-                                    listener_progress = self.listenerProgress)
-        #if nothing was returned
-        if not fOutput:
-            self.signalErrorMsg.emit("Error! Unable to generate subtitles for file " + sourceFile + ".")
-        elif fOutput != -1:
-            #if the operation was not canceled
-
-            #updated the progress message
-            self.listenerProgress("Finished", 100)
-
-            #parses the .srt subtitle file and export text to .txt file
-            SRTParser.extractTextFromSRT(str(outputFileSRT))
-
-            if self.objParamAutosub.boolOpenOutputFilesAuto:
-                #open both SRT and TXT output files
-                MyUtil.open_file(outputFileTXT)
-                MyUtil.open_file(outputFileSRT)
-
-    def __loopSelectedFiles(self):
-        self.signalLockGUI.emit()
-
-        langCode = self.objParamAutosub.langCode
-
-        #if output directory does not exist, creates it
-        pathOutputFolder = Path(self.objParamAutosub.outputFolder)
-
-        if not os.path.exists(pathOutputFolder):
-            os.mkdir(pathOutputFolder)
-        #if there the output file is not a directory
-        if not os.path.isdir(pathOutputFolder):
-            #force the user to select a different output directory
-            self.signalErrorMsg.emit("Error! Invalid output folder. Please choose another one.")
-        else:
-            #go ahead with autosub process
-            nFiles = len(self.objParamAutosub.listFiles)
-            for i in range(nFiles):
-                #does not continue the loop if user clicked cancel button
-                if not Ctr_Autosub.is_operation_canceled():
-                    self.__updateProgressFileYofN(i, nFiles)
-                    self.__runAutosubForMedia(i, langCode)
-
-            #if operation is canceled does not clear the file list
-            if Ctr_Autosub.is_operation_canceled():
-                self.signalResetGUIAfterCancel.emit()
-            else:
-                self.signalResetGUIAfterSuccess.emit()
-
-
-    def run(self):
-        Ctr_Autosub.init()
-        self.__loopSelectedFiles()
-        self.running = False
-
-    def cancel(self):
-       Ctr_Autosub.cancel_operation()
+'''
+   (C) 2019 Raryel C. Souza
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+'''
+
+from PyQt5.QtCore import QThread
+from PyQt5.QtCore import pyqtSignal
+from pathlib import Path
+from pytranscriber.util.srtparser import SRTParser
+from pytranscriber.util.util import MyUtil
+from pytranscriber.control.ctr_autosub import Ctr_Autosub
+import os
+
+
+class Thread_Exec_Autosub(QThread):
+    signalLockGUI = pyqtSignal()
+    signalResetGUIAfterCancel = pyqtSignal()
+    signalResetGUIAfterSuccess = pyqtSignal()
+    signalProgress = pyqtSignal(str, int)
+    signalProgressFileYofN = pyqtSignal(str)
+    signalErrorMsg = pyqtSignal(str)
+
+    def __init__(self, objParamAutosub):
+        self.objParamAutosub = objParamAutosub
+        self.running = True
+        QThread.__init__(self)
+
+    def __updateProgressFileYofN(self, currentIndex, countFiles ):
+        self.signalProgressFileYofN.emit("File " + str(currentIndex+1) + " of " +str(countFiles))
+
+    def listenerProgress(self, string, percent):
+        self.signalProgress.emit(string, percent)
+
+    def __generatePathOutputFile(self, sourceFile):
+        #extract the filename without extension from the path
+        base = os.path.basename(sourceFile)
+        #[0] is filename, [1] is file extension
+        fileName = os.path.splitext(base)[0]
+
+        #the output file has same name as input file, located on output Folder
+        #with extension .srt
+        pathOutputFolder = Path(self.objParamAutosub.outputFolder)
+        outputFileSRT = pathOutputFolder / (fileName + ".srt")
+        outputFileTXT = pathOutputFolder / (fileName + ".txt")
+        return [outputFileSRT, outputFileTXT]
+
+    def __runAutosubForMedia(self, index, langCode):
+        sourceFile = self.objParamAutosub.listFiles[index]
+        outputFiles = self.__generatePathOutputFile(sourceFile)
+        outputFileSRT = outputFiles[0]
+        outputFileTXT = outputFiles[1]
+
+        #run autosub
+        fOutput = Ctr_Autosub.generate_subtitles(source_path = sourceFile,
+                                    output = outputFileSRT,
+                                    src_language = langCode,
+                                    listener_progress = self.listenerProgress)
+        #if nothing was returned
+        if not fOutput:
+            self.signalErrorMsg.emit("Error! Unable to generate subtitles for file " + sourceFile + ".")
+        elif fOutput != -1:
+            #if the operation was not canceled
+
+            #updated the progress message
+            self.listenerProgress("Finished", 100)
+
+            #parses the .srt subtitle file and export text to .txt file
+            SRTParser.extractTextFromSRT(str(outputFileSRT))
+
+            if self.objParamAutosub.boolOpenOutputFilesAuto:
+                #open both SRT and TXT output files
+                MyUtil.open_file(outputFileTXT)
+                MyUtil.open_file(outputFileSRT)
+
+    def __loopSelectedFiles(self):
+        self.signalLockGUI.emit()
+
+        langCode = self.objParamAutosub.langCode
+
+        #if output directory does not exist, creates it
+        pathOutputFolder = Path(self.objParamAutosub.outputFolder)
+
+        if not os.path.exists(pathOutputFolder):
+            os.mkdir(pathOutputFolder)
+        #if there the output file is not a directory
+        if not os.path.isdir(pathOutputFolder):
+            #force the user to select a different output directory
+            self.signalErrorMsg.emit("Error! Invalid output folder. Please choose another one.")
+        else:
+            #go ahead with autosub process
+            nFiles = len(self.objParamAutosub.listFiles)
+            for i in range(nFiles):
+                #does not continue the loop if user clicked cancel button
+                if not Ctr_Autosub.is_operation_canceled():
+                    self.__updateProgressFileYofN(i, nFiles)
+                    self.__runAutosubForMedia(i, langCode)
+
+            #if operation is canceled does not clear the file list
+            if Ctr_Autosub.is_operation_canceled():
+                self.signalResetGUIAfterCancel.emit()
+            else:
+                self.signalResetGUIAfterSuccess.emit()
+
+
+    def run(self):
+        Ctr_Autosub.init()
+        self.__loopSelectedFiles()
+        self.running = False
+
+    def cancel(self):
+       Ctr_Autosub.cancel_operation()

+ 0 - 0
pytranscriber/gui/__init__.py → composer/pytranscriber/gui/__init__.py


+ 0 - 0
pytranscriber/gui/__pycache__/__init__.cpython-37.pyc → composer/pytranscriber/gui/__pycache__/__init__.cpython-37.pyc


+ 0 - 0
pytranscriber/gui/__pycache__/__init__.cpython-38.pyc → composer/pytranscriber/gui/__pycache__/__init__.cpython-38.pyc


+ 0 - 0
pytranscriber/gui/__pycache__/__init__.cpython-39.pyc → composer/pytranscriber/gui/__pycache__/__init__.cpython-39.pyc


+ 0 - 0
pytranscriber/gui/__pycache__/gui.cpython-37.pyc → composer/pytranscriber/gui/__pycache__/gui.cpython-37.pyc


+ 0 - 0
pytranscriber/gui/__pycache__/gui.cpython-38.pyc → composer/pytranscriber/gui/__pycache__/gui.cpython-38.pyc


+ 0 - 0
pytranscriber/gui/__pycache__/gui.cpython-39.pyc → composer/pytranscriber/gui/__pycache__/gui.cpython-39.pyc


+ 120 - 120
pytranscriber/gui/gui.py → composer/pytranscriber/gui/gui.py

@@ -1,120 +1,120 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'gui.ui'
-#
-# Created by: PyQt5 UI code generator 5.13.1
-#
-# WARNING! All changes made in this file will be lost!
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_window(object):
-    def setupUi(self, window):
-        window.setObjectName("window")
-        window.resize(1045, 487)
-        self.centralwidget = QtWidgets.QWidget(window)
-        self.centralwidget.setObjectName("centralwidget")
-        self.bSelectMedia = QtWidgets.QPushButton(self.centralwidget)
-        self.bSelectMedia.setGeometry(QtCore.QRect(10, 10, 141, 34))
-        self.bSelectMedia.setObjectName("bSelectMedia")
-        self.bConvert = QtWidgets.QPushButton(self.centralwidget)
-        self.bConvert.setEnabled(False)
-        self.bConvert.setGeometry(QtCore.QRect(200, 290, 341, 34))
-        self.bConvert.setObjectName("bConvert")
-        self.progressBar = QtWidgets.QProgressBar(self.centralwidget)
-        self.progressBar.setGeometry(QtCore.QRect(20, 340, 1021, 23))
-        self.progressBar.setProperty("value", 0)
-        self.progressBar.setObjectName("progressBar")
-        self.labelCurrentOperation = QtWidgets.QLabel(self.centralwidget)
-        self.labelCurrentOperation.setGeometry(QtCore.QRect(170, 350, 871, 41))
-        self.labelCurrentOperation.setText("")
-        self.labelCurrentOperation.setObjectName("labelCurrentOperation")
-        self.bOpenOutputFolder = QtWidgets.QPushButton(self.centralwidget)
-        self.bOpenOutputFolder.setGeometry(QtCore.QRect(550, 290, 241, 34))
-        self.bOpenOutputFolder.setObjectName("bOpenOutputFolder")
-        self.bSelectOutputFolder = QtWidgets.QPushButton(self.centralwidget)
-        self.bSelectOutputFolder.setGeometry(QtCore.QRect(10, 180, 141, 34))
-        self.bSelectOutputFolder.setObjectName("bSelectOutputFolder")
-        self.qleOutputFolder = QtWidgets.QLineEdit(self.centralwidget)
-        self.qleOutputFolder.setGeometry(QtCore.QRect(160, 180, 861, 32))
-        self.qleOutputFolder.setText("")
-        self.qleOutputFolder.setReadOnly(True)
-        self.qleOutputFolder.setObjectName("qleOutputFolder")
-        self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
-        self.groupBox.setGeometry(QtCore.QRect(160, 10, 871, 161))
-        self.groupBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
-        self.groupBox.setFlat(False)
-        self.groupBox.setCheckable(False)
-        self.groupBox.setObjectName("groupBox")
-        self.qlwListFilesSelected = QtWidgets.QListWidget(self.groupBox)
-        self.qlwListFilesSelected.setGeometry(QtCore.QRect(10, 30, 851, 121))
-        self.qlwListFilesSelected.setObjectName("qlwListFilesSelected")
-        self.bRemoveFile = QtWidgets.QPushButton(self.centralwidget)
-        self.bRemoveFile.setGeometry(QtCore.QRect(10, 50, 141, 34))
-        self.bRemoveFile.setObjectName("bRemoveFile")
-        self.labelProgressFileIndex = QtWidgets.QLabel(self.centralwidget)
-        self.labelProgressFileIndex.setGeometry(QtCore.QRect(30, 350, 131, 41))
-        self.labelProgressFileIndex.setText("")
-        self.labelProgressFileIndex.setObjectName("labelProgressFileIndex")
-        self.bCancel = QtWidgets.QPushButton(self.centralwidget)
-        self.bCancel.setGeometry(QtCore.QRect(470, 390, 108, 36))
-        self.bCancel.setObjectName("bCancel")
-        self.chbxOpenOutputFilesAuto = QtWidgets.QCheckBox(self.centralwidget)
-        self.chbxOpenOutputFilesAuto.setGeometry(QtCore.QRect(10, 220, 291, 32))
-        self.chbxOpenOutputFilesAuto.setChecked(True)
-        self.chbxOpenOutputFilesAuto.setObjectName("chbxOpenOutputFilesAuto")
-        self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
-        self.horizontalLayoutWidget.setGeometry(QtCore.QRect(200, 250, 591, 34))
-        self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
-        self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
-        self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
-        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
-        self.labelSelectLang = QtWidgets.QLabel(self.horizontalLayoutWidget)
-        self.labelSelectLang.setObjectName("labelSelectLang")
-        self.horizontalLayout_5.addWidget(self.labelSelectLang)
-        self.cbSelectLang = QtWidgets.QComboBox(self.horizontalLayoutWidget)
-        self.cbSelectLang.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
-        self.cbSelectLang.setObjectName("cbSelectLang")
-        self.horizontalLayout_5.addWidget(self.cbSelectLang)
-        window.setCentralWidget(self.centralwidget)
-        self.menubar = QtWidgets.QMenuBar(window)
-        self.menubar.setGeometry(QtCore.QRect(0, 0, 1045, 34))
-        self.menubar.setObjectName("menubar")
-        self.menuAbout = QtWidgets.QMenu(self.menubar)
-        self.menuAbout.setObjectName("menuAbout")
-        window.setMenuBar(self.menubar)
-        self.statusbar = QtWidgets.QStatusBar(window)
-        self.statusbar.setObjectName("statusbar")
-        window.setStatusBar(self.statusbar)
-        self.actionLicense = QtWidgets.QAction(window)
-        self.actionLicense.setObjectName("actionLicense")
-        self.actionDonation = QtWidgets.QAction(window)
-        self.actionDonation.setObjectName("actionDonation")
-        self.actionAbout_pyTranscriber = QtWidgets.QAction(window)
-        self.actionAbout_pyTranscriber.setObjectName("actionAbout_pyTranscriber")
-        self.menuAbout.addAction(self.actionLicense)
-        self.menuAbout.addAction(self.actionDonation)
-        self.menuAbout.addAction(self.actionAbout_pyTranscriber)
-        self.menubar.addAction(self.menuAbout.menuAction())
-
-        self.retranslateUi(window)
-        QtCore.QMetaObject.connectSlotsByName(window)
-
-    def retranslateUi(self, window):
-        _translate = QtCore.QCoreApplication.translate
-        window.setWindowTitle(_translate("window", "pyTranscriber - v1.6 - 21/01/2020"))
-        self.bSelectMedia.setText(_translate("window", "Select file(s)"))
-        self.bConvert.setText(_translate("window", "Transcribe Audio / Generate Subtitles"))
-        self.bOpenOutputFolder.setText(_translate("window", "Open Output Folder"))
-        self.bSelectOutputFolder.setText(_translate("window", "Output Location"))
-        self.groupBox.setTitle(_translate("window", "&List of files to generate transcribe audio / generate subtitles"))
-        self.bRemoveFile.setText(_translate("window", "Remove file(s)"))
-        self.bCancel.setText(_translate("window", "Cancel"))
-        self.chbxOpenOutputFilesAuto.setText(_translate("window", "Open output files automatically"))
-        self.labelSelectLang.setText(_translate("window", "Audio Language:"))
-        self.menuAbout.setTitle(_translate("window", "Abo&ut"))
-        self.actionLicense.setText(_translate("window", "&License"))
-        self.actionDonation.setText(_translate("window", "&DONATIONS"))
-        self.actionAbout_pyTranscriber.setText(_translate("window", "&About pyTranscriber"))
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'gui.ui'
+#
+# Created by: PyQt5 UI code generator 5.13.1
+#
+# WARNING! All changes made in this file will be lost!
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+
+class Ui_window(object):
+    def setupUi(self, window):
+        window.setObjectName("window")
+        window.resize(1045, 487)
+        self.centralwidget = QtWidgets.QWidget(window)
+        self.centralwidget.setObjectName("centralwidget")
+        self.bSelectMedia = QtWidgets.QPushButton(self.centralwidget)
+        self.bSelectMedia.setGeometry(QtCore.QRect(10, 10, 141, 34))
+        self.bSelectMedia.setObjectName("bSelectMedia")
+        self.bConvert = QtWidgets.QPushButton(self.centralwidget)
+        self.bConvert.setEnabled(False)
+        self.bConvert.setGeometry(QtCore.QRect(200, 290, 341, 34))
+        self.bConvert.setObjectName("bConvert")
+        self.progressBar = QtWidgets.QProgressBar(self.centralwidget)
+        self.progressBar.setGeometry(QtCore.QRect(20, 340, 1021, 23))
+        self.progressBar.setProperty("value", 0)
+        self.progressBar.setObjectName("progressBar")
+        self.labelCurrentOperation = QtWidgets.QLabel(self.centralwidget)
+        self.labelCurrentOperation.setGeometry(QtCore.QRect(170, 350, 871, 41))
+        self.labelCurrentOperation.setText("")
+        self.labelCurrentOperation.setObjectName("labelCurrentOperation")
+        self.bOpenOutputFolder = QtWidgets.QPushButton(self.centralwidget)
+        self.bOpenOutputFolder.setGeometry(QtCore.QRect(550, 290, 241, 34))
+        self.bOpenOutputFolder.setObjectName("bOpenOutputFolder")
+        self.bSelectOutputFolder = QtWidgets.QPushButton(self.centralwidget)
+        self.bSelectOutputFolder.setGeometry(QtCore.QRect(10, 180, 141, 34))
+        self.bSelectOutputFolder.setObjectName("bSelectOutputFolder")
+        self.qleOutputFolder = QtWidgets.QLineEdit(self.centralwidget)
+        self.qleOutputFolder.setGeometry(QtCore.QRect(160, 180, 861, 32))
+        self.qleOutputFolder.setText("")
+        self.qleOutputFolder.setReadOnly(True)
+        self.qleOutputFolder.setObjectName("qleOutputFolder")
+        self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
+        self.groupBox.setGeometry(QtCore.QRect(160, 10, 871, 161))
+        self.groupBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
+        self.groupBox.setFlat(False)
+        self.groupBox.setCheckable(False)
+        self.groupBox.setObjectName("groupBox")
+        self.qlwListFilesSelected = QtWidgets.QListWidget(self.groupBox)
+        self.qlwListFilesSelected.setGeometry(QtCore.QRect(10, 30, 851, 121))
+        self.qlwListFilesSelected.setObjectName("qlwListFilesSelected")
+        self.bRemoveFile = QtWidgets.QPushButton(self.centralwidget)
+        self.bRemoveFile.setGeometry(QtCore.QRect(10, 50, 141, 34))
+        self.bRemoveFile.setObjectName("bRemoveFile")
+        self.labelProgressFileIndex = QtWidgets.QLabel(self.centralwidget)
+        self.labelProgressFileIndex.setGeometry(QtCore.QRect(30, 350, 131, 41))
+        self.labelProgressFileIndex.setText("")
+        self.labelProgressFileIndex.setObjectName("labelProgressFileIndex")
+        self.bCancel = QtWidgets.QPushButton(self.centralwidget)
+        self.bCancel.setGeometry(QtCore.QRect(470, 390, 108, 36))
+        self.bCancel.setObjectName("bCancel")
+        self.chbxOpenOutputFilesAuto = QtWidgets.QCheckBox(self.centralwidget)
+        self.chbxOpenOutputFilesAuto.setGeometry(QtCore.QRect(10, 220, 291, 32))
+        self.chbxOpenOutputFilesAuto.setChecked(True)
+        self.chbxOpenOutputFilesAuto.setObjectName("chbxOpenOutputFilesAuto")
+        self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
+        self.horizontalLayoutWidget.setGeometry(QtCore.QRect(200, 250, 591, 34))
+        self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
+        self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
+        self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
+        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
+        self.labelSelectLang = QtWidgets.QLabel(self.horizontalLayoutWidget)
+        self.labelSelectLang.setObjectName("labelSelectLang")
+        self.horizontalLayout_5.addWidget(self.labelSelectLang)
+        self.cbSelectLang = QtWidgets.QComboBox(self.horizontalLayoutWidget)
+        self.cbSelectLang.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
+        self.cbSelectLang.setObjectName("cbSelectLang")
+        self.horizontalLayout_5.addWidget(self.cbSelectLang)
+        window.setCentralWidget(self.centralwidget)
+        self.menubar = QtWidgets.QMenuBar(window)
+        self.menubar.setGeometry(QtCore.QRect(0, 0, 1045, 34))
+        self.menubar.setObjectName("menubar")
+        self.menuAbout = QtWidgets.QMenu(self.menubar)
+        self.menuAbout.setObjectName("menuAbout")
+        window.setMenuBar(self.menubar)
+        self.statusbar = QtWidgets.QStatusBar(window)
+        self.statusbar.setObjectName("statusbar")
+        window.setStatusBar(self.statusbar)
+        self.actionLicense = QtWidgets.QAction(window)
+        self.actionLicense.setObjectName("actionLicense")
+        self.actionDonation = QtWidgets.QAction(window)
+        self.actionDonation.setObjectName("actionDonation")
+        self.actionAbout_pyTranscriber = QtWidgets.QAction(window)
+        self.actionAbout_pyTranscriber.setObjectName("actionAbout_pyTranscriber")
+        self.menuAbout.addAction(self.actionLicense)
+        self.menuAbout.addAction(self.actionDonation)
+        self.menuAbout.addAction(self.actionAbout_pyTranscriber)
+        self.menubar.addAction(self.menuAbout.menuAction())
+
+        self.retranslateUi(window)
+        QtCore.QMetaObject.connectSlotsByName(window)
+
+    def retranslateUi(self, window):
+        _translate = QtCore.QCoreApplication.translate
+        window.setWindowTitle(_translate("window", "pyTranscriber - v1.6 - 21/01/2020"))
+        self.bSelectMedia.setText(_translate("window", "Select file(s)"))
+        self.bConvert.setText(_translate("window", "Transcribe Audio / Generate Subtitles"))
+        self.bOpenOutputFolder.setText(_translate("window", "Open Output Folder"))
+        self.bSelectOutputFolder.setText(_translate("window", "Output Location"))
+        self.groupBox.setTitle(_translate("window", "&List of files to generate transcribe audio / generate subtitles"))
+        self.bRemoveFile.setText(_translate("window", "Remove file(s)"))
+        self.bCancel.setText(_translate("window", "Cancel"))
+        self.chbxOpenOutputFilesAuto.setText(_translate("window", "Open output files automatically"))
+        self.labelSelectLang.setText(_translate("window", "Audio Language:"))
+        self.menuAbout.setTitle(_translate("window", "Abo&ut"))
+        self.actionLicense.setText(_translate("window", "&License"))
+        self.actionDonation.setText(_translate("window", "&DONATIONS"))
+        self.actionAbout_pyTranscriber.setText(_translate("window", "&About pyTranscriber"))

+ 266 - 266
pytranscriber/gui/gui.ui → composer/pytranscriber/gui/gui.ui

@@ -1,266 +1,266 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>window</class>
- <widget class="QMainWindow" name="window">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1045</width>
-    <height>487</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>pyTranscriber - v1.5 - 07/12/2020</string>
-  </property>
-  <widget class="QWidget" name="centralwidget">
-   <widget class="QPushButton" name="bSelectMedia">
-    <property name="geometry">
-     <rect>
-      <x>10</x>
-      <y>10</y>
-      <width>141</width>
-      <height>34</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Select file(s)</string>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="bConvert">
-    <property name="enabled">
-     <bool>false</bool>
-    </property>
-    <property name="geometry">
-     <rect>
-      <x>200</x>
-      <y>290</y>
-      <width>341</width>
-      <height>34</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Transcribe Audio / Generate Subtitles</string>
-    </property>
-   </widget>
-   <widget class="QProgressBar" name="progressBar">
-    <property name="geometry">
-     <rect>
-      <x>20</x>
-      <y>340</y>
-      <width>1021</width>
-      <height>23</height>
-     </rect>
-    </property>
-    <property name="value">
-     <number>0</number>
-    </property>
-   </widget>
-   <widget class="QLabel" name="labelCurrentOperation">
-    <property name="geometry">
-     <rect>
-      <x>170</x>
-      <y>350</y>
-      <width>871</width>
-      <height>41</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string/>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="bOpenOutputFolder">
-    <property name="geometry">
-     <rect>
-      <x>550</x>
-      <y>290</y>
-      <width>241</width>
-      <height>34</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Open Output Folder</string>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="bSelectOutputFolder">
-    <property name="geometry">
-     <rect>
-      <x>10</x>
-      <y>180</y>
-      <width>141</width>
-      <height>34</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Output Location</string>
-    </property>
-   </widget>
-   <widget class="QLineEdit" name="qleOutputFolder">
-    <property name="geometry">
-     <rect>
-      <x>160</x>
-      <y>180</y>
-      <width>861</width>
-      <height>32</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string/>
-    </property>
-    <property name="readOnly">
-     <bool>true</bool>
-    </property>
-   </widget>
-   <widget class="QGroupBox" name="groupBox">
-    <property name="geometry">
-     <rect>
-      <x>160</x>
-      <y>10</y>
-      <width>871</width>
-      <height>161</height>
-     </rect>
-    </property>
-    <property name="title">
-     <string>&amp;List of files to generate transcribe audio / generate subtitles</string>
-    </property>
-    <property name="alignment">
-     <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-    </property>
-    <property name="flat">
-     <bool>false</bool>
-    </property>
-    <property name="checkable">
-     <bool>false</bool>
-    </property>
-    <widget class="QListWidget" name="qlwListFilesSelected">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>30</y>
-       <width>851</width>
-       <height>121</height>
-      </rect>
-     </property>
-    </widget>
-   </widget>
-   <widget class="QPushButton" name="bRemoveFile">
-    <property name="geometry">
-     <rect>
-      <x>10</x>
-      <y>50</y>
-      <width>141</width>
-      <height>34</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Remove file(s)</string>
-    </property>
-   </widget>
-   <widget class="QLabel" name="labelProgressFileIndex">
-    <property name="geometry">
-     <rect>
-      <x>30</x>
-      <y>350</y>
-      <width>131</width>
-      <height>41</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string/>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="bCancel">
-    <property name="geometry">
-     <rect>
-      <x>470</x>
-      <y>390</y>
-      <width>108</width>
-      <height>36</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Cancel</string>
-    </property>
-   </widget>
-   <widget class="QCheckBox" name="chbxOpenOutputFilesAuto">
-    <property name="geometry">
-     <rect>
-      <x>10</x>
-      <y>220</y>
-      <width>291</width>
-      <height>32</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>Open output files automatically</string>
-    </property>
-    <property name="checked">
-     <bool>true</bool>
-    </property>
-   </widget>
-   <widget class="QWidget" name="horizontalLayoutWidget">
-    <property name="geometry">
-     <rect>
-      <x>200</x>
-      <y>250</y>
-      <width>591</width>
-      <height>34</height>
-     </rect>
-    </property>
-    <layout class="QHBoxLayout" name="horizontalLayout_5">
-     <item>
-      <widget class="QLabel" name="labelSelectLang">
-       <property name="text">
-        <string>Audio Language:</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QComboBox" name="cbSelectLang">
-       <property name="sizeAdjustPolicy">
-        <enum>QComboBox::AdjustToContents</enum>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </widget>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>1045</width>
-     <height>34</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menuAbout">
-    <property name="title">
-     <string>Abo&amp;ut</string>
-    </property>
-    <addaction name="actionLicense"/>
-    <addaction name="actionDonate"/>
-    <addaction name="actionAbout_pyTranscriber"/>
-   </widget>
-   <addaction name="menuAbout"/>
-  </widget>
-  <widget class="QStatusBar" name="statusbar"/>
-  <action name="actionLicense">
-   <property name="text">
-    <string>&amp;License</string>
-   </property>
-  </action>
-  <action name="actionDonate">
-   <property name="text">
-    <string>&amp;DONATIONS</string>
-   </property>
-  </action>
-  <action name="actionAbout_pyTranscriber">
-   <property name="text">
-    <string>&amp;About pyTranscriber</string>
-   </property>
-  </action>
- </widget>
- <resources/>
- <connections/>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>window</class>
+ <widget class="QMainWindow" name="window">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1045</width>
+    <height>487</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>pyTranscriber - v1.5 - 07/12/2020</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QPushButton" name="bSelectMedia">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>10</y>
+      <width>141</width>
+      <height>34</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Select file(s)</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="bConvert">
+    <property name="enabled">
+     <bool>false</bool>
+    </property>
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>290</y>
+      <width>341</width>
+      <height>34</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Transcribe Audio / Generate Subtitles</string>
+    </property>
+   </widget>
+   <widget class="QProgressBar" name="progressBar">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>340</y>
+      <width>1021</width>
+      <height>23</height>
+     </rect>
+    </property>
+    <property name="value">
+     <number>0</number>
+    </property>
+   </widget>
+   <widget class="QLabel" name="labelCurrentOperation">
+    <property name="geometry">
+     <rect>
+      <x>170</x>
+      <y>350</y>
+      <width>871</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="bOpenOutputFolder">
+    <property name="geometry">
+     <rect>
+      <x>550</x>
+      <y>290</y>
+      <width>241</width>
+      <height>34</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Open Output Folder</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="bSelectOutputFolder">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>180</y>
+      <width>141</width>
+      <height>34</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Output Location</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="qleOutputFolder">
+    <property name="geometry">
+     <rect>
+      <x>160</x>
+      <y>180</y>
+      <width>861</width>
+      <height>32</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QGroupBox" name="groupBox">
+    <property name="geometry">
+     <rect>
+      <x>160</x>
+      <y>10</y>
+      <width>871</width>
+      <height>161</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>&amp;List of files to generate transcribe audio / generate subtitles</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+    </property>
+    <property name="flat">
+     <bool>false</bool>
+    </property>
+    <property name="checkable">
+     <bool>false</bool>
+    </property>
+    <widget class="QListWidget" name="qlwListFilesSelected">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>30</y>
+       <width>851</width>
+       <height>121</height>
+      </rect>
+     </property>
+    </widget>
+   </widget>
+   <widget class="QPushButton" name="bRemoveFile">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>50</y>
+      <width>141</width>
+      <height>34</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Remove file(s)</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="labelProgressFileIndex">
+    <property name="geometry">
+     <rect>
+      <x>30</x>
+      <y>350</y>
+      <width>131</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="bCancel">
+    <property name="geometry">
+     <rect>
+      <x>470</x>
+      <y>390</y>
+      <width>108</width>
+      <height>36</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Cancel</string>
+    </property>
+   </widget>
+   <widget class="QCheckBox" name="chbxOpenOutputFilesAuto">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>220</y>
+      <width>291</width>
+      <height>32</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Open output files automatically</string>
+    </property>
+    <property name="checked">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QWidget" name="horizontalLayoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>250</y>
+      <width>591</width>
+      <height>34</height>
+     </rect>
+    </property>
+    <layout class="QHBoxLayout" name="horizontalLayout_5">
+     <item>
+      <widget class="QLabel" name="labelSelectLang">
+       <property name="text">
+        <string>Audio Language:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QComboBox" name="cbSelectLang">
+       <property name="sizeAdjustPolicy">
+        <enum>QComboBox::AdjustToContents</enum>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>1045</width>
+     <height>34</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuAbout">
+    <property name="title">
+     <string>Abo&amp;ut</string>
+    </property>
+    <addaction name="actionLicense"/>
+    <addaction name="actionDonate"/>
+    <addaction name="actionAbout_pyTranscriber"/>
+   </widget>
+   <addaction name="menuAbout"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="actionLicense">
+   <property name="text">
+    <string>&amp;License</string>
+   </property>
+  </action>
+  <action name="actionDonate">
+   <property name="text">
+    <string>&amp;DONATIONS</string>
+   </property>
+  </action>
+  <action name="actionAbout_pyTranscriber">
+   <property name="text">
+    <string>&amp;About pyTranscriber</string>
+   </property>
+  </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 0 - 0
pytranscriber/model/__init__.py → composer/pytranscriber/model/__init__.py


+ 0 - 0
pytranscriber/model/__pycache__/__init__.cpython-37.pyc → composer/pytranscriber/model/__pycache__/__init__.cpython-37.pyc


+ 0 - 0
pytranscriber/model/__pycache__/__init__.cpython-38.pyc → composer/pytranscriber/model/__pycache__/__init__.cpython-38.pyc


+ 0 - 0
pytranscriber/model/__pycache__/__init__.cpython-39.pyc → composer/pytranscriber/model/__pycache__/__init__.cpython-39.pyc


+ 0 - 0
pytranscriber/model/__pycache__/param_autosub.cpython-37.pyc → composer/pytranscriber/model/__pycache__/param_autosub.cpython-37.pyc


+ 0 - 0
pytranscriber/model/__pycache__/param_autosub.cpython-38.pyc → composer/pytranscriber/model/__pycache__/param_autosub.cpython-38.pyc


+ 0 - 0
pytranscriber/model/__pycache__/param_autosub.cpython-39.pyc → composer/pytranscriber/model/__pycache__/param_autosub.cpython-39.pyc


+ 22 - 22
pytranscriber/model/param_autosub.py → composer/pytranscriber/model/param_autosub.py

@@ -1,22 +1,22 @@
-'''
-   (C) 2019 Raryel C. Souza
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-'''
-
-class Param_Autosub():
-
-    def __init__(self, listFiles, outputFolder, langCode,
-                boolOpenOutputFilesAuto):
-        self.listFiles = listFiles
-        self.outputFolder = outputFolder
-        self.langCode = langCode
-        self.boolOpenOutputFilesAuto = boolOpenOutputFilesAuto
+'''
+   (C) 2019 Raryel C. Souza
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+'''
+
+class Param_Autosub():
+
+    def __init__(self, listFiles, outputFolder, langCode,
+                boolOpenOutputFilesAuto):
+        self.listFiles = listFiles
+        self.outputFolder = outputFolder
+        self.langCode = langCode
+        self.boolOpenOutputFilesAuto = boolOpenOutputFilesAuto

+ 0 - 0
pytranscriber/util/__init__.py → composer/pytranscriber/util/__init__.py


+ 0 - 0
pytranscriber/util/__pycache__/__init__.cpython-37.pyc → composer/pytranscriber/util/__pycache__/__init__.cpython-37.pyc


+ 0 - 0
pytranscriber/util/__pycache__/__init__.cpython-38.pyc → composer/pytranscriber/util/__pycache__/__init__.cpython-38.pyc


+ 0 - 0
pytranscriber/util/__pycache__/__init__.cpython-39.pyc → composer/pytranscriber/util/__pycache__/__init__.cpython-39.pyc


+ 0 - 0
pytranscriber/util/__pycache__/srtparser.cpython-37.pyc → composer/pytranscriber/util/__pycache__/srtparser.cpython-37.pyc


+ 0 - 0
pytranscriber/util/__pycache__/srtparser.cpython-38.pyc → composer/pytranscriber/util/__pycache__/srtparser.cpython-38.pyc


+ 0 - 0
pytranscriber/util/__pycache__/srtparser.cpython-39.pyc → composer/pytranscriber/util/__pycache__/srtparser.cpython-39.pyc


+ 0 - 0
pytranscriber/util/__pycache__/util.cpython-37.pyc → composer/pytranscriber/util/__pycache__/util.cpython-37.pyc


+ 0 - 0
pytranscriber/util/__pycache__/util.cpython-38.pyc → composer/pytranscriber/util/__pycache__/util.cpython-38.pyc


+ 0 - 0
pytranscriber/util/__pycache__/util.cpython-39.pyc → composer/pytranscriber/util/__pycache__/util.cpython-39.pyc


+ 49 - 49
pytranscriber/util/srtparser.py → composer/pytranscriber/util/srtparser.py

@@ -1,49 +1,49 @@
-'''
-   (C) 2019 Raryel C. Souza
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-'''
-
-import re, sys
-
-class SRTParser(object):
-    @staticmethod
-    def extractTextFromSRT(fileSRT):
-        file_name = fileSRT
-        file_encoding = 'utf-8'
-
-        #loop through the lines for parsing
-        with open(file_name, encoding=file_encoding, errors='replace') as f:
-            lines = f.readlines()
-            new_lines = SRTParser.clean_up(lines)
-            new_file_name = file_name[:-4] + '.txt'
-
-        #write parsed txt file
-        with open(new_file_name, 'w', encoding=file_encoding) as f:
-            for line in new_lines:
-                f.write(line)
-
-    @staticmethod
-    def clean_up(lines):
-        regexSubtitleIndexNumber = re.compile("[0-9]+")
-
-        new_lines = []
-        for line in lines[1:]:
-            #if line empty or
-            #if line contains --> or
-            #if line matches the subtitle index regex
-            #then skip line
-            if (not line or not line.strip()) or ("-->" in line) or regexSubtitleIndexNumber.match(line):
-                continue
-            else:
-                #append line
-                new_lines.append(line)
-        return new_lines
+'''
+   (C) 2019 Raryel C. Souza
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+'''
+
+import re, sys
+
+class SRTParser(object):
+    @staticmethod
+    def extractTextFromSRT(fileSRT):
+        file_name = fileSRT
+        file_encoding = 'utf-8'
+
+        #loop through the lines for parsing
+        with open(file_name, encoding=file_encoding, errors='replace') as f:
+            lines = f.readlines()
+            new_lines = SRTParser.clean_up(lines)
+            new_file_name = file_name[:-4] + '.txt'
+
+        #write parsed txt file
+        with open(new_file_name, 'w', encoding=file_encoding) as f:
+            for line in new_lines:
+                f.write(line)
+
+    @staticmethod
+    def clean_up(lines):
+        regexSubtitleIndexNumber = re.compile("[0-9]+")
+
+        new_lines = []
+        for line in lines[1:]:
+            #if line empty or
+            #if line contains --> or
+            #if line matches the subtitle index regex
+            #then skip line
+            if (not line or not line.strip()) or ("-->" in line) or regexSubtitleIndexNumber.match(line):
+                continue
+            else:
+                #append line
+                new_lines.append(line)
+        return new_lines

+ 44 - 44
pytranscriber/util/util.py → composer/pytranscriber/util/util.py

@@ -1,44 +1,44 @@
-'''
-   (C) 2019 Raryel C. Souza
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-'''
-
-import platform
-import os
-import subprocess
-import socket
-
-class MyUtil(object):
-    @staticmethod
-    def open_file(path):
-        if platform.system() == "Windows":
-            os.startfile(path)
-        elif platform.system() == "Darwin":
-            subprocess.Popen(["open", path])
-        else:
-            subprocess.Popen(["xdg-open", path])
-
-    @staticmethod
-    def is_internet_connected():
-        try:
-            # connect to the host -- tells us if the host is actually
-            # reachable
-            s = socket.create_connection(("www.google.com", 80), 2)
-            s.close()
-            return True
-        except OSError:
-            pass
-        return False
-
-    @staticmethod
-    def percentage(currentval, maxval):
-        return 100 * currentval / float(maxval)
+'''
+   (C) 2019 Raryel C. Souza
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+'''
+
+import platform
+import os
+import subprocess
+import socket
+
+class MyUtil(object):
+    @staticmethod
+    def open_file(path):
+        if platform.system() == "Windows":
+            os.startfile(path)
+        elif platform.system() == "Darwin":
+            subprocess.Popen(["open", path])
+        else:
+            subprocess.Popen(["xdg-open", path])
+
+    @staticmethod
+    def is_internet_connected():
+        try:
+            # connect to the host -- tells us if the host is actually
+            # reachable
+            s = socket.create_connection(("www.google.com", 80), 2)
+            s.close()
+            return True
+        except OSError:
+            pass
+        return False
+
+    @staticmethod
+    def percentage(currentval, maxval):
+        return 100 * currentval / float(maxval)