Commit graph

567 commits

Author SHA1 Message Date
Thomas Goyne
d6982426c6 Merge pull request #26 from tophf/rot-angle-fix
Style editor: accept -360..360deg range
2015-02-28 14:28:44 -08:00
9adefaf01e5bf6426d838cd20eae582d2b6ba647
af9fe934c7 Pass all font attachments to font renderer
See #1805.
2015-02-27 01:16:35 +03:00
9adefaf01e5bf6426d838cd20eae582d2b6ba647
4f9713cb20 Style editor: accept -360..360deg range
People tend to use 270deg not knowing|remembering it's equal to -90deg
2015-02-26 22:40:21 +03:00
Thomas Goyne
5cedf16edd Use the custom lua error handler during macro load 2015-02-15 08:19:23 -08:00
Thomas Goyne
879788fe83 Eliminate some gratuitous exceptions 2015-02-15 08:19:10 -08:00
Thomas Goyne
0416188235 Eliminate a pointless menu refresh when opening subtitle files 2015-02-15 08:19:05 -08:00
Thomas Goyne
acb9b8adac Reinitialize libass every time the font is changed in the style editor
libass doesn't free any font data it requests until the ass_renderer is
destroyed, so recreate it every time the font is changed to avoid
holding on to extremely large amounts of data when the user quickly
switches between fonts.

