Skip to content

Commit

Permalink
Change font to VCR Mono
Browse files Browse the repository at this point in the history
  • Loading branch information
F33RNI committed Sep 1, 2023
1 parent 568c620 commit 45f4a7a
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 68 deletions.
3 changes: 2 additions & 1 deletion FramesProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ def _rendering_process(self, file: str,
time_total,
round(percentage_absolute,
1),
round(fps_filtered, 2))
round(fps_filtered, 2))\
.upper()
self.rendering_progress.value = int(percentage_relative)
self.current_frame_absolute.value = frame_from + current_frame - 1

Expand Down
42 changes: 25 additions & 17 deletions GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ def __init__(self, config: dict, config_file: str, version: str, frames_processo
# Set icon
self.setWindowIcon(QtGui.QIcon("icon.png"))

# Load font
font_path = os.path.join("fonts", "VCR_OSD_MONO_1.001.ttf")
if os.path.exists(font_path):
logging.info("Loading font from: {}".format(font_path))
font_id = QtGui.QFontDatabase.addApplicationFont(font_path)
font_name = QtGui.QFontDatabase.applicationFontFamilies(font_id)[0]
self.setFont(QtGui.QFont(font_name, 12 if sys.platform == "darwin" else 10, 300))

# Show GUI
self.show()
self.setAcceptDrops(True)
Expand Down Expand Up @@ -297,7 +305,7 @@ def control_next_frame(self) -> None:
while self.frames_processor.rendering_pause_request.value \
or self.frames_processor.rendering_single_frame_forward_request.value:
time.sleep(0.01)
self.btn_play_pause.setText("Play")
self.btn_play_pause.setText("PLAY")

# Play file again and pause it
elif self.current_file:
Expand Down Expand Up @@ -335,7 +343,7 @@ def control_play_pause(self) -> None:
if not self.frames_processor.rendering_pause_request.value \
and not self.frames_processor.rendering_resume_request.value:
# Pause rendering
if self.btn_play_pause.text() == "Pause":
if self.btn_play_pause.text() == "PAUSE":
self.pause_rendering()

# Resume rendering
Expand All @@ -357,7 +365,7 @@ def timeline_callback(self) -> None:
:return:
"""
# Store current setting
paused_previously = self.btn_play_pause.text() == "Play"
paused_previously = self.btn_play_pause.text() == "PLAY"

# Rendering is active
if self.frames_processor.rendering_process_active.value:
Expand Down Expand Up @@ -456,7 +464,7 @@ def rendering_done(self, successful: bool) -> None:
self.rb_preview_processed.setEnabled(False)

# Change button text to Play
self.btn_play_pause.setText("Play")
self.btn_play_pause.setText("PLAY")

# Enable controls back
if self.render_to_file:
Expand Down Expand Up @@ -511,7 +519,7 @@ def menu_about(self) -> None:
"\nFFmpeg library by www.ffmpeg.org"
"\nBloomEffect by Yoann Berenguer"
"\nIdea and help with theme switch by Keepalove (Azarell) (Sprav04ka)"
.format(self.version))
.format(self.version).upper())
about_box.exec_()

def open_file(self, filename=None, render_to_file=None, render_from_frame=1) -> None:
Expand Down Expand Up @@ -562,7 +570,7 @@ def open_file(self, filename=None, render_to_file=None, render_from_frame=1) ->
video_parameters["width"],
video_parameters["height"],
round(video_parameters["fps"], 2),
video_parameters["bit_rate"] // 1000))
video_parameters["bit_rate"] // 1000).upper())

render_to_frame = frames
if render_to_file:
Expand All @@ -573,10 +581,10 @@ def open_file(self, filename=None, render_to_file=None, render_from_frame=1) ->
render_to_frame = int(self.config["render_frame_to"])

# Show QProgressDialog if rendering to file
self.rendering_progress = QProgressDialog("Rendering file\n{}".format(filename), "",
self.rendering_progress = QProgressDialog("RENDERING FILE\n{}".format(filename).upper(), "",
0, 100, self)
self.rendering_progress.setWindowTitle("Rendering")
self.rendering_progress.setCancelButtonText("Abort")
self.rendering_progress.setWindowTitle("RENDERING")
self.rendering_progress.setCancelButtonText("ABORT")
self.rendering_progress.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
self.rendering_progress.canceled.connect(self.abort_file_rendering)
self.rendering_progress.show()
Expand All @@ -600,7 +608,7 @@ def open_file(self, filename=None, render_to_file=None, render_from_frame=1) ->
video_parameters, render_to_file)

# Enable controls
self.btn_play_pause.setText("Pause")
self.btn_play_pause.setText("PAUSE")
self.btn_previous.setEnabled(not render_to_file)
self.btn_play_pause.setEnabled(not render_to_file)
self.btn_next.setEnabled(not render_to_file)
Expand Down Expand Up @@ -699,7 +707,7 @@ def abort_file_rendering(self) -> None:

# Prevent dialog after aborting
if self.frames_processor.rendering_process_active.value:
reply = QMessageBox.question(self, "Abort rendering", "Are you sure you want to stop rendering process?",
reply = QMessageBox.question(self, "ABORT RENDERING", "ARE YOU SURE YOU WANT TO STOP RENDERING PROCESS?",
QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if reply == QMessageBox.Yes:
# Stop rendering =(
Expand All @@ -720,7 +728,7 @@ def pause_rendering(self) -> None:
self.frames_processor.rendering_pause_request.value = True
while self.frames_processor.rendering_pause_request.value:
time.sleep(0.01)
self.btn_play_pause.setText("Play")
self.btn_play_pause.setText("PLAY")

def resume_rendering(self) -> None:
"""
Expand All @@ -732,7 +740,7 @@ def resume_rendering(self) -> None:
self.frames_processor.rendering_resume_request.value = True
while self.frames_processor.rendering_resume_request.value:
time.sleep(0.01)
self.btn_play_pause.setText("Pause")
self.btn_play_pause.setText("PAUSE")

def stop_rendering(self) -> None:
"""
Expand All @@ -754,10 +762,10 @@ def error_message_box(self, error_message: str, additional_text=None) -> None:
"""
error_box = QMessageBox(self)
error_box.setIcon(QMessageBox.Critical)
error_box.setWindowTitle("Error")
error_box.setText(error_message)
error_box.setWindowTitle("ERROR")
error_box.setText(error_message.upper())
if additional_text:
error_box.setInformativeText(str(additional_text))
error_box.setInformativeText(str(additional_text).upper())
error_box.exec_()

def dragEnterEvent(self, event):
Expand Down Expand Up @@ -823,7 +831,7 @@ def closeEvent(self, event) -> None:
:return:
"""
if self.current_file:
reply = QMessageBox.question(self, "Quit", "Are you sure you want to quit?",
reply = QMessageBox.question(self, "QUIT", "ARE YOU SURE YOU WANT TO QUIT?",
QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if reply == QMessageBox.Yes:
# Stop current rendering
Expand Down
3 changes: 2 additions & 1 deletion NTSC-VHS-Renderer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ PyInstaller.config.CONF['workpath'] = './build'
COMPILE_NAME = 'NTSC-VHS-Renderer'

# Version of main.py
COMPILE_VERSION = '1.2.0'
COMPILE_VERSION = '1.3.0'

# Files and folders to include in final build directory (dist/COMPILE_NAME folder)
INCLUDE_FILES = ['icon.png',
'icon.ico',
'gui.ui',
'config.json',
'stylesheets',
'fonts',
'bloom',
'ffmpeg-6.0-essentials_build',
'NTSC-CRT',
Expand Down
Binary file added fonts/VCR_OSD_MONO_1.001.ttf
Binary file not shown.
Binary file modified git_media/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 45f4a7a

Please sign in to comment.