Browse Source

More pylint corrections

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
dc0c1df47e
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 300 additions and 232 deletions
  1. +7
    -2
      .travis/script-pylint.sh
  2. +61
    -49
      source/frontend/carla_backend.py
  3. +178
    -146
      source/frontend/carla_settings.py
  4. +49
    -29
      source/frontend/carla_widgets.py
  5. +5
    -6
      source/frontend/widgets/canvaspreviewframe.py

+ 7
- 2
.travis/script-pylint.sh View File

@@ -15,13 +15,19 @@ fi
# widget code, check all errors
${pylint} \
--extension-pkg-whitelist=PyQt5 \
--max-attributes=25 \
--max-line-length=120 \
--max-locals=25 \
--disable=\
bad-whitespace \
bad-whitespace,\
invalid-name,\
missing-docstring \
source/frontend/widgets/canvaspreviewframe.py

# main app code, ignore some errors
${pylint} \
--extension-pkg-whitelist=PyQt5 \
--max-line-length=120 \
--disable=\
bad-whitespace,\
bare-except,\
@@ -29,7 +35,6 @@ blacklisted-name,\
duplicate-code,\
fixme,\
invalid-name,\
line-too-long,\
missing-docstring,\
too-few-public-methods,\
too-many-arguments,\


+ 61
- 49
source/frontend/carla_backend.py View File

@@ -16,7 +16,7 @@
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Imports (Global)

from abc import abstractmethod
@@ -24,7 +24,7 @@ from platform import architecture
from struct import pack
from sys import platform, maxsize

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Imports (ctypes)

from ctypes import (
@@ -34,18 +34,18 @@ from ctypes import (
CDLL, CFUNCTYPE, RTLD_GLOBAL, RTLD_LOCAL, POINTER
)

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# 64bit check

kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32)

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Define custom types

c_enum = c_int
c_uintptr = c_uint64 if kIs64bit else c_uint32

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Set Platform

if platform == "darwin":
@@ -74,7 +74,7 @@ else:
MACOS = False
WINDOWS = False

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Convert a ctypes c_char_p into a python string

def charPtrToString(charPtr):
@@ -84,7 +84,7 @@ def charPtrToString(charPtr):
return charPtr
return charPtr.decode("utf-8", errors="ignore")

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Convert a ctypes POINTER(c_char_p) into a python string list

def charPtrPtrToStringList(charPtrPtr):
@@ -103,7 +103,7 @@ def charPtrPtrToStringList(charPtrPtr):

return strList

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Convert a ctypes POINTER(c_<num>) into a python number list

def numPtrToList(numPtr):
@@ -122,10 +122,11 @@ def numPtrToList(numPtr):

return numList

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Convert a ctypes value into a python one

c_int_types = (c_int, c_int8, c_int16, c_int32, c_int64, c_uint, c_uint8, c_uint16, c_uint32, c_uint64, c_long, c_longlong)
c_int_types = (c_int, c_int8, c_int16, c_int32, c_int64,
c_uint, c_uint8, c_uint16, c_uint32, c_uint64, c_long, c_longlong)
c_float_types = (c_float, c_double, c_longdouble)
c_intp_types = tuple(POINTER(i) for i in c_int_types)
c_floatp_types = tuple(POINTER(i) for i in c_float_types)
@@ -144,7 +145,7 @@ def toPythonType(value, attr):
print("..............", attr, ".....................", value, ":", type(value))
return value

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Convert a ctypes struct into a python dict

def structToDict(struct):
@@ -152,7 +153,7 @@ def structToDict(struct):
return dict((attr, toPythonType(getattr(struct, attr), attr)) for attr, value in struct._fields_)
# pylint: enable=protected-access

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Backend API (base definitions)

# Maximum default number of loadable plugins.
@@ -172,7 +173,7 @@ MAX_DEFAULT_PARAMETERS = 200
# Currently only used for audio peaks.
MAIN_CARLA_PLUGIN_ID = 0xFFFF

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Engine Driver Device Hints
# Various engine driver device hints.
# @see carla_get_engine_driver_device_info()
@@ -192,7 +193,7 @@ ENGINE_DRIVER_DEVICE_VARIABLE_BUFFER_SIZE = 0x4
# @see ENGINE_OPTION_AUDIO_SAMPLE_RATE
ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x8

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Plugin Hints
# Various plugin hints.
# @see carla_get_plugin_info()
@@ -236,7 +237,7 @@ PLUGIN_USES_MULTI_PROGS = 0x400
# Plugin can make use of inline display API.
PLUGIN_HAS_INLINE_DISPLAY = 0x800

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Plugin Options
# Various plugin options.
# @see carla_get_plugin_info() and carla_set_option()
@@ -276,7 +277,7 @@ PLUGIN_OPTION_SEND_PROGRAM_CHANGES = 0x200
# This flag exists because 0x0 as an option value is a valid one, so we need something else to indicate "null-ness".
PLUGIN_OPTIONS_NULL = 0x10000

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Parameter Hints
# Various parameter hints.
# @see CarlaPlugin::getParameterData() and carla_get_parameter_data()
@@ -315,7 +316,7 @@ PARAMETER_USES_CUSTOM_TEXT = 0x400
# Parameter can be turned into a CV control.
PARAMETER_CAN_BE_CV_CONTROLLED = 0x800

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Patchbay Port Hints
# Various patchbay port hints.

@@ -335,7 +336,7 @@ PATCHBAY_PORT_TYPE_MIDI = 0x08
# Patchbay port is of OSC type.
PATCHBAY_PORT_TYPE_OSC = 0x10

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Patchbay Port Group Hints
# Various patchbay port group hints.

@@ -351,7 +352,7 @@ PATCHBAY_PORT_GROUP_STEREO = 0x04
# A mid-side stereo group, where the 1st port is center and the 2nd is side.
PATCHBAY_PORT_GROUP_MID_SIDE = 0x08

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Custom Data Types
# These types define how the value in the CustomData struct is stored.
# @see CustomData.type
@@ -369,7 +370,7 @@ CUSTOM_DATA_TYPE_PROPERTY = "http://kxstudio.sf.net/ns/carla/property"
# String type URI.
CUSTOM_DATA_TYPE_STRING = "http://kxstudio.sf.net/ns/carla/string"

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Custom Data Keys
# Pre-defined keys used internally in Carla.
# @see CustomData.key
@@ -386,7 +387,7 @@ CUSTOM_DATA_KEY_UI_SIZE = "CarlaUiSize"
# UI visible key.
CUSTOM_DATA_KEY_UI_VISIBLE = "CarlaUiVisible"

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Binary Type
# The binary type of a plugin.

@@ -408,7 +409,7 @@ BINARY_WIN64 = 4
# Other binary type.
BINARY_OTHER = 5

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# File Type
# File type.

@@ -421,7 +422,7 @@ FILE_AUDIO = 1
# MIDI file.
FILE_MIDI = 2

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Plugin Type
# Plugin type.
# Some files are handled as if they were plugins.
@@ -467,7 +468,7 @@ PLUGIN_SFZ = 11
# JACK application.
PLUGIN_JACK = 12

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Plugin Category
# Plugin category, which describes the functionality of a plugin.

@@ -501,7 +502,7 @@ PLUGIN_CATEGORY_UTILITY = 8
# Miscellaneous plugin (used to check if the plugin has a category).
PLUGIN_CATEGORY_OTHER = 9

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Parameter Type
# Plugin parameter type.

@@ -514,7 +515,7 @@ PARAMETER_INPUT = 1
# Output parameter.
PARAMETER_OUTPUT = 2

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Internal Parameter Index
# Special parameters used internally in Carla.
# Plugins do not know about their existence.
@@ -553,7 +554,7 @@ PARAMETER_CTRL_CHANNEL = -8
# Max value, defined only for convenience.
PARAMETER_MAX = -9

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Special Mapped Control Index

