Previously the OpenGL instance was tied to each render/cache task,
creating and destroying it each time one started and stopped. This was
completely unnecessary since the instance holds no state and can be
shared by all of the render tasks without having to expensively start
a new one.
There were a lot of issues that arose from trying to make GUI changes
from another thread (even though we ran those functions in the right
thread). Now we store layout information until the end of the load and
make the changes then. This works much better from both a business logic
and user experience perspective.
Also prevents multiple sequences from taking focus during load and
starting a render job.
Viewer init was kind of too late since in many cases the sequence
would start caching and crash the app before the user could even read
the message. Moving to the startup makes it clearer from the beginning.
ProgressDialog doesn't have to worry about the platform anymore, now
MainWindow will determine what to do or whether to ignore certain progress
indicator functions.
Previously, audio was all queued first and would therefore all have to
finish before any video frames could start caching. No longer! Now they're
queued side by side so users won't have to wait for audio to finish before
their cached frames come in.
These are two changes that speed up when frames start getting rendered
and processed (particularly for larger scale projects):
* Sorting of time beforehand was done to optimize decoding but is actually
unnecessary since the frames are already sequential when they're retrieved
from the range. As long as we maintain that order, no sorting is required.
This speeds up caching IMMENSELY.
* Evaluate hashes concurrently while retrieving frames. Before, this was
done before any rendering and could therefore delay rendering by several
seconds. Doing them concurrently means frames start rendering almost
immediately and further hashes can be analyzed while we wait for frames to
finish rendering.
While the auto-cache will always default to on, there are cases where the
user may not want the viewer to barrel ahead caching something (footage
viewer for instance or if the user is making a lot of changes in a short
amount of time).
Backslashes are the normal directory delimiter for Windows so Windows users
will likely be more comfortable with this. Also prevents issues where a
filename may appear twice in the "open recent" list for both slash
directions.
With this commit, we save to a temporary file first and then cat the end
run a copy to overwrite the source file. If the save somehow fails or the
program crashes mid-save, this will prevent the user's project file from
getting corrupted.