Commit Graph

56 Commits

Author SHA1 Message Date
Thomas Goyne a7f4fb5b87 Run clang-modernize on things 2013-11-23 09:57:22 -08:00
Thomas Goyne 2fdbc73721 Fully extract the resolution resampling logic from DialogResample 2013-07-09 08:35:50 -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 bb83193253 Kill AssDialogue::SetMarginString
It's no longer used anywhere.
2013-07-09 08:35:50 -07:00
Thomas Goyne de7b09f7f7 Change some enums into enum classes 2013-06-12 20:01:21 -07: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 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 9a36e5cfe1 Add a unique ID to dialogue lines
This is needed to track lines across undo, as the previous method of
using the row number was slow and broke on inserts/deletes.
2013-01-14 08:37:03 -08:00
Thomas Goyne 8f765f3955 Add AssOverrideBlockComment
Nothing actually wants to treat comments as plain text, so using the
same type for both just makes things more complex.
2012-12-31 07:09:32 -08:00
Thomas Goyne d49758edbf De-wxify AssOverride 2012-12-31 07:09:31 -08:00
Thomas Goyne 0b133de08f Remove pointless empty destructors
An explicit empty destructor is only needed when a class has a smart
pointer to an incomplete type.
2012-12-11 09:06:21 -08:00
Thomas Goyne 534f574a87 Delete AssDialogue::StripTag
It is not actually used anywhere.
2012-12-10 17:43:29 -08:00
Thomas Goyne 8c2062f0c7 Store AssOverrideTags directly rather than a vector of pointers 2012-12-10 17:04:18 -08:00
Thomas Goyne 9b44f92235 Make AssEntry purely a base class and add AssInfo
Now that all the other junk is being dropped from the file, script info
lines are the only thing left which was a concrete AssEntry, and
AssEntry wasn't actually a very good way to store them.
2012-12-07 18:55:29 -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 3949ccec24 Drop the position argument from ProcessParametersCallback since nothing needs it 2012-12-02 12:39:37 -08:00
Thomas Goyne 1c176e8568 Store parsed dialogue blocks in a ptr_vector
This eliminates the need to explicitly delete the parsed blocks.

Also go ahead and remove AssDialogue::Blocks since it's really not a
very good idea in general.
2012-12-02 12:29:33 -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 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 5309f7fb9d Add explicit override specifiers to ASS-related virtuals 2012-11-26 07:11:30 -08:00
Thomas Goyne 4e8e5b597c Change AssEntry::group to an enum 2012-11-25 14:01:50 -08:00
Thomas Goyne 06aaaff16b NULL -> nullptr 2012-11-13 08:51:01 -08:00
Thomas Goyne 99a20e4d1c Move InvalidMarginIdError to ass_dialogue.h 2012-10-26 17:26:53 -07:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne c7fd04a739 Rename ASS -> Ass in symbol names
Most types and functions used Ass, but a decent number used ASS, so make
them consistent.
2012-10-16 09:52:19 -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 a0c92f83f9 Fix some PVS-Studio warnings 2012-10-12 14:51:30 -07:00
Thomas Goyne 50b70f6979 Remove DOCME placeholders from AssDialogue 2012-10-10 18:48:39 -07:00
Thomas Goyne d49e59653f Add a version of ParseASSTags that returns the blocks rather than mutating the line
Originally committed to SVN as r6626.
2012-03-28 23:58:50 +00:00
Thomas Goyne b32515da80 Strip trailing whitespace from all cpp and h files
Originally committed to SVN as r6600.
2012-03-25 04:05:06 +00:00
Thomas Goyne 75ae053958 Make some stuff const
Originally committed to SVN as r6590.
2012-03-20 00:39:10 +00:00
Thomas Goyne 759b8433c1 Silence some clang warnings
Originally committed to SVN as r6558.
2012-03-10 02:16:08 +00:00
Thomas Goyne c2d3c910c7 Replace some uses of "" with wxString()
Despite special-casing zero-length input, wxString("") takes over four
times as long as wxString() - and on a 10k line script, this change cuts
AssFile's copy constructor's runtime in half.