# Specially designated mapped control indexes.
@@ -569,7 +570,7 @@ CONTROL_VALUE_CV = 130
# Special value to indicate MIDI pitchbend.
CONTROL_VALUE_MIDI_PITCHBEND = 131

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Engine Callback Opcode
# Engine callback opcodes.
# Front-ends must never block indefinitely during a callback.
@@ -840,7 +841,7 @@ ENGINE_CALLBACK_PARAMETER_MAPPED_RANGE_CHANGED = 46
# @a valuef Y position 2
ENGINE_CALLBACK_PATCHBAY_CLIENT_POSITION_CHANGED = 47

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# NSM Callback Opcode
# NSM callback opcodes.
# @see ENGINE_CALLBACK_NSM
@@ -874,7 +875,7 @@ NSM_CALLBACK_SHOW_OPTIONAL_GUI = 6
# Hide-optional-gui message.
NSM_CALLBACK_HIDE_OPTIONAL_GUI = 7

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Engine Option
# Engine options.
# @see carla_set_engine_option()
@@ -1014,7 +1015,7 @@ ENGINE_OPTION_WINE_SERVER_RT_PRIO = 32
# Capture console output into debug callbacks
ENGINE_OPTION_DEBUG_CONSOLE_OUTPUT = 33

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Engine Process Mode
# Engine process mode.
# @see ENGINE_OPTION_PROCESS_MODE
@@ -1037,7 +1038,7 @@ ENGINE_PROCESS_MODE_PATCHBAY = 3
# Special mode, used in plugin-bridges only.
ENGINE_PROCESS_MODE_BRIDGE = 4

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Engine Transport Mode
# Engine transport mode.
# @see ENGINE_OPTION_TRANSPORT_MODE
@@ -1058,7 +1059,7 @@ ENGINE_TRANSPORT_MODE_PLUGIN = 3
# Special mode, used in plugin-bridges only.
ENGINE_TRANSPORT_MODE_BRIDGE = 4

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# File Callback Opcode
# File callback opcodes.
# Front-ends must always block-wait for user input.
@@ -1074,7 +1075,7 @@ FILE_CALLBACK_OPEN = 1
# Save file or folder.
FILE_CALLBACK_SAVE = 2

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Patchbay Icon
# The icon of a patchbay client/group.

@@ -1102,7 +1103,7 @@ PATCHBAY_ICON_DISTRHO = 4
# Used for file type plugins (like SF2 and SFZ).
PATCHBAY_ICON_FILE = 5

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Backend API (C stuff)

# Engine callback function.
@@ -1211,7 +1212,7 @@ class EngineDriverDeviceInfo(Structure):
("sampleRates", POINTER(c_double))
]

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Backend API (Python compatible stuff)

# @see ParameterData
@@ -1257,7 +1258,7 @@ PyEngineDriverDeviceInfo = {
'sampleRates': []
}

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Host API (C stuff)

# Information about a loaded plugin.
@@ -1426,7 +1427,7 @@ class CarlaInlineDisplayImageSurface(Structure):
("stride", c_int)
]

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Host API (Python compatible stuff)

# @see CarlaPluginInfo
@@ -1493,7 +1494,7 @@ PyCarlaRuntimeEngineDriverDeviceInfo = {
'sampleRates': []
}

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Set BINARY_NATIVE

if WINDOWS:
@@ -1501,7 +1502,7 @@ if WINDOWS:
else:
BINARY_NATIVE = BINARY_POSIX64 if kIs64bit else BINARY_POSIX32

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Host object (Meta)

class CarlaHostMeta():
@@ -2236,7 +2237,7 @@ class CarlaHostMeta():
def nsm_ready(self, opcode):
raise NotImplementedError

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Host object (dummy/null, does nothing)

class CarlaHostNull(CarlaHostMeta):
@@ -2565,7 +2566,7 @@ class CarlaHostNull(CarlaHostMeta):
def nsm_ready(self, opcode):
return

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Host object using a DLL

class CarlaHostDLL(CarlaHostMeta):
@@ -2685,7 +2686,8 @@ class CarlaHostDLL(CarlaHostMeta):
self.lib.carla_get_max_plugin_number.argtypes = (c_void_p,)
self.lib.carla_get_max_plugin_number.restype = c_uint32

self.lib.carla_add_plugin.argtypes = (c_void_p, c_enum, c_enum, c_char_p, c_char_p, c_char_p, c_int64, c_void_p, c_uint)
self.lib.carla_add_plugin.argtypes = (c_void_p, c_enum, c_enum, c_char_p, c_char_p, c_char_p, c_int64,
c_void_p, c_uint)
self.lib.carla_add_plugin.restype = c_bool

self.lib.carla_remove_plugin.argtypes = (c_void_p, c_uint)
@@ -3051,7 +3053,10 @@ class CarlaHostDLL(CarlaHostMeta):
return structToDict(self.lib.carla_get_parameter_info(self.handle, pluginId, parameterId).contents)

def get_parameter_scalepoint_info(self, pluginId, parameterId, scalePointId):
return structToDict(self.lib.carla_get_parameter_scalepoint_info(self.handle, pluginId, parameterId, scalePointId).contents)
return structToDict(self.lib.carla_get_parameter_scalepoint_info(self.handle,
pluginId,
parameterId,
scalePointId).contents)

def get_parameter_data(self, pluginId, parameterId):
return structToDict(self.lib.carla_get_parameter_data(self.handle, pluginId, parameterId).contents)
@@ -3066,7 +3071,10 @@ class CarlaHostDLL(CarlaHostMeta):
return structToDict(self.lib.carla_get_custom_data(self.handle, pluginId, customDataId).contents)

def get_custom_data_value(self, pluginId, type_, key):
return charPtrToString(self.lib.carla_get_custom_data_value(self.handle, pluginId, type_.encode("utf-8"), key.encode("utf-8")))
return charPtrToString(self.lib.carla_get_custom_data_value(self.handle,
pluginId,
type_.encode("utf-8"),
key.encode("utf-8")))

def get_chunk_data(self, pluginId):
return charPtrToString(self.lib.carla_get_chunk_data(self.handle, pluginId))
@@ -3177,7 +3185,11 @@ class CarlaHostDLL(CarlaHostMeta):
self.lib.carla_set_midi_program(self.handle, pluginId, midiProgramId)

def set_custom_data(self, pluginId, type_, key, value):
self.lib.carla_set_custom_data(self.handle, pluginId, type_.encode("utf-8"), key.encode("utf-8"), value.encode("utf-8"))
self.lib.carla_set_custom_data(self.handle,
pluginId,
type_.encode("utf-8"),
key.encode("utf-8"),
value.encode("utf-8"))

def set_chunk_data(self, pluginId, chunkData):
self.lib.carla_set_chunk_data(self.handle, pluginId, chunkData.encode("utf-8"))
@@ -3218,7 +3230,7 @@ class CarlaHostDLL(CarlaHostMeta):
def nsm_ready(self, opcode):
self.lib.carla_nsm_ready(self.handle, opcode)

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Helper object for CarlaHostPlugin

class PluginStoreInfo():
@@ -3247,7 +3259,7 @@ class PluginStoreInfo():
self.customData = []
self.peaks = [0.0, 0.0, 0.0, 0.0]

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Carla Host object for plugins (using pipes)

class CarlaHostPlugin(CarlaHostMeta):
@@ -3956,4 +3968,4 @@ class CarlaHostPlugin(CarlaHostMeta):
elif action == ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED:
self._set_currentMidiProgram(pluginId, value1)

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------

+ 178
- 146
source/frontend/carla_settings.py View File

@@ -16,13 +16,13 @@
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Imports (PyQt5)

from PyQt5.QtCore import pyqtSlot, Qt
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QFileDialog

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Imports (Custom)

