port from perforce
This commit is contained in:
49
hgplus/nordlicht2014-intro/3rdparty/example.c
vendored
Normal file
49
hgplus/nordlicht2014-intro/3rdparty/example.c
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "usync.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (usync_init() < 0)
|
||||
abort();
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
/* HACK: prefetch tracks - not needed when actually editing */
|
||||
usync_get_val(foo);
|
||||
sleep(1);
|
||||
usync_update(0.0f);
|
||||
#endif
|
||||
|
||||
float row = 0.0f;
|
||||
while (row <= 8.0f) {
|
||||
usync_update(row);
|
||||
printf("%f: %f\n", row, usync_get_val(foo));
|
||||
row += 1.0f / 4; /* step one 4th of a row */
|
||||
}
|
||||
usync_export();
|
||||
}
|
||||
|
||||
#ifndef SYNC_PLAYER
|
||||
static void pause(void *d, int flag)
|
||||
{
|
||||
/* TODO*/
|
||||
}
|
||||
|
||||
static void set_row(void *d, int row)
|
||||
{
|
||||
/* TODO*/
|
||||
}
|
||||
|
||||
static int is_playing(void *d)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
struct sync_cb usync_cb = {
|
||||
pause,
|
||||
set_row,
|
||||
is_playing
|
||||
};
|
||||
|
||||
void *usync_data = NULL;
|
||||
#endif
|
||||
Reference in New Issue
Block a user