Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Update audio_player.py and main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
royshil committed Apr 29, 2024
1 parent c7305dd commit 4a62869
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
1 change: 1 addition & 0 deletions audio_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, type, bytes):

class AudioPlayer(QThread):
def __init__(self):
super().__init__()
self.queue = queue.Queue()
self.isRunning = False

Expand Down
Binary file added icons/bw_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 10 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
from translation import TranslationThread
from text_to_speech import TextToSpeechThread

ONLY_IN_PRO = "Only available in LexiSynth Pro"
NOT_IMPLEMENTED = "Not implemented yet"


def disable_pro_dropdown_options_by_text(
def disable_dropdown_options_by_text(
combo_box, text: str | list[str], negative_case=False
):
for i in range(combo_box.count()):
Expand All @@ -39,11 +39,11 @@ def disable_pro_dropdown_options_by_text(
):
if not negative_case:
combo_box.model().item(i).setEnabled(False)
combo_box.model().item(i).setToolTip(ONLY_IN_PRO)
combo_box.model().item(i).setToolTip(NOT_IMPLEMENTED)
else:
if negative_case:
combo_box.model().item(i).setEnabled(False)
combo_box.model().item(i).setToolTip(ONLY_IN_PRO)
combo_box.model().item(i).setToolTip(NOT_IMPLEMENTED)


def toggle_all_widgets_in_a_groupbox(group_box, enabled):
Expand Down Expand Up @@ -185,12 +185,12 @@ def __init__(self):
self.comboBox_speechEngine.currentIndexChanged.connect(self.speechEngineChanged)

# disable everything on comboBox_transcriptionOutputText except for "Text File" and "No text output"
disable_pro_dropdown_options_by_text(
disable_dropdown_options_by_text(
self.comboBox_transcriptionOutputText,
["No text output", "Text File"],
negative_case=True,
)
disable_pro_dropdown_options_by_text(
disable_dropdown_options_by_text(
self.comboBox_translationOutputTextOptions,
["No text output", "Text File"],
negative_case=True,
Expand All @@ -204,9 +204,7 @@ def __init__(self):
self.comboBox_translationSourceSelect.currentIndexChanged.connect(
self.translationSourceChanged
)
disable_pro_dropdown_options_by_text(
self.comboBox_translationSourceSelect, "URL"
)
disable_dropdown_options_by_text(self.comboBox_translationSourceSelect, "URL")

self.outputsFolder = None
self.transcriptionOutputTextFilePath = None
Expand Down Expand Up @@ -545,14 +543,14 @@ def populateAudioSources(self):
for device in audioDevices:
self.comboBox_audioSources.addItem(device.sourceName)
self.comboBox_audioSources.addItem("--- NDI Sources ---")
disable_pro_dropdown_options_by_text(
disable_dropdown_options_by_text(
self.comboBox_audioSources, "--- NDI Sources ---"
)
# add file input option
self.comboBox_audioSources.addItem("File")
# add stream option
self.comboBox_audioSources.addItem("Stream")
disable_pro_dropdown_options_by_text(self.comboBox_audioSources, "Stream")
disable_dropdown_options_by_text(self.comboBox_audioSources, "Stream")

def audioSourceChanged(self):
logger.info("audio source changed")
Expand Down Expand Up @@ -696,7 +694,7 @@ def closeEvent(self, event):
os_name = platform.system()
if os_name != "Darwin":
try:
import pyi_splash
import pyi_splash # type: ignore

pyi_splash.close()
except ImportError:
Expand Down
8 changes: 4 additions & 4 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>939</width>
<width>988</width>
<height>612</height>
</rect>
</property>
Expand Down Expand Up @@ -484,7 +484,7 @@
</font>
</property>
<property name="toolTip">
<string>Only available in Lexis Pro</string>
<string>Not implemented yet</string>
</property>
<item>
<property name="text">
Expand Down Expand Up @@ -1267,8 +1267,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>939</width>
<height>24</height>
<width>988</width>
<height>21</height>
</rect>
</property>
</widget>
Expand Down

0 comments on commit 4a62869

Please sign in to comment.