Browse Source

New option to wherever put UIs on top of carla

Closes #348
tags/1.9.7
falkTX 8 years ago
parent
commit
9eb197339b
6 changed files with 99 additions and 72 deletions
  1. +65
    -58
      resources/ui/carla_settings.ui
  2. +1
    -0
      source/carla_backend.py
  3. +11
    -6
      source/carla_host.py
  4. +17
    -6
      source/carla_settings.py
  5. +2
    -0
      source/carla_shared.py
  6. +3
    -2
      source/native-plugins/resources/carla-plugin

+ 65
- 58
resources/ui/carla_settings.ui View File

@@ -261,6 +261,71 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="group_main_misc">
<property name="title">
<string>Interface</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="1">
<widget class="QSpinBox" name="sb_main_refresh_interval">
<property name="suffix">
<string> ms</string>
</property>
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>250</number>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>130</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_main_refresh_interval">
<property name="text">
<string>Interface refresh interval:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="ch_main_manage_uis">
<property name="text">
<string>Make plugin UIs appear on top of Carla (needs restart)</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QCheckBox" name="ch_main_use_custom_skins">
<property name="text">
<string>Use custom plugin slot skins</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="group_main_theme"> <widget class="QGroupBox" name="group_main_theme">
<property name="title"> <property name="title">
@@ -323,64 +388,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="group_main_misc">
<property name="title">
<string>Misc</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<widget class="QLabel" name="label_main_refresh_interval">
<property name="text">
<string>GUI Refresh interval:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="sb_main_refresh_interval">
<property name="suffix">
<string> ms</string>
</property>
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>250</number>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>130</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="cb_main_use_custom_skins">
<property name="text">
<string>Use custom plugin slot skins</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">


+ 1
- 0
source/carla_backend.py View File

@@ -1216,6 +1216,7 @@ class CarlaHostMeta(object):
self.preferPluginBridges = False self.preferPluginBridges = False
self.preferUIBridges = False self.preferUIBridges = False
self.preventBadBehaviour = False self.preventBadBehaviour = False
self.manageUIs = False
self.uisAlwaysOnTop = False self.uisAlwaysOnTop = False
self.maxParameters = 0 self.maxParameters = 0
self.uiBridgesTimeout = 0 self.uiBridgesTimeout = 0


+ 11
- 6
source/carla_host.py View File

@@ -1842,7 +1842,7 @@ class HostWindow(QMainWindow):
QMainWindow.showEvent(self, event) QMainWindow.showEvent(self, event)


# set our gui as parent for all plugins UIs # set our gui as parent for all plugins UIs
if not (self.host.isControl or self.host.isPlugin):
if self.host.manageUIs and not (self.host.isControl or self.host.isPlugin):
winIdStr = "%x" % self.winId() winIdStr = "%x" % self.winId()
self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr) self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr)


@@ -2241,6 +2241,16 @@ def loadHostSettings(host):
settings = QSettings("falkTX", "Carla2") settings = QSettings("falkTX", "Carla2")


# bool values # bool values
try:
host.manageUIs = settings.value(CARLA_KEY_MAIN_MANAGE_UIS, CARLA_DEFAULT_MAIN_MANAGE_UIS, type=bool)
except:
host.manageUIs = CARLA_DEFAULT_MAIN_MANAGE_UIS

try:
host.uisAlwaysOnTop = settings.value(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, CARLA_DEFAULT_UIS_ALWAYS_ON_TOP, type=bool)
except:
host.uisAlwaysOnTop = CARLA_DEFAULT_UIS_ALWAYS_ON_TOP

try: try:
host.forceStereo = settings.value(CARLA_KEY_ENGINE_FORCE_STEREO, CARLA_DEFAULT_FORCE_STEREO, type=bool) host.forceStereo = settings.value(CARLA_KEY_ENGINE_FORCE_STEREO, CARLA_DEFAULT_FORCE_STEREO, type=bool)
except: except:
@@ -2256,11 +2266,6 @@ def loadHostSettings(host):
except: except:
host.preferUIBridges = CARLA_DEFAULT_PREFER_UI_BRIDGES host.preferUIBridges = CARLA_DEFAULT_PREFER_UI_BRIDGES


try:
host.uisAlwaysOnTop = settings.value(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, CARLA_DEFAULT_UIS_ALWAYS_ON_TOP, type=bool)
except:
host.uisAlwaysOnTop = CARLA_DEFAULT_UIS_ALWAYS_ON_TOP

# int values # int values
try: try:
host.maxParameters = settings.value(CARLA_KEY_ENGINE_MAX_PARAMETERS, CARLA_DEFAULT_MAX_PARAMETERS, type=int) host.maxParameters = settings.value(CARLA_KEY_ENGINE_MAX_PARAMETERS, CARLA_DEFAULT_MAX_PARAMETERS, type=int)


+ 17
- 6
source/carla_settings.py View File

@@ -238,6 +238,10 @@ class CarlaSettingsW(QDialog):
self.ui.group_main_theme.setEnabled(False) self.ui.group_main_theme.setEnabled(False)
self.ui.group_main_theme.setVisible(False) self.ui.group_main_theme.setVisible(False)


