[SCM] calf/master: + LV2: another update to reflect development of event extension

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:37:03 UTC 2013


The following commit has been merged in the master branch:
commit 8dfb7108910ddac9f8b3902ce71872b5754d4082
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Tue Feb 5 22:53:47 2008 +0000

    + LV2: another update to reflect development of event extension
    
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@123 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/lv2_event.h b/src/calf/lv2_event.h
index bc81ed9..ed306f9 100644
--- a/src/calf/lv2_event.h
+++ b/src/calf/lv2_event.h
@@ -121,6 +121,43 @@ typedef struct {
  * |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ...
  */
 typedef struct {
+	
+	/** The contents of the event buffer.  This may or may not reside in the
+	 * same block of memory as this header, plugins must not assume either.
+	 * The host guarantees this points to at least capacity bytes of allocated
+	 * memory (though only size bytes of that are valid events).
+	 */
+	uint8_t* data;
+
+	/** The size of this event header in bytes (including everything).
+	 *
+	 * This is to allow for extending this header in the future without
+	 * breaking binary compatibility.  Whenever this header is copied,
+	 * it MUST be done using this field (and NOT the sizeof this struct).
+	 */
+	uint16_t header_size;
+
+	/** The type of the time stamps for events in this buffer.
+	 * As a special exception, '0' always means audio frames and subframes
+	 * (1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate.
+	 * INPUTS: The host must set this field to the numeric ID of some URI
+	 *     defining the meaning of the frames/subframes fields of contained
+	 *     events (obtained by the LV2 URI Map uri_to_id function with the URI
+	 *     of this extension as the 'map' argument, see lv2_uri_map.h).
+	 *     The host must never pass a plugin a buffer which uses a stamp type
+	 *     the plugin does not 'understand'.  The value of this field must
+	 *     never change, except when connect_port is called on the input
+	 *     port, at which time the host MUST have set the stamp_type field to
+	 *     the value that will be used for all subsequent run calls.
+	 * OUTPUTS: The plugin may set this to any value that has been returned
+	 *     from uri_to_id with the URI of this extension for a 'map' argument.
+	 *     When connected to a buffer with connect_port, output ports MUST set
+	 *     this field to the type of time stamp they will be writing.  On any
+	 *     call to connect_port on an event input port, the plugin may change
+	 *     this field on any output port, it is the responsibility of the host
+	 *     to check if any of these values have changed and act accordingly.
+	 */
+	uint16_t stamp_type;
 
 	/** The number of events in this buffer.
 	 * INPUTS: The host must set this field to the number of events
@@ -149,32 +186,6 @@ typedef struct {
 	 *     Any initial value should be ignored by the plugin.
 	 */
 	uint32_t size;
-	
-	/** The type of the time stamps for events in this buffer.
-	 * As a special exception, '0' always means audio frames and subframes
-	 * (1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate.
-	 * INPUTS: The host must set this field to the numeric ID of some URI
-	 *     which defines the meaning of the frames and subframes fields of
-	 *     contained events (obtained by the LV2 URI Map uri_to_id function
-	 *     with the URI of this extension as the 'map' argument).
-	 *     The host must never pass a plugin a buffer which uses a stamp type
-	 *     the plugin does not 'understand'.  The value of this field must
-	 *     never change, except when connect_port is called on the input
-	 *     port, at which time the host MUST have set the stamp_type field to
-	 *     the value that will be used for all run calls (until a reconnect).
-	 * OUTPUTS: The plugin may set this to any value that has been returned
-	 *     from uri_to_id with the URI of this extension for a 'map' argument.
-	 *     When connected to a buffer with connect_port, output ports MUST set
-	 *     this field to the type of time stamp they will be writing.  On any
-	 *     call to connect_port on an event input port, the plugin may change
-	 *     this field on any output port, it is the responsibility of the host
-	 *     to check if any of these values have changed.
-	 */
-	uint16_t stamp_type;
-
-	/** For possible future use.  Hosts and plugins that do not know of any
-	 * use for this value MUST always set it to 0. */
-	uint16_t pad;
 
 } LV2_Event_Buffer;
 
diff --git a/src/calf/lv2wrap.h b/src/calf/lv2wrap.h
index 33271fb..de9948f 100644
--- a/src/calf/lv2wrap.h
+++ b/src/calf/lv2wrap.h
@@ -174,7 +174,7 @@ struct lv2_wrapper
             struct LV2_Midi_Event: public LV2_Event {
                 unsigned char data[1];
             };
-            unsigned char *data = (unsigned char *)(mod->event_data + 1);
+            unsigned char *data = (unsigned char *)(mod->event_data->data);
             for (uint32_t i = 0; i < mod->event_data->event_count; i++) {
                 LV2_Midi_Event *item = (LV2_Midi_Event *)data;
                 uint32_t ts = item->frames;

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list