Commit graph

244 commits

Author SHA1 Message Date
Thomas Goyne
50d0744e9c Skip prompting the user for a language on first start if we have a translation for their OS UI language 2014-05-06 10:29:53 -07:00
Thomas Goyne
47b8627ad3 Keep the old subtitles file alive until the new one is fully announced
This fixes crashes from touching dangling references to lines in the old
subtitle file in the handlers for the various signals triggered when a
new file is opened.
2014-05-06 09:36:07 -07:00
Thomas Goyne
ca86b0da33 Actually initialize the initial MatchState in the search replace engine 2014-05-05 18:52:16 -07:00
Thomas Goyne
a00e5dc967 Update which style the Edit button edits when the line's style is changed 2014-05-05 18:42:06 -07:00
Thomas Goyne
2674c702d1 Silence incorrect warning 2014-05-05 17:53:14 -07:00
Thomas Goyne
7e2724c22c Add support for submenus in the automation menu
Split the menu text on /, with each segment before the last used as the
submenu name and the last as the actual menu text.

Closes #852.
2014-05-05 14:27:01 -07:00
Thomas Goyne
c5608a4725 Add Comment field to the paste over dialog 2014-05-05 07:01:57 -07:00
Thomas Goyne
26a9e57006 Eliminate an extra commit when using the color picker buttons 2014-05-05 06:28:27 -07:00
Thomas Goyne
f261688b11 Don't ignore the contents of override blocks when counting characters for selection preserving 2014-05-05 06:27:37 -07:00
Thomas Goyne
3983719e3f Add an Edit button next to the style list dropdown. Closes #1746. 2014-05-04 12:53:22 -07:00
Thomas Goyne
57f6e9a869 Actually serialize the styles for the subtitle renderers 2014-05-04 11:16:57 -07:00
Niels Martin Hansen
e1c575b7a1 MicroDVD import should also use default styles 2014-05-04 13:14:28 +02:00
Niels Martin Hansen
1dc2ae09a0 Forgot OSX default config in 6b827abec0 2014-05-04 13:07:25 +02:00
Niels Martin Hansen
82d7979f04 Pass style catalog names instead of file names to AssFile::LoadDefault 2014-05-04 13:04:48 +02:00
Niels Martin Hansen
79b6ce2583 Move style catalog indexing and naming logic 2014-05-04 13:03:04 +02:00
Thomas Goyne
c30ca1a321 Remove progress throttling from ffms indexing 2014-05-03 17:22:38 -07:00
Thomas Goyne
d672e75109 Filter out redundant progress updates sooner
Sending events from background threads to the main thread is somewhat
expensive, so filter out progress updates which don't actually change
the progress on the background thread.
2014-05-03 17:22:38 -07:00
Thomas Goyne
6a1321e1df Move the serialization for the subtitles providers to SubtitlesProvider 2014-05-03 17:22:38 -07:00
Niels Martin Hansen
451c6751de Preferences page for default style catalogs 2014-05-03 22:23:01 +02:00
Niels Martin Hansen
6b827abec0 Config options for default style catalogs for various formats 2014-05-03 21:08:37 +02:00
Niels Martin Hansen
f45f73151e Copy styles from Default catalog to new files 2014-05-03 20:02:52 +02:00
Niels Martin Hansen
3260a5fa1a Update about box 3rd-party library credits 2014-05-03 02:14:12 +02:00
Niels Martin Hansen
9c2f12a786 Clearer error messages when audio open fails
The existing chain of errors from all providers can be really confusing,
so instead try to interpret the exception type to add some meaning.
2014-05-03 01:05:09 +02:00
Thomas Goyne
2587625af4 Fix non-pch compilation 2014-05-01 13:48:46 -07:00
Thomas Goyne
f7f6c2b90b Switch to using csri_open_mem 2014-05-01 13:39:35 -07:00
Thomas Goyne
af20d31699 Push the dropping of non-visible lines into the serialization logic
Makes things way less gross and trivially faster.
2014-05-01 13:39:35 -07:00
Thomas Goyne
7a5c92aaee Speed up TextFileWriter a bit
Write the text and the newline separately rather than appending the
newline to the text to eliminate a copy of the text.
2014-05-01 13:39:35 -07:00
Thomas Goyne
4366ece827 Speed up passing subtitles to VSFilter a little
Use temp_file_mapping so that it normally never actually hits the disk
on Windows and use AssSubtitleFormat directly.
2014-04-30 06:29:37 -07:00
Thomas Goyne
1eba2f035c Add a separate SSA subtitle format and move all of the SSA writing stuff there 2014-04-30 06:29:37 -07:00
Thomas Goyne
31af9c575f Extract duplicated ASS writing code from libass provider 2014-04-30 06:29:37 -07:00
Thomas Goyne
431b096f51 Fix loading modules with UTF-8 BOMs
Ensure MoonScript gets loaded before we install our package loader to
avoid having its package loader used over ours.
2014-04-28 14:19:16 -07:00
Thomas Goyne
606e3f4882 Fix crash on script load errors 2014-04-28 13:36:56 -07:00
Thomas Goyne
e3fa270345 Process any pending log text when a progress dialog completes 2014-04-28 11:01:57 -07:00
Thomas Goyne
8aa3c8761c Unswap the actor and effect columns in the grid 2014-04-28 10:10:33 -07:00
Thomas Goyne
aa850688f4 Don't try to open compressed subtitle tracks
Actually supporting them would be even better of course, but at least
don't crash on them.
2014-04-28 08:43:25 -07:00
Thomas Goyne
c74045cf20 Use spin controls for numeric fields in the style editor
Closes #1741.
2014-04-28 07:38:33 -07:00
Thomas Goyne
63f4bf1beb Switch from regular Lua to LuaJIT 2014-04-28 07:38:30 -07:00
Thomas Goyne
9492192b73 Switch back to building Lua as C
In preparation for switching to LuaJIT, which doesn't support PUC Lua's
thing of using C++ exceptions for lua_error.

