diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-03-11 16:31:38 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-03-11 16:31:38 +0100 |
commit | 03925afaa3117243a7b29fa4327ea378c3e6eee6 (patch) | |
tree | 12357e194346213a3bded2654f7e3428c84d6aed /code/fe310/eos/eve/eve_track.h | |
parent | ab1006d27417cc831150877ec46fbc13ffeddb53 (diff) |
eve refactor: keyboard scale param; track extended; oscillator extended tracker
Diffstat (limited to 'code/fe310/eos/eve/eve_track.h')
-rw-r--r-- | code/fe310/eos/eve/eve_track.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/code/fe310/eos/eve/eve_track.h b/code/fe310/eos/eve/eve_track.h new file mode 100644 index 0000000..07ddb44 --- /dev/null +++ b/code/fe310/eos/eve/eve_track.h @@ -0,0 +1,35 @@ +#include <stdint.h> + +#define EVE_TRACK_TYPE_INERT 1 +#define EVE_TRACK_TYPE_OSC 2 +#define EVE_TRACK_FRICTION 500 + +typedef void (*eve_track_init_t) (EVETouchTimer *, EVETouch *); +typedef int (*eve_track_tick_t) (EVETouchTimer *, EVETouch *); +typedef void (*eve_track_stop_t) (EVETouchTimer *, EVETouch *); + +typedef struct EVETracker { + eve_track_init_t init; + eve_track_tick_t tick; + eve_track_stop_t stop; +} EVETracker; + +typedef struct EVETrackOsc { + int x; + int y; + double f; + double d; + double a; + uint32_t t_max; +} EVETrackOsc; + +void eve_init_track(void); +EVETracker *eve_track_get_tracker(void); +void eve_track_set_handler(eve_track_init_t init, eve_track_tick_t tick, eve_track_stop_t stop, void *param); +void eve_track_set(uint8_t type, void *param); +void eve_track_stop(EVETouchTimer *timer, EVETouch *touch); + +void eve_track_inert_init(EVETouchTimer *timer, EVETouch *touch); +int eve_track_inert_tick(EVETouchTimer *timer, EVETouch *touch); +int eve_track_osc_tick(EVETouchTimer *timer, EVETouch *touch); +void eve_track_osc_init(EVETrackOsc *p, int x, int y, uint32_t T, double d, uint32_t t_max); |