1
0
Fork 0
Commit Graph

917 Commits

Author SHA1 Message Date
arch1t3cht ddfd4501f0 visual tools: Add more tag get functions
Add getters for alignment, outline, shadow, font size, and the raw
extents of the text. Also handle overriding \xbord and \ybord correctly.
2023-01-14 14:18:04 +01:00
arch1t3cht 9cfc72bd83 visual tools: Add RemoveOverride function 2023-01-14 14:16:05 +01:00
arch1t3cht 8b142a05e5 visual tools: Add EndDrag and EndHold hooks 2023-01-14 14:14:42 +01:00
arch1t3cht bfdf01df9a visual tools: Add general interface for setting subtools 2023-01-14 13:56:21 +01:00
arch1t3cht f5a730fa45 avisynth: Only increase refcount when fully initialized
When Avisynth is not installed or not functional, this would otherwise
cause a crash when trying to initialize Avisynth more than once, since
after the first time the refcount would have been incrased anyway.
2023-01-14 00:13:47 +01:00
arch1t3cht 0d0ed49546 vapoursynth: Only set loaded when fully initialized 2023-01-13 23:52:27 +01:00
arch1t3cht d08726606f meson: Also add regen dependencies for bitmaps 2023-01-10 21:47:29 +01:00
arch1t3cht 74b9353038 Allow higher decimal precision in style editor
Also, allow negative fsp.
This doesn't change the behaviour of the SpinCtrl increment/decrement
buttons, just the precision that can manually be set. Small values of
fsp can be useful as a hack to disable all ligatures. Precise values of
fscx/fscy can be useful to compensate for anamorphic resolutions. The
other fields were made more precise for consistency.
2023-01-07 14:42:52 +01:00
arch1t3cht 15cca59679 Validate wxVariant type in hotkey CommandRenderer
This fixes a crash on Windows when double-clicking the draggable
separator between the column headers "Command" and "Description" in the
hotkey configuration dialog.
2023-01-02 15:29:00 +01:00
arch1t3cht 1bd426f69a folding: Switch to extradata for storage
This makes the internal juggling of fold data even more complicated, but
it has a number of advantages:
- Folds will preserved even when opening the file with Aegisub builds
  that don't know about folding.
- Folds will be preserved by automation scripts that re-insert every
  line.
- Folds do not break when adding or deleting lines in a text editor or
  some other editor, as long as the lines involving folds aren't
  touched.
- In particular, merging changes using tools like git will not break
  folds.
- Copy/pasting folds also keeps the folds to some extent. This is
  impossible to solve in full generality, but simple cases like
  cut/pasting a folded section somewhere else work, as long as the file
  isn't saved in between.
- This will give automation scripts full access to folding without
  needing to set up any additional API functions.
