Commit Graph

36 Commits

Author SHA1 Message Date
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 64ecd29169 Switch to using an intrusive list for the visual tool features
Slightly improves performance and eliminates a bunch of really clunky
passing around and storing of iterators.
2013-09-17 16:23:36 -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 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 67df64e879 Use range-based for loops in a bunch of places 2012-11-12 18:35:25 -08:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne b74130579f Update all selected rows in the rectangular clip tool rather than just the active line 2012-10-20 07:59:07 -07:00
Thomas Goyne 73ee949d55 Fix bounds checking in the rectangular clip visual tool with detached video
Originally committed to SVN as r5960.
2011-12-05 03:22:33 +00:00
Thomas Goyne 4be9c302d3 Fix rendering of the clip visual tools with detached video
Originally committed to SVN as r5847.
2011-11-12 01:23:40 +00:00
Thomas Goyne be77dc8307 Mostly rewrite the visual tools and related classes
Convert all coordinates within the visual tools to Vector2D, which has
been significantly extended. Eliminates a lot of issues with accumulated
rounding errors and simplifies a lot of code.

Modernize the visual tools' interactions with the rest of Aegisub by
connecting to signals directly rather than routing everything through
the video display and converting the main visual tool mode toolbar to
the command system.

Extract all references to OpenGL from the visual tools and move them to
OpenGLWrapper as a first step towards making it possible to implement an
alternative video renderer. In the process, eliminate all uses of OpenGL
immediate mode.

Fix a bunch of minor issues and general instability.

Originally committed to SVN as r5823.
2011-11-06 17:18:20 +00:00
Thomas Goyne d990bbbb99 Eliminate all unnecessary uses of L and _T
Originally committed to SVN as r5611.
2011-09-28 19:43:11 +00:00
Thomas Goyne d405b061df Eliminate a lot of unnessesary includes of subs_grid.h
Originally committed to SVN as r5458.
2011-07-15 04:05:15 +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 833e69b09f Replace MIN/MAX/MID with std::min/std::max/mid
Originally committed to SVN as r5078.
2010-12-31 21:03:03 +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 be1ed9e672 Make visual tools pass around iterators for everything related to visual features rather than a mix of pointers and indices, and clean up feature creation. Fixes a large pile of selection-related bugs.
Originally committed to SVN as r4648.
2010-06-30 06:29:14 +00:00
Thomas Goyne 5588cda268 Significantly revamp how visual tools interact with the rest of the program
Rather than just have a single Refresh method that gets called whenever
something happens that could possibly be of interest to the visual
tools, add seperate methods for signaling frame number changes and
changes to the file, and use the new SelectionController stuff for other
things that used to merit a Refresh. This eliminates a large amount of
redundant reparsing of lines which happened on paint, as well as a large
number of redundant repaints.

Frame data is now only uploaded to the video card when the frame number changes
rather than when anything at all changes, slightly improving performance when
using mesa's software opengl implementation.

Vector clip and drag tools now do a slightly better job of not
discarding the user's selection for no apparent reason, and strange
selection behavior from clicking on visual features should now be
entirely fixed.

Everything but the constructor and toolbar event handler in the visual
tool implementations are now private.

Originally committed to SVN as r4631.
2010-06-28 07:13:15 +00:00
Thomas Goyne dc2836e9e5 Fix bug where features for the wrong line were displayed in the rectangular clip tool
Originally committed to SVN as r4619.
2010-06-27 07:53:08 +00:00
Thomas Goyne fe9aa56d10 Remove pointless IntSwap function from utils.h
Originally committed to SVN as r4560.
2010-06-22 00:03:03 +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 23972b10bc Add selection and control of multiple visual features
Make all visual tools support selecting and manipulating multiple visual
features at once, allowing multiple lines to be moved at once, entire
vector clips to be translated, etc. Controls:

  - Left click: Select control clicked control only
  - Ctrl-left click: Add/remove control to selection
  - Drag control (with or without ctrl): Move all selected controls,
    after setting/adding to selection if target is not in the selection
  - Click on no control: Clear selection

