Commit Graph

677 Commits

Author SHA1 Message Date
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 e53bdd32d7 Save state of "show original" for osx
Fix wangqr/Aegisub#47
2020-05-27 03:15:59 -04:00
wangqr 333f928019 Save state of "show original"
Fix wangqr/Aegisub#41
2020-05-17 23:36:52 -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 f501567e2d Use native color depth for audio rendering
See wangqr/Aegisub#39
2020-05-06 12:48:56 -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 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 c0c2a9100d Modernize CMake (part 1) 2020-03-30 20:32:16 -04:00
wangqr 62708e8e5c Ensure stdcall on XAudio2 callback
Fix for x86 build
2020-03-29 22:18:49 -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 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 8034fbbd22 Fix missing config option 2020-03-08 03:36:46 -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 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