2023-01-02 02:40:19 +01:00
arch1t3cht 3b02a199f0 vapoursynth: Fix default argument for color range
Unlike the other arguments for the resize function, "range_in" does not
use the same format as in the frame props. A frame prop _Range=1 means
limited, while an argument range_in=1 means full range.
2023-01-02 02:13:04 +01:00
arch1t3cht abe2a81c99 folding: Fix crash when clicking fold column header 2022-12-11 18:53:36 +01:00
arch1t3cht 3b7cb30e1f Raise size limit of dummy video in config dialog
This is to facilitate some tricks with tracing rendered subtitles in
programs like GIMP with higher accuracy. Use at your own risk.
2022-11-30 22:35:27 +01:00
arch1t3cht cba8d3644f Remove "Video Panning" option
It's probably stable enough at this point, and hiding it behind an
option just creates more confusion than it prevents.
2022-11-17 17:29:18 +01:00
arch1t3cht c8ff1bc960 Clear column width cache after updating grid style
Fixes arch1t3cht/Aegisub#11
2022-11-08 00:49:42 +01:00
arch1t3cht bd4e79fdf9 Merge branch 'vector_clip_actions' into feature 2022-11-04 00:46:15 +01:00
arch1t3cht b1a9867f16 Visual perspective tool: First functioning version 2022-11-04 00:45:32 +01:00
arch1t3cht 9d4a67b523 Merge branches 'info', 'video_panning_option', 'fixes', 'misc', 'vapoursynth' and 'wangqr_gui' into feature 2022-11-03 00:03:23 +01:00
arch1t3cht 7ddfef7517 Add syntax highlighting for drawings and vector clips
The highlighting distinguishes drawing commands from coordinates, and
colors x and y coordinates in different colors to make coordinates
easier to visually parse. Furthermore, in cubic Bezier curves, it
underlines the coordinates which corresponds to endpoints of the curves.
2022-11-02 23:58:01 +01:00
arch1t3cht b7f3e19e00 vapoursynth: Don't update script colorspace if colorspace unknown
Aegisub will automatically override the YCbCr Matrix field of the
current file's Script Properties with the video's reported color space.
The FFMS2 provider guesses a color space for all videos, but we don't
do this for Vapoursynth. Thus, we now disable this overriding whenever
the colorspace isn't known.
2022-11-02 23:51:15 +01:00
arch1t3cht a3b131a312 vapoursynth: Reset locale after initializing
On Windows, Python changes the application's locale upon being called,
which will break wxwidgets, causing various assertion error dialogs or
even crashes (for example when interacting with any sort of float edit
control). Saving the locale and restoring it afterwards seems to be
the only really possible way to remedy this.
2022-11-02 23:51:10 +01:00
arch1t3cht 399042e9e9 Revert "fix"
This was a test commit I never meant to push...

This reverts commit cc9d13d21a.
2022-11-02 23:48:59 +01:00
arch1t3cht 28db5d31ce video zoom: Fix crash on windows when making detached video too small 2022-11-02 23:07:55 +01:00
arch1t3cht 6cc22750c1 Revert "video zoom: Fix crash on windows when making detached video too small"
This reverts commit b38493ee68.
2022-11-02 23:07:03 +01:00
arch1t3cht 2ee6f6e904 Fix overscan mask being half as thick as it should be
The percent values used for the overscan masks follow the BBC's
guidelines, as in
https://en.wikipedia.org/wiki/Overscan#Overscan_amounts .
However, these measure the per-side width as opposed to the total
percentage of width/height being cut off. Thus, they should not be
divided by two when drawing the mask.
2022-11-02 21:57:57 +01:00
arch1t3cht 04ccc15fd4 Fix overscan mask with DPI scaling 2022-11-02 21:57:57 +01:00
arch1t3cht 3583e57ddc vapoursynth: use exact fraction for frame rate 2022-11-02 02:18:52 +01:00
arch1t3cht 962295cf1e vapoursynth: Fix offset in audio block's first frame 2022-11-02 02:18:52 +01:00
arch1t3cht a5aa4eca29 vapoursynth: Properly pass through script errors 2022-11-02 02:18:52 +01:00
arch1t3cht 2bcf0c7555 Merge branch 'video_panning_option' into feature 2022-10-11 18:55:11 +02:00
arch1t3cht b38493ee68 video zoom: Fix crash on windows when making detached video too small 2022-10-11 18:54:55 +02:00
arch1t3cht 0e89f32cfb video zoom: Fix detached video with DPI scaling 2022-10-11 18:31:46 +02:00
arch1t3cht 17831ca0f4 video zoom: Fix visual tools with DPI scaling 2022-10-11 15:15:40 +02:00
arch1t3cht b8b85eb580 Merge branch 'wangqr_gui' into feature 2022-10-10 01:43:27 +02:00
IbarakiKasen 049c1c08d1 Fix wxFlexGridSizer flex grow
Fix wangqr/Aegisub#143
2022-10-10 01:17:35 +02:00
wangqr e69c4e9a86 Expand all widgets in SubsEditBox to get a consistent height 2022-10-10 01:17:35 +02:00
wangqr 53cc316e6f Expand layer SpinCtrl a little
to compensate wxMac bug with GetSizeFromText
2022-10-10 01:17:35 +02:00
wangqr d55922d3cf Don't shrink the size of layer SpinCtrl on GTK3 2022-10-10 01:17:35 +02:00
wangqr 7fe4382d38 Remove hardcoded height of the slider
Before this the slider is only partially displayed
2022-10-10 01:17:35 +02:00
wangqr ed15252d69 Add workaround for wrong initial wxTextCtrl size in about dialog
See https://trac.wxwidgets.org/ticket/18507

