[SCM] calf/master: + LV2: working event port implementation, reenabled MIDI port (might crash recent Ingen versions, please use the older ones or wait until the suspected unknown port bug is fixed)

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


The following commit has been merged in the master branch:
commit a2311fea524d9318b1115d105bed69ee0179041a
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Fri Feb 1 23:59:35 2008 +0000

    + LV2: working event port implementation, reenabled MIDI port (might crash recent Ingen versions, please use the older ones or wait until the suspected unknown port bug is fixed)
    
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@119 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/lv2_event.h b/src/calf/lv2_event.h
index 6fda1ba..bb8a6aa 100644
--- a/src/calf/lv2_event.h
+++ b/src/calf/lv2_event.h
@@ -46,7 +46,7 @@
  * Equal to 2^12 * 5 * 7 * 9 * 11 * 13 * 17, which is evenly divisble
  * by all integers from 1 through 18 inclusive, and powers of 2 up to 2^12.
  */
-static const uint32_t LV2_EVENT_PPQN = 3136573440;
+static const uint32_t LV2_EVENT_PPQN = 3136573440U;
 
 
 
diff --git a/src/calf/lv2wrap.h b/src/calf/lv2wrap.h
index c626c7c..df14a6b 100644
--- a/src/calf/lv2wrap.h
+++ b/src/calf/lv2wrap.h
@@ -98,15 +98,12 @@ struct lv2_wrapper
             int i = port - ins - outs;
             mod->params[i] = (float *)DataLocation;
         }
-#if USE_OLD_LV2_MIDI
         else if (Module::support_midi && port == ins + outs + params) {
             mod->midi_data = (LV2_MIDI *)DataLocation;
         }
-#else
-        else if (Module::support_midi && port == ins + outs + params) {
+        else if (Module::support_midi && port == ins + outs + params + 1) {
             mod->event_data = (LV2_Event_Buffer *)DataLocation;
         }
-#endif
     }
 
     static void cb_activate(LV2_Handle Instance) {
@@ -166,7 +163,6 @@ struct lv2_wrapper
         }
         mod->params_changed();
         uint32_t offset = 0;
-#if USE_OLD_LV2_MIDI
         if (mod->midi_data)
         {
             struct MIDI_ITEM {
@@ -195,10 +191,9 @@ struct lv2_wrapper
                 data += 12 + item->size;
             }
         }
-#else
         if (mod->event_data)
         {
-            printf("Event data: count %d\n", mod->event_data->event_count);
+            // printf("Event data: count %d\n", mod->event_data->event_count);
             struct LV2_Midi_Event: public LV2_Event {
                 unsigned char data[1];
             };
@@ -206,7 +201,8 @@ struct lv2_wrapper
             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;
-                printf("Event: timestamp %d subframes %d type %d vs %d\n", item->frames, item->subframes, item->type, mod->midi_event_type);
+                // printf("Event: timestamp %d subframes %d type %d vs %d\n", item->frames, item->subframes, item->type, mod->midi_event_type);
+                fflush(stdout);
                 if (ts > offset)
                 {
                     process_slice(mod, offset, ts);
@@ -214,7 +210,7 @@ struct lv2_wrapper
                 }
                 if (item->type == mod->midi_event_type) 
                 {
-                    printf("Midi message %x %x %x %x %d\n", item->data[0], item->data[1], item->data[2], item->data[3], item->size);
+                    // printf("Midi message %x %x %x %x %d\n", item->data[0], item->data[1], item->data[2], item->data[3], item->size);
                     switch(item->data[0] >> 4)
                     {
                     case 8: mod->note_off(item->data[1], item->data[2]); break;
@@ -228,7 +224,6 @@ struct lv2_wrapper
                 data += ((sizeof(LV2_Event) + item->size + 7))&~7;
             }
         }
-#endif
         process_slice(mod, offset, SampleCount);
     }
     static void cb_cleanup(LV2_Handle Instance) {
diff --git a/src/makerdf.cpp b/src/makerdf.cpp
index c2b2e80..806ebaf 100644
--- a/src/makerdf.cpp
+++ b/src/makerdf.cpp
@@ -180,7 +180,7 @@ void make_ttl(string path_prefix)
         for (int i = 0; i < pi.params; i++)
             add_ctl_port(ports, pi.param_props[i], pn++);
         if (pi.midi_in_capable) {
-            // add_port(ports, "midi_in", "MIDI", "Input", pn++, "<http://ll-plugins.nongnu.org/lv2/ext/MidiPort>");
+            add_port(ports, "midi_in", "MIDI", "Input", pn++, "<http://ll-plugins.nongnu.org/lv2/ext/MidiPort>");
             add_port(ports, "event_in", "Event", "Input", pn++, "lv2ev:EventPort");
         }
         if (!ports.empty())

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list