Collection of tools useful for audio production
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

452 lines
20KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Common/Shared code related to Settings dialog
  4. # Copyright (C) 2010-2012 Filipe Coelho <falktx@gmail.com>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # For a full copy of the GNU General Public License see the COPYING file
  17. # Imports (Global)
  18. from PyQt4.QtCore import pyqtSlot, SIGNAL, SLOT
  19. from PyQt4.QtGui import QDialog, QDialogButtonBox, QIcon, QPixmap
  20. # Imports (Custom Stuff)
  21. import ui_settings_app
  22. from shared import *
  23. from patchcanvas_theme import *
  24. TAB_INDEX_MAIN = 0
  25. TAB_INDEX_CANVAS = 1
  26. TAB_INDEX_LADISH = 2
  27. TAB_INDEX_CARLA_ENGINE = 3
  28. TAB_INDEX_CARLA_PATHS = 4
  29. # Define values here so we don't have to import full patchcanvas here
  30. CANVAS_ANTIALIASING_SMALL = 1
  31. CANVAS_EYECANDY_SMALL = 1
  32. # ladish defines
  33. LADISH_CONF_KEY_DAEMON_NOTIFY = "/org/ladish/daemon/notify"
  34. LADISH_CONF_KEY_DAEMON_SHELL = "/org/ladish/daemon/shell"
  35. LADISH_CONF_KEY_DAEMON_TERMINAL = "/org/ladish/daemon/terminal"
  36. LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART = "/org/ladish/daemon/studio_autostart"
  37. LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY = "/org/ladish/daemon/js_save_delay"
  38. LADISH_CONF_KEY_DAEMON_NOTIFY_DEFAULT = True
  39. LADISH_CONF_KEY_DAEMON_SHELL_DEFAULT = "sh"
  40. LADISH_CONF_KEY_DAEMON_TERMINAL_DEFAULT = "x-terminal-emulator"
  41. LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART_DEFAULT = True
  42. LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY_DEFAULT = 0
  43. # Internal defines
  44. global SETTINGS_DEFAULT_PROJECT_FOLDER
  45. global SETTINGS_DEFAULT_PLUGINS_PATHS
  46. SETTINGS_DEFAULT_PROJECT_FOLDER = "/tmp"
  47. SETTINGS_DEFAULT_PLUGINS_PATHS = [None, None, None, None, None]
  48. def setDefaultProjectFolder(folder):
  49. global SETTINGS_DEFAULT_PROJECT_FOLDER
  50. SETTINGS_DEFAULT_PROJECT_FOLDER = folder
  51. def setDefaultPluginsPaths(ladspas, dssis, lv2s, vsts, sf2s):
  52. global SETTINGS_DEFAULT_PLUGINS_PATHS
  53. SETTINGS_DEFAULT_PLUGINS_PATHS[0] = ladspas
  54. SETTINGS_DEFAULT_PLUGINS_PATHS[1] = dssis
  55. SETTINGS_DEFAULT_PLUGINS_PATHS[2] = lv2s
  56. SETTINGS_DEFAULT_PLUGINS_PATHS[3] = vsts
  57. SETTINGS_DEFAULT_PLUGINS_PATHS[4] = sf2s
  58. # Settings Dialog
  59. class SettingsW(QDialog, ui_settings_app.Ui_SettingsW):
  60. def __init__(self, parent, appName, hasOpenGL=False):
  61. QDialog.__init__(self, parent)
  62. self.setupUi(self)
  63. # Load app-specific settings
  64. self.ms_RefreshInterval = 120
  65. self.ms_AutoHideGroups = True
  66. self.ms_UseSystemTray = True
  67. self.ms_CloseToTray = False
  68. if appName == "catarina":
  69. self.ms_AutoHideGroups = False
  70. self.lw_page.hideRow(0)
  71. self.lw_page.hideRow(2)
  72. self.lw_page.hideRow(3)
  73. self.lw_page.hideRow(4)
  74. self.lw_page.setCurrentCell(1, 0)
  75. elif appName == "catia":
  76. self.ms_UseSystemTray = False
  77. self.group_main_paths.setEnabled(False)
  78. self.group_main_paths.setVisible(False)
  79. self.group_tray.setEnabled(False)
  80. self.group_tray.setVisible(False)
  81. self.lw_page.hideRow(2)
  82. self.lw_page.hideRow(3)
  83. self.lw_page.hideRow(4)
  84. self.lw_page.setCurrentCell(0, 0)
  85. elif appName == "claudia":
  86. self.cb_jack_port_alias.setEnabled(False)
  87. self.cb_jack_port_alias.setVisible(False)
  88. self.label_jack_port_alias.setEnabled(False)
  89. self.label_jack_port_alias.setVisible(False)
  90. self.lw_page.hideRow(3)
  91. self.lw_page.hideRow(4)
  92. self.lw_page.setCurrentCell(0, 0)
  93. elif appName == "carla":
  94. self.ms_RefreshInterval = 60
  95. self.cb_jack_port_alias.setEnabled(False)
  96. self.cb_jack_port_alias.setVisible(False)
  97. self.label_jack_port_alias.setEnabled(False)
  98. self.label_jack_port_alias.setVisible(False)
  99. self.group_tray.setEnabled(False)
  100. self.group_tray.setVisible(False)
  101. self.lw_page.hideRow(1)
  102. self.lw_page.hideRow(2)
  103. self.lw_page.setCurrentCell(0, 0)
  104. self.settings = self.parent().settings
  105. self.loadSettings()
  106. if not hasOpenGL:
  107. self.cb_canvas_use_opengl.setChecked(False)
  108. self.cb_canvas_use_opengl.setEnabled(False)
  109. self.label_icon.setPixmap(QPixmap(":/48x48/%s" % appName))
  110. self.lw_page.item(0, 0).setIcon(QIcon(":/48x48/%s" % appName))
  111. self.lw_page.item(3, 0).setIcon(QIcon.fromTheme("application-x-executable", QIcon(":/48x48/exec.png")))
  112. self.connect(self, SIGNAL("accepted()"), SLOT("slot_saveSettings()"))
  113. self.connect(self.b_main_def_folder_open, SIGNAL("clicked()"), SLOT("slot_getAndSetPath_project()"))
  114. self.connect(self.b_paths_add, SIGNAL("clicked()"), SLOT("slot_addPath()"))
  115. self.connect(self.b_paths_remove, SIGNAL("clicked()"), SLOT("slot_removePath()"))
  116. self.connect(self.b_paths_change, SIGNAL("clicked()"), SLOT("slot_changePath()"))
  117. self.connect(self.tw_paths, SIGNAL("currentChanged(int)"), SLOT("slot_pathTabChanged(int)"))
  118. self.connect(self.lw_ladspa, SIGNAL("currentRowChanged(int)"), SLOT("slot_pathRowChanged(int)"))
  119. self.connect(self.lw_dssi, SIGNAL("currentRowChanged(int)"), SLOT("slot_pathRowChanged(int)"))
  120. self.connect(self.lw_lv2, SIGNAL("currentRowChanged(int)"), SLOT("slot_pathRowChanged(int)"))
  121. self.connect(self.lw_vst, SIGNAL("currentRowChanged(int)"), SLOT("slot_pathRowChanged(int)"))
  122. self.connect(self.lw_sf2, SIGNAL("currentRowChanged(int)"), SLOT("slot_pathRowChanged(int)"))
  123. self.connect(self.buttonBox.button(QDialogButtonBox.Reset), SIGNAL("clicked()"), SLOT("slot_resetSettings()"))
  124. self.lw_ladspa.setCurrentRow(0)
  125. self.lw_dssi.setCurrentRow(0)
  126. self.lw_lv2.setCurrentRow(0)
  127. self.lw_vst.setCurrentRow(0)
  128. self.lw_sf2.setCurrentRow(0)
  129. self.slot_pathTabChanged(self.tw_paths.currentIndex())
  130. def loadSettings(self):
  131. if not self.lw_page.isRowHidden(TAB_INDEX_MAIN):
  132. self.le_main_def_folder.setText(self.settings.value("Main/DefaultProjectFolder", SETTINGS_DEFAULT_PROJECT_FOLDER, type=str))
  133. self.cb_tray_enable.setChecked(self.settings.value("Main/UseSystemTray", self.ms_UseSystemTray, type=bool))
  134. self.cb_tray_close_to.setChecked(self.settings.value("Main/CloseToTray", self.ms_CloseToTray, type=bool))
  135. self.sb_gui_refresh.setValue(self.settings.value("Main/RefreshInterval", self.ms_RefreshInterval, type=int))
  136. self.cb_jack_port_alias.setCurrentIndex(self.settings.value("Main/JackPortAlias", 2, type=int))
  137. # ---------------------------------------
  138. if not self.lw_page.isRowHidden(TAB_INDEX_CANVAS):
  139. self.cb_canvas_hide_groups.setChecked(self.settings.value("Canvas/AutoHideGroups", self.ms_AutoHideGroups, type=bool))
  140. self.cb_canvas_bezier_lines.setChecked(self.settings.value("Canvas/UseBezierLines", True, type=bool))
  141. self.cb_canvas_eyecandy.setCheckState(self.settings.value("Canvas/EyeCandy", CANVAS_EYECANDY_SMALL, type=int))
  142. self.cb_canvas_use_opengl.setChecked(self.settings.value("Canvas/UseOpenGL", False, type=bool))
  143. self.cb_canvas_render_aa.setCheckState(self.settings.value("Canvas/Antialiasing", CANVAS_ANTIALIASING_SMALL, type=int))
  144. self.cb_canvas_render_text_aa.setChecked(self.settings.value("Canvas/TextAntialiasing", True, type=bool))
  145. self.cb_canvas_render_hq_aa.setChecked(self.settings.value("Canvas/HighQualityAntialiasing", False, type=bool))
  146. theme_name = self.settings.value("Canvas/Theme", getDefaultThemeName(), type=str)
  147. for i in range(Theme.THEME_MAX):
  148. this_theme_name = getThemeName(i)
  149. self.cb_canvas_theme.addItem(this_theme_name)
  150. if this_theme_name == theme_name:
  151. self.cb_canvas_theme.setCurrentIndex(i)
  152. # ---------------------------------------
  153. if not self.lw_page.isRowHidden(TAB_INDEX_LADISH):
  154. self.cb_ladish_notify.setChecked(self.settings.value(LADISH_CONF_KEY_DAEMON_NOTIFY, LADISH_CONF_KEY_DAEMON_NOTIFY_DEFAULT, type=bool))
  155. self.le_ladish_shell.setText(self.settings.value(LADISH_CONF_KEY_DAEMON_SHELL, LADISH_CONF_KEY_DAEMON_SHELL_DEFAULT, type=str))
  156. self.le_ladish_terminal.setText(self.settings.value(LADISH_CONF_KEY_DAEMON_TERMINAL, LADISH_CONF_KEY_DAEMON_TERMINAL_DEFAULT, type=str))
  157. self.cb_ladish_studio_autostart.setChecked(self.settings.value(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART, LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART_DEFAULT, type=bool))
  158. self.sb_ladish_jsdelay.setValue(self.settings.value(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY_DEFAULT, type=int))
  159. # --------------------------------------------
  160. if not self.lw_page.isRowHidden(TAB_INDEX_CARLA_ENGINE):
  161. self.ch_engine_global_client.setChecked(self.settings.value("Engine/GlobalClient", False, type=bool))
  162. self.ch_engine_dssi_chunks.setChecked(self.settings.value("Engine/DSSIChunks", False, type=bool))
  163. self.ch_engine_prefer_bridges.setChecked(self.settings.value("Engine/PreferBridges", True, type=bool))
  164. # --------------------------------------------
  165. if not self.lw_page.isRowHidden(TAB_INDEX_CARLA_PATHS):
  166. ladspas = toList(self.settings.value("Paths/LADSPA", SETTINGS_DEFAULT_PLUGINS_PATHS[0]))
  167. dssis = toList(self.settings.value("Paths/DSSI", SETTINGS_DEFAULT_PLUGINS_PATHS[1]))
  168. lv2s = toList(self.settings.value("Paths/LV2", SETTINGS_DEFAULT_PLUGINS_PATHS[2]))
  169. vsts = toList(self.settings.value("Paths/VST", SETTINGS_DEFAULT_PLUGINS_PATHS[3]))
  170. sf2s = toList(self.settings.value("Paths/SF2", SETTINGS_DEFAULT_PLUGINS_PATHS[4]))
  171. ladspas.sort()
  172. dssis.sort()
  173. lv2s.sort()
  174. vsts.sort()
  175. sf2s.sort()
  176. for ladspa in ladspas:
  177. self.lw_ladspa.addItem(ladspa)
  178. for dssi in dssis:
  179. self.lw_dssi.addItem(dssi)
  180. for lv2 in lv2s:
  181. self.lw_lv2.addItem(lv2)
  182. for vst in vsts:
  183. self.lw_vst.addItem(vst)
  184. for sf2 in sf2s:
  185. self.lw_sf2.addItem(sf2)
  186. @pyqtSlot()
  187. def slot_getAndSetPath_project(self):
  188. getAndSetPath(self, self.le_main_def_folder.text(), self.le_main_def_folder)
  189. @pyqtSlot()
  190. def slot_addPath(self):
  191. newPath = QFileDialog.getExistingDirectory(self, self.tr("Add Path"), "", QFileDialog.ShowDirsOnly)
  192. if newPath:
  193. if self.tw_paths.currentIndex() == 0:
  194. self.lw_ladspa.addItem(newPath)
  195. elif self.tw_paths.currentIndex() == 1:
  196. self.lw_dssi.addItem(newPath)
  197. elif self.tw_paths.currentIndex() == 2:
  198. self.lw_lv2.addItem(newPath)
  199. elif self.tw_paths.currentIndex() == 3:
  200. self.lw_vst.addItem(newPath)
  201. elif self.tw_paths.currentIndex() == 4:
  202. self.lw_sf2.addItem(newPath)
  203. @pyqtSlot()
  204. def slot_removePath(self):
  205. if self.tw_paths.currentIndex() == 0:
  206. self.lw_ladspa.takeItem(self.lw_ladspa.currentRow())
  207. elif self.tw_paths.currentIndex() == 1:
  208. self.lw_dssi.takeItem(self.lw_dssi.currentRow())
  209. elif self.tw_paths.currentIndex() == 2:
  210. self.lw_lv2.takeItem(self.lw_lv2.currentRow())
  211. elif self.tw_paths.currentIndex() == 3:
  212. self.lw_vst.takeItem(self.lw_vst.currentRow())
  213. elif self.tw_paths.currentIndex() == 4:
  214. self.lw_sf2.takeItem(self.lw_sf2.currentRow())
  215. @pyqtSlot()
  216. def slot_changePath(self):
  217. if self.tw_paths.currentIndex() == 0:
  218. currentPath = self.lw_ladspa.currentItem().text()
  219. elif self.tw_paths.currentIndex() == 1:
  220. currentPath = self.lw_dssi.currentItem().text()
  221. elif self.tw_paths.currentIndex() == 2:
  222. currentPath = self.lw_lv2.currentItem().text()
  223. elif self.tw_paths.currentIndex() == 3:
  224. currentPath = self.lw_vst.currentItem().text()
  225. elif self.tw_paths.currentIndex() == 4:
  226. currentPath = self.lw_sf2.currentItem().text()
  227. else:
  228. currentPath = ""
  229. newPath = QFileDialog.getExistingDirectory(self, self.tr("Add Path"), currentPath, QFileDialog.ShowDirsOnly)
  230. if newPath:
  231. if self.tw_paths.currentIndex() == 0:
  232. self.lw_ladspa.currentItem().setText(newPath)
  233. elif self.tw_paths.currentIndex() == 1:
  234. self.lw_dssi.currentItem().setText(newPath)
  235. elif self.tw_paths.currentIndex() == 2:
  236. self.lw_lv2.currentItem().setText(newPath)
  237. elif self.tw_paths.currentIndex() == 3:
  238. self.lw_vst.currentItem().setText(newPath)
  239. elif self.tw_paths.currentIndex() == 4:
  240. self.lw_sf2.currentItem().setText(newPath)
  241. @pyqtSlot(int)
  242. def slot_pathTabChanged(self, index):
  243. if index == 0:
  244. row = self.lw_ladspa.currentRow()
  245. elif index == 1:
  246. row = self.lw_dssi.currentRow()
  247. elif index == 2:
  248. row = self.lw_lv2.currentRow()
  249. elif index == 3:
  250. row = self.lw_vst.currentRow()
  251. elif index == 4:
  252. row = self.lw_sf2.currentRow()
  253. else:
  254. row = -1
  255. check = bool(row >= 0)
  256. self.b_paths_remove.setEnabled(check)
  257. self.b_paths_change.setEnabled(check)
  258. @pyqtSlot(int)
  259. def slot_pathRowChanged(self, row):
  260. check = bool(row >= 0)
  261. self.b_paths_remove.setEnabled(check)
  262. self.b_paths_change.setEnabled(check)
  263. @pyqtSlot()
  264. def slot_saveSettings(self):
  265. if not self.lw_page.isRowHidden(TAB_INDEX_MAIN):
  266. self.settings.setValue("Main/RefreshInterval", self.sb_gui_refresh.value())
  267. if self.group_tray.isEnabled():
  268. self.settings.setValue("Main/UseSystemTray", self.cb_tray_enable.isChecked())
  269. self.settings.setValue("Main/CloseToTray", self.cb_tray_close_to.isChecked())
  270. if self.group_main_paths.isEnabled():
  271. self.settings.setValue("Main/DefaultProjectFolder", self.le_main_def_folder.text())
  272. if self.cb_jack_port_alias.isEnabled():
  273. self.settings.setValue("Main/JackPortAlias", self.cb_jack_port_alias.currentIndex())
  274. # ---------------------------------------
  275. if not self.lw_page.isRowHidden(TAB_INDEX_CANVAS):
  276. self.settings.setValue("Canvas/Theme", self.cb_canvas_theme.currentText())
  277. self.settings.setValue("Canvas/AutoHideGroups", self.cb_canvas_hide_groups.isChecked())
  278. self.settings.setValue("Canvas/UseBezierLines", self.cb_canvas_bezier_lines.isChecked())
  279. self.settings.setValue("Canvas/UseOpenGL", self.cb_canvas_use_opengl.isChecked())
  280. self.settings.setValue("Canvas/TextAntialiasing", self.cb_canvas_render_text_aa.isChecked())
  281. self.settings.setValue("Canvas/HighQualityAntialiasing", self.cb_canvas_render_hq_aa.isChecked())
  282. # 0, 1, 2 match their enum variants
  283. self.settings.setValue("Canvas/EyeCandy", self.cb_canvas_eyecandy.checkState())
  284. self.settings.setValue("Canvas/Antialiasing", self.cb_canvas_render_aa.checkState())
  285. # ---------------------------------------
  286. if not self.lw_page.isRowHidden(TAB_INDEX_LADISH):
  287. self.settings.setValue(LADISH_CONF_KEY_DAEMON_NOTIFY, self.cb_ladish_notify.isChecked())
  288. self.settings.setValue(LADISH_CONF_KEY_DAEMON_SHELL, self.le_ladish_shell.text())
  289. self.settings.setValue(LADISH_CONF_KEY_DAEMON_TERMINAL, self.le_ladish_terminal.text())
  290. self.settings.setValue(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART, self.cb_ladish_studio_autostart.isChecked())
  291. self.settings.setValue(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, self.sb_ladish_jsdelay.value())
  292. # --------------------------------------------
  293. if not self.lw_page.isRowHidden(TAB_INDEX_CARLA_ENGINE):
  294. self.settings.setValue("Engine/GlobalClient", self.ch_engine_global_client.isChecked())
  295. self.settings.setValue("Engine/DSSIChunks", self.ch_engine_dssi_chunks.isChecked())
  296. self.settings.setValue("Engine/PreferBridges", self.ch_engine_prefer_bridges.isChecked())
  297. # --------------------------------------------
  298. if not self.lw_page.isRowHidden(TAB_INDEX_CARLA_PATHS):
  299. ladspas = []
  300. dssis = []
  301. lv2s = []
  302. vsts = []
  303. sf2s = []
  304. for i in range(self.lw_ladspa.count()):
  305. ladspas.append(self.lw_ladspa.item(i).text())
  306. for i in range(self.lw_dssi.count()):
  307. dssis.append(self.lw_dssi.item(i).text())
  308. for i in range(self.lw_lv2.count()):
  309. lv2s.append(self.lw_lv2.item(i).text())
  310. for i in range(self.lw_vst.count()):
  311. vsts.append(self.lw_vst.item(i).text())
  312. for i in range(self.lw_sf2.count()):
  313. sf2s.append(self.lw_sf2.item(i).text())
  314. self.settings.setValue("Paths/LADSPA", ladspas)
  315. self.settings.setValue("Paths/DSSI", dssis)
  316. self.settings.setValue("Paths/LV2", lv2s)
  317. self.settings.setValue("Paths/VST", vsts)
  318. self.settings.setValue("Paths/SF2", sf2s)
  319. @pyqtSlot()
  320. def slot_resetSettings(self):
  321. if self.lw_page.currentRow() == TAB_INDEX_MAIN:
  322. self.le_main_def_folder.setText(SETTINGS_DEFAULT_PROJECT_FOLDER)
  323. self.cb_tray_enable.setChecked(self.ms_UseSystemTray)
  324. self.cb_tray_close_to.setChecked(self.ms_CloseToTray)
  325. self.sb_gui_refresh.setValue(self.ms_RefreshInterval)
  326. self.cb_jack_port_alias.setCurrentIndex(2)
  327. elif self.lw_page.currentRow() == TAB_INDEX_CANVAS:
  328. self.cb_canvas_theme.setCurrentIndex(0)
  329. self.cb_canvas_hide_groups.setChecked(self.ms_AutoHideGroups)
  330. self.cb_canvas_bezier_lines.setChecked(True)
  331. self.cb_canvas_eyecandy.setCheckState(Qt.PartiallyChecked)
  332. self.cb_canvas_use_opengl.setChecked(False)
  333. self.cb_canvas_render_aa.setCheckState(Qt.PartiallyChecked)
  334. self.cb_canvas_render_text_aa.setChecked(True)
  335. self.cb_canvas_render_hq_aa.setChecked(False)
  336. elif self.lw_page.currentRow() == TAB_INDEX_LADISH:
  337. self.cb_ladish_notify.setChecked(LADISH_CONF_KEY_DAEMON_NOTIFY_DEFAULT)
  338. self.cb_ladish_studio_autostart.setChecked(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART_DEFAULT)
  339. self.le_ladish_shell.setText(LADISH_CONF_KEY_DAEMON_SHELL_DEFAULT)
  340. self.le_ladish_terminal.setText(LADISH_CONF_KEY_DAEMON_TERMINAL_DEFAULT)
  341. elif self.lw_page.currentRow() == TAB_INDEX_CARLA_ENGINE:
  342. self.ch_engine_global_client.setChecked(False)
  343. self.ch_engine_dssi_chunks.setChecked(False)
  344. self.ch_engine_prefer_bridges.setChecked(True)
  345. elif self.lw_page.currentRow() == TAB_INDEX_CARLA_PATHS:
  346. ladspas, dssis, lv2s, vsts, sf2s = SETTINGS_DEFAULT_PLUGINS_PATHS
  347. if self.tw_paths.currentIndex() == 0:
  348. self.lw_ladspa.clear()
  349. ladspas.sort()
  350. for ladspa in ladspas:
  351. self.lw_ladspa.addItem(ladspa)
  352. elif self.tw_paths.currentIndex() == 1:
  353. self.lw_dssi.clear()
  354. dssis.sort()
  355. for dssi in dssis:
  356. self.lw_dssi.addItem(dssi)
  357. elif self.tw_paths.currentIndex() == 2:
  358. self.lw_lv2.clear()
  359. lv2s.sort()
  360. for lv2 in lv2s:
  361. self.lw_lv2.addItem(lv2)
  362. elif self.tw_paths.currentIndex() == 3:
  363. self.lw_vst.clear()
  364. vsts.sort()
  365. for vst in vsts:
  366. self.lw_vst.addItem(vst)
  367. elif self.tw_paths.currentIndex() == 4:
  368. self.lw_sf2.clear()
  369. sf2s.sort()
  370. for sf2 in sf2s:
  371. self.lw_sf2.addItem(sf2)