Commit f18ac20e authored by Hanspeter Portner's avatar Hanspeter Portner

prototype sandbox_ui.

parent a0a9843b
......@@ -6,15 +6,30 @@ os:
- linux
compiler:
- gcc
- clang
# - clang
before_install:
- wget http://lv2plug.in/spec/lv2-1.12.0.tar.bz2
- tar xjf lv2-1.12.0.tar.bz2
- wget http://download.drobilla.net/serd-0.22.0.tar.bz2
- wget http://download.drobilla.net/sord-0.14.0.tar.bz2
- wget http://download.drobilla.net/sratom-0.4.6.tar.bz2
- wget http://download.drobilla.net/lilv-0.22.0.tar.bz2
- wget https://github.com/nanomsg/nanomsg/releases/download/0.8-beta/nanomsg-0.8-beta.tar.gz
- tar xjf lv2-1.12.0.tar.bz2
- tar xjf serd-0.22.0.tar.bz2
- tar xjf sord-0.14.0.tar.bz2
- tar xjf sratom-0.4.6.tar.bz2
- tar xjf lilv-0.22.0.tar.bz2
- tar xzf nanomsg-0.8-beta.tar.gz
- sudo add-apt-repository -y ppa:enlightenment-git/ppa
- sudo apt-get -q update
install:
- sudo apt-get install -y libefl-dev
- pushd lv2-1.12.0 && ./waf configure --no-plugins --prefix=/usr && ./waf build && sudo ./waf install && popd
- pushd serd-0.22.0 && ./waf configure --no-utils --prefix=/usr && ./waf build && sudo ./waf install && popd
- pushd sord-0.14.0 && ./waf configure --no-utils --prefix=/usr && ./waf build && sudo ./waf install && popd
- pushd sratom-0.4.6 && ./waf configure --prefix=/usr && ./waf build && sudo ./waf install && popd
- pushd lilv-0.22.0 && ./waf configure --no-utils --prefix=/usr && ./waf build && sudo ./waf install && popd
- pushd nanomsg-0.8-beta && ./configure --prefix=/usr && make && sudo make install && popd
before_script:
- mkdir build && pushd build && cmake .. && popd
script:
......
......@@ -4,8 +4,10 @@ project(sherlock.lv2)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/libosc)
include_directories(${PROJECT_SOURCE_DIR}/eo_ui.lv2)
include_directories(${PROJECT_SOURCE_DIR}/osc.lv2)
include_directories(${PROJECT_SOURCE_DIR}/ext_ui.lv2)
include_directories(${PROJECT_SOURCE_DIR}/sandbox_ui.lv2)
include_directories(${PROJECT_SOURCE_DIR}/symap)
set(CMAKE_C_FLAGS "-std=gnu11 -Wextra -Wno-unused-parameter -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
......@@ -24,21 +26,20 @@ find_package(PkgConfig) # ${PKG_CONFIG_FOUND}
pkg_search_module(LV2 REQUIRED lv2>=1.10)
include_directories(${LV2_INCLUDE_DIRS})
set(LIBS ${LIBS} ${LV2_LDFLAGS})
pkg_search_module(ELM REQUIRED elementary>=1.8)
include_directories(${ELM_INCLUDE_DIRS})
set(LIBS_UI ${LIBS_UI} ${ELM_LDFLAGS})
pkg_search_module(ECORE_X OPTIONAL ecore-x)
pkg_search_module(NANOMSG REQUIRED libnanomsg>=2.0)
include_directories(${NANOMSG_INCLUDE_DIRS})
if((DEFINED ECORE_X_FOUND) AND ((${ELM_VERSION} VERSION_EQUAL "1.13.0") OR (${ELM_VERSION} VERSION_GREATER "1.13.0")))
message(STATUS "X11 UI wrap enabled")
set(X11_UI_WRAP "")
add_definitions("-DX11_UI_WRAP")
else()
message(STATUS "X11 UI wrap disabled")
set(X11_UI_WRAP "#")
pkg_search_module(SRATOM REQUIRED sratom-0>=0.4.0)
include_directories(${SRATOM_INCLUDE_DIRS})
pkg_search_module(LILV REQUIRED lilv-0>=0.20.0)
include_directories(${LILV_INCLUDE_DIRS})
if((${LILV_VERSION} VERSION_EQUAL "0.22.0") OR (${LILV_VERSION} VERSION_GREATER "0.22.0"))
add_definitions("-DLILV_0_22")
endif()
add_library(sherlock MODULE
......@@ -46,20 +47,41 @@ add_library(sherlock MODULE
atom_inspector.c
midi_inspector.c
osc_inspector.c)
target_link_libraries(sherlock ${LIBS})
set_target_properties(sherlock PROPERTIES PREFIX "")
install(TARGETS sherlock DESTINATION ${DEST})
add_library(sherlock_ui MODULE
sherlock_ui.c
atom_inspector_ui.c
midi_inspector_ui.c
osc_inspector_ui.c)
target_link_libraries(sherlock_ui ${LIBS_UI})
${PROJECT_SOURCE_DIR}/sandbox_ui.lv2/sandbox_master.c
sherlock_ui.c)
target_link_libraries(sherlock_ui
${NANOMSG_LDFLAGS}
${SRATOM_LDFLAGS})
set_target_properties(sherlock_ui PROPERTIES PREFIX "")
install(TARGETS sherlock_ui DESTINATION ${DEST})
add_library(sherlock_eo MODULE
sherlock_eo.c
atom_inspector_eo.c
midi_inspector_eo.c
osc_inspector_eo.c)
target_link_libraries(sherlock_eo
${ELM_LDFLAGS})
set_target_properties(sherlock_eo PROPERTIES PREFIX "")
install(TARGETS sherlock_eo DESTINATION ${DEST})
add_executable(sandbox_efl
${PROJECT_SOURCE_DIR}/sandbox_ui.lv2/sandbox_slave.c
${PROJECT_SOURCE_DIR}/sandbox_ui.lv2/sandbox_efl.c
${PROJECT_SOURCE_DIR}/symap/symap.c)
target_link_libraries(sandbox_efl
${ELM_LDFLAGS}
${NANOMSG_LDFLAGS}
${LILV_LDFLAGS}
dl)
install(TARGETS sandbox_efl DESTINATION ${DEST})
configure_file(${PROJECT_SOURCE_DIR}/manifest.ttl.in ${PROJECT_BINARY_DIR}/manifest.ttl)
install(FILES ${PROJECT_BINARY_DIR}/manifest.ttl DESTINATION ${DEST})
install(FILES ${PROJECT_SOURCE_DIR}/sherlock.ttl DESTINATION ${DEST})
install(FILES ${PROJECT_SOURCE_DIR}/sherlock_ui.ttl DESTINATION ${DEST})
install(FILES ${PROJECT_SOURCE_DIR}/omk_logo_256x256.png DESTINATION ${DEST})
......@@ -19,7 +19,7 @@
#include <sherlock.h>
#include <lv2_eo_ui.h>
#include <Elementary.h>
#define COUNT_MAX 2048 // maximal amount of events shown
#define STRING_BUF_SIZE 2048
......@@ -38,8 +38,6 @@
typedef struct _UI UI;
struct _UI {
eo_ui_t eoui;
LV2UI_Write_Function write_function;
LV2UI_Controller controller;
......@@ -64,6 +62,7 @@ struct _UI {
LV2_Atom_Forge forge;
Evas_Object *widget;
Evas_Object *table;
Evas_Object *list;
Evas_Object *info;
......@@ -861,16 +860,34 @@ _info_clicked(void *data, Evas_Object *obj, void *event_info)
}
}
static Evas_Object *
_content_get(eo_ui_t *eoui)
static void
_content_free(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UI *ui = (void *)eoui - offsetof(UI, eoui);
UI *ui = data;
ui->table = elm_table_add(eoui->win);
ui->widget = NULL;
}
static void
_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UI *ui = data;
evas_object_del(ui->widget);
}
static Evas_Object *
_content_get(UI *ui, Evas_Object *parent)
{
ui->table = elm_table_add(parent);
if(ui->table)
{
elm_table_homogeneous_set(ui->table, EINA_FALSE);
elm_table_padding_set(ui->table, 0, 0);
evas_object_size_hint_min_set(ui->table, 1280, 720);
evas_object_event_callback_add(ui->table, EVAS_CALLBACK_FREE, _content_free, ui);
evas_object_event_callback_add(ui->table, EVAS_CALLBACK_DEL, _content_del, ui);
Evas_Object *panes = elm_panes_add(ui->table);
if(panes)
......@@ -1033,37 +1050,22 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
if(strcmp(plugin_uri, SHERLOCK_ATOM_INSPECTOR_URI))
return NULL;
eo_ui_driver_t driver;
if(descriptor == &atom_inspector_eo)
driver = EO_UI_DRIVER_EO;
else if(descriptor == &atom_inspector_ui)
driver = EO_UI_DRIVER_UI;
else if(descriptor == &atom_inspector_x11)
driver = EO_UI_DRIVER_X11;
else if(descriptor == &atom_inspector_kx)
driver = EO_UI_DRIVER_KX;
else
return NULL;
UI *ui = calloc(1, sizeof(UI));
if(!ui)
return NULL;
eo_ui_t *eoui = &ui->eoui;
eoui->driver = driver;
eoui->content_get = _content_get;
eoui->w = 1280,
eoui->h = 720;
ui->write_function = write_function;
ui->controller = controller;
Evas_Object *parent = NULL;
for(int i=0; features[i]; i++)
{
if(!strcmp(features[i]->URI, LV2_URID__map))
ui->map = (LV2_URID_Map *)features[i]->data;
ui->map = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__unmap))
ui->unmap = (LV2_URID_Unmap *)features[i]->data;
ui->unmap = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_UI__parent))
parent = features[i]->data;
}
if(!ui->map || !ui->unmap)
......@@ -1072,6 +1074,11 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
free(ui);
return NULL;
}
if(!parent)
{
free(ui);
return NULL;
}
lv2_atom_forge_init(&ui->forge, ui->map);
......@@ -1148,13 +1155,6 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
sprintf(ui->string_buf, "%s/omk_logo_256x256.png", bundle_path);
ui->logo_path = strdup(ui->string_buf);
if(eoui_instantiate(eoui, descriptor, plugin_uri, bundle_path, write_function,
controller, widget, features))
{
free(ui);
return NULL;
}
ui->uris.midi_MidiEvent = ui->map->map(ui->map->handle, LV2_MIDI__MidiEvent);
ui->uris.event_transfer = ui->map->map(ui->map->handle, LV2_ATOM__eventTransfer);
......@@ -1205,6 +1205,14 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
_hash_set(ui, ui->uris.time_framesPerSecond);
_hash_set(ui, ui->uris.time_speed);
ui->widget = _content_get(ui, parent);
if(!ui->widget)
{
free(ui);
return NULL;
}
*(Evas_Object **)widget = ui->widget;
return ui;
}
......@@ -1213,8 +1221,8 @@ cleanup(LV2UI_Handle handle)
{
UI *ui = handle;
eoui_cleanup(&ui->eoui);
if(ui->widget)
evas_object_del(ui->widget);
if(ui->logo_path)
free(ui->logo_path);
......@@ -1313,29 +1321,5 @@ const LV2UI_Descriptor atom_inspector_eo = {
.instantiate = instantiate,
.cleanup = cleanup,
.port_event = port_event,
.extension_data = eoui_eo_extension_data
};
const LV2UI_Descriptor atom_inspector_ui = {
.URI = SHERLOCK_ATOM_INSPECTOR_UI_URI,
.instantiate = instantiate,
.cleanup = cleanup,
.port_event = port_event,
.extension_data = eoui_ui_extension_data
};
const LV2UI_Descriptor atom_inspector_x11 = {
.URI = SHERLOCK_ATOM_INSPECTOR_X11_URI,
.instantiate = instantiate,
.cleanup = cleanup,
.port_event = port_event,
.extension_data = eoui_x11_extension_data
};
const LV2UI_Descriptor atom_inspector_kx = {
.URI = SHERLOCK_ATOM_INSPECTOR_KX_URI,
.instantiate = instantiate,
.cleanup = cleanup,
.port_event = port_event,
.extension_data = eoui_kx_extension_data
.extension_data = NULL
};
cmake_minimum_required(VERSION 2.8)
project(eo.lv2)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
set(CMAKE_C_FLAGS "-std=gnu99 -Wextra -Wno-unused-parameter -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}")
add_definitions("-D_GNU_SOURCE=1") # asprintf
set(EO_MAJOR_VERSION 0)
set(EO_MINOR_VERSION 1)
set(EO_MICRO_VERSION 1)
set(DEST lib/lv2/eo.lv2)
find_package(PkgConfig) # ${PKG_CONFIG_FOUND}
# eo
add_library(eo MODULE
test/eo.c)
target_link_libraries(eo ${LIBS})
set_target_properties(eo PROPERTIES PREFIX "")
install(TARGETS eo DESTINATION ${DEST})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/test/eo.ttl DESTINATION ${DEST})
# manifest
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/manifest.ttl.in ${PROJECT_BINARY_DIR}/manifest.ttl)
install(FILES ${PROJECT_BINARY_DIR}/manifest.ttl DESTINATION ${DEST})
pkg_search_module(ELM REQUIRED elementary>=1.8)
include_directories(${ELM_INCLUDE_DIRS})
set(LIBS_UI ${LIBS_UI} ${ELM_LDFLAGS})
pkg_search_module(ECORE_X OPTIONAL ecore-x)
if((${ELM_VERSION} VERSION_EQUAL "1.9.0") OR (${ELM_VERSION} VERSION_GREATER "1.9.0"))
add_definitions("-DELM_1_9")
endif()
if((DEFINED ECORE_X_FOUND) AND ((${ELM_VERSION} VERSION_EQUAL "1.13.0") OR (${ELM_VERSION} VERSION_GREATER "1.13.0")))
message(STATUS "X11 UI wrap enabled")
set(X11_UI_WRAP "")
add_definitions("-DX11_UI_WRAP")
else()
message(STATUS "X11 UI wrap disabled")
set(X11_UI_WRAP "#")
endif()
# eo_ui
add_library(eo_ui MODULE
test/eo_ui.c)
target_link_libraries(eo_ui ${LIBS_UI})
set_target_properties(eo_ui PROPERTIES PREFIX "")
install(TARGETS eo_ui DESTINATION ${DEST})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/test/lv2_white.png DESTINATION ${DEST})
The Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or redistributed.
The intent is that the Copyright Holder maintains some artistic
control over the development of that Package while still keeping the
Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement.
Definitions
"Copyright Holder" means the individual(s) or organization(s)
named in the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy,
distribute, or modify the Package.
"Package" means the collection of files distributed by the
Copyright Holder, and derivatives of that collection and/or of
those files. A given Package may consist of either the Standard
Version, or a Modified Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing
this Package or providing support for this Package to another
party. It does not mean licensing fees.
"Standard Version" refers to the Package if it has not been
modified, or has been modified only in ways explicitly requested
by the Copyright Holder.
"Modified Version" means the Package, if it has been changed, and
such changes were not explicitly requested by the Copyright
Holder.
"Original License" means this Artistic License as Distributed with
the Standard Version of the Package, in its current version or as
it may be modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary,
or any other form resulting from mechanical transformation or
translation of the Source form.
Permission for Use and Modification Without Distribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.
Permissions for Redistribution of the Standard Version
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License.
Distribution of Modified Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder
of the Standard Version, under the Original License, so that the
Copyright Holder may include your modifications in the Standard
Version.
(b) ensure that installation of your Modified Version does not
prevent the user installing or running the Standard Version. In
addition, the Modified Version must bear a name that is different
from the name of the Standard Version.
(c) allow anyone who receives a copy of the Modified Version to
make the Source form of the Modified Version available to others
under
(i) the Original License or
(ii) a license that permits the licensee to freely copy,
modify and redistribute the Modified Version using the same
licensing terms that apply to the copy that the licensee
received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor
Fees are allowed.
Distribution of Compiled Forms of the Standard Version
or Modified Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be
valid at the time of your distribution. If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
you do not forfeit any of your rights under this license.
(6) You may Distribute a Modified Version in Compiled form without
the Source, provided that you comply with Section 4 with respect to
the Source of the Modified Version.
Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license.
General Provisions
(10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.
(11) If your Modified Version has been derived from a Modified
Version made by someone other than you, you are nevertheless required
to ensure that your Modified Version complies with the requirements of
this license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily
infringed by the Package. If you institute patent litigation
(including a cross-claim or counterclaim) against any party alleging
that the Package constitutes direct or contributory patent
infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.
(14) Disclaimer of Warranty:
THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# eo\_ui.lv2
## Enlightened User Interface Extension for the LV2 Plugin Specification
This diff is collapsed.
# Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the Artistic License 2.0 as published by
# The Perl Foundation.
#
# This source 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. See the
# Artistic License 2.0 for more details.
#
# You should have received a copy of the Artistic License 2.0
# along the source as a COPYING file. If not, obtain it from
# http://www.perlfoundation.org/artistic_license_2_0.
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
ui:EoUI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:comment """
A UI where the LV2_Widget is a pointer to an Evas/Elementary compatible Object
(e.g. an "Evas_Object *" or "Eo *"), and the host guarantees that the
Ecore_Evas or Elementary library has been initialised and the Ecore or
Elementary main loop is running before an UI of this type is instantiated.""" .
/*
* Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch)
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the Artistic License 2.0 as published by
* The Perl Foundation.
*
* This source is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the voiceied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Artistic License 2.0 for more details.
*
* You should have received a copy of the Artistic License 2.0
* along the source as a COPYING file. If not, obtain it from
* http://www.perlfoundation.org/artistic_license_2_0.
*/
#include <stdlib.h>
#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#define EO_PREFIX "http://open-music-kontrollers.ch/lv2/eo#"
#define EO_TEST_URI EO_PREFIX"test"
typedef struct _plughandle_t plughandle_t;
struct _plughandle_t {
const float *x_in;
const float *y_in;
};
static LV2_Handle
instantiate(const LV2_Descriptor* descriptor, double rate,
const char *bundle_path, const LV2_Feature *const *features)
{
plughandle_t *handle = calloc(1, sizeof(plughandle_t));
if(!handle)
return NULL;
return handle;
}
static void
connect_port(LV2_Handle instance, uint32_t port, void *data)
{
plughandle_t *handle = (plughandle_t *)instance;
switch(port)
{
case 0:
handle->x_in = (const float *)data;
break;
case 1:
handle->y_in = (const float *)data;
break;
default:
break;
}
}
static void
run(LV2_Handle instance, uint32_t nsamples)
{
plughandle_t *handle = instance;
// do nothing
}
static void
cleanup(LV2_Handle instance)
{
plughandle_t *handle = instance;
free(handle);
}
const LV2_Descriptor eo_test = {
.URI = EO_TEST_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = NULL,
.run = run,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = NULL
};
#ifdef _WIN32
__declspec(dllexport)
#else
__attribute__((visibility("default")))
#endif
const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
switch(index)
{
case 0:
return &eo_test;
default:
return NULL;
}
}
# Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the Artistic License 2.0 as published by
# The Perl Foundation.
#
# This source 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. See the
# Artistic License 2.0 for more details.
#
# You should have received a copy of the Artistic License 2.0
# along the source as a COPYING file. If not, obtain it from
# http://www.perlfoundation.org/artistic_license_2_0.
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
@prefix state: <http://lv2plug.in/ns/ext/state#> .
@prefix patch: <http://lv2plug.in/ns/ext/patch#> .
@prefix log: <http://lv2plug.in/ns/ext/log#> .
@prefix units: <http://lv2plug.in/ns/extensions/units#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .