Compare commits

...

213 Commits
mia ... dev

Author SHA1 Message Date
wangqr 3bde4dd751 Move coveralls to after_success in Travis CI
So it won't affect the build result
2020-07-28 17:29:51 -04:00
wangqr 533716c6c0 Add default path on Windows in FindAviSynth.cmake 2020-07-28 16:32:33 -04:00
Oneric 98abe53b15 po/de: Update German translation
Translate missing strings, defuzz (mostly) and some corrections
(hopefully without introducing new errors), like:
 - non-matching printf format strings
 - discrepancy of '...' usage or not-usage in English and German
 - Ntsc → NTSC, etc
2020-07-26 18:47:35 +02:00
wangqr 7e3a0fb926 FFMS actually can be used without cache 2020-07-20 21:38:08 -04:00
wangqr 79c2141082 Delete temporary file on close 2020-07-20 18:57:09 -04:00
wangqr a58902c938 Gracefully handle 32-bit memory limit 2020-07-20 18:31:00 -04:00
wangqr e5f543c1ab Add support for XAudio2 redistributable
Bundle XAudio2 to better support Win7

Fix wangqr/Aegisub#59
2020-07-20 16:16:20 -04:00
wangqr 940181c7bc Update po files 2020-07-17 13:18:46 -04:00
wangqr 79a71c3176 Fix syntax error in e2ea84541f 2020-07-17 12:47:06 -04:00
Oneric 4aee271d03 po/make_pot: Fix sorting and make POSIX compliant
Replaces non POSIX `echo -e` with an equivalent printf call and
fixes sorting of lua files.

This still leaves a problem with the order of old commented strings
being being reversed and there #, c-format comments being stripped.
See: https://savannah.gnu.org/bugs/?58778
2020-07-17 18:29:16 +02:00
Oneric e2ea84541f AlignToVideo: Handle tolerance = 0 correctly
Checking if the diff is '>' instead of '>=' will always fail if
tolerance=0, even if the colours are identical. This will cause the line
to get a startime greter than its end time, which is not desireable.

Rounding errors and limits of floating type precision might still affect
the comparison. An additional sanity check before calculation is added
to ensure the selected position and colour match within tolerance.
This allows us to refactor the search code to never check the starting
frame and guanrantees valid timings with start<end even with
rounding errors.
2020-07-17 18:07:18 +02:00
Oneric 7f4cdaea42 AlignToVideo: Improve rgb->lab precision 2020-07-17 17:09:05 +02:00
Oneric 26f0713aae dialog_align: Remove point at the end of the tooltips
No other tooltips end with points, even if they're a sentence.These
ones aren't even sentences.
Also updates all *.po files accordingly, with an hacked in
POT-Creation-Date due to issues with make_pot.sh.
2020-07-17 16:12:41 +02:00
Oneric b64bc3916b Readme: Fix Typo 2020-07-17 00:10:55 +02:00
wangqr e98b7292f1 Update po files 2020-07-05 15:13:38 -04:00
wangqr 971f955f1a Update README.md 2020-07-05 02:27:50 -04:00
wangqr 8dececc3cb Use millisecond in Make Adjacent step in Timing Post-Processor
Fix wangqr/Aegisub#57
2020-07-04 05:22:14 -04:00
wangqr 1e3e478f5f Disable alt drag check when setting timing values by absolute values
In AudioTimingControllerDialogue

Fix Aegisub/Aegisub#186
2020-07-02 01:58:26 -04:00
wangqr 2b827decd0 Explicitly set buffer to 24-bit color + 8-bit alpha
As wxGLCanvas does not set this for us now, even when WX_GL_RGBA is specified

Fix wangqr/Aegisub#55
2020-06-29 23:37:37 -04:00
wangqr 5f326cc873 Correctly write float header when saving WAV audio clip
Fix wangqr/Aegisub#56
2020-06-29 04:57:55 -04:00
wangqr 65ba6af0f0 Remove .. from include paths
Fix wangqr/Aegisub#52
2020-06-08 04:45:05 -04:00
wangqr b9b1443578 Remove gcc 4.7 workaround 2020-06-07 12:24:26 -04:00
wangqr af8cb9b601 Test hunspell and uchardet on Travis macOS 2020-06-07 12:09:04 -04:00
wangqr e481d033cb Prevent event queue flooded by wxEVT_PAINT by moving some repaint request to OnIdle 2020-06-05 22:34:06 -04:00
wangqr 7b69476b5b Move wxSTC::GotoPos to idle event in fonts collector dialog
wxSTC::GotoPos is CPU consuming. Calling it every time when fonts collector worker thread adds log to wxSTC causes performance issues. So we only set a flag to request go to end, and actually do it when idle.

Fix TypesettingTools/Aegisub#28
2020-06-04 10:35:14 -04:00
wangqr 51648c638b Reallocate static ranges for wxMenuItem
Previously different menus may use conflict ids in range 10000~.

Fix TypesettingTools/Aegisub#53
See also Aegisub/Aegisub#131
2020-06-03 23:49:04 -04:00
wangqr 71c940f933 Fix initial state of AudioTimingControllerDialogue
It should not be in alt-dragging mode by default.

Fix TypesettingTools/Aegisub#32
2020-06-03 20:00:54 -04:00
wangqr 809b789b61 Remove unreachable assert 2020-06-01 22:33:01 -04:00
wangqr 6028c7f6cb Set default build type to Release 2020-06-01 22:16:28 -04:00
wangqr d9e67d3b27 Use CMake pch support 2020-05-31 02:04:22 -04:00
wangqr bf241635e1 avisynthplus no longer in AUR for Archlinux 2020-05-31 00:43:20 -04:00
wangqr 95fe52aeaa Remove mysterious brackets 2020-05-31 00:41:29 -04:00
wangqr 8d03571613 Add Apply button to select lines dialog
Allow modifying selection without closing dialog.

Fix wangqr/Aegisub#49
2020-05-31 00:21:19 -04:00
wangqr 1fda1d2b05 Fix XAudio2 handle leak 2020-05-31 00:18:33 -04:00
wangqr e2430b6fca Remove vendor submodules 2020-05-29 00:55:02 -04:00
wangqr e53bdd32d7 Save state of "show original" for osx
Fix wangqr/Aegisub#47
2020-05-27 03:15:59 -04:00
wangqr 60eae86e21 Stable version of avs+ now available on arch 2020-05-21 16:23:52 -04:00
wangqr 333f928019 Save state of "show original"
Fix wangqr/Aegisub#41
2020-05-17 23:36:52 -04:00
wangqr 5e71125825 Fix Windows build with boost 1.73.0 2020-05-17 22:41:57 -04:00
wangqr 47c95e5fe5 Remove unnecessary compiler flags
Also Fix CI
2020-05-09 13:44:13 -04:00
wangqr 9d812a8aac Use standard static_assert instead of homemade macro 2020-05-09 12:21:09 -04:00
wangqr 38a0e20edc Happy new year 2020-05-07 13:43:09 -04:00
wangqr 3ec57295fd Use id instead of pos to robustly locate VisualToolDrag button 2020-05-06 21:22:53 -04:00
wangqr 47b2bfd544 Move AddSeparator to VisualTool::SetToolbar 2020-05-06 21:20:53 -04:00
wangqr 7ac2983c61 Remove redundant UpdateToggleButtons() in VisualToolDrag::OnSubTool 2020-05-06 20:24:15 -04:00
wangqr 76802c3441 Remove unnecessary Realize() when constructing Visual Tools toolbar
The Realize() will change the toolbar size on macOS, which may trigger VideoDisplay::Render and VisualToolDrag::UpdateToggleButtons. Therefore, if we want to call Realize, it must be after setting VideoDisplay::tool and calling VisualTool::SetToolbar. Otherwise, the first will cause an infinite recursion from if(!tool) condition in VideoDisplay::Render, the latter will cause NULL dereference (because VisualToolDrag::toolbar is not set yet).

