Commit Graph

66 Commits

Author SHA1 Message Date
Thomas Goyne 9ac2f93bf0 Fix some mostly unimportant uses of uninitialized memory
Originally committed to SVN as r6304.
2012-01-18 20:08:06 +00:00
Thomas Goyne 01646d7cf4 Remove StandardPaths::DecodePathMaybeRelative, as it's been deprecated forever
Originally committed to SVN as r6232.
2012-01-08 01:34:37 +00:00
Thomas Goyne 15d49fb655 Revamp AssFile::AddLine and related functions to eliminate the statics and hopefully make it less brittle
Originally committed to SVN as r6231.
2012-01-08 01:34:30 +00:00
Thomas Goyne 8fdd5d987e Remove the encoding parameter from AssFile::SaveMemory, as it only supports utf-8, and simplify the implementation
Originally committed to SVN as r6220.
2012-01-08 01:33:19 +00:00
Thomas Goyne 0fd475031a Make default script resolution customizable
Originally committed to SVN as r6205.
2012-01-08 01:04:37 +00:00
Thomas Goyne 7adbe07b4e Silence a bunch of PREFast warnings
Originally committed to SVN as r6162.
2011-12-26 22:20:49 +00:00
Thomas Goyne 95ad8c1fba Fix the single-line-commit optimization
Originally committed to SVN as r6138.
2011-12-22 21:31:18 +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 cce9cb3c47 Fix unintended lowercasing of all strings returned from AssFile::GetScriptInfo
Originally committed to SVN as r5924.
2011-11-28 22:16:50 +00:00
Thomas Goyne ca91097b8f Revamp script resolution setting logic
Rather than setting the default script resolution to 640x480, leave it
unset in new files. When video is opened, if the user has not already
manually set a script resolution, automatically use the video's
resolution as the script resolution. If the user has and the set
resolution is not a multiple of the video resolution, use the old prompt
for updating it.

This eliminates the confusing prompt about mismatched resolutions when
opening video with a new file while hopefully resulting in users using
the correct resolution more often.

