Commit Graph

52 Commits

Author SHA1 Message Date
Thomas Goyne 6fad60e58d Use NSDMIs where applicable 2013-12-11 18:50:12 -08:00
Thomas Goyne 72d4577d7d Kill scoped_ptr in favor of unique_ptr 2013-06-11 16:06:58 -07:00
Thomas Goyne a0d3dbc550 Extract Loading/Saving/Undo stuff from AssFile
Add SubsController, which deals with things like what subtitle file is
currently open, rather than the contents of the current subtitle file.
Move the rest of the relevant logic from FrameMain there in addition to
all of the stuff from AssFile.
2013-02-06 13:22:32 -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 0e7df15170 Initial implementation of the split editbox 2013-01-14 08:37:03 -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 090905056b Remove spaces in > > in nested templates 2012-12-11 10:58:28 -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 009518271a Document a few things and kill all remaining placeholders 2012-12-02 13:08:42 -08:00
Thomas Goyne 67d796731a Replace SubsEditBox::OnUndoTimer with a lambda 2012-12-02 07:59:32 -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 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 28175aadbe Switch to boost.container for containers of incomplete types
STL containers are not required to support incomplete types, and while
most implementations do, clang's libc++ does not.
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 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 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 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 8f3b027881 Improve the negative-duration-avoiding behavior of the time edit boxes
Save the initial start and end times of lines before adjusting them to
avoid negative line durations, so that if further changes to the edit
boxes make the adjustment unneccesary the original values can be
restored. This Fixes the problem where changing a line visible from
frames 800-900 to 800-901 would actually result in 90-901, due to the
end frame briefly being 90.

Originally committed to SVN as r6741.
2012-05-02 22:42:25 +00:00
Thomas Goyne 4675dbb29d Factor out the placeholder text behavior from SubsEditBox and make it work better
Handle switching from placeholder/normal mode when the value is changed
externally (such as from the active line changing) in addition to on
focus/blur, and improve behavior when the user sets the text to the
placeholder text.

Originally committed to SVN as r6321.
2012-01-20 05:14:50 +00:00
Thomas Goyne 1ce9b0d31b Refactor SubsEditBox a bit to make the constructor less of a monolithic behemoth and eliminate some duplicated code.
Originally committed to SVN as r6320.
2012-01-20 05:14:44 +00:00
Thomas Goyne 68b2ae8275 Eliminate most clang warnings
Originally committed to SVN as r6183.
2011-12-28 21:27:22 +00:00
Thomas Goyne 1c2abeae30 Stop coalescing changes made in the edit box after ten seconds of no changes
Originally committed to SVN as r6137.
2011-12-22 21:31:09 +00:00
Thomas Goyne 62f37772a3 Fix a pile of issues that resulted in the Actor box not working at all
Originally committed to SVN as r5758.
2011-10-19 04:05:09 +00:00
Thomas Goyne 035445e93a When the cursor is in a comment block, insert override tags at the beginning of the block rather than inside the comment
Originally committed to SVN as r5757.
2011-10-19 03:24:10 +00:00
Thomas Goyne a260a998b3 Convert newlines to \N when pasting rather than trying to clean them up later
Originally committed to SVN as r5727.
2011-10-10 20:59:04 +00:00
Thomas Goyne d022d2ae56 Eliminate pointless (and slow) setting of the edit box to its current text
Originally committed to SVN as r5594.
2011-09-15 05:17:00 +00:00
Thomas Goyne 934a5b24eb Refine the commit types
Switch to a bitmask with much more finely-grained information about what
changed in the commit, fixing a few potential correctness problems and
significantly improving the performance of several scenarios where commits
are spammed very frequently.

Originally committed to SVN as r5590.
2011-09-15 05:16:32 +00:00
Thomas Goyne df1dce3593 Kill SubtitlesGrid::ass and SubtitlesGrid::EditBox and convert everything that used them over to agi::Context
Originally committed to SVN as r5215.
2011-01-16 07:17:36 +00:00
Thomas Goyne 17c07cc131 Add timecodes opened signal to VideoContext
Originally committed to SVN as r5080.
2010-12-31 21:03:18 +00:00
Amar Takhar c15777f844 Merge audio_display_rewrite branch to trunk. This is not a complete work, don't expect to time anything for a while.
Originally committed to SVN as r4903.
2010-12-08 03:36:10 +00:00
Thomas Goyne 6d2b941e76 Rework how committing changes works
Rather than everything having to separately commit changes to the ass
and then tell the subs grid to notify various parts of Aegisub about the
changes, committing the AssFile now triggers an event which objects
listen for.