Requires replacing all uses of lua_error (and things calling lua_error)
with custom versions that throw an exception instead and adding an
exception -> lua error wrapper at all C++ -> Lua boundaries.
2014-04-27 10:37:23 -07:00
Thomas Goyne
e3eb28ffd1 Extract some duplicated table pushing code 2014-04-27 09:15:35 -07:00
Thomas Goyne
689c16deb3 Use lua_createtable where applicable 2014-04-27 09:15:35 -07:00
Thomas Goyne
50e27d8247 Shut up warning 2014-04-26 08:16:38 -07:00
Thomas Goyne
2adcc76cf6 Switch automation tests to busted
This requires shuffling a bunch of stuff around to get a CLI lua
executable that uses an automation-like environment, but that's
something that'll be nice to have in the future anyway.

Busted indirectly depends on lfs and we currently can't use external
binary modules, so add a copy of lfs to the repo and build it with
Aegisub.
2014-04-26 08:16:38 -07:00
Thomas Goyne
b8af29da0d Move some of the automation machinery to libaegisub 2014-04-25 15:03:18 -07:00
Thomas Goyne
15ae2b0ccc Eliminate a bunch of explicit constructors/destructors
Use explicitly defaulted destructors for base cases when possible,
eliminate aggregate initialization constructors where possible, and push
some more stuff to NSDMIs.
2014-04-25 14:53:24 -07:00
Thomas Goyne
4cd92ee532 Move stuff only ever used in auto4_lua.cpp to an anonymous namespace there 2014-04-25 09:27:27 -07:00
Thomas Goyne
e7734e642d Use nullptr 2014-04-25 08:59:43 -07:00
Thomas Goyne
d0603fde88 Don't check for used extradata ids if there are none 2014-04-25 08:59:43 -07:00
Niels Martin Hansen
d53c36e67f Merge branch 'extradata'
Conflicts:
	src/ass_parser.cpp