Closes #1320.
2015-02-08 09:13:53 -08:00
Thomas Goyne
9f196adc2e Replace boost::tokenizer with agi::Split 2015-02-08 08:11:22 -08:00
Thomas Goyne
5d8aeb8b40 Replace most remaining uses of boost::split with agi::Split 2015-02-08 08:11:14 -08:00
Thomas Goyne
2269dbcfe0 Reuse previously calculated string widths 2015-02-07 14:56:48 -08:00
Thomas Goyne
427037a552 Reimplement boost::split_iterator to make it less slow
boost::split_iterator type-erases the predicate, which makes it require
a virtual call per character (!) along with a heap allocation. As it
turns out we only ever need one predicate (comparing to a single
character), so replace it with a split_iterator that just does that.
2015-02-07 14:56:27 -08:00
Thomas Goyne
d8bd9904d8 Avoid running the extradata parsing regex unnecessarily 2015-02-07 14:56:20 -08:00
Thomas Goyne
bddf44ddde Eliminate a bunch of memory allocations when getting column widths 2015-02-01 20:09:40 -08:00
Thomas Goyne
8c1b20e651 Speed up grid painting with many unique effects/actors a bit 2015-02-01 20:09:35 -08:00
Thomas Goyne
79fb5cb3fe Fix crash when deleting the last dialogue line from automation 2015-01-26 19:22:59 -08:00
Thomas Goyne
7300a1bf2d Remove some redundant .get()s 2015-01-26 19:22:59 -08:00
Niels Martin Hansen
def24c25b3 Fix EBU STL writing on non-MSVC runtimes
MSVC 2013 and earlier have the _snprintf() function fill fields
completely, eliding the NUL character, if the printed string is
as long as or longer than the given buffer size. This is not the
case in POSIX snprintf(), it always ensures the string is terminated.
This causes several fields in GSI to become truncated and contain
NUL characters which should not appear there.
2015-01-26 19:19:42 +01:00
Niels Martin Hansen
d0296618a6 Sort Automation menu items by display name 2015-01-25 00:35:42 +01:00
Niels Martin Hansen
88d8573d4c Fix crash when loading a dialogue line missing extradata 2015-01-20 21:22:24 +01:00
Niels Martin Hansen
ebb3811942 Fix #1843 2015-01-14 00:46:02 +01:00
Niels Martin Hansen
b4516e4754 Fix #1844, eliminate pointers so typeid behaves
Only the bare type is considered polymorphic/habving a vtable
so therefore applying typeid to a pointer type doesn't behave
as intended.
2015-01-14 00:35:26 +01:00
Niels Martin Hansen
f0a5abad01 AssKaraoke can safely take a const AssDialogue* 2015-01-14 00:21:25 +01:00
Niels Martin Hansen
e9f0999c01 Include seconds in log timestamps on Windows 2015-01-14 00:21:23 +01:00
Thomas Goyne
57edbafdda Replace uses of wxThreadEvent with a statically typed event 2015-01-01 10:24:01 -08:00
Thomas Goyne
ef4424f5e2 Eliminate implicit std::string <-> wxString conversions
On Windows these don't use UTF-8 and so are broken.
2015-01-01 10:24:00 -08:00
Thomas Goyne
26050bd4e0 Actually use CPPFLAGS_BOOST when building src/aegisub 2015-01-01 10:24:00 -08:00
Thomas Goyne
3c59ea9a0a Remove AegisubApp::HandleEvent
OnExceptionInMainLoop covers the same functionality.
2015-01-01 10:24:00 -08:00
Thomas Goyne
2a33b35f60 Give Pen an out-of-line destructor 2015-01-01 10:24:00 -08:00
Thomas Goyne
ab35c41a93 Move AudioDisplayInteractionObject to audio_display.cpp 2015-01-01 10:24:00 -08:00
Thomas Goyne
4502a9893d Make some virtual destructors protected instead 2015-01-01 10:23:59 -08:00
Thomas Goyne
b6edf58651 Eliminate some object file bloat 2015-01-01 10:23:59 -08:00
Thomas Goyne
1d82a75595 Add a missing static 2015-01-01 10:23:59 -08:00
Thomas Goyne
62186e916a Anchor AssAttachment's vtable 2015-01-01 10:23:59 -08:00
Thomas Goyne
0e1c566628 Move tool_translation_assistant_insert into the anonymous namespace 2014-12-28 20:31:48 -08:00
Thomas Goyne
a7042486c0 Anchor AssStyle's vtable 2014-12-28 20:31:33 -08:00
Thomas Goyne
625bd7a767 Avoid having to include preferences.h in app.cpp 2014-12-28 20:28:33 -08:00
Thomas Goyne
0f324a22f1 Fix a pile of places where abs() was used on floats 2014-12-28 19:30:32 -08:00
Thomas Goyne
a6b1639320 Extract some bits that don't need to be templated from templates
Cuts compile time by about 10% and shrinks the final binary a little.
2014-12-28 16:46:38 -08:00
Thomas Goyne
372b9fe115 Eliminate a pointless set that only ever had zero or one entries 2014-12-28 16:46:37 -08:00
Thomas Goyne
5201773a3b Slightly optimize returning strings to lua from ffi functions 2014-12-28 16:46:37 -08:00
Thomas Goyne
010f6c4f79 Debloatify some stuff 2014-12-28 12:30:01 -08:00
Thomas Goyne
76afcdafa1 Eliminate uses of dynamic_cast on everything but GUI widgets 2014-12-28 12:29:54 -08:00
Thomas Goyne
c313f32384 Special-case all lines being selected in validate_adjoinable
GetSortedSelection is kinda slow with large selections and all lines
being selected is an easy thing to special-case.
2014-12-24 16:59:11 -08:00
Thomas Goyne
84bd682e2e Make it harder for automation script to leave no lines selected 2014-12-24 16:12:21 -08:00
Thomas Goyne
1fd44ea8da Add subtitles.script_resolution()
Returns the values from the headers if they're present, or does the
insane Gabest-logic if one or both are missing.
2014-12-24 15:10:12 -08:00
Thomas Goyne
c43bf1e822 Limit the range to be painted in the audio display to what is visible 2014-12-21 11:31:21 -08:00
Thomas Goyne
71ee37cd71 Slather around more const 2014-12-21 11:31:17 -08:00
Khaled Hosny
d4057418da Fix build with latest Visual Studio
This fiixes:

error C2797: list initialization inside member initializer list or
non-static data member initializer is not implemented

