Commit graph

444 commits

Author SHA1 Message Date
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
Thomas Goyne
ce29d07113 Remove an entirely pointless GUI-thread-blocking call to GetFrame 2014-06-07 08:48:40 -07:00
Thomas Goyne
f38ba33fed Eliminate some pointless rerenders of the video display
If the frame number hasn't changed and none of the currently visible
lines have changed, there's no need to rerender the subtitles and
redisplay the frame. Mostly helps with very slow opengl implementations
where actually painting the video display is expensive, as the rendering
is done on a background thread anyway.
2014-06-07 08:48:39 -07:00
Thomas Goyne
5e54a342e4 Fix the Select All button in the import styles dialog 2014-06-06 12:08:41 -07:00
Thomas Goyne
ce358c1367 Move global_scripts to options.h
Not the perfect place for it by any means, but that's where the rest of
the application-global stuff is these days and it removed the need for
automation stuff to include main.h (and thus all the wxApp garbage).
2014-06-06 12:08:41 -07:00
Thomas Goyne
07cf50f7d3 Use non-deprecated wxIMPLEMENT_APP 2014-06-06 12:08:40 -07:00
Thomas Goyne
392c9ea35a Catch std::exceptions thrown during startup 2014-06-06 12:08:40 -07:00
Thomas Goyne
04efe2edfb Delete osx-run.sh
wxWidgets now supports running from outside application bundles, so it's
no longer needed.
2014-06-05 08:35:50 -07:00
Thomas Goyne
421d5ca52e Add #ifdef __cplusplus to the precompiled headers to make Xcode happy 2014-06-05 08:35:50 -07:00
Thomas Goyne
50dfa1cd42 Fix issues with selected line styles with the keyboard on OS X
Opening the style list dropdown and switching between values with the
arrow keys doesn't update the value returned from ctrl->GetValue() on
OS X, but the event contains the correct value so use that instread.
2014-06-05 08:35:50 -07:00
Thomas Goyne
238110e799 Set minimum widths for the columns of the hotkeys editor on OS X
The OS X implementation makes very poor choices for the default widths
if given the opportunity.
2014-06-05 06:33:03 -07:00
Thomas Goyne
fffb138b81 Add IME support on OS X
Closes #1247, #1672, #1695.
2014-06-04 14:29:37 -07:00
Thomas Goyne
acdc0e7cba Use less std::set 2014-06-04 14:15:27 -07:00
Thomas Goyne
9133293869 Use less std::bind 2014-06-04 14:15:27 -07:00
Thomas Goyne
745aa8fef0 Use less wxString in HotkeyDataViewModel 2014-06-04 14:15:26 -07:00
Thomas Goyne
970dd96959 Delete unused variable 2014-06-04 14:15:26 -07:00
Thomas Goyne
460b806038 Use non-deprecated wxFONT/wxPEN constants 2014-06-04 14:15:26 -07:00
Thomas Goyne
d3484e7382 Get the end time of the last line in a less dumb way 2014-06-04 14:15:26 -07:00
Thomas Goyne
f7532ff1ef Actually use the ?dictionary token. Closes #1761. 2014-06-04 14:15:26 -07:00
Thomas Goyne
0bf93ec263 Fix a bunch of crashes in the vector clip tool 2014-06-03 10:07:35 -07:00
Thomas Goyne
5fcb287ed0 Fix saving images with subtitles for frames other than the first 2014-06-03 07:21:07 -07:00
Thomas Goyne
4e5b81973b Set the initial audio volume when opening audio 2014-06-03 07:21:07 -07:00
Thomas Goyne
e6d7c4547a Fix compilation of the portaudio player 2014-06-03 07:21:07 -07:00
Thomas Goyne
b42086fdfd Use the customized default styles for SRT files opened from matroska 2014-06-02 13:02:06 -07:00
Thomas Goyne
e061ac8755 Pull even more of the subs load logic into Project
The relative order of the on-file-load logic matters, so signals don't
work very well for it. Doing it all explicitly in Project fixes a bunch
of inconsistent issues related to restoring saved state.

