#include "m_pd.h"
#include "m_imp.h"
#include "s_stuff.h"
#ifdef _WIN32
#include <windows.h>
#include <sys/timeb.h>
#else
#include <sys/time.h>
#endif
#include <errno.h>
#include <pthread.h>
#define TIMEUNITPERMSEC …
#define TIMEUNITPERSECOND …
#define SYSTIMEPERTICK …
#define APPROXTICKSPERSEC …
#define SYS_QUIT_QUIT …
#define SYS_QUIT_REOPEN …
#define SYS_QUIT_CLOSE …
static int sys_quit;
static pthread_cond_t sched_cond;
static pthread_mutex_t sched_mutex;
static int sched_useaudio = …;
static double sched_referencerealtime, sched_referencelogicaltime;
static int sys_exitcode;
extern int sys_nosleep;
int sys_usecsincelastsleep(void);
int sys_sleepgrain;
t_clockmethod;
struct _clock
{ … };
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
t_clock *clock_new(void *owner, t_method fn)
{ … }
void clock_unset(t_clock *x)
{ … }
void clock_set(t_clock *x, double setticks)
{ … }
void clock_delay(t_clock *x, double delaytime)
{ … }
void clock_setunit(t_clock *x, double timeunit, int sampflag)
{ … }
double clock_getlogicaltime(void)
{ … }
double clock_getsystime(void) { … }
double clock_gettimesince(double prevsystime)
{ … }
double clock_gettimesincewithunits(double prevsystime,
double units, int sampflag)
{ … }
double clock_getsystimeafter(double delaytime)
{ … }
void clock_free(t_clock *x)
{ … }
void glob_audiostatus(void)
{ … }
static int sched_diored;
static int sched_dioredtime;
static int sched_meterson;
static int sched_counter;
static void sys_addhist(int n) { … }
static void sys_clearhist(void) { … }
void sys_log_error(int type)
{ … }
static int sched_lastinclip, sched_lastoutclip,
sched_lastindb, sched_lastoutdb;
void glob_watchdog(void *dummy);
static float sched_fastforward;
void glob_fastforward(void *dummy, t_floatarg f)
{ … }
void sched_init(void)
{ … }
void sched_term(void)
{ … }
void dsp_tick(void);
void sys_exit(int status)
{ … }
void sys_reopen_audio(void)
{ … }
void sys_close_audio(void)
{ … }
void sched_set_using_audio(int flag)
{ … }
int sched_get_using_audio(void)
{ … }
void sched_tick(void)
{ … }
int sched_get_sleepgrain(void)
{ … }
int *get_sys_sleepgrain(void)
{ … }
void sys_pollmidiqueue(void);
void sys_initmidiqueue(void);
int (*sys_idlehook)(void);
int sched_idletask(void)
{ … }
static void m_pollingscheduler(void)
{ … }
static volatile int callback_inprogress;
void sched_audio_callbackfn(void)
{ … }
#define CALLBACK_TIMEOUT …
int sys_try_reopen_audio(void);
static void m_callbackscheduler(void)
{ … }
void sys_do_reopen_audio(void);
void sys_do_close_audio(void);
int m_mainloop(void)
{ … }
int m_batchmain(void)
{ … }