Commit ed465b1a authored by Hanspeter Portner's avatar Hanspeter Portner

remove simple ui.

parent 1e3a1b4b
Pipeline #7335046 passed with stages
in 7 minutes and 43 seconds
......@@ -21,7 +21,7 @@ stages:
script:
- mkdir build
- pushd build
- cmake -DCAIRO_INCLUDE_DIRS="/opt/${CI_BUILD_NAME}/include" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR} -DPLUGIN_DEST="${BASE_NAME}-$(cat ../VERSION)/${CI_BUILD_NAME}/${BASE_NAME}" -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} ..
- cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR} -DPLUGIN_DEST="${BASE_NAME}-$(cat ../VERSION)/${CI_BUILD_NAME}/${BASE_NAME}" -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} ..
- cmake .. # needed for darwin
- make
- make install
......@@ -31,7 +31,7 @@ stages:
script:
- mkdir build
- pushd build
- cmake -DCAIRO_INCLUDE_DIRS="/opt/${CI_BUILD_NAME}/include" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=1 -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR} -DPLUGIN_DEST="${BASE_NAME}-$(cat ../VERSION)/${CI_BUILD_NAME}/${BASE_NAME}" -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} ..
- cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=1 -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR} -DPLUGIN_DEST="${BASE_NAME}-$(cat ../VERSION)/${CI_BUILD_NAME}/${BASE_NAME}" -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} ..
- cmake .. # needed for darwin
- make
- make install
......
......@@ -4,7 +4,6 @@ project(moony.lv2)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/tlsf-3.0)
include_directories(${PROJECT_SOURCE_DIR}/kx.lv2)
include_directories(${PROJECT_SOURCE_DIR}/osc.lv2)
include_directories(${PROJECT_SOURCE_DIR}/timely.lv2)
include_directories(${PROJECT_SOURCE_DIR}/xpress.lv2)
......@@ -12,7 +11,6 @@ include_directories(${PROJECT_SOURCE_DIR}/lua-5.3.4)
include_directories(${PROJECT_SOURCE_DIR}/tiny-AES128-C)
include_directories(${PROJECT_SOURCE_DIR}/laes128)
include_directories(${PROJECT_SOURCE_DIR}/api)
include_directories(${PROJECT_SOURCE_DIR}/ui)
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/plugin)
include_directories(${PROJECT_SOURCE_DIR}/pugl)
......@@ -72,32 +70,15 @@ set(LIBS ${LIBS} ${LV2_LDFLAGS})
# options
include(CMakeDependentOption)
option(BUILD_SIMPLE_UI "Build simple external UI" OFF)
option(BUILD_NK_UI "Build nuklear UI" ON)
option(BUILD_UI "Build UI" ON)
option(USE_MANUAL_GC "Use manual garbage collection" OFF)
if(USE_MANUAL_GC)
add_definitions("-DUSE_MANUAL_GC")
endif()
if(BUILD_SIMPLE_UI)
add_library(moony_simple MODULE
ui/moony_simple.c
ui/simple_ui.c)
target_link_libraries(moony_simple ${LIBS_SIMPLE})
set_target_properties(moony_simple PROPERTIES POSITION_INDEPENDENT_CODE true) # -fPIC
set_target_properties(moony_simple PROPERTIES INTERPROCEDURAL_OPTIMIZATION true) # -flto
set_target_properties(moony_simple PROPERTIES PREFIX "")
if(NOT WIN32)
set_target_properties(moony_simple PROPERTIES LINK_FLAGS "-Wl,-e,lv2ui_descriptor")
endif()
install(TARGETS moony_simple DESTINATION ${PLUGIN_DEST})
else()
set(SIMPLE_WRAP "#")
endif()
if(BUILD_NK_UI)
set(LIBS_NK ${LIBS_NK} m)
if(BUILD_UI)
set(LIBS_UI ${LIBS_UI} m)
if(WIN32)
set(MOONY_UI_TYPE "WindowsUI")
......@@ -109,11 +90,11 @@ if(BUILD_NK_UI)
find_package(OpenGL)
if(${OPENGL_FOUND})
set(LIBS_NK ${LIBS_NK} ${OPENGL_LIBRARIES})
set(LIBS_UI ${LIBS_UI} ${OPENGL_LIBRARIES})
else() # try pkg-config
pkg_search_module(GL REQUIRED gl)
if(${GL_FOUND})
set(LIBS_NK ${LIBS_NK} ${GL_LDFLAGS})
set(LIBS_UI ${LIBS_UI} ${GL_LDFLAGS})
else()
message(FATAL_ERROR "OpenGL not found")
endif()
......@@ -123,14 +104,14 @@ if(BUILD_NK_UI)
if(WIN32)
find_library(GDI32_LIBRARY NAMES gdi32)
if(GDI32_LIBRARY)
set(LIBS_NK ${LIBS_NK} ${GDI32_LIBRARY})
set(LIBS_UI ${LIBS_UI} ${GDI32_LIBRARY})
else()
message(FATAL_ERROR "gdi32 library not found")
endif()
find_library(USER32_LIBRARY NAMES user32)
if(USER32_LIBRARY)
set(LIBS_NK ${LIBS_NK} ${USER32_LIBRARY})
set(LIBS_UI ${LIBS_UI} ${USER32_LIBRARY})
else()
message(FATAL_ERROR "user32 library not found")
endif()
......@@ -140,7 +121,7 @@ if(BUILD_NK_UI)
elseif(APPLE)
find_library(COCOA_LIBRARY NAMES Cocoa)
if(COCOA_LIBRARY)
set(LIBS_NK ${LIBS_NK} ${COCOA_LIBRARY})
set(LIBS_UI ${LIBS_UI} ${COCOA_LIBRARY})
else()
message(FATAL_ERROR "Cocoa framework not found")
endif()
......@@ -150,30 +131,30 @@ if(BUILD_NK_UI)
else() # GNU/Linux
pkg_search_module(X11 REQUIRED x11>=1.6)
include_directories(${X11_INCLUDE_DIRS})
set(LIBS_NK ${LIBS_NK} ${X11_LDFLAGS})
set(LIBS_UI ${LIBS_UI} ${X11_LDFLAGS})
pkg_search_module(XEXT REQUIRED xext>=1.3)
include_directories(${XEXT_INCLUDE_DIRS})
set(LIBS_NK ${LIBS_NK} ${XEXT_LDFLAGS})
set(LIBS_UI ${LIBS_UI} ${XEXT_LDFLAGS})
set(TAR_UI ${TAR_UI} pugl/pugl/pugl_x11.c)
endif()
add_library(moony_nk MODULE
ui/moony_nk.c
ui/nk_ui.c
add_library(moony_ui MODULE
plugin/moony_nk.c
plugin/nk_ui.c
${TAR_UI}
$<TARGET_OBJECTS:lua>
$<TARGET_OBJECTS:lpeg>)
target_link_libraries(moony_nk ${LIBS_NK})
set_target_properties(moony_nk PROPERTIES PREFIX "")
target_link_libraries(moony_ui ${LIBS_UI})
set_target_properties(moony_ui PROPERTIES PREFIX "")
if(NOT WIN32)
set_target_properties(moony_nk PROPERTIES LINK_FLAGS "-Wl,-e,lv2ui_descriptor")
set_target_properties(moony_ui PROPERTIES LINK_FLAGS "-Wl,-e,lv2ui_descriptor")
endif()
install(TARGETS moony_nk DESTINATION ${PLUGIN_DEST})
install(TARGETS moony_ui DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/nuklear/extra_font/Cousine-Regular.ttf DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/ui/lexer.lua DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/ui/moony.lua DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/plugin/lexer.lua DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/plugin/moony.lua DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/png/bell.png DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/png/cancel-1.png DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/png/cancel.png DESTINATION ${PLUGIN_DEST})
......@@ -196,7 +177,7 @@ if(BUILD_NK_UI)
install(FILES ${PROJECT_SOURCE_DIR}/logo/omk_logo_256x256.png DESTINATION ${PLUGIN_DEST})
install(FILES ${PROJECT_SOURCE_DIR}/logo/moony_logo.png DESTINATION ${PLUGIN_DEST})
else()
set(NK_WRAP "#")
set(UI_WRAP "#")
endif()
add_library(lua OBJECT
......@@ -340,8 +321,8 @@ if(BUILD_TESTING)
${PROJECT_BINARY_DIR}/manual.html
DEPENDS
moony_test
${PROJECT_SOURCE_DIR}/ui/lexer.lua
${PROJECT_SOURCE_DIR}/ui/moony.lua
${PROJECT_SOURCE_DIR}/plugin/lexer.lua
${PROJECT_SOURCE_DIR}/plugin/moony.lua
${PROJECT_SOURCE_DIR}/manual/hilight.lua
${PROJECT_SOURCE_DIR}/manual/manual.html.in)
add_custom_target(moony_manual ALL DEPENDS ${PROJECT_BINARY_DIR}/manual.html)
......
......@@ -2,11 +2,10 @@
* doc: Canvas
* api: xpress
* api: CanvasResponder
* gui: external editor
* api: remove inline-display/cairo once ardour supports routing atoms
=== High priority
* doc: Parameter
* api: add forge:vectorize
* api: simplify forge:set
* api: improve Parameter
* state: store logFollow
......@@ -13,9 +13,7 @@ rm -rf ${TARGET}
mkdir -p ${TARGET}
pushd ${TARGET}
PKG_CONFIG_PATH=${PKG_CONFIG_PATH} cmake \
-DCAIRO_INCLUDE_DIRS="/opt/${CI_BUILD_NAME}/include" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_INLINE_DISPLAY=1 \
-DBUILD_TESTING=0 \
-DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR} \
-DPLUGIN_DEST="${BASE_NAME}-$(cat ../VERSION)/${CI_BUILD_NAME}/${BASE_NAME}" \
......
......@@ -88,10 +88,7 @@
#define MOONY_PARAM_COLS_URI MOONY_URI"#paramCols"
#define MOONY_PARAM_ROWS_URI MOONY_URI"#paramRows"
#define MOONY_SIMPLE_UI_URI MOONY_URI"#ui_2_simple_1_ui"
#define MOONY_SIMPLE_KX_URI MOONY_URI"#ui_2_simple_2_kx"
#define MOONY_NK_URI MOONY_URI"#ui_3_nk"
#define MOONY_NK_URI MOONY_URI"#moony_ui"
#define MOONY_C1XC1_URI MOONY_URI"#c1xc1"
#define MOONY_C2XC2_URI MOONY_URI"#c2xc2"
......
/*
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 "lv2/lv2plug.in/ns/extensions/ui/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 */
package.path = package.path .. ';../ui/?.lua'
package.path = package.path .. ';../plugin/?.lua'
local lexer = require('lexer')
local moony = lexer.load('moony')
......
......@@ -35,9 +35,7 @@ moony:c1xc1
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
moony:c2xc2
......@@ -45,9 +43,7 @@ moony:c2xc2
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
moony:c4xc4
......@@ -55,9 +51,7 @@ moony:c4xc4
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
# atom in, atom out
......@@ -66,9 +60,7 @@ moony:a1xa1
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
moony:a2xa2
......@@ -76,9 +68,7 @@ moony:a2xa2
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
moony:a4xa4
......@@ -86,9 +76,7 @@ moony:a4xa4
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
# control/atom in, control/atom out
......@@ -97,9 +85,7 @@ moony:c1a1xc1a1
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
moony:c2a1xc2a1
......@@ -107,9 +93,7 @@ moony:c2a1xc2a1
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
moony:c4a1xc4a1
......@@ -117,25 +101,13 @@ moony:c4a1xc4a1
lv2:minorVersion @MOONY_MINOR_VERSION@ ;
lv2:microVersion @MOONY_MICRO_VERSION@ ;
lv2:binary <moony@CMAKE_SHARED_MODULE_SUFFIX@> ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_1_ui ;
@SIMPLE_WRAP@ui:ui moony:ui_2_simple_2_kx ;
@NK_WRAP@ui:ui moony:ui_3_nk ;
@UI_WRAP@ui:ui moony:moony_ui ;
rdfs:seeAlso <moony.ttl> .
# Simple UI
moony:ui_2_simple_1_ui
a ui:UI ;
ui:binary <moony_simple@CMAKE_SHARED_MODULE_SUFFIX@> ;
rdfs:seeAlso <moony_ui.ttl> .
moony:ui_2_simple_2_kx
a kx:Widget ;
ui:binary <moony_simple@CMAKE_SHARED_MODULE_SUFFIX@> ;
rdfs:seeAlso <moony_ui.ttl> .
# NK UI
moony:ui_3_nk
# UI
moony:moony_ui
a ui:@MOONY_UI_TYPE@ ;
ui:binary <moony_nk@CMAKE_SHARED_MODULE_SUFFIX@> ;
ui:binary <moony_ui@CMAKE_SHARED_MODULE_SUFFIX@> ;
rdfs:seeAlso <moony_ui.ttl> .
# Banks
......
......@@ -22,89 +22,7 @@
@prefix moony: <http://open-music-kontrollers.ch/lv2/moony#> .
# Simple UI
moony:ui_2_simple_1_ui
ui:portNotification [
ui:plugin moony:c1xc1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c2xc2 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c4xc4 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:a1xa1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:a2xa2 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:a4xa4 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c1a1xc1a1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c2a1xc2a1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c4a1xc4a1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] ;
lv2:requiredFeature ui:idleInterface, ui:portMap, urid:map ;
lv2:extensionData ui:idleInterface, ui:showInterface .
moony:ui_2_simple_2_kx
ui:portNotification [
ui:plugin moony:c1xc1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c2xc2 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c4xc4 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:a1xa1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:a2xa2 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:a4xa4 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c1a1xc1a1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c2a1xc2a1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] , [
ui:plugin moony:c4a1xc4a1 ;
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] ;
lv2:requiredFeature kx:Host, ui:portMap, urid:map .
moony:ui_3_nk
moony:moony_ui
ui:portNotification [
ui:plugin moony:c1xc1 ;
lv2:symbol "notify" ;
......
/*
* 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.
*/
#include <moony.h>
#ifdef _WIN32
__declspec(dllexport)
#else
__attribute__((visibility("default")))
#endif
const LV2UI_Descriptor*
lv2ui_descriptor(uint32_t index)
{
switch(index)
{
case 0:
return &simple_ui;
case 1:
return &simple_kx;
default:
return NULL;
}
}
/*
* 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.
*/
#ifndef _MOONY_COMMON_UI_H
#define _MOONY_COMMON_UI_H
#include <unistd.h>
#include <stdbool.h>
#include <errno.h>
#if !defined(_WIN32)
# include <sys/wait.h>
# include <signal.h>
#else
# include <fcntl.h>
# include <sys/stat.h>
# include <windows.h>
#endif
#include <lv2/lv2plug.in/ns/ext/log/logger.h>
typedef struct _spawn_t spawn_t;
struct _spawn_t {
#if defined(_WIN32)
PROCESS_INFORMATION pi;
#else
pid_t pid;
#endif
LV2_Log_Logger *logger;
};
static inline char **
_spawn_parse_env(char *env, char *path)
{
unsigned n = 0;
char **args = malloc((n+1) * sizeof(char *));
char **oldargs = NULL;
if(!args)
goto fail;
args[n] = NULL;
char *pch = strtok(env," \t");
while(pch)
{
args[n++] = pch;
oldargs = args;
args = realloc(args, (n+1) * sizeof(char *));
if(!args)
goto fail;
oldargs = NULL;
args[n] = NULL;
pch = strtok(NULL, " \t");
}
args[n++] = path;
oldargs = args;
args = realloc(args, (n+1) * sizeof(char *));
if(!args)
goto fail;
oldargs = NULL;
args[n] = NULL;
return args;
fail:
if(oldargs)
free(oldargs);
if(args)
free(args);
return 0;
}
#if defined(_WIN32)
static inline int
_spawn_spawn(spawn_t *spawn, char **args)
{
STARTUPINFO si;
memset(&si, 0x0, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
size_t len = 0;
for(char **arg = args; *arg; arg++)
{
len += strlen(*arg) + 1; // + space
}
char *cmd = malloc(len + 1); // + zero byte
if(!cmd)
return -1;
cmd[0] = '\0';
for(char **arg = args; *arg; arg++)
{
cmd = strcat(cmd, *arg);
cmd = strcat(cmd, " ");
}
int ret = 0;
if(!CreateProcess(
NULL, // No module name (use command line)
cmd, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&spawn->pi ) // Pointer to PROCESS_INFORMATION structure
)
{
if(spawn->logger)
lv2_log_error(spawn->logger, "CreateProcess failed: %d\n", GetLastError());
ret = -1;
}
free(cmd);
return ret;
}
static inline int
_spawn_waitpid(spawn_t *spawn, bool blocking)
{
if(blocking)
{
WaitForSingleObject(spawn->pi.hProcess, INFINITE);
return 0;
}
// !blocking
const DWORD status = WaitForSingleObject(spawn->pi.hProcess, 0);
switch(WaitForSingleObject(spawn->pi.hProcess, 0))
{
case WAIT_TIMEOUT: // non-signaled, e.g. still running
return 0;
case WAIT_OBJECT_0: // signaled, e.g. not running anymore
return -1;
case WAIT_ABANDONED: // abandoned
if(spawn->logger)
lv2_log_note(spawn->logger, "WaitForSingleObject abandoned\n");
return -1;
case WAIT_FAILED: // failed, try later
if(spawn->logger)
lv2_log_note(spawn->logger, "WaitForSingleObject failed\n");
return 0;
}
return 0; // try later
}
static inline void
_spawn_kill(spawn_t *spawn)
{
CloseHandle(spawn->pi.hProcess);
CloseHandle(spawn->pi.hThread);
}
static inline bool
_spawn_has_child(spawn_t *spawn)
{
return (spawn->pi.hProcess != 0x0) && (spawn->pi.hThread != 0x0);