Commit Graph

59 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 2e051a8fde Fix non-pch compliation 2013-11-23 09:57:21 -08:00
Thomas Goyne e15ef04b72 Limit shift times history to the last 50 shifts 2013-10-27 13:08:58 -07:00
Thomas Goyne 01a38a5e86 Use more make_unique
Shuts up a bunch of Coverity false-positives and might fix a true
positive or two.
2013-10-23 17:08:12 -07:00
Thomas Goyne c62ebf7e8b Use std::to_wstring rather than wxString::Format("%d", ...)
std::to_wstring is significantly faster and is a bit shorter.
2013-09-18 08:32:30 -07:00
Thomas Goyne 6cd6ee9845 Use auto more places 2013-09-17 07:51:07 -07:00
Thomas Goyne a9f83663e8 Revert "Return the ifstream from agi::io::Open by move"
This reverts commit 1f5484fedb.

Move constructors for fstreams are not implemented yet in libstdc++.

Closes #1578.
2013-02-16 19:47:31 -08:00
Thomas Goyne 1f5484fedb Return the ifstream from agi::io::Open by move 2013-02-12 15:51:59 -08:00
Thomas Goyne 396ff897e5 Kill StandardPaths
It's now just a pointless wrapper around agi::Path.
2013-02-06 13:22:33 -08: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 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 d0f4d9df99 Replace all uses of lagi_wxString with to_wx 2012-12-22 15:18:38 -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 06aaaff16b NULL -> nullptr 2012-11-13 08:51:01 -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 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 afd24913d6 Fix find/replace derp 2012-10-12 14:54:09 -07:00
Thomas Goyne e4a6092b36 Use signals for selection change notifications 2012-10-12 14:54:07 -07:00
cantabile 7bd7ef7cd6 Shift times: Make Enter in the time edit do the same as clicking OK
Originally committed to SVN as r6944.
2012-07-24 02:39:40 +00:00
cantabile 5ecb89eeec Shift times: Use TimeEdit::SetTime() instead of TimeEdit::SetValue()
TimeEdit::SetValue() will trigger TimeEdit::OnModified(), but that
doesn't always update the internal "time" property.
TimeEdit::OnModified() seems to be designed to handle editing the value
with the keyboard, not with SetValue().

Originally committed to SVN as r6943.
2012-07-24 02:39:37 +00:00
Thomas Goyne 47fb50d4d3 Fix crash after cancelling the shift times dialog. Closes #1483.
Originally committed to SVN as r6756.
2012-05-10 14:18:54 +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 ef4c1b369d Adjust the label for the history box in the shift times dialog to suggest that old shifts can now be loaded
Originally committed to SVN as r6383.
2012-01-27 20:04:14 +00:00
Thomas Goyne 214079af58 Load Shift Times settings from history on double-click
Redesign how shift times history is saved. Previously it stored the
localized strings in the history file, which are not particularly
parsable as the format may differ between locales. Rather than doing
this, store the raw settings in a json file, and generate the history
strings on display. In addition to making it much easier to load old
settings, this makes it so that the history is always displayed using
the current locale, rather than the locale in which the shifting was
done.

Closes #1427.

Originally committed to SVN as r6363.
2012-01-25 23:09:45 +00:00
Thomas Goyne 7dd6cfe37d Derive agi::acs exceptions from agi::FileSystemError and friends rather than having two sets of errors for the same thing
Originally committed to SVN as r6278.
2012-01-12 22:31:54 +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 3a069b7f60 Clean up TimeEdit
Remove some unused or constant arguments and simplify some overly
convoluted logic.

Check for whether timecodes are open rather than whether video is open
to determine if by-frame mode is enabled.

Operate on a project context rather than using VideoContext::Get().

Use non-event-generating setter methods rather than a boolean ready
variable.

Make all member variables private and add setters rather than relying on
the client code calling Update when appropriate.

Eliminate flickering in overwrite mode.

Originally committed to SVN as r6056.
2011-12-22 21:18:16 +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 54f359f91b Enable the correct shift amount text box when opening the shift times dialog rather than always enabling the time one
Originally committed to SVN as r5735.
2011-10-12 23:08:02 +00:00
Thomas Goyne d70fb7fe2d Fix compilation errors
Originally committed to SVN as r5601.
2011-09-15 06:03:13 +00:00
Thomas Goyne 0c4eb020a4 Rewrite the shift times dialog, detangling it from the grid and making it modeless, and add support for characters outside the local charset in the shift history file path. Closes #1269.
Originally committed to SVN as r5596.
2011-09-15 05:17:14 +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 95cadb5226 Clean up base_grid a bit
Reduce the visibilty of many members and document some of them

Cut down on recreation of wxPen and wxBrush objects in DrawImage,
probably speeding up painting somewhat

Simplify handling of extendRow

Move event IDs to base_grid.cpp

Remove worthless comments and dead code

Assorted cosmetic changes

Originally committed to SVN as r5462.
2011-07-15 04:05:43 +00:00
Thomas Goyne b286339ce0 Eliminate a few uses of VideoContext::Get()
Originally committed to SVN as r5251.
2011-01-20 05:57:53 +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 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 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 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 4a8abae3a3 Kill options.h and options.cpp, which have been empty for a while
Originally committed to SVN as r4676.
2010-07-12 21:49:48 +00:00
Thomas Goyne c40aa7080a Eliminate almost all uses of AssFile::top.
Originally committed to SVN as r4669.
2010-07-09 07:31:48 +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
Thomas Goyne acba2c6b63 Rewrite VFR handling in Aegisub.
Kill vfr.h and vfr.cpp and use the libaegisub versions of them instead.

Rather than the globals VFR_Input and VFR_Output, everything related to
frame rate is now part of the video context. Most things which used to
use VFR_Output now call VideoContext::TimeAtFrame etc.; video providers,
rather than modifying VFR_Input directly, now have getters for their
frame rates which VideoContext calls. Read-only public access to
VFR_Input and VFR_Output are still provided (hopefully temporarily) for
a few things which were awkward to do through VideoContext.

The Avisynth provider now might correctly handle VFR MKVs which can be
opened with DirectShowSource but not DSS2.

Rework keyframe handling as well, so that it continues to match the vfr
handling in design and implementation.

Originally committed to SVN as r4662.
2010-07-08 04:29:04 +00:00
Thomas Goyne d8e8f9eb68 Fix bad option names
Originally committed to SVN as r4591.
2010-06-24 06:26:44 +00:00
Amar Takhar 40e12403d5 Merge all changes from the libaegisub branch into trunk, the effective range is r4175:4330. All options have been re-done and now use Cajun to support a json-backed format.
Initial support for low-level access and file I/O methods are included as well.

Originally committed to SVN as r4331.
2010-05-21 01:13:36 +00:00
Thomas Goyne 42781c1c62 Make the shift times history display one-based frame numbers when shifting the selection onwards. Updates #1098
Originally committed to SVN as r4255.
2010-05-01 01:07:00 +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