Example #1
0
JNIEXPORT void JNICALL Java_org_puredata_core_PdBase_initialize
(JNIEnv *env, jclass cls) {
  CACHE_ENV
  objClass = LIBPD_CLASS_REF("java/lang/Object");
  floatClass = LIBPD_CLASS_REF("java/lang/Float");
  floatInit = (*env)->GetMethodID(env, floatClass, "<init>", "(F)V");

  libpd_printhook = (t_libpd_printhook) java_printhook;
  libpd_banghook = (t_libpd_banghook) java_sendBang;
  libpd_floathook = (t_libpd_floathook) java_sendFloat;
  libpd_symbolhook = (t_libpd_symbolhook) java_sendSymbol;
  libpd_listhook = (t_libpd_listhook) java_sendList;
  libpd_messagehook = (t_libpd_messagehook) java_sendMessage;

  libpd_noteonhook = (t_libpd_noteonhook) java_sendNoteOn;
  libpd_controlchangehook = (t_libpd_controlchangehook) java_sendControlChange;
  libpd_programchangehook = (t_libpd_programchangehook) java_sendProgramChange;
  libpd_pitchbendhook = (t_libpd_pitchbendhook) java_sendPitchBend;
  libpd_aftertouchhook = (t_libpd_aftertouchhook) java_sendAftertouch;
  libpd_polyaftertouchhook =
            (t_libpd_polyaftertouchhook) java_sendPolyAftertouch;
  libpd_midibytehook = (t_libpd_midibytehook) java_sendMidiByte;

  libpd_init();
}
Example #2
0
JNIEXPORT void JNICALL Java_org_puredata_core_PdBase_initialize
(JNIEnv *env, jclass cls) {
  libpd_queued_init();

  objClass = LIBPD_CLASS_REF("java/lang/Object");
  floatClass = LIBPD_CLASS_REF("java/lang/Float");
  floatInit = (*env)->GetMethodID(env, floatClass, "<init>", "(F)V");

  libpd_set_queued_printhook(libpd_print_concatenator);
  libpd_set_concatenated_printhook(java_printhook);

  libpd_set_queued_banghook(java_sendBang);
  libpd_set_queued_floathook(java_sendFloat);
  libpd_set_queued_symbolhook(java_sendSymbol);
  libpd_set_queued_listhook(java_sendList);
  libpd_set_queued_messagehook(java_sendMessage);

  libpd_set_queued_noteonhook(java_sendNoteOn);
  libpd_set_queued_controlchangehook(java_sendControlChange);
  libpd_set_queued_programchangehook(java_sendProgramChange);
  libpd_set_queued_pitchbendhook(java_sendPitchBend);
  libpd_set_queued_aftertouchhook(java_sendAftertouch);
  libpd_set_queued_polyaftertouchhook(java_sendPolyAftertouch);
  libpd_set_queued_midibytehook(java_sendMidiByte);
}