On the other hand, we do not need to call Realize here at all. If the toolbar does not show, we don't need to call Realize. If the toolbar will show, then Realize will be called by VisualTool after adding their buttons, in VisualTool::SetToolbar.

So we remove the Realize() call from VideoDisplay::SetTool.

Fix wangqr/Aegisub#21
Fix wangqr/Aegisub#44
2020-05-06 20:13:04 -04:00
wangqr ac88eadd78 Use wxGenericStaticBitmap on wxOSX>=3.1.0 to get mouse event
See https://trac.wxwidgets.org/ticket/18545
Fix wangqr/Aegisub#45
2020-05-06 15:32:54 -04:00
wangqr 839dcc5aed Handle @loader_path in libboost on macOS
See wangqr/Aegisub#39
2020-05-06 13:14:06 -04:00
wangqr f501567e2d Use native color depth for audio rendering
See wangqr/Aegisub#39
2020-05-06 12:48:56 -04:00
wangqr 5dd58aca8b Add write permission before install_name_tool when doing osx-bundle
Fix wangqr/Aegisub#39
2020-04-14 10:28:15 -04:00
wangqr b92a2593cb Expand all widgets in SubsEditBox to get a consistent height 2020-04-10 09:51:08 -04:00
wangqr c1dca9cb1f Remove icon size option from Windows
Windows now always use the default size, with correct HiDPI handling
2020-04-10 00:04:06 -04:00
wangqr 55f379e229 Add required windows macro for Boost::asio 2020-04-09 22:00:19 -04:00
wangqr 76f4b3aaa2 CMake: Remove /MP to support Ninja build 2020-04-09 21:59:27 -04:00
wangqr cdebf5f3d4 Handle long path in GDI font lister 2020-04-09 11:03:23 -04:00
Ryan Lucia a281285615 Set visual tool default feature color correctly
Fixes TypesettingTools/Aegisub#50
2020-04-08 18:10:52 -04:00
wangqr 0e01f053e2 Fix touch date issue in setup.ps1 2020-04-03 22:21:38 -04:00
wangqr 638f1eb99e Detect byte order
Since uchardet does not do that for us

Fix wangqr/Aegisub#38
2020-04-03 22:21:00 -04:00
wangqr 799d96602d Fix uchardet enable macro
It should be applied to libaegisub
2020-04-03 22:19:25 -04:00
wangqr 01f6e86901 Modernize CMake (part 2) 2020-03-31 02:26:31 -04:00
wangqr c0c2a9100d Modernize CMake (part 1) 2020-03-30 20:32:16 -04:00
wangqr 5318838b93 Migrate tests/setup.bat to PowerShell
Removed set / ping hacks
2020-03-29 22:25:15 -04:00
wangqr 62708e8e5c Ensure stdcall on XAudio2 callback
Fix for x86 build
2020-03-29 22:18:49 -04:00
wangqr 4b096e6c6e Merge branch 'dev-small-changes' into dev 2020-03-20 20:15:18 -04:00
wangqr ef99ce14fd Detect iconv type at compile time instead of project generation 2020-03-20 08:03:44 -04:00
wangqr 88c486aca4 Change default audio output to XAudio2 on Windows
Downmix defaults to disabled on non-Windows OSes, because we don't support non-mono output at the moment
2020-03-20 04:13:41 -04:00
wangqr 3351235434 Move macOS specific build issue to Wiki 2020-03-14 01:00:44 -04:00
wangqr 64d0f86d8d Add git_version.h generation to CMake 2020-03-11 17:07:33 -04:00
wangqr 3394f22a93 Expand layer SpinCtrl a little
to compensate wxMac bug with GetSizeFromText
2020-03-10 01:16:28 -04:00
wangqr f71919f2ae Fix missing config option for Align on macOS 2020-03-09 21:02:33 -04:00
wangqr b6b21930fa Use homebrew addon instead of manually executing 2020-03-09 20:23:48 -04:00
wangqr 7cad0e06f9 Remove redundant email notification 2020-03-09 20:01:24 -04:00
wangqr 3096376ee6 Revert special naming for LuaJIT shared object
This was a hack on macOS when LuaJIT is dynamic only, and no longer needed as we are also using static LuaJIT on macOS now
2020-03-09 19:56:24 -04:00
wangqr 460cf9a9fd Drop support for macOS < 10.10
They are less than 2.4% in all macOS and 0.2% in all OS
2020-03-09 19:50:56 -04:00
wangqr db855e8cf5 Fix Travis warning 2020-03-09 19:47:07 -04:00
wangqr ed83c39807 Add back unit test to macOS
This reverts commit 272c2f48f1.
2020-03-09 17:36:52 -04:00
wangqr 52032dc14b Upgrade LuaJIT to 2.1.0-beta3 2020-03-09 13:01:09 -04:00
wangqr 3a50ba0386 Fix osx-fix-libs.py
Create symbolic links, to make libicu happy
Rewrite the script in python3, as python2 is deprecated
2020-03-08 19:17:53 -04:00
C.W. Betts e7b64aa741 Poke the OS X icons.
More recent versions of OS X caused the old icons to display incorrectly/as garbage.
2020-03-08 17:48:52 -04:00
wangqr 8034fbbd22 Fix missing config option 2020-03-08 03:36:46 -04:00
wangqr 272c2f48f1 Ignore unit tests on macOS for now 2020-03-08 03:24:04 -04:00
wangqr b557dfcb6e Update build instructions in README
CMake is not tested on macOS now, so don't include it in README. Be more specific on where to find dependencies.
2020-03-08 03:06:04 -04:00
wangqr 3556c9629e Remove IME handling code for Scintilla
The code was for wxCocoa, which is a dead implementation of wxWidgets. wxOSX/Cocoa does not need this hack anymore. And the code is causing linking errors due to using private structures in wxCocoa.

