forked from kmatheussen/radium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_smoothdelay.cpp
57 lines (41 loc) · 925 Bytes
/
test_smoothdelay.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#if BENCHMARK_SMOOTHDELAY
#if !defined(RELEASE)
#error "hmm"
#endif
#endif
#include <stdio.h>
#include <math.h>
#include <QThread>
#define TEST_SMOOTHDELAY 1
#include "../common/nsmtracker.h"
#include "../audio/SmoothDelay.hpp"
static double get_ms(void){
struct timeval now;
int err = gettimeofday(&now, NULL);
if (err != 0)
abort();
return (double)now.tv_sec*1000.0 + (double)now.tv_usec/1000.0;
}
double TIME_get_ms(void){
return get_ms();
}
bool PLAYER_current_thread_has_lock(void){
return false;
}
bool THREADING_is_player_or_runner_thread(void){
return true;
}
void CRASHREPORTER_send_assert_message(enum Crash_Type crash_type, const char *fmt,...){
abort();
}
void JUCE_add_sound(float *dst, const float *src, int num_frames){
for(int i=0;i<num_frames;i++)
dst[i] += src[i];
}
void msleep(int ms){
QThread::msleep(ms);
}
int main(void){
SMOOTHDELAY_test();
return 0;
}