rtmidi_register_callback   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/rtmidi.xtm

Implementation

(bind-func rtmidi_register_callback
  "Register a midi sink/source"
  (lambda (dev:RtMidiInPtr callback_name:i8* user_data:i8*)
    (let ((len (strlen callback_name))
          (callback_name_native:i8* (salloc (+ len 8))))
      (strncpy callback_name_native callback_name (+ 1 len))
      (strncpy (pref-ptr callback_name_native len) "_native" 8)
      (let ((fptr (llvm_get_function_ptr callback_name_native)))
        (if (null? fptr)
            (printf "Error: cannot find xtlang function %s\n" callback_name)
            (begin
              (rtmidi_in_set_callback dev (cast fptr RtMidiCCallback) user_data)
              (printf "\nregistered %s as MIDI callback function\n\n" callback_name)))))))


Back to Index

Similar Entries

  • PaStreamCallbackTimeInfo_print    xtlang
  • PaStreamCallbackTimeInfo_toString    xtlang
  • audio_callback:PaStreamCallback    xtlang
  • audio_callback:PaStreamCallback    xtlang
  • callback    scheme
  • callback-adapter    scheme
  • callback-test2-helper    xtlang
  • callback_goodbye_world    xtlang
  • callback_hello_world    xtlang
  • clock_scheduler_main_callback    xtlang
  • curl_write_callback    xtlang
  • glfw_char_callback:GLFWcharfun    xtlang
  • glfw_cursor_position_callback:GLFWcursorposfun    xtlang
  • glfw_error_callback:GLFWerrorfun    xtlang
  • glfw_key_callback:GLFWkeyfun    xtlang
  • glfw_mouse_button_callback:GLFWmousebuttonfun    xtlang
  • glfw_window_focus_callback:GLFWwindowfocusfun    xtlang
  • glfw_window_position_callback:GLFWwindowposfun    xtlang
  • gui_window_size_callback    xtlang
  • impc:ir:compiler:callback    scheme
  • impc:ti:callback    scheme
  • impc:ti:callback-check    scheme
  • impc:ti:register-new-builtin    scheme
  • impc:ti:register-new-closure    scheme
  • impc:ti:register-new-genericfunc    scheme
  • impc:ti:register-new-generictype    scheme
  • impc:ti:register-new-globalvar    scheme
  • impc:ti:register-new-namedtype    scheme
  • impc:ti:register-new-nativefunc    scheme
  • impc:ti:register-new-polyfunc    scheme
  • impc:ti:register-new-polytype    scheme
  • impc:ti:register-new-typealias    scheme
  • impc:ti:register-new-xtmacro    scheme
  • listener-callback    scheme
  • on_register_custom_schemes    xtlang
  • register-ext-val    macro
  • register-lib-func    macro
  • register-lib-type    macro
  • register-lib-val    macro
  • register_class    xtlang
  • register_method    xtlang
  • rtmidi_default_callback:RtMidiCCallback    xtlang
  • rtmidi_print_ports    xtlang
  • rtmidi_process_message    xtlang
  • rtmidi_send    xtlang