import ui_carla_settings
@@ -175,13 +175,13 @@ from carla_shared import (

from patchcanvas.theme import Theme, getThemeName

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# ...

BUFFER_SIZE_LIST = (16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192)
SAMPLE_RATE_LIST = (22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000)

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Driver Settings

class DriverSettingsW(QDialog):
@@ -193,7 +193,7 @@ class DriverSettingsW(QDialog):
self.ui = ui_carla_settings_driver.Ui_DriverSettingsW()
self.ui.setupUi(self)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Internal stuff

self.fDriverIndex = driverIndex
@@ -203,7 +203,7 @@ class DriverSettingsW(QDialog):
self.fBufferSizes = BUFFER_SIZE_LIST
self.fSampleRates = SAMPLE_RATE_LIST

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Set-up GUI

for name in self.fDeviceNames:
@@ -211,27 +211,28 @@ class DriverSettingsW(QDialog):

self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Load settings

self.loadSettings()

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Set-up connections

self.accepted.connect(self.slot_saveSettings)
self.ui.b_panel.clicked.connect(self.slot_showDevicePanel)
self.ui.cb_device.currentIndexChanged.connect(self.slot_updateDeviceInfo)

# ----------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

def loadSettings(self):
settings = QSafeSettings("falkTX", "Carla2")

audioDevice = settings.value("%s%s/Device" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), "", str)
audioBufferSize = settings.value("%s%s/BufferSize" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), CARLA_DEFAULT_AUDIO_BUFFER_SIZE, int)
audioSampleRate = settings.value("%s%s/SampleRate" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), CARLA_DEFAULT_AUDIO_SAMPLE_RATE, int)
audioTripleBuffer = settings.value("%s%s/TripleBuffer" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), CARLA_DEFAULT_AUDIO_TRIPLE_BUFFER, bool)
args = (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName)
audioDevice = settings.value("%s%s/Device" % args, "", str)
audioBufferSize = settings.value("%s%s/BufferSize" % args, CARLA_DEFAULT_AUDIO_BUFFER_SIZE, int)
audioSampleRate = settings.value("%s%s/SampleRate" % args, CARLA_DEFAULT_AUDIO_SAMPLE_RATE, int)
audioTripleBuffer = settings.value("%s%s/TripleBuffer" % args, CARLA_DEFAULT_AUDIO_TRIPLE_BUFFER, bool)

if audioDevice and audioDevice in self.fDeviceNames:
self.ui.cb_device.setCurrentIndex(self.fDeviceNames.index(audioDevice))
@@ -257,7 +258,7 @@ class DriverSettingsW(QDialog):

self.ui.cb_triple_buffer.setChecked(audioTripleBuffer and self.ui.cb_triple_buffer.isEnabled())

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_saveSettings(self):
@@ -271,12 +272,13 @@ class DriverSettingsW(QDialog):
if sampleRate == self.AUTOMATIC_OPTION:
sampleRate = "0"

settings.setValue("%s%s/Device" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), self.ui.cb_device.currentText())
settings.setValue("%s%s/BufferSize" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), bufferSize)
settings.setValue("%s%s/SampleRate" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), sampleRate)
settings.setValue("%s%s/TripleBuffer" % (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName), self.ui.cb_triple_buffer.isChecked())
args = (CARLA_KEY_ENGINE_DRIVER_PREFIX, self.fDriverName)
settings.setValue("%s%s/Device" % args, self.ui.cb_device.currentText())
settings.setValue("%s%s/BufferSize" % args, bufferSize)
settings.setValue("%s%s/SampleRate" % args, sampleRate)
settings.setValue("%s%s/TripleBuffer" % args, self.ui.cb_triple_buffer.isChecked())

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_showDevicePanel(self):
@@ -331,7 +333,7 @@ class DriverSettingsW(QDialog):
self.ui.cb_samplerate.addItem(self.AUTOMATIC_OPTION)
self.ui.cb_samplerate.setCurrentIndex(0)

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Runtime Driver Settings

class RuntimeDriverSettingsW(QDialog):
@@ -343,7 +345,7 @@ class RuntimeDriverSettingsW(QDialog):

driverDeviceInfo = host.get_runtime_engine_driver_device_info()

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Set-up GUI

self.ui.cb_device.clear()
@@ -367,7 +369,7 @@ class RuntimeDriverSettingsW(QDialog):
self.adjustSize()
self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Load runtime settings

if host.is_engine_running():
@@ -411,12 +413,12 @@ class RuntimeDriverSettingsW(QDialog):
if (driverDeviceInfo['hints'] & ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL) == 0x0:
self.ui.b_panel.setEnabled(False)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Set-up connections

self.ui.b_panel.clicked.connect(self.slot_showDevicePanel)

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

def getValues(self):
audioDevice = self.ui.cb_buffersize.currentText()
@@ -430,13 +432,13 @@ class RuntimeDriverSettingsW(QDialog):

return (audioDevice, int(bufferSize), int(sampleRate))

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_showDevicePanel(self):
self.host.show_engine_device_control_panel()

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Settings Dialog

class CarlaSettingsW(QDialog):
@@ -469,7 +471,7 @@ class CarlaSettingsW(QDialog):
# so add +2 pos padding if driverName != "JACK".
PROCESS_MODE_NON_JACK_PADDING = 2

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

def __init__(self, parent, host, hasCanvas, hasCanvasGL):
QDialog.__init__(self, parent)
@@ -477,10 +479,11 @@ class CarlaSettingsW(QDialog):
self.ui = ui_carla_settings.Ui_CarlaSettingsW()
self.ui.setupUi(self)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Set-up GUI

self.ui.lw_page.setFixedWidth(48 + 6*3 + fontMetricsHorizontalAdvance(self.ui.lw_page.fontMetrics(), "Experimental"))
self.ui.lw_page.setFixedWidth(48 + 6*3 +
fontMetricsHorizontalAdvance(self.ui.lw_page.fontMetrics(), "Experimental"))

for i in range(host.get_engine_driver_count()):
self.ui.cb_engine_audio_driver.addItem(host.get_engine_driver_name(i))
@@ -549,12 +552,12 @@ class CarlaSettingsW(QDialog):

self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Load settings

self.loadSettings()

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Set-up connections

self.accepted.connect(self.slot_saveSettings)
@@ -591,7 +594,7 @@ class CarlaSettingsW(QDialog):
#self.ui.cb_canvas_fancy_eyecandy.toggled.connect(self.slot_canvasFancyEyeCandyToggled)
self.ui.cb_canvas_use_opengl.toggled.connect(self.slot_canvasOpenGLToggled)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Post-connect setup

self.ui.lw_ladspa.setCurrentRow(0)
@@ -612,44 +615,77 @@ class CarlaSettingsW(QDialog):

self.adjustSize()

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

def loadSettings(self):
settings = QSafeSettings()

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Main

self.ui.ch_main_show_logs.setChecked(self.host.showLogs)
self.ui.ch_engine_uis_always_on_top.setChecked(self.host.uisAlwaysOnTop)

self.ui.le_main_proj_folder.setText(settings.value(CARLA_KEY_MAIN_PROJECT_FOLDER, CARLA_DEFAULT_MAIN_PROJECT_FOLDER, str))
self.ui.ch_main_theme_pro.setChecked(settings.value(CARLA_KEY_MAIN_USE_PRO_THEME, CARLA_DEFAULT_MAIN_USE_PRO_THEME, bool) and self.ui.group_main_theme.isEnabled())
self.ui.cb_main_theme_color.setCurrentIndex(self.ui.cb_main_theme_color.findText(settings.value(CARLA_KEY_MAIN_PRO_THEME_COLOR, CARLA_DEFAULT_MAIN_PRO_THEME_COLOR, str)))
self.ui.sb_main_refresh_interval.setValue(settings.value(CARLA_KEY_MAIN_REFRESH_INTERVAL, CARLA_DEFAULT_MAIN_REFRESH_INTERVAL, int))
self.ui.ch_main_confirm_exit.setChecked(settings.value(CARLA_KEY_MAIN_CONFIRM_EXIT, CARLA_DEFAULT_MAIN_CONFIRM_EXIT, bool))
self.ui.le_main_proj_folder.setText(
settings.value(CARLA_KEY_MAIN_PROJECT_FOLDER, CARLA_DEFAULT_MAIN_PROJECT_FOLDER, str))

# ----------------------------------------------------------------------------------------------------
self.ui.ch_main_theme_pro.setChecked(self.ui.group_main_theme.isEnabled() and
settings.value(CARLA_KEY_MAIN_USE_PRO_THEME, CARLA_DEFAULT_MAIN_USE_PRO_THEME, bool))

self.ui.cb_main_theme_color.setCurrentIndex(
self.ui.cb_main_theme_color.findText(settings.value(CARLA_KEY_MAIN_PRO_THEME_COLOR,
CARLA_DEFAULT_MAIN_PRO_THEME_COLOR, str)))

self.ui.sb_main_refresh_interval.setValue(
settings.value(CARLA_KEY_MAIN_REFRESH_INTERVAL, CARLA_DEFAULT_MAIN_REFRESH_INTERVAL, int))

