diff options
author | David Robillard <d@drobilla.net> | 2007-04-08 06:04:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-04-08 06:04:32 +0000 |
commit | e96c36c1a7abb062e36efc0ac95c35fedcef922e (patch) | |
tree | 826d5caa0392201472d12c02a1c3df4cf7b275be /src/common/lv2ext/lv2-miditype.h | |
parent | 7d69e89f22304e37fa325ce4f39a374a02072a69 (diff) | |
download | ingen-e96c36c1a7abb062e36efc0ac95c35fedcef922e.tar.gz ingen-e96c36c1a7abb062e36efc0ac95c35fedcef922e.tar.bz2 ingen-e96c36c1a7abb062e36efc0ac95c35fedcef922e.zip |
De-template-ification of port types (req. for LV2 MIDI, but nice code size reduction).
LV2 MIDI patching support (LV2 style MIDI throughout, inc. internal plugins).
git-svn-id: http://svn.drobilla.net/lad/ingen@415 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/common/lv2ext/lv2-miditype.h')
-rw-r--r-- | src/common/lv2ext/lv2-miditype.h | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/common/lv2ext/lv2-miditype.h b/src/common/lv2ext/lv2-miditype.h index 332e57f1..5350e4f7 100644 --- a/src/common/lv2ext/lv2-miditype.h +++ b/src/common/lv2ext/lv2-miditype.h @@ -1,37 +1,38 @@ -/************************************************************************ - - LV2 MIDI Data Type Extension - Copyright 2006 Lars Luthman in 2006 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2.1 of - the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA. +/**************************************************************************** + + lv2-miditype.h - header file for using MIDI in LV2 plugins + + Copyright (C) 2006 Lars Luthman <lars.luthman@gmail.com> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA -*************************************************************************/ +****************************************************************************/ #ifndef LV2_MIDITYPE_H #define LV2_MIDITYPE_H +#include <stdint.h> /** This data structure is used to contain the MIDI events for one run() cycle. The port buffer for a LV2 port that has the datatype - <http://ll-plugins.nongnu.org/lv2/namespace#miditype> should be a pointer + <http://ll-plugins.nongnu.org/lv2/ext/miditype> should be a pointer to an instance of this struct. To store two Note On events on MIDI channel 0 in a buffer, with timestamps - 12 and 35.5, you could use something like this code (assuming that midi_data - is a variable of type LV2_MIDI): + 12 and 35.5, you could use something like this code (assuming that + midi_data is a variable of type LV2_MIDI): @code size_t buffer_offset = 0; @@ -71,7 +72,8 @@ buffer_offset += sizeof(double); size_t size = *(size_t*)(midi_data->data + buffer_offset); buffer_offset += sizeof(size_t); - do_something_with_event(timestamp, size, midi_data->data + buffer_offset); + do_something_with_event(timestamp, size, + midi_data->data + buffer_offset); buffer_offset += size; } |