if MACOS or WINDOWS:
self.ui.ch_main_manage_uis.setEnabled(False)
self.ui.ch_main_manage_uis.setVisible(False)

if host.isControl: if host.isControl:
self.ui.lw_page.hideRow(self.TAB_INDEX_CANVAS) self.ui.lw_page.hideRow(self.TAB_INDEX_CANVAS)
self.ui.lw_page.hideRow(self.TAB_INDEX_ENGINE) self.ui.lw_page.hideRow(self.TAB_INDEX_ENGINE)
@@ -320,11 +324,14 @@ class CarlaSettingsW(QDialog):
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
# Main # Main


self.ui.ch_main_manage_uis.setChecked(self.host.manageUIs)
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, type=str)) self.ui.le_main_proj_folder.setText(settings.value(CARLA_KEY_MAIN_PROJECT_FOLDER, CARLA_DEFAULT_MAIN_PROJECT_FOLDER, type=str))
self.ui.ch_main_theme_pro.setChecked(settings.value(CARLA_KEY_MAIN_USE_PRO_THEME, CARLA_DEFAULT_MAIN_USE_PRO_THEME, type=bool) and self.ui.group_main_theme.isEnabled()) self.ui.ch_main_theme_pro.setChecked(settings.value(CARLA_KEY_MAIN_USE_PRO_THEME, CARLA_DEFAULT_MAIN_USE_PRO_THEME, type=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, type=str))) 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, type=str)))
self.ui.sb_main_refresh_interval.setValue(settings.value(CARLA_KEY_MAIN_REFRESH_INTERVAL, CARLA_DEFAULT_MAIN_REFRESH_INTERVAL, type=int)) self.ui.sb_main_refresh_interval.setValue(settings.value(CARLA_KEY_MAIN_REFRESH_INTERVAL, CARLA_DEFAULT_MAIN_REFRESH_INTERVAL, type=int))
self.ui.cb_main_use_custom_skins.setChecked(settings.value(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS, type=bool))
self.ui.ch_main_use_custom_skins.setChecked(settings.value(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS, type=bool))


# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
# Canvas # Canvas
@@ -374,7 +381,6 @@ class CarlaSettingsW(QDialog):
self.ui.cb_engine_process_mode_other.setCurrentIndex(0) self.ui.cb_engine_process_mode_other.setCurrentIndex(0)


self.ui.sb_engine_max_params.setValue(self.host.maxParameters) self.ui.sb_engine_max_params.setValue(self.host.maxParameters)
self.ui.ch_engine_uis_always_on_top.setChecked(self.host.uisAlwaysOnTop)
self.ui.ch_engine_prefer_ui_bridges.setChecked(self.host.preferUIBridges) self.ui.ch_engine_prefer_ui_bridges.setChecked(self.host.preferUIBridges)
self.ui.sb_engine_ui_bridges_timeout.setValue(self.host.uiBridgesTimeout) 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())
@@ -442,11 +448,17 @@ class CarlaSettingsW(QDialog):
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
# Main # Main


self.host.manageUIs = self.ui.ch_main_manage_uis.isChecked()
self.host.uisAlwaysOnTop = self.ui.ch_engine_uis_always_on_top.isChecked()

settings.setValue(CARLA_KEY_MAIN_PROJECT_FOLDER, self.ui.le_main_proj_folder.text()) settings.setValue(CARLA_KEY_MAIN_PROJECT_FOLDER, self.ui.le_main_proj_folder.text())
settings.setValue(CARLA_KEY_MAIN_USE_PRO_THEME, self.ui.ch_main_theme_pro.isChecked()) settings.setValue(CARLA_KEY_MAIN_USE_PRO_THEME, self.ui.ch_main_theme_pro.isChecked())
settings.setValue(CARLA_KEY_MAIN_PRO_THEME_COLOR, self.ui.cb_main_theme_color.currentText()) 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()) settings.setValue(CARLA_KEY_MAIN_REFRESH_INTERVAL, self.ui.sb_main_refresh_interval.value())
settings.setValue(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, self.ui.cb_main_use_custom_skins.isChecked())
settings.setValue(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, self.ui.ch_main_use_custom_skins.isChecked())

settings.setValue(CARLA_KEY_MAIN_MANAGE_UIS, self.host.manageUIs)
settings.setValue(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, self.host.uisAlwaysOnTop)


# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
# Canvas # Canvas
@@ -484,7 +496,6 @@ class CarlaSettingsW(QDialog):
self.host.forceStereo = self.ui.ch_engine_force_stereo.isChecked() self.host.forceStereo = self.ui.ch_engine_force_stereo.isChecked()
self.host.preferPluginBridges = self.ui.ch_engine_prefer_plugin_bridges.isChecked() self.host.preferPluginBridges = self.ui.ch_engine_prefer_plugin_bridges.isChecked()
self.host.preferUIBridges = self.ui.ch_engine_prefer_ui_bridges.isChecked() self.host.preferUIBridges = self.ui.ch_engine_prefer_ui_bridges.isChecked()
self.host.uisAlwaysOnTop = self.ui.ch_engine_uis_always_on_top.isChecked()
self.host.maxParameters = self.ui.sb_engine_max_params.value() self.host.maxParameters = self.ui.sb_engine_max_params.value()
self.host.uiBridgesTimeout = self.ui.sb_engine_ui_bridges_timeout.value() self.host.uiBridgesTimeout = self.ui.sb_engine_ui_bridges_timeout.value()


@@ -502,7 +513,6 @@ class CarlaSettingsW(QDialog):


settings.setValue(CARLA_KEY_ENGINE_PREFER_PLUGIN_BRIDGES, self.host.preferPluginBridges) settings.setValue(CARLA_KEY_ENGINE_PREFER_PLUGIN_BRIDGES, self.host.preferPluginBridges)
settings.setValue(CARLA_KEY_ENGINE_PREFER_UI_BRIDGES, self.host.preferUIBridges) settings.setValue(CARLA_KEY_ENGINE_PREFER_UI_BRIDGES, self.host.preferUIBridges)
settings.setValue(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, self.host.uisAlwaysOnTop)
settings.setValue(CARLA_KEY_ENGINE_MAX_PARAMETERS, self.host.maxParameters) settings.setValue(CARLA_KEY_ENGINE_MAX_PARAMETERS, self.host.maxParameters)
settings.setValue(CARLA_KEY_ENGINE_UI_BRIDGES_TIMEOUT, self.host.uiBridgesTimeout) settings.setValue(CARLA_KEY_ENGINE_UI_BRIDGES_TIMEOUT, self.host.uiBridgesTimeout)


@@ -572,7 +582,8 @@ class CarlaSettingsW(QDialog):
self.ui.ch_main_theme_pro.setChecked(CARLA_DEFAULT_MAIN_USE_PRO_THEME and self.ui.group_main_theme.isEnabled()) 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.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.sb_main_refresh_interval.setValue(CARLA_DEFAULT_MAIN_REFRESH_INTERVAL)
self.ui.cb_main_use_custom_skins.setChecked(CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS)
self.ui.ch_main_use_custom_skins.setChecked(CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS)
self.ui.ch_main_manage_uis.setChecked(CARLA_DEFAULT_MAIN_MANAGE_UIS)


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


+ 2
- 0
source/carla_shared.py View File

@@ -192,6 +192,7 @@ CARLA_KEY_MAIN_USE_PRO_THEME = "Main/UseProTheme" # bool
CARLA_KEY_MAIN_PRO_THEME_COLOR = "Main/ProThemeColor" # str CARLA_KEY_MAIN_PRO_THEME_COLOR = "Main/ProThemeColor" # str
CARLA_KEY_MAIN_REFRESH_INTERVAL = "Main/RefreshInterval" # int CARLA_KEY_MAIN_REFRESH_INTERVAL = "Main/RefreshInterval" # int
CARLA_KEY_MAIN_USE_CUSTOM_SKINS = "Main/UseCustomSkins" # bool CARLA_KEY_MAIN_USE_CUSTOM_SKINS = "Main/UseCustomSkins" # bool
CARLA_KEY_MAIN_MANAGE_UIS = "Main/ManageUIs" # bool


CARLA_KEY_CANVAS_THEME = "Canvas/Theme" # str CARLA_KEY_CANVAS_THEME = "Canvas/Theme" # str
CARLA_KEY_CANVAS_SIZE = "Canvas/Size" # str "NxN" CARLA_KEY_CANVAS_SIZE = "Canvas/Size" # str "NxN"
@@ -235,6 +236,7 @@ CARLA_DEFAULT_MAIN_USE_PRO_THEME = True
CARLA_DEFAULT_MAIN_PRO_THEME_COLOR = "Black" CARLA_DEFAULT_MAIN_PRO_THEME_COLOR = "Black"
CARLA_DEFAULT_MAIN_REFRESH_INTERVAL = 20 CARLA_DEFAULT_MAIN_REFRESH_INTERVAL = 20
CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS = True CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS = True
CARLA_DEFAULT_MAIN_MANAGE_UIS = True


# Canvas # Canvas
CARLA_DEFAULT_CANVAS_THEME = "Modern Dark" CARLA_DEFAULT_CANVAS_THEME = "Modern Dark"


+ 3
- 2
source/native-plugins/resources/carla-plugin View File

@@ -533,8 +533,9 @@ class CarlaEmbedW(QEmbedWidget):
QEmbedWidget.showEvent(self, event) QEmbedWidget.showEvent(self, event)


# set our gui as parent for all plugins UIs # set our gui as parent for all plugins UIs
winIdStr = "%x" % self.fWinId
self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr)
if self.host.manageUIs:
winIdStr = "%x" % self.fWinId
self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr)


def hideEvent(self, event): def hideEvent(self, event):
# disable parent # disable parent


Loading…
Cancel
Save