Exemplo n.º 1
0
void rtmidi_in_cancel_callback (RtMidiInPtr device)
{
#if defined(__NO_EXCEPTIONS__)
    RtMidiIn* rtm = (RtMidiIn*) device->ptr;
    rtm->resetError();
    rtm->cancelCallback ();
    if (rtm->isError()) {
        device->ok  = false;
        device->msg = rtm->getError().what ();
    }
    else {
        delete (CallbackProxyUserData*) device->data;
        device->data = 0;
    }
#else
    try {
        ((RtMidiIn*) device->ptr)->cancelCallback ();
        delete (CallbackProxyUserData*) device->data;
        device->data = 0;
    } catch (const RtMidiError & err) {
        device->ok  = false;
        device->msg = err.what ();
    }
#endif
}
Exemplo n.º 2
0
value rtmidi_in_cancelcallback(value obj) {
  RtMidiIn *midiin = (RtMidiIn *)(intptr_t)val_float(obj);
  midiin->cancelCallback();
  if (callback_root) {
    delete callback_root;
    callback_root = NULL;
  }
  return alloc_null();
}