Browse Source

Make transport controls experimental

Closes #546
tags/1.9.8
falkTX 7 years ago
parent
commit
244ccfc2ac
10 changed files with 67 additions and 19 deletions
  1. +7
    -0
      resources/ui/carla_settings.ui
  2. +9
    -4
      source/backend/CarlaBackend.h
  3. +5
    -2
      source/backend/CarlaStandalone.cpp
  4. +5
    -2
      source/backend/engine/CarlaEngine.cpp
  5. +1
    -1
      source/backend/engine/CarlaEngineJack.cpp
  6. +7
    -4
      source/carla_backend.py
  7. +22
    -1
      source/carla_host.py
  8. +7
    -5
      source/carla_settings.py
  9. +2
    -0
      source/carla_shared.py
  10. +2
    -0
      source/utils/CarlaBackendUtils.hpp

+ 7
- 0
resources/ui/carla_settings.ui View File

@@ -1786,6 +1786,13 @@
<string>Main</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item>
<widget class="QCheckBox" name="ch_exp_transport">
<property name="text">
<string>Enable transport controls</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_exp_plugin_bridges">
<property name="text">


+ 9
- 4
source/backend/CarlaBackend.h View File

@@ -1167,26 +1167,31 @@ typedef enum {
* @see ENGINE_OPTION_TRANSPORT_MODE
*/
typedef enum {
/*!
* No transport.
*/
ENGINE_TRANSPORT_MODE_DISABLED = 0,

/*!
* Internal transport mode.
*/
ENGINE_TRANSPORT_MODE_INTERNAL = 0,
ENGINE_TRANSPORT_MODE_INTERNAL = 1,

/*!
* Transport from JACK.
* Only available if driver name is "JACK".
*/
ENGINE_TRANSPORT_MODE_JACK = 1,
ENGINE_TRANSPORT_MODE_JACK = 2,

/*!
* Transport from host, used when Carla is a plugin.
*/
ENGINE_TRANSPORT_MODE_PLUGIN = 2,
ENGINE_TRANSPORT_MODE_PLUGIN = 3,

/*!
* Special mode, used in plugin-bridges only.
*/
ENGINE_TRANSPORT_MODE_BRIDGE = 3
ENGINE_TRANSPORT_MODE_BRIDGE = 4

} EngineTransportMode;



+ 5
- 2
source/backend/CarlaStandalone.cpp View File

@@ -466,10 +466,13 @@ void carla_set_engine_option(EngineOption option, int value, const char* valueSt
break;

case CB::ENGINE_OPTION_TRANSPORT_MODE:
CARLA_SAFE_ASSERT_RETURN(value >= CB::ENGINE_TRANSPORT_MODE_INTERNAL && value <= CB::ENGINE_TRANSPORT_MODE_BRIDGE,);
CARLA_SAFE_ASSERT_RETURN(value >= CB::ENGINE_TRANSPORT_MODE_DISABLED && value <= CB::ENGINE_TRANSPORT_MODE_BRIDGE,);
gStandalone.engineOptions.transportMode = static_cast<CB::EngineTransportMode>(value);
delete[] gStandalone.engineOptions.transportExtra;
gStandalone.engineOptions.transportExtra = (valueStr != nullptr) ? carla_strdup_safe(valueStr) : nullptr;
if (value != CB::ENGINE_TRANSPORT_MODE_DISABLED && valueStr != nullptr)
gStandalone.engineOptions.transportExtra = carla_strdup_safe(valueStr);
else
gStandalone.engineOptions.transportExtra = nullptr;
break;

case CB::ENGINE_OPTION_FORCE_STEREO:


+ 5
- 2
source/backend/engine/CarlaEngine.cpp View File

@@ -1384,11 +1384,14 @@ void CarlaEngine::setOption(const EngineOption option, const int value, const ch
break;

case ENGINE_OPTION_TRANSPORT_MODE:
CARLA_SAFE_ASSERT_RETURN(value >= ENGINE_TRANSPORT_MODE_INTERNAL && value <= ENGINE_TRANSPORT_MODE_BRIDGE,);
CARLA_SAFE_ASSERT_RETURN(value >= ENGINE_TRANSPORT_MODE_DISABLED && value <= ENGINE_TRANSPORT_MODE_BRIDGE,);
CARLA_SAFE_ASSERT_RETURN(getType() == kEngineTypeJack || value != ENGINE_TRANSPORT_MODE_JACK,);
pData->options.transportMode = static_cast<EngineTransportMode>(value);
delete[] pData->options.transportExtra;
pData->options.transportExtra = (valueStr != nullptr) ? carla_strdup_safe(valueStr) : nullptr;
if (value >= ENGINE_TRANSPORT_MODE_DISABLED && valueStr != nullptr)
pData->options.transportExtra = carla_strdup_safe(valueStr);
else
pData->options.transportExtra = nullptr;

pData->time.setNeedsReset();



+ 1
- 1
source/backend/engine/CarlaEngineJack.cpp View File

@@ -1087,7 +1087,7 @@ public:
{
if (option == ENGINE_OPTION_TRANSPORT_MODE && fClient != nullptr)
{
CARLA_SAFE_ASSERT_RETURN(value >= ENGINE_TRANSPORT_MODE_INTERNAL && value <= ENGINE_TRANSPORT_MODE_JACK,);
CARLA_SAFE_ASSERT_RETURN(value >= ENGINE_TRANSPORT_MODE_DISABLED && value <= ENGINE_TRANSPORT_MODE_JACK,);

if (value == ENGINE_TRANSPORT_MODE_JACK)
{


+ 7
- 4
source/carla_backend.py View File

@@ -836,18 +836,21 @@ ENGINE_PROCESS_MODE_BRIDGE = 4
# Engine transport mode.
# @see ENGINE_OPTION_TRANSPORT_MODE

# No transport.
ENGINE_TRANSPORT_MODE_DISABLED = 0

# Internal transport mode.
ENGINE_TRANSPORT_MODE_INTERNAL = 0
ENGINE_TRANSPORT_MODE_INTERNAL = 1

# Transport from JACK.
# Only available if driver name is "JACK".
ENGINE_TRANSPORT_MODE_JACK = 1
ENGINE_TRANSPORT_MODE_JACK = 2

# Transport from host, used when Carla is a plugin.
ENGINE_TRANSPORT_MODE_PLUGIN = 2
ENGINE_TRANSPORT_MODE_PLUGIN = 3

# Special mode, used in plugin-bridges only.
ENGINE_TRANSPORT_MODE_BRIDGE = 3
ENGINE_TRANSPORT_MODE_BRIDGE = 4

# ------------------------------------------------------------------------------------------------------------
# File Callback Opcode


+ 22
- 1
source/carla_host.py View File

@@ -789,7 +789,7 @@ class HostWindow(QMainWindow):
self.ui.act_file_save.setEnabled(canSave)
self.ui.act_engine_start.setEnabled(False)
self.ui.act_engine_stop.setEnabled(True)
self.ui.w_transport.setEnabled(True)
self.ui.w_transport.setEnabled(transportMode != ENGINE_TRANSPORT_MODE_DISABLED)

if self.host.isPlugin or not self.fSessionManagerName:
self.ui.act_file_open.setEnabled(True)
@@ -1519,6 +1519,27 @@ class HostWindow(QMainWindow):
self.ui.act_add_jack.setVisible(settings.value(CARLA_KEY_EXPERIMENTAL_JACK_APPS,
CARLA_DEFAULT_EXPERIMENTAL_JACK_APPS, type=bool))

if not (self.host.isControl or self.host.isPlugin):
if settings.value(CARLA_KEY_EXPERIMENTAL_TRANSPORT, CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT, type=bool):
if self.ui.cb_transport_jack.isChecked():
transportMode = ENGINE_TRANSPORT_MODE_JACK
else:
transportMode = ENGINE_TRANSPORT_MODE_INTERNAL
transportExtra = ":link:" if self.ui.cb_transport_link.isChecked() else ""
else:
# Stop transport if becoming disabled
if self.ui.w_transport.isEnabled() and self.host.is_engine_running():
self.host.transport_pause()
self.host.transport_relocate(0)
self.host.transport_pause()

transportMode = ENGINE_TRANSPORT_MODE_DISABLED
transportExtra = ""

self.ui.w_transport.setEnabled(transportMode != ENGINE_TRANSPORT_MODE_DISABLED)
self.host.transportMode = transportMode
self.host.set_engine_option(ENGINE_OPTION_TRANSPORT_MODE, transportMode, transportExtra)

self.fMiniCanvasUpdateTimeout = 1000 if self.fSavedSettings[CARLA_KEY_CANVAS_FANCY_EYE_CANDY] else 0

setEngineSettings(self.host)


+ 7
- 5
source/carla_settings.py View File

@@ -506,6 +506,10 @@ class CarlaSettingsW(QDialog):
# ----------------------------------------------------------------------------------------------------
# Experimental

self.ui.ch_exp_transport.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_TRANSPORT,
CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT,
type=bool))

self.ui.ch_exp_jack_apps.setChecked(settings.value(CARLA_KEY_EXPERIMENTAL_JACK_APPS,
CARLA_DEFAULT_EXPERIMENTAL_JACK_APPS,
type=bool))
@@ -667,10 +671,6 @@ class CarlaSettingsW(QDialog):
# ----------------------------------------------------------------------------------------------------
# Wine

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_WINE_EXECUTABLE, self.ui.le_wine_exec.text())
settings.setValue(CARLA_KEY_WINE_AUTO_PREFIX, self.ui.cb_wine_prefix_detect.isChecked())
settings.setValue(CARLA_KEY_WINE_FALLBACK_PREFIX, self.ui.le_wine_prefix_fallback.text())
@@ -681,7 +681,8 @@ class CarlaSettingsW(QDialog):
# ----------------------------------------------------------------------------------------------------
# Experimental

settings.setValue(CARLA_KEY_EXPERIMENTAL_JACK_APPS, self.ui.ch_exp_jack_apps.isChecked())
settings.setValue(CARLA_KEY_EXPERIMENTAL_TRANSPORT, self.ui.ch_exp_transport.isChecked())
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())

@@ -834,6 +835,7 @@ class CarlaSettingsW(QDialog):
self.ui.cb_canvas_render_hq_aa.setChecked(CARLA_DEFAULT_CANVAS_HQ_ANTIALIASING and self.ui.cb_canvas_render_hq_aa.isEnabled())
self.ui.ch_engine_force_stereo.setChecked(CARLA_DEFAULT_FORCE_STEREO)
self.ui.ch_engine_prefer_plugin_bridges.setChecked(CARLA_DEFAULT_PREFER_PLUGIN_BRIDGES)
self.ui.ch_exp_transport.setChecked(CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT)

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



+ 2
- 0
source/carla_shared.py View File

@@ -233,6 +233,7 @@ CARLA_KEY_WINE_RT_PRIO_ENABLED = "Wine/RtPrioEnabled" # bool
CARLA_KEY_WINE_BASE_RT_PRIO = "Wine/BaseRtPrio" # int
CARLA_KEY_WINE_SERVER_RT_PRIO = "Wine/ServerRtPrio" # int

CARLA_KEY_EXPERIMENTAL_TRANSPORT = "Experimental/Transport" # bool
CARLA_KEY_EXPERIMENTAL_PLUGIN_BRIDGES = "Experimental/PluginBridges" # bool
CARLA_KEY_EXPERIMENTAL_WINE_BRIDGES = "Experimental/WineBridges" # bool
CARLA_KEY_EXPERIMENTAL_JACK_APPS = "Experimental/JackApplications" # bool
@@ -305,6 +306,7 @@ CARLA_DEFAULT_WINE_BASE_RT_PRIO = 15
CARLA_DEFAULT_WINE_SERVER_RT_PRIO = 10

# Experimental
CARLA_DEFAULT_EXPERIMENTAL_TRANSPORT = False
CARLA_DEFAULT_EXPERIMENTAL_PLUGIN_BRIDGES = False
CARLA_DEFAULT_EXPERIMENTAL_WINE_BRIDGES = False
CARLA_DEFAULT_EXPERIMENTAL_JACK_APPS = False


+ 2
- 0
source/utils/CarlaBackendUtils.hpp View File

@@ -373,6 +373,8 @@ const char* EngineTransportMode2Str(const EngineTransportMode mode) noexcept
{
switch (mode)
{
case ENGINE_TRANSPORT_MODE_DISABLED:
return "ENGINE_TRANSPORT_MODE_DISABLED";
case ENGINE_TRANSPORT_MODE_INTERNAL:
return "ENGINE_TRANSPORT_MODE_INTERNAL";
case ENGINE_TRANSPORT_MODE_JACK:


Loading…
Cancel
Save