Skip to content

Commit

Permalink
Modified some relative imports
Browse files Browse the repository at this point in the history
  • Loading branch information
robotmitchum committed Jan 3, 2025
1 parent 639c480 commit e4c93ce
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 14 deletions.
5 changes: 4 additions & 1 deletion tools/audio_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def play(self, data, sr, loop_start, loop_end, msg=None):
sd.sleep(100)
if msg:
if loop_start is None or loop_start is None:
msg(f'■ Press space bar to play')
try:
msg(f'■ Press space bar to play')
except RuntimeError as e:
pass

def stop(self, msg=None):
if self.is_playing.is_set():
Expand Down
4 changes: 2 additions & 2 deletions tools/base_tool_UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ def lw_drop_event(self, event):
event.ignore()

def closeEvent(self, event):
print(f'{self.objectName()} closed')
self.player.stop(msg=None)
self.removeEventFilter(self)
self.player.stop()
print(f'{self.objectName()} closed')
event.accept()

def disable_focus(self):
Expand Down
3 changes: 2 additions & 1 deletion tools/loop_tool_UI.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ from pathlib import Path

from PyQt5 import QtGui, QtCore

import UI.loop_tool as gui
import loop_sample as ls
from audio_player import play_notification
from base_tool_UI import BaseToolUi, launch
from common_ui_utils import add_ctx, resource_path
from sample_utils import Sample
# import UI.loop_tool as gui
from tools.UI import loop_tool as gui

# from simple_logger import SimpleLogger

Expand Down
4 changes: 3 additions & 1 deletion tools/rename_tool_UI.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ from pathlib import Path

from PyQt5 import QtWidgets, QtGui, Qt, QtCore

import UI.rename_tool as gui
# import UI.rename_tool as gui
from tools.UI import rename_tool as gui

import sample_utils as st
from audio_player import play_notification
from base_tool_UI import BaseToolUi, launch
Expand Down
3 changes: 2 additions & 1 deletion tools/smp2ds_UI.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ from PyQt5 import QtGui, QtCore, Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox

import smp_to_dspreset as smp2ds
from UI import smp_to_ds as gui
from audio_player import play_notification
from common_prefs_utils import Node, get_settings, set_settings, read_settings, write_settings
from common_ui_utils import add_ctx, add_insert_ctx, popup_menu
from common_ui_utils import beautify_str, resource_path, resource_path_alt, shorten_path
from jsonFile import read_json
from smp_to_dspreset import __version__
# import UI.smp_to_ds as gui
from tools.UI import smp_to_ds as gui


class Smp2dsUi(gui.Ui_smp_to_ds_ui, QMainWindow):
Expand Down
3 changes: 2 additions & 1 deletion tools/split_tool_UI.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ from pathlib import Path

from PyQt5 import QtGui, QtCore

import UI.split_tool as gui
import split_audio as sa
from audio_player import play_notification
from base_tool_UI import BaseToolUi, launch
from common_ui_utils import add_ctx, get_documents_directory, resource_path
from sample_utils import Sample
# import UI.split_tool as gui
from tools.UI import split_tool as gui

try:
import crepe
Expand Down
8 changes: 4 additions & 4 deletions tools/st_tool_UI.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ import os
import threading
import traceback
from functools import partial
from glob import glob
from pathlib import Path
from typing import cast

import soundfile as sf
from PyQt5 import QtWidgets, QtGui, QtCore

import UI.st_tool as gui
import pseudo_stereo as ps
from audio_player import play_notification
from base_tool_UI import BaseToolUi, launch
from common_audio_utils import rms
from common_ui_utils import add_ctx, replace_widget, FilePathLabel, resource_path
from common_ui_utils import add_ctx, replace_widget, FilePathLabel, resource_path, resource_path_alt
from file_utils import resolve_overwriting
from sample_utils import Sample
# import UI.st_tool as gui
from tools.UI import st_tool as gui
from utils import append_metadata, set_md_tags

__version__ = '1.1.0'
Expand Down Expand Up @@ -307,7 +307,7 @@ class StToolUi(gui.Ui_st_tool_mw, BaseToolUi):

def get_ir_samples(self, ir_subdir='dh_ir'):
self.ir_samples = []
ir_path = resource_path(self.base_dir / ir_subdir, as_str=False)
ir_path = resource_path_alt(self.base_dir / ir_subdir, parent_dir='', as_str=False)
if ir_path.is_dir():
for ext in self.file_types:
ir_smp = ir_path.glob(f'*{ext}')
Expand Down
6 changes: 3 additions & 3 deletions tools/upsample_tool_UI.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import soundfile as sf
from PyQt5 import QtWidgets, QtGui, QtCore
from scipy import interpolate

import UI.upsample_tool as gui
import noise_reduction as nr
from audio_player import play_notification
from base_tool_UI import BaseToolUi, launch
Expand All @@ -28,11 +27,12 @@ from file_utils import resolve_overwriting
from loop_sample import db_to_lin
from sample_utils import Sample
from split_audio import envelope_transform
from subprocess_utils import DisableShellWindows
# import UI.upsample_tool as gui
from tools.UI import upsample_tool as gui
from upsample import audio_upsample
from utils import append_metadata, set_md_tags

from subprocess_utils import DisableShellWindows

__version__ = '1.1.0'


Expand Down

0 comments on commit e4c93ce

Please sign in to comment.