Fix wangqr/Aegisub#19
2022-10-10 01:17:35 +02:00
wangqr af7cbb7730 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
2022-10-10 01:17:35 +02:00
wangqr 0e0e04c943 Set the height of sub box back to 50px
Revert the change made in ad15c53fb1.
As a temporary solution for wangqr/Aegisub#4.
2022-10-10 01:17:35 +02:00
wangqr 6cb1a49943 Fix High DPI issue on GTK
* Use icon size in the config
2022-10-10 01:17:35 +02:00
wangqr 5f3757525a Add DPI awareness
* Removed most hard coded wxSize
* Sub edit box now have DPI aware icons

Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2022-10-10 01:17:34 +02:00
sepro e2ef1eb77f windows: enable DPI awareness in manifest 2022-10-10 01:17:34 +02:00
arch1t3cht cc9d13d21a fix 2022-10-10 01:17:34 +02:00
sepro 1469f1499b meson: apply custom manifest on windows
Co-authored-by: arch1t3cht <arch1t3cht@gmail.com>
2022-10-09 01:30:39 +02:00
arch1t3cht ccc5f44a5f Merge branches 'info', 'bugfixes', 'workarounds', 'fixes', 'folding', 'bestsource', 'avisynth' and 'vapoursynth' into feature 2022-09-27 23:37:18 +02:00
arch1t3cht 40a9344d44 vapoursynth: Check if file exists before creating provider
Since FileNotFound exceptions don't abort the provider search, opening
an invalid path would show errors such as "vapoursynth not found" when
VapourSynth wasn't installed, even if VapourSynth wasn't selected as the
default video provider.
2022-09-27 23:17:54 +02:00
arch1t3cht febce3ecdc vapoursynth: Add configurable default script
This default script will be executed to load any file whose file name
extension is not .py or .vpy .

The gui code for setting the default script is still a bit wonky as it
doesn't fit the rest of the preferences pages nicely, but it works for
now.
2022-09-27 23:14:30 +02:00
arch1t3cht fe77a1a0b8 avisynth: Check if file exists before creating provider
Since FileNotFound exceptions don't abort the provider search, opening
an invalid path would show errors such as "avisynth not found" when
Avisynth wasn't installed, even if Avisynth wasn't selected as the video
provider.
2022-09-27 22:59:01 +02:00
arch1t3cht 38efde92e3 folding: Fix selections jumping around 2022-09-14 11:31:50 +02:00
arch1t3cht a394aefd1a Fix crash when cancelling automation scripts
When cancelling an automation macro from the progress dialog, the dialog
throws a UserCancelException. If the macro still runs to the end
afterwards (instead of calling aegisub.cancel or causing an exception),
the two return values are left on the stack. This causes assertion errors
due to check_stack when those are enabled.
2022-09-13 22:41:18 +02:00
arch1t3cht 7ea1d650a9 bestsource: Fixes to fps and colorspace conversion
Some of these got lost in the process before.
For now, default to 709 if the colorspace is unkown. More detailed
colorspace guessing can be added in the future.
2022-08-29 11:11:05 +02:00
arch1t3cht 3fedc88641 Include strings.rc as resource file on Windows
This was included here:
6f546951b4/build/Aegisub/Aegisub.vcxproj.filters (L1094)
in the MSVC build.
2022-08-28 01:38:41 +02:00
arch1t3cht bb16cdf7fe Merge branches 'folding', 'misc' and 'bestsource' into feature 2022-08-23 20:16:55 +02:00
arch1t3cht 9ea7808a30 bestsource: Mark video provider as slow
Looks like this wasn't clear enough, so let's make it clear to users
that BestVideoSource should only be used if absolutely necessary.
2022-08-23 20:13:45 +02:00
arch1t3cht 6b43e643cb Merge branch 'wangqr_time_video' into feature 2022-08-23 19:59:24 +02:00
arch1t3cht c7c874acc4 Add commands to reload audio or video
This is mostly useful for reloading Avisyth or VapourSynth scripts.
2022-08-23 19:53:40 +02:00
arch1t3cht b2fbc84335 AlignToVideo: Reexport the new icon files
Some metadata of these files was triggering the assertion errors in #6 .
Reexporting the icons using ffmpeg fixed this.

