Not the perfect place for it by any means, but that's where the rest of
the application-global stuff is these days and it removed the need for
automation stuff to include main.h (and thus all the wxApp garbage).
It's modestly faster, significantly more type-safe, and doesn't assert
when there's too few arguments, which causes problems for plural forms.
Closes#1733.
Fixes errors when trying to automatically open audio from dummy video
and improves UX a little by disabling the Open Audio From Video menu
item when there are no audio tracks.
Most of the dialogs in Aegisub have a public interface consisting of a
single function, so there's really no need to expose the actual dialog
classes to the rest of the program. Add dialogs.h with the declarations
of all of those functions (most of which are just ShowFooDialog()), and
kill a million other headers.
Add a new Project class which is responsible for everything related to
opening and closing audio, video, subtitles, timecodes and keyframes.
This pulls almost everything not directly related to playing audio/video
out of the audio and video controllers, pulls more crap out of
FrameMain, and happens to make things a little simpler in the process.
Some of the toolbar buttons are seriously wrong when mirrored and there
doesn't seem to be a way to disable mirroring for the images while using
RTL layout for the toolbar itself, so double-mirror them so that they
end up with their original appearance.
Ideally the button images would be localizable as some of them actually
should be mirrored, but that's probably not worth the work involved.
See #1354.
Use explicitly defaulted destructors for base cases when possible,
eliminate aggregate initialization constructors where possible, and push
some more stuff to NSDMIs.
Only count characters outside of override blocks for the relative
positions to do the edits on each line, which handles the case where the
lines have different lengths of stuff in override blocks but the same
text.
Apply the modification at the cursor position to each selected line
rather than just setting all selected lines to the active line's text.
Still doesn't have good results in any nontrivial cases, but it's at
least sometimes useful.
ptr_vector hasn't been updated for C++11, so despite being specifically
designed to store pointers to objects it's less safe and not really any
easier to use than a regular vector of unique_ptrs
iterator_to requires that the object be in the list, which is sometimes
not the case when processing a commit which removed the active line or a
selected line. To handle this, add a checked version that returns
Events.end() when it is not in the list rather than crashing.