Commit graph

654 commits

Author SHA1 Message Date
wangqr 6cad7c3d6c Fix build issue with AviSynth on linux 2020-03-06 16:18:52 -05: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
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
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 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 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 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 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
wangqr 3c2414c0df Handle video flip and rotate metadata in ffms2
Fix Aegisub/Aegisub#149
2019-09-22 15:12: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 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 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 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
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
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 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 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 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