Commit Graph

54 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 72d4577d7d Kill scoped_ptr in favor of unique_ptr 2013-06-11 16:06:58 -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 3ec82952f8 Partially de-wxify AssStyle 2012-12-31 07:09:31 -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 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 e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne 712a5e0d8b Skip unprocessed keydown events in the styling assistant so that typing style names actually works 2012-10-16 08:51:21 -07:00
Thomas Goyne e4a6092b36 Use signals for selection change notifications 2012-10-12 14:54:07 -07:00
Thomas Goyne 123f02f0fb Process hotkeys in wxEVT_CHAR_HOOK rather than wxEVT_KEY_DOWN
Char hook events propagate by default, removing the need for the event
filter to make key down events propagate, which was causing some funny
issues.

On Windows, the char hook handler runs before menu accelerators, fixing
a bug where Default context hotkeys would override more specific ones
when they appeared on a menu. Unfortunately, this is not the case on
GTK, so the dumb accelerator-disabling hack is still required.

Originally committed to SVN as r6724.
2012-04-27 19:07:49 +00:00
Thomas Goyne 9f3fd691e2 Unskip key events handled by the non-command keypress handling in BaseGrid
hotkey::check marks non-matching events as skipped, so the default key
event handler was running even if BaseGrid did something with the
keypress.

Closes #1464.

Originally committed to SVN as r6667.
2012-04-06 03:53:38 +00:00
Thomas Goyne fe36760872 Use 16x16 icons for dialogs rather than cropping the 24x24 icons to 16x16
Originally committed to SVN as r6650.
2012-04-03 20:40:24 +00:00
Thomas Goyne f66c772130 Ensure the hotkey descriptions in the translation and styling assistants actually get marked as translatable
Originally committed to SVN as r6582.
2012-03-12 23:35:20 +00:00
Thomas Goyne 4153bbc10b Fix pointlessly different strings in the translation and styling assistant
Originally committed to SVN as r6581.
2012-03-12 23:35:11 +00:00
Thomas Goyne de9cc755d2 Stop key event propagation when checking for hotkeys to avoid checking keypresses that aren't hotkeys several times
Originally committed to SVN as r6577.
2012-03-12 23:34:34 +00:00
Thomas Goyne 36548b93b1 Add a dialog manager for modeless dialogs so that they don't have to all be stuffed into the context
Originally committed to SVN as r6553.
2012-03-09 00:23:41 +00:00
Thomas Goyne e8ba128fa8 Synchronize a bunch of similar but not quite identical strings. Closes #1081.
Originally committed to SVN as r6213.
2012-01-08 01:05:25 +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 a66cc26706 Remove all calls to wxKeyEvent::StopPropagation. Key events don't propagate by default and even if they did, events which are marked as processed don't propagate further.
Originally committed to SVN as r6046.
2011-12-22 21:16:43 +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
Thomas Goyne 262d5195c5 Add access keys for nearly all things which support them and were missing them. Closes #1070.
Originally committed to SVN as r5877.
2011-11-18 18:49:09 +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 561216d4c8 Make hotkey::check take a project context and make FrameMain::context private
Originally committed to SVN as r5532.
2011-07-29 23:16:55 +00:00
Thomas Goyne 3a4c48d8df Fix compilation without precompiled headers
Originally committed to SVN as r5525.
2011-07-27 17:21:39 +00:00
Thomas Goyne 07b77203f1 Rewrite the styling assisant as changes to other parts of Aegisub have made almost all of it broken
Originally committed to SVN as r5518.
2011-07-27 05:36:09 +00:00
Thomas Goyne 7deebf759b Remove the concept of disabled hotkeys; it's unnessesary and wasn't actually used
Originally committed to SVN as r5504.
2011-07-26 19:52:15 +00:00
Thomas Goyne 256e098aa7 Remove header include order requirements
Originally committed to SVN as r5449.
2011-07-15 04:04:13 +00:00
Thomas Goyne ccddf8eab1 Make hotkey::check return whether any hotkeys matched, and skip events which did not match any hotkeys
Originally committed to SVN as r5241.
2011-01-19 03:12:46 +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 d84b768171 Remove the 'audio' and 'grid' public members from VideoContext and migrate everything that used them over to Context
Originally committed to SVN as r5211.
2011-01-16 07:17:08 +00:00
Thomas Goyne e450cb3e7e Fix include paths
Originally committed to SVN as r5132.
2011-01-05 18:40:37 +00:00
Amar Takhar 167f09a610 Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 13:00:46 +00:00
Thomas Goyne 3345797ff6 Use signals in AudioController and AudioTimingController
Originally committed to SVN as r4907.
2010-12-08 08:09:16 +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 a32bbab0b6 Add selection-preserving logic to BaseGrid::UpdateMaps and eliminate some unnecessary updates and clears of the maps. Fixes a pile of cases where operations would result in incorrect or no selections, or scrolling to the top of the file.
Originally committed to SVN as r4677.
2010-07-13 05:29:08 +00:00
Thomas Goyne 2e5dc176db Rewrite Undo/Redo code
Make the undo and redo stacks non-static members of AssFile, making it
theoretically possible to have multiple open AssFiles with working undo.

Slightly improve tracking of whether the file is modified: saving,
making a change, then undoing the change now results in the file being
shown as unmodified as with most programs with undo.

Add basic undo coalescing support.

Originally committed to SVN as r4667.
2010-07-09 07:31:34 +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
Niels Martin Hansen c4a27da4fc Change the grid to use more sensible maps to keep track of index/object mappings for subtitle lines, and follow the SelectionController model. (Hopefully the new maps can also give slightly better performance.)
Try to keep the original API intact. Some redundant or unused functions in SubtitleGrid were removed. The LoadFromAss() function was renamed to UpdateMaps() since that was its real purpose. (Note that SubtitleGrid now has an UpdateMaps() function that overshadows BaseGrid::UpdateMaps(), but SubtitleGrid::UpdateMaps() calls the hidden function. They are not virtual.)
This does not yet fix visual tool feature selection.
Generally, things just feel more broken still. Further work will fix things.

Originally committed to SVN as r4603.
2010-06-26 07:26:27 +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 c7ea710267 Use VideoContext::JumpToTime where appropriate
Originally committed to SVN as r4522.
2010-06-16 06:19:49 +00:00
Amar Takhar d348b4e33e Fix all the headers in *.cpp, this includes:
* Wrapping all headers that are in agi_pre.h with AGI_PRE.
 * Sorting alphabetically.

Originally committed to SVN as r3515.
2009-09-10 13:06:40 +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
Thomas Goyne e6d6a056c9 Change resources filename back to libresrc.cpp/h.
Originally committed to SVN as r3272.
2009-07-25 16:15:13 +00:00
Thomas Goyne c641c6e656 Switch all icons in Aegisub to use the new png versions, using a new small tool to store the pngs as byte arrays in a cpp file.
Originally committed to SVN as r3265.
2009-07-25 04:49:59 +00:00
Thomas Goyne fcbc9fcdc0 Move the libresrc include to the individual files that need it.
Originally committed to SVN as r3244.
2009-07-24 00:08:25 +00:00
Amar Takhar b62f52d8f8 Swap wxBITMAP(.*) with wxBitmap(.*_xpm) now that we're switching to xpm buttons on _all_ platforms, this makes things much easier.
Originally committed to SVN as r3237.
2009-07-23 23:38:04 +00:00