Closes #1759.
2014-06-02 13:02:06 -07:00
Thomas Goyne
917913b0ef Flush the clipboard before closing it, not after 2014-06-02 13:02:05 -07:00
Thomas Goyne
ff9beb850c Build wx without iostream support 2014-05-31 08:11:32 -07:00
Thomas Goyne
193b30af86 Eliminate a bunch of entirely pointless OptionPage subclasses 2014-05-31 08:11:32 -07:00
Thomas Goyne
76f0afecaf Eliminate pointless wxDialog subclasses
A lot of the wxDialog subclasses don't actually override any virtual
functions, so there's no particular need for them to be subclasses at
all, and wxDialog's vtable is so huge that they actually contribute
measureable to the size of the executable.
2014-05-31 08:11:32 -07:00
Thomas Goyne
060536824b Kill ScintillaTextCtrl and just always use the UTF-8 methods
Trivially improves performance and reduces the opportunities for wxSTC
to fuck up.
2014-05-30 13:24:38 -07:00
Thomas Goyne
fa68b5ee1a Fix compilation with UTF-8 wxString 2014-05-30 11:53:15 -07:00
Thomas Goyne
59489b8f8c Extract some of the string formatter implementation to format.cpp 2014-05-30 11:53:15 -07:00
Thomas Goyne
37c02ae127 Replace wxString::Format with agi::format
It's modestly faster, significantly more type-safe, and doesn't assert
when there's too few arguments, which causes problems for plural forms.

