1 |
|
|
#include "gwion_util.h" |
2 |
|
|
#include "gwion_ast.h" |
3 |
|
|
#include "gwion_env.h" |
4 |
|
|
#include "vm.h" |
5 |
|
|
#include "gwion.h" |
6 |
|
|
#include "instr.h" |
7 |
|
|
#include "object.h" |
8 |
|
|
#include "emit.h" |
9 |
|
|
#include "operator.h" |
10 |
|
|
#include "import.h" |
11 |
|
|
#include "gwi.h" |
12 |
|
|
#include "driver.h" |
13 |
|
|
#include "traverse.h" |
14 |
|
|
#include "parse.h" |
15 |
|
|
#include "specialid.h" |
16 |
|
|
#include "array.h" |
17 |
|
|
#include "gack.h" |
18 |
|
|
|
19 |
|
730 |
GWION_IMPORT(values) { |
20 |
|
730 |
VM* vm = gwi_vm(gwi); |
21 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, d_zero, m_float, 0.0); |
22 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, sr, m_float, (m_float)vm->bbq->si->sr); |
23 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, samp, m_float, 1.0); |
24 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, ms, m_float, (m_float)(*sr / 1000.)); |
25 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, second, m_float, (m_float)*sr); |
26 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, minute, m_float, (m_float)(*sr * 60.0)); |
27 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, hour, m_float, (m_float)(*minute * 60.0)); |
28 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, t_zero, m_float, 0.0); |
29 |
|
730 |
ALLOC_PTR(gwi->gwion->mp, pi, m_float, (m_float)M_PI); |
30 |
|
730 |
gwi_item_ini(gwi, "float", "samplerate"); |
31 |
|
730 |
gwi_item_end(gwi, ae_flag_const, sr); |
32 |
|
730 |
gwi_item_ini(gwi, "float", "pi"); |
33 |
|
730 |
gwi_item_end(gwi, ae_flag_const, pi); |
34 |
|
730 |
gwi_item_ini(gwi, "dur", "d_zero"); |
35 |
|
730 |
gwi_item_end(gwi, ae_flag_const, d_zero); |
36 |
|
730 |
gwi_item_ini(gwi, "dur", "samp"); |
37 |
|
730 |
gwi_item_end(gwi, ae_flag_const, samp); |
38 |
|
730 |
gwi_item_ini(gwi, "dur", "ms"); |
39 |
|
730 |
gwi_item_end(gwi, ae_flag_const, ms); |
40 |
|
730 |
gwi_item_ini(gwi, "dur", "second"); |
41 |
|
730 |
gwi_item_end(gwi, ae_flag_const, second); |
42 |
|
730 |
gwi_item_ini(gwi, "dur", "minute"); |
43 |
|
730 |
gwi_item_end(gwi, ae_flag_const, minute); |
44 |
|
730 |
gwi_item_ini(gwi, "dur", "hour"); |
45 |
|
730 |
gwi_item_end(gwi, ae_flag_const, hour); |
46 |
|
730 |
gwi_item_ini(gwi, "time", "t_zero"); |
47 |
|
730 |
gwi_item_end(gwi, ae_flag_const, t_zero); |
48 |
|
730 |
return GW_OK; |
49 |
|
|
} |