Do not allow to embed ogg/vorbis files, require import
[ardour.git] / scripts / _tx_raw_midi_from_file.lua
index 36cbdc1a39df33e45bd48373e010738cba883aa4..ac45cd1b10c64b9c68aa8649a8920e24bec45c10 100644 (file)
@@ -73,9 +73,9 @@ function factory () return function ()
                        -- parse MIDI data byte-by-byte
                        for i = 1, #bytes do
                                if parser:process_byte (bytes:byte (i)) then
-                                       if parser:buffer_size () > 127 then
+                                       if parser:buffer_size () > 255 then
                                                long_message = true
-                                               print ("WARNING -- single large message > 127, bytes: ", parser:buffer_size ())
+                                               print ("WARNING -- single large message > 255, bytes: ", parser:buffer_size ())
                                        end
                                        -- parsed complete normalized MIDI message, send it
                                        async_midi_port:write (parser:midi_buffer (), parser:buffer_size (), 0)
@@ -108,3 +108,21 @@ function factory () return function ()
        rv = nil
        collectgarbage ()
 end end
+
+function icon (params) return function (ctx, width, height, fg)
+       ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
+       local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil(math.min (width, height) * .45) .. "px")
+       txt:set_text ("S")
+       ctx:move_to (1, 1)
+       txt:show_in_cairo_context (ctx)
+
+       txt:set_text ("Y")
+       local tw, th = txt:get_pixel_size ()
+       ctx:move_to (.5 * (width - tw), .5 * (height - th))
+       txt:show_in_cairo_context (ctx)
+
+       txt:set_text ("X")
+       tw, th = txt:get_pixel_size ()
+       ctx:move_to ((width - tw - 1), (height - th -1))
+       txt:show_in_cairo_context (ctx)
+end end