Commit graph

72 commits

Author SHA1 Message Date
Thomas Goyne
50baf2d97f Only add alpha tags if the user actually changes the alpha 2013-01-14 08:37:02 -08:00
Thomas Goyne
0b5674e6aa Hide the alpha controls when the alpha isn't used 2013-01-14 08:37:02 -08:00
Thomas Goyne
c37c1ad477 Add alpha support to the color picker. Closes #217. 2013-01-14 08:37:01 -08:00
Thomas Goyne
b1dbb9a94b Decouple SearchReplaceEngine from DialogSearchReplace 2013-01-13 09:00:18 -08:00
Thomas Goyne
2f4cae46b4 Move the SearchReplaceEngine instance to the context 2013-01-11 08:53:36 -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
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
3ec82952f8 Partially de-wxify AssStyle 2012-12-31 07:09:31 -08:00
Thomas Goyne
d49758edbf De-wxify AssOverride 2012-12-31 07:09:31 -08:00
Thomas Goyne
8c2062f0c7 Store AssOverrideTags directly rather than a vector of pointers 2012-12-10 17:04:18 -08:00
Thomas Goyne
f28f6ad5b3 Join lines copied to the clipboard with newlines rather than nothing 2012-12-10 14:03:03 -08:00
Thomas Goyne
8cf47c38b6 Drop AssOverrideParameter::omitted since it's equivalent to the type being VARDATA_NONE 2012-12-09 10:36:13 -08:00
Thomas Goyne
d2a0a76ca9 Store AssOverrideParameters directly rather than a vector of pointers to them 2012-12-09 10:12:50 -08:00
Thomas Goyne
28705000bb Use boost::join in a handful of places 2012-12-07 08:25: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
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
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
0b19908e7b Use std::prev and std::next where applicable 2012-11-30 10:54:57 -08:00
Thomas Goyne
174a992974 Use remove_and_dispose_if where applicable 2012-11-30 10:44:09 -08:00
Thomas Goyne
b94547aa71 Drop format and header lines from the in-memory file representation
They're just pointless cruft, so drop them from the file when parsing
and re-add them when saving as ASS or SSA.
2012-11-24 16:24:00 -08:00
Thomas Goyne
bd259b7197 Fix awesome variable shadowing derp 2012-11-20 14:28:57 -08:00
Thomas Goyne
653aa32eb2 Use std::any_of rather than std::find_if() != end() 2012-11-13 05:52:24 -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
b077c0991b Move the split line at cursor functionality to commands 2012-11-10 18:05:57 -08:00
Thomas Goyne
ea5428b65f Replace AssColor with agi::Color
Add agi::Color, and replace AssColor and all uses of wxColor that are
not immediately passed to/from wx with it.
2012-11-10 18:05:56 -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
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
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
53433426bb Fix some stuff from Coverity Scan
Mostly just bugs in unreachable code and stylistic things, but there's a
few incorrect reachable things that were working by coincidence and
gratuitous dynamic_casts.
2012-10-15 18:16:09 -07:00
Thomas Goyne
ccafd0be17 Update the selection correctly after setting a tag via the edit box buttons
The valid bounds for a selection are not updated until the contents of
the edit box are updated on commit, so set the selection after
committing rather than before.
2012-10-14 20:35:08 -07:00
Thomas Goyne
be94ab70f4 Extract cut/copy/delete lines logic from SubtitlesGrid 2012-10-14 18:57:57 -07:00
Thomas Goyne
610b2a9494 Make pasting lines not horribly slow and bad. Closes #1534. 2012-10-13 21:32:26 -07:00
Thomas Goyne
7ca2c5cb65 Actually set the correct color tags from the color picker buttons 2012-10-12 14:54:09 -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
e4a6092b36 Use signals for selection change notifications 2012-10-12 14:54:07 -07:00
Thomas Goyne
e995cd2616 Don't stop video playback when undoing or redoing changes 2012-09-01 21:45:17 -07:00
Thomas Goyne
06e23b9296 Use SetSelectionAndActive whenever both are set at once
I'm not sure if this fixes any current actual problems as using slightly
stale data is normally only a problem when lines are being deleted, but
it's easier to fix it across the board than to figure out where it is
and isn't needed, and the speed impact of batching is trivial.

Originally committed to SVN as r6753.
2012-05-05 02:11:09 +00:00
Thomas Goyne
4231653146 When joining lines, use the maximum of the lines' end times rather than the last line's end time
Originally committed to SVN as r6734.
2012-05-01 02:49:53 +00:00
Thomas Goyne
9e3553c199 Join concatenated lines with a space rather than \N
Originally committed to SVN as r6733.
2012-05-01 02:49:48 +00:00
Thomas Goyne
14274a7672 Forward Cut/Copy/Paste to all text areas, not just the main subs edit box
Originally committed to SVN as r6576.
2012-03-12 23:34:25 +00:00
Thomas Goyne
9b69ce7a27 Add support for noncontiguous selections to the duplicate lines commands
Originally committed to SVN as r6476.
2012-02-15 22:14:10 +00:00
Thomas Goyne
4ea45627b5 Remove periods from the end of help strings
Originally committed to SVN as r6423.
2012-02-01 18:47:26 +00:00
Thomas Goyne
772c8dee3b Fix accelerator conflict between Redo and Find and Replace
Originally committed to SVN as r6377.
2012-01-27 19:23:07 +00:00
Thomas Goyne
16db1eb4dd Add more menu accelerators and fix a conflict between View and Video. Patch by catntabile. Closes #1434.
Originally committed to SVN as r6376.
2012-01-27 19:22:57 +00:00
Thomas Goyne
7e557c1dad Rename edit/line/swap to grid/swap and grid/swap/* to grid/move/*
Continue moving all the reordering commands to grid (why were they in
three different categories?), and change swap to move to better reflect
what they do.

Originally committed to SVN as r6287.
2012-01-13 20:18:57 +00:00
Thomas Goyne
71345af81a Overload operator int() on AssTime and remove GetMS/SetMS
Originally committed to SVN as r6123.
2011-12-22 21:28:51 +00:00
Thomas Goyne
34a87b1c1e Silence a pile of /W4 warnings
Originally committed to SVN as r6001.
2011-12-22 21:09:31 +00:00