Closes #1733.
2014-05-30 11:53:14 -07:00
Thomas Goyne
8d26c66d0f Remove a bunch of unused functionalty from agi::Exception 2014-05-30 11:53:14 -07:00
Thomas Goyne
b43788fa7f Replace boost::format with agi::format
boost::format is slow to compile, slow to run, and has an unpleasant
interface.
2014-05-30 08:30:31 -07:00
Thomas Goyne
e75fc089d3 Don't error on truncated wave files 2014-05-27 06:42:47 -07:00
Thomas Goyne
59a680e6e1 Fix saving audio clips from lines 2014-05-27 06:42:46 -07:00
Thomas Goyne
dfec6b73b7 Use free() on data returned by Hunspell, not delete 2014-05-27 06:42:46 -07:00
Thomas Goyne
eec83bb32b Cut down on FileNotFound exceptions thrown on startup 2014-05-27 06:42:46 -07:00
Thomas Goyne
ac5f40a543 Fix \N handling in EBU STL export 2014-05-27 06:42:46 -07:00
Thomas Goyne
02ca3360ca Handle missing recently used subtitle files better 2014-05-26 09:34:20 -07:00
Thomas Goyne
960dc3723b Don't get the duration from the audio controller on audio open
The audio controller's provider may not have been updated yet.
2014-05-26 09:34:20 -07:00
Thomas Goyne
cca97a58f6 Fully initialize the video when it's opened via drag-and-drop 2014-05-26 09:34:20 -07:00
Thomas Goyne
81b942ea6e Update agi_pre.h 2014-05-26 09:34:20 -07:00
Thomas Goyne
6c685daf98 Ditch boost.circular_buffer
It drags in a ton of crap, is kinda slow at runtime due to using
std::deque, and doesn't actually make the code much simpler than just
using a manual ring buffer.
2014-05-26 09:34:19 -07:00
Thomas Goyne
1f7c47239b Replace timeval junk with std::chrono 2014-05-26 09:34:19 -07:00
Thomas Goyne
fed99649e9 Cut down on pointless uses of std::list 2014-05-26 09:34:19 -07:00
Thomas Goyne
c0d3ecb6c2 Change Spline to a std::vector 2014-05-26 09:34:18 -07:00
Thomas Goyne
8ec9280ecc Change most uses of deques to vectors 2014-05-26 09:34:18 -07:00
Thomas Goyne
20a7ec786f Use initializer lists rather than std::make_pair 2014-05-26 09:34:18 -07:00
Thomas Goyne
4f65f79f1e Remove some pointless std::moves 2014-05-26 09:34:18 -07:00
Thomas Goyne
4598a23485 Fix the paste over dialog 2014-05-24 07:41:17 -07:00
Thomas Goyne
b370e1af53 Stop video playback when seeking due to switching active lines 2014-05-24 07:41:17 -07:00
Thomas Goyne
d73790805a Fix reloading the video provider after settings changes 2014-05-24 07:41:16 -07:00
Thomas Goyne
9ca61a2fb5 Delete unused stuff in the pulseaudio player 2014-05-24 07:41:16 -07:00
Thomas Goyne
55865d131a Add a missing check for if the video has an audio track 2014-05-23 13:03:10 -07:00
Thomas Goyne
99b46f6a14 Fix restoring video position from saved project info 2014-05-23 13:03:10 -07:00
Thomas Goyne
d004fc1856 Improve ALSA playback position reporting
Use std::chrono since it's a nicer API. Use a separate lock for playback
position so that the GUI thread isn't blocked for hundreds of ms while
snd_pcm_drain is waiting, and update the playback position after
decoding audio rather than before to avoid it being significantly wrong
when not using a cache.
2014-05-23 13:03:10 -07:00
Thomas Goyne
e36ecbde49 Reuse a decoding buffer for ALSA rather than constantly allocating new ones 2014-05-23 13:03:10 -07:00
Thomas Goyne
1bf6197869 Use std::thread rather than pthreads for AlsaPlayer 2014-05-23 13:03:10 -07:00
Thomas Goyne
c2b8892b33 Use unique_ptr in AlsaPlayer 2014-05-23 13:03:10 -07:00
Thomas Goyne
9d3067ae75 Return absolute paths for files in project_properties() 2014-05-23 07:28:26 -07:00
Thomas Goyne
384f87f399 Use more plural forms for translatable strings 2014-05-23 07:28:25 -07:00
Thomas Goyne
60fd44163e Don't clear project properties on undo/redo 2014-05-23 07:28:25 -07:00
Thomas Goyne
40ac2f9b44 Fix crash when opening video
If video was previously open and the user chooses to resample the script
for the new video, VideoController would try to update the subs for the
now-deleted old provider.
2014-05-23 07:28:25 -07:00
Thomas Goyne
e2754bcd90 Make video providers report whether their file has audio tracks
Fixes errors when trying to automatically open audio from dummy video
and improves UX a little by disabling the Open Audio From Video menu
item when there are no audio tracks.
2014-05-23 07:28:25 -07:00
Thomas Goyne
692b354713 Don't compile the FFT code if FFTW is enabled 2014-05-23 07:28:25 -07:00
Thomas Goyne
e0b8c21590 Use unique_ptr for AudioWaveformRenderer's decode buffer 2014-05-23 07:28:25 -07:00
Thomas Goyne
09e325a1c3 Clean up unused includes 2014-05-23 07:28:24 -07:00
Thomas Goyne
df406d5452 Fix compilation with GCC 2014-05-22 14:58:39 -07:00
Thomas Goyne
2bf23af00a Remove a lot of pointless headers for dialogs
Most of the dialogs in Aegisub have a public interface consisting of a
single function, so there's really no need to expose the actual dialog
classes to the rest of the program. Add dialogs.h with the declarations
of all of those functions (most of which are just ShowFooDialog()), and
kill a million other headers.
2014-05-22 14:58:39 -07:00
Thomas Goyne
49357eec20 Add missing subs_controller.h include for release builds 2014-05-22 09:54:59 -07:00
Thomas Goyne
9ae9da4aab Support loading keyframes and timecodes files via drag-and-drop
Closes #1749.
2014-05-22 09:29:16 -07:00
Thomas Goyne
de2e1e23de List the files to be (un)loaded in the Load/Unload files dialog
Updates #880.
2014-05-22 09:29:16 -07:00
Thomas Goyne
aa21b3d77d Add aegisub.project_properties()
Returns a table with all of the project metadata junk that used to be in
the script info section of the file.

