[SCM] juce/master: Fixed LV2_wrapper

umlaeute at users.alioth.debian.org umlaeute at users.alioth.debian.org
Fri Nov 4 22:12:04 UTC 2016


The following commit has been merged in the master branch:
commit 011bd6fd71db1713a8a91aff4be216d78c6fa53f
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date:   Fri Nov 4 22:01:19 2016 +0100

    Fixed LV2_wrapper
    
    - use system-provided headers (lv2-dev)
    - provide headers missing from lv2-dev
    - fix relative includes

diff --git a/debian/extra/includes/lv2_external_ui.h b/debian/extra/includes/lv2_external_ui.h
new file mode 100644
index 0000000..789cd3f
--- /dev/null
+++ b/debian/extra/includes/lv2_external_ui.h
@@ -0,0 +1,109 @@
+/*
+  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 at 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"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * 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.
+ */
+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_Widget * _this_);
+
+  /**
+   * Host calls this function to make the plugin UI visible.
+   *
+   * @param _this_ the UI context
+   */
+  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_Widget * _this_);
+
+} LV2_External_UI_Widget;
+
+#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__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 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 LV2UI_Descriptor::cleanup().
+   * If host wants to make the UI visible again, the UI must be reinstantiated.
+   *
+   * @note When using the depreated URI LV2_EXTERNAL_UI_DEPRECATED_URI,
+   *       some hosts will not call LV2UI_Descriptor::cleanup() as they should,
+   *       and may call show() again without re-initialization.
+   *
+   * @param controller Host context associated with plugin UI, as
+   *                   supplied to LV2UI_Descriptor::instantiate().
+   */
+  void (*ui_closed)(LV2UI_Controller controller);
+
+  /**
+   * Optional (may be NULL) "user friendly" identifier which the UI
+   * may display to allow a user to easily associate this particular
+   * UI instance with the correct plugin instance as it is represented
+   * by the host (e.g. "track 1" or "channel 4").
+   *
+   * If supplied by host, the string will be referenced only during
+   * LV2UI_Descriptor::instantiate()
+   */
+  const char * plugin_human_id;
+
+} LV2_External_UI_Host;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* LV2_EXTERNAL_UI_H */
diff --git a/debian/extra/includes/lv2_programs.h b/debian/extra/includes/lv2_programs.h
new file mode 100644
index 0000000..01e2877
--- /dev/null
+++ b/debian/extra/includes/lv2_programs.h
@@ -0,0 +1,174 @@
+/*
+  LV2 Programs Extension
+  Copyright 2012 Filipe Coelho <falktx at falktx.com>
+
+  Permission to use, copy, modify, and/or distribute this software for any
+  purpose with or without fee is hereby granted, provided that the above
+  copyright notice and this permission notice appear in all copies.
+
+  THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+/**
+   @file lv2_programs.h
+   C header for the LV2 programs extension <http://kxstudio.sf.net/ns/lv2ext/programs>.
+*/
+
+#ifndef LV2_PROGRAMS_H
+#define LV2_PROGRAMS_H
+
+#include "lv2.h"
+#include "ui.h"
+
+#define LV2_PROGRAMS_URI    "http://kxstudio.sf.net/ns/lv2ext/programs"
+#define LV2_PROGRAMS_PREFIX LV2_PROGRAMS_URI "#"
+
+#define LV2_PROGRAMS__Host        LV2_PROGRAMS_PREFIX "Host"
+#define LV2_PROGRAMS__Interface   LV2_PROGRAMS_PREFIX "Interface"
+#define LV2_PROGRAMS__UIInterface LV2_PROGRAMS_PREFIX "UIInterface"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void* LV2_Programs_Handle;
+
+typedef struct _LV2_Program_Descriptor {
+
+    /** Bank number for this program. Note that this extension does not
+        support MIDI-style separation of bank LSB and MSB values. There is
+        no restriction on the set of available banks: the numbers do not
+        need to be contiguous, there does not need to be a bank 0, etc. */
+    uint32_t bank;
+
+    /** Program number (unique within its bank) for this program. There is
+        no restriction on the set of available programs: the numbers do not
+        need to be contiguous, there does not need to be a program 0, etc. */
+    uint32_t program;
+
+    /** Name of the program. */
+    const char * name;
+
+} LV2_Program_Descriptor;
+
+/**
+   Programs extension, plugin data.
+
+   When the plugin's extension_data is called with argument LV2_PROGRAMS__Interface,
+   the plugin MUST return an LV2_Programs_Instance structure, which remains valid
+   for the lifetime of the plugin.
+*/
+typedef struct _LV2_Programs_Interface {
+    /**
+     * get_program()
+     *
+     * This member is a function pointer that provides a description
+     * of a program (named preset sound) available on this plugin.
+     *
+     * The index argument is an index into the plugin's list of
+     * programs, not a program number as represented by the Program
+     * field of the LV2_Program_Descriptor. (This distinction is
+     * needed to support plugins that use non-contiguous program or
+     * bank numbers.)
+     *
+     * This function returns a LV2_Program_Descriptor pointer that is
+     * guaranteed to be valid only until the next call to get_program
+     * or deactivate, on the same plugin instance. This function must
+     * return NULL if passed an index argument out of range, so that
+     * the host can use it to query the number of programs as well as
+     * their properties.
+     */
+    const LV2_Program_Descriptor *(*get_program)(LV2_Handle handle,
+                                                 uint32_t index);
+
+    /**
+     * select_program()
+     *
+     * This member is a function pointer that selects a new program
+     * for this plugin. The program change should take effect
+     * immediately at the start of the next run() call. (This
+     * means that a host providing the capability of changing programs
+     * between any two notes on a track must vary the block size so as
+     * to place the program change at the right place. A host that
+     * wanted to avoid this would probably just instantiate a plugin
+     * for each program.)
+     *
+     * Plugins should ignore a select_program() call with an invalid
+     * bank or program.
+     *
+     * A plugin is not required to select any particular default
+     * program on activate(): it's the host's duty to set a program
+     * explicitly.
+     *
+     * A plugin is permitted to re-write the values of its input
+     * control ports when select_program is called. The host should
+     * re-read the input control port values and update its own
+     * records appropriately. (This is the only circumstance in which
+     * a LV2 plugin is allowed to modify its own control-input ports.)
+     */
+    void (*select_program)(LV2_Handle handle,
+                           uint32_t bank,
+                           uint32_t program);
+
+} LV2_Programs_Interface;
+
+/**
+   Programs extension, UI data.
+
+   When the UI's extension_data is called with argument LV2_PROGRAMS__UIInterface,
+   the UI MUST return an LV2_Programs_UI_Interface structure, which remains valid
+   for the lifetime of the UI.
+*/
+typedef struct _LV2_Programs_UI_Interface {
+    /**
+     * select_program()
+     *
+     * This is exactly the same as select_program in LV2_Programs_Instance,
+     * but this struct relates to the UI instead of the plugin.
+     *
+     * When called, UIs should update their state to match the selected program.
+     */
+    void (*select_program)(LV2UI_Handle handle,
+                           uint32_t bank,
+                           uint32_t program);
+
+} LV2_Programs_UI_Interface;
+
+/**
+    Feature data for LV2_PROGRAMS__Host.
+*/
+typedef struct _LV2_Programs_Host {
+    /**
+     *  Opaque host data.
+     */
+    LV2_Programs_Handle handle;
+
+    /**
+     * program_changed()
+     *
+     * Tell the host to reload a plugin's program.
+     * Parameter handle MUST be the 'handle' member of this struct.
+     * Parameter index is program index to change.
+     * When index is -1, host should reload all the programs.
+     *
+     * The plugin MUST NEVER call this function on a RT context or during run().
+     *
+     * NOTE: This call is to inform the host about a program's bank, program or name change.
+     *       It DOES NOT change the current selected program.
+     */
+    void (*program_changed)(LV2_Programs_Handle handle,
+                            int32_t index);
+
+} LV2_Programs_Host;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* LV2_PROGRAMS_H */
diff --git a/debian/extra/juce_LV2_Wrapper.cpp b/debian/extra/juce_LV2_Wrapper.cpp
index 273bf1b..f8441ad 100644
--- a/debian/extra/juce_LV2_Wrapper.cpp
+++ b/debian/extra/juce_LV2_Wrapper.cpp
@@ -55,23 +55,23 @@
 #include <iostream>
 
 // LV2 includes..