self.ui.ch_main_confirm_exit.setChecked(
settings.value(CARLA_KEY_MAIN_CONFIRM_EXIT, CARLA_DEFAULT_MAIN_CONFIRM_EXIT, bool))

# -------------------------------------------------------------------------------------------------------------
# Canvas

self.ui.cb_canvas_theme.setCurrentIndex(self.ui.cb_canvas_theme.findText(settings.value(CARLA_KEY_CANVAS_THEME, CARLA_DEFAULT_CANVAS_THEME, str)))
self.ui.cb_canvas_size.setCurrentIndex(self.ui.cb_canvas_size.findText(settings.value(CARLA_KEY_CANVAS_SIZE, CARLA_DEFAULT_CANVAS_SIZE, str)))
self.ui.cb_canvas_bezier_lines.setChecked(settings.value(CARLA_KEY_CANVAS_USE_BEZIER_LINES, CARLA_DEFAULT_CANVAS_USE_BEZIER_LINES, bool))
self.ui.cb_canvas_hide_groups.setChecked(settings.value(CARLA_KEY_CANVAS_AUTO_HIDE_GROUPS, CARLA_DEFAULT_CANVAS_AUTO_HIDE_GROUPS, bool))
self.ui.cb_canvas_auto_select.setChecked(settings.value(CARLA_KEY_CANVAS_AUTO_SELECT_ITEMS, CARLA_DEFAULT_CANVAS_AUTO_SELECT_ITEMS, bool))
#self.ui.cb_canvas_eyecandy.setChecked(settings.value(CARLA_KEY_CANVAS_EYE_CANDY, CARLA_DEFAULT_CANVAS_EYE_CANDY, bool))
self.ui.cb_canvas_fancy_eyecandy.setChecked(settings.value(CARLA_KEY_CANVAS_FANCY_EYE_CANDY, CARLA_DEFAULT_CANVAS_FANCY_EYE_CANDY, bool))
self.ui.cb_canvas_use_opengl.setChecked(settings.value(CARLA_KEY_CANVAS_USE_OPENGL, CARLA_DEFAULT_CANVAS_USE_OPENGL, bool) and self.ui.cb_canvas_use_opengl.isEnabled())
self.ui.cb_canvas_render_aa.setCheckState(settings.value(CARLA_KEY_CANVAS_ANTIALIASING, CARLA_DEFAULT_CANVAS_ANTIALIASING, int))
self.ui.cb_canvas_render_hq_aa.setChecked(settings.value(CARLA_KEY_CANVAS_HQ_ANTIALIASING, CARLA_DEFAULT_CANVAS_HQ_ANTIALIASING, bool) and self.ui.cb_canvas_render_hq_aa.isEnabled())
self.ui.cb_canvas_full_repaints.setChecked(settings.value(CARLA_KEY_CANVAS_FULL_REPAINTS, CARLA_DEFAULT_CANVAS_FULL_REPAINTS, bool))
self.ui.cb_canvas_inline_displays.setChecked(settings.value(CARLA_KEY_CANVAS_INLINE_DISPLAYS, CARLA_DEFAULT_CANVAS_INLINE_DISPLAYS, bool))

# ----------------------------------------------------------------------------------------------------
self.ui.cb_canvas_theme.setCurrentIndex(
self.ui.cb_canvas_theme.findText(settings.value(CARLA_KEY_CANVAS_THEME, CARLA_DEFAULT_CANVAS_THEME, str)))

self.ui.cb_canvas_size.setCurrentIndex(
self.ui.cb_canvas_size.findText(settings.value(CARLA_KEY_CANVAS_SIZE, CARLA_DEFAULT_CANVAS_SIZE, str)))

self.ui.cb_canvas_bezier_lines.setChecked(
settings.value(CARLA_KEY_CANVAS_USE_BEZIER_LINES, CARLA_DEFAULT_CANVAS_USE_BEZIER_LINES, bool))

self.ui.cb_canvas_hide_groups.setChecked(
settings.value(CARLA_KEY_CANVAS_AUTO_HIDE_GROUPS, CARLA_DEFAULT_CANVAS_AUTO_HIDE_GROUPS, bool))

self.ui.cb_canvas_auto_select.setChecked(
settings.value(CARLA_KEY_CANVAS_AUTO_SELECT_ITEMS, CARLA_DEFAULT_CANVAS_AUTO_SELECT_ITEMS, bool))

#self.ui.cb_canvas_eyecandy.setChecked(
# settings.value(CARLA_KEY_CANVAS_EYE_CANDY, CARLA_DEFAULT_CANVAS_EYE_CANDY, bool))

self.ui.cb_canvas_fancy_eyecandy.setChecked(
settings.value(CARLA_KEY_CANVAS_FANCY_EYE_CANDY, CARLA_DEFAULT_CANVAS_FANCY_EYE_CANDY, bool))

self.ui.cb_canvas_use_opengl.setChecked(self.ui.cb_canvas_use_opengl.isEnabled() and
settings.value(CARLA_KEY_CANVAS_USE_OPENGL, CARLA_DEFAULT_CANVAS_USE_OPENGL, bool))

self.ui.cb_canvas_render_aa.setCheckState(
settings.value(CARLA_KEY_CANVAS_ANTIALIASING, CARLA_DEFAULT_CANVAS_ANTIALIASING, int))

self.ui.cb_canvas_render_hq_aa.setChecked(self.ui.cb_canvas_render_hq_aa.isEnabled() and
settings.value(CARLA_KEY_CANVAS_HQ_ANTIALIASING, CARLA_DEFAULT_CANVAS_HQ_ANTIALIASING, bool))

self.ui.cb_canvas_full_repaints.setChecked(
settings.value(CARLA_KEY_CANVAS_FULL_REPAINTS, CARLA_DEFAULT_CANVAS_FULL_REPAINTS, bool))

self.ui.cb_canvas_inline_displays.setChecked(
settings.value(CARLA_KEY_CANVAS_INLINE_DISPLAYS, CARLA_DEFAULT_CANVAS_INLINE_DISPLAYS, bool))

# -------------------------------------------------------------------------------------------------------------

settings = QSafeSettings("falkTX", "Carla2")

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Main

self.ui.ch_main_experimental.setChecked(self.host.experimental)
@@ -661,7 +697,7 @@ class CarlaSettingsW(QDialog):
elif not self.host.showWineBridges:
self.ui.lw_page.hideRow(self.TAB_INDEX_WINE)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Engine

if self.host.isPlugin:
@@ -690,7 +726,8 @@ class CarlaSettingsW(QDialog):
self.ui.cb_engine_process_mode_jack.setCurrentIndex(self.host.nextProcessMode)

if self.host.nextProcessMode >= self.PROCESS_MODE_NON_JACK_PADDING:
self.ui.cb_engine_process_mode_other.setCurrentIndex(self.host.nextProcessMode-self.PROCESS_MODE_NON_JACK_PADDING)
self.ui.cb_engine_process_mode_other.setCurrentIndex(self.host.nextProcessMode -
self.PROCESS_MODE_NON_JACK_PADDING)
else:
self.ui.cb_engine_process_mode_other.setCurrentIndex(0)

@@ -699,34 +736,30 @@ class CarlaSettingsW(QDialog):
self.ui.ch_engine_manage_uis.setChecked(self.host.manageUIs)
self.ui.ch_engine_prefer_ui_bridges.setChecked(self.host.preferUIBridges)
self.ui.sb_engine_ui_bridges_timeout.setValue(self.host.uiBridgesTimeout)
self.ui.ch_engine_force_stereo.setChecked(self.host.forceStereo or not self.ui.ch_engine_force_stereo.isEnabled())
self.ui.ch_engine_force_stereo.setChecked(self.host.forceStereo or
not self.ui.ch_engine_force_stereo.isEnabled())
self.ui.ch_engine_prefer_plugin_bridges.setChecked(self.host.preferPluginBridges)
self.ui.ch_exp_export_lv2.setChecked(self.host.exportLV2)
self.ui.cb_exp_plugin_bridges.setChecked(self.host.showPluginBridges)
self.ui.ch_exp_wine_bridges.setChecked(self.host.showWineBridges)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# OSC

