I wrote a small VST plugin (based on the AudioPlugin example).
Everything is fine, it’s not really an Audio plugin yet, it will be for now it’s a chat thingy screenshot
the problem is that the networking thing is done in a seperate thread and should not block, however if u run it in FLStudio like i do, you can see the FL stopping for the time the thread is doing it’s network stuff, here is the worker tab
void Worker::run ()
{
// do the bartman
Url = new URL ("http://www.fruityart.org/chat.php");
if (threadShouldExit())
return;
InputStream *stream = Url->createInputStream(false);
if (threadShouldExit())
return;
buf = stream->readEntireStreamAsString();
delete stream;
delete Url;
return;
}
the buf point to a variable in the other class where i do the parsing and all like so:
the part that could be holding the GUI is the insertTextAtCursor () method, but is that that CPU intensive ? we’re not talking large amounts of text about 50 lines or so (the output from the serv is limited).
this part makes the host application flicker.
Is this a very bad way to do it ? Should i implement some kind
of diff algorithm to only update wiith the difference of the current and the previous text ? Or maybe there is a much optimal way to do this ?