Revert fffb138b81
2020-03-08 01:48:58 -05:00
wangqr f8bd53c479 Add macOS to travis 2020-03-08 01:37:27 -05:00
wangqr 50f63a54d0 Rewrite build instructions 2020-03-07 20:10:45 -05:00
wangqr 6cad7c3d6c Fix build issue with AviSynth on linux 2020-03-06 16:18:52 -05:00
wangqr 6bd3f4c26b Use target name without directory in $*_OBJ macro
Fix Aegisub/Aegisub#171
2020-02-17 15:08:29 +08:00
wangqr cd7ee8d505 Use the first matched font in GDI font lister
Previously, when reading font data, we only set FaceName to the matched font. When we are using some font with special font weight (e.g. @Source Han Sans J Heavy), if we do not correct the font weight in the LOGFONTW struct, then subsequent call to get_font_data will fall back to default font. This causes wrongly matching Arial.ttf to any font that does not provide standard font weights.

Instead of only correcting FaceName using the matched font, we simply use the first matched font, thus the FaceName, Weight, CharSet, etc. will all be correct. This also eliminates the memcpy.
2020-01-05 17:12:02 -05:00
wangqr cb77c0b395 Add option to downmix FFMS audio
When enabled, restore FFMS to old behavior, downmixing auduo to S16 mono. This can reduce cache usage.

Fix wangqr/Aegisub#31
2019-12-26 17:31:59 -05:00
wangqr 80ef2fbf35 Submit "align to video" on double click
Fix wangqr/Aegisub#34
2019-12-25 18:38:42 -05:00
wangqr 20fc9043e8 Don't shrink the size of layer SpinCtrl on GTK3 2019-11-21 23:04:51 -05:00
wangqr a520f8a4a3 Rerender video display after EVT_PAINT
Otherwise the video display will be blank after restore from minimized.
2019-11-10 23:17:43 -05:00
wangqr 1bda6052b6 Use GetSizeFromText instead of GetSizeFromTextSize(GetTextExtent) 2019-11-07 16:06:53 -05:00
wangqr 557e81be1d VideoDisplay: Move render code to render callback
Previously, Render is called every time when the content is updated from event callbacks. So simply moving the mouse around will spam the event queue and cause video stuck. Now we do render in render callback, and only set a flag to indicate the need of re-render.
2019-11-04 07:03:45 -05:00
wangqr f2676ddc3a Avisynth audio provider: add option to allow no downmix 2019-11-02 22:26:02 -04:00
Charlie Jiang a2fc4bf479 🐛 Fix: lagi: Don't close iconv_t if it is iconv_invalid
When certain iconv_t is invalid, iconv_invalid(0xfffffffffffffffffffffff) will be returned. Passing it to iconv_close will cause a SIGSEGV.
2019-11-02 21:23:27 -04:00
wangqr 71894fd769 Fix bugs in ram audio provider
There was some magic bit operations to calculate the cache block offsets. This only works when both bytes_per_sample and channels are power of 2. Originally the format is assumed to be int16 mono, which satisfies this requirement. However in case we use original audio data, the channels can be something not a power of 2 (e.g. for 5.1 channel audio the number of channels is 6). This will break the calculation. We rewrite the calculation, without using those bit operations.
2019-11-02 02:26:36 -04:00
wangqr 56434c5f58 Fix bugs in separating Int16Mono and original audio
* A memory leak in FillBufferInt16Mono
* A now unnecessary assert
2019-11-02 00:41:14 -04:00
Luke Gorrie 45cd713ef9 lj_str.c: Remove special-case string interning fastpath
lj_str_new() had a separate fast-path and slow-path. This was bad
because (a) the fast-path was complex and (b) the fast-path was
actually slower than the slow-path in practice and (c) in practice it
could cause confusing performance problems depending on the memory
alignment of any often-reused string buffers in a program.

This change specifically makes the 'life' benchmark faster and more
robust to memory layout.
2019-11-02 00:23:50 -04:00
wangqr 29fd12258f Fix lint warnings about unexpected */
Introduced in b86238456f
2019-11-02 00:23:50 -04:00
wangqr b947116937 Separate XAudio2 from DirectSound in preference and CMake 2019-11-02 00:23:50 -04:00
wangqr 309996aeb2 Remove the usage of __FILE__
Prepare for reproducible build
2019-11-02 00:23:44 -04:00
wangqr 2929b9db37 XAudio2: Try orignal sound format first, and fallback to 16bit mono on failure 2019-11-01 21:58:11 -04:00
wangqr 2ca9cf0de0 Fix unit tests
As we have removed the int16 convert and downmix related stuff.
2019-11-01 04:12:35 -04:00
wangqr 0336779735 Added experimental XAudio2 audio player
Removed downsampling in FFMS2 and CreateConvertAudioProvider, to ensure we can get the original audio channels and data.

Fix Aegisub/Aegisub#160
2019-11-01 03:32:42 -04:00
wangqr b86238456f Change channels number and bytes per second to hardcoded value
Because these audio players can only handle 16bit mono anyway.
2019-10-30 01:16:28 -04:00
wangqr 620033915a Handle channel > 1 in hd & ram cache audio provider 2019-10-30 00:47:45 -04:00
wangqr c1a4e0674b Move the ConvertAudioProvider into GetInt16MonoAudio function
And use a dummy ConvertAudioProvider to keep backward compatibility.
2019-10-30 00:19:10 -04:00
wangqr 24d52bb1ee Clearly state int16 Mono of the audio provider in function name
Most code assumes the audio provider is providing int16 single channel audio data, without actually checking them. In this commit, we add a new function to provide the needed int16 mono data with checking.
2019-10-29 21:45:40 -04:00
wangqr 7c5cac0316 Remove hardcoded height of the slider
Before this the slider is only partially displayed
2019-10-28 20:45:29 -04:00
wangqr 5fc01de1e5 Fix rotation degree calculation 2019-10-28 20:21:02 -04:00
wangqr bd7a7ac551 Remove duplicated version check 2019-10-28 11:22:24 -04:00
wangqr 41c0e49813 Only expand thumb at Paint
This will give a more natural indication of where the position is. When dragging with mouse, now the thumb block will always center under the mouse position.

Fix wangqr/Aegisub#26
2019-10-26 02:44:40 -04:00
wangqr f74b3acd0e Revert "Remove unused adv dependency"
This reverts commit ea4010dcbe.
adv is required for Sash and DataViewCtrl
2019-10-17 16:40:27 -04:00
wangqr 41bb13cff2 Fix FromUTF8 usage with wxWidgets 3.0 2019-10-17 16:14:21 -04:00
wangqr f92abc863e Remove exception in destructor of agi::io::Save
Provide Close() for error handling
Correctly parse boost error code
Handle failure in TextFileWriter

Fix wangqr/Aegisub#25
2019-10-17 03:29:59 -04:00
Thomas Goyne b2be79366e Adjust the index of the drag subtool button for the addition of the separator 2019-10-16 11:10:13 -04:00
wangqr ea4010dcbe Remove unused adv dependency 2019-10-05 09:53:07 -04:00
scx 8db6c60bc3 Update desktop file
- Add Keywords
 - Add StartupWMClass
 - Update Categories
