diff --git a/Makefile b/Makefile index 61843cbe7..a16430e0d 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,8 @@ source/resources_rc.py: resources/resources.qrc # UI code UIs = source/ui_carla.py source/ui_carla_control.py\ - source/ui_carla_about.py source/ui_carla_database.py source/ui_carla_edit.py source/ui_carla_parameter.py source/ui_carla_plugin.py source/ui_carla_refresh.py \ + source/ui_carla_about.py source/ui_carla_database.py source/ui_carla_edit.py source/ui_carla_parameter.py source/ui_carla_plugin.py \ + source/ui_carla_refresh.py source/ui_carla_settings.py \ source/ui_inputdialog_value.py UI: $(UIs) diff --git a/resources/16x16/dialog-information.png b/resources/16x16/dialog-information.png new file mode 100644 index 000000000..cbabb0e54 Binary files /dev/null and b/resources/16x16/dialog-information.png differ diff --git a/resources/16x16/edit-rename.png b/resources/16x16/edit-rename.png new file mode 100644 index 000000000..dbae38660 Binary files /dev/null and b/resources/16x16/edit-rename.png differ diff --git a/resources/16x16/list-remove.png b/resources/16x16/list-remove.png new file mode 100644 index 000000000..f1f0dee79 Binary files /dev/null and b/resources/16x16/list-remove.png differ diff --git a/resources/48x48/canvas.png b/resources/48x48/canvas.png new file mode 100644 index 000000000..9000e8f84 Binary files /dev/null and b/resources/48x48/canvas.png differ diff --git a/resources/48x48/folder.png b/resources/48x48/folder.png new file mode 100644 index 000000000..489ddd208 Binary files /dev/null and b/resources/48x48/folder.png differ diff --git a/resources/48x48/jack.png b/resources/48x48/jack.png new file mode 100644 index 000000000..9d4542635 Binary files /dev/null and b/resources/48x48/jack.png differ diff --git a/resources/resources.qrc b/resources/resources.qrc index f69800f77..f28717518 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -7,13 +7,16 @@ 16x16/arrow-right.png 16x16/configure.png 16x16/dialog-error.png + 16x16/dialog-information.png 16x16/dialog-ok-apply.png 16x16/document-new.png 16x16/document-open.png 16x16/document-save.png 16x16/document-save-as.png 16x16/edit-delete.png + 16x16/edit-rename.png 16x16/list-add.png + 16x16/list-remove.png 16x16/media-playback-start.png 16x16/media-playback-stop.png 16x16/network-connect.png @@ -23,6 +26,10 @@ 48x48/carla.png 48x48/carla-control.png + 48x48/canvas.png + 48x48/jack.png + 48x48/folder.png + 48x48/carla.png 48x48/carla-control.png diff --git a/resources/ui/carla_settings.ui b/resources/ui/carla_settings.ui new file mode 100644 index 000000000..1a7352b59 --- /dev/null +++ b/resources/ui/carla_settings.ui @@ -0,0 +1,1171 @@ + + + CarlaSettingsW + + + + 0 + 0 + 600 + 465 + + + + + 600 + 0 + + + + Settings + + + + + + + + + 125 + 16777215 + + + + QAbstractItemView::NoEditTriggers + + + false + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + + 48 + 48 + + + + Qt::ElideMiddle + + + false + + + false + + + false + + + true + + + false + + + 52 + + + + main + + + + + canvas + + + + + engine + + + + + paths + + + + + Widget + + + + + Main + + + + 75 + true + + + + AlignLeft|AlignVCenter + + + + :/48x48/carla.png:/48x48/carla.png + + + ItemIsSelectable|ItemIsEnabled + + + + + Canvas + + + + 75 + true + + + + + :/48x48/canvas.png:/48x48/canvas.png + + + ItemIsSelectable|ItemIsEnabled + + + + + Engine + + + + 75 + true + + + + + :/48x48/jack.png:/48x48/jack.png + + + ItemIsSelectable|ItemIsEnabled + + + + + Paths + + + + 75 + true + + + + + :/48x48/folder.png:/48x48/folder.png + + + ItemIsSelectable|ItemIsEnabled + + + + + + + + 0 + + + 0 + + + + + 2 + + + + + + + <b>Main</b> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/48x48/carla.png + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + + + Paths + + + + + + + + Default project folder: + + + + + + + + + + + 22 + 22 + + + + + + + + :/16x16/document-open.png:/16x16/document-open.png + + + + + + + + + + + + Misc + + + + + + GUI Refresh interval: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + ms + + + 10 + + + 1000 + + + 250 + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 40 + 10 + + + + + + + + Carla will run small processing checks when scanning the plugins (to make sure they won't crash). +You can disable these checks to get a faster scanning time (at your own risk). + + + Disable processing checks while scanning + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + 2 + + + + + + + <b>Canvas</b> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/48x48/canvas.png + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + + + Theme + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 80 + 20 + + + + + + + + Bezier Lines + + + + + + + + + + Theme: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Options + + + + + + Auto-hide groups with no ports + + + + + + + Fancy Eye-candy + + + true + + + + + + + Use OpenGL for rendering (EXPERIMENTAL, needs restart) + + + + + + + + + + Qt Render Hints + + + + + + Antialiasing + + + true + + + + + + + false + + + High Quality Antiliasing (OpenGL only) + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + 2 + + + + + + + <b>Engine</b> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/48x48/exec.png + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + + + Core + + + + + + + 0 + 0 + + + + 1 + + + + + QLayout::SetMinimumSize + + + 0 + + + + + 1 + + + + Single Client + + + + + Multiple Clients + + + + + Continuous Rack (EXPERIMENTAL) + + + + + + + + + + QLayout::SetMinimumSize + + + 0 + + + + + + Continuous Rack (EXPERIMENTAL) + + + + + + + + + + + + Audio driver: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Process mode: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Maximum number of parameters to allow in the built-in 'Edit' dialog + + + Max Parameters: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Maximum number of parameters to allow in the built-in 'Edit' dialog + + + 1000 + + + + + + + false + + + ... + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + GUIs + + + + + + How much time to wait for OSC GUIs to ping back the host + + + OSC UI Timeout: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + How much time to wait for OSC GUIs to ping back the host + + + ms + + + 10000 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 10 + + + + + + + + Use OSC-GUI bridges when possible, this way separating the UI from DSP code + + + Use UI bridges instead of direct handling when possible + + + + + + + + + + Advanced + + + + + + Enable chunk data for dssi-vst (EXPERIMENTAL) + + + + + + + Whenever possible, run the plugins in bridge mode. + + + Run plugins in bridge mode when possible (EXPERIMENTAL) + + + + + + + Force mono plugins as stereo by running 2 instances at the same time. +This mode is not available for VST plugins. + + + Force mono plugins as stereo (EXPERIMENTAL) + + + + + + + + + + Qt::Vertical + + + + 20 + 225 + + + + + + + + + + 2 + + + + + + + <b>Paths</b> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/48x48/folder.png + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + + + 0 + + + + LADSPA + + + + + + + + + + DSSI + + + + + + + + + + LV2 + + + + + + + + + + 22 + 22 + + + + + + + :/16x16/dialog-information.png + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Restart Carla to be able to load new found plugins + + + + + + + + VST + + + + + + + + + + GIG + + + + + + + + + + SF2 + + + + + + + + + + SFZ + + + + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Add... + + + + :/16x16/list-add.png:/16x16/list-add.png + + + + + + + Remove + + + + :/16x16/list-remove.png:/16x16/list-remove.png + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Change... + + + + :/16x16/edit-rename.png:/16x16/edit-rename.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset + + + + + + + + + + + + + + buttonBox + accepted() + CarlaSettingsW + accept() + + + 254 + 458 + + + 157 + 274 + + + + + buttonBox + rejected() + CarlaSettingsW + reject() + + + 254 + 458 + + + 286 + 274 + + + + + lw_page + currentCellChanged(int,int,int,int) + stackedWidget + setCurrentIndex(int) + + + 113 + 17 + + + 170 + 27 + + + + + cb_canvas_use_opengl + toggled(bool) + cb_canvas_render_hq_aa + setEnabled(bool) + + + 385 + 227 + + + 385 + 299 + + + + + diff --git a/source/carla.py b/source/carla.py index a6e124445..764641bfb 100755 --- a/source/carla.py +++ b/source/carla.py @@ -19,16 +19,480 @@ # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import QSize -from PyQt4.QtGui import QApplication, QMainWindow +from PyQt4.QtCore import Qt, QSize +from PyQt4.QtGui import QApplication, QDialogButtonBox, QMainWindow # ------------------------------------------------------------------------------------------------------------ # Imports (Custom Stuff) import ui_carla +import ui_carla_settings from carla_shared import * from carla_backend import * # FIXME, remove later +# ------------------------------------------------------------------------------------------------------------ +# Global variables + +# Tab indexes +TAB_INDEX_MAIN = 0 +TAB_INDEX_CANVAS = 1 +TAB_INDEX_CARLA_ENGINE = 2 +TAB_INDEX_CARLA_PATHS = 3 +TAB_INDEX_NONE = 4 + +# Single and Multiple client mode is only for JACK, +# but we still want to match QComboBox index to defines, +# so add +2 pos padding if driverName != "JACK". +PROCESS_MODE_NON_JACK_PADDING = 2 + +# Carla defaults +CARLA_DEFAULT_PROCESS_HIGH_PRECISION = False +CARLA_DEFAULT_MAX_PARAMETERS = 200 +CARLA_DEFAULT_FORCE_STEREO = False +CARLA_DEFAULT_USE_DSSI_VST_CHUNKS = False +CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES = False +CARLA_DEFAULT_PREFER_UI_BRIDGES = True +CARLA_DEFAULT_OSC_UI_TIMEOUT = 4000 +CARLA_DEFAULT_DISABLE_CHECKS = False + +# PatchCanvas defines +CANVAS_ANTIALIASING_SMALL = 1 +CANVAS_EYECANDY_SMALL = 1 + +# ------------------------------------------------------------------------------------------------------------ +# Settings Dialog + +class CarlaSettingsW(QDialog): + def __init__(self, parent): + QDialog.__init__(self, parent) + self.ui = ui_carla_settings.Ui_CarlaSettingsW() + self.ui.setupUi(self) + + # TODO + self.ui.lw_page.hideRow(TAB_INDEX_CANVAS) + + # ------------------------------------------------------------- + # Load settings + + self.loadSettings() + + # ------------------------------------------------------------- + # Set-up GUI + + driverCount = Carla.host.get_engine_driver_count() + + for i in range(driverCount): + driverName = cString(Carla.host.get_engine_driver_name(i)) + self.ui.cb_engine_audio_driver.addItem(driverName) + + #if not hasOpenGL: + #self.cb_canvas_use_opengl.setChecked(False) + #self.cb_canvas_use_opengl.setEnabled(False) + + # ------------------------------------------------------------- + # Set-up connections + + self.connect(self, SIGNAL("accepted()"), SLOT("slot_saveSettings()")) + self.connect(self.ui.buttonBox.button(QDialogButtonBox.Reset), SIGNAL("clicked()"), SLOT("slot_resetSettings()")) + + self.connect(self.ui.b_main_def_folder_open, SIGNAL("clicked()"), SLOT("slot_getAndSetProjectPath()")) + self.connect(self.ui.cb_engine_audio_driver, SIGNAL("currentIndexChanged(int)"), SLOT("slot_engineAudioDriverChanged()")) + self.connect(self.ui.b_paths_add, SIGNAL("clicked()"), SLOT("slot_addPluginPath()")) + self.connect(self.ui.b_paths_remove, SIGNAL("clicked()"), SLOT("slot_removePluginPath()")) + self.connect(self.ui.b_paths_change, SIGNAL("clicked()"), SLOT("slot_changePluginPath()")) + self.connect(self.ui.tw_paths, SIGNAL("currentChanged(int)"), SLOT("slot_pluginPathTabChanged(int)")) + self.connect(self.ui.lw_ladspa, SIGNAL("currentRowChanged(int)"), SLOT("slot_pluginPathRowChanged(int)")) + self.connect(self.ui.lw_dssi, SIGNAL("currentRowChanged(int)"), SLOT("slot_pluginPathRowChanged(int)")) + self.connect(self.ui.lw_lv2, SIGNAL("currentRowChanged(int)"), SLOT("slot_pluginPathRowChanged(int)")) + self.connect(self.ui.lw_vst, SIGNAL("currentRowChanged(int)"), SLOT("slot_pluginPathRowChanged(int)")) + self.connect(self.ui.lw_sf2, SIGNAL("currentRowChanged(int)"), SLOT("slot_pluginPathRowChanged(int)")) + + # ------------------------------------------------------------- + # Post-connect setup + + self.ui.lw_ladspa.setCurrentRow(0) + self.ui.lw_dssi.setCurrentRow(0) + self.ui.lw_lv2.setCurrentRow(0) + self.ui.lw_vst.setCurrentRow(0) + self.ui.lw_gig.setCurrentRow(0) + self.ui.lw_sf2.setCurrentRow(0) + self.ui.lw_sfz.setCurrentRow(0) + #QTimer.singleShot(0, self, ) + #self.slot_pluginPathTabChanged(self.tw_paths.currentIndex()) + + def loadSettings(self): + settings = QSettings() + + # --------------------------------------- + + self.ui.le_main_def_folder.setText(settings.value("Main/DefaultProjectFolder", HOME, type=str)) + self.ui.sb_gui_refresh.setValue(settings.value("Main/RefreshInterval", 50, type=int)) + + # --------------------------------------- + + self.ui.cb_canvas_hide_groups.setChecked(settings.value("Canvas/AutoHideGroups", False, type=bool)) + self.ui.cb_canvas_bezier_lines.setChecked(settings.value("Canvas/UseBezierLines", True, type=bool)) + self.ui.cb_canvas_eyecandy.setCheckState(settings.value("Canvas/EyeCandy", CANVAS_EYECANDY_SMALL, type=int)) + self.ui.cb_canvas_use_opengl.setChecked(settings.value("Canvas/UseOpenGL", False, type=bool)) + self.ui.cb_canvas_render_aa.setCheckState(settings.value("Canvas/Antialiasing", CANVAS_ANTIALIASING_SMALL, type=int)) + self.ui.cb_canvas_render_hq_aa.setChecked(settings.value("Canvas/HighQualityAntialiasing", False, type=bool)) + + #themeName = settings.value("Canvas/Theme", getDefaultThemeName(), type=str) + + #for i in range(Theme.THEME_MAX): + #thisThemeName = getThemeName(i) + #self.ui.cb_canvas_theme.addItem(thisThemeName) + #if thisThemeName == themeName: + #self.ui.cb_canvas_theme.setCurrentIndex(i) + + # -------------------------------------------- + + audioDriver = settings.value("Engine/AudioDriver", "JACK", type=str) + for i in range(self.ui.cb_engine_audio_driver.count()): + if self.ui.cb_engine_audio_driver.itemText(i) == audioDriver: + self.ui.cb_engine_audio_driver.setCurrentIndex(i) + break + else: + self.ui.cb_engine_audio_driver.setCurrentIndex(-1) + + if audioDriver == "JACK": + processModeIndex = settings.value("Engine/ProcessMode", PROCESS_MODE_MULTIPLE_CLIENTS, type=int) + self.ui.cb_engine_process_mode_jack.setCurrentIndex(processModeIndex) + self.ui.sw_engine_process_mode.setCurrentIndex(0) + else: + processModeIndex = settings.value("Engine/ProcessMode", PROCESS_MODE_CONTINUOUS_RACK, type=int) + processModeIndex -= PROCESS_MODE_NON_JACK_PADDING + self.ui.cb_engine_process_mode_other.setCurrentIndex(processModeIndex) + self.ui.sw_engine_process_mode.setCurrentIndex(1) + + self.ui.sb_engine_max_params.setValue(settings.value("Engine/MaxParameters", CARLA_DEFAULT_MAX_PARAMETERS, type=int)) + self.ui.ch_engine_prefer_ui_bridges.setChecked(settings.value("Engine/PreferUiBridges", CARLA_DEFAULT_PREFER_UI_BRIDGES, type=bool)) + self.ui.sb_engine_oscgui_timeout.setValue(settings.value("Engine/OscUiTimeout", CARLA_DEFAULT_OSC_UI_TIMEOUT, type=int)) + self.ui.ch_engine_disable_checks.setChecked(settings.value("Engine/DisableChecks", CARLA_DEFAULT_DISABLE_CHECKS, type=bool)) + self.ui.ch_engine_dssi_chunks.setChecked(settings.value("Engine/UseDssiVstChunks", CARLA_DEFAULT_USE_DSSI_VST_CHUNKS, type=bool)) + self.ui.ch_engine_prefer_plugin_bridges.setChecked(settings.value("Engine/PreferPluginBridges", CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES, type=bool)) + self.ui.ch_engine_force_stereo.setChecked(settings.value("Engine/ForceStereo", CARLA_DEFAULT_FORCE_STEREO, type=bool)) + + # -------------------------------------------- + + global LADSPA_PATH, DSSI_PATH, LV2_PATH, VST_PATH, GIG_PATH, SF2_PATH, SFZ_PATH + + ladspas = toList(settings.value("Paths/LADSPA", LADSPA_PATH)) + dssis = toList(settings.value("Paths/DSSI", DSSI_PATH)) + lv2s = toList(settings.value("Paths/LV2", LV2_PATH)) + vsts = toList(settings.value("Paths/VST", VST_PATH)) + gigs = toList(settings.value("Paths/GIG", GIG_PATH)) + sf2s = toList(settings.value("Paths/SF2", SF2_PATH)) + sfzs = toList(settings.value("Paths/SFZ", SFZ_PATH)) + + ladspas.sort() + dssis.sort() + lv2s.sort() + vsts.sort() + gigs.sort() + sf2s.sort() + sfzs.sort() + + for ladspa in ladspas: + self.ui.lw_ladspa.addItem(ladspa) + + for dssi in dssis: + self.ui.lw_dssi.addItem(dssi) + + for lv2 in lv2s: + self.ui.lw_lv2.addItem(lv2) + + for vst in vsts: + self.ui.lw_vst.addItem(vst) + + for gig in gigs: + self.ui.lw_gig.addItem(gig) + + for sf2 in sf2s: + self.ui.lw_sf2.addItem(sf2) + + for sfz in sfzs: + self.ui.lw_sfz.addItem(sfz) + + @pyqtSlot() + def slot_saveSettings(self): + settings = QSettings() + + # --------------------------------------- + + settings.setValue("Main/RefreshInterval", self.ui.sb_gui_refresh.value()) + settings.setValue("Main/DefaultProjectFolder", self.ui.le_main_def_folder.text()) + + # --------------------------------------- + + #settings.setValue("Canvas/Theme", self.ui.cb_canvas_theme.currentText()) + #settings.setValue("Canvas/AutoHideGroups", self.ui.cb_canvas_hide_groups.isChecked()) + #settings.setValue("Canvas/UseBezierLines", self.ui.cb_canvas_bezier_lines.isChecked()) + #settings.setValue("Canvas/UseOpenGL", self.ui.cb_canvas_use_opengl.isChecked()) + #settings.setValue("Canvas/HighQualityAntialiasing", self.ui.cb_canvas_render_hq_aa.isChecked()) + + ## 0, 1, 2 match their enum variants + #settings.setValue("Canvas/EyeCandy", self.ui.cb_canvas_eyecandy.checkState()) + #settings.setValue("Canvas/Antialiasing", self.ui.cb_canvas_render_aa.checkState()) + + # -------------------------------------------- + + audioDriver = self.ui.cb_engine_audio_driver.currentText() + settings.setValue("Engine/AudioDriver", audioDriver) + + if audioDriver == "JACK": + settings.setValue("Engine/ProcessMode", self.ui.cb_engine_process_mode_jack.currentIndex()) + else: + settings.setValue("Engine/ProcessMode", self.ui.cb_engine_process_mode_other.currentIndex()+PROCESS_MODE_NON_JACK_PADDING) + + settings.setValue("Engine/MaxParameters", self.ui.sb_engine_max_params.value()) + settings.setValue("Engine/PreferUiBridges", self.ui.ch_engine_prefer_ui_bridges.isChecked()) + settings.setValue("Engine/OscUiTimeout", self.ui.sb_engine_oscgui_timeout.value()) + settings.setValue("Engine/DisableChecks", self.ui.ch_engine_disable_checks.isChecked()) + settings.setValue("Engine/UseDssiVstChunks", self.ui.ch_engine_dssi_chunks.isChecked()) + settings.setValue("Engine/PreferPluginBridges", self.ui.ch_engine_prefer_plugin_bridges.isChecked()) + settings.setValue("Engine/ForceStereo", self.ui.ch_engine_force_stereo.isChecked()) + + # -------------------------------------------- + + # FIXME - find a cleaner way to do this, *.items() ? + ladspas = [] + dssis = [] + lv2s = [] + vsts = [] + gigs = [] + sf2s = [] + sfzs = [] + + for i in range(self.ui.lw_ladspa.count()): + ladspas.append(self.ui.lw_ladspa.item(i).text()) + + for i in range(self.ui.lw_dssi.count()): + dssis.append(self.ui.lw_dssi.item(i).text()) + + for i in range(self.ui.lw_lv2.count()): + lv2s.append(self.ui.lw_lv2.item(i).text()) + + for i in range(self.ui.lw_vst.count()): + vsts.append(self.ui.lw_vst.item(i).text()) + + for i in range(self.ui.lw_gig.count()): + gigs.append(self.ui.lw_gig.item(i).text()) + + for i in range(self.ui.lw_sf2.count()): + sf2s.append(self.ui.lw_sf2.item(i).text()) + + for i in range(self.ui.lw_sfz.count()): + sfzs.append(self.ui.lw_sfz.item(i).text()) + + settings.setValue("Paths/LADSPA", ladspas) + settings.setValue("Paths/DSSI", dssis) + settings.setValue("Paths/LV2", lv2s) + settings.setValue("Paths/VST", vsts) + settings.setValue("Paths/GIG", gigs) + settings.setValue("Paths/SF2", sf2s) + settings.setValue("Paths/SFZ", sfzs) + + @pyqtSlot() + def slot_resetSettings(self): + if self.ui.lw_page.currentRow() == TAB_INDEX_MAIN: + self.ui.le_main_def_folder.setText(HOME) + self.ui.sb_gui_refresh.setValue(50) + + elif self.ui.lw_page.currentRow() == TAB_INDEX_CANVAS: + self.ui.cb_canvas_theme.setCurrentIndex(0) + self.ui.cb_canvas_hide_groups.setChecked(False) + self.ui.cb_canvas_bezier_lines.setChecked(True) + self.ui.cb_canvas_eyecandy.setCheckState(Qt.PartiallyChecked) + self.ui.cb_canvas_use_opengl.setChecked(False) + self.ui.cb_canvas_render_aa.setCheckState(Qt.PartiallyChecked) + self.ui.cb_canvas_render_hq_aa.setChecked(False) + + elif self.ui.lw_page.currentRow() == TAB_INDEX_CARLA_ENGINE: + self.ui.cb_engine_audio_driver.setCurrentIndex(0) + self.ui.sb_engine_max_params.setValue(CARLA_DEFAULT_MAX_PARAMETERS) + self.ui.ch_engine_prefer_ui_bridges.setChecked(CARLA_DEFAULT_PREFER_UI_BRIDGES) + self.ui.sb_engine_oscgui_timeout.setValue(CARLA_DEFAULT_OSC_UI_TIMEOUT) + self.ui.ch_engine_disable_checks.setChecked(CARLA_DEFAULT_DISABLE_CHECKS) + self.ui.ch_engine_dssi_chunks.setChecked(CARLA_DEFAULT_USE_DSSI_VST_CHUNKS) + self.ui.ch_engine_prefer_plugin_bridges.setChecked(CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES) + self.ui.ch_engine_force_stereo.setChecked(CARLA_DEFAULT_FORCE_STEREO) + + if self.ui.cb_engine_audio_driver.currentText() == "JACK": + self.ui.cb_engine_process_mode_jack.setCurrentIndex(PROCESS_MODE_MULTIPLE_CLIENTS) + self.ui.sw_engine_process_mode.setCurrentIndex(0) + else: + self.ui.cb_engine_process_mode_other.setCurrentIndex(PROCESS_MODE_CONTINUOUS_RACK-PROCESS_MODE_NON_JACK_PADDING) + self.ui.sw_engine_process_mode.setCurrentIndex(1) + + elif self.ui.lw_page.currentRow() == TAB_INDEX_CARLA_PATHS: + global LADSPA_PATH, DSSI_PATH, LV2_PATH, VST_PATH, GIG_PATH, SF2_PATH, SFZ_PATH + + if self.ui.tw_paths.currentIndex() == 0: + LADSPA_PATH.sort() + self.ui.lw_ladspa.clear() + + for ladspa in LADSPA_PATH: + self.ui.lw_ladspa.addItem(ladspa) + + elif self.ui.tw_paths.currentIndex() == 1: + DSSI_PATH.sort() + self.ui.lw_dssi.clear() + + for dssi in DSSI_PATH: + self.ui.lw_dssi.addItem(dssi) + + elif self.ui.tw_paths.currentIndex() == 2: + LV2_PATH.sort() + self.ui.lw_lv2.clear() + + for lv2 in LV2_PATH: + self.ui.lw_lv2.addItem(lv2) + + elif self.ui.tw_paths.currentIndex() == 3: + VST_PATH.sort() + self.ui.lw_vst.clear() + + for vst in VST_PATH: + self.ui.lw_vst.addItem(vst) + + elif self.ui.tw_paths.currentIndex() == 4: + GIG_PATH.sort() + self.ui.lw_gig.clear() + + for gig in GIG_PATH: + self.ui.lw_gig.addItem(gig) + + elif self.ui.tw_paths.currentIndex() == 5: + SF2_PATH.sort() + self.ui.lw_sf2.clear() + + for sf2 in SF2_PATH: + self.ui.lw_sf2.addItem(sf2) + + elif self.ui.tw_paths.currentIndex() == 6: + SFZ_PATH.sort() + self.ui.lw_sfz.clear() + + for sfz in SFZ_PATH: + self.ui.lw_sfz.addItem(sfz) + + @pyqtSlot() + def slot_getAndSetProjectPath(self): + pass #getAndSetPath(self, self.le_main_def_folder.text(), self.le_main_def_folder) + + @pyqtSlot() + def slot_engineAudioDriverChanged(self): + if self.ui.cb_engine_audio_driver.currentText() == "JACK": + self.ui.sw_engine_process_mode.setCurrentIndex(0) + else: + self.ui.sw_engine_process_mode.setCurrentIndex(1) + + @pyqtSlot() + def slot_addPluginPath(self): + newPath = QFileDialog.getExistingDirectory(self, self.tr("Add Path"), "", QFileDialog.ShowDirsOnly) + if newPath: + if self.ui.tw_paths.currentIndex() == 0: + self.ui.lw_ladspa.addItem(newPath) + elif self.ui.tw_paths.currentIndex() == 1: + self.ui.lw_dssi.addItem(newPath) + elif self.ui.tw_paths.currentIndex() == 2: + self.ui.lw_lv2.addItem(newPath) + elif self.ui.tw_paths.currentIndex() == 3: + self.ui.lw_vst.addItem(newPath) + elif self.ui.tw_paths.currentIndex() == 4: + self.ui.lw_gig.addItem(newPath) + elif self.ui.tw_paths.currentIndex() == 5: + self.ui.lw_sf2.addItem(newPath) + elif self.ui.tw_paths.currentIndex() == 6: + self.ui.lw_sfz.addItem(newPath) + + @pyqtSlot() + def slot_removePluginPath(self): + if self.ui.tw_paths.currentIndex() == 0: + self.ui.lw_ladspa.takeItem(self.ui.lw_ladspa.currentRow()) + elif self.ui.tw_paths.currentIndex() == 1: + self.ui.lw_dssi.takeItem(self.ui.lw_dssi.currentRow()) + elif self.ui.tw_paths.currentIndex() == 2: + self.ui.lw_lv2.takeItem(self.ui.lw_lv2.currentRow()) + elif self.ui.tw_paths.currentIndex() == 3: + self.ui.lw_vst.takeItem(self.ui.lw_vst.currentRow()) + elif self.ui.tw_paths.currentIndex() == 4: + self.ui.lw_gig.takeItem(self.ui.lw_gig.currentRow()) + elif self.ui.tw_paths.currentIndex() == 5: + self.ui.lw_sf2.takeItem(self.ui.lw_sf2.currentRow()) + elif self.ui.tw_paths.currentIndex() == 6: + self.ui.lw_sfz.takeItem(self.ui.lw_sfz.currentRow()) + + @pyqtSlot() + def slot_changePluginPath(self): + if self.ui.tw_paths.currentIndex() == 0: + currentPath = self.ui.lw_ladspa.currentItem().text() + elif self.ui.tw_paths.currentIndex() == 1: + currentPath = self.ui.lw_dssi.currentItem().text() + elif self.ui.tw_paths.currentIndex() == 2: + currentPath = self.ui.lw_lv2.currentItem().text() + elif self.ui.tw_paths.currentIndex() == 3: + currentPath = self.ui.lw_vst.currentItem().text() + elif self.ui.tw_paths.currentIndex() == 4: + currentPath = self.ui.lw_gig.currentItem().text() + elif self.ui.tw_paths.currentIndex() == 5: + currentPath = self.ui.lw_sf2.currentItem().text() + elif self.ui.tw_paths.currentIndex() == 6: + currentPath = self.ui.lw_sfz.currentItem().text() + else: + currentPath = "" + + newPath = QFileDialog.getExistingDirectory(self, self.tr("Add Path"), currentPath, QFileDialog.ShowDirsOnly) + if newPath: + if self.ui.tw_paths.currentIndex() == 0: + self.ui.lw_ladspa.currentItem().setText(newPath) + elif self.ui.tw_paths.currentIndex() == 1: + self.ui.lw_dssi.currentItem().setText(newPath) + elif self.ui.tw_paths.currentIndex() == 2: + self.ui.lw_lv2.currentItem().setText(newPath) + elif self.ui.tw_paths.currentIndex() == 3: + self.ui.lw_vst.currentItem().setText(newPath) + elif self.ui.tw_paths.currentIndex() == 4: + self.ui.lw_gig.currentItem().setText(newPath) + elif self.ui.tw_paths.currentIndex() == 5: + self.ui.lw_sf2.currentItem().setText(newPath) + elif self.ui.tw_paths.currentIndex() == 6: + self.ui.lw_sfz.currentItem().setText(newPath) + + @pyqtSlot(int) + def slot_pluginPathTabChanged(self, index): + if index == 0: + row = self.ui.lw_ladspa.currentRow() + elif index == 1: + row = self.ui.lw_dssi.currentRow() + elif index == 2: + row = self.ui.lw_lv2.currentRow() + elif index == 3: + row = self.ui.lw_vst.currentRow() + elif index == 4: + row = self.ui.lw_gig.currentRow() + elif index == 5: + row = self.ui.lw_sf2.currentRow() + elif index == 6: + row = self.ui.lw_sfz.currentRow() + else: + row = -1 + + check = bool(row >= 0) + self.ui.b_paths_remove.setEnabled(check) + self.ui.b_paths_change.setEnabled(check) + + @pyqtSlot(int) + def slot_pluginPathRowChanged(self, row): + check = bool(row >= 0) + self.ui.b_paths_remove.setEnabled(check) + self.ui.b_paths_change.setEnabled(check) + + def done(self, r): + QDialog.done(self, r) + self.close() + # ------------------------------------------------------------------------------------------------------------ # Main Window @@ -361,7 +825,7 @@ class CarlaMainW(QMainWindow): @pyqtSlot() def slot_configureCarla(self): - CarlaAboutW(self).exec_() + CarlaSettingsW(self).exec_() @pyqtSlot() def slot_handleSIGUSR1(self):