Fixes #6 .
2022-08-23 19:30:41 +02:00
arch1t3cht c8d4df1355 Add option to sort subtitles by text 2022-08-23 16:11:23 +02:00
arch1t3cht 9b920c7892 folding: Always write fold data to file 2022-08-23 15:55:26 +02:00
arch1t3cht 2e78b9cfde Merge branch 'video_panning_option' into feature 2022-08-23 04:51:41 +02:00
arch1t3cht 98d476102e video zoom: Fix aspect ratio forcing
Do this by partially reverting the changes to UpdateSize in favor of
just multiplying by videoZoomValue *after* setting all the window sizes.
2022-08-23 04:48:33 +02:00
arch1t3cht 1dbd3b3cc7 Merge branches 'fixes' and 'ffmpeg_build' into feature 2022-08-22 02:26:03 +02:00
arch1t3cht 5a0bfdd775 Remove unnecessary flags in SelectedChoices dialog
These alignment flags would cause an assertion error
"Horizontal alignment flags are ignored in horizontal sizers"
when opening the dialog (mainly when importing styles from another
script).
As the assertion error says, the flags are ignored anyway, so they're
safe to remove.
2022-08-21 02:31:33 +02:00
arch1t3cht 7f7f5c8385 Merge branch 'misc' into feature 2022-08-19 21:18:48 +02:00
arch1t3cht 732c5c7654 Copy subitles: Fix wxBitmap usage
UseAlpha turned out to be unnecessary and doesn't even exist in some
wxWidgets ports.
2022-08-19 21:17:29 +02:00
arch1t3cht 3b8cc6deb1 Merge branches 'misc', 'xa2-ds' and 'info' into feature 2022-08-19 02:31:59 +02:00
arch1t3cht aadf6b32b9 Add option to copy or save subtitles with transparent background 2022-08-19 01:46:19 +02:00
arch1t3cht 819d90e9b0 Stereo playback on Linux audio players
After the audio provider rework, adjust the audio players to not
use the int16 mono downmixed audio unless necessary. Furthermore,
the pulseaudio-based player now controls the volume directly through
pulseaudio instead of by modifying the buffer. This also reduces latency
when changing the volume.