2019-09-25 17:25:38 -04:00
wangqr 0e29c8d0e4 Modify make_pot to use xgettext instead of grep
To match the change in af5060d6a3
2019-09-25 17:23:10 -04:00
wangqr 0fbcaea871 Fix make_pot.sh 2019-09-25 16:59:34 -04:00
wangqr 7c76136726 fix: infinite recursion when loading video
In 888be0607f some changes have been made to video_display.cpp which causes infinite recursion: the video display enables video/tool/cross tool when running VideoDisplay::Render() for the first time.
But when setting up the tool, the video box size is changed, which calls VideoDisplay::Render() again. So we need to set the tool BEFORE it modifies the box by "AddSeparator".

Fix wangqr/Aegisub#21

Co-authored-by: Charlie Jiang <cqjjjzr@126.com>
2019-09-23 11:58:51 -04:00
darealshinji d708f3ecd8 don't be too pedantic on the OpenAL checks 2019-09-22 20:12:00 -04:00
Yakauleu Uladzislau 22063d7e6b Added Belarusian Localization 2019-09-22 20:09:12 -04:00
wangqr 3c2414c0df Handle video flip and rotate metadata in ffms2
Fix Aegisub/Aegisub#149
2019-09-22 15:12:18 -04:00
wangqr 9c95e81784 Add gcc-9 to travis 2019-09-21 04:16:15 -04:00
wangqr 716549f2c9 Fix lagi_thes unit tests on Windows
The thes file was using \r\n line ends, and \r was not stripped, causing the encoding string has a \r at its end.
Use binary mode and always use \n as line ends.
2019-09-18 18:11:18 -04:00
wangqr d5eba08cbe Add workaround for wrong initial wxTextCtrl size in about dialog
See https://trac.wxwidgets.org/ticket/18507

Fix wangqr/Aegisub#19
2019-09-17 20:25:50 -04:00
wangqr af5060d6a3 Fix msgfmt missing LINGUAS 2019-09-15 21:06:39 -04:00
wangqr e51b93683d In Properties dialog, create the button first
So the foucus goes to the OK button on init. This will let wxWidgets correctly handle the initial position of text in wxTextCtrl

Fix wangqr/Aegisub#6
2019-09-15 19:46:53 -04:00
wangqr f1ef3d2d2c Fix PCM provider bugs 2019-09-15 19:46:43 -04:00
wangqr a4d49c66d0 Fix failing unit tests on Windows 2019-09-15 00:45:25 -04:00
wangqr 7a8e2ec816 Fix gtest setup.bat on Windows 2019-09-14 21:11:03 -04:00
wangqr 186c98308e Use gettext for desktop file instead of intltool 2019-09-13 17:59:38 -04:00
wangqr 7c500a096a Search user fonts in GDI font lister
Windows now allow user install fonts without admin. List HKCU for those fonts.
https://blogs.windows.com/windowsexperience/2018/06/27/announcing-windows-10-insider-preview-build-17704/
2019-09-13 15:49:15 -04:00
wangqr bd4c7789cf Add openal and CMake test to travis 2019-09-12 02:42:11 -04:00
wangqr 3eff75d56e In tagless_find_helper only tag before start should be ignored
The search result is irrelevant to which tag we should ignore

Fix wangqr/Aegisub#17
2019-09-11 11:29:20 -04:00
wangqr da699f124e Fix wrong memset usage 2019-09-10 02:15:48 -04:00
wangqr 1204a3be85 Cleanup CMake 2019-09-10 01:37:48 -04:00
wangqr 9e6b7e94c0 Fix crash in cache invalidation
The original version uses a reverse iterator, whose .base() is invalid after KillMacroBlock() erases it.

Fix TypesettingTools/Aegisub#33
Fix Aegisub/Aegisub#142
2019-09-08 13:01:55 -04:00
davste0816 ad02d39f44 Fix Move Down button in Export dialog 2019-09-08 11:37:52 -04:00
davste0816 d914ad72b5 Add .webm to extension list, add .eac3 as an audio format
Co-Authored-By: FichteFoll <fichtefoll2@googlemail.com>
2019-09-08 11:37:52 -04:00
davste0816 055aa379e5 Recognize .opus as an audio format, .h264 .hevc as video formats 2019-09-08 11:37:45 -04:00
wangqr 97792e15a8 Add WITH_* switchs to CMake to optional features 2019-09-08 07:12:19 -04:00
wangqr 4a874de442 Fix missing autopoint 2019-09-08 05:53:48 -04:00
scx 5d14137710 make_pot.sh: Check presence of xmlstarlet and jq 2019-09-08 04:35:05 -04:00
scx d252dcf32d Integrate AppData file with build system 2019-09-08 04:35:05 -04:00
scx 4f351b8b4a Add AppData file template 2019-09-08 04:35:05 -04:00
scx c4e0f40370 Fix compiler flags
http://devel.aegisub.org/ticket/1899
http://devel.aegisub.org/ticket/1900
https://github.com/Aegisub/Aegisub/pull/29
2019-09-08 02:25:56 -04:00
scx 05c0ba0e46 Add missing AM_GNU_GETTEXT_VERSION macro
Bug: http://devel.aegisub.org/ticket/1914
2019-09-08 02:22:51 -04:00
wangqr e4e04c9e87 Stop using deprecated hunspell API 2019-09-08 00:29:41 -04:00
wangqr 81160b2ec0 Remove conflicting glext.h 2019-09-07 22:29:23 -04:00
wangqr bf28e7efc3 Add PulseAudio to cmake 2019-09-07 12:35:27 -04:00
wangqr c2c44f1ad2 Fix build warnings
For pimpl with anonymous namespace, see https://stackoverflow.com/questions/39684438
2019-09-07 01:31:16 -04:00
wangqr 5dd201bc2d Update README.md and prepare for release 2019-09-05 22:16:58 -04:00
wangqr 3663d118b6 Separate desktop template for CMake
So it does not affect the translation
2019-09-04 22:46:29 -04:00
wangqr 60a722db31 Don't internally reset the selection after collected fonts
This creates an inconsistency between UI and internal mode.

Fix wangqr/Aegisub#10
2019-09-03 11:58:20 -04:00
wangqr d65643ddee Remove extra semicolon 2019-09-02 22:23:19 -04:00
wangqr fbca222295 Add back original travis tests 2019-09-02 22:06:41 -04:00
wangqr 3225ae39f4 Fix Makefile build
A missing header (acconf.h) issue was introduced in 34575a9786
In 419386aadd, some new source files have been added but not added to the file list in Makefile
2019-09-02 13:46:50 -04:00
wangqr 888be0607f visualSubToolBar now use same style as other toolbars
Previously visualSubToolBar has boarder while visualToolBar does not. So the width of the toolbar will change when toggling visualSubToolBar.

Now we remove the boarder so they have the same width. A separator is added at the top of visualToolBar instead to provide visual cue.

Fix wangqr/Aegisub#11
2019-09-01 22:55:13 -04:00
scx 4200b85fb4 Fix crashing when picking language
Aegisub crashes immediately after selecting any language
from the end of the list (above the 100th position).
This is because it can support no more than 100 languages.
This patch extends this limit up to 1000 languages (locales).