-#include "includes/lv2.h"
-#include "includes/atom.h"
-#include "includes/atom-util.h"
-#include "includes/buf-size.h"
-#include "includes/instance-access.h"
-#include "includes/midi.h"
-#include "includes/options.h"
-#include "includes/port-props.h"
-#include "includes/presets.h"
-#include "includes/state.h"
-#include "includes/time.h"
-#include "includes/ui.h"
-#include "includes/urid.h"
+#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+#include <lv2/lv2plug.in/ns/ext/atom/util.h>
+#include <lv2/lv2plug.in/ns/ext/buf-size/buf-size.h>
+#include <lv2/lv2plug.in/ns/ext/instance-access/instance-access.h>
+#include <lv2/lv2plug.in/ns/ext/midi/midi.h>
+#include <lv2/lv2plug.in/ns/ext/options/options.h>
+#include <lv2/lv2plug.in/ns/ext/port-props/port-props.h>
+#include <lv2/lv2plug.in/ns/ext/presets/presets.h>
+#include <lv2/lv2plug.in/ns/ext/state/state.h>
+#include <lv2/lv2plug.in/ns/ext/time/time.h>
+#include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
+#include <lv2/lv2plug.in/ns/ext/urid/urid.h>
 #include "includes/lv2_external_ui.h"
 #include "includes/lv2_programs.h"
 
-#include "../utility/juce_IncludeModuleHeaders.h"
+#include "juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h"
 
 namespace juce
 {

-- 
juce packaging



More information about the pkg-multimedia-commits mailing list