Browse Source

Update external-ui to new header file (taken by KXStudio project)

tags/v0.9.0
falkTX 13 years ago
parent
commit
b010d62158
4 changed files with 53 additions and 53 deletions
  1. +6
    -7
      c++/carla-backend/lv2.cpp
  2. +3
    -3
      c++/carla-includes/carla_lv2.h
  3. +43
    -42
      c++/carla-includes/lv2/lv2_external_ui.h
  4. +1
    -1
      c++/carla-includes/lv2/lv2_programs.h

+ 6
- 7
c++/carla-backend/lv2.cpp View File

@@ -48,7 +48,6 @@ CARLA_BACKEND_START_NAMESPACE
const unsigned int MAX_EVENT_BUFFER = 8192; // 0x2000
//const unsigned int MAX_EVENT_BUFFER = (sizeof(LV2_Atom_Event) + 4) * MAX_MIDI_EVENTS;


/*!
* @defgroup PluginHints Plugin Hints
* @{
@@ -361,7 +360,7 @@ public:

if (features[lv2_feature_id_external_ui] && features[lv2_feature_id_external_ui]->data)
{
const lv2_external_ui_host* const uiHost = (const lv2_external_ui_host*)features[lv2_feature_id_external_ui]->data;
const LV2_External_UI_Host* const uiHost = (const LV2_External_UI_Host*)features[lv2_feature_id_external_ui]->data;

if (uiHost->plugin_human_id)
free((void*)uiHost->plugin_human_id);
@@ -948,11 +947,11 @@ public:
{
if (yesNo)
{
LV2_EXTERNAL_UI_SHOW((lv2_external_ui*)ui.widget);
LV2_EXTERNAL_UI_SHOW((LV2_External_UI_Widget*)ui.widget);
}
else
{
LV2_EXTERNAL_UI_HIDE((lv2_external_ui*)ui.widget);
LV2_EXTERNAL_UI_HIDE((LV2_External_UI_Widget*)ui.widget);

if (rdf_descriptor->Author && strcmp(rdf_descriptor->Author, "linuxDSP") == 0)
{
@@ -1022,7 +1021,7 @@ public:
{
// Update external UI
if (gui.type == GUI_EXTERNAL_LV2 && ui.handle && ui.descriptor && ui.widget)
LV2_EXTERNAL_UI_RUN((lv2_external_ui*)ui.widget);
LV2_EXTERNAL_UI_RUN((LV2_External_UI_Widget*)ui.widget);

CarlaPlugin::idleGui();
}
@@ -4102,7 +4101,7 @@ public:
uiResizeFt->handle = this;
uiResizeFt->ui_resize = carla_lv2_ui_resize;

lv2_external_ui_host* const uiExternalHostFt = new lv2_external_ui_host;
LV2_External_UI_Host* const uiExternalHostFt = new LV2_External_UI_Host;
uiExternalHostFt->ui_closed = carla_lv2_external_ui_closed;
uiExternalHostFt->plugin_human_id = strdup(guiTitle.toUtf8().constData());

@@ -4127,7 +4126,7 @@ public:
features[lv2_feature_id_ui_resize]->data = uiResizeFt;

features[lv2_feature_id_external_ui] = new LV2_Feature;
features[lv2_feature_id_external_ui]->URI = LV2_EXTERNAL_UI_URI;
features[lv2_feature_id_external_ui]->URI = LV2_EXTERNAL_UI__Host;
features[lv2_feature_id_external_ui]->data = uiExternalHostFt;

features[lv2_feature_id_external_ui_old] = new LV2_Feature;


+ 3
- 3
c++/carla-includes/carla_lv2.h View File

@@ -158,7 +158,7 @@ public:
ui_cocoa (new_uri(LV2_UI__CocoaUI)),
ui_windows (new_uri(LV2_UI__WindowsUI)),
ui_x11 (new_uri(LV2_UI__X11UI)),
ui_external (new_uri(LV2_EXTERNAL_UI_URI)),
ui_external (new_uri(LV2_EXTERNAL_UI__Widget)),
ui_external_old (new_uri(LV2_EXTERNAL_UI_DEPRECATED_URI)),

preset_preset (new_uri(LV2_PRESETS__Preset)),
@@ -1500,7 +1500,7 @@ bool is_lv2_ui_feature_supported(const LV2_URI uri)
return true;
if (strcmp(uri, LV2_UI__touch) == 0)
return false; // TODO
if (strcmp(uri, LV2_EXTERNAL_UI_URI) == 0)
if (strcmp(uri, LV2_EXTERNAL_UI__Widget) == 0)
return true;
if (strcmp(uri, LV2_EXTERNAL_UI_DEPRECATED_URI) == 0)
return true;
@@ -1525,7 +1525,7 @@ LV2_URI get_lv2_ui_uri(const LV2_Property type)
case LV2_UI_X11:
return LV2_UI__X11UI;
case LV2_UI_EXTERNAL:
return LV2_EXTERNAL_UI_URI;
return LV2_EXTERNAL_UI__Widget;
case LV2_UI_OLD_EXTERNAL:
return LV2_EXTERNAL_UI_DEPRECATED_URI;
default:


+ 43
- 42
c++/carla-includes/lv2/lv2_external_ui.h View File

@@ -1,22 +1,30 @@
/* -*- Mode: C ; c-basic-offset: 2 -*- */
/*****************************************************************************
*
* This work is in public domain.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* If you have questions, contact Nedko Arnaudov <nedko@arnaudov.name> or
* ask in #lad channel, FreeNode IRC network.
*
*****************************************************************************/

#ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED
#define LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED

/** UI extension suitable for out-of-process UIs */
#define LV2_EXTERNAL_UI_URI "http://nedko.arnaudov.name/lv2/external_ui/"
/*
LV2 External UI extension
This work is in public domain.

This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you have questions, contact Filipe Coelho (aka falkTX) <falktx@falktx.com>
or ask in #lad channel, FreeNode IRC network.
*/

/**
@file lv2_external_ui.h
C header for the LV2 External UI extension <http://kxstudio.sf.net/ns/lv2ext/external-ui>.
*/

#ifndef LV2_EXTERNAL_UI_H
#define LV2_EXTERNAL_UI_H

#include "ui.h"

#define LV2_EXTERNAL_UI_URI "http://kxstudio.sf.net/ns/lv2ext/external-ui"
#define LV2_EXTERNAL_UI_PREFIX LV2_EXTERNAL_UI_URI "#"

#define LV2_EXTERNAL_UI__Host LV2_EXTERNAL_UI_PREFIX "Host"
#define LV2_EXTERNAL_UI__Widget LV2_EXTERNAL_UI_PREFIX "Widget"

/** This extension used to be defined by a lv2plug.in URI */
#define LV2_EXTERNAL_UI_DEPRECATED_URI "http://lv2plug.in/ns/extensions/ui#external"
@@ -24,53 +32,49 @@
#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* Adjust editor indent */
#endif

/**
* When LV2_EXTERNAL_UI_URI UI is instantiated, the returned
* LV2UI_Widget handle must be cast to pointer to struct lv2_external_ui.
* When LV2_EXTERNAL_UI__Widget UI is instantiated, the returned
* LV2UI_Widget handle must be cast to pointer to LV2_External_UI_Widget.
* UI is created in invisible state.
*/
struct lv2_external_ui
{
typedef struct _LV2_External_UI_Widget {
/**
* Host calls this function regulary. UI library implementing the
* callback may do IPC or redraw the UI.
*
* @param _this_ the UI context
*/
void (* run)(struct lv2_external_ui * _this_);
void (*run)(struct _LV2_External_UI_Widget * _this_);

/**
* Host calls this function to make the plugin UI visible.
*
* @param _this_ the UI context
*/
void (* show)(struct lv2_external_ui * _this_);
void (*show)(struct _LV2_External_UI_Widget * _this_);

/**
* Host calls this function to make the plugin UI invisible again.
*
* @param _this_ the UI context
*/
void (* hide)(struct lv2_external_ui * _this_);
};
void (*hide)(struct _LV2_External_UI_Widget * _this_);
} LV2_External_UI_Widget;

#define LV2_EXTERNAL_UI_RUN(ptr) (ptr)->run(ptr)
#define LV2_EXTERNAL_UI_RUN(ptr) (ptr)->run(ptr)
#define LV2_EXTERNAL_UI_SHOW(ptr) (ptr)->show(ptr)
#define LV2_EXTERNAL_UI_HIDE(ptr) (ptr)->hide(ptr)

/**
* On UI instantiation, host must supply LV2_EXTERNAL_UI_URI
* feature. LV2_Feature::data must be pointer to struct lv2_external_ui_host. */
struct lv2_external_ui_host
{
* On UI instantiation, host must supply LV2_EXTERNAL_UI__Host feature.
* LV2_Feature::data must be pointer to LV2_External_UI_Host.
*/
typedef struct _LV2_External_UI_Host {
/**
* Callback that plugin UI will call
* when UI (GUI window) is closed by user.
* This callback wil; be called during execution of lv2_external_ui::run()
* This callback will be called during execution of LV2_External_UI_Widget::run()
* (i.e. not from background thread).
*
* After this callback is called, UI is defunct. Host must call
@@ -80,7 +84,7 @@ struct lv2_external_ui_host
* @param controller Host context associated with plugin UI, as
* supplied to LV2UI_Descriptor::instantiate()
*/
void (* ui_closed)(LV2UI_Controller controller);
void (*ui_closed)(LV2UI_Controller controller);

/**
* Optional (may be NULL) "user friendly" identifier which the UI
@@ -92,13 +96,10 @@ struct lv2_external_ui_host
* LV2UI_Descriptor::instantiate()
*/
const char * plugin_human_id;
};
} LV2_External_UI_Host;

#if 0
{ /* Adjust editor indent */
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* #ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED */
#endif /* LV2_EXTERNAL_UI_H */

+ 1
- 1
c++/carla-includes/lv2/lv2_programs.h View File

@@ -16,7 +16,7 @@
*/

/**
@file programs.h
@file lv2_programs.h
C header for the LV2 programs extension <http://kxstudio.sf.net/ns/lv2ext/programs>.
*/



Loading…
Cancel
Save