1 /*
2  * Copyright (c) 2019 Christian Schoenebeck
3  *
4  * http://www.linuxsampler.org
5  *
6  * This file is part of LinuxSampler and released under the same terms.
7  * See README file for details.
8  */
9 
10 #ifndef LS_LFO_ALL_H
11 #define LS_LFO_ALL_H
12 
13 // This header pulls all LFO header files available in the sampler's code base.
14 //
15 // Since we have numerous different LFO wave form types, and for each of them
16 // even several different implementations, this header serves for including all
17 // the individual LFO implementations' header files and additionally it
18 // automatically selects (by typedefs) for each wave form one specific
19 // implementation (either because the configure script's benchmarks picked the
20 // most fastest/efficient implementation for this machine, or because the it was
21 // explicitly human selected (i.e. by configure script argument).
22 
23 #include "../../common/global_private.h"
24 #include "LFOBase.h"
25 
26 // IDs of the two possible implementations
27 // we get the implementation to pick from config.h
28 // the implementation IDs should be the same like in benchmarks/triang.cpp !
29 #define TRIANG_INT_MATH_SOLUTION       2
30 #define TRIANG_DI_HARMONIC_SOLUTION    3
31 #define TRIANG_INT_ABS_MATH_SOLUTION   5
32 
33 // include the appropriate (unsigned) triangle LFO implementation
34 #if CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
35 # include "LFOTriangleIntMath.h"
36 #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
37 # include "LFOTriangleIntAbsMath.h"
38 #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
39 # include "LFOTriangleDiHarmonic.h"
40 #else
41 # error "Unknown or no (unsigned) triangle LFO implementation selected!"
42 #endif
43 
44 // include the appropriate (signed) triangle LFO implementation
45 #if CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
46 # include "LFOTriangleIntMath.h"
47 #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
48 # include "LFOTriangleIntAbsMath.h"
49 #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
50 # include "LFOTriangleDiHarmonic.h"
51 #else
52 # error "Unknown or no (signed) triangle LFO implementation selected!"
53 #endif
54 
55 //TODO: benchmark in configure and pull the relevant implementation for these wave forms as well like we do for triangle
56 #include "LFOSquareIntMath.h"
57 #include "LFOSquarePulse.h"
58 #include "LFOSawIntMathNew.h"
59 #include "LFOSawIntMathOld.h"
60 #include "LFOSineNumericComplexNr.h"
61 #include "LFOSineBuiltinFn.h"
62 #include "LFOPulse.h"
63 
64 namespace LinuxSampler {
65 
66     #if CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
67     typedef LFOTriangleIntMath<LFO::range_unsigned> LFOTriangleUnsigned;
68     #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
69     typedef LFOTriangleIntAbsMath<LFO::range_unsigned> LFOTriangleUnsigned;
70     #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
71     typedef LFOTriangleDiHarmonic<LFO::range_unsigned> LFOTriangleUnsigned;
72     #endif
73 
74     #if CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
75     typedef LFOTriangleIntMath<LFO::range_signed> LFOTriangleSigned;
76     #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
77     typedef LFOTriangleIntAbsMath<LFO::range_signed> LFOTriangleSigned;
78     #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
79     typedef LFOTriangleDiHarmonic<LFO::range_signed> LFOTriangleSigned;
80     #endif
81 
82     typedef LFOSquareIntMath<LFO::range_signed> LFOSquareSigned;
83     typedef LFOSquareIntMath<LFO::range_unsigned> LFOSquareUnsigned;
84 
85     typedef LFOSawIntMathNew<LFO::range_signed> LFOSawSigned;
86     typedef LFOSawIntMathNew<LFO::range_unsigned> LFOSawUnsigned;
87 
88     typedef LFOSineNumericComplexNr<LFO::range_signed> LFOSineSigned;
89     typedef LFOSineNumericComplexNr<LFO::range_unsigned> LFOSineUnsigned;
90 
91 } // namespace LinuxSampler
92 
93 #endif // LS_LFO_ALL_H
94