self.ui.ch_osc_enable.setChecked(settings.value(CARLA_KEY_OSC_ENABLED,
CARLA_DEFAULT_OSC_ENABLED,
bool))
self.ui.ch_osc_enable.setChecked(
settings.value(CARLA_KEY_OSC_ENABLED, CARLA_DEFAULT_OSC_ENABLED, bool))

self.ui.group_osc_tcp_port.setChecked(settings.value(CARLA_KEY_OSC_TCP_PORT_ENABLED,
CARLA_DEFAULT_OSC_TCP_PORT_ENABLED,
bool))
self.ui.group_osc_tcp_port.setChecked(
settings.value(CARLA_KEY_OSC_TCP_PORT_ENABLED, CARLA_DEFAULT_OSC_TCP_PORT_ENABLED, bool))

self.ui.group_osc_udp_port.setChecked(settings.value(CARLA_KEY_OSC_UDP_PORT_ENABLED,
CARLA_DEFAULT_OSC_UDP_PORT_ENABLED,
bool))
self.ui.group_osc_udp_port.setChecked(
settings.value(CARLA_KEY_OSC_UDP_PORT_ENABLED, CARLA_DEFAULT_OSC_UDP_PORT_ENABLED, bool))

self.ui.sb_osc_tcp_port_number.setValue(settings.value(CARLA_KEY_OSC_TCP_PORT_NUMBER,
CARLA_DEFAULT_OSC_TCP_PORT_NUMBER,
int))
self.ui.sb_osc_tcp_port_number.setValue(
settings.value(CARLA_KEY_OSC_TCP_PORT_NUMBER, CARLA_DEFAULT_OSC_TCP_PORT_NUMBER, int))

self.ui.sb_osc_udp_port_number.setValue(settings.value(CARLA_KEY_OSC_UDP_PORT_NUMBER,
CARLA_DEFAULT_OSC_UDP_PORT_NUMBER,
int))
self.ui.sb_osc_udp_port_number.setValue(
settings.value(CARLA_KEY_OSC_UDP_PORT_NUMBER, CARLA_DEFAULT_OSC_UDP_PORT_NUMBER, int))

if settings.value(CARLA_KEY_OSC_TCP_PORT_RANDOM, CARLA_DEFAULT_OSC_TCP_PORT_RANDOM, bool):
self.ui.rb_osc_tcp_port_specific.setChecked(False)
@@ -742,11 +775,11 @@ class CarlaSettingsW(QDialog):
self.ui.rb_osc_udp_port_random.setChecked(False)
self.ui.rb_osc_udp_port_specific.setChecked(True)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# File Paths

audioPaths = settings.value(CARLA_KEY_PATHS_AUDIO, CARLA_DEFAULT_FILE_PATH_AUDIO, list)
midiPaths = settings.value(CARLA_KEY_PATHS_MIDI, CARLA_DEFAULT_FILE_PATH_MIDI, list)
midiPaths = settings.value(CARLA_KEY_PATHS_MIDI, CARLA_DEFAULT_FILE_PATH_MIDI, list)

audioPaths.sort()
midiPaths.sort()
@@ -761,7 +794,7 @@ class CarlaSettingsW(QDialog):
continue
self.ui.lw_files_midi.addItem(midiPath)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Plugin Paths

ladspas = settings.value(CARLA_KEY_PATHS_LADSPA, CARLA_DEFAULT_LADSPA_PATH, list)
@@ -815,53 +848,44 @@ class CarlaSettingsW(QDialog):
continue
self.ui.lw_sfz.addItem(sfz)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Wine

self.ui.le_wine_exec.setText(settings.value(CARLA_KEY_WINE_EXECUTABLE,
CARLA_DEFAULT_WINE_EXECUTABLE,
str))
self.ui.le_wine_exec.setText(
settings.value(CARLA_KEY_WINE_EXECUTABLE, CARLA_DEFAULT_WINE_EXECUTABLE, str))

self.ui.cb_wine_prefix_detect.setChecked(settings.value(CARLA_KEY_WINE_AUTO_PREFIX,
CARLA_DEFAULT_WINE_AUTO_PREFIX,
bool))
self.ui.cb_wine_prefix_detect.setChecked(
settings.value(CARLA_KEY_WINE_AUTO_PREFIX, CARLA_DEFAULT_WINE_AUTO_PREFIX, bool))

self.ui.le_wine_prefix_fallback.setText(settings.value(CARLA_KEY_WINE_FALLBACK_PREFIX,
CARLA_DEFAULT_WINE_FALLBACK_PREFIX,
str))
self.ui.le_wine_prefix_fallback.setText(
settings.value(CARLA_KEY_WINE_FALLBACK_PREFIX, CARLA_DEFAULT_WINE_FALLBACK_PREFIX, str))

self.ui.group_wine_realtime.setChecked(settings.value(CARLA_KEY_WINE_RT_PRIO_ENABLED,
CARLA_DEFAULT_WINE_RT_PRIO_ENABLED,
bool))
self.ui.group_wine_realtime.setChecked(
settings.value(CARLA_KEY_WINE_RT_PRIO_ENABLED, CARLA_DEFAULT_WINE_RT_PRIO_ENABLED, bool))

self.ui.sb_wine_base_prio.setValue(settings.value(CARLA_KEY_WINE_BASE_RT_PRIO,
CARLA_DEFAULT_WINE_BASE_RT_PRIO,
int))
self.ui.sb_wine_base_prio.setValue(
settings.value(CARLA_KEY_WINE_BASE_RT_PRIO, CARLA_DEFAULT_WINE_BASE_RT_PRIO, int))

self.ui.sb_wine_server_prio.setValue(settings.value(CARLA_KEY_WINE_SERVER_RT_PRIO,
CARLA_DEFAULT_WINE_SERVER_RT_PRIO,
int))
self.ui.sb_wine_server_prio.setValue(
settings.value(CARLA_KEY_WINE_SERVER_RT_PRIO, CARLA_DEFAULT_WINE_SERVER_RT_PRIO, int))

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Experimental

self.ui.ch_exp_jack_apps.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_JACK_APPS,
CARLA_DEFAULT_EXPERIMENTAL_JACK_APPS,
bool))
self.ui.ch_exp_jack_apps.setChecked(
settings.value(CARLA_KEY_EXPERIMENTAL_JACK_APPS, CARLA_DEFAULT_EXPERIMENTAL_JACK_APPS, bool))

self.ui.ch_exp_export_lv2.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_EXPORT_LV2,
CARLA_DEFAULT_EXPERIMENTAL_LV2_EXPORT,
bool))
self.ui.ch_exp_export_lv2.setChecked(
settings.value(CARLA_KEY_EXPERIMENTAL_EXPORT_LV2, CARLA_DEFAULT_EXPERIMENTAL_LV2_EXPORT, bool))

self.ui.ch_exp_load_lib_global.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_LOAD_LIB_GLOBAL,
CARLA_DEFAULT_EXPERIMENTAL_LOAD_LIB_GLOBAL,
bool))
self.ui.ch_exp_load_lib_global.setChecked(
settings.value(CARLA_KEY_EXPERIMENTAL_LOAD_LIB_GLOBAL, CARLA_DEFAULT_EXPERIMENTAL_LOAD_LIB_GLOBAL, bool))

self.ui.ch_exp_prevent_bad_behaviour.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_PREVENT_BAD_BEHAVIOUR,
CARLA_DEFAULT_EXPERIMENTAL_PREVENT_BAD_BEHAVIOUR,
bool))
self.ui.ch_exp_prevent_bad_behaviour.setChecked(
settings.value(CARLA_KEY_EXPERIMENTAL_PREVENT_BAD_BEHAVIOUR,
CARLA_DEFAULT_EXPERIMENTAL_PREVENT_BAD_BEHAVIOUR, bool))

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_saveSettings(self):
@@ -872,7 +896,7 @@ class CarlaSettingsW(QDialog):
if not self.host.experimental:
self.resetExperimentalSettings()

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Main

settings.setValue(CARLA_KEY_MAIN_PROJECT_FOLDER, self.ui.le_main_proj_folder.text())
@@ -881,7 +905,7 @@ class CarlaSettingsW(QDialog):
settings.setValue(CARLA_KEY_MAIN_PRO_THEME_COLOR, self.ui.cb_main_theme_color.currentText())
settings.setValue(CARLA_KEY_MAIN_REFRESH_INTERVAL, self.ui.sb_main_refresh_interval.value())

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Canvas