Fixes Aegisub/Aegisub#131
2019-09-01 19:17:35 -04:00
wangqr 0b8b286767 Fix crash on right click due to no spell checker 2019-09-01 19:15:28 -04:00
wangqr 139132a964 Use AviSynth from system 2019-09-01 19:15:21 -04:00
wangqr 4a3689d6e7 Remove the trailing period in help text of time/align
Fix wangqr/Aegisub#7
2019-08-24 02:10:08 -04:00
wangqr 248e69a9b6 Use absolute distance when scrolling audio box with mouse wheel
Instead of 1/3 screen per tick. So the distance of scroll no longer depends on the width of the audio box. Besides, 1/3 is feels to far for me when the audio box is wide.

See wangqr/Aegisub#5
2019-08-24 01:16:18 -04:00
wangqr 46474e0319 Set the height of sub box to the same as secondary_editor
The secondary_editor is a wxTextCtrl, whose height is calculated from 2 rows of text. Using this height gives better consistency on screens with different DPIs, instead of using hard coded value like 50px
2019-08-24 01:12:16 -04:00
wangqr 50544cf749 Set the height of sub box back to 50px
Revert the change made in ad15c53fb1.
As a temporary solution for wangqr/Aegisub#4.
2019-08-18 22:25:50 -04:00
wangqr e9a68f22b9 Remove the usage of dummy wxTimerEvent 2019-07-24 09:11:17 -04:00
wangqr d6ddea0f65 Detect EBML magic number to skip encoding detection for MKV
MKV loads slow after f733297499
2019-06-16 19:16:31 -04:00
wangqr 2bbed6c5a0 Load audio when video is successfully loaded
Fix bug introduced in 8f40ca44ce
2019-06-06 16:32:26 -04:00
wangqr 592250eeaa Remove call to wxSizer::CalcMin and wxSizer::RecalcSizes
As they are used internally by Layout and should not be called
directly.
2019-06-06 15:24:40 -04:00
wangqr 8f40ca44ce Try auto loading audio from video only when actually loading a video
If the user drop some files into Aegisub, we try to load sub, video,
audio, etc from them. When "Automatically open audio when opening
video" is checked in config, we try to load audio from the path of
the video. This should only be done if the video is newly loaded. So
we should never try to load audio from video if the user is just
opening a subtitle.

See https://github.com/Aegisub/Aegisub/issues/121#issuecomment-498489847
2019-06-06 14:31:07 -04:00
wangqr f776db2d2b Change the default fontsize and the list of resolutions
The default fontsize is changed to 48. While it still looks small
on the default 720p video, it is actually bigger than
    20 / 480 * 720 = 30

Here 720p is the default video resolution after 837d5a41d7. Some
common resolutions are also added to the preset list.

Fix wangqr/Aegisub#3
2019-06-03 22:08:11 -04:00
wangqr f9ffc46bf6 Add linux desktop icon 2019-05-22 20:45:51 -04:00
wangqr 019e68147e Fix FFT first sample location
Fix wangqr/Aegisub#1
2019-05-22 20:10:09 -04:00
wangqr f733297499 Rewrite encoding detection
Now feeds all data to uchardet, when uchardet is available. The file
size limit is removed.

When uchardet is not available, we look for UTF-8 BOM.
This should make loading UTF-8-BOM files faster.
Because Aegisub always save file in UTF-8-BOM, this should also
guarentee Aegisub will load large (>100MB) file saved by itself.

