/* Copyright (c) 1997-1999 Miller Puckette. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ /* misc. */ #include "m_pd.h" #include "s_stuff.h" #include #include #include #ifdef _WIN32 #include #include #else #include #include #include #include #include #endif /* _WIN32 */ #if defined (__APPLE__) || defined (__FreeBSD__) #define CLOCKHZ CLK_TCK #endif #if defined (__linux__) || defined (__CYGWIN__) || defined (ANDROID) #define CLOCKHZ sysconf(_SC_CLK_TCK) #endif #if defined (__FreeBSD_kernel__) || defined(__GNU__) #include #define CLOCKHZ CLOCKS_PER_SEC #endif static t_class *loadbang_class; typedef struct _loadbang { t_object x_obj; } t_loadbang; static void *loadbang_new(void) { t_loadbang *x = (t_loadbang *)pd_new(loadbang_class); outlet_new(&x->x_obj, &s_bang); return (x); } static void loadbang_loadbang(t_loadbang *x) { if (!sys_noloadbang) outlet_bang(x->x_obj.ob_outlet); } void loadbang_setup(void) { loadbang_class = class_new(gensym("loadbang"), (t_newmethod)loadbang_new, 0, sizeof(t_loadbang), CLASS_NOINLET, 0); class_addmethod(loadbang_class, (t_method)loadbang_loadbang, gensym("loadbang"), 0); }