Code: Select all
float wave_y[AREAHEIGHT]
I have
Code: Select all
void DistoTVUI::stateChanged(const char* key, const char* value)
{
printf("Im here at StateChanged\n");
if (strcmp(key, "waveform") == 0) {
char* tmp;
int i = 0;
char tmpbuf[4*AREAHEIGHT+1] = {0};
snprintf(tmpbuf, 4*AREAHEIGHT, "%s", value);
tmp = strtok(tmpbuf, " ");
while ((tmp != NULL) && (i < AREAHEIGHT)) {
wave_y[i] = AREAHEIGHT-((float)atoi(tmp));
i++;
printf("reload dsp wave_y[%d]=%.2f ", i, wave_y[i]);
tmp = strtok(NULL, " ");
}
}
repaint();
}
So if I close the UI window, the wave never gets re-painted and overwritten by the UI when I open the window from host.
I think I should change stateChanged() to setState(), because the UI is the only input and the state never gets changed on the plugin side, it only has the information there. But there is no documentation or examples I have found on UI::setState()
https://github.com/martinbangens/DistoTV