http://msdn.microsoft.com/en-us/library/dn793970.aspx
2014-11-23 15:30:27 +02:00
Thomas Goyne
a9208a592b Update the selection and scroll position after opening subtitles from video 2014-11-22 13:27:06 -08:00
Thomas Goyne
1a4634003f Fix crash on a certain kind of malformed shift times history file 2014-11-22 13:21:58 -08:00
Martin Herkt
cf55299017 Fix crash in block cache aging
Bug introduced in e2a11f2d90
2014-11-12 06:21:53 +01:00
Derek Buitenhuis
c871aaf153 srt: Factor out last goto
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-11-05 13:56:53 +00:00
Thomas Goyne
3d228536f5 Only update the YCbCr Matrix when resampling if it was actually changed 2014-10-12 15:45:13 -07:00
Thomas Goyne
ed03cd9735 Fix compilation without fftw3 2014-10-12 15:23:58 -07:00
Thomas Goyne
c41e97cec1 Skip the [Aegisub Project Garbage] and [Aegisub Extradata] sections when exporting to ASS 2014-09-20 11:52:44 -07:00
Thomas Goyne
9e6d5d7d9c Optimize Extradata handling a bit 2014-09-06 09:47:29 -07:00
Thomas Goyne
8567d9a573 Use more make_unqiue 2014-08-31 08:11:12 -07:00
Thomas Goyne
9ebb8d7df1 Silence a warning 2014-08-31 08:11:12 -07:00
Thomas Goyne
e4368d59e4 Fix loading subtitles extradata from matroska files 2014-08-30 08:11:39 -07:00
Thomas Goyne
54a7d43cf1 Use EnumFontFamiliesEx to try to find the correct match when fontconfig gives several options
Fixes collection of ITC Cheltenham, ITC Tiffany, Zurich, Delicious,
Jacoby, Segoe WP, Agilita LT, and a bunch of dumb improperly modified
fonts I have lying around.

Closes #1806.
2014-08-24 16:53:59 -07:00
Thomas Goyne
580386b229 Use FcFontSetSort rather than FcFontSetMatch
For whatever reason FcFontSetMatch sometimes returns something other
than the first result of FcFontSetSort, and every time they different
either FcFontSetMatch is wrong or they're both wrong.

Fixes collection of Adobe Jenson Pro and Arno Pro.
2014-08-24 16:53:54 -07:00
torque
3c12fc69f3 Perform extradata deduplication on add.
Checks all existing extradata keys and values to ensure that the set
that is being added doesn't already exist.
2014-08-24 12:06:22 -07:00
Thomas Goyne
d7fe7e3580 Make SubsController ensure files are non-empty on commit
There have been a bunch of recurring problems with things not handling
zero dialogue lines or zero styles very well, so add one to the file on
commit if needed.

Closes #1814.
2014-08-24 08:02:43 -07:00
Thomas Goyne
9ec4059096 Handle json parsing errors when loading shift times history
Closes #1802.
2014-08-24 07:42:57 -07:00
Thomas Goyne
6159f1587d Update wx
Removes the need for the RTL hacks in BaseGrid as the bugs have been
fixed properly in wx.
2014-08-23 15:56:32 -07:00
Thomas Goyne
20470ea682 Actually register the SSA subtitle format 2014-08-10 06:52:58 -07:00
Thomas Goyne
5b47758539 Convert the clipboard module to the ffi 2014-07-28 15:52:37 -07:00
Thomas Goyne
77ecff1cba Eliminate a pointless multimap in the cache cleaner 2014-07-28 12:09:48 -07:00
Thomas Goyne
51b92390b6 Fix a bunch of float <-> double conversion warnings 2014-07-28 12:09:48 -07:00
Thomas Goyne
ec407bbd7f Don't use std::min/max in mid()
VC++'s optimizer completely falls down on it for whatever reason.
2014-07-28 12:09:48 -07:00
Thomas Goyne
24b8db522a Remove unused things in block_cache.h 2014-07-28 12:09:47 -07:00
Thomas Goyne
e2a11f2d90 Speed up aging the block cache
Keep track of the total size rather than recalculating it every time as
calculating the size actually takes while.
2014-07-28 12:09:47 -07:00
Thomas Goyne
641f1e2e81 Simplify AudioSpectrumCacheBlockFactory a little 2014-07-28 12:09:47 -07:00
Thomas Goyne
7a3110015e Change AudioDisplay::style_ranges to a vector
This is faster in all cases except for repainting a very small part of
the display with a very large number of range transitions and simplifies
the code a bit.
2014-07-28 12:09:47 -07:00
Thomas Goyne
c9e4cea8ad Fix handling for automation debug formatting errors
One spot was missed when converting stuff over to using error_Tag rather
than lua_error for stack unwinding on errors.
2014-07-26 20:38:56 -07:00
Thomas Goyne
de686bdb6f Remove the automation thread priority stuff
It hasn't actually been used for anything for a while, and if a single
normal-priority thread can make your system unresponsive it's time to
upgrade to an OS that's isn't garbage.
2014-07-23 15:29:55 -07:00
Thomas Goyne
d61a9664c6 Write a BOM at the beginning of subtitles to make unpatched VSFilter happy
Closes #1795.
2014-07-23 15:29:54 -07:00
Thomas Goyne
771525ae6f Make AssFixStylesFilter usable statically
Trivially speeds up ProcFrame as constructing export filters isn't free
due to that it has to look up the translatable strings.
2014-07-14 10:10:22 -07:00
Thomas Goyne
97c59e2630 Fix non-pch compilation 2014-07-14 10:10:22 -07:00
darealshinji
3c772dd649 fix Linux build 2014-07-12 01:31:26 +02:00
Thomas Goyne
a9019421f1 Fix memory leak in aegisub.text_extents on Windows
The old object returned by SelectObject has to be made active again
before the DC is destroyed or it doesn't get deleted.
2014-07-11 09:26:59 -07:00
Thomas Goyne
06367d5cd9 Don't convert encoding names to lowercase when writing files
Not only is it unnecessary, but it actively breaks the mapping of
user-friendly encoding names in the Export dialog to the real encoding
names.