Closes #1747.
2014-05-22 09:29:16 -07:00
Thomas Goyne
9c7119fdc2 Redesign how project metadata is stored in the file
Remove it from the script info section and put it in its own section
that isn't tracked by undo and make it not stringly typed. Removes the
need for the gross hack where changes are slipped in just before saving
to circumvent the undo system, cuts down on the uses of string literals
to identify fields, and probably improves performance a little.
2014-05-22 09:29:15 -07:00
Thomas Goyne
19e8f19e52 Redesign project file handling
Add a new Project class which is responsible for everything related to
opening and closing audio, video, subtitles, timecodes and keyframes.
This pulls almost everything not directly related to playing audio/video
out of the audio and video controllers, pulls more crap out of
FrameMain, and happens to make things a little simpler in the process.
2014-05-22 09:29:12 -07:00
Thomas Goyne
a345b8c4d5 Undelete the script resolution mismatch option from default_config 2014-05-22 06:14:59 -07:00
Thomas Goyne
5830fc4225 Don't limit CodecPrivate to 256KB 2014-05-20 09:46:58 -07:00
Thomas Goyne
5f4d6ad386 Return zero bytes when MatroskaFile asks for data past the end of the file 2014-05-20 09:46:57 -07:00
Thomas Goyne
53f02d33a6 Fix a bunch of warnings when building with gcc on linux 2014-05-20 09:46:57 -07:00
Thomas Goyne
c2455cccb6 Enable loading audio when opening video by default
Main reason not to do this was that loading audio blocked the UI, which
has now been fixed, and having to separately load audio confuses
beginners.
2014-05-20 09:46:57 -07:00
Thomas Goyne
7645b447be Set the correct variable for whether to commit subs after opening video 2014-05-19 19:32:25 -07:00
Thomas Goyne
6edb38501b Update the YCbCr matrix used by the video display when the header is changed 2014-05-19 19:32:25 -07:00
Thomas Goyne
ad33fdb109 Add color matrix conversion to the resolution resampler 2014-05-19 19:32:25 -07:00
Thomas Goyne
7a06e08ad0 Use ycbcr_converter in YUV4MPEGVideoProvider 2014-05-19 19:32:25 -07:00
Thomas Goyne
9774352a77 Fix compilation with gcc 4.8. Closes #1756. 2014-05-19 06:53:44 -07:00
Thomas Goyne
a376ed90b9 Insert \\N on shift-enter in the edit box 2014-05-18 07:50:23 -07:00
Thomas Goyne
402aa509a0 Fix non-pch compilation 2014-05-17 18:01:41 -07:00
Thomas Goyne
d0ce26d7df Add an option to resample the script to the resolution mismatch dialog
Closes #1382.
2014-05-17 18:01:41 -07:00
Thomas Goyne
32fae528b0 Don't try to shift line margins that are 0 2014-05-17 18:01:41 -07:00
Thomas Goyne
c78db67cba Round negative drawing coordinates correctly 2014-05-17 18:01:41 -07:00
Thomas Goyne
229b6cf63d Fix resampling drawings with AR changes
The shift from margins should be applied only to the line's position,
not to each point in the drawing, and the scale needs to compensate for
that the scale on the style is being changed as well.
2014-05-17 18:01:41 -07:00
Thomas Goyne
0f030c45f3 Make AR-changing resampling more user-friendly
Add modes where the borders to add or remove are automatically
calculated rather than forcing the user to do it manually, and hopefully
make it a bit clearer what exactly will happen.
2014-05-17 18:01:41 -07:00
Thomas Goyne
7e2780f57a Make both source and destination resolution overridable in the resampler 2014-05-17 18:01:40 -07:00
Thomas Goyne
6886436ddc Add YCbCr Matrix to the script properties dialog 2014-05-17 18:01:40 -07:00
Thomas Goyne
26cfd3ecbd Add missing check for if the context has been initialized in the crash handler 2014-05-15 12:07:46 -07:00
Thomas Goyne
79fd39d6ca Default to the language selected in the installer 2014-05-15 11:09:38 -07:00
Thomas Goyne
0a1660c03b Add version information to the windows executable
Closes #913.
2014-05-15 08:39:09 -07:00
Thomas Goyne
8a49cf1c34 Shove simple getters in AudioTimingControllerDialogue into the class declaration 2014-05-15 07:44:13 -07:00
Thomas Goyne
6f36c75cfd Fix snapping audio markers to markers from other selected lines 2014-05-15 07:31:33 -07:00
Thomas Goyne
e593843da7 Significantly speed up marker snapping with large selections 2014-05-14 12:48:59 -07:00
Thomas Goyne
fc662e0278 Use INT_MIN as the invalid click position sentinel rather than -1 2014-05-14 12:13:40 -07:00
Thomas Goyne
c13b026598 Snap based on all markers being dragged rather than just the mouse position 2014-05-14 12:04:19 -07:00
Thomas Goyne
9168484fc6 Allow clicking anywhere in the audio display for alt-dragging 2014-05-14 08:37:03 -07:00
Thomas Goyne
fff59982f4 Clear the clicked marker on right click 2014-05-13 12:44:28 -07:00
Thomas Goyne
66ba65774a Add custom build system for wxWidgets 2014-05-13 11:02:46 -07:00
Thomas Goyne
1651446e0f Drag the entire audio selection when Alt is held down
Closes #691.
2014-05-12 12:07:46 -07:00
Thomas Goyne
5da847e1ef Use more NSDMIs 2014-05-12 10:05:36 -07:00
Thomas Goyne
562a2259f5 Check for uses of styles other than "Default" in CanSave rather than customized styles
Customizable default styles makes the latter check awkward to implement,
and the previous logic of comparing against the hardcoded default wrong.
2014-05-12 08:34:28 -07:00
Thomas Goyne
164ad33753 Fix RTL painting of the subtitles grid
wx comes very close to just making it work automatically, but it doesn't
translate the origin to the top-right corner and wxBufferedPaintDC
doesn't handle RTL at all, so reimplement it with some hacks.

