Browse Source

Implement UIsAlwaysOnTop option in backend; Enable ui-bridge option

tags/1.9.4
falkTX 12 years ago
parent
commit
d60fc69a9d
4 changed files with 61 additions and 19 deletions
  1. +0
    -3
      resources/ui/carla_settings.ui
  2. +8
    -2
      source/backend/native/distrho/DistrhoPluginCarla.cpp
  3. +9
    -2
      source/backend/plugin/CarlaPluginGui.cpp
  4. +44
    -12
      source/backend/plugin/Lv2Plugin.cpp

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

@@ -854,9 +854,6 @@ You can disable these checks to get a faster scanning time (at your own risk).</
</item> </item>
<item row="1" column="0" colspan="3"> <item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="ch_engine_prefer_ui_bridges"> <widget class="QCheckBox" name="ch_engine_prefer_ui_bridges">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Use OSC-GUI bridges when possible, this way separating the UI from DSP code</string> <string>Use OSC-GUI bridges when possible, this way separating the UI from DSP code</string>
</property> </property>


+ 8
- 2
source/backend/native/distrho/DistrhoPluginCarla.cpp View File

@@ -19,7 +19,7 @@


#include "DistrhoPluginMain.cpp" #include "DistrhoPluginMain.cpp"


#include <QtCore/Qt>
#include <QtCore/QSettings>


#if DISTRHO_PLUGIN_HAS_UI #if DISTRHO_PLUGIN_HAS_UI
# if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) # if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
@@ -52,7 +52,6 @@ public:
fUi(this, 0, editParameterCallback, setParameterCallback, setStateCallback, sendNoteCallback, uiResizeCallback) fUi(this, 0, editParameterCallback, setParameterCallback, setStateCallback, sendNoteCallback, uiResizeCallback)
#endif #endif
{ {
setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint);
#ifdef DISTRHO_UI_OPENGL #ifdef DISTRHO_UI_OPENGL
setCentralWidget(&fWidget); setCentralWidget(&fWidget);
#else #else
@@ -63,6 +62,13 @@ public:
setWindowTitle(QString("%1 (GUI)").arg(fUi.name())); setWindowTitle(QString("%1 (GUI)").arg(fUi.name()));


uiResize(fUi.width(), fUi.height()); uiResize(fUi.width(), fUi.height());

{
QSettings settings;

if (settings.value("Engine/UIsAlwaysOnTop", true).toBool())
setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint);
}
} }


~UICarla() ~UICarla()


+ 9
- 2
source/backend/plugin/CarlaPluginGui.cpp View File

@@ -17,6 +17,8 @@


#include "CarlaPluginGui.hpp" #include "CarlaPluginGui.hpp"


# include <QtCore/QSettings>

#ifdef Q_WS_X11 #ifdef Q_WS_X11
# include <QtGui/QX11EmbedContainer> # include <QtGui/QX11EmbedContainer>
#endif #endif
@@ -52,9 +54,14 @@ CarlaPluginGui::CarlaPluginGui(CarlaEngine* const engine, Callback* const callba
setWindowFlags(windowFlags()|Qt::MSWindowsFixedSizeDialogHint); setWindowFlags(windowFlags()|Qt::MSWindowsFixedSizeDialogHint);
#endif #endif


setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint);

connect(this, SIGNAL(setSizeSafeSignal(int,int)), SLOT(setSizeSafeSlot(int,int))); connect(this, SIGNAL(setSizeSafeSignal(int,int)), SLOT(setSizeSafeSlot(int,int)));

{
QSettings settings;

if (settings.value("Engine/UIsAlwaysOnTop", true).toBool())
setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint);
}
} }


CarlaPluginGui::~CarlaPluginGui() CarlaPluginGui::~CarlaPluginGui()


+ 44
- 12
source/backend/plugin/Lv2Plugin.cpp View File

@@ -3239,6 +3239,45 @@ protected:


// ------------------------------------------------------------------- // -------------------------------------------------------------------


LV2_Worker_Status handleWorkerSchedule(const uint32_t size, const void* const data)
{
carla_stdout("Lv2Plugin::handleWorkerSchedule(%i, %p)", size, data);

#if 0
if (! ext.worker)
{
carla_stderr("Lv2Plugin::handleWorkerSchedule(%i, %p) - plugin has no worker", size, data);
return LV2_WORKER_ERR_UNKNOWN;
}

if (x_engine->isOffline())
ext.worker->work(handle, carla_lv2_worker_respond, this, size, data);
else
postponeEvent(PluginPostEventCustom, size, 0, 0.0, data);
#endif

return LV2_WORKER_SUCCESS;
}

LV2_Worker_Status handleWorkerRespond(const uint32_t size, const void* const data)
{
carla_stdout("Lv2Plugin::handleWorkerRespond(%i, %p)", size, data);

#if 0
LV2_Atom_Worker workerAtom;
workerAtom.atom.type = CARLA_URI_MAP_ID_ATOM_WORKER;
workerAtom.atom.size = sizeof(LV2_Atom_Worker_Body);
workerAtom.body.size = size;
workerAtom.body.data = data;

atomQueueIn.put(0, (const LV2_Atom*)&workerAtom);
#endif

return LV2_WORKER_SUCCESS;
}

// -------------------------------------------------------------------

void handleExternalUiClosed() void handleExternalUiClosed()
{ {
CARLA_ASSERT(fUi.type == PLUGIN_UI_EXTERNAL); CARLA_ASSERT(fUi.type == PLUGIN_UI_EXTERNAL);
@@ -3595,6 +3634,9 @@ public:
fFeatures[kFeatureIdWorker]->URI = LV2_WORKER__schedule; fFeatures[kFeatureIdWorker]->URI = LV2_WORKER__schedule;
fFeatures[kFeatureIdWorker]->data = workerFt; fFeatures[kFeatureIdWorker]->data = workerFt;


if (! needsFixedBuffer())
fFeatures[kFeatureIdBufSizeFixed]->URI = LV2_BUF_SIZE__boundedBlockLength;

// --------------------------------------------------------------- // ---------------------------------------------------------------
// get DLL main entry // get DLL main entry


@@ -4475,12 +4517,7 @@ private:
if (handle == nullptr) if (handle == nullptr)
return LV2_WORKER_ERR_UNKNOWN; return LV2_WORKER_ERR_UNKNOWN;


//return ((Lv2Plugin*)handle)->handleWorkerSchedule(size, data);
return LV2_WORKER_ERR_UNKNOWN;

// todo
(void)size;
(void)data;
return ((Lv2Plugin*)handle)->handleWorkerSchedule(size, data);
} }


static LV2_Worker_Status carla_lv2_worker_respond(LV2_Worker_Respond_Handle handle, uint32_t size, const void* data) static LV2_Worker_Status carla_lv2_worker_respond(LV2_Worker_Respond_Handle handle, uint32_t size, const void* data)
@@ -4491,12 +4528,7 @@ private:
if (handle == nullptr) if (handle == nullptr)
return LV2_WORKER_ERR_UNKNOWN; return LV2_WORKER_ERR_UNKNOWN;


//return ((Lv2Plugin*)handle)->handleWorkerRespond(size, data);
return LV2_WORKER_ERR_UNKNOWN;

// todo
(void)size;
(void)data;
return ((Lv2Plugin*)handle)->handleWorkerRespond(size, data);
} }


// ------------------------------------------------------------------- // -------------------------------------------------------------------


Loading…
Cancel
Save