AssFile::Commit now also has an argument to indicate what sorts of
changes were made to the file. For now these types are very broad.

Originally committed to SVN as r4901.
2010-12-07 19:09:28 +00:00
Thomas Goyne 6432ea1f94 Remove the realtime visual tool option, as the threaded video display makes it pointless
Originally committed to SVN as r4825.
2010-10-26 04:12:10 +00:00
Thomas Goyne 2a51ad837e Fix non-precompiled header compilation
Originally committed to SVN as r4723.
2010-08-02 22:14:11 +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 d30326b20d Don't create the default visual tool until video is loaded so that visual tools can assume video is loaded.
Originally committed to SVN as r4630.
2010-06-28 07:13:08 +00:00
Niels Martin Hansen c9c2fa6404 Move "active line" responsibility to the grid. There are at the very least a bunch of redraw issues that need to be sorted out, probably much worse things are hiding.
Originally committed to SVN as r4604.
2010-06-26 11:32:16 +00:00
Thomas Goyne 6df5d97568 Eliminate a redundant rerender of the frame when committing changes from
the visual tools. Makes all visual tools roughly twice as fast when real
time mode is enabled.

Originally committed to SVN as r4365.
2010-05-26 22:09:00 +00:00
Thomas Goyne 877eabdce7 Fix selection issues with visual features
Selections in drag mode now follow the following rules:

 * If a line is selected in the grid, at least one visual feature
   corresponding to the line is selected.

 * If a line has any features selected, that line is selected in the
   grid.

In addition, all control points now start out selected in the vector
clip tool, and all tools should no longer discard the current selection
at unpredictable or unintended times.

Updates #513.

Originally committed to SVN as r4363.
2010-05-26 07:17:39 +00:00
Thomas Goyne 8513fef7e2 Eliminate an unnecessary call to VideoContext::UpdateDisplays triggered by SubsEditBox::SetToLine, moderately improving responsiveness when working with lines that take a long time to render.
Originally committed to SVN as r3925.
2010-01-02 06:23:02 +00:00
Amar Takhar 8504b4790d Remove '#pragma once' from 84 files that don't need it. Thanks to Plorkyeran for testing this on windows. The next step is to detangle the remaining files that currently require it.
Originally committed to SVN as r3533.
2009-09-11 18:51:48 +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 7a8c5229fd * Remove wxprec.h from all files other than agi_pre.h. Including this in various headers is useless as it includes wx.h which includes dozens of 'common' wx headers. With this we're unable to tell which files rely on which interfaces. This commit removes them and manually places in required headers as-needed.
* Update agi_pre.h to include some missing headers, also move required windowsheaders to the top of the list
 * Use <> versus "" for the wx header in avisynth_wrap.cpp
 * Remove xx/wx.h from agi_pre.h as it's included by wxprec.h.

Originally committed to SVN as r3513.
2009-09-10 10:26:50 +00:00
Amar Takhar 6ee2f98349 Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs.  This isn't the actual document in itself but empty documentation using any old documentation if it was there.

This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.

Some notes:
 * Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
 * Some multiline comments may have been munged into single line comments
 * Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
 * Enum comments can go after the enumeration itself '[value] /// comment'
 * include/aegisub/*.h haven't been converted yet, this will be done in a later commit
 * Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.

See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.

Originally committed to SVN as r3312.
2009-07-29 22:59:22 +00:00
Amar Takhar 12aa34088a Switch all headers to using Doxygen and cleanup contact info
* Swap old email + website address with 'Aegisub Project http://www.aegisub.org/'
 * Set categories for all files (jfs)
 * Add descriptions for each file (jfs)
 * Add $Id$ keyword

Originally committed to SVN as r3310.
2009-07-29 05:43:02 +00:00