settings.setValue(CARLA_KEY_CANVAS_THEME, self.ui.cb_canvas_theme.currentText())
@@ -893,20 +917,21 @@ class CarlaSettingsW(QDialog):
settings.setValue(CARLA_KEY_CANVAS_FANCY_EYE_CANDY, self.ui.cb_canvas_fancy_eyecandy.isChecked())
settings.setValue(CARLA_KEY_CANVAS_USE_OPENGL, self.ui.cb_canvas_use_opengl.isChecked())
settings.setValue(CARLA_KEY_CANVAS_HQ_ANTIALIASING, self.ui.cb_canvas_render_hq_aa.isChecked())
settings.setValue(CARLA_KEY_CANVAS_ANTIALIASING, self.ui.cb_canvas_render_aa.checkState()) # 0, 1, 2 match their enum variants
# NOTE: checkState() 0, 1, 2 match their enum variants
settings.setValue(CARLA_KEY_CANVAS_ANTIALIASING, self.ui.cb_canvas_render_aa.checkState())
settings.setValue(CARLA_KEY_CANVAS_FULL_REPAINTS, self.ui.cb_canvas_full_repaints.isChecked())
settings.setValue(CARLA_KEY_CANVAS_INLINE_DISPLAYS, self.ui.cb_canvas_inline_displays.isChecked())

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------

settings = QSafeSettings("falkTX", "Carla2")

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Main

settings.setValue(CARLA_KEY_MAIN_EXPERIMENTAL, self.host.experimental)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Engine

audioDriver = self.ui.cb_engine_audio_driver.currentText()
@@ -919,7 +944,8 @@ class CarlaSettingsW(QDialog):
if audioDriver == "JACK":
self.host.nextProcessMode = self.ui.cb_engine_process_mode_jack.currentIndex()
else:
self.host.nextProcessMode = self.ui.cb_engine_process_mode_other.currentIndex() + self.PROCESS_MODE_NON_JACK_PADDING
self.host.nextProcessMode = (self.ui.cb_engine_process_mode_other.currentIndex() +
self.PROCESS_MODE_NON_JACK_PADDING)

settings.setValue(CARLA_KEY_ENGINE_PROCESS_MODE, self.host.nextProcessMode)

@@ -951,7 +977,7 @@ class CarlaSettingsW(QDialog):
settings.setValue(CARLA_KEY_EXPERIMENTAL_PLUGIN_BRIDGES, self.host.showPluginBridges)
settings.setValue(CARLA_KEY_EXPERIMENTAL_WINE_BRIDGES, self.host.showWineBridges)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# OSC

settings.setValue(CARLA_KEY_OSC_ENABLED, self.ui.ch_osc_enable.isChecked())
@@ -962,7 +988,7 @@ class CarlaSettingsW(QDialog):
settings.setValue(CARLA_KEY_OSC_TCP_PORT_NUMBER, self.ui.sb_osc_tcp_port_number.value())
settings.setValue(CARLA_KEY_OSC_UDP_PORT_NUMBER, self.ui.sb_osc_udp_port_number.value())

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# File Paths

audioPaths = []
@@ -980,7 +1006,7 @@ class CarlaSettingsW(QDialog):
settings.setValue(CARLA_KEY_PATHS_AUDIO, audioPaths)
settings.setValue(CARLA_KEY_PATHS_MIDI, midiPaths)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Plugin Paths

ladspas = []
@@ -1028,7 +1054,7 @@ class CarlaSettingsW(QDialog):
settings.setValue(CARLA_KEY_PATHS_SF2, sf2s)
settings.setValue(CARLA_KEY_PATHS_SFZ, sfzs)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Wine

settings.setValue(CARLA_KEY_WINE_EXECUTABLE, self.ui.le_wine_exec.text())
@@ -1038,31 +1064,34 @@ class CarlaSettingsW(QDialog):
settings.setValue(CARLA_KEY_WINE_BASE_RT_PRIO, self.ui.sb_wine_base_prio.value())
settings.setValue(CARLA_KEY_WINE_SERVER_RT_PRIO, self.ui.sb_wine_server_prio.value())

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Experimental

settings.setValue(CARLA_KEY_EXPERIMENTAL_JACK_APPS, self.ui.ch_exp_jack_apps.isChecked())
settings.setValue(CARLA_KEY_EXPERIMENTAL_LOAD_LIB_GLOBAL, self.ui.ch_exp_load_lib_global.isChecked())
settings.setValue(CARLA_KEY_EXPERIMENTAL_PREVENT_BAD_BEHAVIOUR, self.ui.ch_exp_prevent_bad_behaviour.isChecked())
settings.setValue(CARLA_KEY_EXPERIMENTAL_PREVENT_BAD_BEHAVIOUR,
self.ui.ch_exp_prevent_bad_behaviour.isChecked())

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_resetSettings(self):
currentRow = self.ui.lw_page.currentRow()

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Main

if currentRow == self.TAB_INDEX_MAIN:
self.ui.le_main_proj_folder.setText(CARLA_DEFAULT_MAIN_PROJECT_FOLDER)
self.ui.ch_main_theme_pro.setChecked(CARLA_DEFAULT_MAIN_USE_PRO_THEME and self.ui.group_main_theme.isEnabled())
self.ui.cb_main_theme_color.setCurrentIndex(self.ui.cb_main_theme_color.findText(CARLA_DEFAULT_MAIN_PRO_THEME_COLOR))
self.ui.ch_main_theme_pro.setChecked(CARLA_DEFAULT_MAIN_USE_PRO_THEME and
self.ui.group_main_theme.isEnabled())
self.ui.cb_main_theme_color.setCurrentIndex(
self.ui.cb_main_theme_color.findText(CARLA_DEFAULT_MAIN_PRO_THEME_COLOR))
self.ui.sb_main_refresh_interval.setValue(CARLA_DEFAULT_MAIN_REFRESH_INTERVAL)
self.ui.ch_main_confirm_exit.setChecked(CARLA_DEFAULT_MAIN_CONFIRM_EXIT)
self.ui.ch_main_show_logs.setChecked(CARLA_DEFAULT_MAIN_SHOW_LOGS)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Canvas

elif currentRow == self.TAB_INDEX_CANVAS:
@@ -1075,7 +1104,7 @@ class CarlaSettingsW(QDialog):
self.ui.cb_canvas_render_aa.setCheckState(Qt.PartiallyChecked) # CARLA_DEFAULT_CANVAS_ANTIALIASING
self.ui.cb_canvas_full_repaints.setChecked(CARLA_DEFAULT_CANVAS_FULL_REPAINTS)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Engine

elif currentRow == self.TAB_INDEX_ENGINE:
@@ -1087,7 +1116,8 @@ class CarlaSettingsW(QDialog):
self.ui.cb_engine_process_mode_jack.setCurrentIndex(CARLA_DEFAULT_PROCESS_MODE)
self.ui.sw_engine_process_mode.setCurrentIndex(0) # show all modes
else:
self.ui.cb_engine_process_mode_other.setCurrentIndex(CARLA_DEFAULT_PROCESS_MODE-self.PROCESS_MODE_NON_JACK_PADDING)
self.ui.cb_engine_process_mode_other.setCurrentIndex(CARLA_DEFAULT_PROCESS_MODE -
self.PROCESS_MODE_NON_JACK_PADDING)
self.ui.sw_engine_process_mode.setCurrentIndex(1) # hide single+multi client modes

self.ui.sb_engine_max_params.setValue(CARLA_DEFAULT_MAX_PARAMETERS)
@@ -1097,7 +1127,7 @@ class CarlaSettingsW(QDialog):
self.ui.sb_engine_ui_bridges_timeout.setValue(CARLA_DEFAULT_UI_BRIDGES_TIMEOUT)
self.ui.ch_engine_manage_uis.setChecked(CARLA_DEFAULT_MANAGE_UIS)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# OSC

elif currentRow == self.TAB_INDEX_OSC:
@@ -1121,7 +1151,7 @@ class CarlaSettingsW(QDialog):
self.ui.rb_osc_udp_port_random.setChecked(False)
self.ui.rb_osc_udp_port_specific.setChecked(True)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Plugin Paths