Originally committed to SVN as r6401.
2012-01-31 00:44:43 +00:00
Thomas Goyne 9cfe230682 Remove unused 'parent' member from AssDialogueBlock and make 'text' protected
Originally committed to SVN as r6165.
2011-12-26 22:21:08 +00:00
Thomas Goyne 7c6696a53a Fix signature of AssDialogue::SetEntryData so it actually overrides the base
Originally committed to SVN as r6154.
2011-12-24 00:36:30 +00:00
Thomas Goyne 56e6f7d5b2 Move ASS -> SRT tag conversion to the SRT subtitle format from AssDialogue
Originally committed to SVN as r5911.
2011-11-25 19:28:19 +00:00
Thomas Goyne 0992a839cc Port new SRT parser from 2.1.9. Updates #1301.
Originally committed to SVN as r5910.
2011-11-25 19:27:51 +00:00
Thomas Goyne fde4a7815d Make the subtitle edit box auto-commit all changes
This happens to fix most of the undo issues, as it's now much harder to
have uncommitted changes to the file.

Closes #355 and #586.

Originally committed to SVN as r4699.
2010-07-20 03:11:11 +00:00
Thomas Goyne 002aad0b29 Don't call CompressForStack on copied AssFiles as the parsed data isn't copied in the first place.
Originally committed to SVN as r4671.
2010-07-11 03:31:19 +00:00
Thomas Goyne 1da57a4be5 Make AssStyle::Clone ~15 times faster.
Originally committed to SVN as r4664.
2010-07-08 07:14:55 +00:00
Thomas Goyne e2f8e69612 Beat some semblance of sanity into ass_override and related files. Fixes a pile of crashes when tags are missing expected parameters.
Originally committed to SVN as r4581.
2010-06-24 01:24:43 +00:00
Thomas Goyne 8756dc1800 Add copy constructor to AssDialogue and use it in Clone
Originally committed to SVN as r4561.
2010-06-22 00:03:11 +00:00
Thomas Goyne 392ce99083 Kill AssDialogue::UpdateData, which last had a non-empty body 3.5 years ago
Originally committed to SVN as r4525.
2010-06-16 06:20:19 +00:00
Thomas Goyne 38d922c57a Remove time-consuming reparsing of the line in VisualTool::SetOverride
Originally committed to SVN as r4430.
2010-06-04 03:08:04 +00:00
Thomas Goyne f001651865 Replace AssDialogueBlock::GetAsOverride etc. with dynamic_cast
Originally committed to SVN as r4428.
2010-06-04 03:07:52 +00:00
Thomas Goyne 2124a1dbd3 Rework how sorting works and add sorting by style
Rather than going through a ton of work to ensure that every AssEvent
has a sensible start time that happens to leave it in the right place
after sorting, simply sort only consecutive blocks of AssDialogues and
leave everything else untouched. Note that this results in different
behavior when there are multiple [Events] sections in a file -- rather
than moving lines between sections and keeping the number of lines per
section constant, each section keeps the lines it had.

As it's now easy to do, also add sorting by style name and end time.

Closes #614.

Originally committed to SVN as r4307.
2010-05-19 00:44:44 +00:00
Amar Takhar 774fb0f674 Fix all the headers in *., this includes:
* Wrapping all headers that are in agi_pre.h with AGI_PRE.
  * Sorting alphabetically.
  * Same operation as r3515.

Note: This is broken when precompiled headers are not in use, I'll fix that after this commit so the two changes don't get jumbled up.

Originally committed to SVN as r3525.
2009-09-11 02:36:34 +00:00
Amar Takhar 925fa88c0c * Remove #pragma once.
* Sort wx headers and wrap with #ifndef WX_PRE.
 * Add missing heade rto stdwx.h.
M    src/ass_attachment.h
M    src/subs_grid.cpp
M    src/ass_dialogue.cpp
M    src/ass_attachment.cpp
M    src/aegisub_endian.h
M    src/audio_display.cpp
M    src/audio_karaoke.cpp
M    src/dialog_kara_timing_copy.cpp
M    src/ass_dialogue.h
M    src/text_file_writer.cpp
M    src/stdwx.h

Originally committed to SVN as r3503.
2009-09-10 02:23:43 +00:00
Niels Martin Hansen 51288bc06d Make a typedef of a function type, hoping to fix Doxygen warnings.
Originally committed to SVN as r3348.
2009-08-01 03:27:13 +00:00
Amar Takhar 2fd9b9d7e3 Fix a whole bunch of Doxygen warnings.
Originally committed to SVN as r3325.
2009-07-30 03:36:53 +00:00