Commit Graph

694 Commits

Author SHA1 Message Date
wangqr 7e3a0fb926 FFMS actually can be used without cache 2020-07-20 21:38:08 -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 79a71c3176 Fix syntax error in e2ea84541f 2020-07-17 12:47:06 -04: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
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 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 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 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