I'm currently working on a sound signal visualizer. After getting the signal, I need to plot both its waveform and spectrum on two different windows.Thus I implemented a Plotter class, which creates its own thread for each instance when constructed. But now I'm running into troubles because many of FLTK's features seemed to be thread-unsafe, because it crashes on some class method calls. (Such as set axis scale)
The model I'm using now:
Plotter 1 -> ctor() -> create thread
\
Plotter 2 -> ctor() -> create thread----> PlotterThread(Plotter*this) -
/ |
Plotter 3 -> ctor() -> create thread |
|
create fltk window and init object
Is this model even practicable? I have no idea now... Thanks.