foostudio.cView |
---|
35 | 35 … | if (argc > 1) src_fname = argv[1]; |
36 | 36 … | if (argc > 2) device_out = argv[2]; |
37 | 37 … | if (argc > 3) device_in = argv[3]; |
38 | 38 … | |
39 | | - ccdl_init(&ccdl, src_fname, "TUNE"); |
| 39 … | + ccdl_init(&ccdl, src_fname, "play"); |
|
40 | 40 … | |
41 | 41 … | if (ccdl_watch(&ccdl)) { |
42 | 42 … | errx(1, "ccdl_watch"); |
43 | 43 … | } |
118 | 118 … | errx(1, "prepare after read failed: %s\n", snd_strerror(err)); |
119 | 119 … | continue; |
120 | 120 … | } |
121 | 121 … | |
122 | | - struct tune *tune = ccdl_get(&ccdl); |
123 | | - if (tune && tune->play) { |
| 122 … | + play_fn *play; |
| 123 … | + *(void **)(&play) = ccdl_get(&ccdl); |
| 124 … | + if (play) { |
124 | 125 … | for (size_t i = 0; i < period_size; i++) { |
125 | 126 … | time += step; |
126 | 127 … | float frame_in = i < (unsigned)frames_in ? buffer[i] : 0; |
127 | | - buffer[i] = tune->play(&tune_obj, tune, time, frame_in); |
| 128 … | + buffer[i] = play(tune_obj, time, frame_in); |
128 | 129 … | } |
129 | 130 … | } else { |
130 | 131 … | time += step * period_size; |
131 | 132 … | } |