21 | 21 |
ImGui::Begin("MainWindow", nullptr, ImGuiWindowFlags_NoDecoration);
|
22 | 22 |
|
23 | 23 |
if (ImGui::IsKeyPressed(SAPP_KEYCODE_L)) {
|
24 | |
int delta = (int) ceil((vismax - vismin) * 0.02);
|
25 | |
vismin += delta;
|
26 | |
vismax += delta;
|
|
24 |
int delta = (int) ceil(visrad * 0.02);
|
|
25 |
playhead += delta;
|
27 | 26 |
} else if (ImGui::IsKeyPressed(SAPP_KEYCODE_H)) {
|
28 | |
int delta = (int) ceil((vismax - vismin) * 0.02);
|
29 | |
delta = std::min(vismin, delta);
|
30 | |
vismin -= delta;
|
31 | |
vismax -= delta;
|
|
27 |
int delta = (int) ceil(visrad * 0.02);
|
|
28 |
playhead -= delta;
|
32 | 29 |
}
|
33 | 30 |
|
|
31 |
/*
|
34 | 32 |
int minframe = 0, maxframe = 0;
|
35 | 33 |
for (const auto &n : _nodes) {
|
36 | 34 |
minframe = std::min(minframe, n->minframe());
|
37 | 35 |
maxframe = std::max(maxframe, n->maxframe());
|
38 | 36 |
}
|
39 | 37 |
ImGui::DragIntRange2("visible", &vismin, &vismax, 1.0, minframe, maxframe);
|
|
38 |
*/
|
40 | 39 |
|
41 | 40 |
for (const auto &n : _nodes) {
|
42 | 41 |
draw_node(n);
|
|
63 | 62 |
static constexpr int hires_frame_limit = 1000;
|
64 | 63 |
|
65 | 64 |
const std::vector<float>& audio_node::rendered() const {
|
66 | |
int visframes = _c->vismax - _c->vismin;
|
|
65 |
int visframes = 2 * _c->visrad;
|
67 | 66 |
return visframes > hires_frame_limit ? _rlo : _rhi;
|
68 | 67 |
}
|
69 | 68 |
|
70 | 69 |
double audio_node::rsamplerate() const {
|
71 | |
int visframes = _c->vismax - _c->vismin;
|
|
70 |
int visframes = 2 * _c->visrad;
|
72 | 71 |
return (visframes > hires_frame_limit ? render_rate_lo : render_rate_hi);
|
73 | 72 |
}
|
74 | 73 |
|