Closes #1789.
2014-07-11 09:26:59 -07:00
Thomas Goyne
548fbd814b Fix a use-after-free when a SubsEditCtrl is destroyed while the thesaurus is loading 2014-07-11 09:26:58 -07:00
Thomas Goyne
4dc38447dc Check the return value from lua_open()
It always fails when running under valgrind because valgrind does not
implement mmap functionality that LuaJIT requires.
2014-07-11 09:26:58 -07:00
Thomas Goyne
bffbae0ed9 Fix vc++ compilation 2014-07-10 12:55:38 -07:00
Thomas Goyne
bf03904fb8 Change the default ffms audio error handling mode to ignore
Truncating the file at the first decoding error seems to cause a lot of
confusion, especially since the UI doesn't mention that it happened
anywhere.
2014-07-10 11:44:57 -07:00
Thomas Goyne
2df4c4c194 Use wxDCFontChanger correctly
Fixes the audio display timeline font changing based on what else is
being painted.
2014-07-10 11:44:56 -07:00
Thomas Goyne
585e9489d9 Move some of the audio provider machinery to libaegisub
And add tests.
2014-07-10 11:44:56 -07:00
Thomas Goyne
e942a7f0f7 Fix int overflow when saving audio clips 2014-07-08 16:38:33 -07:00
Thomas Goyne
e713f741a4 Make some functions static 2014-07-08 16:38:16 -07:00
Thomas Goyne
e60197962a Fix buffer overflow when getting text extents
lfFaceName needs to be null-terminated, so only copy up to 31 characters
into the buffer.
2014-07-08 09:23:19 -07:00
Thomas Goyne
8a5b4ae3a3 Fix keycode mapping for backspace, enter, tab and escape 2014-07-08 09:23:19 -07:00
Thomas Goyne
6c0752035c Slightly optimize AssDialogue serialization 2014-07-07 08:40:38 -07:00
Thomas Goyne
935c6bc3a7 Store hotkeys in a less dumb format 2014-07-06 19:25:49 -07:00
Thomas Goyne
3b34ed9a77 Move AssTime to libaegisub and add tests 2014-07-06 19:25:49 -07:00
Thomas Goyne
8c7fd37aa9 Clean up the SRT reader/writer a bit 2014-07-06 19:25:49 -07:00
Thomas Goyne
8576c4993f Fix SRT timestamp parsing 2014-07-06 19:25:48 -07:00
Thomas Goyne
dd70da35d4 Remove some cruft from the fonts collector 2014-07-06 19:25:48 -07:00
Thomas Goyne
e924db1fda Store open dialogs in an unsorted vector
Even if every dialog in the program was open at once, linearly searching
a vector is quite fast enough.
2014-07-06 19:25:48 -07:00
Thomas Goyne
d9016cc8ea Debloat and slightly speed up the MRU code 2014-07-06 19:25:48 -07:00
Thomas Goyne
518342b919 Make the hotkey code a bit less bloated 2014-07-06 19:25:48 -07:00
Thomas Goyne
df8ad34838 Eliminate pointless runtime datastructures for CalltipProvider
And add some tests and make it actually work correctly.
2014-07-04 20:37:36 -07:00
Thomas Goyne
d56868e820 Fiddle with the dependency info for libresrc to hopefully work better 2014-07-02 18:20:11 -07:00
Thomas Goyne
a084f02a2d Fix a case where the found text would not be selected with find/replace
SubsTextEditCtrl::SetTextTo needs to update the selection via the text
selection controller or the text selection controller will have an
outdated cached state until the UpdateUI event is processed, which
soemtimes resulted in it not actually setting the selection when it
needed to be.
2014-07-01 20:16:17 -07:00
Thomas Goyne
abcd2bd61b Modernize the EBU STL writer a bit 2014-07-01 20:16:17 -07:00
Thomas Goyne
0f42155ca2 Make all of the syntax highlighter colors customizable
Closes #1782.
2014-07-01 12:25:22 -07:00
Thomas Goyne
71b74a6e86 Remove -D__STDC_FORMAT_MACROS from CXXFLAGS
The inttypes defines are no longer used anywhere due to that agi::Format
doesn't require them.
2014-07-01 12:22:39 -07:00
Derek Buitenhuis
14f9814bba srt: Factor out a goto statement
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-06-30 17:05:30 +01:00
Thomas Goyne
e1d56f9294 Update all selected lines when dragging the origin in the rotate tools 2014-06-29 11:42:55 -07:00
Thomas Goyne
5989226422 Fix crash when loading video from drag&drop is cancelled 2014-06-29 11:42:46 -07:00
Thomas Goyne
a38793497f Drop support for the DirectX SDK and require the Windows 8 SDK for DirectSound 2014-06-29 10:45:27 -07:00
Thomas Goyne
e53b2dab6b Eliminate a string copy for @ fonts in the fonts collector 2014-06-29 10:45:27 -07:00
Thomas Goyne
c50d80cf24 Fix enabling/disabling the default script resolution edit boxes in the preferences dialog 2014-06-29 10:45:26 -07:00
Thomas Goyne
4c88449e4c Make UnknownElement moveable and not copyable
And remove the unused comparison functionality.
2014-06-29 10:45:26 -07:00
Thomas Goyne
4c0e578eda Rewrite the remaining bits of json::Writer 2014-06-29 10:45:26 -07:00
Thomas Goyne
13fe4fe9ff Actually load the platform config rather than the default config twice 2014-06-28 19:49:39 -07:00
Thomas Goyne
b7a8dea753 Remove a pointless static bool 2014-06-28 19:49:39 -07:00
Thomas Goyne
dab67c6267 Enable the Apply button in the preferences dialog after a color is changed 2014-06-27 11:15:48 -07:00
Thomas Goyne
4accc988b3 Make the main edit box's background color customizable
Closes #1042.
Closes Aegisub/Aegisub#12.
2014-06-27 11:15:48 -07:00
Thomas Goyne
ce629c2393 Add the help page for the resolution mismatch dialog 2014-06-27 11:15:48 -07:00
Thomas Goyne
6e40f4f920 Don't automatically select all control handle in the vector clip tool
This was originally done because there was no easy way to select them
all otherwise, but box selection of handles has been supported for a
while now.
2014-06-26 17:24:54 -07:00
Thomas Goyne
e48e8cef84 Load files dropped on the window asynchronously 2014-06-26 17:24:54 -07:00
Thomas Goyne
03443818f0 Pass UTF-8 paths to hunspell now that it supports them 2014-06-26 16:50:43 -07:00
Thomas Goyne
3c57dda9ac Update to hunspell 1.3.3 2014-06-26 16:50:43 -07:00
Thomas Goyne
69781f0a88 Enable compression for the 256x256 icon
Bumps 200KB off the executable.
2014-06-24 13:14:20 -07:00
Thomas Goyne
6661c6a808 Fix use-after-frees when opening files from the MRU lists
Pass the paths to open by value to avoid ending up with a dangling
reference to a path stored in the MRU list which has been invalidated by
adding or removing items.

