annotate examples/08-PureData/basic_libpd/z_libpd.h @ 464:8fcfbfb32aa0 prerelease

Examples reorder with subdirectories. Added header to each project. Moved Doxygen to bottom of render.cpp.
author Robert Jack <robert.h.jack@gmail.com>
date Mon, 20 Jun 2016 16:20:38 +0100
parents
children
rev   line source
robert@464 1 /*
robert@464 2 * Copyright (c) 2010 Peter Brinkmann (peter.brinkmann@gmail.com)
robert@464 3 *
robert@464 4 * For information on usage and redistribution, and for a DISCLAIMER OF ALL
robert@464 5 * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
robert@464 6 *
robert@464 7 * See https://github.com/libpd/libpd/wiki for documentation
robert@464 8 *
robert@464 9 */
robert@464 10
robert@464 11 #ifndef __Z_LIBPD_H__
robert@464 12 #define __Z_LIBPD_H__
robert@464 13
robert@464 14 #ifdef __cplusplus
robert@464 15 extern "C"
robert@464 16 {
robert@464 17 #endif
robert@464 18
robert@464 19 #include "m_pd.h"
robert@464 20
robert@464 21 EXTERN int libpd_init(void);
robert@464 22 EXTERN void libpd_clear_search_path(void);
robert@464 23 EXTERN void libpd_add_to_search_path(const char *sym);
robert@464 24
robert@464 25 EXTERN void *libpd_openfile(const char *basename, const char *dirname);
robert@464 26 EXTERN void libpd_closefile(void *p);
robert@464 27 EXTERN int libpd_getdollarzero(void *p);
robert@464 28
robert@464 29 EXTERN int libpd_blocksize(void);
robert@464 30 EXTERN int libpd_init_audio(int inChans, int outChans, int sampleRate);
robert@464 31 EXTERN int libpd_process_raw(const float *inBuffer, float *outBuffer);
robert@464 32 EXTERN t_sample* libpd_get_sys_soundin();
robert@464 33 EXTERN t_sample* libpd_get_sys_soundout();
robert@464 34 EXTERN int libpd_process_sys();
robert@464 35 EXTERN int libpd_process_short(const int ticks,
robert@464 36 const short *inBuffer, short *outBuffer);
robert@464 37 EXTERN int libpd_process_float(int ticks,
robert@464 38 const float *inBuffer, float *outBuffer);
robert@464 39 EXTERN int libpd_process_double(int ticks,
robert@464 40 const double *inBuffer, double *outBuffer);
robert@464 41
robert@464 42 EXTERN int libpd_arraysize(const char *name);
robert@464 43 // The parameters of the next two functions are inspired by memcpy.
robert@464 44 EXTERN int libpd_read_array(float *dest, const char *src, int offset, int n);
robert@464 45 EXTERN int libpd_write_array(const char *dest, int offset, float *src, int n);
robert@464 46
robert@464 47 EXTERN int libpd_bang(const char *recv);
robert@464 48 EXTERN int libpd_float(const char *recv, float x);
robert@464 49 EXTERN int libpd_symbol(const char *recv, const char *sym);
robert@464 50
robert@464 51 EXTERN void libpd_set_float(t_atom *v, float x);
robert@464 52 EXTERN void libpd_set_symbol(t_atom *v, const char *sym);
robert@464 53 EXTERN int libpd_list(const char *recv, int argc, t_atom *argv);
robert@464 54 EXTERN int libpd_message(const char *recv, const char *msg, int argc, t_atom *argv);
robert@464 55
robert@464 56 EXTERN int libpd_start_message(int max_length);
robert@464 57 EXTERN void libpd_add_float(float x);
robert@464 58 EXTERN void libpd_add_symbol(const char *sym);
robert@464 59 EXTERN int libpd_finish_list(const char *recv);
robert@464 60 EXTERN int libpd_finish_message(const char *recv, const char *msg);
robert@464 61
robert@464 62 EXTERN int libpd_exists(const char *sym);
robert@464 63 EXTERN void *libpd_bind(const char *sym);
robert@464 64 EXTERN void libpd_unbind(void *p);
robert@464 65
robert@464 66 EXTERN int libpd_is_float(t_atom *a);
robert@464 67 EXTERN int libpd_is_symbol(t_atom *a);
robert@464 68 EXTERN float libpd_get_float(t_atom *a);
robert@464 69 EXTERN char *libpd_get_symbol(t_atom *a);
robert@464 70 EXTERN t_atom *libpd_next_atom(t_atom *a);
robert@464 71
robert@464 72 typedef void (*t_libpd_printhook)(const char *recv);
robert@464 73 typedef void (*t_libpd_banghook)(const char *recv);
robert@464 74 typedef void (*t_libpd_floathook)(const char *recv, float x);
robert@464 75 typedef void (*t_libpd_symbolhook)(const char *recv, const char *sym);
robert@464 76 typedef void (*t_libpd_listhook)(const char *recv, int argc, t_atom *argv);
robert@464 77 typedef void (*t_libpd_messagehook)(const char *recv, const char *msg,
robert@464 78 int argc, t_atom *argv);
robert@464 79
robert@464 80 EXTERN void libpd_set_printhook(const t_libpd_printhook hook);
robert@464 81 EXTERN void libpd_set_banghook(const t_libpd_banghook hook);
robert@464 82 EXTERN void libpd_set_floathook(const t_libpd_floathook hook);
robert@464 83 EXTERN void libpd_set_symbolhook(const t_libpd_symbolhook hook);
robert@464 84 EXTERN void libpd_set_listhook(const t_libpd_listhook hook);
robert@464 85 EXTERN void libpd_set_messagehook(const t_libpd_messagehook hook);
robert@464 86
robert@464 87 EXTERN int libpd_noteon(int channel, int pitch, int velocity);
robert@464 88 EXTERN int libpd_controlchange(int channel, int controller, int value);
robert@464 89 EXTERN int libpd_programchange(int channel, int value);
robert@464 90 EXTERN int libpd_pitchbend(int channel, int value);
robert@464 91 EXTERN int libpd_aftertouch(int channel, int value);
robert@464 92 EXTERN int libpd_polyaftertouch(int channel, int pitch, int value);
robert@464 93 EXTERN int libpd_midibyte(int port, int byte);
robert@464 94 EXTERN int libpd_sysex(int port, int byte);
robert@464 95 EXTERN int libpd_sysrealtime(int port, int byte);
robert@464 96
robert@464 97 typedef void (*t_libpd_noteonhook)(int channel, int pitch, int velocity);
robert@464 98 typedef void (*t_libpd_controlchangehook)(int channel,
robert@464 99 int controller, int value);
robert@464 100 typedef void (*t_libpd_programchangehook)(int channel, int value);
robert@464 101 typedef void (*t_libpd_pitchbendhook)(int channel, int value);
robert@464 102 typedef void (*t_libpd_aftertouchhook)(int channel, int value);
robert@464 103 typedef void (*t_libpd_polyaftertouchhook)(int channel, int pitch, int value);
robert@464 104 typedef void (*t_libpd_midibytehook)(int port, int byte);
robert@464 105
robert@464 106 EXTERN void libpd_set_noteonhook(const t_libpd_noteonhook hook);
robert@464 107 EXTERN void libpd_set_controlchangehook(const t_libpd_controlchangehook hook);
robert@464 108 EXTERN void libpd_set_programchangehook(const t_libpd_programchangehook hook);
robert@464 109 EXTERN void libpd_set_pitchbendhook(const t_libpd_pitchbendhook hook);
robert@464 110 EXTERN void libpd_set_aftertouchhook(const t_libpd_aftertouchhook hook);
robert@464 111 EXTERN void libpd_set_polyaftertouchhook(const t_libpd_polyaftertouchhook hook);
robert@464 112 EXTERN void libpd_set_midibytehook(const t_libpd_midibytehook hook);
robert@464 113 EXTERN void libpd_sys_microsleep(int sleep);
robert@464 114
robert@464 115 #ifdef __cplusplus
robert@464 116 }
robert@464 117 #endif
robert@464 118
robert@464 119 #endif