summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandros Theodotou <alex@zrythm.org>2019-06-10 00:48:35 +0100
committerAlexandros Theodotou <alex@zrythm.org>2019-06-10 01:04:44 +0100
commitc8817e6114a85ca12e1c81db514c2881cd9dc3f5 (patch)
tree6e23505bb7aede303b5a59588ad6e43a455b9f89
parent27f3298b769c8af8c5ef106186faa34a4fc399bf (diff)
downloadzrythm-c8817e6114a85ca12e1c81db514c2881cd9dc3f5.zip
zrythm-c8817e6114a85ca12e1c81db514c2881cd9dc3f5.tar.gz
zrythm-c8817e6114a85ca12e1c81db514c2881cd9dc3f5.tar.bz2
fix issues with plugins and add some missing configs from previous autotools conf
-rw-r--r--AUTHORS12
-rw-r--r--THANKS16
-rw-r--r--TRANSLATORS2
-rw-r--r--inc/plugins/lv2/suil.h2
-rw-r--r--inc/plugins/plugin.h10
-rw-r--r--meson.build71
-rw-r--r--meson_options.txt6
-rw-r--r--src/audio/port.c8
-rw-r--r--src/meson.build2
-rw-r--r--src/plugins/lv2/meson.build2
-rw-r--r--src/plugins/lv2/x11_in_gtk3.c62
-rw-r--r--src/plugins/lv2_plugin.c10
-rw-r--r--src/plugins/plugin.c30
13 files changed, 189 insertions, 44 deletions
diff --git a/AUTHORS b/AUTHORS
index 4333c95..7633b8d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,10 @@
-Alexandros Theodotou <alex at zrythm dot org>
-Sascha Bast <sash@mischkonsum.org>
+Alexandros Theodotou <alex@zrythm.org>
+
+Contributors:
+
+ * Sascha Bast <sash@mischkonsum.org>
+ * Piano roll auto-scroll
+ * Robin Gareus <robin@gareus.org>
+ * Routing algorithm
+ * Georg Krause
+ * Forward and backward button callbacks
diff --git a/THANKS b/THANKS
index 01551e1..3c07588 100644
--- a/THANKS
+++ b/THANKS
@@ -2,9 +2,13 @@
# (for copyright purposes) significant amounts of code but
# should be thanked anyway for their contributions and support
-Daniel Peterson minor fixes
-Yustin minor GSource fixes, helping with
- optimization
-Adam Kosmin ideas, financial contributions
-bill-auger coming up with the Zrythm tagline
-sub26nico French translations
+* Daniel Peterson
+ * Minor fixes
+* Yustin
+ * GSource fixes
+ * Help with optimization
+* Adam Kosmin
+ * UI ideas
+ * Financial contribution
+* bill-auger
+ * Coming up with the Zrythm tagline
diff --git a/TRANSLATORS b/TRANSLATORS
new file mode 100644
index 0000000..b23c524
--- /dev/null
+++ b/TRANSLATORS
@@ -0,0 +1,2 @@
+French:
+ * Nicolas Faure <sub26nico@laposte.net>
diff --git a/inc/plugins/lv2/suil.h b/inc/plugins/lv2/suil.h
index c5bacfd..95b3cd3 100644
--- a/inc/plugins/lv2/suil.h
+++ b/inc/plugins/lv2/suil.h
@@ -1,5 +1,5 @@
/*
- Copyright 2007-2017 David Robillard <http://drobilla.net>
+ Copyright 2011-2017 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff --git a/inc/plugins/plugin.h b/inc/plugins/plugin.h
index b80f48b..cbd8dbe 100644
--- a/inc/plugins/plugin.h
+++ b/inc/plugins/plugin.h
@@ -157,7 +157,7 @@ typedef struct Plugin
int enabled;
/** Plugin automatables. */
- Automatable * automatables[900];
+ Automatable ** automatables;
int num_automatables;
/** Whether plugin UI is opened or not. */
@@ -300,6 +300,14 @@ void
plugin_init_loaded (Plugin * plgn);
/**
+ * Adds an Automatable to the Plugin.
+ */
+void
+plugin_add_automatable (
+ Plugin * pl,
+ Automatable * a);
+
+/**
* Creates/initializes a plugin and its internal
* plugin (LV2, etc.)
* using the given descriptor.
diff --git a/meson.build b/meson.build
index 222f9c7..8715418 100644
--- a/meson.build
+++ b/meson.build
@@ -118,8 +118,8 @@ if cc.get_id() == 'msvc'
# Compiler options taken from msvc_recommended_pragmas.h
# in GLib, based on _Win32_Programming_ by Rector and Newcomer
test_cflags = []
- add_project_arguments('-FImsvc_recommended_pragmas.h', language: 'c')
- add_project_arguments('-D_USE_MATH_DEFINES', language: 'c')
+ add_project_arguments('-FImsvc_recommended_pragmas.h', language: [ 'c', 'cpp' ])
+ add_project_arguments('-D_USE_MATH_DEFINES', language: [ 'c', 'cpp' ])
elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
test_cflags = [
'-Wall',
@@ -127,7 +127,6 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-Wno-unused-parameter',
'-Wno-sequence-point',
'-Wignored-qualifiers',
- '-Wno-bad-function-cast',
'-Wno-cast-function-type',
'-Werror=maybe-uninitialized',
'-Werror=implicit-function-declaration',
@@ -140,8 +139,6 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-Werror=implicit-int',
'-Werror=multistatement-macros',
'-Werror=switch',
- '-Werror=absolute-value',
- '-Werror=parentheses-equality',
'-Werror=overflow',
'-Werror=array-bounds',
]
@@ -149,6 +146,10 @@ else
test_cflags = []
endif
+if get_option ('enable_profiling')
+ test_cflags += [ '-g', '-pg', 'no-pie' ]
+endif
+
if (os_win32)
test_cflags += [
'-mms-bitfields',
@@ -160,10 +161,6 @@ else
]
endif
-if get_option ('enable_profiling')
- test_cflags += '-pg'
-endif
-
common_cflags = []
foreach f : test_cflags
if cc.has_argument (f)
@@ -173,6 +170,10 @@ endforeach
test_ldflags = []
+if get_option ('enable_profiling')
+ test_ldflags += [ '-g', '-pg', 'no-pie' ]
+endif
+
if os_win32
test_ldflags += [
'-fno-stack-protector',
@@ -187,7 +188,6 @@ endif
if os_linux
test_ldflags += [
- '-lrt',
'-lasound',
]
endif
@@ -204,10 +204,6 @@ if os_freebsd
]
endif
-if get_option ('enable_profiling')
- test_ldflags += '-pg'
-endif
-
if (meson.version() >= '0.46.0')
common_ldflags = cc.get_supported_link_arguments (
test_ldflags)
@@ -216,6 +212,14 @@ else
endif
# set config defines
+libgtop_dep = dependency('libgtop-2.0', required: false)
+if (libgtop_dep.found ())
+ cdata.set('HAVE_LIBGTOP', 1)
+endif
+x11_dep = dependency('x11', required: false)
+if (x11_dep.found ())
+ cdata.set('HAVE_X11', 1)
+endif
jack_dep = dependency ('jack', required: false)
if (jack_dep.found ())
cdata.set('HAVE_JACK', 1)
@@ -225,6 +229,7 @@ port_audio_dep = dependency (
if (port_audio_dep.found ())
cdata.set('HAVE_PORT_AUDIO', 1)
endif
+qt5_dep = dependency('Qt5Widgets', required: false)
yaml_dep = dependency('yaml-0.1')
gtk_dep = dependency('gtk+-3.0', version: '>=3.20')
@@ -236,15 +241,27 @@ zrythm_deps = [
yaml_dep,
gtk_dep,
sndfile_dep,
+ libgtop_dep,
dependency('threads'),
dependency('lilv-0', version: '>=0.24.2'),
dependency('samplerate', version: '>=0.1.8'),
dependency('lv2', version: '>=1.14.0'),
- dependency('Qt5Widgets', required: false),
libm,
- cc.find_library('rt', required: false),
]
+if (qt5_dep.found() and get_option('enable_qt5'))
+ cdata.set('HAVE_QT5', 1)
+ zrythm_deps += qt5_dep
+endif
+
+if os_linux
+ zrythm_deps += cc.find_library('rt')
+endif
+
+if os_linux or os_freebsd
+ zrythm_deps += x11_dep
+endif
+
if (os_darwin)
zrythm_deps += dependency (
'appleframeworks',
@@ -260,14 +277,30 @@ configure_file (
configuration: cdata,
)
+test_cflags_c_only = [
+ '-Wno-bad-function-cast',
+ '-Werror=absolute-value',
+ '-Werror=parentheses-equality',
+ ]
+
+common_cflags_c_only = []
+foreach f : test_cflags_c_only
+ if cc.has_argument (f)
+ common_cflags_c_only += f
+ endif
+endforeach
+
+add_project_arguments (
+ common_cflags_c_only,
+ language: [ 'c' ]
+ )
add_project_arguments (
common_cflags,
- language: 'c'
+ language: [ 'c', 'cpp' ],
)
-
add_project_link_arguments (
common_ldflags,
- language: 'c',
+ language: [ 'c', 'cpp' ],
)
meson.add_install_script (
diff --git a/meson_options.txt b/meson_options.txt
index 00137e7..a7f0aed 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,6 +11,12 @@ option (
description: 'Whether to compile unit tests')
option (
+ 'enable_qt5',
+ type: 'boolean',
+ value: false,
+ description: 'Compile with QT5 support in suil')
+
+option (
'enable_ffmpeg',
type: 'boolean',
value: false,
diff --git a/src/audio/port.c b/src/audio/port.c
index 3569109..9840b81 100644
--- a/src/audio/port.c
+++ b/src/audio/port.c
@@ -512,10 +512,10 @@ port_sum_signal_from_inputs (Port * port)
}
/* FIXME the master events never get cleared
*/
- /*if (port->midi_events->num_events > 0)*/
- /*g_message ("port %s has %d events",*/
- /*port->identifier.label,*/
- /*port->midi_events->num_events);*/
+ if (port->midi_events->num_events > 0)
+ g_message ("port %s has %d events",
+ port->identifier.label,
+ port->midi_events->num_events);
break;
case TYPE_AUDIO:
for (k = 0; k < port->num_srcs; k++)
diff --git a/src/meson.build b/src/meson.build
index 2c3789d..3a75ea4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -66,6 +66,8 @@ zrythm_exe = executable (
],
export_dynamic: true,
include_directories: all_inc,
+ c_args: common_cflags,
+ link_args: common_ldflags,
objects: objects,
install: true,
)
diff --git a/src/plugins/lv2/meson.build b/src/plugins/lv2/meson.build
index 898860d..7bd3b83 100644
--- a/src/plugins/lv2/meson.build
+++ b/src/plugins/lv2/meson.build
@@ -3,11 +3,13 @@ lv2_srcs = [
'jack.c',
'log.c',
'lv2_evbuf.c',
+ 'qt5_in_gtk3.cpp',
'state.c',
'suil_host.c',
'suil_instance.c',
'symap.c',
'urid.c',
+ 'win_in_gtk3.cpp',
'worker.c',
'x11_in_gtk3.c',
]
diff --git a/src/plugins/lv2/x11_in_gtk3.c b/src/plugins/lv2/x11_in_gtk3.c
index cd0950c..ad48034 100644
--- a/src/plugins/lv2/x11_in_gtk3.c
+++ b/src/plugins/lv2/x11_in_gtk3.c
@@ -49,6 +49,8 @@ struct _SuilX11Wrapper {
const LV2UI_Idle_Interface* idle_iface;
guint idle_id;
guint idle_ms;
+ int req_width;
+ int req_height;
};
struct _SuilX11WrapperClass {
@@ -272,6 +274,55 @@ suil_x11_wrapper_key_event(GtkWidget* widget,
}
static void
+suil_x11_wrapper_get_preferred_width(GtkWidget* widget,
+ gint* minimum_width,
+ gint* natural_width)
+{
+
+ SuilX11Wrapper* const self = Z_SUIL_X11_WRAPPER(widget);
+ if (x_window_is_valid(self)) {
+ GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(self->plug));
+ XSizeHints hints;
+ memset(&hints, 0, sizeof(hints));
+ long supplied;
+ XGetWMNormalHints(GDK_WINDOW_XDISPLAY(window),
+ (Window)self->instance->ui_widget,
+ &hints,
+ &supplied);
+ *natural_width = ((hints.flags & PBaseSize) ? hints.base_width
+ : self->req_width);
+ *minimum_width = ((hints.flags & PMinSize) ? hints.min_width
+ : self->req_width);
+ } else {
+ *natural_width = *minimum_width = self->req_width;
+ }
+}
+
+static void
+suil_x11_wrapper_get_preferred_height(GtkWidget* widget,
+ gint* minimum_height,
+ gint* natural_height)
+{
+ SuilX11Wrapper* const self = Z_SUIL_X11_WRAPPER(widget);
+ if (x_window_is_valid(self)) {
+ GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(self->plug));
+ XSizeHints hints;
+ memset(&hints, 0, sizeof(hints));
+ long supplied;
+ XGetWMNormalHints(GDK_WINDOW_XDISPLAY(window),
+ (Window)self->instance->ui_widget,
+ &hints,
+ &supplied);
+ *natural_height = ((hints.flags & PBaseSize) ? hints.base_height
+ : self->req_height);
+ *minimum_height = ((hints.flags & PMinSize) ? hints.min_height
+ : self->req_height);
+ } else {
+ *natural_height = *minimum_height = self->req_height;
+ }
+}
+
+static void
suil_x11_on_size_allocate(GtkWidget* widget,
GtkAllocation* a)
{
@@ -297,6 +348,8 @@ suil_x11_wrapper_class_init(SuilX11WrapperClass* klass)
widget_class->show = suil_x11_wrapper_show;
widget_class->key_press_event = suil_x11_wrapper_key_event;
widget_class->key_release_event = suil_x11_wrapper_key_event;
+ widget_class->get_preferred_width = suil_x11_wrapper_get_preferred_width;
+ widget_class->get_preferred_height = suil_x11_wrapper_get_preferred_height;
}
static void
@@ -307,12 +360,19 @@ suil_x11_wrapper_init(SuilX11Wrapper* self)
self->instance = NULL;
self->idle_iface = NULL;
self->idle_ms = 1000 / 30; // 30 Hz default
+ self->req_width = 0;
+ self->req_height = 0;
}
static int
wrapper_resize(LV2UI_Feature_Handle handle, int width, int height)
{
- gtk_widget_set_size_request(GTK_WIDGET(handle), width, height);
+ SuilX11Wrapper* const wrap = Z_SUIL_X11_WRAPPER(handle);
+
+ wrap->req_width = width;
+ wrap->req_height = height;
+
+ gtk_widget_queue_resize(GTK_WIDGET(handle));
return 0;
}
diff --git a/src/plugins/lv2_plugin.c b/src/plugins/lv2_plugin.c
index 7eaeddc..e2705df 100644
--- a/src/plugins/lv2_plugin.c
+++ b/src/plugins/lv2_plugin.c
@@ -2173,12 +2173,14 @@ lv2_plugin_process (Lv2Plugin * lv2_plugin)
3, ev->raw_buffer);
}
}
- zix_sem_wait (
- &port->midi_events->access_sem);
+ /*g_message ("waiting to clear events");*/
+ /*zix_sem_wait (*/
+ /*&port->midi_events->access_sem);*/
midi_events_clear (
port->midi_events, 0);
- zix_sem_post (
- &port->midi_events->access_sem);
+ /*zix_sem_post (*/
+ /*&port->midi_events->access_sem);*/
+ /*g_message ("posted clear events");*/
}
else if (port->identifier.type == TYPE_EVENT)
{
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 6e73190..99b15b9 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -116,6 +116,25 @@ plugin_clone_descr (
}
/**
+ * Adds an Automatable to the Plugin.
+ */
+void
+plugin_add_automatable (
+ Plugin * pl,
+ Automatable * a)
+{
+ pl->automatables =
+ realloc (
+ pl->automatables,
+ sizeof (Automatable *) *
+ (pl->num_automatables + 1));
+ array_append (
+ pl->automatables,
+ pl->num_automatables,
+ a);
+}
+
+/**
* Loads the plugin from its state file.
*/
/*void*/
@@ -198,9 +217,8 @@ plugin_generate_automatables (Plugin * plugin)
plugin->descr->name);
/* add plugin enabled automatable */
- array_append (
- plugin->automatables,
- plugin->num_automatables,
+ plugin_add_automatable (
+ plugin,
automatable_create_plugin_enabled (plugin));
/* add plugin control automatables */
@@ -211,9 +229,8 @@ plugin_generate_automatables (Plugin * plugin)
{
Lv2Control * control =
lv2_plugin->controls.controls[j];
- array_append (
- plugin->automatables,
- plugin->num_automatables,
+ plugin_add_automatable (
+ plugin,
automatable_create_lv2_control (
plugin, control));
}
@@ -478,6 +495,7 @@ plugin_free (Plugin *plugin)
plugin->automatables[i];
automatable_free (automatable);
}
+ free (plugin->automatables);
free (plugin);
}