Closes #1777.
2014-06-23 16:40:43 -07:00
Thomas Goyne
4ce1283bbb Fix handling of thesaurus words with only a single suggestion
When there's only one suggestion for a given word the part of speech
appears in the suggested replacement, which needs to be stripped.

Closes #1776.
2014-06-23 16:40:43 -07:00
Thomas Goyne
961e6dab88 Select the last token when double-clicking past the end of the text in the edit box 2014-06-20 10:45:13 -07:00
Thomas Goyne
5f981e40f1 Add dependency on libresrc headers to all of the src objects 2014-06-17 20:48:59 -07:00
Thomas Goyne
68eaab0f43 Convert the build system to non-recursive make
Speeds up a no-op build from 500ms to 60ms and significantly improves
dependency tracking.
2014-06-17 11:37:20 -07:00
Thomas Goyne
cb71a3d05d Fix saving audio clips
Actually write all of the samples rather than half of them.
2014-06-15 17:17:15 -07:00
Thomas Goyne
5f9fc95fb4 Always update the rendered subtitles for non-dialogue changes
Closes #1770.
2014-06-15 17:17:15 -07:00
Thomas Goyne
23f6addf35 Close the detached video dialog when video is closed 2014-06-15 17:17:15 -07:00
Thomas Goyne
7780fadfc6 Fix restarting the application after changing the UI language on OS X 2014-06-14 06:51:53 -07:00
Thomas Goyne
62c28ce0d3 Avoid pointless repaints of the grid when seeking video
Keep track of which lines are displayed on the current video frame so
that video seeks only have to repaint the grid when the set actually
changes. Speeds up video playback on non-fbf stuff by ~15%.
2014-06-12 17:06:25 -07:00
Thomas Goyne
633fa0e4d7 Only repaint the video slider on seek if the thumb will actually move
Cuts CPU usage for playback in totally arbitrary circumstances by about
5%.
2014-06-12 17:06:25 -07:00
Thomas Goyne
4bdccb889c Reuse buffers for video frames
At least on OS X, allocating the buffers is one of the more expensive
parts of video playback, and on an arbitrary 720p H.264 file with simple
subtitles this cuts CPU usage while playing by about 30%.
2014-06-12 17:06:25 -07:00
Thomas Goyne
a574d6ac67 Speed up AsyncVideoProvider::UpdateSubtitles a bit
Adding Row to AssDialogue removes the need to loop over the file to find
out what rows changed.
2014-06-12 17:06:25 -07:00
Thomas Goyne
2508dd9c6e Only scroll the grid to the active line if the row has actually changed
Makes it so that undo/redo only scrolls to the active line if it's
different in the two versions of the file.
2014-06-12 17:06:25 -07:00
Thomas Goyne
f24a72d8fc De-wxString HelpButton 2014-06-11 12:52:30 -07:00
Thomas Goyne
8e36b69ef1 Update manual URL for 3.2 2014-06-11 12:52:30 -07:00
Thomas Goyne
87f99876c6 Eliminate some repeated iequals 2014-06-11 12:52:30 -07:00
Thomas Goyne
7de5fbac92 Eliminate all remaining places where strings are thrown as exceptions
Closes #916.
2014-06-11 12:52:30 -07:00
Thomas Goyne
789ff25f27 Remove some exceptions not used for much of anything 2014-06-11 12:52:30 -07:00
Thomas Goyne
cfd2698b03 Use NSSpellChecker rather than hunspell on OS X
Main benefit is it removes the need to ship 50 MB of dictionaries.
2014-06-11 12:33:09 -07:00
Thomas Goyne
6500b379bd Remove all distfile stuff from the build system
It's unused and out of date.
2014-06-09 17:20:56 -07:00
Thomas Goyne
b777cae2fe Fix crash on invalid extradata from automation 2014-06-09 17:20:56 -07:00
Thomas Goyne
831fbcd9a0 Fix crash when an extradata entry is used by more than one line 2014-06-09 17:20:56 -07:00
Thomas Goyne
ac7161cd08 Revert 50dfa1cd42 for wxGTK
wxGTK has the opposite problem as OS X: GetValue returns the new value,
but the change event has the old value.
2014-06-08 08:00:11 -07:00
Thomas Goyne
aae82f01e9 Set the margin controls in the style editor to the correct initial values 2014-06-07 08:48:40 -07:00