aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2015-09-12 20:54:43 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2015-09-12 20:54:43 +0200
commit864c9e7218bc3c0b7973151cb9b0b91d66adc90e (patch)
tree2a66a4f9c2088d320f0a8f82c595644a0c0347b3
parentce806d7b95a2220a9cbd77fc5d5dc9247a36548c (diff)
downloadsynthpod-864c9e7218bc3c0b7973151cb9b0b91d66adc90e.tar.xz
remove GUI build option, add GUI cli argument.
* remove GUI build option * add command line argument to disable GUI * split man page in two.
-rw-r--r--CMakeLists.txt17
-rw-r--r--bin/CMakeLists.txt26
-rw-r--r--bin/synthpod_alsa.175
-rw-r--r--bin/synthpod_alsa.c52
-rw-r--r--bin/synthpod_bin.h74
-rw-r--r--bin/synthpod_jack.1 (renamed from bin/synthpod.1)20
-rw-r--r--bin/synthpod_jack.c59
-rw-r--r--data/CMakeLists.txt58
-rw-r--r--lib/CMakeLists.txt28
-rw-r--r--lib/synthpod_ui.c957
-rw-r--r--plugins/CMakeLists.txt43
11 files changed, 727 insertions, 682 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b166e563..fbf0aa9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,6 @@ set(CMAKE_CXX_FLAGS "-std=gnu++11 -ffast-math -fvisibility=hidden ${CMAKE_CXX_FL
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}")
# options
-option(BUILD_UI "Build user interface libraries" ON)
option(BUILD_JACK "Build JACK standalone host" ON)
option(BUILD_ALSA "Build ALSA standalone host (experimental)" OFF)
@@ -72,20 +71,16 @@ include_directories(${LILV_INCLUDE_DIRS})
pkg_search_module(LV2 REQUIRED lv2>=1.10)
include_directories(${LV2_INCLUDE_DIRS})
-if(BUILD_UI)
- add_definitions("-DBUILD_UI")
-
# elm
- pkg_search_module(ELM REQUIRED elementary>=1.8)
- include_directories(${ELM_INCLUDE_DIRS})
-
- if((${ELM_VERSION} VERSION_EQUAL "1.10.0") OR (${ELM_VERSION} VERSION_GREATER "1.10.0"))
- add_definitions("-DELM_1_10")
- endif()
+pkg_search_module(ELM REQUIRED elementary>=1.8)
+include_directories(${ELM_INCLUDE_DIRS})
- pkg_search_module(ECORE_X OPTIONAL ecore-x)
+if((${ELM_VERSION} VERSION_EQUAL "1.10.0") OR (${ELM_VERSION} VERSION_GREATER "1.10.0"))
+ add_definitions("-DELM_1_10")
endif()
+pkg_search_module(ECORE_X OPTIONAL ecore-x)
+
add_subdirectory(lib)
add_subdirectory(bin)
add_subdirectory(plugins)
diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt
index 24b50e72..4c7cbd53 100644
--- a/bin/CMakeLists.txt
+++ b/bin/CMakeLists.txt
@@ -15,10 +15,6 @@ if(BUILD_JACK OR BUILD_ALSA)
# icon
install(FILES ${PROJECT_SOURCE_DIR}/data/pix/synthpod.png DESTINATION
${SYNTHPOD_ICON_DIR})
-
-# man page
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/synthpod.1 DESTINATION
- man/man1)
endif()
if(BUILD_JACK)
@@ -54,11 +50,8 @@ if(BUILD_JACK)
${ECORE_CON_LDFLAGS}
${JACK_LIBS}
"-lm"
- synthpod.lib)
- if(BUILD_UI)
- target_link_libraries(synthpod.jack
- synthpod_ui.lib)
- endif()
+ synthpod.lib
+ synthpod_ui.lib)
set_target_properties(synthpod.jack PROPERTIES OUTPUT_NAME "synthpod_jack")
install(TARGETS synthpod.jack DESTINATION bin)
@@ -67,6 +60,10 @@ if(BUILD_JACK)
${PROJECT_BINARY_DIR}/bin/synthpod_jack.desktop @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/bin/synthpod_jack.desktop DESTINATION
${SYNTHPOD_DESKTOP_DIR})
+
+# man page
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/synthpod_jack.1 DESTINATION
+ man/man1)
endif()
if(BUILD_ALSA)
@@ -94,11 +91,8 @@ if(BUILD_ALSA)
"-lasound" #FIXME
${ZITA_ALSA_PCMI_LIBRARY}
"-lm"
- synthpod.lib)
- if(BUILD_UI)
- target_link_libraries(synthpod.alsa
- synthpod_ui.lib)
- endif()
+ synthpod.lib
+ synthpod_ui.lib)
set_target_properties(synthpod.alsa PROPERTIES OUTPUT_NAME "synthpod_alsa")
install(TARGETS synthpod.alsa DESTINATION bin)
@@ -107,4 +101,8 @@ if(BUILD_ALSA)
${PROJECT_BINARY_DIR}/bin/synthpod_alsa.desktop @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/bin/synthpod_alsa.desktop DESTINATION
${SYNTHPOD_DESKTOP_DIR})
+
+# man page
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/synthpod_alsa.1 DESTINATION
+ man/man1)
endif()
diff --git a/bin/synthpod_alsa.1 b/bin/synthpod_alsa.1
new file mode 100644
index 00000000..374889f2
--- /dev/null
+++ b/bin/synthpod_alsa.1
@@ -0,0 +1,75 @@
+.TH SYNTHPOD "1" "September 12, 2015"
+
+.SH NAME
+synthpod \- a lightweight nonlinear LV2 plugin container
+
+.SH SYNOPSIS
+.B synthpod_alsa
+[\fIoptions\fR] [\fIbundle-path\fR]
+
+.SH DESCRIPTION
+\fBsynthpod\fP is a lightweight nonlinear LV2 plugin container, aka host.
+.PP
+It is a pure stand-alone ALSA client with NSM session support and ALSA AUDIO/MIDI.
+.PP
+It is a also a first-class LV2 plugin (http://open-music-kontrollers.ch/lv2/synthpod#stereo).
+
+.SH OPTIONS
+.HP
+\fB\-v\fR
+.IP
+Print version and license information
+
+.HP
+\fB\-h\fR
+.IP
+Print usage information
+
+.HP
+\fB\-2\fR
+.IP
+Disable GUI
+
+.HP
+\fB\-i\fR capture-device
+.IP
+Capture device ("default")
+
+.HP
+\fB\-o\fR playback-device
+.IP
+Playback device ("default")
+
+.HP
+\fB\-r\fR sample-rate
+.IP
+Sample Rate (48000)
+
+.HP
+\fB\-p\fR sample-period
+.IP
+Frames per period (1024)
+
+.HP
+\fB\-n\fR period-number
+.IP
+Number of periods of playback latency (3)
+
+.HP
+\fB\-s\fR sequence-size
+.IP
+Minimal byte size of event sequence buffers (8192)
+
+.SH FILES
+.TP
+.I $XDG_DATA_HOME/synthpod $HOME/.local/share/synthpod
+Default bundle state directory
+.TP
+.I $HOME/.lv2
+Default LV2 preset directory
+
+.SH LICENSE
+Artistic License 2.0.
+
+.SH AUTHOR
+Hanspeter Portner (dev@open-music-kontrollers.ch).
diff --git a/bin/synthpod_alsa.c b/bin/synthpod_alsa.c
index 2e6487bc..275434d6 100644
--- a/bin/synthpod_alsa.c
+++ b/bin/synthpod_alsa.c
@@ -117,7 +117,6 @@ _rt_thread(void *data, Eina_Thread thread)
int paused = sp_app_paused(app);
if(paused == 1) // aka loading state
{
- printf("paused\n");
pcmi_pcm_idle(pcmi, nsamples);
continue;
@@ -433,7 +432,6 @@ _system_port_del(void *data, void *sys_port)
free(chan);
}
-#if defined(BUILD_UI)
static void
_ui_saved(void *data, int status)
{
@@ -452,7 +450,6 @@ _ui_saved(void *data, int status)
elm_exit();
}
}
-#endif // BUILD_UI
static int
_alsa_init(prog_t *handle, const char *id)
@@ -525,9 +522,7 @@ _open(const char *path, const char *name, const char *id, void *data)
Eina_Bool status = eina_thread_create(&handle->thread,
EINA_THREAD_URGENT, -1, _rt_thread, handle); //TODO
-#if defined(BUILD_UI) //FIXME
sp_ui_bundle_load(bin->ui, bin->path, 1);
-#endif
return 0; // success
}
@@ -539,9 +534,7 @@ _save(void *data)
prog_t *handle = (void *)bin - offsetof(prog_t, bin);
handle->save_state = SAVE_STATE_NSM;
-#if defined(BUILD_UI) //FIXME
sp_ui_bundle_save(bin->ui, bin->path, 1);
-#endif
return 0; // success
}
@@ -549,22 +542,12 @@ _save(void *data)
static const synthpod_nsm_driver_t nsm_driver = {
.open = _open,
.save = _save,
-#if defined(BUILD_UI)
.show = _show,
.hide = _hide
-#else
- .show = NULL,
- .hide = NULL
-#endif // BUILD_UI
};
-#if defined(BUILD_UI)
EAPI_MAIN int
elm_main(int argc, char **argv)
-#else
-int
-main(int argc, char **argv)
-#endif
{
static prog_t handle;
bin_t *bin = &handle.bin;
@@ -577,21 +560,27 @@ main(int argc, char **argv)
const char *def = "default";
handle.play_name = def;
handle.capt_name = def;
+
+ bin->has_gui = true;
+
+ fprintf(stderr,
+ "--------------------------------------------------------------------\n"
+ "Synthpod "SYNTHPOD_VERSION"\n"
+ "--------------------------------------------------------------------\n"
+ "\n"
+ "Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)\n"
+ "\n"
+ "This is free software: you can redistribute it and/or modify\n"
+ "it under the terms of the Artistic License 2.0 as published by\n"
+ "The Perl Foundation.\n\n");
int c;
- while((c = getopt(argc, argv, "vh2i:o:r:p:n:s:")) != -1)
+ while((c = getopt(argc, argv, "vhG2i:o:r:p:n:s:")) != -1)
{
switch(c)
{
case 'v':
- fprintf(stderr, "Synthpod " SYNTHPOD_VERSION "\n"
- "\n"
- "Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)\n"
- "\n"
- "This is free software: you can redistribute it and/or modify\n"
- "it under the terms of the Artistic License 2.0 as published by\n"
- "The Perl Foundation.\n"
- "\n"
+ fprintf(stderr,
"This source is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
@@ -603,12 +592,14 @@ main(int argc, char **argv)
return 0;
case 'h':
fprintf(stderr,
+ "--------------------------------------------------------------------\n"
"USAGE\n"
" %s [OPTIONS] [BUNDLE_PATH]\n"
"\n"
"OPTIONS\n"
- " [-v] print version and license information\n"
+ " [-v] print version and full license information\n"
" [-h] print usage information\n"
+ " [-G] disable GUI\n"
" [-2] force 2 channel mode\n"
" [-i] capture-device capture device (\"default\")\n"
" [-o] playback-device playback device (\"default\")\n"
@@ -618,6 +609,9 @@ main(int argc, char **argv)
" [-s] sequence-size minimum sequence size (8192)\n\n"
, argv[0]);
return 0;
+ case 'G':
+ bin->has_gui = false;
+ break;
case '2':
handle.twochan = 1;
break;
@@ -667,7 +661,6 @@ main(int argc, char **argv)
bin->app_driver.osc_sched = NULL;
-#if defined(BUILD_UI)
bin->ui_driver.saved = _ui_saved;
bin->ui_driver.features = SP_UI_FEATURE_NEW | SP_UI_FEATURE_SAVE | SP_UI_FEATURE_CLOSE;
@@ -675,7 +668,6 @@ main(int argc, char **argv)
bin->ui_driver.features |= SP_UI_FEATURE_IMPORT_FROM | SP_UI_FEATURE_EXPORT_TO;
else
bin->ui_driver.features |= SP_UI_FEATURE_OPEN | SP_UI_FEATURE_SAVE_AS;
-#endif
// run
bin_run(bin, argv, &nsm_driver);
@@ -692,6 +684,4 @@ main(int argc, char **argv)
return 0;
}
-#if defined(BUILD_UI)
ELM_MAIN()
-#endif
diff --git a/bin/synthpod_bin.h b/bin/synthpod_bin.h
index 64380dc3..a6111866 100644
--- a/bin/synthpod_bin.h
+++ b/bin/synthpod_bin.h
@@ -20,12 +20,7 @@
#include <synthpod_app.h>
-#if defined(BUILD_UI)
# include <synthpod_ui.h>
-#else
-# include <Ecore.h>
-# include <Ecore_File.h>
-#endif
#include <Eina.h>
@@ -71,7 +66,7 @@ struct _bin_t {
char *path;
synthpod_nsm_t *nsm;
-#if defined(BUILD_UI)
+ bool has_gui;
sp_ui_t *ui;
sp_ui_driver_t ui_driver;
@@ -80,9 +75,6 @@ struct _bin_t {
Ecore_Animator *ui_anim;
Evas_Object *win;
-#else
- Ecore_Event_Handler *sig;
-#endif
volatile int worker_dead;
Eina_Thread worker_thread;
@@ -96,7 +88,6 @@ struct _bin_t {
LV2_URID log_warning;
};
-#if defined(BUILD_UI)
// non-rt ui-thread
static void
_ui_delete_request(void *data, Evas_Object *obj, void *event)
@@ -136,15 +127,6 @@ _ui_animator(void *data)
return EINA_TRUE; // continue animator
}
-#else
-static Eina_Bool
-_quit(void *data, int type, void *info)
-{
- ecore_main_loop_quit();
-
- return EINA_TRUE;
-}
-#endif // BUILD_UI
// non-rt worker-thread
static void *
@@ -188,7 +170,6 @@ _worker_thread(void *data, Eina_Thread thread)
return NULL;
}
-#if defined(BUILD_UI)
// rt
static void *
_app_to_ui_request(size_t size, void *data)
@@ -227,7 +208,6 @@ _ui_to_app_advance(size_t size, void *data)
varchunk_write_advance(bin->app_from_ui, size);
}
-#endif
// rt
static void *
@@ -325,13 +305,13 @@ _log_printf(void *data, LV2_URID type, const char *fmt, ...)
return ret;
}
-#if defined(BUILD_UI)
static int
_show(void *data)
{
bin_t *bin = data;
- evas_object_show(bin->win);
+ if(bin->win)
+ evas_object_show(bin->win);
return 0;
}
@@ -341,20 +321,18 @@ _hide(void *data)
{
bin_t *bin = data;
- evas_object_hide(bin->win);
+ if(bin->win)
+ evas_object_hide(bin->win);
return 0;
}
-#endif // BUILD_UI
static void
bin_init(bin_t *bin)
{
// varchunk init
-#if defined(BUILD_UI)
bin->app_to_ui = varchunk_new(CHUNK_SIZE);
bin->app_from_ui = varchunk_new(CHUNK_SIZE);
-#endif
bin->app_to_worker = varchunk_new(CHUNK_SIZE);
bin->app_from_worker = varchunk_new(CHUNK_SIZE);
bin->app_to_log = varchunk_new(CHUNK_SIZE);
@@ -373,19 +351,13 @@ bin_init(bin_t *bin)
bin->app_driver.unmap = unmap;
bin->app_driver.log_printf = _log_printf;
bin->app_driver.log_vprintf = _log_vprintf;
-#if defined(BUILD_UI)
bin->app_driver.to_ui_request = _app_to_ui_request;
bin->app_driver.to_ui_advance = _app_to_ui_advance;
-#else
- bin->app_driver.to_ui_request = NULL;
- bin->app_driver.to_ui_advance = NULL;
-#endif
bin->app_driver.to_worker_request = _app_to_worker_request;
bin->app_driver.to_worker_advance = _app_to_worker_advance;
bin->app_driver.to_app_request = _worker_to_app_request;
bin->app_driver.to_app_advance = _worker_to_app_advance;
-#if defined(BUILD_UI)
bin->ui_driver.map = map;
bin->ui_driver.unmap = unmap;
bin->ui_driver.to_app_request = _ui_to_app_request;
@@ -394,23 +366,28 @@ bin_init(bin_t *bin)
bin->ui_driver.opened = _ui_opened;
bin->ui_driver.close = _ui_close;
-#endif
}
static void
bin_run(bin_t *bin, char **argv, const synthpod_nsm_driver_t *nsm_driver)
{
-#if defined(BUILD_UI)
// create main window
bin->ui_anim = ecore_animator_add(_ui_animator, bin);
- bin->win = elm_win_util_standard_add("synthpod", "Synthpod");
- evas_object_smart_callback_add(bin->win, "delete,request", _ui_delete_request, NULL);
- evas_object_resize(bin->win, 1280, 720);
- evas_object_show(bin->win);
+
+ bin->win = NULL;
+ if(bin->has_gui)
+ {
+ bin->win = elm_win_util_standard_add("synthpod", "Synthpod");
+ if(bin->win)
+ {
+ evas_object_smart_callback_add(bin->win, "delete,request", _ui_delete_request, NULL);
+ evas_object_resize(bin->win, 1280, 720);
+ evas_object_show(bin->win);
+ }
+ }
// ui init
bin->ui = sp_ui_new(bin->win, NULL, &bin->ui_driver, bin, 1);
-#endif
// NSM init
const char *exe = strrchr(argv[0], '/');
@@ -424,22 +401,17 @@ bin_run(bin_t *bin, char **argv, const synthpod_nsm_driver_t *nsm_driver)
Eina_Bool status = eina_thread_create(&bin->worker_thread,
EINA_THREAD_URGENT, -1, _worker_thread, bin); //TODO
-#if defined(BUILD_UI)
// main loop
elm_run();
// ui deinit
sp_ui_free(bin->ui);
- evas_object_del(bin->win);
- ecore_animator_del(bin->ui_anim);
-#else
- bin->sig = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _quit, NULL);
+ if(bin->win)
+ evas_object_del(bin->win);
- ecore_main_loop_begin();
-
- ecore_event_handler_del(bin->sig);
-#endif // BUILD_UI
+ if(bin->ui_anim)
+ ecore_animator_del(bin->ui_anim);
}
static void
@@ -470,10 +442,8 @@ bin_deinit(bin_t *bin)
ext_urid_free(bin->ext_urid);
// varchunk deinit
-#if defined(BUILD_UI)
varchunk_free(bin->app_to_ui);
varchunk_free(bin->app_from_ui);
-#endif
varchunk_free(bin->app_to_log);
varchunk_free(bin->app_to_worker);
varchunk_free(bin->app_from_worker);
@@ -499,7 +469,6 @@ bin_process_pre(bin_t *bin, uint32_t nsamples, int paused)
// run synthpod app pre
sp_app_run_pre(bin->app, nsamples);
-#if defined(BUILD_UI)
// read events from UI
if(!paused) // aka not saving state
{
@@ -513,7 +482,6 @@ bin_process_pre(bin_t *bin, uint32_t nsamples, int paused)
varchunk_read_advance(bin->app_from_ui);
}
}
-#endif // BUILD_UI
// run synthpod app post
sp_app_run_post(bin->app, nsamples);
diff --git a/bin/synthpod.1 b/bin/synthpod_jack.1
index 17c09f6a..514b52ae 100644
--- a/bin/synthpod.1
+++ b/bin/synthpod_jack.1
@@ -1,36 +1,50 @@
-.TH SYNTHPOD "1" "July 16, 2015"
+.TH SYNTHPOD "1" "September 12, 2015"
+
.SH NAME
synthpod \- a lightweight nonlinear LV2 plugin container
+
.SH SYNOPSIS
.B synthpod_jack
[\fIoptions\fR] [\fIbundle-path\fR]
+
.SH DESCRIPTION
\fBsynthpod\fP is a lightweight nonlinear LV2 plugin container, aka host.
.PP
It is a pure stand-alone JACK client with JACK/NSM session support and JACK AUDIO/MIDI.
.PP
It is a also a first-class LV2 plugin (http://open-music-kontrollers.ch/lv2/synthpod#stereo).
+
.SH OPTIONS
.HP
\fB\-v\fR
.IP
Print version and license information
+
.HP
\fB\-h\fR
.IP
Print usage information
+
+.HP
+\fB\-G\fR
+.IP
+Disable GUI
+
.HP
\fB\-n\fR server-name
.IP
Connect to named JACK daemon
+
.HP
\fB\-u\fR client-uuid
.IP
Client UUID for JACK session management
+
.HP
\fB\-s\fR sequence-size
.IP
-Minimal byte size of event sequence buffers (may be bigger)
+Minimal byte size of event sequence buffers (8192)
+
.SH FILES
.TP
.I $XDG_DATA_HOME/synthpod $HOME/.local/share/synthpod
@@ -38,7 +52,9 @@ Default bundle state directory
.TP
.I $HOME/.lv2
Default LV2 preset directory
+
.SH LICENSE
Artistic License 2.0.
+
.SH AUTHOR
Hanspeter Portner (dev@open-music-kontrollers.ch).
diff --git a/bin/synthpod_jack.c b/bin/synthpod_jack.c
index e324243c..2ae950e0 100644
--- a/bin/synthpod_jack.c
+++ b/bin/synthpod_jack.c
@@ -669,16 +669,12 @@ _session_async(void *data)
// fall-through
case JackSessionSave:
handle->save_state = SAVE_STATE_JACK;
-#if defined(BUILD_UI) //FIXME
sp_ui_bundle_save(bin->ui, ev->session_dir, 1);
-#endif
break;
case JackSessionSaveTemplate:
handle->save_state = SAVE_STATE_JACK;
-#if defined(BUILD_UI) //FIXME
sp_ui_bundle_new(bin->ui);
sp_ui_bundle_save(bin->ui, ev->session_dir, 1);
-#endif
break;
}
}
@@ -722,7 +718,6 @@ _sample_rate(jack_nframes_t sample_rate, void *data)
return 0;
}
-#if defined(BUILD_UI)
static void
_ui_saved(void *data, int status)
{
@@ -753,7 +748,6 @@ _ui_saved(void *data, int status)
elm_exit();
}
}
-#endif // BUILD_UI
static void *
_system_port_add(void *data, System_Port_Type type, const char *short_name,
@@ -863,11 +857,7 @@ _shutdown_async(void *data)
{
prog_t *handle = data;
-#if defined(BUILD_UI)
elm_exit();
-#else
- ecore_main_loop_quit();
-#endif
}
static void
@@ -989,9 +979,7 @@ _open(const char *path, const char *name, const char *id, void *data)
// jack activate
jack_activate(handle->client); //TODO check
-#if defined(BUILD_UI) //FIXME
sp_ui_bundle_load(bin->ui, bin->path, 1);
-#endif
return 0; // success
}
@@ -1003,9 +991,7 @@ _save(void *data)
prog_t *handle = (void *)bin - offsetof(prog_t, bin);
handle->save_state = SAVE_STATE_NSM;
-#if defined(BUILD_UI) //FIXME
sp_ui_bundle_save(bin->ui, bin->path, 1);
-#endif
return 0; // success
}
@@ -1013,13 +999,8 @@ _save(void *data)
static const synthpod_nsm_driver_t nsm_driver = {
.open = _open,
.save = _save,
-#if defined(BUILD_UI)
.show = _show,
.hide = _hide
-#else
- .show = NULL,
- .hide = NULL
-#endif // BUILD_UI
};
#if defined(JACK_HAS_CYCLE_TIMES)
@@ -1074,13 +1055,8 @@ _osc_schedule_frames2osc(osc_schedule_handle_t instance, int64_t frames)
}
#endif // JACK_HAS_CYCLE_TIMES
-#if defined(BUILD_UI)
EAPI_MAIN int
elm_main(int argc, char **argv)
-#else
-int
-main(int argc, char **argv)
-#endif
{
static prog_t handle;
bin_t *bin = &handle.bin;
@@ -1088,21 +1064,27 @@ main(int argc, char **argv)
handle.server_name = NULL;
handle.session_id = NULL;
handle.seq_size = SEQ_SIZE;
+
+ bin->has_gui = true;
+
+ fprintf(stderr,
+ "--------------------------------------------------------------------\n"
+ "Synthpod "SYNTHPOD_VERSION"\n"
+ "--------------------------------------------------------------------\n"
+ "\n"
+ "Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)\n"
+ "\n"
+ "This is free software: you can redistribute it and/or modify\n"
+ "it under the terms of the Artistic License 2.0 as published by\n"
+ "The Perl Foundation.\n\n");
int c;
- while((c = getopt(argc, argv, "vhn:u:s:")) != -1)
+ while((c = getopt(argc, argv, "vhGn:u:s:")) != -1)
{
switch(c)
{
case 'v':
- fprintf(stderr, "Synthpod "SYNTHPOD_VERSION"\n"
- "\n"
- "Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)\n"
- "\n"
- "This is free software: you can redistribute it and/or modify\n"
- "it under the terms of the Artistic License 2.0 as published by\n"
- "The Perl Foundation.\n"
- "\n"
+ fprintf(stderr,
"This source is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
@@ -1114,17 +1096,22 @@ main(int argc, char **argv)
return 0;
case 'h':
fprintf(stderr,
+ "--------------------------------------------------------------------\n"
"USAGE\n"
" %s [OPTIONS] [BUNDLE_PATH]\n"
"\n"
"OPTIONS\n"
- " [-v] print version and license information\n"
+ " [-v] print version and full license information\n"
" [-h] print usage information\n"
+ " [-G] disable GUI\n"
" [-n] server-name connect to named JACK daemon\n"
" [-u] client-uuid client UUID for JACK session management\n"
" [-s] sequence-size minimum sequence size (8192)\n\n"
, argv[0]);
return 0;
+ case 'G':
+ bin->has_gui = false;
+ break;
case 'n':
handle.server_name = optarg;
break;
@@ -1179,7 +1166,6 @@ main(int argc, char **argv)
bin->app_driver.osc_sched = NULL;
#endif
-#if defined(BUILD_UI)
bin->ui_driver.saved = _ui_saved;
bin->ui_driver.features = SP_UI_FEATURE_NEW | SP_UI_FEATURE_SAVE | SP_UI_FEATURE_CLOSE;
@@ -1187,7 +1173,6 @@ main(int argc, char **argv)
bin->ui_driver.features |= SP_UI_FEATURE_IMPORT_FROM | SP_UI_FEATURE_EXPORT_TO;
else
bin->ui_driver.features |= SP_UI_FEATURE_OPEN | SP_UI_FEATURE_SAVE_AS;
-#endif
// run
bin_run(bin, argv, &nsm_driver);
@@ -1204,6 +1189,4 @@ main(int argc, char **argv)
return 0;
}
-#if defined(BUILD_UI)
ELM_MAIN()
-#endif
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index e861cbc3..b205f956 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -1,34 +1,32 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-if(BUILD_UI)
# theme
- find_program(EDJE_CC NAMES edje_cc)
- if(EDJE_CC_NOTFOUND)
- message(SEND_ERROR "edje_cc not found")
- else(EDJE_CC_NOTFOUND)
- message(STATUS "edje_cc found: " ${EDJE_CC})
- endif(EDJE_CC_NOTFOUND)
+find_program(EDJE_CC NAMES edje_cc)
+if(EDJE_CC_NOTFOUND)
+ message(SEND_ERROR "edje_cc not found")
+else(EDJE_CC_NOTFOUND)
+ message(STATUS "edje_cc found: " ${EDJE_CC})
+endif(EDJE_CC_NOTFOUND)
- add_custom_command(
- OUTPUT ${PROJECT_BINARY_DIR}/synthpod.edj
- COMMAND ${EDJE_CC} ARGS
- "-fd" ${CMAKE_CURRENT_SOURCE_DIR}/font
- "-id" ${CMAKE_CURRENT_SOURCE_DIR}/pix
- ${CMAKE_CURRENT_SOURCE_DIR}/synthpod.edc
- ${PROJECT_BINARY_DIR}/synthpod.edj
- DEPENDS
- ${CMAKE_CURRENT_SOURCE_DIR}/modgrid.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/modlist.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/patcher.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/smart_slider.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/smart_meter.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/smart_spinner.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/smart_toggle.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/synthpod.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/theme.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/omk_logo.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/entry.edc
- ${CMAKE_CURRENT_SOURCE_DIR}/group.edc)
- add_custom_target(THEME ALL DEPENDS ${PROJECT_BINARY_DIR}/synthpod.edj)
- install(FILES ${PROJECT_BINARY_DIR}/synthpod.edj DESTINATION ${SYNTHPOD_DATA_DIR})
-endif()
+add_custom_command(
+ OUTPUT ${PROJECT_BINARY_DIR}/synthpod.edj
+ COMMAND ${EDJE_CC} ARGS
+ "-fd" ${CMAKE_CURRENT_SOURCE_DIR}/font
+ "-id" ${CMAKE_CURRENT_SOURCE_DIR}/pix
+ ${CMAKE_CURRENT_SOURCE_DIR}/synthpod.edc
+ ${PROJECT_BINARY_DIR}/synthpod.edj
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/modgrid.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/modlist.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/patcher.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/smart_slider.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/smart_meter.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/smart_spinner.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/smart_toggle.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/synthpod.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/theme.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/omk_logo.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/entry.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/group.edc)
+add_custom_target(THEME ALL DEPENDS ${PROJECT_BINARY_DIR}/synthpod.edj)
+install(FILES ${PROJECT_BINARY_DIR}/synthpod.edj DESTINATION ${SYNTHPOD_DATA_DIR})
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 26193c5d..46d23cd2 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -31,19 +31,17 @@ target_link_libraries(synthpod.lib
set_target_properties(synthpod.lib PROPERTIES OUTPUT_NAME "synthpod")
install(TARGETS synthpod.lib DESTINATION lib)
-if(BUILD_UI)
# synthpod_ui
- add_library(synthpod_ui.lib SHARED
- synthpod_ui.c
- patcher.c
- smart_slider.c
- smart_meter.c
- smart_spinner.c
- smart_toggle.c)
- target_link_libraries(synthpod_ui.lib
- ${ELM_LDFLAGS}
- ${LILV_LDFLAGS}
- ${LV2_LDFLAGS})
- set_target_properties(synthpod_ui.lib PROPERTIES OUTPUT_NAME "synthpod_ui")
- install(TARGETS synthpod_ui.lib DESTINATION lib)
-endif()
+add_library(synthpod_ui.lib SHARED
+ synthpod_ui.c
+ patcher.c
+ smart_slider.c
+ smart_meter.c
+ smart_spinner.c
+ smart_toggle.c)
+target_link_libraries(synthpod_ui.lib
+ ${ELM_LDFLAGS}
+ ${LILV_LDFLAGS}
+ ${LV2_LDFLAGS})
+set_target_properties(synthpod_ui.lib PROPERTIES OUTPUT_NAME "synthpod_ui")
+install(TARGETS synthpod_ui.lib DESTINATION lib)
diff --git a/lib/synthpod_ui.c b/lib/synthpod_ui.c
index f8981122..592745df 100644
--- a/lib/synthpod_ui.c
+++ b/lib/synthpod_ui.c
@@ -369,7 +369,7 @@ _std_port_event(LV2UI_Handle handle, uint32_t index, uint32_t size,
protocol = ui->regs.port.float_protocol.urid;
// check for expanded list
- if(!elm_genlist_item_expanded_get(mod->std.itm))
+ if(!mod->std.itm || !elm_genlist_item_expanded_get(mod->std.itm))
return;
if(protocol == ui->regs.port.float_protocol.urid)
@@ -3785,8 +3785,9 @@ _modgrid_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
sp_ui_t *ui = data;
- elm_scroller_movement_block_set(ui->modgrid,
- ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL | ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
+ if(ui->modgrid)
+ elm_scroller_movement_block_set(ui->modgrid,
+ ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL | ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
}
static void
@@ -3794,7 +3795,8 @@ _modgrid_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
sp_ui_t *ui = data;
- elm_scroller_movement_block_set(ui->modgrid, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
+ if(ui->modgrid)
+ elm_scroller_movement_block_set(ui->modgrid, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
}
static Evas_Object *
@@ -3803,6 +3805,9 @@ _modgrid_content_get(void *data, Evas_Object *obj, const char *part)
mod_t *mod = data;
sp_ui_t *ui = mod->ui;
+ if(!ui->modgrid)
+ return NULL;
+
if(!strcmp(part, "elm.swallow.icon"))
{
Evas_Object *container = elm_layout_add(ui->modgrid);
@@ -4002,7 +4007,7 @@ _patchgrid_content_get(void *data, Evas_Object *obj, const char *part)
{
sp_ui_t *ui = evas_object_data_get(obj, "ui");
Evas_Object **matrix = data;
- if(!ui || !matrix)
+ if(!ui || !ui->patchgrid || !matrix)
return NULL;
if(!strcmp(part, "elm.swallow.icon"))
@@ -4056,7 +4061,7 @@ _theme_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
static void
_pluglist_populate(sp_ui_t *ui, const char *match)
{
- if(!ui->plugs || !ui->pluglist || !ui->plugitc)
+ if(!ui || !ui->plugs || !ui->pluglist || !ui->plugitc)
return;
LILV_FOREACH(plugins, itr, ui->plugs)
@@ -4103,6 +4108,8 @@ static void
_plugentry_changed(void *data, Evas_Object *obj, void *event_info)
{
sp_ui_t *ui = data;
+ if(!ui || !ui->pluglist)
+ return;
const char *chunk = elm_entry_entry_get(obj);
char *match = elm_entry_markup_to_utf8(chunk);
@@ -4115,6 +4122,8 @@ _plugentry_changed(void *data, Evas_Object *obj, void *event_info)
static void
_modlist_clear(sp_ui_t *ui, int clear_system_ports)
{
+ if(!ui || !ui->modlist)
+
// iterate over all registered modules
for(Elm_Object_Item *itm = elm_genlist_first_item_get(ui->modlist);
itm != NULL;
@@ -4137,6 +4146,8 @@ static void
_menu_new(void *data, Evas_Object *obj, void *event_info)
{
sp_ui_t *ui = data;
+ if(!ui)
+ return;
sp_ui_bundle_new(ui);
}
@@ -4147,7 +4158,7 @@ _menu_open(void *data, Evas_Object *obj, void *event_info)
sp_ui_t *ui = data;
const char *bundle_path = event_info;
- if(bundle_path)
+ if(ui && bundle_path)
{
int update_path = ui->driver->features & SP_UI_FEATURE_OPEN ? 1 : 0;
_modlist_clear(ui, 1); // clear system ports
@@ -4161,7 +4172,7 @@ _menu_save_as(void *data, Evas_Object *obj, void *event_info)
sp_ui_t *ui = data;
const char *bundle_path = event_info;
- if(bundle_path)
+ if(ui && bundle_path)
{
int update_path = ui->driver->features & SP_UI_FEATURE_SAVE_AS ? 1 : 0;
sp_ui_bundle_save(ui, bundle_path, update_path);
@@ -4173,7 +4184,7 @@ _menu_save(void *data, Evas_Object *obj, void *event_info)
{
sp_ui_t *ui = data;
- if(ui->bundle_path)
+ if(ui && ui->bundle_path)
sp_ui_bundle_save(ui, ui->bundle_path, 0);
}
@@ -4182,7 +4193,7 @@ _menu_close(void *data, Evas_Object *obj, void *event_info)
{
sp_ui_t *ui = data;
- if(ui->driver->close)
+ if(ui && ui->driver->close)
ui->driver->close(ui->data);
}
@@ -4191,6 +4202,9 @@ _menu_about(void *data, Evas_Object *obj, void *event_info)
{
sp_ui_t *ui = data;
+ if(!ui || !ui->popup)
+ return;
+
elm_popup_timeout_set(ui->popup, 0.f);
if(evas_object_visible_get(ui->popup))
evas_object_hide(ui->popup);
@@ -4202,7 +4216,7 @@ sp_ui_t *
sp_ui_new(Evas_Object *win, const LilvWorld *world, sp_ui_driver_t *driver,
void *data, int show_splash)
{
- if(!win || !driver || !data)
+ if(!driver || !data)
return NULL;
if( !driver->map || !driver->unmap
@@ -4247,279 +4261,304 @@ sp_ui_new(Evas_Object *win, const LilvWorld *world, sp_ui_driver_t *driver,
}
}
- ui->plugitc = elm_genlist_item_class_new();
- if(ui->plugitc)
- {
- ui->plugitc->item_style = "default_style";
- ui->plugitc->func.text_get = _pluglist_label_get;
- ui->plugitc->func.content_get = NULL;
- ui->plugitc->func.state_get = NULL;
- ui->plugitc->func.del = _pluglist_del;
- }
-
- ui->patchitc = elm_gengrid_item_class_new();
- if(ui->patchitc)
+ if(ui->win)
{
- ui->patchitc->item_style = "default";
- ui->patchitc->func.text_get = _patchgrid_label_get;
- ui->patchitc->func.content_get = _patchgrid_content_get;
- ui->patchitc->func.state_get = NULL;
- ui->patchitc->func.del = NULL;
- }
+ ui->plugitc = elm_genlist_item_class_new();
+ if(ui->plugitc)
+ {
+ ui->plugitc->item_style = "default_style";
+ ui->plugitc->func.text_get = _pluglist_label_get;
+ ui->plugitc->func.content_get = NULL;
+ ui->plugitc->func.state_get = NULL;
+ ui->plugitc->func.del = _pluglist_del;
+ }
- ui->propitc = elm_gengrid_item_class_new();
- if(ui->propitc)
- {
- ui->propitc->item_style = "full";
- ui->propitc->func.text_get = NULL;
- ui->propitc->func.content_get = _property_content_get;
- ui->propitc->func.state_get = NULL;
- ui->propitc->func.del = NULL;
- }
+ ui->patchitc = elm_gengrid_item_class_new();
+ if(ui->patchitc)
+ {
+ ui->patchitc->item_style = "default";
+ ui->patchitc->func.text_get = _patchgrid_label_get;
+ ui->patchitc->func.content_get = _patchgrid_content_get;
+ ui->patchitc->func.state_get = NULL;
+ ui->patchitc->func.del = NULL;
+ }
- ui->grpitc = elm_gengrid_item_class_new();
- if(ui->grpitc)
- {
- ui->grpitc->item_style = "full";
- ui->grpitc->func.text_get = NULL;
- ui->grpitc->func.content_get = _group_content_get;
- ui->grpitc->func.state_get = NULL;
- ui->grpitc->func.del = _group_del;
- }
+ ui->propitc = elm_gengrid_item_class_new();
+ if(ui->propitc)
+ {
+ ui->propitc->item_style = "full";
+ ui->propitc->func.text_get = NULL;
+ ui->propitc->func.content_get = _property_content_get;
+ ui->propitc->func.state_get = NULL;
+ ui->propitc->func.del = NULL;
+ }
- ui->moditc = elm_genlist_item_class_new();
- if(ui->moditc)
- {
- ui->moditc->item_style = "full";
- ui->moditc->func.text_get = NULL;
- ui->moditc->func.content_get = _modlist_content_get;
- ui->moditc->func.state_get = NULL;
- ui->moditc->func.del = _modlist_del;
- }
+ ui->grpitc = elm_gengrid_item_class_new();
+ if(ui->grpitc)
+ {
+ ui->grpitc->item_style = "full";
+ ui->grpitc->func.text_get = NULL;
+ ui->grpitc->func.content_get = _group_content_get;
+ ui->grpitc->func.state_get = NULL;
+ ui->grpitc->func.del = _group_del;
+ }
- ui->stditc = elm_genlist_item_class_new();
- if(ui->stditc)
- {
- ui->stditc->item_style = "full";
- ui->stditc->func.text_get = NULL;
- ui->stditc->func.content_get = _modlist_std_content_get;
- ui->stditc->func.state_get = NULL;
- ui->stditc->func.del = NULL;
- }
+ ui->moditc = elm_genlist_item_class_new();
+ if(ui->moditc)
+ {
+ ui->moditc->item_style = "full";
+ ui->moditc->func.text_get = NULL;
+ ui->moditc->func.content_get = _modlist_content_get;
+ ui->moditc->func.state_get = NULL;
+ ui->moditc->func.del = _modlist_del;
+ }
- ui->psetitc = elm_genlist_item_class_new();
- if(ui->psetitc)
- {
- ui->psetitc->item_style = "full";
- ui->psetitc->func.text_get = NULL;
- ui->psetitc->func.content_get = _modlist_psets_content_get;
- ui->psetitc->func.state_get = NULL;
- ui->psetitc->func.del = NULL;
- }
+ ui->stditc = elm_genlist_item_class_new();
+ if(ui->stditc)
+ {
+ ui->stditc->item_style = "full";
+ ui->stditc->func.text_get = NULL;
+ ui->stditc->func.content_get = _modlist_std_content_get;
+ ui->stditc->func.state_get = NULL;
+ ui->stditc->func.del = NULL;
+ }
- ui->psetitmitc = elm_genlist_item_class_new();
- if(ui->psetitmitc)
- {
- ui->psetitmitc->item_style = "default";
- ui->psetitmitc->func.text_get = _modlist_pset_label_get;
- ui->psetitmitc->func.content_get = NULL;
- ui->psetitmitc->func.state_get = NULL;
- ui->psetitmitc->func.del = NULL;
- }
+ ui->psetitc = elm_genlist_item_class_new();
+ if(ui->psetitc)
+ {
+ ui->psetitc->item_style = "full";
+ ui->psetitc->func.text_get = NULL;
+ ui->psetitc->func.content_get = _modlist_psets_content_get;
+ ui->psetitc->func.state_get = NULL;
+ ui->psetitc->func.del = NULL;
+ }
- ui->psetsaveitc = elm_genlist_item_class_new();
- if(ui->psetsaveitc)
- {
- ui->psetsaveitc->item_style = "full";
- ui->psetsaveitc->func.text_get = NULL;
- ui->psetsaveitc->func.content_get = _modlist_pset_content_get;
- ui->psetsaveitc->func.state_get = NULL;
- ui->psetsaveitc->func.del = NULL;
- }
+ ui->psetitmitc = elm_genlist_item_class_new();
+ if(ui->psetitmitc)
+ {
+ ui->psetitmitc->item_style = "default";
+ ui->psetitmitc->func.text_get = _modlist_pset_label_get;
+ ui->psetitmitc->func.content_get = NULL;
+ ui->psetitmitc->func.state_get = NULL;
+ ui->psetitmitc->func.del = NULL;
+ }
- ui->griditc = elm_gengrid_item_class_new();
- if(ui->griditc)
- {
- ui->griditc->item_style = "default";
- ui->griditc->func.text_get = _modgrid_label_get;
- ui->griditc->func.content_get = _modgrid_content_get;
- ui->griditc->func.state_get = NULL;
- ui->griditc->func.del = _modgrid_del;
- }
+ ui->psetsaveitc = elm_genlist_item_class_new();
+ if(ui->psetsaveitc)
+ {
+ ui->psetsaveitc->item_style = "full";
+ ui->psetsaveitc->func.text_get = NULL;
+ ui->psetsaveitc->func.content_get = _modlist_pset_content_get;
+ ui->psetsaveitc->func.state_get = NULL;
+ ui->psetsaveitc->func.del = NULL;
+ }
- ui->table = elm_table_add(ui->win);
- if(ui->table)
- {
- elm_table_homogeneous_set(ui->table, EINA_FALSE);
- elm_table_padding_set(ui->table, 0, 0);
- evas_object_size_hint_weight_set(ui->table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->table, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->table);
+ ui->griditc = elm_gengrid_item_class_new();
+ if(ui->griditc)
+ {
+ ui->griditc->item_style = "default";
+ ui->griditc->func.text_get = _modgrid_label_get;
+ ui->griditc->func.content_get = _modgrid_content_get;
+ ui->griditc->func.state_get = NULL;
+ ui->griditc->func.del = _modgrid_del;
+ }
- // get theme data items
- Evas_Object *theme = elm_layout_add(ui->table);
- if(theme)
+ ui->table = elm_table_add(ui->win);
+ if(ui->table)
{
- elm_layout_file_set(theme, SYNTHPOD_DATA_DIR"/synthpod.edj",
- "/synthpod/theme");
+ elm_table_homogeneous_set(ui->table, EINA_FALSE);
+ elm_table_padding_set(ui->table, 0, 0);
+ evas_object_size_hint_weight_set(ui->table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->table, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->table);
+
+ // get theme data items
+ Evas_Object *theme = elm_layout_add(ui->table);
+ if(theme)
+ {
+ elm_layout_file_set(theme, SYNTHPOD_DATA_DIR"/synthpod.edj",
+ "/synthpod/theme");
- const char *colors_max = elm_layout_data_get(theme, "colors_max");
- ui->colors_max = colors_max ? atoi(colors_max) : 20;
+ const char *colors_max = elm_layout_data_get(theme, "colors_max");
+ ui->colors_max = colors_max ? atoi(colors_max) : 20;
- evas_object_del(theme);
- }
- else
- {
- ui->colors_max = 20;
- }
+ evas_object_del(theme);
+ }
+ else
+ {
+ ui->colors_max = 20;
+ }
- _theme_resize(ui, NULL, ui->win, NULL);
- evas_object_event_callback_add(ui->win, EVAS_CALLBACK_RESIZE, _theme_resize, ui);
- evas_object_event_callback_add(ui->win, EVAS_CALLBACK_KEY_DOWN, _theme_key_down, ui);
+ _theme_resize(ui, NULL, ui->win, NULL);
+ evas_object_event_callback_add(ui->win, EVAS_CALLBACK_RESIZE, _theme_resize, ui);
+ evas_object_event_callback_add(ui->win, EVAS_CALLBACK_KEY_DOWN, _theme_key_down, ui);
- ui->mainmenu = elm_box_add(ui->table);
- if(ui->mainmenu)
- {
- Evas_Object *but;
-
- elm_box_horizontal_set(ui->mainmenu, EINA_TRUE);
- elm_box_homogeneous_set(ui->mainmenu, EINA_FALSE);
- evas_object_size_hint_weight_set(ui->mainmenu, EVAS_HINT_EXPAND, 0.f);
- evas_object_size_hint_align_set(ui->mainmenu, 0.f, 0.f);
- evas_object_show(ui->mainmenu);
- elm_table_pack(ui->table, ui->mainmenu, 0, 0, 1, 1);
-
- if(ui->driver->features & SP_UI_FEATURE_NEW)
+ ui->mainmenu = elm_box_add(ui->table);
+ if(ui->mainmenu)
{
- but = elm_button_add(ui->mainmenu);
- if(but)
+ Evas_Object *but;
+
+ elm_box_horizontal_set(ui->mainmenu, EINA_TRUE);
+ elm_box_homogeneous_set(ui->mainmenu, EINA_FALSE);
+ evas_object_size_hint_weight_set(ui->mainmenu, EVAS_HINT_EXPAND, 0.f);
+ evas_object_size_hint_align_set(ui->mainmenu, 0.f, 0.f);
+ evas_object_show(ui->mainmenu);
+ elm_table_pack(ui->table, ui->mainmenu, 0, 0, 1, 1);
+
+ if(ui->driver->features & SP_UI_FEATURE_NEW)
{
- elm_object_tooltip_text_set(but, "Ctrl+N");
+ but = elm_button_add(ui->mainmenu);
+ if(but)
+ {
+ elm_object_tooltip_text_set(but, "Ctrl+N");
#if defined(ELM_1_10)
- elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
+ elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
#endif
- elm_object_text_set(but, "New");
- evas_object_smart_callback_add(but, "clicked", _menu_new, ui);
- evas_object_show(but);
- elm_box_pack_end(ui->mainmenu, but);
-
- Evas_Object *icon;
- icon = elm_icon_add(but);
- if(icon)
- {
- elm_icon_standard_set(icon, "document-new");
- evas_object_show(icon);
- elm_object_content_set(but, icon);
+ elm_object_text_set(but, "New");
+ evas_object_smart_callback_add(but, "clicked", _menu_new, ui);
+ evas_object_show(but);
+ elm_box_pack_end(ui->mainmenu, but);
+
+ Evas_Object *icon;
+ icon = elm_icon_add(but);
+ if(icon)
+ {
+ elm_icon_standard_set(icon, "document-new");
+ evas_object_show(icon);
+ elm_object_content_set(but, icon);
+ }
}
}
- }
- if(ui->driver->features & (SP_UI_FEATURE_OPEN | SP_UI_FEATURE_IMPORT_FROM) )
- {
- but = elm_fileselector_button_add(ui->mainmenu);
- if(but)
+ if(ui->driver->features & (SP_UI_FEATURE_OPEN | SP_UI_FEATURE_IMPORT_FROM) )
{
- elm_object_tooltip_text_set(but, "Ctrl+O");
+ but = elm_fileselector_button_add(ui->mainmenu);
+ if(but)
+ {
+ elm_object_tooltip_text_set(but, "Ctrl+O");
#if defined(ELM_1_10)
- elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
+ elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
#endif
- elm_fileselector_is_save_set(but, EINA_FALSE);
- elm_fileselector_folder_only_set(but, EINA_TRUE);
- if(ui->driver->features & SP_UI_FEATURE_OPEN)
- elm_object_text_set(but, "Open");
- else if(ui->driver->features & SP_UI_FEATURE_IMPORT_FROM)
- elm_object_text_set(but, "Import");
- evas_object_smart_callback_add(but, "file,chosen", _menu_open, ui);
- evas_object_show(but);
- elm_box_pack_end(ui->mainmenu, but);
-
- Evas_Object *icon;
- icon = elm_icon_add(but);
- if(icon)
- {
+ elm_fileselector_is_save_set(but, EINA_FALSE);
+ elm_fileselector_folder_only_set(but, EINA_TRUE);
if(ui->driver->features & SP_UI_FEATURE_OPEN)
- elm_icon_standard_set(icon, "document-open");
+ elm_object_text_set(but, "Open");
else if(ui->driver->features & SP_UI_FEATURE_IMPORT_FROM)
- elm_icon_standard_set(icon, "document-import");
- evas_object_show(icon);
- elm_object_content_set(but, icon);
- }
+ elm_object_text_set(but, "Import");
+ evas_object_smart_callback_add(but, "file,chosen", _menu_open, ui);
+ evas_object_show(but);
+ elm_box_pack_end(ui->mainmenu, but);
+
+ Evas_Object *icon;
+ icon = elm_icon_add(but);
+ if(icon)
+ {
+ if(ui->driver->features & SP_UI_FEATURE_OPEN)
+ elm_icon_standard_set(icon, "document-open");
+ else if(ui->driver->features & SP_UI_FEATURE_IMPORT_FROM)
+ elm_icon_standard_set(icon, "document-import");
+ evas_object_show(icon);
+ elm_object_content_set(but, icon);
+ }
- ui->load_but = but;
+ ui->load_but = but;
+ }
}
- }
- if(ui->driver->features & SP_UI_FEATURE_SAVE)
- {
- but = elm_button_add(ui->mainmenu);
- if(but)
+ if(ui->driver->features & SP_UI_FEATURE_SAVE)
{
- elm_object_tooltip_text_set(but, "Ctrl+S");
+ but = elm_button_add(ui->mainmenu);
+ if(but)
+ {
+ elm_object_tooltip_text_set(but, "Ctrl+S");
#if defined(ELM_1_10)
- elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
+ elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
#endif
- elm_object_text_set(but, "Save");
- evas_object_smart_callback_add(but, "clicked", _menu_save, ui);
- evas_object_show(but);
- elm_box_pack_end(ui->mainmenu, but);
-
- Evas_Object *icon;
- icon = elm_icon_add(but);
- if(icon)
- {
- elm_icon_standard_set(icon, "document-save");
- evas_object_show(icon);
- elm_object_content_set(but, icon);
+ elm_object_text_set(but, "Save");
+ evas_object_smart_callback_add(but, "clicked", _menu_save, ui);
+ evas_object_show(but);
+ elm_box_pack_end(ui->mainmenu, but);
+
+ Evas_Object *icon;
+ icon = elm_icon_add(but);
+ if(icon)
+ {
+ elm_icon_standard_set(icon, "document-save");
+ evas_object_show(icon);
+ elm_object_content_set(but, icon);
+ }
}
}
- }
- if(ui->driver->features & (SP_UI_FEATURE_SAVE_AS | SP_UI_FEATURE_EXPORT_TO))
- {
- but = elm_fileselector_button_add(ui->mainmenu);
- if(but)
+ if(ui->driver->features & (SP_UI_FEATURE_SAVE_AS | SP_UI_FEATURE_EXPORT_TO))
{
- elm_object_tooltip_text_set(but, "Ctrl+Shift+S");
+ but = elm_fileselector_button_add(ui->mainmenu);
+ if(but)
+ {
+ elm_object_tooltip_text_set(but, "Ctrl+Shift+S");
#if defined(ELM_1_10)
- elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
+ elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
#endif
- elm_fileselector_is_save_set(but, EINA_TRUE);
- elm_fileselector_folder_only_set(but, EINA_TRUE);
- if(ui->driver->features & SP_UI_FEATURE_SAVE_AS)
- elm_object_text_set(but, "Save as");
- else if(ui->driver->features & SP_UI_FEATURE_EXPORT_TO)
- elm_object_text_set(but, "Export");
- evas_object_smart_callback_add(but, "file,chosen", _menu_save_as, ui);
- evas_object_show(but);
- elm_box_pack_end(ui->mainmenu, but);
-
- Evas_Object *icon;
- icon = elm_icon_add(but);
- if(icon)
- {
+ elm_fileselector_is_save_set(but, EINA_TRUE);
+ elm_fileselector_folder_only_set(but, EINA_TRUE);
if(ui->driver->features & SP_UI_FEATURE_SAVE_AS)
- elm_icon_standard_set(icon, "document-save-as");
+ elm_object_text_set(but, "Save as");
else if(ui->driver->features & SP_UI_FEATURE_EXPORT_TO)
- elm_icon_standard_set(icon, "document-export");
- evas_object_show(icon);
- elm_object_content_set(but, icon);
+ elm_object_text_set(but, "Export");
+ evas_object_smart_callback_add(but, "file,chosen", _menu_save_as, ui);
+ evas_object_show(but);
+ elm_box_pack_end(ui->mainmenu, but);
+
+ Evas_Object *icon;
+ icon = elm_icon_add(but);
+ if(icon)
+ {
+ if(ui->driver->features & SP_UI_FEATURE_SAVE_AS)
+ elm_icon_standard_set(icon, "document-save-as");
+ else if(ui->driver->features & SP_UI_FEATURE_EXPORT_TO)
+ elm_icon_standard_set(icon, "document-export");
+ evas_object_show(icon);
+ elm_object_content_set(but, icon);
+ }
+
+ ui->save_as_but = but;
}
+ }
- ui->save_as_but = but;
+ if(ui->driver->features & SP_UI_FEATURE_CLOSE)
+ {
+ but = elm_button_add(ui->mainmenu);
+ if(but)
+ {
+ elm_object_tooltip_text_set(but, "Ctrl+Q");
+#if defined(ELM_1_10)
+ elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
+#endif
+ elm_object_text_set(but, "Close");
+ evas_object_smart_callback_add(but, "clicked", _menu_close, ui);
+ evas_object_show(but);
+ elm_box_pack_end(ui->mainmenu, but);
+
+ Evas_Object *icon;
+ icon = elm_icon_add(but);
+ if(icon)
+ {
+ elm_icon_standard_set(icon, "application-exit");
+ evas_object_show(icon);
+ elm_object_content_set(but, icon);
+ }
+ }
}
- }
- if(ui->driver->features & SP_UI_FEATURE_CLOSE)
- {
but = elm_button_add(ui->mainmenu);
if(but)
{
- elm_object_tooltip_text_set(but, "Ctrl+Q");
+ elm_object_tooltip_text_set(but, "Ctrl+?");
#if defined(ELM_1_10)
- elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
+ elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
#endif
- elm_object_text_set(but, "Close");
- evas_object_smart_callback_add(but, "clicked", _menu_close, ui);
+ elm_object_text_set(but, "About");
+ evas_object_smart_callback_add(but, "clicked", _menu_about, ui);
evas_object_show(but);
elm_box_pack_end(ui->mainmenu, but);
@@ -4527,240 +4566,218 @@ sp_ui_new(Evas_Object *win, const LilvWorld *world, sp_ui_driver_t *driver,
icon = elm_icon_add(but);
if(icon)
{
- elm_icon_standard_set(icon, "application-exit");
+ elm_icon_standard_set(icon, "help-about");
evas_object_show(icon);
elm_object_content_set(but, icon);
}
}
- }
-
- but = elm_button_add(ui->mainmenu);
- if(but)
- {
- elm_object_tooltip_text_set(but, "Ctrl+?");
-#if defined(ELM_1_10)
- elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_BOTTOM);
-#endif
- elm_object_text_set(but, "About");
- evas_object_smart_callback_add(but, "clicked", _menu_about, ui);
- evas_object_show(but);
- elm_box_pack_end(ui->mainmenu, but);
-
- Evas_Object *icon;
- icon = elm_icon_add(but);
- if(icon)
- {
- elm_icon_standard_set(icon, "help-about");
- evas_object_show(icon);
- elm_object_content_set(but, icon);
- }
- }
- } // mainmenu
+ } // mainmenu
- ui->mainpane = elm_panes_add(ui->table);
- if(ui->mainpane)
- {
- elm_panes_horizontal_set(ui->mainpane, EINA_FALSE);
- elm_panes_content_left_size_set(ui->mainpane, 0.5);
- evas_object_size_hint_weight_set(ui->mainpane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->mainpane, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->mainpane);
- elm_table_pack(ui->table, ui->mainpane, 0, 1, 1, 1);
-
- ui->popup = elm_popup_add(ui->table);
- if(ui->popup)
+ ui->mainpane = elm_panes_add(ui->table);
+ if(ui->mainpane)
{
- elm_popup_allow_events_set(ui->popup, EINA_TRUE);
- if(show_splash)
- evas_object_show(ui->popup);
-
- Evas_Object *hbox = elm_box_add(ui->popup);
- if(hbox)
+ elm_panes_horizontal_set(ui->mainpane, EINA_FALSE);
+ elm_panes_content_left_size_set(ui->mainpane, 0.5);
+ evas_object_size_hint_weight_set(ui->mainpane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->mainpane, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->mainpane);
+ elm_table_pack(ui->table, ui->mainpane, 0, 1, 1, 1);
+
+ ui->popup = elm_popup_add(ui->table);
+ if(ui->popup)
{
- elm_box_horizontal_set(hbox, EINA_TRUE);
- elm_box_homogeneous_set(hbox, EINA_FALSE);
- elm_box_padding_set(hbox, 10, 0);
- evas_object_show(hbox);
- elm_object_content_set(ui->popup, hbox);
+ elm_popup_allow_events_set(ui->popup, EINA_TRUE);
+ if(show_splash)
+ evas_object_show(ui->popup);
- Evas_Object *icon = elm_icon_add(hbox);
- if(icon)
+ Evas_Object *hbox = elm_box_add(ui->popup);
+ if(hbox)
{
- elm_image_file_set(icon, SYNTHPOD_DATA_DIR"/synthpod.edj",
- "/omk/logo");
- evas_object_size_hint_min_set(icon, 128, 128);
- evas_object_size_hint_max_set(icon, 256, 256);
- evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
- evas_object_show(icon);
- elm_box_pack_end(hbox, icon);
- }
+ elm_box_horizontal_set(hbox, EINA_TRUE);
+ elm_box_homogeneous_set(hbox, EINA_FALSE);
+ elm_box_padding_set(hbox, 10, 0);
+ evas_object_show(hbox);
+ elm_object_content_set(ui->popup, hbox);
+
+ Evas_Object *icon = elm_icon_add(hbox);
+ if(icon)
+ {
+ elm_image_file_set(icon, SYNTHPOD_DATA_DIR"/synthpod.edj",
+ "/omk/logo");
+ evas_object_size_hint_min_set(icon, 128, 128);
+ evas_object_size_hint_max_set(icon, 256, 256);
+ evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
+ evas_object_show(icon);
+ elm_box_pack_end(hbox, icon);
+ }
- Evas_Object *label = elm_label_add(hbox);
- if(label)
- {
- elm_object_text_set(label,
- "<color=#b00 shadow_color=#fff font_size=20>"
- "Synthpod - Plugin Container"
- "</color></br><align=left>"
- "Version "SYNTHPOD_VERSION"</br></br>"
- "Copyright (c) 2015 Hanspeter Portner</br></br>"
- "This is free and libre software</br>"
- "Released under Artistic License 2.0</br>"
- "By Open Music Kontrollers</br></br>"
- "<color=#bbb>"
- "http://open-music-kontrollers.ch/lv2/synthpod</br>"
- "dev@open-music-kontrollers.ch"
- "</color></align>");
-
- evas_object_show(label);
- elm_box_pack_end(hbox, label);
+ Evas_Object *label = elm_label_add(hbox);
+ if(label)
+ {
+ elm_object_text_set(label,
+ "<color=#b00 shadow_color=#fff font_size=20>"
+ "Synthpod - Plugin Container"
+ "</color></br><align=left>"
+ "Version "SYNTHPOD_VERSION"</br></br>"
+ "Copyright (c) 2015 Hanspeter Portner</br></br>"
+ "This is free and libre software</br>"
+ "Released under Artistic License 2.0</br>"
+ "By Open Music Kontrollers</br></br>"
+ "<color=#bbb>"
+ "http://open-music-kontrollers.ch/lv2/synthpod</br>"
+ "dev@open-music-kontrollers.ch"
+ "</color></align>");
+
+ evas_object_show(label);
+ elm_box_pack_end(hbox, label);
+ }
}
}
- }
- ui->leftpane = elm_panes_add(ui->mainpane);
- if(ui->leftpane)
- {
- elm_panes_horizontal_set(ui->leftpane, EINA_FALSE);
- elm_panes_content_left_size_set(ui->leftpane, 0.5);
- evas_object_size_hint_weight_set(ui->leftpane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->leftpane, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->leftpane);
- elm_object_part_content_set(ui->mainpane, "left", ui->leftpane);
-
- ui->plugpane = elm_panes_add(ui->mainpane);
- if(ui->plugpane)
+ ui->leftpane = elm_panes_add(ui->mainpane);
+ if(ui->leftpane)
{
- elm_panes_horizontal_set(ui->plugpane, EINA_TRUE);
- elm_panes_content_left_size_set(ui->plugpane, 0.33);
- evas_object_size_hint_weight_set(ui->plugpane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->plugpane, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->plugpane);
- elm_object_part_content_set(ui->leftpane, "left", ui->plugpane);
-
- ui->plugbox = elm_box_add(ui->plugpane);
- if(ui->plugbox)
+ elm_panes_horizontal_set(ui->leftpane, EINA_FALSE);
+ elm_panes_content_left_size_set(ui->leftpane, 0.5);
+ evas_object_size_hint_weight_set(ui->leftpane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->leftpane, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->leftpane);
+ elm_object_part_content_set(ui->mainpane, "left", ui->leftpane);
+
+ ui->plugpane = elm_panes_add(ui->mainpane);
+ if(ui->plugpane)
{
- elm_box_horizontal_set(ui->plugbox, EINA_FALSE);
- elm_box_homogeneous_set(ui->plugbox, EINA_FALSE);
- evas_object_data_set(ui->plugbox, "ui", ui);
- evas_object_size_hint_weight_set(ui->plugbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->plugbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->plugbox);
- elm_object_part_content_set(ui->plugpane, "left", ui->plugbox);
-
- ui->plugentry = elm_entry_add(ui->plugbox);
- if(ui->plugentry)
- {
- elm_entry_entry_set(ui->plugentry, "");
- elm_entry_editable_set(ui->plugentry, EINA_TRUE);
- elm_entry_single_line_set(ui->plugentry, EINA_TRUE);
- elm_entry_scrollable_set(ui->plugentry, EINA_TRUE);
- evas_object_smart_callback_add(ui->plugentry, "changed,user", _plugentry_changed, ui);
- evas_object_data_set(ui->plugentry, "ui", ui);
- //evas_object_size_hint_weight_set(ui->plugentry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->plugentry, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->plugentry);
- elm_box_pack_end(ui->plugbox, ui->plugentry);
- } // plugentry
-
- ui->pluglist = elm_genlist_add(ui->plugbox);
- if(ui->pluglist)
+ elm_panes_horizontal_set(ui->plugpane, EINA_TRUE);
+ elm_panes_content_left_size_set(ui->plugpane, 0.33);
+ evas_object_size_hint_weight_set(ui->plugpane, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->plugpane, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->plugpane);
+ elm_object_part_content_set(ui->leftpane, "left", ui->plugpane);
+
+ ui->plugbox = elm_box_add(ui->plugpane);
+ if(ui->plugbox)
{
- //elm_genlist_homogeneous_set(ui->pluglist, EINA_TRUE); // needef for lazy-loading
- evas_object_smart_callback_add(ui->pluglist, "activated",
- _pluglist_activated, ui);
- evas_object_smart_callback_add(ui->pluglist, "expand,request",
- _list_expand_request, ui);
- evas_object_smart_callback_add(ui->pluglist, "contract,request",
- _list_contract_request, ui);
- evas_object_smart_callback_add(ui->pluglist, "expanded",
- _pluglist_expanded, ui);
- evas_object_smart_callback_add(ui->pluglist, "contracted",
- _pluglist_contracted, ui);
- evas_object_data_set(ui->pluglist, "ui", ui);
- evas_object_size_hint_weight_set(ui->pluglist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->pluglist, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->pluglist);
- elm_box_pack_end(ui->plugbox, ui->pluglist);
- } // pluglist
- } // plugbox
-
- ui->patchgrid = elm_gengrid_add(ui->plugpane);
- if(ui->patchgrid)
- {
- elm_gengrid_horizontal_set(ui->patchgrid, EINA_FALSE);
- elm_gengrid_select_mode_set(ui->patchgrid, ELM_OBJECT_SELECT_MODE_NONE);
- elm_gengrid_reorder_mode_set(ui->patchgrid, EINA_TRUE);
- elm_gengrid_item_size_set(ui->patchgrid, 400, 400);
- evas_object_data_set(ui->patchgrid, "ui", ui);
- evas_object_size_hint_weight_set(ui->patchgrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->patchgrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->patchgrid);
- elm_object_part_content_set(ui->plugpane, "right", ui->patchgrid);
-
- for(int t=0; t<PORT_TYPE_NUM; t++)
+ elm_box_horizontal_set(ui->plugbox, EINA_FALSE);
+ elm_box_homogeneous_set(ui->plugbox, EINA_FALSE);
+ evas_object_data_set(ui->plugbox, "ui", ui);
+ evas_object_size_hint_weight_set(ui->plugbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->plugbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->plugbox);
+ elm_object_part_content_set(ui->plugpane, "left", ui->plugbox);
+
+ ui->plugentry = elm_entry_add(ui->plugbox);
+ if(ui->plugentry)
+ {
+ elm_entry_entry_set(ui->plugentry, "");
+ elm_entry_editable_set(ui->plugentry, EINA_TRUE);
+ elm_entry_single_line_set(ui->plugentry, EINA_TRUE);
+ elm_entry_scrollable_set(ui->plugentry, EINA_TRUE);
+ evas_object_smart_callback_add(ui->plugentry, "changed,user", _plugentry_changed, ui);
+ evas_object_data_set(ui->plugentry, "ui", ui);
+ //evas_object_size_hint_weight_set(ui->plugentry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->plugentry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->plugentry);
+ elm_box_pack_end(ui->plugbox, ui->plugentry);
+ } // plugentry
+
+ ui->pluglist = elm_genlist_add(ui->plugbox);
+ if(ui->pluglist)
+ {
+ //elm_genlist_homogeneous_set(ui->pluglist, EINA_TRUE); // needef for lazy-loading
+ evas_object_smart_callback_add(ui->pluglist, "activated",
+ _pluglist_activated, ui);
+ evas_object_smart_callback_add(ui->pluglist, "expand,request",
+ _list_expand_request, ui);
+ evas_object_smart_callback_add(ui->pluglist, "contract,request",
+ _list_contract_request, ui);
+ evas_object_smart_callback_add(ui->pluglist, "expanded",
+ _pluglist_expanded, ui);
+ evas_object_smart_callback_add(ui->pluglist, "contracted",
+ _pluglist_contracted, ui);
+ evas_object_data_set(ui->pluglist, "ui", ui);
+ evas_object_size_hint_weight_set(ui->pluglist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->pluglist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->pluglist);
+ elm_box_pack_end(ui->plugbox, ui->pluglist);
+ } // pluglist
+ } // plugbox
+
+ ui->patchgrid = elm_gengrid_add(ui->plugpane);
+ if(ui->patchgrid)
{
- Elm_Object_Item *itm = elm_gengrid_item_append(ui->patchgrid, ui->patchitc,
- &ui->matrix[t], NULL, NULL);
- }
- } // patchgrid
- } // plugpane
+ elm_gengrid_horizontal_set(ui->patchgrid, EINA_FALSE);
+ elm_gengrid_select_mode_set(ui->patchgrid, ELM_OBJECT_SELECT_MODE_NONE);
+ elm_gengrid_reorder_mode_set(ui->patchgrid, EINA_TRUE);
+ elm_gengrid_item_size_set(ui->patchgrid, 400, 400);
+ evas_object_data_set(ui->patchgrid, "ui", ui);
+ evas_object_size_hint_weight_set(ui->patchgrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->patchgrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->patchgrid);
+ elm_object_part_content_set(ui->plugpane, "right", ui->patchgrid);
+
+ for(int t=0; t<PORT_TYPE_NUM; t++)
+ {
+ Elm_Object_Item *itm = elm_gengrid_item_append(ui->patchgrid, ui->patchitc,
+ &ui->matrix[t], NULL, NULL);
+ }
+ } // patchgrid
+ } // plugpane
- ui->modlist = elm_genlist_add(ui->leftpane);
- if(ui->modlist)
+ ui->modlist = elm_genlist_add(ui->leftpane);
+ if(ui->modlist)
+ {
+ elm_genlist_homogeneous_set(ui->modlist, EINA_TRUE); // needef for lazy-loading
+ elm_genlist_block_count_set(ui->modlist, 64); // needef for lazy-loading
+ //elm_genlist_select_mode_set(ui->modlist, ELM_OBJECT_SELECT_MODE_NONE);
+ elm_genlist_reorder_mode_set(ui->modlist, EINA_TRUE);
+ evas_object_smart_callback_add(ui->modlist, "expand,request",
+ _list_expand_request, ui);
+ evas_object_smart_callback_add(ui->modlist, "contract,request",
+ _list_contract_request, ui);
+ evas_object_smart_callback_add(ui->modlist, "expanded",
+ _modlist_expanded, ui);
+ evas_object_smart_callback_add(ui->modlist, "contracted",
+ _modlist_contracted, ui);
+ evas_object_smart_callback_add(ui->modlist, "activated",
+ _modlist_activated, ui);
+ evas_object_smart_callback_add(ui->modlist, "moved",
+ _modlist_moved, ui);
+ evas_object_data_set(ui->modlist, "ui", ui);
+ evas_object_size_hint_weight_set(ui->modlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->modlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->modlist);
+ elm_object_part_content_set(ui->leftpane, "right", ui->modlist);
+ } // modlist
+ } // leftpane
+
+ ui->modgrid = elm_gengrid_add(ui->mainpane);
+ if(ui->modgrid)
{
- elm_genlist_homogeneous_set(ui->modlist, EINA_TRUE); // needef for lazy-loading
- elm_genlist_block_count_set(ui->modlist, 64); // needef for lazy-loading
- //elm_genlist_select_mode_set(ui->modlist, ELM_OBJECT_SELECT_MODE_NONE);
- elm_genlist_reorder_mode_set(ui->modlist, EINA_TRUE);
- evas_object_smart_callback_add(ui->modlist, "expand,request",
- _list_expand_request, ui);
- evas_object_smart_callback_add(ui->modlist, "contract,request",
- _list_contract_request, ui);
- evas_object_smart_callback_add(ui->modlist, "expanded",
- _modlist_expanded, ui);
- evas_object_smart_callback_add(ui->modlist, "contracted",
- _modlist_contracted, ui);
- evas_object_smart_callback_add(ui->modlist, "activated",
- _modlist_activated, ui);
- evas_object_smart_callback_add(ui->modlist, "moved",
- _modlist_moved, ui);
- evas_object_data_set(ui->modlist, "ui", ui);
- evas_object_size_hint_weight_set(ui->modlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->modlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->modlist);
- elm_object_part_content_set(ui->leftpane, "right", ui->modlist);
- } // modlist
- } // leftpane
-
- ui->modgrid = elm_gengrid_add(ui->mainpane);
- if(ui->modgrid)
+ elm_gengrid_select_mode_set(ui->modgrid, ELM_OBJECT_SELECT_MODE_NONE);
+ elm_gengrid_reorder_mode_set(ui->modgrid, EINA_TRUE);
+ elm_gengrid_item_size_set(ui->modgrid, 600, 400);
+ evas_object_data_set(ui->modgrid, "ui", ui);
+ evas_object_size_hint_weight_set(ui->modgrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui->modgrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->modgrid);
+ elm_object_part_content_set(ui->mainpane, "right", ui->modgrid);
+ } // modgrid
+ } // mainpane
+
+ ui->statusline = elm_label_add(ui->table);
+ if(ui->statusline)
{
- elm_gengrid_select_mode_set(ui->modgrid, ELM_OBJECT_SELECT_MODE_NONE);
- elm_gengrid_reorder_mode_set(ui->modgrid, EINA_TRUE);
- elm_gengrid_item_size_set(ui->modgrid, 600, 400);
- evas_object_data_set(ui->modgrid, "ui", ui);
- evas_object_size_hint_weight_set(ui->modgrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(ui->modgrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(ui->modgrid);
- elm_object_part_content_set(ui->mainpane, "right", ui->modgrid);
- } // modgrid
- } // mainpane
-
- ui->statusline = elm_label_add(ui->table);
- if(ui->statusline)
- {
- //TODO use
- elm_object_text_set(ui->statusline, "[status]");
- evas_object_size_hint_weight_set(ui->statusline, EVAS_HINT_EXPAND, 0.f);
- evas_object_size_hint_align_set(ui->statusline, 0.f, 1.f);
- evas_object_show(ui->statusline);
- elm_table_pack(ui->table, ui->statusline, 0, 2, 1, 1);
- } // statusline
+ //TODO use
+ elm_object_text_set(ui->statusline, "[status]");
+ evas_object_size_hint_weight_set(ui->statusline, EVAS_HINT_EXPAND, 0.f);
+ evas_object_size_hint_align_set(ui->statusline, 0.f, 1.f);
+ evas_object_show(ui->statusline);
+ elm_table_pack(ui->table, ui->statusline, 0, 2, 1, 1);
+ } // statusline
- //TODO add info button
- } // theme
+ //TODO add info button
+ } // theme
+ }
// initialzie registry
sp_regs_init(&ui->regs, ui->world, ui->driver->map);
@@ -4783,7 +4800,7 @@ sp_ui_widget_get(sp_ui_t *ui)
static inline mod_t *
_sp_ui_mod_get(sp_ui_t *ui, u_id_t uid)
{
- if(!ui->modlist)
+ if(!ui || !ui->modlist)
return NULL;
for(Elm_Object_Item *itm = elm_genlist_first_item_get(ui->modlist);
@@ -4829,19 +4846,25 @@ sp_ui_from_app(sp_ui_t *ui, const LV2_Atom *atom)
if(mod->system.source || mod->system.sink || !ui->sink_itm)
{
- mod->std.itm = elm_genlist_item_append(ui->modlist, ui->moditc, mod,
- NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
+ if(ui->modlist)
+ {
+ mod->std.itm = elm_genlist_item_append(ui->modlist, ui->moditc, mod,
+ NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
+ }
if(mod->system.sink)
ui->sink_itm = mod->std.itm;
}
else // no sink and no source
{
- mod->std.itm = elm_genlist_item_insert_before(ui->modlist, ui->moditc, mod,
- NULL, ui->sink_itm, ELM_GENLIST_ITEM_TREE, NULL, NULL);
+ if(ui->modlist)
+ {
+ mod->std.itm = elm_genlist_item_insert_before(ui->modlist, ui->moditc, mod,
+ NULL, ui->sink_itm, ELM_GENLIST_ITEM_TREE, NULL, NULL);
+ }
}
- if(mod->eo.ui) // has EoUI
+ if(mod->eo.ui && ui->modgrid) // has EoUI
{
mod->eo.embedded.itm = elm_gengrid_item_append(ui->modgrid, ui->griditc, mod,
NULL, NULL);
@@ -4869,9 +4892,12 @@ sp_ui_from_app(sp_ui_t *ui, const LV2_Atom *atom)
}
// remove StdUI list item
- elm_genlist_item_expanded_set(mod->std.itm, EINA_FALSE);
- elm_object_item_del(mod->std.itm);
- mod->std.itm = NULL;
+ if(mod->std.itm)
+ {
+ elm_genlist_item_expanded_set(mod->std.itm, EINA_FALSE);
+ elm_object_item_del(mod->std.itm);
+ mod->std.itm = NULL;
+ }
_patches_update(ui);
}
@@ -5040,10 +5066,11 @@ sp_ui_from_app(sp_ui_t *ui, const LV2_Atom *atom)
void
sp_ui_resize(sp_ui_t *ui, int w, int h)
{
- if(!ui || !ui->table)
+ if(!ui)
return;
- evas_object_resize(ui->table, w, h);
+ if(ui->table)
+ evas_object_resize(ui->table, w, h);
}
void
@@ -5170,9 +5197,11 @@ sp_ui_bundle_load(sp_ui_t *ui, const char *bundle_path, int update_path)
free(ui->bundle_path);
ui->bundle_path = strdup(bundle_path);
}
-
- elm_fileselector_path_set(ui->load_but, bundle_path);
- elm_fileselector_path_set(ui->save_as_but, bundle_path);
+
+ if(ui->load_but)
+ elm_fileselector_path_set(ui->load_but, bundle_path);
+ if(ui->save_as_but)
+ elm_fileselector_path_set(ui->save_as_but, bundle_path);
// signal to app
size_t size = sizeof(transmit_bundle_load_t)
@@ -5208,9 +5237,11 @@ sp_ui_bundle_save(sp_ui_t *ui, const char *bundle_path, int update_path)
free(ui->bundle_path);
ui->bundle_path = strdup(bundle_path);
}
-
- elm_fileselector_path_set(ui->load_but, bundle_path);
- elm_fileselector_path_set(ui->save_as_but, bundle_path);
+
+ if(ui->load_but)
+ elm_fileselector_path_set(ui->load_but, bundle_path);
+ if(ui->save_as_but)
+ elm_fileselector_path_set(ui->save_as_but, bundle_path);
// signal to app
size_t size = sizeof(transmit_bundle_save_t)
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 06994a72..8734ac38 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -34,35 +34,28 @@ set_target_properties(synthpod.lv2 PROPERTIES PREFIX "" OUTPUT_NAME "synthpod")
install(TARGETS synthpod.lv2 DESTINATION ${SYNTHPOD_PLUGIN_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/synthpod.ttl DESTINATION ${SYNTHPOD_PLUGIN_DIR})
-if(BUILD_UI)
- 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()
-
- set(EO_UI_WRAP "")
- set(UI_UI_WRAP "")
- set(KX_UI_WRAP "")
-
-# synthpod_ui
- add_library(synthpod_ui.lv2 MODULE
- synthpod_lv2_ui.c
- synthpod_common_ui.c
- synthpod_keyboard_ui.c)
- target_link_libraries(synthpod_ui.lv2 synthpod_ui.lib)
- set_target_properties(synthpod_ui.lv2 PROPERTIES PREFIX "" OUTPUT_NAME "synthpod_ui")
- install(TARGETS synthpod_ui.lv2 DESTINATION ${SYNTHPOD_PLUGIN_DIR})
+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()
- set(EO_UI_WRAP "#")
- set(UI_UI_WRAP "#")
- set(KX_UI_WRAP "#")
+ message(STATUS "X11 UI wrap disabled")
set(X11_UI_WRAP "#")
endif()
+set(EO_UI_WRAP "")
+set(UI_UI_WRAP "")
+set(KX_UI_WRAP "")
+
+# synthpod_ui
+add_library(synthpod_ui.lv2 MODULE
+ synthpod_lv2_ui.c
+ synthpod_common_ui.c
+ synthpod_keyboard_ui.c)
+target_link_libraries(synthpod_ui.lv2 synthpod_ui.lib)
+set_target_properties(synthpod_ui.lv2 PROPERTIES PREFIX "" OUTPUT_NAME "synthpod_ui")
+install(TARGETS synthpod_ui.lv2 DESTINATION ${SYNTHPOD_PLUGIN_DIR})
+
# manifest
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/manifest.ttl.in ${PROJECT_BINARY_DIR}/plugins/manifest.ttl)
install(FILES ${PROJECT_BINARY_DIR}/plugins/manifest.ttl DESTINATION ${SYNTHPOD_PLUGIN_DIR})