Added save for last selected music files
This commit is contained in:
@@ -41,7 +41,8 @@ stackedModels_dir = os.path.join(base_path, 'models')
|
|||||||
banner_path = os.path.join(base_path, 'img', 'UVR-banner.png')
|
banner_path = os.path.join(base_path, 'img', 'UVR-banner.png')
|
||||||
refresh_path = os.path.join(base_path, 'img', 'refresh.png')
|
refresh_path = os.path.join(base_path, 'img', 'refresh.png')
|
||||||
DEFAULT_DATA = {
|
DEFAULT_DATA = {
|
||||||
'export_path': '',
|
'exportPath': '',
|
||||||
|
'inputPaths': [],
|
||||||
'gpu': False,
|
'gpu': False,
|
||||||
'postprocess': False,
|
'postprocess': False,
|
||||||
'tta': False,
|
'tta': False,
|
||||||
@@ -55,8 +56,8 @@ DEFAULT_DATA = {
|
|||||||
'stackOnly': False,
|
'stackOnly': False,
|
||||||
'saveAllStacked': False,
|
'saveAllStacked': False,
|
||||||
'modelFolder': False,
|
'modelFolder': False,
|
||||||
'modelInstrumentalLabel': 'model_iter26_sr33075_hl384_w512.pth',
|
'modelInstrumentalLabel': '',
|
||||||
'modelStackedLabel': 'baseline.pth',
|
'modelStackedLabel': '',
|
||||||
'aiModel': 'v4',
|
'aiModel': 'v4',
|
||||||
|
|
||||||
'useModel': 'instrumental',
|
'useModel': 'instrumental',
|
||||||
@@ -193,7 +194,7 @@ def drop(event, accept_mode: str = 'files'):
|
|||||||
path[-1] = path[-1].replace('}', '')
|
path[-1] = path[-1].replace('}', '')
|
||||||
# Set Variables
|
# Set Variables
|
||||||
root.inputPaths = path
|
root.inputPaths = path
|
||||||
root.inputPathsEntry_var.set('; '.join(path))
|
root.update_inputPaths()
|
||||||
else:
|
else:
|
||||||
# Invalid accept mode
|
# Invalid accept mode
|
||||||
return
|
return
|
||||||
@@ -280,8 +281,8 @@ class MainWindow(TkinterDnD.Tk):
|
|||||||
# -Tkinter Value Holders-
|
# -Tkinter Value Holders-
|
||||||
data = load_data()
|
data = load_data()
|
||||||
# Paths
|
# Paths
|
||||||
self.exportPath_var = tk.StringVar(value=data['export_path'])
|
self.exportPath_var = tk.StringVar(value=data['exportPath'])
|
||||||
self.inputPaths = []
|
self.inputPaths = data['inputPaths']
|
||||||
# Processing Options
|
# Processing Options
|
||||||
self.gpuConversion_var = tk.BooleanVar(value=data['gpu'])
|
self.gpuConversion_var = tk.BooleanVar(value=data['gpu'])
|
||||||
self.postprocessing_var = tk.BooleanVar(value=data['postprocess'])
|
self.postprocessing_var = tk.BooleanVar(value=data['postprocess'])
|
||||||
@@ -607,7 +608,7 @@ class MainWindow(TkinterDnD.Tk):
|
|||||||
)
|
)
|
||||||
if paths: # Path selected
|
if paths: # Path selected
|
||||||
self.inputPaths = paths
|
self.inputPaths = paths
|
||||||
self.inputPathsEntry_var.set('; '.join(paths))
|
self.update_inputPaths()
|
||||||
self.lastDir = os.path.dirname(paths[0])
|
self.lastDir = os.path.dirname(paths[0])
|
||||||
|
|
||||||
def open_export_filedialog(self):
|
def open_export_filedialog(self):
|
||||||
@@ -783,6 +784,16 @@ class MainWindow(TkinterDnD.Tk):
|
|||||||
widget.configure(state=tk.NORMAL)
|
widget.configure(state=tk.NORMAL)
|
||||||
var.set(DEFAULT_DATA[key])
|
var.set(DEFAULT_DATA[key])
|
||||||
|
|
||||||
|
def update_inputPaths(self):
|
||||||
|
"""Update the music file entry"""
|
||||||
|
if self.inputPaths:
|
||||||
|
# Non-empty Selection
|
||||||
|
text = '; '.join(self.inputPaths)
|
||||||
|
else:
|
||||||
|
# Empty Selection
|
||||||
|
text = ''
|
||||||
|
self.inputPathsEntry_var.set(text)
|
||||||
|
|
||||||
def update_loop(self):
|
def update_loop(self):
|
||||||
"""Update the dropdown menu"""
|
"""Update the dropdown menu"""
|
||||||
self.update_available_models()
|
self.update_available_models()
|
||||||
@@ -889,6 +900,7 @@ class MainWindow(TkinterDnD.Tk):
|
|||||||
relx=1/3 + 1/3/2, rely=3/self.COL2_ROWS, relwidth=1/3/4, relheight=1/self.COL2_ROWS)
|
relx=1/3 + 1/3/2, rely=3/self.COL2_ROWS, relwidth=1/3/4, relheight=1/self.COL2_ROWS)
|
||||||
|
|
||||||
self.decode_modelNames()
|
self.decode_modelNames()
|
||||||
|
self.update_inputPaths()
|
||||||
|
|
||||||
def deselect_models(self):
|
def deselect_models(self):
|
||||||
"""
|
"""
|
||||||
@@ -925,7 +937,6 @@ class MainWindow(TkinterDnD.Tk):
|
|||||||
"""
|
"""
|
||||||
Save the data of the application
|
Save the data of the application
|
||||||
"""
|
"""
|
||||||
export_path = self.exportPath_var.get()
|
|
||||||
# Get constants
|
# Get constants
|
||||||
instrumental = get_model_values(self.instrumentalModel_var.get())
|
instrumental = get_model_values(self.instrumentalModel_var.get())
|
||||||
stacked = get_model_values(self.stackedModel_var.get())
|
stacked = get_model_values(self.stackedModel_var.get())
|
||||||
@@ -942,7 +953,8 @@ class MainWindow(TkinterDnD.Tk):
|
|||||||
|
|
||||||
# -Save Data-
|
# -Save Data-
|
||||||
save_data(data={
|
save_data(data={
|
||||||
'export_path': export_path,
|
'exportPath': self.exportPath_var.get(),
|
||||||
|
'inputPaths': self.inputPaths,
|
||||||
'gpu': self.gpuConversion_var.get(),
|
'gpu': self.gpuConversion_var.get(),
|
||||||
'postprocess': self.postprocessing_var.get(),
|
'postprocess': self.postprocessing_var.get(),
|
||||||
'tta': self.tta_var.get(),
|
'tta': self.tta_var.get(),
|
||||||
|
|||||||
Reference in New Issue
Block a user