2014-04-25 17:22:15 +02:00
Thomas Goyne
d4fbe3040d Preserve the insertion point (but not selection) when switching between lines 2014-04-25 08:00:45 -07:00
Niels Martin Hansen
f278c35f3f Dynamically use either inline_string escaping or uuencoding for extradata
Since luabins generates binary data which grows up to 3x by escaping,
it's more efficient to uuencode that instead.
A marker is placed as the first character of the value field, either
'e' for inline_string escaped text, or 'u' for uuencoded binary data.
The key is always inline_string escaped, as it will typically be
human readable.
2014-04-25 16:04:08 +02:00
Thomas Goyne
6ee1b8ca52 Update the start sample between blocks in the ram audio provider correctly 2014-04-24 19:08:05 -07:00
Thomas Goyne
cef07785d7 Remove a pointless ++ and make stuff const 2014-04-24 18:51:54 -07:00
Niels Martin Hansen
7839e8c983 Fix bug in extradata id list reading 2014-04-25 00:05:32 +02:00
Niels Martin Hansen
b2768b7abd Work around boost::format bug
See https://svn.boost.org/trac/boost/ticket/9360
It seems that the %X specifier is ignored if the input value is a char type
and the char is instead output verbatim and not in its integer value.
Casting it to an int works around this.
2014-04-24 23:54:42 +02:00
Niels Martin Hansen
3f08b1d057 Use lua_pushlstring() so strings with embedded NULs also work 2014-04-24 23:49:36 +02:00
Niels Martin Hansen
18f55eaebf Load luabins library into Auto4 Lua environment 2014-04-24 23:01:27 +02:00
Thomas Goyne
7161ce167c Use lambdas rather than std::bind(std::ref(Signal)) for signal forwarding 2014-04-23 15:48:39 -07:00
Thomas Goyne
6fc4c8da14 Move make_unique to its own header file
Rebuilding the entire project after touching util.h gets old fast.
2014-04-23 15:29:23 -07:00
Niels Martin Hansen
cf81e91383 Perform extradata garbage collection on save 2014-04-23 22:54:01 +02:00
Niels Martin Hansen
159dfcde39 Add extradata reading/writing to Auto4 Lua 2014-04-23 22:54:01 +02:00
Niels Martin Hansen
040b467090 Add undo support for extradata 2014-04-23 22:54:01 +02:00
Niels Martin Hansen
8076fb2791 Basic storage and loading/saving for extradata 2014-04-23 22:54:01 +02:00
Thomas Goyne
c248dc56da Make the visual tool drag handles a little smaller 2014-04-23 07:15:28 -07:00
Thomas Goyne
7b0b74fbb0 Fix off-by-one error in the bounds check for restoring the active line 2014-04-23 06:22:18 -07:00
Thomas Goyne
ec6f14eef4 Make double-click in the edit box smarter
Use the syntax highlighting's word splitting to decide what to select so
that double-clicking on \Nword only selects 'word'.
2014-04-22 17:01:22 -07:00
Thomas Goyne
b4284efb38 Trigger the audio selection change logic when switching timing controllers
Results in the display seeking to the active line when audio is opened
(if seeking to active line is enabled), and initializes the scrollbar
properly.

