Exemplo n.º 1
0
int main(int argc, char *argv[])
{
    int sz;
    extern void calculate_rc(void);

    calculate_rc();
    printf("tot = %d\n", tot);
    if (argc > 1)
	sz = atoi(argv[1]);
    else
	sz = 200;
    glutInitDisplayMode(GLUT_DEPTH | GLUT_RGBA | GLUT_DOUBLE | GLUT_MULTISAMPLE);
    glutInitWindowPosition(200, 0);
    glutInitWindowSize(sz, sz);
    glutCreateWindow("Roller coaster");
    glNewList(1, GL_COMPILE);
    do_display();
    glEndList();
    glutDisplayFunc(display);
    glutKeyboardFunc(parsekey);
    glutSpecialFunc(parsekey_special);
    glutReshapeFunc(myReshape);
    glutIdleFunc(Animate);
    myinit();
    glutSwapBuffers();
    glutMainLoop();
    return 0;             /* ANSI C requires main to return int. */
}
Exemplo n.º 2
0
/* Rate of 0 means undefined. Effects that depend on sample rate must
   self-check against this because they can not implemented properly */
void uade_effect_set_sample_rate(struct uade_effect *ue, int rate)
{
    assert(rate >= 0);
    ue->rate = rate;

    if (rate == 0)
        return;

    calculate_shelve(rate, HEADPHONE2_SHELVE_FREQ, HEADPHONE2_SHELVE_LEVEL, &headphone2_shelve_l);
    calculate_shelve(rate, HEADPHONE2_SHELVE_FREQ, HEADPHONE2_SHELVE_LEVEL, &headphone2_shelve_r);
    
    calculate_rc(rate, HEADPHONE2_SHADOW_FREQ, &headphone2_rc_l);
    calculate_rc(rate, HEADPHONE2_SHADOW_FREQ, &headphone2_rc_r);
    
    headphone2_delay_length = HEADPHONE2_DELAY_TIME * rate + 0.5;
    
    if (headphone2_delay_length > HEADPHONE2_DELAY_MAX_LENGTH) {
        __android_log_print(ANDROID_LOG_VERBOSE, "UADE", "effects.c: truncating headphone delay line due to samplerate exceeding 96 kHz.\n");
        headphone2_delay_length = HEADPHONE2_DELAY_MAX_LENGTH;
    }
}