Lots of little stuff to fix still.

Updates #513.

Originally committed to SVN as r4322.
2010-05-20 08:55:58 +00:00
Thomas Goyne 8ff2728322 Move all userdata in VisualDraggableFeature not used by VisualTool to subclasses specific to each tool that needs userdata.
Originally committed to SVN as r4321.
2010-05-20 08:55:52 +00:00
Thomas Goyne 40a0c8994a Simplify the VisualTool interface a bit.
Originally committed to SVN as r4318.
2010-05-20 08:55:35 +00:00
Thomas Goyne e023831134 Detangle the visual tools from SubsEditBox a bit by making changes to the file no longer go through the edit box.
Originally committed to SVN as r4317.
2010-05-20 08:55:29 +00:00
Thomas Goyne 2ec4a97dbb Fix bad coordinate conversion in the clip visual tool
Originally committed to SVN as r4315.
2010-05-20 08:55:18 +00:00
Thomas Goyne 2c876e79c3 Make visual tools use only screen coordinates.
Previously the visual typesetting tools and the overlay mask used
several coordinate frames, converting between them in many places in
inconsistent ways.  This elimiates all uses of coordinate frames other
than screen and script, and makes the conversion done in one place, and
only when parsing or serializing ASS.

This fixes:

 - A few minor rounding errors

 - Horrible brokeness when only part of the video frame is being
   displayed, due to higher levels of zoom than fit onscreen or panning
   the video

 - Distortion of the visual typesetting tools when the combination of
   overridden aspect ratio, script resolution, and video resolution did
   not result in square pixels.

 - Resolution-dependence of the visual typesetting tools, which resulted
   in some tools becoming hard to use at zooms outside the range of
   100-200%.

 - Some draggable controls used the mouse's script coordinates,
   resulting in noticable jerky movement at high zoom levels or when
   using strange script resolutions.

Closes #966.

Originally committed to SVN as r4289.
2010-05-16 06:39:11 +00:00
Thomas Goyne 1654f4a102 Remove a redundant (and incorrect) check for if the mouse is over the video
Originally committed to SVN as r4279.
2010-05-13 18:37:51 +00:00
Thomas Goyne c7e06e9451 Change the uses of -1 for invalid positions in the visual typesetting tools to INT_MIN, as -1 is sometimes a perfectly valid coordinate
Originally committed to SVN as r4258.
2010-05-01 01:45:16 +00:00
Thomas Goyne 5cbabf2d35 Add an option to only display visual typesetting tools when the mouse is over the video.
Originally committed to SVN as r4257.
2010-05-01 01:45:10 +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
Thomas Goyne 1a4e7375fd Add some documentation to VideoDisplay and clean up the includes a bit.
Originally committed to SVN as r3501.
2009-09-10 01:41:34 +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
Amar Takhar 91d73ec8ea SVN Transition Step 3/7
1. cd aegisub/
  2. svn mv *cpp *h src/
  3. svn mv Makefile.am MatroskaParser.c auto4_perldata.inc bitmaps boost \
     changelog.txt config gl include libosxutil libresrc md5.c msvc mythes.cxx \
     mythes.hxx res.rc src/
  4. cd ..
  5. svn mv FFmpegSource2/ INSTALL Makefile.am README  acinclude.m4 \
     autogen.sh automation/ bin build configure.in desktop dummy.txt lib \
     libass/ m4macros/ packages/ po/ scripts/ universalchardet/ aegisub/
  6. mkdir -p docs/wiki_convert
  7. svn add docs/wiki_convert
  8. cd docs
  9. svn mv aegisub_convert_docs.pl convert.bat output wiki_convert/

* See r2749 for full description.

Originally committed to SVN as r2752.
2009-03-08 08:30:39 +00:00