diff options
author | David Robillard <d@drobilla.net> | 2012-08-08 00:15:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-08 00:15:43 +0000 |
commit | 0b53a3e48f7b0316ef6e8b45dc9982e771dd6d28 (patch) | |
tree | fb0cb84ba5915c20356f8dc02823a66cdaf1b8e5 /src | |
parent | 5311bbcdc328f8123bab5faa807f3cd4ef72917a (diff) | |
download | jalv-0b53a3e48f7b0316ef6e8b45dc9982e771dd6d28.tar.gz jalv-0b53a3e48f7b0316ef6e8b45dc9982e771dd6d28.tar.bz2 jalv-0b53a3e48f7b0316ef6e8b45dc9982e771dd6d28.zip |
Support latest LV2 buf-size extension.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4623 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/jalv.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -318,7 +318,7 @@ jack_buffer_size_cb(jack_nframes_t nframes, void* data) Jalv* const jalv = (Jalv*)data; jalv->block_length = nframes; jalv->buf_size_set = true; -#ifdef jack_port_type_get_buffer_size +#ifdef HAVE_JACK_PORT_TYPE_GET_BUFFER_SIZE jalv->midi_buf_size = jack_port_type_get_buffer_size( jalv->jack_client, JACK_DEFAULT_MIDI_TYPE); #endif @@ -726,8 +726,7 @@ jalv_get_sample_count(LV2_Buf_Size_Access_Handle handle, uint32_t* power_of) { Jalv* jalv = (Jalv*)handle; - // TODO: Is this actually guaranteed with Jack2? - *min = jalv->block_length; + *min = jalv->block_length; // FIXME: Not guaranteed by Jack API *max = jalv->block_length; *multiple_of = 1; *power_of = 0; @@ -739,17 +738,22 @@ jalv_get_sample_count(LV2_Buf_Size_Access_Handle handle, return 0; } -static size_t +static LV2_Buf_Size_Status jalv_get_buf_size(LV2_Buf_Size_Access_Handle handle, + uint32_t* buf_size, LV2_URID type, - LV2_URID subtype) + uint32_t sample_count) { Jalv* jalv = (Jalv*)handle; if (!jalv->buf_size_set) { fprintf(stderr, "Buffer size requested but it is not yet known.\n"); - return 0; } - return 0; + if (type == jalv->forge.Sequence) { + *buf_size = jalv->midi_buf_size; + return LV2_BUF_SIZE_SUCCESS; + } + *buf_size = 0; + return LV2_BUF_SIZE_ERR_BAD_TYPE; } static void |