Browse Source

Release JACK timebase master when disabling jack transport sync

Fixes #525
tags/1.9.8
falkTX 7 years ago
parent
commit
90da8601f5
2 changed files with 25 additions and 2 deletions
  1. +1
    -1
      source/backend/CarlaEngine.hpp
  2. +24
    -1
      source/backend/engine/CarlaEngineJack.cpp

+ 1
- 1
source/backend/CarlaEngine.hpp View File

@@ -1041,7 +1041,7 @@ public:
/*!
* Set the engine option @a option to @a value or @a valueStr.
*/
void setOption(const EngineOption option, const int value, const char* const valueStr) noexcept;
virtual void setOption(const EngineOption option, const int value, const char* const valueStr) noexcept;

// -------------------------------------------------------------------
// OSC Stuff


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

@@ -949,7 +949,8 @@ public:
jackbridge_set_process_callback(fClient, carla_jack_process_callback, this);
jackbridge_on_shutdown(fClient, carla_jack_shutdown_callback, this);

fTimebaseMaster = jackbridge_set_timebase_callback(fClient, true, carla_jack_timebase_callback, this);
if (pData->options.transportMode == ENGINE_TRANSPORT_MODE_JACK)
fTimebaseMaster = jackbridge_set_timebase_callback(fClient, true, carla_jack_timebase_callback, this);

if (pData->options.processMode != ENGINE_PROCESS_MODE_PATCHBAY)
initJackPatchbay(jackClientName);
@@ -1081,6 +1082,28 @@ public:
return "JACK";
}

#ifndef BUILD_BRIDGE
void setOption(const EngineOption option, const int value, const char* const valueStr) noexcept override
{
if (option == ENGINE_OPTION_TRANSPORT_MODE && fClient != nullptr)
{
CARLA_SAFE_ASSERT_RETURN(value >= ENGINE_TRANSPORT_MODE_INTERNAL && value <= ENGINE_TRANSPORT_MODE_JACK,);

if (value == ENGINE_TRANSPORT_MODE_JACK)
{
fTimebaseMaster = jackbridge_set_timebase_callback(fClient, true, carla_jack_timebase_callback, this);
}
else
{
jackbridge_release_timebase(fClient);
fTimebaseMaster = false;
}
}

CarlaEngine::setOption(option, value, valueStr);
}
#endif

CarlaEngineClient* addClient(CarlaPlugin* const plugin) override
{
jack_client_t* client = nullptr;


Loading…
Cancel
Save