diff --git a/sync/sync.h b/sync/sync.h index 790e967..70987ef 100644 --- a/sync/sync.h +++ b/sync/sync.h @@ -35,7 +35,7 @@ void sync_set_io_cb(struct sync_device *d, struct sync_io_cb *cb); #endif /* defined(SYNC_PLAYER) */ const struct sync_track *sync_get_track(struct sync_device *, const char *); -float sync_get_val(const struct sync_track *, double); +double sync_get_val(const struct sync_track *, double); #ifdef __cplusplus } diff --git a/sync/track.c b/sync/track.c index fccc3e7..05f4793 100644 --- a/sync/track.c +++ b/sync/track.c @@ -13,27 +13,27 @@ #include "track.h" #include "base.h" -static float key_linear(const struct track_key k[2], double row) +static double key_linear(const struct track_key k[2], double row) { double t = (row - k[0].row) / (k[1].row - k[0].row); - return (float)(k[0].value + (k[1].value - k[0].value) * t); + return k[0].value + (k[1].value - k[0].value) * t; } -static float key_smooth(const struct track_key k[2], double row) +static double key_smooth(const struct track_key k[2], double row) { double t = (row - k[0].row) / (k[1].row - k[0].row); t = t * t * (3 - 2 * t); - return (float)(k[0].value + (k[1].value - k[0].value) * t); + return k[0].value + (k[1].value - k[0].value) * t; } -static float key_ramp(const struct track_key k[2], double row) +static double key_ramp(const struct track_key k[2], double row) { double t = (row - k[0].row) / (k[1].row - k[0].row); t = pow(t, 2.0); - return (float)(k[0].value + (k[1].value - k[0].value) * t); + return k[0].value + (k[1].value - k[0].value) * t; } -float sync_get_val(const struct sync_track *t, double row) +double sync_get_val(const struct sync_track *t, double row) { int idx, irow;