elif currentRow == self.TAB_INDEX_FILEPATHS:
@@ -1133,7 +1163,7 @@ class CarlaSettingsW(QDialog):
elif curIndex == self.FILEPATH_INDEX_MIDI:
self.ui.lw_files_midi.clear()

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Plugin Paths

elif currentRow == self.TAB_INDEX_PLUGINPATHS:
@@ -1209,7 +1239,7 @@ class CarlaSettingsW(QDialog):
continue
self.ui.lw_sfz.addItem(path)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Wine

elif currentRow == self.TAB_INDEX_WINE:
@@ -1220,7 +1250,7 @@ class CarlaSettingsW(QDialog):
self.ui.sb_wine_base_prio.setValue(CARLA_DEFAULT_WINE_BASE_RT_PRIO)
self.ui.sb_wine_server_prio.setValue(CARLA_DEFAULT_WINE_SERVER_RT_PRIO)

# ----------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------
# Experimental

elif currentRow == self.TAB_INDEX_EXPERIMENTAL:
@@ -1237,13 +1267,15 @@ class CarlaSettingsW(QDialog):

# Temporary, until stable
self.ui.cb_canvas_fancy_eyecandy.setChecked(CARLA_DEFAULT_CANVAS_FANCY_EYE_CANDY)
self.ui.cb_canvas_use_opengl.setChecked(CARLA_DEFAULT_CANVAS_USE_OPENGL and self.ui.cb_canvas_use_opengl.isEnabled())
self.ui.cb_canvas_render_hq_aa.setChecked(CARLA_DEFAULT_CANVAS_HQ_ANTIALIASING and self.ui.cb_canvas_render_hq_aa.isEnabled())
self.ui.cb_canvas_use_opengl.setChecked(CARLA_DEFAULT_CANVAS_USE_OPENGL and
self.ui.cb_canvas_use_opengl.isEnabled())
self.ui.cb_canvas_render_hq_aa.setChecked(CARLA_DEFAULT_CANVAS_HQ_ANTIALIASING and
self.ui.cb_canvas_render_hq_aa.isEnabled())
self.ui.cb_canvas_inline_displays.setChecked(CARLA_DEFAULT_CANVAS_INLINE_DISPLAYS)
self.ui.ch_engine_force_stereo.setChecked(CARLA_DEFAULT_FORCE_STEREO)
self.ui.ch_engine_prefer_plugin_bridges.setChecked(CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES)

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot(bool)
def slot_enableExperimental(self, toggled):
@@ -1287,14 +1319,14 @@ class CarlaSettingsW(QDialog):
# uncheck GL specific option
self.ui.cb_canvas_render_hq_aa.setChecked(False)

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_getAndSetProjectPath(self):
# FIXME
getAndSetPath(self, self.ui.le_main_proj_folder)

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_engineAudioDriverChanged(self):
@@ -1309,7 +1341,7 @@ class CarlaSettingsW(QDialog):
driverName = self.ui.cb_engine_audio_driver.currentText()
DriverSettingsW(self, self.host, driverIndex, driverName).exec_()

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_addPluginPath(self):
@@ -1395,7 +1427,7 @@ class CarlaSettingsW(QDialog):
elif curIndex == self.PLUGINPATH_INDEX_SFZ:
self.ui.lw_sfz.currentItem().setText(newPath)

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot(int)
def slot_pluginPathTabChanged(self, index):
@@ -1424,7 +1456,7 @@ class CarlaSettingsW(QDialog):
self.ui.b_paths_remove.setEnabled(check)
self.ui.b_paths_change.setEnabled(check)

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot()
def slot_addFilePath(self):
@@ -1470,7 +1502,7 @@ class CarlaSettingsW(QDialog):
elif curIndex == self.FILEPATH_INDEX_MIDI:
self.ui.lw_files_midi.currentItem().setText(newPath)

# --------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------

@pyqtSlot(int)
def slot_filePathTabChanged(self, index):
@@ -1489,7 +1521,7 @@ class CarlaSettingsW(QDialog):
self.ui.b_filepaths_remove.setEnabled(check)
self.ui.b_filepaths_change.setEnabled(check)

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------
# Main

if __name__ == '__main__':
@@ -1510,4 +1542,4 @@ if __name__ == '__main__':

_app.exit_exec()

# ------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------

+ 49
- 29
source/frontend/carla_widgets.py View File

@@ -143,6 +143,7 @@ class CarlaAboutW(QDialog):
self.ui.le_osc_url_tcp.setText(self.tr("(Engine not running)"))
self.ui.le_osc_url_udp.setText(self.tr("(Engine not running)"))

# pylint: disable=line-too-long
self.ui.l_osc_cmds.setText("<table>"
"<tr><td>" "/set_active" "&nbsp;</td><td>&lt;i-value&gt;</td></tr>"
"<tr><td>" "/set_drywet" "&nbsp;</td><td>&lt;f-value&gt;</td></tr>"
@@ -162,6 +163,7 @@ class CarlaAboutW(QDialog):

self.ui.l_example.setText("/Carla/2/set_parameter_value 5 1.0")
self.ui.l_example_help.setText("<i>(as in this example, \"2\" is the plugin number and \"5\" the parameter)</i>")
# pylint: enable=line-too-long

self.ui.l_ladspa.setText(self.tr("Everything! (Including LRDF)"))
self.ui.l_dssi.setText(self.tr("Everything! (Including CustomData/Chunks)"))
@@ -431,7 +433,8 @@ class PluginParameter(QWidget):

if ccx > self.fMappedCtrl and not inlist:
inlist = True
action = menuMIDI.addAction(self.tr("%02i [0x%02X] (Custom)" % (self.fMappedCtrl, self.fMappedCtrl)))
action = menuMIDI.addAction(self.tr("%02i [0x%02X] (Custom)" % (self.fMappedCtrl,
self.fMappedCtrl)))
action.setCheckable(True)
action.setChecked(True)
actCCs.append(action)
@@ -525,10 +528,11 @@ class PluginParameter(QWidget):
elif actSel in actCCs:
ctrl = int(actSel.text().split(" ", 1)[0].replace("&",""), 10)
elif actSel == actCustomCC:
value = self.fMappedCtrl if self.fMappedCtrl >= 0x01 and self.fMappedCtrl <= 0x77 else 1
ctrl, ok = QInputDialog.getInt(self,
self.tr("Custom CC"),
"Custom MIDI CC to use:",
self.fMappedCtrl if self.fMappedCtrl >= 0x01 and self.fMappedCtrl <= 0x77 else 1,
value,
0x01, 0x77, 1)
if not ok:
return
@@ -915,29 +919,31 @@ class PluginEdit(QDialog):
self.ui.dial_b_right.setEnabled(pluginHints & PLUGIN_CAN_BALANCE)
self.ui.dial_pan.setEnabled(pluginHints & PLUGIN_CAN_PANNING)

self.ui.ch_use_chunks.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_USE_CHUNKS)
self.ui.ch_use_chunks.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_USE_CHUNKS)
self.ui.ch_fixed_buffer.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_FIXED_BUFFERS)
self.ui.ch_fixed_buffer.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_FIXED_BUFFERS)
self.ui.ch_force_stereo.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_FORCE_STEREO)
self.ui.ch_force_stereo.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_FORCE_STEREO)
self.ui.ch_map_program_changes.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_MAP_PROGRAM_CHANGES)
self.ui.ch_map_program_changes.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_MAP_PROGRAM_CHANGES)
self.ui.ch_send_control_changes.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_CONTROL_CHANGES)
self.ui.ch_send_control_changes.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_SEND_CONTROL_CHANGES)
self.ui.ch_send_channel_pressure.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)
self.ui.ch_send_channel_pressure.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)
self.ui.ch_send_note_aftertouch.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)
self.ui.ch_send_note_aftertouch.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)
self.ui.ch_send_pitchbend.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_PITCHBEND)
self.ui.ch_send_pitchbend.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_SEND_PITCHBEND)
self.ui.ch_send_all_sound_off.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_ALL_SOUND_OFF)
self.ui.ch_send_all_sound_off.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_SEND_ALL_SOUND_OFF)

