[client] audio: redraw the graphs if they have been updated

This commit is contained in:
Geoffrey McRae 2022-01-17 22:49:19 +11:00
parent 775ac7ce8b
commit 0ad26b7da7
5 changed files with 17 additions and 0 deletions

View File

@ -116,6 +116,7 @@ typedef const char * (*GraphFormatFn)(const char * name,
GraphHandle app_registerGraph(const char * name, RingBuffer buffer,
float min, float max, GraphFormatFn formatFn);
void app_unregisterGraph(GraphHandle handle);
void app_invalidateGraphs(void);
void app_overlayConfigRegister(const char * title,
void (*callback)(void * udata, int * id), void * udata);

View File

@ -706,6 +706,11 @@ void app_unregisterGraph(GraphHandle handle)
overlayGraph_unregister(handle);
}
void app_invalidateGraphs(void)
{
overlayGraph_invalidate();
}
void app_registerOverlay(const struct LG_OverlayOps * ops, const void * params)
{
ASSERT_LG_OVERLAY_VALID(ops);

View File

@ -298,4 +298,6 @@ void audio_tick(unsigned long long tickCount)
ringbuffer_push(audio.playback.timings, &flatency);
LG_UNLOCK(audio.playback.lock);
app_invalidateGraphs();
}

View File

@ -241,3 +241,11 @@ void overlayGraph_iterate(void (*callback)(GraphHandle handle, const char * name
callback(graph, graph->name, &graph->enabled, udata);
ll_unlock(gs.graphs);
}
void overlayGraph_invalidate(void)
{
if (!gs.show)
return;
app_invalidateWindow(false);
}

View File

@ -47,6 +47,7 @@ GraphHandle overlayGraph_register(const char * name, RingBuffer buffer,
void overlayGraph_unregister();
void overlayGraph_iterate(void (*callback)(GraphHandle handle, const char * name,
bool * enabled, void * udata), void * udata);
void overlayGraph_invalidate(void);
void overlayConfig_register(const char * title,
void (*callback)(void * udata, int * id), void * udata);