void PdBase::PdContext::clear() { // detach callbacks if(bInited) { computeAudio(false); libpd_printhook = (t_libpd_printhook) NULL; libpd_banghook = (t_libpd_banghook) NULL; libpd_floathook = (t_libpd_floathook) NULL; libpd_symbolhook = (t_libpd_symbolhook) NULL; libpd_listhook = (t_libpd_listhook) NULL; libpd_messagehook = (t_libpd_messagehook) NULL; libpd_noteonhook = (t_libpd_noteonhook) NULL; libpd_controlchangehook = (t_libpd_controlchangehook) NULL; libpd_programchangehook = (t_libpd_programchangehook) NULL; libpd_pitchbendhook = (t_libpd_pitchbendhook) NULL; libpd_aftertouchhook = (t_libpd_aftertouchhook) NULL; libpd_polyaftertouchhook = (t_libpd_polyaftertouchhook) NULL; libpd_midibytehook = (t_libpd_midibytehook) NULL; } bInited = false; bMsgInProgress = false; curMsgLen = 0; msgType = MSG; midiPort = 0; }
void PdBase::PdContext::clear() { // detach callbacks if(bInited) { computeAudio(false); if(bQueued) { libpd_set_queued_printhook(NULL); libpd_set_concatenated_printhook(NULL); libpd_set_queued_banghook(NULL); libpd_set_queued_floathook(NULL); libpd_set_queued_symbolhook(NULL); libpd_set_queued_listhook(NULL); libpd_set_queued_messagehook(NULL); libpd_set_queued_noteonhook(NULL); libpd_set_queued_controlchangehook(NULL); libpd_set_queued_programchangehook(NULL); libpd_set_queued_pitchbendhook(NULL); libpd_set_queued_aftertouchhook(NULL); libpd_set_queued_polyaftertouchhook(NULL); libpd_set_queued_midibytehook(NULL); libpd_queued_release(); } else { libpd_set_printhook(NULL); libpd_set_concatenated_printhook(NULL); libpd_set_banghook(NULL); libpd_set_floathook(NULL); libpd_set_symbolhook(NULL); libpd_set_listhook(NULL); libpd_set_messagehook(NULL); libpd_set_noteonhook(NULL); libpd_set_controlchangehook(NULL); libpd_set_programchangehook(NULL); libpd_set_pitchbendhook(NULL); libpd_set_aftertouchhook(NULL); libpd_set_polyaftertouchhook(NULL); libpd_set_midibytehook(NULL); } } bInited = false; bQueued = false; bMsgInProgress = false; curMsgLen = 0; msgType = MSG; midiPort = 0; }