canSendPrograms = bool((self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) != 0 and
(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_MAP_PROGRAM_CHANGES) == 0)
optsAvailable = self.fPluginInfo['optionsAvailable']
optsEnabled = self.fPluginInfo['optionsEnabled']
self.ui.ch_use_chunks.setEnabled(optsAvailable & PLUGIN_OPTION_USE_CHUNKS)
self.ui.ch_use_chunks.setChecked(optsEnabled & PLUGIN_OPTION_USE_CHUNKS)
self.ui.ch_fixed_buffer.setEnabled(optsAvailable & PLUGIN_OPTION_FIXED_BUFFERS)
self.ui.ch_fixed_buffer.setChecked(optsEnabled & PLUGIN_OPTION_FIXED_BUFFERS)
self.ui.ch_force_stereo.setEnabled(optsAvailable & PLUGIN_OPTION_FORCE_STEREO)
self.ui.ch_force_stereo.setChecked(optsEnabled & PLUGIN_OPTION_FORCE_STEREO)
self.ui.ch_map_program_changes.setEnabled(optsAvailable & PLUGIN_OPTION_MAP_PROGRAM_CHANGES)
self.ui.ch_map_program_changes.setChecked(optsEnabled & PLUGIN_OPTION_MAP_PROGRAM_CHANGES)
self.ui.ch_send_control_changes.setEnabled(optsAvailable & PLUGIN_OPTION_SEND_CONTROL_CHANGES)
self.ui.ch_send_control_changes.setChecked(optsEnabled & PLUGIN_OPTION_SEND_CONTROL_CHANGES)
self.ui.ch_send_channel_pressure.setEnabled(optsAvailable & PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)
self.ui.ch_send_channel_pressure.setChecked(optsEnabled & PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)
self.ui.ch_send_note_aftertouch.setEnabled(optsAvailable & PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)
self.ui.ch_send_note_aftertouch.setChecked(optsEnabled & PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)
self.ui.ch_send_pitchbend.setEnabled(optsAvailable & PLUGIN_OPTION_SEND_PITCHBEND)
self.ui.ch_send_pitchbend.setChecked(optsEnabled & PLUGIN_OPTION_SEND_PITCHBEND)
self.ui.ch_send_all_sound_off.setEnabled(optsAvailable & PLUGIN_OPTION_SEND_ALL_SOUND_OFF)
self.ui.ch_send_all_sound_off.setChecked(optsEnabled & PLUGIN_OPTION_SEND_ALL_SOUND_OFF)

canSendPrograms = bool((optsAvailable & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) != 0 and
(optsEnabled & PLUGIN_OPTION_MAP_PROGRAM_CHANGES) == 0)
self.ui.ch_send_program_changes.setEnabled(canSendPrograms)
self.ui.ch_send_program_changes.setChecked(self.fPluginInfo['optionsEnabled'] & PLUGIN_OPTION_SEND_PROGRAM_CHANGES)
self.ui.ch_send_program_changes.setChecked(optsEnabled & PLUGIN_OPTION_SEND_PROGRAM_CHANGES)

self.ui.sw_programs.setCurrentIndex(0 if self.fPluginInfo['type'] in (PLUGIN_VST2, PLUGIN_SFZ) else 1)

@@ -1308,7 +1314,10 @@ class PluginEdit(QDialog):
return

if self.fCurrentStateFilename:
askTry = QMessageBox.question(self, self.tr("Overwrite?"), self.tr("Overwrite previously created file?"), QMessageBox.Ok|QMessageBox.Cancel)
askTry = QMessageBox.question(self,
self.tr("Overwrite?"),
self.tr("Overwrite previously created file?"),
QMessageBox.Ok|QMessageBox.Cancel)

if askTry == QMessageBox.Ok:
self.host.save_plugin_state(self.fPluginId, self.fCurrentStateFilename)
@@ -1337,7 +1346,10 @@ class PluginEdit(QDialog):
for i in range(self.host.get_program_count(self.fPluginId)):
presetList.append("%03i - %s" % (i+1, self.host.get_program_name(self.fPluginId, i)))

ret = QInputDialog.getItem(self, self.tr("Open LV2 Preset"), self.tr("Select an LV2 Preset:"), presetList, 0, False)
ret = QInputDialog.getItem(self,
self.tr("Open LV2 Preset"),
self.tr("Select an LV2 Preset:"),
presetList, 0, False)

if ret[1]:
index = int(ret[0].split(" - ", 1)[0])-1
@@ -1404,7 +1416,8 @@ class PluginEdit(QDialog):
# handle map-program-changes and send-program-changes conflict

if option == PLUGIN_OPTION_MAP_PROGRAM_CHANGES and not clicked:
self.ui.ch_send_program_changes.setEnabled(self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_PROGRAM_CHANGES)
self.ui.ch_send_program_changes.setEnabled(
self.fPluginInfo['optionsAvailable'] & PLUGIN_OPTION_SEND_PROGRAM_CHANGES)

# restore send-program-changes if needed
if self.ui.ch_send_program_changes.isChecked():
@@ -1575,7 +1588,13 @@ class PluginEdit(QDialog):

if actSelected == actSet:
current = minimum + (maximum-minimum)*(float(sender.value())/10000)
value, ok = QInputDialog.getInt(self, self.tr("Set value"), label, round(current*100.0), round(minimum*100.0), round(maximum*100.0), 1)
value, ok = QInputDialog.getInt(self,
self.tr("Set value"),
label,
round(current*100.0),
round(minimum*100.0),
round(maximum*100.0),
1)
if ok:
value = float(value)/100.0

@@ -1692,7 +1711,8 @@ class PluginEdit(QDialog):
def _updateCtrlPrograms(self):
self.ui.keyboard.setEnabled(self.fControlChannel >= 0)

if self.fPluginInfo['category'] != PLUGIN_CATEGORY_SYNTH or self.fPluginInfo['type'] not in (PLUGIN_INTERNAL, PLUGIN_SF2):
if (self.fPluginInfo['category'] != PLUGIN_CATEGORY_SYNTH or
self.fPluginInfo['type'] not in (PLUGIN_INTERNAL, PLUGIN_SF2)):
return

if self.fControlChannel < 0:


+ 5
- 6
source/frontend/widgets/canvaspreviewframe.py View File

@@ -104,7 +104,6 @@ class CanvasPreviewFrame(QFrame):
self.fZoomCursors[self._kCursorZoomOut] = QCursor(QPixmap(":/cursors/zoom-out_black.png"), 8, 7)

def init(self, scene: QGraphicsScene, realWidth: float, realHeight: float, useCustomPaint: bool = False):
# realWidth, realHeight = float(realWidth), float(realHeight)
self.fScene = scene
self.fRenderSource = QRectF(0.0, 0.0, realWidth, realHeight)
self.fInternalRatio = realWidth / realHeight
@@ -119,21 +118,21 @@ class CanvasPreviewFrame(QFrame):

# -----------------------------------------------------------------------------------------------------------------

def setViewPosX(self, xp):
def setViewPosX(self, xp: float):
self.fViewRect[self._kRectX] = xp * (self.fInternalWidth - self.fViewRect[self._kRectWidth]/self.fScale)
self.update()

def setViewPosY(self, yp):
def setViewPosY(self, yp: float):
self.fViewRect[self._kRectY] = yp * (self.fInternalHeight - self.fViewRect[self._kRectHeight]/self.fScale)
self.update()

def setViewScale(self, scale):
def setViewScale(self, scale: float):
self.fScale = scale

if self.fRealParent is not None:
QTimer.singleShot(0, self.fRealParent.slot_miniCanvasCheckAll)

def setViewSize(self, width, height):
def setViewSize(self, width: float, height: float):
self.fViewRect[self._kRectWidth] = width * self.fInternalWidth
self.fViewRect[self._kRectHeight] = height * self.fInternalHeight
self.update()
@@ -387,7 +386,7 @@ class CanvasPreviewFrame(QFrame):

self.cursor().setPos(self.fMouseInitialZoomPos)

def _updateMouseMode(self, event=None):
def _updateMouseMode(self, event = None):
if self.fMouseLeftDown and self.fMouseRightDown:
self.fMouseInitialZoomPos = event.globalPos()
self.setCursor(self.fZoomCursors[self._kCursorZoom])


Loading…
Cancel
Save