diff options
author | David Robillard <d@drobilla.net> | 2012-08-29 05:16:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-29 05:16:57 +0000 |
commit | d800be459ab5a0eaf37e9797386513039aae829b (patch) | |
tree | 94cc756ad0e3ee56d7e951bb705af28b582cde45 | |
parent | bd19664f71d92669e355a06d1ad88b23ea294082 (diff) | |
download | jalv-d800be459ab5a0eaf37e9797386513039aae829b.tar.gz jalv-d800be459ab5a0eaf37e9797386513039aae829b.tar.bz2 jalv-d800be459ab5a0eaf37e9797386513039aae829b.zip |
Implement providing block length to plugin via options.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4759 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/jalv.c | 36 | ||||
-rw-r--r-- | src/jalv_internal.h | 3 |
2 files changed, 26 insertions, 13 deletions
@@ -799,19 +799,22 @@ main(int argc, char** argv) jalv.midi_event_id = uri_to_id( &jalv, "http://lv2plug.in/ns/ext/event", LV2_MIDI__MidiEvent); - jalv.urids.atom_Float = symap_map(jalv.symap, LV2_ATOM__Float); - jalv.urids.param_sampleRate = symap_map(jalv.symap, LV2_PARAMETERS__sampleRate); - jalv.urids.atom_eventTransfer = symap_map(jalv.symap, LV2_ATOM__eventTransfer); - jalv.urids.log_Trace = symap_map(jalv.symap, LV2_LOG__Trace); - jalv.urids.midi_MidiEvent = symap_map(jalv.symap, LV2_MIDI__MidiEvent); - jalv.urids.time_Position = symap_map(jalv.symap, LV2_TIME__Position); - jalv.urids.time_bar = symap_map(jalv.symap, LV2_TIME__bar); - jalv.urids.time_barBeat = symap_map(jalv.symap, LV2_TIME__barBeat); - jalv.urids.time_beatUnit = symap_map(jalv.symap, LV2_TIME__beatUnit); - jalv.urids.time_beatsPerBar = symap_map(jalv.symap, LV2_TIME__beatsPerBar); - jalv.urids.time_beatsPerMinute = symap_map(jalv.symap, LV2_TIME__beatsPerMinute); - jalv.urids.time_frame = symap_map(jalv.symap, LV2_TIME__frame); - jalv.urids.time_speed = symap_map(jalv.symap, LV2_TIME__speed); + jalv.urids.atom_Float = symap_map(jalv.symap, LV2_ATOM__Float); + jalv.urids.atom_Int = symap_map(jalv.symap, LV2_ATOM__Int); + jalv.urids.atom_eventTransfer = symap_map(jalv.symap, LV2_ATOM__eventTransfer); + jalv.urids.bufsz_maxBlockLength = symap_map(jalv.symap, LV2_BUF_SIZE__maxBlockLength); + jalv.urids.bufsz_minBlockLength = symap_map(jalv.symap, LV2_BUF_SIZE__minBlockLength); + jalv.urids.log_Trace = symap_map(jalv.symap, LV2_LOG__Trace); + jalv.urids.midi_MidiEvent = symap_map(jalv.symap, LV2_MIDI__MidiEvent); + jalv.urids.param_sampleRate = symap_map(jalv.symap, LV2_PARAMETERS__sampleRate); + jalv.urids.time_Position = symap_map(jalv.symap, LV2_TIME__Position); + jalv.urids.time_bar = symap_map(jalv.symap, LV2_TIME__bar); + jalv.urids.time_barBeat = symap_map(jalv.symap, LV2_TIME__barBeat); + jalv.urids.time_beatUnit = symap_map(jalv.symap, LV2_TIME__beatUnit); + jalv.urids.time_beatsPerBar = symap_map(jalv.symap, LV2_TIME__beatsPerBar); + jalv.urids.time_beatsPerMinute = symap_map(jalv.symap, LV2_TIME__beatsPerMinute); + jalv.urids.time_frame = symap_map(jalv.symap, LV2_TIME__frame); + jalv.urids.time_speed = symap_map(jalv.symap, LV2_TIME__speed); #ifdef _WIN32 jalv.temp_dir = jalv_strdup("jalvXXXXXX"); @@ -987,11 +990,18 @@ main(int argc, char** argv) jalv.opts.buffer_size = jalv.midi_buf_size * 4; } + printf("Block length: %u frames\n", jalv.block_length); /* Initialize options to pass to plugin */ const LV2_Atom_Float sample_rate_option = { { sizeof(float), jalv.urids.atom_Float }, jalv.sample_rate }; + const LV2_Atom_Int min_length_option = + { { sizeof(float), jalv.urids.atom_Int }, jalv.block_length }; + const LV2_Atom_Int max_length_option = + { { sizeof(float), jalv.urids.atom_Int }, jalv.block_length }; LV2_Options_Option options[] = { { jalv.urids.param_sampleRate, &sample_rate_option.atom }, + { jalv.urids.bufsz_minBlockLength, &min_length_option.atom }, + { jalv.urids.bufsz_maxBlockLength, &max_length_option.atom }, { 0, NULL } }; options_feature.data = &options; diff --git a/src/jalv_internal.h b/src/jalv_internal.h index df07cb2..093ead9 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -92,7 +92,10 @@ typedef struct { typedef struct { LV2_URID atom_Float; + LV2_URID atom_Int; LV2_URID atom_eventTransfer; + LV2_URID bufsz_maxBlockLength; + LV2_URID bufsz_minBlockLength; LV2_URID log_Trace; LV2_URID midi_MidiEvent; LV2_URID param_sampleRate; |