Updates #1732.
2014-04-22 16:42:47 -07:00
Thomas Goyne
feec511227 Use more make_unique 2014-04-22 16:37:12 -07:00
Thomas Goyne
c53e8f6139 Pass around newly created AudioTimingControllers in a unique_ptr 2014-04-22 16:21:53 -07:00
Thomas Goyne
f83f8b73a0 Hide the CPS value if it's over 100 2014-04-22 12:35:41 -07:00
Thomas Goyne
a30d6121fd Don't block the UI while decoding audio for the caches
Simply zero the memory for audio which hasn't been decoded yet, modify
the audio renderer to avoid caching blocks which aren't ready yet, and
add a progress indiciator to the audio display scrollbar.
2014-04-22 12:34:20 -07:00
Thomas Goyne
1bd3572054 Make the CPS warning thresholds and color customizable 2014-04-21 11:11:40 -07:00
Thomas Goyne
7bc35cecb7 Don't show a CPS value for lines under 100 ms long 2014-04-21 11:11:40 -07:00
Thomas Goyne
543034b96b Change the background color of the CPS column when the value is excessively high 2014-04-21 11:11:40 -07:00
Thomas Goyne
a1a289c4c0 Push more of the painting logic into the grid column classes 2014-04-21 11:11:40 -07:00
Thomas Goyne
6e0160d730 Fix ugly extra grid line drawn when the first row is selected 2014-04-20 19:46:03 -07:00
Thomas Goyne
5646c05be7 Draw the active line box on top of the grid columns 2014-04-20 19:39:48 -07:00
Thomas Goyne
f14cef7321 Remove pointless vertical alignment logic
The only time it has an effect is when font substitution occurs, and the
end result tends to be worse than doing nothing at all.
2014-04-20 19:32:39 -07:00
Thomas Goyne
d886a5916d Create the output directory when collecting fonts to a zip 2014-04-20 07:01:49 -07:00
Thomas Goyne
1677e700b2 Add missing error checking for opening the output zip file in the fonts collector 2014-04-20 07:01:49 -07:00
Thomas Goyne
3ed99b5cb2 Make SubsEditBox::PopulateList less pointlessly slow 2014-04-20 07:01:49 -07:00
Thomas Goyne
2387b31cee Rearrange BaseGrid's data members 2014-04-20 07:01:49 -07:00
Thomas Goyne
c3e024954c Make frame mode handling in grid columns a little less ugly 2014-04-20 07:01:48 -07:00
Thomas Goyne
6c6f60eb98 Add an option to ignore punctuation for the character counter 2014-04-18 20:11:38 -07:00
Thomas Goyne
cff3c0a3df Don't repopulate the actor/effect fields when the active line changes
Speeds up switching lines on a totally arbitrary test file that doesn't
even use very many actors or effects by ~20%.
2014-04-18 20:11:38 -07:00
Thomas Goyne
8aea747b88 Update the character counter synchronously
It's not longer even vaguely in the realm of slow enough to justify
dumping off on a background thread.
2014-04-18 20:11:38 -07:00
Thomas Goyne
af32733797 Move character count stuff to libaegisub 2014-04-18 20:11:38 -07:00
Thomas Goyne
bd53302907 Remove unused variable 2014-04-18 14:28:55 -07:00
Thomas Goyne
744717a164 Skip calculating the CPS for lines where it's very unlikely to be meaningful 2014-04-18 14:08:12 -07:00
Thomas Goyne
5143c34d70 Fix right and vertical margin columns 2014-04-18 14:05:31 -07:00
Thomas Goyne
5df871f599 Extract all of the column-specific logic from BaseGrid 2014-04-18 12:17:03 -07:00
Thomas Goyne
909be4494a Use a struct for the cached grid brushes rather than an array+enum 2014-04-18 07:17:38 -07:00
Thomas Goyne
d5274b72d4 Cap CPS column at 999 2014-04-18 07:07:03 -07:00
Thomas Goyne
867eaae7a8 Add basic characters-per-second column to the grid 2014-04-17 19:11:35 -07:00
Thomas Goyne
393d1dd269 Fix combine lines commands 2014-04-17 18:08:03 -07:00
Thomas Goyne
c93d38cc34 Clean up BaseGrid a little
Eliminate the hardcoded uses of 11 all over the place and cache the
calculation of the header widths.
2014-04-17 18:08:03 -07:00
Thomas Goyne
27c1522622 Use AssDialogue::Row more places 2014-04-17 17:30:06 -07:00
Thomas Goyne
e729d38164 Add a warning for faux bold/italic to the fonts collector 2014-04-17 16:07:01 -07:00
Thomas Goyne
1a67ee1fdf Add SelectionController::GetSortedSelection and use it where useful 2014-04-17 14:32:18 -07:00
Thomas Goyne
df42fdb2d2 Restore the text selection and cursor position on undo 2014-04-17 11:46:28 -07:00
Thomas Goyne
56699e4800 Mark move constructors as noexcept
Or just default them for non-MSVC when possible.
2014-04-17 11:46:28 -07:00