Closes #1354.
2014-05-12 08:04:24 -07:00
Thomas Goyne
0909d137b0 Mirror toolbar button images for RTL locales
Some of the toolbar buttons are seriously wrong when mirrored and there
doesn't seem to be a way to disable mirroring for the images while using
RTL layout for the toolbar itself, so double-mirror them so that they
end up with their original appearance.

Ideally the button images would be localizable as some of them actually
should be mirrored, but that's probably not worth the work involved.

See #1354.
2014-05-11 07:31:22 -07:00
Thomas Goyne
3d0e2baf4e Force the video display to LTR layout direction
Mirroring the video is not useful or desirable.

See #1354.
2014-05-11 06:59:59 -07:00
Thomas Goyne
b96edfebcc Remove check for customized styles in SRTSubtitleFormat::CanSave
It doesn't work with customizable default styles.
2014-05-09 09:24:27 -07:00
Thomas Goyne
73d64870af Fix writing files as non-utf-8 2014-05-09 07:00:48 -07:00
Thomas Goyne
eadf555da3 Pass exceptions in async workers back to the main thread 2014-05-09 07:00:48 -07:00
Thomas Goyne
d3a4bed994 Port respack to lua
Simplifies the build system a little by cutting down on the number of
helpers that need to be built.
2014-05-08 10:39:18 -07:00
Thomas Goyne
571c9d9b7a Don't hardcode the size of buttons with translatable labels. Closes #1750. 2014-05-07 10:43:01 -07:00
Thomas Goyne
049142f6f6 Make the check for faux bold match libass's logic for when to embolden 2014-05-07 07:13:32 -07:00
Thomas Goyne
8e5d4c48bc Print usage information for faux bold/itatlic warnings 2014-05-07 06:51:35 -07:00
Thomas Goyne
26e7880c8b Fix compilation with non-16-bit wchar_t 2014-05-06 18:31:19 -07:00
Thomas Goyne
77a2c1bb16 Verify that we're actually using a UTF-8 locale and switch to en_US.UTF-8 if not
Should fix #1587 and #1675, but I was never able to reproduce either of
them so maybe not.
2014-05-06 18:16:36 -07:00
Thomas Goyne
432640c045 Use localized language names from ICU rather than English names 2014-05-06 17:32:10 -07:00
Thomas Goyne
32f5e00bf8 Eliminate a pointless check 2014-05-06 10:32:19 -07:00