Example #1
0
static void update_speed(struct af_instance *af, double new_speed)
{
    struct priv *p = af->priv;

    p->speed = new_speed;
    rubberband_set_time_ratio(p->rubber, 1.0 / p->speed);
}
Example #2
0
void set_playback_speed (double speed) {
    if(rubberband==NULL)
        rubberband_init(&Denemo.prefs);
    Denemo.project->movement->end_time /= slowdown;
    Denemo.project->movement->start_time /= slowdown;
    if(speed>1.01) {
        slowdown = speed;
        rubberband_active = TRUE;
    }
    else
    {
        slowdown = 1.0;
        rubberband_active = FALSE;
    }
    rubberband_set_time_ratio(rubberband, slowdown);
    Denemo.project->movement->end_time *= slowdown;
    Denemo.project->movement->start_time *= slowdown;
}