Commit Graph

159 Commits

Author SHA1 Message Date
Thomas Goyne 038eb6e58b Use the new much shorter event names 2013-12-11 18:50:12 -08:00
Thomas Goyne 6fad60e58d Use NSDMIs where applicable 2013-12-11 18:50:12 -08:00
Thomas Goyne a7f4fb5b87 Run clang-modernize on things 2013-11-23 09:57:22 -08:00
Thomas Goyne ebd01c50c9 Rewrite NumValidator
Split int validating and double validating into two separate classes.

Make double parsing, validating and stringifying locale-aware. This is
far more complicated than it needs to be due to that Aegisub's locale
handling is a total mess.

Use DoubleValidator rather than wxFloatingPointValidator, because the
latter doesn't work with Aegisub's locale mess (on OS X it uses the C
locale for some things, and the locale reported by CoreFoundation for
others).

Closes #1568.
2013-10-15 10:59:23 -07:00
Thomas Goyne d81e2f45ac Add an option to ignore whitespace for the character counter 2013-09-20 07:43:33 -07:00
Thomas Goyne ce23d72399 Kill AssDialogue::GetMarginString
It didn't actually make the calling code any shorter or simpler.
2013-07-09 08:35:50 -07:00
Thomas Goyne 7c7cfc79e6 Delete SubtitlesGrid since it's now empty 2013-06-18 19:43:16 -07:00
Thomas Goyne 72d4577d7d Kill scoped_ptr in favor of unique_ptr 2013-06-11 16:06:58 -07:00
Thomas Goyne e5c25fa066 Fix crash when clearing the contents of one of the Margin boxes 2013-04-07 11:36:10 -07:00
Thomas Goyne e89fb6eeb8 Improve the edit box tooltips 2013-04-07 08:43:56 -07:00
Thomas Goyne 777649a551 Update the character count asynchronously 2013-02-06 13:38:35 -08:00
Thomas Goyne 1e0f08c0ed Mostly purge wxWidgets from non-UI stuff
Use boost::filesystem::path for all paths, and std::string for all other
strings, converting to/from wxString as close to the actual uses of wx
as possible.

Where possible, replace the uses of non-UI wxWidgets functionality with
the additions to the standard library in C++11, or the equivalents in
boost.

Move the path token management logic to libaegisub (and rewrite it in
the process).

Add a basic thread pool based on asio and std::thread to libaegisub.

This touches nearly every file in the project and a nontrivial amount of
code had to be rewritten entirely, so there's probably a lot of broken
stuff.
2013-02-06 13:22:15 -08:00
Thomas Goyne 9a69ca9de4 Add padding between the split editbox buttons 2013-01-14 08:37:03 -08:00
Thomas Goyne 3499a0546a Make the split editor readonly rather than disabled 2013-01-14 08:37:03 -08:00
Thomas Goyne 879c2c19ae Add a button to the split editbox to remove the line text only, leaving override tags 2013-01-14 08:37:03 -08:00
Thomas Goyne 0e7df15170 Initial implementation of the split editbox 2013-01-14 08:37:03 -08:00
Thomas Goyne 4334514c78 Remove the "update video" box from the find dialog
It hasn't worked for a few years and doesn't really make any sense with
how committing works now.
2013-01-11 08:33:52 -08:00
Thomas Goyne e9a5494910 Calculate the required size for the subs edit box time edits rather than hardcoding it 2013-01-09 19:44:26 -08:00
Thomas Goyne a99428c49d Extract options and MRU stuff from main.h
Nearly all of the files including main.h are doing so only for OPT_GET
and friends, which are rather unrelated to the main things that main.h
declares.
2013-01-09 16:48:31 -08:00
Thomas Goyne 3ec82952f8 Partially de-wxify AssStyle 2012-12-31 07:09:31 -08:00
Thomas Goyne 72ae116196 Rename SubsEditBox's private members
Mostly to cut down on conflicts with the split-editbox branch.
2012-12-12 15:17:21 -08:00
Thomas Goyne bd35d9308d Use unordered_set for the actor/effect values 2012-12-07 19:24:42 -08:00
Thomas Goyne 422cfb153f Add a box with the character count of the longest line
Character counts are a pretty terrible measure of anything, but it's
still the main measure of length used in most subtitling standards
(because subtitling standards are written under the assumption that the
tools are terrible (which is generally an accurate assumption)).
2012-12-06 10:01:47 -08:00
Thomas Goyne d5aae26d83 Use boost::flyweight to intern the wxString members of AssDialogue
100 no-op non-amend commits on a subtitle file with 6689 dialogue lines,
with the undo limit set to 100:

Without flyweight:
	No video open:
		Initial memory usage: 30.6 MB
		Final memory usage: 498.0 MB
		Elapsed time: 6.3 seconds
	Video open, using libass:
		Initial memory usage: 54.3 MB
		Final memory usage: 653.3 MB
		Elapsed time: 23.7 seconds

