diff options
Diffstat (limited to 'plugins')
24 files changed, 189 insertions, 281 deletions
diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c index 2c65cc4..c3ba279 100644 --- a/plugins/eg-amp.lv2/amp.c +++ b/plugins/eg-amp.lv2/amp.c @@ -15,11 +15,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/** Include standard C headers */ -#include <math.h> -#include <stdint.h> -#include <stdlib.h> - /** LV2 headers are based on the URI of the specification they come from, so a consistent convention can be used even for unofficial extensions. The URI @@ -29,6 +24,11 @@ */ #include "lv2/core/lv2.h" +/** Include standard C headers */ +#include <math.h> +#include <stdint.h> +#include <stdlib.h> + /** The URI is the identifier for a plugin, and how the host associates this implementation in code with its description in data. In this plugin it is diff --git a/plugins/eg-amp.lv2/wscript b/plugins/eg-amp.lv2/wscript index 04efb0a..822825d 100644 --- a/plugins/eg-amp.lv2/wscript +++ b/plugins/eg-amp.lv2/wscript @@ -16,52 +16,36 @@ def options(opt): autowaf.set_options(opt) def configure(conf): - autowaf.display_header('Amp Configuration') conf.load('compiler_c', cache=True) conf.load('lv2', cache=True) conf.load('autowaf', cache=True) - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', uselib_store='LV2') + conf.check_pkg('lv2', uselib_store='LV2') conf.check(features='c cshlib', lib='m', uselib_store='M', mandatory=False) - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') - def build(bld): bundle = 'eg-amp.lv2' - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - # Build manifest.ttl by substitution (for portable lib extension) bld(features = 'subst', source = 'manifest.ttl.in', - target = '%s/%s' % (bundle, 'manifest.ttl'), + target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'), install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) + LIB_EXT = bld.env.LV2_LIB_EXT) # Copy other data files to build bundle (build/eg-amp.lv2) for i in ['amp.ttl']: bld(features = 'subst', is_copy = True, source = i, - target = '%s/%s' % (bundle, i), + target = 'lv2/%s/%s' % (bundle, i), install_path = '${LV2DIR}/%s' % bundle) - # Use LV2 headers from parent directory if building as a sub-project - includes = None - if autowaf.is_child: - includes = '../..' - # Build plugin library - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'amp.c', name = 'amp', - target = '%s/amp' % bundle, + target = 'lv2/%s/amp' % bundle, install_path = '${LV2DIR}/%s' % bundle, - uselib = 'M LV2', - includes = includes) - obj.env.cshlib_PATTERN = module_pat + uselib = 'M LV2') diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c index 2bbd440..0abcfbd 100644 --- a/plugins/eg-fifths.lv2/fifths.c +++ b/plugins/eg-fifths.lv2/fifths.c @@ -15,12 +15,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#ifndef __cplusplus -# include <stdbool.h> -#endif +#include "./uris.h" #include "lv2/atom/atom.h" #include "lv2/atom/util.h" @@ -31,7 +26,10 @@ #include "lv2/midi/midi.h" #include "lv2/urid/urid.h" -#include "./uris.h" +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> enum { FIFTHS_IN = 0, diff --git a/plugins/eg-fifths.lv2/uris.h b/plugins/eg-fifths.lv2/uris.h index de297dc..04b09f6 100644 --- a/plugins/eg-fifths.lv2/uris.h +++ b/plugins/eg-fifths.lv2/uris.h @@ -18,6 +18,7 @@ #ifndef FIFTHS_URIS_H #define FIFTHS_URIS_H +#include "lv2/atom/atom.h" #include "lv2/log/log.h" #include "lv2/midi/midi.h" #include "lv2/patch/patch.h" diff --git a/plugins/eg-fifths.lv2/wscript b/plugins/eg-fifths.lv2/wscript index f5c1808..8b2991b 100644 --- a/plugins/eg-fifths.lv2/wscript +++ b/plugins/eg-fifths.lv2/wscript @@ -16,50 +16,34 @@ def options(opt): autowaf.set_options(opt) def configure(conf): - autowaf.display_header('Fifths Configuration') conf.load('compiler_c', cache=True) conf.load('lv2', cache=True) conf.load('autowaf', cache=True) - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', atleast_version='1.2.1', uselib_store='LV2') - - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') + conf.check_pkg('lv2 >= 1.2.1', uselib_store='LV2') def build(bld): bundle = 'eg-fifths.lv2' - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - # Build manifest.ttl by substitution (for portable lib extension) bld(features = 'subst', source = 'manifest.ttl.in', - target = '%s/%s' % (bundle, 'manifest.ttl'), + target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'), install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) + LIB_EXT = bld.env.LV2_LIB_EXT) # Copy other data files to build bundle (build/eg-fifths.lv2) for i in ['fifths.ttl']: bld(features = 'subst', is_copy = True, source = i, - target = '%s/%s' % (bundle, i), + target = 'lv2/%s/%s' % (bundle, i), install_path = '${LV2DIR}/%s' % bundle) - # Use LV2 headers from parent directory if building as a sub-project - includes = ['.'] - if autowaf.is_child: - includes += ['../..'] - # Build plugin library - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'fifths.c', name = 'fifths', - target = '%s/fifths' % bundle, + target = 'lv2/%s/fifths' % bundle, install_path = '${LV2DIR}/%s' % bundle, - use = 'LV2', - includes = includes) - obj.env.cshlib_PATTERN = module_pat + use = 'LV2') diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c index b74b52e..a7231d2 100644 --- a/plugins/eg-metro.lv2/metro.c +++ b/plugins/eg-metro.lv2/metro.c @@ -15,15 +15,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <math.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#ifndef __cplusplus -# include <stdbool.h> -#endif - #include "lv2/atom/atom.h" #include "lv2/atom/util.h" #include "lv2/core/lv2.h" @@ -33,6 +24,13 @@ #include "lv2/time/time.h" #include "lv2/urid/urid.h" +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #ifndef M_PI # define M_PI 3.14159265 #endif diff --git a/plugins/eg-metro.lv2/wscript b/plugins/eg-metro.lv2/wscript index 467a069..5fb0d07 100644 --- a/plugins/eg-metro.lv2/wscript +++ b/plugins/eg-metro.lv2/wscript @@ -16,51 +16,35 @@ def options(opt): autowaf.set_options(opt) def configure(conf): - autowaf.display_header('Metro Configuration') conf.load('compiler_c', cache=True) conf.load('lv2', cache=True) conf.load('autowaf', cache=True) - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', atleast_version='0.2.0', uselib_store='LV2') + conf.check_pkg('lv2 >= 0.2.0', uselib_store='LV2') conf.check(features='c cshlib', lib='m', uselib_store='M', mandatory=False) - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') - def build(bld): bundle = 'eg-metro.lv2' - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - # Build manifest.ttl by substitution (for portable lib extension) bld(features = 'subst', source = 'manifest.ttl.in', - target = '%s/%s' % (bundle, 'manifest.ttl'), + target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'), install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) + LIB_EXT = bld.env.LV2_LIB_EXT) # Copy other data files to build bundle (build/eg-metro.lv2) bld(features = 'subst', is_copy = True, source = 'metro.ttl', - target = '%s/metro.ttl' % bundle, + target = 'lv2/%s/metro.ttl' % bundle, install_path = '${LV2DIR}/%s' % bundle) - # Use LV2 headers from parent directory if building as a sub-project - includes = ['.'] - if autowaf.is_child: - includes += ['../..'] - # Build plugin library - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'metro.c', name = 'metro', - target = '%s/metro' % bundle, + target = 'lv2/%s/metro' % bundle, install_path = '${LV2DIR}/%s' % bundle, - use = ['M', 'LV2'], - includes = includes) - obj.env.cshlib_PATTERN = module_pat + use = ['M', 'LV2']) diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c index 8ec5721..70901f6 100644 --- a/plugins/eg-midigate.lv2/midigate.c +++ b/plugins/eg-midigate.lv2/midigate.c @@ -14,12 +14,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <stdbool.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - #include "lv2/atom/atom.h" #include "lv2/atom/util.h" #include "lv2/core/lv2.h" @@ -29,6 +23,12 @@ #include "lv2/midi/midi.h" #include "lv2/urid/urid.h" +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #define MIDIGATE_URI "http://lv2plug.in/plugins/eg-midigate" typedef enum { diff --git a/plugins/eg-midigate.lv2/wscript b/plugins/eg-midigate.lv2/wscript index 933ae7a..5862721 100644 --- a/plugins/eg-midigate.lv2/wscript +++ b/plugins/eg-midigate.lv2/wscript @@ -16,50 +16,34 @@ def options(opt): autowaf.set_options(opt) def configure(conf): - autowaf.display_header('Midigate Configuration') conf.load('compiler_c', cache=True) conf.load('lv2', cache=True) conf.load('autowaf', cache=True) - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', uselib_store='LV2') - - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') + conf.check_pkg('lv2', uselib_store='LV2') def build(bld): bundle = 'eg-midigate.lv2' - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - # Build manifest.ttl by substitution (for portable lib extension) bld(features = 'subst', source = 'manifest.ttl.in', - target = '%s/%s' % (bundle, 'manifest.ttl'), + target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'), install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) + LIB_EXT = bld.env.LV2_LIB_EXT) # Copy other data files to build bundle (build/eg-midigate.lv2) for i in ['midigate.ttl']: bld(features = 'subst', is_copy = True, source = i, - target = '%s/%s' % (bundle, i), + target = 'lv2/%s/%s' % (bundle, i), install_path = '${LV2DIR}/%s' % bundle) - # Use LV2 headers from parent directory if building as a sub-project - includes = None - if autowaf.is_child: - includes = '../..' - # Build plugin library - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'midigate.c', name = 'midigate', - target = '%s/midigate' % bundle, + target = 'lv2/%s/midigate' % bundle, install_path = '${LV2DIR}/%s' % bundle, - uselib = 'LV2', - includes = includes) - obj.env.cshlib_PATTERN = module_pat + uselib = 'LV2') diff --git a/plugins/eg-params.lv2/params.c b/plugins/eg-params.lv2/params.c index 6328601..94d34a5 100644 --- a/plugins/eg-params.lv2/params.c +++ b/plugins/eg-params.lv2/params.c @@ -15,13 +15,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#ifndef __cplusplus -# include <stdbool.h> -#endif +#include "state_map.h" #include "lv2/atom/atom.h" #include "lv2/atom/forge.h" @@ -35,7 +29,11 @@ #include "lv2/state/state.h" #include "lv2/urid/urid.h" -#include "state_map.h" +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #define MAX_STRING 1024 diff --git a/plugins/eg-params.lv2/params.ttl b/plugins/eg-params.lv2/params.ttl index dbcf6aa..931c826 100644 --- a/plugins/eg-params.lv2/params.ttl +++ b/plugins/eg-params.lv2/params.ttl @@ -116,11 +116,11 @@ plug:spring state:state [ plug:int 0 ; plug:long "0"^^xsd:long ; - plug:float 0.1234 ; + plug:float "0.1234"^^xsd:float ; plug:double "0e0"^^xsd:double ; plug:bool false ; plug:string "Hello, world" ; plug:path <params.ttl> ; - plug:spring 0.0 ; - plug:lfo 0.0 + plug:spring "0.0"^^xsd:float ; + plug:lfo "0.0"^^xsd:float ] . diff --git a/plugins/eg-params.lv2/state_map.h b/plugins/eg-params.lv2/state_map.h index cd97a80..c80d4a2 100644 --- a/plugins/eg-params.lv2/state_map.h +++ b/plugins/eg-params.lv2/state_map.h @@ -15,6 +15,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "lv2/atom/atom.h" +#include "lv2/urid/urid.h" + +#include <stdarg.h> #include <stdlib.h> /** Entry in an array that serves as a dictionary of properties. */ diff --git a/plugins/eg-params.lv2/wscript b/plugins/eg-params.lv2/wscript index 60dcee4..503e8db 100644 --- a/plugins/eg-params.lv2/wscript +++ b/plugins/eg-params.lv2/wscript @@ -16,50 +16,34 @@ def options(opt): autowaf.set_options(opt) def configure(conf): - autowaf.display_header('Params Configuration') conf.load('compiler_c', cache=True) conf.load('lv2', cache=True) conf.load('autowaf', cache=True) - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', atleast_version='1.12.1', uselib_store='LV2') - - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') + conf.check_pkg('lv2 >= 1.12.1', uselib_store='LV2') def build(bld): bundle = 'eg-params.lv2' - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - # Build manifest.ttl by substitution (for portable lib extension) bld(features = 'subst', source = 'manifest.ttl.in', - target = '%s/%s' % (bundle, 'manifest.ttl'), + target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'), install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) + LIB_EXT = bld.env.LV2_LIB_EXT) # Copy other data files to build bundle (build/eg-params.lv2) for i in ['params.ttl']: bld(features = 'subst', is_copy = True, source = i, - target = '%s/%s' % (bundle, i), + target = 'lv2/%s/%s' % (bundle, i), install_path = '${LV2DIR}/%s' % bundle) - # Use LV2 headers from parent directory if building as a sub-project - includes = ['.'] - if autowaf.is_child: - includes += ['../..'] - # Build plugin library - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'params.c', name = 'params', - target = '%s/params' % bundle, + target = 'lv2/%s/params' % bundle, install_path = '${LV2DIR}/%s' % bundle, - use = 'LV2', - includes = includes) - obj.env.cshlib_PATTERN = module_pat + use = 'LV2') diff --git a/plugins/eg-sampler.lv2/atom_sink.h b/plugins/eg-sampler.lv2/atom_sink.h index ae3df30..b84ca55 100644 --- a/plugins/eg-sampler.lv2/atom_sink.h +++ b/plugins/eg-sampler.lv2/atom_sink.h @@ -14,6 +14,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "lv2/atom/forge.h" + /** A forge sink that writes to an atom buffer. diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h index e3002c2..45d3465 100644 --- a/plugins/eg-sampler.lv2/peaks.h +++ b/plugins/eg-sampler.lv2/peaks.h @@ -28,10 +28,11 @@ #ifndef PEAKS_H_INCLUDED #define PEAKS_H_INCLUDED -#include <math.h> - #include "lv2/atom/forge.h" +#include <math.h> +#include <stdlib.h> + #define PEAKS_URI "http://lv2plug.in/ns/peaks#" #define PEAKS__PeakUpdate PEAKS_URI "PeakUpdate" #define PEAKS__magnitudes PEAKS_URI "magnitudes" @@ -119,7 +120,7 @@ peaks_sender_start(PeaksSender* sender, Forge a message which sends a range of peaks. Writes a peaks:PeakUpdate object to `forge`, like: - [source,n3] + [source,turtle] ---- [] a peaks:PeakUpdate ; diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c index efc479f..4e6afdf 100644 --- a/plugins/eg-sampler.lv2/sampler.c +++ b/plugins/eg-sampler.lv2/sampler.c @@ -17,16 +17,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <math.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#ifndef __cplusplus -# include <stdbool.h> -#endif - -#include <sndfile.h> +#include "atom_sink.h" +#include "peaks.h" +#include "uris.h" #include "lv2/atom/atom.h" #include "lv2/atom/forge.h" @@ -40,9 +33,14 @@ #include "lv2/urid/urid.h" #include "lv2/worker/worker.h" -#include "atom_sink.h" -#include "peaks.h" -#include "uris.h" +#include <sndfile.h> + +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> enum { SAMPLER_CONTROL = 0, diff --git a/plugins/eg-sampler.lv2/sampler.ttl b/plugins/eg-sampler.lv2/sampler.ttl index 92570e5..f5088f3 100644 --- a/plugins/eg-sampler.lv2/sampler.ttl +++ b/plugins/eg-sampler.lv2/sampler.ttl @@ -1,13 +1,14 @@ @prefix atom: <http://lv2plug.in/ns/ext/atom#> . @prefix doap: <http://usefulinc.com/ns/doap#> . @prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix param: <http://lv2plug.in/ns/ext/parameters#> . @prefix patch: <http://lv2plug.in/ns/ext/patch#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix state: <http://lv2plug.in/ns/ext/state#> . @prefix ui: <http://lv2plug.in/ns/extensions/ui#> . @prefix urid: <http://lv2plug.in/ns/ext/urid#> . @prefix work: <http://lv2plug.in/ns/ext/worker#> . -@prefix param: <http://lv2plug.in/ns/ext/parameters#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://lv2plug.in/plugins/eg-sampler#sample> a lv2:Parameter ; @@ -57,12 +58,13 @@ ] ; state:state [ <http://lv2plug.in/plugins/eg-sampler#sample> <click.wav> ; - param:gain 1.0 + param:gain "1.0"^^xsd:float ] . <http://lv2plug.in/plugins/eg-sampler#ui> a ui:GtkUI ; lv2:requiredFeature urid:map ; + lv2:optionalFeature ui:requestValue ; lv2:extensionData ui:showInterface ; ui:portNotification [ ui:plugin <http://lv2plug.in/plugins/eg-sampler> ; diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c index e52d679..1cb7553 100644 --- a/plugins/eg-sampler.lv2/sampler_ui.c +++ b/plugins/eg-sampler.lv2/sampler_ui.c @@ -15,17 +15,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <stdbool.h> -#include <stdint.h> -#include <stdlib.h> -#include <string.h> - -#include <cairo.h> -#include <gdk/gdk.h> -#include <glib-object.h> -#include <glib.h> -#include <gobject/gclosure.h> -#include <gtk/gtk.h> +#include "peaks.h" +#include "uris.h" #include "lv2/atom/atom.h" #include "lv2/atom/forge.h" @@ -38,8 +29,17 @@ #include "lv2/ui/ui.h" #include "lv2/urid/urid.h" -#include "peaks.h" -#include "uris.h" +#include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> +#include <gobject/gclosure.h> +#include <gtk/gtk.h> + +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> #define SAMPLER_UI_URI "http://lv2plug.in/plugins/eg-sampler#ui" @@ -47,11 +47,12 @@ #define MIN_CANVAS_H 80 typedef struct { - LV2_Atom_Forge forge; - LV2_URID_Map* map; - LV2_Log_Logger logger; - SamplerURIs uris; - PeaksReceiver precv; + LV2_Atom_Forge forge; + LV2_URID_Map* map; + LV2UI_Request_Value* request_value; + LV2_Log_Logger logger; + SamplerURIs uris; + PeaksReceiver precv; LV2UI_Write_Function write; LV2UI_Controller controller; @@ -59,6 +60,7 @@ typedef struct { GtkWidget* box; GtkWidget* play_button; GtkWidget* file_button; + GtkWidget* request_file_button; GtkWidget* button_box; GtkWidget* canvas; GtkWidget* window; /* For optional show interface. */ @@ -91,6 +93,17 @@ on_file_set(GtkFileChooserButton* widget, void* handle) } static void +on_request_file(GtkButton* widget, void* handle) +{ + SamplerUI* ui = (SamplerUI*)handle; + + ui->request_value->request(ui->request_value->handle, + ui->uris.eg_sample, + 0, + NULL); +} + +static void on_play_clicked(GtkFileChooserButton* widget, void* handle) { SamplerUI* ui = (SamplerUI*)handle; @@ -220,8 +233,9 @@ instantiate(const LV2UI_Descriptor* descriptor, // Get host features const char* missing = lv2_features_query( features, - LV2_LOG__log, &ui->logger.log, false, - LV2_URID__map, &ui->map, true, + LV2_LOG__log, &ui->logger.log , false, + LV2_URID__map, &ui->map, true, + LV2_UI__requestValue, &ui->request_value, false, NULL); lv2_log_logger_set_map(&ui->logger, ui->map); if (missing) { @@ -242,16 +256,21 @@ instantiate(const LV2UI_Descriptor* descriptor, ui->button_box = gtk_hbox_new(FALSE, 4); ui->file_button = gtk_file_chooser_button_new( "Load Sample", GTK_FILE_CHOOSER_ACTION_OPEN); + ui->request_file_button = gtk_button_new_with_label("Request Sample"); gtk_widget_set_size_request(ui->canvas, MIN_CANVAS_W, MIN_CANVAS_H); gtk_container_set_border_width(GTK_CONTAINER(ui->box), 4); gtk_box_pack_start(GTK_BOX(ui->box), ui->canvas, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(ui->box), ui->button_box, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(ui->button_box), ui->play_button, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(ui->button_box), ui->request_file_button, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(ui->button_box), ui->file_button, TRUE, TRUE, 0); g_signal_connect(ui->file_button, "file-set", G_CALLBACK(on_file_set), ui); + g_signal_connect(ui->request_file_button, "clicked", + G_CALLBACK(on_request_file), ui); + g_signal_connect(ui->play_button, "clicked", G_CALLBACK(on_play_clicked), ui); @@ -283,6 +302,7 @@ cleanup(LV2UI_Handle handle) gtk_widget_destroy(ui->canvas); gtk_widget_destroy(ui->button_box); gtk_widget_destroy(ui->file_button); + gtk_widget_destroy(ui->request_file_button); free(ui); } diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h index 659d400..1609db7 100644 --- a/plugins/eg-sampler.lv2/uris.h +++ b/plugins/eg-sampler.lv2/uris.h @@ -24,6 +24,8 @@ #include "lv2/patch/patch.h" #include "lv2/state/state.h" +#include <stdio.h> + #define EG_SAMPLER_URI "http://lv2plug.in/plugins/eg-sampler" #define EG_SAMPLER__applySample EG_SAMPLER_URI "#applySample" #define EG_SAMPLER__freeSample EG_SAMPLER_URI "#freeSample" @@ -71,7 +73,7 @@ map_sampler_uris(LV2_URID_Map* map, SamplerURIs* uris) /** Write a message like the following to `forge`: - [source,n3] + [source,turtle] ---- [] a patch:Set ; @@ -100,7 +102,7 @@ write_set_file(LV2_Atom_Forge* forge, /** Get the file path from `obj` which is a message like: - [source,n3] + [source,turtle] ---- [] a patch:Set ; diff --git a/plugins/eg-sampler.lv2/wscript b/plugins/eg-sampler.lv2/wscript index 3656edc..8c640c1 100644 --- a/plugins/eg-sampler.lv2/wscript +++ b/plugins/eg-sampler.lv2/wscript @@ -16,67 +16,49 @@ def options(opt): autowaf.set_options(opt) def configure(conf): - autowaf.display_header('Sampler Configuration') conf.load('compiler_c', cache=True) conf.load('lv2', cache=True) conf.load('autowaf', cache=True) - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', atleast_version='1.2.1', uselib_store='LV2') - - autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', - atleast_version='1.0.0', mandatory=True) - autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK2', - atleast_version='2.18.0', mandatory=False) + conf.check_pkg('lv2 >= 1.2.1', uselib_store='LV2') + conf.check_pkg('sndfile >= 1.0.0', uselib_store='SNDFILE') + conf.check_pkg('gtk+-2.0 >= 2.18.0', + uselib_store='GTK2', + system=True, + mandatory=False) conf.check(features='c cshlib', lib='m', uselib_store='M', mandatory=False) - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') - def build(bld): bundle = 'eg-sampler.lv2' - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - # Build manifest.ttl by substitution (for portable lib extension) bld(features = 'subst', source = 'manifest.ttl.in', - target = '%s/%s' % (bundle, 'manifest.ttl'), + target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'), install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) + LIB_EXT = bld.env.LV2_LIB_EXT) # Copy other data files to build bundle (build/eg-sampler.lv2) for i in ['sampler.ttl', 'click.wav']: bld(features = 'subst', is_copy = True, source = i, - target = '%s/%s' % (bundle, i), + target = 'lv2/%s/%s' % (bundle, i), install_path = '${LV2DIR}/%s' % bundle) - # Use LV2 headers from parent directory if building as a sub-project - includes = ['.'] - if autowaf.is_child: - includes += ['../..'] - # Build plugin library - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'sampler.c', name = 'sampler', - target = '%s/sampler' % bundle, + target = 'lv2/%s/sampler' % bundle, install_path = '${LV2DIR}/%s' % bundle, - use = ['M', 'SNDFILE', 'LV2'], - includes = includes) - obj.env.cshlib_PATTERN = module_pat + use = ['M', 'SNDFILE', 'LV2']) # Build UI library if bld.env.HAVE_GTK2: - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'sampler_ui.c', name = 'sampler_ui', - target = '%s/sampler_ui' % bundle, + target = 'lv2/%s/sampler_ui' % bundle, install_path = '${LV2DIR}/%s' % bundle, - use = ['GTK2', 'LV2'], - includes = includes) - obj.env.cshlib_PATTERN = module_pat + use = ['GTK2', 'LV2']) diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c index d675cb2..a4f5f3f 100644 --- a/plugins/eg-scope.lv2/examploscope.c +++ b/plugins/eg-scope.lv2/examploscope.c @@ -15,11 +15,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <stdbool.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> +#include "./uris.h" #include "lv2/atom/atom.h" #include "lv2/atom/forge.h" @@ -31,7 +27,11 @@ #include "lv2/state/state.h" #include "lv2/urid/urid.h" -#include "./uris.h" +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> /** ==== Private Plugin Instance Structure ==== @@ -168,7 +168,7 @@ connect_port(LV2_Handle handle, This function forges a message for sending a vector of raw data. The object is a http://lv2plug.in/ns/ext/atom#Blank[Blank] with a few properties, like: - [source,n3] + [source,turtle] -------- [] a sco:RawAudio ; diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index 1639ae9..ce0000c 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -14,19 +14,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <assert.h> -#include <stdbool.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <cairo.h> -#include <gdk/gdk.h> -#include <glib-object.h> -#include <glib.h> -#include <gobject/gclosure.h> -#include <gtk/gtk.h> +#include "./uris.h" #include "lv2/atom/atom.h" #include "lv2/atom/forge.h" @@ -35,7 +23,19 @@ #include "lv2/ui/ui.h" #include "lv2/urid/urid.h" -#include "./uris.h" +#include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> +#include <gobject/gclosure.h> +#include <gtk/gtk.h> + +#include <assert.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> // Drawing area size #define DAWIDTH (640) diff --git a/plugins/eg-scope.lv2/wscript b/plugins/eg-scope.lv2/wscript index 3fb0687..4333502 100644 --- a/plugins/eg-scope.lv2/wscript +++ b/plugins/eg-scope.lv2/wscript @@ -16,59 +16,41 @@ def options(opt): autowaf.set_options(opt) def configure(conf): - autowaf.display_header('Scope Configuration') conf.load('compiler_c', cache=True) conf.load('lv2', cache=True) conf.load('autowaf', cache=True) - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', atleast_version='1.2.1', uselib_store='LV2') - - autowaf.check_pkg(conf, 'cairo', uselib_store='CAIRO', - atleast_version='1.8.10', mandatory=True) - autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK2', - atleast_version='2.18.0', mandatory=False) - - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') + conf.check_pkg('lv2 >= 1.2.1', uselib_store='LV2') + conf.check_pkg('cairo >= 1.8.10', uselib_store='CAIRO') + conf.check_pkg('gtk+-2.0 >= 2.18.0', + uselib_store='GTK2', + system=True, + mandatory=False) def build(bld): bundle = 'eg-scope.lv2' - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - # Build manifest.ttl by substitution (for portable lib extension) for i in ['manifest.ttl', 'examploscope.ttl']: bld(features = 'subst', source = i + '.in', - target = '%s/%s' % (bundle, i), + target = 'lv2/%s/%s' % (bundle, i), install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) - - # Use LV2 headers from parent directory if building as a sub-project - includes = ['.'] - if autowaf.is_child: - includes += ['../..'] + LIB_EXT = bld.env.LV2_LIB_EXT) # Build plugin library - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'examploscope.c', name = 'examploscope', - target = '%s/examploscope' % bundle, + target = 'lv2/%s/examploscope' % bundle, install_path = '${LV2DIR}/%s' % bundle, - use = 'LV2', - includes = includes) - obj.env.cshlib_PATTERN = module_pat + use = 'LV2') # Build UI library if bld.env.HAVE_GTK2: - obj = bld(features = 'c cshlib', + obj = bld(features = 'c cshlib lv2lib', source = 'examploscope_ui.c', name = 'examploscope_ui', - target = '%s/examploscope_ui' % bundle, + target = 'lv2/%s/examploscope_ui' % bundle, install_path = '${LV2DIR}/%s' % bundle, - use = 'GTK2 CAIRO LV2', - includes = includes) - obj.env.cshlib_PATTERN = module_pat + use = 'GTK2 CAIRO LV2') diff --git a/plugins/literasc.py b/plugins/literasc.py index 5c5b80e..0bcd8f2 100755 --- a/plugins/literasc.py +++ b/plugins/literasc.py @@ -87,7 +87,7 @@ def format_ttl_source(filename, file): chunk = line else: if is_comment: - output += format_code('n3', chunk) + output += format_code('turtle', chunk) in_comment = True chunk = line.strip().lstrip('# ') + ' \n' else: @@ -96,7 +96,7 @@ def format_ttl_source(filename, file): if in_comment: return output + format_text(chunk) else: - return output + format_code('n3', chunk) + return output + format_code('turtle', chunk) def gen(out, filenames): for filename in filenames: |