Originally committed to SVN as r5921.
2011-11-28 22:16:22 +00:00
Thomas Goyne 2e5cbf079e Update ?script after save as
Originally committed to SVN as r5822.
2011-11-06 17:18:14 +00:00
Thomas Goyne 6e2e87c0b5 Fix incorrect lowercasing in AssFile::GetScriptInfo
Originally committed to SVN as r5811.
2011-11-04 19:41:43 +00:00
Thomas Goyne 7476dfd9c6 Use GetScriptInfoAsInt in AssFile::GetResolution
Originally committed to SVN as r5777.
2011-10-25 01:16:56 +00:00
Thomas Goyne af19dad6ea Remove pointless try\catch in AssFile;GetScriptInfoAsInt (wx functions don't throw exceptions)
Originally committed to SVN as r5776.
2011-10-25 01:16:47 +00:00
Thomas Goyne 2ad0342103 Make AssFile::GetScriptInfo slightly less dumb
Originally committed to SVN as r5775.
2011-10-25 01:16:36 +00:00
Thomas Goyne fdf74309a5 Don't revert changes to the filename made when undoing. Updates #1345.
Originally committed to SVN as r5725.
2011-10-10 17:29:35 +00:00
Thomas Goyne eb947b3914 Remove dead code in AssFile::CanSave
Originally committed to SVN as r5724.
2011-10-10 17:29:26 +00:00
Thomas Goyne ab52f9a441 Move most of the autosave logic to AssFile and only autosave if there's actually been changes since the last autosave
Originally committed to SVN as r5680.
2011-09-29 18:17:27 +00:00
Thomas Goyne 976061747d Fix setting of filename when saving the subtitles
Originally committed to SVN as r5655.
2011-09-28 19:50:59 +00:00
Thomas Goyne df100fb5a5 Pass a project context to AssExportFilter::GetConfigDialogWindow so that export filters don't have to use things like AssFile::top and VideoContext::Get
Originally committed to SVN as r5629.
2011-09-28 19:46:53 +00:00
Thomas Goyne 4ec507f814 Clean up SubtitleFormat
Document all of the SubtitleFormat methods.

Add default implementations of CanReadFile and CanWriteFile that check
against the appropriate wildcard list.

Clean up and simplify a lot of very odd code.

Throw typed exceptions in all subtitle readers rather than strings.

Originally committed to SVN as r5617.
2011-09-28 19:44:53 +00:00
Thomas Goyne 67ab06e830 Add an optional argument to AssFile::Commit which indicates that only a single line was changed. Currently used only to cut down on file copies when coalescing.
Originally committed to SVN as r5614.
2011-09-28 19:44:24 +00:00
Thomas Goyne cc147d1660 Eliminate uses of c_str made unnecessary by changed to wxString::Format in wx 2.9
Originally committed to SVN as r5612.
2011-09-28 19:43:48 +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 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 ccf9f64818 Make Assfile::SetScriptInfo slightly less slow
Originally committed to SVN as r5569.
2011-08-27 06:42:10 +00:00
Thomas Goyne 1cacc33d2d Simplify version.cpp
Originally committed to SVN as r5526.
2011-07-27 22:52:37 +00:00
Thomas Goyne 9ec1e1ba79 Explicitly set Collisions to the default (Normal) in the default file so that opening and closing the properties dialog on the default file is a no-op
Originally committed to SVN as r5250.
2011-01-20 05:57:46 +00:00
Thomas Goyne a8ebc1e456 Make AssFile handle autosaving on every commit itself rather than going through FrameMain
Originally committed to SVN as r5247.
2011-01-20 05:57:23 +00:00
Thomas Goyne 7210ea17d8 Add pre-save signal to AssFile and move most of the logic in FrameMain::SaveSubtitles to slots for this signal
Originally committed to SVN as r5207.
2011-01-16 07:16:40 +00:00
Thomas Goyne 59300cbc27 Add a subtitle open signal and move most of the logic in FrameMain::LoadSubtitles to slots for this signal.
Originally committed to SVN as r5206.
2011-01-16 07:16:33 +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 7d2c7c5881 Don't add garbage AssEntries for blank lines in the file. Fixes some issues with sorting lines.
Originally committed to SVN as r4801.
2010-10-11 20:06:04 +00:00
Thomas Goyne 84b8877d1d Clean up AssFile::Load, eliminating some redundant checks, and fixing a few situations where the undo stack could be left in an inconsistant state
Originally committed to SVN as r4785.
2010-09-15 02:46:19 +00:00
Karl Blomster 9108ea9b00 Don't try to coalesce undo operations when there aren't any undo operations to coalesce with. Fixes a crash when opening .txt files.
Originally committed to SVN as r4784.
2010-09-15 01:00:18 +00:00
Thomas Goyne 46be23073e Fix a few gcc warnings
Originally committed to SVN as r4722.
2010-08-02 20:25:29 +00:00
Thomas Goyne c10e9e3a5b Make video and audio providers throw typed exceptions.
Don't display error messages and try other providers when the user
cancels loading a file.

Remove files from the MRU lists if they can't be found.

Closes #717.

Originally committed to SVN as r4717.
2010-08-02 06:32:01 +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 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 002aad0b29 Don't call CompressForStack on copied AssFiles as the parsed data isn't copied in the first place.
Originally committed to SVN as r4671.
2010-07-11 03:31:19 +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 e2f8e69612 Beat some semblance of sanity into ass_override and related files. Fixes a pile of crashes when tags are missing expected parameters.
Originally committed to SVN as r4581.
2010-06-24 01:24:43 +00:00
Thomas Goyne 627d423017 Fix memory leak in VariableData
Originally committed to SVN as r4577.
2010-06-24 01:24:21 +00:00
Thomas Goyne 50d1b3ed2d Rewrite the ass parsing code in visual_tool.cpp, eliminating a lot of repeated code and making it better at finding the correct values.
Originally committed to SVN as r4573.
2010-06-24 01:23:43 +00:00
Thomas Goyne a40b9c4b91 Simplify and speed up AssFile's copy constructor and assignment operator.
Originally committed to SVN as r4565.
2010-06-22 00:03:33 +00:00
Thomas Goyne 7958f85ef3 Remove pointless call to AssDialogue::SetEntryData in AssFile::CompressForStack; makes pushing files onto the undo stack about 50% faster
Originally committed to SVN as r4564.
2010-06-22 00:03:28 +00:00
Niels Martin Hansen 5bd0981a72 Make AssFile::Load catch agi::Exception and report it properly. The catching of reading/parsing errors probably doesn't really belong there, but just making things work for now. Updates #1213 in preparation for the actual patch.
Originally committed to SVN as r4555.
2010-06-20 19:03:05 +00:00
Amar Takhar 8ee9737b6f Move mru,opt objects out of the main singleton and into a global config:: namespace. With exception of the log object these are initialised during startup to ensure they are initalised after the log object.
Originally committed to SVN as r4538.
2010-06-18 02:23:27 +00:00
Thomas Goyne 8086fae633 Document AssFile's public methods
Originally committed to SVN as r4524.
2010-06-16 06:20:14 +00:00