See Aegisub/Aegisub#110
2019-05-18 22:13:26 -04:00
wangqr 4c6d370d51 Add install target 2019-05-18 20:10:18 -04:00
wangqr b7c640d061 Fix High DPI issue on GTK
* Use icon size in the config
2019-05-17 13:58:14 -04:00
wangqr 2c06f03f5b Add AviSynth support 2019-05-16 11:07:57 -04:00
wangqr 1819fc8d8b Fix iconv ConversionFailure on long path 2019-05-16 11:04:53 -04:00
wangqr ba54e8d12f Fix build warnings 2019-05-11 21:36:34 -04:00
Ryan Lucia c76e410d30 Divorce stored TPP lead-in/out values from config
There's no real reason to link these as far as I can tell, and plenty of
valid reasons not to
2019-05-11 20:04:29 -04:00
Ryan Lucia bb2cfb1fcd Properly ignore ASS whitespace characters in character counter 2019-05-11 20:00:49 -04:00
Ryan Lucia 9abcc03202 Add configuration options for colors in visual typesetting tools 2019-05-11 19:43:54 -04:00
Ryan Lucia 837d5a41d7 Update default config to modern standards 2019-05-11 19:38:10 -04:00
Ryan Lucia 875456c803 Use FFMS2 constant in place of magic number 2019-05-10 15:22:26 -04:00
Ryan Lucia 9ddecfdd46 Ignore VS build files
Most files were moved to .vs directory with VS15
2019-05-10 15:17:19 -04:00
Ryan Lucia 70f27eae4b Pass 0 to FFMS_Init
The argument is no longer used, and the docs specify to pass a value of 0 to avoid confusion
2019-05-10 15:12:55 -04:00
Ryan Lucia 8d2ef3fca7 Point users at a functional bug tracker 2019-05-10 15:09:25 -04:00
Ryan Lucia 48869ae0ad Fix line order when splitting after current frame 2019-05-10 15:09:05 -04:00
Ryan Lucia b00285cf71 Use proper event for DoubleUpdater
Previously changes weren't recognized because the event bound was for integers
2019-05-10 15:06:01 -04:00
Ryan Lucia c6c9e05406 Remove dead forums link 2019-05-10 15:05:18 -04:00
Ryan Lucia fc1a78aeca Make translation assistant skipping whitespace an explicit setting 2019-05-10 15:04:48 -04:00
Ryan Lucia 38bb1790ab Remove Force BT.601 option and update color matrix guessing 2019-05-10 15:03:20 -04:00
Ryan Lucia fff08c4650 Add support for setting status bar text from Lua 2019-05-10 14:54:05 -04:00
wangqr 163d57d6a2 Fix LuaJIT segfault 2019-05-09 21:36:11 -04:00
wangqr 6266867586 Fix errors in AlignToVideo
* Call TimeAtFrame with correct parameter
* Fix syntax error
2019-05-09 16:54:20 -04:00
wangqr 4431f678ce Update about dialog 2019-05-09 16:30:38 -04:00
Charlie Jiang 419386aadd Merge remote-tracking branch 'origind-dev/master'
Add align to video function
2019-05-09 16:26:08 -04:00
wangqr c4cce28766 Update README to use CMake 2019-05-08 22:49:53 -04:00
wangqr 1ae2f60b9a Fix CMake build errors 2019-05-08 17:09:29 -04:00
wangqr b6eebcd7ef Fix build warnings 2019-05-08 17:09:07 -04:00
wangqr bf55264e6d Fix VS2019 compile issues 2019-05-08 16:34:53 -04:00
wangqr 34575a9786 Migrate to CMake to update packages easier 2019-05-08 16:34:39 -04:00
wangqr 69310d40ae Correctly handle memory free using Lua GC
Instead of manually free. Otherwise return value of `search' may refer to invalid memory.
Fix Aegisub/Aegisub#99
2019-03-15 00:01:29 -04:00
wangqr 657d9d5149 Bump boost version to 1.69.0
Fix Aegisub/Aegisub#93
2019-03-14 23:58:28 -04:00
wangqr 043a45cf91 Add DPI aware to Aegisub manifest 2018-12-08 01:20:08 -05:00
wangqr ad15c53fb1 Add DPI awareness
* Removed most hard coded wxSize
* Sub edit box now have DPI aware icons
2018-12-08 01:20:08 -05:00
wangqr 841a35a6fd Fix overflow bound 2018-12-08 01:20:08 -05:00
wangqr ee7dc6af4e Fix millisecond to centisecond convertion
Fix Aegisub/Aegisub#94
2018-12-08 01:20:08 -05:00
wangqr 77da2436c5 Change some text box size to make it looks better on HiDPI 2018-12-08 01:20:08 -05:00
wangqr 7be2325629 Fix travis-ci build script 2018-12-08 00:48:00 -05:00
776 changed files with 251450 additions and 346125 deletions

6
.gitignore vendored
View File

@ -5,6 +5,7 @@
*.bz2
*.cache
*.dep
*.db
*.dll
*.dmg
*.exe
@ -14,13 +15,13 @@
*.ilk
*.log
*.manifest
!src/dpi_aware.manifest
*.mkv
*.mo
*.ncb
*.obj
*.opensdf
*.orig
*.patch
*.pch
*.pdb
*.profdata
@ -63,6 +64,8 @@ git_version.h
git_version.xml
packages/desktop/aegisub.desktop
packages/desktop/aegisub.desktop.template
packages/desktop/aegisub.appdata.xml
packages/desktop/aegisub.appdata.xml.template
src/aegisub
src/libresrc/bitmap.cpp
src/libresrc/bitmap.h
@ -86,3 +89,4 @@ vendor/luajit/src/lj_vm.s
vendor/luajit/src/luajit
.nuget
.vs

38
.gitmodules vendored
View File

@ -1,42 +1,4 @@
[submodule "freetype2"]
path = vendor/freetype2
url = git://git.sv.nongnu.org/freetype/freetype2.git
ignore = dirty
[submodule "wxWidgets"]
path = vendor/wxWidgets
url = git://github.com/Aegisub/wxWidgets.git
ignore = dirty
[submodule "googletest"]
path = vendor/googletest
url = git://github.com/svn2github/googletest.git
ignore = dirty
[submodule "ffmpeg"]
path = vendor/ffmpeg
url = git://source.ffmpeg.org/ffmpeg.git
ignore = dirty
[submodule "ffms2"]
path = vendor/ffms2
url = git://github.com/FFMS/ffms2.git
branch = master
ignore = dirty
[submodule "libass"]
path = vendor/libass
url = git://github.com/libass/libass.git
branch = master
[submodule "icu"]
path = vendor/icu
url = git://github.com/svn2github/icu4c.git
branch = master
ignore = dirty
[submodule "boost"]
path = vendor/boost
url = https://github.com/boostorg/boost.git
ignore = dirty
[submodule "fftw"]
path = vendor/fftw
url = https://github.com/Aegisub/fftw3.git
ignore = dirty
[submodule "uchardet"]
path = vendor/uchardet
url = https://github.com/BYVoid/uchardet
ignore = dirty

View File

@ -1,5 +1,5 @@
sudo: required
dist: trusty
os: linux
dist: bionic
language: cpp
git:
@ -8,61 +8,97 @@ git:
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- libasound2-dev
- libfftw3-dev
- libhunspell-dev
- yasm
- libfribidi-dev
- libass-dev
- libicu-dev
- luarocks
- g++-5
- cmake
- build-essential
- libboost-all-dev
- libffms2-dev
- libfontconfig1-dev
- libopenal-dev
- libuchardet-dev
- libwxgtk3.0-dev
- portaudio19-dev
- libpulse-dev
- autopoint
- libgtest-dev
- gcc-10
- g++-10
- python3-pip
- python3-setuptools
homebrew:
packages:
- autoconf
- boost
- ffmpeg
- ffms2
- fftw
- freetype
- fribidi
- gettext
- icu4c
- libass
- lua
- luarocks
- m4
- wxmac
- hunspell
- uchardet
update: true
matrix:
env:
- ''
- BUILD_SUIT=autotools WITH_COVERALLS=y
- CC=gcc-10 CXX=g++-10
- BUILD_SUIT=autotools CC=gcc-10 CXX=g++-10
jobs:
include:
- compiler: gcc
env: BOOST_VERSION=55
- compiler: gcc
env: BOOST_VERSION=60
before_install:
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 --slave /usr/bin/gcov gcov /usr/bin/gcov-5
- os: osx
osx_image: xcode11.5
env: BUILD_SUIT=autotools
install:
# Can't install these via the apt addon due to the whitelist
- sudo apt-get install -y -qq libffms2-dev libwxgtk3.0-dev libuchardet-dev
- sudo pip install cpp-coveralls
- sudo luarocks install busted > /dev/null
- sudo luarocks install moonscript > /dev/null
- sudo luarocks install uuid > /dev/null
- git submodule --quiet init
- git submodule --quiet update vendor/googletest
- cd vendor
- rm -rf boost
- wget http://sourceforge.net/projects/boost/files/boost/1.${BOOST_VERSION}.0/boost_1_${BOOST_VERSION}_0.tar.bz2/download
- tar xjf download
- mv boost_1_${BOOST_VERSION}_0 boost
- cd boost
- ./bootstrap.sh
- ./b2 -j3 -layout=system threading=multi cxxflags=-std=c++11 link=shared variant=release --without-python --without-iostreams --without-serialization --without-graph --without-log --without-math --without-signals --without-test --without-wave --without-mpi --without-program_options --without-graph_parallel --without-context --without-coroutine --without-random --without-timer --without-date_time
- cd ../..
- ./.travis/install.sh
script:
- export CPATH=$(pwd)/vendor/boost
- export LD_LIBRARY_PATH=$(pwd)/vendor/boost/stage/lib:$LD_LIBRARY_PATH
- export CPPFLAGS="-fprofile-arcs -ftest-coverage"
- export LIBS="-lgcov"
- autoreconf -if
- ./configure BOOST_LDFLAGS="-L$(pwd)/vendor/boost/stage/lib" --enable-debug || cat config.log
- make -j3 all test
- coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null
notifications:
email:
- on_success: change
- on_failure: change
- if [ "$TRAVIS_OS_NAME" = 'osx' ]; then
export PATH="/usr/local/opt/gettext/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:$PATH";
export CPPFLAGS="-I/usr/local/opt/gettext/include -I/usr/local/opt/icu4c/include";
export LDFLAGS="-L/usr/local/opt/gettext/lib -L/usr/local/opt/icu4c/lib";
export ACLOCAL_PATH="/usr/local/opt/gettext/share/aclocal";
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig";
./autogen.sh;
./configure --enable-debug || cat config.log;
make -j2 || travis_terminate 1;
make test || travis_terminate 1;
elif [ "$BUILD_SUIT" = 'autotools' ]; then
if [ ! -z "$WITH_COVERALLS" ]; then
export CPPFLAGS="--coverage";
export LIBS="-lgcov";
fi;
./autogen.sh;
./configure --enable-debug || cat config.log;
make -j2 || travis_terminate 1;
make test || travis_terminate 1;
else
mkdir build-dir;
cd build-dir;
cmake -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wno-unused-parameter -pedantic' -DCMAKE_C_FLAGS='-Wall -Wextra -Wno-unused-parameter' -DWITH_STARTUPLOG=ON -DWITH_TEST=ON ..;
make -j2 || travis_terminate 1;
make test || travis_terminate 1;
fi
after_success:
- if [ ! -z "$WITH_COVERALLS" ]; then
coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null;
fi

23
.travis/install.sh Executable file
View File

@ -0,0 +1,23 @@
#! /bin/bash
set -e
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
# Remove the CMake provided by travis
sudo rm -rf /usr/local/cmake*
if [ "$BUILD_SUIT" = 'autotools' ]; then
if [ ! -z "$WITH_COVERALLS" ]; then
sudo pip3 install -U cpp-coveralls
fi
git submodule --quiet init
git submodule --quiet update vendor/googletest
else
pushd /usr/src/googletest
sudo cmake .
sudo make install -j2
popd
fi
fi
sudo luarocks install busted > /dev/null
sudo luarocks install moonscript > /dev/null
sudo luarocks install uuid > /dev/null

76
CMakeLists.test.txt Normal file
View File

@ -0,0 +1,76 @@
if(UNIX)
add_executable(aegisub-lua EXCLUDE_FROM_ALL
automation/tests/aegisub.cpp
)
target_link_libraries(aegisub-lua PRIVATE libaegisub luabins luajit "Boost::locale")
add_custom_target(test-automation
COMMAND sh -c "$(luarocks path); ${PROJECT_BINARY_DIR}/aegisub-lua tests/busted.lua -p moon tests/modules"
VERBATIM
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/automation"
)
add_dependencies(test-automation aegisub-lua)
else()
add_custom_target(test-automation)
endif()
find_package(GTest)
if(GTEST_FOUND)
add_executable(gtest-run EXCLUDE_FROM_ALL
tests/tests/access.cpp
tests/tests/audio.cpp
tests/tests/cajun.cpp
tests/tests/calltip_provider.cpp
tests/tests/character_count.cpp
tests/tests/color.cpp
tests/tests/dialogue_lexer.cpp
tests/tests/format.cpp
tests/tests/fs.cpp
tests/tests/hotkey.cpp
tests/tests/iconv.cpp
tests/tests/ifind.cpp
tests/tests/karaoke_matcher.cpp
tests/tests/keyframe.cpp
tests/tests/line_iterator.cpp
tests/tests/line_wrap.cpp
tests/tests/mru.cpp
tests/tests/option.cpp
tests/tests/path.cpp
tests/tests/signals.cpp
tests/tests/split.cpp
tests/tests/syntax_highlight.cpp
tests/tests/thesaurus.cpp
tests/tests/time.cpp
tests/tests/type_name.cpp
tests/tests/util.cpp
tests/tests/uuencode.cpp
tests/tests/vfr.cpp
tests/tests/word_split.cpp
tests/support/main.cpp
tests/support/util.cpp
)
target_compile_definitions(gtest-run PRIVATE CMAKE_BUILD)
target_include_directories(gtest-run PRIVATE "${PROJECT_SOURCE_DIR}/tests/support")
target_link_libraries(gtest-run PRIVATE libaegisub "Boost::filesystem" "GTest::GTest" "Iconv::Iconv")
if(MSVC)
set_target_properties(gtest-run PROPERTIES COMPILE_FLAGS "/Yu${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h" COMPILE_FLAGS "/FI${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h")
else()
target_compile_options(gtest-run PRIVATE -include "${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h")
endif()
if(WIN32)
add_custom_target(test-aegisub
COMMAND "${PROJECT_SOURCE_DIR}/tests/setup.bat"
COMMAND gtest-run
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/tests"
)
else()
add_custom_target(test-aegisub
COMMAND "${PROJECT_SOURCE_DIR}/tests/setup.sh"
COMMAND gtest-run
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/tests"
)
endif()
else()
add_custom_target(test-aegisub)
endif()
add_custom_target(test DEPENDS test-automation test-aegisub)

786
CMakeLists.txt Normal file
View File

@ -0,0 +1,786 @@
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0074 NEW)
project(Aegisub)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Explicitly set the build type to Release if no other type is specified
# on the command line. Without this, cmake defaults to an unoptimized,
# non-debug build, which almost nobody wants.
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
add_executable(luajit-minilua vendor/luajit/src/host/minilua.c)
if(NOT WIN32)
target_link_libraries(luajit-minilua m)
endif()
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen"
COMMAND luajit-minilua ../dynasm/dynasm.lua -LN -D WIN -D JIT -D FFI -D P64 -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h" vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
else()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen"
COMMAND luajit-minilua ../dynasm/dynasm.lua -LN -D WIN -D JIT -D FFI -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h" vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen"
COMMAND luajit-minilua ../dynasm/dynasm.lua -D P64 -D JIT -D FFI -D FPU -D HFABI -D VER= -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h" vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
else()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen"
COMMAND luajit-minilua ../dynasm/dynasm.lua -D JIT -D FFI -D FPU -D HFABI -D VER= -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h" vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
endif()
endif()
add_executable(luajit-buildvm
vendor/luajit/src/host/buildvm.c
vendor/luajit/src/host/buildvm_asm.c
vendor/luajit/src/host/buildvm_peobj.c
vendor/luajit/src/host/buildvm_lib.c
vendor/luajit/src/host/buildvm_fold.c
"${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/buildvm_arch.h"
)
target_compile_definitions(luajit-buildvm PRIVATE LUAJIT_ENABLE_LUA52COMPAT)
target_include_directories(luajit-buildvm PRIVATE vendor/luajit/src "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen")
if(UNIX)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/lj_vm.s"
COMMAND luajit-buildvm -m elfasm -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/lj_vm.s"
)
elseif(MSVC)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/lj_vm.obj"
COMMAND luajit-buildvm -m peobj -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/lj_vm.obj"
)
endif()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_ffdef.h"
COMMAND luajit-buildvm -m ffdef -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_ffdef.h" lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_bcdef.h"
COMMAND luajit-buildvm -m bcdef -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_bcdef.h" lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_folddef.h"
COMMAND luajit-buildvm -m folddef -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_folddef.h" lj_opt_fold.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_recdef.h"
COMMAND luajit-buildvm -m recdef -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_recdef.h" lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_libdef.h"
COMMAND luajit-buildvm -m libdef -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_libdef.h" lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/jit/vmdef.lua"
COMMAND luajit-buildvm -m vmdef -o "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/jit/vmdef.lua" lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_library(luajit STATIC
vendor/luajit/src/lib_base.c
vendor/luajit/src/lib_math.c
vendor/luajit/src/lib_bit.c
vendor/luajit/src/lib_string.c
vendor/luajit/src/lib_table.c
vendor/luajit/src/lib_io.c
vendor/luajit/src/lib_os.c
vendor/luajit/src/lib_package.c
vendor/luajit/src/lib_debug.c
vendor/luajit/src/lib_jit.c
vendor/luajit/src/lib_ffi.c
vendor/luajit/src/lj_gc.c
vendor/luajit/src/lj_err.c
vendor/luajit/src/lj_char.c
vendor/luajit/src/lj_bc.c
vendor/luajit/src/lj_obj.c
vendor/luajit/src/lj_buf.c
vendor/luajit/src/lj_str.c
vendor/luajit/src/lj_tab.c
vendor/luajit/src/lj_func.c
vendor/luajit/src/lj_udata.c
vendor/luajit/src/lj_meta.c
vendor/luajit/src/lj_debug.c
vendor/luajit/src/lj_state.c
vendor/luajit/src/lj_dispatch.c
vendor/luajit/src/lj_vmevent.c
vendor/luajit/src/lj_vmmath.c
vendor/luajit/src/lj_strscan.c
vendor/luajit/src/lj_strfmt.c
vendor/luajit/src/lj_strfmt_num.c
vendor/luajit/src/lj_api.c
vendor/luajit/src/lj_profile.c
vendor/luajit/src/lj_lex.c
vendor/luajit/src/lj_parse.c
vendor/luajit/src/lj_bcread.c
vendor/luajit/src/lj_bcwrite.c
vendor/luajit/src/lj_load.c
vendor/luajit/src/lj_ir.c
vendor/luajit/src/lj_opt_mem.c
vendor/luajit/src/lj_opt_fold.c
vendor/luajit/src/lj_opt_narrow.c
vendor/luajit/src/lj_opt_dce.c
vendor/luajit/src/lj_opt_loop.c
vendor/luajit/src/lj_opt_split.c
vendor/luajit/src/lj_opt_sink.c
vendor/luajit/src/lj_mcode.c
vendor/luajit/src/lj_snap.c
vendor/luajit/src/lj_record.c
vendor/luajit/src/lj_crecord.c
vendor/luajit/src/lj_ffrecord.c
vendor/luajit/src/lj_asm.c
vendor/luajit/src/lj_trace.c
vendor/luajit/src/lj_gdbjit.c
vendor/luajit/src/lj_ctype.c
vendor/luajit/src/lj_cdata.c
vendor/luajit/src/lj_cconv.c
vendor/luajit/src/lj_ccall.c
vendor/luajit/src/lj_ccallback.c
vendor/luajit/src/lj_carith.c
vendor/luajit/src/lj_clib.c
vendor/luajit/src/lj_cparse.c
vendor/luajit/src/lj_lib.c
vendor/luajit/src/lj_alloc.c
vendor/luajit/src/lib_aux.c
vendor/luajit/src/lib_init.c
"${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_ffdef.h"
"${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_bcdef.h"
"${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_folddef.h"
"${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_recdef.h"
"${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen/lj_libdef.h"
# "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/jit/vmdef.lua"
)
target_compile_definitions(luajit PRIVATE LUAJIT_ENABLE_LUA52COMPAT)
target_include_directories(luajit PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/gen" PUBLIC "vendor/luajit/src")
if(WIN32)
target_sources(luajit PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/lj_vm.obj")
else()
target_sources(luajit PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/lj_vm.s")
set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/vendor/luajit/src/lj_vm.s" PROPERTY LANGUAGE C)
target_link_libraries(luajit ${CMAKE_DL_LIBS})
endif()
add_subdirectory(vendor/luabins)
add_library(libaegisub STATIC
libaegisub/common/parser.cpp
libaegisub/ass/dialogue_parser.cpp
libaegisub/ass/time.cpp
libaegisub/ass/uuencode.cpp
libaegisub/audio/provider.cpp
libaegisub/audio/provider_convert.cpp
libaegisub/audio/provider_dummy.cpp
libaegisub/audio/provider_hd.cpp
libaegisub/audio/provider_lock.cpp
libaegisub/audio/provider_pcm.cpp
libaegisub/audio/provider_ram.cpp
libaegisub/common/cajun/elements.cpp
libaegisub/common/cajun/reader.cpp
libaegisub/common/cajun/writer.cpp
libaegisub/lua/modules/lfs.cpp
libaegisub/lua/modules/re.cpp
libaegisub/lua/modules/unicode.cpp
libaegisub/lua/modules/lpeg.c
libaegisub/lua/modules.cpp
libaegisub/lua/script_reader.cpp
libaegisub/lua/utils.cpp
libaegisub/common/calltip_provider.cpp
libaegisub/common/character_count.cpp
libaegisub/common/charset.cpp
libaegisub/common/charset_6937.cpp
libaegisub/common/charset_conv.cpp
libaegisub/common/color.cpp
libaegisub/common/file_mapping.cpp
libaegisub/common/format.cpp
libaegisub/common/fs.cpp
libaegisub/common/hotkey.cpp
libaegisub/common/io.cpp
libaegisub/common/json.cpp
libaegisub/common/kana_table.cpp
libaegisub/common/karaoke_matcher.cpp
libaegisub/common/keyframe.cpp
libaegisub/common/line_iterator.cpp
libaegisub/common/log.cpp
libaegisub/common/mru.cpp
libaegisub/common/option.cpp
libaegisub/common/option_value.cpp
libaegisub/common/path.cpp
libaegisub/common/thesaurus.cpp
libaegisub/common/util.cpp
libaegisub/common/vfr.cpp
libaegisub/common/ycbcr_conv.cpp
libaegisub/common/dispatch.cpp
)
if(UNIX)
target_sources(libaegisub PRIVATE
libaegisub/unix/access.cpp
libaegisub/unix/fs.cpp
libaegisub/unix/log.cpp
libaegisub/unix/path.cpp
libaegisub/unix/util.cpp
)
set_property(
SOURCE libaegisub/unix/path.cpp
PROPERTY COMPILE_DEFINITIONS
P_DATA="${CMAKE_INSTALL_PREFIX}/share/aegisub/"
)
elseif(WIN32)
target_sources(libaegisub PRIVATE
libaegisub/windows/access.cpp
libaegisub/windows/charset_conv_win.cpp
libaegisub/windows/fs.cpp
libaegisub/windows/lagi_pre.cpp
libaegisub/windows/log_win.cpp
libaegisub/windows/path_win.cpp
libaegisub/windows/util_win.cpp
)
endif()
set_target_properties(libaegisub PROPERTIES PREFIX "")
target_compile_definitions(libaegisub PRIVATE CMAKE_BUILD)
target_include_directories(libaegisub PUBLIC "libaegisub/include")
target_precompile_headers(libaegisub PRIVATE "libaegisub/lagi_pre.h")
target_link_libraries(libaegisub PRIVATE luajit luabins)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/src/libresrc/default_config.cpp" "${CMAKE_CURRENT_BINARY_DIR}/src/libresrc/default_config.h"