Closed FelipeDefensor closed 7 months ago
I commited the changes to LenzDev.
@LenzGit, what I found out is that the matplotlib FigureCanvasTkAgg
contains a tkinter.Canvas
, which can be accessed via the get_tk_widget()
method, so it should not be inserted into an already existing canvas. That raises two issues: (1) a TimelineCanvas
instance ais created for each timeline, and there is no convenient way to substitute its creation for the creation of the FigureCanvasTkAgg
canvas; (2) I haven't been able to control the margin on that canvas, and that is necessary to make it align with other timelines.
More importantly, there is a noticeable delay whenever the canvas is resized (as when zooming) so the figure is almost certainly being regenerated. Delay when zooming is already an issue, so I would not like to add the extra overhead to the process.
At this point, I think we are better off sticking with the old plan of pre-generating the images. I'm gonna give it a shot to see how long it takes.
Note to self - this might be useful: https://www.youtube.com/watch?v=RHmTgapLu4s
It uses pyqtgraph, which appears to be more optimized, instead of matplotlib.
Lenz, I was able to fix the zoom rounding. We need to keep the floats stored in self.timeline_width fro the operations to act like inverses and only convert with
int()
when using the values. I generated some graphs of different lengths to check if the sizes were correct. The generation is taking a long time, though, probably because the audio is being processed anew every time.