With flyweight:
	No video open:
		Initial memory usage: 26.0 MB
		Final memory usage: 104.5 MB
		Elapsed time: 3.0 seconds
	Video open, using libass:
		Initial memory usage: 46.7 MB
		Final memory usage: 251.8 MB
		Elapsed time: 13.0 seconds

No video open:
	Memory usage: -79%
	Time: -52%
Video open:
	Memory usage: -61.5%
	Time: -45%

100 no-op amend commits on a line in the middle of a subtitle file with
6689 dialogue lines, with video open:

Without flyweight:
	Initial memory usage: 48.2 MB
	Final memory usage: 182.3 MB
	Elapsed time: 22.3 seconds

With flyweight:
	Initial memory usage: 39.8 MB
	Final memory usage: 165.8 MB
	Elapsed time: 13.8 seconds

Note: The large jump in memory usage here is due to that the benchmark
is blocking the main thread, so at the end there are ~100 video frames
waiting to be displayed.
2012-12-05 18:43:44 -08:00
Thomas Goyne 67d796731a Replace SubsEditBox::OnUndoTimer with a lambda 2012-12-02 07:59:32 -08:00
Thomas Goyne b507f49cec Remove the pad argument from GetMarginString
It's no longer ever actually set to true.
2012-12-02 07:59:31 -08:00
Thomas Goyne 3045e2d012 Move the Margin controls to an array 2012-12-02 07:59:31 -08:00
Thomas Goyne fae9a5496a Extract some duplicated code for the margin controls 2012-12-02 07:59:31 -08:00
Thomas Goyne 0b46fdff49 Refactor time ctrl handling in SubsEditBox 2012-12-02 07:59:31 -08:00
Thomas Goyne 1b6f122d12 Replace field_setter with a lambda 2012-12-02 07:59:31 -08:00
Thomas Goyne 7090d2f513 Don't include wx/wx.h in subs_grid.h 2012-12-02 06:33:29 -08:00
Thomas Goyne 96cf5ea7ed Kill the #ifndef AGI_PRE guards
They don't actually improve compilation performance and make it more
annoying to modify what things are in the precompiled header.
2012-12-02 06:33:29 -08:00
Thomas Goyne e4d6b8661b Add range adaptor for filtering to a specific subclass from a heterogeneous range
This makes looping over the subtitle file and parsed dialogue lines less
awkward in many cases.
2012-11-12 18:35:25 -08:00
Thomas Goyne 67df64e879 Use range-based for loops in a bunch of places 2012-11-12 18:35:25 -08:00
Thomas Goyne 0893ed3f0a Remove references to tr1 2012-11-10 18:05:57 -08:00
Thomas Goyne 83761d881a Convert AssFile::Line to an intrusive list
Gives O(1) pointer -> iterator conversions, better memory usage, better
performance, and overall slightly simplifies the code using it.
2012-11-10 18:05:56 -08:00
Thomas Goyne b5baacec2c Fix merge error in df60c2e7a4
Although wxSTC defines SetValue, it doesn't actually work correctly.
2012-10-28 07:20:12 -07:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne df60c2e7a4 Factor out a bunch of duplicated code for clipboard stuff 2012-10-25 17:39:49 -07:00
Thomas Goyne 6b3cfcebfd Change the Effect box to a combobox like the Actor box. Closes #1461. 2012-10-20 07:34:55 -07:00
Thomas Goyne cc3ca715a1 Set the focus to the edit box after any of the edit box buttons are clicked 2012-10-12 14:54:09 -07:00
Thomas Goyne daf28e2005 Use the native placeholder text functionality on OS X 2012-10-12 14:54:09 -07:00
Thomas Goyne a1fad1f947 Drop support for ASS2
It is very unlikely that anyone has ever actually used ASS2 for
anything, and in practice it was not usable anyway as the bottom margin
was always either ignored or blindly overwritten.
2012-10-12 14:54:08 -07:00
Thomas Goyne b3486440f3 Show the hotkeys for the edit box buttons in the tooltip 2012-10-12 14:54:08 -07:00
Thomas Goyne 1b68790c4b Convert the subs edit box buttons to commands
This makes they hotkeyable and extracts a large chunk of logic from the
giant mess that is SubsEditBox.
2012-10-12 14:54:08 -07:00
Thomas Goyne 44f0fcce07 Go through TextSelectionController rather than hitting the text edit directly in SubsEditBox 2012-10-12 14:54:08 -07:00
Thomas Goyne a948924850 Add a TextSelectionController interface to avoid exposing the wxSTC edit directly in the context 2012-10-12 14:54:08 -07:00
Thomas Goyne e4a6092b36 Use signals for selection change notifications 2012-10-12 14:54:07 -07:00
Thomas Goyne 004b41f0eb Switch the Duration field back to time mode when video is closed 2012-10-09 20:40:47 -07:00
Thomas Goyne 269dd79230 Increase the undo-group-breaking timer to 30 seconds (from 10) 2012-10-09 07:28:16 -07:00