The entire set of GetAudio functions is quite messy now. After wangqr's
audio rework, it was split into GetAudio and GetInt16MonoAudio
functions, but now volume scaling is also necessary. Really, this should
go back to a type constructor based system with audio players being
allowed to choose what properties out of mono / 16 bytes / int samples /
volume they need.
2022-08-18 22:48:40 +02:00
arch1t3cht 8169f0c6dc Merge branch 'xa2-ds' into feature 2022-08-18 18:10:26 +02:00
arch1t3cht 144860eb59 Remove format assertion after audio rework 2022-08-18 18:09:32 +02:00
arch1t3cht e7e87f5584 Merge branch 'xa2-ds' into feature 2022-08-16 21:04:44 +02:00
arch1t3cht 0b8f5ad8fa XAudio PR: Revert some changes and fix on linux
Mostly synchronizing with the updates made to the ffmpeg audio provider
and removing the CMakeLists.txt
2022-08-16 21:03:59 +02:00
arch1t3cht 17d827c88a Merge branch 'misc_dc' into feature 2022-08-16 19:59:42 +02:00
arch1t3cht 6cdf360e76 Add downmix option on OSX
This fixes wangqr's commit dabd9f that adds an option to enable or
disable downmixing
2022-08-16 19:58:11 +02:00
arch1t3cht 24ac0647ac Merge branch 'vapoursynth' into feature 2022-08-16 19:57:22 +02:00
arch1t3cht ff43f3d601 vapoursynth: Add audio source 2022-08-16 19:22:54 +02:00
arch1t3cht 4a5a212f35 bestsource: Switch to GetPackedAudio()
After vapoursynth/bestsource#7 , BestSource now has a function to
get the packed audio instead, so we just use that directly.
2022-08-16 19:22:54 +02:00
arch1t3cht 3f298bf03a Add vapoursynth video provider 2022-08-16 19:22:54 +02:00
arch1t3cht 6af0b41f47 bestsource: Add audio provider 2022-08-16 19:22:54 +02:00
arch1t3cht 70fd08aabe bestsource: Expose some options 2022-08-16 19:22:54 +02:00
arch1t3cht e41647c78c bestsource: Detect audio and color space 2022-08-16 19:22:54 +02:00
arch1t3cht 4c6e3527d4 bestsource: Switch to manual sws_scale
This was to work with ffmpeg 4.4, but it also saves one frame copy
operation. It does, however, lose the slice threading.
2022-08-16 19:22:54 +02:00
arch1t3cht 33b9a6e395 Add bestsource video provider
Co-authored-by: Asada shinon <joshwoo71@gmail.com>
2022-08-16 19:22:54 +02:00
arch1t3cht 44888d9b70 Merge branch 'color_picker_fix2' into feature 2022-08-16 16:09:13 +02:00
arch1t3cht 25bd040494 Fix color picker option 2022-08-16 16:07:25 +02:00
arch1t3cht 64ecc490be Merge branch 'fixes' into feature 2022-08-16 15:51:37 +02:00
wangqr d75e49653a Fix syntax error in e2ea84541f 2022-08-15 21:01:09 +02:00
Oneric 57841a0a34 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.
2022-08-15 21:01:09 +02:00
Oneric f1cfd480c4 AlignToVideo: Improve rgb->lab precision 2022-08-15 21:01:09 +02:00
Oneric 2300988613 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.
2022-08-15 21:01:09 +02:00
wangqr b2ba1feb28 Submit "align to video" on double click
Fix wangqr/Aegisub#34
2022-08-15 21:01:09 +02:00
wangqr 60dcc35830 Remove the trailing period in help text of time/align
Fix wangqr/Aegisub#7
2022-08-15 21:01:09 +02:00
wangqr 2b3df72c75 Fix missing config option for Align on macOS 2022-08-15 21:01:09 +02:00
wangqr 37380658bb Fix errors in AlignToVideo
* Call TimeAtFrame with correct parameter
* Fix syntax error
2022-08-15 21:01:09 +02:00
Charlie Jiang cc8e857849 Merge remote-tracking branch 'origind-dev/master'
Add align to video function
2022-08-15 21:01:09 +02:00
arch1t3cht 9ebe154964 Fix width of lua float edits
Float edits with a spinner are by default sized to fit their full
min-max range of possible values, so this makes min and max default to 0
and 100 (like it'd done internally in wx) instead of -DOUBLE_MAX and
DOUBLE_MAX.

Note that this does change the behavior of lua dialogs, but does not
contradict existing documentation or specification. It should only
affect scripts who either disobey the specification by specifying only
one value out of max/min, or scripts displaying these large float edits
by specifing a step, but no max or min.
2022-08-14 16:24:50 +02:00
arch1t3cht 53466be0ca Merge branch 'avisynth' into feature 2022-08-13 23:03:33 +02:00