Compare commits

...

6050 Commits

Author SHA1 Message Date
odrling fa669a94e6
use older macos-12 runner
latest/14 fails and builds for arm64
also GA skipped 13 for macos-latest for some reason
2024-04-02 18:59:41 +02:00
odrling dd14bb326f
fix version.sh when building from a git worktree
In a git worktree .git is a regular file that contains a reference to
its git directory
2024-04-02 18:44:59 +02:00
odrling 463f886a58
add missing includes
my gentoo ebuild seems to die on these includes... unlike a manual build
2024-04-02 18:44:59 +02:00
odrling b2e6af62eb
copy all automation scripts to install dir 2024-04-02 18:44:59 +02:00
odrling 724df479c5
add automation scripts back 2024-04-02 18:44:59 +02:00
odrling fc5277492c
force git directory in version.sh 2024-04-02 18:44:59 +02:00
odrling 3e0d4bcdab
osx-fix-libs: log link path 2024-04-02 18:44:59 +02:00
odrling 1ea0faa59f
osx-fix-libs: fix relative symlinks with same name 2024-04-02 18:44:58 +02:00
odrling 89bae8640c
force dependency on libresrc 2024-04-02 18:44:58 +02:00
odrling 13ee9cc20b
don't delay audio on matroska files 2024-04-02 18:44:58 +02:00
odrling 39da678257
add option to disable tests 2024-04-02 18:44:58 +02:00
odrling 9ef7feab55
fix vfr nonzero start time test 2024-04-02 18:44:58 +02:00
odrling e69fd3e96f
[style] increase default font size 2024-04-02 18:44:58 +02:00
odrling ce97291a1b
[Karaoke] disable drag timing
disables "Left-click drag moves end marker"
2024-04-02 18:44:58 +02:00
odrling fc54f0a1a8
[style] change default style 2024-04-02 18:44:58 +02:00
odrling f0c20ea8e5
[Karaoke] Autocommit and autofocus 2024-04-02 18:44:57 +02:00
Vincent Wong 654dbcf2cf
Audio/timing: minor style, comment
A bit more clarification of code logic. Follow predominant if/else style
2024-04-02 18:44:57 +02:00
Vincent Wong 0761654486
Audio/Timing: implement tap-to-time
Tap-to-time provides the user the ability to tap to the lyrics/syllables
of the song in order to time lines or karaoke. It consists of these
extra UI interactions:

- **Indicator**: tap marker: a designated marker that can be moved to
  the current audio position; indicated in:
  - the audio display by a green arrow underneath a marker
  - the karaoke display by a green-colored syllable
- **Control**: tap marker: the tap marker can be changed by selecting
  syllables on audio display in karaoke mode, or clicking the markers on
  audio display in dialogue mode
- **Control**: ctrl-right-click audio display: starts playing the audio
  from that exact position until the end of the file
- **Option**: Timing/Tap To Time: enables the tap marker indicator and
  commands
- **Button**: time_opt_tap_to_time: toggles the Timing/Tap To Time option
- **Button**: time_tap_connect (hotkey I): a command that:
  - moves the tap marker's position to the current playing audio
    position
  - sets the next marker to be the tap marker
  - if the tap marker is already the last marker AND BOTH autocommit AND
    next-line-on-commit is ON, will move onto the next line
  - if moved on to the next line, also sets the start marker to the current
    audio position, so the two lines are connected, and moves to the
    next tap marker (essentially reinvoking time_tap_connect once)
- **Button**: time_tap_no_connect (hotkey O): similar to
  time_tap_connect, except it will not set the next line's start
  position even if moved to the next line

Expected workflow:
1) User loads song lyrics
2) User splits each line into syllables
3) User turns on tap-to-time, autocommit, and next-line-on-commit
4) User plays audio from beginning, tapping time_tap_connect to each
syllable, occasionally tapping time_tap_no_connect when a break between
lines is desired
5) If user messes up a line, they can set the tap marker to where they
want to restart from, and ctrl-right-click to start the audio a few
seconds before it
6) Syllables can be split/merged at will, and adjustments to timing can
be done using normal karaoke timing controls
2024-04-02 18:44:57 +02:00
Vincent Wong 166fabcfd2
AudioTimingControllerKaraoke: move timing correction above MoveMarker
Having the timing correction in MoveMarker is extremely surprising
behavior if any other part of the code uses MoveMarker expecting it to
work correctly as advertised
2024-04-02 18:44:57 +02:00
Vincent Wong 3f0ec2c102
audio_timing: add missing param comment for OnLeftClick
Missing the alt_click param in comment
2024-04-02 18:44:57 +02:00
odrling 010f538efa
normalize timecodes for every formats except matroska 2024-04-02 18:44:57 +02:00
odrling 8348c1e0f5
shift video instead of subtitles
This is probably wrong in some cases. This is probably what we want with
matroska files.
2024-04-02 18:44:57 +02:00
odrling 8c3d6c06ad
fix mks file parsing 2024-04-02 18:44:56 +02:00
odrling e824932423
fix sub timing in mkv files with video delay
Some matroska files have audio start at timestamp 0 and video later.
In this case mkvtoolnix seems to use the first block of the first
cluster to the audio track (I would assume this is only an
implementation detail and not really from the matroska specs. And also
could happen in other cases without the video being delayed, but that's
not the point). Aegisub used to read this first block and use its
timestamp as the starting point of the video track.

With this commit, Aegisub tries to read all the blocks until it can read
the first timestamp of the video track and use it for the subtitles'
timestamps. Audio tracks don't seem to be impacted by these changes.
2024-04-02 18:44:56 +02:00
Pierre Jeanjean 93398de478
Fix charset detection and conversion issues 2024-04-02 18:44:53 +02:00
arch1t3cht aa68c2e66b Merge branches 'misc' and 'bugfixes' into feature 2024-03-20 14:39:37 +01:00
Ryan Lucia 4b20bc7df0 ci: try to workaround github actions bug 2024-03-20 14:39:24 +01:00
moi15moi 7543060f1d Rework Windows font collector (arch1t3cht/Aegisub#107)
[src\meson.build] Add DirectWrite has dependency

[src\font_file_lister_gdi] Rework GDI FontCollector to use DirectWrite

This replaces all the logic of using the Windows registry to obtain the font path by using DirectWrite. The goal is simply to improve the quality of the code. This doesn't change any functionality

[src\meson.build] Remove Uniscribe has dependency

Uniscribe was only used for the FontCollector. Since we now use DirectWrite, we don't need it anymore.

[src\dialog_fonts_collector] Catch exceptions that FontCollector may raise

On Windows, the initialization of the FontCollector can raise an exception

[src\font_file_lister] Document the exception that GdiFontFileLister can throw

[src\font_file_lister_gdi] Correct possible memory leak when an error occur

Fix error caused by AddFontResource on Windows 10 or higher

[meson.build] Replace add_project_arguments with conf.set for HAVE_DWRITE_3

[src\dialog_fonts_collector] Update message error and optimisation

[src\font_file_lister_gdi] Correct documentation typo

[src\font_file_lister_gdi] Cosmetic nit - Initialize hfont in one line

[src\font_file_lister_gdi] Cosmetic nit - Remove if statements brace

[src\font_file_lister_gdi] Replace WCHAR param of normalizeFilePathCase to std::wstring

[src\font_file_lister_gdi] Replace WCHAR by std::wstring

[src\font_file_lister_gdi] Use IDWriteFontFace::GetSimulations to detect fake_italic/fake_bold

See this comment: https://github.com/arch1t3cht/Aegisub/pull/107#issuecomment-1975229652

[src\font_file_lister_gdi] If Win7/8 has Win 10 SDK on compile time, correctly verify if font has character(s)

With the Visual Studio 2019 toolchain on Windows 7, it installs the Windows 10 SDK by default. Because of this, ``HAVE_DWRITE_3`` is true, so the ``QueryInterface`` always fails. Now, if the ``QueryInterface`` fails, we try to verify if the font has characters with a Windows Vista SP2 compatible code.

[src\font_file_lister_gdi] Support facename that contains only whitespace AND truncated facename

Problem 1:
Previously, if a user wrote "\fn   ", it would return the font Arial, which is not what we want. This is because when we request EnumFontFamiliesEx with whitespace or an empty lfFaceName, it will enumerate all the installed fonts.

Solution 1:
To resolve this issue, let's implement a solution similar to libass to determine if the selected facename exists: 649a7c2e1f/libass/ass_directwrite.c (L737-L747)

Problem 2:
GDI truncates font names to 31 characters. See: https://github.com/libass/libass/issues/459
However, since I changed the method to determine if a facename exists, I ensured that we still support this "feature".

To test this, I used the font in: https://github.com/libass/libass/issues/710

[src\font_file_lister_gdi] Add a FIXME comment regarding the utilization of std::wstring over WCHAR

[src\font_file_lister_gdi] Add FIXME comment about charset
2024-03-20 14:38:45 +01:00
arch1t3cht 897ca32c26 Allow setting Encoding=-1 in style editor 2024-03-19 23:32:12 +01:00
arch1t3cht cd2e894634 Merge branches 'bestsource', 'vapoursynth' and 'bugfixes' into feature 2024-03-08 01:54:29 +01:00
arch1t3cht 4f8cb846cc bestsource: Bump to R1 2024-03-08 01:54:14 +01:00
arch1t3cht 86295a8d36 Install gettext on Windows CI
Apparently this is no longer installed by default.
2024-03-08 01:40:38 +01:00
arch1t3cht bf8bbb60d6 vapoursynth: Switch from bestaudiosource to BestSource
BestSource now had its first official release, so this is possible now.
2024-03-07 21:46:59 +01:00
arch1t3cht e2e3906d15 Merge branch 'vapoursynth' into feature 2024-02-27 20:40:47 +01:00
arch1t3cht deb0f19b1b vapoursynth: Ensure vscache directory is created
Match the other video providers for consistency.
2024-02-27 20:39:41 +01:00
petzku abff2365d3 vapoursynth: Recursively create directories 2024-02-27 20:36:21 +01:00
arch1t3cht dcca721543 Merge branches 'lua_api' and 'misc' into feature 2024-02-20 15:04:04 +01:00
arch1t3cht f52b699493 lua: Add function to get raw frame data
This can be useful when scripts want to read the entire frame
and pass it on somewhere else (say, write it to a file or use some
library function on it).
2024-02-20 15:02:59 +01:00
arch1t3cht 1515c77438 Fix widths of time columns for fonts with proportional figures
This still breaks when the 0 digit is narrower than some other
digit, but that's unlikely and the current behavior now matches
the original behavior when all times are < 10h.

Fixes arch1t3cht/Aegisub#111 .
2024-02-19 14:22:27 +01:00
arch1t3cht 63bbdc32d3 lua: Make frame:getPixel return three values
This is what users will want in the majority of cases, and switching
to this makes using this function much easier.

However, this does break backwards compatibility. Luckily to my
knowledge this function is not actually used in any existing published
script (all scripts using get_frame just use getPixelFormatted instead)
so the damage shouldn't be too large. But this is also why I'd rather
rip off the band-aid of breaking backwards compatibility now than later.
2024-02-18 02:34:18 +01:00
arch1t3cht c11f17b9e6 lua: Correct refcount handling in get_frame
When destroying a frame handle, the previous logic would copy the
shared_ptr in the userdata and then free it twice (once explicitly
and once at the end of the function), which is actually UB, even
if if worked fine so far. This commit now ensures that it's the
actual userdata's shared_ptr that's freed in the gc function.
2024-02-18 02:34:18 +01:00
arch1t3cht 48855787a1 lua: Fix FrameDestroy function name 2024-02-18 02:34:18 +01:00
arch1t3cht ba9f48a0e5 Merge branch 'misc' into feature 2024-02-08 21:26:04 +01:00
arch1t3cht eaf09b2850 Fix widths of time columns for times >10h
An unfortunate consequence of this is that the grid widths have to
be computed on every change to line timing, which will probably
have an impact on timing performance when autocommit is enabled.
It's probably not a huge impact but it's worth keeping an eye on.
2024-02-08 21:22:35 +01:00
arch1t3cht e67fe10c4b Merge branch 'misc' into feature 2024-02-08 20:43:59 +01:00
Oneric 8fcb7c61e8 Stop truncating parsed times to <10h
All current renderers and muxers have no issues with longer timestamps.
However, classic VSFilter keeping track of time with a 32-bit int,
leads to a more meaningful limit at 596h, so enforce that instead.

Since the stringification code for SRT and ASS (but not SMPTE) relied on
hours being single digit, replace them with a simple format string.

GUI inputs are still limited to <10h, but at least
pre-existing timestamps no longer get mangled.
2024-02-08 20:43:32 +01:00
arch1t3cht 069cd48cac Merge branch 'bugfixes' into feature 2024-01-20 00:13:37 +01:00
arch1t3cht 7e24a5f3a5 Fix compilation error for assdraw command
This broke on wxWidgets master.
Really this command could just be removed entirely but I'll keep it
around for now.
2024-01-20 00:12:43 +01:00
arch1t3cht 6af7c6bddf Merge branches 'workarounds' and 'bestsource' into feature 2023-12-27 06:53:22 +01:00
0tkl 167b4add50 bestsource: Update ffmpeg API usage for keyframes 2023-12-27 06:52:56 +01:00
0tkl 29c8054b50 Update ffmpeg wrap to 6.1 2023-12-27 06:50:37 +01:00
arch1t3cht b0c77beef6 Merge branch 'bugfixes' into feature 2023-12-26 16:54:47 +01:00
arch1t3cht 8650e12364 Download hunspell dictionaries from GH repo
Since the download from SourceForge frequently fails,
the English dictionaries are now hosted in a TypesettingTools
repository.
2023-12-26 16:53:32 +01:00
arch1t3cht eca52e4166 Merge branch 'workarounds' into feature 2023-12-26 16:20:07 +01:00
arch1t3cht 8e60a46c01 Work around double buffering issue in wx master
See https://github.com/wxWidgets/wxWidgets/issues/23585 .
This patch reverts commit fb4f0b590c42a66263debf926617c00b157c9a in
wxWidgets.
2023-12-26 16:16:12 +01:00
arch1t3cht 1eea4ca69c Remove stray BOM in dav1d patch 2023-12-26 16:15:39 +01:00
arch1t3cht 7f928e8d6d Merge branch 'bugfixes' into feature 2023-12-02 18:08:47 +01:00
arch1t3cht 592bd993d7 Remove iconv's stdbool.h
This was breaking things (libass) and doesn't seem to be
needed any more.
2023-12-02 18:08:36 +01:00
arch1t3cht 160cf46b98 Merge branch 'bugfixes' into feature 2023-12-02 17:27:55 +01:00
arch1t3cht df9d442102 Fix AviSynth paths for portable build (again) 2023-12-02 17:26:00 +01:00
arch1t3cht ce557d98e4 Use crash_writer_minidump on Windows
This was done in Aegisub/Aegisub.
2023-12-02 17:21:11 +01:00
arch1t3cht 786f082673 Merge branch 'workarounds' into feature 2023-11-24 23:10:07 +01:00
arch1t3cht ffb95f1375 Bump wxWidgets wrap back down to 3.1.4
Fixes arch1t3cht/Aegisub#99 .
Of course one day icon scaling should be sorted out properly,
but for now let's just revert.
2023-11-24 23:08:49 +01:00
arch1t3cht 8947e20dbb Merge branch 'bugfixes' into feature 2023-11-24 21:02:09 +01:00
arch1t3cht 18d088c479 Fix hunspell include and wrap 2023-11-24 20:53:07 +01:00
arch1t3cht 20caaabc07 Merge branch 'vapoursynth' into feature 2023-11-23 11:32:41 +01:00
arch1t3cht 928a2d4c6c vapoursynth: Fix lwindex parsing when video is not the first stream
SubKt my beloved...
This was broken in 0d281af269 and is fixed
in a more robust way in this commit.
2023-11-23 10:00:11 +01:00
arch1t3cht 07fa563fa6 vapoursynth: Ignore __aegi_timecodes on single-frame clips
The vfr class (understandably) does not like timecode lists with only
one element, so the current default script breaks when opening images.
So to not bloat the default script too much we just ignore
__aegi_timecodes in the provider in these cases.
2023-11-23 09:40:04 +01:00
arch1t3cht 5ceaa45f3a Merge branch 'bugfixes' into feature 2023-11-21 21:20:52 +01:00
arch1t3cht 4576ac0638 luajit: Remove checkdef for SSE
This isn't actually set in luajit's Makefile. Maybe it was at some
point in the past, but there's no trace of it now.

Fixes arch1t3cht/Aegisub#98 .
2023-11-21 21:19:06 +01:00
arch1t3cht 693959801f ci: Add manual trigger option 2023-11-15 19:04:50 +01:00
arch1t3cht 752a14cc25 Merge branch 'bugfixes' into feature 2023-11-06 22:45:06 +01:00
arch1t3cht 24c8144e91 meson: luajit: Set correct LUAJIT_TARGET for buildvm
On native builds this is derived automatically, but on cross builds
it needs to be set explicitly.
2023-11-06 22:44:18 +01:00
arch1t3cht 1ba7979ff4 meson: luajit: Remove unused readline dependency 2023-11-06 22:44:03 +01:00
arch1t3cht d728ce0e78 meson: Don't run tests on cross builds
This can be made into an option or whatever when cross builds that
can/need to run tests show up, but for now this is enough.
2023-11-06 22:12:30 +01:00
arch1t3cht fd753c58a5 Merge branch 'vapoursynth' into feature 2023-11-03 02:27:20 +01:00
Setsugennoao 568597bddc vapoursynth: Fix VSScript DLL loading
We do this by first trying to fetch its location from the registry, then PATH
2023-11-03 02:24:46 +01:00
arch1t3cht 95500b84fd Merge branch 'vapoursynth' into feature 2023-11-01 20:35:21 +01:00
arch1t3cht 0d281af269 vapoursynth: Fix lwindex parsing for files with multiple video streams 2023-11-01 20:32:32 +01:00
arch1t3cht fac664ad10 Merge branch 'workarounds' into feature 2023-10-27 16:41:40 +02:00
arch1t3cht 6dda04da9f Revert "Parially revert fffb138b8175b4838b6a063863756b7c6b2db547"
This reverts commit c487dd2bdb.

Revert the commit that
partially reverted fffb138b81 ...
It turns out that this very much did break IME input, so reverting
this for now. This does make Aegisub use private symbols in wx again,
but the CI builds build wx from the wrap now. Still, this is why
this is on the workarounds branch. If this breaks for too many
people this could either go behind a meson option or be fixed in
some better magical way that I have yet to find.

Fixes arch1t3cht/Aegisub#90
Fixes arch1t3cht/Aegisub#91
2023-10-27 16:40:21 +02:00
arch1t3cht dd303b1c9d Merge branch 'misc' into feature 2023-10-25 20:20:55 +02:00
arch1t3cht 2ac3bdf870 Allow reading compressed subtitles from mkv
The error handling inside of read_subtitles is a bit clumsy here,
but it's probably the best we can get without bigger refactors.
2023-10-25 20:20:04 +02:00
arch1t3cht 795dffc072 Merge branch 'bugfixes' into feature 2023-10-18 23:30:11 +02:00
arch1t3cht 45fdaecd72 ci: Install setuptools
After Python 3.12 released, meson doesn't seem to like the python
installed by actions/setup-python any more.
2023-10-18 23:29:20 +02:00
arch1t3cht 4a939d1954 Merge branches 'vapoursynth' and 'fixes' into feature 2023-10-18 21:22:54 +02:00
arch1t3cht 47b10e5ffc Fix progress dialog when switching from indeterminate to setting progress 2023-10-18 21:21:37 +02:00
arch1t3cht 2dbee37ad8 vapoursynth: Copy aegisub_vs.py to build folder for testing 2023-10-18 14:51:28 +02:00
arch1t3cht a1b3e0d9f1 vapoursynth: Allow scripts to control the progress dialog
This happens via VapourSynth's message logger.
Also add wrapper functions for this to aegisub_vs.py and add progress
updates everywhere - both to improve UX and to help with debugging for
when scripts get stuck somewhere.
2023-10-18 14:51:28 +02:00
arch1t3cht 79b3f4ccb0 vapoursynth: Add option to enable/disable user plugin loading
On Windows, plugins are shipped with Aegisub now and loaded from
aegisub_vs.py, so user plugins installed out of Aegisub are more
likely to just interfere with that (like when the user has an
old version of libvslsmashsource installed).
So this option defaults to off on Windows, but to on everywhere else
since VS plugins aren't shipped with Aegisub there.

Note that this option only disables autoloading of user plugins.
VapourSynth loads system plugins no matter what.
2023-10-18 13:31:47 +02:00
arch1t3cht 4ebdc2b82c Merge branches 'bugfixes', 'video_provider_rework' and 'avisynth' into feature 2023-10-17 18:31:11 +02:00
arch1t3cht fabc6e436f osx: Sign executable and libraries after bundling 2023-10-17 18:26:49 +02:00
arch1t3cht 858f4acf35 avisynth: Decrease refcount again when constructor fails
Proper fix to the issue that f5a730fa45
was trying to fix.

Fixes arch1t3cht/Aegisub#61 .
2023-10-15 23:08:39 +02:00
arch1t3cht a9eed184c2 Revert "avisynth: Only increase refcount when fully initialized"
This reverts commit f5a730fa45.
2023-10-15 22:58:23 +02:00
arch1t3cht dd3016a89d Further fixes to audio/video provider selection
- Fix selection not aborting when the preferred provider returns null
- Fix the default video provider being "ffmpegsource" (lowercase)
  instead of "FFmpegSource", which would trip up provider selection
- More generally, make sure the preferred video provider actually exists
  and fall back to the default (FFmpegSource) if not.

Fixes arch1t3cht/Aegisub#23 .
Fixes arch1t3cht/Aegisub#61 .
Fixes arch1t3cht/Aegisub#83 .
2023-10-15 22:27:21 +02:00
arch1t3cht 07c4f26a8e ci: Install nasm for Ubuntu AppImage build
Ubuntu doesn't have ffmpeg 6.0 yet, but we want to bundle ffms2 master
since the distro version still has seeking issues. Compiling the ffmpeg
wrap needs nasm.
2023-10-14 00:51:32 +02:00
arch1t3cht b3eb182259 Merge branch 'bugfixes' into feature 2023-10-13 23:56:15 +02:00
arch1t3cht ee247419b6 Merge branch 'workarounds' into feature 2023-10-13 23:55:52 +02:00
arch1t3cht b8f4c98c4c Move iconv include to charset_conv.h
On newer mac sdks iconv_t is defined differently, so it's harder to
just have a typedef for it.
2023-10-13 23:52:26 +02:00
arch1t3cht c67ba9f70c Update ffmpeg wrap to 6.0 following ffms2 updates
Also bump libdav1d and turn the wrap patches into diffs. This requires
bumping the minimum meson version to 0.63, but meson 1.0 is available
pretty much everywhere now so this should be fine.
2023-10-13 23:46:11 +02:00
arch1t3cht 9bc3cad79e Add remaining dasm flags in luajit wrap
This now matches the makefile. Also stop hardcoding the flags
for MSVC, since cc.get_define seems to work properly there now.
2023-10-13 23:26:01 +02:00
arch1t3cht 82b7e96cea Merge branches 'bugfixes' and 'fixes' into feature 2023-10-13 00:36:09 +02:00
arch1t3cht a631bf192c lua: Fix dialog dropdowns that are empty by default on Mac 2023-10-13 00:32:36 +02:00
arch1t3cht ad92ccf01a Fix cleantags with \k tags with noninteger durations
Fixes arch1t3cht/Aegisub#92 .
2023-10-13 00:26:26 +02:00
arch1t3cht 4e6af75db4 Add proper endianness flag for dasm in luajit wrap
Fixes luajit almost completely breaking on aarch64 and probably
other non-x86 architectures.
2023-10-12 23:04:22 +02:00
arch1t3cht 61ec2bc3e7 Merge branch 'fixes' into feature 2023-09-17 18:49:10 +02:00
arch1t3cht edae653584 Deduplicate automation autoload path, for real this time
Replaces the incorrect fix in 642251b
Fixes arch1t3cht/Aegisub#15
2023-09-17 18:47:42 +02:00
arch1t3cht 8fb8e90006 Merge branches 'bugfixes' and 'workarounds' into feature 2023-09-12 16:18:00 +02:00
arch1t3cht 49139f0a22 Fix OSX library wrangling when libs use @rpath or @loader_path
Fixes arch1t3cht/Aegisub#77
2023-09-12 16:16:40 +02:00
arch1t3cht d10ffebe35 Fix dictionary download on mac when osx-bundle is run more than once 2023-09-12 14:57:42 +02:00
arch1t3cht 9acb673457 Also add Dark Mode option on OSX
While it's not actually exposed there, it's used internally in various
GUI code.
2023-09-12 14:55:21 +02:00
arch1t3cht 1fde843630 Merge branches 'fixes' and 'bugfixes' into feature 2023-09-10 14:04:30 +02:00
arch1t3cht 4a97bb0dd2 meson: Update luajit wrap for luajit's rolling releases 2023-09-10 14:04:04 +02:00
Alex James 4f67db8dd7 libaegisub: Avoid calling iconv_close(iconv_invalid)
IsConversionSupported unconditionally calls iconv_close on the
descriptor returned by iconv_open. This may result in crashes if
iconv_open returns iconv_invalid.
2023-09-07 19:38:59 +02:00
arch1t3cht 41ef3fa56a vapoursynth: Remove old and incorrect docstring sentence 2023-09-05 00:21:11 +02:00
arch1t3cht 11fece4c03 Merge branch 'vapoursynth' into feature 2023-08-15 16:05:01 +02:00
arch1t3cht b2ee8ac036 vapoursynth: Make loading error messages a bit more helpful 2023-08-15 16:04:53 +02:00
arch1t3cht a867f0cc30 Merge branch 'workarounds' into feature 2023-08-09 18:30:51 +02:00
arch1t3cht 418514456e Disable sunken or raised borders for dark mode
Co-authored-by: arch1t3cht <arch1t3cht@gmail.com>
2023-08-09 18:29:04 +02:00
sepro 061a860e2e Add option to enable experimental dark mode 2023-08-09 18:07:52 +02:00
sepro 5944d7999c Add option to build on wxWidgets master 2023-08-09 18:07:13 +02:00
sepro 0f897ba0eb Add nasm fallback url 2023-08-09 18:03:11 +02:00
arch1t3cht 4659bb2802 Merge branch 'bugfixes' into feature 2023-08-09 18:02:46 +02:00
sepro 0637bcdc7f Add nasm fallback url 2023-08-09 18:01:09 +02:00
arch1t3cht 0b7ea58cd6 meson: Add libresrc headers as dependencies
These are included in the Aegisub source files, so they need to be
generated before compiling.
2023-08-01 14:07:56 +02:00
arch1t3cht 239d585512 Merge branches 'vapoursynth' and 'fixes' into feature 2023-07-31 23:55:51 +02:00
arch1t3cht c61f149a37 Merge branch 'fixes' into feature 2023-07-31 23:48:14 +02:00
arch1t3cht 47c923d4ed unicode-monkeypatch: use tostring() in io.open error handling
msg can be nil, which would previously error out when trying to print it.
2023-07-31 23:41:43 +02:00
arch1t3cht 263c2b9189 vapoursynth: Make askyesno method configurable
In particular, don't always import tkinter.messagebox since not all
Python distributions include tkinter.
2023-07-29 20:08:54 +02:00
arch1t3cht 66127f8c40 Merge branch 'bugfixes' into feature 2023-07-18 16:02:24 +02:00
0tkl 0fd12795da fix typo in meson wrap file 2023-07-18 16:01:59 +02:00
arch1t3cht a957af9a12 Merge branch 'bugfixes' into feature 2023-07-16 19:51:16 +02:00
arch1t3cht 6754ff8775 installer: Update paths to Avisynth libraries 2023-07-16 19:51:05 +02:00
arch1t3cht f9be4a854f Merge branches 'workarounds' and 'video_provider_rework' into feature 2023-07-16 17:57:09 +02:00
arch1t3cht d97c16cb7c Disable icu subproject in harfbuzz
Harfbuzz updated its ICU detection, which now picks up our subproject,
but isn't actually compatible with it.
2023-07-16 17:56:23 +02:00
arch1t3cht d3325eef6c Revert "meson: revert icu detection in harfbuzz"
This reverts commit 36a18e5ba3.
2023-07-16 17:55:32 +02:00
arch1t3cht dbe30b4da5 Revert "Point Yutils to fixed fork"
This reverts commit 12a5050365.
2023-07-16 17:55:19 +02:00
arch1t3cht 02567c2265 Rework the audio/video provider system
This became necessary now that more providers were added. Providers can
be proritized for certain file types (e.g. .vpy files will always be
opened with VapourSynth), and when the default provider fails on a file,
the user will be notified and be asked to pick an alternative provider.
2023-07-16 17:52:21 +02:00
arch1t3cht 7ca8b4c008 Merge branch 'misc' into feature 2023-07-14 00:06:52 +02:00
arch1t3cht 644a4ca9f7 Allow fractional frame rates in dummy video
The validation code for the dummy video dialog is kind of dirty but I've
had this lying around for months and just want to get it done...
2023-07-14 00:05:46 +02:00
arch1t3cht 96123cb6da Merge branch 'xa2-ds' into feature 2023-07-12 02:52:58 +02:00
arch1t3cht 42c71c4775 Add XAudio2 redistributable DLL for older Windows versions
The CI builds link against XAudio2_9, which isn't available on Windows 8
and lower. As a quick and dirty workaround, this commit ships the
XAudio2 redistributable on those older Windows versions. Simply renaming
the redistributable to XAudio2_9.dll isn't strictly allowed by the
documentation, but it works and is probably an acceptable hack to
support an outdated operating system...

Fixes arch1t3cht/Aegisub#16 .
2023-07-12 02:49:09 +02:00
arch1t3cht 0479b310e8 Merge branch 'video_panning_option' into feature 2023-06-27 02:15:54 +02:00
arch1t3cht 3f017bc29c video zoom: Add pan_reset command to video context menu 2023-06-27 02:15:18 +02:00
arch1t3cht eb6f31c077 Merge branch 'lua_api' into feature 2023-06-21 21:31:03 +02:00
arch1t3cht e483c5e48f lua: Fix crash after 79050df
Replacing all uses of LuaToAssEntry with LuaToTrackedAssEntry
also replaced its use in LuaParseKaraokeData, which would cause a double
free when canceling a script after calling parse_karaoke_data.
2023-06-21 21:29:23 +02:00
arch1t3cht 9e8ac83998 Merge branches 'vapoursynth' and 'info' into feature 2023-06-11 01:22:14 +02:00
arch1t3cht 1f6684823c vapoursynth: Add "ask" mode for get_keyframe 2023-06-11 01:22:06 +02:00
arch1t3cht fd401f059a README: Clarify where to find builds and some other updates 2023-06-10 02:08:45 +02:00
arch1t3cht d06a31968d vapoursynth: Add buttons to set default scripts to default 2023-06-08 18:41:12 +02:00
arch1t3cht 7bc18fec26 Merge branch 'folding' into feature 2023-06-01 23:35:39 +02:00
arch1t3cht b41f6bde71 Don't immediately delete unused extradata entries
Instead, count how many consecutive times the entry has been found to be
unused and delete it once that count exceeds a limit. This will prevent
excessive reallocating of extradata ID's in applications like folding.
2023-06-01 23:35:26 +02:00
arch1t3cht 58d6ab520b folding: Also update counterpart for fold operations
This wasn't necessary before since the internal representation of
folds is be checked for consistency after each commit, but after the
switch to extradata fold operations would leave the extradata in an
invalid state. This isn't technically a problem, but it does leave more
extradata entries lying around than necessary, and it can trip up
automation scripts that aren't prepared for inconsistent fold state.
2023-06-01 23:01:32 +02:00
arch1t3cht 58c0130d81 Fix default hotkeys commands for splitting lines
These commands were revamped in 0ef9963 but the default hotkeys were
never updated. The hotkeys were automatically migrated, but resetting
the settings back to defaults would still set invalid settings.
2023-05-30 01:45:53 +02:00
arch1t3cht dba4f4924e Merge branches 'lua_api' and 'bugfixes' into feature 2023-05-29 14:52:31 +02:00
arch1t3cht f3d6eea3b9 Fix AppImage build on CI 2023-05-29 14:43:34 +02:00
wangqr 055c87cd21 Reallocate static ranges for wxMenuItem
Previously different menus may use conflict ids in range 10000~.

Fix TypesettingTools/Aegisub#53
See also Aegisub/Aegisub#131
2023-05-25 23:13:05 +02:00
arch1t3cht 42f7e53e92 lua: Don't check_stack in LuaCheckStack destructor
This would cause an assertion failure in functions like lua_for_each
when the given closure throws an error and thus leaves some  values on
the stack. This can make Aegisub crash entirely instead of just catching
and reporting the error. Instead, these stack_checks can be done
manually.
2023-05-22 09:23:22 +02:00
arch1t3cht 79050dfdfb lua: Fix memory leak on aegisub.cancel() 2023-05-21 20:26:33 +02:00
arch1t3cht 64b92a95ac folding: Simplify fold operation code 2023-05-19 18:45:40 +02:00
arch1t3cht 5e51c59e8e Merge branch 'vector_clip_actions' into feature 2023-05-18 23:40:56 +02:00
arch1t3cht c8f8e8ac42 visual tools: Add setting for shape handle size 2023-05-18 23:39:00 +02:00
arch1t3cht 4365b16524 Merge branch 'pr_at_po-de' into feature 2023-05-01 17:33:48 +02:00
arch1t3cht b150b6bfc7 po/de: Add missing space 2023-05-01 17:08:33 +02:00
Oneric a6cf70ba59 po/make_pot: also update PO files
While meson already provides the aegisub-update-po target
for this exact purpose, it insists on also running meson’s
aegisub-pot target first, leading to missing translation strings.
2023-04-30 18:09:48 +02:00
Ananji Peixoto da Costa 0e9dd4b311 po/pt_BR: fix antes/depois confusion
pt_PT already uses the correct translation.
Cherry-picked-from: d771fb21af
2023-04-30 17:56:05 +02:00
Oneric 2f4258a8b4 po/de: add some trivial translations 2023-04-30 17:56:05 +02:00
Oneric 5b66d473d2 po/de: fix a few errors
Implements suggestions by arch1t3cht.
2023-04-30 17:56:05 +02:00
Oneric da9842b70c po/de: import German translation from wangqr’s fork
This fixes a bunch of misspellings, borked C format strings and
increases translation coverage from 1288/1612 to 1516/1612
where still missing strings mostly don’t exists in wangqr’s build.

Original commit:
98abe53b15
2023-04-30 17:56:05 +02:00
Oneric 6b3cb7ec63 po: regenerate pot and po files
Using make_pot.sh and
  msgmerge --no-fuzzy-matching --sort-by-file $i.po aegisub.pot
since meson’s aegisub-pot target are still not covering all
translatable strings yet.
2023-04-30 17:56:05 +02:00
Oneric bc3358fcfe po/make_pot: increase portability across shells
Base POSIX leaves the handling of backslahes in the operand
implementation defined. The XSI extension specifies several
escape sequences, like e.g. \n, which shall be transformed
upon printing.
Current make_pot.sh expects XSI behaviour and indeed e.g.
dash’s echo builtin implements this. echo builtins of other common
shells such as bash however, do not (by default). Avoid this portability
pitfall by just using printf at all relevant places. See:
  https://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
  https://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html

This also allows us to stop substituting each backslash with four
backslashes before piping to maybe_append. This substituion existed
to safely pass backslahes through maybe_append’s two layers of echo.

Also improve quoting. For consistency prefer single-quote quoting over
shell backslash escapes. QUote the unguarded *.lua to ensure it will
continue to work if there happen to be any lua files in the scripts
working directory.

This supersedes commits from wangqr/Aegisub which adjusted quoting and
echo usage to work with different shells. This is more throughout and
doesn't introduce semi-broken intermediate states.
  0fbcaea871
  4aee271d03
  940181c7bc
(Note the second commit actually didn't manage to achieve the intended
portability, since several echo usages remained and it forgot to adjust
the backslash substitution, which was then fixed in the third commit.)
2023-04-30 17:46:20 +02:00
Oneric f417f6f1ad po/Make_pot: replace xmlstarelet+jq with gettext
gettext can deal with AppData (and other XML files)
since version 0.19.6 (2015). We already depend on gettext anyway so
let’s utilise this, to get rid of two build dependencies and simplify
the extraction logic.
This depends on the removal of underscore prefixes
as done in a prior commit.

After this the developer name "Aegisub Group"
is now also treated as a translateable string.
2023-04-30 17:40:55 +02:00
Oneric 6d9901ee3c po/make_pot: use gettext to process desktop file
gettext understands desktop files since 0.19 (2014),
so there’s no need for custom grep logic. This change
matches meson’s i18n which also uses gettext for this.

As a side efffect of this some long strings now get
broken into multiple lines (cosmetic only) and some
blank line gaps are normalised by gettext.

Cherry picks: 0e29c8d0e4
With fixups from: e98b7292f1
2023-04-30 17:38:28 +02:00
Oneric afa290ecfb po/make_pot: don't silently omit strings if utilities are missing
Instead abort the script on any errors, which
also helps detecting other unexpected errors.

Adopts parts of: 940181c7bc
  and 4aee271d03
2023-04-30 17:10:27 +02:00
Oneric 87d810254c po/make_pot: sort lua files in POT
find may output matching files in any order.
To avoid unnecessary changes between regeneration
sort its output. For C++ sources xgettext’s --sort-by-file
already has an equivalent effect. All other files are already
statically listed in a fixed order.

Adopts part of: 4aee271d03
2023-04-30 17:10:27 +02:00
Oneric 5c00368e85 build: consider all translation keywords for C++
And document which aprts are still missing.
The keyword list is are copied from make_pot.sh.
Sorting by file helps keeping future PO(T) update diffs small'ish
and is also done in wangqr’s PO-file update procedure. (POT file
generation also sorts, but by preapplying `LC_ALL=C sort` to the
file list instead of using xgettext’s sorting option.)

Without this, meson’s aegisub-pot missed the majority of translatable
strings from C++ sources. While this brings the target much closerto
make_pot.sh, the remaining strings aren't straigthforward to integrate
unfortunately. At the time of writing meson has no support for iss files
and make_pot.sh uses custom logic to select only specific strings
from Lua and JSON files.

Even after this commit, POT updates should
thus still continue to use make_pot.sh.
2023-04-30 17:10:24 +02:00
Oneric 8c35b1d642 Integrate appdata.xml into meson build
It used to be genrated and installed by the old custom build system,
but apparently got lost in switching to meson.

Rename to .in.in instead of .template.in, since i18n otherwise gets
utterly confused failing to recognise the file type and both erroring
out with "no ITS rules found" during merge_file and failing to extract
any translatable strings.
Also drop underscores which were previously processed by intltool.

This doesn't yet automatically replace the release version and date
in the appdata file, but neither did the old build.

Note: while this slightly improves the situation, meson’s aegisub-pot
target is still missing many strings. make_pot.sh should be used.
2023-04-30 03:09:56 +02:00
Oneric 2b33e45f23 Update links in appdata.xml 2023-04-30 03:09:56 +02:00
Oneric 66efa84eed Integrate desktop file translation into meson
meson’s i18n module get’s confused by .template and fails
to extract translatable strings, thus rename to in.in.

Note: while this slightly improves the situation, meson’s aegisub-pot
target is still missing many strings. make_pot.sh should be used.
2023-04-30 03:09:56 +02:00
Oneric 429455263f Fix generation and translation of desktop file
a91c4f70c3 switched processing of the
desktop file from intltool to gettext-backed i18n.merge_file and dropped
leading underscores which used to be processed by intltool.

However, this commit omitted dropping the underscore from Keywords,
resulting in this field being stripped from the installed version.

Furthermore, make_pot.sh was broken since it too relied on the
underscore meaning POT regeneration will now remove the desktop files
strings from translation files.
Since it was not added to po/POTFILES meson’s native aegisub-pot target
also doesn't add desktop file strings to the translation pool. Though,
this target still misses a lot of other strings as well and shouldn't be
used yet anyway.

This commit removes leftover underscores and reintegrates desktop file
strings into both make_pot.sh. Integration into aegisub-pot is done in a
follow-up commit.
2023-04-30 03:09:56 +02:00
arch1t3cht db0e79323f Merge branch 'vapoursynth' into feature 2023-04-29 21:28:36 +02:00
arch1t3cht 3d278547fe vapoursynth: Add Mac support 2023-04-29 21:24:14 +02:00
arch1t3cht ff20805ae6 Merge branch 'vector_clip_actions' into feature 2023-04-29 01:16:08 +02:00
arch1t3cht 20cc0b8077 perspective tool: Support drawings
This will not work in more complex cases like lines containing both text
and drawings, but it's correct in simpler ones.
2023-04-29 01:11:38 +02:00
arch1t3cht 9c2d6169c6 perspective tool: Fix uninitialized variable 2023-04-29 01:11:15 +02:00
arch1t3cht 82dffcb9f9 Disallow negative spacing in style editor again
Since it turns out that this is not supported by the renderer anyway,
see arch1t3cht/Aegisub#48 .
2023-04-27 16:02:26 +02:00
arch1t3cht 00e241d74b Merge branches 'video_panning_option' and 'bestsource' into feature 2023-04-23 15:39:41 +02:00
arch1t3cht 0c057ebddb bestsource: Unify some messages with ffms2's 2023-04-23 15:39:11 +02:00
arch1t3cht 0f13a75a42 video zoom: Fix reset command capitalization 2023-04-21 22:59:02 +02:00
arch1t3cht 18fd966bd9 Merge branch 'bugfixes' into feature 2023-04-21 16:38:55 +02:00
arch1t3cht 165cb14879 Add AppImage build on linux
This consists of a meson option that
- sets a flag to make Aegisub read paths relative to the executable
- makes meson set up the symlinks like AppRun and .DirIcon as following
  the AppDir format

and a CI workflow that builds with this option, installs to an AppDir
directory, and bundles it as an AppImage.

Modified from arch1t3cht/Aegisub#12 .

Co-authored-by: Fred Brennan <copypaste@kittens.ph>
2023-04-21 16:23:01 +02:00
arch1t3cht 43d65b906b Also detect fonts used in drawings in font collector 2023-04-07 18:49:09 +02:00
arch1t3cht 26a5f00c8a Merge branch 'bugfixes' into feature 2023-03-28 08:40:58 +02:00
arch1t3cht 8633e2c4ae mac: Statically link ffms2
This is to make sure we're building the git version that fixes the
PAFF seeking regression and contains the workarounds for VPX/AV1.
2023-03-28 08:39:04 +02:00
arch1t3cht 1de8d04a43 Merge branches 'bugfixes' and 'vapoursynth' into feature 2023-03-24 20:31:07 +01:00
arch1t3cht 883a1b2a73 installer and ci: Throw more errors on failure
This makes it easier to notice when installer generation failed.
2023-03-24 20:30:17 +01:00
arch1t3cht 0d5063bf79 Ship en_US hunspell dictionaries on Windows and OSX
For now, this uses the same OpenOffice dictionaries that were used in
previous official releases, downloaded from
https://sourceforge.net/projects/openofficeorg.mirror/files/contrib/dictionaries/
In the future this could be updated to some newer dictionary like
SCOWL's.

Fixes arch1t3cht/Aegisub#21.
2023-03-24 20:30:17 +01:00
LightArrowsEXE 178551071e make_keyframes: Set default format to GRAY8
This will allow clips with non-standard resolutions to be downscaled without any concerns.
2023-03-24 01:01:29 +01:00
arch1t3cht 9a7314015f vapoursynth: Unify capitalization 2023-03-24 01:01:29 +01:00
arch1t3cht af9d659c93 vapoursynth: Add try_get_keyframes function to aegisub_vs.py 2023-03-24 01:01:29 +01:00
LightArrowsEXE 84d67c73b0 make_keyframes: Set default format to GRAY8
This will allow clips with non-standard resolutions to be downscaled without any concerns.
2023-03-16 15:14:08 +01:00
arch1t3cht 256ddab369 vapoursynth: Ship plugins on windows and add ensure_plugin function 2023-03-16 02:26:10 +01:00
arch1t3cht 61b8a16cd8 vapoursynth: Unify capitalization 2023-03-16 02:26:10 +01:00
arch1t3cht 041e9fc70c vapoursynth: Add try_get_keyframes function to aegisub_vs.py 2023-03-16 02:26:10 +01:00
arch1t3cht e7e56ef5e0 Fix validation for perspective/lock_outer 2023-03-04 13:32:55 +01:00
arch1t3cht 5050bad8ac lua: Scroll large dialogs automatically 2023-03-04 12:52:46 +01:00
arch1t3cht d2c46f5dca bestsource: Forward error messages 2023-02-28 15:17:11 +01:00
arch1t3cht 798262ff1c Merge branch 'fixes' into feature 2023-02-25 12:33:15 +01:00
arch1t3cht 15d215f36d lua: Interact with clipboard on main gui thread
Fixes arch1t3cht/Aegisub#22 .
2023-02-25 12:31:27 +01:00
arch1t3cht fde3dd0dbf Merge branch 'fixes' into feature 2023-02-25 02:24:28 +01:00
arch1t3cht 7f52346f06 lua: Handle file dialogs completely on main gui thread
wx doesn't seem to like the dialogs being created on some other worker
thread, which makes file dialogs opened by lua scripts crash in various
ways on Linux. Doing everything on the main thread hopefully fixes this.

Fixes TypesettingTools/Aegisub#51 .
2023-02-25 02:22:13 +01:00
arch1t3cht 6f073c6a31 Merge branch 'vapoursynth' into feature 2023-02-24 01:42:58 +01:00
arch1t3cht 1f2eaaf6e4 vapoursynth: Show logged messages in progress window 2023-02-24 01:42:30 +01:00
arch1t3cht 097a0f45be vapoursynth: Remove file access checks
These are broken in some edge cases, such as smb mounts on Windows.
Paired with d96fc1f70d.
2023-02-24 01:42:30 +01:00
arch1t3cht 628d740108 vapoursynth: Add status dialog when running script 2023-02-24 01:42:30 +01:00
arch1t3cht ad38400ab9 vapoursynth: Improve default scripts and add utility functions
Add a utility library that wraps LWLibavSource and can parse its .lwi
file to obtain timecodes and keyframes. It also contains a function to
generate and save keyframes using WWXD or Scxvid. Update the default
scripts to use these functions.
2023-02-24 01:42:30 +01:00
arch1t3cht b5a646de66 Merge branch 'vapoursynth' (early part) into feature 2023-02-24 00:30:21 +01:00
arch1t3cht 8b605c8fb5 Merge branches 'workarounds', 'bestsource', 'misc', 'info', 'wangqr_gui', 'fixes' and 'avisynth' into feature 2023-02-24 00:29:28 +01:00
wangqr bf240c9770 Add Apply button to select lines dialog
Allow modifying selection without closing dialog.

Fix wangqr/Aegisub#49
2023-02-24 00:13:22 +01:00
wangqr c7d757b91e Save state of "show original"
Fix wangqr/Aegisub#41
2023-02-24 00:11:12 +01:00
arch1t3cht e425ce4d9e vapoursynth: Allow __aegi_timecodes to be a path to a timecodes file 2023-02-23 23:55:00 +01:00
arch1t3cht 29ba61e55d vapoursynth: Allow __aegi_keyframes to be a path to a keyframes file 2023-02-23 23:55:00 +01:00
arch1t3cht 384fc69208 vapoursynth: Allow script to supply timecodes, keyframes, and audio flag
These are read from the __aegi_timecodes, __aegi_keyframes, and
__aegi_hasaudio variables respectively.
2023-02-23 23:54:56 +01:00
arch1t3cht e994934e24 Link ffmpeg with dav1d to enable AV1 support.
The patched meson.build for dav1d just changes the include_directories
from 'include/dav1d' to 'include' and, while we're at it, removes the
pkg_config stuff to avoid a deprecation warning.

AV1 decoding is pretty broken in upstream ffms2, so point the wrap to a
fork that has some hack patches for it. BestSource works fine out of the
box, though.
2023-02-20 17:16:23 +01:00
arch1t3cht d399e44061 bestsource: Always get exact duration
Fixes arch1t3cht/Aegisub#27.
2023-02-13 17:05:05 +01:00
arch1t3cht 7485ae46a1 bestsource: Fix timecode computation
(derp.)

Fixes arch1t3cht/Aegisub#27.
2023-02-13 13:34:08 +01:00
arch1t3cht 1734f00d8a Don't assume a max length in fs::ShortName 2023-02-12 15:05:21 +01:00
arch1t3cht 6874419564 Make touch pad scroll in the subtitle grid smoother 2023-02-10 00:55:44 +01:00
arch1t3cht 9a9cc66b27 README: Add required vapoursynth plugins for default script 2023-02-09 12:50:49 +01:00
arch1t3cht d7e7c3a7f0 Set longPathAware in manifest 2023-02-09 02:36:39 +01:00
arch1t3cht 464c4f9f4e Add manifest as regen dependency 2023-02-09 02:36:39 +01:00
arch1t3cht 6704a8e57d avisynth: Remove file access checks
These are broken in some edge cases, such as smb mounts on Windows.
Paired with d96fc1f70d.
2023-02-08 17:41:31 +01:00
arch1t3cht d96fc1f70d Don't try other providers after FileNotFound error
Otherwise this can cause confusing error messages from unrelated
providers when simply opening an invalid path.
2023-02-08 17:37:44 +01:00
wangqr e4f0a9a510 Fix initial state of AudioTimingControllerDialogue
It should not be in alt-dragging mode by default.

Fix TypesettingTools/Aegisub#32
2023-02-08 00:50:48 +01:00
arch1t3cht c348f8582a vapoursynth: Add a preferred cache directory and clean it when necessary 2023-02-05 02:32:57 +01:00
arch1t3cht 32aaf6372c vapoursynth: Set path variables and import path in python 2023-02-05 02:28:06 +01:00
arch1t3cht 15f4da61d3 bestsource: Clean index cache when necessary 2023-01-31 02:47:02 +01:00
arch1t3cht 5dfa94d22d Fix missing comma in videoList
... ever wondered why you can't drag .webm files into Aegisub?
This is why.
2023-01-31 02:06:54 +01:00
arch1t3cht e2fb3a7e43 bestsource: Pin wrap
This is to fix upstream not compiling against ffmpeg 4.4 anymore.
2023-01-30 17:22:43 +01:00
arch1t3cht 66c90b7ed8 vfr: Ensure nonzero denominator 2023-01-30 01:56:52 +01:00
arch1t3cht 88867d402c vapoursynth: Default to 25fps when no clip fps set
This matches the behavior of the FFMS video provider.
2023-01-30 01:55:22 +01:00
arch1t3cht 79a0655eb8 Merge branch 'folding' into feature 2023-01-27 02:55:50 +01:00
arch1t3cht 57572e5686 Merge branch 'vector_clip_actions' into feature 2023-01-26 23:34:27 +01:00
arch1t3cht a632f5f7ee Revert "Merge branch 'vector_clip_actions' into feature"
This reverts commit bd4e79fdf9, reversing
changes made to 9d4a67b523.
2023-01-26 23:34:14 +01:00
arch1t3cht c6b901dfbe Merge branches 'bugfixes', 'workarounds', 'fixes', 'gui', 'xa2-ds', 'avisynth', 'vapoursynth' and 'video_panning_option' into feature 2023-01-26 23:12:07 +01:00
arch1t3cht 86dfadb852 Merge branch 'misc' into feature 2023-01-26 23:11:37 +01:00
arch1t3cht cd8169bdf2 Merge branch 'cibuilds' into feature 2023-01-26 23:05:17 +01:00
arch1t3cht 0485c1aaf0 ci: Run on every push
There's no monthly time limit anymore, so there's no harm in just
building on feature.
2023-01-26 23:02:49 +01:00
arch1t3cht 12a5050365 Point Yutils to fixed fork 2023-01-26 23:02:11 +01:00
arch1t3cht d860c710c0 Throw shit at the wall until it builds with boost 1.81
This is nothing more than duct tape, do not pull.
In the long run boost::filesystem should just be replaced with
std::filesystem (as done in tgoyne/Aegisub:cmake), but this would
complicate the history and cause merge conflicts for a bunch of pulls.
Hence this horrible temporary solution.
2023-01-26 22:56:53 +01:00
arch1t3cht 0d16753d0a Patch ffmpeg wrap to make it find the zlib subproject 2023-01-26 22:56:53 +01:00
arch1t3cht 5c065dc74e Revert "Patch ffmpeg wrap to compile with simd extensions"
Support for these has been added upstream now.
This reverts commit 77cc1a6b22.
2023-01-26 22:56:53 +01:00
arch1t3cht 5dd001388b Revert "ffmpeg wrap: pin version"
This reverts commit 74d75a568e.
2023-01-26 22:56:53 +01:00
arch1t3cht f6954ab903 Point ffi-experiments to fixed fork 2023-01-26 22:56:53 +01:00
arch1t3cht 36a18e5ba3 meson: revert icu detection in harfbuzz 2023-01-26 22:56:53 +01:00
arch1t3cht 60897b2327 meson: Set NDEBUG on release builds
The old MSVC build system also set this:
6f546951b4/build/standard-settings.props (L62)
2023-01-26 21:04:04 +01:00
arch1t3cht 642251b2dd Deduplicate automation autoload path
Fixes TypesettingTools/Aegisub#168
Fixes arch1t3cht/Aegisub#15
2023-01-26 20:52:20 +01:00
arch1t3cht 36e5275418 visual tools: Add perspective tool 2023-01-25 23:24:11 +01:00
arch1t3cht 352e41f19b video zoom: Fix zoom when script_res != video_res 2023-01-20 00:18:51 +01:00
arch1t3cht 4c2b47d5de visual tools: Fix grid in RotateXY tool
Fix the grid scaling when the video is not at 100% zoom, and scale the
grid with \fscx / \fscy .
2023-01-14 14:20:24 +01:00
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 8fc301fad4 ci: Use GITHUB_TOKEN if available 2023-01-12 13:36:39 +01:00
arch1t3cht d08726606f meson: Also add regen dependencies for bitmaps 2023-01-10 21:47:29 +01:00
arch1t3cht c0f337a992 Allow '+' and 'E' in numbers when tokenizing drawings 2023-01-07 14:42:52 +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 6d83aa9101 Update CI actions versions 2022-12-01 21:36:09 +01:00
arch1t3cht 74d75a568e ffmpeg wrap: pin version 2022-11-30 22:58:08 +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 b3b4b96238 Fix HDD audio cache provider when channels > 1 2022-11-15 18:31:19 +01:00
arch1t3cht c0edbb2710 Fix syntax highlighting with empty clip 2022-11-09 09:36:45 +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 fca902b0a1 CI-Build 2022-11-04 2022-11-04 00:48: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 277d1e15cd CI-Build 2022-11-02 2022-11-03 00:03:36 +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 4edd619229 README: Typo fix 2022-11-02 23:08:36 +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 a0d381019f README: wangqr_gui and some general info 2022-11-02 19:50:25 +01:00
arch1t3cht 245cc68afa Fix FrameAtTime computation for CFR
The new formula is just the inverse function of the CFR part of
the TimeAtFrame function.

To see how the previous implementation was faulty, see either the added
tests, or
- In Aegisub, open a dummy video with a frame rate of 23.976
- Make a subtitle event with start time 04:44.41
- Double-click the line to (supposedly) seek to its first frame
- This will seek one frame earlier than it should, and the event will
  not be displayed on the resulting frame.
2022-11-02 02:19:38 +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 231706239f CI-Build 2022-10-11 2022-10-11 19:09:43 +02: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 2f31bfc565 CI-Build 2022-09-27 2022-09-27 23:50:14 +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 961b3dfbee README: workarounds branch 2022-09-27 22:40:04 +02:00
arch1t3cht 22fb4c6e8c Move luabins back to vendor
Workaround for TypesettingTools/Aegisub#162
2022-09-27 16:54:15 +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 fb7f4bdd9a installer: Bump VCRedist to 17 (2015 - 2022)
The windows-latest platform in the CI already uses VS2022, so let's bump
the VCRedist to match.
2022-08-28 00:36:51 +02:00
arch1t3cht 7721ae689f Fix Avisynth paths for portable build
Also apply the change in 75db50b to the portable build.
The .mo files, on the other hand, already work as they are.
2022-08-26 15:17:59 +02:00
arch1t3cht 0dddddf96b CI-Build 2022-08-23 2022-08-23 20:21:29 +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 ec23330b09 CI-Build 2022-08-22 2022-08-23 04:54:35 +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 1d1a1d2ad7 CI-Build 2022-08-22 2022-08-22 02:26:38 +02:00
arch1t3cht 1dbd3b3cc7 Merge branches 'fixes' and 'ffmpeg_build' into feature 2022-08-22 02:26:03 +02:00
arch1t3cht 77cc1a6b22 Patch ffmpeg wrap to compile with simd extensions
This is very hacky and only intended to get these extensions working on
the Windows CI builds.
2022-08-22 02:25:25 +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 b52d1d0973 CI-Build 2022-08-19 v2 2022-08-19 02:35:05 +02:00
arch1t3cht 3b8cc6deb1 Merge branches 'misc', 'xa2-ds' and 'info' into feature 2022-08-19 02:31:59 +02:00
arch1t3cht 918c1e23a3 README: misc branch and compile instructions 2022-08-19 02:28:27 +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 34d339c187 CI-Build 2022-08-18 2022-08-18 18:12:06 +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 00ee2b1ab8 CI-Build 2022-08-16 v2 2022-08-17 03:12:56 +02:00
arch1t3cht 50fb12d433 Merge branches 'fixes' and 'info' into feature 2022-08-17 03:09:39 +02:00
arch1t3cht 1e958cd1a1 Typo fix 2022-08-17 02:59:15 +02:00
arch1t3cht b697ad6ca0 Remove access checks in windows fs operations
These were giving false negatives on samba shares, which broke the font
collector. Windows also recommends to not use access checks in these
cases, and instead just see if the operations succeeds or not.
2022-08-17 02:54:09 +02:00
arch1t3cht 860a090de8 CI-Build 2022-08-16 2022-08-16 21:10:03 +02:00
arch1t3cht 3e5b985c7b Merge branch 'info' into feature 2022-08-16 21:04:46 +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 afbd626e40 README: New audio+video interfaces 2022-08-16 20:54:49 +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 e4261faf73 bestsource: Add jannson wrap 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
arch1t3cht fb24bcda6d Delete CMakeLists
The file was mistakenly added when pulling wangqr's "time to video"
feature. I fixed the branch, but instead of merging the whole branch
again, let's just delete the file here.
2022-08-15 21:23:42 +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 3fb2eacf95 CI-Build 2022-08-13 2022-08-13 23:04:01 +02:00
arch1t3cht 53466be0ca Merge branch 'avisynth' into feature 2022-08-13 23:03:33 +02:00
arch1t3cht ad443dd118 avisynth: Properly destruct the IScriptEnvironment
Starting with AVISYNTH_INTERFACE_VERSION=5, this is how script
environments should be deleted. The previous code was causing crashes
when unloading AviSynth in certain scenarios, such as when failing to
open a file due to an incorrect path.
2022-08-13 22:53:58 +02:00
arch1t3cht 95bd0edbdd Merge branch 'lua_api' into feature 2022-08-13 21:00:21 +02:00
arch1t3cht 0376c56a95 Lua docs: Typo fix 2022-08-13 21:00:13 +02:00
arch1t3cht ce1b3a0158 avisynth: Validate downmix option
Because... let's maybe not let users make Aegisub call arbitrary
symbols in avisynth.dll/so just by editing the config.json.
2022-08-13 01:06:24 +02:00
arch1t3cht fe285678a3 avisynth: Allow compilation on Linux
Co-authored-by: wangqr <wangqr@wangqr.tk>
2022-08-13 01:06:24 +02:00
Ristellise 6906b6e5d7 [Shinon] Enable Directsound2 player to use more than 1 channel audio.
- DS2 Player has a similar structure to XAudio, so I don't see any reason why not to enable 1 channel+ audio.
 - Haven't tried with 5.1 channel sources but I believe it should be the same as 2 channel (As in, Directsound will downmix the audio to 2 channel)
 - Moved the volume setting to using the player directly and from some quick audio tests, -10000 is too soft. I tried with -5000 instead which seems to be alright.
2022-08-11 12:28:35 +08:00
Ristellise 994e50048a Finish up XAudio with a round of bugfixes 2022-08-10 21:23:56 +08:00
Ristellise fd28458ed8 Implement wangqr Audio Changes:
- To allow for XAudio2 to work properly, we need to rework how does provider work since they only are used to be able to take in mono audio.
 - Other providers have been dumbed down to accept single channel audio since originally aegisub only accepted 1 channel audio.
 - meson.build has been modified to accommodate for xaudio, as we currently don't accept redistributable forms of xaudio, we need to work around the WinNT version.
 - There has been 1 more fix to res.rc to allow for compiling on non tagged releases.
2022-08-10 21:09:41 +08:00
Ristellise 3dfea0c315 Add XAudio2 2022-08-10 16:31:02 +08:00
arch1t3cht 80e8ad0103 Merge branch 'folding' into feature 2022-08-08 16:40:24 +02:00
arch1t3cht 663112ba03 folding: Don't drop folds starting at the very first line 2022-08-08 16:38:43 +02:00
arch1t3cht 31271676b3 CI-Build 2022-08-07 2022-08-08 02:21:40 +02:00
arch1t3cht 17d50d49ef Merge branch 'lua_api' into feature 2022-08-08 02:19:40 +02:00
wangqr e2a49b3313 Avisynth audio provider: add option to allow no downmix 2022-08-08 01:38:20 +02:00
wangqr 691ab820b8 Handle exceptions from AviSynthWrapper ctor 2022-08-08 01:38:01 +02:00
sepro 8e1cc6228e Add automation function to get frame 2022-08-08 01:30:15 +02:00
arch1t3cht bde149fd30 lua: Function returning if the file is modified 2022-08-08 01:00:08 +02:00
arch1t3cht 4e8c02d38f CI-Build 2022-08-01 2022-08-01 23:24:30 +02:00
arch1t3cht e8493975e2 Merge branch 'lua_api' into feature 2022-08-01 23:24:16 +02:00
arch1t3cht 64ba5b1e36 Merge branch 'info' into feature 2022-08-01 22:15:34 +02:00
arch1t3cht 8dbf6a4fb7 README: lua_api, wangqr_time_video, and the zlib linker bug 2022-08-01 22:15:22 +02:00
arch1t3cht 69d79ac0cf Merge branch 'wangqr_time_video' into feature 2022-08-01 22:09:29 +02:00
arch1t3cht 84d90ce80b Merge branch 'video_panning_option' into feature 2022-08-01 21:56:24 +02:00
wangqr c232ef6bb6 Fix syntax error in e2ea84541f 2022-08-01 21:43:26 +02:00
Oneric 61c6303a14 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-01 21:43:26 +02:00
Oneric 7a729532b4 AlignToVideo: Improve rgb->lab precision 2022-08-01 21:43:26 +02:00
Oneric e098342f54 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-01 21:43:24 +02:00
wangqr b5e7bbc5ad Submit "align to video" on double click
Fix wangqr/Aegisub#34
2022-08-01 21:43:17 +02:00
wangqr 42248eabad Remove the trailing period in help text of time/align
Fix wangqr/Aegisub#7
2022-08-01 21:43:17 +02:00
wangqr 68166c7581 Fix missing config option for Align on macOS 2022-08-01 21:43:17 +02:00
wangqr c71e140c41 Fix errors in AlignToVideo
* Call TimeAtFrame with correct parameter
* Fix syntax error
2022-08-01 21:43:17 +02:00
Charlie Jiang 3dcab8b9bd Merge remote-tracking branch 'origind-dev/master'
Add align to video function
2022-08-01 21:43:15 +02:00
arch1t3cht c07a648270 Add options to commit or reverse video zoom 2022-08-01 21:21:24 +02:00
arch1t3cht fa33b07c7f Add option toggling behaviour of Ctrl+Zoom 2022-08-01 21:00:53 +02:00
arch1t3cht feab1a5663 Add documentation for text selection api 2022-08-01 20:48:15 +02:00
arch1t3cht b61f8946c1 Merge branch 'folding' into feature 2022-08-01 20:06:24 +02:00
arch1t3cht fd1a92d627 Folding: Fix default hotkeys 2022-08-01 20:05:55 +02:00
arch1t3cht c0fa794e45 Lua: Functions to set text selection and cursor
Putting this logic for delaying changes in the TextSelectionController
isn't the cleanest, but all attempts at saving this state somewhere in
the Lua API instead turned out even worse. Also, the logic for inverted
selections probably does belong in there.
2022-08-01 19:56:53 +02:00
arch1t3cht 4a928674cd Merge branch 'folding' into feature 2022-07-31 21:31:44 +02:00
arch1t3cht 7c92e6bbd6 Folding: Dont error on missing _foldinfo 2022-07-31 21:31:34 +02:00
arch1t3cht d0c8ffd1af CI-Build 2022-07-30 2022-07-30 13:47:56 +02:00
arch1t3cht 4b9c50a702 Merge branch 'vector_clip_actions' into feature 2022-07-30 13:46:04 +02:00
arch1t3cht af009c4ce7 Make line tool the default vector clip tool again 2022-07-30 13:45:49 +02:00
arch1t3cht 32dda63971 Merge branch 'misc_dc' into feature 2022-07-30 13:07:42 +02:00
arch1t3cht a6af313cf2 Merge branch 'info' into feature 2022-07-30 13:06:58 +02:00
arch1t3cht a37f84215d Typo fix 2022-07-30 03:36:33 +02:00
arch1t3cht 9177943c76 Update README: ffms2 and misc_dc 2022-07-30 01:51:46 +02:00
Asada shinon ba3a3dc80a Parse mixin lines as template lines 2022-07-30 00:57:15 +02:00
arch1t3cht aeaab655eb Fix segfault when stereo downmixing 2022-07-30 00:45:49 +02:00
Ristellise f06e42a82e [Shinon] Change Mono Downmixing to Stereo Downmixing 2022-07-29 23:21:55 +02:00
wangqr dabd9f699f 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
2022-07-29 23:18:56 +02:00
Asada shinon d0efa0494a Save vector clips with two decimal places
Co-authored-by: arch1t3cht <arch1t3cht@gmail.com>
2022-07-29 21:50:10 +02:00
Asada shinon 58a6cf4793 Added new hotkey command to reload current font provider. 2022-07-29 20:51:37 +02:00
arch1t3cht 32fc7abd2d Explain the problems with adding new forks 2022-07-27 17:06:32 +02:00
arch1t3cht 58d6fa456e CI-Build 2022-07-27 2022-07-27 15:28:12 +02:00
arch1t3cht 11b5a80618 Merge branch 'folding' into feature 2022-07-27 15:27:04 +02:00
arch1t3cht ca462c2a24 Merge branch 'info' into feature 2022-07-27 15:26:37 +02:00
arch1t3cht 0926f84d0e Merge branch 'spectrum-frequency-mapping' into feature 2022-07-27 15:26:36 +02:00
arch1t3cht 8ca6ec1884 Merge branches 'vector_clip_actions' and 'color_picker_fix2' into feature 2022-07-27 15:26:34 +02:00
arch1t3cht 9cc3fe9e71 Merge branches 'video_panning_option', 'bugfixes' and 'avisynth' into feature 2022-07-27 15:26:33 +02:00
arch1t3cht e65e55833c Fix compilation for older C++ 2022-07-27 15:23:47 +02:00
arch1t3cht 818fcd51f4 Folding: Toggling folds by clicking the indicator 2022-07-27 15:23:47 +02:00
arch1t3cht 2176954aee Folding: Pass fold data through Lua
This way, automation scripts won't nuke the fold data on any lines they
modify.
This is done as userdata for now, so scripts that don't know what
they're doing don't break the folds even further. If scripts get more
access to folds, it should be with a safer and simpler API.
2022-07-27 15:23:47 +02:00
arch1t3cht 56cc1a6873 Add line folding
Line folds are managed using metadata of AssDialogue elements, and
saved in the project properties. They only affect the appearance of the
subtitle grid, and have no impact on other line operations.
2022-07-27 15:23:47 +02:00
arch1t3cht 1772dd17ae Use std::this_thread everywhere
The previous logic wouldn't compile on linux using clang.

With the meson build requiring c++14, there's no need for platform
specific code. Really, the entire agi::util::sleep_for function could be
removed entirely, but I'll keep the patch minimal for now.
2022-07-27 15:20:03 +02:00
arch1t3cht 4f9b23ab1f Readme 2022-07-27 02:00:23 +02:00
arch1t3cht 2234068202 Allow vertical audio zoom with Shift+Mouse Wheel 2022-07-26 23:38:27 +02:00
arch1t3cht ff46b860a2 Add option toggling behaviour of Ctrl+Zoom 2022-07-20 14:38:31 +02:00
arch1t3cht 7ea9b95fe0 Clean up pointer code
The previous one was remnant of scrapped code.
2022-07-19 02:45:04 +02:00
arch1t3cht 2c296afdb8 Add option to restrict color picker to window 2022-07-19 02:41:50 +02:00
arch1t3cht 238dbb386d Restrict color picker's screenshot to window
This fixes issues like Aegisub/Aegisub#264 with taking
screenshots on linux, especially with wxgtk3 or wayland.
2022-07-18 20:21:04 +02:00
arch1t3cht eb07b3f9b8 Show hotkeys for vector clip tools
Move the function to generate toolbar tooltips listing hotkeys to the
command class, so it can be used outside of toolbar.cpp .
2022-07-12 16:54:04 +02:00
arch1t3cht 7da4493a0f Use command metadata for vector clip toolbar
This cuts down on the data duplication for the command names and help
texts, at the expense of copying a bit of code from the general toolbar
logic.

Modifying the toolbar Populate() function to also add additional buttons
appears very hard or impossible.
2022-07-12 16:49:22 +02:00
arch1t3cht 10d233d3e2 Add bindable commands for visual vector clip tools 2022-07-12 16:49:22 +02:00
arch1t3cht 77af0c40dc Use public enum for visual clip tool modes 2022-07-12 16:49:22 +02:00
arch1t3cht 86354050f3 meson: Use depend_files for files in respack manifest 2022-07-10 23:00:52 +02:00
arch1t3cht ba0db4da70 Also add Video Pan option on OSX 2022-07-10 22:57:55 +02:00
arch1t3cht 21591b3e88 meson: Use depend_files for files in respack manifest 2022-07-07 10:33:36 +02:00
Eli Schwartz 8336c7d97c meson: use best practices lookup for iconv support
Meson 0.60.0 adds support for an "iconv" dependency that always does the
right thing for you, so that you don't need to think about it. It also
has some side advantages:
- you can do dependency fallback, and --force-fallback-for=iconv works
- it logs one line, not two, and that is "dependency found? yes or no"

Since Aegisub doesn't mandate the use of such new versions of Meson, we
cannot assume the dependency works. Instead, adapt to the version of
Meson being used: on new enough versions of Meson, use the new
dependency, but on older versions of Meson, use the pre-existing logic,
which isn't as nice but has been producing correct results so far.
2022-07-07 00:08:24 -07:00
arch1t3cht e644227e95 avisynth: Remove option to allow ancient versions
- This refers to AviSynth < 2.5.6, which is from before 2005
- With the current setup (using GetAVSLinkage, these versions wouldn't
  work anyway)
- The latest AviSynthPlus is bundled with the installer anyway
2022-07-05 02:01:35 +02:00
arch1t3cht 635503affe meson: Add files in manifest as respack.py input
This makes meson detect changes to files like default_config.json
and rebuild libresrc.cpp when necessary.
2022-07-05 01:35:08 +02:00
arch1t3cht e240a5fdc2 avisynth: Update headers and fix playback
- Build the latest AviSynth headers using CMake, as proposed in #134
- Add and initialize AVS_Linkage to fix video loading

Video and audio playback now works in most cases, but still crashes for
some files.
2022-07-05 01:12:10 +02:00
arch1t3cht 142605cf41 meson: Add files in manifest as respack.py input
This makes meson detect changes to files like default_config.json
and rebuild libresrc.cpp when necessary.
2022-07-04 22:22:01 +02:00
arch1t3cht fdcb0ee75f meson: Fix compliation with avisynth enabled
Still crashes when loading a video.
2022-07-03 17:49:46 +02:00
arch1t3cht 5bde34ff3e macos: attempt to fix the installer build
Try and fix an issue when a symlink would link to a path with the same
basename, without actually having a mac system available to test.
2022-07-02 19:58:43 -07:00
arch1t3cht 2bf4f17e58 ci: Don't abort if one of the matrix runs fails 2022-07-02 19:58:43 -07:00
arch1t3cht cfd93ce81b meson: Use latest git version for ffms2
This is to include the fix for FFMS/ffms2#394 .
2022-07-02 19:58:43 -07:00
arch1t3cht 6e811ef6a7 Fix compile error on linux 2022-07-02 19:58:43 -07:00
arch1t3cht 9fef97a5bb installer: update paths to mo files
Meson's i18n module changed its output paths here:
487d45c1e5
2022-07-02 19:58:43 -07:00
arch1t3cht 75db50b6ed installer: update paths to Avisynth libaries
The folder structure of the release archives changed with
AviSynth+ 3.7.1.
2022-07-02 19:58:43 -07:00
TRAMBO 4776ca9dd1
Fix errors when automation scripts being loaded and os.execute not working (#156)
* fix errors when automation scripts being loaded and os.execute not working

* Update unicode-monkeypatch.lua
2022-06-08 08:36:49 -07:00
Oneric e5dee3fbe2 meson: bump ffmpeg wrap
meson-4.4 contains a fix regarding the prefix kwarg
with newer Meson versions not present in the 4.3 branch.
2022-06-08 01:10:11 -07:00
Oneric 85ce9663a6 Pass storage size to libass to fix rendering
Since ASS rendering depends on the storage size of the video libass
needs to know about it to render the subtitles correctly. If it isn't
told about the storage size libass uses the value from PlayRes{X,Y} as
a guess, but this isn't always correct.
With Aegisub currently always rendering at storage resolution
this ends up the same as the frame size.
2022-06-08 01:10:11 -07:00
Sodra 03ffce8a89 Fixing zoom when panning is off 2022-03-02 19:02:21 -08:00
Sodra bb5081189e Fix video panning option. Oops teehee ptep~ 2022-03-02 18:36:38 -08:00
Sodra b332181937 Added option to enable video panning 2022-03-02 18:24:17 -08:00
moex3 36f7e102e2 Revert "Add reset hotkey as Ctrl-R" / Not needed
This reverts commit 3d525d9938790211b02a31a16d716498957891fc.
The default hotkey is not required. People can just add a custom one
from the hotkey settings if they want this.
2022-03-02 15:02:02 -08:00
moex3 0b8586e90d Add reset hotkey as Ctrl-R
I'm not entirely sure, that this is how it's supposed to be added.
This requires editing the already existing hotkey.json file (shows path
in log, if it exists).
Should this also be added to hotkey.cpp?
2022-03-02 15:02:01 -08:00
moex3 14d078fb9f Fix a zooming bug on linux
The preview window would change in width, when the video was being zoomed.
Possibly, because on windows, zooming only calls UpdateSize once, but on
linux, it gets called multiple, like 8 times.
Rounding fixed it.
2022-03-02 15:02:01 -08:00
moex3 09ea0f54d3 Make zooming feel more linear
with a "good enough" implementation
2022-03-02 15:02:00 -08:00
moex3 db6297c8c3 Make zooming center around the cursor position 2022-03-02 15:01:59 -08:00
moex3 4f6836da9c Make video zoom different from preview window zoom 2022-03-02 15:01:59 -08:00
moex3 70ddf3c7f5 Respect min. zoom value when changing pan coords 2022-03-02 15:01:58 -08:00
moex3 d73dfe9c18 Change pan values with the zoom level changes 2022-03-02 15:01:58 -08:00
moex3 808ead65bf Fix crosshair drawing
I'm not sure about that scale_factor, i don't know how to test that
2022-03-02 15:01:57 -08:00
moex3 0ec0f20695 Fix mouse position bug when videoAr > displayAr
Crosshair drawing is broken when videoAr != displayAr
2022-03-02 15:01:56 -08:00
moex3 5f95f76671 Change tab to spaces 2022-03-02 15:01:55 -08:00
moex3 f3d796a3e3 Add menu item for resetting the video pan 2022-03-02 15:01:54 -08:00
moex3 e3949cdaa1 Add video panning 2022-03-02 15:01:48 -08:00
EleonoreMizo bfcd8a3e2c
Merge branch 'master' into spectrum-frequency-mapping 2021-11-29 22:27:26 +01:00
Oleg Oshmyan f21d8a3607 meson: use OpenAL.framework on macOS
It is not picked up by the existing dependency() check because its
version is unknown to Meson, which fails the version constraint.
Besides, dependency('openal') seems to try "openal.framework",
which may or may not work on case-sensitive file systems.
2021-11-10 20:12:21 -07:00
Oleg Oshmyan 1d01f8adc8 meson: allow unconstrained dependency version to be "unknown"
And allow for compound version constraints in the future.
2021-11-10 20:12:21 -07:00
Oleg Oshmyan 18503946d5 meson: don't check disabled dependencies at all
Don't search for the dependency and set up fallback
only to throw it away if the option is disabled.
This is a waste, and this gives the user the illusion
that the request to disable the feature was ignored.
2021-11-10 20:12:21 -07:00
woclass e58e4a9149
Fix Mac dmg build (#138)
* [mac/build] update build steps

* [macos] bundle app

* [macos] build dmg

* [ci] setup macOS CI

* [i18n] TODO: rm WX locale files

* [deps] set main branch to main

* Fix osx-fix-libs.py

Create symbolic links, to make libicu happy
Rewrite the script in python3, as python2 is deprecated

* Add write permission before install_name_tool when doing osx-bundle

Fix wangqr/Aegisub#39

* Handle @loader_path in libboost on macOS

See wangqr/Aegisub#39

* [tools/mac] use python3

* [ci/mac] install & using system deps

* [ci/win] don't build fribidi:docs

* [ci/mac]  trying openal-soft

* [ci/mac] use pulseaudio in CI

* [ci/win] only run aeg's test

* [ci/win] fix CI

* [ci/win] fix CI: not use dict `{}`

* [ci] run ci

* [ci/win] don't build docs

* [ci/win] remove args tail newline

* [ci/win] false->disabled

* Use md title format

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>

* Recover file permissions.

* [ci/win] disable fontconfig

Co-Authored-By: Ryan Lucia <ryan@luciaonline.net>

* [ci/win] disable libass:fontconfig

Co-authored-by: wangqr <wangqr@wangqr.tk>
Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
2021-10-12 03:37:49 -04:00
woclass 0dffcec461
Fix meson warning (#126)
* [git] ignore IDE setting, Meson subprojects

* [win_installer] rename *.mo -> *.gmo

* [win_installer] only add aeg translations

* [win_installer] split aeg/wx translations

* [win_installer] gen & pack translations

* [git] ignore hunspell source dir

* [git] ignore uchardet source dir

* [test] Generate the test executable

run with `meson test`

* [test] add tools to remove test data files

`unset.bat FULL_PATH`

* [test] set to correct Error type

* [test] Set Source character sets to UTF-8 for MSVC

* [test] move test data files to build_root

* [meson/wxWidgets] fix warning: deprecated feature `cmake_options`

* [meson] fix warning:  msvc does not support C++11

* [meson/fribidi] add original meson.build file

* [meson/fribidi] merge pr-151

https://github.com/fribidi/fribidi/pull/151
"meson: add fribidi_static_cargs to extra_cflags"

* [meson/fribidi] fix DEPRECATION

"Library fribidi was passed to the "libraries" keyword argument of a previous call to generate() method instead of first positional argument."

* [git]  rm IDE dir

* [meson] remove old flags

* [meson] fixed in upstream
2021-05-24 09:47:34 -04:00
woclass 7e9c7d7aa0
Run tests (#125)
* [git] ignore IDE setting, Meson subprojects

* [win_installer] rename *.mo -> *.gmo

* [win_installer] only add aeg translations

* [win_installer] split aeg/wx translations

* [win_installer] gen & pack translations

* [git] ignore hunspell source dir

* [git] ignore uchardet source dir

* [test] Generate the test executable

run with `meson test`

* [test] add tools to remove test data files

`unset.bat FULL_PATH`

* [test] set to correct Error type

* [test] Set Source character sets to UTF-8 for MSVC

* [test] move test data files to build_root

* [git] remove IDE dir

* [git] ignore gtest subprojects

* [ci] run test in ci

* [meson/test] use more meaningful name

* [test] Add more comments and help msg
2021-05-23 23:33:33 -04:00
Myaamori dfb0a1ca99 meson: don't use deprecated get_pkgconfig_variable 2021-05-23 18:37:36 -04:00
Myaamori 2c927bac32 meson: make --force-fallback-for=luajit work
This option makes the dependency() call resolve to the subproject
which breaks the Lua 5.2 compatibility check.
This change just ignores the result of the dependency() call
if it resolves to the subproject and then re-fetches it
with a subproject() call later.
Alternatively we could explicitly handle the case where dependency()
resolves to the subproject, but that's just extra code for no
observable difference in behaviour.
2021-05-23 18:37:36 -04:00
clr134 28e3e75c44
Polish translation corrections (#130) 2021-05-23 17:33:04 -04:00
Vardë 3c17671ad0
Updates French translation (#121)
* Updates French translation

* Missing spelling mistake

* Additional adjustments

* Improvements (#1)

Co-authored-by: Vardë <Ichunjo@users.noreply.github.com>

Co-authored-by: anne-o-pixel <81879599+anne-o-pixel@users.noreply.github.com>
2021-05-23 04:54:46 -04:00
woclass 52c8fef28c
Generate Win portable.zip (#124)
* [git] ignore IDE setting, Meson subprojects

* [win_installer] rename *.mo -> *.gmo

* [win_installer] only add aeg translations

* [win_installer] split aeg/wx translations

* [win_installer] gen & pack translations

* [git] ignore hunspell source dir

* [git] ignore uchardet source dir

* [win_installer\portable] add new target `meson win-portable`

+ meson install copy `include/unicode-monkeypatch.lua`

* [win_installer\portable] make aegisub-portable-64.zip

+ remove WinRAR deps

* [win_installer\portable] using powershell

* [git] upload portable.zip

* [win_installer\portable] rm freetype

* [repo] remove Optional dependencies: WinRAR

* [repo] Update README.md, add cmd to gen zip file

* [repo] use recommended build command

* [git] remove IDE dir

* [ci] add Windows portable installer build step
2021-05-23 04:37:54 -04:00
Yi-Jyun Pan 761194025f meson: luajit: allow to build in ARM64
Meson thought that a ARM64 cpu is aarch64, while
luajit only provided a file for "arm64". Since there is
no difference but the name between aarch64 and arm64, I
choose to bind aarch64 -> arm64.

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2021-05-23 04:32:54 -04:00
woclass 62c3acb666
Fix localization file generation on Windows (#119)
* [git] ignore IDE setting, Meson subprojects

* [win_installer] rename *.mo -> *.gmo

* [win_installer] only add aeg translations

* [win_installer] split aeg/wx translations

* [win_installer] gen & pack translations

* [git] ignore hunspell source dir

* [git] ignore uchardet source dir

* [git] remove IDE dir

* [git] remove unused subprojects
2021-05-23 02:06:10 -04:00
Ryan Lucia aeba7a390e Re-enable MacOS CI 2021-05-22 02:48:27 -04:00
Ryan Lucia a856030078 Switch to new boost tarball hosting 2021-05-21 21:52:18 -04:00
Myaamori 84ac716972 meson: add uchardet port
Meson port instead of using CMake as I ran into issues with the
src directory (where uchardet.h is located) not being appended
to the include path, and on Windows I ran into a Meson issue
where a -D macro definition was being interpreted as a filename.
In the end a Meson port seemed simpler than working out the CMake
issues, as the CMakeLists.txt files were straightforward and easy
to port.

Note that because of the directory structure of the uchardet source
I had to change the include directive from uchardet/uchardet.h
to just uchardet.h. This is actually more in line with the uchardet
pkg-config file, which appends /usr/include/uchardet to the include path.
2021-05-21 21:09:36 -04:00
Myaamori c43e4fba3c meson: add Hunspell port
This moves the visibility logic (HUNSPELL_STATIC/BUILDING_LIBHUNSPELL)
to the build system. Only relevant on Windows.
2021-05-21 21:09:36 -04:00
Myaamori 0f95589d0a meson: Fix Windows artifacts 2021-05-21 21:07:22 -04:00
Myaamori b00f5dd58e meson: add option to specify wxWidgets version 2021-04-09 18:00:01 -04:00
Ryan 696a732840 Add new unicode script to installer 2021-03-27 14:56:04 -04:00
Ryan 7def61d46f Update README for Windows 2021-03-27 14:55:52 -04:00
Myaamori 3dfc553880 Fix faux bold logic in font collector for Fontconfig
Based on libass's logic (a requested weight of over 150 more than
the matching font).
2021-03-27 12:38:50 -04:00
Myaamori 4b2cd7f170 Convert OpenType weight to Fontconfig weight in font collector
Fixes #108
2021-03-27 12:38:50 -04:00
Ryan 7a27ee7823 meson: add -DLUAJIT_UNWIND_EXTERNAL for MacOS/Linux 2021-03-27 12:34:18 -04:00
Ryan 9d1b28f5a7 Delete luajit patch files 2021-03-27 12:34:18 -04:00
Ryan 51494a07d9 lua: run unicode-monkeypatch on Windows when loading scripts 2021-03-27 12:34:18 -04:00
Ryan 8394f1adca Monkeypatch script fixes 2021-03-27 12:34:18 -04:00
Ryan e929e4a75c meson: copy monkeypatch script 2021-03-27 12:34:18 -04:00
Ryan 4648e8cc5b meson: add new luajit string buffer files 2021-03-27 12:34:18 -04:00
Ryan Lucia b7f6ac42e4 Add lua monkeypatch for Unicode support on Windows 2021-03-27 12:34:18 -04:00
Ryan Lucia 84beba20cb meson: fix luajit 64-bit builds
Upstream defines ENDIAN_LE or ENDIAN_BE always, so assume little endian. x86_64 defaulting to x86 seems to just be a mistake
2021-03-27 12:34:18 -04:00
Ryan ef64307ba1 Switch to upstream LuaJIT
This does not yet handle the patching, but should build without issue
2021-03-27 12:34:18 -04:00
Ryan 48c3acd3aa actions: disable MacOS
The LTO change broke this somehow, but disable until I can investigate why
2021-03-27 09:31:10 -04:00
Ryan f5122a3927 meson: copy automation files to build directory
This enables running Moonscript on Windows builds without relying on system files
2021-03-27 09:30:21 -04:00
Ryan d32ef75cba meson: move executable to the root directory 2021-03-27 09:29:37 -04:00
Ryan 1246534b7b Move AddSeparator to VisualTool::SetToolbar
Co-authored-by: wangqr <wangqr@wangqr.tk>
2021-03-27 08:09:11 -04:00
Ryan Lucia c218db6f34 meson: disable LTO by default 2021-03-06 14:57:27 -05:00
petzku 19429b0f6e Fix negative margin handling (closes #104)
Previously, margins were clamped to 0..9999, but negative margins are
well supported by most renderers.  In addition, previously lua
automations automations were able to produce these negative margin
values, and they would be saved correctly. However, re-opening the file
would clamp the values, and they could not be edited in the edit box.

This commit changes the clamping to be -9999..99999, and allows entering
(and editing) negative values in all relevant fields. In addition, this
makes the subtitle edit box margin fields take 5 characters instead of 4
to accommodate negative numbers up to 9999 (also the reason for raising
the upper bound).
2021-03-06 14:29:18 -05:00
Ryan Lucia 8fa0fa352b meson: generate osx-bundle.sed 2021-02-27 21:11:56 -05:00
Ryan Lucia dc3ffa30af actions: stylistic cleanup 2021-02-27 20:21:29 -05:00
Ryan Lucia 43751546f4 spectrum view: allow 32-bit wxBitmap
Required on MacOS
2021-02-22 14:29:14 -05:00
Ryan Lucia 2abb098bd1 meson: improve iconv detection 2021-02-22 14:26:03 -05:00
Myaamori c6f4ea45aa Let search field in Hotkeys menu expand horizontally
On Linux with wx 3.1 it was too small to use by default
2021-01-31 19:34:47 -05:00
Myaamori ca7501c7ed Remove unused alignment flags for combo boxes in resampler
Causes an assertion error with wx 3.1
2021-01-31 19:34:47 -05:00
Ryan Lucia c32c612dc3 meson: set dataroot correctly for osx bundle 2021-01-30 16:22:05 -05:00
Ryan 1fd574f556 win_installer: don't include arch in file name 2021-01-30 12:20:24 -05:00
Ryan b72f02b9f2 meson: reorder nasm download to work with global args 2021-01-30 12:11:34 -05:00
Ryan 248785d7ad meson: apply manifest on windows 2021-01-30 12:02:34 -05:00
Ryan 36b75b827d meson: fix warnings, cleanup 2021-01-30 12:02:18 -05:00
Ryan 73ad926880 meson: define CSRI_NO_EXPORT earlier in setup 2021-01-30 09:12:13 -05:00
Ryan 2cb759a6e2 win_installer: set directory correctly after DepCtrl checkout 2021-01-30 09:11:34 -05:00
Ryan e186fa4627 meson: disable CSRI on non-windows for now 2021-01-30 09:04:22 -05:00
Ryan 1ac52a24d6 meson: disable gdi_fontselect for now
This one continues to be controversial, so for now the plan will be to report issues upstream that come up as a result of this being removed
2021-01-30 08:58:45 -05:00
Ryan 7d9feca578 meson: add CSRI support 2021-01-30 08:57:39 -05:00
Ryan d8c348e897 meson: standardized config defines to set integer 1 2021-01-30 08:56:01 -05:00
Ryan f3958288ac libresrc: put new wxBitmap constructor behind wx version check
Based off https://github.com/Aegisub/Aegisub/pull/175
2021-01-30 07:29:45 -05:00
Ryan 8d8ea166df lua: remove usage of luaL_reg in favor of luaL_Reg
The former was deprecated with 5.1, and removed entirely in later versions and in LuaJIT
2021-01-30 07:25:06 -05:00
Ryan 7640576cc9 meson: use conf object for defines where appropriate 2021-01-30 07:25:03 -05:00
Ryan 8acc8be2ba win_installer: checkout DepCtrl 0.6.3 2021-01-17 09:53:19 -05:00
Ryan 73c54cef99 win_installer: use plain aegisub.exe everywhere 2021-01-17 09:53:01 -05:00
Ryan 1981f4db3e win_installer: fix vc redist name in run section to match source 2021-01-17 09:30:26 -05:00
Ryan bec44eaab8 meson: define P_LOCALE 2021-01-16 13:15:05 -05:00
Ryan b8d1864a07 aegisub: ifdef wxBitmap constructor to scale on MacOS only
Quick fix to unblock the build; need better HiDPI handling across the board
2021-01-16 13:01:51 -05:00
Myaamori b42da504a0
Save unexpanded path in font collector (#79)
Fixes #78
2021-01-16 06:13:37 -05:00
Ryan 35b2ca5532 win_installer: fix paths for Avisynth+ dlls
3.7.0 changed the layout, so just match the new one
2021-01-16 06:02:32 -05:00
Ryan 1384123e2d iconv wrapper: allocate a smaller buffer on the stack 2021-01-16 05:31:08 -05:00
Ryan 8b8f4a3925 meson: bump minimum ffms2 version to 2.22
It's been out for 6 years, so this should be fairly safe. Also fix a build error that somehow snuck in during the merge
2021-01-16 05:31:08 -05:00
Ryan 6660594f64 Update URLs to point at the main repo 2021-01-16 05:31:08 -05:00
Ryan 308ef6cbb0 meson: promote dirent wrap 2021-01-16 05:30:59 -05:00
Ryan d583744b69 Merge in work from TypesettingTools fork 2021-01-16 02:12:31 -05:00
Ryan a2da1616c0 meson: set minimum win version to 7
I think setting it at 8 was accidental? This matches the installer, so we should be consistent throughout
2021-01-16 01:26:19 -05:00
Ryan 25a62f4f12 libass_gdi_fontselect: don't redefine NOMINMAX
It's now defined in the build system itself
2021-01-16 01:24:19 -05:00
Ryan 417ba4ff2d actions: change branch to master 2021-01-10 03:14:12 -05:00
Ryan 2211b7a0a5 README: update for macOS with meson 2021-01-10 03:14:12 -05:00
Ryan 4b1d23e6be actions: add separate debug/release lanes
No debug on Windows because the container isn't powerful enough
2021-01-10 03:14:12 -05:00
Ryan 7f46b687e1 meson: remove libass dirent patch
Handled more properly in libass itself
2021-01-10 03:14:12 -05:00
Ryan 1a5c19c4d7 actions: force LFS 1.8.0 on macOS 2021-01-10 03:14:12 -05:00
Ryan 28bc329678 actions: apt-get update on ubuntu 2021-01-10 03:14:12 -05:00
Ryan a77f7d48df meson: update to reflect fixes in dependencies 2021-01-10 03:14:12 -05:00
Ryan Lucia bc079922c0 actions: Enable OSX CI 2021-01-10 03:14:12 -05:00
Ryan Lucia b51463a5f5 meson: Fix build on OSX 2021-01-10 03:14:12 -05:00
Ryan Lucia c487dd2bdb Parially revert fffb138b81
I haven't checked whether reverting this breaks IME input, and if it doesn't what changed on wx's end. However, this is the commit that uses private symbols, and so reverting it lets us build against upstream wx. Even if this is a loss in functionality, for now it's fine.
2021-01-10 03:14:12 -05:00
Ryan f240c01cbc meson: only manually set _DEBUG on non-windows 2021-01-10 03:14:12 -05:00
Ryan 56581fbce3 actions: invoke win-installer correctly, install innosetup on ci 2021-01-10 03:14:12 -05:00
Ryan 32729800df actions: build as release for Windows CI 2021-01-10 03:14:12 -05:00
Ryan 9211b7b632 win-installer: fix warnings 2021-01-10 03:14:12 -05:00
Ryan 8cf4100c87 meson: fix resource file compilation
This enables video to load correctly in Windows builds
2021-01-10 03:14:12 -05:00
Ryan 106c753782 actions: support installer generation on CI 2021-01-10 03:14:12 -05:00
Ryan a3ec466ff6 meson: fix Windows installer generation
This includes some miscellaneous cleanup to the installer files as well
2021-01-10 03:14:12 -05:00
Ryan 72edb88982 meson: add Avisynth option, compile libass_gdi_fontselect
Sadly, building with Avisynth is still broken.
2021-01-10 03:14:12 -05:00
Ryan Lucia 44fdeb361f actions: upload artifacts 2021-01-10 03:14:12 -05:00
Ryan Lucia 194521e777 meson: set wx subproject buildtype, remove d_vscrt hack 2021-01-10 03:14:12 -05:00
Ryan Lucia 47f7aa879d README: update Windows section to reflect the switch to Meson 2021-01-10 03:14:12 -05:00
Ryan Lucia 89c788a4b3 autotools: remove remaining makefiles 2021-01-10 03:14:12 -05:00
Ryan Lucia c5111b492b actions: force fallback for harfbuzz 2021-01-10 03:14:12 -05:00
Ryan Lucia 4dc65303a1 actions: force default_library=static for freetype 2021-01-10 03:14:12 -05:00
Ryan Lucia cd0eee968f meson: minor subproject cleanup, update gitignore 2021-01-10 03:14:12 -05:00
Ryan Lucia f91f6f0743 meson: pass png=enable to freetype2 to work around bug
See https://savannah.nongnu.org/bugs/?59458
2021-01-10 03:14:12 -05:00
Ryan Lucia 18ccc1d7f0 meson: disable building ffmpeg tests 2021-01-10 03:14:12 -05:00
Ryan Lucia 8a09d00081 actions: enable MSVC 2021-01-10 03:14:12 -05:00
Ryan Lucia 3f1c315dfe meson: force zlib subproject for freetype 2021-01-10 03:14:12 -05:00
Myaamori abec21f4e0 meson: fix wx subproject on Linux 2021-01-10 03:14:12 -05:00
Myaamori aecf09a64d Use wxSizer::RepositionChildren instead of RecalcSizes on wx 3.1.3+ 2021-01-10 03:14:12 -05:00
Myaamori 93b2794c85 Correct wxStyledTextCtrl::StartStyling for wx 3.1 2021-01-10 03:14:12 -05:00
Myaamori 6ff1729303 meson: update/promote libass dependency wraps 2021-01-10 03:14:12 -05:00
Myaamori 8bb8b34fe7 meson: set _DEBUG on all platforms for debug builds 2021-01-10 03:14:12 -05:00
Myaamori 0ea6d36fca meson: don't generate git_version.xml and don't regenerate git_version.h on windows
Also fix incorrect use of return outside function. Fixes #80
2021-01-10 03:14:12 -05:00
Ryan Lucia 17303d3846 actions: add initial ubuntu workflow 2021-01-10 03:14:12 -05:00
Ryan Lucia 7d4c99db5a meson: switch to upstream freetype 2021-01-10 03:14:12 -05:00
Ryan Lucia daa4cc8bbc meson: search for 'system' module with system boost
System was made header-only by 1.74, so we can't check for it in the submodule, but when linking with older system boosts we need to make sure it gets linked in
2021-01-10 03:14:12 -05:00
Ryan Lucia dc3aaa5df0 meson: allow boost fallback under msvc 2021-01-10 03:14:12 -05:00
Ryan Lucia 454c79c8cc Remove travis file 2021-01-10 03:14:12 -05:00
Ryan Lucia 60431862fa meson: allow wx fallback on all platforms 2021-01-10 03:14:12 -05:00
Ryan Lucia 7d0028799f meson: remove old wx_path and icu_path hacks 2021-01-10 03:14:12 -05:00
Ryan Lucia e393509515 meson: default to buildtype debugoptimized 2021-01-10 03:14:12 -05:00
Ryan Lucia e3826cb17e meson: initial attempt to generate Aegisub.app on macOS 2021-01-10 03:14:12 -05:00
Ryan Lucia 8f42f11b11 Convert osx-fix-libs.py to py3 2021-01-10 03:14:12 -05:00
Ryan Lucia 9fd62692af win-installer: auto-populate current year for copyright 2021-01-10 03:14:12 -05:00
Ryan Lucia 2e898c461a win-installer: remove fragment_opengl 2021-01-10 03:14:12 -05:00
Ryan Lucia 0d45c67dcf meson: move all .desktop file work into linux conditional 2021-01-10 03:14:12 -05:00
Ryan Lucia 44af99a163 meson: move luabins to subprojects 2021-01-10 03:14:12 -05:00
Ryan Lucia e087728021 gitignore: mass purge, add .DS_STORE 2021-01-10 03:14:12 -05:00
Ryan Lucia 5ec5271eb5 meson: fix source file inclusion in libaegisub on osx 2021-01-10 03:14:12 -05:00
Myaamori 3147f303c8 meson: save git_version.xml to meson build directory in version.ps1 2021-01-10 03:14:12 -05:00
Myaamori d80b8d6de0 meson: use meson-pr branch for libass 2021-01-10 03:14:12 -05:00
Myaamori fa2c35a058 remove build, .nuget, Aegisub.sln 2021-01-10 03:14:12 -05:00
Myaamori 0e51dba59b meson: remove DUALNUM check from LuaJIT 2021-01-10 03:14:12 -05:00
Myaamori 5dff6c9234 update .gitignore 2021-01-10 03:14:12 -05:00
Myaamori 65fc7c0f30 meson: ignore second argument in version.ps1
for compatibility with bf2dca2e4c0
2021-01-10 03:14:12 -05:00
Myaamori b1c2fbdb19 meson: add nasm wrap for Windows 2021-01-10 03:14:12 -05:00
Myaamori 2510ef25c2 meson: patch libass with stub dirent.h
this should probably be handled by the libass meson port at some point
2021-01-10 03:14:12 -05:00
Myaamori 03de8929d4 meson: pin wx version and fix dependencies 2021-01-10 03:14:12 -05:00
Myaamori 441daf5aeb meson: use check_header to check for iconv
iconv is not a standalone library on Linux, so find_library is pointless
2021-01-10 03:14:12 -05:00
Myaamori 0b7e244232 meson: define fallbacks for optional dependencies 2021-01-10 03:14:12 -05:00
Myaamori 51b8248ac8 meson: create git_version.h in build directory in version.sh 2021-01-10 03:14:12 -05:00
Myaamori bb02d3bc5e meson: don't build with C11
C11 breaks the LuaJIT build
2021-01-10 03:14:12 -05:00
Myaamori f9f8b6c4d3 meson: add FFMS2 wrap 2021-01-10 03:14:12 -05:00
Myaamori ce791773f6 meson: add Boost wrap 2021-01-10 03:14:12 -05:00
Myaamori d6ee06eb54 meson: add ICU wrap 2021-01-10 03:14:12 -05:00
Myaamori 64df2d61c7 meson: have iconv subproject override iconv dependency 2021-01-10 03:14:12 -05:00
Myaamori 130339a3d6 meson: set correct flags when compiling LuaJIT on Windows 2021-01-10 03:14:12 -05:00
Myaamori 1fc019447a meson: enable Lua 5.2 compat for both native and host builds 2021-01-10 03:14:12 -05:00
Myaamori f6b74331da meson: update zlib wrapper 2021-01-10 03:14:12 -05:00
line0 2e613f5476 meson: flag aegisub as a GUI app 2021-01-10 03:14:12 -05:00
line0 bfdcbdefad meson: add missing link dependencies on windows 2021-01-10 03:14:12 -05:00
line0 88e24db733 meson: add support for building wxWidgets as a subproject (WIP)
monolithic build only and disabled precompiled headers due to limited cmake support in meson

still missing linker dependencies refs to Windows SDK libs
2021-01-10 03:14:12 -05:00
line0 37230683fb utils: work around missing C++11 char16_t overload in wx string conversion 2021-01-10 03:14:12 -05:00
line0 f039395003 meson: generate git_version header in build root rather than within the source tree
fixes an issue where the windows version of the git version update script generated the header in a place where it couldn't be found by the include in version.cpp
2021-01-10 03:14:12 -05:00
line0 18fe7918f3 meson: make boost honor the global default_library option 2021-01-10 03:14:12 -05:00
line0 23e86bf074 meson: build libiconv as static library 2021-01-10 03:14:12 -05:00
line0 e56ab6c784 meson: define BOOST_USE_WINDOWS_H on Windows
fixes symbol redefinition errors in VS 2019
2021-01-10 03:14:12 -05:00
line0 609d38e605 meson: update dependencies
switch back to official harfbuzz upstream now that meson has landed
2021-01-10 03:14:12 -05:00
line0 b6c0f2d544 meson: don't build fontconfig file lister on windows 2021-01-10 03:14:12 -05:00
line0 b8e2cf83fd fix PCHs on VS2019
* separate PCH for C and C++
* acconf.h now included in PCHs on windows, too
* meson now auto-generates companion source files for PCH headers
2021-01-10 03:14:12 -05:00
FichteFoll a91c4f70c3 Use i18n.merge_file for real
Requires gettext 0.19, which is available on all major linux dists.

Not compatible with autotools chain! (For now, anyway.)
2021-01-10 03:14:12 -05:00
FichteFoll 6343d36169 Add commented i18n.merge_file version
Using that makes use of gettext (and msgfmt) rather than intltool,
which is the proper way but requires a more recent gettext version and
I'm not comfortable adding that dependency for now.

Specifically, it would require updating the autotools chain as well
as the template files are incompatible.

See https://wiki.gnome.org/MigratingFromIntltoolToGettext for more info.
2021-01-10 03:14:12 -05:00
FichteFoll 650954f28e Move language specifications to LINGUAS file
This is required when using i18n.merge_file.
2021-01-10 03:14:12 -05:00
FichteFoll 443dd5146d Properly build aegisub.desktop 2021-01-10 03:14:12 -05:00
Ryan Lucia 9708ca8e5e Add virtual destructor to SignalBase
Quashes a frequent warning
2021-01-10 03:14:12 -05:00
Ryan Lucia 2cb6d5b814 meson: fix up OSX and non-MSVC detection 2021-01-10 03:14:12 -05:00
FichteFoll 9fdf490cff Use git rev-list to determine revision number 2021-01-10 03:14:12 -05:00
FichteFoll 8704f83743 Fix git_version.h generation 2021-01-10 03:14:12 -05:00
Ryan Lucia 5e14a9265b meson: attempt to wrangle dependencies 2021-01-10 03:14:12 -05:00
Ryan Lucia 7befd5e759 gitignore: mass cleaning 2021-01-10 03:14:12 -05:00
Ryan Lucia a853f7c4b0 Windows installer: always include vc+ runtime 2021-01-10 03:14:12 -05:00
Ryan Lucia 57e4f788d0 meson: update subprojects 2021-01-10 03:14:12 -05:00
Ryan Lucia 13711128fa meson: remove 'build_' prefix from option 2021-01-10 03:14:12 -05:00
Ryan Lucia 1599858c92 Make version.sh executable 2021-01-10 03:14:12 -05:00
Ryan Lucia 3b2d770d74 Fix PCH usage
Hopefully this time in a way that doesn't ruin life for Unix folks!
2021-01-10 03:14:12 -05:00
Ryan Lucia d2d3168904 meson: allow additional include directories for manually located deps 2021-01-10 03:14:12 -05:00
Ryan Lucia df396b67b2 meson: add Windows-specific project args 2021-01-10 03:14:12 -05:00
Ryan Lucia 2eaf9b0062 meson: fix option name lookup in build file 2021-01-10 03:14:12 -05:00
Ryan Lucia 9e284660b1 meson: add DirectSound detection 2021-01-10 03:14:12 -05:00
Ryan Lucia 9aeaceb6e7 meson: add basic libiconv subproject functionality 2021-01-10 03:14:12 -05:00
Ryan Lucia 631dad170f meson: fix luajit compiler args 2021-01-10 03:14:12 -05:00
Ryan Lucia d3c709a2ea Move iconv to subprojects 2021-01-10 03:14:12 -05:00
Ryan Lucia 608d0c9c15 Move hunspell to subprojects 2021-01-10 03:14:12 -05:00
Ryan Lucia 609f5be032 Move CSRI to subprojects 2021-01-10 03:14:12 -05:00
Ryan Lucia 6ca1d6463a Remove submodules 2021-01-10 03:14:12 -05:00
Ryan Lucia 42bfc53a77 meson: bump c++ version 2021-01-10 03:14:12 -05:00
Ryan Lucia 0be226aa6c meson: add wrapfiles for essential subprojects 2021-01-10 03:14:12 -05:00
Ryan Lucia 506bac365d meson: move luajit to subprojects directory 2021-01-10 03:14:12 -05:00
Ryan Lucia a9dfafd37a meson: fix syntax errors in packages/meson.build 2021-01-10 03:14:12 -05:00
Ryan Lucia 1a133cd567 meson: move version scripts to tools directory 2021-01-10 03:14:12 -05:00
Ryan Lucia c965171663 Remove autotools build system 2021-01-10 03:14:12 -05:00
line0 936b39303d PowerShell version script: work correctly from any cwd; do not error out when version.h doesn't already exist; adjust git_version.h and git_version.xml paths for meson build system 2021-01-10 03:14:12 -05:00
Ryan Lucia 613cef19a0 meson: rename option for optional dependencies 2021-01-10 03:14:12 -05:00
Ryan Lucia 7596a7c5e4 meson: remove 'static' option 2021-01-10 03:14:12 -05:00
Ryan Lucia f361138a4d Switch from combo option to feature where appropriate
Also remove the extra space before colons :)
2021-01-10 03:14:12 -05:00
Ryan Lucia 3b7724aab4 Fix spacing around colons in luajit subproject files 2021-01-10 03:14:12 -05:00
Ryan Lucia ddd6a4f289 Move version generation scripts up a level 2021-01-10 03:14:12 -05:00
Ryan Lucia 83fcab0775 Switch to newer path concatenation syntax 2021-01-10 03:14:12 -05:00
Ryan Lucia cde5778283 Make spacing around colons consistent 2021-01-10 03:14:12 -05:00
Ryan Lucia 68f5843117 Don't require fontconfig on windows 2021-01-10 03:14:12 -05:00
Ryan Lucia 02a2c12cee Enable version.ps1 on windows
version.ps1 itself still has to be modified to support out-of-tree builds
2021-01-10 03:14:12 -05:00
Ryan Lucia c564df55aa Bump Meson version
Build file was using a now-deprecated property
2021-01-10 03:14:12 -05:00
line0 2f13615342 add powershell version of build/version.sh 2021-01-10 03:14:12 -05:00
FichteFoll a6076ed580 Always build git_version.sh 2021-01-10 03:14:12 -05:00
Martin Herkt 2e3a78383f Fix fdo icon install path 2021-01-10 03:14:12 -05:00
Martin Herkt ca3802e82a Meson: respack.lua → respack.py; works out-of-tree 2021-01-10 03:14:12 -05:00
Martin Herkt 48af346e94 Meson: add gettext i18n 2021-01-10 03:14:12 -05:00
Martin Herkt 97b4dfb7f4 Meson: add install rules 2021-01-10 03:14:12 -05:00
Martin Herkt 8905921a2d Initial port of the build system to Meson
Still some TODOs left. Probably only works on Linux for now.
2021-01-10 03:14:12 -05:00
EleonoreMizo f9c8a7f6aa Spectrum display improvement
– Selection of different frequency mappings for the spectrum display,
from linear (current default) to logarithmic.
– Field added in the preference page to select the frequency mapping
– New preference key to remember this setting:
Audio/Renderer/Spectrum/FreqCurve
– Consistent display with high sampling rates (> 48 kHz)
– Fixed time shift with high quality settings
2020-12-15 20:11:58 +01:00
Andrew Neth d0bab1212c
Look for both system fonts and user fonts on Windows (#64)
* Look for both system fonts and user fonts on Windows

* Move repeated font registry reading code to separate function

* Pass the files vector to read_fonts_from_key as a reference

* Allocate a larger filename buffer when necessary while reading fonts from registry
2020-02-08 15:41:03 -05:00
Thomas Goyne 6f546951b4 Use appropriate DPI images in more places on macOS 2019-10-06 12:46:06 -07:00
Thomas Goyne 85f711fccc Adjust the index of the drag subtool button for the addition of the separator 2019-09-28 18:13:44 -07:00
Thomas Goyne 5da48d0f30 Don't call Realize() before setting the toolbar 2019-09-28 18:13:44 -07:00
Thomas Goyne 6ca879938d Always feed the entire file into uchardet when detection is needed
uchardet will report that a file is "ascii" if the first page has no bytes
>127, so we need to actually look at the entire file in case the first higher
byte is later in the file.
2019-09-28 18:13:44 -07:00
Thomas Goyne 8d17a0e88a Assume that files which start with a unicode BOM are valid files of that type 2019-09-28 18:13:44 -07:00
wangqr e1a8ab1c10 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-28 21:13:01 -04:00
wangqr 6d4dd60ce8 Handle video flip and rotate metadata in ffms2
Fix Aegisub/Aegisub#149
2019-09-22 17:41:05 -07:00
wangqr 57ee580c0f 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-22 17:41:05 -07:00
wangqr 336745cdb2 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-22 17:41:02 -07:00
wangqr 10f7458b5f Fix PCM provider bugs 2019-09-22 17:41:02 -07:00
wangqr 1122c0880a Fix failing unit tests on Windows 2019-09-22 17:41:02 -07:00
wangqr dd59fc988a Fix gtest setup.bat on Windows 2019-09-22 17:41:02 -07:00
wangqr 896011f535 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-22 17:41:02 -07:00
wangqr 7a1756a26f 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-22 17:41:02 -07:00
wangqr 6732179a8a Fix wrong memset usage 2019-09-22 17:41:02 -07:00
davste0816 72d0457bc8 Fix Move Down button in Export dialog 2019-09-22 17:41:02 -07:00
davste0816 073c06d812 Add .webm to extension list, add .eac3 as an audio format
Co-Authored-By: FichteFoll <fichtefoll2@googlemail.com>
2019-09-22 17:41:02 -07:00
davste0816 06798f2caf Recognize .opus as an audio format, .h264 .hevc as video formats 2019-09-22 17:41:02 -07:00
wangqr b3f0cb8953 Don't internally reset the selection after collected fonts
This creates an inconsistency between UI and internal mode.

Fix wangqr/Aegisub#10
2019-09-22 17:41:02 -07:00
wangqr 9ed381f498 Remove extra semicolon 2019-09-22 17:41:02 -07:00
wangqr b429645006 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-22 17:41:02 -07:00
wangqr 0a2a07ba7e 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-09-22 17:41:02 -07:00
wangqr 716c2eae0d Remove the usage of dummy wxTimerEvent 2019-09-22 17:40:47 -07:00
wangqr bb5090ac3a Detect EBML magic number to skip encoding detection for MKV
MKV loads slow after f733297499
2019-09-22 17:40:46 -07:00
wangqr d7139c40c0 Remove call to wxSizer::CalcMin and wxSizer::RecalcSizes
As they are used internally by Layout and should not be called
directly.
2019-09-22 17:39:43 -07:00
wangqr 73ca9ace1c 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-09-22 17:39:43 -07:00
wangqr 38046516b3 Fix FFT first sample location
Fix wangqr/Aegisub#1
2019-09-22 17:39:43 -07:00
wangqr 698c41afef Fix iconv ConversionFailure on long path 2019-09-22 17:39:43 -07:00
Ryan Lucia 293673fef1 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-09-22 17:39:43 -07:00
Ryan Lucia 2411617158 Properly ignore ASS whitespace characters in character counter 2019-09-22 17:39:43 -07:00
Ryan Lucia af5d34cc1d Add configuration options for colors in visual typesetting tools 2019-09-22 17:39:43 -07:00
Ryan Lucia 1ce72a6d6e Update default config to modern standards 2019-09-22 17:39:43 -07:00
Ryan Lucia ebea3905cc Use FFMS2 constant in place of magic number 2019-09-22 17:39:43 -07:00
Ryan Lucia 4f870f9c26 Ignore VS build files
Most files were moved to .vs directory with VS15
2019-09-22 17:39:43 -07:00
Ryan Lucia f2ca259a8b 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-09-22 17:39:43 -07:00
Ryan Lucia 04a193de4d Point users at a functional bug tracker 2019-09-22 17:39:43 -07:00
Ryan Lucia 63d267d359 Fix line order when splitting after current frame 2019-09-22 17:39:43 -07:00
Ryan Lucia b2dd50e910 Use proper event for DoubleUpdater
Previously changes weren't recognized because the event bound was for integers
2019-09-22 17:39:43 -07:00
Ryan Lucia 66a3748f97 Remove dead forums link 2019-09-22 17:39:43 -07:00
Ryan Lucia bc649b6063 Make translation assistant skipping whitespace an explicit setting 2019-09-22 17:39:43 -07:00
Ryan Lucia 30286e7035 Remove Force BT.601 option and update color matrix guessing 2019-09-22 17:39:43 -07:00
Ryan Lucia d660f7f2b0 Add support for setting status bar text from Lua 2019-09-22 17:39:43 -07:00
wangqr d0c05fbcde Update about dialog 2019-09-22 17:39:43 -07:00
wangqr 17215edc31 Fix build warnings 2019-09-22 17:39:43 -07:00
wangqr faad82e1ec Fix overflow bound 2019-09-22 17:12:05 -07:00
wangqr 5d4973a5f6 Fix millisecond to centisecond convertion
Fix Aegisub/Aegisub#94
2019-09-22 17:12:05 -07:00
wangqr d89c1ce900 Change some text box size to make it looks better on HiDPI 2019-09-22 17:12:05 -07:00
Thomas Goyne 4897905287 Install autopoint on travis 2019-09-22 16:44:03 -07:00
darealshinji 7c43c757ce don't be too pedantic on the OpenAL checks 2019-09-22 19:35:40 -04:00
scx 547b17fc22 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 #131
2019-09-22 19:34:23 -04:00
scx c3c446a8d6 Fixes for Boost 1.69.0 2019-09-22 19:33:36 -04:00
darealshinji 7094bd1e20 Add configure option to enable portable builds on Linux 2019-09-22 19:26:50 -04:00
Yakauleu Uladzislau 565b7cb86e Added Belarusian Localization 2019-09-22 19:23:39 -04:00
scx 0847acc53f Add missing AM_GNU_GETTEXT_VERSION macro
Bug: http://devel.aegisub.org/ticket/1914
2019-09-22 19:22:33 -04:00
scx 67d9fd9aa4 DataBlockCache: Fix crash in cache invalidation (#142)
The original version uses a reverse iterator,
whose .base() is invalid after KillMacroBlock() erases it.
2019-09-22 19:19:56 -04:00
scx cb0af6ca35 Fix crash on right click due to no spell checker
See: #131
2019-09-22 19:17:39 -04:00
scx 0418d0b5be Desktop file: make Keywords translatable 2019-09-22 19:16:23 -04:00
scx eeb3e17b73 Update desktop file
- Add Keywords
 - Add StartupWMClass
 - Update Categories
2019-09-22 19:16:23 -04:00
scx 7ea2c09afa make_pot.sh: Check presence of xmlstarlet and jq 2019-09-22 19:15:36 -04:00
scx c3a4a9122c Integrate AppData file with build system 2019-09-22 19:15:36 -04:00
scx 0a1b93860b Add AppData file template 2019-09-22 19:15:36 -04:00
wangqr 42552e5efb 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-09-22 19:12:23 -04:00
wangqr 3782b906d7 Fix travis-ci build script 2019-09-22 19:12:23 -04:00
Ryan Lucia d9bd7def0b Fix autotools lua detection 2019-09-08 18:36:58 -04:00
Ryan Lucia 5ed4838d00 Convert osx-fix-libs to py3 2019-05-16 18:11:03 -04:00
Ryan Lucia 5005d6d2a2 Set visual tool default feature color correctly
Fixes #50
2019-05-16 18:10:43 -04:00
Ryan Lucia fb02d6855c Fix compilation on Mojave 2019-05-16 17:41:18 -04:00
Ryan Lucia a5228d8d44 Update OSX build instructions
Two notable changes: attempting to forcibly link icu4c no longer works for :reasons:, so you have to manually add it to the pkg-config and compiler/linker search directories. Additionally, homebrew removed build options from most packages as part of https://github.com/Homebrew/homebrew-core/issues/31510, and this includes luajit and boost. The former builds with gc64 by default on HEAD, and the latter with icu4c support by default, so this actually somewhat simplifies things.
2019-05-16 14:46:26 -04:00
davste0816 c2085d139c Fix Move Down button in Export dialog 2019-05-12 11:56:13 -04:00
davste0816 b107077b20 Add .webm to extension list, add .eac3 as an audio format
Co-Authored-By: FichteFoll <fichtefoll2@googlemail.com>
2019-05-12 11:55:48 -04:00
davste0816 0e6b492735 Recognize .opus as an audio format, .h264 .hevc as video formats 2019-05-12 11:55:48 -04:00
Martin Herkt a78f5d2760 DataBlockCache: Fix crash in cache invalidation
Fixes #33
2019-05-03 20:51:23 -04:00
FichteFoll 75fc5f38d7 Adjust boost gil header paths for boost 1.69
boost/gil.hpp was added in 1.68 and boost/gil/gil_all.hpp removed in
1.69.
2019-01-31 19:47:00 -05:00
Ryan Lucia 7853e7abe2 Update libass
Worth noting that this does NOT currently build, thanks to a few lines in libass that are not compatible with vc++. I'll bump the libass commit when MrSmile's pr gets merged and this is remedied. You can apply this commit to remedy that: 5317a8dd89
Also worth noting that while libass switched to nasm, I haven't done so here because it wasn't worth the effort, so I just made a questionable change to the yasm.targets to emulate nasm behavior
2019-01-07 21:48:50 -05:00
Ryan Lucia 7147038e0a Fix luajit build flags
Notably, don't build the dynamic library and enable 5.2 compatibility features
2019-01-07 21:48:50 -05:00
Ryan Lucia 3ba7358bfe Use FFMS2 constant in place of magic number 2019-01-07 21:48:50 -05:00
Ryan Lucia a1ec3767e4 Remove compatibility with old versions of FFMS2
2.22 was released oct 2015, so I think a more recent version is a fairly safe assumption
2019-01-07 21:48:50 -05:00
Ryan Lucia ad52260665 Ensure FFMS always indexes video tracks
Matching historical behavior with DoIndexing, which is assumed throughout the codebase
2019-01-07 21:48:50 -05:00
Ryan Lucia 5a554a586e Excise the hopefully last mention of ASSDraw 2019-01-07 21:48:50 -05:00
Ryan Lucia 826a360b8d Revert to dynamically linking the vc runtime 2019-01-07 21:48:49 -05:00
Ryan Lucia 628962559d Update strip-icu to python 3 2019-01-07 21:48:49 -05:00
Ryan Lucia 129e748abd Update uchardet 2019-01-07 21:48:49 -05:00
Ryan Lucia 9638bfbef4 Update ffmpeg and ffms2 2019-01-07 21:48:49 -05:00
Thomas Goyne f99711aca8 Bump _WIN32_WINNT to Vista 2019-01-07 21:48:49 -05:00
Thomas Goyne 6496414e61 Update freetype2 2019-01-07 21:48:48 -05:00
Thomas Goyne 2cb92a5f74 Bump _WIN32_WINNT to Vista 2018-11-23 09:22:18 -08:00
Thomas Goyne ebc76c8a11 Update ffmpeg and ffms2 2018-11-23 09:22:18 -08:00
Thomas Goyne 6afb851365 Update freetype2 2018-11-23 09:22:18 -08:00
Ryan Lucia 26ccf0b8e5 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
2018-11-17 19:27:25 -05:00
Ryan Lucia 08ebcf4693 Remove assdraw from default toolbar 2018-11-17 17:54:17 -05:00
Ryan Lucia a9eba14df5 Remove assdraw and forums from default menu
Reflects changes previously made to remove those elements from Aegisub
2018-11-17 15:57:48 -05:00
Ryan Lucia 9d579e15ec Add installer vendor folder to gitignore 2018-11-17 15:56:34 -05:00
Ryan Lucia c6d50332e8 Modify organization for installer requirements, minor installer clean-up 2018-10-06 03:57:04 -04:00
Ryan Lucia 6e0706939e More cleanup efforts on the installer scripts
Untested, probably still needs work
2018-10-05 21:16:30 -04:00
line0 e2bd1283c6 add DependencyControl plus requirements to windows installer; also split features in components and drop 32-bit support 2018-10-05 21:15:12 -04:00
Ryan Lucia 2961ea1947 Update VS project to properly locate fribidi headers 2018-10-05 20:56:13 -04:00
Ryan Lucia 5c1566752a Ignore VS build files
Most files were moved to .vs directory with VS15
2018-10-05 17:51:55 -04:00
bkbkb 2ce503ebe7 Fix fribidi download link 2018-09-23 20:20:05 -04:00
darealshinji c3e03f3039 Update config.sub, config.guess, install-sh (#77) 2018-09-23 20:19:33 -04:00
bkbkb 83736b4866 Fix fribidi download link 2018-07-29 21:39:15 -07:00
Thomas Goyne 524c6114a8
Merge pull request #80 from jbeich/boost
Unbreak build against Boost 1.68
2018-07-09 15:06:51 -07:00
Jan Beich d8336d2fed Keep using std::distance after Boost 1.68
src/search_replace_engine.cpp:256:14: error: call to
      'distance' is ambiguous
                                count += distance(
                                         ^~~~~~~~
/usr/include/c++/v1/iterator:511:1: note: candidate function [with _InputIter =
      boost::u32regex_iterator<std::__1::__wrap_iter<const char *> >]
distance(_InputIter __first, _InputIter __last)
^
/usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate function [with SinglePassIterator =
      boost::u32regex_iterator<std::__1::__wrap_iter<const char *> >]
        distance(SinglePassIterator first, SinglePassIterator last)
        ^
2018-07-09 20:17:59 +00:00
darealshinji ce658d0709 Update config.sub, config.guess, install-sh (#77) 2018-06-17 11:14:35 -07:00
Ryan Lucia fe0dd3e095 Merge remote-tracking branch 'upstream/master' into tstools 2018-05-31 04:26:15 -04:00
Ryan Lucia 9ce76d3802 Update OSX build instructions
Tested against a fresh copy of 10.13
2018-05-31 04:23:59 -04:00
Ryan Lucia d4e99700d4 Remove ambiguity over distance function call 2018-05-31 04:22:43 -04:00
Ryan Lucia 861a1c1694 Update gitignore to include additional generated luajit files 2018-05-31 04:22:11 -04:00
Marcin Kurczewski a4bde47c5c Fix MRU menus (#48)
Broken in 9bbfdddde0. I don't understand
why the author made such a change, so I left their solution with #ifdef
guard.
2018-05-28 21:24:23 +02:00
Thomas Goyne a32bf7acdc Set ffmpeg's yasm include paths correctly 2018-05-25 22:32:27 +02:00
Thomas Goyne 4fdc5efb69 Explicitly declare DataBlockCache as moveable to make vs17 happy 2018-05-25 22:32:27 +02:00
Thomas Goyne e44f0b92b0 Use absolute paths for the default dependencies paths 2018-05-25 08:27:29 +02:00
Thomas Goyne bbd5a0aadb Fix a typo in install.targets 2018-05-25 08:27:29 +02:00
Thomas Goyne 5cfa896f98 Drop Windows XP support 2018-05-25 08:27:29 +02:00
Thomas Goyne 9c628f1cdf Switch to the vs 2017 toolkit 2018-05-25 08:27:29 +02:00
Ryan Lucia adb7c36be3 Apply and update LuaJIT patches 2018-05-12 03:06:01 -04:00
Ryan Lucia 90586ca588 Update LuaJIT to 2.0.5 2018-05-12 02:58:15 -04:00
Ryan Lucia a621072e7d Add support for WWXD keyframes in qpfile format 2018-05-10 03:28:51 -04:00
Ryan Lucia 747525142a Pass 0 to FFMS_Init
The argument is no longer used, and the docs specify to pass a value of 0 to avoid confusion
2018-05-07 19:24:47 -04:00
Ryan Lucia 869cdcc7a1 Properly ignore ASS whitespace characters in character counter 2018-05-07 18:09:42 -04:00
Ryan Lucia 3eaa56fc18 Point users at a functional bug tracker 2018-05-07 18:09:42 -04:00
Ryan Lucia e516ab6e32 Fix line order when splitting after current frame 2018-05-07 18:09:42 -04:00
Ryan Lucia 4d048e3c90 Add configuration options for colors in visual typesetting tools 2018-05-07 18:09:40 -04:00
Ryan Lucia 50a18c7942 Use proper event for DoubleUpdater
Previously changes weren't recognized because the event bound was for integers
2018-04-30 02:38:14 -04:00
Ryan Lucia dbd7dd8ba1 Remove shitty joke
The default message here is an old joke in extremely poor taste, and best replaced in the config
2018-04-30 02:38:14 -04:00
Ryan Lucia 2f500cd480 Remove dead forums link 2018-04-30 02:38:14 -04:00
Ryan Lucia 95d96f938b Make translation assistant skipping whitespace an explicit setting 2018-04-30 02:38:14 -04:00
Ryan Lucia 3bcc7269be Remove Force BT.601 option and update color matrix guessing 2018-04-30 02:38:14 -04:00
Ryan Lucia 10814a7d0b Add support for setting status bar text from Lua 2018-04-30 02:38:11 -04:00
Ryan Lucia 8cc3a35dd4 Update default config to modern standards 2018-04-29 16:36:21 -04:00
Thomas Goyne 73c5e7a4c2
Merge pull request #60 from sidneys/hotfix/updated-macos-build
FIX: Updated build instructions for macOS 10.12 and XCode 9
2018-04-29 13:03:31 -07:00
Roxas Shadow d893218e50 it.po: fix typo (#59) 2018-04-29 13:00:11 -07:00
computerfan e401baa910 Update Simplified Chinese translation (#55)
Fix some wrong or ambiguous translation.
2018-04-29 12:59:59 -07:00
Alexander Pozdnyakov 315d416753 added missing files (#57) 2018-04-29 12:59:48 -07:00
sidneys b097d3133d fix(updated-macos-build): add missing .m4 macros 2018-03-31 02:58:27 +02:00
sidneys d4461f65be fix(updated-macos-build): prefix icu method calls (icu::BreakIterator, icu::Locale, icu::UnicodeString) 2018-03-31 02:58:27 +02:00
Sidney 40a0fb5910 fix(updated-macos-build): update Homebrew and wxWidgets instructions in README 2018-03-31 02:58:27 +02:00
therealfun f6a2ac08a6 Makefiles: replace the use of subst macro with patsubst (#56)
$(subst .c,.o,...) replaces '.c' with '.o' everywhere in pathnames. For
example, renaming the "Aegisub" folder to "Aegisub.cool" will make the
build system generate "Aegisub.oool/.../.o" objects.

https://www.gnu.org/software/make/manual/make.html#Text-Functions
2018-03-05 09:28:29 -08:00
rr- 4791222ab3 Add support for reading waveform selection in LUA 2018-03-03 12:51:49 -08:00
rr- 21f704f138 Fix joining as karaoke 2018-03-03 12:50:01 -08:00
Rasmus Thomsen 876d59ec22 remove fontconfig submodule
we already remove its folder ( vendor/fontconfig ), so we should remove it from the actual submodule list as well
2018-03-03 12:46:44 -08:00
Ryan Lucia 1b7388683f Document process for updating mooonscript 2018-03-03 12:46:20 -08:00
Ryan Lucia 3c5b61429a Update moonscript version
Current version is from
491f2352a2
2018-03-03 12:46:20 -08:00
Thomas Goyne bc157d9bbc Also stub out the `system` lua module that newer versions of busted use 2018-03-03 12:44:31 -08:00
Rodger Combs 61028916c8 main: fix warning 2018-01-27 11:35:18 -08:00
Rodger Combs 16d57dac79 OpenAL: destroy context when not in use
This prevents the CoreAudio thread from spinning when paused on macOS
2018-01-27 11:34:58 -08:00
Rodger Combs 5a3b7301c6 find/replace: handle enter key in input fields 2018-01-27 11:34:24 -08:00
Rodger Combs a88835e253 find/replace: bring window to front when activated 2018-01-27 11:34:05 -08:00
Rodger Combs 275a35fdeb README: fix outdated brew package names 2018-01-27 11:34:02 -08:00
Thomas Goyne de9290b75b Remove fontconfig from macOS deps 2018-01-27 11:33:23 -08:00
Rodger Combs 1bd25711eb README: document luajit and wxWidgets build procedure on macOS 2018-01-27 11:32:42 -08:00
Rodger Combs 3632ad067d Build: update boost m4 macros 2018-01-27 11:32:27 -08:00
Thomas Goyne 3bc5e8f04f Remove pointless explicit heights for the audio sliders
The containing sizer overrides them instantly, but for whatever reason
supplying them breaks things on macOS.
2017-07-07 16:46:52 -07:00
Thomas Goyne f555ac841c Bump minimum macOS version to 10.8
Recent versions of the SDK have dropped support for <future> when targeting
10.7.
2017-07-04 12:31:55 -07:00
Thomas Goyne 70edb03b2a Fix some audio display rendering quirks on retina OS X 2017-07-04 10:51:08 -07:00
Martin Herkt 8d3ad9ff68 dialog_about: only include build date with credit (#45)
The build date is largely irrelevant and prevents reproducible builds.
Make it optional.
2017-05-22 07:43:30 -07:00
Maxime Gauduin dd67db47cb Fix compilation against icu 59.1 (#46) 2017-05-08 19:01:47 -07:00
Martin Herkt 3594ade719 build: sort wildcard results for repeatable builds (#44) 2017-03-30 10:08:30 -07:00
Eduard Ereza Martínez b859ddbca4 Update Catalan translation (really) 2017-03-25 12:13:24 -07:00
Ryan Lucia 3e2c165852 Properly set colorspace when loading video
FFMS2 originally would automatically attempt to guess the color space
if not manually specified, but this was removed in
7c2e08109d
and Aegisub never adapted to the change
2017-03-25 12:13:10 -07:00
Thomas Goyne 1042226531 Merge pull request #39 from TheFireRed/patch-1
Quick fix
2016-07-30 11:00:50 -07:00
Thomas Goyne 172ccc2b25 Merge pull request #40 from aristotll/master
Fix typo
2016-07-30 10:59:38 -07:00
Thomas Goyne ea27230293 Merge pull request #41 from Ereza/master
Update Catalan translation
2016-07-30 10:59:29 -07:00
Eduard Ereza Martínez 823e181096 Update Catalan translation 2016-07-14 02:08:15 +02:00
Yao 931613381c Fix typo 2016-07-09 16:25:40 +08:00
Álex G.M b5396eb382 Quick fix
Fixed a small mistranslation. Remove = quitar, eliminar ≠ remover
2016-06-26 19:42:57 +02:00
Niels Martin Hansen b118fe7e7a Fix STL header writing (really)
The vsnprintf call must be passed the buffer size, not the target string size. Shortening the string to field length happens in the memcpy.
2016-05-18 21:56:34 +02:00
Thomas Goyne 0e8bc44539 Work around more places where VC++ generates null pointers-to-members 2016-04-09 08:36:50 -07:00
Thomas Goyne 101cd8e1e5 Fix compilation with old versions of ffms2 2016-04-08 13:29:32 -07:00
Thomas Goyne 7a6da26be6 Fix compilation on X11-using platforms 2016-04-08 12:14:28 -07:00
Thomas Goyne dba8f1c062 Use Uniscribe to check glyph coverage of non-BMP characters rather than just skipping them 2016-04-08 11:24:26 -07:00
Thomas Goyne 15adac519d Update to the new indicator API for Scintilla as 3.4 dropped the old one 2016-04-08 11:24:25 -07:00
Thomas Goyne 1aa9215e7f Use FFMS_DoIndexing2 when using a recent version of ffms2
And clean up the audio track selection logic a bit.
2016-04-08 11:24:21 -07:00
Thomas Goyne 95f3f30d53 Remove pointless braces 2016-04-08 11:24:16 -07:00
Thomas Goyne b8fa7e010b Don't init COM for FFMS2
FFMS2 no longer uses COM for anything.
2016-04-08 11:24:14 -07:00
Thomas Goyne 8823476275 Work around bad codegen from VC++2015 update 2 2016-04-08 11:24:11 -07:00
Thomas Goyne 43f5af556d Switch back to GetVersionEx() to avoid depending on the win8 SDK just for VersionHelpers.h 2016-04-08 11:24:07 -07:00
Thomas Goyne 2720d8c0dc Fix OS X compilation 2016-03-18 19:42:32 -07:00
Thomas Goyne 8f019a6e45 Statically link the CRT for Release builds
VS 2015 has made distributing the dynamic CRT awful; the installer is
larger than Aegisub itself and app-local deployment requires an absurd
number of DLLs.
2016-03-13 17:39:10 -07:00
Thomas Goyne d1e5a2674b Statically link ffms2 on Windows
It used to need to be dynamic due to that it was a nightmare to build,
with very specific toolchain requirements, but that's no longer the
case.
2016-03-13 17:38:49 -07:00
Thomas Goyne 9bbfdddde0 Add the standard OS X "Window" menu 2016-03-13 16:33:53 -07:00
Thomas Goyne cac4ba910d Fix more incorrect sizer flags 2016-03-13 16:33:53 -07:00
Thomas Goyne e3ad5ea976 Update wxWidgets to 3.1.0 2016-03-13 16:33:52 -07:00
Thomas Goyne 26fea0e123 Fix skipping over existing spaces when exporting to EBU STL
ac5f40a543 made it so that the N in \N was
skipped, but broke the space case, resulting in two spaces between each
word.

Closes #1887.
2016-03-05 16:35:01 -08:00
Thomas Goyne b2687e893b Fix member variable initialization order 2016-03-05 16:35:01 -08:00
Thomas Goyne b6c1bb146b Add PTHREAD_CFLAGS to LIBS_PTHREAD
As the ax_pthread documentation says you need to do.

Closes #1902. Closes #1911.
2016-03-05 11:23:46 -08:00
Thomas Goyne 893b08a19c Add CFLAGS_PTHREAD/LIBS_PTHREAD to everything needing them
Closes #1903.
2016-03-05 11:23:46 -08:00
Thomas Goyne 0dea29b369 Build with boost 1.60 when using GCC 5 on Travis 2016-03-05 11:23:46 -08:00
Thomas Goyne c3f442aee8 Build with both GCC 4.8 and GCC 5 on Travis 2016-03-05 11:23:46 -08:00
Thomas Goyne 4c15d0ba84 Add support for running respack.lua with system Lua 2016-03-05 10:51:26 -08:00
Thomas Goyne 0ed6dd46fb Add support for using system LuaJIT rather than the bundled copy
Closes #1904.
2016-03-05 10:51:16 -08:00
Thomas Goyne 45315476bd Switch to a maintained fork of universalchardet 2016-02-09 20:29:29 -08:00
Thomas Goyne a315ce6903 Fix assert failure when opening with no args 2016-02-08 06:59:49 -08:00
darealshinji 14a80dbabd Change LIBS_PTHREAD to PTHREAD_LIBS
See https://github.com/tgoyne/aegisub/blob/master/m4macros/ax_pthread.m4#L12
2016-01-12 11:11:09 +01:00
Thomas Goyne 9ed553e5fb Update ax_pthread.m4 to the most recent version
Closes #1901.
2016-01-11 20:52:40 -08:00
Thomas Goyne ad0f702a55 Escape "." corrently in respack.lua
Using \ works in minilua, but not real lua.

Closes #1898.
2016-01-11 20:52:40 -08:00
Thomas Goyne 28eb475fc2 Actually use the list of filenames in AegisubApp::OpenFiles() 2016-01-10 19:47:26 -08:00
Thomas Goyne bb3e0de728 Handle i/o errors when indexing fonts for GDI 2016-01-10 19:47:25 -08:00
Thomas Goyne 3c381b6c55 Handle fonts that are marked as bold but have the same weight as the normal variant 2016-01-02 15:42:26 -08:00
Thomas Goyne 761a121452 Fix the weight of fonts that use 1-10 2016-01-02 15:42:26 -08:00
Thomas Goyne 596332763b Use the Windows Family Name for family name matching 2016-01-02 15:42:26 -08:00
Thomas Goyne e13a39f302 Try to better match GDI's weight penalty 2016-01-02 15:42:26 -08:00
Thomas Goyne b9a56cb870 Prioritize family name matches over postscript name matches 2016-01-02 15:42:25 -08:00
Thomas Goyne 278b7621cf Assume that fonts which CT won't give the OS/2 table for are Regular 2016-01-02 15:42:25 -08:00
Thomas Goyne f2b3b69b3f Read the weight from the OS/2 table rather than asking CoreText
The weights reported by CT are only occasionally correlated with the
OS/2 weights, and GDI uses the latter.
2016-01-02 15:42:25 -08:00
Thomas Goyne 8e6c4ff3ba Don't check for fontconfig in configure on OS X 2016-01-02 15:42:25 -08:00
Thomas Goyne f824d2c56b Remove OS X and Windows support from the fontconfig file lister 2016-01-02 15:42:25 -08:00
Thomas Goyne 6780373a50 Remove fontconfig config files from the OS X package 2016-01-02 15:42:25 -08:00
Thomas Goyne b1cb16c7f8 Do a better job of picking the best match from CoreText 2016-01-02 15:42:25 -08:00
Thomas Goyne d152af1f14 Deduplicate matched paths from CoreText 2016-01-02 15:42:25 -08:00
Thomas Goyne 2527204515 Get the filesystem representation of urls rather than an absolute url 2016-01-02 15:42:25 -08:00
Thomas Goyne 63bb585db6 Enable ARC for the coretext font lister 2016-01-02 15:42:24 -08:00
Thomas Goyne 973f0b09fc Add a basic CoreText-based fonts collector backend 2016-01-02 15:42:24 -08:00
Thomas Goyne f8c3504898 Remove the OS X fontconfig init logic from the libass provider 2016-01-02 15:42:24 -08:00
Thomas Goyne 9b815ac8cc Fix a crash when reattaching video
The window close event propagates up to the detached window's parent, so
the handler for the parent window closing needs to filter it out.
2016-01-02 13:48:00 -08:00
Thomas Goyne 0b2d0d40d5 Ensure that the fonts collector destination label gets wrapped on OS X 2015-12-29 20:12:52 -08:00
Thomas Goyne 4f34784370 Set the initial control state when the fonts collector dialog is opened correctly 2015-12-29 20:12:32 -08:00
Thomas Goyne f481a7f5fb Use the correct upper bound for restoring the font collector modes 2015-12-29 20:12:29 -08:00
Thomas Goyne e8cdfc57a9 Make FcMode an enum class and simplify the data flow 2015-12-29 20:12:24 -08:00
Thomas Goyne fe2925408c Remove fontconfig entirely from the Windows build 2015-12-29 20:08:07 -08:00
Thomas Goyne e5a6abd215 Add a GDI-based font selector for libass
This deliberately doesn't perform any font substitutions as the sort of
people that use libass on Windows tend to perfer to manually pick
fonts with the correctly glyphs.
2015-12-29 20:08:07 -08:00
Thomas Goyne e06385b6d4 Remove unused includes from subtitles_provider_libass.cpp 2015-12-29 20:08:05 -08:00
Thomas Goyne de3bdeb484 Build libass without fontconfig enabled on Windows 2015-12-29 19:56:48 -08:00
Thomas Goyne 15d78ed190 Update to libass 0.13.1 2015-12-29 19:56:38 -08:00
Thomas Goyne 913b8438f3 Fix Windows x64 compilation 2015-12-29 19:55:58 -08:00
Thomas Goyne 3b13260ca1 Use murmur3 to explicitly hash the font index keys
This significantly improves performance by avoiding the need to
construct std::strings of the things to be hashed, eliminating a bunch
of memory allocations and copies.
2015-12-29 12:38:01 -08:00
Thomas Goyne 879661a379 Only index the first kilobyte of font files to speed up indexing 2015-12-29 12:38:00 -08:00
Thomas Goyne 82f250dbbb Fix the checks for fake bold/italic
EnumFontFamiliesEx doesn't actually use the lfItalic andlfWeight fields,
so we have to check separately.
2015-12-29 12:38:00 -08:00
Thomas Goyne ddc5cd155f Add a GDI-based fonts collector backend 2015-12-29 12:38:00 -08:00
Thomas Goyne fa2e3fb38f More cruft to support running busted on Travis 2015-12-22 17:43:25 -08:00
Thomas Goyne afed3dca21 Fix compilation on Linux 2015-12-21 19:57:49 -08:00
Thomas Goyne 26361c5003 Add support for using busted 2.0 to run automation tests
Supply a definition of socket.gettime() to remove the dependency on
LuaSocket, as installing binary deps from luarocks doesn't work with a
custom build of luajit.
2015-12-21 19:48:23 -08:00
Thomas Goyne 3747705a43 Select the OpenGL context when destroying VideoDisplay
This is needed to destroy the correct things when there are multiple
active opengl displays.
2015-12-21 17:46:38 -08:00
Thomas Goyne c8d02de3db Allow coalescing undo over autosaves 2015-12-21 17:46:38 -08:00
Thomas Goyne 52dbb482af Make next_commit_id a member variable rather than a static
Multiple instances of SubsController should not share it.
2015-12-21 17:46:38 -08:00
Thomas Goyne 2032ab8ea3 Handle multiple simultaneous OpenAL audio players in one process 2015-12-21 17:46:38 -08:00
Thomas Goyne 75804da4ea Set the closed marker even on 64-bit OS X 2015-12-21 17:46:38 -08:00
Thomas Goyne 5f89a64f07 Adjust the menu text on OS X to better match the HIG 2015-12-21 17:46:38 -08:00
Thomas Goyne f28e46c2e3 Add a Close command to the file menu on OS X 2015-12-21 17:46:37 -08:00
Thomas Goyne ead12de8b6 Actually close all windows on quit 2015-12-21 17:18:07 -08:00
Thomas Goyne 84b0f1e043 Mostly adopt the standard OS X document-based UI model on OS X 2015-12-21 17:18:04 -08:00
Thomas Goyne 0f17784548 Actually open a new window in the New Window command 2015-12-21 17:17:54 -08:00
Thomas Goyne 8de8724660 Support creating multiple main windows
This is not yet actually exposed in any way in the UI.
2015-12-21 17:17:51 -08:00
Thomas Goyne f5f5439808 Add context-specific path tokens
?video, ?audio, and ?script are not global.
2015-12-21 17:17:48 -08:00
Thomas Goyne 932937c343 Shut up a missing override warning 2015-12-21 17:17:46 -08:00
Thomas Goyne e757618b32 Use an explicit operator bool for Vector2D 2015-12-21 17:17:42 -08:00
Thomas Goyne d253388c8e Perform autosaves on a background thread rather than blocking the UI 2015-12-21 17:17:33 -08:00
Thomas Goyne 44b76d38d2 Switch to app-local deployment of the CRT rather than using the installer
The installer for VS2015 is huge (13 MB compressed for 5.5MB of
installed stuff) and seems to be restarting people's computers without
warning.
2015-12-08 19:14:02 -08:00
Thomas Goyne bebc024fa0 Fix overflow issues with truncated pcm files 2015-11-29 20:11:14 -08:00
Thomas Goyne f811f7e363 Select the "Time" radio on startup 2015-11-29 20:11:14 -08:00
Thomas Goyne 1d00bd834d Fix typo that made the color picker's cursor appear in the wrong place in RGB modes 2015-11-29 20:11:14 -08:00
Thomas Goyne 9112cc8cf9 Fix some invalid sizer flags 2015-11-29 20:11:14 -08:00
Thomas Goyne 4542204b3a Fix undefined behavior in DataBlockCache::SetBlockCount()
Left-shifting negative signed numbers is UB (and pointlessly complex
here anyway).
2015-11-29 20:11:14 -08:00
Thomas Goyne 652a250189 Add an error message for when creating the Lua state fails 2015-11-29 20:11:14 -08:00
Thomas Goyne 263ccbdc23 Fix misalined pointer read in the PCM audio provider 2015-11-29 20:11:14 -08:00
Thomas Goyne 0d72423223 Include a copy of ffversion.h 2015-11-29 20:11:14 -08:00
Thomas Goyne 9fd5bbc552 Update boost.vcxproj.filters to reflect files removed from boost.vcxproj 2015-11-29 20:11:14 -08:00
Thomas Goyne 2fa56abc75 Explicitly add the DirectX SDK dir to the linker paths 2015-11-29 20:11:14 -08:00
Thomas Goyne f7661dbd78 Explicitly default AssAttachment's copy constructor 2015-11-29 20:11:14 -08:00
Thomas Goyne 7eb2504dbb Merge pull request #32 from darealshinji/patch-1
Don't use -fPIC
2015-09-19 17:11:38 +02:00
darealshinji f0258cf2d9 Don't use -fPIC
`-fPIC` is only useful when building shared libraries.
2015-09-18 23:03:50 +02:00
Thomas Goyne 85a820918f Fix a crash when opening a new file when the grid is not scrolled to the top 2015-09-13 18:49:46 +02:00
Thomas Goyne ea43700531 Add LIBS_PTHREAD to repack-thes-dict
Closes https://github.com/Aegisub/Aegisub/pull/28.
2015-09-13 12:12:17 +02:00
Thomas Goyne c49dd8bd96 Ensure luarocks env variables are set for make-automation 2015-09-13 11:54:32 +02:00
Thomas Goyne 85b356407f Reapply OS X/Windows build hacks 2015-09-13 10:02:59 +02:00
darealshinji 736e69ef53 LuaJIT: enable Makefile verbosity with V=1 2015-09-12 13:09:32 +02:00
darealshinji 5c50029074 Aegisub-specific LuaJIT settings 2015-09-12 13:01:34 +02:00
darealshinji 896ede12f3 Apply and update LuaJIT patches 2015-09-12 12:45:23 +02:00
darealshinji 541a9ad590 LuaJIT 2.0.4 2015-09-12 12:38:01 +02:00
Cirrus Wazza 1f7a59afcb Update French translation
Closes #1882.
2015-08-30 16:47:59 -07:00
Thomas Goyne ac2ac9cf06 Merge pull request #30 from CoffeeFlux/master
Fixed typo in README.md
2015-08-15 14:35:21 -07:00
Ryan Lucia a84c9b9a85 Fixed typo 2015-08-14 16:39:32 -04:00
Thomas Goyne 0ea48271d4 Add missing automation files to the portable installer 2015-07-31 11:12:20 -07:00
Thomas Goyne a55bc56a12 Update portable installer to include the vs14 CRT 2015-07-31 11:11:10 -07:00
Thomas Goyne 5c9ce12746 Use SWResample for FFMS2 rather than AVResample
FFmpeg's Opus decoder requires swresample, so just use it for
everything rather than shipping both resamplers.
2015-07-30 19:20:10 -07:00
Thomas Goyne ad1af90e74 Update dependencies to VS14 compatible versions 2015-07-30 19:20:10 -07:00
Thomas Goyne 4366e59353 Update to Visual Studio 2015 2015-07-30 19:20:10 -07:00
Thomas Goyne 017bbe1e59 Delay showing the font indexing dialog for 250ms
Helps avoid ugly flickering when no indexing is required, but fontconfig
is taking a long time to load the cache.
2015-07-28 20:46:02 -07:00
Thomas Goyne 9ae508730d Remove some incorrect and ignored sizer flags 2015-07-28 20:46:02 -07:00
Thomas Goyne d5dde6cff2 Reduce error-handling bloat a bit 2015-07-28 16:22:48 -07:00
Thomas Goyne b0f4c9f1ad Remove agi::vfr::Framerate's explicit swap implementation 2015-07-28 14:30:03 -07:00
Thomas Goyne fefa31eb47 Improve code coverage of tests 2015-07-28 14:30:03 -07:00
Thomas Goyne 4a3b411092 Silence a warning 2015-07-28 14:30:02 -07:00
Thomas Goyne 09b2736103 Mark a bunch of things as overriding virtual functions 2015-07-28 14:30:02 -07:00
Thomas Goyne 7a60ac95ef Always use C++ for AC_AGI_COMPILE 2015-07-27 18:57:08 -07:00
Thomas Goyne d278dcc7a8 Update to a newer version of AX_CHECK_GL that supports OpenBSD
Closes #1875.
2015-07-27 18:19:57 -07:00
Thomas Goyne 096398425a Skip some pointless configure checks on OS X 2015-07-27 18:19:41 -07:00
Thomas Goyne 8f5bfb0cae Make toggle buttons on OS X much more visibly distinct
Closes #1839.
2015-07-27 18:19:41 -07:00
Thomas Goyne f1252d1364 Update Vietnamese translation
loses #1878.
2015-07-27 10:29:23 -07:00
Thomas Goyne b55ad78c23 Update wx setup.h 2015-07-27 10:29:22 -07:00
Thomas Goyne 3c55d4fde4 Fix incorrect results for non-regex skip tags searches
Closes #1865.
2015-07-27 10:29:22 -07:00
Thomas Goyne 74ac2ab1fe Extract some more find/replace logic to libaegisub 2015-07-27 10:29:22 -07:00
Thomas Goyne cad8c80aab Update wxWidgets 2015-05-31 11:49:30 -07:00
Thomas Goyne 97bf5c77c3 Explicitly allow unicode text when pasting 2015-05-31 11:49:29 -07:00
Thomas Goyne 42429d4930 Remove incorrect sizer flags 2015-05-31 11:49:29 -07:00
Thomas Goyne ba9f5a78d4 Include the stack trace for errors in automation validation functions 2015-05-09 13:58:32 -07:00
Thomas Goyne ff874fadf9 Reduce nesting 2015-05-09 13:58:23 -07:00
Thomas Goyne a5c87908e1 Set the new active line correctly after splitting by karaoke 2015-05-09 13:58:15 -07:00
Thomas Goyne 0ccac34cb0 Fix crash when splitting lines by karaoke
Defer the deletion of the old lines until after the commit as is now
done for everything that deletes selected lines.
2015-05-09 13:58:12 -07:00
Thomas Goyne 8c6a3d85ba Update ffms2 project 2015-05-09 12:58:40 -07:00
Thomas Goyne 5afc543a5a Update libass to 0.12.2 2015-05-09 11:28:19 -07:00
Thomas Goyne d2958e6aca Set the Row for dialogue lines added to keep the file non-empty 2015-05-09 11:28:18 -07:00
Thomas Goyne 4d4102fcb3 Update ffms2
Fixes handling of positive audio delay.
2015-05-09 10:54:41 -07:00
Thomas Goyne c013342caa Catch more exceptions in lfs 2015-05-09 10:54:37 -07:00
Thomas Goyne 8cd970eb53 Update moonscript to 0.3.1 2015-05-09 10:54:34 -07:00
Thomas Goyne 7a8fda007d Cancel karaoke templater execution immediately when an error occurs
Closes #1849.
2015-03-01 11:22:50 -08:00
Thomas Goyne 9466c98fd7 Remove trailing whitespace from kara-templater.lua 2015-03-01 11:20:15 -08:00
Thomas Goyne 40ae2cdc35 Fix snapping audio markers when dragging inactive line markers with ctrl
We do need to check if the inactive markers are in the active set when
ctrl-dragging, as otherwise there'll always be a marker 0 pixels away to
snap to. Fortunately when ctrl-dragging all of the the markers involved
are by definition very close together, so it would be very difficult to
have enough markers to check for this to be a performance issue.

Closes #1823.
2015-03-01 11:13:43 -08:00
Thomas Goyne 801a8915d1 Use the untranslated context name for new hotkeys
Closes #1855.
2015-02-28 14:39:06 -08:00
Thomas Goyne d6982426c6 Merge pull request #26 from tophf/rot-angle-fix
Style editor: accept -360..360deg range
2015-02-28 14:28:44 -08:00
Thomas Goyne 2ef500d22c Merge pull request #27 from tophf/attached-font-render-fix
Pass all font attachments to font renderer
2015-02-28 14:28:17 -08:00
9adefaf01e5bf6426d838cd20eae582d2b6ba647 af9fe934c7 Pass all font attachments to font renderer
See #1805.
2015-02-27 01:16:35 +03:00
9adefaf01e5bf6426d838cd20eae582d2b6ba647 4f9713cb20 Style editor: accept -360..360deg range
People tend to use 270deg not knowing|remembering it's equal to -90deg
2015-02-26 22:40:21 +03:00
Thomas Goyne 3554bdc29a Fix failing tests 2015-02-15 12:37:34 -08:00
Thomas Goyne 48d4364eb8 Fix tests compilation on Windows 2015-02-15 12:33:48 -08:00
Thomas Goyne 5cedf16edd Use the custom lua error handler during macro load 2015-02-15 08:19:23 -08:00
Thomas Goyne 878fd4453b Fix whitespace 2015-02-15 08:19:22 -08:00
Thomas Goyne e72ab0eda8 Remove an incorrect error message 2015-02-15 08:19:17 -08:00
Thomas Goyne 879788fe83 Eliminate some gratuitous exceptions 2015-02-15 08:19:10 -08:00
Thomas Goyne 0416188235 Eliminate a pointless menu refresh when opening subtitle files 2015-02-15 08:19:05 -08:00
Thomas Goyne acb9b8adac Reinitialize libass every time the font is changed in the style editor
libass doesn't free any font data it requests until the ass_renderer is
destroyed, so recreate it every time the font is changed to avoid
holding on to extremely large amounts of data when the user quickly
switches between fonts.

Closes #1320.
2015-02-08 09:13:53 -08:00
Thomas Goyne 9f196adc2e Replace boost::tokenizer with agi::Split 2015-02-08 08:11:22 -08:00
Thomas Goyne 5d8aeb8b40 Replace most remaining uses of boost::split with agi::Split 2015-02-08 08:11:14 -08:00
Thomas Goyne 01558bf10d Fix type_name compilation on OS X
Reverts 2986932f31. There are more types
of ints than sizes of ints, so using the stdint types doesn't work.
2015-02-07 14:56:50 -08:00
Thomas Goyne 2269dbcfe0 Reuse previously calculated string widths 2015-02-07 14:56:48 -08:00
Thomas Goyne 427037a552 Reimplement boost::split_iterator to make it less slow
boost::split_iterator type-erases the predicate, which makes it require
a virtual call per character (!) along with a heap allocation. As it
turns out we only ever need one predicate (comparing to a single
character), so replace it with a split_iterator that just does that.
2015-02-07 14:56:27 -08:00
Thomas Goyne d8bd9904d8 Avoid running the extradata parsing regex unnecessarily 2015-02-07 14:56:20 -08:00
Thomas Goyne bddf44ddde Eliminate a bunch of memory allocations when getting column widths 2015-02-01 20:09:40 -08:00
Thomas Goyne 8c1b20e651 Speed up grid painting with many unique effects/actors a bit 2015-02-01 20:09:35 -08:00
Thomas Goyne 79fb5cb3fe Fix crash when deleting the last dialogue line from automation 2015-01-26 19:22:59 -08:00
Thomas Goyne 0080f3ad39 Update libass 2015-01-26 19:22:59 -08:00
Thomas Goyne 7300a1bf2d Remove some redundant .get()s 2015-01-26 19:22:59 -08:00
Niels Martin Hansen def24c25b3 Fix EBU STL writing on non-MSVC runtimes
MSVC 2013 and earlier have the _snprintf() function fill fields
completely, eliding the NUL character, if the printed string is
as long as or longer than the given buffer size. This is not the
case in POSIX snprintf(), it always ensures the string is terminated.
This causes several fields in GSI to become truncated and contain
NUL characters which should not appear there.
2015-01-26 19:19:42 +01:00
Niels Martin Hansen d0296618a6 Sort Automation menu items by display name 2015-01-25 00:35:42 +01:00
Niels Martin Hansen 0f3bca016e Fix bug introduced in 15d26dd 2015-01-23 19:28:40 +01:00
Niels Martin Hansen 88d8573d4c Fix crash when loading a dialogue line missing extradata 2015-01-20 21:22:24 +01:00
Niels Martin Hansen 0f618d94df Enable assembly routines for libass on Windows 2015-01-20 21:22:23 +01:00
Niels Martin Hansen bfa416c583 Build fribidi with standard-malloc flag
Not using this may cause unpredictable crashes in some builds
on some systems. Fribidi's own allocator is not thread safe.
2015-01-20 21:22:21 +01:00
Niels Martin Hansen 2cfa6f14f2 Split Yasm targets into reusable file 2015-01-20 21:22:20 +01:00
Niels Martin Hansen e692759ea1 Change standard-outdirs.props to space indents 2015-01-20 21:22:19 +01:00
Niels Martin Hansen 5e446264a2 Use new task in relative-ObjectFileName target 2015-01-20 21:22:18 +01:00
Niels Martin Hansen 59ab4cd09b Rework InstallHeaders target to be more regular 2015-01-20 21:22:16 +01:00
Niels Martin Hansen 773b60c36c Rework header copy in boost build 2015-01-20 21:22:15 +01:00
Niels Martin Hansen 2986932f31 Fix issues with type_name on Win64 build
Both size_t and unsigned long long are aliases for
unsigned __int64 on Win64, and causes a duplicate definition.
Replacing all the integer type_name definitions with stdint.h
names should avoid this problem.
2015-01-20 21:22:14 +01:00
Niels Martin Hansen b97ea87b4c Fix libass project for FastUptodateCheck 2015-01-20 02:53:47 +01:00
Niels Martin Hansen 76b776d483 Fix libaegisub project for FastUptodateCheck 2015-01-20 02:53:46 +01:00
Niels Martin Hansen 8ca73559bd Fix boost project for FastUptodateCheck 2015-01-20 02:53:44 +01:00
Niels Martin Hansen 9016a61ec4 Fix freetype project for FastUptodateCheck 2015-01-20 02:53:43 +01:00
Niels Martin Hansen 722e979419 Fix luajit project for FastUptodateCheck 2015-01-20 02:53:28 +01:00
Niels Martin Hansen a0bf50dc8a Upgrade all MSBuild projects to v12 tools
Has no real effect, it's what VS 2013 already uses and detailed
logging reveals that the build system doesn't even recognize v4
and assumes v12 anyway.
Might prevent builds with outdated tools.
2015-01-18 03:03:42 +01:00
Niels Martin Hansen 52d4955064 Clean up object dirs for Yasm'd files on Windows 2015-01-14 04:45:45 +01:00
Niels Martin Hansen 5bcfc81df5 Clean up produced object dirs during Windows build
Adds some additional MSBuild magic that chops dir names
from a given base, to avoid making deep, thin hierarchies
of dirs when building especially FFmpeg and libaegisub.
2015-01-14 04:45:02 +01:00
Niels Martin Hansen 719eff39b1 Integrate Yasm assembling better in VC build
By not having it blindly run before the ClCompile target
it won't be checked every time you choose to build a single
file from the IDE. Instead it becomes a separate build stage
of its own.
2015-01-14 03:40:36 +01:00
Niels Martin Hansen a0a6194a26 Partially revert 68781a9
The change in source file paths breaks on some systems
2015-01-14 01:06:42 +01:00
Niels Martin Hansen ebb3811942 Fix #1843 2015-01-14 00:46:02 +01:00
Niels Martin Hansen b4516e4754 Fix #1844, eliminate pointers so typeid behaves
Only the bare type is considered polymorphic/habving a vtable
so therefore applying typeid to a pointer type doesn't behave
as intended.
2015-01-14 00:35:26 +01:00
Niels Martin Hansen f0a5abad01 AssKaraoke can safely take a const AssDialogue* 2015-01-14 00:21:25 +01:00
Niels Martin Hansen 68781a95b2 Log names of files Yasm'd in FFmpeg build 2015-01-14 00:21:24 +01:00
Niels Martin Hansen e9f0999c01 Include seconds in log timestamps on Windows 2015-01-14 00:21:23 +01:00
Niels Martin Hansen a93c51c9ba Avoid having libiconv export symbols on Windows 2015-01-14 00:21:23 +01:00
Niels Martin Hansen ca555359d9 Make dummy audio provider generate non-periodic noise 2015-01-14 00:21:22 +01:00
Thomas Goyne bfe7e4688a Bump wx submodule 2015-01-01 10:24:01 -08:00
Thomas Goyne 0b0eaed049 Also disable unused boost stuff on Windows 2015-01-01 10:24:01 -08:00
Thomas Goyne 6929dcabc1 Move the boost config defines to acconf.h to make the build command lines less gross 2015-01-01 10:24:01 -08:00
Thomas Goyne 069af7cfca Build wx without wxAny 2015-01-01 10:24:01 -08:00
Thomas Goyne 57edbafdda Replace uses of wxThreadEvent with a statically typed event 2015-01-01 10:24:01 -08:00
Thomas Goyne ef4424f5e2 Eliminate implicit std::string <-> wxString conversions
On Windows these don't use UTF-8 and so are broken.
2015-01-01 10:24:00 -08:00
Thomas Goyne 26050bd4e0 Actually use CPPFLAGS_BOOST when building src/aegisub 2015-01-01 10:24:00 -08:00
Thomas Goyne 3c59ea9a0a Remove AegisubApp::HandleEvent
OnExceptionInMainLoop covers the same functionality.
2015-01-01 10:24:00 -08:00
Thomas Goyne 2a33b35f60 Give Pen an out-of-line destructor 2015-01-01 10:24:00 -08:00
Thomas Goyne ab35c41a93 Move AudioDisplayInteractionObject to audio_display.cpp 2015-01-01 10:24:00 -08:00
Thomas Goyne 4502a9893d Make some virtual destructors protected instead 2015-01-01 10:23:59 -08:00
Thomas Goyne b6edf58651 Eliminate some object file bloat 2015-01-01 10:23:59 -08:00
Thomas Goyne affb47776b Build with BOOST_MULTI_INDEX_DISABLE_SERIALIZATION 2015-01-01 10:23:59 -08:00
Thomas Goyne 1d82a75595 Add a missing static 2015-01-01 10:23:59 -08:00
Thomas Goyne 62186e916a Anchor AssAttachment's vtable 2015-01-01 10:23:59 -08:00
Thomas Goyne b29fcd4f89 Add some extern template declarations for stuff with vtables 2014-12-28 20:43:29 -08:00
Thomas Goyne 0e1c566628 Move tool_translation_assistant_insert into the anonymous namespace 2014-12-28 20:31:48 -08:00
Thomas Goyne a7042486c0 Anchor AssStyle's vtable 2014-12-28 20:31:33 -08:00
Thomas Goyne 625bd7a767 Avoid having to include preferences.h in app.cpp 2014-12-28 20:28:33 -08:00
Thomas Goyne e485c469e2 Pull some of OptionValue to a cpp file 2014-12-28 20:21:48 -08:00
Thomas Goyne 5089499e8b Remove Excetipion's virtual destructor 2014-12-28 19:52:42 -08:00
Thomas Goyne 0f324a22f1 Fix a pile of places where abs() was used on floats 2014-12-28 19:30:32 -08:00
Thomas Goyne a6b1639320 Extract some bits that don't need to be templated from templates
Cuts compile time by about 10% and shrinks the final binary a little.
2014-12-28 16:46:38 -08:00
Thomas Goyne 372b9fe115 Eliminate a pointless set that only ever had zero or one entries 2014-12-28 16:46:37 -08:00
Thomas Goyne 5201773a3b Slightly optimize returning strings to lua from ffi functions 2014-12-28 16:46:37 -08:00
Thomas Goyne 010f6c4f79 Debloatify some stuff 2014-12-28 12:30:01 -08:00
Thomas Goyne 76afcdafa1 Eliminate uses of dynamic_cast on everything but GUI widgets 2014-12-28 12:29:54 -08:00
Thomas Goyne 6d74f22e92 Fix the legacy clipboard include 2014-12-25 21:09:06 -08:00
Thomas Goyne c313f32384 Special-case all lines being selected in validate_adjoinable
GetSortedSelection is kinda slow with large selections and all lines
being selected is an easy thing to special-case.
2014-12-24 16:59:11 -08:00
Thomas Goyne 44506eae56 Fix compilation with compilers with non-totally-broken templates 2014-12-24 16:46:51 -08:00
Thomas Goyne 0a18fe6cd3 Fix stack corruption when a script tries to select an invalid line 2014-12-24 16:24:51 -08:00
Thomas Goyne 84bd682e2e Make it harder for automation script to leave no lines selected 2014-12-24 16:12:21 -08:00
Thomas Goyne 15d26dd86f Slightly speed up karaskel.collect_head 2014-12-24 15:10:12 -08:00
Thomas Goyne 1fd44ea8da Add subtitles.script_resolution()
Returns the values from the headers if they're present, or does the
insane Gabest-logic if one or both are missing.
2014-12-24 15:10:12 -08:00
Thomas Goyne c43bf1e822 Limit the range to be painted in the audio display to what is visible 2014-12-21 11:31:21 -08:00
Thomas Goyne 71ee37cd71 Slather around more const 2014-12-21 11:31:17 -08:00
Tom Maneiro 2694332692 Update Spanish translation. Closes #1838. 2014-12-07 15:25:01 -08:00
Thomas Goyne 7fc2b248ad Update dependencies 2014-11-30 15:28:58 -08:00
Thomas Goyne bc7e66971d Merge pull request #24 from line0/installer-updates
Windows Installer updates
2014-11-30 15:28:40 -08:00
line0 4765b6dbc6 fix bad alignment caused by @9242c9fb4703cc70e3f46874b54a08f4381bae0f 2014-11-30 20:11:34 +01:00
line0 9242c9fb47 Windows Installer: use the correct name for the Galician wxstd translation file 2014-11-30 19:56:17 +01:00
line0 83759ec463 Windows Installer: include missing modules
(ffi, lfs, argcheck)
2014-11-30 19:45:15 +01:00
Lasse Liehu f1c177842a Update Finnish translation
Closes #1837.
2014-11-30 09:41:18 -08:00
Thomas Goyne b2a69c693d Update README to no longer say that Update 3 is unsupported 2014-11-23 16:33:03 -08:00
Thomas Goyne 7833b1bcbc Merge pull request #23 from khaledhosny/C2797
Fix build with latest Visual Studio
2014-11-23 16:31:50 -08:00
Khaled Hosny d4057418da Fix build with latest Visual Studio
This fiixes:

error C2797: list initialization inside member initializer list or
non-static data member initializer is not implemented

http://msdn.microsoft.com/en-us/library/dn793970.aspx
2014-11-23 15:30:27 +02:00
Thomas Goyne a9208a592b Update the selection and scroll position after opening subtitles from video 2014-11-22 13:27:06 -08:00
Thomas Goyne 1a4634003f Fix crash on a certain kind of malformed shift times history file 2014-11-22 13:21:58 -08:00
Yuri c2a6c168fb Update Hungarian translation
Closes #1836.
2014-11-22 13:04:02 -08:00
Thomas Goyne 2e7d70edf3 Merge pull request #22 from lachs0r/master
Fix crash in block cache aging
2014-11-11 21:32:46 -08:00
Martin Herkt cf55299017 Fix crash in block cache aging
Bug introduced in e2a11f2d90
2014-11-12 06:21:53 +01:00
Thomas Goyne ea9ee7effa Merge pull request #21 from dwbuiten/srtgoto2
srt: Factor out last goto
2014-11-08 07:59:46 -08:00
Derek Buitenhuis c871aaf153 srt: Factor out last goto
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-11-05 13:56:53 +00:00
Thomas Goyne 3d228536f5 Only update the YCbCr Matrix when resampling if it was actually changed 2014-10-12 15:45:13 -07:00
kotobenko 16a3f38f6d Improve the Ukrainian translation. Closes #1828. 2014-10-12 15:28:53 -07:00
Thomas Goyne ed03cd9735 Fix compilation without fftw3 2014-10-12 15:23:58 -07:00
torque bf1f2ca5c7 Re-rasterize OS X bundle icon.
Rasterized using Inkscape. Fixes the incorrectly blended white fringes
the old icon had at all resolutions below 512x512.

Also includes retina-sized images.
2014-10-12 15:19:56 -07:00
Thomas Goyne 9cd3be4166 Improve the build instructions a bit 2014-09-21 08:23:41 -07:00
Thomas Goyne 66c9872563 Update some out-of-date bits of the README 2014-09-21 08:05:42 -07:00
Thomas Goyne c41e97cec1 Skip the [Aegisub Project Garbage] and [Aegisub Extradata] sections when exporting to ASS 2014-09-20 11:52:44 -07:00
Thomas Goyne 57d66be785 Fix skipping trailing empty segments in re.split 2014-09-20 08:13:49 -07:00
Thomas Goyne 9e6d5d7d9c Optimize Extradata handling a bit 2014-09-06 09:47:29 -07:00
Thomas Goyne 8567d9a573 Use more make_unqiue 2014-08-31 08:11:12 -07:00
Thomas Goyne 9ebb8d7df1 Silence a warning 2014-08-31 08:11:12 -07:00
Thomas Goyne e4368d59e4 Fix loading subtitles extradata from matroska files 2014-08-30 08:11:39 -07:00
Thomas Goyne 158288b66d Merge pull request #19 from darealshinji/patch-1
fix permissions in INSTALL_FLAGS
2014-08-26 14:56:44 -07:00
darealshinji c7dc8664de fix permissions in INSTALL_FLAGS 2014-08-26 08:30:42 +02:00
Thomas Goyne 54a7d43cf1 Use EnumFontFamiliesEx to try to find the correct match when fontconfig gives several options
Fixes collection of ITC Cheltenham, ITC Tiffany, Zurich, Delicious,
Jacoby, Segoe WP, Agilita LT, and a bunch of dumb improperly modified
fonts I have lying around.

Closes #1806.
2014-08-24 16:53:59 -07:00
Thomas Goyne 580386b229 Use FcFontSetSort rather than FcFontSetMatch
For whatever reason FcFontSetMatch sometimes returns something other
than the first result of FcFontSetSort, and every time they different
either FcFontSetMatch is wrong or they're both wrong.

Fixes collection of Adobe Jenson Pro and Arno Pro.
2014-08-24 16:53:54 -07:00
Thomas Goyne 375117c35c Merge pull request #18 from torque/extradata-dedup
Perform extradata deduplication on add.
2014-08-24 16:53:23 -07:00
torque 3c12fc69f3 Perform extradata deduplication on add.
Checks all existing extradata keys and values to ensure that the set
that is being added doesn't already exist.
2014-08-24 12:06:22 -07:00
Thomas Goyne d7fe7e3580 Make SubsController ensure files are non-empty on commit
There have been a bunch of recurring problems with things not handling
zero dialogue lines or zero styles very well, so add one to the file on
commit if needed.

Closes #1814.
2014-08-24 08:02:43 -07:00
Thomas Goyne 9ec4059096 Handle json parsing errors when loading shift times history
Closes #1802.
2014-08-24 07:42:57 -07:00
Thomas Goyne 6159f1587d Update wx
Removes the need for the RTL hacks in BaseGrid as the bugs have been
fixed properly in wx.
2014-08-23 15:56:32 -07:00
Thomas Goyne 416b9809c8 Update boost to 1.56
Closes #1818.
2014-08-16 14:01:58 -07:00
Oleksiy Prytchyn 4958bf3612 Add Ukrainian translation. Closes #1809. 2014-08-11 07:13:18 -07:00
Thomas Goyne 20470ea682 Actually register the SSA subtitle format 2014-08-10 06:52:58 -07:00
Thomas Goyne 5b47758539 Convert the clipboard module to the ffi 2014-07-28 15:52:37 -07:00
Thomas Goyne 97a19d4fe2 Shut up strdup "deprecation" warnings 2014-07-28 15:52:37 -07:00
Thomas Goyne e3c60514cd Add lua argument checker 2014-07-28 12:30:45 -07:00
Thomas Goyne 74a215f642 Convert the re module over to the LuaJIT ffi 2014-07-28 12:30:44 -07:00
Thomas Goyne a01a84fb4f Extract some common ffi API stuff 2014-07-28 12:30:44 -07:00
Thomas Goyne 0cf35894e1 Convert the lfs module to using the ffi 2014-07-28 12:30:44 -07:00
Thomas Goyne 4f08afd808 Convert the unicode lua module over to using the ffi 2014-07-28 12:30:44 -07:00
Thomas Goyne cf252fa91a Add simple type -> type name string compile time reflection stuff
This is needed for passing types to the LuaJIT ffi.
2014-07-28 12:30:44 -07:00
Thomas Goyne 77ecff1cba Eliminate a pointless multimap in the cache cleaner 2014-07-28 12:09:48 -07:00
Thomas Goyne 51b92390b6 Fix a bunch of float <-> double conversion warnings 2014-07-28 12:09:48 -07:00
Thomas Goyne ec407bbd7f Don't use std::min/max in mid()
VC++'s optimizer completely falls down on it for whatever reason.
2014-07-28 12:09:48 -07:00
Thomas Goyne 24b8db522a Remove unused things in block_cache.h 2014-07-28 12:09:47 -07:00
Thomas Goyne e2a11f2d90 Speed up aging the block cache
Keep track of the total size rather than recalculating it every time as
calculating the size actually takes while.
2014-07-28 12:09:47 -07:00
Thomas Goyne 641f1e2e81 Simplify AudioSpectrumCacheBlockFactory a little 2014-07-28 12:09:47 -07:00
Thomas Goyne 7a3110015e Change AudioDisplay::style_ranges to a vector
This is faster in all cases except for repainting a very small part of
the display with a very large number of range transitions and simplifies
the code a bit.
2014-07-28 12:09:47 -07:00
djcj f81736d461 update config.guess and config.sub 2014-07-28 12:08:23 -07:00
djcj 4c09f696d1 add '(Language)' after translated labels as suggested on the forums: http://forum.aegisub.org/viewtopic.php?f=5&t=66925#p91569 2014-07-28 12:08:23 -07:00
Thomas Goyne c9e4cea8ad Fix handling for automation debug formatting errors
One spot was missed when converting stuff over to using error_Tag rather
than lua_error for stack unwinding on errors.
2014-07-26 20:38:56 -07:00
Thomas Goyne eb0cf90433 Ensure the lua state gets closed when running tests
This is required for the gc metamethods to actually get run.
2014-07-23 15:29:55 -07:00
Thomas Goyne de686bdb6f Remove the automation thread priority stuff
It hasn't actually been used for anything for a while, and if a single
normal-priority thread can make your system unresponsive it's time to
upgrade to an OS that's isn't garbage.
2014-07-23 15:29:55 -07:00
Thomas Goyne 0cc941e559 Use wx events for invoking on the main thread on OS X
Dispatching to the main queue with GCD does not work when there is a
modal dialog active.
2014-07-23 15:29:55 -07:00
Thomas Goyne e675cf10da Don't version the executable on Linux
Release branches will continue to use versioned file names, but that
doesn't really make much sense for builds from master.
2014-07-23 15:29:54 -07:00
Thomas Goyne d61a9664c6 Write a BOM at the beginning of subtitles to make unpatched VSFilter happy
Closes #1795.
2014-07-23 15:29:54 -07:00
Thomas Goyne 45b5637e35 Update ffms2 2014-07-23 15:05:58 -07:00
Thomas Goyne d311da75e0 Change LuaJIT's deployment target back to 10.4
Targetting 10.7 makes the error handler segfault, and targetting 10.4
appears to work fine.
2014-07-23 14:53:48 -07:00
Thomas Goyne 97b5163874 Patch os module methods to add Unicode support on Windows 2014-07-15 14:32:54 -07:00
Thomas Goyne 68b824c8ca Patch io.open and io.popen to support Unicode filenames on Windows 2014-07-15 14:32:54 -07:00
Thomas Goyne 584284aa79 Reject vfr timecodes which are all identical 2014-07-15 09:11:40 -07:00
Xabier Aramendi 1835d5e2d8 Update Basque translation
Closes #1791.
2014-07-15 07:15:10 -07:00
Thomas Goyne 897f9d1254 Eliminate some warnings 2014-07-14 10:10:22 -07:00
Thomas Goyne 771525ae6f Make AssFixStylesFilter usable statically
Trivially speeds up ProcFrame as constructing export filters isn't free
due to that it has to look up the translatable strings.
2014-07-14 10:10:22 -07:00
Thomas Goyne 97c59e2630 Fix non-pch compilation 2014-07-14 10:10:22 -07:00
Thomas Goyne 92b8b2851b Don't build the dialogue lexer on every use
Building the lexer takes much longer than actually lexing, and since the
lexer is stateless there's no reason not to just make it static.
2014-07-14 10:10:22 -07:00
Thomas Goyne 706a72d5c1 Eliminate several memory allocations per line when reading thesaurus files 2014-07-14 10:10:21 -07:00
Thomas Goyne 88a089721b Merge pull request #7 from darealshinji/master
Fix compilation with PortAudio enabled
2014-07-12 07:23:57 -07:00
darealshinji 3c772dd649 fix Linux build 2014-07-12 01:31:26 +02:00
Thomas Goyne a9019421f1 Fix memory leak in aegisub.text_extents on Windows
The old object returned by SelectObject has to be made active again
before the DC is destroyed or it doesn't get deleted.
2014-07-11 09:26:59 -07:00
Thomas Goyne 06367d5cd9 Don't convert encoding names to lowercase when writing files
Not only is it unnecessary, but it actively breaks the mapping of
user-friendly encoding names in the Export dialog to the real encoding
names.

Closes #1789.
2014-07-11 09:26:59 -07:00
Thomas Goyne 548fbd814b Fix a use-after-free when a SubsEditCtrl is destroyed while the thesaurus is loading 2014-07-11 09:26:58 -07:00
Thomas Goyne 4dc38447dc Check the return value from lua_open()
It always fails when running under valgrind because valgrind does not
implement mmap functionality that LuaJIT requires.
2014-07-11 09:26:58 -07:00
Thomas Goyne bffbae0ed9 Fix vc++ compilation 2014-07-10 12:55:38 -07:00
Thomas Goyne bf03904fb8 Change the default ffms audio error handling mode to ignore
Truncating the file at the first decoding error seems to cause a lot of
confusion, especially since the UI doesn't mention that it happened
anywhere.
2014-07-10 11:44:57 -07:00
Thomas Goyne 2df4c4c194 Use wxDCFontChanger correctly
Fixes the audio display timeline font changing based on what else is
being painted.
2014-07-10 11:44:56 -07:00
Thomas Goyne a5c2ef273f Add tests for floating point sample conversion 2014-07-10 11:44:56 -07:00
Thomas Goyne 63de3232f7 Add test for channel downmixing 2014-07-10 11:44:56 -07:00
Thomas Goyne f32bdff84a Add tests for the sample doubling converter and make it work correctly 2014-07-10 11:44:56 -07:00
Thomas Goyne 93ad15efb1 Reuse the decoding buffer in the audio converters 2014-07-10 11:44:56 -07:00
Thomas Goyne b9c75d8706 Add tests for the audio bitdepth conversions
And fix some bugs in it, and make it not rely on undefined behavior.
2014-07-10 11:44:56 -07:00
Thomas Goyne 585e9489d9 Move some of the audio provider machinery to libaegisub
And add tests.
2014-07-10 11:44:56 -07:00
Thomas Goyne e942a7f0f7 Fix int overflow when saving audio clips 2014-07-08 16:38:33 -07:00
Thomas Goyne e713f741a4 Make some functions static 2014-07-08 16:38:16 -07:00
Thomas Goyne e60197962a Fix buffer overflow when getting text extents
lfFaceName needs to be null-terminated, so only copy up to 31 characters
into the buffer.
2014-07-08 09:23:19 -07:00
Thomas Goyne 8a5b4ae3a3 Fix keycode mapping for backspace, enter, tab and escape 2014-07-08 09:23:19 -07:00
Thomas Goyne a58ed7343d Add Aegisub's include dirs before the system ones rather than after 2014-07-07 09:42:02 -07:00
Thomas Goyne a11da3350c Save a backup copy of the old hotkey file if migrating from the old format 2014-07-07 09:42:02 -07:00
Thomas Goyne 365c04333c Install the unicode-compatible Lua module loader before loading moonscript
Closes #1760.
2014-07-07 09:23:36 -07:00
Thomas Goyne 6c0752035c Slightly optimize AssDialogue serialization 2014-07-07 08:40:38 -07:00
doplank 3844a1cb80 Update Indonesian translation 2014-07-07 08:40:38 -07:00
Thomas Goyne 5a14b36389 Remove unused test util functions 2014-07-06 19:25:49 -07:00
Thomas Goyne 935c6bc3a7 Store hotkeys in a less dumb format 2014-07-06 19:25:49 -07:00
Thomas Goyne 033baed930 Add simple tests for agi::Split 2014-07-06 19:25:49 -07:00
Thomas Goyne 2757ebd94f Add character counter tests 2014-07-06 19:25:49 -07:00
Thomas Goyne 3b34ed9a77 Move AssTime to libaegisub and add tests 2014-07-06 19:25:49 -07:00
Thomas Goyne ba0e544d70 Swallow spam from coveralls submission 2014-07-06 19:25:49 -07:00
Thomas Goyne 8c7fd37aa9 Clean up the SRT reader/writer a bit 2014-07-06 19:25:49 -07:00
Thomas Goyne 8576c4993f Fix SRT timestamp parsing 2014-07-06 19:25:48 -07:00
Thomas Goyne dd70da35d4 Remove some cruft from the fonts collector 2014-07-06 19:25:48 -07:00
Thomas Goyne e924db1fda Store open dialogs in an unsorted vector
Even if every dialog in the program was open at once, linearly searching
a vector is quite fast enough.
2014-07-06 19:25:48 -07:00
Thomas Goyne f0f836c47b Eliminate a pointless std::map in charset_conv 2014-07-06 19:25:48 -07:00
Thomas Goyne a22dd0f9ca Clean up the json parser a little 2014-07-06 19:25:48 -07:00
Thomas Goyne d9016cc8ea Debloat and slightly speed up the MRU code 2014-07-06 19:25:48 -07:00
Thomas Goyne 518342b919 Make the hotkey code a bit less bloated 2014-07-06 19:25:48 -07:00
Thomas Goyne c0c05e982a Support passing a test filter to make test 2014-07-04 21:14:29 -07:00
Thomas Goyne 7cafee39fc Exclude the Windows-specific files from coveralls 2014-07-04 20:37:36 -07:00
Thomas Goyne df8ad34838 Eliminate pointless runtime datastructures for CalltipProvider
And add some tests and make it actually work correctly.
2014-07-04 20:37:36 -07:00
Thomas Goyne 93522e30a8 Use a static table of tokens for agi::Path
The set of possible tokens is fixed, so using std::map is a bunch of
pointless overhead (that turns out to not even really simplify the
code).
2014-07-04 20:37:36 -07:00
Thomas Goyne 6fab17d860 Add basic tests for lfs 2014-07-04 10:52:38 -07:00
Thomas Goyne 9befa29707 Don't exclude tests dir from coverage information 2014-07-04 08:45:05 -07:00
Thomas Goyne 830b54ec69 Build in debug mode on travis 2014-07-04 08:41:57 -07:00
Thomas Goyne 7dc8dd6075 Install moonscript for busted on travis 2014-07-04 08:41:57 -07:00
Thomas Goyne 771ce976cc Use the boost 1.55 tarball on travis since cloning the repo takes forever 2014-07-04 07:51:56 -07:00
Thomas Goyne 5d92024201 Exclude more stuff from coveralls to cut down on noise 2014-07-04 07:21:55 -07:00
Thomas Goyne 6ce9ce1546 Remove unused helper function 2014-07-03 10:57:53 -07:00
Thomas Goyne 2f0ddb4f32 Improve the line_iterator tests 2014-07-03 10:57:53 -07:00
Thomas Goyne 14969ec2ea Submit code coverage information to Coveralls 2014-07-03 10:57:53 -07:00
Thomas Goyne d56868e820 Fiddle with the dependency info for libresrc to hopefully work better 2014-07-02 18:20:11 -07:00
Thomas Goyne 3832f700c5 Eliminate race condition in fs::Touch test 2014-07-02 18:20:11 -07:00
Thomas Goyne 92958a874b Add travis CI support 2014-07-02 18:20:11 -07:00
Thomas Goyne 3ddafcd34a Disable iconv tests that require on libiconv functionality when not using libiconv 2014-07-02 18:20:10 -07:00
Thomas Goyne c804042978 Fix test compilation with gcc 2014-07-02 18:20:10 -07:00
Thomas Goyne c5bffa9352 Fix failing path test on Linux 2014-07-02 18:20:10 -07:00
Thomas Goyne 1c94439909 Support running setup.sh out-of-tree 2014-07-02 10:55:19 -07:00
Thomas Goyne a084f02a2d Fix a case where the found text would not be selected with find/replace
SubsTextEditCtrl::SetTextTo needs to update the selection via the text
selection controller or the text selection controller will have an
outdated cached state until the UpdateUI event is processed, which
soemtimes resulted in it not actually setting the selection when it
needed to be.
2014-07-01 20:16:17 -07:00
Thomas Goyne abcd2bd61b Modernize the EBU STL writer a bit 2014-07-01 20:16:17 -07:00
电脑迷 ce503a1fb5 Update Chinese translations. Closes #1779. 2014-07-01 12:25:36 -07:00
Thomas Goyne 97a7b74dea Update fontconfig 2014-07-01 12:25:36 -07:00
Thomas Goyne 0f42155ca2 Make all of the syntax highlighter colors customizable
Closes #1782.
2014-07-01 12:25:22 -07:00
Thomas Goyne 71b74a6e86 Remove -D__STDC_FORMAT_MACROS from CXXFLAGS
The inttypes defines are no longer used anywhere due to that agi::Format
doesn't require them.
2014-07-01 12:22:39 -07:00
Thomas Goyne c1a7ba0009 Merge pull request #13 from dwbuiten/goto1
srt: Factor out a goto statement
2014-06-30 13:08:14 -07:00
Derek Buitenhuis 14f9814bba srt: Factor out a goto statement
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-06-30 17:05:30 +01:00
Thomas Goyne e1d56f9294 Update all selected lines when dragging the origin in the rotate tools 2014-06-29 11:42:55 -07:00
Thomas Goyne 5989226422 Fix crash when loading video from drag&drop is cancelled 2014-06-29 11:42:46 -07:00
Thomas Goyne a38793497f Drop support for the DirectX SDK and require the Windows 8 SDK for DirectSound 2014-06-29 10:45:27 -07:00
Thomas Goyne e53b2dab6b Eliminate a string copy for @ fonts in the fonts collector 2014-06-29 10:45:27 -07:00
Thomas Goyne c50d80cf24 Fix enabling/disabling the default script resolution edit boxes in the preferences dialog 2014-06-29 10:45:26 -07:00
Thomas Goyne 3ef728405d Add -DBOOST_SYSTEM_NO_DEPRECATED to Boost's CPPFLAGS 2014-06-29 10:45:26 -07:00
Thomas Goyne dbf144812b Fix failing path tests on OS X 2014-06-29 10:45:26 -07:00
Thomas Goyne 4c88449e4c Make UnknownElement moveable and not copyable
And remove the unused comparison functionality.
2014-06-29 10:45:26 -07:00
Thomas Goyne 4c0e578eda Rewrite the remaining bits of json::Writer 2014-06-29 10:45:26 -07:00
Thomas Goyne bc410a99f6 Change the in-memory storage of options to a sorted vector 2014-06-29 10:01:00 -07:00
Thomas Goyne 13fe4fe9ff Actually load the platform config rather than the default config twice 2014-06-28 19:49:39 -07:00
Thomas Goyne c9608ab610 Remove an exception not used for anything useful 2014-06-28 19:49:39 -07:00
Thomas Goyne b7a8dea753 Remove a pointless static bool 2014-06-28 19:49:39 -07:00
Thomas Goyne 6fec035958 Regenerate aegisub.pot 2014-06-27 11:20:04 -07:00
Thomas Goyne 481f9e42a7 Fix the path to the desktop file in make_pot.sh 2014-06-27 11:20:03 -07:00
Thomas Goyne dab67c6267 Enable the Apply button in the preferences dialog after a color is changed 2014-06-27 11:15:48 -07:00
Thomas Goyne 4accc988b3 Make the main edit box's background color customizable
Closes #1042.
Closes Aegisub/Aegisub#12.
2014-06-27 11:15:48 -07:00
Thomas Goyne ce629c2393 Add the help page for the resolution mismatch dialog 2014-06-27 11:15:48 -07:00
Thomas Goyne 6e40f4f920 Don't automatically select all control handle in the vector clip tool
This was originally done because there was no easy way to select them
all otherwise, but box selection of handles has been supported for a
while now.
2014-06-26 17:24:54 -07:00
Thomas Goyne e48e8cef84 Load files dropped on the window asynchronously 2014-06-26 17:24:54 -07:00
Thomas Goyne 6a3a401f57 Update fontconfig 2014-06-26 16:50:54 -07:00
Thomas Goyne b8f20dfe49 Add a custom stream IO implementation for Freetype
Freetype expects its IO to perform like mmap (i.e. seeking to be free),
but the non-unix implementation uses fseek and fread. This
implementation simply reads the entire file into a buffer, as fonts
generally aren't very big.

Cuts the time to recreate the fontconfig cache on my machine by about
60%.
2014-06-26 16:50:54 -07:00
Thomas Goyne 99cf941edd Trim a bit more out of the ICU data files 2014-06-26 16:50:43 -07:00
Thomas Goyne 03443818f0 Pass UTF-8 paths to hunspell now that it supports them 2014-06-26 16:50:43 -07:00
Thomas Goyne 3c57dda9ac Update to hunspell 1.3.3 2014-06-26 16:50:43 -07:00
Thomas Goyne 41b08628bc Update ffms2 2014-06-24 13:14:21 -07:00
Thomas Goyne 5816af6c01 Disable RTTI for ffms2, hunspell, and universalchardet
They don't actually use it so it's just pointless bloat.
2014-06-24 13:14:21 -07:00
Thomas Goyne 69781f0a88 Enable compression for the 256x256 icon
Bumps 200KB off the executable.
2014-06-24 13:14:20 -07:00
Thomas Goyne 4861287332 Remove the in-repo copy of the fontconfig config files
And just copy them from the fontconfig installation being used.
2014-06-24 09:06:32 -07:00
Thomas Goyne 0153987e02 Eliminate warnings in lpeg 2014-06-24 09:06:32 -07:00
Thomas Goyne 6661c6a808 Fix use-after-frees when opening files from the MRU lists
Pass the paths to open by value to avoid ending up with a dangling
reference to a path stored in the MRU list which has been invalidated by
adding or removing items.

Closes #1777.
2014-06-23 16:40:43 -07:00
Thomas Goyne 4ce1283bbb Fix handling of thesaurus words with only a single suggestion
When there's only one suggestion for a given word the part of speech
appears in the suggested replacement, which needs to be stripped.

Closes #1776.
2014-06-23 16:40:43 -07:00
Thomas Goyne 5ece2e534c Merge pull request #6 from darealshinji/patch-1
fix icons target dir on Linux
2014-06-21 16:23:16 -07:00
darealshinji 5496544984 fix icons target dir on Linux
The /usr/share/icons/hicolor/*x*/ directories contain only subfolders.
2014-06-21 17:05:42 +02:00
Thomas Goyne 961e6dab88 Select the last token when double-clicking past the end of the text in the edit box 2014-06-20 10:45:13 -07:00
Lasse Liehu 790d52b113 Update Finnish translation
Closes #1774.
2014-06-19 09:17:27 -07:00
Thomas Goyne 5f981e40f1 Add dependency on libresrc headers to all of the src objects 2014-06-17 20:48:59 -07:00
Thomas Goyne 68eaab0f43 Convert the build system to non-recursive make
Speeds up a no-op build from 500ms to 60ms and significantly improves
dependency tracking.
2014-06-17 11:37:20 -07:00
Thomas Goyne cb71a3d05d Fix saving audio clips
Actually write all of the samples rather than half of them.
2014-06-15 17:17:15 -07:00
Thomas Goyne 5f9fc95fb4 Always update the rendered subtitles for non-dialogue changes
Closes #1770.
2014-06-15 17:17:15 -07:00
Thomas Goyne 23f6addf35 Close the detached video dialog when video is closed 2014-06-15 17:17:15 -07:00
Thomas Goyne 7780fadfc6 Fix restarting the application after changing the UI language on OS X 2014-06-14 06:51:53 -07:00
Thomas Goyne ebb13d96ec Add the restart helper binary to the application bundle, not the source file 2014-06-14 06:51:53 -07:00
Thomas Goyne 62c28ce0d3 Avoid pointless repaints of the grid when seeking video
Keep track of which lines are displayed on the current video frame so
that video seeks only have to repaint the grid when the set actually
changes. Speeds up video playback on non-fbf stuff by ~15%.
2014-06-12 17:06:25 -07:00
Thomas Goyne 633fa0e4d7 Only repaint the video slider on seek if the thumb will actually move
Cuts CPU usage for playback in totally arbitrary circumstances by about
5%.
2014-06-12 17:06:25 -07:00
Thomas Goyne 4bdccb889c Reuse buffers for video frames
At least on OS X, allocating the buffers is one of the more expensive
parts of video playback, and on an arbitrary 720p H.264 file with simple
subtitles this cuts CPU usage while playing by about 30%.
2014-06-12 17:06:25 -07:00
Thomas Goyne a574d6ac67 Speed up AsyncVideoProvider::UpdateSubtitles a bit
Adding Row to AssDialogue removes the need to loop over the file to find
out what rows changed.
2014-06-12 17:06:25 -07:00
Thomas Goyne 2508dd9c6e Only scroll the grid to the active line if the row has actually changed
Makes it so that undo/redo only scrolls to the active line if it's
different in the two versions of the file.
2014-06-12 17:06:25 -07:00
Thomas Goyne f24a72d8fc De-wxString HelpButton 2014-06-11 12:52:30 -07:00
Thomas Goyne 8e36b69ef1 Update manual URL for 3.2 2014-06-11 12:52:30 -07:00
Thomas Goyne 87f99876c6 Eliminate some repeated iequals 2014-06-11 12:52:30 -07:00
Thomas Goyne 7de5fbac92 Eliminate all remaining places where strings are thrown as exceptions
Closes #916.
2014-06-11 12:52:30 -07:00
Thomas Goyne 789ff25f27 Remove some exceptions not used for much of anything 2014-06-11 12:52:30 -07:00
Thomas Goyne cfd2698b03 Use NSSpellChecker rather than hunspell on OS X
Main benefit is it removes the need to ship 50 MB of dictionaries.
2014-06-11 12:33:09 -07:00
Thomas Goyne 6500b379bd Remove all distfile stuff from the build system
It's unused and out of date.
2014-06-09 17:20:56 -07:00
Thomas Goyne 168cb8d7ef Move the desktop dir under the packages dir 2014-06-09 17:20:56 -07:00
Thomas Goyne b777cae2fe Fix crash on invalid extradata from automation 2014-06-09 17:20:56 -07:00
Thomas Goyne 831fbcd9a0 Fix crash when an extradata entry is used by more than one line 2014-06-09 17:20:56 -07:00
Thomas Goyne ac7161cd08 Revert 50dfa1cd42 for wxGTK
wxGTK has the opposite problem as OS X: GetValue returns the new value,
but the change event has the old value.
2014-06-08 08:00:11 -07:00
Thomas Goyne 056a775751 Set ?dictionary to the correct thing on OS X. Closes #1766. 2014-06-08 08:00:11 -07:00
Thomas Goyne 882e6894ff Use GCD on OS X rather than boost.asio for the thread pool 2014-06-07 08:48:40 -07:00
Thomas Goyne aae82f01e9 Set the margin controls in the style editor to the correct initial values 2014-06-07 08:48:40 -07:00
Thomas Goyne ce29d07113 Remove an entirely pointless GUI-thread-blocking call to GetFrame 2014-06-07 08:48:40 -07:00
Thomas Goyne f38ba33fed Eliminate some pointless rerenders of the video display
If the frame number hasn't changed and none of the currently visible
lines have changed, there's no need to rerender the subtitles and
redisplay the frame. Mostly helps with very slow opengl implementations
where actually painting the video display is expensive, as the rendering
is done on a background thread anyway.
2014-06-07 08:48:39 -07:00
Thomas Goyne 556d655c0b Update ffmpeg, ffms2, libass 2014-06-06 12:08:51 -07:00
Thomas Goyne 5e54a342e4 Fix the Select All button in the import styles dialog 2014-06-06 12:08:41 -07:00
Thomas Goyne ce358c1367 Move global_scripts to options.h
Not the perfect place for it by any means, but that's where the rest of
the application-global stuff is these days and it removed the need for
automation stuff to include main.h (and thus all the wxApp garbage).
2014-06-06 12:08:41 -07:00
Thomas Goyne 07cf50f7d3 Use non-deprecated wxIMPLEMENT_APP 2014-06-06 12:08:40 -07:00
Thomas Goyne 392c9ea35a Catch std::exceptions thrown during startup 2014-06-06 12:08:40 -07:00
Thomas Goyne 62d64e0949 Update wxWidgets 2014-06-05 12:03:56 -07:00
Thomas Goyne 5009e6f497 Add clang PGO files to .gitignore 2014-06-05 12:03:30 -07:00
Thomas Goyne 04efe2edfb Delete osx-run.sh
wxWidgets now supports running from outside application bundles, so it's
no longer needed.
2014-06-05 08:35:50 -07:00
Thomas Goyne 421d5ca52e Add #ifdef __cplusplus to the precompiled headers to make Xcode happy 2014-06-05 08:35:50 -07:00
Thomas Goyne 50dfa1cd42 Fix issues with selected line styles with the keyboard on OS X
Opening the style list dropdown and switching between values with the
arrow keys doesn't update the value returned from ctrl->GetValue() on
OS X, but the event contains the correct value so use that instread.
2014-06-05 08:35:50 -07:00
Thomas Goyne 238110e799 Set minimum widths for the columns of the hotkeys editor on OS X
The OS X implementation makes very poor choices for the default widths
if given the opportunity.
2014-06-05 06:33:03 -07:00
Thomas Goyne fffb138b81 Add IME support on OS X
Closes #1247, #1672, #1695.
2014-06-04 14:29:37 -07:00
Thomas Goyne acdc0e7cba Use less std::set 2014-06-04 14:15:27 -07:00
Thomas Goyne 9133293869 Use less std::bind 2014-06-04 14:15:27 -07:00
Thomas Goyne 745aa8fef0 Use less wxString in HotkeyDataViewModel 2014-06-04 14:15:26 -07:00
Thomas Goyne 970dd96959 Delete unused variable 2014-06-04 14:15:26 -07:00
Thomas Goyne 460b806038 Use non-deprecated wxFONT/wxPEN constants 2014-06-04 14:15:26 -07:00
Thomas Goyne d3484e7382 Get the end time of the last line in a less dumb way 2014-06-04 14:15:26 -07:00
Thomas Goyne f7532ff1ef Actually use the ?dictionary token. Closes #1761. 2014-06-04 14:15:26 -07:00
Thomas Goyne 47303007eb Remove the ?docs token
It's not actually used anywhere and not even set on Windows.
2014-06-04 14:15:26 -07:00
Thomas Goyne 0bf93ec263 Fix a bunch of crashes in the vector clip tool 2014-06-03 10:07:35 -07:00
Thomas Goyne 5fcb287ed0 Fix saving images with subtitles for frames other than the first 2014-06-03 07:21:07 -07:00
Thomas Goyne 4e5b81973b Set the initial audio volume when opening audio 2014-06-03 07:21:07 -07:00
Thomas Goyne e6d7c4547a Fix compilation of the portaudio player 2014-06-03 07:21:07 -07:00
Thomas Goyne b42086fdfd Use the customized default styles for SRT files opened from matroska 2014-06-02 13:02:06 -07:00
Thomas Goyne e061ac8755 Pull even more of the subs load logic into Project
The relative order of the on-file-load logic matters, so signals don't
work very well for it. Doing it all explicitly in Project fixes a bunch
of inconsistent issues related to restoring saved state.

Closes #1759.
2014-06-02 13:02:06 -07:00
Thomas Goyne 3bd6c302c3 Add a bunch of missing project references 2014-06-02 13:02:05 -07:00
Thomas Goyne 9f8a648017 Disable a bunch of ICU stuff we don't use
Bumps ~800KB off the executable (and 100MB off icu.lib).
2014-06-02 13:02:05 -07:00
Thomas Goyne 917913b0ef Flush the clipboard before closing it, not after 2014-06-02 13:02:05 -07:00
Thomas Goyne ff9beb850c Build wx without iostream support 2014-05-31 08:11:32 -07:00
Thomas Goyne 193b30af86 Eliminate a bunch of entirely pointless OptionPage subclasses 2014-05-31 08:11:32 -07:00
Thomas Goyne 76f0afecaf Eliminate pointless wxDialog subclasses
A lot of the wxDialog subclasses don't actually override any virtual
functions, so there's no particular need for them to be subclasses at
all, and wxDialog's vtable is so huge that they actually contribute
measureable to the size of the executable.
2014-05-31 08:11:32 -07:00
Thomas Goyne fb27c98ddd Update wxWidgets 2014-05-30 13:24:58 -07:00
Thomas Goyne 060536824b Kill ScintillaTextCtrl and just always use the UTF-8 methods
Trivially improves performance and reduces the opportunities for wxSTC
to fuck up.
2014-05-30 13:24:38 -07:00
Thomas Goyne e6b495dc1b Enable ffmpeg's png decoder 2014-05-30 13:24:38 -07:00
Thomas Goyne db3452bcde Disable decoders for dumb rarely-used formats which have huge data tables 2014-05-30 13:24:38 -07:00
Thomas Goyne fa68b5ee1a Fix compilation with UTF-8 wxString 2014-05-30 11:53:15 -07:00
Thomas Goyne eebd1dba21 Use iconv rather than std::wstring_convert
libstdc++ 4.8 does not have <codecvt>.
2014-05-30 11:53:15 -07:00
Thomas Goyne 59489b8f8c Extract some of the string formatter implementation to format.cpp 2014-05-30 11:53:15 -07:00
Thomas Goyne 37c02ae127 Replace wxString::Format with agi::format
It's modestly faster, significantly more type-safe, and doesn't assert
when there's too few arguments, which causes problems for plural forms.

Closes #1733.
2014-05-30 11:53:14 -07:00
Thomas Goyne 8d26c66d0f Remove a bunch of unused functionalty from agi::Exception 2014-05-30 11:53:14 -07:00
Thomas Goyne b43788fa7f Replace boost::format with agi::format
boost::format is slow to compile, slow to run, and has an unpleasant
interface.
2014-05-30 08:30:31 -07:00
Thomas Goyne 8ba286c544 Fix moving files to the front of the MRU list 2014-05-30 08:30:31 -07:00
Thomas Goyne 72748d45f7 Fix crash on v1 timecode files with zero override ranges 2014-05-30 08:30:31 -07:00
Thomas Goyne e75fc089d3 Don't error on truncated wave files 2014-05-27 06:42:47 -07:00
Thomas Goyne 59a680e6e1 Fix saving audio clips from lines 2014-05-27 06:42:46 -07:00
Thomas Goyne dfec6b73b7 Use free() on data returned by Hunspell, not delete 2014-05-27 06:42:46 -07:00
Thomas Goyne eec83bb32b Cut down on FileNotFound exceptions thrown on startup 2014-05-27 06:42:46 -07:00
Thomas Goyne d08f4e73b4 Only check for permissions if opening a file fails 2014-05-27 06:42:46 -07:00
Thomas Goyne ac5f40a543 Fix \N handling in EBU STL export 2014-05-27 06:42:46 -07:00
Thomas Goyne 02ca3360ca Handle missing recently used subtitle files better 2014-05-26 09:34:20 -07:00
Thomas Goyne 960dc3723b Don't get the duration from the audio controller on audio open
The audio controller's provider may not have been updated yet.
2014-05-26 09:34:20 -07:00
Thomas Goyne cca97a58f6 Fully initialize the video when it's opened via drag-and-drop 2014-05-26 09:34:20 -07:00
Thomas Goyne 4da1443194 Store connected slots in a vector rather than a map 2014-05-26 09:34:20 -07:00
Thomas Goyne 81b942ea6e Update agi_pre.h 2014-05-26 09:34:20 -07:00
Thomas Goyne 6c685daf98 Ditch boost.circular_buffer
It drags in a ton of crap, is kinda slow at runtime due to using
std::deque, and doesn't actually make the code much simpler than just
using a manual ring buffer.
2014-05-26 09:34:19 -07:00
Thomas Goyne 1f7c47239b Replace timeval junk with std::chrono 2014-05-26 09:34:19 -07:00
Thomas Goyne 650cfcb043 Remove a bunch of unused crap from lagi_pre.h 2014-05-26 09:34:19 -07:00
Thomas Goyne 50f2e550e2 Use std::thread with libc++
boost::thread is only used due to libstdc++ 4.8 missing a bunch of
stuff.
2014-05-26 09:34:19 -07:00
Thomas Goyne 6477ef933b Use std::to_string rather than boost::lexical_cast 2014-05-26 09:34:19 -07:00
Thomas Goyne 41297e5ace Remove non-spirit uses of boost.phoenix
The slightly more concise code is not worth the compilation speed hit.
2014-05-26 09:34:19 -07:00
Thomas Goyne fed99649e9 Cut down on pointless uses of std::list 2014-05-26 09:34:19 -07:00
Thomas Goyne c0d3ecb6c2 Change Spline to a std::vector 2014-05-26 09:34:18 -07:00
Thomas Goyne 8ec9280ecc Change most uses of deques to vectors 2014-05-26 09:34:18 -07:00
Thomas Goyne 20a7ec786f Use initializer lists rather than std::make_pair 2014-05-26 09:34:18 -07:00
Thomas Goyne 4f65f79f1e Remove some pointless std::moves 2014-05-26 09:34:18 -07:00
Thomas Goyne 4598a23485 Fix the paste over dialog 2014-05-24 07:41:17 -07:00
Thomas Goyne b370e1af53 Stop video playback when seeking due to switching active lines 2014-05-24 07:41:17 -07:00
Thomas Goyne d73790805a Fix reloading the video provider after settings changes 2014-05-24 07:41:16 -07:00
Thomas Goyne 9ca61a2fb5 Delete unused stuff in the pulseaudio player 2014-05-24 07:41:16 -07:00
Thomas Goyne 55865d131a Add a missing check for if the video has an audio track 2014-05-23 13:03:10 -07:00
Thomas Goyne 99b46f6a14 Fix restoring video position from saved project info 2014-05-23 13:03:10 -07:00
Thomas Goyne d004fc1856 Improve ALSA playback position reporting
Use std::chrono since it's a nicer API. Use a separate lock for playback
position so that the GUI thread isn't blocked for hundreds of ms while
snd_pcm_drain is waiting, and update the playback position after
decoding audio rather than before to avoid it being significantly wrong
when not using a cache.
2014-05-23 13:03:10 -07:00
Thomas Goyne e36ecbde49 Reuse a decoding buffer for ALSA rather than constantly allocating new ones 2014-05-23 13:03:10 -07:00
Thomas Goyne 1bf6197869 Use std::thread rather than pthreads for AlsaPlayer 2014-05-23 13:03:10 -07:00
Thomas Goyne c2b8892b33 Use unique_ptr in AlsaPlayer 2014-05-23 13:03:10 -07:00
Arslanoglou Georgios b9a683eeb2 Update Greek translation. Closes #1526. 2014-05-23 07:47:27 -07:00
Thomas Goyne 9a3f5ce905 Add a BOM to fragment_strings.iss
InnoSetup doesn't read it as UTF-8 without one.
2014-05-23 07:47:27 -07:00
Thomas Goyne 9d3067ae75 Return absolute paths for files in project_properties() 2014-05-23 07:28:26 -07:00
Thomas Goyne 384f87f399 Use more plural forms for translatable strings 2014-05-23 07:28:25 -07:00
Thomas Goyne 60fd44163e Don't clear project properties on undo/redo 2014-05-23 07:28:25 -07:00
Thomas Goyne 40ac2f9b44 Fix crash when opening video
If video was previously open and the user chooses to resample the script
for the new video, VideoController would try to update the subs for the
now-deleted old provider.
2014-05-23 07:28:25 -07:00
Thomas Goyne e2754bcd90 Make video providers report whether their file has audio tracks
Fixes errors when trying to automatically open audio from dummy video
and improves UX a little by disabling the Open Audio From Video menu
item when there are no audio tracks.
2014-05-23 07:28:25 -07:00
Thomas Goyne 692b354713 Don't compile the FFT code if FFTW is enabled 2014-05-23 07:28:25 -07:00
Thomas Goyne e0b8c21590 Use unique_ptr for AudioWaveformRenderer's decode buffer 2014-05-23 07:28:25 -07:00
Thomas Goyne 09e325a1c3 Clean up unused includes 2014-05-23 07:28:24 -07:00
Thomas Goyne df406d5452 Fix compilation with GCC 2014-05-22 14:58:39 -07:00
Thomas Goyne 2bf23af00a Remove a lot of pointless headers for dialogs
Most of the dialogs in Aegisub have a public interface consisting of a
single function, so there's really no need to expose the actual dialog
classes to the rest of the program. Add dialogs.h with the declarations
of all of those functions (most of which are just ShowFooDialog()), and
kill a million other headers.
2014-05-22 14:58:39 -07:00
Thomas Goyne 49357eec20 Add missing subs_controller.h include for release builds 2014-05-22 09:54:59 -07:00
Thomas Goyne 9ae9da4aab Support loading keyframes and timecodes files via drag-and-drop
Closes #1749.
2014-05-22 09:29:16 -07:00
Thomas Goyne de2e1e23de List the files to be (un)loaded in the Load/Unload files dialog
Updates #880.
2014-05-22 09:29:16 -07:00
Thomas Goyne aa21b3d77d Add aegisub.project_properties()
Returns a table with all of the project metadata junk that used to be in
the script info section of the file.

Closes #1747.
2014-05-22 09:29:16 -07:00
Thomas Goyne 6a8958f287 Delete the Clean Script Info macro
It doesn't actually do anything anymore.
2014-05-22 09:29:15 -07:00
Thomas Goyne 9c7119fdc2 Redesign how project metadata is stored in the file
Remove it from the script info section and put it in its own section
that isn't tracked by undo and make it not stringly typed. Removes the
need for the gross hack where changes are slipped in just before saving
to circumvent the undo system, cuts down on the uses of string literals
to identify fields, and probably improves performance a little.
2014-05-22 09:29:15 -07:00
Thomas Goyne 19e8f19e52 Redesign project file handling
Add a new Project class which is responsible for everything related to
opening and closing audio, video, subtitles, timecodes and keyframes.
This pulls almost everything not directly related to playing audio/video
out of the audio and video controllers, pulls more crap out of
FrameMain, and happens to make things a little simpler in the process.
2014-05-22 09:29:12 -07:00
Thomas Goyne a345b8c4d5 Undelete the script resolution mismatch option from default_config 2014-05-22 06:14:59 -07:00
Thomas Goyne deaf833605 Preserve alpha when resampling style colors 2014-05-22 06:14:56 -07:00
Thomas Goyne 5830fc4225 Don't limit CodecPrivate to 256KB 2014-05-20 09:46:58 -07:00
Thomas Goyne f522d4df8a Update ffms2 2014-05-20 09:46:58 -07:00
Thomas Goyne 5f4d6ad386 Return zero bytes when MatroskaFile asks for data past the end of the file 2014-05-20 09:46:57 -07:00
Thomas Goyne 53f02d33a6 Fix a bunch of warnings when building with gcc on linux 2014-05-20 09:46:57 -07:00
Thomas Goyne 291437eed6 Handle ftruncate failures 2014-05-20 09:46:57 -07:00
Thomas Goyne c2455cccb6 Enable loading audio when opening video by default
Main reason not to do this was that loading audio blocked the UI, which
has now been fixed, and having to separately load audio confuses
beginners.
2014-05-20 09:46:57 -07:00
Daniel Mota 6b8c1ff2b2 Update pt_PT.po 2014-05-19 19:35:34 -07:00
Thomas Goyne 7645b447be Set the correct variable for whether to commit subs after opening video 2014-05-19 19:32:25 -07:00
Thomas Goyne 6edb38501b Update the YCbCr matrix used by the video display when the header is changed 2014-05-19 19:32:25 -07:00
Thomas Goyne ad33fdb109 Add color matrix conversion to the resolution resampler 2014-05-19 19:32:25 -07:00
Thomas Goyne 7a06e08ad0 Use ycbcr_converter in YUV4MPEGVideoProvider 2014-05-19 19:32:25 -07:00
Thomas Goyne cddefd8ed9 Add RGB <-> YCbCr conversion stuff to libaegisub 2014-05-19 19:32:25 -07:00
Thomas Goyne 9774352a77 Fix compilation with gcc 4.8. Closes #1756. 2014-05-19 06:53:44 -07:00
Thomas Goyne a376ed90b9 Insert \\N on shift-enter in the edit box 2014-05-18 07:50:23 -07:00
Thomas Goyne 2cf35b5043 Force-enable native TLS in wxWidgets
It is off by default on Windows due to that it breaks if a wx-using
library is loaded with LoadLibrary on XP, but that is not a use-case we
care about.
2014-05-17 18:32:04 -07:00
Thomas Goyne 402aa509a0 Fix non-pch compilation 2014-05-17 18:01:41 -07:00
Thomas Goyne d0ce26d7df Add an option to resample the script to the resolution mismatch dialog
Closes #1382.
2014-05-17 18:01:41 -07:00
Thomas Goyne 32fae528b0 Don't try to shift line margins that are 0 2014-05-17 18:01:41 -07:00
Thomas Goyne c78db67cba Round negative drawing coordinates correctly 2014-05-17 18:01:41 -07:00
Thomas Goyne 229b6cf63d Fix resampling drawings with AR changes
The shift from margins should be applied only to the line's position,
not to each point in the drawing, and the scale needs to compensate for
that the scale on the style is being changed as well.
2014-05-17 18:01:41 -07:00
Thomas Goyne 0f030c45f3 Make AR-changing resampling more user-friendly
Add modes where the borders to add or remove are automatically
calculated rather than forcing the user to do it manually, and hopefully
make it a bit clearer what exactly will happen.
2014-05-17 18:01:41 -07:00
Thomas Goyne 7e2780f57a Make both source and destination resolution overridable in the resampler 2014-05-17 18:01:40 -07:00
Thomas Goyne 6886436ddc Add YCbCr Matrix to the script properties dialog 2014-05-17 18:01:40 -07:00
电脑迷 207a78fa1e Update Chinese translations. Closes #1755. 2014-05-17 18:01:40 -07:00
Thomas Goyne d5ff5eaf5f Update fontconfig 2014-05-17 18:01:40 -07:00
Thomas Goyne 26cfd3ecbd Add missing check for if the context has been initialized in the crash handler 2014-05-15 12:07:46 -07:00
Thomas Goyne 796f26c008 Ask whether to check for updates in the installer
Gets rid of the last annoying modal dialog on first startup.
2014-05-15 12:07:46 -07:00
Thomas Goyne 1049b2d140 Make the "Create a start menu icon" string translatable 2014-05-15 11:09:42 -07:00
Thomas Goyne 79fd39d6ca Default to the language selected in the installer 2014-05-15 11:09:38 -07:00
Thomas Goyne 79c2634f2b Regenerate aegisub.pot 2014-05-15 10:09:32 -07:00
Thomas Goyne d741c55725 Extract installer strings for translation 2014-05-15 10:09:32 -07:00
Thomas Goyne 0a1660c03b Add version information to the windows executable
Closes #913.
2014-05-15 08:39:09 -07:00
Thomas Goyne 8a49cf1c34 Shove simple getters in AudioTimingControllerDialogue into the class declaration 2014-05-15 07:44:13 -07:00
Thomas Goyne 6f36c75cfd Fix snapping audio markers to markers from other selected lines 2014-05-15 07:31:33 -07:00
Thomas Goyne e593843da7 Significantly speed up marker snapping with large selections 2014-05-14 12:48:59 -07:00
Thomas Goyne fc662e0278 Use INT_MIN as the invalid click position sentinel rather than -1 2014-05-14 12:13:40 -07:00
Thomas Goyne c13b026598 Snap based on all markers being dragged rather than just the mouse position 2014-05-14 12:04:19 -07:00
Thomas Goyne 9168484fc6 Allow clicking anywhere in the audio display for alt-dragging 2014-05-14 08:37:03 -07:00
Thomas Goyne 48acd4aa13 Install libpng headers 2014-05-13 15:35:00 -07:00
Thomas Goyne fff59982f4 Clear the clicked marker on right click 2014-05-13 12:44:28 -07:00
Thomas Goyne b7b2ea2d61 Skip building wx files that don't actually define anything 2014-05-13 11:51:22 -07:00
Thomas Goyne 66ba65774a Add custom build system for wxWidgets 2014-05-13 11:02:46 -07:00
Thomas Goyne 843412beb0 Install headers before compiling rather than after 2014-05-13 09:24:40 -07:00
Thomas Goyne 95eb603f8d Link against zlib.lib rather than wxzlib.lib 2014-05-12 17:42:26 -07:00
Thomas Goyne a0efd18f96 Use wx's vendored copy of zlib rather than having a second copy in a submodule 2014-05-12 17:42:26 -07:00
Thomas Goyne 1651446e0f Drag the entire audio selection when Alt is held down
Closes #691.
2014-05-12 12:07:46 -07:00
Thomas Goyne 5da847e1ef Use more NSDMIs 2014-05-12 10:05:36 -07:00
Thomas Goyne 562a2259f5 Check for uses of styles other than "Default" in CanSave rather than customized styles
Customizable default styles makes the latter check awkward to implement,
and the previous logic of comparing against the hardcoded default wrong.
2014-05-12 08:34:28 -07:00
Thomas Goyne bc2f862909 Update wx 2014-05-12 08:04:53 -07:00
Thomas Goyne 164ad33753 Fix RTL painting of the subtitles grid
wx comes very close to just making it work automatically, but it doesn't
translate the origin to the top-right corner and wxBufferedPaintDC
doesn't handle RTL at all, so reimplement it with some hacks.

Closes #1354.
2014-05-12 08:04:24 -07:00
Thomas Goyne 0909d137b0 Mirror toolbar button images for RTL locales
Some of the toolbar buttons are seriously wrong when mirrored and there
doesn't seem to be a way to disable mirroring for the images while using
RTL layout for the toolbar itself, so double-mirror them so that they
end up with their original appearance.

Ideally the button images would be localizable as some of them actually
should be mirrored, but that's probably not worth the work involved.

See #1354.
2014-05-11 07:31:22 -07:00
Thomas Goyne 3d0e2baf4e Force the video display to LTR layout direction
Mirroring the video is not useful or desirable.

See #1354.
2014-05-11 06:59:59 -07:00
Thomas Goyne 645848d0c5 Fix test compilation on Windows 2014-05-10 08:19:59 -07:00
Thomas Goyne 8ff801a645 Update readme 2014-05-10 08:19:59 -07:00
Thomas Goyne 3db69b0a29 Add more missing project dependencies for working parallel builds 2014-05-10 08:19:59 -07:00
Thomas Goyne eb2793f88d Add msbuild build system for FFmpeg
This eliminates the need for a msys environment to build any part of
Aegisub. Also happens to make building FFmpeg much faster (~3 minutes
vs. ~10 minutes for me).
2014-05-10 08:19:59 -07:00
Thomas Goyne 3d8071df7f Update ffmpeg 2014-05-10 06:12:37 -07:00
Thomas Goyne 2c0568090c Add a custom build task for getting the git version info
Eliminates the need to have a copy of git accessible in the msys
build environment and reduces the dependency on msys to just FFmpeg.

Probably trivially faster due to how slow shell scripts are on Windows.
2014-05-10 06:12:37 -07:00
tophf 01dc7f9294 Only process selected lines in the Select Overlaps macro
And skip over commented lines as the description claimed it did already.

Closes #1751.
2014-05-09 10:25:13 -07:00
Thomas Goyne b96edfebcc Remove check for customized styles in SRTSubtitleFormat::CanSave
It doesn't work with customizable default styles.
2014-05-09 09:24:27 -07:00
Thomas Goyne 73d64870af Fix writing files as non-utf-8 2014-05-09 07:00:48 -07:00
Thomas Goyne 94a060a556 Add unicode case conversion functions to the automation module 2014-05-09 07:00:48 -07:00
Thomas Goyne eadf555da3 Pass exceptions in async workers back to the main thread 2014-05-09 07:00:48 -07:00
Thomas Goyne 74e995b915 Disable more wx stuff we don't use 2014-05-08 17:26:27 -07:00
Thomas Goyne 36d9a3c490 Add msbuild build system for fribidi
Thankfully the release tarball comes with pre-built versions of
the generated files.
2014-05-08 15:03:42 -07:00
Thomas Goyne 2e40f2b246 Switch to downloading a release tarball for fribidi 2014-05-08 14:41:38 -07:00
Thomas Goyne 135b61595c Add missing build dependencies on minilua 2014-05-08 13:13:45 -07:00
Thomas Goyne b2c210ffeb Delete old config file for ICU 2014-05-08 12:38:58 -07:00
Thomas Goyne b4d49511be Fix ignoring override blocks for CPS calculations 2014-05-08 12:34:04 -07:00
Thomas Goyne 679b96fdfe Add msbuild build system for ICU 2014-05-08 12:34:04 -07:00
Thomas Goyne d3a4bed994 Port respack to lua
Simplifies the build system a little by cutting down on the number of
helpers that need to be built.
2014-05-08 10:39:18 -07:00
Thomas Goyne 9f8a10b014 Strip a few more MB of unused stuff from ICU's data files 2014-05-07 15:57:48 -07:00
Thomas Goyne 571c9d9b7a Don't hardcode the size of buttons with translatable labels. Closes #1750. 2014-05-07 10:43:01 -07:00
Thomas Goyne 049142f6f6 Make the check for faux bold match libass's logic for when to embolden 2014-05-07 07:13:32 -07:00
Thomas Goyne 8e5d4c48bc Print usage information for faux bold/itatlic warnings 2014-05-07 06:51:35 -07:00
Thomas Goyne 26e7880c8b Fix compilation with non-16-bit wchar_t 2014-05-06 18:31:19 -07:00
Thomas Goyne 77a2c1bb16 Verify that we're actually using a UTF-8 locale and switch to en_US.UTF-8 if not
Should fix #1587 and #1675, but I was never able to reproduce either of
them so maybe not.
2014-05-06 18:16:36 -07:00
Thomas Goyne 432640c045 Use localized language names from ICU rather than English names 2014-05-06 17:32:10 -07:00
Thomas Goyne 86ebd15ffb Update to ICU 53.1 2014-05-06 17:20:13 -07:00
Thomas Goyne 32f5e00bf8 Eliminate a pointless check 2014-05-06 10:32:19 -07:00
Thomas Goyne 50d0744e9c Skip prompting the user for a language on first start if we have a translation for their OS UI language 2014-05-06 10:29:53 -07:00
Thomas Goyne 47b8627ad3 Keep the old subtitles file alive until the new one is fully announced
This fixes crashes from touching dangling references to lines in the old
subtitle file in the handlers for the various signals triggered when a
new file is opened.
2014-05-06 09:36:07 -07:00
Thomas Goyne ca1cf8d9e7 Set the version in the Windows installer automatically 2014-05-06 08:07:57 -07:00
Thomas Goyne ca86b0da33 Actually initialize the initial MatchState in the search replace engine 2014-05-05 18:52:16 -07:00
Thomas Goyne a00e5dc967 Update which style the Edit button edits when the line's style is changed 2014-05-05 18:42:06 -07:00
Thomas Goyne 2674c702d1 Silence incorrect warning 2014-05-05 17:53:14 -07:00
Thomas Goyne 75641141d6 Switch icon creation to additional tasks rather than components 2014-05-05 17:37:07 -07:00
Thomas Goyne 48250db656 Add all of the applicable translations to the installer 2014-05-05 16:51:22 -07:00
Thomas Goyne cfad8ea3d4 Add more old pdbs to the files for the installer to clean up 2014-05-05 16:06:37 -07:00
Thomas Goyne 7e2724c22c Add support for submenus in the automation menu
Split the menu text on /, with each segment before the last used as the
submenu name and the last as the actual menu text.

Closes #852.
2014-05-05 14:27:01 -07:00
Thomas Goyne c5608a4725 Add Comment field to the paste over dialog 2014-05-05 07:01:57 -07:00
Thomas Goyne 26a9e57006 Eliminate an extra commit when using the color picker buttons 2014-05-05 06:28:27 -07:00
Thomas Goyne f261688b11 Don't ignore the contents of override blocks when counting characters for selection preserving 2014-05-05 06:27:37 -07:00
Thomas Goyne 3983719e3f Add an Edit button next to the style list dropdown. Closes #1746. 2014-05-04 12:53:22 -07:00
Thomas Goyne 57f6e9a869 Actually serialize the styles for the subtitle renderers 2014-05-04 11:16:57 -07:00
Thomas Goyne 58603b51a8 Update libass 2014-05-04 10:15:57 -07:00
Niels Martin Hansen e1c575b7a1 MicroDVD import should also use default styles 2014-05-04 13:14:28 +02:00
Niels Martin Hansen 1dc2ae09a0 Forgot OSX default config in 6b827abec0 2014-05-04 13:07:25 +02:00
Niels Martin Hansen 82d7979f04 Pass style catalog names instead of file names to AssFile::LoadDefault 2014-05-04 13:04:48 +02:00
Niels Martin Hansen 79b6ce2583 Move style catalog indexing and naming logic 2014-05-04 13:03:04 +02:00
Niels Martin Hansen cdb6da4b2f Also ignore VS *.sdf lock files (*.opensdf) 2014-05-04 10:37:40 +02:00
Niels Martin Hansen 5a4920c48f Option to change parallel make options for gmake based VS projects
It seems that gmake can livelock in parallel make mode on Windows
in some cases. This provides an escape hatch for those cases.
2014-05-04 10:35:15 +02:00
Niels Martin Hansen 5bb4754e40 Option to disable HAALISOURCE when building FFMS2 on VS
Visual Studio Express does not supply ATL and can't build the Haali-
supplied code in FFMS2, so provide an escape hatch for that.
2014-05-04 09:56:37 +02:00
Thomas Goyne c30ca1a321 Remove progress throttling from ffms indexing 2014-05-03 17:22:38 -07:00
Thomas Goyne d9df9c9e5b Add dummy install target for LuaJit 2014-05-03 17:22:38 -07:00
Thomas Goyne d672e75109 Filter out redundant progress updates sooner
Sending events from background threads to the main thread is somewhat
expensive, so filter out progress updates which don't actually change
the progress on the background thread.
2014-05-03 17:22:38 -07:00
Thomas Goyne 6a1321e1df Move the serialization for the subtitles providers to SubtitlesProvider 2014-05-03 17:22:38 -07:00
Thomas Goyne b40370c93d Grab the copy of vsfilter for the installer from the bin dir 2014-05-03 16:45:32 -07:00
Niels Martin Hansen 451c6751de Preferences page for default style catalogs 2014-05-03 22:23:01 +02:00
Niels Martin Hansen 6b827abec0 Config options for default style catalogs for various formats 2014-05-03 21:08:37 +02:00
Niels Martin Hansen f45f73151e Copy styles from Default catalog to new files 2014-05-03 20:02:52 +02:00
Niels Martin Hansen 3260a5fa1a Update about box 3rd-party library credits 2014-05-03 02:14:12 +02:00
Niels Martin Hansen 94a6b72f1d Add user *.props files to gitignore 2014-05-03 01:15:19 +02:00
Niels Martin Hansen 143de0713b Remove whitespace in MSYS shell environment vars
It seems that whitespace around the paths in the PATH, LIB, INCLUDE env
vars can break in some situations, making the build fail entirely.
Unfortunately this also makes the file harder to read and diff.
2014-05-03 01:08:56 +02:00
Niels Martin Hansen 9c2f12a786 Clearer error messages when audio open fails
The existing chain of errors from all providers can be really confusing,
so instead try to interpret the exception type to add some meaning.
2014-05-03 01:05:09 +02:00
Thomas Goyne 81c72c5fe9 Install lua.hpp when building luajit 2014-05-02 13:16:43 -07:00
Thomas Goyne 2587625af4 Fix non-pch compilation 2014-05-01 13:48:46 -07:00
Thomas Goyne f7f6c2b90b Switch to using csri_open_mem 2014-05-01 13:39:35 -07:00
Thomas Goyne af20d31699 Push the dropping of non-visible lines into the serialization logic
Makes things way less gross and trivially faster.
2014-05-01 13:39:35 -07:00
Thomas Goyne 7a5c92aaee Speed up TextFileWriter a bit
Write the text and the newline separately rather than appending the
newline to the text to eliminate a copy of the text.
2014-05-01 13:39:35 -07:00
Thomas Goyne 4366ece827 Speed up passing subtitles to VSFilter a little
Use temp_file_mapping so that it normally never actually hits the disk
on Windows and use AssSubtitleFormat directly.
2014-04-30 06:29:37 -07:00
Thomas Goyne 1eba2f035c Add a separate SSA subtitle format and move all of the SSA writing stuff there 2014-04-30 06:29:37 -07:00
Thomas Goyne 31af9c575f Extract duplicated ASS writing code from libass provider 2014-04-30 06:29:37 -07:00
Thomas Goyne b24e2c33e0 Update URL for ffms2 2014-04-29 07:24:43 -07:00
Thomas Goyne eca8991dd8 Remove some pointless configure checks 2014-04-29 07:23:02 -07:00
Thomas Goyne a7db164bd3 Fix extra blank lines in configure output 2014-04-29 07:12:04 -07:00
Thomas Goyne 3a64d81c50 Decruftify and fix the boost configure checks 2014-04-28 18:37:43 -07:00
Thomas Goyne 431b096f51 Fix loading modules with UTF-8 BOMs
Ensure MoonScript gets loaded before we install our package loader to
avoid having its package loader used over ours.
2014-04-28 14:19:16 -07:00
Thomas Goyne 606e3f4882 Fix crash on script load errors 2014-04-28 13:36:56 -07:00
Thomas Goyne e3fa270345 Process any pending log text when a progress dialog completes 2014-04-28 11:01:57 -07:00
Thomas Goyne e5f935678e Build LuaJIT in Lua 5.2 mode on Windows as well 2014-04-28 10:58:55 -07:00
Thomas Goyne a5a6d5da86 Restore the BOM-skipping logic to the Lua script reader
And add BOM to one of the test files to verify it works.
2014-04-28 10:21:54 -07:00
Thomas Goyne 8aa3c8761c Unswap the actor and effect columns in the grid 2014-04-28 10:10:33 -07:00
Thomas Goyne 5be69dc7e8 Fix compilation of LuaJIT on x64 Windows 2014-04-28 09:13:09 -07:00
Thomas Goyne aa850688f4 Don't try to open compressed subtitle tracks
Actually supporting them would be even better of course, but at least
don't crash on them.
2014-04-28 08:43:25 -07:00
Thomas Goyne c74045cf20 Use spin controls for numeric fields in the style editor
Closes #1741.
2014-04-28 07:38:33 -07:00
Thomas Goyne 63f4bf1beb Switch from regular Lua to LuaJIT 2014-04-28 07:38:30 -07:00
Thomas Goyne ec4a8c9a26 Fix read from before beginning of stack 2014-04-27 21:23:53 -07:00
Thomas Goyne b4de0b9b82 Fix crash on zero-length lua files 2014-04-27 21:23:52 -07:00
Thomas Goyne 9492192b73 Switch back to building Lua as C
In preparation for switching to LuaJIT, which doesn't support PUC Lua's
thing of using C++ exceptions for lua_error.

Requires replacing all uses of lua_error (and things calling lua_error)
with custom versions that throw an exception instead and adding an
exception -> lua error wrapper at all C++ -> Lua boundaries.
2014-04-27 10:37:23 -07:00
Thomas Goyne e3eb28ffd1 Extract some duplicated table pushing code 2014-04-27 09:15:35 -07:00
Thomas Goyne 689c16deb3 Use lua_createtable where applicable 2014-04-27 09:15:35 -07:00
Thomas Goyne 5cde33c8d5 Reimplement the useful parts of lfs
It doesn't support Unicode on Windows, so replace it with a
reimplementation using boost.filesystem that does, but skip all the
useless junk.
2014-04-26 08:16:39 -07:00
Thomas Goyne 50e27d8247 Shut up warning 2014-04-26 08:16:38 -07:00
Thomas Goyne 2adcc76cf6 Switch automation tests to busted
This requires shuffling a bunch of stuff around to get a CLI lua
executable that uses an automation-like environment, but that's
something that'll be nice to have in the future anyway.

Busted indirectly depends on lfs and we currently can't use external
binary modules, so add a copy of lfs to the repo and build it with
Aegisub.
2014-04-26 08:16:38 -07:00
Thomas Goyne b8af29da0d Move some of the automation machinery to libaegisub 2014-04-25 15:03:18 -07:00
Thomas Goyne 15ae2b0ccc Eliminate a bunch of explicit constructors/destructors
Use explicitly defaulted destructors for base cases when possible,
eliminate aggregate initialization constructors where possible, and push
some more stuff to NSDMIs.
2014-04-25 14:53:24 -07:00
Thomas Goyne a5fdc6795c Fix compilation of automation tests 2014-04-25 14:52:53 -07:00
Thomas Goyne 4cd92ee532 Move stuff only ever used in auto4_lua.cpp to an anonymous namespace there 2014-04-25 09:27:27 -07:00
Thomas Goyne e7734e642d Use nullptr 2014-04-25 08:59:43 -07:00
Thomas Goyne d0603fde88 Don't check for used extradata ids if there are none 2014-04-25 08:59:43 -07:00
Thomas Goyne 882afc5111 Update out-of-date tests 2014-04-25 08:59:42 -07:00
Thomas Goyne b9509289aa Fix test compilation 2014-04-25 08:59:42 -07:00
Thomas Goyne 2de5396f7a Remove luabins project from MinDep and Test targets 2014-04-25 08:59:42 -07:00
Niels Martin Hansen d53c36e67f Merge branch 'extradata'
Conflicts:
	src/ass_parser.cpp
2014-04-25 17:22:15 +02:00
Niels Martin Hansen 5a930cfee3 Forgot to add the luabins project to MSVS solution file 2014-04-25 17:19:39 +02:00
Thomas Goyne d4fbe3040d Preserve the insertion point (but not selection) when switching between lines 2014-04-25 08:00:45 -07:00
Niels Martin Hansen f278c35f3f Dynamically use either inline_string escaping or uuencoding for extradata
Since luabins generates binary data which grows up to 3x by escaping,
it's more efficient to uuencode that instead.
A marker is placed as the first character of the value field, either
'e' for inline_string escaped text, or 'u' for uuencoded binary data.
The key is always inline_string escaped, as it will typically be
human readable.
2014-04-25 16:04:08 +02:00
Niels Martin Hansen bcd41bd986 Windows build system for luabins (untested) 2014-04-25 15:08:54 +02:00
Thomas Goyne 6ee1b8ca52 Update the start sample between blocks in the ram audio provider correctly 2014-04-24 19:08:05 -07:00
Thomas Goyne cef07785d7 Remove a pointless ++ and make stuff const 2014-04-24 18:51:54 -07:00
Niels Martin Hansen 7839e8c983 Fix bug in extradata id list reading 2014-04-25 00:05:32 +02:00
Niels Martin Hansen b2768b7abd Work around boost::format bug
See https://svn.boost.org/trac/boost/ticket/9360
It seems that the %X specifier is ignored if the input value is a char type
and the char is instead output verbatim and not in its integer value.
Casting it to an int works around this.
2014-04-24 23:54:42 +02:00
Niels Martin Hansen 3f08b1d057 Use lua_pushlstring() so strings with embedded NULs also work 2014-04-24 23:49:36 +02:00
Niels Martin Hansen 18f55eaebf Load luabins library into Auto4 Lua environment 2014-04-24 23:01:27 +02:00
Niels Martin Hansen 057a223b38 Integrate luabins into Aegisub's build system
Make it build as C++ so it links properly against the C++-built version
of Lua used in Aegisub too.
2014-04-24 23:01:27 +02:00
Niels Martin Hansen b4801ef1bb Import luabins 831869cdc8c5e7579804e6472a2dc6cbe0b2672b 2014-04-24 23:00:41 +02:00
Thomas Goyne 7161ce167c Use lambdas rather than std::bind(std::ref(Signal)) for signal forwarding 2014-04-23 15:48:39 -07:00
Thomas Goyne 7f289551ae Remove -Wno-variadic-macros from CXXFLAGS
It's no longer nonstandard in C++11.
2014-04-23 15:29:23 -07:00
Thomas Goyne 6fc4c8da14 Move make_unique to its own header file
Rebuilding the entire project after touching util.h gets old fast.
2014-04-23 15:29:23 -07:00
Niels Martin Hansen cf81e91383 Perform extradata garbage collection on save 2014-04-23 22:54:01 +02:00
Niels Martin Hansen 159dfcde39 Add extradata reading/writing to Auto4 Lua 2014-04-23 22:54:01 +02:00
Niels Martin Hansen 040b467090 Add undo support for extradata 2014-04-23 22:54:01 +02:00
Niels Martin Hansen 8076fb2791 Basic storage and loading/saving for extradata 2014-04-23 22:54:01 +02:00
Thomas Goyne c248dc56da Make the visual tool drag handles a little smaller 2014-04-23 07:15:28 -07:00
Thomas Goyne 7b0b74fbb0 Fix off-by-one error in the bounds check for restoring the active line 2014-04-23 06:22:18 -07:00
Thomas Goyne ec6f14eef4 Make double-click in the edit box smarter
Use the syntax highlighting's word splitting to decide what to select so
that double-clicking on \Nword only selects 'word'.
2014-04-22 17:01:22 -07:00
Thomas Goyne b4284efb38 Trigger the audio selection change logic when switching timing controllers
Results in the display seeking to the active line when audio is opened
(if seeking to active line is enabled), and initializes the scrollbar
properly.

Updates #1732.
2014-04-22 16:42:47 -07:00
Thomas Goyne feec511227 Use more make_unique 2014-04-22 16:37:12 -07:00
Thomas Goyne c53e8f6139 Pass around newly created AudioTimingControllers in a unique_ptr 2014-04-22 16:21:53 -07:00
Thomas Goyne f83f8b73a0 Hide the CPS value if it's over 100 2014-04-22 12:35:41 -07:00
Thomas Goyne a30d6121fd Don't block the UI while decoding audio for the caches
Simply zero the memory for audio which hasn't been decoded yet, modify
the audio renderer to avoid caching blocks which aren't ready yet, and
add a progress indiciator to the audio display scrollbar.
2014-04-22 12:34:20 -07:00
Thomas Goyne 7dfd494a46 Update ffms2 2014-04-21 11:11:40 -07:00
Thomas Goyne 1bd3572054 Make the CPS warning thresholds and color customizable 2014-04-21 11:11:40 -07:00
Thomas Goyne 7bc35cecb7 Don't show a CPS value for lines under 100 ms long 2014-04-21 11:11:40 -07:00
Thomas Goyne 543034b96b Change the background color of the CPS column when the value is excessively high 2014-04-21 11:11:40 -07:00
Thomas Goyne a1a289c4c0 Push more of the painting logic into the grid column classes 2014-04-21 11:11:40 -07:00
Thomas Goyne 6e0160d730 Fix ugly extra grid line drawn when the first row is selected 2014-04-20 19:46:03 -07:00
Thomas Goyne 5646c05be7 Draw the active line box on top of the grid columns 2014-04-20 19:39:48 -07:00
Thomas Goyne f14cef7321 Remove pointless vertical alignment logic
The only time it has an effect is when font substitution occurs, and the
end result tends to be worse than doing nothing at all.
2014-04-20 19:32:39 -07:00
电脑迷 e42e6f36e6 Update Chinese translations. Closes #1739. 2014-04-20 07:01:49 -07:00
Thomas Goyne d886a5916d Create the output directory when collecting fonts to a zip 2014-04-20 07:01:49 -07:00
Thomas Goyne 1677e700b2 Add missing error checking for opening the output zip file in the fonts collector 2014-04-20 07:01:49 -07:00
Thomas Goyne 3ed99b5cb2 Make SubsEditBox::PopulateList less pointlessly slow 2014-04-20 07:01:49 -07:00
Thomas Goyne 2387b31cee Rearrange BaseGrid's data members 2014-04-20 07:01:49 -07:00
Thomas Goyne c3e024954c Make frame mode handling in grid columns a little less ugly 2014-04-20 07:01:48 -07:00
Thomas Goyne 6c6f60eb98 Add an option to ignore punctuation for the character counter 2014-04-18 20:11:38 -07:00
Thomas Goyne cff3c0a3df Don't repopulate the actor/effect fields when the active line changes
Speeds up switching lines on a totally arbitrary test file that doesn't
even use very many actors or effects by ~20%.
2014-04-18 20:11:38 -07:00
Thomas Goyne 8aea747b88 Update the character counter synchronously
It's not longer even vaguely in the realm of slow enough to justify
dumping off on a background thread.
2014-04-18 20:11:38 -07:00
Thomas Goyne 2de95818db Use ICU directly for character counting
ICU docs say not to create a new break iterator each time as
boost.locale does, and in fact creating the break iterator is about 90%
of the run time of the character counter, so use ICU directly and cache
the break iterator.
2014-04-18 20:11:38 -07:00
Thomas Goyne af32733797 Move character count stuff to libaegisub 2014-04-18 20:11:38 -07:00
Thomas Goyne bd53302907 Remove unused variable 2014-04-18 14:28:55 -07:00
Thomas Goyne 744717a164 Skip calculating the CPS for lines where it's very unlikely to be meaningful 2014-04-18 14:08:12 -07:00
Thomas Goyne 5143c34d70 Fix right and vertical margin columns 2014-04-18 14:05:31 -07:00
Thomas Goyne 5df871f599 Extract all of the column-specific logic from BaseGrid 2014-04-18 12:17:03 -07:00
Thomas Goyne 909be4494a Use a struct for the cached grid brushes rather than an array+enum 2014-04-18 07:17:38 -07:00
Thomas Goyne d5274b72d4 Cap CPS column at 999 2014-04-18 07:07:03 -07:00
Thomas Goyne 867eaae7a8 Add basic characters-per-second column to the grid 2014-04-17 19:11:35 -07:00
Thomas Goyne 393d1dd269 Fix combine lines commands 2014-04-17 18:08:03 -07:00
Thomas Goyne c93d38cc34 Clean up BaseGrid a little
Eliminate the hardcoded uses of 11 all over the place and cache the
calculation of the header widths.
2014-04-17 18:08:03 -07:00
Thomas Goyne 27c1522622 Use AssDialogue::Row more places 2014-04-17 17:30:06 -07:00
Thomas Goyne e729d38164 Add a warning for faux bold/italic to the fonts collector 2014-04-17 16:07:01 -07:00
Thomas Goyne 1a67ee1fdf Add SelectionController::GetSortedSelection and use it where useful 2014-04-17 14:32:18 -07:00
Thomas Goyne 5721cd1453 Update ffms2 2014-04-17 11:46:28 -07:00
Thomas Goyne df42fdb2d2 Restore the text selection and cursor position on undo 2014-04-17 11:46:28 -07:00
Thomas Goyne 56699e4800 Mark move constructors as noexcept
Or just default them for non-MSVC when possible.
2014-04-17 11:46:28 -07:00
Thomas Goyne 09d0d039e0 Convert signal.h to variadic templates 2014-04-17 11:46:27 -07:00
Thomas Goyne ecdf7c4fc3 Cut the width of the lines for the visual features in half 2014-04-17 11:46:27 -07:00
Thomas Goyne 18d9a43edb Cut the opacity of visual tool features in half 2014-04-17 11:46:27 -07:00
Thomas Goyne 73c2e92655 Clean up VideoBox a little 2014-04-17 11:46:27 -07:00
Thomas Goyne c8033c2ef7 Initialize the charset converter for the thesaurus sooner
Narrows the window of time for a crash-on-exit when the user exits while
a thesaurus is being loaded.
2014-04-16 08:15:31 -07:00
Thomas Goyne 00a3547453 Make find/replace and automation text fields unlimited length
On Windows text fields default to a maximum of 30,000 characters.
2014-04-16 08:11:38 -07:00
Thomas Goyne d07cba4875 Keep the old active line when an automation script changes the selection but not active line 2014-04-16 08:11:38 -07:00
Thomas Goyne 162e119afa Make subs.delete accept a table of rows to delete
Lua has a limit to how many arguments can be pushed onto the stack, so
when deleting very large numbers of lines at once unpacking a table can
fail.
2014-04-16 08:11:38 -07:00
Thomas Goyne c685ae4aea Remove -Wno-long-long from default CXXFLAGS
It's no longer nonstandard in C++11 so there's no default warning for
it.
2014-04-16 08:11:37 -07:00
Thomas Goyne 1d5292fdee Kill config.h and just force-include acconf.h in non-pch builds 2014-04-16 08:11:37 -07:00
Thomas Goyne dcf1270fc4 Ensure boost.locale is initialized with a UTF-8 locale on OS X
This fixes the find/replace dialog stripping non-us-ascii characters
from the file.

See #1587 for the same issue on Windows.
2014-04-15 16:57:45 -07:00
Thomas Goyne 489eca221d Fix compilation with clang 2014-04-15 11:09:25 -07:00
Thomas Goyne a141ef1264 Remove the never-actually-used BASE block type 2014-04-15 11:09:25 -07:00
Thomas Goyne 3528e49286 Make the duration field not completely wrong in frame mode 2014-04-15 11:09:25 -07:00
Thomas Goyne 780c93ed4d Make modifying multiple lines at once less brittle
Only count characters outside of override blocks for the relative
positions to do the edits on each line, which handles the case where the
lines have different lengths of stuff in override blocks but the same
text.
2014-04-15 06:19:12 -07:00
Thomas Goyne 7ed3fbade0 Eliminate some awful in/out arguments 2014-04-15 06:19:12 -07:00
Thomas Goyne 0e04794ffd Make the edit box buttons less dumb with multiple lines selected
Apply the modification at the cursor position to each selected line
rather than just setting all selected lines to the active line's text.
Still doesn't have good results in any nontrivial cases, but it's at
least sometimes useful.
2014-04-14 13:52:14 -07:00
Thomas Goyne 7fc78d40ab Switch from boost::ptr_vector to a vector of unique_ptr
ptr_vector hasn't been updated for C++11, so despite being specifically
designed to store pointers to objects it's less safe and not really any
easier to use than a regular vector of unique_ptrs
2014-04-14 13:52:14 -07:00
Thomas Goyne f53d840520 Unbind the progress dialog's idle handler when it's unneeded 2014-04-06 09:57:01 -07:00
Thomas Goyne 3e4b6a725f Change both selection and active line in SetSelectionAndActive before announcing 2014-04-04 09:01:03 -07:00
Thomas Goyne df762b5b99 Add a checked iterator_to() to AssFile
iterator_to requires that the object be in the list, which is sometimes
not the case when processing a commit which removed the active line or a
selected line. To handle this, add a checked version that returns
Events.end() when it is not in the list rather than crashing.
2014-04-04 09:01:02 -07:00
Thomas Goyne 9c4574ed34 Add a missing word to a help string 2014-04-04 09:01:02 -07:00
Thomas Goyne 54fa37c855 Fix compilation on linux
Closes tgoyne/aegisub#4.
2014-04-03 17:43:41 -07:00
Thomas Goyne b8d67b3d8e Update row numbers after an order-changing commit 2014-04-01 09:19:30 -07:00
Thomas Goyne caf5ac9cd7 Sort the audio display markers
This was accidentally removed in 5d3bc0d. Closes #1731.
2014-04-01 09:19:30 -07:00
Thomas Goyne 4adc7c78fc Remove array indexing from UnknownElement 2014-04-01 09:19:30 -07:00
Thomas Goyne fb79c47cb5 Actually include the dependency files in the tests Makefile 2014-03-31 10:23:36 -07:00
Thomas Goyne 8a520b31af Add a default value for GTEST_ROOT 2014-03-31 10:23:36 -07:00
Thomas Goyne ffb2fd2b9d Remove redundant option not found exception type 2014-03-31 10:23:36 -07:00
Thomas Goyne a050b43621 Define OptionValueMap with using rather than inheritence 2014-03-31 10:23:36 -07:00
Thomas Goyne c59b9d59b8 Clean up OptionValue
Make the vtables less absurdly huge (knocks 100KB off aegisub32.exe),
eliminate some copies of the values when constructing the options, and
use an enum class for the value type.
2014-03-31 10:23:36 -07:00
Thomas Goyne 371f602100 Fix tests compilation 2014-03-31 10:23:36 -07:00
Thomas Goyne fcd0df2e96 Preserve the old selection when an automation script doesn't return a new one 2014-03-31 08:11:43 -07:00
Thomas Goyne 3bbbc56053 Add the line's row number to AssDialogue
The grid needs to be able to map AssDialogue * to a row number, and just
storing it in the AssDialogue is nearly strictly better than a std::map
mapping events to rows. Probably will be of use elsewhere as well.
2014-03-31 08:11:43 -07:00
Thomas Goyne 84c5eb25b3 Actually check lines other than the active line in the spellchecker dialog 2014-03-31 08:11:43 -07:00
Thomas Goyne dbec5ff0bc Fix out-of-bounds read when looking for subtitles in a matroska file with no subtitles 2014-03-28 09:15:09 -07:00
Thomas Goyne c1f968a252 Add filters file for the FFMS2 project 2014-03-28 09:05:36 -07:00
Thomas Goyne 4a46f09d31 Force the final progress of operations to 100%. Closes #1728. 2014-03-27 19:17:24 -07:00
Thomas Goyne f07a2559b8 Update the grid scrollbar after dialogue count changes 2014-03-27 18:49:16 -07:00
Thomas Goyne 1b0c1902d5 Update ffms2 2014-03-27 07:24:14 -07:00
Thomas Goyne ad8d11d87f Don't animate the progress bar when moving backwards 2014-03-27 07:21:55 -07:00
Thomas Goyne cf6e274c49 Fix incorrect capitalization of frame_main.h
Closes tgoyne/aegisub#3.
2014-03-27 06:50:16 -07:00
Thomas Goyne 290cdefd9d Skip building the wx libraries we don't use 2014-03-26 15:13:21 -07:00
Thomas Goyne 736b1d2fa7 Actually enable optimizations for ICU in release builds 2014-03-26 12:34:14 -07:00
Thomas Goyne 2ba88537a8 Pull some global init logic out of FrameMain's constructor 2014-03-26 11:33:33 -07:00
Thomas Goyne 35301df5f7 Remove the (unimplemented) machinery for automation subtitle formats 2014-03-26 11:17:38 -07:00
Thomas Goyne e477005ecd Eliminate some uses of std::bind 2014-03-26 10:38:38 -07:00
Thomas Goyne e5e3bff7f8 Clean up some stuff in menu.cpp 2014-03-26 10:25:24 -07:00
Thomas Goyne 0931194b4f Remove most inclusions of main.h 2014-03-26 10:12:43 -07:00
Thomas Goyne 84ceed7c3c Update ffms2 2014-03-26 10:03:24 -07:00
Thomas Goyne 14d64daf69 Fix crash on empty progress title on OS X 2014-03-26 09:24:47 -07:00
Thomas Goyne 16804f41c9 Delete in-repo copy of intttypes.h since vs2013 has it 2014-03-26 08:25:24 -07:00
Thomas Goyne c4c0f6f125 Kill VideoContext::Get() 2014-03-26 08:23:43 -07:00
Thomas Goyne aa46c49403 Pull some of the context (de)init out of FrameMain
And actually do deinitialize more of the stuff in the context.
2014-03-25 20:04:48 -07:00
Thomas Goyne 821f54a372 Delay showing the font caching dialog until subtitles are actually rendered 2014-03-25 20:04:48 -07:00
Thomas Goyne 39626db787 Eliminate all uses of FrameMain via the global app object 2014-03-25 17:06:48 -07:00
Thomas Goyne e596de03c7 Fix moving the top line of the file down 2014-03-25 17:06:48 -07:00
Thomas Goyne b5a8217fcd Remove pointless wxSafeYield in FrameMain's constructor
This was needed to make the splash screen appear, and was missed when
the splash screen was killed.
2014-03-25 17:06:48 -07:00
Thomas Goyne 523d858374 Extract SelectionController from BaseGrid 2014-03-25 17:06:47 -07:00
Thomas Goyne eb548306e9 Don't skip the first dialogue line in the kanji timer 2014-03-24 12:40:03 -07:00
Thomas Goyne 5214efd553 Fix issues with RecombineOverlaps 2014-03-24 12:40:03 -07:00
Thomas Goyne e71270f0f0 Refactor the rest of the factories 2014-03-24 12:40:03 -07:00
Thomas Goyne dbe9bcfdad Extract some duplicated code 2014-03-24 12:40:03 -07:00
Thomas Goyne 470f85d365 Convert VideoProviderManager to AudioProviderManager's new design 2014-03-24 09:25:26 -07:00
Thomas Goyne 36a71be19f Remove virtual destructor from FFmpegSourceProvider 2014-03-24 06:55:35 -07:00
Thomas Goyne 938025acb1 Redesign AudioProviderFactory
Register functions which create each type of provider rather than the
provider types themselves so that the concrete types don't need to be
publicly exposed, and use a static list of providers rather than
registering them at runtime.
2014-03-24 06:55:35 -07:00
Thomas Goyne 7dd764db6b Remove the option to disable the PCM audio provider 2014-03-23 16:49:03 -07:00
Thomas Goyne 3d76d583e1 Use stdint types in MatroskaParser 2014-03-23 09:01:25 -07:00
Thomas Goyne b1f132ec6f Use a proper auto-deleting temp file for the HD audio cache 2014-03-23 08:14:35 -07:00
Thomas Goyne a63db6b519 Move git submodules to a consistent location within the .git/modules dir 2014-03-21 19:23:47 -07:00
Thomas Goyne 2eb211f5b6 Fix issues with showing the previous inactive line
The "previous" line for the first line was actually the last line of the
file, and the previous line for the second line was ignored entirely.

Closes #1719.
2014-03-21 16:41:22 -07:00
Thomas Goyne 3e9bb94126 Use boost range algorithms in audio_timing_dialogue.cpp 2014-03-21 16:11:56 -07:00
Thomas Goyne 5d3bc0d0d2 Modernize some code in audio_timing_dialogue.cpp 2014-03-21 16:01:24 -07:00
Thomas Goyne 66877105cb Remove old cruft from the precompiled headers 2014-03-21 15:02:12 -07:00
Thomas Goyne 53188cca47 Expunge remaining references to <fstream> and <iostream> 2014-03-21 14:31:48 -07:00
Thomas Goyne db7c8f49cb Kill default_path.json since it was never used for anything 2014-03-21 14:04:17 -07:00
Thomas Goyne e1bc828e44 Don't wrap the default config json blobs in std::strings 2014-03-21 14:02:49 -07:00
Thomas Goyne d615dcb30a Replace all uses of strstream and stringstream with bufferstream
istringstream makes a copy of its input, which is not very nice for
performance. strstream doesn't do bounds checking, which is not very
nice for safety (and is deprecated).
2014-03-21 13:50:28 -07:00
Thomas Goyne d454872c00 Use read_file_mapping for the thesaurus 2014-03-21 13:23:15 -07:00
Thomas Goyne 0268ffd345 Return a const char * from read_file_mapping::read 2014-03-21 13:23:12 -07:00
Thomas Goyne 23ff6dead1 Use read_file_mapping for YUV4MPEGVideoProvider 2014-03-21 10:57:14 -07:00
Thomas Goyne 18e5144977 Remove unused function in line_iterator 2014-03-21 09:47:05 -07:00
Thomas Goyne 220e6d18da Use read_file_mapping in TextFileReader 2014-03-21 09:28:17 -07:00
Thomas Goyne 87501931f6 Don't reset the progress animation timer when receiving redundant progress updates 2014-03-21 08:39:58 -07:00
Thomas Goyne 3d21f00356 Use read_file_mapping for charset detection 2014-03-21 08:06:41 -07:00
Thomas Goyne cb1f04481a Use read_file_mapping for reading attachments 2014-03-21 07:44:22 -07:00
Thomas Goyne 5750a660c2 Open files with FILE_SHARE_READ on Windows 2014-03-21 07:23:44 -07:00
Thomas Goyne ad193f70a9 Use read_file_mapping for reading automation scripts 2014-03-21 07:22:31 -07:00
Thomas Goyne 95008b7dc1 Remove unused variable 2014-03-20 20:26:18 -07:00
Thomas Goyne 58db99cd24 Simplify PCMAudioProvider a bit and pull it fully into the cpp file 2014-03-20 20:26:17 -07:00
Thomas Goyne df177ae869 Fix crash_writer_minidump.cpp's newlines 2014-03-20 20:26:17 -07:00
Thomas Goyne 0c9f39ca25 Use mmap for reading subtitles from Matroska files
Cuts cold-cache read time for an arbitrary 1 GB file read over a network
off a USB 2.0 hard drive from ~70 seconds to ~45 seconds.
2014-03-20 20:26:17 -07:00
Thomas Goyne 00b4d6908f Use read_file_mapping directly in the HD audio provider 2014-03-20 20:26:17 -07:00
Thomas Goyne 6c14c9bee9 Extract the rest of the mmap logic from the PCM provider. Closes #934. 2014-03-20 20:26:17 -07:00
Thomas Goyne 3222275750 Use boost.interprocess's mmap wrapper in the PCM provider 2014-03-20 20:25:44 -07:00
Thomas Goyne 3fa48281b0 Add an error check for trying to interact with expired subtitles objects 2014-03-20 14:13:11 -07:00
Thomas Goyne 8f96e06d0c Remove pdbs from the windows installers 2014-03-20 10:41:12 -07:00
Thomas Goyne aab025c830 Write minidumps on windows rather than just basic stack traces 2014-03-20 10:41:12 -07:00
Thomas Goyne 4b6946dcec Reinitialize the crash error message after the UI language is selected 2014-03-20 10:41:12 -07:00
Thomas Goyne 61b19a17e8 Extract crashlog writing from main.cpp 2014-03-20 10:41:12 -07:00
Thomas Goyne 39823b5d89 Delete the unfinished crash reporter 2014-03-19 08:22:53 -07:00
Thomas Goyne 21cc91cd16 Update ffmpeg, ffms2, libass, wxWidgets 2014-03-18 14:08:33 -07:00
Thomas Goyne feb3b45ced Fix crash on startup when the config file can't be written 2014-03-18 14:03:36 -07:00
Thomas Goyne e74f1dc80e Use enum classes for the selection dialog modes 2014-03-18 13:46:13 -07:00
Thomas Goyne 3ef8fa9ec0 Make a for loop in uuencode less dumb 2014-03-18 13:41:26 -07:00
Thomas Goyne 59e8ec522e Fix Make times continuous 2014-03-16 16:56:36 -07:00
Thomas Goyne 1bd63ce35c Fix crash after inserting lines via subs.insert 2014-03-15 08:31:09 -07:00
Thomas Goyne 96a2a98e39 Update ffms2 2014-03-14 09:01:48 -07:00
Thomas Goyne 7794680c1e Really fix compilation with boost <= 1.55. Closes #1716. 2014-03-14 07:14:13 -07:00
Thomas Goyne b7b8c3d251 Update fontconfig 2014-03-14 07:00:37 -07:00
Thomas Goyne 21d87ff1ca Remove some invalid finals that VC++ was okay with for some reason 2014-03-12 20:32:57 -07:00
Thomas Goyne ea96c6e2ad Make everything final that can be
Apparently gcc does use final for devirtualization.
2014-03-12 19:07:30 -07:00
Thomas Goyne ab39cfe362 Replace rref + const ref overloads with one version taking by value 2014-03-12 18:02:17 -07:00
Thomas Goyne 26c92453b8 Slather on some std::moves when setting the selection 2014-03-12 15:20:37 -07:00
Thomas Goyne 7c2363ee5b Add rref overloads to SetSelectedSet and SetSelectionAndActive 2014-03-12 15:20:34 -07:00
Thomas Goyne 92ae789b46 Eliminate a bunch of pointless copies of the selection set 2014-03-12 14:54:46 -07:00
Thomas Goyne 31979500c4 Update aegisub.pot 2014-03-12 09:41:44 -07:00
Thomas Goyne 4aa79925c1 Update version in make_pot.sh to 3.2 2014-03-12 09:40:40 -07:00
Thomas Goyne 6e12297313 Update string extraction for desktop file 2014-03-12 09:26:19 -07:00
Thomas Goyne 067450e04a Add wxPLURAL to the patterns extracted by make_pot.sh 2014-03-12 09:23:55 -07:00
Thomas Goyne bd15a54ae3 Use proper plural forms for some UI strings 2014-03-12 09:20:46 -07:00
Thomas Goyne 6374cb52e1 Add some missing inter-project dependencies 2014-03-11 13:02:14 -07:00
Thomas Goyne 409eee4510 Install CSRI and iconv headers rather than mucking about with include paths 2014-03-11 12:27:34 -07:00
Thomas Goyne 1745177b6c Fix compilation with non-bleeding edge boost 2014-03-11 12:15:01 -07:00
Thomas Goyne 843e71331f Add in-repo copy of Lua and use it rather than the system copy
Aegisub needs Lua built as C++ (for stack unwinding on errors). No one
packages it like that, so at the moment we can't actually use systme
packages for Lua.

Fixes a bunch of memory leaks on Automation errors.
2014-03-11 12:15:01 -07:00
Thomas Goyne 33a4a056a4 Move everything up a level since the root dir no longer has stuff 2014-03-11 12:14:57 -07:00
Thomas Goyne bdff48f19b Move submodules to aegisub/vendor 2014-03-11 09:17:21 -07:00
Thomas Goyne c97e2031d5 Move all in-repo deps to aegisub/vendor 2014-03-11 08:59:45 -07:00
Thomas Goyne 1b05310e32 Switch libass URL to github 2014-03-11 08:57:26 -07:00
Thomas Goyne 64f51c917f Kill the awkward automatic subtitle format (de)registration 2014-03-09 15:12:40 -07:00
Thomas Goyne e0d34bfb01 Update deps 2014-03-09 15:12:40 -07:00
Thomas Goyne 9a8e0075cb Silence some warnings from boost.crc 2014-03-09 15:12:40 -07:00
Thomas Goyne 8ee3095506 Do disgusting things to make LuaAssFile work
LuaAssFile relied on the lifetime guarantees of intrusive lists (i.e.
you can pretty much do whatever the fuck you want and it'll work out),
but AssInfo objects are no longer owned by an intrusive list. Do awful
things to lazily copy the header section when needed to provide similar
lifetime guarantees.
2014-03-09 15:12:40 -07:00
Thomas Goyne f6463f0fd4 Fix non-pch compilation 2014-03-09 15:12:40 -07:00
Thomas Goyne 7d08dca912 Make AssFile::Attachments a vector 2014-03-09 15:12:40 -07:00
Thomas Goyne bacbd8c2bf Devirtualize AssEntry::GetEntryData 2014-03-09 15:12:40 -07:00
Thomas Goyne 3d35ba894c Move the intrusive list hooks to the concrete entry types 2014-03-09 15:12:40 -07:00
Thomas Goyne cc7595e3c6 Remove AssEntry::Clone 2014-03-09 15:12:39 -07:00
Thomas Goyne 8acce1a9ee Don't return a const std::string from GetData
It has zero benefit and forces an extra copy.
2014-03-09 15:12:39 -07:00
Thomas Goyne e64fd78c51 Change AssFile::Info to a vector 2014-03-09 15:12:39 -07:00
Thomas Goyne b1639c6162 Make the entry lists be of the appropriate type rather than just AssEntry
Eliminates a bajillion dynamic casts.
2014-03-09 15:12:39 -07:00
Thomas Goyne 1506c1ab10 Remove some cruft from TextFileReader 2014-03-09 08:06:23 -07:00
Thomas Goyne 805481315e Split AssFile into separate lists for each section 2014-03-09 08:06:21 -07:00
Thomas Goyne 222b6ee099 Eliminate some duplicated exception handling code 2014-03-07 08:36:33 -08:00
Thomas Goyne 6bf986a63f Flush the clipboard on exit
Apparently flushing immediately after setting the clipboard sometimes
doesn't work.
2014-03-07 08:33:47 -08:00
Thomas Goyne e37e4b8231 Update to moonscript 0.2.5 2014-03-06 19:19:12 -08:00
Thomas Goyne 7d1cd576d1 Match the parser's section order when constructing files for undo 2014-03-05 17:31:40 -08:00
Thomas Goyne cb8b107bd9 Sort the actor and effect fields. Closes #1715. 2014-03-05 17:31:38 -08:00
Thomas Goyne c9582fe7cf Remove the added/removed items arguments from the selection changed signal
They're only used by one thing (the drag visual tool), so calculating
them is pointless overhead most of the time, and it simplifies the
visual tool code much less than it complicates the grid code.
2014-03-05 17:31:36 -08:00
Thomas Goyne c3fb54153f Store selection and active line in undo info and restore them on undo 2014-03-05 17:31:33 -08:00
Thomas Goyne 9ecb54333a Redesign the undo stack
Store the data in vectors rather than AssFiles since even an intrusive
linked list has comically high memory overhead. Cuts memory usage of a
full undo stack with 15k lines by 65 MB for 32-bit and 130 MB for
64-bit. Also roughly halves how long it takes to copy the file for the
undo stack, and makes undo/redo a bit faster.
2014-03-04 20:21:02 -08:00
Thomas Goyne 2a316e5a55 Make BaseGrid::UpdateMaps far less slow 2014-03-04 20:20:51 -08:00
Thomas Goyne 9a347b0b29 Use splice rather than swaps to pop the undo stack 2014-03-04 13:54:34 -08:00
Thomas Goyne ff21670388 Add Release-MinDep solution configuration 2014-03-04 13:54:34 -08:00
Thomas Goyne c02bdbcf9e Adjust the appears of the vector clip control handles
Make them significantly smaller to cover less of the video and fiddle
with the appearance to hopefully make them still visible enough.
2014-03-03 20:08:04 -08:00
Thomas Goyne 0f731bcf13 Cut the opacity of the vector clip tool's lines a bit 2014-03-03 19:04:20 -08:00
Thomas Goyne 1dbe7dd5f9 Return a rgba string for coloralpha lua controls 2014-03-02 07:24:06 -08:00
Thomas Goyne 5029b5286f Update libass 2014-03-02 07:19:12 -08:00
Thomas Goyne 4f2f8ef4cb Make missing boost libraries a configure error. Closes #1707. 2014-03-02 07:16:25 -08:00
Thomas Goyne 261ceaf969 Pass nullptr for the codepage for ass_read_memory
Passing a codepage makes libass convert to UTF-8 even if it's already
UTF-8.
2014-03-02 07:16:23 -08:00
Thomas Goyne 2c4eaa8d45 Remove no-longer-used header variable in ass parser 2014-03-02 07:16:13 -08:00
Thomas Goyne 3c59903420 Work around an incorrect assertion in older versions of boost. Closes #1702. 2014-02-02 09:14:33 -08:00
Thomas Goyne 0523c27393 Set ApplicationCompany for the Aegisub executable
Despite being completely unmentioned in the documentation this appears
to be required to show up in the default programs UI on Windows 8.1.

Closes #1699.
2014-02-02 08:53:29 -08:00
Thomas Goyne 51218d5d57 Add resource strings for file associations
These weren't merged from 2.1.9 with the rest of the file association
code, which results in the installer trying to reference nonexistent
resources and things breaking.

Updates #1699.
2014-02-02 08:53:20 -08:00
Thomas Goyne 3d22784998 Make lines_to_delete a vector 2014-02-01 20:57:30 -08:00
Thomas Goyne 2d259bb27e Make deleterange not do totally incorrect things 2014-02-01 20:57:30 -08:00
Thomas Goyne df3957393c Set extendRow even when active_line doesn't change
After shift-clicking on the grid the row to extend from doesn't equal
the active line, and clicking on the current active line to deselect all
other lines need to update the extend row.
2014-02-01 20:57:30 -08:00
Илиян Илиев db4a0e4c1e Add Bulgarian translation. Closes #1706. 2014-02-01 17:06:51 -08:00
Thomas Goyne ab44e51edc Never ask to change the script resolution when opening dummy video 2014-02-01 16:57:13 -08:00
Thomas Goyne 4dd76012cd Move YCbCr Matrix header setting from subtitle save to video open 2014-02-01 16:56:32 -08:00
Xabier Aramendi 9b75d4e0ab Update Basque translation 2014-02-01 08:33:33 -08:00
Thomas Goyne f8e8c955b7 Add nl.mo to the Windows installer. Closes #1698. 2014-02-01 08:30:55 -08:00
Thomas Goyne 89e3c45bd6 Use less ugly string formatting when resampling resolution 2014-02-01 08:26:12 -08:00
Thomas Goyne d4fb6f91e6 Resample \be and \blur when resampling resolution 2014-02-01 08:25:52 -08:00
Thomas Goyne 6b9c9091fe Bump libass version 2014-01-19 18:35:17 -08:00
Thomas Goyne e4e7457d7d Build libass without iconv support
We only ever feed UTF-8 to it, and it doesn't check whether the input is
UTF-8 before converting.
2014-01-19 18:35:17 -08:00
Thomas Goyne 1cf0100d5a Bump ffmpeg version 2014-01-19 18:35:17 -08:00
Thomas Goyne 00ff8c4b4a Update to ICU 52.1 2014-01-19 18:35:17 -08:00
Thomas Goyne 934431a29e Make respack less dumb 2014-01-19 18:35:17 -08:00
Thomas Goyne b1ffffaa4c Delete unused button bitmaps 2014-01-19 18:35:17 -08:00
Thomas Goyne a7027a6bfa Hide visual tools for commented lines 2014-01-19 18:35:17 -08:00
Thomas Goyne cc829b2322 Build with all icon sizes enabled on Windows. Closes #1692. 2014-01-19 18:35:17 -08:00
Thomas Goyne aa71e9ab9c Merge pull request #9 from computerfan/patch-2
Update Traditional Chinese translation.
2014-01-14 07:27:21 -08:00
computerfan 6f50c58011 Updated Traditional Chinese translation. 2014-01-14 19:29:49 +08:00
Yuri c035c45e53 Update Hungarian translation. Closes #1693. 2014-01-12 14:59:40 -08:00
Thomas Goyne 2de6a8b600 Fix codecvt errors on OS X
When launching Aegisub from Finder (but not via open), using the UTF-8
version of the locale breaks things for whatever reason, but fortunately
it's unneccesary as paths on OS X are always UTF-8 even if the locale
isn't.

Closes #1685.
2014-01-12 14:59:40 -08:00
Thomas Goyne 71cd017f0f Merge pull request #8 from computerfan/patch-1
Update Simplified Chinese translations
2014-01-12 06:10:52 -08:00
computerfan 5f3b4d1d53 Update and modify Chinese translations. 2014-01-12 17:46:45 +08:00
Thomas Goyne 1c07f92d02 Don't modify the "YCbCr Matrix" header when dummy video is opened
Color matching to dummy video makes zero sense, and setting it to None
results in breakage when someone opens dummy video for an already
typeset script.

Closes #1690.
2014-01-11 15:47:28 -08:00
Thomas Goyne cf79e521e4 Fix potential crash when a thesaurus finishes loading 2014-01-11 07:48:27 -08:00
Thomas Goyne 5cfb76fe9a Reenable shift-enter in the translation assistant
Newlines in the text are converted to \N, so no reason not to allow it
there.

Closes #1691.
2014-01-11 07:47:19 -08:00
Thomas Goyne 15280b4561 Delete some old unused stuff 2014-01-11 07:29:07 -08:00
Thomas Goyne 75df295fc0 Rearrage SinkMessage to eliminate padding 2014-01-11 07:29:04 -08:00
Thomas Goyne af544f05af Fix non-pch compilation 2014-01-11 07:28:38 -08:00
Thomas Goyne c19a1c7641 Delete unused copy-and-shift constructor for TimeRange 2014-01-11 07:28:23 -08:00
Tom Maneiro 6617d52178 Update Spanish translation. Closes #1687. 2014-01-06 08:21:48 -08:00
Thomas Goyne 3747d436cc Convert Factory to variadic templates 2014-01-06 08:19:39 -08:00
Thomas Goyne a8492fc02d Fix directory iteration on Vista
FindExInfoBasic was added in Windows 7, not Vista.
2014-01-05 10:04:25 -08:00
Thomas Goyne f71b380f01 Fix compilation with wx built with --enable-stl
--enable-stl replaces the implicit conversion to char/wchar_t* with one
to std::[w]string. This breaks conversions to boost::filesytem::path and
makes some ternaries ambiguous (which GCC helpfully reports as no
conversion existing rather than an ambiguous conversion).
2014-01-05 10:04:23 -08:00
Thomas Goyne 46315d872f Add a better error message when a hotkey is set for an invalid command 2014-01-03 16:56:18 -08:00
Thomas Goyne 40ddfa8e59 Fix typo in help text 2014-01-03 07:42:12 -08:00
صفا الفليج b57f0a9c6d Update arabic translation 2014-01-03 07:42:10 -08:00
Thomas Goyne afd69725fc Build with -dead_strip on OS X
Bumps 3.5 MB off the binary and doesn't seem to break anything.
2014-01-02 16:35:08 -08:00
Thomas Goyne fc63df571b Use -Werror for compiler flag support checks so that they actually work 2014-01-02 16:35:08 -08:00
Thomas Goyne a433a3f5e4 Silence unused local typedef warnings from gcc+boost 2014-01-02 16:35:08 -08:00
Thomas Goyne dce9dbf211 Silence warnings from other people's code 2014-01-02 16:35:08 -08:00
Thomas Goyne 1cbf20f8ab Work around wxGTK issues with time edits
Modifying the contents of a text control after IM processing happens in
the same cycle of the event loop seems to be seriously broken. Work
around this by disabling IM processing for time edits, as it should
never be relevant for them anyway.

Closes #1679. Closes #1680.
2014-01-02 11:47:15 -08:00
Thomas Goyne 5298634721 Fix infinite loop of error messages when an invalid command is displayed in the hotkey editor 2014-01-01 19:20:50 -08:00
Thomas Goyne 1d69efc35e Kill the Update Dependencies project
Move downloading the ICU data file to the ICU project, since that's the
only thing that was left.
2014-01-01 14:27:26 -08:00
Thomas Goyne 5d38a9c585 Also return full paths from aegisub.dialog.save 2014-01-01 11:46:27 -08:00
Thomas Goyne 418e1cad98 Fix some warnings when compiling with gcc 2014-01-01 10:28:10 -08:00
Thomas Goyne d21c33df31 Grab the .mo files for the installed from the po directory
Grabbing them from the package's src directory just adds another step
that needs to be done manually whenever a translation changes.
2014-01-01 09:39:49 -08:00
Thomas Goyne 56701605ff Port BuildTasks to C#
VS Express Edition doesn't support F#.
2014-01-01 09:20:37 -08:00
Thomas Goyne 75ecb0c2a8 Move fftw3 to a git submodule and update to 3.3.3 2014-01-01 07:36:53 -08:00
Thomas Goyne 11581ccd28 Bump copyright years 2014-01-01 07:22:37 -08:00
Thomas Goyne eb839ded82 Fix typo in readme 2014-01-01 07:13:25 -08:00
Thomas Goyne 58f35cd31c Merge pull request #7 from Leinad4Mind/patch-2
Update pt_PT.po due to 3.1.0 changes
2013-12-30 19:55:13 -08:00
Daniel Mota 5832b55d3f Update pt_PT.po due to 3.1.0 changes 2013-12-30 02:49:30 +00:00
Thomas Goyne 20b4515c24 Fix potential use-after-frees on redo
Don't delete the old copy of the file until after the new version is
committed to avoid a use-after-free when code tries to do things with
the active line in a COMMIT_NEW handler, as just trying to avoid doing
that hasn't really worked out.
2013-12-29 11:44:22 -08:00
Thomas Goyne 21b9fe1405 Replace the standard Lua include path entirely on Windows
The default Lua include path is encoded with the local charset rather
than UTF-8. This causes problems when the working directory includes
non-latin-1 characters which are valid in the local charset, as Aegisub
expects the string to be UTF-8. As the default path isn't very useful on
Windows (on other platforms it could potentially include things like
luarocks-installed modules), just clear it.

Closes #1676.
2013-12-27 14:52:01 -08:00
doplank 0a5a26a74d Update Indonesian translation 2013-12-27 09:56:43 -08:00
Thomas Goyne f0d35a1cf3 Retinafy the video display 2013-12-27 09:56:39 -08:00
Thomas Goyne c8368a500b Dynamically switch to the retina toolbar icons as appropriate 2013-12-27 09:29:53 -08:00
Thomas Goyne f4a6d90db4 Use retina icons for the main toolbar if first opened on a retina display 2013-12-27 09:29:53 -08:00
Thomas Goyne b4ed6a3b1a Add 48x48 and 64x64 icons 2013-12-27 09:29:53 -08:00
Thomas Goyne 55ff9bfd50 Simplify HelpButton a little
Switch to flat_map for trivially less memory usage and just use a global
map rather than a heap-allocated map since it's not
(de)initialization-order sensitive.
2013-12-26 17:43:55 -08:00
Thomas Goyne 6ca0349fc8 Simplify icon handling
Eliminate the pointless runtime command name -> icon map and just make
commands responsible for their icons. Don't bother predecoding and
caching icons since it wastes some RAM (~10 MB) and decoding icons takes
a trivial amount of time.

Fix a few places where icons were being set for the wrong command names.
2013-12-26 17:43:50 -08:00
Thomas Goyne 2ef352d365 Add an option to skip all of the slow configure checks
Cuts the total runtime of the configure script from 19 seconds to 5
seconds for me.
2013-12-24 16:34:19 -08:00
Thomas Goyne 6baa096a64 Add configure check to verify that boost was built with ICU support 2013-12-24 16:34:17 -08:00
Thomas Goyne 1645182b5d Add dependency on libaegisub for the tools directory 2013-12-24 12:41:42 -08:00
Thomas Goyne 5202829fbf Add stuff to .gitignore 2013-12-24 12:33:03 -08:00
Thomas Goyne 3e0ef08031 Merge the translations into the desktop file on install. Closes #1109. 2013-12-24 11:03:09 -08:00
Thomas Goyne 615f3b4880 Explicitly link boost.chrono
Boost.thread sometimes fails to link without this.
2013-12-24 10:16:05 -08:00
Thomas Goyne f95f2dcd25 Refactor spellchecker language listing 2013-12-24 09:42:20 -08:00
Thomas Goyne dbf5af1d49 Load the thesaurus dictionary asynchronously 2013-12-24 09:26:29 -08:00
Thomas Goyne 6957cd76a6 Refactor thesaurus language listing a bit 2013-12-24 09:25:45 -08:00
Thomas Goyne 6a193f280e Use a flat_map for the thesaurus index 2013-12-24 09:25:39 -08:00
Thomas Goyne d9a2669389 Add tool to repack thesaurus dictionaries
The standard MyThes dictionaries include words that we don't support
(nearly half the entries in the English dictionary have speaces in them)
which waste space, and they aren't UTF-8 which slows down loading as we
need to convert them.

Knocks a total of 10 MB off the thesaurus dictionaries.
2013-12-24 09:23:49 -08:00
Thomas Goyne c28a02a34d Don't overwrite alpha when using the color picker screen dropper 2013-12-24 09:23:32 -08:00
Thomas Goyne f534205a91 Make line_iterator less slow 2013-12-24 09:23:28 -08:00
Thomas Goyne 45726bea3c Fix loading automation script names from subtitle files 2013-12-23 11:46:52 -08:00
Thomas Goyne 22e4a8bd58 Ignore errors when canonicalizing paths for automation
It's only being done to make the error reporting prettier, so it failing
shouldn't block the loading of the file.
2013-12-23 11:37:20 -08:00
Thomas Goyne 41ce8d7c31 More crash log writing fixes 2013-12-23 10:19:01 -08:00
Thomas Goyne 40da549a56 Set the path to write crash recovery files to correctly 2013-12-23 10:00:24 -08:00
Thomas Goyne 1601c9c68d Handle uncaught exceptions thrown from more places 2013-12-23 09:07:20 -08:00
Thomas Goyne 3d6cbc8c99 Don't spam the user with many dialogs when pasting invalid styles
Just show a single error dialog regardless of the number of styles that
failed to parse.
2013-12-23 07:54:13 -08:00
Thomas Goyne 3c8160f1e3 Preserve the detached video dialog size when changing tools
The relayout to handle the changed subtoolbar size was fitting the
dialog to the size of the video, which was rather undesirable.
2013-12-21 08:25:01 -08:00
Thomas Goyne 32acb6067b Fix the default angle for styles 2013-12-16 20:23:02 -08:00
Thomas Goyne 01431aca41 Build stuff with /Gw
It's not very useful, but it doesn't appear to have any downsides.
2013-12-15 15:31:51 -08:00
Thomas Goyne d0bcc2e22c Apply the line's shear to the x/y rotation grid 2013-12-15 08:06:50 -08:00
Thomas Goyne 80cb3d04c7 Make the X/Y rotation grid much bigger
This is still a totally arbitrary size. Maybe it should be customizable
or adaptive somehow?
2013-12-13 19:51:44 -08:00
Thomas Goyne 41434ec5a1 Cut down on magic numbers in the drawing code for the x/y rotate grid 2013-12-13 19:47:29 -08:00
Thomas Goyne 70440a8874 Switch to unpatched libass since it's compilable with VC++ 2013 2013-12-12 10:28:27 -08:00
Thomas Goyne be485dd4d4 Use raw string literals for regular expressions where useful 2013-12-12 09:27:52 -08:00
Thomas Goyne cb0a55839d Switch to using the VC++ 12 redist in the portable installer 2013-12-12 06:41:05 -08:00
Thomas Goyne 14fcfce71a Delete pre-3.0 hotkey/option migration information 2013-12-12 06:36:54 -08:00
Thomas Goyne f8828f6658 Add semicolons to things that apparently sometimes need semicolons 2013-12-11 20:26:11 -08:00
Thomas Goyne 30b475410e Fix compilation with boost 1.52. Closes #1670. 2013-12-11 19:36:29 -08:00
Thomas Goyne 0a19a6d8f5 Don't use uniform initialization for structs because VC++ 2013 is buggy 2013-12-11 19:16:16 -08:00
Thomas Goyne 038eb6e58b Use the new much shorter event names 2013-12-11 18:50:12 -08:00
Thomas Goyne 7c68c81ea3 Remove #ifs for older versions of wx 2013-12-11 18:50:12 -08:00
Thomas Goyne e9f2194ca6 Bump required version of wx to 3.0.0 2013-12-11 18:50:12 -08:00
Thomas Goyne 6fad60e58d Use NSDMIs where applicable 2013-12-11 18:50:12 -08:00
Thomas Goyne d6a5d9c458 Use initializer lists in some places 2013-12-11 18:50:11 -08:00
Thomas Goyne a84e463a06 Fix test compilation on windows 2013-12-11 15:03:45 -08:00
Thomas Goyne af96b305bf Switch to VC++ 2013 on Windows
Remove the faux-variadic make_unique since 2013 has real variadic
templates.

Switch to the non-deprecated windows version check functions.

Switch to the develop branch of boost since master doesn't fully support
VS 2013 atm.

Fix some assorted compilation errors.

Hardcode the paths to a bunch of Visual Studio things since it's now
expanding the relevant macros to nothing for whatever reason.
2013-12-11 15:02:35 -08:00
Thomas Goyne 5493c025bc Fix the color picker recent colors box on OS X
SetBitmap triggers a size event, which results in UpdateBitmap being
called again. For some reason, rather than being an infinite loop this
just resulted in the bitmap never being set.
2013-12-11 10:14:55 -08:00
Thomas Goyne 5b7b5811f1 Remove pointless sizer in the colorpicker dialog 2013-12-11 09:38:40 -08:00
Thomas Goyne fc7bf8f1b0 Fix AssAttachment::Clone 2013-12-11 07:55:17 -08:00
Thomas Goyne 5776e058eb Update ffms2 version 2013-12-10 15:27:17 -08:00
Thomas Goyne d4c831e346 Fix crash when FFMS_GetCodecNameI returns NULL 2013-12-10 12:37:03 -08:00
Thomas Goyne 16d55f9d64 Also add the track cursor font name option to the non-OS X config file 2013-12-10 12:08:36 -08:00
Thomas Goyne 533bb4cd1c Fix crash when writing crash logs 2013-12-10 10:38:57 -08:00
Thomas Goyne c83b2ace2a Eliminate CoreText warnings on 10.9 from the audio track cursor 2013-12-10 09:18:27 -08:00
Thomas Goyne 85148002bc Get the UI font from CoreText on OS X 2013-12-10 09:08:30 -08:00
Thomas Goyne 1935e77261 Codesign the app bundle before creating the dmg 2013-12-09 13:55:44 -08:00
Thomas Goyne 29eb7b5e9e Preserve the filename header when reading attachments 2013-12-09 13:45:29 -08:00
Thomas Goyne 23a21b33b1 Use a fixed-size buffer for log messages
libc++'s implementation of ostrstream seems to have incorrect
range-checking and does some out-of-bounds reads and writes whenever a
resize is needed, which results in crashes on 10.7 (but not 10.9 for
unknown reasons).
2013-12-09 12:47:32 -08:00
Thomas Goyne f886237623 Update boost version 2013-12-08 14:38:47 -08:00
Thomas Goyne f56f9ade9b Merge pull request #5 from 11rcombs/osx-build-tweaks
Tweaked OSX build to not hate /usr/local quite as much
2013-12-08 06:53:16 -08:00
11rcombs 8e249b249e Tweaked OSX build to not hate /usr/local quite as much 2013-12-07 23:21:07 -06:00
Nuria Andión 9fe5ef7b86 Update Galician translation. Closes #1167. 2013-12-06 15:27:01 -08:00
sL1pKn07 079b341f98 Fix permissions on installed files. Closes #1669. 2013-12-06 15:25:17 -08:00
Thomas Goyne 4c1a8a21b9 Fix assertion failure when deleting all lines
Lines need to be deselected before they're deleted, but new lines need
to be committed before they can be selected, so reorder things to
remove -> insert new line if needed -> commit -> update selection -> delete.
2013-12-01 20:27:31 -08:00
Thomas Goyne 11d1348c2c Fix check for if the first arg to log is a number 2013-11-27 17:14:19 -08:00
Thomas Goyne 0b1b10fb52 Remove the installed copy of the docs
Keeping them up to date is annoying.
2013-11-24 09:19:33 -08:00
Thomas Goyne 795697fff5 Update to wx 3.0.0 2013-11-23 15:10:23 -08:00
Thomas Goyne 91e4cd292e Fix keyboard layout handling issues in time edits. Closes #1630. 2013-11-23 15:07:53 -08:00
Shimapan 53a90d5f18 Update german translation 2013-11-23 13:04:31 -08:00
Thomas Goyne a69f0d8af8 Regenerate aegisub.pot 2013-11-23 12:50:00 -08:00
Thomas Goyne 64a9026e57 Delete make_pot.bat 2013-11-23 12:47:49 -08:00
Thomas Goyne 14c57aad6e Update versions in make_pot.sh 2013-11-23 12:47:48 -08:00
Thomas Goyne 8aa0842b14 Add option to build with OpenAL on Windows 2013-11-23 10:18:18 -08:00
Thomas Goyne 1f66e776c1 Fix uncaught exception when resampling empty drawings 2013-11-23 09:57:22 -08:00
Thomas Goyne cf76fb343f Fix compilation of thesaurus tests 2013-11-23 09:57:22 -08:00
Thomas Goyne a7f4fb5b87 Run clang-modernize on things 2013-11-23 09:57:22 -08:00
Thomas Goyne 2e051a8fde Fix non-pch compliation 2013-11-23 09:57:21 -08:00
Thomas Goyne 3d573f0e70 Add Split at cursor (at video frame) 2013-11-17 17:21:23 -08:00
Thomas Goyne 0ef9963782 Replace Duplicate and Shift with Split (before|after) current frame
If the current frame is outside the bounds of the selected line, create
a duplicate of it at the current video frame. Otherwise, make the line
end on the previous frame and create a copy of it which starts on the
current frame (for split before).
2013-11-17 15:07:17 -08:00
Nuria Andión e5f1dc48fb Add Galician translation 2013-11-10 07:40:14 -08:00
Thomas Goyne bf13603ae1 Swallow all filesystem errors when automatically opening audio from video 2013-11-10 07:25:31 -08:00
Thomas Goyne 747e34b981 Fix crash when a subtitles file is not found 2013-11-09 15:56:18 -08:00
Thomas Goyne f0ff8c6179 Improve the error message in the fonts collector when a style does not exist
Closes #1661.
2013-11-09 06:25:51 -08:00
Thomas Goyne 466b69ba59 Fix ESC handling in automation dialogs when no button IDs are set
Closes #1660.
2013-11-09 06:17:41 -08:00
Thomas Goyne f0ef14669f Handle override blocks starting at the beginning of the line correctly 2013-11-04 13:54:12 -08:00
Thomas Goyne 10cbff0ee2 Fix crash when adjusting vertical zoom 2013-11-03 06:21:02 -08:00
Thomas Goyne 62a81df4b2 Fix handling of unpaired braces in the edit box buttons 2013-11-03 05:38:13 -08:00
Thomas Goyne 0a34a5fc94 Always search all lines if only one line is selected
I.e. ignore the "In Selection" option for find (but not Replace All) if
the selection is probably not meaningful.
2013-11-02 16:25:31 -07:00
Thomas Goyne a8bee18308 Select the contents of the Find Next box when the dialog is first created
It was only being selected when the dialog already existed and was just
being re-shown.
2013-11-02 07:57:57 -07:00
Thomas Goyne 766b82d71b Fix some edge-cases in the thesarus code
Handle missing parts-of-speach and trailing pipes on lines.
2013-11-02 07:53:04 -07:00
tophf 3948bdc6f4 Fix trimming of second line in Recombine Lines 2013-11-01 08:44:21 -07:00
Thomas Goyne dd325acd81 Add accelerators to more stuff in the find/replace dialog 2013-10-29 09:35:54 -07:00
Thomas Goyne e15ef04b72 Limit shift times history to the last 50 shifts 2013-10-27 13:08:58 -07:00
Thomas Goyne 95ef444c20 More unique_ptr 2013-10-27 13:07:19 -07:00
Thomas Goyne eee4da0642 Change the selection before committing deletions of lines
For whatever reason this was sometimes being done after the commit,
which resulted in a lot of code only working by coincidence when the
grid commit handler happened to be the first one to be called.
2013-10-27 07:03:51 -07:00
Thomas Goyne 2f14c395e7 Preserve line current length in Duplicate and Shift
It's quite rare to actually want a multi-frame line followed by a
single-frame line; in most cases they're either all a single frame (in
which case this behaves the same as it always has), or they're all
multi-line, in which case this should be more convenient.
2013-10-26 08:44:16 -07:00
Thomas Goyne 1f04d02c1b Fix check for script yuv matrix matching video yuv matrix 2013-10-25 16:31:56 -07:00
Thomas Goyne f275ed5628 Update the manual URL now that the 3.1 manual partially exists 2013-10-25 14:10:33 -07:00
Thomas Goyne 5f63a3fcce Remove the help/files command
The local docs it tries to open don't actually exists and if they're
ever added, the help contents command opens them anyway so I'm not sure
what the intended purpose of the command ever was.
2013-10-25 14:09:42 -07:00
Thomas Goyne 3a852f102d Remove entirely superfluous doxygen comments in commands 2013-10-25 14:03:35 -07:00
Thomas Goyne 51d516979b Improve some help text for commands
Consistently use the imperative mood and expand some overly terse help
messages.
2013-10-25 13:54:20 -07:00
Thomas Goyne c5e30709a6 Add a command to cycle between subtitle providers 2013-10-24 14:32:49 -07:00
Thomas Goyne 879ef35bd4 Add missing include 2013-10-24 13:17:53 -07:00
Thomas Goyne e737ea415d Fix compilation with UTF-8 wxString 2013-10-24 13:16:13 -07:00
Thomas Goyne 50f92ef573 Actually uudecode attachments when extracting them
Closes #1653.
2013-10-24 09:00:42 -07:00
Thomas Goyne b1ecefe0f2 Remove pointless data member (CID #739030) 2013-10-23 17:08:27 -07:00
Thomas Goyne 01a38a5e86 Use more make_unique
Shuts up a bunch of Coverity false-positives and might fix a true
positive or two.
2013-10-23 17:08:12 -07:00
Thomas Goyne da5445a09f Fix incorrect scope of variable in mkv_wrap.cpp
Worked by coincidence since the required value was left on the stack.

CID #1111282.
2013-10-23 17:08:12 -07:00
Thomas Goyne 9936bf0eca Initialize drop when loading timecodes (CID #1111295) 2013-10-23 17:08:12 -07:00
Thomas Goyne 09a3174cb8 Initialize more stuff in OpenALPlayer's constructor (CID #1111296) 2013-10-23 17:08:11 -07:00
Thomas Goyne 0e2cc0938f Strongly bind global lua functions used in the standard modules 2013-10-22 08:55:04 -07:00
Thomas Goyne 8367f9960c Eliminate warnings with VS2012 + Win8 SDK 2013-10-22 07:45:23 -07:00
Thomas Goyne d3247d16fb Pass -mmacosx-version-min=10.7 to more stuff 2013-10-21 18:12:42 -07:00
Thomas Goyne 535a17bcf2 Remove pointess OSX_ prefix from functions 2013-10-21 18:11:37 -07:00
Thomas Goyne cbff449f8f Put config files in the right place on OS X 2013-10-21 18:09:34 -07:00
Thomas Goyne eeb574b1f9 Fix dmg creation on 10.9 2013-10-17 10:08:27 -07:00
Thomas Goyne 2640dc42a1 Fix EBU STL export 2013-10-17 09:43:44 -07:00
Thomas Goyne 73e1dc1b60 Honor the color matrix tag from the subtitles file when appropriate
If the script's matrix matches the video's matrix, use that even if
Force BT.601 is on, and if it's TV.601, use that even if Force BT.601 is
off.

This should mostly eliminate the common problems resulting from  mixed
values of the Force BT.601 option.

Closes #1649.
2013-10-17 08:04:03 -07:00
Thomas Goyne 4116f030af Clean up factory_manager a bit 2013-10-16 18:08:43 -07:00
Thomas Goyne 7bd1da7d45 Fix saving screenshots of dummy video 2013-10-16 17:29:03 -07:00
Thomas Goyne e57035c832 Lock aspect ratio in the scale tool when alt is held down 2013-10-16 16:41:21 -07:00
Thomas Goyne b254a6823b Fix double confirmation when exiting with unsaved changes
For some reason the close event is getting sent multiple times and
them getting processed in the event loop for the confirmation dialog,
resulting in two dialogs.
2013-10-16 16:41:04 -07:00
Thomas Goyne 9ea3dbd847 Make ffmpeg explicitly depend on zlib 2013-10-16 14:04:42 -07:00
Thomas Goyne 9dbca06179 Actually copy the current value in IntValidator's copy constructor 2013-10-15 16:02:25 -07:00
Thomas Goyne d4a7a1a9b6 Build osx-bundle-restart-helper via the Makefile rather than as part of bundle creation 2013-10-15 12:17:47 -07:00
Thomas Goyne ebd01c50c9 Rewrite NumValidator
Split int validating and double validating into two separate classes.

Make double parsing, validating and stringifying locale-aware. This is
far more complicated than it needs to be due to that Aegisub's locale
handling is a total mess.

Use DoubleValidator rather than wxFloatingPointValidator, because the
latter doesn't work with Aegisub's locale mess (on OS X it uses the C
locale for some things, and the locale reported by CoreFoundation for
others).

Closes #1568.
2013-10-15 10:59:23 -07:00
Thomas Goyne 3691849bac Fix logging on OS X
Passing nullptr to ostrstream's constructor is a nonstandard extension
that libc++ doesn't support, and as it turns out preallocating a buffer
doesn't actually meaningfully improve performance anyway.
2013-10-13 09:06:46 -07:00
Thomas Goyne 82412e6428 Fix compilation with UTF-8 wxString 2013-10-12 08:41:37 -07:00
Thomas Goyne e5faae462f Remove some pointless configure checks
Speeds up configure by about 10%.
2013-10-11 18:45:22 -07:00
Thomas Goyne b0bbe748bf Move libass fork to Aegisub org on github 2013-10-09 07:13:55 -07:00
Thomas Goyne 267de7ed07 Fix crash when the video height or width is zero
Closes #1555. Closes #1644.
2013-10-08 15:21:26 -07:00
Thomas Goyne 4d8adff9d6 Build wx with wxStandardPaths enabled
It's still needed to get the path to the executable when restarting to
switch UI languages.
2013-10-08 07:33:01 -07:00
Thomas Goyne 6694baf3f0 Allow using , as the separator in time edit controls 2013-10-08 07:19:56 -07:00
Thomas Goyne 7a6fd4bb1e Make saving transient UI state in the file optional
It significantly increases the amount of noise when tracking subtitle
files in source control.

Closes #1535.
2013-10-07 17:57:16 -07:00
Thomas Goyne 1cdd461023 Separate UI state info from functional ASS info headers a bit
Prefix script info entries that are just storing Aegisub UI state with
"Aegisub ", and use a separate AssFile method to get/set them.
2013-10-07 17:57:16 -07:00
Thomas Goyne 62114d45f5 Fix reading MicroDVD files 2013-10-06 07:37:35 -07:00
Thomas Goyne 822c596206 Fix overriding charset for subtitle files
IconvWrapper needs the non-lowercased charset for the pretty -> real
name mapping to work.
2013-10-06 07:11:53 -07:00
Thomas Goyne 6f79d8731f Pass the detected or chosen charset to SubtitleFormat::CanReadFile
The MicroDVD format needs it since it also probes the file contents.
2013-10-06 07:04:40 -07:00
Thomas Goyne 73b0f7c88c Add support for Windows 7's taskbar progress indicator 2013-10-05 20:12:35 -07:00
Thomas Goyne 216b5ef0c7 Increase maximum template depth for parser.o
The latest version of clang has reduced the default.
2013-10-05 20:12:34 -07:00
Thomas Goyne 91c31f646e Opt out of AppNap while progress bars are active 2013-10-05 20:12:34 -07:00
Thomas Goyne 9a21c13cbe Use agi::scoped_holder to close files in mkvwrap 2013-10-05 15:41:22 -07:00
Thomas Goyne bbd4cbef78 Fix shifting contiguous selections downward
Reverse iterators behave differently from regular iterators when
swapping (regular iterators continue to point at the same elements,
while reverse iterators do not), so instead use regular iterators with a
negative step for shifting down.
2013-09-30 17:01:15 -07:00
Thomas Goyne 921d5ed01a Only paint the margin values in the grid if they're non-zero
Showing zero is mildly misleading since it's actually default margin
rather than no margin, and this makes it much easier to spot the rows
where there's actually an interesting value.
2013-09-27 18:02:54 -07:00
Thomas Goyne 04435a13a3 Remove some unused AudioPlayer methods 2013-09-26 20:31:20 -07:00
Thomas Goyne 703b1fc3a7 Extract common stuff for wrapper audio providers to a base class 2013-09-26 20:18:29 -07:00
Thomas Goyne 07ad40dd3f Improve audio loading progress reporting
Even without the animation the reported progress was an average of 1.5
blocks behind the actual progress, and with the animation it was two
blocks behind. Assuming constant-speed audio decoding it should now be
nearly accurate (it still ignores that the last block may be smaller
than the rest).
2013-09-26 19:01:18 -07:00
Thomas Goyne 932747e70a Make progress bars less jerky 2013-09-26 16:13:32 -07:00
Thomas Goyne 382708132c Update indexing progress less often
wxTheApp->QueueEvent is sufficiently slow that updating the progress
could sometimes take longer than the actual indexing.
2013-09-26 16:13:24 -07:00
Thomas Goyne a28aafcdab Fix crash when cancelling an automation script 2013-09-24 07:45:50 -07:00
Thomas Goyne 7651e83314 Fix setting selection/active line from automation scripts
The error handling function is under the results of the called function,
not at the top of the stack, so lua_pop was removing the wrong thing.
2013-09-23 14:15:45 -07:00
Thomas Goyne 8c7ec3a3b6 Don't build tests in release configuration 2013-09-22 19:06:58 -07:00
Thomas Goyne 260b37ba8e Fix line numbers for moonscript files in error messages 2013-09-22 18:44:03 -07:00
Thomas Goyne 646e5deb52 Canonicalize Automation script file names for nicer errors 2013-09-22 17:40:27 -07:00
Thomas Goyne 2be9218560 Double the size of the Automation log window 2013-09-21 16:20:19 -07:00
Thomas Goyne 32990fce49 Don't try to add stack traces to non-string errors 2013-09-21 16:12:19 -07:00
Thomas Goyne ec7d75d1ae Fix an occasional crash when loading Automation scripts
cmd::reg and AssExportFilterChain::Register are not thread-safe, so
guard them with a mutex.
2013-09-21 15:59:28 -07:00
Thomas Goyne f1ed0e4313 Fix display of automation errors on startup
The wxLogger isn't created until it's needed by the main thread, so any
errors logged on a background thread before the logger was first used on
the main thread were simply being discarded. Fix this by forcing the
creation of the logger very early in the startup process.
2013-09-21 12:52:11 -07:00
Thomas Goyne ced3dd7a7e Improve error reporting when an automation script fails to load
Cut down on the amount of redundant information displayed so that the
actual error is visible.
2013-09-21 12:10:37 -07:00
Thomas Goyne 1a8fbf35f1 Improve lua stack trace display 2013-09-21 11:22:58 -07:00
Thomas Goyne 8fade74026 Actually trim whitespace when combining lines
regex_replace does not mutate the string in place.
2013-09-21 11:21:25 -07:00
Thomas Goyne e315ceb236 Print the stack trace on lua errors 2013-09-21 09:44:44 -07:00
Thomas Goyne d81e2f45ac Add an option to ignore whitespace for the character counter 2013-09-20 07:43:33 -07:00
Thomas Goyne ac09590389 Devirtualize OptionValue::GetName 2013-09-20 06:51:04 -07:00
Thomas Goyne bd88cde436 Remove agi::OptionValue::GetDefault*
They aren't actually used for much of anything.
2013-09-20 06:51:04 -07:00
Thomas Goyne cb549e5aa9 Significantly speed up dragging lots of vector clip control points 2013-09-18 16:18:38 -07:00
Thomas Goyne 8d5a54ff5e Fix crash when smoothing freehand curves 2013-09-18 15:59:01 -07:00
Thomas Goyne 6a6c983f19 Add box selection to the move mode of the vector clip tool
Closes #1404.
2013-09-18 15:52:48 -07:00
Thomas Goyne c62ebf7e8b Use std::to_wstring rather than wxString::Format("%d", ...)
std::to_wstring is significantly faster and is a bit shorter.
2013-09-18 08:32:30 -07:00
Thomas Goyne 64ecd29169 Switch to using an intrusive list for the visual tool features
Slightly improves performance and eliminates a bunch of really clunky
passing around and storing of iterators.
2013-09-17 16:23:36 -07:00
Thomas Goyne b4ba31fe45 Bump dependency versions 2013-09-17 09:09:57 -07:00
Thomas Goyne 6cd6ee9845 Use auto more places 2013-09-17 07:51:07 -07:00
Thomas Goyne 0d50820178 Clean up BaseGrid a little 2013-09-17 07:51:06 -07:00
Thomas Goyne e5afaf8a45 Handle subtitle lines pasted into the edit box
If the text being pasted can be parsed as ASS dialogue events, then do
so even if the edit box is focused since it's rather unlikely that
the user actually wants ASS subtitle events in their subs.
2013-09-16 11:02:20 -07:00
Thomas Goyne 5787ca4ae0 Cache widths of strings in SetColumnWidths 2013-09-16 10:43:56 -07:00
Thomas Goyne 079ccc728d Significantly speed up resizing the window with large files open
SetColumnWidths can take a long time to run and the only column that can
change width on resize is the last one, so only update that.
2013-09-16 10:26:41 -07:00
Thomas Goyne bb89378b7f Skip empty lines in the kanji timer 2013-09-16 09:43:57 -07:00
Thomas Goyne 98048c135a Shut up clang analyzer warning 2013-09-16 08:40:27 -07:00
Thomas Goyne e72e183f27 Remove incorrect ! in check for changed calltip position 2013-09-16 07:58:06 -07:00
Thomas Goyne af2028e971 Pass unique_ptrs around by value 2013-09-16 06:43:17 -07:00
Thomas Goyne 40a0d8b2f7 Actually delete the lines in AssFile's destructor 2013-09-15 16:58:04 -07:00
Thomas Goyne bfc7f56e20 Only go back one line rather than two 2013-09-15 15:37:49 -07:00
Thomas Goyne 80c9f67ce8 Rewrite the auto-matcher for the karaoke timing copier
Operate on characters rather than bytes in the dialog so that it
actually works with Kanji.

Rewrite the auto-matcher to handle more cases and add unit tests for it.
2013-09-15 14:52:16 -07:00
Thomas Goyne 3e3bd37a26 Switch to using Bind for DialogKanjiTimer events 2013-09-14 08:26:59 -07:00
Thomas Goyne 1d7334c129 Disable the wxGTK accelerator workaround for wx 2.9.5
Unsurprisingly the munging around with the menu bar implementation
details has resulted in things breaking, but fortunately the problem it
was working around (#1314) appears to have been fixed entirely.

Closes #1628.
2013-09-01 13:34:53 -07:00
Thomas Goyne 2a35763a8a Add Backspace to the table of key names. Closes #1631. 2013-09-01 12:27:42 -07:00
Thomas Goyne 51b21576cc Support duplicate order numbers in Matroska files
Such files are pretty broken, but apparently other stuff allows it.
2013-08-26 17:25:26 -07:00
Thomas Goyne f427c4574d Revert "Don't invert horizontal scroll on the audio display on OS X"
This has been fixed upstream.
2013-08-20 12:20:37 -07:00
Thomas Goyne 0b210673f9 Zoom into the mouse's position in the audio display
Rather than pinning the time at the center of the audio display, pin the
time at the mouse's position since that's the area the user probably
cares about. If the mouse is not over the audio display (such as if the
user is adjusting the zoom via the sliders rather than the mouse wheel),
just use the center as it used to.
2013-08-20 12:11:39 -07:00
Thomas Goyne 1f5b98b11d Bump ffmpeg and boost versions 2013-08-19 12:51:19 -07:00
Thomas Goyne b4c2349b88 Switch git submodules to git:// rather than ssh
Fetching stuff via ssh requires a Github account.
2013-08-19 12:51:19 -07:00
Thomas Goyne 50eda65a14 Switch to the official FFMS2 git repo now that there is one 2013-08-19 12:51:19 -07:00
Thomas Goyne 6c5adde19a Fix wx compilation and silence a warning when compiling wx 2013-08-19 12:51:19 -07:00
Maxime Gauduin 0a2c0ab75e wxStandardPaths is protected as of wxgtk 2.9.5
Closes #1625, #1626, #1627.
2013-08-18 19:14:53 -07:00
Thomas Goyne aa66bcd8b7 Update to latest wxWidgets 2013-08-18 18:47:26 -07:00
Thomas Goyne ae9f05d876 "Allow grid to take focus" -> "Focus grid on click"
The grid can still be focused via the keyboard, so the previous label
was misleading.
2013-08-17 15:10:17 -07:00
Thomas Goyne f714d60a54 Build parser.cpp first
Shaves a few seconds off parallel builds with 4+ cores by avoiding
having everything else finish while it's still building.
2013-08-17 15:08:58 -07:00
Thomas Goyne b68578f1d9 Eliminate a bogus limit of 100 for a bunch of rarely-used options 2013-08-17 15:06:07 -07:00
Thomas Goyne dd6542c143 Use ForwardMouseWheelEvent rather than checking window bounds 2013-08-14 20:09:10 -07:00
tophf c7aba2f54a Also forward page up/down and home/end from the video slider to the subs grid 2013-08-14 20:06:16 -07:00
tophf 51edb4caca Add support for the scroll wheel to the video slider 2013-08-14 20:05:48 -07:00
Thomas Goyne 9eca8c5733 Correct custom labels for buttons with standard IDs 2013-08-10 07:50:07 -07:00
Thomas Goyne 92887b53cf Fix crash when pasting styles in the styles manager 2013-08-08 20:36:12 -07:00
Thomas Goyne 106fb663c7 Eliminate a pointless roundtrip through wxString when copying styles to the clipboard 2013-08-08 20:18:12 -07:00
tophf 74fbe22afe Honor custom labels for buttons with standard IDs 2013-08-01 20:42:01 -07:00
Thomas Goyne 52d67accb4 Fix some issues with resampling drawings
The X scale/offset was being used for both X and Y coordinates.

Only non-negative integers were supported. xy-VSFilter and libass both
now support non-integer coordinates, and negative coordinates have of
course always been valid. Resampled coordinates are now rounded to
eighth-pixels rather than whole pixels.
2013-07-30 20:50:31 -07:00
Thomas Goyne 13d31d17ef Return full paths from aegisub.dialog.open rather than just filenames 2013-07-21 16:38:32 -07:00
Thomas Goyne 5ebc2032d4 Fix test compilation 2013-07-13 09:50:21 -07:00
Thomas Goyne c4dae9e783 Support reading keyframes files from ffmpeg/avconv 2013-07-13 08:40:57 -07:00
Thomas Goyne d0779e7ed7 Make DialogTranslation::UpdateDisplay a bit less slow 2013-07-11 20:18:41 -07:00
Thomas Goyne b9b804ff55 Fix selection preserving in SubsTextEditCtrl::SetTextTo
Calling GetReverseUnicodePosition on the selection positioning after
calling SetText resulted in the conversions between UTF-8 indices and
wxString indices just being a very slow no-op.
2013-07-10 18:03:17 -07:00
Thomas Goyne 8ab163cb5a Make GetReverseUnicodePosition less horribly awful 2013-07-10 17:43:41 -07:00
Thomas Goyne 5ff42d9469 Also handle wxID_CANCEL in DialogManager
wxEVT_CLOSE_WINDOW is only triggered from the platform's close buttons,
not cancel buttons/ESC, so modeless dialogs closed in that way were not
getting deleted.
2013-07-09 08:35:51 -07:00
Thomas Goyne 791c1f88ad Remove pointless wxID_CANCEL binding 2013-07-09 08:35:51 -07:00
Thomas Goyne e0bf0317c9 Fix display of Unicode font names in the fonts collector dialog 2013-07-09 08:35:50 -07:00
Thomas Goyne 2fdbc73721 Fully extract the resolution resampling logic from DialogResample 2013-07-09 08:35:50 -07:00
Thomas Goyne ce23d72399 Kill AssDialogue::GetMarginString
It didn't actually make the calling code any shorter or simpler.
2013-07-09 08:35:50 -07:00
Thomas Goyne bb83193253 Kill AssDialogue::SetMarginString
It's no longer used anywhere.
2013-07-09 08:35:50 -07:00
Thomas Goyne df73591a54 Load autoloaded automation scripts in parallel 2013-07-09 08:35:50 -07:00
Thomas Goyne a75b7f6ca8 Prefetch the list of fonts for the style editor dialog
On my machine (with ~5000 fonts installed), enumerating the installed
fonts was about 75% of the total construction time of the style editor
dialog.
2013-07-09 08:35:50 -07:00
Xabier Aramendi (Azpidatziak) 55379d506a Update Basque translation 2013-07-04 10:45:38 -07:00
Thomas Goyne c542922a88 Use -Wno-c++11-narrowing when available
Needed to build boost.gil with Apple Clang 5.0
2013-07-04 08:29:06 -07:00
Thomas Goyne ecc08f5e77 Fix conversion of video frames to RGB
Video frames aren't actually BGRA; the alpha channel is actually just
garbage since CSRI uses 0 for opaque and other things use 255. To work
around this, add a custom colorspace converter.

Fixes the subtitles preview in the style editor and copying frames to
the clipboard/saving them.

Closes #1621.
2013-07-04 08:25:25 -07:00
Thomas Goyne cb3b72af36 Update to moonscript 0.2.4 2013-07-03 16:11:42 -07:00
Thomas Goyne 6b07002083 Fix libass compilation on Windows 2013-07-03 16:00:49 -07:00
Thomas Goyne dd49539555 Eliminate double dot in temporary file names
Probably didn't cause any problems, but it was slightly ugly.
2013-07-02 20:09:01 -07:00
Thomas Goyne af74371f6d Retry commits of file writes for up to a second to work around AV scanning
Poorly-written antivirus software briefly lock newly written files to
scan them for viruses, which makes the rename from the temp file to
actual file fail. Work around this by retrying the rename up to ten
times.

Closes #1620.
2013-07-02 20:09:01 -07:00
Thomas Goyne b77ca808d0 Bump dependency versions 2013-07-02 20:08:58 -07:00
Thomas Goyne 5bf4f80920 Slightly simplify spectrum image generation in the colorpicker 2013-07-02 20:08:57 -07:00
Thomas Goyne e2022449d9 Use gil in ColourButton rather than wxMemoryDC
Basic drawing with wxMemoryDC is relatively slow.
2013-07-02 20:08:57 -07:00
Thomas Goyne 991569463a Fix the Select None button in the export dialog 2013-07-01 18:52:15 -07:00
Thomas Goyne a1d44cafc1 Redesign VideoFrame
Eliminate the manual memory management and shuffle around where the
copies are made to eliminate the need for non-owning video frames.
2013-07-01 18:35:09 -07:00
Thomas Goyne 8760c9a547 Use unique_ptr in Connection rather than a shared_ptr 2013-06-30 16:06:36 -07:00
Thomas Goyne 098ffd0a92 Clean up signal.h a little 2013-06-30 15:51:51 -07:00
Thomas Goyne 7473fb1af6 Fix issues with loading the video AR from subtitles
Removing the first character from the non-custom case resulted in an
error when the value was empty and resulted in nothing happening when a
valid value was present.
2013-06-30 15:37:07 -07:00
Thomas Goyne 96d7912d0b Only generate fake focus lost events when using the generic implementation 2013-06-26 12:59:10 -07:00
Thomas Goyne a4dd4f6986 Send a fake focus lost event to wxSpinCtrlDouble before reading the value
wxSpinCtrlDouble only updates its value when the spin button is clicked
or it loses focus, and in some cases we want to read the value while it
still has focus.

Closes #1610.
2013-06-26 12:15:31 -07:00
Thomas Goyne 5199923a66 Correctly strip the separator character when loading plain-text files 2013-06-26 11:26:18 -07:00
Thomas Goyne b3ff6a854d Allow malformed timestamps in SRT. Closes #1614. 2013-06-22 07:54:56 -07:00
Thomas Goyne 135133e4c2 Allow garbage after the timestamp in SRT files. Updates #1614. 2013-06-22 07:53:42 -07:00
Thomas Goyne 7c7cfc79e6 Delete SubtitlesGrid since it's now empty 2013-06-18 19:43:16 -07:00
Thomas Goyne ad58ae14bf Extract RecombineLines from SubtitlesGrid 2013-06-18 19:43:16 -07:00
Thomas Goyne bda127144d Extract adjoin lines logic from SubtitlesGrid 2013-06-18 19:43:16 -07:00
Thomas Goyne e0fcfef32e Remove some unused includes in video_box.cpp 2013-06-12 20:01:21 -07:00
Thomas Goyne ca9a2f533e Clean up DialogJumpTo slightly 2013-06-12 20:01:21 -07:00
Thomas Goyne d2a16ed923 Slightly simplify DialogVideoDetails 2013-06-12 20:01:21 -07:00
Thomas Goyne de7b09f7f7 Change some enums into enum classes 2013-06-12 20:01:21 -07:00
Thomas Goyne e99f4c4da1 Simplify clipboard_set slightly 2013-06-12 15:52:30 -07:00
Thomas Goyne b90a77c74b Update the title of the detached video dialog when videos are opened. Closes #1607. 2013-06-12 14:21:56 -07:00
Thomas Goyne 0acec9c874 Fix crash when opening non-cached audio 2013-06-12 14:13:35 -07:00
Thomas Goyne 3306ee126d More unique_ptr 2013-06-11 20:54:07 -07:00
Thomas Goyne b67a0538ff Drop support for non-little-endian platforms
Aegisub doesn't actually currently run on any.
2013-06-11 20:54:07 -07:00
Thomas Goyne 160346df99 Remove a bunch of cruft from the configure script 2013-06-11 19:52:44 -07:00
Thomas Goyne 4472552fab Fix setting the style editor preview background color 2013-06-11 19:46:28 -07:00
Thomas Goyne 39bff418ca Remove handling for no subtitle providers available 2013-06-11 19:46:26 -07:00
Thomas Goyne 9735397a93 Make libass a hard dependency
There's really no point in letting people build Aegisub without any
subtitle renderers.
2013-06-11 19:46:12 -07:00
Thomas Goyne f5ee5ca740 Use ColorValidator in DialogStyleEditor 2013-06-11 19:46:10 -07:00
Thomas Goyne 77dd026555 Extract ColorValidator from Automation's dialog stuff 2013-06-11 16:32:59 -07:00
Thomas Goyne 72d4577d7d Kill scoped_ptr in favor of unique_ptr 2013-06-11 16:06:58 -07:00
Thomas Goyne 9133f17e82 Insignificantly speed up opening UTF-8 files 2013-06-09 07:56:20 -07:00
Thomas Goyne 2a2a623bb4 Fix importing styles from files in non-local charsets (i.e. hopefully all of them) 2013-06-09 07:53:07 -07:00
Thomas Goyne ef2a39fc7b Eliminate pointless UTF-8 -> utf-8 conversion 2013-06-09 07:39:00 -07:00
Thomas Goyne 51d083fe70 Add "edit/line/duplicate/shift_back" to the default grid context menu 2013-06-08 19:22:10 -07:00
Thomas Goyne 7658f6e329 Add default hotkey for "edit/line/duplicate/shift_back" 2013-06-08 19:21:51 -07:00
Thomas Goyne cff5afbb08 Don't overwrite existing hotkeys in migrations 2013-06-08 19:21:51 -07:00
Thomas Goyne 9809b66f61 Redesign hotkey migration logic to not rely on monotonically increasing revisions 2013-06-08 19:21:51 -07:00
Thomas Goyne e693fa97ba Clean up the hotkey code a bit 2013-06-08 19:21:51 -07:00
Thomas Goyne 6c08f53d1b Delete pre-3.0.0 hotkey migrations 2013-06-08 19:21:50 -07:00
Thomas Goyne f21a72992b Use unique_ptr for most non-wx owning pointers 2013-06-08 19:21:49 -07:00
Thomas Goyne d81dfc1e73 Use a unique_ptr in agi::io::Save 2013-06-08 19:21:31 -07:00
Thomas Goyne f051e59a61 Return a unique_ptr from agi::io::Open 2013-06-08 19:21:31 -07:00
Thomas Goyne cf7d548d17 Cosmetics in line_iterator 2013-06-08 19:21:31 -07:00
Thomas Goyne e668cc45e0 Delete stuff for VS 2008 2013-06-08 19:21:31 -07:00
Thomas Goyne 995a8642f0 Clean up vfr.cpp a little 2013-06-08 19:21:31 -07:00
Thomas Goyne 2781df7ce9 Use std::begin/std::end rather than countof 2013-06-08 19:21:30 -07:00
Thomas Goyne 151b1cb6ac Kill AegiFloatToString and AegiIntegerToString 2013-06-08 19:21:30 -07:00
Thomas Goyne ed7151a7a5 Remove some unneeded forward declarations 2013-06-08 19:21:30 -07:00
Thomas Goyne 5c4279a654 Add command "edit/line/duplicate/shift_back" 2013-06-08 19:21:28 -07:00
Thomas Goyne 48c44440f7 Set the horizontal zoom option consistently
Always store the actual zoom level, rather than sometimes the zoom level
and sometimes the slider position.

Updates #1597.
2013-06-05 19:03:47 -07:00
Thomas Goyne 8f65d43b6c Change the syntax for setting automation button IDs to be more backwards compatible 2013-05-27 13:10:05 -07:00
Thomas Goyne f90a5b21e9 Remove the hack for dynamically linking the runtime for FFmpeg as it's been fixed upstream 2013-05-27 10:50:28 -07:00
Thomas Goyne eacaf9bd67 Update to latest FFmpeg master 2013-05-27 10:36:38 -07:00
Thomas Goyne eac4a9f96d Don't set the focus on the default button in automation dialogs 2013-05-27 07:42:47 -07:00
Thomas Goyne ad695cf0a5 Escape the contents of object keys when writing JSON 2013-05-27 07:42:42 -07:00
Thomas Goyne 7deca9f43c Update to latest wx trunk 2013-05-26 15:53:44 -07:00
Thomas Goyne 5462d35708 Actually read the values from controls in automation dialogs 2013-05-26 08:37:15 -07:00
Thomas Goyne 6308104031 Fix dialog control table loading when there are buttons 2013-05-26 08:37:15 -07:00
Thomas Goyne bfa5a8df1e Use lua_for_each more places 2013-05-25 16:31:48 -07:00
Thomas Goyne e84b24e9f3 Implement TransferToWindow in DoubleValidator. Closes #1606. 2013-05-25 15:46:57 -07:00
Thomas Goyne 061e2a1ada non-pch compilation 2013-05-25 15:20:31 -07:00
Thomas Goyne 4c71fcc51b Don't invert horizontal scroll on the audio display on OS X
For some reason horizontal scroll comes pre-flipped.

Closes #1612.
2013-05-25 15:20:31 -07:00
Thomas Goyne 8e491a9ecc Add support for using standard button IDs from automation
Some example uses:

	-- ~special snowflake~ OK/Cancel
	aegisub.dialog.display(config, {ok='Accept', cancel='Cancel'})

	-- On OS X the 'Help' button will be just a left-aligned ?
	aegisub.dialog.display(config, {ok='OK', cancel='Cancel', help='Help'})

	-- Each button in its own subtable to preserve passed order
	-- Unnecessary when using only IDed buttons since the passed order will
	-- be ignored in favor of the platform-standard order
	aegisub.dialog.display(config,
	  {{ok='Accept'}, {cancel='Cancel'}, {help='Help'}, 'Another Button'})

In some cases the passed labels will be ignored in favor of the
platform-standard labels.

Available IDs:
	ok
	yes
	save
	apply
	close
	no
	cancel
	help
	context_help

Note that many combinations of button IDs do not make sense and may have
strange effects.

Buttons with an ID of 'cancel' return false, as if ESC was pressed. A
button with an ID of 'close' results in that button being triggered on
ESC rather than cancel.

Buttons with an ID of 'ok', 'yes' and 'save' are set as the default
affirmative button for the dialog.

Closes #1609.
2013-05-25 15:20:03 -07:00
Thomas De Rocker 657726b9ec Complete Dutch (nl) translation. Closes #1604. 2013-05-09 20:00:26 -07:00
Thomas Goyne f76b9ff356 Fix check for errors when compiling MoonScript 2013-05-09 06:27:35 -07:00
Thomas Goyne 536cff7cb6 Bump ICU version 2013-05-06 17:36:50 -07:00
Thomas Goyne ef459770a0 Add an option to ignore uppercase words when spellchecking. Closes #1460. 2013-05-06 17:36:25 -07:00
Thomas Goyne 3154090d2f Don't reuse commit IDs for new commits after undo. Closes #1598. 2013-05-05 21:01:02 -07:00
Thomas Goyne 95d773ebc9 Don't use the custom renders in the hotkeys editor on OS X
The standard controls aren't particularly usable, but the OS X
implementation of wxDVC doesn't actually support custom renderers and
not very usable is mildly better than entirely nonfunctional.

Updates #1589.
2013-05-05 20:55:10 -07:00
Thomas Goyne 2db687cc31 Remove use of copy_file from boost.filesystem
copy_file's signature varies depending on whether or not boost was
compiled as C++11, which makes Linux packaging awkward.

Closes #1580. Closes #1581.
2013-05-05 08:17:55 -07:00
Thomas Goyne 6e62f9e461 Pass the filename to moonscript.loadstring for error reporting 2013-05-04 18:31:33 -07:00
Thomas Goyne 5dd982b742 Fix util.deep_copy 2013-05-04 17:05:42 -07:00
Thomas Goyne d9ad794dcb Add FFTW3 to .gitignore 2013-05-04 06:47:13 -07:00
Thomas Goyne c23c3682aa Also set the moonpath for the automation tests 2013-05-04 06:26:14 -07:00
Thomas Goyne 3785cbb3a6 Remove lingering stuff from the fftw submodule 2013-05-04 06:14:16 -07:00
Thomas Goyne cefc045c05 Enable wxRegKey since a bunch of random stuff depends on it 2013-05-03 22:32:03 -07:00
Thomas Goyne 24735a2fbb Add lua CFLAGS for lpeg.o 2013-05-03 20:14:10 -07:00
Thomas Goyne d9cb5ae574 Update automation files to install 2013-05-03 20:00:55 -07:00
Thomas Goyne 6ec305f76b Fix non-pch compilation 2013-05-03 17:57:32 -07:00
Thomas Goyne 39f2a09aee Update installer files 2013-05-03 17:57:32 -07:00
Thomas Goyne 19854e207a Add native support for MoonScript 2013-05-03 17:57:32 -07:00
Thomas Goyne 99d74e18b3 Add LPeg 0.10
0.11 has a bug that makes it crash on MoonScript, and 0.12 is much slower.

LPeg isn't packaged as a C library and consists of a whopping two files
so just compile it as part of Aegisub.
2013-05-03 06:41:07 -07:00
Thomas Goyne 34be32d570 Don't build the automation tests helper so by default 2013-05-02 18:07:05 -07:00
Thomas Goyne bdebf392e2 Fix ipairs on tables 2013-05-02 17:57:06 -07:00
Thomas Goyne 4662f34774 Use std::this_thread on Windows to avoid having to build boost.chrono 2013-05-02 09:25:18 -07:00
Thomas Goyne 0638af6825 Use agi::line_iterator for loading keyframe files
line_iterator supports Windows newlines on non-Windows platforms, unlike
istream_iterator.
2013-05-02 09:20:54 -07:00
Thomas Goyne 1b96bf748f Fix calls to other util functions from within util functions 2013-05-02 07:44:40 -07:00
Thomas Goyne 9bcc6efcc8 Export the string functions from utils-auto4.lua 2013-05-02 07:30:25 -07:00
Thomas Goyne ffb8c29ca2 Set the maximum end time seen correctly in select-overlaps 2013-05-01 21:21:07 -07:00
Thomas Goyne b2f5a993d9 Actually define __ipairs on LuaAssFile 2013-05-01 21:21:07 -07:00
Thomas Goyne 995e0d85e9 Make pairs and ipairs call the appropriate metamethods when present
As is done in Lua 5.2. This makes it possible to use ipairs on the
subtitles object.
2013-05-01 21:21:07 -07:00
Thomas Goyne a6f7375427 Add lua cflags for auto4_regex.cpp 2013-04-29 20:32:27 -07:00
Thomas Goyne e033078488 Make automation depend on libaegisub 2013-04-29 20:28:24 -07:00
Thomas Goyne 05baa4b0e4 Fix compilation with gcc 4.7 2013-04-29 20:24:33 -07:00
Thomas Goyne 380e5fd99f Use boost::thread in LibassSubtitlesProvider
libstdc++ 4.7's std::thread is missing sleep_for.
2013-04-29 20:18:29 -07:00
Thomas Goyne 3e299958bd Fix compilation with gcc 2013-04-29 18:21:55 -07:00
Thomas De Rocker 722d8558bb Add partial Dutch translation. Updates #1599. 2013-04-29 18:19:20 -07:00
Thomas Goyne 0216d9d5bd Make utils.lua a proper module with a compat wrapper 2013-04-28 20:52:36 -07:00
Thomas Goyne a40b1d0028 Make unicode.lua a proper module and add basic tests
Also drop support for >4 byte sequences as they were eliminated in RFC 3629.
2013-04-28 20:52:36 -07:00
Thomas Goyne 37e74b8274 Add a basic test harness for running Automation tests 2013-04-28 20:51:45 -07:00
Thomas Goyne 7232de2cdd Move Aegisub modules to aegisub.(module) and add wrapper shims 2013-04-28 20:02:54 -07:00
Thomas Goyne bbd8bb0eab Fix compilation on platforms where int64_t == long 2013-04-24 20:04:35 -07:00
Thomas Goyne 13521a0c3e Default to only showing the maximum in the waveform view 2013-04-24 19:40:15 -07:00
Thomas Goyne 7820b2a6dc Restore the position of the audio zoom slider from the options correctly. Closes #1597. 2013-04-21 19:04:15 -07:00
Thomas Goyne b2953e82cb Add the beginnings of a README file 2013-04-21 18:24:10 -07:00
Thomas Goyne 90b35efa75 Remove most of the fetched dependencies since they're now submodules 2013-04-21 18:24:07 -07:00
Thomas Goyne 9667a7b21f Build Lua as C
Linux distros nearly always package Lua built as C, so build it as C on
Windows as well to cut down on needless differences.
2013-04-21 18:02:04 -07:00
Thomas Goyne 8cd1a0a9d4 Remove in-repo copy of lua 5.1 and use the submodule instead 2013-04-21 18:02:03 -07:00
Thomas Goyne 5a4b70b8b9 Don't create a global 'clipboard' object in the clipboard module 2013-04-21 18:02:03 -07:00
Thomas Goyne a2055b5db9 Add submodules for most of the deps 2013-04-21 18:02:00 -07:00
Thomas Goyne 7d5a8a1b4c Fix x64 compilation on Windows 2013-04-20 07:58:58 -07:00
Thomas Goyne 9c98d1bc13 Fix the output path for dictionaries in the portable install 2013-04-20 06:53:20 -07:00
Thomas Goyne f68cc1e584 Fix crash when opening kanji timer dialog. Closes #1585. 2013-04-16 20:21:06 -07:00
Thomas Goyne d6fd2f016b Shuffle some stuff around in MicroDVDSubtitleFormat::ReadFile 2013-04-16 20:05:45 -07:00
Thomas Goyne b743bb39b0 Report a more useful line number for bad lines in the TPP. Closes #1596. 2013-04-16 20:05:45 -07:00
Thomas Goyne 3c7527c2f7 Do a better job of picking a new active line after deleting lines
Set it to the first line not part of the selection after the selection
begins if there are any, and the last line remaining in the file if not
(i.e. the last line before the selection).

Closes #1595.
2013-04-16 20:05:44 -07:00
Thomas Goyne 71b14ecc74 Select the right things in the select overlaps macro. Closes #1594. 2013-04-16 20:05:44 -07:00
Thomas Goyne 1096ef8c6e Disable a pile of wx things we don't use 2013-04-16 20:05:44 -07:00
Thomas Goyne 82476832af Build wx without wxRegex 2013-04-16 20:05:44 -07:00
Thomas Goyne 4e7d6df6b2 Remove the use of wxRegex for case-insensitive filtering 2013-04-16 20:05:44 -07:00
Thomas Goyne 17170fc5fe Remove the charset detection from TextFileReader since it's never used 2013-04-16 20:05:44 -07:00
Thomas Goyne 8bdb7d32ad Drop support for non-UTF-8 lua scripts 2013-04-16 20:05:44 -07:00
Thomas Goyne 68662211a1 Make Lua 5.1 a required dependency 2013-04-16 20:05:43 -07:00
Thomas Goyne c556a47509 Replace wxRegex bindings for lua with boost::regex bindings
API is mostly unchanged other than the addition of a lot more flags.
Should be less buggy since it has an actual test suite, and generally
has a more powerful regex syntax with better support for Unicode.

The bindings are written in MoonScript. For now the compiled form is
store in the repo for convenince.
2013-04-16 20:05:43 -07:00
Thomas Goyne 44188267d6 Extract some common helper methods to auto4_lua_utils.h 2013-04-09 20:14:53 -07:00
Thomas Goyne e5c25fa066 Fix crash when clearing the contents of one of the Margin boxes 2013-04-07 11:36:10 -07:00
Thomas Goyne d3cfa20db9 Fix unicode issues in the karaoke split/join bar
Use ICU to split the text into characters rather than assuming that one
wchar_t == one character in some places, and one char == one character
in other places.
2013-04-07 11:36:06 -07:00
Thomas Goyne e33dc4ae3a Add the en_US dictionary to the portable installer 2013-04-07 08:43:57 -07:00
Thomas Goyne a15d1cb43d Fix the paths in the PortableInstaller filters 2013-04-07 08:43:57 -07:00
Thomas Goyne 5ff00c6996 Remove MPC-HC VSFilter from the portable installer files 2013-04-07 08:43:57 -07:00
Thomas Goyne c640f279ba Create the output directory for the portable installer if it doesn't exist 2013-04-07 08:43:56 -07:00
Thomas Goyne c49f4c68db Add 64-bit installer script 2013-04-07 08:43:56 -07:00
Thomas Goyne e89fb6eeb8 Improve the edit box tooltips 2013-04-07 08:43:56 -07:00
Thomas Goyne 51e17b4c38 Remove unused private member 2013-03-30 07:52:49 -07:00
Thomas Goyne cb9c48d6af Strip Collisions lines on read
Nothing supports them and malformed values crash VSFilter.

Closes #1583.
2013-03-30 07:18:34 -07:00
Thomas Goyne 1598e81773 Remove the 'Collisions' setting from the properties dialog
No renderers actually support it so there's really no reason for it to
be settable.
2013-03-30 07:08:57 -07:00
Thomas Goyne 4603f39962 Fix the option name for the subtitle MRU list. Closes #1592. 2013-03-29 21:24:47 -07:00
Thomas Goyne c1b99aba0e Select the contents of the find box when opening the search/replace dialog 2013-03-29 17:21:07 -07:00
Thomas Goyne de68a1995d Fix crashes from unchecked uses of lua_tostring. Closes #1588. 2013-03-18 07:01:54 -07:00
صفا الفليج d0a86904b9 Update Arabic translation. Updates #1532. 2013-03-03 20:04:49 -08:00
Thomas Goyne 890379bb86 Fix compilation error in auto4_lua_scriptreader.cpp 2013-02-16 19:53:54 -08:00
Thomas Goyne a9f83663e8 Revert "Return the ifstream from agi::io::Open by move"
This reverts commit 1f5484fedb.

Move constructors for fstreams are not implemented yet in libstdc++.

Closes #1578.
2013-02-16 19:47:31 -08:00
Thomas Goyne 84410f770b Fix loading subtitles from Matroska files without track names 2013-02-13 20:22:02 -08:00
Lasse Liehu 76a088e7c1 Update Finnish translation. Updates #1522. 2013-02-13 08:06:43 -08:00
Thomas Goyne c83fff12a9 Match HTML colors in a way that actually works in extract_color
Lua patterns don't have optional capture groups, so instead make the
contents of the capture groups optional.

Closes #1575.
2013-02-12 17:09:04 -08:00
Thomas Goyne 959be0a64a Handle partial characters at the end of the read buffer when loading Lua scripts. Closes #1576. 2013-02-12 15:52:00 -08:00
Thomas Goyne 1f5484fedb Return the ifstream from agi::io::Open by move 2013-02-12 15:51:59 -08:00
Thomas Goyne d99647ba28 Fix crash when closing video while a frame request is pending 2013-02-08 21:05:57 -08:00
Thomas Goyne e7306ae642 Release mouse capture from the visual tools when the zoom is changed 2013-02-08 20:37:43 -08:00
Thomas Goyne e9a949954f Split ass drawings on spaces, not | 2013-02-08 20:29:39 -08:00
Thomas Goyne 1a8c88faea Actually decode strings in inline_string_decode 2013-02-08 20:27:38 -08:00
Thomas Goyne c9ffffda54 Fix compilation with clang 2013-02-08 09:53:34 -08:00
Thomas Goyne 4a4583a77d Fix path generation for saving screenshots 2013-02-08 09:53:34 -08:00
Thomas Goyne d34f88080c Fix directory iteration on Windows XP 2013-02-08 09:03:00 -08:00
Thomas Goyne d3606eac99 Don't complain about things in the autoload folder which aren't automation scripts 2013-02-07 16:02:44 -08:00
Thomas Goyne a872fc50b8 Store ass attachments in the encoded form in memory
This marginally increases memory use, but vastly speeds up pretty much
everything when a file has attachments (other than extracting the
attachments, but that's generally IO-bound anyway).
2013-02-07 16:02:44 -08:00
Thomas Goyne 73217fd0e9 Move uuencoding logic to libaegisub and add tests 2013-02-07 16:02:44 -08:00
Thomas Goyne be8790942a Change AssParameterClass to an enum class 2013-02-07 08:55:01 -08:00
Thomas Goyne e115206998 Change VariableDataType to an enum class 2013-02-07 08:49:11 -08:00
Thomas Goyne 14afce006e Remove AssStyleStorage's dependencies on other Aegisub classes 2013-02-07 08:47:43 -08:00
Thomas Goyne 2bad9029cb Set ?data in a way that works with spaces in the path on Windows 2013-02-06 19:15:21 -08:00
Thomas Goyne 9a69017752 Don't drop the last two chaacters in inline_string_decode 2013-02-06 17:13:14 -08:00
Thomas Goyne e0a3f1d399 Explicitly link boost.thread for static boost.locale 2013-02-06 14:04:59 -08:00
Thomas Goyne 79cd9448f8 Update to ICU 50.1.2 2013-02-06 13:38:35 -08:00
Thomas Goyne bec9483429 Cut all the stuff from ICU's data file that we don't need 2013-02-06 13:38:35 -08:00
Thomas Goyne 48921c35e0 Use ICU for checking if characters are whitespace 2013-02-06 13:38:35 -08:00
Thomas Goyne 9f2fdb2a86 Count characters rather than bytes in the character counter 2013-02-06 13:38:35 -08:00
Thomas Goyne 777649a551 Update the character count asynchronously 2013-02-06 13:38:35 -08:00
Thomas Goyne 40a7a452a2 Delay loading command line arguments until after Aegisub is fully initialized 2013-02-06 13:38:35 -08:00
Thomas Goyne f0054f61bc Fix crash on exit from the dispatch thread pool 2013-02-06 13:38:35 -08:00
Thomas Goyne 8118d790a4 Don't display an error message if user cancels the charset selection dialog 2013-02-06 13:38:35 -08:00
Thomas Goyne 3d48f18542 Display the full list of supported character sets if detection fails catastrophically 2013-02-06 13:38:34 -08:00
Thomas Goyne 1f831be170 Ask the user if they want to close the current file before prompting for a new file to open rather than after 2013-02-06 13:38:34 -08:00
Thomas Goyne d7531a723a Add missing include in dialogue_parser.h 2013-02-06 13:38:34 -08:00
Thomas Goyne d92ef13d44 Add ICU to configure 2013-02-06 13:38:34 -08:00
Thomas Goyne 6905fb3efd Bump required version of boost to 1.50 2013-02-06 13:38:34 -08:00
Thomas Goyne 6cb9665202 Support extensions with multiple dots in agi::fs::HasExtension 2013-02-06 13:38:34 -08:00
Thomas Goyne b885c2c19d Disable the signed/unsigned comparison warning for the tests 2013-02-06 13:38:34 -08:00
Thomas Goyne 523fcd72b0 Add agi::fs tests 2013-02-06 13:38:34 -08:00
Thomas Goyne 761bc80d8b Switch to a less terrible set of m4 macros for boost 2013-02-06 13:38:34 -08:00
Thomas Goyne 386f60daa7 Remove an unused private member from VideoDisplay 2013-02-06 13:38:34 -08:00
Thomas Goyne 841ec898d3 Add ICU to the configure script 2013-02-06 13:38:33 -08:00
Thomas Goyne fd6f4a38e5 Remove unused private member in AudioMarkerInteractionObject 2013-02-06 13:38:33 -08:00
Thomas Goyne 10a88dfb52 Use boost.locale for spellchecker word splitting
This is currently only correct if the UI language is the same as the
subtitles language as the global locale is used, but it should still
never be worse than the small hardcoded table of word splitters.

Closes #1206.
2013-02-06 13:38:33 -08:00
Thomas Goyne 5efba3fda1 Improve handling of whitespace in the fonts collector
When whitespace characters are missing in the font, print the names of
the characters rather than seemingly printing nothing.

Closes #1553.
2013-02-06 13:38:33 -08:00
Thomas Goyne 2a5134a5ca Add an option to not skip blank lines when importing plain text files 2013-02-06 13:38:33 -08:00
Thomas Goyne d55949d9c1 Only perform charset detection once when opening subtitles
Relying on TextFileReader to do the charset detection results in the
user being prompted to pick a charset twice when it can't be
auto-detected, since the result from trying to open the subtitles as
timecodes was not being reused.

Closes #1512.
2013-02-06 13:38:33 -08:00
Thomas Goyne 47c36c9033 Use ICU/boost.locale for case-insensitive searching
Do proper unicode case-folding for case-insensitive searching rather
than converting only ascii characters to lowercase. The Turkish 'i' is
still not handled correctly (since it's the only place where
case-folding is locale-dependent), but that's probably not worth caring
about as long as we don't have a Turkish UI translation.

This affects both the find/replace dialog and the select lines dialog.

Closes #1342.
2013-02-06 13:38:33 -08:00
Thomas Goyne 1cc52611de Rearrange the tests files 2013-02-06 13:22:34 -08:00
Thomas Goyne 09aa873ed7 Hide the StatusTimeout awfulness in a util function 2013-02-06 13:22:34 -08:00
Thomas Goyne a9467836f9 Move autosave logic to SubsController 2013-02-06 13:22:34 -08:00
Thomas Goyne 74028b9bcd Sort the files in the project 2013-02-06 13:22:33 -08:00
Thomas Goyne 1d5e270283 Remove duplicate copy of hotkey.h in the project file 2013-02-06 13:22:33 -08:00
Thomas Goyne 396ff897e5 Kill StandardPaths
It's now just a pointless wrapper around agi::Path.
2013-02-06 13:22:33 -08:00
Thomas Goyne af37047736 Build the tests on Windows 2013-02-06 13:22:33 -08:00
Thomas Goyne 937f8497a5 Build gtest on Windows 2013-02-06 13:22:33 -08:00
Thomas Goyne 053bb9b76a Add googletest to the dependency fetcher 2013-02-06 13:22:33 -08:00
Thomas Goyne 9f7e865196 Set the default string encoding to UTF-8 2013-02-06 13:22:33 -08:00
Thomas Goyne 86aca22502 Build boost.locale on Windows 2013-02-06 13:22:33 -08:00
Thomas Goyne 8846d77845 Use ICU regular expressions for user-entered regexps 2013-02-06 13:22:33 -08:00
Thomas Goyne 07adb5c84e Build boost.regex with ICU support 2013-02-06 13:22:32 -08:00
Thomas Goyne 91e43d3c17 Build ICU on Windows 2013-02-06 13:22:32 -08:00
Thomas Goyne 855902edb8 Add ICU to the libraries downloaded by the dependencies fetcher 2013-02-06 13:22:32 -08:00
Thomas Goyne be930e68ef Use std::atomic rather than a mutex in the progress dialog 2013-02-06 13:22:32 -08:00
Thomas Goyne bc5417de4a Give all of the Aegisub-created threads names 2013-02-06 13:22:32 -08:00
Thomas Goyne a0d3dbc550 Extract Loading/Saving/Undo stuff from AssFile
Add SubsController, which deals with things like what subtitle file is
currently open, rather than the contents of the current subtitle file.
Move the rest of the relevant logic from FrameMain there in addition to
all of the stuff from AssFile.
2013-02-06 13:22:32 -08:00
Thomas Goyne 9a146d1fc0 Remove AssFile::loaded since it isn't actually used for anything 2013-02-06 13:22:17 -08:00
Thomas Goyne 5092ab20c9 Do logging on a background thread
Makes logging actually thread-safe and slightly improves performance.
2013-02-06 13:22:17 -08:00
Thomas Goyne 2e99223977 Factor out some duplicated code in the color picker slider generation 2013-02-06 13:22:16 -08:00
Thomas Goyne 2113ed9580 Use boost.gil for overlaying images from libass 2013-02-06 13:22:16 -08:00
Thomas Goyne 6bd6ed5e5b Remove support for saving to memory with CSRI since there aren't actually any non-VSFilter renderers 2013-02-06 13:22:16 -08:00
Thomas Goyne 2d646b447d Don't add a hardcoded path that's unlikely to actually exist to the include path on OS X 2013-02-06 13:22:16 -08:00
Thomas Goyne a942687050 Use a circular buffer to store only the last 250 log messages 2013-02-06 13:22:16 -08:00
Thomas Goyne c6005be4a1 Write log files incrementally so that they actually exist for crashes 2013-02-06 13:22:16 -08:00
Thomas Goyne 101721863a Make log messages a little saner 2013-02-06 13:22:16 -08:00
Thomas Goyne 69e1744fc7 Make agi::util::time_log less insane 2013-02-06 13:22:16 -08:00
Thomas Goyne ca9be4caef Extract some duplicated wxFileSelector code to a helper function 2013-02-06 13:22:16 -08:00
Thomas Goyne bc7229782c Use an enum for the predefined aspect ratio types 2013-02-06 13:22:15 -08:00
Thomas Goyne 9537e14c3c Use boost.rational for AR normalization 2013-02-06 13:22:15 -08:00
Thomas Goyne 1e1a09e67a Use AssTime's formatting for DialogVideoDetails 2013-02-06 13:22:15 -08:00
Thomas Goyne 1e0f08c0ed Mostly purge wxWidgets from non-UI stuff
Use boost::filesystem::path for all paths, and std::string for all other
strings, converting to/from wxString as close to the actual uses of wx
as possible.

Where possible, replace the uses of non-UI wxWidgets functionality with
the additions to the standard library in C++11, or the equivalents in
boost.

Move the path token management logic to libaegisub (and rewrite it in
the process).

Add a basic thread pool based on asio and std::thread to libaegisub.

This touches nearly every file in the project and a nontrivial amount of
code had to be rewritten entirely, so there's probably a lot of broken
stuff.
2013-02-06 13:22:15 -08:00
Thomas Goyne 10e06ac3f9 Build and/or link the non-header-only boost libraries 2013-02-01 19:07:51 -08:00
Thomas Goyne 89a431a68b Set end times to zero when pasting plain text. Closes #1570. 2013-01-17 14:04:50 -08:00
Thomas Goyne cbbcc35e4f Remove some pointless initializers in AssDialogue's constructor 2013-01-17 14:03:48 -08:00
Thomas Goyne c08a9d4d7d Always make a full copy of the subtitles for ThreadedFrameSource after a save
Saving can add new lines to the file without making a commit, resulting
in the rendering thread's copy of the file getting out of sync.
2013-01-14 08:37:04 -08:00
Thomas Goyne 9a69ca9de4 Add padding between the split editbox buttons 2013-01-14 08:37:03 -08:00
Thomas Goyne 3499a0546a Make the split editor readonly rather than disabled 2013-01-14 08:37:03 -08:00
Thomas Goyne 879c2c19ae Add a button to the split editbox to remove the line text only, leaving override tags 2013-01-14 08:37:03 -08:00
Thomas Goyne 31d2054ab3 Don't update the initial line state after undo 2013-01-14 08:37:03 -08:00
Thomas Goyne 9a36e5cfe1 Add a unique ID to dialogue lines
This is needed to track lines across undo, as the previous method of
using the row number was slow and broke on inserts/deletes.
2013-01-14 08:37:03 -08:00
Thomas Goyne 0e7df15170 Initial implementation of the split editbox 2013-01-14 08:37:03 -08:00
Thomas Goyne 8162ebea24 Actually read the initial alpha for the color picker buttons 2013-01-14 08:37:03 -08:00
Thomas Goyne abf592e705 Add support for parsing alpha override parameters 2013-01-14 08:37:03 -08:00
Thomas Goyne 948d3055d5 Eliminate some unnecessary includes of subs_grid.h 2013-01-14 08:37:03 -08:00
Thomas Goyne 8d3202652f Paste over the selected lines if the selection has multiple lines
This seems to be what most users expect, rather than pasting downwards
from the active line, and is what pre-3.0 versions did as long as the
selection was continuous (since it pasted over from the first selected
line rather than the active line).
2013-01-14 08:37:02 -08:00
Thomas Goyne 50baf2d97f Only add alpha tags if the user actually changes the alpha 2013-01-14 08:37:02 -08:00
Thomas Goyne 9e37e0897f Implement the "coloralpha" automation control type 2013-01-14 08:37:02 -08:00
Thomas Goyne 0b5674e6aa Hide the alpha controls when the alpha isn't used 2013-01-14 08:37:02 -08:00
Thomas Goyne 7a3b221847 Use wxStaticBitmap for ColorPickerRecent 2013-01-14 08:37:02 -08:00
Thomas Goyne 0e58e3b09f Inline the bodies of the color picker controls
Scrolling between the declarations and definitions is annoying.
2013-01-14 08:37:02 -08:00
Thomas Goyne fa8fb65b8a Change PickerDirector to an enum class 2013-01-14 08:37:02 -08:00
Thomas Goyne 2072241e54 Move the implementation of the color picker dialog into an anonymous namespace 2013-01-14 08:37:01 -08:00
Thomas Goyne 247a92607b Remove the now-pointless convenience overload of GetColorFromUser 2013-01-14 08:37:01 -08:00
Thomas Goyne 4c147cbf0b Make ColourButton saner
Emit a separate event for when a color is picked rather than horribly
overloading the onclick event, and switch to a wxButton base since
wxBitmapButton no longer does anything useful.
2013-01-14 08:37:01 -08:00
Thomas Goyne c37c1ad477 Add alpha support to the color picker. Closes #217. 2013-01-14 08:37:01 -08:00
Thomas Goyne e19da4ffe7 Make the tag parameter parsing more forgiving of malformed input 2013-01-13 09:59:41 -08:00
Thomas Goyne ed6c052e7f Use SearchReplaceEngine in DialogSelection 2013-01-13 09:00:19 -08:00
Thomas Goyne 6be8d32929 Clean up SearchReplaceEngine a bit 2013-01-13 09:00:19 -08:00
Thomas Goyne f8b717e9ac Don't clear the body of \t tags when doing stuff to them 2013-01-13 09:00:18 -08:00
Thomas Goyne 3b4d121d4a Add an option to skip override tags when searching. Closes #104. 2013-01-13 09:00:18 -08:00
Thomas Goyne 5fff88473f Add option to skip comments in the find/replace dialog. Updates #683. 2013-01-13 09:00:18 -08:00
Thomas Goyne ab3ef175cd Rewrite SearchReplaceEngine
Decouple it from the subtitles grid and do everything through the
project context instead.

Actually obey the "In Selection" option for things other than Replace
All.

Cut down on the amount of logic duplicated between Replace All and
normal find/replace.

Start searching from the current cursor position, rather than the last
found position.
2013-01-13 09:00:18 -08:00
Thomas Goyne b1dbb9a94b Decouple SearchReplaceEngine from DialogSearchReplace 2013-01-13 09:00:18 -08:00
Thomas Goyne 59db22e905 Use STL names for wxString functions with a bunch of aliases 2013-01-11 08:55:35 -08:00
Thomas Goyne 2f4cae46b4 Move the SearchReplaceEngine instance to the context 2013-01-11 08:53:36 -08:00
Thomas Goyne bc2ddfbaee Fix compilation with clang 2013-01-11 08:44:35 -08:00
Thomas Goyne b337fbd691 Fix loading unicode actor names from plain text files
'isComment ? "" : actor' results in actor decaying to a const char * in
the local charset rather than converting "" to wxString, which breaks
things when unicode is involved.
2013-01-11 08:41:12 -08:00
Thomas Goyne d459b7089c Use enums rather than magic numbers 2013-01-11 08:41:12 -08:00
Thomas Goyne 199507a58a Remove an unused variable and rename a misleading one 2013-01-11 08:41:12 -08:00
Thomas Goyne c923b05c23 Eliminate some duplicated code in the find dialog 2013-01-11 08:41:12 -08:00
Thomas Goyne 2d521fafc5 Shuffle around the find dialog sizers to cut down on empty space 2013-01-11 08:33:52 -08:00
Thomas Goyne 13851ff74d Delete worthless comments 2013-01-11 08:33:52 -08:00
Thomas Goyne 4334514c78 Remove the "update video" box from the find dialog
It hasn't worked for a few years and doesn't really make any sense with
how committing works now.
2013-01-11 08:33:52 -08:00
Thomas Goyne 76d93f0036 Actually stretch the volume/zoom link button 2013-01-09 20:03:22 -08:00
Thomas Goyne e9a5494910 Calculate the required size for the subs edit box time edits rather than hardcoding it 2013-01-09 19:44:26 -08:00
Thomas Goyne d7d2e17093 Remove calls to SetBackgroundStyle(wxBG_STYLE_COLOUR)
With wx2.9 it's a no-op.
2013-01-09 19:40:49 -08:00
Thomas Goyne ca80156a4d Add some padding between the video box textctrls 2013-01-09 19:38:41 -08:00
Thomas Goyne cb1b5401e3 Remove the border around the video box in the detached video dialog 2013-01-09 19:26:39 -08:00
Thomas Goyne 442bbcc682 Add libass cflags to subtitles_provider.o 2013-01-09 19:24:47 -08:00
Thomas Goyne 8cb2d5bf16 Drop MPC-HC VSFilter and default to xy-VSFilter 2013-01-09 16:48:32 -08:00
Thomas Goyne 8566960312 Write the version comments under the [Script Info] header. Closes #1567. 2013-01-09 16:48:32 -08:00
Thomas Goyne 8470ffdbf0 Allow negative values for shadow depth, angle and spacing in the style editor 2013-01-09 16:48:32 -08:00
Thomas Goyne 7bc79b2d9f Significantly speed up AssDialogue::GetData
wxString::Format is astonishingly slow, and while this normally doesn't
particularly matter, AssEntry::EntryData's speed can become relevant on
large files.

Switch to a slightly more manual approach that's about four times as
fast.
2013-01-09 16:48:32 -08:00
Thomas Goyne a99428c49d Extract options and MRU stuff from main.h
Nearly all of the files including main.h are doing so only for OPT_GET
and friends, which are rather unrelated to the main things that main.h
declares.
2013-01-09 16:48:31 -08:00
Thomas Goyne bd9a81372d Cut down on the ifdefs in main.cpp
Shuffle some stuff around to reduces the number of ifdefs and always
define MacOpenFile since there's no reason not to.
2013-01-09 16:48:31 -08:00
Thomas Goyne 9b24ab38a4 Don't write the crash xml file
Nothing uses it and it's not even valid xml.
2013-01-09 16:48:31 -08:00
Thomas Goyne c691099d24 Use CRC32 for ffms2 index filenames
No real advantages other than that it means md5.h/c can be deleted.
2013-01-09 16:48:30 -08:00
Thomas Goyne e8344ab0c7 Add agi::util::Remove for deleting files 2013-01-03 17:36:50 -08:00
Thomas Goyne cec5f2256c Add agi::util::try_parse 2013-01-03 17:36:50 -08:00
Thomas Goyne 4116e88fe5 Get rid of auto-running exporters, since they aren't really used for anything anymore 2013-01-03 17:36:50 -08:00
Thomas Goyne 7d6e246ace Handle filters which unregister themselves in AssExportFilterChain::Clear 2013-01-03 16:44:07 -08:00
Thomas Goyne 451de69e54 Trim whitespace from all of the style fields when parsing. Closes #1565. 2013-01-01 21:00:06 -08:00
Thomas Goyne b1cd2db023 Don't throw exceptions from destructors 2013-01-01 20:55:00 -08:00
Thomas Goyne faad79479f Handle FileNotFound errors when the user dictionary file doesn't exist 2012-12-31 07:50:17 -08:00
Thomas Goyne 3e5ba4fd98 Catch wxStrings in OnInit as there's still a few things that throw them 2012-12-31 07:49:57 -08:00
Thomas Goyne 8f765f3955 Add AssOverrideBlockComment
Nothing actually wants to treat comments as plain text, so using the
same type for both just makes things more complex.
2012-12-31 07:09:32 -08:00
Thomas Goyne 1f1cb36b6d Extract TEXT -> DRAWING conversion from SplitWords 2012-12-31 07:09:31 -08:00
Thomas Goyne 3ec82952f8 Partially de-wxify AssStyle 2012-12-31 07:09:31 -08:00
Thomas Goyne d49758edbf De-wxify AssOverride 2012-12-31 07:09:31 -08:00
Thomas Goyne 134fe60517 Fix tests compilation 2012-12-31 07:09:31 -08:00
Thomas Goyne 426e4593c7 Fix a bunch of incorrect implicit wxString <-> std::string conversions
The implicit conversion assumes that std::string is encoded in the local
charset, while it's always actually UTF-8.
2012-12-31 07:09:31 -08:00
Thomas Goyne e04c46fd45 Replace the body of autogen.sh with a call to autoreconf. Closes #1564. 2012-12-31 07:08:56 -08:00
Thomas Goyne 2bf92fec6e Fix crash when amending commits with video open
The video source's copy of the subtitle file was being discarded once it
was fully loaded (as it was previously never needed again), so amending
it only worked if the user had made a non-amend commit after the last
seek.
2012-12-29 08:40:10 -08:00
Thomas Goyne d5f36af87e Add override attributes to the subtitle formats 2012-12-28 19:49:48 -08:00
Thomas Goyne 43d3fac178 Fix compilation with libc++ 2012-12-28 09:44:53 -08:00
Thomas Goyne b0cbc049ec Fix 64-bit compilation 2012-12-28 09:19:43 -08:00
Thomas Goyne c6cd86f2da Actually initialize AssOverrideParameter::omitted 2012-12-28 09:18:54 -08:00
Thomas Goyne 87e60bca2a Fix fonts collector crash when the font isn't found 2012-12-28 07:32:55 -08:00
Thomas Goyne 9955a2c39d Log more stuff when creating audio providers 2012-12-27 08:49:37 -08:00
Thomas Goyne 572a58cd90 Have FFMS2 do the audio downmixing when possible
Aegisub's downmixer is terrible for anything with more than two channels
(averaging all the channels together is not even vaguely close to the
correct thing to do for 5.1), so libavresample should be far better.
2012-12-27 08:42:00 -08:00
Thomas Goyne 745b9ab2a9 Build ffmpeg and ffms2 with libavresample 2012-12-26 19:32:47 -08:00
Thomas Goyne 44323cef6d Use max_element rather than a loop 2012-12-26 19:27:25 -08:00
Thomas Goyne 6e3cc883b3 Replace most uses of type::iterator with auto 2012-12-22 15:35:13 -08:00
Thomas Goyne d0f4d9df99 Replace all uses of lagi_wxString with to_wx 2012-12-22 15:18:38 -08:00
Thomas Goyne e270dc9aec Use stable_vector for AudioProviderRam's cache
stable_vector allocates its elements non-contiguously (as is required
for stability), while still giving O(1) indexing.
2012-12-22 14:44:35 -08:00
Thomas Goyne 433368dc58 Fix some weirdness in the AVS audio provider 2012-12-22 12:14:32 -08:00
Thomas Goyne 46d2819312 Use lambdas for some of DialogProgress's stuff 2012-12-22 11:51:08 -08:00
Thomas Goyne 6e5b53d1a9 Move the logic for which AudioProvider to create out of AudioController
Audio providers should be responsible for determining whether or not
they can open a URI, since it's not really possible for anything else
to. As such move the (lack of) parsing of dummy audio URIs to
DummyAudioProvider, and try to create DummyAudioProviders in
AudioProvider::CreateProvider.
2012-12-22 09:30:47 -08:00
Thomas Goyne a4607ff6be Clean up AudioProvider a bit
Factor out some duplicated code and clean up some cruft.
2012-12-22 07:49:59 -08:00
Thomas Goyne 31feab4a8b Rewrite the dummy video dialog
Use validators for transferring data to/from the controls and for
validating the values rather than a bunch of custom logic.
2012-12-21 17:01:13 -08:00
Thomas Goyne 0b5994e8eb Always update edit box styles when it's called directly 2012-12-21 16:56:27 -08:00
Thomas Goyne e25fc4b334 Add Remove From Dictionary to the subs edit box context menu when applicable. Closes #1184. 2012-12-21 16:56:27 -08:00
Thomas Goyne 24aef1ffef Fix word-boundary checking for edit box spellchecking 2012-12-21 16:56:27 -08:00
Thomas Goyne 835f7c0f78 Only enable the Remove Word button when the word can be removed. Updates #1184. 2012-12-21 16:56:26 -08:00
Stjepan Henc fe630e052b Add Remove Word button to the spellchecker dialog. Updates #1184. 2012-12-21 16:56:26 -08:00
Thomas Goyne 36012c3302 Delete the respack-generated files on Clean 2012-12-17 17:21:26 -08:00
Thomas Goyne a2c14e9c5f Check the error code when FFMS2 can't create an indexer
Creating an indexer can fail for reasons other than the file not
existing. This check is still not completely correct, since FFMS2 uses
the wrong error codes in a bunch of places.
2012-12-17 10:14:08 -08:00
Thomas Goyne eab11666a9 Remove some cruft from option.h 2012-12-17 09:32:42 -08:00
Thomas Goyne 4c6be1fe55 Fix y4m loading 2012-12-17 09:32:42 -08:00
Thomas Goyne 229e5d98c5 Avoid making a full copy of the file for ThreadedFrameSource when possible
When the set of changed lines is populated, only copy those lines rather
than the entire file. On large files, this makes amend commits roughly
twice as fast when video is open.
2012-12-17 09:32:42 -08:00
Thomas Goyne fee60be5db Announce the set of lines changed in commits
Currently this is only populated when commits are amended, for the
simple reason that it's the only time that AssFile knows what lines
changed. It is probably worth expanding this in the future.
2012-12-17 09:32:42 -08:00
Thomas Goyne 4e72fff1d9 Check the right substrings in the spellchecker dialog. Closes #1560. 2012-12-12 18:08:07 -08:00
Thomas Goyne 72ae116196 Rename SubsEditBox's private members
Mostly to cut down on conflicts with the split-editbox branch.
2012-12-12 15:17:21 -08:00
Thomas Goyne 090905056b Remove spaces in > > in nested templates 2012-12-11 10:58:28 -08:00
Thomas Goyne 6e153ed7d9 Make OpenGLTextTexture moveable so that it doesn't need to be in a shared_ptr 2012-12-11 10:41:20 -08:00
Thomas Goyne 0b133de08f Remove pointless empty destructors
An explicit empty destructor is only needed when a class has a smart
pointer to an incomplete type.
2012-12-11 09:06:21 -08:00
Thomas Goyne 9a77d564e4 Cut down on the padding under the audio toolbar 2012-12-11 08:32:58 -08:00
Thomas Goyne 7c477f3cd1 Use a real toolbar for the video box's buttons 2012-12-11 08:25:24 -08:00
Thomas Goyne 534f574a87 Delete AssDialogue::StripTag
It is not actually used anywhere.
2012-12-10 17:43:29 -08:00
Thomas Goyne 8c2062f0c7 Store AssOverrideTags directly rather than a vector of pointers 2012-12-10 17:04:18 -08:00
Thomas Goyne a0d3b8595f Redesign AssOverrideParameter
Always store the original string form and convert it to the desired type
on demand. In most cases this is significantly faster as typically only
a few of the parameters in a line are actually read. In addition, this
makes it so that parameters which did not actually change are always
reserialized in their original form.

Delete VariableData as it's no longer used by anything.

Closes #1513.
2012-12-10 14:41:11 -08:00
Thomas Goyne f28f6ad5b3 Join lines copied to the clipboard with newlines rather than nothing 2012-12-10 14:03:03 -08:00
Thomas Goyne fb3500b354 Make the configure check for lua more specific
Move the generic lua check to after the checks for lua 5.1 and check for
lua < 5.2.

Closes #1559.
2012-12-10 14:01:56 -08:00
Thomas Goyne 936598e9f5 Add include directory and log files to .gitignore 2012-12-10 07:43:23 -08:00
Thomas Goyne 681de8cf37 Fix order of VariableData's initializers 2012-12-09 17:19:01 -08:00
Thomas Goyne a36011a9dd Don't insert [Script Info] entries for empty values 2012-12-09 17:07:05 -08:00
Thomas Goyne c1409b5c25 Add a space after the colon in [Script Info] entries 2012-12-09 17:05:11 -08:00
Thomas Goyne 96b3656742 Stick to the standard order of sections when inserting lines 2012-12-09 15:44:03 -08:00
Thomas Goyne 205d408f3e Move tag/param proto declarations to the cpp file
It's purely an implementation detail of the parser that should not be
exposed to the outside world.
2012-12-09 15:40:29 -08:00
Thomas Goyne 8cf47c38b6 Drop AssOverrideParameter::omitted since it's equivalent to the type being VARDATA_NONE 2012-12-09 10:36:13 -08:00
Thomas Goyne d2a0a76ca9 Store AssOverrideParameters directly rather than a vector of pointers to them 2012-12-09 10:12:50 -08:00
Thomas Goyne 851f7f40e6 Make VariableData uncopyable but moveable 2012-12-09 10:12:50 -08:00
Thomas Goyne 482d31299b Remove unused things from VariableData 2012-12-09 08:04:29 -08:00
Thomas Goyne 7e38ad6ec7 Don't add {} to the body of \t tags 2012-12-09 08:04:20 -08:00
Thomas Goyne bd35d9308d Use unordered_set for the actor/effect values 2012-12-07 19:24:42 -08:00
Thomas Goyne 9b44f92235 Make AssEntry purely a base class and add AssInfo
Now that all the other junk is being dropped from the file, script info
lines are the only thing left which was a concrete AssEntry, and
AssEntry wasn't actually a very good way to store them.
2012-12-07 18:55:29 -08:00
Thomas Goyne cccd95941d Fix syntax highlighting for multiple karaoke templater expression blocks 2012-12-07 18:20:09 -08:00
Thomas Goyne 28705000bb Use boost::join in a handful of places 2012-12-07 08:25:47 -08:00
Thomas Goyne 0ac8df140c Make the check for if an override tag needs parens less dumb 2012-12-07 08:12:45 -08:00
Thomas Goyne 422cfb153f Add a box with the character count of the longest line
Character counts are a pretty terrible measure of anything, but it's
still the main measure of length used in most subtitling standards
(because subtitling standards are written under the assumption that the
tools are terrible (which is generally an accurate assumption)).
2012-12-06 10:01:47 -08:00
Thomas Goyne 1b15a753a1 Add .m4v to the list of video file extensions
It would be nice if this didn't require adding it in five different places...
2012-12-05 20:23:32 -08:00
Thomas Goyne 222c09b58f Increase maximum undo levels to 10000 from 100 2012-12-05 19:12:34 -08:00
Thomas Goyne f3122aca30 Make the precompiled header depend on the .h file 2012-12-05 18:46:25 -08:00
Thomas Goyne d5aae26d83 Use boost::flyweight to intern the wxString members of AssDialogue
100 no-op non-amend commits on a subtitle file with 6689 dialogue lines,
with the undo limit set to 100:

Without flyweight:
	No video open:
		Initial memory usage: 30.6 MB
		Final memory usage: 498.0 MB
		Elapsed time: 6.3 seconds
	Video open, using libass:
		Initial memory usage: 54.3 MB
		Final memory usage: 653.3 MB
		Elapsed time: 23.7 seconds

With flyweight:
	No video open:
		Initial memory usage: 26.0 MB
		Final memory usage: 104.5 MB
		Elapsed time: 3.0 seconds
	Video open, using libass:
		Initial memory usage: 46.7 MB
		Final memory usage: 251.8 MB
		Elapsed time: 13.0 seconds

No video open:
	Memory usage: -79%
	Time: -52%
Video open:
	Memory usage: -61.5%
	Time: -45%

100 no-op amend commits on a line in the middle of a subtitle file with
6689 dialogue lines, with video open:

Without flyweight:
	Initial memory usage: 48.2 MB
	Final memory usage: 182.3 MB
	Elapsed time: 22.3 seconds

With flyweight:
	Initial memory usage: 39.8 MB
	Final memory usage: 165.8 MB
	Elapsed time: 13.8 seconds

Note: The large jump in memory usage here is due to that the benchmark
is blocking the main thread, so at the end there are ~100 video frames
waiting to be displayed.
2012-12-05 18:43:44 -08:00
Thomas Goyne c7c270cf12 Use an enum for the SRT parser states 2012-12-05 15:06:02 -08:00
Thomas Goyne c1ed667025 Add the curly braces in AssDialogueBlockOverride::GetText
All of the calling code added them, so there's no reason not to just do
it in one place.
2012-12-04 19:49:05 -08:00
Thomas Goyne 17ffacb6a0 Use iota rather than partial sum 2012-12-02 13:34:32 -08:00
Thomas Goyne de4ef14598 Use lambdas for very short event handlers 2012-12-02 13:29:46 -08:00
Thomas Goyne 004b032a54 Update LICENSE 2012-12-02 13:16:10 -08:00
Thomas Goyne 91fa11e375 Relicense all of my stuff that's still 3-BSD to ISC 2012-12-02 13:14:24 -08:00
Thomas Goyne 009518271a Document a few things and kill all remaining placeholders 2012-12-02 13:08:42 -08:00
Thomas Goyne 3949ccec24 Drop the position argument from ProcessParametersCallback since nothing needs it 2012-12-02 12:39:37 -08:00
Thomas Goyne 1c176e8568 Store parsed dialogue blocks in a ptr_vector
This eliminates the need to explicitly delete the parsed blocks.

Also go ahead and remove AssDialogue::Blocks since it's really not a
very good idea in general.
2012-12-02 12:29:33 -08:00
Thomas Goyne 67d796731a Replace SubsEditBox::OnUndoTimer with a lambda 2012-12-02 07:59:32 -08:00
Thomas Goyne b507f49cec Remove the pad argument from GetMarginString
It's no longer ever actually set to true.
2012-12-02 07:59:31 -08:00
Thomas Goyne 3045e2d012 Move the Margin controls to an array 2012-12-02 07:59:31 -08:00
Thomas Goyne fae9a5496a Extract some duplicated code for the margin controls 2012-12-02 07:59:31 -08:00
Thomas Goyne 0b46fdff49 Refactor time ctrl handling in SubsEditBox 2012-12-02 07:59:31 -08:00
Thomas Goyne 1b6f122d12 Replace field_setter with a lambda 2012-12-02 07:59:31 -08:00
Thomas Goyne 621b665885 Move the project configurations to aegisub.props 2012-12-02 06:33:30 -08:00
Thomas Goyne d3fc4dcb25 Remove things used in one (or zero) files from agi_pre.h 2012-12-02 06:33:30 -08:00
Thomas Goyne 7090d2f513 Don't include wx/wx.h in subs_grid.h 2012-12-02 06:33:29 -08:00
Thomas Goyne 96cf5ea7ed Kill the #ifndef AGI_PRE guards
They don't actually improve compilation performance and make it more
annoying to modify what things are in the precompiled header.
2012-12-02 06:33:29 -08:00
Thomas Goyne ff03fef2db Use the C++ versions of C headers 2012-12-01 17:24:59 -08:00
Thomas Goyne f337db86d3 Make AssStyle::UpdateData and GetSSAText less weird 2012-12-01 17:24:59 -08:00
Thomas Goyne 56993f7f5e Don't use emplace_back for wxDataViewItemArray since it doesn't work in non-STL builds 2012-11-30 18:47:24 -08:00
Thomas Goyne e0ce2962cf Fix typo in a VFW error message 2012-11-30 17:06:01 -08:00
Thomas Goyne c2a43a2356 Clean up AssKaraoke a little bit 2012-11-30 16:40:00 -08:00
Thomas Goyne ffef9a1485 Round syllable durations to centiseconds when splitting syllables 2012-11-30 16:25:20 -08:00
Thomas Goyne af35e50810 Also move karaoke markers after the dragged marker if Ctrl is held down. Closes #1557. 2012-11-30 16:22:45 -08:00
Thomas Goyne 5b31f10d0b Use the XP-compatible msvc runtime 2012-11-30 12:01:45 -08:00
Thomas Goyne 66becbab16 Fix crash on exit
Subtitle formats unregister themselves when deleted, so using
delete_clear on the list of subtitle formats does not work very well.
2012-11-30 12:01:44 -08:00
Thomas Goyne 5513d774bf Rewrite the fontconfig font lister
FcFontRenderPrepare discards excess family names and fullnames, so in
some cases it may be impossible to verify that the font returned by it
is the one we asked for. To work around this, prefilter the available
fonts to only do fontconfig's matching on the ones with the correct
names.
2012-11-30 12:01:44 -08:00
Thomas Goyne 0b19908e7b Use std::prev and std::next where applicable 2012-11-30 10:54:57 -08:00
Thomas Goyne 174a992974 Use remove_and_dispose_if where applicable 2012-11-30 10:44:09 -08:00
Thomas Goyne 6ab8345148 Use nullptr in more places 2012-11-30 10:44:09 -08:00
Thomas Goyne 7a7a036017 Switch lists of pointers to vectors of pointers 2012-11-30 10:44:09 -08:00
Thomas Goyne e77e810bd8 Use emplace_back where applicable 2012-11-30 10:44:09 -08:00
Thomas Goyne eca70285f1 Switch all uses of std::list for signal connections to std::deque 2012-11-28 07:28:18 -08:00
Thomas Goyne df4fffede5 Add a solution configuration with all external deps disabled 2012-11-28 06:51:52 -08:00
Thomas Goyne 42a8a55b51 Fix setting hotkeys
Populating a vector by resizing it to the target size then using
push_back does not work very well.
2012-11-27 16:14:06 -08:00
Thomas Goyne d7b01edc64 Support styles after the dialogue in the fonts collector
Make two passes over the file to collect all of the styles before
processing the dialogue lines, as the styles section can legally come
after the dialogue lines which use those styles.
2012-11-26 16:37:53 -08:00
Thomas Goyne a5ac77368c Use EVT_CHAR_HOOK rather than EVT_KEY_DOWN in TimeEdit
With wxWidgets trunk keydown events are no longer generated for
Ctrl-C/X/V on Windows, which breaks the custom copy/paste handling.
2012-11-26 07:38:50 -08:00
Thomas Goyne 5309f7fb9d Add explicit override specifiers to ASS-related virtuals 2012-11-26 07:11:30 -08:00
Thomas Goyne 2a6c6616a9 Rename AssStyle::GetType() to AssStyle::Group() so that it actually gets called 2012-11-26 07:11:30 -08:00
Thomas Goyne 1a6caa27b6 Switch to using lambdas in a few places 2012-11-26 07:11:30 -08:00
Thomas Goyne 2c1f593a13 Delete declarations of LuaParseTagData and LuaUnparseTagData 2012-11-26 07:11:30 -08:00
Thomas Goyne 6b09bdfe70 Factor out some duplicated code 2012-11-26 07:11:30 -08:00
Thomas Goyne 947dc537d1 Add a generic function for invoking functions on the GUI thread 2012-11-26 07:11:30 -08:00
Thomas Goyne 1d020b851e Add picked colors to the recently used colors 2012-11-25 16:47:39 -08:00
Thomas Goyne 59e6a1bef7 Fix crash when playing audio before time 0
There were two checks for reads past the end rather than checks for
before start and after end.

Closes #1556.
2012-11-25 14:01:50 -08:00
Thomas Goyne 4e8e5b597c Change AssEntry::group to an enum 2012-11-25 14:01:50 -08:00
Thomas Goyne 49ed0551ad Consolidate all entries of each group when there are duplicate sections
Dealing with multiple instances of each section makes the code
significantly more complicated, and in most cases Aegisub doesn't
actually bother to handle it correctly.
2012-11-24 16:24:01 -08:00
Thomas Goyne b94547aa71 Drop format and header lines from the in-memory file representation
They're just pointless cruft, so drop them from the file when parsing
and re-add them when saving as ASS or SSA.
2012-11-24 16:24:00 -08:00
Thomas Goyne 30ceced39f Skip the current line when searching for the next matching line in the kanji timer 2012-11-24 16:24:00 -08:00
Thomas Goyne 0483c1cfbe Fix string vs color logic in the option parsing 2012-11-24 16:24:00 -08:00
Thomas Goyne 28b056e422 Add a msbuild project to build the portable installers 2012-11-24 16:24:00 -08:00
Thomas Goyne 6ed970ed5b Write a msbuild xml file with the current version information 2012-11-24 10:44:44 -08:00
Thomas Goyne 3ff6158d85 Fix configure check for libc++ 2012-11-24 10:04:53 -08:00
Thomas Goyne bdf7a0ca83 Parse unclosed override blocks as plain text as VSFilter does 2012-11-24 10:04:53 -08:00
Thomas Goyne a4311b50f7 Update the correct inputs when typing in the HTML box in the color picker 2012-11-24 10:04:53 -08:00
Thomas Goyne ded55272a0 Use the correct format for ASS colors in the color picker 2012-11-24 10:04:53 -08:00
Martin Herkt b1e40455ed ASS: Fix script header
Previously, Aegisub wrote its "Script generated by" lines without a
semicolon to mark them as comments. As a result, it prepended these
lines every time a script was loaded and then saved again. Fix.

Also fix a bug that caused the ASS parser to treat comments before
the [Script Info] section as non-blank lines, therefore inserting a
duplicate section header whenever such comments were present.
2012-11-22 07:50:14 -08:00
Thomas Goyne 3f840ceec8 Fix crash when rearranging styles in the style manager
Inserting lines already in an intrusive list at a different position
does not work, unlike with unintrusive lists. Instead, swap each item in
to the correct place.
2012-11-21 07:32:06 -08:00
Thomas Goyne 8e10d67d2f Read strings from Matroska as UTF-8
Strings in Matroska files are all either UTF-8 or a UTF-8 subset, not
whatever the current locale happens to be.
2012-11-21 06:27:27 -08:00
Thomas Goyne 3b90e81fee Install 64-bit xy-VSFilter 2012-11-20 19:18:18 -08:00
Thomas Goyne e2fdabe1fd Unconditionally install the runtime 2012-11-20 19:18:18 -08:00
Thomas Goyne bd259b7197 Fix awesome variable shadowing derp 2012-11-20 14:28:57 -08:00
صفا الفليج 87851a76db Update Arabic translation. Update #1532. 2012-11-19 16:49:07 -08:00
Thomas Goyne 55ba0d042a Add _32 to the filename of 32-bit ffms2 2012-11-19 16:18:09 -08:00
Thomas Goyne f6197a99ea Unconditionally install the vc++ runtime for now as the check needs to be updated 2012-11-19 16:14:14 -08:00
Thomas Goyne 1880bb71df Disable parallel make for fribidi since it seems to have broken deps 2012-11-19 11:08:34 -08:00
Thomas Goyne b8b9bfdfb6 Fix non-pch compilation 2012-11-18 21:10:36 -08:00
Thomas Goyne ffa69421cd Rename setup.h to setup-build.h
build is in the include path for git_version.h, so build/wx/setup.h
would get included rather than $PREFIX/include/wx/setup.h.
2012-11-18 21:10:21 -08:00
Thomas Goyne 799ca651d0 Copy the platform header before running respack 2012-11-18 07:12:04 -08:00
Thomas Goyne ee38d27c2b Set the newline style for ffmpeg before checking out the working copy 2012-11-18 06:48:18 -08:00
Thomas Goyne 1a0258596a Fix some incorrect header includes in the projects resulting in excess rebuilds 2012-11-17 21:09:16 -08:00
Thomas Goyne 38efa5679e Fix statically linking fribidi 2012-11-17 17:34:38 -08:00
Thomas Goyne 4a749530f4 Add libass project 2012-11-17 17:34:37 -08:00
Thomas Goyne 291e411f4c Use a patched zconf.h that doesn't try to include unistd.h when it isn't available 2012-11-17 11:13:08 -08:00
Thomas Goyne 2c4908caf5 Add boost to the automatically fetched dependencies 2012-11-17 11:13:06 -08:00
Thomas Goyne 9344493558 Add boost path to configuration UI 2012-11-17 11:13:05 -08:00
Thomas Goyne 92b09ea7c6 Fix gratuitous rebuilding of libresrc 2012-11-17 11:12:59 -08:00
Thomas Goyne d98bd816a6 Use a timestamp file rather than trying to track FFmpeg's dependencies 2012-11-17 11:12:12 -08:00
Thomas Goyne 39e642d20e Add wxWidgets project 2012-11-16 20:21:23 -08:00
Thomas Goyne b6c2cf887f Add an empty unistd.h for zconf.h 2012-11-16 15:58:56 -08:00
Thomas Goyne e0144394f5 Add the directory with inttypes.h to the include path for Makefile projects 2012-11-16 15:58:56 -08:00
Thomas Goyne 8ca862fa93 Force autocrlf to input for ffmpeg since it barfs on Windows newlines 2012-11-16 15:58:56 -08:00
Thomas Goyne 497f23e22d Clean up the solution build configurations a bit 2012-11-16 15:58:56 -08:00
Thomas Goyne 7bf664b28d Enable automatic NuGet package restoration 2012-11-16 15:58:56 -08:00
Thomas Goyne 30dd139cf3 Fix the include path for FFTW3 2012-11-16 15:58:55 -08:00
Thomas Goyne dfefdeaf8a Don't try to load the user config file if it doesn't exist 2012-11-16 15:58:55 -08:00
Thomas Goyne 8c5c4cfd20 Add the solution file 2012-11-16 15:58:55 -08:00
Thomas Goyne b169a05f08 Try to autodetect the location of msys 2012-11-16 15:58:55 -08:00
Thomas Goyne d6c8215df7 Set the default source paths for the deps to where the updater will put them 2012-11-16 15:58:55 -08:00
Thomas Goyne 6f01ad7f95 Add project to fetch and update most of Aegisub's external deps 2012-11-16 13:47:51 -08:00
Thomas Goyne b055abae44 Fix compliation with gcc 4.7 2012-11-15 18:15:40 -08:00
Thomas Goyne 89fef06d6b Replace all uses of auto_ptr with unique_ptr 2012-11-15 18:15:39 -08:00
Thomas Goyne 0be698965a Obey the platform/configuration set in the UI for ffmpeg and fribidi 2012-11-15 18:15:39 -08:00
Thomas Goyne eaf66ea329 Dynamically link the runtime for FFMS2 and FFmpeg 2012-11-15 15:25:24 -08:00
Thomas Goyne 558325bce3 Add zlib project 2012-11-14 14:35:49 -08:00
Thomas Goyne 73696b8efa Add msbuild target for building translations. Closes #1076. 2012-11-14 07:08:43 -08:00
Thomas Goyne 9a2b8fc408 Add dependency information to the fribidi project 2012-11-13 16:15:39 -08:00
Thomas Goyne d70094917b Add some dependency information to avoid pointlessly rebuilding ffmpeg 2012-11-13 11:01:50 -08:00
Thomas Goyne 06aaaff16b NULL -> nullptr 2012-11-13 08:51:01 -08:00
Thomas Goyne 47c678bd63 Make UCDetect a little less insane 2012-11-13 08:46:31 -08:00
Thomas Goyne 2dd1da8333 Use C++11 stuff in libaegisub 2012-11-13 08:46:30 -08:00
Thomas Goyne 653aa32eb2 Use std::any_of rather than std::find_if() != end() 2012-11-13 05:52:24 -08:00
Thomas Goyne b6b68b789d Use lambdas in a few places 2012-11-12 19:40:42 -08:00
Thomas Goyne dbbb73651d Replace the post-build events with a new target with dep tracking and such 2012-11-12 18:35:34 -08:00
Thomas Goyne 6a0c790ff2 Add a FFMS2 project 2012-11-12 18:35:34 -08:00
Thomas Goyne 938a1d32c8 Add ffmpeg project 2012-11-12 18:35:28 -08:00
Thomas Goyne eeb28dbdb1 Fix SSA parsing test 2012-11-12 18:35:28 -08:00
Thomas Goyne 6212afb314 Add karaoke templater support to the syntax highlighter 2012-11-12 18:35:27 -08:00
Thomas Goyne b3c1af11b7 Fix handling of unclosed override blocks starting at position 0 2012-11-12 18:35:27 -08:00
Thomas Goyne 7ca7b1d934 Fix syntax highlighting for fonts with spaces 2012-11-12 18:35:27 -08:00
Thomas Goyne 1375da556f Default to O3 rather than O2 2012-11-12 18:35:27 -08:00
Thomas Goyne 692ef37b8f Add Clean and Rebuild targets to fribidi 2012-11-12 18:35:27 -08:00
Thomas Goyne 31e347febf Use ToolTask for ShellWrapper for simpler effective logging 2012-11-12 18:35:27 -08:00
Thomas Goyne e7ab194809 Set the output base relative to the project so that it works when building projects directly 2012-11-12 18:35:27 -08:00
Thomas Goyne ffcd455713 Add fribidi project 2012-11-12 18:35:27 -08:00
Thomas Goyne 3cf2a39884 Add msbuild task to update git_version.h 2012-11-12 18:35:27 -08:00
Thomas Goyne c759beda96 Add msys root directory to paths page 2012-11-12 18:35:27 -08:00
Thomas Goyne c1dc875a05 Always add the spellchecker language list to the edit box context menu
There's really no reason not to include it even if the right-click
wasn't on a word, and leaving it out can lead to confusing situations
when the dictionary file for the user's currently selected language
doesn't exist.
2012-11-12 18:35:26 -08:00
Thomas Goyne 01c833d9b3 Make the autosave dialog resizeable 2012-11-12 18:35:26 -08:00
Thomas Goyne c41f2ff343 Add an icon to the autosave dialog 2012-11-12 18:35:26 -08:00
Thomas Goyne 59a165f022 Change the crash recovery naming scheme to be like the autosave files 2012-11-12 18:35:26 -08:00
Thomas Goyne eb823e66d3 Add backups and crash recovery files to the autosave dialog. Closes #657. 2012-11-12 18:35:26 -08:00
Thomas Goyne 154f831c7c Add a basic dialog for opening Autosave files
This currently consists of just a list of autosave files and the
timestamps of the versions available for each file. It'd probably be a
good idea to add more information to this later, such as the original
file path and perhaps a preview of the file?

Closes #781.
2012-11-12 18:35:26 -08:00
Thomas Goyne 6f05d4b466 Change the test for json parse errors to work with libc++
libc++ is of the opinion that "123eee" is a well-formed double equal to 0.
2012-11-12 18:35:26 -08:00
Thomas Goyne ae231ce5a5 Add test files to .gitignore 2012-11-12 18:35:26 -08:00
Thomas Goyne 9c37a50b4d Add support for gtest 1.6
1.6.0 removed support for 'make install' as the maintainers are
apparently unaware that their library is not actually a unique snowflake
and that having to use identical compilation settings for every library
is in fact a completely normal thing for C++ libraries that people
somehow manage to deal with.

Building the tests now requires passing the root directory of a copy of
the googletest source to make, via 'make GTEST_ROOT=~/path/to/gtest'.
2012-11-12 18:35:26 -08:00
Thomas Goyne 4853119153 Add .cc extension to Makefile.target 2012-11-12 18:35:26 -08:00
Thomas Goyne 88fdee726b Extract word-splitting logic from the syntax highlighter 2012-11-12 18:35:25 -08:00
Thomas Goyne 24c21dd425 Don't update the editbox styling when it hasn't changed
The syntax highlighting isn't especially slow, but the stylesneeded
event seems to be sent repeatedly until the styles aren't changed, so it
was pointlessly reparsing and restyling the text on every idle event.
2012-11-12 18:35:25 -08:00
Thomas Goyne f628f92747 Significantly restructure the msbuild projects to make them actually work 2012-11-12 18:35:25 -08:00
Thomas Goyne 7a116db07d Unbind shift-enter in the edit box since it does weird things 2012-11-12 18:35:25 -08:00
Thomas Goyne 238356406f Extract calltip logic from the edit ctrl to libaegisub 2012-11-12 18:35:25 -08:00
Thomas Goyne e4d6b8661b Add range adaptor for filtering to a specific subclass from a heterogeneous range
This makes looping over the subtitle file and parsed dialogue lines less
awkward in many cases.
2012-11-12 18:35:25 -08:00
Thomas Goyne 67df64e879 Use range-based for loops in a bunch of places 2012-11-12 18:35:25 -08:00
Thomas Goyne 8af78a6a61 Add fontconfig project 2012-11-12 18:35:25 -08:00
Thomas Goyne 3add0e5b91 Add freetype2 project 2012-11-12 18:35:24 -08:00
Thomas Goyne aaccf94269 Remove support for externally-built FFTW3 2012-11-12 18:35:24 -08:00
Thomas Goyne 6b52c4f4aa Copy FFTW3's header to a more convenient place after building it 2012-11-12 18:35:24 -08:00
Thomas Goyne 4bb1b182c8 Add a conditional project reference to FFTW3 2012-11-12 18:35:24 -08:00
Thomas Goyne b308b1ec9c Add a project file for FFTW3 2012-11-12 18:35:24 -08:00
Thomas Goyne a4e96f22f7 Use the full path to the source file for the intermediate file location
This fixes the issues with multiple files in different directories with
the same name overwriting each other's object files.
2012-11-12 18:35:24 -08:00
Thomas Goyne 8ad1e2d4a9 Actually include the user's global properties file 2012-11-12 18:35:24 -08:00
Thomas Goyne 338e604455 Include user config file in libresrc to get the wx path 2012-11-12 18:35:24 -08:00
Thomas Goyne cfc9f81f85 Define NOMINMAX for Aegisub 2012-11-12 18:35:24 -08:00
Thomas Goyne 735d687ec5 Add wx paths to the config properties 2012-11-12 18:35:24 -08:00
Thomas Goyne 83597e1a68 Actually define the update checker defines when enabled 2012-11-12 18:35:23 -08:00
Thomas Goyne 7f4a3b4967 Set defaults for more build options 2012-11-12 18:35:23 -08:00
Thomas Goyne 5f1f84ec32 Include default config before aegisub.props so that it actually works 2012-11-12 18:35:23 -08:00
Thomas Goyne c4daf53030 Remove logic to create the default config file 2012-11-12 18:35:23 -08:00
Thomas Goyne 45ff83637a Rearrange the build settings a bit and add update checker settings 2012-11-12 18:35:23 -08:00
Thomas Goyne b7e7a9054c Remove FinalRelease config setting 2012-11-12 18:35:23 -08:00
Thomas Goyne 5db559265f Drop support for config_windows.h 2012-11-12 18:35:23 -08:00
Thomas Goyne 0aba5206c0 Normalize whitespace in Aegisub.targets 2012-11-12 18:35:23 -08:00
Thomas Goyne f1ef0582cb Update Aegisub project 2012-11-12 18:35:23 -08:00
Thomas Goyne 1531ef88bd Visual Studio 2012 compilation fixes
VS11 only defines pseudo-variadic template stuff for up to 5 arguments,
so use lambdas rather than bind.
2012-11-12 18:35:23 -08:00
Thomas Goyne f3d32c6726 Increase memory limit for precompiled header compilation 2012-11-12 18:35:23 -08:00
Thomas Goyne 67af6f89a8 Fix Aegisub source directory path 2012-11-12 18:35:22 -08:00
Thomas Goyne 8c3f556387 Remove SubWCRev build step 2012-11-12 18:35:22 -08:00
Thomas Goyne b2a5fe406c Unconditionally enable Lua and Hunspell 2012-11-12 18:35:22 -08:00
Thomas Goyne 71af4127ce Add error checking to respack 2012-11-12 18:35:22 -08:00
Thomas Goyne 08eb738de5 Update libresrc project 2012-11-12 18:35:22 -08:00
Thomas Goyne 98cf1b7350 Update respack project 2012-11-12 18:35:22 -08:00
Thomas Goyne c2510b1ef0 Remove explicit references to libraries and use project references instead 2012-11-12 18:35:22 -08:00
Thomas Goyne fc7d50dfb5 Update CSRI source path 2012-11-12 18:35:22 -08:00
Thomas Goyne e5a852fc0c Update hunspell project 2012-11-12 18:35:22 -08:00
Thomas Goyne 0905290acc Add ipch to .gitignore 2012-11-12 18:35:22 -08:00
Thomas Goyne 6c23f14c81 Fix the default Aegisub source base 2012-11-12 18:35:22 -08:00
Thomas Goyne 2cf834806e Update libaegisub project 2012-11-12 18:35:21 -08:00
Thomas Goyne 7230afc3cf Update iconv project 2012-11-12 18:35:21 -08:00
Thomas Goyne a9bc2c99a7 Update lua project 2012-11-12 18:35:21 -08:00
Thomas Goyne e259418190 Add lib and obj dirs to .gitignore 2012-11-12 18:35:21 -08:00
Thomas Goyne 9b4fd7a051 Update universalchardet project 2012-11-12 18:35:21 -08:00
Thomas Goyne c41468354a Convert msbuild projects to vs 2012 format 2012-11-12 18:35:21 -08:00
Thomas Goyne e0f16da866 Move msbuild stuff to top level build folder 2012-11-12 18:35:21 -08:00
Thomas Goyne b4c71e4673 Delete vs2008 build system 2012-11-12 18:35:21 -08:00
Thomas Goyne 1848aad5c1 Fix compilation with C++ 11/libc++ 2012-11-12 18:35:21 -08:00
Thomas Goyne ebd56f2163 Include cstdint rather than stdint.h 2012-11-10 18:05:57 -08:00
Thomas Goyne 0893ed3f0a Remove references to tr1 2012-11-10 18:05:57 -08:00
Thomas Goyne 4500edef39 Build as C++11 on non-windows 2012-11-10 18:05:57 -08:00
Thomas Goyne fdeb661a79 Bump required OS X version to 10.7 for libc++ 2012-11-10 18:05:57 -08:00
Thomas Goyne 13b83b0996 Use libc++ when it's available 2012-11-10 18:05:57 -08:00
Thomas Goyne b077c0991b Move the split line at cursor functionality to commands 2012-11-10 18:05:57 -08:00
Thomas Goyne 9d4be82be8 Replace syntax highlighting logic with new stuff in libaegisub 2012-11-10 18:05:57 -08:00
Thomas Goyne 76adcad999 Move the spellchecker base class to libaegisub 2012-11-10 18:05:57 -08:00
Thomas Goyne 47bafe4b9f Add a lexer for the body of dialogue lines to libaegisub 2012-11-10 18:05:56 -08:00
Thomas Goyne bd78692148 Use wxSTC::GetTextRaw rather than converting utf-8 -> wxString -> utf-8 2012-11-10 18:05:56 -08:00
Thomas Goyne 9088ae994c Remove windows.h from the precompiled header
It's only used by a few source files and it defines a ton of garbage.
2012-11-10 18:05:56 -08:00
Thomas Goyne 08983adc96 Move agi::Color parsing to its own file
Keeping all uses of boost.spirit in a single translation unit helps
avoid having it murder compile times, which requires that it be off by
itself.
2012-11-10 18:05:56 -08:00
Thomas Goyne ea5428b65f Replace AssColor with agi::Color
Add agi::Color, and replace AssColor and all uses of wxColor that are
not immediately passed to/from wx with it.
2012-11-10 18:05:56 -08:00
Thomas Goyne 83761d881a Convert AssFile::Line to an intrusive list
Gives O(1) pointer -> iterator conversions, better memory usage, better
performance, and overall slightly simplifies the code using it.
2012-11-10 18:05:56 -08:00
Thomas Goyne 28175aadbe Switch to boost.container for containers of incomplete types
STL containers are not required to support incomplete types, and while
most implementations do, clang's libc++ does not.
2012-11-10 18:05:56 -08:00
Thomas Goyne dfa4f33f25 Add boost check to configure 2012-11-10 18:05:56 -08:00
Thomas Goyne 59eae9ab85 Store the lines in LuaAssFile in a vector
This makes the implementation better match the exposed interface and
simplifies some of the code.
2012-11-10 18:05:55 -08:00
Thomas Goyne 10f0f5fc7b Kill AssFile::AddComment and just add it when writing the file 2012-11-10 18:05:55 -08:00
Thomas Goyne a51b3d8d7f Handle errors which occur in the progress dialog worker thread 2012-11-10 18:01:22 -08:00
Thomas Goyne ed43623743 Create well-formed ASS when reading SRT-in-Matroska
The conversion to ASS was creating invalid lines which could not be
parsed, resulting in the worker thread crashing.

Closes #1554.
2012-11-10 18:01:20 -08:00
Thomas Goyne 6b0ea92f8e Actually read dialogue lines from SRT-in-Matroska
Pass the ASS parser a [Events] line before feeding it dialogue lines so
that the dialogue lines are parsed as such rather than as script info
lines.

Updates #1554.
2012-11-10 18:01:18 -08:00
Thomas Goyne 8701d7cdb1 Add Malay to the spellchecker language list. Closes #1552. 2012-11-03 16:08:36 -07:00
ZHAOLI 776b080564 Update Simplified Chinese translation. Closes #1550. 2012-11-03 15:57:24 -07:00
Thomas Goyne b006bcc8c4 Commit pending audio changes on Enter in the edit box. Closes #1544. 2012-11-03 15:57:24 -07:00
Thomas Goyne 6c2ccd8639 Don't display an error when opening read-only formats 2012-10-29 06:29:45 -07:00
Thomas Goyne b5baacec2c Fix merge error in df60c2e7a4
Although wxSTC defines SetValue, it doesn't actually work correctly.
2012-10-28 07:20:12 -07:00
Thomas Goyne 0e7501f45c Fix some cases where the detached video dialog would get set to bogus sizes
At very large and very small sizes, setting the window's size with
SetSize may not actually result in the window changing to the requested
size.  Once this happened future adjustments to the size were incorrect,
and the video display would sometimes not fit in the window, and on os x
the window could get set to a negative size, with weird results.
2012-10-27 20:44:09 -07:00
Thomas Goyne f35e10c76a Decode the autosave path when cleaning up old files 2012-10-27 19:26:45 -07:00
Thomas Goyne a266d32ce4 Remove pointless GetString override in the list option values 2012-10-27 05:54:50 -07:00
Thomas Goyne 99a20e4d1c Move InvalidMarginIdError to ass_dialogue.h 2012-10-26 17:26:53 -07:00
Thomas Goyne ce05857bfa Use std::tr1::array for AssStyle::Margin
This eliminates the need for an explicit operator= on AssStyle.
2012-10-26 17:26:53 -07:00
Thomas Goyne e0705f1c84 Fix a capitalization error in Info.plist. Closes #1547. 2012-10-25 17:39:50 -07:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne df60c2e7a4 Factor out a bunch of duplicated code for clipboard stuff 2012-10-25 17:39:49 -07:00
Thomas Goyne ff6394c95e Throw only real exceptions from subtitle io stuff 2012-10-25 17:39:49 -07:00
Thomas Goyne 78b70e987e Disable Ubuntu's global menu bar for Aegisub
wxWidgets currently doesn't generate menu open or update events for the
Ubuntu menubar (since GTK doesn't send the relevant signals to the
application), which we rely on.

Updates #1531.
2012-10-25 17:39:49 -07:00
Thomas Goyne 67c01d11f6 Delete unfinished and unused stuff from libaegisub 2012-10-25 17:39:49 -07:00
Thomas Goyne 56ced22c63 Mark autosave files with the current date and time
This makes it so that autosave files are (almost) never overwritten, so
that opening an old version of the file won't result in the autosaves
from a newer version being replaced.

Clean up old autosave files on startup to limit the total to 100
files/100 MB. Maybe make this configurable in the future?

Closes #1155.
2012-10-25 07:50:31 -07:00
Thomas Goyne 820732b97e Add i386 to the supported architectures in the plist 2012-10-22 10:10:20 -07:00
Thomas Goyne decbf06de3 Timestamp temporary files to reduce the chance of name collisions 2012-10-21 15:29:52 -07:00
Thomas Goyne b43f27396e Verify that creating the temp file for saving actually succeeded 2012-10-21 15:29:52 -07:00
Thomas Goyne 715c882a97 Actually check MoveFileEx's return value 2012-10-21 08:13:46 -07:00
Thomas Goyne da79178cc9 Add _tmp before the extension when saving
This makes it easier to open the temporary file if an error occurs at
some point in the saving process.
2012-10-21 08:04:06 -07:00
Thomas Goyne c7fb6a57a4 Remove the platform-specific agi::io implementations since they were nearly identical 2012-10-21 08:00:02 -07:00
Thomas Goyne 40bb3b857e Allow scrolling the subtitles grid a page past the last row. Closes #888. 2012-10-20 08:26:38 -07:00
Thomas Goyne 7553534d96 Update all selected rows in the vector clip tool rather than just the active line 2012-10-20 08:07:15 -07:00
Thomas Goyne b74130579f Update all selected rows in the rectangular clip tool rather than just the active line 2012-10-20 07:59:07 -07:00
Thomas Goyne 6b3cfcebfd Change the Effect box to a combobox like the Actor box. Closes #1461. 2012-10-20 07:34:55 -07:00
Thomas Goyne bd3df29a1c Fix splitting lines by karaoke
New lines have to be committed before they can be selected.

Closes #1541.
2012-10-19 13:28:18 -07:00
Thomas Goyne 49a442bded Fix non-pch compilation 2012-10-19 08:57:56 -07:00
Thomas Goyne 8575fb9c87 Don't use wxRemoveFile in the cache cleaner
wxRemoveFile notifies the user of errors via a dialog box, and errors
when cleaning the cache are normally just due to two copies of Aegisub
trying to clean it at the same time.
2012-10-19 07:35:37 -07:00
Thomas Goyne 938ccfe39b Mark TimecodeRange::operator< as const 2012-10-16 15:53:49 -07:00
Thomas Goyne 30165e4392 Truncate syllables which extend past the end of the line rather than normalizing all of the syllable lengths 2012-10-16 14:29:31 -07:00
Thomas Goyne a267a15de0 Play right-clicked syllables when in karaoke mode 2012-10-16 14:08:20 -07:00
Thomas Goyne 7b3f2d0414 Remove pointless #pragma once from ass_file.h 2012-10-16 09:53:30 -07:00
Thomas Goyne 9547bc4ef2 Move some stuff from AssFile::Load to FrameMain::LoadSubtitles
This is still not a very good place for it, but AssFile really shouldn't
be mucking around in global program state.
2012-10-16 09:53:28 -07:00
Thomas Goyne a53432736c Get wxMessageBox out of AssFile 2012-10-16 09:52:47 -07:00
Thomas Goyne 33dd0abc7f Kill AssFile::GetWildcardList
It did not actually simplify or clarify any of the code that called it.
2012-10-16 09:52:47 -07:00
Thomas Goyne d3e2585faf Refactor AssParser so that AddLine is less of a monolithic monstrosity 2012-10-16 09:52:19 -07:00
Thomas Goyne 7e1bb8348a Move ASS parsing to its own class 2012-10-16 09:52:19 -07:00
Thomas Goyne c7fd04a739 Rename ASS -> Ass in symbol names
Most types and functions used Ass, but a decent number used ASS, so make
them consistent.
2012-10-16 09:52:19 -07:00
Thomas Goyne 006f820aea Move ass parsing logic from AssFile to ASSSubtitleFormat 2012-10-16 09:52:19 -07:00
Thomas Goyne 682c7d5371 Fix an occasional crash on startup on Windows debug builds
Some of the debug iterator code seems to not like 'delete map[key]', so
change things a little to do things in a way that appears to be fine.
2012-10-16 09:51:31 -07:00
Thomas Goyne 712a5e0d8b Skip unprocessed keydown events in the styling assistant so that typing style names actually works 2012-10-16 08:51:21 -07:00
Thomas Goyne ce89183b8c Remove config_unix.h from the vcproj 2012-10-15 18:16:09 -07:00
Thomas Goyne b52099f0fa Delete SubtitlesGrid::SetSelectionFromAbsolute and SubtitlesGrid::GetAbsoluteSelection
Nothing uses them anymore (and nothing should be using them).
2012-10-15 18:16:09 -07:00
Thomas Goyne 53433426bb Fix some stuff from Coverity Scan
Mostly just bugs in unreachable code and stylistic things, but there's a
few incorrect reachable things that were working by coincidence and
gratuitous dynamic_casts.
2012-10-15 18:16:09 -07:00
Thomas Goyne ccafd0be17 Update the selection correctly after setting a tag via the edit box buttons
The valid bounds for a selection are not updated until the contents of
the edit box are updated on commit, so set the selection after
committing rather than before.
2012-10-14 20:35:08 -07:00
Thomas Goyne be94ab70f4 Extract cut/copy/delete lines logic from SubtitlesGrid 2012-10-14 18:57:57 -07:00
Thomas Goyne 8aeb611745 Make the correct row visible when selecting rows with shift + arrow keys in the grid. Closes #1533. 2012-10-14 08:31:16 -07:00
Thomas Goyne b7e0af6bbb Delete BaseGrid::GetFirstSelRow() since it's no longer used by anything 2012-10-14 08:22:13 -07:00
Thomas Goyne a40b76ea59 Insert new lines before/after the active line rather than the first selected line 2012-10-14 08:21:41 -07:00
Thomas Goyne 610b2a9494 Make pasting lines not horribly slow and bad. Closes #1534. 2012-10-13 21:32:26 -07:00
Thomas Goyne 7410e37e07 Fix some places where the margin count wasn't updated when removing ASS2 support 2012-10-12 14:54:09 -07:00
Thomas Goyne afd24913d6 Fix find/replace derp 2012-10-12 14:54:09 -07:00
Thomas Goyne cc3ca715a1 Set the focus to the edit box after any of the edit box buttons are clicked 2012-10-12 14:54:09 -07:00
Thomas Goyne daf28e2005 Use the native placeholder text functionality on OS X 2012-10-12 14:54:09 -07:00
Thomas Goyne 7ca2c5cb65 Actually set the correct color tags from the color picker buttons 2012-10-12 14:54:09 -07:00
Thomas Goyne a1fad1f947 Drop support for ASS2
It is very unlikely that anyone has ever actually used ASS2 for
anything, and in practice it was not usable anyway as the bottom margin
was always either ignored or blindly overwritten.
2012-10-12 14:54:08 -07:00
Thomas Goyne 983d0b19eb Add default hotkeys for the color buttons 2012-10-12 14:54:08 -07:00
Thomas Goyne b3486440f3 Show the hotkeys for the edit box buttons in the tooltip 2012-10-12 14:54:08 -07:00
Thomas Goyne 1b68790c4b Convert the subs edit box buttons to commands
This makes they hotkeyable and extracts a large chunk of logic from the
giant mess that is SubsEditBox.
2012-10-12 14:54:08 -07:00
Thomas Goyne 44f0fcce07 Go through TextSelectionController rather than hitting the text edit directly in SubsEditBox 2012-10-12 14:54:08 -07:00
Thomas Goyne a948924850 Add a TextSelectionController interface to avoid exposing the wxSTC edit directly in the context 2012-10-12 14:54:08 -07:00
Thomas Goyne 1c2ec34cb1 Bump version number in installer to 3.1.0 2012-10-12 14:54:08 -07:00
Thomas Goyne 93a567e800 Update hunspell from 1.2.1 to 1.3.2 2012-10-12 14:54:08 -07:00
Thomas Goyne e4a6092b36 Use signals for selection change notifications 2012-10-12 14:54:07 -07:00
Thomas Goyne a0c92f83f9 Fix some PVS-Studio warnings 2012-10-12 14:51:30 -07:00
Thomas Goyne 189615bf48 Don't use a full-size subbitmap for icons for no apparent reason 2012-10-12 14:51:30 -07:00
Thomas Goyne 7d2da48ddb Remove config_unix.h since the things it was working around were fixed years ago 2012-10-12 14:51:30 -07:00
Thomas Goyne e42cbe5cd3 Enable HiDPI on OS X
Everything but the audio and video displays and toolbar icons just work,
and they're not too hideously ugly.
2012-10-12 14:51:29 -07:00
Thomas Goyne fc01b8bafe Delete the freetype fonts collector
It's pretty horribly broken and fixing it would essentially consist of
rewriting fontconfig.
2012-10-12 14:51:29 -07:00
Thomas Goyne 2dcbf77e29 Use printf rather than echo -n in autogen.sh 2012-10-12 14:51:29 -07:00
Thomas Goyne a3ff3e966d Bump version to 3.1 2012-10-12 14:51:29 -07:00
Thomas Goyne 67af44b889 Fix compilation with no audio players enabled 2012-10-12 14:51:29 -07:00
Thomas Goyne d0a7388581 Remove ifdef checks for header inclusion in audio_player.cpp as the headers themselves have the checks 2012-10-12 14:51:29 -07:00
Thomas Goyne 95a1b7e9b5 Remove AudioPlayer::OpenStream and CloseStream
Instead, just pass the provider to the constructor and let the player
worry about when to create its things. The ability to explicitly open
and close the playback wasn't actually required for anything, and it
complicated the implementations of the players.
2012-10-12 14:51:29 -07:00
صفا الفليج 6e90d9498d Add partial Arabic translation. Updates #1532. 2012-10-12 14:44:13 -07:00
Thomas Goyne 79ef194238 Fix compilation error with clang 2012-10-12 14:36:29 -07:00
Yuri ab47cfa1a5 Update Hungarian translation 2012-10-12 14:11:32 -07:00
doplank c3f56fe5d7 Update Indonesian translation 2012-10-12 14:11:02 -07:00
Thomas Goyne 863e041d4d Honor the configured MRU limits
Actually use the limits set in the preferences dialog rather than always
limiting the MRU lists to 16.

Currently only the Find and Replace limits can be set to above 16 due to
how the open recent items commands are implemented.

Closes #1528.
2012-10-11 10:19:49 -07:00
Thomas Goyne e5251544ea Don't save separate wavs for each selected line
Instead, save a single wav spanning the full range of all selected
lines.
2012-10-11 09:41:25 -07:00
Adam Rambousek 254e7564e1 Update Czech translation 2012-10-10 19:49:10 -07:00
Thomas Goyne f691335e3b Run the icons through ImageOptim
Knocks 70 KB off the total size.
2012-10-10 18:49:19 -07:00
Thomas Goyne a7bb608a34 Mark Command::Icon as const 2012-10-10 18:48:47 -07:00
Thomas Goyne 50b70f6979 Remove DOCME placeholders from AssDialogue 2012-10-10 18:48:39 -07:00
Thomas Goyne 9009c963e3 Fix rounding errors that resulted in karaoke syllables drifting 2012-10-09 20:40:49 -07:00
Thomas Goyne 004b41f0eb Switch the Duration field back to time mode when video is closed 2012-10-09 20:40:47 -07:00
Thomas Goyne 05e4a237cb Fix a few errors in the German translation. Closes #1523. 2012-10-09 15:37:21 -07:00
Thomas Goyne 2dc7366871 Delete aegisub.desktop on distclean rather than clean since it's generate at configure time 2012-10-09 15:29:13 -07:00
Thomas Goyne 89d7e0a321 Allow framerate transform to/from variable without external timecodes loaded
This is a potentially sensible operation (to convert from VFR to/from
the video's average FPS), so there's no reason to require that the input
and output timecodes be from different places.

Closes #1530.
2012-10-09 09:20:35 -07:00
Thomas Goyne a56bf25d00 Actually load the fontconfig config file in the fonts collector on OS X 2012-10-09 09:20:34 -07:00
Thomas Goyne f7ff76a251 Set datarootdir 2012-10-09 07:30:27 -07:00
Thomas Goyne 269dd79230 Increase the undo-group-breaking timer to 30 seconds (from 10) 2012-10-09 07:28:16 -07:00
Thomas Goyne 28e041de6f Bump version number in installer to 3.0.2 2012-10-08 14:06:37 -07:00
Thomas Goyne b44d53c227 Don't install the somewhat out-of-date automation design docs. Updates #1135. 2012-10-08 14:01:05 -07:00
Thomas Goyne 49184f2d0e Honor docdir and localedir configure variables. Updates #1135. 2012-10-08 14:00:45 -07:00
Thomas Goyne a13d06318b Remove all glu.h includes since no glu functions are ever used. Updates #1511. 2012-10-08 10:21:20 -07:00
Thomas Goyne db30fdedbd Use the correct option name for reporting the user's UI language 2012-10-07 19:55:26 -07:00
Xabier Aramendi (Azpidatziak) 695de800c3 Update Basque translations. Updates #1499. 2012-10-07 19:28:46 -07:00
Lasse Liehu 7c990ecd7e Update Finnish translation. Updates #1522. 2012-10-07 19:28:36 -07:00
Thomas Goyne 0f90f8a627 Delete svn-revision-base.h 2012-10-07 09:03:44 -07:00
Thomas Goyne 07257e1bb3 Fix non-precomp header compilation 2012-10-06 09:39:44 -07:00
Daniel Mota 4a62073df0 Fix some errors in the Portuguese Translation 2012-10-06 08:46:37 -07:00
Thomas Goyne 846449cb03 Center the audio display when a line is within 5% of an edge as 2.1 did 2012-10-06 08:46:10 -07:00
Thomas Goyne 8d89e8c268 Bump version number in installer to 3.0.1 2012-10-05 08:21:40 -07:00
Thomas Goyne de862cb6e8 Remove the correct syllable split on a click on the left side of the split line 2012-10-05 08:21:40 -07:00
Thomas Goyne 5cdcd3dcb3 Increase the hit area for removing syllable splits a little 2012-10-05 08:21:40 -07:00
Thomas Goyne d0a9f3f7cd Change the karaoke split cursor color to indicate whether it'll add or remove a split 2012-10-05 08:21:40 -07:00
Thomas Goyne 1cd9f2dcf2 Add a default hotkey for "audio/play/line" 2012-10-04 16:56:02 -07:00
Thomas Goyne d97ad27354 Add the play line button to the audio toolbar 2012-10-04 16:49:55 -07:00
Thomas Goyne 44468fbd3d Add "audio/play/line" command 2012-10-04 16:48:35 -07:00
Thomas Goyne 2db488ee81 Update Greek translation. Closes #1526. 2012-10-04 15:59:02 -07:00
Thomas Goyne 050721a90d Update Russian translation. Closes #1525. 2012-10-04 13:02:24 -07:00
Thomas Goyne 7343392823 Don't use StandardPaths before OnInit is called
AegisubLocale is created extremely early in the application
initialization, and using StandardPaths in its constructor resulted in
?user being set to an incorrect value as the app name hadn't been set
yet.
2012-10-04 12:58:01 -07:00
Thomas Goyne 662cf01493 Remove solidbreak from installer flags since there's no longer optional components 2012-10-04 11:33:58 -07:00
Thomas Goyne 782c6310f3 Don't include glu.h in the precompiled header since it's never actually used 2012-10-03 15:58:14 -07:00
Thomas Goyne 2c4de3a635 Remove unused things from osx-bundle.sed.in 2012-10-02 16:06:05 -07:00
Thomas Goyne 0e3fabddfa Set the plist version correctly 2012-10-02 16:06:05 -07:00
Thomas Goyne f3f9d2c34d Also convert sr_RS to sr_YU in the plist on OS X 2012-10-02 16:06:05 -07:00
Thomas Goyne 4e723184a1 Put the Serbian translation in the right place on windows. Closes #1325. 2012-10-02 16:06:05 -07:00
Thomas Goyne 86a39cc9ac Update config.guess and config.sub to a version that isn't close to a decade old 2012-10-02 16:06:05 -07:00
Thomas Goyne 1f6a6087c6 Remove waf build system since it's pretty out of date 2012-10-02 16:06:05 -07:00
Thomas Goyne 21c2259d94 Rename configure.in to configure.ac 2012-10-02 16:06:05 -07:00
Thomas Goyne 40f97dbfea Redesign AegisubLocale
Use wxTranslations directly rather than going through wxLocale. This
significantly simplifies the code, eliminates the hardcoded list of
languages for non-windows, and makes it possible to use mismatched
languages and locales.

Closes #1508.
2012-10-02 16:06:05 -07:00
Thomas Goyne 0346fbf715 Remove all optional components from the installer other than icons
There's really no reason to present the user with a giant list of
checkboxes that lets them unselect at most a few megabytes of local
files.
2012-10-02 12:56:35 -07:00
Thomas Goyne 8fad077e88 Don't ignore loaded timecodes when converting frames to times for the subtitle renderer 2012-10-02 12:56:19 -07:00
Thomas Goyne 57a253004d Scroll the audio display after a click near an edge
When auto scrolling is enabled, scroll the audio display after a click
near an edge to mimic the effect of scrolling to show the new audio
selection (as 2.1.9 did), but hopefully without all the weird
undesirable cases that had.
2012-10-02 08:09:33 -07:00
Thomas Goyne 05f5d37576 Split AudioDisplay::OnMouseEvent into several methods 2012-10-02 07:40:50 -07:00
Thomas Goyne 3d3a74c5d2 Audio display cosmetics 2012-10-02 07:27:52 -07:00
Thomas Goyne 55bdbf8d48 Add scroll arrows to the karaoke syllable bar when the contents are too wide to fit. Closes #1516. 2012-10-01 16:55:20 -07:00
Thomas Goyne b020322a3a Update the size of the karaoke syllable bar when the window is resized. Updates #1516. 2012-10-01 15:38:02 -07:00
Thomas Goyne 1b089795f1 Also stop the video when stopping audio playback as 2.1.9 did. Closes #1515. 2012-10-01 10:28:42 -07:00
Thomas Goyne 0d844de245 Fix an error in the Portuguese translations 2012-10-01 09:37:46 -07:00
Thomas Goyne 0a5fa6ff39 Don't use ARC in the Obj-C++ code
It never allocated any non-autoreleased objects so ARC wasn't actually
doing anything other than breaking compilation with gcc.
2012-09-29 22:10:45 -07:00
Thomas Goyne afe0213317 Delete most of the dictionary installers and replace them with a shell script 2012-09-29 21:46:09 -07:00
Thomas Goyne 0c3d321124 Remove the .x from 3.0.x in the dictionary installers 2012-09-29 21:46:09 -07:00
Thomas Goyne 25e65237cd Mark "Action" as translatable in the fonts collector dialog
Fortunately "Action" is also used in the select lines dialog so it's
already present in the translations.
2012-09-27 17:10:33 -07:00
Thomas Goyne 17295357e2 Update Indonesian translation 2012-09-25 09:37:49 -07:00
Thomas Goyne 08c9781dfb Actually modify the line time when applying lead-in/out in karaoke mode 2012-09-24 18:56:49 -07:00
Thomas Goyne 7433b814a7 Modify the first syllable when normalizing karaoke syllable lengths 2012-09-24 18:46:15 -07:00
Thomas Goyne 85f2774033 Report the user's UI language in addition to the system language to the update checker 2012-09-24 13:00:52 -07:00
Thomas Goyne ccf3e94d96 Bundle the Serbian translation as sr_YU on OS X as it doesn't have sr_RS 2012-09-23 08:20:24 -07:00
Thomas Goyne 68fcf90de5 Update Serbian translation 2012-09-23 08:20:23 -07:00
Thomas Goyne 51e23a3c7e Remove the period from the catalog name since gettext seems to not like it 2012-09-22 21:29:44 -07:00
Thomas Goyne 39bf2ab5fd Don't list languages in the language dialog which won't actually work. Updates #1508. 2012-09-22 09:51:39 -07:00
Thomas Goyne 9a6eb70f12 Try to find an English locale ID which is available
wxLANGUAGE_ENGLISH corresponds to the "en" locale on Linux, which is
generally not installed, which resulted in English actually being the
system default locale.

Updates #1508.
2012-09-22 09:42:32 -07:00
Thomas Goyne c4f6e729f9 Add missing period in 2.35 in a string that probably isn't actually visible anywhere 2012-09-21 18:13:10 -07:00
Thomas Goyne 6943b868da Handle file not found errors when opening linked audio from subtitles 2012-09-21 18:07:30 -07:00
Thomas Goyne ffab39b21f Don't automatically load audio from video if audio from that file is already open 2012-09-21 17:58:22 -07:00
Thomas Goyne d66c8709ae Update Portuguese translation 2012-09-16 19:18:33 -07:00
Thomas Goyne 7b5bb6f57a Add missing languages to the hardcoded list for non-windows 2012-09-16 19:12:05 -07:00
Thomas Goyne 9c9413a209 Update Portuguese translation 2012-09-16 19:08:07 -07:00
Thomas Goyne ef99f77087 Make the open/save keyframes dialog title translatable 2012-09-16 18:52:50 -07:00
Thomas Goyne d2f724afa5 Update Spanish translation 2012-09-14 19:32:23 -07:00
Thomas Goyne 9048d8a59a Fix compilation failure in it.po 2012-09-14 07:55:36 -07:00
Thomas Goyne 2c2f60d4e0 Fix completely incorrect behavior when AR changing is enabled in the resolution resampler 2012-09-14 07:55:31 -07:00
Thomas Goyne e552dc4c9c Remove some dead assigns 2012-09-14 07:55:01 -07:00
Thomas Goyne f3fe0b6a0b Update German translation 2012-09-11 09:20:32 -07:00
Thomas Goyne 429dfe08b6 Update Italian translation 2012-09-10 17:45:29 -07:00
Thomas Goyne d0de419e21 Bump copyright year in dictionary installers 2012-09-07 17:11:53 -07:00
Thomas Goyne 3dcb553203 Add installer for Basque dictionaries 2012-09-07 17:10:47 -07:00
Thomas Goyne 14457fb87e Update Euskara (Basque) translation 2012-09-07 08:04:21 -07:00
Thomas Goyne 32560df6be Update French translation 2012-09-07 07:31:05 -07:00
Thomas Goyne 9ae6e3c538 Fix compilation with precompiled headers disabled 2012-09-06 08:25:38 -07:00
Thomas Goyne 0d1ffbbdf7 Update manual URL 2012-09-03 17:28:45 -07:00
Thomas Goyne 598d3d77e6 Modify aegisub_convert_docs.pl to produce a static mirror suitable for serving on a web site 2012-09-03 17:26:49 -07:00
Thomas Goyne 1c9af767e5 Move audio decode error handling to GetAudio
Errors when not getting with volume need to be handled too.

Updates #1509.
2012-09-01 21:45:18 -07:00
Thomas Goyne e995cd2616 Don't stop video playback when undoing or redoing changes 2012-09-01 21:45:17 -07:00
Thomas Goyne 4d15df51f5 Fix the hash of the last SVN revision 2012-08-26 19:19:44 -07:00
Thomas Goyne 9f8e25ed0a Force LC_CTYPE to en_US.UTF-8 on OS X
When run from an app bundle the locale environment variables are unset,
and the default locale settings are bogus as a result.
2012-08-26 19:15:48 -07:00
Thomas Goyne 4cb5d411b3 Mark Aegisub as x86_64 rather than i386 2012-08-26 19:15:47 -07:00
Thomas Goyne 9d5d82fc42 Declare Aegisub as the Owner for .ass and .ssa 2012-08-26 19:15:46 -07:00
Thomas Goyne ca4c29a9f4 Fix tests linking with static libaegisub 2012-08-26 19:15:42 -07:00
Thomas Goyne 748ca154b6 Add a BOM to fragment_Translation.iss so that iscc uses the right charset 2012-08-26 19:15:27 -07:00
Thomas Goyne 09962a56d1 Use the last valid mouse position for VideoDisplay::GetMousePosition
On Windows opening the context menu triggers a mouse leave event, which
invalidates the current mouse position, so the Copy coordinates to
Clipboard command didn't work.
2012-08-25 18:33:46 -07:00
Thomas Goyne fd447927d5 Bump copyright year in installer to 2012 2012-08-21 07:06:20 -07:00
Thomas Goyne 54c4e4ab6e Make building the reporter optional
It's not actually useful for anything and it drags in cURL as a dependency.
2012-08-21 07:02:51 -07:00
Thomas Goyne b0036b4d99 Statically link libaegisub
Dynamically linking it caused a steady stream of issues for no apparent
benefits.
2012-08-21 07:02:45 -07:00
Thomas Goyne 4208fa362c Fix stack check failure when a script fails to load in a debug build 2012-08-19 20:32:18 -07:00
Thomas Goyne 1e030289ad Revamp how version tagging works
Rather than having it be a configurable option, simply build in final
release mode if Aegisub is being built from a signed tag, and get the
version information from that tag.

Drop the version number from the OS X app bundle when not building from
a tag as it done everywhere else. Drop the arch suffix since ppc hasn't
been tested in years and isn't worth testing as it's only going to get
less relevant as time goes on.

Remove some redundant definitions in the build system.
2012-08-19 14:33:50 -07:00
Thomas Goyne 42a016a83b Update the revision checks to work with a pure-git repo 2012-08-19 14:05:38 -07:00
Thomas Goyne fd6652b345 Delete stuff that's been split into their own repos 2012-08-19 20:43:40 -07:00
Thomas Goyne 1f07735f6f Add .gitignore 2012-08-19 20:43:39 -07:00
Thomas Goyne 16cd907fe7 Add a BOM to all of the lua files since they're no longer assumed to be UTF-8
Originally committed to SVN as r6962.
2012-08-19 20:43:39 -07:00
Thomas Goyne 18db0b09ac Log audio decoding errors
Originally committed to SVN as r6961.
2012-08-19 14:11:29 -07:00
Thomas Goyne 79684d5ad6 Factor out bounds-checking for GetAudio to a single place
It was being done in inconsistent ways in several places, which did not
include all of the places it needed to be done.

Closes #1509.

Originally committed to SVN as r6960.
2012-08-19 14:11:29 -07:00
Thomas Goyne 037d385419 Guard uses of audio providers with a mutex when not using a cache as they aren't thread-safe. Updates #1509.
Originally committed to SVN as r6959.
2012-08-19 14:11:29 -07:00
Thomas Goyne 5a38d69921 Open files as binary in TextFileReader
Text mode does undesirable things like stopping when it hits an EOF
byte, which can be a valid part of a UTF-16 character, and line_iterator
handles stripping \r anyway.

Originally committed to SVN as r6958.
2012-08-19 14:11:29 -07:00
Thomas Goyne e774902a29 Always write a newline at the end of ASS files
Originally committed to SVN as r6957.
2012-08-19 14:11:29 -07:00
Thomas Goyne b265d1fa0e Actually set the actor when reading from txt files
Originally committed to SVN as r6956.
2012-08-19 14:11:29 -07:00
Thomas Goyne d132364025 Fix check for OS X version in the update checker
Originally committed to SVN as r6955.
2012-08-19 14:11:28 -07:00
Thomas Goyne 21841e84a8 Get the locale name for OS X from CF rather than wx
Originally committed to SVN as r6954.
2012-08-19 14:11:28 -07:00
Thomas Goyne f2035d76fc Don't block the source of a drag-and-drop while the dropped audio/video are loading
Originally committed to SVN as r6953.
2012-08-04 16:31:44 +00:00
Thomas Goyne b86a1bfb2d Fix compilation with wx 2.9.4 with 2.8 compatibility enabled. Closes #1504.
Originally committed to SVN as r6952.
2012-08-03 02:32:30 +00:00
Thomas Goyne e2e304f2cb Don't try to shift to a negative start time when shifting lines to frame zero
Originally committed to SVN as r6951.
2012-07-29 03:23:27 +00:00
Thomas Goyne ffe41cdf20 Don't discard frames which are decoded before the video display becomes visible
Originally committed to SVN as r6950.
2012-07-29 03:23:24 +00:00
Thomas Goyne 8c42f09235 Don't pass size_t to wxString::Format since there's no portable specifier for it
Originally committed to SVN as r6949.
2012-07-24 02:40:39 +00:00
Thomas Goyne 8ba149a7e6 Actually save the video zoom to the subtitles file
Originally committed to SVN as r6948.
2012-07-24 02:40:37 +00:00
Thomas Goyne 65d3c4cc2d Save keyframe and timecode file names even if video isn't loaded
Originally committed to SVN as r6947.
2012-07-24 02:40:34 +00:00
Thomas Goyne de7dd7e07f Use the video AR from the script rather than the video's AR when opening linked video
Originally committed to SVN as r6946.
2012-07-24 02:40:31 +00:00
Thomas Goyne 269a206053 Fix loading linked audio when automatic opening of audio from video is enabled
Originally committed to SVN as r6945.
2012-07-24 02:40:29 +00:00
cantabile 7bd7ef7cd6 Shift times: Make Enter in the time edit do the same as clicking OK
Originally committed to SVN as r6944.
2012-07-24 02:39:40 +00:00
cantabile 5ecb89eeec Shift times: Use TimeEdit::SetTime() instead of TimeEdit::SetValue()
TimeEdit::SetValue() will trigger TimeEdit::OnModified(), but that
doesn't always update the internal "time" property.
TimeEdit::OnModified() seems to be designed to handle editing the value
with the keyboard, not with SetValue().

Originally committed to SVN as r6943.
2012-07-24 02:39:37 +00:00
cantabile 3193e05747 Use correct format specifier in AssColor::GetSSAFormatted()
Avoids a ton of assertion failures when saving SSA files.

Originally committed to SVN as r6942.
2012-07-24 02:39:35 +00:00
cantabile ef65262920 SRTSubtitleFormat: don't mix line endings in non-Windows
Originally committed to SVN as r6941.
2012-07-24 02:39:32 +00:00
Thomas Goyne b2fb39b67f Fix leak of the Indexer when an audio/video file has already been indexed
Originally committed to SVN as r6940.
2012-07-23 00:44:47 +00:00
Thomas Goyne 11a4ede9a0 Add Layer to the things lines can be sorted by
Originally committed to SVN as r6939.
2012-07-23 00:44:44 +00:00
Thomas Goyne f3a935c985 Install all of the automation scripts
Originally committed to SVN as r6938.
2012-07-22 23:56:49 +00:00
Thomas Goyne ef3e75dbe9 Pass the row length rather than frame width to OpenGL for the unpack row length
Originally committed to SVN as r6937.
2012-07-21 03:50:38 +00:00
Thomas Goyne 556f0514c2 Fix crash in the Kanji timer when the source begins with whitespace and the dest is empty
Originally committed to SVN as r6936.
2012-07-21 03:50:35 +00:00
Thomas Goyne 291a4050d8 Fix manual path generation
Originally committed to SVN as r6935.
2012-07-14 16:54:15 +00:00
Thomas Goyne 1ff1a57bdc Regenerate aegisub.pot
Originally committed to SVN as r6934.
2012-07-14 16:54:12 +00:00
Thomas Goyne 38217c6c59 Implement the timing adjustment commands
Originally committed to SVN as r6933.
2012-07-14 13:35:15 +00:00
Thomas Goyne 60c38bd2e5 Fix potential crash when deleting lines with audio open
Don't assume that the active line is valid in RegenerateInactiveLines,
as it may get called by the commit signal before the selection is
updated when the active line is deleted.

Closes #1502.

Originally committed to SVN as r6932.
2012-07-08 23:22:27 +00:00
Thomas Goyne 5162c28684 Check for audio hotkeys in both key down and char hook
wx doesn't call the keyboard hook when a window has capture, which
results in hotkeys not working while a mouse button is held down. This
usually doesn't matter much, but in the audio display one might want to
play audio while moving a marker. In general checking for hotkeys in
keydown doesn't work, but in the specific cast of marker dragging
keyboard focus is guaranteed to be on the audio display so it works out.

Originally committed to SVN as r6931.
2012-07-08 23:22:25 +00:00
Thomas Goyne 4e53ab3eab Remove the uses of wxNumberFormatter
We currently require mismatched locales for non-English since we don't
distinguish between locale-independent things like the config file and
UI things, which wxNumberFormatter barfs on.

Originally committed to SVN as r6930.
2012-07-06 02:14:46 +00:00
Thomas Goyne 8244271508 Use curl to fetch updates on OS X
The update checker sometimes triggers crashes on startup on OS X when
trying to release the CFSocket, so hopefully sidestep whatever the issue
is by just using curl to retrieve the update list.

Originally committed to SVN as r6929.
2012-07-05 23:05:37 +00:00
Thomas Goyne 3dc9e4fbea Don't try to set the zoom dropdown selection if it'd be out of bounds
Originally committed to SVN as r6928.
2012-07-05 23:05:34 +00:00
Thomas Goyne 2fb6b19e45 Destroy the old video context when detaching video
It was previously not being destroyed until video was reattached, which
wasted VRAM and caused problems on OS X.

Originally committed to SVN as r6927.
2012-07-04 15:30:21 +00:00
Thomas Goyne f90d7a56fa Mostly rewrite the VideoDisplay sizing logic
Fixes layout errors after maximizing when the window previously wasn't
big enough to fit the video and an infinite loop caused by wxGTK not
updating the window size immediately.

Makes it so that the bottom video toolbar is not pushed offscreen by
high video zoom. This is not always desirable, but should be an
improvement in most cases.

Closes #1409.

Originally committed to SVN as r6926.
2012-07-04 15:30:16 +00:00
Thomas Goyne a7b254e95f Use the user's ffms2 error handling mode when indexing video files to avoid reindexing when opening the audio
Originally committed to SVN as r6925.
2012-06-30 15:27:11 +00:00
Thomas Goyne fbd0681d2a Use the translated text for submenus
Originally committed to SVN as r6924.
2012-06-27 01:44:38 +00:00
Thomas Goyne 7bb1e10736 Add Basque translation by Xabier Aramendi. Closes #1499.
Originally committed to SVN as r6923.
2012-06-27 01:44:33 +00:00
Thomas Goyne 400520daa4 Fix handling of \N, \n and \h in the fonts collector
Originally committed to SVN as r6922.
2012-06-26 01:50:41 +00:00
Thomas Goyne 33f475ff3a Put VSFilter in the CSRI directory and also include xy-vsfilter in 32-bit builds
Originally committed to SVN as r6921.
2012-06-25 14:21:39 +00:00
Thomas Goyne 67686b1ad8 Copy mo files directly from the po folder for the installer
Originally committed to SVN as r6920.
2012-06-25 14:21:36 +00:00
Thomas Goyne e945c02151 Fix some warnings
Originally committed to SVN as r6919.
2012-06-25 14:21:32 +00:00
Thomas Goyne e4e80b4d3d Add a configure check for the pch flags as clang doesn't support -fpch-deps
Originally committed to SVN as r6918.
2012-06-23 17:22:08 +00:00
Thomas Goyne 4129051684 Add license headers to libresrc.(h|cpp)
Originally committed to SVN as r6917.
2012-06-23 01:06:43 +00:00
Thomas Goyne ed070b7b6a Wrap standard headers in libresrc.h with #ifndef AGI_PRE
Originally committed to SVN as r6916.
2012-06-23 01:06:40 +00:00
Thomas Goyne 257e25eb0e Make libresrc_getconfig less weird
Originally committed to SVN as r6915.
2012-06-23 01:06:38 +00:00
Thomas Goyne e99b1aaad4 Remove some pointess stuff in the icon code
Originally committed to SVN as r6914.
2012-06-23 01:06:35 +00:00
Thomas Goyne bfa3aba654 Don't try to use wxFileName::Exists with wx 2.9.3. Closes #1500.
Originally committed to SVN as r6913.
2012-06-23 01:06:32 +00:00
Thomas Goyne fd017b52ac Fix incorrectly positioned controls in the fonts collector dialog
The documentation claims that making things in static boxes children of
the static box is the right thing to do, but it's broken things a few
times now, so just make them children of the static box's parent.

Originally committed to SVN as r6912.
2012-06-21 04:32:10 +00:00
Thomas Goyne 7d2fb49828 Make the update checker configurable
Move the server and base url to the build-time configuration options and make
it disablable entirely.

Originally committed to SVN as r6911.
2012-06-21 02:09:40 +00:00
Thomas Goyne 87370eb9c0 Fix crash when clicking in the screen dropper area on Windows
Originally committed to SVN as r6910.
2012-06-17 20:22:38 +00:00
Thomas Goyne 9f7bdd8d17 Don't force ffms2 threads to 1 if it's recent enough
Originally committed to SVN as r6909.
2012-06-16 04:10:32 +00:00
Thomas Goyne 77821c10b7 Don't also force TV range when Force BT.601 is enabled
Originally committed to SVN as r6908.
2012-06-15 13:09:15 +00:00
cantabile 5ea71bce89 HD audio cache: initialise variables before checking for free space
Originally committed to SVN as r6907.
2012-06-15 13:08:45 +00:00
cantabile d99f3e3841 Fix missing ending slash in the HD cache file's location
Given the location "/home/asdf/.aegisub" and name "audio%02i.tmp",
the cache file was ".aegisubaudio00.tmp" in "/home/asdf"...

Originally committed to SVN as r6906.
2012-06-15 13:08:41 +00:00
cantabile 67c05519fa Allow the use of standard paths in the HD cache file's location
Originally committed to SVN as r6905.
2012-06-15 13:08:39 +00:00
Thomas Goyne b8c6a41ac4 Add support for floating-point audio. Closes #1490.
Originally committed to SVN as r6904.
2012-06-13 15:58:28 +00:00
Thomas Goyne 5eb14a1f7a Maybe really fix hurr durr gtk. Closes #1474.
Originally committed to SVN as r6903.
2012-06-13 15:58:24 +00:00
Thomas Goyne 05f63f14b2 Log which audio provider is actually used
Originally committed to SVN as r6902.
2012-06-13 15:58:21 +00:00
Thomas Goyne d4635b723a Support wx built with utf-32 strings
Originally committed to SVN as r6901.
2012-06-13 04:16:53 +00:00
Thomas Goyne 7c461ddfcf Use size_t rather than int64_t as the array index in AudioProvider::GetAudioWithVolume
In 32-bit builds the int64_t index resulted in two (inlined) calls to
allmul per audio sample, which took 25-50% of the total CPU time
involved in playing audio from the RAM cache.

Originally committed to SVN as r6900.
2012-06-13 04:16:50 +00:00
Thomas Goyne 998fc633b9 osx: Fix assertion failure when expanding hotkey categories
Originally committed to SVN as r6899.
2012-06-12 03:13:58 +00:00
Thomas Goyne 2db20778fc Mostly rewrite the screen dropper code
Eliminate a lot of the platform-specific code by just using the portable
versions everywhere, and use CoreGraphics rather than wxScreenDC to grab
an image of the screen on OS X as wxScreenDC doesn't actually work on
10.6+.

Originally committed to SVN as r6898.
2012-06-12 03:13:55 +00:00
Thomas Goyne 82d955ba96 Exit on error in osx-run.sh
Originally committed to SVN as r6897.
2012-06-12 03:13:53 +00:00
Thomas Goyne 0f071d978a Rewrite the OS X bundle utils in Obj-C++ and return std::strings rather than malloced char *
Originally committed to SVN as r6896.
2012-06-12 03:13:49 +00:00
cantabile 4b78e05695 Video box: tweak the tab order
Move the slider before the buttons,
and move the video display before the slider.

Originally committed to SVN as r6895.
2012-06-12 02:59:41 +00:00
cantabile 46c83d7f1c Allow tabbing out of the video slider
Originally committed to SVN as r6894.
2012-06-12 02:59:38 +00:00
cantabile acea3a04e0 Make run.sh work regardless of $PWD.
Originally committed to SVN as r6893.
2012-06-12 02:59:35 +00:00
Thomas Goyne 03b1b8e1c0 Flush options before restarting so that language changes actually apply
Originally committed to SVN as r6892.
2012-06-08 21:20:21 +00:00
Thomas Goyne a51de67d68 ffms2: Reindex and reload audio when the error handling mode is changed
Originally committed to SVN as r6891.
2012-06-07 21:03:11 +00:00
Thomas Goyne 8c17d45e8c osx: Move the detached video dialog to the normal window level when it goes fullscreen as it's hilariously broken otherwise
Originally committed to SVN as r6890.
2012-06-07 21:03:08 +00:00
Thomas Goyne f0f7ad2858 osx: Make modelss dialogs stay on top of the main window as they're floating panels, not documents
Originally committed to SVN as r6889.
2012-06-07 02:48:13 +00:00
Thomas Goyne 26a5fbe4b8 osx: Add the full screen button to the detached video dialog
Originally committed to SVN as r6888.
2012-06-07 02:48:11 +00:00
Thomas Goyne b65e867455 Enable the Accept Splits button even when it's only the autosplit that would be committed
Originally committed to SVN as r6887.
2012-06-07 02:48:08 +00:00
Thomas Goyne 18041eabc7 Use * rather than \+ in osx-bundle.sed since the latter has magically stopped working
Originally committed to SVN as r6886.
2012-06-07 02:48:05 +00:00
Thomas Goyne c6237865af Unconditionally add -lz to WX_LIBS
Originally committed to SVN as r6885.
2012-05-28 15:00:54 +00:00
Thomas Goyne 9cb5178c4b Revert r6758
The explicit cast should not be required, and the type of the parameter
has changed between wx versions so it breaks things.

Originally committed to SVN as r6884.
2012-05-28 14:55:42 +00:00
Thomas Goyne 108c38b9bc Don't swallow : keypresses in TimeEdit
Originally committed to SVN as r6883.
2012-05-28 14:18:40 +00:00
cantabile a3d7d2bbc0 TimeEdit: handle Shift-Insert the same way as Ctrl-V
Shift-Insert pasted the text anyway, but without anyone "noticing",
which meant the TimeEdit's internal variable "time" didn't get updated,
causing TimeEdit::GetTime() to return the old time. Because of this,
pasting a time in the Jump To dialog with Shift-Insert didn't update the
frame number.

Originally committed to SVN as r6882.
2012-05-28 14:18:10 +00:00
cantabile 3a81e80aa5 Add workaround for tabbing out of SubsTextEditCtrl
wxStyledTextCtrl eats the tabs, so handle them in
SubsTextEditCtrl::OnKeyDown()

Originally committed to SVN as r6881.
2012-05-28 14:18:07 +00:00
Thomas Goyne 571752a955 Make the visual typesetting toolbar use all available space
When toolbars actually have a background (as on OS X), the stretch
spacer was very ugly, and there's no different on platforms without a
background.

Originally committed to SVN as r6880.
2012-05-26 20:16:12 +00:00
Thomas Goyne cde9a34425 osx: Add the full screen button to the main window
Originally committed to SVN as r6879.
2012-05-26 20:16:08 +00:00
Thomas Goyne 1da7502d6e Remove pointless commented-out code
Originally committed to SVN as r6878.
2012-05-26 20:16:05 +00:00
Thomas Goyne ae672b64af Add Objective-C++ support to the makefile
Originally committed to SVN as r6877.
2012-05-26 20:16:02 +00:00
Thomas Goyne dc5d6c9a4a Add missing include in unix/log.cpp and wrap includes in #ifndef LAGI_PRE
Originally committed to SVN as r6876.
2012-05-26 17:00:16 +00:00
Thomas Goyne 427c8406d5 hurr durr gtk. Closes #1474.
Originally committed to SVN as r6875.
2012-05-26 16:54:55 +00:00
Thomas Goyne a75c8705bb Make bitmap.{h,cpp} depend on their input files
Originally committed to SVN as r6874.
2012-05-26 16:54:52 +00:00
Thomas Goyne e4154b1ae0 Don't include the version in the automation install path. Closes #1493.
Originally committed to SVN as r6873.
2012-05-26 16:54:48 +00:00
Thomas Goyne bf9a71f91a assdraw: remove unused stuff
Originally committed to SVN as r6872.
2012-05-26 16:54:45 +00:00
Thomas Goyne e368b068e4 assdraw: eliminate some variable shadowing
Originally committed to SVN as r6871.
2012-05-26 16:54:42 +00:00
Thomas Goyne 618c4b8afa assdraw: delete some commented code
Originally committed to SVN as r6870.
2012-05-26 16:54:39 +00:00
Thomas Goyne 4b662d74f4 assdraw: create the config dir if it doesn't already exist
Originally committed to SVN as r6869.
2012-05-24 01:56:39 +00:00
Thomas Goyne 03259b3ceb assdraw: always write the config file to the user's config dir
Originally committed to SVN as r6868.
2012-05-24 01:56:36 +00:00
Thomas Goyne 77b60b579e assdraw: actually set the app name
Originally committed to SVN as r6867.
2012-05-24 01:56:33 +00:00
Thomas Goyne c3aa3cbe00 assdraw: strip trailing whitespace from files
Originally committed to SVN as r6866.
2012-05-24 01:56:30 +00:00
Thomas Goyne 8c6d047115 assdraw: remove checks for basic wx features
Originally committed to SVN as r6865.
2012-05-24 01:56:27 +00:00
Thomas Goyne e215c9d22b assdraw: delete beta expiration code
Originally committed to SVN as r6864.
2012-05-24 01:56:24 +00:00
Thomas Goyne 3083df4a45 assdraw: delete some insane commented out code
Originally committed to SVN as r6863.
2012-05-24 01:56:21 +00:00
Thomas Goyne 091af97248 assdraw: use CSS syntax to save colors since it actually supports alpha
Originally committed to SVN as r6862.
2012-05-24 01:56:18 +00:00
Thomas Goyne eb1184b329 assdraw: add minimal OS X bundle generation script
Originally committed to SVN as r6861.
2012-05-24 01:56:15 +00:00
Thomas Goyne 01eba350b7 assdraw: fix assertion failure from reading and writing a bitmap at the same time
Originally committed to SVN as r6860.
2012-05-24 01:56:12 +00:00
Thomas Goyne f0eaaacd06 assdraw: actually ask for all of the wx libraries used
Originally committed to SVN as r6859.
2012-05-24 01:56:09 +00:00
Thomas Goyne b67edaff6d assdraw: add missing news when creating PG properties
Originally committed to SVN as r6858.
2012-05-24 01:56:06 +00:00
Thomas Goyne ecc05d5965 assdraw: fix AddTool argument order
Originally committed to SVN as r6857.
2012-05-24 01:56:03 +00:00
Thomas Goyne a30b9d4fdb assdraw: remove pointless variable that clang barfs on
Originally committed to SVN as r6856.
2012-05-24 01:56:00 +00:00
Thomas Goyne fd322e8dc9 assdraw: pass enough arguments to wxFlexGridSizer's constructor
Originally committed to SVN as r6855.
2012-05-24 01:55:57 +00:00
Thomas Goyne a0c0b5a865 assdraw: remove wxADJUST_MINSIZE (which didn't actually do anything)
Originally committed to SVN as r6854.
2012-05-24 01:55:54 +00:00
Thomas Goyne 822f659055 assdraw: add missing wx/dcclient include
Originally committed to SVN as r6853.
2012-05-24 01:55:51 +00:00
Thomas Goyne cfb34bd50c assdraw: typedef wxPGId for backwards comaptibility
Originally committed to SVN as r6852.
2012-05-24 01:55:49 +00:00
Thomas Goyne decc47a568 assdraw: fix memory leak
Originally committed to SVN as r6851.
2012-05-24 01:55:46 +00:00
Thomas Goyne 40a2bae771 assdraw: remove pointless out of date inline copy of libpropgrid
Originally committed to SVN as r6850.
2012-05-24 01:55:42 +00:00
Thomas Goyne c4367f083c assdraw: add wxwin.m4
Originally committed to SVN as r6849.
2012-05-24 01:55:39 +00:00
Thomas Goyne 5dd13ea811 assdraw: fix some derp in the configure script
Originally committed to SVN as r6848.
2012-05-24 01:55:36 +00:00
Thomas Goyne 86674614a4 assdraw: actually set the package name in configure.in
Originally committed to SVN as r6847.
2012-05-24 01:55:33 +00:00
Thomas Goyne fb77e183e6 assdraw: replace autogen.sh with buildconf
The autogen.sh script was incredibly out of date and dumb.

Originally committed to SVN as r6846.
2012-05-24 01:53:59 +00:00
Thomas Goyne 1206906c32 Automatically generate the list of supported languages rather than hardcoding it
Originally committed to SVN as r6845.
2012-05-24 01:53:56 +00:00
Thomas Goyne a6036d98f1 Fix copyright years and URL in the plist
Originally committed to SVN as r6844.
2012-05-24 01:53:53 +00:00
Thomas Goyne 29e9d09859 Fix non-precompiled-header compilation
Originally committed to SVN as r6843.
2012-05-23 03:38:50 +00:00
Thomas Goyne 11747a6c27 Regenerate aegisub.pot
Originally committed to SVN as r6842.
2012-05-23 03:38:47 +00:00
Thomas Goyne c6aa43de72 Add command audio/play/current
This is like audio/play/selection except it ignores changes to the
primary range during playback, and always stops when the original end of
the line is reached.

Originally committed to SVN as r6841.
2012-05-23 03:38:44 +00:00
Thomas Goyne 567549c55d OS X: Add default hotkey to show/hide toolbar
Originally committed to SVN as r6840.
2012-05-23 03:38:41 +00:00
Thomas Goyne 58de109085 Add Show/Hide toolbar to the View menu
The Apple HIG says to include this, and I see no reason not to include
it on the other platforms as well.

Originally committed to SVN as r6839.
2012-05-23 03:38:37 +00:00
Thomas Goyne b9154a79c1 Also extract strings from the OS X default menu
Originally committed to SVN as r6838.
2012-05-23 03:38:34 +00:00
Thomas Goyne 24cd2bbdf9 Fix the name of the quit command
Originally committed to SVN as r6837.
2012-05-19 16:22:21 +00:00
Thomas Goyne 9f9e273de2 Compress the dmg with bzip2 rather than zlib
Reduces size by ~7%.

Originally committed to SVN as r6836.
2012-05-19 16:22:16 +00:00
Thomas Goyne 35279b6e28 Remove pointless blank buttons
Originally committed to SVN as r6835.
2012-05-19 15:49:23 +00:00
Thomas Goyne e4cc9d1404 OX X: Force 32x32 toolbar icons rather than 24x24
Originally committed to SVN as r6834.
2012-05-19 15:49:18 +00:00
Thomas Goyne 57d1d92a9e Make the 32x32 icons available in the program
Originally committed to SVN as r6833.
2012-05-19 15:49:12 +00:00
Thomas Goyne dc99f02d1d Add 32x32 icons to the respack manifest
Originally committed to SVN as r6832.
2012-05-19 15:49:06 +00:00
Thomas Goyne 2fdded77fb Add 32x32 versions of the icons for OX X
Originally committed to SVN as r6831.
2012-05-19 15:48:57 +00:00
Thomas Goyne 467f4b0c52 Fix crash when changing hotkeys after detaching video
ToolTipManager's slots can outlive the windows they're for, so use
wxWeakRef to avoid trying to update the tooltip for windows that have
been destroyed.

Originally committed to SVN as r6830.
2012-05-19 03:02:21 +00:00
Thomas Goyne b6e47f1cc0 Remove unused incldue in subs_edit_box.cpp
Originally committed to SVN as r6829.
2012-05-19 03:02:15 +00:00
Thomas Goyne dcbe114361 Add version of run.sh that works on OS X
Originally committed to SVN as r6828.
2012-05-19 01:13:11 +00:00
Thomas Goyne 3d512eb422 OS X: Always use 24x24 icons for toolbars attached to frames
32x32 icons really should be used here as they'll get automatically
upscaled to that anyway, but we currently don't have those.

Originally committed to SVN as r6827.
2012-05-19 01:13:05 +00:00
Thomas Goyne ba40e24326 Attach toolbars to the frame before populating them
Works around a wxOSX-Cocoa bug (http://trac.wxwidgets.org/ticket/13888)
that resulted in items never being added to the toolbar.

Originally committed to SVN as r6826.
2012-05-19 01:13:00 +00:00
Thomas Goyne 48c3b39cd1 Silence some warnings in universalchardet
Originally committed to SVN as r6825.
2012-05-19 01:12:54 +00:00
Thomas Goyne c7fb7eb295 Handle modeless dialogs which never fully open
Fixes crash when opening the spell checker dialog after no spelling
errors were found previously.

Closes #1491.

Originally committed to SVN as r6824.
2012-05-18 14:01:56 +00:00
Thomas Goyne 904b5aafe4 Set both the initial and value for font size spin ctrls as well
Originally committed to SVN as r6823.
2012-05-18 05:03:21 +00:00
Thomas Goyne 4f832e4b82 Cast size_ts passed to wxString::Format to ints
Originally committed to SVN as r6822.
2012-05-18 05:03:16 +00:00
Thomas Goyne 21100038f5 Explicitly set the value of the Matches radio box in the Select Lines dialog
On OS X is it not implicitly set to the opposite of the Doesn't Match
radio box as it is on other platforms.

Originally committed to SVN as r6821.
2012-05-18 05:03:11 +00:00
Thomas Goyne 5c10bfa2f3 OS X: Fix crash when opening Find/Replace dialog
Originally committed to SVN as r6820.
2012-05-18 05:03:05 +00:00
Thomas Goyne 2675bbb831 OS X: Adjust some default hotkeys to match the platform standards
Originally committed to SVN as r6819.
2012-05-18 05:03:00 +00:00
Thomas Goyne 2f2e33617a OS X: Rearrange menus a bit to get closer to normal
Originally committed to SVN as r6818.
2012-05-18 05:02:55 +00:00
Thomas Goyne 129edf3f12 OS X: Use Lucida Grande by default
Originally committed to SVN as r6817.
2012-05-18 05:02:50 +00:00
Thomas Goyne 3699a35988 Add OS X-specific default config, hotkey and menu files
Originally committed to SVN as r6816.
2012-05-18 05:02:43 +00:00
Thomas Goyne 33c36a3298 Fix double multiplication by sample rate that resulted in the waveform renderer allocating way more memory than needed
Originally committed to SVN as r6815.
2012-05-18 01:58:35 +00:00
Thomas Goyne 2243844d89 Actually copy the automation files into the .app
Originally committed to SVN as r6814.
2012-05-17 05:22:52 +00:00
Thomas Goyne 7c203dd750 Don't version-suffix the fontconfig cache path
Everything else is put in ~/Library/Application Support/Aegisub/, so put
the fontconfig cache there as well instead of ~/Library/Application
Support/Aegisub-3.0/

Originally committed to SVN as r6813.
2012-05-17 05:22:46 +00:00
Thomas Goyne 015d533556 Fix bad destruction order when exiting without closing the main window first
On OS X, when closing via Quit the document windows are not closed until
after OnExit is called, resulting the project context being destructed
after the global stuff, resulting in crashes on exit in some cases.

Originally committed to SVN as r6812.
2012-05-16 14:23:16 +00:00
Thomas Goyne 7ab4f85211 Stop audio undo coalescing when swtiching between lines
Originally committed to SVN as r6811.
2012-05-16 14:23:10 +00:00
Thomas Goyne c86f553aa7 Handle the menu items that are moved to the application menu on OS X
Originally committed to SVN as r6810.
2012-05-16 04:57:24 +00:00
Thomas Goyne e51a86195f Don't signal ScriptsChanged in ScriptManager's destructor
Fixes a crash on exit on OS X

Originally committed to SVN as r6809.
2012-05-16 04:57:18 +00:00
Thomas Goyne 7570d2b982 Fix wxString::Format assertion failure when opening the log window
Originally committed to SVN as r6808.
2012-05-16 04:57:12 +00:00
Thomas Goyne 7e8c18492f Fix non-precompiled-header compilation
Originally committed to SVN as r6807.
2012-05-16 04:57:06 +00:00
Thomas Goyne 0efae2fc85 Add ffms2's cflags to preferenes.cpp
Originally committed to SVN as r6806.
2012-05-16 04:56:59 +00:00
Thomas Goyne e798e517bd Add padding to the sides of the jump to dialog
Originally committed to SVN as r6805.
2012-05-15 14:11:30 +00:00
cantabile 8960e840d2 Vertically center various widgets
Preferences: labels.
Properties dialog: resolution textboxes.
Fonts collector: path textbox.
Resample resolution: resolution spin boxes.
Video details: labels.

Originally committed to SVN as r6804.
2012-05-15 14:07:14 +00:00
cantabile b8f7d5eb13 Jump To dialog: use correct format specifier in wxString::Format
Avoids an assertion failure.

Originally committed to SVN as r6803.
2012-05-15 14:07:10 +00:00
cantabile 5d9268792f Make the Jump To dialog less silly
- Don't set arbitrary sizes for the labels and textboxes.
- Get rid of the horizontal box sizers because the labels just wouldn't
  center vertically. Use a grid sizer instead.
- Use a wxStdDialogButtonSizer instead of creating the buttons manually.

Originally committed to SVN as r6802.
2012-05-15 14:07:05 +00:00
cantabile 9254ea8ff6 Dummy video dialog: make the OK button the default button of the dialog
Done by imitating the buttons in the timing postprocessor.

Originally committed to SVN as r6801.
2012-05-15 14:07:00 +00:00
cantabile 848ebf4d2d Move two accelerators
SubsEditBox: move accelerator so it doesn't conflict with "Timing" menu.
Dummy video dialog: move accelerator so it doesn't conflict with the
Cancel button.

Originally committed to SVN as r6800.
2012-05-15 14:06:55 +00:00
cantabile 597b92bb7f Silence three gcc warnings ("ambiguous else")
Originally committed to SVN as r6799.
2012-05-15 14:06:49 +00:00
cantabile 68d7677e14 Never focus the comment checkbox (wxGTK only)
The checkbox can be toggled using its accelerator, without needing to
switch focus back to whatever was focused before.

Originally committed to SVN as r6798.
2012-05-15 14:06:44 +00:00
cantabile 1afc3a816f Alsa player: avoid allocating an array of negative size and add some printfs for debugging.
Originally committed to SVN as r6797.
2012-05-15 14:06:39 +00:00
cantabile 9f6d117875 Preferences: give the font and path textboxes a minimum width of 160 px
The default minimum width was too small.

Originally committed to SVN as r6796.
2012-05-15 14:06:34 +00:00
cantabile c868928817 Preferences, Colors page: make the box sizers expand
This way the Colors page behaves more or less like the other pages.

Originally committed to SVN as r6795.
2012-05-15 14:06:29 +00:00
cantabile 8887f96098 Preferences: rearrange the "Colors" page a bit
Make it look less asymmetrical.

Originally committed to SVN as r6794.
2012-05-15 14:06:24 +00:00
cantabile 54a08a44c1 stdout log emitter: flush stdout after every printf() if stdout is not a terminal
This makes it possible to watch aegisub's output in realtime even if its
stdout is redirected to a file.

Originally committed to SVN as r6793.
2012-05-15 14:06:18 +00:00
Thomas Goyne d38e02c031 Always use wxPATH_WIN for wxFileName::GetForbiddenChars
While it's possible to have files with the DOS-only forbidden characters
on other platforms, wx doesn't actually support them very well.

Closes #1489.

Originally committed to SVN as r6792.
2012-05-15 13:40:10 +00:00
Thomas Goyne ea1dbc3e8c Remove out of date bug workaround
Panel borders no longer make update region coordinates be out of sync
with drawing coordinates.

Originally committed to SVN as r6791.
2012-05-15 13:40:05 +00:00
Thomas Goyne d31b795e60 Move the logic for Enter in a time edit to SubsEditBox
It doesn't make any sense for the time edits used elsewhere, and it made
Enter in a time edit not close dialogs.

Originally committed to SVN as r6790.
2012-05-15 13:40:00 +00:00
Thomas Goyne fc7164422c Flush options after asking the first-startup questions
Originally committed to SVN as r6789.
2012-05-15 13:39:55 +00:00
Thomas Goyne 4940a98e85 Set both the initial and value fields of spin controls in the preferences dialog since wx ports are inconsistent about which is used
Originally committed to SVN as r6788.
2012-05-15 13:39:50 +00:00
Thomas Goyne 5b9ba0205a Always use change_value for setting spin ctrls in the color picker
With wxCocoa the change events from SetValue are processed immediately,
resulting in significant breakage as in some cases multiple spin
controls need to be set at once. Even on other platforms where things
appeared to work due to the change notifications being delayed, they
still didn't do anything useful and slowed updates down slightly.

Originally committed to SVN as r6787.
2012-05-15 13:39:45 +00:00
Thomas Goyne ad64e8e48a Remove hardcoded widths for the labels in the color picker
This results in the controls being slightly misaligned, but that's not
as bad as truncating the labels.

Originally committed to SVN as r6786.
2012-05-15 13:39:40 +00:00
Thomas Goyne a97c7fa1f6 Fix infinite loop when changing the color in the color picker on OS X
Originally committed to SVN as r6785.
2012-05-15 13:39:35 +00:00
Thomas Goyne 75305877f0 Set the initial values of the color picker before binding events
Originally committed to SVN as r6784.
2012-05-15 13:39:30 +00:00
Thomas Goyne ba413fa64d Rework destruction of FrameMain's children
wxCocoa doesn't like reparenting SubsGrid to NULL, so instead
recursively destroy all of FrameMain's children other than SubsGrid and
its parent. Fixes a crash on exit on OS X.

Originally committed to SVN as r6783.
2012-05-15 13:39:24 +00:00
Thomas Goyne 3a951a2564 Fix wxstd.mo paths in osx-bundle.sh
Originally committed to SVN as r6782.
2012-05-14 13:22:09 +00:00
Thomas Goyne 827abff4c3 Recreate the App dir if it already exists rather than falling down
Originally committed to SVN as r6781.
2012-05-14 13:22:04 +00:00
Thomas Goyne 2a5666be69 Pass the path to wx-config to osx-bundle.sh as it may not be on the path
Originally committed to SVN as r6780.
2012-05-14 13:21:58 +00:00
Thomas Goyne fa70f15988 Remove the message about not asking for support with SVN revisions
Originally committed to SVN as r6779.
2012-05-14 13:21:53 +00:00
Thomas Goyne aee4657ece Remove the check for wx's m4 since we ship it now
Originally committed to SVN as r6778.
2012-05-14 13:21:48 +00:00
Thomas Goyne bdda855438 Explicitly set the git log format rather than relying on the default
Originally committed to SVN as r6777.
2012-05-14 13:21:43 +00:00
Thomas Goyne 069b34a806 Remove osx-bundle.sed on distclean, not clean
Originally committed to SVN as r6776.
2012-05-14 13:21:38 +00:00
Thomas Goyne 6b21485c0b Add default_config_platform.json to distclean files
Originally committed to SVN as r6775.
2012-05-14 13:21:33 +00:00
Thomas Goyne a126dea300 Make osx-bundle.sh exit on error
Originally committed to SVN as r6774.
2012-05-14 13:21:27 +00:00
Thomas Goyne 0239ab6688 Remove the explicit height from the preferences dialog
The height was too short to fit the contents in some cases, and wasn't
even used on Windows. Patch by cantabile.

Closes #1488.

Originally committed to SVN as r6773.
2012-05-13 00:58:16 +00:00
Thomas Goyne 57e06a6cad Fix error when a dropdown in the preferences dialog has no values
Originally committed to SVN as r6772.
2012-05-13 00:58:11 +00:00
Thomas Goyne d04bc6d9b4 Don't paint the audio display if it hasn't been fully initialized due to audio not being open
Originally committed to SVN as r6771.
2012-05-13 00:58:06 +00:00
Thomas Goyne c0d3cbf688 Make the use of blacklisted paths when building a OS X bundle a warning rather than an error
Originally committed to SVN as r6770.
2012-05-13 00:58:01 +00:00
Thomas Goyne deaf8669da Make make osx-dmg run make osx-bundle automatically
Originally committed to SVN as r6769.
2012-05-13 00:57:56 +00:00
Thomas Goyne 8abfdd6156 Actually fail if wx can't be found
Originally committed to SVN as r6768.
2012-05-13 00:57:50 +00:00
Thomas Goyne 2cc44be966 Add wxwin.m4 to acinclude.m4 so that it actually gets used without the user manually setting the aclocal path
Originally committed to SVN as r6767.
2012-05-13 00:57:45 +00:00
Thomas Goyne 65117f56d3 Add 1.12 to the automake versions checked for
Originally committed to SVN as r6766.
2012-05-13 00:57:40 +00:00
Thomas Goyne 35fa6c47ce Automatically add a "Default" style to the "Default" catalog as 2.1.x did. Patch by cantabile. Closes #1487.
Originally committed to SVN as r6765.
2012-05-13 00:57:34 +00:00
Thomas Goyne 3388281fb7 Fix error when the style catalog directory doesn't exist or is empty
Use wxDir::GetFirst/GetNext rather than wxFileFirstFile since the latter
doesn't have any way to signal that there aren't actually any files to
be found.

Closes #1486.

Originally committed to SVN as r6764.
2012-05-13 00:57:25 +00:00
Thomas Goyne 2addf40b31 Fix typo (204M -> 240M)
Originally committed to SVN as r6763.
2012-05-11 14:42:30 +00:00
Thomas Goyne bc74dfc33b Update the video matrix tagging scheme
Write the color range and color space used to convert video to RGB to
the YCbCr Matrix field, or None if no non-RGB video was opened. See
http://code.google.com/p/xy-vsfilter/issues/detail?id=91 for related
discussion.

Originally committed to SVN as r6762.
2012-05-11 14:38:44 +00:00
Thomas Goyne baacea6ab0 Force threads to 1 when opening video via lavf since the ffms2 bug that makes multithreaded decoding sometimes break still hasn't been fixed
Originally committed to SVN as r6761.
2012-05-11 02:58:34 +00:00
Thomas Goyne c354dc9e30 Fix brokenness in the curve smoothing
Originally committed to SVN as r6760.
2012-05-11 02:47:24 +00:00
Thomas Goyne a05d469741 Actually do the smoothing when drawing a smoothed freehand shape
Originally committed to SVN as r6759.
2012-05-11 02:47:18 +00:00
Thomas Goyne c4e36e00a5 Fix compilation with wxGTK trunk
Originally committed to SVN as r6758.
2012-05-10 14:19:07 +00:00
Thomas Goyne f1b2b4a3da Don't allow opening multiple copies of the spell checker dialog
Originally committed to SVN as r6757.
2012-05-10 14:19:02 +00:00
Thomas Goyne 47fb50d4d3 Fix crash after cancelling the shift times dialog. Closes #1483.
Originally committed to SVN as r6756.
2012-05-10 14:18:54 +00:00
Thomas Goyne f724abd0b8 Add support for symlinking fonts rather than copying them in the fonts collector. Based on a patch by nodame.
Originally committed to SVN as r6755.
2012-05-10 14:18:47 +00:00
Thomas Goyne 18f158a364 Rename option "Always show visual tools" to "Only show visual tools when mouse is over video" as the old name said nothing about when they wouldn't be shown.
Originally committed to SVN as r6754.
2012-05-05 02:11:15 +00:00
Thomas Goyne 06e23b9296 Use SetSelectionAndActive whenever both are set at once
I'm not sure if this fixes any current actual problems as using slightly
stale data is normally only a problem when lines are being deleted, but
it's easier to fix it across the board than to figure out where it is
and isn't needed, and the speed impact of batching is trivial.

Originally committed to SVN as r6753.
2012-05-05 02:11:09 +00:00
Thomas Goyne f756aa73c1 Add SelectionController::SetSelectionAndActive, which automatically batches the changes to the selection and active line
Originally committed to SVN as r6752.
2012-05-05 02:11:03 +00:00
Thomas Goyne 70abaf75d7 Don't cache the selection in the dialogue timing controller, as getting it isn't very expensive and it was used in a stale state when the active line changed
Originally committed to SVN as r6751.
2012-05-05 02:10:57 +00:00
Thomas Goyne a15024e052 Trigger a modified event on Enter in a time edit so that selecting several lines and hitting Enter to set them all to the active line's time works
Originally committed to SVN as r6750.
2012-05-04 02:53:14 +00:00
Thomas Goyne 9269c79763 Only clear the selection due to a click on no visual features if there are actually multiple visual features to select
Originally committed to SVN as r6749.
2012-05-04 02:53:09 +00:00
Thomas Goyne 479de87068 Leave the selected range in the audio display unchanged when switching to an untimed line as 2.1.x did
Originally committed to SVN as r6748.
2012-05-04 02:53:03 +00:00
Thomas Goyne 1bd24d837c Allow block selections on the grid with modifier keys held down
Originally committed to SVN as r6747.
2012-05-04 02:52:58 +00:00
Thomas Goyne 213ccccf86 Redesign the logic for scrolling the grid on drags
Update the grid scroll position on mouse up rather than mouse down,
eliminating the need for the logic that made it impossible to do a drag
selection from the top or bottom rows of the grid, and fix some cases
where the grid would scroll in an undesirable direction.

Originally committed to SVN as r6746.
2012-05-04 02:52:52 +00:00
Thomas Goyne 4d7c6b08e0 Leave the current line selected after splitting at cursor rather than selecting the new line
Originally committed to SVN as r6745.
2012-05-03 03:14:11 +00:00
Thomas Goyne 4603a86953 Don't pointless recreate the subs provider when the subs preview is resized
Fixes a bug that made it rather awkward to resize the style editor
dialog with libass, as the libass provider briefly creates a modal
dialog whenever it's created, which would interrupt the drag

Originally committed to SVN as r6744.
2012-05-02 22:42:43 +00:00
Thomas Goyne 63d60b9b1e Save the size of the style editor in addition to the position
Originally committed to SVN as r6743.
2012-05-02 22:42:37 +00:00
Thomas Goyne 5a067f56e4 Add command "time/lead/both" which adds both lead in and out
Originally committed to SVN as r6742.
2012-05-02 22:42:31 +00:00
Thomas Goyne 8f3b027881 Improve the negative-duration-avoiding behavior of the time edit boxes
Save the initial start and end times of lines before adjusting them to
avoid negative line durations, so that if further changes to the edit
boxes make the adjustment unneccesary the original values can be
restored. This Fixes the problem where changing a line visible from
frames 800-900 to 800-901 would actually result in 90-901, due to the
end frame briefly being 90.

Originally committed to SVN as r6741.
2012-05-02 22:42:25 +00:00
Thomas Goyne 252351b7da Don't stop audio playback when switching lines
Originally committed to SVN as r6740.
2012-05-02 22:42:18 +00:00
Thomas Goyne 4be8e3595b Limit the duration of the lines created with Insert (before) and Insert (after) to the default timing length
Originally committed to SVN as r6739.
2012-05-02 00:31:44 +00:00
Thomas Goyne cb75c42f04 Leave the old audio open when opening new audio fails for any reason
Originally committed to SVN as r6738.
2012-05-02 00:31:38 +00:00
Thomas Goyne b8212512e7 Work around a bug which made style names in the style editor scrolled to the left far sooner than they needed to be
Originally committed to SVN as r6737.
2012-05-01 02:50:09 +00:00
Thomas Goyne 2ef7ed98c0 Update the audio scroll position at most once every 50ms when dragging markers
Originally committed to SVN as r6736.
2012-05-01 02:50:03 +00:00
Thomas Goyne 1558aa2dad Increase the height of the audio display scrollbar by 50%
Originally committed to SVN as r6735.
2012-05-01 02:49:58 +00:00
Thomas Goyne 4231653146 When joining lines, use the maximum of the lines' end times rather than the last line's end time
Originally committed to SVN as r6734.
2012-05-01 02:49:53 +00:00
Thomas Goyne 9e3553c199 Join concatenated lines with a space rather than \N
Originally committed to SVN as r6733.
2012-05-01 02:49:48 +00:00
Thomas Goyne 834c2849da Scroll 1/3 of the audio display per mouse wheel click rather than 120 pixels
This is what 2.1.x did (except this actually handles nonstandard wheel
deltas) and is generally far more usable.

Originally committed to SVN as r6732.
2012-05-01 02:49:43 +00:00
Thomas Goyne 1c4bb4a0e2 Split Lead In and Lead Out into separate passes in the TPP
This makes it so that if there is a gap between two lines but not enough
space for both the full lead-in and lead-out to be added, adding lead-in
to the second line will be prioritized over adding lead-out to the first
line, which is usually the desired result.

Originally committed to SVN as r6731.
2012-05-01 02:49:38 +00:00
Thomas Goyne 742cbf16aa Add WebM to the list of supported video formats
Originally committed to SVN as r6730.
2012-05-01 02:49:33 +00:00
Thomas Goyne 2deafdd3a7 Fix race condition on shutdown that could result in the program not completely exiting on Windows
Originally committed to SVN as r6729.
2012-05-01 02:49:26 +00:00
Thomas Goyne 81d1073a97 Move the auto4 script factories to a local non-heap static to reduce memory leak report noise
Originally committed to SVN as r6728.
2012-04-27 19:08:17 +00:00
Thomas Goyne 38e87e2c83 Fix formatting string assertion failure in the search/replace dialog. Closes #1478.
Originally committed to SVN as r6727.
2012-04-27 19:08:09 +00:00
Thomas Goyne c71734a8a4 Fix the width of the adjacent bias slider in the TPP dialog on wxGTK. Closes #1477.
Originally committed to SVN as r6726.
2012-04-27 19:08:02 +00:00
Thomas Goyne f3238e2609 Bump required version of wx to 2.9.3
Although EVT_CHAR_HOOK was added in 2.9.2, it does not behave in the
required way until 2.9.3.

Originally committed to SVN as r6725.
2012-04-27 19:07:57 +00:00
Thomas Goyne 123f02f0fb Process hotkeys in wxEVT_CHAR_HOOK rather than wxEVT_KEY_DOWN
Char hook events propagate by default, removing the need for the event
filter to make key down events propagate, which was causing some funny
issues.

On Windows, the char hook handler runs before menu accelerators, fixing
a bug where Default context hotkeys would override more specific ones
when they appeared on a menu. Unfortunately, this is not the case on
GTK, so the dumb accelerator-disabling hack is still required.

Originally committed to SVN as r6724.
2012-04-27 19:07:49 +00:00
Thomas Goyne 40b1fbaa1b Implement audio/play/toggle (default hotkey B)
Originally committed to SVN as r6723.
2012-04-27 19:07:42 +00:00
Thomas Goyne 46a27a4e46 Eliminate excess spacing from CellSkip
Originally committed to SVN as r6722.
2012-04-27 19:07:36 +00:00
Thomas Goyne b275399fb1 Add option to draw lines at each second in the audio display
Originally committed to SVN as r6721.
2012-04-27 19:07:29 +00:00
Thomas Goyne 8b854283b7 Add audio/commit/default command
This command commits the current line, advances to the next line (even
if Auto Next on Commit is disabled), and resets the next line's time to
the default timing as if the next line was zero-timed. Add a default
hotkey of Shift-G, but don't bother with a toolbar button for now as
demand for this turned out to be fairly low.

Closes #946.

Originally committed to SVN as r6720.
2012-04-27 19:07:21 +00:00
Thomas Goyne eb26bc51b9 Add commit commands which always stay and always advance regardless of the auto advance setting
Originally committed to SVN as r6719.
2012-04-27 19:07:15 +00:00
Thomas Goyne 99a65974e4 Move the Next Line on Commit logic to the commit command so that other commands can do different things
Originally committed to SVN as r6718.
2012-04-27 19:07:07 +00:00
Thomas Goyne 79282d7b89 Add the header background color to the preferences dialog
Originally committed to SVN as r6717.
2012-04-27 19:06:58 +00:00
Thomas Goyne e4df8f9654 Reduce the Matroska read-ahead to 1KB
We only read subtitles, which are individually very small and generally
have video frames between them, resulting in most of the 65 KB
previously read being wasted. On an arbitrary test file this speeds up
subtitle reading from a cold cache by ~25%, and ~60% from warm.

Originally committed to SVN as r6716.
2012-04-22 15:31:16 +00:00
Thomas Goyne b13c72e967 Fix a few places where 32-bit fseek/ftell were used in the Matroska reader code
Originally committed to SVN as r6715.
2012-04-22 15:31:11 +00:00
Thomas Goyne 35241bdbce Fix wxString::Format assertion failure when opening subtitles from Matroska
Originally committed to SVN as r6714.
2012-04-22 15:31:06 +00:00
Thomas Goyne 95344fdb7c Always write user dictionaries to ?user/dictionaries
The value of Path/Dictionary is not guaranteed to be writable, and on
linux is likely to not be.

Originally committed to SVN as r6713.
2012-04-21 15:13:57 +00:00
Thomas Goyne fb5f94ca74 Change the spell checker and thesaurus language lists to radio items rather than check items
Originally committed to SVN as r6712.
2012-04-21 15:13:51 +00:00
Thomas Goyne 0a64763f2f Set the audio volume from the slider when audio is opened
Originally committed to SVN as r6711.
2012-04-21 15:13:46 +00:00
Thomas Goyne 3c31c1a17a Store the loaded audio file as a path relative to the subtitles, as is done with video
Originally committed to SVN as r6710.
2012-04-21 15:13:40 +00:00
Thomas Goyne 15eb4dc29d Fix bad option name that caused a fatal error on startup for clean installs
Originally committed to SVN as r6709.
2012-04-17 15:03:27 +00:00
Thomas Goyne 3253ccdb90 Move the "Force BT.601" option out of the FFmpegSource category as it's no longer FFMS2-specific, and make it on by default
Originally committed to SVN as r6708.
2012-04-16 23:55:21 +00:00
Thomas Goyne eceac482d0 Add BT.601/BT.709 guessing to the Avisynth video provider along with support for Force BT.601
Originally committed to SVN as r6707.
2012-04-16 23:55:15 +00:00
Thomas Goyne c28a2d33ed Explicitly enable optimization for the CSRI project to eliminate some link-time warnings about optimizations being disabled
Originally committed to SVN as r6706.
2012-04-16 23:55:10 +00:00
Thomas Goyne c28f262ec4 Use a save file dialog when extracting attachments rather than an open one
Originally committed to SVN as r6705.
2012-04-16 23:55:04 +00:00
Thomas Goyne 8a03e3a374 Read and write attachments in binary mode so they don't get mutilated on Windows
Originally committed to SVN as r6704.
2012-04-16 23:54:59 +00:00
Thomas Goyne d83507c816 Use the overload of wxComboBox::Append that takes a wxArrayString rather than manually looping over the items
Originally committed to SVN as r6703.
2012-04-16 23:54:53 +00:00
Thomas Goyne e5540de2da Delay creation of the thesaurus until it's needed
Although in absolute terms it does not take very long, loading the 18 MB
en_US thesaurus was about three quarters of Aegisub's total startup
time when opening with no command line arguments.

Originally committed to SVN as r6702.
2012-04-16 23:54:47 +00:00
Thomas Goyne 20a31f8e32 Change the default subtitles provider on Windows to "CSRI/vsfilter_aegisub"
Originally committed to SVN as r6701.
2012-04-16 23:54:42 +00:00
Thomas Goyne ed27a4eaa4 When gathering CSRI renderers, stick those with "aegisub" in the name at the beginning, so that the shipped copy of VSFilter will be used by default
Originally committed to SVN as r6700.
2012-04-16 23:54:34 +00:00
Thomas Goyne 0f9289dc0f Reduce how long the CSRI lock is held
Originally committed to SVN as r6699.
2012-04-14 03:17:22 +00:00
Thomas Goyne 24fde36e7f Don't fallback to default when trying to create a nonexistent CSRI renderer, as that should never happen
Originally committed to SVN as r6698.
2012-04-14 03:17:15 +00:00
Thomas Goyne 77eaedd611 Use wxEVT_CHAR_HOOK rather than wxEVT_KEY_DOWN in the hotkey editor so that hotkeys can be set to Esc
Originally committed to SVN as r6697.
2012-04-13 22:27:56 +00:00
Thomas Goyne 1d15bf273a Fix compilation failure from incomplete merging in r6692
Originally committed to SVN as r6696.
2012-04-12 15:40:25 +00:00
Thomas Goyne ba7b7efc12 Rename the 'Start-marker drag sensitivity' option, as its name was highly misleading
Originally committed to SVN as r6695.
2012-04-12 00:04:36 +00:00
Thomas Goyne 0da9a4f111 Add option to disable the new behavior where left-click-drag sets the start marker then drags the end marker
Originally committed to SVN as r6694.
2012-04-12 00:04:31 +00:00
Thomas Goyne 313fa2e1eb Use START times rather than EXACT for keyframe markers so that they agree with the snap start/end to frame commands
Originally committed to SVN as r6693.
2012-04-12 00:04:24 +00:00
Thomas Goyne bdafd8f201 Reset to the platform-specific default option values rather than the global defaults
Originally committed to SVN as r6692.
2012-04-11 04:10:56 +00:00
Thomas Goyne 4cafedb14e Regenerate aegisub.pot and fix a msgid misspelling
Originally committed to SVN as r6691.
2012-04-11 03:43:16 +00:00
Thomas Goyne 39d2546dcd Add a button to the preferences dialog to reset all options to the defaults
Originally committed to SVN as r6690.
2012-04-11 03:43:08 +00:00
Thomas Goyne 3ae96b59b9 Set the event type for version checker results correctly so that the dialog actually gets displayed
Originally committed to SVN as r6689.
2012-04-10 23:19:42 +00:00
Thomas Goyne 30565530eb Pick the CSRI renderer when the provider is created rather than every time subtitles are loaded
Originally committed to SVN as r6688.
2012-04-10 20:41:25 +00:00
Thomas Goyne 9f87a2bacb Only register the CSRI subtitles provider if there actually are any CSRI providers available
Originally committed to SVN as r6687.
2012-04-10 20:41:20 +00:00
Thomas Goyne e6978e9909 Fix some things in the po files
In cases where an English-specific change was made to a string (such as
fixing a misspelling or colour -> color), update the corresponding msgid
in the po.

Apply some of the punctuation changes where it's safe to. Many strings
lost some punctuation at the end, so simply update the msgid when the
translation didn't have any punctuation at the end, and if the
punctuation was the same, update both the msgid and msgstr (and leave it
up to the translator if the punctuation was different).

Update msgid and msgstr in the cases where the printf formatting
character was the only thing that changed.

This decreases the number of new strings by up to ~150.

Originally committed to SVN as r6686.
2012-04-10 20:41:11 +00:00
Thomas Goyne d2483f6b37 Regenerate aegisub.pot
Originally committed to SVN as r6685.
2012-04-10 20:41:05 +00:00
Thomas Goyne e2edd71f9d Make top-level menubar items translatable
Originally committed to SVN as r6684.
2012-04-10 20:41:00 +00:00
Thomas Goyne ee84961d36 Make the invalid command name message translatable, as it's displayed to the user in non-error situations
Originally committed to SVN as r6683.
2012-04-10 20:40:54 +00:00
Thomas Goyne d842e73643 Make the hotkey context names translatable
Originally committed to SVN as r6682.
2012-04-10 20:40:48 +00:00
Thomas Goyne f7a42e8821 Mark the Actor and Effect placeholder texts as translatable
Originally committed to SVN as r6681.
2012-04-10 20:40:43 +00:00
Thomas Goyne 0c7638aed5 s/were were/were/g
Originally committed to SVN as r6680.
2012-04-10 20:40:37 +00:00
Thomas Goyne 711faf17fa Readd the 's' to 'Subtitles provider'
Originally committed to SVN as r6679.
2012-04-10 20:40:32 +00:00
Thomas Goyne 08a63d437a Don't mark the provider/player names as translatable in the preferences dialog
The dropdown to pick the provider/player can't be made translatable with
how they're currently implemented, and having the options group name not
match the values in the dropdown is more confusing than useful.

Originally committed to SVN as r6678.
2012-04-10 20:40:26 +00:00
Thomas Goyne 7cda44c3f0 Readd the number prefixes to the automation log levels in the preferences dialog
Originally committed to SVN as r6677.
2012-04-10 20:40:20 +00:00
Thomas Goyne af0e58f876 Readd the word 'Mode' to 'Cycle Tag Hiding Mode'
Originally committed to SVN as r6676.
2012-04-10 20:40:14 +00:00
Thomas Goyne 87455d7f7e Append a blank line to the end of the fonts collector log since it clips the bottom few pixels of the last line on windows
Originally committed to SVN as r6675.
2012-04-08 02:28:50 +00:00
Thomas Goyne 79f24a5fb2 Add a warning when the fonts collector finds over 32 MB of fonts
Originally committed to SVN as r6674.
2012-04-08 02:28:43 +00:00
Thomas Goyne c614980dca "Fix" issues with hotkeys not working with wxGTK
GTK accelerators silently swallow the keypresses when the menu item is
disabled, so disable accelerators completely and just use our hotkey system.

Closes #1314.

Originally committed to SVN as r6673.
2012-04-07 01:06:34 +00:00
Thomas Goyne db69fdbbcd Vertically center the labels in the color picker dialog. Closes #1467.
Originally committed to SVN as r6672.
2012-04-06 15:51:14 +00:00
Thomas Goyne 309bc35af3 Don't accept keyboard focus in the color picker controls which can't be used via the keyboard. Updates #1467.
Originally committed to SVN as r6671.
2012-04-06 15:51:07 +00:00
Thomas Goyne 07eb718fa1 Rearrange control creation in the color picker dialog to get a less weird tab order. Updates #1467.
Originally committed to SVN as r6670.
2012-04-06 15:51:00 +00:00
Thomas Goyne 5f00eb62f4 Fix a case where Recombine Lines would leave an empty line
If a "1, 1+2, 1" pattern appeared at the end of the selection the blank
line at the end would never get cleaned up as it's removed when the line
after it is checked for recombination, so add a special case for that.

Closes #1468.

Originally committed to SVN as r6669.
2012-04-06 15:50:54 +00:00
Thomas Goyne 3403734c00 Update the cached grid colors when the relevant options are changed rather than just repainting the grid. Closes #1466.
Originally committed to SVN as r6668.
2012-04-06 15:50:46 +00:00
Thomas Goyne 9f3fd691e2 Unskip key events handled by the non-command keypress handling in BaseGrid
hotkey::check marks non-matching events as skipped, so the default key
event handler was running even if BaseGrid did something with the
keypress.

Closes #1464.

Originally committed to SVN as r6667.
2012-04-06 03:53:38 +00:00
Thomas Goyne 01f3049c0f Add batch file for 64-bit portable
Originally committed to SVN as r6666.
2012-04-06 01:55:40 +00:00
Thomas Goyne b6dab6f9bc Add 64-bit installer
Originally committed to SVN as r6665.
2012-04-06 01:55:34 +00:00
Thomas Goyne 84e378148e Add platform-specific default configuration files
Default to VSFilter on Windows as libass is still somewhat unstable.

Set the default audio player via the platform config file rather than
not doing anything with it.

Originally committed to SVN as r6664.
2012-04-06 01:55:22 +00:00
Thomas Goyne 0d4846d012 Handle the cancel button in the color picker dialog better
Return wxNullColor rather than the original color on cancel so that the
calling code can actually tell if it was cancelled.

If one of the subs edit box color buttons is cancelled, undo the changes
made rather than restoring the original text of the active line. This
makes the cancel button actually work with multiple lines selected, and
eliminates some undo state noise.

Closes #1465.

Originally committed to SVN as r6663.
2012-04-06 01:55:14 +00:00
Thomas Goyne acf566a062 Delete the libass vcproj as libass is no longer in-tree
Originally committed to SVN as r6662.
2012-04-04 16:46:26 +00:00
Thomas Goyne 4992d8f3c2 Remove the old portable and upgrade installers
Originally committed to SVN as r6661.
2012-04-04 16:46:20 +00:00
Thomas Goyne 8e98e6d61e Add a batch file to generate the portable self-extracting archive
Originally committed to SVN as r6660.
2012-04-04 16:46:14 +00:00
Thomas Goyne 113b09035e Add re and clipboard lua modules to the installer
Originally committed to SVN as r6659.
2012-04-04 16:46:08 +00:00
Thomas Goyne 6e877b7dea Make some very similar translatable strings identical
Originally committed to SVN as r6658.
2012-04-04 16:46:02 +00:00
Thomas Goyne 4ed11dafca Regenerate aegisub.pot. May or may not be final.
Originally committed to SVN as r6657.
2012-04-04 02:47:17 +00:00
Thomas Goyne b7c1526c7d Fix an underescaped translatable string
Originally committed to SVN as r6656.
2012-04-04 02:47:12 +00:00
Thomas Goyne e557aa866b Fix pot generation
Filter out duplicate strings, and escape backslashes from lua strings.

Include strings from aegisub.desktop.

Originally committed to SVN as r6655.
2012-04-04 02:47:05 +00:00
Thomas Goyne 566f08f308 Clean up old log files rather than just letting them accumulate forever
Originally committed to SVN as r6654.
2012-04-03 22:44:47 +00:00
Thomas Goyne bd0f6a4c2b Extract the cache cleaning logic from FFmpegSourceProvider
Originally committed to SVN as r6653.
2012-04-03 22:44:40 +00:00
Thomas Goyne 2a324a56e5 Fix crash when opening the Select Lines dialog for the second time
Originally committed to SVN as r6652.
2012-04-03 20:40:39 +00:00
Thomas Goyne 462448c7d1 Add icons to some of the dialogs missing them
Originally committed to SVN as r6651.
2012-04-03 20:40:33 +00:00
Thomas Goyne fe36760872 Use 16x16 icons for dialogs rather than cropping the 24x24 icons to 16x16
Originally committed to SVN as r6650.
2012-04-03 20:40:24 +00:00
Thomas Goyne a679d91304 Write the bytes as unsigned chars rather than signed in respack, as the array is declared as unsigned
Originally committed to SVN as r6649.
2012-04-03 20:40:18 +00:00
Thomas Goyne 4bb707d663 Use "color" in all UI strings
Previously there were 29 instances of "color" and 9 of "colour".

Originally committed to SVN as r6648.
2012-04-03 17:38:50 +00:00
Thomas Goyne b11e3d7f3a gcc 4.7 compilation fixes
Originally committed to SVN as r6647.
2012-04-03 17:38:45 +00:00
Thomas Goyne 582e947c75 Fix errors when reattaching video with some video cards
With ATI cards, deleting a wxGLContext seems to invalidate ALL
wxGlContexts, rather than just things associated with the deleted one.
This resulted in video breaking after closing the detached video dialog,
as the embedded video display was trying to use an invalidated context.
To work around this, delete and recreate the context when reattaching
video.

Also recreate the visual typesetting tool as OpenGLText holds references
to textures created on construction.

Originally committed to SVN as r6646.
2012-04-03 17:38:38 +00:00
Thomas Goyne 9f9ada8f8d Fix race condition that could result in a crash when opening video
When opening the video resulted in the script resolution changing, the
subtitles file was committed at a time when IsLoaded() would return true
but VideoOpen hadn't been signalled yet, resulting in some VideoDisplay
code running before the display was initialized. If the video opened is
sufficiently fast to decode, this could result in a crash due to trying
to display a frame before the display is shown.

Originally committed to SVN as r6645.
2012-04-02 04:22:22 +00:00
Thomas Goyne 4d50efc256 Add a help button to the preferences dialog
Originally committed to SVN as r6644.
2012-04-01 02:43:01 +00:00
Thomas Goyne 8f7d3ba8b8 Move audio color schemes to the Colours page
Originally committed to SVN as r6643.
2012-03-31 17:38:33 +00:00
Thomas Goyne da8ea6d220 Reword a few option labels in the preferences dialog
Originally committed to SVN as r6642.
2012-03-31 17:38:27 +00:00
Thomas Goyne 25f5254e1b Let the user set FFMS2 decoding threads to -1
Originally committed to SVN as r6641.
2012-03-31 17:38:22 +00:00
Thomas Goyne 4f32fe2db4 Increase default undo levels to 50
Typical computers have far more RAM than they did in 2005, and the
memory required for each undo state is far lower than when the default
was first set to 8.

Originally committed to SVN as r6640.
2012-03-31 17:38:16 +00:00
Thomas Goyne e6697b1923 Fix fallbacks for invalid characters when converting charsets
r6632 made ConverterImpl have a vtable, which makes the iconv_fallbacks
parent no longer the first thing in the object, so add an explicit cast.

Originally committed to SVN as r6639.
2012-03-31 00:28:55 +00:00
Thomas Goyne 2d9213cdfc Add support for writing unformatted level 1 teletext to the EBU STL subtitle format
Originally committed to SVN as r6638.
2012-03-29 19:05:45 +00:00
Thomas Goyne 7335c520c1 Ensure that the text field is terminated when writing EBU STL files
The text field must be terminated with 0x8F, so write an extra block if
the last block is filled exactly.

Originally committed to SVN as r6637.
2012-03-29 19:05:37 +00:00
Thomas Goyne 4294e5857d Port the EBU STL (tech 3264) subtitle format from 2.1.9
Split the configuration dialog off into its own file and mostly decouple
it from the subtitle format.

Save last used export settings to options and restore them the next time
the dialog is opened.

Use libaegisub for charset conversion and IO rather than wxWidgets.

Use libaegisub's line-wrapping logic and finish implementing all of the
various wrapping modes.

Make unchecking the "Translate alignments" checkbox do something.

Originally committed to SVN as r6636.
2012-03-29 19:05:26 +00:00
Thomas Goyne 028fd3b4ba Add line-wrapping logic to libaegisub
Originally committed to SVN as r6635.
2012-03-29 19:05:16 +00:00
Thomas Goyne 39ca0c1b5b Fix some uses of uninitialized values on startup
Originally committed to SVN as r6634.
2012-03-29 19:05:07 +00:00
Thomas Goyne dd0b1cf5ec Disable the busy cursor while displaying the FPS prompt when exporting subtitles
Originally committed to SVN as r6633.
2012-03-29 19:04:58 +00:00
Thomas Goyne f31d9a5a8b Add converter to ISO-6937-2
glibc's iconv implementation supports ISO-6937-2, but libiconv doesn't
due to that these days the only place it's used is in a few old subtitle
formats. As a result, on everything but linux we need our own converter.

Conversion from ISO-6937-2 is currently not supported.

Originally committed to SVN as r6632.
2012-03-29 19:04:49 +00:00
Thomas Goyne 71776940f6 Rewrite SMPTE timecode handling
Move SMPTE handling to agi::vfr::Framerate to get all of the interesting
logic dealing with timcodes in one place, and to make it testable.

Completely rewrite the SMPTE time conversions as testing them reveals
that they were incorrect in some cases.

Originally committed to SVN as r6631.
2012-03-29 19:04:36 +00:00
Thomas Goyne c7d3c8a5c3 Override CanWriteFile in the transation subtitle format as the default doesn't work for it
Originally committed to SVN as r6630.
2012-03-29 00:05:34 +00:00
Thomas Goyne c4a1a93b97 Center most of the message boxes over their parent windows
Originally committed to SVN as r6629.
2012-03-28 23:59:19 +00:00
Thomas Goyne 31a0146df2 Fix crash when clicking the sort button in the style manager with no styles selected
Originally committed to SVN as r6628.
2012-03-28 23:59:10 +00:00
Thomas Goyne a76fb7c432 Override CanSave in the SRT format to allow supported override tags
Originally committed to SVN as r6627.
2012-03-28 23:59:01 +00:00
Thomas Goyne d49e59653f Add a version of ParseASSTags that returns the blocks rather than mutating the line
Originally committed to SVN as r6626.
2012-03-28 23:58:50 +00:00
Thomas Goyne a03b37bdef Move the CanSave logic to the subtitle formats as it's obviously format-specific
Originally committed to SVN as r6625.
2012-03-28 23:58:40 +00:00
Thomas Goyne 0ae8479ffb Remove the check for timing in AssFile::CanSave as all non-txt formats support timing
Originally committed to SVN as r6624.
2012-03-28 23:58:28 +00:00
Thomas Goyne 6e36a897d0 Don't allow dragging audio markers to negative times
As ASS doesn't support negative times, some of the other code assumes
that times are >= 0, and it's never actually useful to have a negative
start time.

Originally committed to SVN as r6623.
2012-03-27 23:15:20 +00:00
Thomas Goyne e4043e64a3 Add support for omitted parameters in tags to the SRT exporter
Originally committed to SVN as r6622.
2012-03-27 23:15:12 +00:00
Thomas Goyne 87d5b1b943 Fix error when exporting a file with \bord tags to SRT
Originally committed to SVN as r6621.
2012-03-27 23:15:03 +00:00
Thomas Goyne fccec60fec Center the load/unload dialog over the main window
Originally committed to SVN as r6620.
2012-03-27 23:14:42 +00:00
Thomas Goyne d3eaa5af9c Remove some unused options from the config file and preferences dialog
Originally committed to SVN as r6619.
2012-03-27 04:23:54 +00:00
Thomas Goyne 1d289bf8f8 Rework FrameMain::LoadList and OnSubtitlesOpen a bit
Fix some issues where a spurious load/unload dialog would be displayed
despite that nothing would be loaded even if the user selected yes, and
double-loading of audio when opening video and audio files with
automatic audio loading enabled.

Originally committed to SVN as r6618.
2012-03-27 04:23:45 +00:00
Thomas Goyne 3f70491ea6 Eliminate a few unneeded header inclusions
Originally committed to SVN as r6617.
2012-03-27 00:50:03 +00:00
Thomas Goyne b201bee1d1 Don't mark file format filters as translatable
Originally committed to SVN as r6616.
2012-03-27 00:49:53 +00:00
Thomas Goyne fb7638312a Make PrettySize less dumb
Originally committed to SVN as r6615.
2012-03-27 00:49:43 +00:00
Thomas Goyne 30f0a56832 Document some of the utils functions
Originally committed to SVN as r6614.
2012-03-27 00:49:33 +00:00
Thomas Goyne e6f55bdbcb Use a binary search in IsWhitespace rather than linear
Originally committed to SVN as r6613.
2012-03-27 00:49:24 +00:00
Thomas Goyne 1f1e9a700a Use std::binary_search rather than a set in GetWordBoundaries
This is slightly faster and simpler.

Originally committed to SVN as r6612.
2012-03-27 00:49:15 +00:00
Thomas Goyne 909a0ca280 Remove some unused functions
Originally committed to SVN as r6611.
2012-03-27 00:49:05 +00:00
Thomas Goyne 7f427e01df Fix completely wrong results from the Kanji timer
Durations were being set in milliseconds rather than centiseconds.

Originally committed to SVN as r6610.
2012-03-27 00:48:56 +00:00
Thomas Goyne 232bae36e7 Fix crash when the Accept button in the kanji timer is clicked at a time when there's nothing to accept
Originally committed to SVN as r6609.
2012-03-27 00:48:47 +00:00
Thomas Goyne f9e8d89059 Remove some unused stuff in the kanji timer
Originally committed to SVN as r6608.
2012-03-27 00:48:38 +00:00
Thomas Goyne 2ef193e197 Remove pointless translatable strings that are never actually displayed
Originally committed to SVN as r6607.
2012-03-27 00:48:28 +00:00
Thomas Goyne 52b1a74f12 Remove todo comment from DirectSoundPlayer, as the player was rewritten entirely instead (years ago)
Originally committed to SVN as r6606.
2012-03-25 04:05:51 +00:00
Thomas Goyne 7218c04d52 Kill AudioPlayer::displayTimer
The rewritten audio display does not use displayTimer and that
functionality shouldn't have been in the players in the first place.

Originally committed to SVN as r6605.
2012-03-25 04:05:44 +00:00
Thomas Goyne 2840fc0aea Replace most remaining uses of std::auto_ptr with agi::scoped_ptr
Originally committed to SVN as r6604.
2012-03-25 04:05:38 +00:00
Thomas Goyne 55f9ccc18d Remove AudioPlayer::GetProvider()
There's really no reason why anything should ever be getting the audio
provider from an audio player.

Originally committed to SVN as r6603.
2012-03-25 04:05:31 +00:00
Thomas Goyne e120bec4f0 Clean up AegisubLocale a bit
Don't let the user cancel the language selection dialog on first
startup, and don't bother with the dialog at all if there's only one
language available.

Originally committed to SVN as r6602.
2012-03-25 04:05:25 +00:00
Thomas Goyne 0b9a21bf82 Hide SinkMessage's copy constructor and assignment operator
Originally committed to SVN as r6601.
2012-03-25 04:05:20 +00:00
Thomas Goyne b32515da80 Strip trailing whitespace from all cpp and h files
Originally committed to SVN as r6600.
2012-03-25 04:05:06 +00:00
Thomas Goyne 1077b9b5c4 Rewrite the Resample Resolution dialog
Use more appropriate controls rather than a pile of text ctrls and some
not-entirely-correct validation of the values.

Split apart the dialog and the actual resampling logic.

Originally committed to SVN as r6599.
2012-03-25 04:04:59 +00:00
Thomas Goyne 6f167e9293 Add functions for converting between SSA and ASS aligns to AssStyle
Originally committed to SVN as r6598.
2012-03-25 04:04:54 +00:00
Thomas Goyne 2036712acb Don't display an error when the user cancels an export
Originally committed to SVN as r6597.
2012-03-25 04:04:48 +00:00
Thomas Goyne ae5d6edaed End the batch if the Paste Over dialog is cancelled rather than horribly breaking everything
Originally committed to SVN as r6596.
2012-03-25 04:04:42 +00:00
Thomas Goyne ddc70bcd9c Add Paste Over to the default grid context menu
Originally committed to SVN as r6595.
2012-03-23 21:47:55 +00:00
Thomas Goyne a815d35f51 Unswap preserve and estimate times when splitting lines at the cursor
Originally committed to SVN as r6594.
2012-03-23 03:45:35 +00:00
Thomas Goyne 73e81c3dca Rewrite the overscan mask logic so that it works with blackbarred detached video
Originally committed to SVN as r6593.
2012-03-20 00:39:42 +00:00
Thomas Goyne d86d56d816 Move bicubic point interpolation logic to SplineCurve
Originally committed to SVN as r6592.
2012-03-20 00:39:33 +00:00
Thomas Goyne ca76c5cf21 Delete some declarations for nonexistent methods
Originally committed to SVN as r6591.
2012-03-20 00:39:25 +00:00
Thomas Goyne 75ae053958 Make some stuff const
Originally committed to SVN as r6590.
2012-03-20 00:39:10 +00:00
Thomas Goyne 36d962931d Eliminate overly-early rounding that resulted in the waveform renderer being significantly wrong at some zoom levels
Originally committed to SVN as r6589.
2012-03-18 18:41:48 +00:00
Thomas Goyne 4d2623bc2a Really fix crash when switching lines with the drag visual tool active
Originally committed to SVN as r6588.
2012-03-15 00:25:54 +00:00
Thomas Goyne cbf9ee463e Remove export_clean_info.h/cpp from the vcproj
Originally committed to SVN as r6587.
2012-03-12 23:39:51 +00:00
Thomas Goyne 9f43f9f041 Rewrite the Clean Script Info export filter in lua
This makes it easy to make it a macro in addition to an export filter,
and simplifies the implementation.

Originally committed to SVN as r6586.
2012-03-12 23:35:56 +00:00
Thomas Goyne 2fa054b48b Extract strings from the lua scripts for translation
Originally committed to SVN as r6585.
2012-03-12 23:35:47 +00:00
Thomas Goyne f4c1fb441e Mark the names and descriptions of included lua macros as translatable
Originally committed to SVN as r6584.
2012-03-12 23:35:37 +00:00
Thomas Goyne 55eb230ef6 Add aegisub.gettext to get translations of strings
Originally committed to SVN as r6583.
2012-03-12 23:35:29 +00:00
Thomas Goyne f66c772130 Ensure the hotkey descriptions in the translation and styling assistants actually get marked as translatable
Originally committed to SVN as r6582.
2012-03-12 23:35:20 +00:00
Thomas Goyne 4153bbc10b Fix pointlessly different strings in the translation and styling assistant
Originally committed to SVN as r6581.
2012-03-12 23:35:11 +00:00
Thomas Goyne 212013ccdf Add Delete line to the hotkeys listed in the translation assistant
Originally committed to SVN as r6580.
2012-03-12 23:35:03 +00:00
Thomas Goyne d0150d6b6d Handle external changes in the translation assisant
As all program hotkeys are now allowed while the translation assistant
is active, it can no longer assume that it's the only thing modifying
the file.

Originally committed to SVN as r6579.
2012-03-12 23:34:54 +00:00
Thomas Goyne 7e5b241260 Use SubsTextEditCtrl in the translation assistant
This gives spellchecking and thesaurus support for the translation (and
syntax highlighting, but that usually won't be useful).

Originally committed to SVN as r6578.
2012-03-12 23:34:45 +00:00
Thomas Goyne de9cc755d2 Stop key event propagation when checking for hotkeys to avoid checking keypresses that aren't hotkeys several times
Originally committed to SVN as r6577.
2012-03-12 23:34:34 +00:00
Thomas Goyne 14274a7672 Forward Cut/Copy/Paste to all text areas, not just the main subs edit box
Originally committed to SVN as r6576.
2012-03-12 23:34:25 +00:00
Thomas Goyne 42b1d4d4eb Fix some misleading variable shadowing
Originally committed to SVN as r6575.
2012-03-12 23:34:16 +00:00
Thomas Goyne 29fcf9de44 Fix new[]/delete mismatch
Originally committed to SVN as r6574.
2012-03-12 23:34:05 +00:00
Thomas Goyne 4a151ca995 Set all selected lines on clicks in dialogue mode rather than just the active line
Originally committed to SVN as r6573.
2012-03-12 00:07:33 +00:00
Thomas Goyne dcffc3fd38 Show all selected lines in the audio display in dialogue mode
Originally committed to SVN as r6572.
2012-03-12 00:07:27 +00:00
Thomas Goyne a48190871b In karaoke mode use the Selected style for the portion of the active line not in the active syllable
Originally committed to SVN as r6571.
2012-03-12 00:07:22 +00:00
Thomas Goyne aba0b5db11 Add support for the Selected style to the audio renderers
Originally committed to SVN as r6570.
2012-03-12 00:07:16 +00:00
Thomas Goyne 812e2e8025 Document a few classes
Originally committed to SVN as r6569.
2012-03-12 00:07:09 +00:00
Thomas Goyne 30d7a18e97 Add missing spaces after colons in error messages
Originally committed to SVN as r6568.
2012-03-11 23:51:10 +00:00
Thomas Goyne 175443d7a6 Fix int overflow in DAR calculation
Originally committed to SVN as r6567.
2012-03-11 23:51:04 +00:00
Thomas Goyne 77e755d109 Allow duplicated timestamps as real files do have them; simply skip all but the last frame with the same timestamp
Originally committed to SVN as r6566.
2012-03-11 23:05:08 +00:00
Thomas Goyne ebe32890fb Don't scroll to the beginning of the audio when switching to an untimed line
Originally committed to SVN as r6565.
2012-03-11 23:05:02 +00:00
Thomas Goyne 1d4c0c0712 Apply bounds checking to AssTimes generated from strings
Originally committed to SVN as r6564.
2012-03-11 23:04:56 +00:00
Thomas Goyne 43f461e846 Delete the dialog manager before the main frame as having modeless dialogs disappear after the main window is ugly
Originally committed to SVN as r6563.
2012-03-11 23:04:49 +00:00
Thomas Goyne 284eac1c93 Fix check for Darwin in the tests makefile
Originally committed to SVN as r6562.
2012-03-11 23:04:42 +00:00
Thomas Goyne 3e3a853a89 Fix iterator increment after erase in VisualToolDrag
Originally committed to SVN as r6561.
2012-03-10 02:16:38 +00:00
Thomas Goyne 29662749db Fix case-insensitive regular expressions in the Select Lines dialog
Originally committed to SVN as r6560.
2012-03-10 02:16:28 +00:00
Thomas Goyne 12511901a9 Fix bad string concatenation in a json parse error message
Originally committed to SVN as r6559.
2012-03-10 02:16:20 +00:00
Thomas Goyne 759b8433c1 Silence some clang warnings
Originally committed to SVN as r6558.
2012-03-10 02:16:08 +00:00
Thomas Goyne fed2a91598 Non-precomp header compilation
Originally committed to SVN as r6557.
2012-03-10 02:15:58 +00:00
Thomas Goyne 7f8aecd7fa Use int64_t for progress reporting rather than int as it's what ffms2 requires. Fixes magic jumping progress bars during indexing.
Originally committed to SVN as r6556.
2012-03-10 01:00:13 +00:00
Thomas Goyne 8ec478db36 Make the fonts collector dialog modeless
Originally committed to SVN as r6555.
2012-03-09 00:24:01 +00:00
Thomas Goyne 6b141f2bd3 Fix gcc compilation errors
Originally committed to SVN as r6554.
2012-03-09 00:23:53 +00:00
Thomas Goyne 36548b93b1 Add a dialog manager for modeless dialogs so that they don't have to all be stuffed into the context
Originally committed to SVN as r6553.
2012-03-09 00:23:41 +00:00
Thomas Goyne 41f2f67042 Make the automation manager dialog modeless
Originally committed to SVN as r6552.
2012-03-09 00:23:30 +00:00
Thomas Goyne 931de846ae Ignore \an and \a tags with out of bounds values rather than doing odd things
Originally committed to SVN as r6551.
2012-03-09 00:23:22 +00:00
Thomas Goyne eea914fa48 Don't select the start handle when a line is selected due to a click on the end handle in the drag visual tool
Originally committed to SVN as r6550.
2012-03-09 00:23:14 +00:00
Thomas Goyne 229daa9874 Update the color of the drag handles in the drag visual tool immediately when the selection changes
Originally committed to SVN as r6549.
2012-03-09 00:23:04 +00:00
Thomas Goyne d8e0038333 Fix SVN revision check with SVN 1.7 when the aegisub directory is not the top level directory of the working copy. Patch by Larso. Closes #1458.
Originally committed to SVN as r6548.
2012-03-08 05:07:15 +00:00
Thomas Goyne 59447a942d Make the style manager dialog modeless
Originally committed to SVN as r6547.
2012-03-08 04:17:42 +00:00
Thomas Goyne 83faddfdb6 Refactor New/Copy/Edit in the style manager a bit and do a better job of selecting the right style in the lists
Originally committed to SVN as r6546.
2012-03-08 04:17:36 +00:00
Thomas Goyne b5a71587ff Move more of the style storage management logic to AssStyleStorage
Originally committed to SVN as r6545.
2012-03-08 04:17:29 +00:00
Thomas Goyne a09d96df1f Make AssStyleStorage keep track of the current catalog name
Originally committed to SVN as r6544.
2012-03-08 04:17:23 +00:00
Thomas Goyne fa06033762 Ensure that there is always at least one style catalog existing and selected so that the style manager doesn't have to check if there is one
Originally committed to SVN as r6543.
2012-03-08 04:17:17 +00:00
Thomas Goyne a0b4da90f7 Add commands and menu entries to sort only the selected lines. Closes #1457.
Originally committed to SVN as r6542.
2012-03-07 22:41:12 +00:00
Thomas Goyne c84c9fe6b8 Fix issues with audio auto scrolling and lines longer than the display
Clicking on the audio display (to change line timing) now never scrolls
the display, rather than jumping around if the line is too long to fit
on the display.

Dragged markers are now always kept visible in the display, even if auto
scroll is off.

Originally committed to SVN as r6541.
2012-03-07 22:41:03 +00:00
Thomas Goyne 9f6bb17379 Fix bug where the Actor box would get incorrectly set to the placeholder text
Originally committed to SVN as r6540.
2012-03-07 22:40:54 +00:00
Thomas Goyne b64e1f925c Coalesce typing in the Actor box (but not selections from the dropdown)
Originally committed to SVN as r6539.
2012-03-07 22:40:45 +00:00
Thomas Goyne 94b3764a91 Coalesce changes made in the Effect box
Originally committed to SVN as r6538.
2012-03-07 22:40:35 +00:00
Thomas Goyne 49ce5275d1 Only prompt to update references to a renamed style if there actually are any
Originally committed to SVN as r6537.
2012-03-07 22:40:26 +00:00
Thomas Goyne f4e1b28c9f Rework handling of copied styles in the style manager a bit
Generate the new name in the style manager rather than the editor so
that the naming scheme of copies is consistent between the Copy buttons
and pasting styles.

Name the second copy of style X "X - Copy (2)" rather than "X - Copy -
Copy", and so on for further copies. (Copies of style "X - Copy" would
still be named "X - Copy - Copy").

Select the new style when a copy is created.

Originally committed to SVN as r6536.
2012-03-07 22:40:15 +00:00
Thomas Goyne 366baff2f8 Add option to force all video opened with FFMS2 to BT.601 for VSFilter compatibility
Originally committed to SVN as r6535.
2012-03-07 04:25:46 +00:00
Thomas Goyne bb9859c70f Fix crash when selecting pure black in the color picker when the recent colors list isn't full
Originally committed to SVN as r6534.
2012-03-07 01:31:04 +00:00
Thomas Goyne 110c2358a6 Use validators for reading values from all lua controls
Fixes some issues with control values not being read back correctly.

Originally committed to SVN as r6533.
2012-03-07 01:30:52 +00:00
Niels Martin Hansen 95fe56d41b Fix compilation with dummy font file lister (i.e. without FT2/FC.)
Originally committed to SVN as r6532.
2012-03-03 01:51:14 +00:00
Niels Martin Hansen 2ddde60efd Stop MSBuild warning about two different specifications of output file name for executables being different.
This prevented the VS debugger from launching properly.

Originally committed to SVN as r6531.
2012-03-03 01:49:42 +00:00
Niels Martin Hansen 3403bd6113 Add some kind of (really untested, but it compiles!) exception data fetching/command line arguments to w32dumper.
Suggest a format for Aegisub to report its crash information to the dumper.

Originally committed to SVN as r6530.
2012-03-03 01:48:23 +00:00
Niels Martin Hansen 4246ea0bd8 Fixed w32dumper GUI so the listbox shows things chronologically instead of lexically.
Also be more correct in the DialogProc implementation.

Originally committed to SVN as r6529.
2012-03-01 00:37:34 +00:00
Niels Martin Hansen 0a6a045241 Experimental minidump writer for Win32. Kinda buggy but kinda works.
Originally committed to SVN as r6528.
2012-03-01 00:12:04 +00:00
Thomas Goyne d9c0f79910 Add wxwin.m4 to m4macros as it changes very rarely and people are terrible at setting their aclocal paths correctly
Originally committed to SVN as r6527.
2012-02-29 01:24:24 +00:00
Thomas Goyne af58db5b9e Fix reindexing of files on every open
FFMS_IndexBelongsToFile returns 0 when the index belongs to the file,
not 1.

Originally committed to SVN as r6526.
2012-02-29 01:24:16 +00:00
Thomas Goyne d53bb22d2b Split the "am/manager" command into several subcommands so that it can be hotkeyed usefully
Originally committed to SVN as r6525.
2012-02-29 01:24:04 +00:00
Thomas Goyne b9fc28b44d Implement min, max and step for floatedit in lua dialogs
Originally committed to SVN as r6524.
2012-02-28 01:23:24 +00:00
Thomas Goyne 27144a7ef7 Fix min/max for lua intedit controls
Originally committed to SVN as r6523.
2012-02-28 01:23:15 +00:00
Thomas Goyne 24fbf25882 Fix duplication of source syllables when linking in the kanji timer
Originally committed to SVN as r6522.
2012-02-28 01:23:07 +00:00
Thomas Goyne 0d703cff69 Don't save empty hotkeys
Originally committed to SVN as r6521.
2012-02-28 01:22:58 +00:00
Thomas Goyne 95a1e187a0 Combine the Subtitles and Interface pages of the preferences dialog as they both have subs edit box and subs grid options
Originally committed to SVN as r6520.
2012-02-28 01:22:49 +00:00
Thomas Goyne 70261b6466 Disable the controls for mutally exclusive and unused options in the preferences dialog
Originally committed to SVN as r6519.
2012-02-28 01:22:40 +00:00
Thomas Goyne c4cba875b4 Always index all tracks when "Video/Open Audio" is enabled, as it'll always double-index otherwise
Originally committed to SVN as r6518.
2012-02-28 01:22:29 +00:00
Thomas Goyne 93d3895a2a Include font_file_lister.h in font_file_lister.cpp, not font_file_lister_fontconfig.h
Originally committed to SVN as r6517.
2012-02-25 02:58:23 +00:00
Thomas Goyne d942663316 Remove the "Link commiting of times" option
It doesn't actually do anything anymore due to that changed to the time
boxes are committed automatically.

Originally committed to SVN as r6516.
2012-02-25 02:58:14 +00:00
Thomas Goyne 451b262672 Increment iterators before erasing them rather than after
Originally committed to SVN as r6515.
2012-02-25 02:58:04 +00:00
Niels Martin Hansen 45da185a43 A bunch of fixes to the MSBuild projects.
Originally committed to SVN as r6514.
2012-02-24 22:48:52 +00:00
Thomas Goyne 5fd05762bd Remove all references to QuickTime, as the QuickTime provider is long gone
Originally committed to SVN as r6513.
2012-02-23 19:28:29 +00:00
Thomas Goyne 5f82f5b2d7 OS X compilation fixes
Originally committed to SVN as r6512.
2012-02-23 19:28:19 +00:00
Thomas Goyne 45dbc8bd15 Fix checks for which OpenGL headers to include on OS X
Originally committed to SVN as r6511.
2012-02-23 19:28:08 +00:00
Thomas Goyne 0d45f98ae8 Cast time_ts passed to printf to a known type
Originally committed to SVN as r6510.
2012-02-23 19:28:00 +00:00
Thomas Goyne 9e6d782339 Remove invalid spaces in the OSX link command
Originally committed to SVN as r6509.
2012-02-23 19:27:51 +00:00
Thomas Goyne 6cf122dea2 Remove the time_t overload of UnknownElement and just cast to int64_t
Originally committed to SVN as r6508.
2012-02-23 19:27:42 +00:00
Thomas Goyne f54d381f94 Don't skip the OS X OpenGL check when X is detected
Originally committed to SVN as r6507.
2012-02-23 19:27:32 +00:00
Thomas Goyne ea130d9af2 Automatically set the aspect ratio when opening anamorphic video with ffms
Originally committed to SVN as r6506.
2012-02-23 01:30:59 +00:00
Thomas Goyne 7e87e95526 Send text updated events when pasting into time edits
Originally committed to SVN as r6505.
2012-02-23 00:46:33 +00:00
Thomas Goyne 7992009392 Treat an unclosed override block as plain text in the syntax highlighter to match vsfilter
Originally committed to SVN as r6504.
2012-02-22 22:36:55 +00:00
Thomas Goyne 7e9608cf7a Adjust syntax highlighting of template lines to match how karaoke templater parses the line
Originally committed to SVN as r6503.
2012-02-22 22:36:45 +00:00
Thomas Goyne d5577b994c Move lead in/out logic to the timing controllers
This makes adding lead in/out work correctly when autocommit is
disabled, and improves the behavior of adding lead-in when in karaoke
mode.

Originally committed to SVN as r6502.
2012-02-22 22:00:54 +00:00
Thomas Goyne c4daf860e5 Add a lua module for reading from/writing to the clipboard
Originally committed to SVN as r6501.
2012-02-22 20:47:34 +00:00
Thomas Goyne 74fcf68fe2 Improve the error message when autoload scripts fail to load
Remove a reference to errors "above" as the message appears both above
and below the actual errors.

Shorten the message a bit to reduce the chance of it getting truncated
by wx.

Fix the name of the button in the automation manager dialog.

Originally committed to SVN as r6500.
2012-02-22 20:47:24 +00:00
Thomas Goyne b59b3c56fc Add lua bindings for open and save standard dialogs
Originally committed to SVN as r6499.
2012-02-22 04:17:16 +00:00
Thomas Goyne 048fc44cfa Add aegisub.file_name() to get the file name of the subtitles file
If called during a macro processing or validation function when the
subtitles have a valid file name (i.e. they've been saved and are not
Untitled), this returns the name of the file, without the path. If
called at any other time, it returns nil.

Originally committed to SVN as r6498.
2012-02-21 23:32:58 +00:00
Thomas Goyne 2dd01747f8 Fix crash on underrun in the alsa player
Originally committed to SVN as r6497.
2012-02-20 18:22:43 +00:00
Thomas Goyne fb6d3daf8b Eliminate all uses of volatile in the alsa player and just lock reads instead
Originally committed to SVN as r6496.
2012-02-20 18:22:37 +00:00
Thomas Goyne df73e15f0f Include C++ versions of C headers rather than the C versions
Originally committed to SVN as r6495.
2012-02-20 18:22:31 +00:00
Thomas Goyne 3fdb50925e Explicitly flag the precompiled header as a C++ header to silence a clang warning
Originally committed to SVN as r6494.
2012-02-20 18:22:25 +00:00
Thomas Goyne f79e933ac9 Bump required version of ffms2 to 2.16
Originally committed to SVN as r6493.
2012-02-20 18:22:20 +00:00
Thomas Goyne 17b0d83831 Use scoped_holder in a handful of places
Originally committed to SVN as r6492.
2012-02-20 18:22:12 +00:00
Thomas Goyne b9ddf00ead Add a scoped holder similar to scoped_ptr for handles that may or may not be pointers
Originally committed to SVN as r6491.
2012-02-20 18:22:04 +00:00
Thomas Goyne ad7d7c2be3 Don't return a dummy icon when no icon is found for a command
The hotkey editor initially required this, but now that we've using
fully custom renderers they're no longer needed, and the blank icons
didn't work correctly on wxGTK.

Originally committed to SVN as r6490.
2012-02-20 05:41:54 +00:00
Thomas Goyne 113c85bda0 Fix crash on aegisub.log(0, nil)
Originally committed to SVN as r6489.
2012-02-20 05:15:18 +00:00
Thomas Goyne 53c2c8821b Redesign BlockCache's age tracking to run in constant time
Speeds up spectrum painting by 40-90% depending on how much of the audio
data is being read from the cache.

Originally committed to SVN as r6488.
2012-02-20 05:15:10 +00:00
Thomas Goyne ffa7e70f5c Fix compilation on 64-bit linux with clang
Originally committed to SVN as r6487.
2012-02-20 05:15:00 +00:00
Thomas Goyne 8e0f6c8d25 Add KP_Enter to the default hotkeys for commit in the translation assistant and styling assistant. Closes #1414.
Originally committed to SVN as r6486.
2012-02-18 00:41:18 +00:00
Thomas Goyne 7f513e675d Replace newlines with \N when modifying text via the translation assistant. Updates #1414.
Originally committed to SVN as r6485.
2012-02-18 00:41:08 +00:00
Thomas Goyne b1930f06e5 Actually set the volume/audio zoom to the saved values rather than just setting the slider positions
Originally committed to SVN as r6484.
2012-02-18 00:40:58 +00:00
Thomas Goyne 72ee3efdc3 Rename the audio rendering style enum values to reflect how they're actually used
Originally committed to SVN as r6483.
2012-02-17 00:14:45 +00:00
Thomas Goyne 57b6a1f03a Remove the nonfunctional Restore Defaults button from the preferences dialog
Originally committed to SVN as r6482.
2012-02-17 00:14:35 +00:00
Thomas Goyne 46254613c8 Batch up log messages in DialogProgress and append them in OnIdle
This signficantly improves performance with spammy automation macros
(karaoke templater with the log level set to Trace is 10-15x faster),
and helps ensure that clicks on the Cancel button are actually processed
in a timely manner.

Originally committed to SVN as r6481.
2012-02-16 21:22:04 +00:00
Thomas Goyne a3ef701f17 Add a [Script Info] section in SetScriptInfo if none exists
Originally committed to SVN as r6480.
2012-02-16 21:21:55 +00:00
Thomas Goyne e5e2b84b15 Ensure that loaded files always have a style and dialogue line
Fixes crashes and general brokenness when opening invalid files.

Originally committed to SVN as r6479.
2012-02-16 21:21:35 +00:00
Thomas Goyne fc64bcaa36 Don't normalize syllable durations when parsing karaoke for automation
Originally committed to SVN as r6478.
2012-02-16 05:21:00 +00:00
Thomas Goyne 6339df3521 Correct the calculation for the position of right-aligned lines in the visual tools
Originally committed to SVN as r6477.
2012-02-16 03:52:50 +00:00
Thomas Goyne 9b69ce7a27 Add support for noncontiguous selections to the duplicate lines commands
Originally committed to SVN as r6476.
2012-02-15 22:14:10 +00:00
Thomas Goyne d4e1c90a04 Force a repaint of the window after opening files from the command line. Closes #1419.
Originally committed to SVN as r6475.
2012-02-15 21:24:00 +00:00
Thomas Goyne a2872158a9 Remember the last used audio zoom and volume and restore it
Originally committed to SVN as r6474.
2012-02-15 21:23:52 +00:00
Thomas Goyne 5bf7342019 Add a Lua binding for wxRegEx
Lua's built in regular expression engine is rather limited in features
compared to wx's, and operates on bytes rather than characters due to
not being unicode-aware.

Originally committed to SVN as r6473.
2012-02-15 21:23:42 +00:00
Thomas Goyne 1c2fb01f0a Copy the cached entry data in AssStyle's operator=. Closes #1453.
Originally committed to SVN as r6472.
2012-02-14 00:35:41 +00:00
Thomas Goyne 17b293865b Override CanWriteFile in the Encore subtitle format as the default extension check doesn't work for the weird filename format
Originally committed to SVN as r6471.
2012-02-14 00:35:33 +00:00
Thomas Goyne 3252503eaa Check for updates after loading files passed on the command line as the update checker dialog interacts poorly with the loading modal dialogs
Originally committed to SVN as r6470.
2012-02-14 00:35:25 +00:00
Thomas Goyne 105a6bd68a Force Encore subtitles to UTF-8 as Encore doesn't like non-unicode encodings
Originally committed to SVN as r6469.
2012-02-14 00:35:16 +00:00
Thomas Goyne fae7261bd0 Make AssTime::ParseASS a constructor overload instead
Originally committed to SVN as r6468.
2012-02-14 00:35:06 +00:00
Thomas Goyne 26b7970ed0 Add missing milliseconds to samples conversion that resulted in audio playback stopping when the start or end time of the line was changed
Originally committed to SVN as r6467.
2012-02-12 04:16:21 +00:00
Thomas Goyne 437cd47cd3 Don't block editing storage styles with the same name as a style on the current script
Originally committed to SVN as r6466.
2012-02-12 04:16:14 +00:00
Thomas Goyne 952bc02c07 Enable lua stack checking in debug builds
Originally committed to SVN as r6465.
2012-02-10 02:16:49 +00:00
Thomas Goyne 3fd457ac68 Fix memory corruption after automation macro errors
Originally committed to SVN as r6464.
2012-02-10 01:41:22 +00:00
Thomas Goyne fbc93bb98a Fix non-precomp header compilation
Originally committed to SVN as r6463.
2012-02-10 00:04:42 +00:00
Thomas Goyne 30e1679a78 Create a new line when committing the last line via the audio display when Next Line on Commit is enabled, as in 2.1.x
Originally committed to SVN as r6462.
2012-02-10 00:04:34 +00:00
Thomas Goyne 47cf5c8629 Support dragging multiple markers at once in the dialogue timing controller
When ctrl is held down and the user clicks on one of the active line's
markers, all markers at the same position as the clicked marker (for
both active and inactive lines) are now moved along with the clicked
marker.

Closes #20.

Originally committed to SVN as r6461.
2012-02-10 00:04:24 +00:00
Thomas Goyne 32c8cc0974 Modify the TimingController interface to support dragging more than one marker at once. Updates #20.
Originally committed to SVN as r6460.
2012-02-10 00:04:13 +00:00
Thomas Goyne 51a3831794 Remove charset detection from AssFile::Load
All of the subtitle formats also already do charset detection when
needed, so doing it in it AssFile::Load is pointless and results in
performing the auto-detection even when it's pointless (because the
format isn't text-based or always uses a single encoding).

Originally committed to SVN as r6459.
2012-02-10 00:04:05 +00:00
Thomas Goyne e20bc09052 colorspace.(cpp|h) cosmetics
Originally committed to SVN as r6458.
2012-02-10 00:03:56 +00:00
Thomas Goyne 16627dbfe7 Clean up DialogVersionCheck a bit
Originally committed to SVN as r6457.
2012-02-10 00:03:46 +00:00
Thomas Goyne de7df882e9 Seek audio to the line on double-click in the grid in addition to video
Originally committed to SVN as r6456.
2012-02-07 23:17:26 +00:00
Thomas Goyne 07327c2b65 Add position information to the error message when aegisub.log is called with bad arguments
Originally committed to SVN as r6455.
2012-02-07 23:17:06 +00:00
Thomas Goyne 003322813e Clean up VideoProviderCache a bit
Originally committed to SVN as r6454.
2012-02-07 23:16:41 +00:00
Thomas Goyne 1075b71976 Prompt to update uses of the style when "Default" is renamed
As far as I can tell, Default was only excluded to avoid prompting when
creating a new style, but whether or not a style is new is now an
explicit parameter to the editor so it's unneeded.

Originally committed to SVN as r6453.
2012-02-07 20:42:44 +00:00
Thomas Goyne fcffb010b9 Fix check for \i?clip in cleantags. Updates #1450.
Originally committed to SVN as r6452.
2012-02-07 01:23:00 +00:00
Thomas Goyne 26f3bb26ba Remove some incorrect uses of ellipses
Ellipses are used to indicate that a command will require additional
input from the user, not that a dialog will be opened.

Originally committed to SVN as r6451.
2012-02-07 01:22:50 +00:00
Thomas Goyne b262a07180 Don't mark paths as translatable
Originally committed to SVN as r6450.
2012-02-07 01:22:42 +00:00
Thomas Goyne 5e96d6e8c3 Remove periods from single-sentence tooltips
Originally committed to SVN as r6449.
2012-02-07 01:22:32 +00:00
Thomas Goyne 38c905d32a Call Validate before invoking commands via hotkeys
Originally committed to SVN as r6448.
2012-02-07 01:22:23 +00:00
Thomas Goyne 51cbc353b3 Fix crashes after reloading automation scripts
Originally committed to SVN as r6447.
2012-02-07 01:22:15 +00:00
Thomas Goyne 489d5bbec6 Ignore the Maximize option for dialogs which aren't supposed to be maximizable. Closes #1451.
Originally committed to SVN as r6446.
2012-02-07 01:22:06 +00:00
Thomas Goyne 813f23e762 Check whether the dialog is maximized rather than whether it's not iconized in PersistLocation. Updates #1451.
Originally committed to SVN as r6445.
2012-02-07 01:21:56 +00:00
Thomas Goyne 5a53aa5511 Delete aegisub.h. It's been a few years since it last had anything in it.
Originally committed to SVN as r6444.
2012-02-07 01:21:47 +00:00
Thomas Goyne 68c9989c89 Clean up DummyVideoProvider a bit
Originally committed to SVN as r6443.
2012-02-07 01:21:37 +00:00
Thomas Goyne f48ccc0640 Make the version check dialog a bit wider
Originally committed to SVN as r6442.
2012-02-03 00:54:09 +00:00
Thomas Goyne bd38cfc305 Only age the renderer caches when a new block is created
Originally committed to SVN as r6441.
2012-02-02 22:58:15 +00:00
Thomas Goyne fc932dddc7 Convert BlockCache from LFU to LRU
In practice there were usually <10 calls to Get per call to Age,
resulting in everything but the most recently used block having an
access count of 0. This resulted in it having essentially random
eviction, which worked decently due to the size of the cache, but with a
significant speed overhead for the LFU tracking.

Originally committed to SVN as r6440.
2012-02-02 22:58:06 +00:00
Thomas Goyne 7ca0ad3233 Repaint the entire audio display when style ranges change
In practice, painting audio from the cache isn't all that expensive, so
the limited refreshing was just introducing places for bugs without
improving performance all that much.

Closes #1432.

Originally committed to SVN as r6439.
2012-02-02 22:57:53 +00:00
Thomas Goyne ddc8dc9eca Only wrap the avisynth-using part of AvisynthVideoProvider's constructor with try/catch so that avisynth is still initialized when the catch handler runs, which is required to actually get an error message. Closes #1444.
Originally committed to SVN as r6438.
2012-02-02 20:51:07 +00:00
Thomas Goyne c5c829357d Use wxAutoBufferedPaintDC for ToggleButton
Originally committed to SVN as r6437.
2012-02-02 20:50:56 +00:00
Thomas Goyne bd7f338115 Don't copy fonts which appear in styles but are never actually used
Originally committed to SVN as r6436.
2012-02-02 19:31:37 +00:00
Thomas Goyne da61e75f75 Skip inline comments when gathering things to collect fonts for
Originally committed to SVN as r6435.
2012-02-02 19:31:27 +00:00
Thomas Goyne 6652ef40e9 Increase the amount of information reported when fonts can't be found
List the styles using the font along with lines which use the font via
overrides, and add a warning at the end when some glyphs could not be
found to reduce the chance of the user failing to notice it.

Originally committed to SVN as r6434.
2012-02-02 19:18:40 +00:00
Thomas Goyne 6c365f0e6a Remove VideoProvider::GetPosition, as it's unused and unneeded
Originally committed to SVN as r6433.
2012-02-02 19:18:30 +00:00
Thomas Goyne 6717334c12 Fix crash when trying to seek to keyframes via the video slider with no keyframes loaded, and use wxAutoBufferedPaintDC rather than manual double-buffering
Originally committed to SVN as r6432.
2012-02-02 19:18:21 +00:00
Thomas Goyne b8a7c6cb1e Remove scoped_ptr::swap
Originally committed to SVN as r6431.
2012-02-02 19:18:10 +00:00
Thomas Goyne d68a7e81b0 Add (optional) overlapping line correction to the timing postprocessor
Trying to use this at the same time as adding lead in/out will probably
not have useful results.

Originally committed to SVN as r6430.
2012-02-01 23:59:40 +00:00
Thomas Goyne eebcf34edb Don't decode audio URIs stored on the script as it currently always stores the absolute path and the decoding breaks dummy audio URIs
Originally committed to SVN as r6429.
2012-02-01 23:59:32 +00:00
Thomas Goyne 3d6e5e7d39 Fix incorrect styling of overlapping inactive lines
Originally committed to SVN as r6428.
2012-02-01 23:59:23 +00:00
Thomas Goyne aaf7285a6e Remove UI-related responsibilities from AudioController
Keeping track of audio markers and labels to be shown in the audio
display is not particularly related to AudioController's primary
responsiblity of controlling the playback of audio.

Originally committed to SVN as r6427.
2012-02-01 23:59:12 +00:00
Thomas Goyne 01b92aa4e3 Change AudioController's public API from samples to milliseconds
The sample rate of the currently open audio is not something that things
which do not interact with the raw audio data should have to care about,
or even know about.

Originally committed to SVN as r6426.
2012-02-01 23:58:58 +00:00
Thomas Goyne bba825ed0d Clear the error color when an automation script which previously failed to load loads successfully
Originally committed to SVN as r6425.
2012-02-01 18:47:47 +00:00
Thomas Goyne 9dbfe5d8e5 Update the visual tool buttons when the active tool is changed via hotkey
Originally committed to SVN as r6424.
2012-02-01 18:47:37 +00:00
Thomas Goyne 4ea45627b5 Remove periods from the end of help strings
Originally committed to SVN as r6423.
2012-02-01 18:47:26 +00:00
Thomas Goyne 2dcd4ff2a6 Mark the style name collision messages as translatable
Originally committed to SVN as r6422.
2012-02-01 18:47:18 +00:00
Thomas Goyne 439b1272b0 Select current style when the style manager is opened
Originally committed to SVN as r6421.
2012-02-01 18:47:10 +00:00
Thomas Goyne f0933ecb1a When adding new hotkeys, automatically select and start editing the new hotkey
Originally committed to SVN as r6420.
2012-02-01 18:47:00 +00:00
Thomas Goyne 499a9b2869 Set thread priorty between Create() and Run()
Originally committed to SVN as r6419.
2012-02-01 14:23:52 +00:00
Thomas Goyne fbe00eabe8 Bump up the size of the log window in the font collector dialog so that it can actually fit font names without wrapping
Originally committed to SVN as r6418.
2012-02-01 04:17:39 +00:00
Thomas Goyne db7924d646 Add a warning in the fontconfig font collector when the chosen font does not have glyphs for some of the characters used in that font
Originally committed to SVN as r6417.
2012-02-01 04:17:33 +00:00
Thomas Goyne 98b51e2c23 Clean up DialogStyleManager a bit, eliminating a decent amount of duplicated code and fixing issues with the logic for enabling and disabling the buttons.
Originally committed to SVN as r6416.
2012-02-01 00:48:50 +00:00
Thomas Goyne c6ac746215 Kill DialogStyleManager::OnClose as it just does the default thing
Originally committed to SVN as r6415.
2012-02-01 00:48:42 +00:00
Thomas Goyne b48436c5de Skip unprocessed key events in the style manager
Originally committed to SVN as r6414.
2012-02-01 00:48:33 +00:00
Thomas Goyne 3be4693480 Uncrustify AssStyleStorage a bit
Originally committed to SVN as r6413.
2012-02-01 00:48:24 +00:00
Thomas Goyne ac5af24014 Remove pointless #ifdef __APPLE__ around CmdDown()
The entire point of CmdDown is that it calls ControlDown on non-OS X, so
the ifdefs are completely pointless.

Originally committed to SVN as r6412.
2012-02-01 00:48:16 +00:00
Thomas Goyne 7bd0691bd7 In PersistLocation get the new location of the dialog directly from the dialog rather than from the event as the data in the event is wrong
Originally committed to SVN as r6411.
2012-02-01 00:48:07 +00:00
Thomas Goyne 04cc422391 Close the spell checker after all lines have been checked rather than only once there are no errors remaining. Closes #1442.
Originally committed to SVN as r6410.
2012-02-01 00:47:57 +00:00
Thomas Goyne 3af57cdbcd Copy the source line's group in AssDialogue's copy constructor as copying wxStrings is far faster than constructing new ones
Originally committed to SVN as r6409.
2012-02-01 00:47:49 +00:00
Thomas Goyne a7d54f3d69 Make AssEntry::group const as it really should never change
Originally committed to SVN as r6408.
2012-02-01 00:47:38 +00:00
Thomas Goyne 8bef1eb874 Destruct AssFiles on a background thread as it's rather slow with large files
Originally committed to SVN as r6407.
2012-02-01 00:47:28 +00:00
Thomas Goyne 64553dd633 Handle commands which change types at runtime. Closes #1413.
Originally committed to SVN as r6406.
2012-01-31 04:04:02 +00:00
Thomas Goyne 983ffc1e83 Add some dumb heuristics to detect binary files in the charset detector to avoid taking forever feeding hundreds of MB through it. Closes #1438.
Originally committed to SVN as r6405.
2012-01-31 04:03:55 +00:00
Thomas Goyne d68a395499 Open files in binary mode for charset detection
Originally committed to SVN as r6404.
2012-01-31 04:03:50 +00:00
Thomas Goyne fc96f1bd28 Swallow cancel exceptions thrown from opening audio from the script so that unrelated things aren't canceled
Originally committed to SVN as r6403.
2012-01-31 04:03:44 +00:00
Thomas Goyne f774f21903 Explicitly do nothing when an empty container is passed to delete_clear as it's oddly slow otherwise
Originally committed to SVN as r6402.
2012-01-31 00:44:55 +00:00
Thomas Goyne c2d3c910c7 Replace some uses of "" with wxString()
Despite special-casing zero-length input, wxString("") takes over four
times as long as wxString() - and on a 10k line script, this change cuts
AssFile's copy constructor's runtime in half.

Originally committed to SVN as r6401.
2012-01-31 00:44:43 +00:00
Thomas Goyne 3b0d2ae8e6 Add effect and actor to the things that lines can be sorted by
Originally committed to SVN as r6400.
2012-01-31 00:44:34 +00:00
Thomas Goyne a114238396 Use AssTime::GetASSFormated for the video position display
Originally committed to SVN as r6399.
2012-01-31 00:44:26 +00:00
Thomas Goyne 725820efc0 Add support for setting the active line from automation macros
The macro processing function can now return a second value, which is
the index of the line to make active, which must be one of the lines in
the selection. If it is not, or if the value is not present, then the
active line is left unchanged if it is in the new selection, or set to
the first line of the new selection if it is not.

Closes #1435.

Originally committed to SVN as r6398.
2012-01-31 00:44:16 +00:00
Thomas Goyne dad803e956 Set the start and end times of syllables relative to the line's start time rather than time 0 to match 2.1.x's behavior. Closes #1440.
Originally committed to SVN as r6397.
2012-01-31 00:44:07 +00:00
Thomas Goyne 4c4ea92d0f Update all spellcheckers after adding a word
Previously adding a word to the dictionary via the spell checker dialog
would not update the dictionary used by the subs edit box and
vice-versa.

Originally committed to SVN as r6396.
2012-01-31 00:43:59 +00:00
Thomas Goyne 57fc4145d9 Always use the same language for all spellchecker instances as having different languages in different places is weird
Originally committed to SVN as r6395.
2012-01-31 00:43:49 +00:00
Thomas Goyne e205f9d51b Make the 'Add to dictionary' button in the spellchecker dialog actually do something. Closes #1441.
Originally committed to SVN as r6394.
2012-01-31 00:43:40 +00:00
Thomas Goyne aa49a4eb0f Factor out the options lookups from BaseGrid::GetRowStrings so that they aren't pointlessly checked every row
Originally committed to SVN as r6393.
2012-01-31 00:43:32 +00:00
Thomas Goyne 1af19fb42e Make AssTime::GetASSFormated roughly an order of magnitude faster
Originally committed to SVN as r6392.
2012-01-31 00:43:23 +00:00
Thomas Goyne 0c972886fb Cache most of the brushes used in grid painting
Originally committed to SVN as r6391.
2012-01-31 00:43:15 +00:00
Thomas Goyne cf1425f9d1 Don't get the strings for hidden columns when painting the grid. Speeds up grid painting by up to 25%.
Originally committed to SVN as r6390.
2012-01-31 00:43:06 +00:00
Thomas Goyne b34d2c547f Use wxAutoBufferedPaintDC rather than manual double-buffering in BaseGrid, as it's simpler and slightly faster
Originally committed to SVN as r6389.
2012-01-31 00:42:58 +00:00
Thomas Goyne e5f1719d8f Use DC clipping in AudioRenderer rather than wxMemoryDC + Blit
In addition to being far simpler, this is marginally faster as
wxMemoryDC has a decent amount of overhead.

Originally committed to SVN as r6388.
2012-01-31 00:42:47 +00:00
Thomas Goyne 0bff490b7e Enable/disable the OK button in the TPP dialog when styles are (un)checked
Originally committed to SVN as r6387.
2012-01-27 23:35:31 +00:00
Thomas Goyne 049c730813 Fix handling of autosave and autobackup paths that don't end in a slash
Originally committed to SVN as r6386.
2012-01-27 21:32:48 +00:00
Thomas Goyne e258e8c25f Fix crash on empty lines in karaoke mode
Originally committed to SVN as r6385.
2012-01-27 20:04:31 +00:00
Thomas Goyne 9e3f280cda Fix bug where opening audio with audio already open would resize the audio display
Originally committed to SVN as r6384.
2012-01-27 20:04:22 +00:00
Thomas Goyne ef4c1b369d Adjust the label for the history box in the shift times dialog to suggest that old shifts can now be loaded
Originally committed to SVN as r6383.
2012-01-27 20:04:14 +00:00
Thomas Goyne 642a9df2bf Correct the tooltip for 'Shift to Current Frame'
Originally committed to SVN as r6382.
2012-01-27 20:04:05 +00:00
Thomas Goyne 78f1198426 Fix error when adding a word to the dictionary when the user dictionary file doesn't already exist
Originally committed to SVN as r6381.
2012-01-27 20:03:55 +00:00
Thomas Goyne bc9c521cfd Apply the 'Subs Edit Box' hotkey handling to all of the text boxes in the subs edit area rather than just the main text edit. Closes #1431.
Originally committed to SVN as r6380.
2012-01-27 19:23:35 +00:00
Thomas Goyne 0dc0135f9a Select the appropriate entry in the zoom dropdown when the zoom is changed externally so that keyboard navigation works. Updates #1433.
Originally committed to SVN as r6379.
2012-01-27 19:23:26 +00:00
Thomas Goyne 2d5df24fd6 Update the zoom on Enter in the zoom box. Updates #1433.
Originally committed to SVN as r6378.
2012-01-27 19:23:16 +00:00
Thomas Goyne 772c8dee3b Fix accelerator conflict between Redo and Find and Replace
Originally committed to SVN as r6377.
2012-01-27 19:23:07 +00:00
Thomas Goyne 16db1eb4dd Add more menu accelerators and fix a conflict between View and Video. Patch by catntabile. Closes #1434.
Originally committed to SVN as r6376.
2012-01-27 19:22:57 +00:00
Thomas Goyne d01c0cf501 Fix crash when drawing a vector clip that does not start with a move. Closes #1430.
Originally committed to SVN as r6375.
2012-01-27 19:22:46 +00:00
Thomas Goyne 4746ae8a1d Really unhardcode the Paste Over dialog's height rather than just the width
Originally committed to SVN as r6374.
2012-01-26 23:23:41 +00:00
Thomas Goyne a54983a9bc Fix a few minor issues with the Paste Over dialog
Remove the pointlessly hardcoded height of the checklist.

Set the parent correctly.

Set the initial focus to the OK button.

Originally committed to SVN as r6373.
2012-01-26 23:21:19 +00:00
Thomas Goyne 8c246e1cb8 Make shift-scrollwheel scroll the grid a page at a time. Closes #1407.
Originally committed to SVN as r6372.
2012-01-26 22:46:09 +00:00
Thomas Goyne 6d550b4a5d Repaint the entire grid on timing changes
Timing changes can potentially make all of the columns need to be
repainted (due to the collision line color), and the grid currently
isn't smart enough to know when this is actually the case, so just
always repaint the entire thing.

Originally committed to SVN as r6371.
2012-01-26 22:27:57 +00:00
Thomas Goyne a1ad0fa585 Use Scintilla's logic for deciding when to coalesce edit box changes
Scintilla's modification notifications don't expose enough information
to do a very good job of deciding when to group changes with previous
ones, but it does expose when Scintilla thinks undo groups should end,
so just use that.

This should significantly improve the behavior of undo when editing
lines in the edit box.

Originally committed to SVN as r6370.
2012-01-26 22:13:39 +00:00
Thomas Goyne d55f1622f1 Fix backwards-compatibilty break in the lua karaoke parser
Insert an empty syllable at the beginning of the karaoke syllable table
to better mimick 2.1.x's behavior.

Originally committed to SVN as r6369.
2012-01-26 21:19:25 +00:00
Thomas Goyne 0aec0a9d59 Add an option to skip over commented lines in the spell checker. Closes #1428.
Originally committed to SVN as r6368.
2012-01-26 20:51:08 +00:00
Thomas Goyne 92ae4a616e Fix truncation of all float fields in styles
Originally committed to SVN as r6367.
2012-01-26 20:17:31 +00:00
Thomas Goyne 99a7eece9c Significantly speed up duplicating multiple lines
SubtitlesGrid::DuplicateLines iterated over the entire file multiple
times for each line duplicated, making duplicating large numbers of
lines extremely slow.

Originally committed to SVN as r6366.
2012-01-26 20:08:54 +00:00
Thomas Goyne 15a4eca7ce Fix crash on (auto)save when using CSRI and video is open
Calling AssFile::Save/Load from multiple threads (even on different
objects) was not safe due to that is uses SubtitleFormat internally,
which was inheriently thread-unsafe. To fix this, change
SubtitleFormat's interface to support immutable implementations, and
make all of the current implementations immutable.

This isn't a perfect solution - making a subtitle format implemented in
lua immutable would be rather difficult - so at some point in the future
SubtitleFormat should probably be changed to a factory which returns new
objects from GetReader/GetWriter.

Originally committed to SVN as r6365.
2012-01-26 20:08:38 +00:00
Thomas Goyne d001d66b12 Add support for the scale parameter of vector clips. Closes #1415.
Originally committed to SVN as r6364.
2012-01-26 00:29:08 +00:00
Thomas Goyne 214079af58 Load Shift Times settings from history on double-click
Redesign how shift times history is saved. Previously it stored the
localized strings in the history file, which are not particularly
parsable as the format may differ between locales. Rather than doing
this, store the raw settings in a json file, and generate the history
strings on display. In addition to making it much easier to load old
settings, this makes it so that the history is always displayed using
the current locale, rather than the locale in which the shifting was
done.

Closes #1427.

Originally committed to SVN as r6363.
2012-01-25 23:09:45 +00:00
Thomas Goyne 2094814077 Save the current row and scroll position in the file and restore it when the file is reopened. Closes #1417.
Originally committed to SVN as r6362.
2012-01-25 19:07:36 +00:00
Thomas Goyne 71a4e38c7d Fix over-escaping that resulted in Recombine Lines stripping 't' rather than tabs. Closes #1418.
Originally committed to SVN as r6361.
2012-01-25 19:07:27 +00:00
Thomas Goyne a4eb7ef528 Fix crash with empty hotkeys. Closes #1420.
Originally committed to SVN as r6360.
2012-01-25 19:07:18 +00:00
Thomas Goyne e9dcbf66f3 Fix compilation errors when wxUSE_ON_FATAL_EXCEPTION is not enabled. Updates #1423.
Originally committed to SVN as r6359.
2012-01-25 19:07:07 +00:00
Thomas Goyne d798d69849 Enable the dummy audio provider in release builds. Closes #1425.
Originally committed to SVN as r6358.
2012-01-25 19:06:56 +00:00
Thomas Goyne e7307d249e Fix odd behavior when switching active lines with the Effect or Actor boxes focused
Originally committed to SVN as r6357.
2012-01-25 05:49:00 +00:00
Thomas Goyne f8c27feedb Skip unprocessed key events. Updates #1408.
Originally committed to SVN as r6356.
2012-01-25 05:48:53 +00:00
Thomas Goyne 26c3e13340 Fix poor synchronization between mouse and keyboard modifications to the selection
Combining Shift+Up/Down (or Home/End or Page Up/Page Down) with
shift-clicking had very odd results due to that they used separate
variables to decide where to extend from (and even when only one was
used they were handled incorrectly in some cases).

Closes #1311.

Originally committed to SVN as r6355.
2012-01-25 04:59:17 +00:00
Thomas Goyne e6d86a1af4 Don't remove audio files from the recently used files list when loading is cancelled
Originally committed to SVN as r6354.
2012-01-25 04:59:11 +00:00
Thomas Goyne bce29f5a9a Fix bug where "Play current line" would not stop at the end of the line if video was already playing
Originally committed to SVN as r6353.
2012-01-25 00:40:21 +00:00
Thomas Goyne a24f1692be Let macros update their help string from the validate function
If the second return value from the validate function exists and is a
non-empty string, replace the macro's help text with that string.

Revert r6327, as this is a better solution to the same problem.

Closes #1413.

Originally committed to SVN as r6352.
2012-01-25 00:21:37 +00:00
Thomas Goyne 3140d902da Report the endianness of detected UTF-16 and UTF-32
'UTF-16' is big-endian UTF-16, so returning it for UTF-16LE is incorrect
and results in line_iterator failing on UTF-16LE.

Originally committed to SVN as r6351.
2012-01-25 00:21:27 +00:00
Thomas Goyne 1034d16e4b Auto-apply AssFixStylesFilter when sending subtitles to the renderer
Originally committed to SVN as r6350.
2012-01-24 01:46:29 +00:00
Thomas Goyne 1c14740d51 Fix check for 'start after' and 'end after' keyframe snapping in the TPP
Originally committed to SVN as r6349.
2012-01-24 01:28:26 +00:00
Thomas Goyne df9f46b49c Actually read the values from the TPP dialog before applying processing
Originally committed to SVN as r6348.
2012-01-23 23:53:26 +00:00
Thomas Goyne 3b5bc88285 Write the video's colorspace to the script info section
Originally committed to SVN as r6347.
2012-01-23 23:07:35 +00:00
Thomas Goyne f2aadc7439 Add automatic host API selection to the portaudio player
Portaudio defaults to using the most stable widely available host API,
rather than the highest performance or quality, and as a result the
default host API on windows (MME) is really quite bad. As such, add
logic to select the best host API for the selected output device.

Closes #1375.

Originally committed to SVN as r6346.
2012-01-23 21:14:32 +00:00
Thomas Goyne e6252ae11b Fix adding lead in/out in the timing postprocessor
The wrong set of lines were being checked for overlaps resulting in
completely broken results.

Originally committed to SVN as r6345.
2012-01-23 21:01:57 +00:00
Thomas Goyne 2d3e505193 Port 2.1.9's installer scripts to 3.0.0
The upgrade installer still needs some updating as it only supports
upgrading from 2.1.8

Originally committed to SVN as r6344.
2012-01-23 19:09:14 +00:00
Thomas Goyne 0b7d018287 Delete the unused preferences dialog pages
Originally committed to SVN as r6343.
2012-01-23 19:02:25 +00:00
Thomas Goyne 8eaf4a6a8e Add most of the remaining "hidden" options to the preferences dialog. Closes #1022.
Originally committed to SVN as r6342.
2012-01-23 19:02:15 +00:00
Thomas Goyne 2e37ba8246 Remove redundant OSS device option
Originally committed to SVN as r6341.
2012-01-23 19:02:05 +00:00
Thomas Goyne 1f8005d8d1 Add option to hide the main toolbar. Updates #1399.
Originally committed to SVN as r6340.
2012-01-22 23:44:24 +00:00
Thomas Goyne c8099decf3 Fix infinite loop in ALSA player when playing zero-length audio
Updates #1394.

Originally committed to SVN as r6339.
2012-01-22 18:18:07 +00:00
Thomas Goyne e026d2a60a Fix copy/paste error that made the end time and duration boxes not work
Originally committed to SVN as r6338.
2012-01-22 18:18:00 +00:00
Thomas Goyne 0287edaa33 Suppress creation of multiple separators in a row in toolbars
If an entire group of commands in a toolbar is missing (such as with
AssDraw on non-windows), the duplicate separator should go as well to
avoid ugliness. A better solution here would be platform-specific
default toolbars, which should probably be done as part of #495.

Closes #1398.

Originally committed to SVN as r6337.
2012-01-22 17:15:36 +00:00
Thomas Goyne 7da57b38dc Bind wxEVT_LEAVE_WINDOW in AudioDisplay so the track cursor actually gets removed when the mouse leaves the display
Originally committed to SVN as r6336.
2012-01-22 17:15:31 +00:00
Thomas Goyne c0b599fbae Only play audio on next/prev line in karaoke mode
Originally committed to SVN as r6335.
2012-01-22 17:15:25 +00:00
Thomas Goyne e10055cb59 Don't try to create an OpenGL context until video is loaded
Creating it during startup triggers a few valgrind errors in vbox's gl
driver that may or may not matter.

Originally committed to SVN as r6334.
2012-01-22 05:59:43 +00:00
Thomas Goyne 6c879c12f1 Move the visual tool submode buttons to the main visual tool toolbar
Creating an entire toolbar for one button in the drag mode is a
pointless waste of space and source of ugliness. The secondary toolbar
was more reasonable for the vector clip tool, but it's still a bit
pointless as there's enough space for it on the main toolbar at any
reasonable zoom level.

Closes #1401.

Originally committed to SVN as r6333.
2012-01-22 05:59:36 +00:00
Thomas Goyne d273255814 Use wxDataViewCtrl::EditItem rather than StartEditor when using 2.9.4 as StartEditor is deprecated
Originally committed to SVN as r6332.
2012-01-22 05:59:31 +00:00
Thomas Goyne 6d4a56d391 Delete most of VideoBox's members
VideoBox is down to one method so it doesn't actually need to be able to
reference most of the stuff it constructs.

Originally committed to SVN as r6331.
2012-01-22 05:59:23 +00:00
Thomas Goyne d1d4d7840b Obey the icon size option in the visual subtoolbars rather than always using 24x24 icons
Originally committed to SVN as r6330.
2012-01-20 23:42:33 +00:00
Thomas Goyne d253620a96 Remove duplicate *.mov from video format filters
Originally committed to SVN as r6329.
2012-01-20 22:36:11 +00:00
Thomas Goyne c83135cb9b Add a few more a/v formats to the filters. Updates #1397.
Originally committed to SVN as r6328.
2012-01-20 22:20:08 +00:00
Thomas Goyne a939732d9c Add auto4lua support for dynamic help strings
Rather than passing a string as the second argument to
aegisub.register_macro, they can now pass a function which will be
called (with no arguments) to get a help string.

Originally committed to SVN as r6327.
2012-01-20 21:33:39 +00:00
Thomas Goyne b0c1ef2d6b Add support for commands with dynamic help strings
Originally committed to SVN as r6326.
2012-01-20 21:33:30 +00:00
Thomas Goyne 64c7043123 Add aegisub.cancel(), which immediates ends macro execution without applying any of the changes that have been made
Originally committed to SVN as r6325.
2012-01-20 21:33:20 +00:00
Thomas Goyne 632a02bcc9 Disable keyboard scrolling in the preferences dialog as it eats unrelated key events on wxGTK
Originally committed to SVN as r6324.
2012-01-20 15:14:47 +00:00
Thomas Goyne 2e2d896ea9 Fix the font pick buttons in the preferences dialog with wxGTK
wxGTK doesn't generate spin events when the value of a spin control is
set programmatically, so generate the event ourseleves.

Originally committed to SVN as r6323.
2012-01-20 15:14:41 +00:00
Thomas Goyne 2bc43eb886 Fix use of uninitialized variable when setting margins to an empty string
Originally committed to SVN as r6322.
2012-01-20 05:14:56 +00:00
Thomas Goyne 4675dbb29d Factor out the placeholder text behavior from SubsEditBox and make it work better
Handle switching from placeholder/normal mode when the value is changed
externally (such as from the active line changing) in addition to on
focus/blur, and improve behavior when the user sets the text to the
placeholder text.

Originally committed to SVN as r6321.
2012-01-20 05:14:50 +00:00
Thomas Goyne 1ce9b0d31b Refactor SubsEditBox a bit to make the constructor less of a monolithic behemoth and eliminate some duplicated code.
Originally committed to SVN as r6320.
2012-01-20 05:14:44 +00:00
Thomas Goyne 8e1ffb7898 Fix off-by-one error in logic for when to reannounce karaoke style ranges
Originally committed to SVN as r6319.
2012-01-20 01:49:41 +00:00
Thomas Goyne a249cfcc35 Add an option to disable autosave as setting the interval to zero isn't very obvious
Originally committed to SVN as r6318.
2012-01-20 01:04:24 +00:00
Thomas Goyne 6e09fb1abf Reset syntax highlighter state at the end of override blocks correctly
With incomplete (or possibly incomplete for \r and \fn) tags at the end
of an override block, the text at the beginning of the next override
block was being incorrectly parsed as part of that tag.

Originally committed to SVN as r6317.
2012-01-19 19:46:09 +00:00
Thomas Goyne 6a091e3ba2 Don't save the file in the 'opened a new file' commit when 'App/Auto/Save on Every Change' is enabled as it's not actually a change
Originally committed to SVN as r6316.
2012-01-19 19:46:01 +00:00
Thomas Goyne e4b2f1b509 Set the minimum undo levels to 2, as things get weird without a valid undo stack
Originally committed to SVN as r6315.
2012-01-19 19:45:49 +00:00
Thomas Goyne c75fb1d069 Add the OSS player to the vcproj
It's never used on Windows, but it's useful to have all of the files in
the project, and the other non-Windows audio players are already in the
project.

Originally committed to SVN as r6314.
2012-01-19 00:43:43 +00:00
Thomas Goyne a72fb8f5bf Quote the path to gtestd.lib so that it works with spaces
Originally committed to SVN as r6313.
2012-01-18 23:39:52 +00:00
Thomas Goyne 6414a6ffcb Add the Ctrl/Alt/Shift-Left/Right hotkeys to the subtitle grid
Originally committed to SVN as r6312.
2012-01-18 22:51:37 +00:00
Thomas Goyne be07cca9f6 Change keyframe snapping distance from frames to milliseconds
Snapping based on frames works poorly with VFR, and is pointlessly
different from the other adjustments.

Originally committed to SVN as r6311.
2012-01-18 22:51:28 +00:00
Thomas Goyne f6c3be4776 Clean up a bunch of stuff in DialogTimingProcessor
Factor out most of the duplicated code and fix a lot of ugly stylistic
things.

Originally committed to SVN as r6310.
2012-01-18 22:51:17 +00:00
Thomas Goyne e40e42ff1c Modernize DialogTextImport
Originally committed to SVN as r6309.
2012-01-18 20:08:53 +00:00
Thomas Goyne b36c70ca7d Move a pile of things that shouldn't be in headers out of the headers
Originally committed to SVN as r6308.
2012-01-18 20:08:42 +00:00
Thomas Goyne b38851bb93 Make the avisynth providers store an AvisynthWrapper rather than inherit from it
Originally committed to SVN as r6307.
2012-01-18 20:08:32 +00:00
Thomas Goyne 46986c6944 Fix new[]/delete mismatch
Originally committed to SVN as r6306.
2012-01-18 20:08:24 +00:00
Thomas Goyne 8cf71ddd8d Fix crash when seeking to previous keyframe with no keyframes loaded
Originally committed to SVN as r6305.
2012-01-18 20:08:16 +00:00
Thomas Goyne 9ac2f93bf0 Fix some mostly unimportant uses of uninitialized memory
Originally committed to SVN as r6304.
2012-01-18 20:08:06 +00:00
Thomas Goyne 2109d677a7 Handle unicode in string lists in the preferences dialog
Originally committed to SVN as r6303.
2012-01-17 03:03:13 +00:00
Thomas Goyne 96211b79cf Focus the frame number field of the Jump To dialog when it's opened
Originally committed to SVN as r6302.
2012-01-17 02:47:37 +00:00
Thomas Goyne cf6f54720d Change the default hotkey for the Jumo To dialog to Ctrl-G
The hotkey should only be Ctrl-J on OS X (where Ctrl-G is taken by Find
Next), but platform-specific hotkeys aren't implemented yet.

Originally committed to SVN as r6301.
2012-01-17 02:47:31 +00:00
Thomas Goyne f463bf4bd9 Derive the custom hotkey renderers from wxDataViewCustomRenderer
Deriving from the more specialized renderes reduces the amount of code
required, but it depends on implementation details of the specific
implementations, resulting in the custom renderers not working with
wxGTK. In addition, this makes it possible to bypass the default
handling for 'Enter' which made it impossible to set it as a hotkey.

Originally committed to SVN as r6300.
2012-01-17 02:47:25 +00:00
Thomas Goyne 4055100734 Implement 'make dist'
Originally committed to SVN as r6299.
2012-01-14 18:46:49 +00:00
Thomas Goyne 3ed84ba70d Update distdir generation
The list of files to include was out of date and only included files
for dependencies which were actually enabled, and the script was
FreeBSD-specific.

Originally committed to SVN as r6298.
2012-01-14 18:46:43 +00:00
Thomas Goyne a586e7e58f Write svn_revision when getting the revision from git
Originally committed to SVN as r6297.
2012-01-14 18:46:38 +00:00
Thomas Goyne 3c6e28ec2e Make default_config.h/cpp depend on the json files packed into it
Originally committed to SVN as r6296.
2012-01-14 18:46:33 +00:00
Thomas Goyne 72c9bdeebf Add some super-kludgy hotkey migration logic
Originally committed to SVN as r6295.
2012-01-14 01:40:32 +00:00
Thomas Goyne 40e4f887ba Make the enter-key-in-edit-box logic a standard hotkeyed command
Originally committed to SVN as r6294.
2012-01-14 01:40:21 +00:00
Thomas Goyne d8cedf0eec Implement the "Auto-focus audio display on mouse over" option
Originally committed to SVN as r6293.
2012-01-13 21:17:51 +00:00
Thomas Goyne 9166eb1d6b Store the selection range for the audio display srollbar in pixels so it remains valid when the zoom changes
Originally committed to SVN as r6292.
2012-01-13 21:17:40 +00:00
Thomas Goyne 3ec9514636 Fix bogus inactive line markers for the previous line when the first dialogue line is active
Originally committed to SVN as r6291.
2012-01-13 20:59:48 +00:00
Thomas Goyne 37cb9d0548 Fix some 32-bit int overflows at high zoom with long audio
Originally committed to SVN as r6290.
2012-01-13 20:59:35 +00:00
Thomas Goyne 789f25aff2 Move all selected rows up/down rather than just the active row
Originally committed to SVN as r6288.
2012-01-13 20:19:06 +00:00
Thomas Goyne 7e557c1dad Rename edit/line/swap to grid/swap and grid/swap/* to grid/move/*
Continue moving all the reordering commands to grid (why were they in
three different categories?), and change swap to move to better reflect
what they do.

Originally committed to SVN as r6287.
2012-01-13 20:18:57 +00:00
Thomas Goyne e2984b93b0 Rename time/sort/* to grid/sort/*
Sorting lines doesn't effect the timing of them, and sorting by style
doesn't even involve time in any way. Moving lines up and down is
already in the grid category, so it seems logical to put sorting there
as well.

Originally committed to SVN as r6286.
2012-01-13 20:18:48 +00:00
Thomas Goyne 1bcbc728c8 Mark the current visual tool as active in the toolbar
Originally committed to SVN as r6285.
2012-01-13 20:18:40 +00:00
Thomas Goyne 54ebe9b37a Fix incorrect (un)wrapping of the subs edit box toolbar on video zoom changes
The size of the contents is not updated until after SubsEditBox::OnSize
is called, so the wrapping logic was being done based on the previous
available area, rather than the new size.

Originally committed to SVN as r6284.
2012-01-13 20:18:29 +00:00
Thomas Goyne 5774e87248 Add files which were missed in r6278
Originally committed to SVN as r6283.
2012-01-13 14:37:15 +00:00
Thomas Goyne 4ab04b79dd Repaint the visual tools when the active line changes
Originally committed to SVN as r6282.
2012-01-12 22:49:24 +00:00
Thomas Goyne 695559d403 Add missing parentheses that resulted in repainting issues in the audio display with inactive lines disabled
Originally committed to SVN as r6281.
2012-01-12 22:32:28 +00:00
Thomas Goyne ca5c968d4f Non-precomp-header compilation fixes
Originally committed to SVN as r6280.
2012-01-12 22:32:20 +00:00
Thomas Goyne 988ade0c00 Rewrite the font collector
The fontconfig collector should now always pick the exact font files
used by libass rather than a giant mishmash of vaguely related files
which may or may not include the correct font.

Make the freetype font collector windows-only, as it's far inferior to
the fontconfig collector and is only present as a fallback.

Add option to copy the fonts to the script's folder.

Closes #1059.

Originally committed to SVN as r6279.
2012-01-12 22:32:09 +00:00
Thomas Goyne 7dd6cfe37d Derive agi::acs exceptions from agi::FileSystemError and friends rather than having two sets of errors for the same thing
Originally committed to SVN as r6278.
2012-01-12 22:31:54 +00:00
Thomas Goyne 7031ba807b Fix gcc compilation error
Originally committed to SVN as r6277.
2012-01-12 21:33:14 +00:00
Thomas Goyne 85733835d1 Kill setup.cpp and move library inclusion to config_windows0.h. Closes #949.
Originally committed to SVN as r6276.
2012-01-11 20:03:46 +00:00
Thomas Goyne 86aacca631 Move SplitLine from SubtitlesGrid to SubsEditCtrl
This still isn't a very good place for the functionality, but it breaks
SubsEditCtrl's dependency on SubtitlesGrid.

Originally committed to SVN as r6275.
2012-01-11 19:19:30 +00:00
Thomas Goyne c8d67ea0ff Fix disabling the spellchecker
Originally committed to SVN as r6274.
2012-01-11 19:19:21 +00:00
Thomas Goyne db18cea308 Don't sort automation macros by name
Leaving macros in the order they're registered makes it possible to
group related macros. Once a UI for editing the menus has been added it
might make sense to default to sorting them, but for now it's just
unhelpful.

Closes #1381.

Originally committed to SVN as r6273.
2012-01-11 19:19:11 +00:00
Thomas Goyne 896a1ab902 Don't mark things in drawing blocks as words in GetWordBoundaries
This disables spell checking in drawing blocks and potential weird
behavior when right-clicking on drawing blocks.

Originally committed to SVN as r6272.
2012-01-11 19:19:03 +00:00
Thomas Goyne 3f8b9b8213 Fix use of uninitialized variables in GetWordAtPosition when the position is not in a word
Originally committed to SVN as r6271.
2012-01-11 19:18:54 +00:00
Thomas Goyne 1293f86afe Refactor SubsTextEditCtrl::OnContextMenu a bit
Originally committed to SVN as r6270.
2012-01-11 19:18:45 +00:00
Thomas Goyne 4726402abd Don't embolden spell check suggestions
Setting the font to bold also changes the font size, which results in
the suggestions looking worse than the default appearance is.

Originally committed to SVN as r6269.
2012-01-11 19:18:35 +00:00
Thomas Goyne ce01b39248 Add some of the FFMS2 options to the advanced audio page of the preferences dialog
Originally committed to SVN as r6268.
2012-01-10 22:10:57 +00:00
Thomas Goyne 2b49d6ea62 Fix typo in preferences dialog
Originally committed to SVN as r6267.
2012-01-10 22:10:47 +00:00
Thomas Goyne 3b099dba74 Fix icon installation with DESTDIR set
Originally committed to SVN as r6266.
2012-01-10 20:56:25 +00:00
Thomas Goyne 5ab777f230 Set BIN_SINSTALL in a way that actually works (make is not sh)
Originally committed to SVN as r6265.
2012-01-10 20:56:15 +00:00
Thomas Goyne 237193a4bb Add option to only show non-comment inactive dialogue lines in the audio display. Closes #1386.
Originally committed to SVN as r6264.
2012-01-10 20:03:31 +00:00
Thomas Goyne 5cd47a8a88 Switch precompiled headers back to defaulting to on
Originally committed to SVN as r6263.
2012-01-10 19:10:00 +00:00
Thomas Goyne 1a02d2ba3e Add missing #include <algorithm> to dialog_log.cpp. Closes #1391.
Originally committed to SVN as r6262.
2012-01-10 19:09:51 +00:00
Thomas Goyne ea819a2e1a Fix portaudio compilation failure
Originally committed to SVN as r6261.
2012-01-10 19:09:41 +00:00
Thomas Goyne d451cf3e9c Add option to show the previous and next inactive lines in the audio display in addition to previous, all or none. Updates #1386.
Originally committed to SVN as r6260.
2012-01-10 01:16:39 +00:00
Thomas Goyne a0fcd535c1 Store the names of commands in the menu rather than references to the commands themselves, to avoid crashes with dynamically created and removed commands. This makes most menu operations a bit slower, but it appears to be sufficiently fast.
Originally committed to SVN as r6259.
2012-01-09 20:31:55 +00:00
Thomas Goyne 1801583ed7 Reload the video when reattaching the video display. Fixes a pile of issues and potential crashes
Originally committed to SVN as r6258.
2012-01-09 20:31:47 +00:00
Thomas Goyne cd48b711b4 Fix opengl errors when the file is modified with a minimized detached video window open
Originally committed to SVN as r6257.
2012-01-09 20:31:38 +00:00
Thomas Goyne 93c96d1f82 Increase default audio marker snap distance to 10 pixels to match 2.1.9
Originally committed to SVN as r6256.
2012-01-09 20:31:30 +00:00
Thomas Goyne 8bfefd356c Return nil from lua functions which require a project context if they're called during script initialization. Closes #1380.
Originally committed to SVN as r6255.
2012-01-09 20:31:19 +00:00
Thomas Goyne bf26c14999 Remove redundant check in AudioDispaly::SetZoomLevel
Originally committed to SVN as r6254.
2012-01-08 01:37:19 +00:00
Thomas Goyne f4c8bf429b Remove AudioTimingController::HasLabels as the rewritten audio display doesn't need it
Originally committed to SVN as r6253.
2012-01-08 01:37:12 +00:00
Thomas Goyne d04753aaf2 Remove AudioController::GetAudioProvider as it was a temporary hack which is no longer needed
Originally committed to SVN as r6252.
2012-01-08 01:37:05 +00:00
Thomas Goyne 702d1e9c22 Split AudioDisplay::OnPaint into several methods
Originally committed to SVN as r6251.
2012-01-08 01:36:58 +00:00
Thomas Goyne 3c62a38c7a Replace MyThes thesaurus implementation with a custom one
Fixes a pile of unicode-related issues, such as dictionaries in a path
which does not fit into the system's local charset, and significantly
cuts down on the amount of code.

Originally committed to SVN as r6250.
2012-01-08 01:36:50 +00:00
Thomas Goyne 518f93f18f Create the json log writer after checking for local config so it goes to the right place
Originally committed to SVN as r6249.
2012-01-08 01:36:35 +00:00
Thomas Goyne e2d31b708e Split the json log writing into a seperate class from LogSink
Originally committed to SVN as r6248.
2012-01-08 01:36:23 +00:00
Thomas Goyne 59ce8bf414 Pass wxStrings to wxString::Format rather than std::string in LogWindow
Originally committed to SVN as r6247.
2012-01-08 01:36:16 +00:00
Thomas Goyne d148bbbf2a Make agi::log::LogSink take ownership of the emitters passed to it
Originally committed to SVN as r6246.
2012-01-08 01:36:09 +00:00
Thomas Goyne ba1a1dc737 Load configuration before initializing commands, hotkeys and icons, as hotkeys uses ?user which may be changed by configuration loading
Originally committed to SVN as r6245.
2012-01-08 01:36:03 +00:00
Thomas Goyne d2d28401bd Change how local config mode works
Rather than loading both the local and user config files and saving to
the local directory if an option is set, simply try to load the local
config file, and if it exists switch to local mode and never even touch
the user file.

Originally committed to SVN as r6244.
2012-01-08 01:35:56 +00:00
Thomas Goyne ae62cb75b4 Add missing uses of STD_STR when converting from wxString to std::string
Originally committed to SVN as r6243.
2012-01-08 01:35:49 +00:00
Thomas Goyne 56337beb11 Use OutputDebugStringW rather than OutputDebugStringA in the windows debug logging so that unicode actually works
Originally committed to SVN as r6242.
2012-01-08 01:35:43 +00:00
Thomas Goyne 976da6717e Change "windows specific" things in the preferences dialog to avisynth-specific
Originally committed to SVN as r6241.
2012-01-08 01:35:37 +00:00
Thomas Goyne 32abbde477 Pass a copy of the video filename to SetVideo in VideoContext::Reload so that it doesn't get cleared by Reset
Originally committed to SVN as r6240.
2012-01-08 01:35:31 +00:00
Thomas Goyne 6f7836c11e Paint keyframe markers on top of line markers so that they don't vanish when lines are scenetimed
Originally committed to SVN as r6239.
2012-01-08 01:35:25 +00:00
Thomas Goyne 58c7bbd78a Sort inactive markers so that lower_bound will actually work when lines are out of order or overlapping
Originally committed to SVN as r6238.
2012-01-08 01:35:18 +00:00
Thomas Goyne c84275d6fa Snap to markers in the audio display on click in addition to on drag
Originally committed to SVN as r6237.
2012-01-08 01:35:11 +00:00
Thomas Goyne 4dcb6240d4 Move audio marker snapping logic from the audio display to the dialogue timing controller
Originally committed to SVN as r6236.
2012-01-08 01:35:04 +00:00
Thomas Goyne 1285584e89 Add ?local for the user's local config dir; use it for FFMS2 indexes
Originally committed to SVN as r6235.
2012-01-08 01:34:57 +00:00
Thomas Goyne 44bc249fe8 Don't suffix the configuration directory with the version on unix
Aegisub is not a library that needs to support having many versions
installed at once, and having multiple versions sharing a config
directory mostly works fine on Windows anyway.

Closes #1031.

Originally committed to SVN as r6234.
2012-01-08 01:34:49 +00:00
Thomas Goyne 43d4e785fb Cosmetics in standard_paths.cpp
Originally committed to SVN as r6233.
2012-01-08 01:34:43 +00:00
Thomas Goyne 01646d7cf4 Remove StandardPaths::DecodePathMaybeRelative, as it's been deprecated forever
Originally committed to SVN as r6232.
2012-01-08 01:34:37 +00:00
Thomas Goyne 15d49fb655 Revamp AssFile::AddLine and related functions to eliminate the statics and hopefully make it less brittle
Originally committed to SVN as r6231.
2012-01-08 01:34:30 +00:00
Thomas Goyne f8b4dd3a61 Bump copyright year in about dialog to 2012
Originally committed to SVN as r6230.
2012-01-08 01:34:24 +00:00
Thomas Goyne afca7e9732 Don't overwrite overridden menu text when hotkeys change
Originally committed to SVN as r6229.
2012-01-08 01:34:18 +00:00
Thomas Goyne 8511376da5 Make strings from the menu json translatable
Originally committed to SVN as r6228.
2012-01-08 01:34:12 +00:00
Thomas Goyne 4d7518e127 Make OpenStream and CloseStream pure virtual
Originally committed to SVN as r6227.
2012-01-08 01:34:06 +00:00
Thomas Goyne 2f38efede6 Remove pointless call to CloseStream in AudioPlayer's destructor (calling virtual functions in constructors/destructors calls the version from the current class, not the most derived type)
Originally committed to SVN as r6226.
2012-01-08 01:34:01 +00:00
Thomas Goyne 81a99ae27b Remove pointless duplicated member variable in OSSPlayer and document a few of the members
Originally committed to SVN as r6225.
2012-01-08 01:33:55 +00:00
Thomas Goyne 02fa5bee3e Add option to automatically open audio when opening video. Closes #1134.
Originally committed to SVN as r6224.
2012-01-08 01:33:47 +00:00
Thomas Goyne df9c6b627f Improve audio open error reporting and remove a pile of unused stuff in AudioPlayer
Originally committed to SVN as r6223.
2012-01-08 01:33:39 +00:00
Thomas Goyne a927672c27 Remove unused private variables in AudioProvider
Originally committed to SVN as r6222.
2012-01-08 01:33:33 +00:00
Thomas Goyne 4e06c198d0 Kill AssStyle::Get\SetMarginString, as it isn't really used for much of anything
Originally committed to SVN as r6221.
2012-01-08 01:33:26 +00:00
Thomas Goyne 8fdd5d987e Remove the encoding parameter from AssFile::SaveMemory, as it only supports utf-8, and simplify the implementation
Originally committed to SVN as r6220.
2012-01-08 01:33:19 +00:00
Thomas Goyne c379e1e8e0 Prompt to save changes before creating new subtitles
Originally committed to SVN as r6218.
2012-01-08 01:05:57 +00:00
Thomas Goyne dc58b3db40 Clean up SetThreadName a little
Originally committed to SVN as r6217.
2012-01-08 01:05:51 +00:00
Thomas Goyne c0d8270815 Add shell script to regenerate the .pot file
Originally committed to SVN as r6216.
2012-01-08 01:05:45 +00:00
Thomas Goyne 2b07b3411f Fill in a few placeholder strings
Originally committed to SVN as r6215.
2012-01-08 01:05:39 +00:00
Thomas Goyne dfafbc082d Delete unused command "subtitle/tags/show"
Originally committed to SVN as r6214.
2012-01-08 01:05:33 +00:00
Thomas Goyne e8ba128fa8 Synchronize a bunch of similar but not quite identical strings. Closes #1081.
Originally committed to SVN as r6213.
2012-01-08 01:05:25 +00:00
Thomas Goyne c847318ddb Mark command strings as translatable
Originally committed to SVN as r6212.
2012-01-08 01:05:19 +00:00
Thomas Goyne 3efdef2224 Tweak a few strings to make them easier to translate
Originally committed to SVN as r6211.
2012-01-08 01:05:13 +00:00
Thomas Goyne eaa1001d7a Don't mark help button page names as translatable
Originally committed to SVN as r6210.
2012-01-08 01:05:07 +00:00
Thomas Goyne e08fb25d15 Check for --enable-debug before wxWidgets as the wx m4 macros use the value of $enable_debug
Originally committed to SVN as r6209.
2012-01-08 01:05:01 +00:00
Thomas Goyne 25c1225ad1 Fix bug where on wxGTK the display mode would get set to "Subs Only" the first time the menus were opened after opening video or audio
Originally committed to SVN as r6208.
2012-01-08 01:04:55 +00:00
Thomas Goyne 89705b4f9c Add missing config.h include in preferences.cpp
Originally committed to SVN as r6207.
2012-01-08 01:04:50 +00:00
Thomas Goyne 4990d8255c Don't bother refcounting portaudio initializations as portaudio does that internally
Originally committed to SVN as r6206.
2012-01-08 01:04:44 +00:00
Thomas Goyne 0fd475031a Make default script resolution customizable
Originally committed to SVN as r6205.
2012-01-08 01:04:37 +00:00
Thomas Goyne 6b85782dc5 Fix signed/unsigned comparison warning on x64
Originally committed to SVN as r6204.
2012-01-08 01:04:29 +00:00
Thomas Goyne 71968aa4f3 Fix wxString::Format assertion failures in the stack walker
Originally committed to SVN as r6203.
2012-01-08 01:04:16 +00:00
Thomas Goyne 00b3fcf0b7 Remove incorrect overriding of the test project's intermediate and output directories
Originally committed to SVN as r6202.
2012-01-08 01:04:11 +00:00
Thomas Goyne 0113b33d66 Always build with -g and optionally strip the debugging symbols on install so that crash backtraces aren't completely meaningless
Originally committed to SVN as r6201.
2012-01-08 01:04:05 +00:00
Thomas Goyne 5702dd60a1 Add install-strip target to the makefile
Originally committed to SVN as r6200.
2012-01-08 01:03:59 +00:00
Thomas Goyne 3d906ded47 Remove precompiled headers on 'make clean' and add 'mostlyclean' target that does not touch them
Originally committed to SVN as r6199.
2012-01-08 01:03:53 +00:00
Thomas Goyne c4251bd181 Add DESTDIR support. Patch by Alucryd. Closes #1376.
Originally committed to SVN as r6198.
2012-01-08 01:03:45 +00:00
Thomas Goyne 58d6ac1fad Make DataBlockCache::Age roughly ten times as fast
Originally committed to SVN as r6197.
2012-01-08 01:03:40 +00:00
Thomas Goyne 83805934dd Fix order of Cut and Copy on the subtitles grid context menu
Originally committed to SVN as r6196.
2012-01-08 01:03:33 +00:00
Thomas Goyne 3f9080bbee Fix left-click check on audio display
Originally committed to SVN as r6189.
2011-12-30 15:52:04 +00:00
Thomas Goyne e34b401201 Return -1 from AegisubApp::FilterEvent rather than wxEventFilter::Event_Skip, as the enum was added in wx 2.9.4
Originally committed to SVN as r6188.
2011-12-30 15:51:58 +00:00
Thomas Goyne 84d1315736 Write the config and MRU files to ?data in portable mode rather than ?user
Originally committed to SVN as r6187.
2011-12-30 01:21:03 +00:00
Thomas Goyne d01d7eb78b Fix crash when the audio commit hotkey is pressed with the grid focused and no audio open
Originally committed to SVN as r6185.
2011-12-29 15:12:36 +00:00
Thomas Goyne d192f1c332 Fix bad format string that made stack trace writing fail after one stack frame
Originally committed to SVN as r6184.
2011-12-29 05:36:49 +00:00
Thomas Goyne 68b2ae8275 Eliminate most clang warnings
Originally committed to SVN as r6183.
2011-12-28 21:27:22 +00:00
Thomas Goyne 0eeb1d18fc Fix getting the revision from git with BSD sed
Originally committed to SVN as r6182.
2011-12-28 21:27:16 +00:00
Thomas Goyne cae10121ed Fix a bunch of -pedantic stuff
Originally committed to SVN as r6181.
2011-12-28 21:27:06 +00:00
Thomas Goyne cdf8e31e1a Get audio marker drag sensitivity from configuration
Originally committed to SVN as r6180.
2011-12-28 21:27:00 +00:00
Thomas Goyne 0e17edc561 Rearrange AudioDisplay::OnMouseEvent a bit to eliminate some duplicated code and separate the code which requires a timing controller from that which doesn't
Originally committed to SVN as r6179.
2011-12-28 21:26:54 +00:00
Thomas Goyne 6953a69cf8 Store the last used AudioMarkerInteractionObject in its own member variable to eliminate an ugly dynamic_cast
Originally committed to SVN as r6178.
2011-12-28 21:26:48 +00:00
Thomas Goyne 88ba844850 Make middle-click-drag on the audio display continue to update the video position
Originally committed to SVN as r6177.
2011-12-28 21:26:41 +00:00
Thomas Goyne 4b2e5d1b93 Make audio marker snap distance and whether or not it defaults to snapping customizable
Originally committed to SVN as r6176.
2011-12-28 01:22:59 +00:00
Thomas Goyne c06d72d5be gcc compilation fix
Originally committed to SVN as r6175.
2011-12-28 01:22:54 +00:00
Thomas Goyne b7cd695cd6 Add support for getting the revision number from git
Originally committed to SVN as r6174.
2011-12-28 01:22:49 +00:00
Thomas Goyne f02ccdd331 Update translations to 2.1.9's. Still rather out of date, but slightly less so.
Originally committed to SVN as r6173.
2011-12-28 01:22:37 +00:00
Thomas Goyne 532072218f Allow snapping to the inactive line markers in the audio display
Originally committed to SVN as r6172.
2011-12-27 18:46:20 +00:00
Thomas Goyne eda90a15fb Make the "Play last 500ms of selection" command always play to the end of the selection as it did in 2.1
Originally committed to SVN as r6171.
2011-12-27 02:23:04 +00:00
Thomas Goyne 935e5544d5 Fix intermediate overflow in DirectSoundPlayer2 that resulted in the playback position resetting to the beginning after 97 seconds with 44.1 khz audio
Originally committed to SVN as r6170.
2011-12-27 01:38:14 +00:00
Thomas Goyne 090fdecb95 Scroll instantly to the audio playback position when "Lock Scroll on Cursor" is enabled
Originally committed to SVN as r6169.
2011-12-27 01:38:08 +00:00
Thomas Goyne cfc7e009f2 Don't disable or hide the visual tools while video is playing. Updates #1336.
Originally committed to SVN as r6168.
2011-12-27 01:38:00 +00:00
Thomas Goyne ae3895fb8e Handle empty files better in the translation assistant
Originally committed to SVN as r6167.
2011-12-26 22:21:19 +00:00
Thomas Goyne 92254a9806 Start the translation assistant at the first translatable block rather than always the first block
Originally committed to SVN as r6166.
2011-12-26 22:21:14 +00:00
Thomas Goyne 9cfe230682 Remove unused 'parent' member from AssDialogueBlock and make 'text' protected
Originally committed to SVN as r6165.
2011-12-26 22:21:08 +00:00
Thomas Goyne 7b4759cc13 Parse {} as an empty override block rather than an empty comment
Originally committed to SVN as r6164.
2011-12-26 22:21:02 +00:00
Thomas Goyne 04990e8694 Fix seeking to previous keyframe when the current frame is not a keyframe
Originally committed to SVN as r6163.
2011-12-26 22:20:57 +00:00
Thomas Goyne 7adbe07b4e Silence a bunch of PREFast warnings
Originally committed to SVN as r6162.
2011-12-26 22:20:49 +00:00
Thomas Goyne bddd4fc714 Add group as an optional parameter to AssEntry's contructor
Originally committed to SVN as r6161.
2011-12-26 22:20:43 +00:00
Thomas Goyne a189bac35e Make AudioRenderingStyleRanges's destructor protected
Originally committed to SVN as r6160.
2011-12-26 22:20:37 +00:00
Thomas Goyne bc640b4f94 Fix use of uninitialized value that resulted in the find/replace dialog always opening as the replace dialog
Originally committed to SVN as r6155.
2011-12-24 00:47:41 +00:00
Thomas Goyne 7c6696a53a Fix signature of AssDialogue::SetEntryData so it actually overrides the base
Originally committed to SVN as r6154.
2011-12-24 00:36:30 +00:00
Thomas Goyne 309e7e75fd Eliminate the use of wxAny as it's the only thing not supported by clang
Originally committed to SVN as r6153.
2011-12-24 00:36:19 +00:00
Thomas Goyne 38b3379b3a Remove build_bsd as it's no longer used by anything
Originally committed to SVN as r6152.
2011-12-23 23:30:31 +00:00
Thomas Goyne d87ff50fc1 Remove special-casing for iconv on BSD
iconv is only one of many dependencies which are likely to be installed
to /usr/local ib BSD.

Originally committed to SVN as r6151.
2011-12-23 23:21:12 +00:00
Thomas Goyne aba01b833a Allow nonintegral font sizes in styles
Originally committed to SVN as r6150.
2011-12-23 23:21:02 +00:00
Thomas Goyne 435e7170df Add missing semicolon in the FFTW build credit
Originally committed to SVN as r6149.
2011-12-23 22:05:44 +00:00
Thomas Goyne 9bfa40a9d3 Add FFTW credit to the about dialog
Originally committed to SVN as r6146.
2011-12-22 21:32:37 +00:00
Thomas Goyne 31c696157d Change FFmpegSource to FFMS2 in the about dialog
Originally committed to SVN as r6145.
2011-12-22 21:32:29 +00:00
Thomas Goyne 236173ed22 Add myself to the primary authors in the About dialog
Originally committed to SVN as r6144.
2011-12-22 21:32:19 +00:00
Thomas Goyne be3e9dae68 Update the value of the zoom dropdown when the detached video dialog is resized
Originally committed to SVN as r6143.
2011-12-22 21:32:09 +00:00
Thomas Goyne 43b6d910fb Resize the detached video dialog to the specified size when the video zoom is changed. Closes #493.
Originally committed to SVN as r6142.
2011-12-22 21:31:57 +00:00
Thomas Goyne 77cf1f7583 Handle Windows newlines in line_iterator on non-Windows
Originally committed to SVN as r6141.
2011-12-22 21:31:48 +00:00
Thomas Goyne 4c9ebe1a4d Add debug flags to tests's CXXFLAGS
Originally committed to SVN as r6140.
2011-12-22 21:31:39 +00:00
Thomas Goyne 477dd8a2f6 Try to preserve the value of the styles dropdown across undo/redo
Originally committed to SVN as r6139.
2011-12-22 21:31:29 +00:00
Thomas Goyne 95ad8c1fba Fix the single-line-commit optimization
Originally committed to SVN as r6138.
2011-12-22 21:31:18 +00:00
Thomas Goyne 1c2abeae30 Stop coalescing changes made in the edit box after ten seconds of no changes
Originally committed to SVN as r6137.
2011-12-22 21:31:09 +00:00
Thomas Goyne fd35224cb5 Stop coalescing changes for undo when the active line changes
Originally committed to SVN as r6136.
2011-12-22 21:31:01 +00:00
Thomas Goyne f0e352f382 Update the view menu after the display mode has been automatically updated due to opening video or audio. Closes #1344.
Originally committed to SVN as r6135.
2011-12-22 21:30:49 +00:00
Thomas Goyne 5eb516f8d9 In non-WITH_STARTUPLOG builds, send startup log events to the standard logging system rather than discard them
Originally committed to SVN as r6134.
2011-12-22 21:30:40 +00:00
Thomas Goyne 046d8a6822 Use wxEventBlocker rather than manually enabling and disabling the event handler in SubsEditBox
Originally committed to SVN as r6133.
2011-12-22 21:30:32 +00:00
Thomas Goyne e5707ca6eb Don't use the ms time value of the Duration time edit control when in frame mode, as with vfr this may not actually represent a consisten number of frames
Originally committed to SVN as r6132.
2011-12-22 21:30:22 +00:00
Thomas Goyne 2c324de29c Fix use of an uninitialized value in the time edit control when the frame number can't be parsed
Originally committed to SVN as r6131.
2011-12-22 21:30:14 +00:00
Thomas Goyne 2fdbd86a7f Add aegisub.decode_path, which simply wraps StandardPaths::DecodePath
Originally committed to SVN as r6130.
2011-12-22 21:30:05 +00:00
Thomas Goyne 4a3f2b8412 Add aegisub.keyframes, which returns a table with all of the frame numbers which are keyframes
Originally committed to SVN as r6129.
2011-12-22 21:29:56 +00:00
Thomas Goyne f974fdb1b2 Delete aegisub.parse_tag_data and aegisub.unparse_tag_data
Originally committed to SVN as r6128.
2011-12-22 21:29:47 +00:00
Thomas Goyne 29460b97b9 Rearrange VideoContext::Reset to fix error on shutdown
Originally committed to SVN as r6127.
2011-12-22 21:29:38 +00:00
Thomas Goyne 4133806fe7 Allow opening video with no working subtitle providers enabled
Originally committed to SVN as r6126.
2011-12-22 21:29:29 +00:00
Thomas Goyne 3cdc27c894 Normalize the value of the time edit controls when they lose focus. Updates #512.
Originally committed to SVN as r6125.
2011-12-22 21:29:18 +00:00
Thomas Goyne 5cbd35e749 Simplify some AssTime-using code
Originally committed to SVN as r6124.
2011-12-22 21:29:09 +00:00
Thomas Goyne 71345af81a Overload operator int() on AssTime and remove GetMS/SetMS
Originally committed to SVN as r6123.
2011-12-22 21:28:51 +00:00
Thomas Goyne de9583004d Uncrustify AssTime
Originally committed to SVN as r6122.
2011-12-22 21:28:41 +00:00
Thomas Goyne e36759a3b2 Remove the undocumented milisecond precision option
Originally committed to SVN as r6121.
2011-12-22 21:28:32 +00:00
Thomas Goyne 1fbf2ef218 Remove pointless operator=, copy constructor and destructor from agi::vfr::Framerate
Originally committed to SVN as r6120.
2011-12-22 21:28:23 +00:00
Thomas Goyne a91f6f7880 Use agi::vfr::Framerate in FractionalTime rather than a numerator\denominator pair
Originally committed to SVN as r6119.
2011-12-22 21:28:13 +00:00
Thomas Goyne ab68b4b080 Delete unused SMPTE parsing code
Originally committed to SVN as r6118.
2011-12-22 21:28:04 +00:00
Thomas Goyne 3b83b9e31b Delete SubtitleFormat::FPSRational and just use FractionalTime
Originally committed to SVN as r6117.
2011-12-22 21:27:53 +00:00
Thomas Goyne ac6e9fd022 Use unrounded rational time in microdvd subtitle format
Originally committed to SVN as r6116.
2011-12-22 21:27:45 +00:00
Thomas Goyne 93ce90cbf9 Store a numerator and denominator in agi::vfr::Framerate rather than a fps. Fixes minor rounding issues with 24000/1001 and 30000/1001 frame rates.
Originally committed to SVN as r6115.
2011-12-22 21:27:35 +00:00
Thomas Goyne 7a9bc1dcc9 Add tests for hotkeys
Originally committed to SVN as r6114.
2011-12-22 21:27:26 +00:00
Thomas Goyne fe090969f4 Actually use the value from the "Always" context in Hotkey::GetHotkey
Originally committed to SVN as r6113.
2011-12-22 21:27:17 +00:00
Thomas Goyne 7bb749b51f Return the name of the command found or an empty string if none from Hotkey::Scan rather than using an out reference
Originally committed to SVN as r6112.
2011-12-22 21:27:06 +00:00
Thomas Goyne 022c711409 Clear the command output variable when a hotkey fails to match to be safe
Originally committed to SVN as r6111.
2011-12-22 21:26:57 +00:00
Thomas Goyne eb8a73d836 Use EXPECT_TRUE and EXPECT_FALSE rather than EXPECT_EQ([true,false])
Originally committed to SVN as r6110.
2011-12-22 21:26:48 +00:00
Thomas Goyne a16da9ffdd Get lua CFLAGS/LIBS from pkg-config when possible
Originally committed to SVN as r6109.
2011-12-22 21:26:39 +00:00
Thomas Goyne d02cf5c99f Handle wxMouseCaptureLostEvent in the color picker
Originally committed to SVN as r6108.
2011-12-22 21:26:30 +00:00
Thomas Goyne 4c31490d41 Use PCMAudioProvider to read from the cache in HDAudioProvider as it's far faster than the naive logic previously used
Originally committed to SVN as r6107.
2011-12-22 21:26:21 +00:00
Thomas Goyne 70dce930e6 Remove maintainer mode, as it didn't actually do anything (since we don't use automake)
Originally committed to SVN as r6106.
2011-12-22 21:26:12 +00:00
Thomas Goyne ac498f75d5 Generate a configure error if a dependency explicitly enabled with --with cannot be found
Originally committed to SVN as r6105.
2011-12-22 21:26:03 +00:00
Thomas Goyne f2c62dad3d Factor out a bunch of duplicated code in the configure script for pkg-config based optional dependencies and use the pkg-config name for all WITH_* defines
Originally committed to SVN as r6104.
2011-12-22 21:25:49 +00:00
Thomas Goyne 975bb7b26f Delete pointless empty destructor in DummyAudioProvider
Originally committed to SVN as r6103.
2011-12-22 21:25:38 +00:00
Thomas Goyne a5fce1d1be Fix off-by-one error in DummyAudioProvider::GetAudio
Originally committed to SVN as r6102.
2011-12-22 21:25:29 +00:00
Thomas Goyne 0892de62a8 Don't let audio markers snap to themselves
Originally committed to SVN as r6101.
2011-12-22 21:25:19 +00:00
Thomas Goyne 5e9339611b Return a pair of SplineCurves from SplineCurve::Split rather than mutating the arguments, as it doesn't actually work in-place
Originally committed to SVN as r6100.
2011-12-22 21:25:08 +00:00
Thomas Goyne 400b8252e9 Don't block loading styles from scripts with only a Default style
Originally committed to SVN as r6099.
2011-12-22 21:25:00 +00:00
Thomas Goyne f809fa4104 Put OSS CFLAGS in their own variable rather than modifying CPPFLAGS
Originally committed to SVN as r6098.
2011-12-22 21:24:51 +00:00
Thomas Goyne 71109a87e1 Replace most inappropriate uses of LDFLAGS with LIBS
Originally committed to SVN as r6097.
2011-12-22 21:24:40 +00:00
Thomas Goyne 48526bf341 Delete libmedia
It's nowhere close to working and just getting further away from working
as time goes on.

Originally committed to SVN as r6096.
2011-12-22 21:24:20 +00:00
Thomas Goyne e2eb7255a9 Refactor the configure script a bit to remove the need for $found_player_audio
Originally committed to SVN as r6095.
2011-12-22 21:24:10 +00:00
Thomas Goyne 4ab6ca890a Use AS_IF and AS_CASE rather than the shell script equivalents in the configure script
Originally committed to SVN as r6094.
2011-12-22 21:24:01 +00:00
Thomas Goyne 670d7dfcd4 Delete ax_openml.m4 as we no longer use openmp
Originally committed to SVN as r6093.
2011-12-22 21:23:52 +00:00
Thomas Goyne f454801868 Update acx_pthread.m4 to the latest versions
Originally committed to SVN as r6092.
2011-12-22 21:23:43 +00:00
Thomas Goyne 6fbf5b057f Remove references to a target archtecture from the configure script
Originally committed to SVN as r6091.
2011-12-22 21:23:35 +00:00
Thomas Goyne 965a292a05 Increase max precision in the rotation tools to four digits so that rotations over 100 degrees aren't rounded to ints
Originally committed to SVN as r6090.
2011-12-22 21:23:26 +00:00
Thomas Goyne d9ab41468c In the cross visual tool, apply the same roundning rules to the coordinates set on double-click as for the displayed coordinates
Originally committed to SVN as r6089.
2011-12-22 21:23:17 +00:00
Thomas Goyne 25f4e4b426 Set the current frame in the Jump To dialog correctly
Originally committed to SVN as r6088.
2011-12-22 21:23:07 +00:00
Thomas Goyne b66357bfb8 Fix warning on x64 unix
Originally committed to SVN as r6087.
2011-12-22 21:22:58 +00:00
Thomas Goyne ff32be592f Make FractionalTime less weird
Originally committed to SVN as r6086.
2011-12-22 21:22:49 +00:00
Thomas Goyne 7a2c461825 Clean up ass_time.h a little
Originally committed to SVN as r6085.
2011-12-22 21:22:40 +00:00
Thomas Goyne ec63fad7c5 Make help buttons fall back to the docs wiki if the scraped html files aren't available locally
Originally committed to SVN as r6084.
2011-12-22 21:22:31 +00:00
Thomas Goyne 8427958a1d Fix spelling error in configure.in
Originally committed to SVN as r6083.
2011-12-22 21:22:22 +00:00
Thomas Goyne 1b40118172 Sort required versions in configure.in
Originally committed to SVN as r6082.
2011-12-22 21:22:13 +00:00
Thomas Goyne fd78c51aa2 Mark things as disabled when --without-blah is passed to configure rather than --with-blah
Originally committed to SVN as r6081.
2011-12-22 21:22:05 +00:00
Thomas Goyne 207ca88c5c Set modification mask correctly when appending lines
Originally committed to SVN as r6080.
2011-12-22 21:21:55 +00:00
Thomas Goyne f78d52448e Fix appending and deleting rows via the subtitles object index syntax
Originally committed to SVN as r6079.
2011-12-22 21:21:47 +00:00
Thomas Goyne 38ffdc4135 Improve error message when a field is missing from a subtitle line
Originally committed to SVN as r6078.
2011-12-22 21:21:38 +00:00
Thomas Goyne 776c7e69a8 When appending lines from a lua script, always append the new line to the end of the appropriate section, creating the section if needed
Originally committed to SVN as r6077.
2011-12-22 21:21:29 +00:00
Thomas Goyne 464f652ea4 Eliminate a bunch of weird bogusness with various environment variables
Originally committed to SVN as r6076.
2011-12-22 21:21:20 +00:00
Thomas Goyne f430d02659 Don't check if iconv is enabled before checking if its argument needs to be const as it's a required dep which is always enabled
Originally committed to SVN as r6075.
2011-12-22 21:21:12 +00:00
Thomas Goyne 848f123a98 Fix some inconsistent formatting in configure.in
Originally committed to SVN as r6074.
2011-12-22 21:21:03 +00:00
Thomas Goyne 810ca07041 Remove unused $with_hunspell_version variable from configure script
Originally committed to SVN as r6073.
2011-12-22 21:20:54 +00:00
Thomas Goyne 863e7070a6 Add a bunch of missing config.h includes
Originally committed to SVN as r6072.
2011-12-22 21:20:44 +00:00
Thomas Goyne 8796a605ba Use non-recursive make for libresrc and command so that dependencies can actually be set correctly. Fixes parallel builds.
Originally committed to SVN as r6071.
2011-12-22 21:20:34 +00:00
Thomas Goyne 7161b74be0 Use AS_HELP_STRING to generate configure help strings
Originally committed to SVN as r6070.
2011-12-22 21:20:24 +00:00
Thomas Goyne 8f24931e3a Remove checks to see if things returned from pkg-config actually work. If pkg-config is returning garbage then there's something very wrong with the user's setup.
Originally committed to SVN as r6069.
2011-12-22 21:20:15 +00:00
Thomas Goyne b12b3425e1 Check for missing OpenGL by inspecting $gl_no rather than GL_LIBS, which could theoretically be empty
Originally committed to SVN as r6068.
2011-12-22 21:20:07 +00:00
Thomas Goyne 96bf33a241 Delete worthless empty OpenGL tests
Originally committed to SVN as r6067.
2011-12-22 21:19:58 +00:00
Thomas Goyne 395381015e Update to a version of AX_CHECK_GL that isn't ancient. Removes the need for --with-apple-opengl-framework.
Originally committed to SVN as r6066.
2011-12-22 21:19:49 +00:00
Thomas Goyne 17d220e7cd Remove configure check for strlcpy, which we never actually use
Originally committed to SVN as r6065.
2011-12-22 21:19:41 +00:00
Thomas Goyne 76b8df425d Add error message if X include path detection fails. Closes #1009.
Originally committed to SVN as r6064.
2011-12-22 21:19:31 +00:00
Thomas Goyne 55f8cb3685 Add option to disable rendering the sample averages in the waveform renderer
Originally committed to SVN as r6063.
2011-12-22 21:19:21 +00:00
Thomas Goyne 0201b8ea9b Add dumb special casing to DialogSearchReplace so that replacing '$' with 'str' with regular expressions enabled results in 'str' being appended once rather than 1000 times.
Originally committed to SVN as r6062.
2011-12-22 21:19:12 +00:00
Thomas Goyne 3ecc731ff3 Fix non-precompiled-header compilation
Originally committed to SVN as r6061.
2011-12-22 21:19:02 +00:00
Thomas Goyne 21f94ae72e Validate the value passed to AssTime's constructor rather than allowing the creation of bad times
Originally committed to SVN as r6060.
2011-12-22 21:18:54 +00:00
Thomas Goyne 515ed54f1d Use a single-line text edit for TimeEdit on wxGTK as the unspecified bugs appear to have been fixed
Originally committed to SVN as r6059.
2011-12-22 21:18:45 +00:00
Thomas Goyne 6a24046b91 Set -fno-var-tracking for command/icon.cpp, as gcc uses an extremely large amount of memory compiling that file otherwise
Originally committed to SVN as r6058.
2011-12-22 21:18:36 +00:00
Thomas Goyne 51d88c675f Actually use FFTW3_CFLAGS and FFTW3_LDFLAGS
Originally committed to SVN as r6057.
2011-12-22 21:18:26 +00:00
Thomas Goyne 3a069b7f60 Clean up TimeEdit
Remove some unused or constant arguments and simplify some overly
convoluted logic.

Check for whether timecodes are open rather than whether video is open
to determine if by-frame mode is enabled.

Operate on a project context rather than using VideoContext::Get().

Use non-event-generating setter methods rather than a boolean ready
variable.

Make all member variables private and add setters rather than relying on
the client code calling Update when appropriate.

Eliminate flickering in overwrite mode.

Originally committed to SVN as r6056.
2011-12-22 21:18:16 +00:00
Thomas Goyne 70d703255b Skip unprocessed key events in the time edit control so that it doesn't eat hotkeys
Originally committed to SVN as r6055.
2011-12-22 21:18:07 +00:00
Thomas Goyne cd3b9bfa37 Enable propagation of key events so that hotkeys work regardless of what's focused
Originally committed to SVN as r6054.
2011-12-22 21:17:58 +00:00
Thomas Goyne 59273bac4a Reenable the assertion failure handler
Originally committed to SVN as r6053.
2011-12-22 21:17:49 +00:00
Thomas Goyne 28e8f0b640 Use wxGetApp() rather than wxTheApp plus a cast
Originally committed to SVN as r6052.
2011-12-22 21:17:40 +00:00
Thomas Goyne 92949bc965 Remove AegisubApp::Get, as wxGetApp() does the same thing
Originally committed to SVN as r6051.
2011-12-22 21:17:30 +00:00
Thomas Goyne 3e539835b7 Use wxDECLARE_APP rather than the deprecated DECLARE_APP
Originally committed to SVN as r6050.
2011-12-22 21:17:21 +00:00
Thomas Goyne f1ff18545a Make more of AegisubApp's methods private
Originally committed to SVN as r6049.
2011-12-22 21:17:12 +00:00
Thomas Goyne 2ec3ff157b Kill AegisubApp::OpenURL. It makes no sense for the top level application object to be doing this and it doesn't even save any code.
Originally committed to SVN as r6048.
2011-12-22 21:17:02 +00:00
Thomas Goyne ce62990d91 Don't wrap the declaration of AegisubApp::HandleEvent in a ifdef check for wxUSE_EXCEPTIONS as we require that wx be built with exception support
Originally committed to SVN as r6047.
2011-12-22 21:16:53 +00:00
Thomas Goyne a66cc26706 Remove all calls to wxKeyEvent::StopPropagation. Key events don't propagate by default and even if they did, events which are marked as processed don't propagate further.
Originally committed to SVN as r6046.
2011-12-22 21:16:43 +00:00
Thomas Goyne ed51e7b668 Fix memory leak when deleting or cutting rows
Originally committed to SVN as r6045.
2011-12-22 21:16:34 +00:00
Thomas Goyne 79fa487678 Delete the DVD subtitle format. It didn't work and it's been years since anyone last touched it.
Originally committed to SVN as r6044.
2011-12-22 21:16:23 +00:00
Thomas Goyne ef32c75609 Also remove empty attachment sections not at the end of the file
Originally committed to SVN as r6043.
2011-12-22 21:16:14 +00:00
Thomas Goyne 921f6c3bcf Remove empty attachment sections from the file while deleting attachments rather than when the dialog is closed to remove a redundant undo point
Originally committed to SVN as r6042.
2011-12-22 21:16:05 +00:00
Thomas Goyne 384d2bc9c2 Disable the Delete and Extract buttons in the attachment dialog after deleting the selected attachments
Originally committed to SVN as r6041.
2011-12-22 21:15:56 +00:00
Thomas Goyne 38e2403001 Factor out duplicated code in DialogAttachments
Originally committed to SVN as r6040.
2011-12-22 21:15:47 +00:00
Thomas Goyne 96aa9e2629 Use libaegisub io code in AssAttachment rather than wx's
Originally committed to SVN as r6039.
2011-12-22 21:15:37 +00:00
Thomas Goyne 00bc0c7ef8 Significantly clean up and simplify AssAttachment
Originally committed to SVN as r6038.
2011-12-22 21:15:28 +00:00
Thomas Goyne eaf436657e Factor out a bunch of duplicated code in AssStyle::Parse
Originally committed to SVN as r6037.
2011-12-22 21:15:19 +00:00
Thomas Goyne 9eaad5f0b1 Document most of AssStyle and remove some unused code
Originally committed to SVN as r6036.
2011-12-22 21:15:10 +00:00
Thomas Goyne dbf3eea732 Remove pointless empty destructor from AssStyle
Originally committed to SVN as r6035.
2011-12-22 21:15:01 +00:00
Thomas Goyne d28c4c4d8b Kill AssEntry::Valid, as there wasn't actually any way to get a fully-constructed entry with it set to false
Originally committed to SVN as r6034.
2011-12-22 21:14:51 +00:00
Thomas Goyne 61767e4453 Disable the "Update video" checkbox in the search/replace dialog when video isn't open
Originally committed to SVN as r6033.
2011-12-22 21:14:42 +00:00
Thomas Goyne 404e0fda4f Delete stuff in DialogSearchReplace
Originally committed to SVN as r6032.
2011-12-22 21:14:32 +00:00
Thomas Goyne ac9b09b847 Jump to the end of the video rather than the frame before the current one when trying to seek to the next keyframe after the last keyframe
Originally committed to SVN as r6031.
2011-12-22 21:14:24 +00:00
Thomas Goyne bf7e4d5cc1 Fix bug where seeking to the next keyframe would actually seek to the keyframe after the next keyframe
Originally committed to SVN as r6030.
2011-12-22 21:14:15 +00:00
Thomas Goyne 95fe6a523f Actually use the selection foreground color for selected rows in the grid
Originally committed to SVN as r6029.
2011-12-22 21:14:06 +00:00
Thomas Goyne 6ee6e10117 Fix infinite loop when switching between the \pos and \move icons in the visual subtoolbar
Originally committed to SVN as r6028.
2011-12-22 21:13:57 +00:00
Thomas Goyne c27ee9fcb8 Disable gcc's unused value warning for tests as a very large number of tests generate it
Originally committed to SVN as r6027.
2011-12-22 21:13:48 +00:00
Thomas Goyne b29606759a Only include character encodings actually supported by the iconv implementation used in the list returned from GetEncodingsList
Originally committed to SVN as r6026.
2011-12-22 21:13:39 +00:00
Thomas Goyne ebde064cb4 Set rpath for tests correctly
Originally committed to SVN as r6025.
2011-12-22 21:13:30 +00:00
Thomas Goyne 10255ae201 Overload operator<< for UnknownElement as gcc complains about abiguous calls otherwise
Originally committed to SVN as r6024.
2011-12-22 21:13:22 +00:00
Thomas Goyne b0c17b9be2 FFTW 3.3 is required, not 3.2
Originally committed to SVN as r6023.
2011-12-22 21:13:13 +00:00
Thomas Goyne 78580c31ba Fix spelling error in configure script
Originally committed to SVN as r6022.
2011-12-22 21:13:04 +00:00
Thomas Goyne 61b1741376 Remove all the json::Reader::Read overloads, as we never actually use them
Originally committed to SVN as r6021.
2011-12-22 21:12:55 +00:00
Thomas Goyne ba1d1596de Eliminate a pile of duplicated code in elements.cpp
Originally committed to SVN as r6020.
2011-12-22 21:12:46 +00:00
Thomas Goyne 2edc5c41e1 Remove kludges to force options to doubles
Originally committed to SVN as r6019.
2011-12-22 21:12:37 +00:00
Thomas Goyne 07da6f6f1b Split json::Number into json::Double and json::Integer
Trying to decide whether an option should be an int or double after
discarding the differences between "1.0" and "1" simply isn't possible,
and even if an option was initialized correctly, if it was changed to a
round number it could get written as an int and break later.

Also convert cajun to tabs because three spaces to indent is terrible.

Originally committed to SVN as r6018.
2011-12-22 21:12:25 +00:00
Thomas Goyne daff67b150 Simply log errors and continue when type errors occur while loading the user config file, rather than only loading the portion of the file before the error
Originally committed to SVN as r6017.
2011-12-22 21:12:15 +00:00
Thomas Goyne d7ae51a5af Remove some unused members of agi::Options
Originally committed to SVN as r6016.
2011-12-22 21:12:06 +00:00
Thomas Goyne 2f73b55b64 Delete agi::Options::DumpAll declaration, as the definition doesn't exist
Originally committed to SVN as r6015.
2011-12-22 21:11:57 +00:00
Thomas Goyne 4c3d191de8 Significantly simplify agi::Options::PutOption
Originally committed to SVN as r6014.
2011-12-22 21:11:46 +00:00
Thomas Goyne 56165305a4 Change the check for duplicate keys when writing the options file to an assertion as it can't actually happen
Originally committed to SVN as r6013.
2011-12-22 21:11:38 +00:00
Thomas Goyne 4823706206 Fix some spelling errors in comments in option.h
Originally committed to SVN as r6012.
2011-12-22 21:11:29 +00:00
Thomas Goyne a7a159288f Make agi::Options's one protected member private, as agi::Option is not designed to be inherited from
Originally committed to SVN as r6011.
2011-12-22 21:11:21 +00:00
Thomas Goyne 70a291d4d4 Add some tests for agi::Options
Originally committed to SVN as r6010.
2011-12-22 21:11:10 +00:00
Thomas Goyne ef3414931f Fix off-by-one error in MRU::GetEntry
Originally committed to SVN as r6009.
2011-12-22 21:11:01 +00:00
Thomas Goyne d0ee3029de Make the MRU tests significantly less worthless
Originally committed to SVN as r6008.
2011-12-22 21:10:50 +00:00
Thomas Goyne 522e634122 Simplify some uses of cajun types and eliminate some copies
Originally committed to SVN as r6007.
2011-12-22 21:10:41 +00:00
Thomas Goyne 9cbaa01e63 Update and significantly expand the cajun tests
Originally committed to SVN as r6006.
2011-12-22 21:10:32 +00:00
Thomas Goyne 3097dc634e Only automatically convert json objects to other types when they are uninitialized
Originally committed to SVN as r6005.
2011-12-22 21:10:22 +00:00
Thomas Goyne a78417177a Move cajun implementations from .inl files included by the headers to .cpp files
Originally committed to SVN as r6004.
2011-12-22 21:10:10 +00:00
Thomas Goyne c601351a50 Silence a pile of prefast warnings in cajun
Originally committed to SVN as r6003.
2011-12-22 21:10:00 +00:00
Thomas Goyne 2439381c33 Fix misspelled word in the crash log
Originally committed to SVN as r6002.
2011-12-22 21:09:51 +00:00
Thomas Goyne 34a87b1c1e Silence a pile of /W4 warnings
Originally committed to SVN as r6001.
2011-12-22 21:09:31 +00:00
Thomas Goyne c36cd32127 Disable forced inclusion of the precompiled header for C files in x64 builds
Originally committed to SVN as r5989.
2011-12-07 00:19:51 +00:00
Thomas Goyne 1b43e05907 Add configure check for FFTW
Originally committed to SVN as r5988.
2011-12-06 23:48:18 +00:00
Thomas Goyne c0cfe8afce Make Vector2D's default constructor initialize to the invalid value rather than a seemingly valid value. Fixes a few cases where uninitialized vectors were used as if they were initialized.
Originally committed to SVN as r5987.
2011-12-06 23:13:06 +00:00
Thomas Goyne f48c2a444d Enable precompiled headers by default
Originally committed to SVN as r5985.
2011-12-06 21:59:20 +00:00
Thomas Goyne 6d62437c42 Combine --disable-check-wx-opengl and --disable-check-wx-stc into a single configure flag named --disable-slow-wx-checks
Originally committed to SVN as r5984.
2011-12-06 21:59:10 +00:00
Thomas Goyne 1a68f12dcb Fix rendering errors with the cross visual tool and detached video
Originally committed to SVN as r5977.
2011-12-06 20:07:57 +00:00
Thomas Goyne ffa811c8bc Add "App/Auto/Load Linked Files" to the preferences dialog
Originally committed to SVN as r5976.
2011-12-06 19:59:04 +00:00
Thomas Goyne 6ff233b5ac Convert audio samples to doubles rather than floats when using FFTW
Originally committed to SVN as r5975.
2011-12-06 19:58:54 +00:00
Thomas Goyne 5d8a802e8a Allocate memory for fftw with fftw_alloc_real/fftw_alloc_complex rather than fftw_malloc
Originally committed to SVN as r5974.
2011-12-06 19:58:44 +00:00
Thomas Goyne b4e3208405 Fix off-by-one error causing rendering errors in the vector clip visual tool when bezier curves are used
Originally committed to SVN as r5973.
2011-12-06 18:08:33 +00:00
Thomas Goyne 388580e0cc Add spaces between the components of bezier curves
Originally committed to SVN as r5972.
2011-12-06 18:08:23 +00:00
Thomas Goyne 904e0769b1 Remove unused paramters to VideoDisplay::UpdateSize
Originally committed to SVN as r5971.
2011-12-06 00:18:13 +00:00
Thomas Goyne 880ea8848c Document some of VideoContext's members
Originally committed to SVN as r5970.
2011-12-06 00:18:04 +00:00
Thomas Goyne e49486201d Eliminate the duplication between VideoContext::videoName and VideoContext::videoFile
Originally committed to SVN as r5969.
2011-12-06 00:17:54 +00:00
Thomas Goyne 2fa16a78c6 Move snapshot saving from VideoContext to the commands
Originally committed to SVN as r5968.
2011-12-06 00:17:45 +00:00
Thomas Goyne 8a7f4038c1 Make the video provider owned solely by ThreadedFrameSource rather than in a shared_ptr stored in several places
Originally committed to SVN as r5967.
2011-12-06 00:17:36 +00:00
Thomas Goyne 59fdab5fe7 Remove VideoContext::nextFrame as it's unused
Originally committed to SVN as r5966.
2011-12-06 00:17:25 +00:00
Thomas Goyne c26e61f209 Remove the audio resync code from VideoContext. It didn't actually work with the threaded video provider and should be unneccesary as video now always plays back at full speed (dropping frames if needed).
Originally committed to SVN as r5965.
2011-12-05 05:27:05 +00:00
Thomas Goyne 8ab9ba77ae Remove the prohibition against seeking while video is playing and just do Stop; Seek; Play as the slider already did in some cases
Originally committed to SVN as r5964.
2011-12-05 05:26:58 +00:00
Thomas Goyne f95f1f13cf Don't block key events on the video slider when video is playing, as this makes stopping the video rather awkward and it's unneccesary
Originally committed to SVN as r5963.
2011-12-05 05:26:52 +00:00
Thomas Goyne 2e40652265 Simplify video playback logic
Originally committed to SVN as r5962.
2011-12-05 05:26:45 +00:00
Thomas Goyne 1f534bc757 Kill VideoContext::playMutex. I assume it was a relic from the old threaded video display code as it's completely pointless.
Originally committed to SVN as r5961.
2011-12-05 05:26:38 +00:00
Thomas Goyne 73ee949d55 Fix bounds checking in the rectangular clip visual tool with detached video
Originally committed to SVN as r5960.
2011-12-05 03:22:33 +00:00
Thomas Goyne 009d99407b Force a relayout of the video display after switching visual tools. Fixes a bug where the subtoolbar would sometimes appear in the wrong place.
Originally committed to SVN as r5959.
2011-12-05 01:45:08 +00:00
Thomas Goyne 48d412468e Make the log dialog not insane and crashy
Originally committed to SVN as r5958.
2011-12-02 04:36:06 +00:00
Thomas Goyne 95a329a1e2 Flush the clipboard on exit so that it isn't cleared
Originally committed to SVN as r5957.
2011-12-02 04:35:59 +00:00
Thomas Goyne 59ddcab360 Add Ctrl-Shift-S as a default hotkey for Save As
Originally committed to SVN as r5956.
2011-12-01 21:59:35 +00:00
Thomas Goyne df3d3cd409 Fix assertion failure when opening the Jump To dialog on 64-bit linux
Originally committed to SVN as r5955.
2011-12-01 04:22:55 +00:00
Thomas Goyne d6ba00883e Fix infinite loop when opening video with wxgtk
Originally committed to SVN as r5954.
2011-12-01 03:47:19 +00:00
Thomas Goyne 90582c0b15 Use NumValidator to ensure only numbers are typed in the frames box of the jump to dialog. Updates #1319.
Originally committed to SVN as r5953.
2011-12-01 00:43:48 +00:00
Thomas Goyne 157c03ce63 Load the colors for the audio display timeline from the audio colorscheme
Originally committed to SVN as r5952.
2011-11-30 21:04:46 +00:00
Thomas Goyne 7bfdc78b72 Load the colors for the audio display scrollbar from the audio colorscheme
Originally committed to SVN as r5951.
2011-11-30 21:04:37 +00:00
Thomas Goyne fa15f0800e Make audio color schemes selectable in the preferences dialog
Originally committed to SVN as r5950.
2011-11-30 21:04:28 +00:00
Thomas Goyne 1a4d116617 Add green audio color scheme similar to the default waveform colors in 2.1. Currently only actually usable by manually editing the config file.
Originally committed to SVN as r5949.
2011-11-30 21:04:18 +00:00
Thomas Goyne 9cb7b23345 Get color scheme names from the config rather than hardcoding it
Originally committed to SVN as r5948.
2011-11-30 21:04:09 +00:00
Thomas Goyne 598a85c6cd Move color scheme definitions to the config file
Originally committed to SVN as r5947.
2011-11-30 21:03:57 +00:00
Thomas Goyne f0e98151f1 Close audio if an error occurs while announcing the opened audio as the program is probably in an inconsistent state
Originally committed to SVN as r5946.
2011-11-30 04:28:03 +00:00
Thomas Goyne b4d2bba7a2 Fix the name of the Resample Resolution dialog's help page
Originally committed to SVN as r5945.
2011-11-30 03:46:44 +00:00
Thomas Goyne adb5963fbd Cast size_ts used in format strings to ints instead as there isn't actually a portable way to format them.
Originally committed to SVN as r5944.
2011-11-30 02:44:27 +00:00
Thomas Goyne f9e8175cb8 Fix wxString::Format assertion failures in 64-bit builds
Originally committed to SVN as r5943.
2011-11-30 02:38:42 +00:00
Thomas Goyne a47f51080c Also define __STDC_FORMAT_MACROS for commands
Originally committed to SVN as r5942.
2011-11-30 02:16:01 +00:00
Thomas Goyne 9203f17f4d Implement the Lock Scroll on Cursor option in the audio display
Originally committed to SVN as r5941.
2011-11-30 00:40:32 +00:00
Thomas Goyne c6b97612ae Delay creation of the audio renderer until audio is actually opened
Originally committed to SVN as r5940.
2011-11-30 00:40:22 +00:00
Thomas Goyne 8632d5ce75 Remove some unreachable code in SubtitleFormat::AskForFPS
Originally committed to SVN as r5939.
2011-11-29 23:26:31 +00:00
Thomas Goyne 500b8b66d8 Make a few of FrameMain's members local to InitContents
Originally committed to SVN as r5938.
2011-11-29 23:18:42 +00:00
Thomas Goyne dfc68a4db9 Make the int/double option type detection slightly less broken
Choosing between int and double based on whether the default value is an
int is dumb and broken enough, but with the "ceil" the detection didn't
even work for negative numbers.

Originally committed to SVN as r5937.
2011-11-29 23:18:34 +00:00
Thomas Goyne b993c02dee Move AegisubFileDropTarget to frame_main.cpp. It's under ten lines of code so there's really no point in having two separate files for it.
Originally committed to SVN as r5936.
2011-11-29 23:18:24 +00:00
Thomas Goyne bad20c2898 Delete aegisub/src/command/header
Originally committed to SVN as r5935.
2011-11-29 23:18:15 +00:00
Thomas Goyne 1374813ee7 Update out-of-date messages about audio players in the configure script
Originally committed to SVN as r5934.
2011-11-29 23:18:07 +00:00
Thomas Goyne eaba8eb177 Define __STDC_FORMAT_MACROS for all files in the Makefile and vc10 project, as was already done in the vc9 project. There's a decent number of files which need it and we don't have any naming conflicts with it so there's no reason not to.
Originally committed to SVN as r5933.
2011-11-29 23:17:58 +00:00
Thomas Goyne 0e260409fd Remove unused OnKeyDown method from DialogSearchReplace
Originally committed to SVN as r5932.
2011-11-29 23:17:49 +00:00
Thomas Goyne 19503ef4f8 Simplify HelpButton and add some error handling
Originally committed to SVN as r5931.
2011-11-29 23:17:40 +00:00
Thomas Goyne 3f90614fd0 Delete static_bmp.[h|cpp] as it isn't actually used anywhere
Originally committed to SVN as r5930.
2011-11-29 23:17:31 +00:00
Thomas Goyne a445512970 Remove out-of-date comment in auto4_lua.cpp
Originally committed to SVN as r5929.
2011-11-29 23:17:20 +00:00
Thomas Goyne d061e81ada Disable LTCG in debug builds
Originally committed to SVN as r5928.
2011-11-28 23:57:33 +00:00
Thomas Goyne 371bda4f2b Move standard windows libraries from setup.cpp to the project. Updates #949.
Originally committed to SVN as r5927.
2011-11-28 22:45:27 +00:00
Thomas Goyne 7e1ef51b8e Remove wx libraries from setup.cpp. Updates #949.
Originally committed to SVN as r5926.
2011-11-28 22:45:16 +00:00
Thomas Goyne 66f3a3ce55 Fix integer overflow in the matroska subtitle loader which resulted in meaningless progress reporting
Originally committed to SVN as r5925.
2011-11-28 22:16:58 +00:00
Thomas Goyne cce9cb3c47 Fix unintended lowercasing of all strings returned from AssFile::GetScriptInfo
Originally committed to SVN as r5924.
2011-11-28 22:16:50 +00:00
Thomas Goyne cdf05af92b Refactor out a bunch of duplicated code in DialogProperties
Originally committed to SVN as r5923.
2011-11-28 22:16:41 +00:00
Thomas Goyne 303432a671 Default to zero when the initial value for a NumValidator is ""
Originally committed to SVN as r5922.
2011-11-28 22:16:33 +00:00
Thomas Goyne ca91097b8f Revamp script resolution setting logic
Rather than setting the default script resolution to 640x480, leave it
unset in new files. When video is opened, if the user has not already
manually set a script resolution, automatically use the video's
resolution as the script resolution. If the user has and the set
resolution is not a multiple of the video resolution, use the old prompt
for updating it.

This eliminates the confusing prompt about mismatched resolutions when
opening video with a new file while hopefully resulting in users using
the correct resolution more often.

Originally committed to SVN as r5921.
2011-11-28 22:16:22 +00:00
Thomas Goyne f519a493c8 Increment PortAudio refcount even if it's currently initialized
Originally committed to SVN as r5920.
2011-11-28 20:02:07 +00:00
Thomas Goyne 3c83d7e326 Add portaudio device selection to the preferences dialog and filter the list of devices to only output devices
Originally committed to SVN as r5919.
2011-11-28 20:01:58 +00:00
Thomas Goyne 87496b8767 Finish rewriting the PortAudio player
Remove pointless volatiles.

Throw agi::Exception-derived exceptions rather than bare strings.

Eliminate pointless struct which wrapped a few member variables for no
apparent reason.

Use logging statements rather than printf.

Don't set an explicit frame buffer size as the audio providers are fine
with variable sizes and portaudio strongly recommends leaving it up to
the device to decide.

Closes #997.

Originally committed to SVN as r5918.
2011-11-28 20:01:46 +00:00
Thomas Goyne c55195e11c Non-precomp-header compilation
Originally committed to SVN as r5917.
2011-11-25 22:12:15 +00:00
Thomas Goyne e5e159d6b1 Throw agi::Exception derived exceptions from the OSS player rather than bare strings
Originally committed to SVN as r5916.
2011-11-25 19:30:42 +00:00
Thomas Goyne 4b51c34497 Fiddle with some compiler settings
Originally committed to SVN as r5915.
2011-11-25 19:30:16 +00:00
Thomas Goyne 5f7ca1c7a8 Store paths in the last used paths options rather than file names. Updates #1340.
Originally committed to SVN as r5914.
2011-11-25 19:29:46 +00:00
Thomas Goyne e095dc06cd Hacks for Mac, LC_CTYPE must be "" and a wxSafeYield breaks something during FrameMain construction
Originally committed to SVN as r5913.
2011-11-25 19:29:17 +00:00
Thomas Goyne 0c5cb8e490 Have the "make adjacent" threshold in TPP have the end of the range be inclusive
Originally committed to SVN as r5912.
2011-11-25 19:28:50 +00:00
Thomas Goyne 56e6f7d5b2 Move ASS -> SRT tag conversion to the SRT subtitle format from AssDialogue
Originally committed to SVN as r5911.
2011-11-25 19:28:19 +00:00
Thomas Goyne 0992a839cc Port new SRT parser from 2.1.9. Updates #1301.
Originally committed to SVN as r5910.
2011-11-25 19:27:51 +00:00
Thomas Goyne 1452f1fbe3 Partially remove the Gtk/SCIM locale hack. Updates #1205, #1248.
Originally committed to SVN as r5909.
2011-11-25 19:27:19 +00:00
Thomas Goyne 6152716003 Make a few strings into format strings for translations. Closes #1093.
Originally committed to SVN as r5908.
2011-11-25 19:26:48 +00:00
Thomas Goyne 7b46ce6380 Don't mark y4m tags as translatable
Originally committed to SVN as r5907.
2011-11-25 19:26:21 +00:00
Thomas Goyne f3c10634d1 Move gl_text's OpenGL header inclusion to the cpp file
Originally committed to SVN as r5906.
2011-11-23 18:33:14 +00:00
Thomas Goyne df50af52e8 Remove OpenGL headers from video_context as it doesn't touch OpenGL anymore
Originally committed to SVN as r5905.
2011-11-23 18:33:02 +00:00
Thomas Goyne 88b536f824 Make VideoOutGL's error checking even more completely overboard
Originally committed to SVN as r5904.
2011-11-23 18:32:50 +00:00
Thomas Goyne dc8dbbb535 Make VideoContext::Reset private and use SetVideo to close the video so that the change gets announced properly
Originally committed to SVN as r5903.
2011-11-23 18:32:37 +00:00
Thomas Goyne eb2a6e14fa Fix a crash caused by the video display recieving a paint event before the first video frame is ready
Originally committed to SVN as r5902.
2011-11-23 18:32:23 +00:00
Thomas Goyne 3c9864e888 Fix MRU test compilation
Originally committed to SVN as r5901.
2011-11-20 17:35:07 +00:00
Thomas Goyne 893ec95841 Don't load the FPS from Aegisub keyframes. The format breaks vfr and setting the fps should be done with timecode files.
Originally committed to SVN as r5900.
2011-11-20 17:35:00 +00:00
Thomas Goyne 2f85e5b398 Fix osx reporter compilation. Patch by torque. Closes #1366.
Originally committed to SVN as r5899.
2011-11-20 17:34:52 +00:00
Thomas Goyne 908d1cadae Pass the audio renderer absolute coordinates rather than relative so that audio actually scrolls
Originally committed to SVN as r5898.
2011-11-20 04:25:05 +00:00
Thomas Goyne d67cc6032b Fix portaudio player compilation
Originally committed to SVN as r5897.
2011-11-20 03:43:52 +00:00
Thomas Goyne cead5f92df fix non-precomp header compilation
Originally committed to SVN as r5896.
2011-11-20 03:30:00 +00:00
Thomas Goyne 7998677612 Fix wxGTK assertion failure
Originally committed to SVN as r5895.
2011-11-19 05:07:41 +00:00
Thomas Goyne 563a544150 Reload audio when the cache type is changed
Originally committed to SVN as r5894.
2011-11-19 04:57:14 +00:00
Thomas Goyne 9a53dc0440 Eliminate some unused variables
Originally committed to SVN as r5893.
2011-11-19 04:46:45 +00:00
Thomas Goyne 236ea4261d Reload audio when the player or provider is changed
Originally committed to SVN as r5892.
2011-11-19 01:14:42 +00:00
Thomas Goyne 43d41def4f Add missing file audio_rendering_style.h
Originally committed to SVN as r5891.
2011-11-19 01:14:33 +00:00
Thomas Goyne 275f32dfcf Remove audio_player_manager.h from the vc9 project as it hasn't existed for quite a while
Originally committed to SVN as r5890.
2011-11-19 01:14:24 +00:00
Thomas Goyne 70ba90f024 Clean up the OpenAL audio player a bit
Remove pointless volatile modifiers from member variables (there aren't
even any threads involved).

Eliminate all heap memory allocation during playback.

Move comments into the doxygen comments and add some more.

Throw typed exceptions.

Originally committed to SVN as r5889.
2011-11-19 01:14:13 +00:00
Thomas Goyne 70fcece459 Don't create the audio timing controller until audio is actually opened
Originally committed to SVN as r5888.
2011-11-18 22:58:22 +00:00
Thomas Goyne 92e10c80a2 Add markers and styling ranges in the audio display for inactive lines. Closes #1327.
Originally committed to SVN as r5887.
2011-11-18 22:58:12 +00:00
Thomas Goyne 3cf1718ef6 Add support for the inactive color scheme to the audio renderers
Originally committed to SVN as r5886.
2011-11-18 22:58:02 +00:00
Thomas Goyne e3b15bf587 Only connect to signals in AudioDisplay when audio is actually open
Originally committed to SVN as r5885.
2011-11-18 22:57:54 +00:00
Thomas Goyne 725a334860 Add Inactive style to Icy Blue
Originally committed to SVN as r5884.
2011-11-18 22:57:45 +00:00
Thomas Goyne 1eedb0c3d4 Replace InitIcyBlue_Normal and InitIcyBlue_Selected with a single method which takes an audio rendering style as a parameter
Originally committed to SVN as r5883.
2011-11-18 22:57:36 +00:00
Thomas Goyne 13a281e9dc Extract the color lookup in AudioColorScheme to a seperate method
Originally committed to SVN as r5882.
2011-11-18 22:57:26 +00:00
Thomas Goyne 262a74dc6f Remove old audio display color options which have been replaced by the audio color schemes
Originally committed to SVN as r5881.
2011-11-18 22:57:17 +00:00
Thomas Goyne f4a975d64c Remove unnecessary explicit 'inline'
Originally committed to SVN as r5880.
2011-11-18 22:57:07 +00:00
Thomas Goyne af9be4afa6 Remove #undef min/max as NOMINMAX is now defined by the project
Originally committed to SVN as r5879.
2011-11-18 22:56:58 +00:00
Thomas Goyne 8d28b44773 Get audio styling ranges from the timing controller. Based on a patch by jfs.
Originally committed to SVN as r5878.
2011-11-18 22:56:45 +00:00
Thomas Goyne 262d5195c5 Add access keys for nearly all things which support them and were missing them. Closes #1070.
Originally committed to SVN as r5877.
2011-11-18 18:49:09 +00:00
Thomas Goyne 2c2bb54e11 Add access keys for most entries in the main menu bar and eliminate a few duplicates. Updates #1078.
Originally committed to SVN as r5876.
2011-11-18 05:00:20 +00:00
Thomas Goyne 0db92549d7 Eliminate some probably spurious uninitialized variable warnings
Originally committed to SVN as r5875.
2011-11-18 04:06:03 +00:00
Thomas Goyne c119d2d84b Don't try to use the active line in a handler for COMMIT_NEW as it may not be valid
Originally committed to SVN as r5874.
2011-11-18 04:04:35 +00:00
Thomas Goyne 28c7e7dec3 Bind wxEVT_SIZE in the video display even when attached. There doesn't seem to be any reason not to and it fixes some bugs with resizing the main window.
Originally committed to SVN as r5873.
2011-11-18 01:20:47 +00:00
Thomas Goyne ff03168f4c Show decimals in the cross visual tool only when the video resolution is greater than the script resolution
Originally committed to SVN as r5872.
2011-11-17 18:21:30 +00:00
Thomas Goyne f863e28479 Add Select All to the subtitles menu. Closes #1226.
Originally committed to SVN as r5871.
2011-11-17 03:58:05 +00:00
Thomas Goyne 8831de5774 Modify a few strings to ease translations
Originally committed to SVN as r5870.
2011-11-17 02:21:46 +00:00
Thomas Goyne bf285cfa50 Make the undo/redo strings more localization-friendly. Closes #1104.
Originally committed to SVN as r5869.
2011-11-17 02:19:10 +00:00
Thomas Goyne 1590b2a65e Add validator to the subtitle save command to check if there are actually unsaved changes
Originally committed to SVN as r5868.
2011-11-16 22:43:56 +00:00
Thomas Goyne 14c9d8ec87 Fix validate method for the subtitle/select/visible command
Originally committed to SVN as r5867.
2011-11-16 22:43:45 +00:00
Thomas Goyne 2cb234b414 Change the default for Video/Check Script Res to 1 (Ask). Closes #1138.
Originally committed to SVN as r5866.
2011-11-16 21:59:48 +00:00
Thomas Goyne da09d71239 Expand text boxes in the preferences dialog to fill available space
Originally committed to SVN as r5865.
2011-11-16 21:59:39 +00:00
Thomas Goyne a6ecf821c9 Add some options to the preferences dialog
Originally committed to SVN as r5864.
2011-11-16 21:59:31 +00:00
Thomas Goyne 88e5392d37 Remove a few unused options
Originally committed to SVN as r5863.
2011-11-16 21:59:22 +00:00
Thomas Goyne 0f2cea4226 Fix the option name for max undo levels in the preferences dialog
Originally committed to SVN as r5862.
2011-11-16 21:59:12 +00:00
Thomas Goyne 95a1071a1b Add the script file name to the close confirmation dialog. Closes #879.
Originally committed to SVN as r5861.
2011-11-16 21:58:58 +00:00
Thomas Goyne de03dfd8a8 Add an option to disable keyframes in the audio display only in karaoke mode. Closes #644.
Originally committed to SVN as r5860.
2011-11-16 19:56:09 +00:00
Thomas Goyne 91a62836a5 Move the keyframe marker provider from the audio controller to the timing controllers
Originally committed to SVN as r5859.
2011-11-16 19:56:00 +00:00
Thomas Goyne 29518f585a Move AudioMarkerProviderKeyframes from audio_controller.cpp to its own header/source files
Originally committed to SVN as r5858.
2011-11-16 19:55:49 +00:00
Thomas Goyne 75d471c538 Remove unneeded overloaded operators for AudioMarkerKeyframe
Originally committed to SVN as r5857.
2011-11-16 19:55:40 +00:00
Thomas Goyne 672f420d6c Fix race conditions in the dsound2 player that occasionally resulted in audio playback stopping instantly
Originally committed to SVN as r5856.
2011-11-16 19:55:31 +00:00
Thomas Goyne b16f1a0698 Use scoped_ptr to store the worker thread in DirectSoundPlayer2
Originally committed to SVN as r5855.
2011-11-16 19:55:22 +00:00
Thomas Goyne f45d9f8e2d Make pointlessly protected members of DirectSourcePlayer2 private
Originally committed to SVN as r5854.
2011-11-16 19:55:13 +00:00
Thomas Goyne 539dc2fbe4 Don't try to handle exceptions thrown by delete
Originally committed to SVN as r5853.
2011-11-16 19:55:04 +00:00
Thomas Goyne a5f6e0588e Move doxygen comments in the dsound2 player to the declarations from the defitions
Originally committed to SVN as r5852.
2011-11-16 19:54:55 +00:00
Thomas Goyne 554a61daf5 Remove redundant wxLogErrors in DirectSoundPlayer2 that the scripted conversion to the new logging system missed
Originally committed to SVN as r5851.
2011-11-16 19:54:45 +00:00
Thomas Goyne 3dd5cbd31d Check for COMMIT_NEW in the visual tools correctly
Originally committed to SVN as r5850.
2011-11-16 19:54:35 +00:00
Thomas Goyne 55fc6c753e Round scales to ints as VSFilter doesn't actually support nonint scales so it's just pointless ugliness
Originally committed to SVN as r5849.
2011-11-16 19:54:25 +00:00
Thomas Goyne 4be9c302d3 Fix rendering of the clip visual tools with detached video
Originally committed to SVN as r5847.
2011-11-12 01:23:40 +00:00
Thomas Goyne 51149104d9 Make all of VideoBox's members private
Originally committed to SVN as r5846.
2011-11-12 01:23:29 +00:00
Thomas Goyne feb752c24c Store the video display and slider in the context directly rather than going through the video box. Fxes a crash when detaching video.
Originally committed to SVN as r5845.
2011-11-12 01:23:18 +00:00
Thomas Goyne 0b742ef3c1 Add operator unspecified-bool-type to agi::scoped_ptr
Originally committed to SVN as r5844.
2011-11-12 01:23:09 +00:00
Thomas Goyne d4ee9da474 Flip the y axis in the scale tool so that moving the mouse up increases size
Originally committed to SVN as r5843.
2011-11-12 01:22:45 +00:00
Thomas Goyne c4369a092f Fix wxGTK assertion failure when opening the TPP dialog
Originally committed to SVN as r5842.
2011-11-09 03:47:26 +00:00
Thomas Goyne a0b74f4424 Fix wxGTK assertion failure in audio_karaoke.cpp
Originally committed to SVN as r5841.
2011-11-09 02:29:36 +00:00
Thomas Goyne 4bd34ee32f Actually compile ffms and libass providers when they're enabled
Originally committed to SVN as r5838.
2011-11-08 06:06:43 +00:00
Thomas Goyne c763026bfc Explicitly declare a storage location for AudioDisplayScrollbar::min_width
Originally committed to SVN as r5837.
2011-11-08 04:53:51 +00:00
Thomas Goyne 3a80292762 Increase required wx version to 2.9.2
Originally committed to SVN as r5836.
2011-11-08 04:14:03 +00:00
Thomas Goyne 2d61579a65 Remove the AC_LIB_RPATH hack as it breaks gettext detection and generates a million warnings
Originally committed to SVN as r5835.
2011-11-08 04:12:47 +00:00
Thomas Goyne 06932668ee Wrap the code argument to AC_*_IFELSE with AC_LANG_SOURCE
Originally committed to SVN as r5834.
2011-11-08 04:06:31 +00:00
Thomas Goyne 1073b3f7f0 Remove bogus (and pointless) initialization in the glibc iconv-backed converter
Originally committed to SVN as r5833.
2011-11-08 03:44:46 +00:00
Thomas Goyne bf70b14dfa Add GL to the reporter's LDFLAGS
Originally committed to SVN as r5832.
2011-11-08 03:43:01 +00:00
Thomas Goyne c04af51c86 Include lua.hpp rather than the .h versions on non-windows as lua is normally compiled as C, not C++
Originally committed to SVN as r5831.
2011-11-08 01:18:16 +00:00
Thomas Goyne 89541a949f Actually hide override tags in hide tags mode. Closes #1360.
Originally committed to SVN as r5830.
2011-11-08 00:25:02 +00:00
Thomas Goyne dc380c5848 Refactor BaseGrid painting a bit
Originally committed to SVN as r5829.
2011-11-08 00:24:53 +00:00
Thomas Goyne 8e81fd07ed Move everything but the subtitle modification utility functions from SubtitlesGrid to BaseGrid. There never has been a clean division of responsibilities between them and the split mostly just made things awkward.
Originally committed to SVN as r5828.
2011-11-08 00:24:41 +00:00
Thomas Goyne 14d734298e Add -lrt to the test for ALSA
Originally committed to SVN as r5827.
2011-11-07 15:50:52 +00:00
Thomas Goyne 2f394a7792 Fix compilation with clang (but not linking because wxAny is currently broken with it)
Originally committed to SVN as r5826.
2011-11-07 06:18:34 +00:00
Thomas Goyne 8b5545c98f Finish porting the alsa player from 2.1.9 so that it actually compiles
Originally committed to SVN as r5825.
2011-11-07 05:24:46 +00:00
Thomas Goyne 0aa553eb7c compilation fixes
Originally committed to SVN as r5824.
2011-11-07 04:14:09 +00:00
Thomas Goyne be77dc8307 Mostly rewrite the visual tools and related classes
Convert all coordinates within the visual tools to Vector2D, which has
been significantly extended. Eliminates a lot of issues with accumulated
rounding errors and simplifies a lot of code.

Modernize the visual tools' interactions with the rest of Aegisub by
connecting to signals directly rather than routing everything through
the video display and converting the main visual tool mode toolbar to
the command system.

Extract all references to OpenGL from the visual tools and move them to
OpenGLWrapper as a first step towards making it possible to implement an
alternative video renderer. In the process, eliminate all uses of OpenGL
immediate mode.

Fix a bunch of minor issues and general instability.

Originally committed to SVN as r5823.
2011-11-06 17:18:20 +00:00
Thomas Goyne 2e5cbf079e Update ?script after save as
Originally committed to SVN as r5822.
2011-11-06 17:18:14 +00:00
Thomas Goyne 5176ae4407 Flush hotkeys after they're modified
Originally committed to SVN as r5821.
2011-11-06 17:18:08 +00:00
Thomas Goyne e9e02539ac Fix crash when setting hotkeys
Originally committed to SVN as r5820.
2011-11-06 17:18:02 +00:00
Thomas Goyne abaf8fc2c4 Non-precompiled-header compilation fix
Originally committed to SVN as r5819.
2011-11-04 19:42:59 +00:00
Thomas Goyne 092ecafe58 Make ConfigVisitor::AddOptionValue less dumb
Originally committed to SVN as r5818.
2011-11-04 19:42:50 +00:00
Thomas Goyne 8fcd3daf28 Rewrite the array config visitor so that it doesn't need the OptionValueList base class
Originally committed to SVN as r5817.
2011-11-04 19:42:40 +00:00
Thomas Goyne 84c545b978 Return const references from OptionValue::GetList* rather than taking an output parameter. Eliminates some copies of lists and makes the calling code less awkward.
Originally committed to SVN as r5816.
2011-11-04 19:42:31 +00:00
Thomas Goyne ba2794b2fe Replace some const strings with const references to strings
Originally committed to SVN as r5815.
2011-11-04 19:42:21 +00:00
Thomas Goyne 05059732f9 Replace incorrect uses of bitwise or with logical or
Originally committed to SVN as r5814.
2011-11-04 19:42:12 +00:00
Thomas Goyne 579203989b Remove pointless explicit empty constructors from OptionValue base classes
Originally committed to SVN as r5813.
2011-11-04 19:42:04 +00:00
Thomas Goyne 723d3b9780 Pass const references into OptionValue::SetList* rather than const values
Originally committed to SVN as r5812.
2011-11-04 19:41:54 +00:00
Thomas Goyne 6e2e87c0b5 Fix incorrect lowercasing in AssFile::GetScriptInfo
Originally committed to SVN as r5811.
2011-11-04 19:41:43 +00:00
Thomas Goyne f48bc59694 Add locks around CSRI operations as VSFilter isn't even vaguely threadsafe
Originally committed to SVN as r5810.
2011-11-04 05:11:31 +00:00
Thomas Goyne 29f0786c81 Update the video box time boxes when the active line changes
Originally committed to SVN as r5809.
2011-11-04 05:11:24 +00:00
Thomas Goyne 4d2a2c618e Set the user agent used for the update checker requests rather than leaving it as 'wxWidgets 2.x'
Originally committed to SVN as r5808.
2011-11-03 22:50:54 +00:00
Thomas Goyne 2cbe7455bb Don't set icons for check and radio menu items as checked icons aren't supported yet
Originally committed to SVN as r5807.
2011-11-03 00:29:23 +00:00
Thomas Goyne 6a31f840a6 Fix crash when slots disconnect from a signal in response to that signal
Originally committed to SVN as r5806.
2011-11-03 00:29:13 +00:00
Thomas Goyne ccebd521c6 Fix errors in update checker resulting from trying to use the wrong option type
Originally committed to SVN as r5805.
2011-10-29 05:12:19 +00:00
Thomas Goyne dedccc1f58 Handle errors when opening audio via the MRU menu
Originally committed to SVN as r5804.
2011-10-29 04:31:05 +00:00
Thomas Goyne 52a2316934 Don't display an error message if the user cancels audio loading
Originally committed to SVN as r5803.
2011-10-29 04:30:58 +00:00
Thomas Goyne 31a3b9aae0 Do nothing if video is played with no video loaded rather than crashing
Originally committed to SVN as r5802.
2011-10-29 04:30:52 +00:00
Thomas Goyne 402ba0e89d Fix loading subtitles from matroska files
Originally committed to SVN as r5801.
2011-10-29 04:16:31 +00:00
Thomas Goyne 6315192e2b Don't reuse buffers in the audio provider converters, as it isn't thread-safe to do so and making it thread-safe would hurt performance more than the extra allocations
Originally committed to SVN as r5800.
2011-10-29 03:47:02 +00:00
Thomas Goyne af3f160f43 Increase msvc heap limit to 130 so that the precompiled header is buildable
Originally committed to SVN as r5799.
2011-10-29 03:46:57 +00:00
Thomas Goyne 085560b8c8 Use a single class for all audio endian and bit-depth conversion as while it's slower than the specialized ones, it isn't significantly so
Originally committed to SVN as r5798.
2011-10-29 03:46:51 +00:00
Thomas Goyne f9408031b6 Add support for 24-64 bit audio. Based on a patch by SAPikachu. Updates #1292.
Originally committed to SVN as r5797.
2011-10-29 03:46:44 +00:00
Thomas Goyne 7f06849531 Rewrite the audio format converters, splitting each conversion into its own class
Originally committed to SVN as r5796.
2011-10-29 03:46:36 +00:00
Thomas Goyne 9a8fb66fbf Remove an unused variable in BaseGrid::UpdateMaps
Originally committed to SVN as r5795.
2011-10-28 20:40:53 +00:00
Thomas Goyne f48f17cd0b Implement the hotkey page of the preferences dialog
Originally committed to SVN as r5794.
2011-10-28 20:40:43 +00:00
Thomas Goyne 6c995e7780 Add support for modifying hotkeys while the program is running
Originally committed to SVN as r5793.
2011-10-28 20:40:32 +00:00
Thomas Goyne cba0b1edb8 Add a function to get a list of all registered command names
Originally committed to SVN as r5792.
2011-10-28 20:40:20 +00:00
Thomas Goyne ffa622d698 Fix compilation without precompiled headers
Originally committed to SVN as r5791.
2011-10-28 20:15:10 +00:00
Thomas Goyne 0a04b62d1d Add a long overload to UnknownElement for gcc
Originally committed to SVN as r5790.
2011-10-28 20:13:58 +00:00
Thomas Goyne f9f84b18f7 Use the error style for the entire thing-that-can't-be-a-tag-name rather than just the first character when a backslash is followed by garbage in an override block
Originally committed to SVN as r5786.
2011-10-26 02:48:08 +00:00
Thomas Goyne 48070be3a3 Move the audio display mouse wheel handling to the audio box so that it can update the horizontal zoom scrollbar
Originally committed to SVN as r5785.
2011-10-25 20:28:30 +00:00
Thomas Goyne b4ace668de Only display the cursor time in the audio display when it's enabled
Originally committed to SVN as r5784.
2011-10-25 20:28:19 +00:00
Thomas Goyne 17b9347562 Add mouse wheel forwarding to ScintillaTextCtrl as wxSTC uses the scroll wheel
Originally committed to SVN as r5783.
2011-10-25 19:41:06 +00:00
Thomas Goyne 9ed1653aae Add mouse wheel forwarding code to FrameMain for when focus is on something that doesn't handle scroll events
Originally committed to SVN as r5782.
2011-10-25 19:40:57 +00:00
Thomas Goyne 1741ce93f6 Factor out the mouse wheel forwarding code in the audio display to a function used by the audio display, video display and subtitles grid, and make it actually work
Originally committed to SVN as r5781.
2011-10-25 19:40:45 +00:00
Thomas Goyne be75262f73 Reload scripts through their manager so that the menu is aware of changes
Originally committed to SVN as r5780.
2011-10-25 19:02:01 +00:00
Thomas Goyne ec9d50a43a Set shadow_w to the correct value in AssStyle's copy constructor
Originally committed to SVN as r5779.
2011-10-25 19:01:53 +00:00
Thomas Goyne f6c8c83f5a Obey the option to disable the keyframe markers in the audio display
Originally committed to SVN as r5778.
2011-10-25 19:01:41 +00:00
Thomas Goyne 7476dfd9c6 Use GetScriptInfoAsInt in AssFile::GetResolution
Originally committed to SVN as r5777.
2011-10-25 01:16:56 +00:00
Thomas Goyne af19dad6ea Remove pointless try\catch in AssFile;GetScriptInfoAsInt (wx functions don't throw exceptions)
Originally committed to SVN as r5776.
2011-10-25 01:16:47 +00:00
Thomas Goyne 2ad0342103 Make AssFile::GetScriptInfo slightly less dumb
Originally committed to SVN as r5775.
2011-10-25 01:16:36 +00:00
Thomas Goyne 5c487ae75f Don't apply the changes from an automation macro if an error occured
Originally committed to SVN as r5774.
2011-10-25 01:15:03 +00:00
Thomas Goyne 3a218c9dd4 Only set video zoom when loading associated video if it's actually present in the file
Originally committed to SVN as r5772.
2011-10-24 20:18:25 +00:00
Thomas Goyne 10464e4617 Kill AegisubApp::OnMouseWheel. It breaks the mouse wheel in dialogs, and it didn't actually work at the moment and isn't really the right way to handle mouse wheel forwarding in the first place
Originally committed to SVN as r5771.
2011-10-24 20:18:16 +00:00
Thomas Goyne 5e01f09b30 Refactor DialogAutomation::OnInfo
Originally committed to SVN as r5770.
2011-10-24 20:18:07 +00:00
Thomas Goyne 7f7aba1bcf Make cmd::Command::name const
Originally committed to SVN as r5769.
2011-10-24 20:17:57 +00:00
Thomas Goyne 4e1e68c88b Allow adding multiple scripts at once in the automation dialog
Originally committed to SVN as r5768.
2011-10-24 20:17:48 +00:00
Thomas Goyne 5cb7bdcbaf Set the event object for colour button click events. Fixes a bug where colour buttons in automation dialogs were completely broken.
Originally committed to SVN as r5767.
2011-10-24 20:17:40 +00:00
Thomas Goyne 374a43cd8b Simplify and speed up the hsl and hsv slider creation code in the color picker dialog
Originally committed to SVN as r5766.
2011-10-24 20:17:30 +00:00
Thomas Goyne c1de03210d Set the style dropdown's value after undo
Originally committed to SVN as r5763.
2011-10-23 17:00:32 +00:00
Thomas Goyne f29e889776 Always update column widths after a new line is added or removed
Originally committed to SVN as r5762.
2011-10-23 17:00:26 +00:00
Thomas Goyne f875938ee4 Don't report a user cancel when the user clicks on the 'Close' button after completion in the progress dialog
Originally committed to SVN as r5761.
2011-10-23 17:00:21 +00:00
Thomas Goyne 1364527681 Fix error when trying to insert to the end of the file from auto4lua
Originally committed to SVN as r5760.
2011-10-23 17:00:14 +00:00
Thomas Goyne d4e17dde2e Factor out the idea of a pen bound to options to a utility class
Originally committed to SVN as r5759.
2011-10-19 04:19:01 +00:00
Thomas Goyne 62f37772a3 Fix a pile of issues that resulted in the Actor box not working at all
Originally committed to SVN as r5758.
2011-10-19 04:05:09 +00:00
Thomas Goyne 035445e93a When the cursor is in a comment block, insert override tags at the beginning of the block rather than inside the comment
Originally committed to SVN as r5757.
2011-10-19 03:24:10 +00:00
Thomas Goyne 4009d24e73 Return an approriately-sized empty icon from icon::get if no icon exists
Originally committed to SVN as r5756.
2011-10-18 00:10:02 +00:00
Thomas Goyne 1da6f46cb2 Log a warning in icon::get if the icon doesn't exist rather than using printf
Originally committed to SVN as r5755.
2011-10-18 00:09:51 +00:00
Thomas Goyne c7d0ce60ee Make the style editor commit its own changes. Fixes some issues where changes made in the style editor would fail to update the rest of the program.
Originally committed to SVN as r5754.
2011-10-17 22:00:58 +00:00
Thomas Goyne a75aa7a633 Eliminate a bunch of pointlessness in json::Writer
Originally committed to SVN as r5753.
2011-10-17 22:00:49 +00:00
Thomas Goyne dd46c7af7f Completely ditch json::Array and json::Object's custom implementations and switch to typedefs to STL types.
Originally committed to SVN as r5752.
2011-10-17 22:00:38 +00:00
Thomas Goyne 4e8848c110 Eliminate a bunch of now unneccesary explicit casts to/from json types
Originally committed to SVN as r5751.
2011-10-17 22:00:28 +00:00
Thomas Goyne b4fa4e6f0c Expose all std::deque members in json::Array
Originally committed to SVN as r5750.
2011-10-17 22:00:18 +00:00
Thomas Goyne 0dee6ea223 Add some convenience overloads to UnknownElement's constructor
Originally committed to SVN as r5749.
2011-10-17 22:00:09 +00:00
Thomas Goyne 36280b7a2b Kill TrivialType_T as it's completely pointless
Originally committed to SVN as r5748.
2011-10-17 21:59:59 +00:00
Thomas Goyne 9dc9047c11 Change json::Object's backing store from a list to a map. Cajun used list to preserve order, but json objects do not guarantee that order will be preserved
Originally committed to SVN as r5747.
2011-10-17 21:59:47 +00:00
Thomas Goyne 2f64a116a7 Make cajun containers implement the STL container interfaces rather than being retarded special snowflakes
Originally committed to SVN as r5746.
2011-10-17 21:59:35 +00:00
Thomas Goyne 85bfb91f73 Add cajun headers to the vc9 libaegisub project
Originally committed to SVN as r5745.
2011-10-17 21:59:24 +00:00
Thomas Goyne 2f43ef2fca Clean up the color picker dialog somewhat
Originally committed to SVN as r5744.
2011-10-17 17:52:49 +00:00
Thomas Goyne 04e385b4d5 Fix potential crash when opening the colorpicker dialog caused by use of an uninitialized variable
Originally committed to SVN as r5743.
2011-10-17 17:52:40 +00:00
Thomas Goyne 8daa6cfdc2 When setting the start or end time of a subtitle line to the current video frame, if the resulting line duration would be less than one frame also update the other time
Originally committed to SVN as r5742.
2011-10-17 17:52:31 +00:00
Thomas Goyne 6895e91e7c Fix validation for Make Lines Continuous
Originally committed to SVN as r5741.
2011-10-17 17:52:22 +00:00
Thomas Goyne cc9cc6d713 Use FFMS_SetOutputFormatV2 with sufficiently recent FFMS2 rather than the deprecated FFMS_SetOutputFormatV
Originally committed to SVN as r5740.
2011-10-17 17:52:11 +00:00
Thomas Goyne 98777eff4e Use the per-platform default audio player from configure rather than always defaulting to portaudio
Originally committed to SVN as r5738.
2011-10-12 23:08:29 +00:00
Thomas Goyne bb4c10a140 Make the audio play commands stop the video like in 2.1.x
Originally committed to SVN as r5737.
2011-10-12 23:08:20 +00:00
Thomas Goyne bf5e504c59 Combine duplicated commands time/snap/frame and time/frame/current into one command that actually works
Originally committed to SVN as r5736.
2011-10-12 23:08:11 +00:00
Thomas Goyne 54f359f91b Enable the correct shift amount text box when opening the shift times dialog rather than always enabling the time one
Originally committed to SVN as r5735.
2011-10-12 23:08:02 +00:00
Thomas Goyne b7efafe3b8 Fix calculation of the time column widths
Originally committed to SVN as r5734.
2011-10-12 23:07:38 +00:00
Thomas Goyne 98786aecba Fix the spelling of 'Choose...' in the preferences dialog
Originally committed to SVN as r5733.
2011-10-11 04:33:41 +00:00
Thomas Goyne 306664d16e Make the browse and font pick buttons in the preferences dialog actually work, and delete BrowseButton as it's no longer used by anything.
Originally committed to SVN as r5732.
2011-10-11 00:06:44 +00:00
Thomas Goyne 91ab2ee9ba Make option names not dumb and wrong
Originally committed to SVN as r5731.
2011-10-11 00:06:34 +00:00
Thomas Goyne a3d9deddb9 Fix endless recursion between SubsTextEditCtrl::UpdateCallTip and UpdateStyle
Originally committed to SVN as r5730.
2011-10-11 00:06:25 +00:00
Thomas Goyne 557e61722b Kill DialogStyleEditor::OnChooseFont, which has been unused for over four years
Originally committed to SVN as r5729.
2011-10-11 00:06:13 +00:00
Thomas Goyne 7dfaa6427c Implement the video position marker in the audio display
Originally committed to SVN as r5728.
2011-10-10 21:04:23 +00:00
Thomas Goyne a260a998b3 Convert newlines to \N when pasting rather than trying to clean them up later
Originally committed to SVN as r5727.
2011-10-10 20:59:04 +00:00
Thomas Goyne 6e30ff633c Fix compilation without precompiled headers
Originally committed to SVN as r5726.
2011-10-10 19:30:11 +00:00
Thomas Goyne fdf74309a5 Don't revert changes to the filename made when undoing. Updates #1345.
Originally committed to SVN as r5725.
2011-10-10 17:29:35 +00:00
Thomas Goyne eb947b3914 Remove dead code in AssFile::CanSave
Originally committed to SVN as r5724.
2011-10-10 17:29:26 +00:00
Thomas Goyne e91834d667 Fix a few colourbutton issues in DialogStyleEditor
Originally committed to SVN as r5723.
2011-10-10 17:29:17 +00:00
Thomas Goyne bd18ad11cb Fix bug making it impossible to modify styles via the style editor
Originally committed to SVN as r5722.
2011-10-10 17:29:09 +00:00
Thomas Goyne 882ee76d59 Eliminate large amounts of duplicated code in DialogStyleEditor
Originally committed to SVN as r5721.
2011-10-10 17:28:59 +00:00
Thomas Goyne cbcc581cea Use PersistLocation for saving and restoring DialogStyleEditor's position
Originally committed to SVN as r5720.
2011-10-10 17:28:48 +00:00
Thomas Goyne 9ccd06b610 Uninvert playing the first/last 500ms of the selection
Originally committed to SVN as r5709.
2011-10-01 18:35:37 +00:00
Thomas Goyne ac37a080c4 Change edit/search_replace to edit/find_replace in the default menu
Originally committed to SVN as r5708.
2011-10-01 18:35:31 +00:00
Thomas Goyne a8caf35ebe Fix flipped subtitles with libass + avisynth
Originally committed to SVN as r5707.
2011-10-01 18:35:25 +00:00
Thomas Goyne 8624f923d9 Add edit box font face and size to the preferences dialog
Originally committed to SVN as r5706.
2011-10-01 18:35:19 +00:00
Thomas Goyne 3ff8591c22 Add a third period to ellipses with only two
Originally committed to SVN as r5705.
2011-10-01 18:35:12 +00:00
Thomas Goyne 9b00fad2fc Include the column headers in the column width calculations in BaseGrid
Originally committed to SVN as r5704.
2011-10-01 18:35:06 +00:00
Thomas Goyne 3dc0ed6c56 Use CmdDown in BaseGrid rather than #ifdefs
Originally committed to SVN as r5703.
2011-10-01 18:35:00 +00:00
Thomas Goyne c199bd6d18 Only forward scroll wheel events to siblings and not parents to work around wx weirdness
Originally committed to SVN as r5702.
2011-10-01 18:34:49 +00:00
Thomas Goyne 5be401a1de Rename edit/search_replace to edit/find_replace for consistency
Originally committed to SVN as r5701.
2011-09-30 23:51:41 +00:00
Thomas Goyne 76467584bb Rearrange FrameMain's constructor so that the frame is shown before the updates check and files are loaded. Fixes some ugliness and a bug where the detached video dialog wasn't being parented correctly
Originally committed to SVN as r5700.
2011-09-30 20:43:04 +00:00
Thomas Goyne e2ea5598fc Remove a pointless sizer around the video box
Originally committed to SVN as r5699.
2011-09-30 20:42:55 +00:00
Thomas Goyne 87290be48e Use Close rather than Destroy when closing the detached video dialog via the command
Originally committed to SVN as r5698.
2011-09-30 20:42:46 +00:00
Thomas Goyne da6a208062 Bind wxEVT_LEFT_DCLICK in VideoDisplay so the cross and drag visual tools work
Originally committed to SVN as r5697.
2011-09-30 20:42:37 +00:00
Thomas Goyne ce1783a868 Fix crash on commit in karaoke mode when autocommit is off
Originally committed to SVN as r5696.
2011-09-30 20:42:28 +00:00
Thomas Goyne 529f61e655 Allow overriding the aspect ratio when video is detached
Originally committed to SVN as r5695.
2011-09-30 20:42:20 +00:00
Thomas Goyne 3776051f96 Make the karaoke syllable table from aegisub.parse_karaoke_data zero-based for backward compatibility
Originally committed to SVN as r5694.
2011-09-30 20:42:09 +00:00
Thomas Goyne 5c75c9f708 Implement the audio scroll commands
Originally committed to SVN as r5693.
2011-09-30 20:41:56 +00:00
Thomas Goyne 597dd4bb8e Don't try to detach on video open if the video is already detached
Originally committed to SVN as r5692.
2011-09-30 20:41:44 +00:00
Thomas Goyne bdcc2ec170 Defriend VideoContext and AudioProvider
Originally committed to SVN as r5691.
2011-09-30 20:41:33 +00:00
Thomas Goyne ea2525cd00 Remove unneccesary forward declarations from video_context.h
Originally committed to SVN as r5690.
2011-09-30 20:41:22 +00:00
Thomas Goyne 8bda12596a Increase the minimum width of the thumb in the audio display scrollbar
Originally committed to SVN as r5689.
2011-09-30 20:41:10 +00:00
Thomas Goyne 8f918a59c2 Add some missing customizable subtitle grid colors to the preferences dialog
Originally committed to SVN as r5688.
2011-09-30 20:40:58 +00:00
Thomas Goyne d5c4a9bec6 Get line start and end marker colors in dialogue mode from options
Originally committed to SVN as r5687.
2011-09-30 20:40:44 +00:00
Thomas Goyne c4544839e9 Explicitly set the size of ColourButton as the default looks somewhat odd with wx trunk
Originally committed to SVN as r5686.
2011-09-29 20:27:50 +00:00
Thomas Goyne 546ced012a Fix option names for syntax highlighting colors
Originally committed to SVN as r5685.
2011-09-29 20:27:40 +00:00
Thomas Goyne 0f8bafb432 Change default color for the end of line marker in the audio display to blue
Originally committed to SVN as r5684.
2011-09-29 20:27:32 +00:00
Thomas Goyne 62181365b9 Default to 25 FPS if there are too few frames in a video to compute the FPS
Originally committed to SVN as r5683.
2011-09-29 20:27:23 +00:00
Thomas Goyne 32463efb08 Fix crash when trying to open audio from file with no audio tracks
Originally committed to SVN as r5682.
2011-09-29 20:27:13 +00:00
Thomas Goyne 7b1dea1a7a Eliminate flickering when moving the mouse over the karaoke split/join bar
Originally committed to SVN as r5681.
2011-09-29 18:17:37 +00:00
Thomas Goyne ab52f9a441 Move most of the autosave logic to AssFile and only autosave if there's actually been changes since the last autosave
Originally committed to SVN as r5680.
2011-09-29 18:17:27 +00:00
Thomas Goyne 00dd477a40 Remove unused method FrameMain::OnSubtitlesSave
Originally committed to SVN as r5679.
2011-09-29 18:17:17 +00:00
Thomas Goyne 08307674a0 Make AudioBox responsible for showing and hiding the karaoke bar, and make it shift the subs box down rather than shrink the audio display
Originally committed to SVN as r5678.
2011-09-29 05:33:10 +00:00
Thomas Goyne 094a6d081c Move the audio box height management code from FrameMain to AudioBox
Originally committed to SVN as r5677.
2011-09-29 05:33:04 +00:00
Thomas Goyne c211975b65 Remove unused window IDs in AudioBox
Originally committed to SVN as r5676.
2011-09-29 05:32:58 +00:00
Thomas Goyne fca7657e60 Don't let the user drag the audio sash below the bottom of the window as it's rather hard to drag back afterwards
Originally committed to SVN as r5675.
2011-09-29 04:38:34 +00:00
Thomas Goyne a00a3047cb Save and restore the height of the audio display across sessions
Originally committed to SVN as r5674.
2011-09-29 04:38:27 +00:00
Thomas Goyne 6beb266c15 Use the end of line marker style for the end marker in karaoke mode rather than the start of line style
Originally committed to SVN as r5673.
2011-09-29 04:38:22 +00:00
Thomas Goyne 9b9482b96f Set the subs box's style and size correctly
Originally committed to SVN as r5672.
2011-09-29 04:38:15 +00:00
Thomas Goyne 9ad1434f37 Don't rely on ADL for std algorithms called on wxArrayInt as wxArrayInt doesn't always inherit from std::vector
Originally committed to SVN as r5671.
2011-09-29 02:33:22 +00:00
Thomas Goyne 34a7f16214 Skip over invalid entries in the MRU file rather than crashing on startup
Originally committed to SVN as r5670.
2011-09-29 00:37:18 +00:00
Thomas Goyne c328bdfa5f Fix typo that resulted in automation macros not being able to set undo points
Originally committed to SVN as r5669.
2011-09-29 00:10:22 +00:00
Thomas Goyne 0f605b358f Make the automation dialog resizable
Originally committed to SVN as r5668.
2011-09-28 21:38:18 +00:00
Thomas Goyne 6a49b5392d Write MRU data to disk whenever a change is made rather than only on program exit
Originally committed to SVN as r5667.
2011-09-28 19:52:46 +00:00
Thomas Goyne 5411a57b3c Add the command name for macros to the information popup in the automation dialog
Originally committed to SVN as r5666.
2011-09-28 19:52:37 +00:00
Thomas Goyne dbca576d50 Require that macros defined in a single script have unique names
Originally committed to SVN as r5665.
2011-09-28 19:52:28 +00:00
Thomas Goyne c632a662b2 Change the naming scheme for lua commands to 'automation/lua/[Script File Name]/[Macro Name]'
Originally committed to SVN as r5664.
2011-09-28 19:52:20 +00:00
Thomas Goyne 799c18e22d Remove unused includes in auto4_lua.cpp
Originally committed to SVN as r5663.
2011-09-28 19:52:11 +00:00
Thomas Goyne 1e13670c70 Improve error handling in LuaModuleLoader and don't keep trying to load modules after one has been found
Originally committed to SVN as r5662.
2011-09-28 19:52:02 +00:00
Thomas Goyne d3ea9236cf Correct closing audio in FrameMain::OnSubtitlesOpen
Originally committed to SVN as r5661.
2011-09-28 19:51:53 +00:00
Thomas Goyne 77d02d269d Eliminate a use of VideoContext::Get in AudioMarkerProviderKeyframes
Originally committed to SVN as r5660.
2011-09-28 19:51:44 +00:00
Thomas Goyne 6bf4a95428 Add a subtitles save slot to AudioController which stores the audio URI in the subtitles
Originally committed to SVN as r5659.
2011-09-28 19:51:35 +00:00
Thomas Goyne 74ae9189a2 Set ?audio to the path to the currently open audio file
Originally committed to SVN as r5658.
2011-09-28 19:51:26 +00:00
Thomas Goyne 9fc0b33cdf Add opened audio files to the audio mru list
Originally committed to SVN as r5657.
2011-09-28 19:51:18 +00:00
Thomas Goyne d863d4379b Implement Audio/Auto/Scroll option
Originally committed to SVN as r5656.
2011-09-28 19:51:09 +00:00
Thomas Goyne 976061747d Fix setting of filename when saving the subtitles
Originally committed to SVN as r5655.
2011-09-28 19:50:59 +00:00
Thomas Goyne bfcd76c4aa Add missing #include <algorithm> to scoped_ptr.h
Originally committed to SVN as r5654.
2011-09-28 19:50:50 +00:00
Thomas Goyne 5a49abb2eb Fix bug in BaseGrid::GetSelection that resulted in row 0 always being selected
Originally committed to SVN as r5653.
2011-09-28 19:50:41 +00:00
Thomas Goyne bb72ec980e Actually select the new line when a new dialogue line is added due to the user switching to the next line from the edit box
Originally committed to SVN as r5652.
2011-09-28 19:50:32 +00:00
Thomas Goyne 94998f4283 Update ths column widths in BaseGrid when the number of digits in the row number changes
Originally committed to SVN as r5651.
2011-09-28 19:50:24 +00:00
Thomas Goyne b55ff3f803 Switch auto4lua to a transactional model which applies changes to the subtitle file only if a macro runs to completion without errors or the user cancelling. Significantly improves behavior when the user cancels and fixes a race condition caused by committing on threads other than the GUI thread.
Originally committed to SVN as r5650.
2011-09-28 19:50:14 +00:00
Thomas Goyne 28afc48ca5 Eliminate an uninitialized variable warning
Originally committed to SVN as r5649.
2011-09-28 19:50:06 +00:00
Thomas Goyne d419c7a447 Implement the Automation menu
Originally committed to SVN as r5648.
2011-09-28 19:49:56 +00:00
Thomas Goyne 5bb5f146a7 Make the project context available to lua C functions so that they can use that instead of VideoContext::Get()
Originally committed to SVN as r5647.
2011-09-28 19:49:47 +00:00
Thomas Goyne dfef9191f9 Move the creation of the progress dialog for the audio caches to AudioProvider and just pass the BackgroundRunner to the caches. This still isn't the right place to be creating it, but this removes the UI-dependency for both caches.
Originally committed to SVN as r5646.
2011-09-28 19:49:37 +00:00
Thomas Goyne a9dc1f045d Remove "Config" from the name of ScriptConfigDialog and friends as they're used for more than just config, and clean up the implementations.
Originally committed to SVN as r5645.
2011-09-28 19:49:27 +00:00
Thomas Goyne 59d11f4cc4 Make it so auto4lua macros can have an IsActive function. Probably not very useful at the moment.
Originally committed to SVN as r5644.
2011-09-28 19:49:18 +00:00
Thomas Goyne 60ea67661a Do a better job of setting the module load path in LuaAssFile
Originally committed to SVN as r5643.
2011-09-28 19:49:09 +00:00
Thomas Goyne 8ba559b7f7 Clean up Automation4::ScriptManager
Originally committed to SVN as r5642.
2011-09-28 19:48:58 +00:00
Thomas Goyne eec3d64221 Make automation macros standard commands and remove the Automation4::Feature base class as it's no longer a useful abstraction.
Originally committed to SVN as r5641.
2011-09-28 19:48:47 +00:00
Thomas Goyne 492a0d3046 Make Automation4::Script mostly pure abstract and clean up the implementation of LuaScript
Originally committed to SVN as r5640.
2011-09-28 19:48:37 +00:00
Thomas Goyne c09259c93d Throw typed exceptions in automation rather than strings
Originally committed to SVN as r5639.
2011-09-28 19:48:28 +00:00
Thomas Goyne 6d0e44baad Use LocalScriptManager::Reload rather than looping over the scripts manually in the am/manager command
Originally committed to SVN as r5638.
2011-09-28 19:48:20 +00:00
Thomas Goyne af9315f1aa Remove some lingering unused automation things in frame_main
Originally committed to SVN as r5637.
2011-09-28 19:48:11 +00:00
Thomas Goyne f970508e67 Add the ability to unregister commands and clarify who owns command objects
Originally committed to SVN as r5636.
2011-09-28 19:48:02 +00:00
Thomas Goyne 8aca250fd0 Kill cmd::id and friends. It didn't work correctly as ids weren't stable and only VideoBox still used it
Originally committed to SVN as r5635.
2011-09-28 19:47:53 +00:00
Thomas Goyne 53b6765dd8 Redesign DialogProgress
Add agi::ProgressSink and agi::BackgroundRunner interfaces to libaegisub
which represent a generic progress sink and a thing which calls funtions
that need progress sinks. Make DialogProgress implement
agi::BackgroundRunner, invoking the passed function on a worker thread
and giving it a progress sink to update the dialog with.

Rewrite Automation4::ProgressSink, LuaThreadedCall and all related
classes to be based on agi::ProgressSink. Automation now simply uses
DialogProgress (although that's merely an implementation detail) and
adds a single method to route dialog opening from the worker thread to
the GUI thread.

Originally committed to SVN as r5634.
2011-09-28 19:47:40 +00:00
Thomas Goyne 5439c6dae6 Remove some old video options from default_config.json
Originally committed to SVN as r5633.
2011-09-28 19:47:31 +00:00
Thomas Goyne f341a63f14 Delete all the unused things in MatroskaWrapper (i.e. most of it), fix some derpy things, and make it throw typed exceptions.
Originally committed to SVN as r5632.
2011-09-28 19:47:21 +00:00
Thomas Goyne 2ca9392942 Set more finely-grained commit types from LuaAssFile rather than always using COMMIT_NEW
Originally committed to SVN as r5631.
2011-09-28 19:47:12 +00:00
Thomas Goyne 08a61c7fd4 Refactor LuaAssFile's implementation
Switch to 1-based indices to match Lua rather than converting back and
forth all over the place.

Eliminate a bunch of duplicated code.

Fix a few memory leaks.

Automatically set an undo point at the end of a macro if there are any
uncommited changes.

Originally committed to SVN as r5630.
2011-09-28 19:47:03 +00:00
Thomas Goyne df100fb5a5 Pass a project context to AssExportFilter::GetConfigDialogWindow so that export filters don't have to use things like AssFile::top and VideoContext::Get
Originally committed to SVN as r5629.
2011-09-28 19:46:53 +00:00
Thomas Goyne 9ce579e187 Document and clean up a bunch of exporter related things. Break some friendships, and add a getter for export filter names.
Originally committed to SVN as r5628.
2011-09-28 19:46:41 +00:00
Thomas Goyne cec07012e7 Add auto4_lua_factory.h to the vc9 project
Originally committed to SVN as r5627.
2011-09-28 19:46:32 +00:00
Thomas Goyne dfc18afd34 Replace custom karaoke parsing code in LuaAssFile with AssKaraoke
Originally committed to SVN as r5626.
2011-09-28 19:46:23 +00:00
Thomas Goyne 1329245a21 Clean up the automation dialog and don't let the user load the same script twice
Originally committed to SVN as r5625.
2011-09-28 19:46:14 +00:00
Thomas Goyne 53c0b6ff3a Clean up and document ScriptFactory, and add a function to get the full wildcard string for all registered automation engines
Originally committed to SVN as r5624.
2011-09-28 19:46:05 +00:00
Thomas Goyne 7680d6c246 Move the local script logic from FrameMain to a new LocalScriptManager
Originally committed to SVN as r5623.
2011-09-28 19:45:55 +00:00
Thomas Goyne 3029436a2d Drop some AS5-specific stuff in LuaAssfile
Originally committed to SVN as r5622.
2011-09-28 19:45:47 +00:00
Thomas Goyne 0a91be1c7c Unconditionally enable building automation even if there are no enabled engines as there isn't really any reason not to and the defines uglify the code.
Originally committed to SVN as r5621.
2011-09-28 19:45:35 +00:00
Thomas Goyne 66e826edb3 Split LuaProgressSink into its own cpp file to cut down on the bloatedness of auto4_lua.cpp
Originally committed to SVN as r5620.
2011-09-28 19:45:25 +00:00
Thomas Goyne 0b6ef72242 Rewrite LuaScriptReader, making it simpler and adding support for more charsets
Originally committed to SVN as r5619.
2011-09-28 19:45:16 +00:00
Thomas Goyne 432abc309b Remove WITH_OLD_HUNSPELL. 1.2.0 is four years old and the configure script doesn't even support older versions that would require WITH_OLD_HUNSPELL
Originally committed to SVN as r5618.
2011-09-28 19:45:07 +00:00
Thomas Goyne 4ec507f814 Clean up SubtitleFormat
Document all of the SubtitleFormat methods.

Add default implementations of CanReadFile and CanWriteFile that check
against the appropriate wildcard list.

Clean up and simplify a lot of very odd code.

Throw typed exceptions in all subtitle readers rather than strings.

Originally committed to SVN as r5617.
2011-09-28 19:44:53 +00:00
Thomas Goyne 156885b56d Make AudioTimingControllerDialogue operate on a project context
Originally committed to SVN as r5616.
2011-09-28 19:44:44 +00:00
Thomas Goyne a25c5c1909 Rewrite the subtitles edit control's syntax highlighting
Simplify and clean up the parsing code to better represent how VSFilter
actually handles many odd edge cases as well as making it significantly
faster.

Use an enum for syntax style IDs rather than magic numbers.

Add styles for comments, draw mode and karaoke templater variables
rather than reusing other styles and move some hardcoded style
information to the config file.

Operate on the utf-8 representation of the edit box text rather than a
wxString, as it's both faster and simpler.

Originally committed to SVN as r5615.
2011-09-28 19:44:34 +00:00
Thomas Goyne 67ab06e830 Add an optional argument to AssFile::Commit which indicates that only a single line was changed. Currently used only to cut down on file copies when coalescing.
Originally committed to SVN as r5614.
2011-09-28 19:44:24 +00:00
Thomas Goyne c936306593 Rewrite nearly everything related to karaoke
Move most karaoke parsing/serializing/editing code to AssKaraoke rather
than being scattered all over the place, and add much better support for
non-karaoke override tags and comments.

Add a karaoke timing controller.

Redesign the karaoke syllable split/join interface to have a single mode
from which both splitting and joining can be done rather than separate
split and join modes.

Only show the karaoke split/join bar when karaoke mode is enabled.

Closes #886, #987, #1190.

Originally committed to SVN as r5613.
2011-09-28 19:44:07 +00:00
Thomas Goyne cc147d1660 Eliminate uses of c_str made unnecessary by changed to wxString::Format in wx 2.9
Originally committed to SVN as r5612.
2011-09-28 19:43:48 +00:00
Thomas Goyne d990bbbb99 Eliminate all unnecessary uses of L and _T
Originally committed to SVN as r5611.
2011-09-28 19:43:11 +00:00
Niels Martin Hansen 7250b89cbd MSBuild project updates.
Originally committed to SVN as r5603.
2011-09-15 14:50:08 +00:00
Thomas Goyne 088976554c Fix non-precomp-header compilation
Originally committed to SVN as r5602.
2011-09-15 06:12:26 +00:00
Thomas Goyne d70fb7fe2d Fix compilation errors
Originally committed to SVN as r5601.
2011-09-15 06:03:13 +00:00
Thomas Goyne 683dd6c0a9 Kill BaseGrid::SelectVisible
Originally committed to SVN as r5600.
2011-09-15 05:17:43 +00:00
Thomas Goyne 11c40188c2 Eliminate some old selection code in BaseGrid
Originally committed to SVN as r5599.
2011-09-15 05:17:36 +00:00
Thomas Goyne 05da23b22f Mostly detangle the edit box from the subtitles grid
Originally committed to SVN as r5598.
2011-09-15 05:17:29 +00:00
Thomas Goyne 3c4191e649 Kill SubtitlesGrid::SetSubsToVideo
Originally committed to SVN as r5597.
2011-09-15 05:17:22 +00:00
Thomas Goyne 0c4eb020a4 Rewrite the shift times dialog, detangling it from the grid and making it modeless, and add support for characters outside the local charset in the shift history file path. Closes #1269.
Originally committed to SVN as r5596.
2011-09-15 05:17:14 +00:00
Thomas Goyne 1f095b0a01 Remove the SubsEditBox from the context in favor of the SubsEditTextCtrl as it was the only public member of SubsEditBox
Originally committed to SVN as r5595.
2011-09-15 05:17:07 +00:00
Thomas Goyne d022d2ae56 Eliminate pointless (and slow) setting of the edit box to its current text
Originally committed to SVN as r5594.
2011-09-15 05:17:00 +00:00
Thomas Goyne 5b3b821696 Always keep the active line visible in the grid
Originally committed to SVN as r5593.
2011-09-15 05:16:54 +00:00
Thomas Goyne 1cc5d4001a Rewrite the selection dialog, detangling it from SubtitlesGrid and making it modeless
Originally committed to SVN as r5592.
2011-09-15 05:16:47 +00:00
Thomas Goyne 584f36a744 Detangle the spellchecker dialog from the subtitles grid, make it modelss, and fix a lot of edges cases
Originally committed to SVN as r5591.
2011-09-15 05:16:41 +00:00
Thomas Goyne 934a5b24eb Refine the commit types
Switch to a bitmask with much more finely-grained information about what
changed in the commit, fixing a few potential correctness problems and
significantly improving the performance of several scenarios where commits
are spammed very frequently.

Originally committed to SVN as r5590.
2011-09-15 05:16:32 +00:00
Thomas Goyne 3f05fe6b3e Add support for labels in the audio display
Originally committed to SVN as r5589.
2011-09-15 05:16:26 +00:00
Thomas Goyne 3e708eab10 Slightly simplify parts of AudioDisplay
Originally committed to SVN as r5588.
2011-09-15 05:16:18 +00:00
Thomas Goyne e5d660e281 Hide visual tools while video is playing. Closes #1336.
Originally committed to SVN as r5586.
2011-09-02 00:03:40 +00:00
Thomas Goyne 182b57bd0f Fix compilation with precompiled headers off
Originally committed to SVN as r5579.
2011-08-31 04:23:18 +00:00
Thomas Goyne d82e2bb496 Use wxEVT_CONTEXT_MENU for context menus rather than right button down so that the context menu key works correctly. Updates #1238.
Originally committed to SVN as r5578.
2011-08-31 04:17:37 +00:00
Thomas Goyne 1c4410bb87 Make middle-click on the audio display seek the video to the clicked on time
Originally committed to SVN as r5577.
2011-08-31 04:17:31 +00:00
Thomas Goyne 02d4ee0cec Revert when the dialogue timing controller is created to avoid broken behavior when leaving karaoke mode
Originally committed to SVN as r5576.
2011-08-31 04:17:24 +00:00
Thomas Goyne 7155ace1d9 Fix merge error in ass_file.h
Originally committed to SVN as r5573.
2011-08-27 07:28:04 +00:00
Thomas Goyne 0de3ce42d5 Speed up BlockCache::Age somewhat
Originally committed to SVN as r5572.
2011-08-27 06:52:49 +00:00
Thomas Goyne 03d7849d12 Significantly speed up grid painting, especially when only some columns need to be repainted
Originally committed to SVN as r5571.
2011-08-27 06:52:42 +00:00
Thomas Goyne b8a1674c27 Remove some cruft from ScintillaTextCtrl and make SetUnicodeStyling significantly faster
Originally committed to SVN as r5570.
2011-08-27 06:52:35 +00:00
Thomas Goyne ccf9f64818 Make Assfile::SetScriptInfo slightly less slow
Originally committed to SVN as r5569.
2011-08-27 06:42:10 +00:00
Thomas Goyne e12bcc6aef Bind VideoContext::OnFileSave to the file save signal rather than the commit signal
Originally committed to SVN as r5568.
2011-08-27 06:42:03 +00:00
Thomas Goyne b14b2eceea Update the Makefile and vc2010 project
Originally committed to SVN as r5567.
2011-08-27 06:37:03 +00:00
Thomas Goyne 2006995645 Revert pending changes when audio is opened to fix problems with stale data
Originally committed to SVN as r5566.
2011-08-27 06:30:56 +00:00
Thomas Goyne a45b971b3a Redesign ToggleBitmap to operate on a command
Originally committed to SVN as r5565.
2011-08-27 06:30:49 +00:00
Thomas Goyne 3ecfd34bd3 Convert the audio toolbar over to the new dynamic toolbar system
Originally committed to SVN as r5564.
2011-08-27 06:30:42 +00:00
Thomas Goyne fc0db4fc36 Convert the VideoDisplay context menu over to the new menu system
Originally committed to SVN as r5563.
2011-08-27 06:30:35 +00:00
Thomas Goyne e2f464c94f Add commands for the video display context menu items
Originally committed to SVN as r5562.
2011-08-27 06:30:29 +00:00
Thomas Goyne ca6d5b1f3e Rearrange VideoDisplay's privates to make them a bit less randomly ordered and switch from auto_ptr to scoped_ptr
Originally committed to SVN as r5561.
2011-08-27 06:30:23 +00:00
Thomas Goyne bc70429ffb Remove #pragma once from subs_grid.h
Originally committed to SVN as r5560.
2011-08-27 06:30:16 +00:00
Thomas Goyne 41119ff6fc Convert the subtitles grid context menu over to the new menu system
Originally committed to SVN as r5559.
2011-08-27 06:30:10 +00:00
Thomas Goyne 017a6aa27d Do stuff to the AVS video provider
Remove the Matroska keyframe/timecode loading code, as opening MKVs via
Avisynth is dumb and didn't work very well anyway.

Fix framerate reporting by actually bothering to read the video
information before trying to use it.

Kill the VFW wrapper and just put the code in the avisynth video source.

If reading the keyframes from an avi file fails just warn the user
rather than refuse to load the video.

Originally committed to SVN as r5558.
2011-08-27 06:30:03 +00:00
Thomas Goyne 27867421b2 Fix some whitespace in frame_main.cpp
Originally committed to SVN as r5557.
2011-08-27 06:29:57 +00:00
Thomas Goyne fb1e6fcbaf Delete some obsolete event handling in FrameMain
Originally committed to SVN as r5556.
2011-08-27 06:29:51 +00:00
Thomas Goyne 5d07756838 Kill FrameMain::HasASSDraw as it's no longer used
Originally committed to SVN as r5555.
2011-08-27 06:29:45 +00:00
Thomas Goyne 626df4db05 Rewrite the dynamic menu generation code
Remove hardcoded assumptions about where in the menu items are and
instead bind menu items directly to commands so that customizing the
menu actually works.

Add support for user menu files that override the default one.

Add better support for multiple menus so that all of the menus can
potentially be created by the dynamic menu system rather than just the
main menu bar.

Add support for commands whose names change based on the current project
state so that undo and redo can work properly.

Simplify the menu json format and make commands responsible for
controlling what type of menu item is created rather than allowing
nonsensical configurations.

The Automation menu is currently not implemented.

Originally committed to SVN as r5554.
2011-08-27 06:29:36 +00:00
Thomas Goyne 319b454bb8 Add hotkeys to the tooltip for toolbar items
Originally committed to SVN as r5538.
2011-08-17 05:32:27 +00:00
Thomas Goyne d3e7f02597 Update the video box time boxes when detached video is first opened
Originally committed to SVN as r5537.
2011-08-17 05:32:21 +00:00
Thomas Goyne 20258438ec Fix incorrect initial size of the detached video dialog
Originally committed to SVN as r5536.
2011-08-17 05:32:15 +00:00
Thomas Goyne 0c1794a93f Don't silently fail to start up if a config file is invalid
Originally committed to SVN as r5535.
2011-08-17 05:32:09 +00:00
Thomas Goyne 330411c94a Add some special cases to line_iterator that makes it significantly faster in common cases
Originally committed to SVN as r5534.
2011-08-17 05:32:01 +00:00
Thomas Goyne 561216d4c8 Make hotkey::check take a project context and make FrameMain::context private
Originally committed to SVN as r5532.
2011-07-29 23:16:55 +00:00
Thomas Goyne ef26170214 Rearrange FrameMain deinitialization so that things which depend on the project context are guaranteed to be destroyed before the context
Originally committed to SVN as r5531.
2011-07-29 23:16:46 +00:00
Thomas Goyne 65368c5f35 Detangle FrameMain and DialogDetachedVideo
Originally committed to SVN as r5530.
2011-07-29 23:16:36 +00:00
Thomas Goyne 3f50ce6d46 Delete FrameMain::LoadVFR as it's not longer used by anything
Originally committed to SVN as r5529.
2011-07-29 23:16:24 +00:00
Thomas Goyne 59755b5bb5 Add command to toggle medusa mode and fix the command names for many hotkeys
Originally committed to SVN as r5528.
2011-07-27 22:59:11 +00:00
Thomas Goyne 6d8d1a48d3 Disable precompiled headers for the C files in release builds and not just debug
Originally committed to SVN as r5527.
2011-07-27 22:59:01 +00:00
Thomas Goyne 1cacc33d2d Simplify version.cpp
Originally committed to SVN as r5526.
2011-07-27 22:52:37 +00:00
Thomas Goyne 3a4c48d8df Fix compilation without precompiled headers
Originally committed to SVN as r5525.
2011-07-27 17:21:39 +00:00
Thomas Goyne db965eb766 Unbreak tag hiding in the grid
Originally committed to SVN as r5524.
2011-07-27 05:54:25 +00:00
Thomas Goyne d937bd80e7 Make opening audio from video actually work
Originally committed to SVN as r5523.
2011-07-27 05:36:42 +00:00
Thomas Goyne 0cc902487d Remove a now-bogus sanity check on thread count in the ffms video provider
Originally committed to SVN as r5522.
2011-07-27 05:36:36 +00:00
Thomas Goyne d3ab35a61f Use PersistLocation for DialogColorPicker
Originally committed to SVN as r5521.
2011-07-27 05:36:30 +00:00
Thomas Goyne 833c35f6ae Use PersistLocation for DialogStyleManager
Originally committed to SVN as r5520.
2011-07-27 05:36:24 +00:00
Thomas Goyne fc46b25726 Rewrite the translation assisant and make it work again
Originally committed to SVN as r5519.
2011-07-27 05:36:15 +00:00
Thomas Goyne 07b77203f1 Rewrite the styling assisant as changes to other parts of Aegisub have made almost all of it broken
Originally committed to SVN as r5518.
2011-07-27 05:36:09 +00:00
Thomas Goyne f906c3dcd2 Factor DialogDetachedVideo's position persistance logic into a seperate class so that it can be used for other dialogs.
Originally committed to SVN as r5517.
2011-07-27 05:36:02 +00:00
Thomas Goyne 3c18ed542c Clean up libaegisub includes
Consistently use the C++ names for headers rather than a combination of the
C and C++ names.

Remove empty LAGI_PRE blocks.

Remove checks for both AGI_PRE and LAGI_PRE and change a check for only
AGI_PRE to LAGI_PRE.

Originally committed to SVN as r5516.
2011-07-26 22:25:21 +00:00
Thomas Goyne ead31761db Include lagi_pre.h in agi_pre.h and remove all duplicates
This eliminates some duplicated logic and potential tr1/non-tr1 header
mismatches, and removes the need for the #if defined(AGI_PRE) ||
defined(LAGI_PRE) guard that was used in a few of the libaegisub headers.

Originally committed to SVN as r5515.
2011-07-26 22:25:10 +00:00
Thomas Goyne 665cddf235 Remove some duplicated includes in lagi_pre.h
Originally committed to SVN as r5514.
2011-07-26 22:24:59 +00:00
Thomas Goyne 2ca6a04543 Remove the C++-only check from agi_pre.h and just don't include it in the C files
Originally committed to SVN as r5513.
2011-07-26 22:24:48 +00:00
Thomas Goyne 12318ced75 Remove the include guard from agi_pre.h as it seems to have magically become unnessesary
Originally committed to SVN as r5512.
2011-07-26 22:24:38 +00:00
Thomas Goyne e92d6f6f65 Don't pass CXXFLAGS to the compiler when compiling .c files
Originally committed to SVN as r5511.
2011-07-26 22:24:26 +00:00
Thomas Goyne 263d161d26 Don't pointlessly store a copy of the default hotkeys json in memory
Originally committed to SVN as r5510.
2011-07-26 20:26:09 +00:00
Thomas Goyne 8e975941b7 Fix inconsistant usage of 'Enter' and 'Return' by switching everything to 'Enter'
Originally committed to SVN as r5509.
2011-07-26 19:53:08 +00:00
Thomas Goyne af484a469d Make get_hotkey_str_first more likely to return the desired hotkey when multiple are available
Originally committed to SVN as r5508.
2011-07-26 19:52:57 +00:00
Thomas Goyne dd38e1f07f Don't swallow errors when parsing json and make agi::json_util::file actually work
Originally committed to SVN as r5507.
2011-07-26 19:52:47 +00:00
Thomas Goyne dabcdb2e8b Uninvert hotkey::Scan's return value
Originally committed to SVN as r5506.
2011-07-26 19:52:36 +00:00
Thomas Goyne ffe8c7a5d6 Only enable the 'Always' hotkey context when medusa mode is on
Originally committed to SVN as r5505.
2011-07-26 19:52:25 +00:00
Thomas Goyne 7deebf759b Remove the concept of disabled hotkeys; it's unnessesary and wasn't actually used
Originally committed to SVN as r5504.
2011-07-26 19:52:15 +00:00
Thomas Goyne acd26c4c48 Fiddle with the log output format so that Visual Studio's parser reads it correctly
Originally committed to SVN as r5503.
2011-07-26 19:52:07 +00:00
Thomas Goyne 87abcddd87 Make the MRU code not so bizzarely overcomplicated
Originally committed to SVN as r5502.
2011-07-26 19:51:56 +00:00
Thomas Goyne 7824348f10 Include the name of the option in the exception thrown when an option is not found
Originally committed to SVN as r5501.
2011-07-26 19:51:47 +00:00
Thomas Goyne a33da9cba5 Replace all uses of std::cout in libaegisub with logging statements and eliminate a lot of nonsense in the windows implementation of acs::Check
Originally committed to SVN as r5500.
2011-07-26 19:51:38 +00:00
Thomas Goyne 64a3cc94ae Fix error checking in agi::util::strtoi
Originally committed to SVN as r5499.
2011-07-26 19:51:28 +00:00
Thomas Goyne 5a9fe91899 Fix swapped expected and actual values in some of the util tests
Originally committed to SVN as r5498.
2011-07-26 19:51:19 +00:00
Thomas Goyne 231adad93f Implement agi::util::freespace for Windows
Originally committed to SVN as r5497.
2011-07-26 19:51:07 +00:00
Thomas Goyne 6f22088b06 Update libass include path to not look for the now nonexistant in-repo copy
Originally committed to SVN as r5494.
2011-07-20 20:09:03 +00:00
Thomas Goyne 52e60f09dc Fix path to config.h in path.cpp
Originally committed to SVN as r5493.
2011-07-20 20:08:51 +00:00
Thomas Goyne 4e0725104d Set default decoding threads for ffms to -1 so that it decides the number automatically
Originally committed to SVN as r5492.
2011-07-20 19:17:56 +00:00
Niels Martin Hansen b60e3a5bd4 Rename another clashing file in libaegisub.
Originally committed to SVN as r5490.
2011-07-18 01:08:41 +00:00
Niels Martin Hansen 89b97a55be Update and simplify project files for recent changes.
Originally committed to SVN as r5489.
2011-07-18 00:43:38 +00:00
Thomas Goyne 85b46bceff Fix required version of FFMS2
Originally committed to SVN as r5486.
2011-07-16 18:43:22 +00:00
Thomas Goyne 72bc33fda3 Fix compilation errors with precompiled headers disabled
Originally committed to SVN as r5484.
2011-07-16 06:42:55 +00:00
Thomas Goyne 0616b39ffe Fix a pile of warnings
Originally committed to SVN as r5483.
2011-07-16 05:01:36 +00:00
Thomas Goyne b509cb0be5 s/WITH_/HAVE_ in src/Makefile so that libass and ffms are actually used when present
Originally committed to SVN as r5482.
2011-07-16 03:52:30 +00:00
Thomas Goyne 8ccc0acc9d Fix reporter compilation errors
Originally committed to SVN as r5481.
2011-07-16 03:36:42 +00:00
Thomas Goyne eea30df7db Kill in-repo libass and ffms and clean up some old cruft in the configure script
Originally committed to SVN as r5480.
2011-07-16 03:36:28 +00:00
Thomas Goyne da3e7e4d88 Only register the assdraw command on windows when assdraw is present
Originally committed to SVN as r5479.
2011-07-15 23:44:03 +00:00
Thomas Goyne 3d22da9fbc Skip invalid commands when constructing the toolbar and menu rather than exploding
Originally committed to SVN as r5478.
2011-07-15 23:43:52 +00:00
Thomas Goyne c32e372dd4 Fix leak of the Options object in agi::Path and potential overwriting of the config file with an out of date version on shutdown
Originally committed to SVN as r5477.
2011-07-15 17:36:53 +00:00
Thomas Goyne 26695a8cc8 Eliminate memory leak in menu code
Originally committed to SVN as r5476.
2011-07-15 17:36:44 +00:00
Thomas Goyne 5c7a848f21 Delete the menu on shutdown
Originally committed to SVN as r5475.
2011-07-15 17:36:35 +00:00
Thomas Goyne be8d841577 Delete built in export filters on exit
Originally committed to SVN as r5474.
2011-07-15 17:36:26 +00:00
Thomas Goyne faecc3304d Delete all commands on shutdown
Originally committed to SVN as r5473.
2011-07-15 17:36:17 +00:00
Thomas Goyne a8a30d6ac1 Fix hotkey memory leaks
Originally committed to SVN as r5472.
2011-07-15 17:36:06 +00:00
Thomas Goyne 1e2abbd45a Fix leak of all icon bitmaps
Originally committed to SVN as r5471.
2011-07-15 17:24:05 +00:00
Thomas Goyne 7842ccbeb1 Kill SubtitlesGrid::SetVideoToSubs
Originally committed to SVN as r5470.
2011-07-15 04:25:23 +00:00
Thomas Goyne e75ea7d2e8 Default to 16x16 icons if the requested size is invalid
The options system currently doesn't support constraints beyond those
forced by the type system, making it easy to set the icon size to a
value which would make it impossible to get to the preferences dialog to
fix it.

Originally committed to SVN as r5469.
2011-07-15 04:06:29 +00:00
Thomas Goyne 88f0659307 Rewrite the toolbar generation code
The old toolbar code didn't actually support any nontrivial
customization of toolbars, as it had a hardcoded list of commands which
would be enabled or disabled, and the checks for enabling/disabling
toolbar buttons was done only in the specific situations which those
commands used.

Make icon size a user customizable option and add support for
dynamically changing it at runtime.

Originally committed to SVN as r5468.
2011-07-15 04:06:23 +00:00
Thomas Goyne f4d44f7c18 Move the zoom box from the main toolbar to the video box
Originally committed to SVN as r5467.
2011-07-15 04:06:16 +00:00
Thomas Goyne b93bb888e3 Use IsActive in frame_main
Originally committed to SVN as r5466.
2011-07-15 04:06:10 +00:00
Thomas Goyne 2b9d47b9fe Add IsActive method to commands to indicate whether or not a radio/checkbox is currently selected
Originally committed to SVN as r5465.
2011-07-15 04:06:03 +00:00
Thomas Goyne ec2c36c743 Add type flags to commands
Originally committed to SVN as r5464.
2011-07-15 04:05:56 +00:00
Thomas Goyne 0af7ae7fca Clean up frame_main a bit
Delete some pointless comments, move documentation to the header, and
extend it a bit

Sort prototypes in the header

Move event IDs out of the header

Remove a few unused includes

Assorted cosmetic changse

Originally committed to SVN as r5463.
2011-07-15 04:05:49 +00:00
Thomas Goyne 95cadb5226 Clean up base_grid a bit
Reduce the visibilty of many members and document some of them

Cut down on recreation of wxPen and wxBrush objects in DrawImage,
probably speeding up painting somewhat

Simplify handling of extendRow

Move event IDs to base_grid.cpp

Remove worthless comments and dead code

Assorted cosmetic changes

Originally committed to SVN as r5462.
2011-07-15 04:05:43 +00:00
Thomas Goyne fdb6d108f8 Use agi::Context::Validate for the main frame's menus and toolbar
Originally committed to SVN as r5461.
2011-07-15 04:05:37 +00:00
Thomas Goyne ef4bfb1535 use agi::Context::Validate for subsgrid context menu item validation
Originally committed to SVN as r5460.
2011-07-15 04:05:31 +00:00
Thomas Goyne f098e2fac8 Add an optional Validate method to commands
Originally committed to SVN as r5459.
2011-07-15 04:05:22 +00:00
Thomas Goyne d405b061df Eliminate a lot of unnessesary includes of subs_grid.h
Originally committed to SVN as r5458.
2011-07-15 04:05:15 +00:00
Thomas Goyne 1d51dd20d2 Return a const reference from GetSelectedSet rather than copying it on every call
Originally committed to SVN as r5457.
2011-07-15 04:05:09 +00:00
Thomas Goyne 2eb4c856e8 Simplify and clean up command management code
Originally committed to SVN as r5456.
2011-07-15 04:05:01 +00:00
Thomas Goyne e6dc86212b Use the active line rather than first selected line in SubsEditBox
Originally committed to SVN as r5455.
2011-07-15 04:04:54 +00:00
Thomas Goyne 4d924b3f27 Move line joining from SubtitlesGrid to the commands
Originally committed to SVN as r5454.
2011-07-15 04:04:48 +00:00
Thomas Goyne b25066e3c3 Remove a write-only variable in option.cpp
Originally committed to SVN as r5453.
2011-07-15 04:04:42 +00:00
Thomas Goyne 6ec63cdde1 Clean up libaegisub includes
Remove cajun includes from all public headers and the precompiled header

Add a pile of missing standard library headers used in multiple files
to lagi_pre

Originally committed to SVN as r5452.
2011-07-15 04:04:34 +00:00
Thomas Goyne 48fbedd25b Remove pointless #pragma onces
Originally committed to SVN as r5451.
2011-07-15 04:04:28 +00:00
Thomas Goyne 7e5e82090f Remove incorrect inclusions of config.h in headers
Originally committed to SVN as r5450.
2011-07-15 04:04:21 +00:00
Thomas Goyne 256e098aa7 Remove header include order requirements
Originally committed to SVN as r5449.
2011-07-15 04:04:13 +00:00
Thomas Goyne 63538d125e Implement lead in/out commands
Originally committed to SVN as r5448.
2011-07-15 04:04:07 +00:00
Thomas Goyne 401f026180 Fix crash when detaching video
Originally committed to SVN as r5447.
2011-07-15 04:04:01 +00:00
Thomas Goyne 0cb42343e0 Fix the video zoom dropdown
Originally committed to SVN as r5446.
2011-07-15 04:03:54 +00:00
Thomas Goyne 9c97544fc5 Temporary hack to make the visual typesetting tool mode hotkeys work
Originally committed to SVN as r5445.
2011-07-15 04:03:48 +00:00
Thomas Goyne 3df2885ce5 Temporary hack to make automation macros work
Originally committed to SVN as r5444.
2011-07-15 04:03:42 +00:00
Thomas Goyne b5a02e202e Rename libaegisub/windows/util.cpp so that it's actually used
Originally committed to SVN as r5443.
2011-07-15 04:03:36 +00:00
Thomas Goyne 67e9384ef4 Remove a bunch of pointless consts from agi::Path and rename the windows implementation so that it's actually used
Originally committed to SVN as r5442.
2011-07-15 04:03:28 +00:00
Niels Martin Hansen 9d1cdab638 Merge rewritten ALSA player from 2.1.9. Closes #1106.
Not tested for compileability, and should probably also have printf's converted to logging statements.

Originally committed to SVN as r5421.
2011-06-12 00:45:02 +00:00
Niels Martin Hansen a98cfb7685 Merge r5409 from 2.1.9, see #1300.
Originally committed to SVN as r5410.
2011-06-06 21:12:00 +00:00
Niels Martin Hansen 23510dcac8 Merge kara-templater remember/recall functions from 2.1.9. Updates #1277.
Originally committed to SVN as r5378.
2011-04-26 08:42:05 +00:00
Grigori Goronzy e67b0ea54b wxGTK: do not freeze/thaw the main frame window
On certain configurations, this is problematic, because windows
sometimes are not thaw()'ed correctly, leading to an interface
that doesn't update. This is a workaround that simply disables all
freeze/thaw on the main frame. I haven't noticed any performance
issues.

Originally committed to SVN as r5373.
2011-02-23 13:14:48 +00:00
Amar Takhar d6d06b53eb Add Audio/OSS/Device option required by the OSS audio player.
Originally committed to SVN as r5372.
2011-02-23 05:14:25 +00:00
Amar Takhar c53492edcd Remove <sys/param.h> and <sys/mount.h> from common/util.cpp this stems from my accident involving placing code meant for unix/util.cpp into unix/common.cpp which was partially fixed in r5366.
Originally committed to SVN as r5371.
2011-02-23 03:34:23 +00:00
Amar Takhar 96f24d6c25 Move sys/param.h under ifndef _WIN32, I need to be more vigilant against including Unix headers in Windows builds.
Originally committed to SVN as r5370.
2011-02-23 03:29:30 +00:00
Amar Takhar 6ee90d4bb1 Add <vector>
Originally committed to SVN as r5369.
2011-02-23 03:24:08 +00:00
Grigori Goronzy 28e1acfeba libaegisub: do not free string returned by getenv()
getenv() returns a string that is part of internal process data and
should never be modified and/or free()'d.

Originally committed to SVN as r5368.
2011-02-23 00:55:48 +00:00
Grigori Goronzy 066ec3014a libaegisub: use statvfs instead of statfs
statvfs is the portable POSIX defined interface and is supported on all
major UNIX platforms.

Originally committed to SVN as r5367.
2011-02-23 00:54:18 +00:00
Karl Blomster 7db22972a7 sys/mount.h and statfs(2) do not exist on windows
Originally committed to SVN as r5366.
2011-02-22 19:03:03 +00:00
Karl Blomster 387fbdfdea fix xml parsing error in libaegisub project
Originally committed to SVN as r5355.
2011-02-22 01:26:46 +00:00
Niels Martin Hansen 27839f92ac Fix #1018 properly, make sure the colour values are brought into 0-255 range and rounded.
Originally committed to SVN as r5354.
2011-02-22 00:54:20 +00:00
Amar Takhar c0cf0c6a06 Add progress support back to HD Audio Cache with the new ProgressSink from libaegisub. Currently AudioProviderFactory::GetProvider() takes the ProgressSinkFactory however this should probably be moved up to the constructor for AudioProviderFactory. We'll see what the best option is when the others come around it's trivial to change.
Originally committed to SVN as r5347.
2011-02-11 03:47:18 +00:00
Amar Takhar 8240d3e6b6 Add util::freespace to check for free space on a path. (with tests)
Originally committed to SVN as r5346.
2011-02-10 23:55:59 +00:00
Amar Takhar bbc0f6f859 Document some utility methods.
Originally committed to SVN as r5345.
2011-02-10 02:47:41 +00:00
Amar Takhar 3a1487cf6f Finish removing wx from yuv4mpeg...
Originally committed to SVN as r5344.
2011-02-10 02:31:42 +00:00
Amar Takhar 2c6abb9a98 Instead of throwing return 0 for invalid values. This happens anyway if the input is invalid so it makes the most sense to return 0 for invalid ranges.
Originally committed to SVN as r5343.
2011-02-10 01:36:25 +00:00
Amar Takhar ef7b3c04e3 Add <climits>
Originally committed to SVN as r5342.
2011-02-10 01:33:34 +00:00
Amar Takhar 106b331cb0 Mostly convert yuv4mpeg.cpp -- a little bit of parsing is left which I will take care of shortly.
Originally committed to SVN as r5341.
2011-02-10 01:33:14 +00:00
Amar Takhar 3522c0b4bd Add a strtoi function. (with unit tests)
Originally committed to SVN as r5340.
2011-02-10 00:41:15 +00:00
Amar Takhar 6615d3981f Add <locale>.
Originally committed to SVN as r5339.
2011-02-09 23:56:24 +00:00
Amar Takhar 453381e613 Add a small test for str_lower.
Originally committed to SVN as r5338.
2011-02-09 23:43:57 +00:00
Amar Takhar c33afffa03 Init agi::log::log.
Originally committed to SVN as r5337.
2011-02-09 23:37:18 +00:00
Amar Takhar 34e0eb837d Hand edit the libaegisub vcproj to include common/util.cpp
Originally committed to SVN as r5336.
2011-02-09 22:32:51 +00:00
Amar Takhar 75e07c7aa7 Add a short method to make an std::string lowercase.
Originally committed to SVN as r5335.
2011-02-09 22:31:44 +00:00
Amar Takhar 6d96457555 Remove "Font/Cache/FontConfig" in lieu of "Cache/FontConfig" and add "Cache/FFmpegSource".
Originally committed to SVN as r5334.
2011-02-09 21:57:31 +00:00
Niels Martin Hansen 7638375282 Get rid of a few unused variable warnings.
Originally committed to SVN as r5333.
2011-02-09 21:56:10 +00:00
Niels Martin Hansen bc002d749c Make Windows path.cpp actually build. Still not really tested.
Originally committed to SVN as r5332.
2011-02-09 21:55:40 +00:00
Niels Martin Hansen acbe4bbb34 Add a bunch of new files to the libaegisub msbuild.
Originally committed to SVN as r5331.
2011-02-09 21:55:03 +00:00
Amar Takhar a118487afa Remove cache cleaning code from ffms, I'll eventually write something in libaegisub as we need cache cleaning for other areas too. (debug log, crash logs etc)
Originally committed to SVN as r5330.
2011-02-09 21:53:37 +00:00
Amar Takhar ce912335f1 Fix and de wxify video_manager.cpp.
Originally committed to SVN as r5329.
2011-02-09 04:41:40 +00:00
Amar Takhar 7d2594b134 s/Video/FFmpegSourceVideoProvider/, originally I was planning something different now we're moving all media-related code, also add missing GetDecoderName() method which was somehow removed by accident in a previous revision.
Originally committed to SVN as r5328.
2011-02-09 04:41:15 +00:00
Amar Takhar 83fd95c605 Some fixes to libmedia/video.h
Originally committed to SVN as r5327.
2011-02-09 02:30:48 +00:00
Amar Takhar ae7d00a57e Fix and de-wxify audio_manager.cpp
Originally committed to SVN as r5326.
2011-02-09 02:28:43 +00:00
Amar Takhar 185721837b s/Audio/FFmpegSourceAudioProvider/, originally I was planning something different now we're moving all media-related code, also replace missing public identifier from the class decleration.
Originally committed to SVN as r5325.
2011-02-09 02:28:24 +00:00
Amar Takhar c603c21b86 Print a message to the user and exit(1) if HOME is not set in the users environment.
Originally committed to SVN as r5324.
2011-02-08 22:40:55 +00:00
Amar Takhar 436ea23e4c Instantiate agi::Path, I have no idea if this works on windows since my build is still broken and jfs' code is untested. If someone else doesn't get to it I'll see about fixing my build and making it work. (if it's even broken...)
Originally committed to SVN as r5323.
2011-02-08 05:05:54 +00:00
Amar Takhar 355ad91105 * Instead of ~ use getenv("HOME") to get the users home directory.
* Fix Locale() to return P_LOCALE
 * Change data and doc values to P_DATA and P_DOC.

Originally committed to SVN as r5322.
2011-02-08 04:22:52 +00:00
Amar Takhar 961c1245f7 Remove const in path.cpp (missed in r5320)
Originally committed to SVN as r5321.
2011-02-08 03:53:34 +00:00
Amar Takhar bf05289495 * Remove misplaced const on a void method.
* Forward declare Options to avoid including options.h in the header.

Originally committed to SVN as r5320.
2011-02-08 03:48:00 +00:00
Niels Martin Hansen 7ae6e6da88 Completely untested implementation of agi::Path for Windows.
Originally committed to SVN as r5319.
2011-02-08 00:21:42 +00:00
Amar Takhar 78ed8e3694 Add stub path file for Windows and hand-edit vcproj to include the file.
Originally committed to SVN as r5318.
2011-02-07 18:02:26 +00:00
Amar Takhar b3c5bb6e92 Add corrected default_path.json which should have been in r5315.
Originally committed to SVN as r5317.
2011-02-07 18:02:04 +00:00
Amar Takhar 0a54e9ca06 Fix inclusion of config.h, when I was writing this I added a relative path directly to acconf.h
Originally committed to SVN as r5316.
2011-02-07 17:36:24 +00:00
Amar Takhar a35962923f Finish agi::Path so we can actually use it, our current path system is brutal and I needed this for libmedia. I'll be adding OS X support shortly: someone else will have to figure out what to do with windows it's completely trivial see unix/path.cpp and check libaegisub/path.h for the return values.
Originally committed to SVN as r5315.
2011-02-07 16:39:49 +00:00
Amar Takhar 7b06c334aa Add missing headers and change StdioProgressSink() to use std::cout and friends.
Originally committed to SVN as r5314.
2011-02-07 00:46:49 +00:00
Amar Takhar e27c3e15b8 Add several progress factories to handle progress bars. The GUI version will come from code within aegisub.
Originally committed to SVN as r5313.
2011-02-07 00:12:57 +00:00
Amar Takhar 73913fb0b8 Remove mutex.h from common/log.cpp until the windows build is fixed.
Originally committed to SVN as r5312.
2011-02-06 20:45:46 +00:00
Amar Takhar 874950382c s/acconf.h/config.h/ -- I forgot I actually fixed this when adding mutex.h so it was already working with the exception of the namespace change.
Originally committed to SVN as r5311.
2011-02-06 20:19:25 +00:00
Amar Takhar 4968fc2b55 Fix ram audio provider: this uses mutex.h (from google) in libaegisub and switches to use agi::io. The progress code has been stubbed out as well as a few path methods. There's no reason to guess at fixing them the only way to do it is after it's actually put into use.
Originally committed to SVN as r5310.
2011-02-06 19:52:50 +00:00
Amar Takhar 2edbc8c8c1 Fix mutex.h so we can actually use it.
Originally committed to SVN as r5309.
2011-02-06 19:50:59 +00:00
Amar Takhar 3d460ca31f Fix video cache, just needed to stub out one option which will be made a param to the constructor.
Originally committed to SVN as r5308.
2011-02-06 19:28:17 +00:00
Amar Takhar 15dab81b91 Fix ram audio provider (this stubs out a few lines used for progress updating.
Originally committed to SVN as r5307.
2011-02-06 18:48:42 +00:00
Amar Takhar 2ce135b612 Copy colourspace.(c|h) into libmedia and hack out wx.
Originally committed to SVN as r5306.
2011-02-06 03:59:13 +00:00
Amar Takhar 0c15005cc2 Add files to media namespace.
Originally committed to SVN as r5305.
2011-02-06 03:32:18 +00:00
Amar Takhar 37bcd0cc12 Fix dummy and pcm audio providers.
Originally committed to SVN as r5304.
2011-02-06 03:14:18 +00:00
Amar Takhar 65d216e60d Move dummy.h to dummy_audio.h
Originally committed to SVN as r5303.
2011-02-06 03:10:34 +00:00
Amar Takhar f16fb6bb5f Add fix convert and downmix audio providers.
Originally committed to SVN as r5302.
2011-02-06 03:09:59 +00:00
Amar Takhar e55ad2ed4d Add files to media namespace
Originally committed to SVN as r5301.
2011-02-06 03:08:51 +00:00
Amar Takhar e18ad3768b Switch namespace to media and use VideoProvider
Originally committed to SVN as r5300.
2011-02-06 03:02:45 +00:00
Amar Takhar 0ca6266c86 Add missing } to close the namespace.
Originally committed to SVN as r5299.
2011-02-06 03:02:13 +00:00
Amar Takhar f8b4b30cf8 Various fixes:
* svn:ignore
 * rename 'agi' namespace to 'media'
 * Remove some hacks required before bringing in provider code.

Originally committed to SVN as r5298.
2011-02-06 02:58:49 +00:00
Amar Takhar 97abbf13ce Remove exception.h, this used to be media.h in libaegisub however it's become moot after bringing in the provider headers from aegisub.
Originally committed to SVN as r5297.
2011-02-06 02:57:47 +00:00
Amar Takhar f486f8dea8 Commit missed changes to libaegisub/Makefile to remove media code.
Originally committed to SVN as r5296.
2011-02-06 00:07:19 +00:00
Amar Takhar ff602f7f2a Copy aegisub/(video|audio)_provider.h to libmedia/(video|audio).h
Originally committed to SVN as r5295.
2011-02-06 00:04:55 +00:00
Amar Takhar 7a13a4fb10 Add Makefile, the precompiled header unfortunatly snuck into r5292 -- it's a verbatim copy from libaegisub.
Originally committed to SVN as r5294.
2011-02-05 23:49:26 +00:00
Amar Takhar 66b6fdcfc8 Move video_frame.cpp which was left out of r5292.
Originally committed to SVN as r5293.
2011-02-05 23:46:09 +00:00
Amar Takhar 511b37ee48 Move converted code out of libaegisub and into libmedia.
Originally committed to SVN as r5292.
2011-02-05 23:43:20 +00:00
Amar Takhar 72211ad685 Copy and rename files from src/ into libmedia/. A lot of these headers will have to go into include/*. At the moment there's no point sorting that out until we see the final relation and external api requirements. I'll first unhook all of this code from the UI to figure out what common changes are required then design the final changes for an api that the UI can use sanely.
Originally committed to SVN as r5290.
2011-02-05 23:34:12 +00:00
Amar Takhar 7508420000 Commit a WIP for fixing tinderbox distfile building.
Originally committed to SVN as r5287.
2011-02-05 22:23:31 +00:00
Amar Takhar 75711f8041 Add FFMPEG LDFLAGS to the reporter as now they're r equired to link libaegisub. It's not worth considering to split it until everything is moved over.
Originally committed to SVN as r5286.
2011-02-04 18:41:52 +00:00
Amar Takhar ac2c6508dd Strategically place comments to stub out AskForTrackSelection() and CleanCache().
Originally committed to SVN as r5285.
2011-02-03 18:12:42 +00:00
Amar Takhar 283eff76ac Add LDFLAGS_POST to the shared library target.
Originally committed to SVN as r5284.
2011-02-03 18:09:08 +00:00
Amar Takhar d59e0dd075 Add support for removing ffms support and properly link ffms into libaegisub.
Originally committed to SVN as r5283.
2011-02-03 18:08:41 +00:00
Amar Takhar e46f83e672 Add -fPIC so ffms can be linked into a shared library.
Originally committed to SVN as r5282.
2011-02-03 18:08:11 +00:00
Amar Takhar a733260603 Add missing headers.
Originally committed to SVN as r5281.
2011-02-03 17:15:38 +00:00
Amar Takhar ac70f229dc Re-license video_frame.(cpp|h) with permission of copyright holder (Rodrigo Braz Monteiro).
Originally committed to SVN as r5280.
2011-02-03 15:52:06 +00:00
Amar Takhar ffff58d698 Compilation fixes now that ffmpegsource_common.cpp has been moved over. Everything compiles correctly now.
Originally committed to SVN as r5279.
2011-02-03 15:49:44 +00:00
Amar Takhar b47dd1e220 Add mid() template to util namespace.
Originally committed to SVN as r5278.
2011-02-03 15:49:13 +00:00
Amar Takhar bb4aa727d3 Add media/* to the build on Unix.
Originally committed to SVN as r5277.
2011-02-03 15:48:46 +00:00
Amar Takhar 36549ff724 Add media.h -- I'm not sure if this will be the perm name, it currently holds exception definitions.
Originally committed to SVN as r5276.
2011-02-03 15:48:18 +00:00
Amar Takhar 93ceb59b0f Move ffmpegsource_common.(cpp|h) and change the license to fit the rest of libaegisub with permission of the current license holder (Karl Blomster)
Originally committed to SVN as r5275.
2011-02-03 15:47:43 +00:00
Amar Takhar bcafbe2083 Move ffms_* files over to media/
Originally committed to SVN as r5274.
2011-02-03 01:18:43 +00:00
Amar Takhar 629b819e37 Move video_frame.(cpp|h) to libaegisub. The license has not been changed however I have an email sent to amz, I will change it once he responds.
Originally committed to SVN as r5273.
2011-02-03 01:18:14 +00:00
Amar Takhar f5308fe65b Move video_provider_ffmpegsource.(cpp|h) and change the license to fit the rest of libaegisub with permission of the current license holder (Karl Blomster)
Originally committed to SVN as r5272.
2011-02-03 01:17:15 +00:00
Amar Takhar cddfe3ed20 Wrap code under the agi namespace.
Originally committed to SVN as r5271.
2011-02-02 23:23:48 +00:00
Amar Takhar cacc3516c1 This should have gone into r5269: These files were re-licensed with permission of the original author. (Karl Blomster).
Originally committed to SVN as r5270.
2011-02-02 23:20:03 +00:00
Amar Takhar 1219b069b1 Copy audio_provider_ffmpegsource.(cpp|h) to ./ffms_audio.(cpp|h) and remove wx usage.. The plan is to move a/v support to libaegisub and write unit tests to make sure we can open/close/seek the "official" formats we want to support.
Originally committed to SVN as r5269.
2011-02-02 23:11:17 +00:00
Thomas Goyne b3562eb917 Implement the overscan mask command
Originally committed to SVN as r5268.
2011-01-25 04:24:19 +00:00
Thomas Goyne 95c45b3102 Remove pointless #pragma once from video_box.h
Originally committed to SVN as r5267.
2011-01-23 07:48:15 +00:00
Thomas Goyne 8d968e4dd5 Move the code for updating the time/frame display boxes from VideoDisplay to VideoBox
Originally committed to SVN as r5266.
2011-01-23 07:48:07 +00:00
Thomas Goyne 091c8170f2 Make several of VideoDisplay's members private
Originally committed to SVN as r5265.
2011-01-23 07:47:59 +00:00
Thomas Goyne 14420102e4 Update the frame number display and visual typesetting tool when opening a new video
Originally committed to SVN as r5264.
2011-01-23 07:47:52 +00:00
Thomas Goyne 10c3a2ca16 Only bind wxEVT_COMMAND_MENU_SELECTED once rather than once per command as large numbers of event handlers make wx explode
Originally committed to SVN as r5263.
2011-01-23 06:45:03 +00:00
Thomas Goyne 88be46c657 Add missing #include <algorithm> in ass_export_filter.cpp
Originally committed to SVN as r5262.
2011-01-21 06:32:02 +00:00
Thomas Goyne 41f9426634 Make the "From Video" button in the framerate transform configuration actually do something
Originally committed to SVN as r5261.
2011-01-21 06:09:28 +00:00
Thomas Goyne b851e50092 Open the correct dialog in tool/export
Originally committed to SVN as r5260.
2011-01-21 06:09:20 +00:00
Thomas Goyne ab00aa74ea Actually initialize the context in DialogResample
Originally committed to SVN as r5259.
2011-01-21 06:09:13 +00:00
Thomas Goyne af92002d8c Redesign export filters to not be static singletons, removing the need to jump through hoops to avoid static initialization order issues
Originally committed to SVN as r5258.
2011-01-21 06:09:04 +00:00
Thomas Goyne 83a461ca63 Port DialogVideoDetails to agi::Context
Originally committed to SVN as r5257.
2011-01-21 04:57:44 +00:00
Thomas Goyne 6ad2098749 Make VideoSlider use commands for its key events
Originally committed to SVN as r5256.
2011-01-21 04:57:36 +00:00
Thomas Goyne 1f79d89e5b Port DialogJumpTo to agi::Context
Originally committed to SVN as r5255.
2011-01-21 04:57:28 +00:00
Thomas Goyne e8b8f876bd Eliminate some uses of VideoContext::Get()
Originally committed to SVN as r5254.
2011-01-21 04:57:21 +00:00
Thomas Goyne 9c07798cb5 Delete some dead code in FrameMain
Originally committed to SVN as r5253.
2011-01-21 04:57:12 +00:00
Thomas Goyne 71daddeeb2 Convert the video box buttons over to commands
Originally committed to SVN as r5252.
2011-01-20 05:58:01 +00:00
Thomas Goyne b286339ce0 Eliminate a few uses of VideoContext::Get()
Originally committed to SVN as r5251.
2011-01-20 05:57:53 +00:00
Thomas Goyne 9ec1e1ba79 Explicitly set Collisions to the default (Normal) in the default file so that opening and closing the properties dialog on the default file is a no-op
Originally committed to SVN as r5250.
2011-01-20 05:57:46 +00:00
Thomas Goyne 79e11ef5cf Convert the properties dialog over to operating on a context
Originally committed to SVN as r5249.
2011-01-20 05:57:38 +00:00
Thomas Goyne 5f0d5757be Make NumValidator less bizzare
Originally committed to SVN as r5248.
2011-01-20 05:57:30 +00:00
Thomas Goyne a8ebc1e456 Make AssFile handle autosaving on every commit itself rather than going through FrameMain
Originally committed to SVN as r5247.
2011-01-20 05:57:23 +00:00
Thomas Goyne cecaff404b Finish killing FrameMain::SaveSubtitles
Originally committed to SVN as r5246.
2011-01-20 05:57:15 +00:00
Thomas Goyne 5270a3bf3a Remove withCharset parameter from FrameMain::SaveSubtitles as it was never used (saving with a charset is done by exporting)
Originally committed to SVN as r5245.
2011-01-20 05:57:08 +00:00
Thomas Goyne 1a26edc869 Delete FrameMain::SynchronizeProject as the last use of it was removed in r5207
Originally committed to SVN as r5244.
2011-01-20 05:56:59 +00:00
Niels Martin Hansen 0762422b20 Super fancy property pages for configuring the build in VC10. Doesn't want to display the defaults (properly) but that's not so important :)
Originally committed to SVN as r5243.
2011-01-19 06:40:23 +00:00
Niels Martin Hansen dd24ffac89 Do some grouping of source files in the VC10 project file.
Originally committed to SVN as r5242.
2011-01-19 04:05:30 +00:00
Thomas Goyne ccddf8eab1 Make hotkey::check return whether any hotkeys matched, and skip events which did not match any hotkeys
Originally committed to SVN as r5241.
2011-01-19 03:12:46 +00:00
Thomas Goyne ec3d1a9d35 Don't try to reorder things by swapping entries in a set
Originally committed to SVN as r5240.
2011-01-18 06:01:29 +00:00
Thomas Goyne 2183442089 Remove the unmodifiered frame left/right hotkeys from default
Originally committed to SVN as r5239.
2011-01-18 05:13:34 +00:00
Thomas Goyne 45c33ab675 Add commands for the remaining subtitles grid hotkeys and remove SubtitlesGrid::OnKeyDown entirely
Originally committed to SVN as r5238.
2011-01-18 05:13:26 +00:00
Thomas Goyne c3325cb543 Remove AegisubApp::OnKeyDown
It was an odd hack to ensure that medusa mode didn't mark keydown events
as processed (resulting in EVT_CHAR never triggering), but there should
be a better way to do this when we reintroduce global timing hotkeys.

Originally committed to SVN as r5237.
2011-01-18 03:42:51 +00:00
Thomas Goyne a4da8c3a61 Update libffms to r411
Originally committed to SVN as r5236.
2011-01-18 00:51:38 +00:00
Thomas Goyne 3f9bead41a Use the tr1 version of <tuple> when building with gcc
Originally committed to SVN as r5235.
2011-01-18 00:29:40 +00:00
Thomas Goyne c9656381f1 Remove now-pointless #pragma once from audio_box.h
Originally committed to SVN as r5234.
2011-01-17 23:54:13 +00:00
Thomas Goyne e0051e09e3 Use commands for most of the buttons in the audio box and add hotkey support
Originally committed to SVN as r5233.
2011-01-17 23:54:05 +00:00
Thomas Goyne f79c9e57a0 Add commands for most of the audio box buttons/hotkeys
Originally committed to SVN as r5232.
2011-01-17 23:53:59 +00:00
Thomas Goyne 33d8dd2975 Update TooltipManager to work with commands
Originally committed to SVN as r5231.
2011-01-17 23:53:52 +00:00
Thomas Goyne 04a4c074b0 Add function to get the string representation of the hotkeys for a command, use it when generating the menu
Originally committed to SVN as r5230.
2011-01-17 23:53:46 +00:00
Thomas Goyne cd4b032c25 Make agi::hotkey::Scan const
Originally committed to SVN as r5229.
2011-01-17 23:53:38 +00:00
Amar Takhar 4abb905130 Update 'interesting' files.
Originally committed to SVN as r5227.
2011-01-17 00:30:59 +00:00
Amar Takhar 3475a622d7 Update robots.txt for the latest buildbot version.
Originally committed to SVN as r5226.
2011-01-17 00:25:26 +00:00
Amar Takhar fe06b43354 * Update OS versions for the buildslaves.
* Fix builders for the new build system.

Originally committed to SVN as r5225.
2011-01-17 00:25:09 +00:00
Niels Martin Hansen 7713ea20e0 Produce a default config_windows.h file if one doesn't already exist.
Allow setting the BUILD_CREDIT define through a property page.

Originally committed to SVN as r5224.
2011-01-16 23:51:41 +00:00
Niels Martin Hansen 652a8c7806 Lump all the custom targets etc. for Aegisub into a single file, instead of using many.
Also, no custom project items needed anyway.

Originally committed to SVN as r5223.
2011-01-16 23:01:26 +00:00
Niels Martin Hansen 1e7718d30b Run TSVN's SubWCRev as part of the build.
The detection of the tool location is tricky and doesn't seem to work entirely as it should. It Works For Me as it is now, though the property page setting doesn't show the correct default.

Originally committed to SVN as r5222.
2011-01-16 22:42:30 +00:00
Thomas Goyne f2df585797 Move audio display hotkeys to the Audio category
Originally committed to SVN as r5221.
2011-01-16 08:50:00 +00:00
Thomas Goyne a2af06f302 Fix a few errors in the default hotkeys
Originally committed to SVN as r5220.
2011-01-16 08:49:53 +00:00
Thomas Goyne 8c8b149236 Fix a few warnings in the reporter
Originally committed to SVN as r5219.
2011-01-16 07:18:06 +00:00
Thomas Goyne be71a66600 Add command and AudioController support for saving audio clips
Originally committed to SVN as r5218.
2011-01-16 07:18:00 +00:00
Thomas Goyne 403d465475 Fix hotkeys with non-alphanumeric keys other than back, return, escape, space and delete
Originally committed to SVN as r5217.
2011-01-16 07:17:53 +00:00
Thomas Goyne a1bd974969 Partially convert the subtitles grid's context menu over to using commands
Originally committed to SVN as r5216.
2011-01-16 07:17:46 +00:00
Thomas Goyne df1dce3593 Kill SubtitlesGrid::ass and SubtitlesGrid::EditBox and convert everything that used them over to agi::Context
Originally committed to SVN as r5215.
2011-01-16 07:17:36 +00:00
Thomas Goyne 778338fa2b Remove FrameMain::menuCreated
Originally committed to SVN as r5214.
2011-01-16 07:17:29 +00:00
Thomas Goyne 6c0db27fac Remove some of FrameMain's friends
Originally committed to SVN as r5213.
2011-01-16 07:17:24 +00:00
Thomas Goyne 362e4c776b Make a large chunk of FrameMain's members private
Originally committed to SVN as r5212.
2011-01-16 07:17:17 +00:00
Thomas Goyne d84b768171 Remove the 'audio' and 'grid' public members from VideoContext and migrate everything that used them over to Context
Originally committed to SVN as r5211.
2011-01-16 07:17:08 +00:00
Thomas Goyne 169d3cd31c Add the selection controller to the context
Originally committed to SVN as r5210.
2011-01-16 07:17:02 +00:00
Thomas Goyne 8544565c0e Rearrange FrameMain initialization order to seperate context initialization and control creation a bit, and eliminate local pointers to non-view parts of the context
Originally committed to SVN as r5209.
2011-01-16 07:16:54 +00:00
Thomas Goyne 9f25b51a54 Rearrange context.h
Originally committed to SVN as r5208.
2011-01-16 07:16:48 +00:00
Thomas Goyne 7210ea17d8 Add pre-save signal to AssFile and move most of the logic in FrameMain::SaveSubtitles to slots for this signal
Originally committed to SVN as r5207.
2011-01-16 07:16:40 +00:00
Thomas Goyne 59300cbc27 Add a subtitle open signal and move most of the logic in FrameMain::LoadSubtitles to slots for this signal.
Originally committed to SVN as r5206.
2011-01-16 07:16:33 +00:00
Thomas Goyne 314a07c9ab Move post-video-load logic from FrameMain::LoadVideo to FrameMain::OnVideoOpen, and open videos via VideoContext directly
Originally committed to SVN as r5205.
2011-01-16 07:16:27 +00:00
Thomas Goyne 1664faf159 Make SubtitlesGrid listen for changes to "Subtitle/Grid/Hide Overrides" rather than refreshing it from the command
Originally committed to SVN as r5204.
2011-01-16 07:16:21 +00:00
Thomas Goyne bee57ccad3 Make DialogSpellChecker operate on a context rather than going through FrameMain
Originally committed to SVN as r5203.
2011-01-16 07:16:13 +00:00
Thomas Goyne 1aeded1a29 Make scoped_ptr's constructor explicit
Originally committed to SVN as r5202.
2011-01-16 07:16:07 +00:00
Thomas Goyne 71937757a2 Remove #pragma once from context.h and fix resulting compilation errors
Originally committed to SVN as r5201.
2011-01-16 07:16:00 +00:00
Thomas Goyne 64ebce6c0f Move NextFrame and PrevFrame from VideoSlider to VideoContext
Originally committed to SVN as r5200.
2011-01-16 07:15:53 +00:00
Thomas Goyne 08ec92046f Implement MRU commands
Originally committed to SVN as r5199.
2011-01-16 07:15:46 +00:00
Thomas Goyne ecea389e62 Add macro for defining command groups (i.e. menus) as they're almost entirely boilerplate
Originally committed to SVN as r5198.
2011-01-16 07:15:40 +00:00
Thomas Goyne 583aed4533 Convert commands to structs to eliminate a line of boilerplate per command
Originally committed to SVN as r5197.
2011-01-16 07:15:32 +00:00
Thomas Goyne 9779eacbf1 Implement almost all stubbed-out commands other than the MRU ones
Originally committed to SVN as r5196.
2011-01-16 07:15:24 +00:00
Thomas Goyne 7afbce439d AppName has to be set before ?user can be used
Originally committed to SVN as r5195.
2011-01-16 07:15:18 +00:00
Thomas Goyne f604e0bacd Add spacers to the main toolbar
Originally committed to SVN as r5194.
2011-01-16 07:15:11 +00:00
Thomas Goyne 77cb5b75b8 Disable the video details menu item when no video is loaded
Originally committed to SVN as r5193.
2011-01-16 07:15:05 +00:00
Thomas Goyne 685d4841dc Wrap documentation in audio_timing.h at 80 columns
Originally committed to SVN as r5192.
2011-01-16 07:14:59 +00:00
Thomas Goyne daa8c58cd8 Don't announce marker movements that update the styled ranges as well; it's redundant and the marker move signal is more useful as only non-interactive markers.
Originally committed to SVN as r5191.
2011-01-16 07:14:53 +00:00
Thomas Goyne cc5952035e Don't declare methods as virtual in a class not intended to be inherited from
Originally committed to SVN as r5190.
2011-01-16 07:14:47 +00:00
Thomas Goyne 84ffb4414a Update vs2008 respack project
Originally committed to SVN as r5189.
2011-01-16 07:14:24 +00:00
Niels Martin Hansen 4c5d8f54ea Forgot svn:keywords...
Originally committed to SVN as r5188.
2011-01-14 07:52:41 +00:00
Niels Martin Hansen 238f2dedb6 Custom property page for the respack tool, how cool!
Also include the standard targets later to make the projects stop spewing build status files into wrong dirs.

Originally committed to SVN as r5187.
2011-01-14 07:40:06 +00:00
Niels Martin Hansen a7dd3611a2 Here's an MSBuild project file for Aegisub itself!
Originally committed to SVN as r5186.
2011-01-14 03:49:28 +00:00
Niels Martin Hansen cda28d706b More clean-up of the MSBuild projects. (The IDE hates me for this.)
Originally committed to SVN as r5185.
2011-01-14 03:47:57 +00:00
Niels Martin Hansen 6490faa5c5 Prevent CSRI helper library from causing linking apps (like aegisub.exe) to export symbols.
Originally committed to SVN as r5184.
2011-01-14 02:05:01 +00:00
Niels Martin Hansen 8b58a63bd5 CSRI helper library MSBuild project.
Originally committed to SVN as r5183.
2011-01-14 01:30:17 +00:00
Niels Martin Hansen 1e6ace134a Respack produced invalid resources on Windows since it was opening files in text mode, causing newline conversions to happen.
Having it open files in binary mode instead fixes the problem.

Originally committed to SVN as r5182.
2011-01-14 01:29:47 +00:00
Niels Martin Hansen 59b8686fdc MSBuild project for chardet.
Originally committed to SVN as r5181.
2011-01-14 01:08:47 +00:00
Niels Martin Hansen 73905fb1b5 Add some DirectX detection.
Originally committed to SVN as r5180.
2011-01-11 22:04:47 +00:00
Niels Martin Hansen 87ac25bfa7 Add some missing files to the libaegisub project. Make Lua compile as C++ to get C++ name mangling, as Aegisub expects that.
Originally committed to SVN as r5179.
2011-01-11 22:04:21 +00:00
Amar Takhar 585b108671 Takes exactly 3 arguments it's not a minimum.
Originally committed to SVN as r5178.
2011-01-11 21:50:27 +00:00
Amar Takhar 357adc07dc Add some comments.
Originally committed to SVN as r5177.
2011-01-11 21:47:59 +00:00
Niels Martin Hansen 5d6730919d Fix ResPack target not actually building the intended resource files.
Originally committed to SVN as r5176.
2011-01-11 21:36:13 +00:00
Niels Martin Hansen f1121898b9 Update ResPack project, write ResPack target for MSBuild and add libresrc project that uses the ResPack target.
The ResPack target is not ideal, it will regenerate the source files even when they are up to date, if only the object files are outdated. This means that in batch builds, the source files will get regenerated for every platform/config built.

Originally committed to SVN as r5175.
2011-01-11 20:25:47 +00:00
Niels Martin Hansen 3974dfd1f2 Reorganise the property sheet includes to use a master include, and use properties to control inclusion of wxWidgets and Freetype, and any further deps.
Originally committed to SVN as r5174.
2011-01-11 18:15:31 +00:00
Amar Takhar 75b732bf60 Use lowercase filenames for OS X includes. HFS is case-insensitive and since I'm cross-compiling the OS X version from Linux it fails when you try to include files using uppercase names when they're actually lowercase.
Originally committed to SVN as r5173.
2011-01-11 17:52:17 +00:00
Niels Martin Hansen a7954fc3e0 MSBuild project for libaegisub.
Originally committed to SVN as r5172.
2011-01-11 17:50:03 +00:00
Amar Takhar f576bf912a Add missing headers.
Originally committed to SVN as r5171.
2011-01-11 17:22:44 +00:00
Amar Takhar a3534f2cae Fix identifers, _misc is no longer used.
Originally committed to SVN as r5169.
2011-01-11 17:00:11 +00:00
Amar Takhar 3ce2b1d802 Fix build to use new method.
Originally committed to SVN as r5168.
2011-01-11 16:59:03 +00:00
Amar Takhar 1a9f9abbed Add respack manifests.
Originally committed to SVN as r5167.
2011-01-11 16:58:47 +00:00
Amar Takhar 29f02c515b Move buttons from 16/* and 24/* to button/*_(16|24).png. This is a closer representation of what they're like in-source and in the future we'll only have 1 version of each icon
Originally committed to SVN as r5166.
2011-01-11 16:57:44 +00:00
Amar Takhar 9d34dfb01c Rewrite respack in pure C++, this is required to make cross-compiling sane.
Originally committed to SVN as r5165.
2011-01-11 16:55:15 +00:00
Amar Takhar a02fee90c3 Add a quick script used for distfile building. I don't see any reason to support a pure makefile solution and make it unnecessarily complex. In the future if anyone feels they may want to use this build system I'll change it otherwise we'll use this for now.
Originally committed to SVN as r5164.
2011-01-10 21:33:58 +00:00
Amar Takhar 7a8829efdc Remove Makefile.inc from EXTRA_DIST
Originally committed to SVN as r5163.
2011-01-10 21:32:54 +00:00
Amar Takhar 03ca62df22 Include dependency files into the Makefiles. This gives us dep tracking for headers.
Originally committed to SVN as r5162.
2011-01-10 21:27:39 +00:00
Niels Martin Hansen 0d6edabbdc Prettify the property files a bit and add some real sample files for the userconfig dir.
Originally committed to SVN as r5161.
2011-01-10 17:46:15 +00:00
Niels Martin Hansen 5f7fbf48c6 Use project relative paths for source files, to work around this (possible) MSBuild bug:
https://connect.microsoft.com/VisualStudio/feedback/details/635294/using-absolute-path-in-clcompile-item-prevents-property-pages-from-showing

Originally committed to SVN as r5160.
2011-01-10 01:27:12 +00:00
Niels Martin Hansen 231220cc63 Oops, left in an Import that shouldn't be there anyway.
Originally committed to SVN as r5159.
2011-01-09 23:06:01 +00:00
Karl Blomster a90d855950 update ffms2 to r409
Originally committed to SVN as r5158.
2011-01-09 21:47:46 +00:00
Niels Martin Hansen a08eb28846 MSBuild projects for the contrib libraries, except CSRI.
There is an odd bug/glitch where it is impossible to view property pages for single source files through the VS 2010 IDE, but compilation works as intended.

Originally committed to SVN as r5157.
2011-01-09 08:01:57 +00:00
Niels Martin Hansen 95c2649721 Add a bunch more property files for MSBuild projects
Originally committed to SVN as r5156.
2011-01-09 07:08:36 +00:00
Amar Takhar c2a81a5dd7 Add a cast to make x64 build on windows happy.
Originally committed to SVN as r5155.
2011-01-09 02:49:49 +00:00
Amar Takhar e1a59d307e * Fix iconv LDFLAGS for *bsd*
* Minor style fix for $GL_LIBS test.
 * Fail if iconv isn't found.
 * Fix variable name for the ! subtitle-found case which was over-writing the audio variable.

Originally committed to SVN as r5154.
2011-01-09 01:37:34 +00:00
Amar Takhar 73bd4f2398 * Remove awk check -- we haven't need it in over a year.
* Remove check for iconv.m4, I switched to custom code over a year ago.

Originally committed to SVN as r5153.
2011-01-09 01:36:18 +00:00
Amar Takhar 23d96d071c Add missing property sheets to x64 build config.
Originally committed to SVN as r5152.
2011-01-09 00:47:06 +00:00
Niels Martin Hansen a13e0ddedf Clear out some warnings emitted by Visual C++ 2010.
On 32 bit VC 2010, std::streamsize is 64 bit while size_t is 32 bit.

Originally committed to SVN as r5151.
2011-01-08 21:58:48 +00:00
Niels Martin Hansen abf9ee645b std::basic_streambuf::_Sgetn_s was removed was Visual C++ 2010 for some reason.
Originally committed to SVN as r5150.
2011-01-08 21:54:31 +00:00
Karl Blomster 71928bc25b update ffms2 to r407
Originally committed to SVN as r5149.
2011-01-08 20:32:18 +00:00
Amar Takhar 8f401a838a Add utilities to a util:: namespace for clarity.
Originally committed to SVN as r5148.
2011-01-08 19:16:11 +00:00
Amar Takhar 68aa077add Actually add util.(c|h) which should have been in r5146.
Originally committed to SVN as r5147.
2011-01-08 19:14:48 +00:00
Amar Takhar 93f8b84688 * Instantiate log class.
* Create new util file and add a config_path() function to get Aegisubs' configuration directory.
 * Header cleanu

Originally committed to SVN as r5146.
2011-01-08 19:14:02 +00:00
Amar Takhar 3f110101aa Ensure the proper cflags are set for common/charset_conv.cpp in libaegisub. Also fix iconv include path on *bsd.
Originally committed to SVN as r5145.
2011-01-08 17:46:46 +00:00
Amar Takhar 69af40edc6 Fix compilation of linux support in the reporter.
Originally committed to SVN as r5144.
2011-01-08 15:38:30 +00:00
Amar Takhar 55803684c3 Use -Wl for linker flags.
Originally committed to SVN as r5143.
2011-01-08 15:38:11 +00:00
Amar Takhar 4eeacb5ab9 Silence warning.
Originally committed to SVN as r5142.
2011-01-08 15:25:04 +00:00
Amar Takhar c67fe6db5d Re-add platform-specific headers and fix prototypes.
Originally committed to SVN as r5141.
2011-01-08 15:24:35 +00:00
Amar Takhar 9d5a2b41b5 Add missing headers and sort.
Originally committed to SVN as r5140.
2011-01-08 15:18:58 +00:00
Amar Takhar ef76d4b91b Remove debug printf.
Originally committed to SVN as r5139.
2011-01-08 15:17:11 +00:00
Amar Takhar 7155e550ad Update for change of paths.
Originally committed to SVN as r5138.
2011-01-08 14:22:23 +00:00
Amar Takhar 1530115458 Add libaegisub to solution.
Originally committed to SVN as r5137.
2011-01-08 14:22:12 +00:00
Amar Takhar 319ac2d4bb Catch all exceptions when deciding whether to load the default config.
Originally committed to SVN as r5136.
2011-01-08 12:13:24 +00:00
Amar Takhar 0d7b2c6e76 Add missing headers when not using precompiled header support. Some minor formatting in libaegisub/common/hotkey.cpp.
Originally committed to SVN as r5135.
2011-01-08 12:10:40 +00:00
Amar Takhar c95d92c2ca Add a temp conditional to avoid exceptions when a command doesn't exist since the hotkeys aren't fully converted.
Originally committed to SVN as r5134.
2011-01-06 15:33:55 +00:00
Thomas Goyne b56b641122 MSVC hurfs a blurf when two files in the same project have the same name
Originally committed to SVN as r5133.
2011-01-05 18:40:46 +00:00
Thomas Goyne e450cb3e7e Fix include paths
Originally committed to SVN as r5132.
2011-01-05 18:40:37 +00:00
Thomas Goyne c6b65d8b82 Remove deleted files from the projects and add the new files
Originally committed to SVN as r5131.
2011-01-05 18:40:30 +00:00
Thomas Goyne 813aab2473 Add default_hotkey.json, default_menu.json, default_path.json, and default_toolbar.json to respack's post-build event.
Originally committed to SVN as r5130.
2011-01-05 18:40:24 +00:00
Amar Takhar 1ac31c65bf Remove medusa commands, they don't technically exist anymore as we call it "global timing mode" now.
Originally committed to SVN as r5129.
2011-01-05 14:19:11 +00:00
Amar Takhar 2804e0cb52 Actually trigger a hotkey if it exists.
Originally committed to SVN as r5128.
2011-01-05 14:07:23 +00:00
Amar Takhar 9915fb1c3b Add a depedency for libresrc on the 'command' subdir to ensure it's built first.
Originally committed to SVN as r5127.
2011-01-05 13:36:13 +00:00
Amar Takhar 167f09a610 Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 13:00:46 +00:00
Amar Takhar cdc73b17d2 Add support for bitmask options to Options. First one is to avoid flushing the config to disk which we don't want to happen when the reporter uses Options to read config values.
Originally committed to SVN as r5123.
2011-01-04 04:24:40 +00:00
Amar Takhar 010f3c14e5 Fix reading of aegisub config values.
Originally committed to SVN as r5122.
2011-01-04 04:23:51 +00:00
Amar Takhar a0e760c9da Replace all instances of wxString with std::string where possible.
Originally committed to SVN as r5121.
2011-01-04 00:22:55 +00:00
Amar Takhar 4d3c89eebf Cache wxGL* values to speed up GL probes, also delete locale in ~Platform().
Originally committed to SVN as r5120.
2011-01-03 16:14:43 +00:00
Amar Takhar 99aff7254f * wxString is really annoying.
* Build JSON tree.

Originally committed to SVN as r5119.
2011-01-03 15:46:21 +00:00
Amar Takhar c041bb8884 * Remove all vestiges of XML.
* Generate the report in the constructor.

Originally committed to SVN as r5118.
2011-01-03 14:28:24 +00:00
Amar Takhar 22c797a5d1 Fix some longstanding bugs now that I understand wxWidgets better.
Originally committed to SVN as r5116.
2011-01-03 14:11:53 +00:00
Amar Takhar f04d721228 Remove the name map, it's no longer required.
Originally committed to SVN as r5115.
2011-01-03 13:43:39 +00:00
Amar Takhar 7514812a25 Convert rest of the values to JSON.
Originally committed to SVN as r5114.
2011-01-03 13:33:53 +00:00
Amar Takhar 4118580bb6 Add JSON stubs, remove a bunch of now obsolete code.
Originally committed to SVN as r5113.
2011-01-03 13:20:53 +00:00
Amar Takhar e35badd20a Convert more groups to JSON and simplify source further.
Originally committed to SVN as r5112.
2011-01-03 13:02:16 +00:00
Amar Takhar 5985c60ded First stab at converting the reporter to use JSON and updating it to a saner design.
Originally committed to SVN as r5111.
2011-01-03 12:00:12 +00:00
Amar Takhar 85b577f25e Bind PBChangeSource() to localhost, any requests will come in via ssh or the local machine anyway.
Originally committed to SVN as r5095.
2011-01-02 03:53:36 +00:00
Amar Takhar 6da7e1a4da Use ~/build/wx versus ~/build/wx-trunk. I'll be using this for default "trunk" builds and a seperate directory for branches.
Originally committed to SVN as r5094.
2011-01-02 03:52:43 +00:00
Amar Takhar ddc12d55ce Remove buildbot users mysql pass from the config file and change it to something else. (I set this up months ago and forgot it was there, previous versions of buildbot didn't use mysql.
Originally committed to SVN as r5093.
2011-01-02 03:16:04 +00:00
Amar Takhar 08750b94e8 Remove PPC builder and comment some old code that needs to be re-done for the latest verison of buildbot (0.8)
Originally committed to SVN as r5092.
2011-01-02 03:12:42 +00:00
Amar Takhar efe88823c7 Add missing header.
Originally committed to SVN as r5091.
2011-01-02 02:37:05 +00:00
Amar Takhar 96a567086c Remove calls to wxPrintf and replace them with LOG_E().
Originally committed to SVN as r5090.
2011-01-02 02:33:24 +00:00
Amar Takhar 64f60e0215 Add missing header, thanks.. closes #1255
Originally committed to SVN as r5089.
2011-01-02 01:44:54 +00:00
Thomas Goyne d282b425c0 Update the audio display when keyframes are loaded/unloaded
Originally committed to SVN as r5086.
2010-12-31 23:53:42 +00:00
Thomas Goyne 7347c09ac0 Use Bind rather than Connect in AudioController
Originally committed to SVN as r5085.
2010-12-31 23:53:36 +00:00
Thomas Goyne cf89403a5b Listen for timecode load signals in AudioMarkerProviderKeyframes
Originally committed to SVN as r5084.
2010-12-31 23:53:30 +00:00
Thomas Goyne 4fdad923ad Timecodes and keyframes are always sorted, so fix some code that assumed they could be unsorted
Originally committed to SVN as r5083.
2010-12-31 23:53:23 +00:00
Thomas Goyne 17c07cc131 Add timecodes opened signal to VideoContext
Originally committed to SVN as r5080.
2010-12-31 21:03:18 +00:00
Thomas Goyne 824294078f Move YUV -> RGB conversion to VideoProviderYUV4MPEG and remove support for formats other than RGB32 from AegiVideoFrame
Originally committed to SVN as r5079.
2010-12-31 21:03:11 +00:00
Thomas Goyne 833e69b09f Replace MIN/MAX/MID with std::min/std::max/mid
Originally committed to SVN as r5078.
2010-12-31 21:03:03 +00:00
Thomas Goyne c6a823c731 Remove duplicate inclusion of several files in the project
Originally committed to SVN as r5077.
2010-12-31 21:02:56 +00:00
Thomas Goyne 5920c3124b Make agi::Signal uncopyable
Originally committed to SVN as r5076.
2010-12-31 21:02:49 +00:00
Thomas Goyne a566955047 Rename signals.h to signal.h
Originally committed to SVN as r5075.
2010-12-31 21:02:42 +00:00
Thomas Goyne 7c2e4e5115 Add tests for agi::keyframe
Originally committed to SVN as r5074.
2010-12-31 21:02:31 +00:00
Thomas Goyne edff7d6a2d Rewrite keyframe loading and saving code and move it to libaegisub
Originally committed to SVN as r5073.
2010-12-31 21:02:17 +00:00
Thomas Goyne ea93f6afba Remove pointless performance hurting call to glFinish
Originally committed to SVN as r5071.
2010-12-30 22:19:42 +00:00
Thomas Goyne 5370f3fa04 Make ThreadedFrameSource never lock jobMutex and fileMutex at the same time. Moderately improves responsiveness of the audio display while video is loaded.
Originally committed to SVN as r5070.
2010-12-30 22:19:36 +00:00
Thomas Goyne ca8b6d8525 Wrap docs in audio_controller.h at 80 columns rather than 100
Originally committed to SVN as r5069.
2010-12-30 22:19:30 +00:00
Thomas Goyne f3d1bc23bd Reduce the amount of repainting done when the selection changes to a new one that doesn't overlap the old selection
Originally committed to SVN as r5068.
2010-12-30 22:19:24 +00:00
Thomas Goyne 364f398c5f Kill VideoContext::keyframesRevision, which is no longer used
Originally committed to SVN as r5067.
2010-12-30 22:19:18 +00:00
Thomas Goyne 4684d5c4f8 Only refresh the audio portion of the audio display when markers are moved. Fixes bug where the timeline would sometimes be bold.
Originally committed to SVN as r5066.
2010-12-30 22:19:12 +00:00
Thomas Goyne a64dc820a4 Remove VideoDisplay's border as on Windows it's rendered on top of the client area, hiding part of the video and throwing off hit detection for the visual tools
Originally committed to SVN as r5061.
2010-12-30 19:13:53 +00:00
Thomas Goyne 5f0ba21e30 Fix bug where the first gl glyph in each row after the first would be overwritten, resulting in the incorrect number being shown in the cross visual tool
Originally committed to SVN as r5060.
2010-12-30 19:13:45 +00:00
Thomas Goyne 73c0515954 Add handling for invalid timecode errors when opening video
Originally committed to SVN as r5059.
2010-12-29 19:35:45 +00:00
Thomas Goyne bd7ac88f6b Apply container audio delay when the FFMS2 version used supports it. Closes #1251.
Originally committed to SVN as r5058.
2010-12-29 06:27:02 +00:00
Thomas Goyne ce2adcea79 Revert r4828 as I decided to fix it in FFMS2 instead.
Originally committed to SVN as r5057.
2010-12-29 06:26:56 +00:00
Amar Takhar ceb2bebf2c Library links should not have absolute paths (from Nikoli on freenode.)
Originally committed to SVN as r5007.
2010-12-14 21:02:20 +00:00
Amar Takhar 45c971da68 Add a note about DESTDIR= support
Originally committed to SVN as r5004.
2010-12-14 18:53:17 +00:00
Amar Takhar 7b7b15f0a1 Include stdint.h for uintptr_t, it's odd that I've never had a problem with this on the several platforms I've built on, which excluded Gentoo of course.
Originally committed to SVN as r5003.
2010-12-14 18:17:49 +00:00
Thomas Goyne 36ded6ef89 Disable events while processing all file change events in SubsEditBox as apparently wxComboBox::Clear triggers change events on some platforms
Originally committed to SVN as r4960.
2010-12-12 00:34:02 +00:00
Thomas Goyne fc9607cbb1 Disable deprecation warnings in libass on windows
Originally committed to SVN as r4959.
2010-12-12 00:33:55 +00:00
Thomas Goyne 017c09489b Add missing config.h include in ass_drawing.c
Originally committed to SVN as r4958.
2010-12-12 00:33:48 +00:00
Niels Martin Hansen ba6fded1cd Make sure Windows builds don't get min and max macros defined from WinDef.h.
Originally committed to SVN as r4957.
2010-12-11 18:27:28 +00:00
Niels Martin Hansen d188673e7c Remove #ifdef block around #include "agi_pre.h", as it causes the VC10 compiler to explode. Hopefully this won't break build somewhere else.
Originally committed to SVN as r4956.
2010-12-11 16:52:12 +00:00
Niels Martin Hansen 60b3ea15c3 Switch _WINDOWS for _WIN32, as _WINDOWS doesn't seem to be defined using MSVC 2010 headers. On the other hand, _WIN32 is always defined by the compiler.
Originally committed to SVN as r4955.
2010-12-11 16:47:03 +00:00
Niels Martin Hansen d63a646c2a Small beginnings of MSBuild-based build system, for Visual Studio 2010/Windows 7.1 SDK.
So far proof of concept building just the respack program, using a semi-generalised form of finding wxWidgets. For it to find wxWidgets, a user configuration needs to be placed in the userconfig dir, see readme.txt.

Originally committed to SVN as r4954.
2010-12-11 16:35:22 +00:00
Amar Takhar a2513f03a7 Add a check for tools/osx-bundle.sed, if it doesn't exist it will create 0 byte files, strange things can happen.
Originally committed to SVN as r4953.
2010-12-11 01:32:59 +00:00
Amar Takhar 572e27f681 Add LDFLAGS to the link line for shared libraries, this fixes the build on OSX. (and should have been there anyway)
Originally committed to SVN as r4952.
2010-12-11 01:32:24 +00:00
Amar Takhar 52497737cd Fixup osx-bundle.sh:
* Remove libtool hack
 * Fix locale installation now that intltool is gone.
 * Some pretty-print cleanups.

Originally committed to SVN as r4951.
2010-12-10 23:05:05 +00:00
Amar Takhar 063cd0480d OS X also needs typename to be defined within the template, that makes Windows,BSD and OS X, it's better to exclude platforms when we hit them.
Originally committed to SVN as r4920.
2010-12-08 18:58:10 +00:00
Amar Takhar 944eaa535e Remove universalchardet headers from the precompiled header. For some reason this was causing issues with compliation on FreeBSD, rather than investigate why I removed it since it's used by exactly 1 file (charset_ucd.cpp). If it's going to cause one problem now it may cause another later that we may not notice.
Originally committed to SVN as r4919.
2010-12-08 14:32:30 +00:00
Amar Takhar b0eb1dfe7c Add missing source files to Makefile.
Originally committed to SVN as r4918.
2010-12-08 14:31:24 +00:00
Amar Takhar 5d73bcc598 Remove common/option_value.cpp it was converted to use signals in r4899.
Originally committed to SVN as r4917.
2010-12-08 14:21:45 +00:00
Amar Takhar 32bb692521 Define typename in the Signal template for FreeBSD as well. I'm not sure why this is required (yet) but we may need it on other platforms as well.
Originally committed to SVN as r4916.
2010-12-08 14:20:53 +00:00
Amar Takhar 819a298246 Add -Wno-variadic-macros to silence "warning: anonymous variadic macros were introduced in C99" with GCC.
Originally committed to SVN as r4915.
2010-12-08 13:35:33 +00:00
Thomas Goyne a6a4132ab5 Make the audio timing controller commit changes made
Originally committed to SVN as r4914.
2010-12-08 08:10:00 +00:00
Thomas Goyne e1e98d0ddd Only refresh the time columns of the subtitle grid when times change
Originally committed to SVN as r4913.
2010-12-08 08:09:55 +00:00
Thomas Goyne 27cb511556 Make blank audio actually blank
Originally committed to SVN as r4912.
2010-12-08 08:09:49 +00:00
Thomas Goyne a6236fa20c Only work around wxMac bugs on wxMac
Originally committed to SVN as r4911.
2010-12-08 08:09:44 +00:00
Thomas Goyne 30cd87bcb3 When zooming, fix the center sample in place
Originally committed to SVN as r4910.
2010-12-08 08:09:37 +00:00
Thomas Goyne 82eddf53ea Remove redundant checks in SampleRange::overlaps
Originally committed to SVN as r4909.
2010-12-08 08:09:30 +00:00
Thomas Goyne b134428668 Store the URL of opened audio files
Originally committed to SVN as r4908.
2010-12-08 08:09:25 +00:00
Thomas Goyne 3345797ff6 Use signals in AudioController and AudioTimingController
Originally committed to SVN as r4907.
2010-12-08 08:09:16 +00:00
Thomas Goyne 3bb1f590d7 Sabotage the once lovely friendship between FrameMain and AudioBox and use an option listener instead
Originally committed to SVN as r4906.
2010-12-08 08:09:11 +00:00
Thomas Goyne 5f39b99b78 Make AudioDisplay use scoped_ptr for pointers it owns
Originally committed to SVN as r4905.
2010-12-08 08:09:05 +00:00
Thomas Goyne 7f076bbbc9 Fix crash on exit
Originally committed to SVN as r4904.
2010-12-08 08:09:00 +00:00
Amar Takhar c15777f844 Merge audio_display_rewrite branch to trunk. This is not a complete work, don't expect to time anything for a while.
Originally committed to SVN as r4903.
2010-12-08 03:36:10 +00:00
Thomas Goyne 0e6d8631fd Add scoped_ptr.h
Originally committed to SVN as r4902.
2010-12-07 19:09:37 +00:00
Thomas Goyne 6d2b941e76 Rework how committing changes works
Rather than everything having to separately commit changes to the ass
and then tell the subs grid to notify various parts of Aegisub about the
changes, committing the AssFile now triggers an event which objects
listen for.

AssFile::Commit now also has an argument to indicate what sorts of
changes were made to the file. For now these types are very broad.

Originally committed to SVN as r4901.
2010-12-07 19:09:28 +00:00
Thomas Goyne d9006b0eb4 Make VideoContext use events for some of its communication with other objects
Originally committed to SVN as r4900.
2010-12-07 19:09:21 +00:00
Thomas Goyne 13f052317e Convert OptionValue over to agi::signal
Originally committed to SVN as r4899.
2010-12-07 19:09:15 +00:00
Thomas Goyne 4fc1ff6ad6 Add simple signal/slot implementation loosly based on boost.sigal
Originally committed to SVN as r4898.
2010-12-07 19:09:08 +00:00
Amar Takhar 31e2828517 Add -D__STDC_FORMAT_MACROS to ffmpegsource_common.o, this should have been in r4896, comitted from the wrong machine...
Originally committed to SVN as r4897.
2010-12-05 23:26:28 +00:00
Amar Takhar 09274c4a1b Remove -D__STDC_FORMAT_MACROS from CXXFLAGS.
Originally committed to SVN as r4896.
2010-12-05 23:08:11 +00:00
Amar Takhar 5a635ebdb3 Merge r4855-4894 from the new_build_system branch. This still has rough spots and some of the dependency relations haven't been expressed but it works, and it's much better than what we had before as it kills off automake, libtool, gettext (package not library), intltool usage.
Originally committed to SVN as r4895.
2010-12-05 19:12:42 +00:00
Amar Takhar d6e9ee9487 Add <memory> for auto_ptr
Originally committed to SVN as r4854.
2010-11-29 10:17:12 +00:00
Thomas Goyne 12bf2a595d Disable analysis on build for libaegisub as it results in versions of Visual Studio that do not support /analyze rebuilding the entire project every time.
Originally committed to SVN as r4852.
2010-11-21 05:14:11 +00:00
Thomas Goyne d840c9eaae Put libaegisub win32/debug intermediate files in the standard location
Originally committed to SVN as r4851.
2010-11-21 05:13:57 +00:00
Amar Takhar b68fc9b68b Add a stub config.h to satisfy matroskaparser.c.
Originally committed to SVN as r4850.
2010-11-20 05:22:00 +00:00
Thomas Goyne 3d85cacae0 Apply the export transform when sending subtitles to the provider on the video worker thread rather than the GUI thread
Originally committed to SVN as r4849.
2010-11-18 06:15:41 +00:00
Thomas Goyne c571f64f86 Fix compilation error on unix when using internal libass
Originally committed to SVN as r4848.
2010-11-18 04:31:38 +00:00
Thomas Goyne ea5a042046 Cache the list of dictionary languages
Originally committed to SVN as r4847.
2010-11-18 03:00:08 +00:00
Thomas Goyne 75285192a3 Add overloaded operator-> to agi::line_iterator
Originally committed to SVN as r4846.
2010-11-17 05:44:02 +00:00
Thomas Goyne 1bb8d16a45 Rewrite HunspellSpellChecker
Add support for loading dictionaries from both the user's dictionary
path and the application's install path

Fix some issues with loading and saving the user's customized dictionary

Originally committed to SVN as r4845.
2010-11-17 05:43:56 +00:00
Thomas Goyne 1214290e90 Change default path to dictionaries to ?user/dictionaries (from ?user/dictionary) to match 2.1.x
Originally committed to SVN as r4844.
2010-11-17 05:43:48 +00:00
Thomas Goyne 1b8b53c14e Pass a double pointer rather than a reference to a pointer to wait_for_cache_thread. Fixes endless 'caching' of fonts on linux.
Originally committed to SVN as r4843.
2010-11-11 05:29:13 +00:00
Thomas Goyne 1f894561c3 Actually set options' default values
Originally committed to SVN as r4842.
2010-11-11 04:48:37 +00:00
Thomas Goyne 7a38c1c06e Add some bounds checking in the preferences dialog
Originally committed to SVN as r4841.
2010-11-11 04:48:29 +00:00
Thomas Goyne 6a186d0bcb Add vcproj for libass and fix msvc compilation errors
Originally committed to SVN as r4840.
2010-11-11 04:48:20 +00:00
Thomas Goyne 5be8ee5c0e Update libass to d8a0fe5984d9bc6d7827026215d21ada3dda7b71 and update LICENSE to reflect that libass is now ISCL
Originally committed to SVN as r4839.
2010-11-11 04:48:08 +00:00
Thomas Goyne c0c82505c7 Fix compilation when no subtitle providers are enabled
Originally committed to SVN as r4838.
2010-11-10 03:35:07 +00:00
Thomas Goyne 598624772d Quote targetpath in respack's build event so it works when the path to the aegisub checkout has spaces in it
Originally committed to SVN as r4837.
2010-11-10 03:34:59 +00:00
Karl Blomster d134eda2e8 compilation fix
Originally committed to SVN as r4836.
2010-11-09 21:22:58 +00:00
Karl Blomster d6dde4ec73 update ffms2 to r354
Originally committed to SVN as r4835.
2010-11-09 19:55:23 +00:00
Thomas Goyne 6affce0581 Make OPT_GET return a const OptionValue* and add OPT_SUB/OPT_UNSUB for subscribing to option changes
Originally committed to SVN as r4834.
2010-11-08 05:08:24 +00:00
Thomas Goyne 469bd3e165 Fix bug where the grid headers sometimes used the collision text color
Originally committed to SVN as r4833.
2010-11-08 02:52:54 +00:00
Thomas Goyne e738847eb2 Update the edit box after splitting a line
Originally committed to SVN as r4832.
2010-11-08 02:28:32 +00:00
Karl Blomster f34d37d091 remove assorted forgotten traces of the splash screen
Originally committed to SVN as r4831.
2010-11-07 19:32:40 +00:00
Karl Blomster 26b9985d3d Use Tahoma 8pt as default grid font. This is what got used in earlier versions.
Originally committed to SVN as r4830.
2010-11-06 19:51:36 +00:00
Karl Blomster 65b5907a4c Get rid of the splash screen. If you want it back, you better make it a) not broken, and b) actually useful as a startup diagnostics tool. If you can't do both, get out.
Originally committed to SVN as r4829.
2010-11-06 19:44:21 +00:00
Thomas Goyne 50f8389615 Add support for delay in FFmpegSourceAudioProvider as FFMS2 only handles it automatically in the avisynth plugin
Originally committed to SVN as r4828.
2010-11-04 04:58:27 +00:00
Thomas Goyne a73091ef5c Coalesce visual tool changes
Originally committed to SVN as r4827.
2010-11-01 04:36:13 +00:00
Thomas Goyne 516b2cec93 Only let AssTime be set to a valid time rather than handling invalid times on display
Originally committed to SVN as r4826.
2010-10-27 21:17:41 +00:00
Thomas Goyne 6432ea1f94 Remove the realtime visual tool option, as the threaded video display makes it pointless
Originally committed to SVN as r4825.
2010-10-26 04:12:10 +00:00
Thomas Goyne 3174f995fa Prioritize the fontconfig font lister over the freetype one when both freetype and fontconfig are available
Originally committed to SVN as r4824.
2010-10-22 18:25:02 +00:00
Thomas Goyne 4af788be1a Fix font collector crash
Originally committed to SVN as r4823.
2010-10-20 01:56:28 +00:00
Thomas Goyne 7189dfb1a1 Make the choice between the freetype and fontconfig listers entirely based on the defined setttings rather than platform
Originally committed to SVN as r4822.
2010-10-20 01:56:22 +00:00
Thomas Goyne da7f1ef96c Make defining WITH_FONTCONFIG on windows actually do something
Originally committed to SVN as r4821.
2010-10-20 00:41:48 +00:00
Thomas Goyne 36a102e558 Improve error reporting when an error occurs during startup
Originally committed to SVN as r4820.
2010-10-20 00:28:37 +00:00
Thomas Goyne c6f20504cb Fix memory leak in libass provider
Originally committed to SVN as r4819.
2010-10-20 00:28:28 +00:00
Thomas Goyne 49a57729ef Always load initialize fontconfig on a worker thread so that installing a font then opening a new video does not block the GUI thread
Originally committed to SVN as r4818.
2010-10-17 02:36:28 +00:00
Thomas Goyne 7ce2e8f389 Update the \move/pos toggle button's icon when it's clicked
Originally committed to SVN as r4817.
2010-10-16 20:23:54 +00:00
Thomas Goyne a278901e13 Update the time relative to frame box when the subtitle file is changed to reflect timing changes immediately
Originally committed to SVN as r4816.
2010-10-16 20:11:53 +00:00
Thomas Goyne 9083776b9c Update the color spectrum view when a recently used color is selected in the color picker
Originally committed to SVN as r4815.
2010-10-16 20:11:48 +00:00
Thomas Goyne 3c02917e20 Fix flipped video when switching between avs and ffms2 providers
Originally committed to SVN as r4814.
2010-10-16 20:11:43 +00:00
Thomas Goyne f7f7699aed Save the video's timecodes if external timecodes aren't loaded
Originally committed to SVN as r4813.
2010-10-16 20:11:37 +00:00
Thomas Goyne 67df3608be Fix crashes when opening a file with zero valid lines
Originally committed to SVN as r4812.
2010-10-16 20:11:32 +00:00
Thomas Goyne 97089a7683 Don't destroy the progress dialog when audio loading is cancelled as it's destroyed automatically
Originally committed to SVN as r4811.
2010-10-16 20:11:26 +00:00
Thomas Goyne 420f28adf8 If the user changes the active row in the middle of searching, search from the new active row even if it's after the last found row. Closes #1004
Originally committed to SVN as r4810.
2010-10-15 16:58:50 +00:00
Karl Blomster 49cdd10ffd fix a bug in kara-templater.lua on behalf of jfs.
Originally committed to SVN as r4808.
2010-10-15 14:33:10 +00:00
Thomas Goyne f4577a8b3a Don't format libass messages which won't be logged
Originally committed to SVN as r4807.
2010-10-11 20:48:29 +00:00
Thomas Goyne ef7abaf1b6 Add new dialogue lines immediately after the last dialogue line in the file rather than at the end of the file
Originally committed to SVN as r4806.
2010-10-11 20:06:31 +00:00
Thomas Goyne aee6b0a540 Make AssAttachment::GetEntryData const so that it's actually called
Originally committed to SVN as r4805.
2010-10-11 20:06:26 +00:00
Thomas Goyne a41aeb8421 Fix minor layout issues in the dummy video dialog
Originally committed to SVN as r4804.
2010-10-11 20:06:20 +00:00
Thomas Goyne 84f646b88b Fix bug where changing the script resolution would not update the current visual tool
Originally committed to SVN as r4803.
2010-10-11 20:06:15 +00:00
Thomas Goyne 2324a1f197 Add a blank line between each group when writing ass files
Originally committed to SVN as r4802.
2010-10-11 20:06:09 +00:00
Thomas Goyne 7d2c7c5881 Don't add garbage AssEntries for blank lines in the file. Fixes some issues with sorting lines.
Originally committed to SVN as r4801.
2010-10-11 20:06:04 +00:00
Thomas Goyne fcba0c8e2a Update grid column widths after opening a new subtitle file.
Originally committed to SVN as r4800.
2010-10-11 20:05:59 +00:00
Thomas Goyne dade679145 Select new styles in the styles manager when they are created.
Originally committed to SVN as r4799.
2010-10-11 20:05:52 +00:00
Thomas Goyne ed9968e172 Don't pointlessly batch single selection changes when find/replacing. Fixes bug where find would select the wrong part of the line.
Originally committed to SVN as r4798.
2010-10-11 20:05:46 +00:00
Thomas Goyne b4739d2aee gcc 4.5 compilation fixes
Originally committed to SVN as r4797.
2010-10-11 04:25:02 +00:00
Thomas Goyne 1fbe7b4f1e Increase the size of the buffer used for formatting messages from libass as they can occasionally be longer than 256 characters
Originally committed to SVN as r4796.
2010-10-08 06:06:50 +00:00
Thomas Goyne 82ca2a4b70 Fix issues with the edit box buttons and omitted tag parameters
Originally committed to SVN as r4795.
2010-10-08 06:06:44 +00:00
Thomas Goyne 8545446baa Make select all not take quadratic time
Originally committed to SVN as r4794.
2010-10-08 06:06:38 +00:00
Thomas Goyne 4bf3b44cc0 Add missing swap in ThreadedFrameSource::ProcFrame that resulted in the full subtitle file never being loaded
Originally committed to SVN as r4793.
2010-10-08 06:06:32 +00:00
Thomas Goyne 682fd9406c Check for both forward and back slashes in the windows version of util::DirName
Originally committed to SVN as r4792.
2010-10-07 17:18:00 +00:00
Thomas Goyne 1dedfb18cd Shift timecodes so that frame 0 always starts at time 0, as nothing related to audio supports non-zero start times
Originally committed to SVN as r4791.
2010-09-23 03:06:22 +00:00
Thomas Goyne 7586f28ffe Fix overflow handling in AssTime::GetAssFormatted
Originally committed to SVN as r4790.
2010-09-23 03:06:15 +00:00
Thomas Goyne 35b9769092 Pass around shared_ptrs to newly allocated AegiVideoFrames rather than pointers into a buffer of AegiVideoFrames in ThreadedFrameSource
Originally committed to SVN as r4789.
2010-09-15 22:10:48 +00:00
Thomas Goyne dca2bd43fe Rearrange ThreadedFrameSource::Entry to allow the use of wxMutexLocker
Originally committed to SVN as r4788.
2010-09-15 22:10:42 +00:00
Amar Takhar d3fca38ee7 Disable installing the assert handler until I find time to figure out how I can call the default handler which provides the popup / some handy debug tools.
Originally committed to SVN as r4787.
2010-09-15 05:19:01 +00:00
Thomas Goyne fd5c1ecffc Fix writing of newlines on windows in charsets wider than one byte
Originally committed to SVN as r4786.
2010-09-15 05:00:12 +00:00
Thomas Goyne 84b8877d1d Clean up AssFile::Load, eliminating some redundant checks, and fixing a few situations where the undo stack could be left in an inconsistant state
Originally committed to SVN as r4785.
2010-09-15 02:46:19 +00:00
Karl Blomster 9108ea9b00 Don't try to coalesce undo operations when there aren't any undo operations to coalesce with. Fixes a crash when opening .txt files.
Originally committed to SVN as r4784.
2010-09-15 01:00:18 +00:00
Karl Blomster 0c2b40dc60 Revert r4782 since it wasn't needed if you do the project file right.
Originally committed to SVN as r4783.
2010-09-15 00:18:21 +00:00
Karl Blomster 3bdba76549 I have no idea what kind of enterprising faggot broke this but apparently we need __STDC_FORMAT_MACROS now. I hope this breaks on some other platform, that would be hilarious.
Originally committed to SVN as r4782.
2010-09-15 00:01:59 +00:00
Karl Blomster 035694c9ae I came, I saw, I hurfed a durf about macro redefinitions
Originally committed to SVN as r4781.
2010-09-14 23:53:22 +00:00
Amar Takhar 6f63041156 Redirect assertions to the logging system. This doesn't create a popup dialogue like the default method does. If someone actually wants that to happen let me know and I'll write something.
Originally committed to SVN as r4780.
2010-09-14 22:05:19 +00:00
Amar Takhar 01e1a34d43 Make setup.sh a little more robust when resetting the data/ directory.
Originally committed to SVN as r4779.
2010-09-11 17:48:54 +00:00
Thomas Goyne c33c5f647d Fix crash when iconv Roundtrip test fails
Originally committed to SVN as r4778.
2010-09-10 03:31:20 +00:00
Thomas Goyne 98305250df Fix compilation of tests on OS X
Originally committed to SVN as r4777.
2010-09-10 03:31:13 +00:00
Thomas Goyne 3512c4e1fe Clean up handling of fallbacks and improve behavior somewhat with glibc iconv
Originally committed to SVN as r4776.
2010-09-09 06:47:50 +00:00
Thomas Goyne 9780243586 Add NOMINMAX to the libaegisub project
Originally committed to SVN as r4775.
2010-09-09 06:47:45 +00:00
Thomas Goyne 81709164b3 Make the detection of BOM sizes actually work
Originally committed to SVN as r4774.
2010-09-09 06:47:29 +00:00
Thomas Goyne 6f7daef630 Bump version number to 3.0 in tests/Makefile.am
Originally committed to SVN as r4773.
2010-09-09 04:05:20 +00:00
Thomas Goyne ac2bac6d00 Use agi::io::Save in TextFileWriter
Originally committed to SVN as r4772.
2010-09-08 20:03:48 +00:00
Thomas Goyne 2662a69b2e Only autosave if there are unsaved changes to the file
Originally committed to SVN as r4771.
2010-09-08 20:03:20 +00:00
Thomas Goyne 7e72a9e0cf Add background fontconfig cache updating
When the libass provider is enabled, initialize fontconfig on program
startup rather than waiting for the user to open a video. If the user
tries to open a video while the cache is still being updated, display a
"progress" dialog,

Updates #1115.

Originally committed to SVN as r4768.
2010-09-01 06:50:35 +00:00
Thomas Goyne f77f908611 Fix compilation without precompiled headers. Closes #1241
Originally committed to SVN as r4767.
2010-08-28 02:00:43 +00:00
Thomas Goyne f37e1bf87a Fix thread warnings on shutdown on unix
Originally committed to SVN as r4766.
2010-08-27 01:01:35 +00:00
Thomas Goyne 071ada7487 Add listener for the autosave timer
Originally committed to SVN as r4765.
2010-08-26 18:38:44 +00:00
Thomas Goyne 0248e7c754 Add listeners for most non-audio options that need them. Closes #1047.
Originally committed to SVN as r4764.
2010-08-26 18:38:37 +00:00
Thomas Goyne 0704887ad4 Save the last viewed page of the preferences dialog
Originally committed to SVN as r4763.
2010-08-26 18:38:31 +00:00
Thomas Goyne daa77301eb Remove "Colour/Background/Modified" option, which was made irrelevant by r4699.
Originally committed to SVN as r4762.
2010-08-26 18:38:26 +00:00
Thomas Goyne 069581b9be Make the preferences dialog actually update the configuration
Originally committed to SVN as r4761.
2010-08-26 18:38:20 +00:00
Thomas Goyne 5721003219 Split colors into two columns so that the preferences dialog is less awkwardly shaped
Originally committed to SVN as r4760.
2010-08-26 18:38:14 +00:00
Thomas Goyne 5d5f24cbd8 Remove Tip of the Day setting from default_config.json
Originally committed to SVN as r4759.
2010-08-26 18:38:09 +00:00
Thomas Goyne f15dd92fb1 Change App/Auto/Check For Updates to a bool so that the correct control is used in the preferences dialog
Originally committed to SVN as r4758.
2010-08-26 18:38:03 +00:00
Thomas Goyne 27a7c41a44 Fix option name for auto-updates checkbox
Originally committed to SVN as r4757.
2010-08-26 18:37:46 +00:00
Thomas Goyne 80af629325 Remove dangling reference to boost files in the makefile
Originally committed to SVN as r4756.
2010-08-26 18:03:00 +00:00
Thomas Goyne 06f0c231b0 Make the advanced video options page a child of the advanced options
Originally committed to SVN as r4755.
2010-08-25 19:31:38 +00:00
Thomas Goyne 34c571b81b Change the one use of boost::shared_ptr to std::tr1::shared_ptr and remove the local copy of boost::shared_ptr
Originally committed to SVN as r4754.
2010-08-25 19:31:31 +00:00
Thomas Goyne 574236875c Fix assertion failure in 32-bit builds
Originally committed to SVN as r4753.
2010-08-25 19:31:26 +00:00
Thomas Goyne a6abc79b95 Add inttypes.h to the precompiled header
Originally committed to SVN as r4752.
2010-08-25 19:31:20 +00:00
Thomas Goyne 459b9e317d Display an error when the config file is corrupted rather than just crashing
Originally committed to SVN as r4751.
2010-08-25 19:31:11 +00:00
Amar Takhar e6b41058d8 Remove duplicate inclusion of <libaegisub/log.h>.
Originally committed to SVN as r4750.
2010-08-22 21:22:49 +00:00
Amar Takhar 6742a17649 Add a workaround for [Hotkeys] header detection, all this code will go away when the Hotkeys are redone.
Originally committed to SVN as r4749.
2010-08-17 04:44:18 +00:00
Thomas Goyne d83c59819f Fix deadlock on pthreads-using platforms
Originally committed to SVN as r4748.
2010-08-16 03:06:28 +00:00
Amar Takhar 714fa65071 Rename 2.2 to 3.0 as this will now be the next version outside of 2.1.
Originally committed to SVN as r4747.
2010-08-15 18:40:58 +00:00
Amar Takhar b50255bfe9 Re-add code removed in r4745 and conditionalise it under BUILD_DARWIN.
Originally committed to SVN as r4746.
2010-08-15 16:55:52 +00:00
Amar Takhar 2bcaf14892 Remove some test code added when fixing the OSX build that slipped into r4743.
Originally committed to SVN as r4745.
2010-08-14 18:57:29 +00:00
Amar Takhar 3c5d4bc97e Relicense libosxutil code (osx/util.cpp and include/util_osx.h) using the same license as the rest of the library. (obsd/2-clause bsdl) Done with the permission of current copyright holder jfs (Niels Martin Hansen).
Originally committed to SVN as r4744.
2010-08-14 18:45:41 +00:00
Amar Takhar d4ba1f48ca Remove libosxutil and fold it into libaegisub.
Originally committed to SVN as r4743.
2010-08-14 17:42:37 +00:00
Amar Takhar 0d12775f4b osx-bundle target fixes.
Originally committed to SVN as r4742.
2010-08-14 17:38:37 +00:00
Thomas Goyne b9f9b0a80a Fix potential divide-by-zero with wxGTK when opening video.
Originally committed to SVN as r4741.
2010-08-13 05:51:31 +00:00
Thomas Goyne 9c93198c3b Honor the user's default zoom when possible rather than always overriding it based on the size of the window
Originally committed to SVN as r4740.
2010-08-13 05:51:26 +00:00
Thomas Goyne 768f74ae3c Make VideoDisplay set its initial zoom itself rather than FrameMain
Originally committed to SVN as r4739.
2010-08-13 05:51:17 +00:00
Amar Takhar 6bb5dd0bfd Use OSXSetModified() from wx instead of using Carbon directly.
Originally committed to SVN as r4738.
2010-08-13 00:33:54 +00:00
Amar Takhar 61656d633b * Make GL_EXT() a noop on OS X, it's not required.
* Conditionalise glMultiDrawArraysFallback since it's not used on OS X.
 * Stub APIENTRY at the top of visual_tool_vector_clip.cpp, this should never be added to a header but at the top of source files.

Originally committed to SVN as r4737.
2010-08-13 00:24:35 +00:00
Amar Takhar ce28cca7c6 Include missing header.
Originally committed to SVN as r4736.
2010-08-12 14:36:09 +00:00
Amar Takhar 9f1b1f1cad Use std::string on osx/unix as well as osx doesn't have strndup.
Originally committed to SVN as r4735.
2010-08-12 14:34:54 +00:00
Amar Takhar 0b4092b602 Fix compilation on Unix/OSX (fix from Plork)
Originally committed to SVN as r4734.
2010-08-12 10:13:29 +00:00
Amar Takhar cbbb917dce Use $INTLTOOLIZE instead of `intltoolize` in autogen.sh to ensure the binary, if specified is actually called. I'm amazed noone has noticed this before.
Originally committed to SVN as r4733.
2010-08-12 09:23:19 +00:00
Thomas Goyne 58ca596359 Define NOMINMAX on Windows and remove workarounds for problems caused by those macros.
Originally committed to SVN as r4732.
2010-08-12 06:39:49 +00:00
Thomas Goyne a400800b54 Remove the override for fonts.conf location on Windows as the default is close enough to sensible.
Originally committed to SVN as r4731.
2010-08-12 01:12:00 +00:00
Thomas Goyne c8851828cd Get the libass provider working on Windows. Requires a valid fontconfig config file (currently not included).
Originally committed to SVN as r4730.
2010-08-10 05:50:14 +00:00
Thomas Goyne e7eba4c00d Add Select All and Select None buttons to the import style from script dialog.
Originally committed to SVN as r4729.
2010-08-10 01:47:29 +00:00
Thomas Goyne 87fac1c571 Reduce flickering when changing zoom level.
Originally committed to SVN as r4728.
2010-08-03 20:21:25 +00:00
Thomas Goyne d5cbb534f8 Make VideoDisplay's size calculations slightly less convoluted.
Originally committed to SVN as r4727.
2010-08-03 20:21:19 +00:00
Thomas Goyne 11d67ec6ae Fix updating of the scroll bar after opening a new file.
Originally committed to SVN as r4726.
2010-08-03 20:21:13 +00:00
Thomas Goyne f66ef36f93 Change criteria for when opened files should be backed up; rather than not backing up binary files (which aren't detected correctly anymore and always was sort of kludgy), don't back up files which are not in a format we can't write.
Originally committed to SVN as r4725.
2010-08-03 20:21:04 +00:00
Thomas Goyne 3f954dadcc Merge OS X color picker fixes in r3996 and r3997 from 2.1.8. Closes #1114.
Originally committed to SVN as r4724.
2010-08-03 02:16:26 +00:00
Thomas Goyne 2a51ad837e Fix non-precompiled header compilation
Originally committed to SVN as r4723.
2010-08-02 22:14:11 +00:00
Thomas Goyne 46be23073e Fix a few gcc warnings
Originally committed to SVN as r4722.
2010-08-02 20:25:29 +00:00
Thomas Goyne ce97d995b4 Also remove timecodes and keyframes from the MRU lists when they cannot be found. Updates #717.
Originally committed to SVN as r4721.
2010-08-02 08:18:53 +00:00
Thomas Goyne 596ad4d65d Add missing throw statement
Originally committed to SVN as r4720.
2010-08-02 08:18:45 +00:00
Thomas Goyne caf81157f1 Fix portaudio player compilation
Originally committed to SVN as r4719.
2010-08-02 08:03:58 +00:00
Thomas Goyne ff85906cdc Fix compilation errors
Originally committed to SVN as r4718.
2010-08-02 07:21:02 +00:00
Thomas Goyne c10e9e3a5b Make video and audio providers throw typed exceptions.
Don't display error messages and try other providers when the user
cancels loading a file.

Remove files from the MRU lists if they can't be found.

Closes #717.

Originally committed to SVN as r4717.
2010-08-02 06:32:01 +00:00
Thomas Goyne 71fb04cd29 Rework most of the various factories to not need an explicit helper class for each class constructable via a factory.
Originally committed to SVN as r4716.
2010-08-02 06:31:38 +00:00
Thomas Goyne f0aa85dfbb Delete the quicktime provider, as it's unmaintained and doesn't work
Originally committed to SVN as r4715.
2010-07-27 03:52:40 +00:00
Thomas Goyne 6407e36c87 Store inner exceptions with shared_ptr rather than a bare pointer so that the inner exception survives copies
Originally committed to SVN as r4714.
2010-07-27 03:52:32 +00:00
Amar Takhar e2d9241efd No need to disable as this is done when it's deleted anyway.
Originally committed to SVN as r4713.
2010-07-25 17:34:17 +00:00
Amar Takhar d3077c3b8b Change emit_stdout to a private member variable, this was changed in r4575. Putting it on the stack won't work since it'll just unsubscribe which we don't want. Unfortunatly this is wrapped with _DEBUG everywhere in main.(h|cpp) if we need more debugging code in the future I'll figure out a better solution.
Originally committed to SVN as r4712.
2010-07-25 17:33:44 +00:00
Amar Takhar 79a67ae1ec Add some log messages when subscribing/unsubscribing emitters.
Originally committed to SVN as r4711.
2010-07-25 17:30:12 +00:00
Thomas Goyne 3bdf0f95c6 Remove audio_provider_stream.cpp from the makefile
Originally committed to SVN as r4710.
2010-07-25 05:42:36 +00:00
Thomas Goyne d4a4db0388 Kill scrubbing code and audio_provider_stream; they were last touched four years ago and never did work.
Originally committed to SVN as r4709.
2010-07-25 03:11:00 +00:00
Thomas Goyne 6040334278 Kill DEBUG_AVISYNTH_CODE as it hasn't actually worked for 3.5 years.
Originally committed to SVN as r4708.
2010-07-23 20:34:23 +00:00
Thomas Goyne 428fc78623 Kill dangling references to dialog_tip.h
Originally committed to SVN as r4707.
2010-07-23 07:00:35 +00:00
Thomas Goyne d8021262df Enable "Make times continous" when only one line is selected. Closes #822.
Originally committed to SVN as r4706.
2010-07-23 06:40:22 +00:00
Thomas Goyne 35e33bd036 Fix crash when video loading fails.
Originally committed to SVN as r4705.
2010-07-23 06:40:12 +00:00
Thomas Goyne da0fb8cde7 Fix gcc build errors introduced in r4702
Originally committed to SVN as r4704.
2010-07-23 06:21:22 +00:00
Thomas Goyne de1588cd1d Delete old tip of the day code. Closes #967.
Originally committed to SVN as r4703.
2010-07-23 06:16:00 +00:00
Thomas Goyne 397b234fba Move video decoding and subtitle rendering to a worker thread
Makes the click event handler for the grid no longer slow when video
autoscroll is enabled, making it harder to accidently select multiple
lines.

Makes seeking speed no longer limited by decoding/rendering speed;
seeking faster than video can be decoded simply results in dropped
frames.

Makes editing the file while a slow-rendering frame is visible far more
responsive.

Originally committed to SVN as r4702.
2010-07-23 05:58:39 +00:00
Thomas Goyne 926b6152f1 Fix detached video crashes.
Originally committed to SVN as r4701.
2010-07-23 04:15:36 +00:00
Thomas Goyne 242b1ee47b Remove deleted files from the makefile
Originally committed to SVN as r4700.
2010-07-20 03:28:50 +00:00
Thomas Goyne fde4a7815d Make the subtitle edit box auto-commit all changes
This happens to fix most of the undo issues, as it's now much harder to
have uncommitted changes to the file.

Closes #355 and #586.

Originally committed to SVN as r4699.
2010-07-20 03:11:11 +00:00
Amar Takhar 51a75cd0fd Split the preferences to make managing the base code from the actual options. I should have done this yesterday however I completely underestimated how annoying it would be having it all in the same file.
Originally committed to SVN as r4698.
2010-07-19 17:53:29 +00:00
Amar Takhar c3881ea772 Some documentation and reformatting
Originally committed to SVN as r4696.
2010-07-19 12:25:53 +00:00
Karl Blomster 9def56b61c fix compilation under visual studio
Originally committed to SVN as r4695.
2010-07-19 01:28:52 +00:00
Karl Blomster cd810ae1c0 fix compilation of the avs provider
Originally committed to SVN as r4694.
2010-07-19 01:08:09 +00:00
Amar Takhar 12014b944e Remove unused macros.
Originally committed to SVN as r4693.
2010-07-18 23:31:21 +00:00
Amar Takhar d8acbb205c Finish converting the rest to objects.
Originally committed to SVN as r4692.
2010-07-18 23:22:00 +00:00
Amar Takhar 1613a5961f Convert the Subtitles and Audio pages.
Originally committed to SVN as r4691.
2010-07-18 19:29:54 +00:00
Amar Takhar dff3cb78f6 Start moving each page to it's own class, the first round of changes was intended as a proof-of-concept. Having each page as it's own object will allow for far easier handling of option changes and reverting.
Originally committed to SVN as r4690.
2010-07-18 16:36:31 +00:00
Amar Takhar 92d51d6f34 Move another block of code to reduce later diffs.
Originally committed to SVN as r4689.
2010-07-18 16:33:32 +00:00
Amar Takhar 1626024be8 Shift some code blocks around before modification to make sense of later diffs.
Originally committed to SVN as r4688.
2010-07-18 14:46:16 +00:00
Thomas Goyne 46d03e3e2b Refresh video display after undo/redo.
Originally committed to SVN as r4687.
2010-07-18 05:45:58 +00:00
Thomas Goyne 63cda2d755 Make gl contexts specific to VideoDisplays and only create/use them when the display is shown. Fixes a pile of X11-related assertion failures.
Originally committed to SVN as r4686.
2010-07-18 05:45:52 +00:00
Amar Takhar f1ea264efc Revert r4684 as the change won't handle nonexistent styles correctly. updates #1232.
Originally committed to SVN as r4685.
2010-07-17 21:08:53 +00:00
Amar Takhar 6705e2fa61 Set the current style directly when updating the dropdown. The old way used Select() which caused an actual commit to happen. This has the side-effect of modifying the file on startup. We currently set the Actor using this method I don't see why doing the same for the Style won't work.
Originally committed to SVN as r4684.
2010-07-17 19:42:44 +00:00
Amar Takhar c624b20777 Left align microseconds by 6 spaces.
Originally committed to SVN as r4683.
2010-07-17 17:47:59 +00:00
Amar Takhar 5755d7e1a0 Use %ld for size_t in RebuildRecentList, fixes an assert in wxString::Format.
Originally committed to SVN as r4682.
2010-07-16 15:44:54 +00:00
Amar Takhar d3e9a906aa Use %ld for both wxFileOffset (off_t) and GetTicks() (time_t), also coalesce into a single wxString::Format. This fixes an assert in wx trunk. Unfortunatly it does not fix audio loading due to seperate breakage of libass in r4630:4631. closes #1228.
Originally committed to SVN as r4681.
2010-07-16 10:33:54 +00:00
Thomas Goyne a32bbab0b6 Add selection-preserving logic to BaseGrid::UpdateMaps and eliminate some unnecessary updates and clears of the maps. Fixes a pile of cases where operations would result in incorrect or no selections, or scrolling to the top of the file.
Originally committed to SVN as r4677.
2010-07-13 05:29:08 +00:00
Thomas Goyne 4a8abae3a3 Kill options.h and options.cpp, which have been empty for a while
Originally committed to SVN as r4676.
2010-07-12 21:49:48 +00:00
Thomas Goyne 9d03e282ea Rewrite the recombine lines algorith to add support for arbitrary selections rather than requiring that each split line be fixed individually.
Originally committed to SVN as r4675.
2010-07-12 07:10:40 +00:00
Thomas Goyne 7e93d78d3a Fix crash when ActiveLine is NULL while video is loaded.
Originally committed to SVN as r4674.
2010-07-12 07:10:34 +00:00
Thomas Goyne 81b75d9f55 Significantly speed up AssLimitToVisibleFilter::ProcessSubs
Originally committed to SVN as r4673.
2010-07-11 03:31:33 +00:00
Thomas Goyne ab27440853 Fix comment in vfr.cpp
Originally committed to SVN as r4672.
2010-07-11 03:31:28 +00:00
Thomas Goyne 002aad0b29 Don't call CompressForStack on copied AssFiles as the parsed data isn't copied in the first place.
Originally committed to SVN as r4671.
2010-07-11 03:31:19 +00:00
Thomas Goyne 4897f35dfc When deleting the last row of the grid, select the new last row rather than nothing.
Originally committed to SVN as r4670.
2010-07-09 07:31:56 +00:00
Thomas Goyne c40aa7080a Eliminate almost all uses of AssFile::top.
Originally committed to SVN as r4669.
2010-07-09 07:31:48 +00:00
Thomas Goyne 5e22a0f151 Save selection over undo/redo.
Originally committed to SVN as r4668.
2010-07-09 07:31:43 +00:00
Thomas Goyne 2e5dc176db Rewrite Undo/Redo code
Make the undo and redo stacks non-static members of AssFile, making it
theoretically possible to have multiple open AssFiles with working undo.

Slightly improve tracking of whether the file is modified: saving,
making a change, then undoing the change now results in the file being
shown as unmodified as with most programs with undo.

Add basic undo coalescing support.

Originally committed to SVN as r4667.
2010-07-09 07:31:34 +00:00
Thomas Goyne 518e78ac6f SSA doesn't have a layer field
Originally committed to SVN as r4666.
2010-07-08 07:44:21 +00:00
Thomas Goyne 5c976dc0a0 Make AssDialogue::GetData ~50% faster
Originally committed to SVN as r4665.
2010-07-08 07:15:04 +00:00
Thomas Goyne 1da57a4be5 Make AssStyle::Clone ~15 times faster.
Originally committed to SVN as r4664.
2010-07-08 07:14:55 +00:00
Thomas Goyne a59d2a8e2e Fix 64-bit compilation errors
Originally committed to SVN as r4663.
2010-07-08 04:50:46 +00:00
Thomas Goyne acba2c6b63 Rewrite VFR handling in Aegisub.
Kill vfr.h and vfr.cpp and use the libaegisub versions of them instead.

Rather than the globals VFR_Input and VFR_Output, everything related to
frame rate is now part of the video context. Most things which used to
use VFR_Output now call VideoContext::TimeAtFrame etc.; video providers,
rather than modifying VFR_Input directly, now have getters for their
frame rates which VideoContext calls. Read-only public access to
VFR_Input and VFR_Output are still provided (hopefully temporarily) for
a few things which were awkward to do through VideoContext.

The Avisynth provider now might correctly handle VFR MKVs which can be
opened with DirectShowSource but not DSS2.

Rework keyframe handling as well, so that it continues to match the vfr
handling in design and implementation.

Originally committed to SVN as r4662.
2010-07-08 04:29:04 +00:00
Thomas Goyne 9322f95071 Rewrite vfr.cpp in libaegisub with tests. Not yet used by Aegisub itself.
Originally committed to SVN as r4661.
2010-07-07 05:24:16 +00:00
Thomas Goyne 929fa83dd9 Move the bulk of TextFileWriter's logic to libaegisub.
Originally committed to SVN as r4660.
2010-07-07 02:41:46 +00:00
Thomas Goyne 02237f2a7a Make the std::string overloads of IconvWrapper::Convert significantly faster
Originally committed to SVN as r4659.
2010-07-07 02:41:40 +00:00
Thomas Goyne 5ed8bf89f6 Fix gcc build errors
Originally committed to SVN as r4658.
2010-07-06 19:33:09 +00:00
Thomas Goyne d7ad7e861f Fix occasional truncation problems with Windows-1258
Originally committed to SVN as r4657.
2010-07-06 19:23:16 +00:00
Thomas Goyne 6623239682 Work around BOM-related issues with UTF-32 and UTF-16 with unspecified byte order
Originally committed to SVN as r4656.
2010-07-06 19:23:10 +00:00
Thomas Goyne ee4c5dee0b Remove charsets which libiconv does not support from charsets.def
Originally committed to SVN as r4655.
2010-07-06 19:23:01 +00:00
Thomas Goyne 2c2dc19f4f Update the time boxes in the video display when video is first loaded
Originally committed to SVN as r4650.
2010-06-30 06:39:27 +00:00
Thomas Goyne 65d40e2408 Fix minor error in vfr.cpp: lines which end exactly on a frame's start time are not visible on that frame.
Originally committed to SVN as r4649.
2010-06-30 06:29:27 +00:00
Thomas Goyne be1ed9e672 Make visual tools pass around iterators for everything related to visual features rather than a mix of pointers and indices, and clean up feature creation. Fixes a large pile of selection-related bugs.
Originally committed to SVN as r4648.
2010-06-30 06:29:14 +00:00
Thomas Goyne 8bd5b16699 Fix bad lengths for utf-8 strings in text_file_writer.cpp
Originally committed to SVN as r4647.
2010-06-30 01:18:35 +00:00
Niels Martin Hansen ce4babb192 Update table.copy_deep function to correctly handle self-referencing tables and tables with circular references. Doesn't handle tables with meta-tables overriding regular field get/set behaviour but that isn't intended either way. Also add a test of this.
Originally committed to SVN as r4645.
2010-06-30 00:36:25 +00:00
Niels Martin Hansen 816b12cec6 Fix selection indexes returned from Auto4 Lua macros to be zero-based instead of one-based. Updates #1219.
Originally committed to SVN as r4643.
2010-06-29 23:14:46 +00:00
Thomas Goyne cac536fc80 On Windows, send debug logging to the debugger rather than stdout.
Originally committed to SVN as r4642.
2010-06-29 23:08:42 +00:00
Niels Martin Hansen c0b22973fa Change subs edit box text-formatting buttons to use 16x16 images instead of 24x24 images. Also change the buttons to fully auto-size instead of fixing one or both dimensions.
Originally committed to SVN as r4641.
2010-06-29 18:33:22 +00:00
Niels Martin Hansen f07c8f031e Clean up About box:
Update year to include 2010 (a little late for that...)
Fix bitmap not showing up.
Make control creation and layout simpler.

Originally committed to SVN as r4640.
2010-06-29 17:48:17 +00:00
Niels Martin Hansen 3589353641 Add some real exception catching to our wxApp class, now we should be able to get decent messages from all exceptions thrown inside event handlers.
Originally committed to SVN as r4639.
2010-06-29 10:31:15 +00:00
Niels Martin Hansen 201f654ca9 Fix option data type for the version check auto check toggle, avoid insane exception when closing version check result dialogue.
Originally committed to SVN as r4638.
2010-06-29 10:06:19 +00:00
Niels Martin Hansen 37cd66c950 Make the cool stuff in r4606 a little less cool, but apparently wxGtk doesn't let you freeze invisible windows and get away with it, so we'll have to live with a little extra flicker.
Originally committed to SVN as r4636.
2010-06-28 22:15:40 +00:00
Grigori Goronzy 6589d258ce Merge r4634.
Originally committed to SVN as r4635.
2010-06-28 11:14:00 +00:00
Thomas Goyne b0afd8659c Frame data does need to be uploaded to the video card on every change as the subtitles and video frame are not seperate.
Originally committed to SVN as r4633.
2010-06-28 07:39:42 +00:00
Thomas Goyne a3ff2cc746 Switch visual tools over to using GetSelectedSet for everything
Originally committed to SVN as r4632.
2010-06-28 07:39:36 +00:00
Thomas Goyne 5588cda268 Significantly revamp how visual tools interact with the rest of the program
Rather than just have a single Refresh method that gets called whenever
something happens that could possibly be of interest to the visual
tools, add seperate methods for signaling frame number changes and
changes to the file, and use the new SelectionController stuff for other
things that used to merit a Refresh. This eliminates a large amount of
redundant reparsing of lines which happened on paint, as well as a large
number of redundant repaints.

Frame data is now only uploaded to the video card when the frame number changes
rather than when anything at all changes, slightly improving performance when
using mesa's software opengl implementation.

Vector clip and drag tools now do a slightly better job of not
discarding the user's selection for no apparent reason, and strange
selection behavior from clicking on visual features should now be
entirely fixed.

Everything but the constructor and toolbar event handler in the visual
tool implementations are now private.

Originally committed to SVN as r4631.
2010-06-28 07:13:15 +00:00
Thomas Goyne d30326b20d Don't create the default visual tool until video is loaded so that visual tools can assume video is loaded.
Originally committed to SVN as r4630.
2010-06-28 07:13:08 +00:00
Thomas Goyne dfb844b6ab Make lines_added and lines_removed in SelectionListener::OnSelectedSetChanged mutually exclusive.
Originally committed to SVN as r4629.
2010-06-28 07:13:03 +00:00
Thomas Goyne 574a247559 Fix segfault caused by AssExportFilterChain not getting initialized.
Originally committed to SVN as r4628.
2010-06-28 07:12:57 +00:00
Thomas Goyne 894d55d7a2 Add overload of GetSelectedSet that just returns the selection
Originally committed to SVN as r4627.
2010-06-28 07:12:52 +00:00
Thomas Goyne 9ff34fb00d Revert r4612: "Remove redundant handler for ctrl-clicking the grid", as I completely misread what the code was doing.
Originally committed to SVN as r4626.
2010-06-28 07:12:36 +00:00
Amar Takhar 743997b266 Make the logging for charset detection more useful by print the detected character set(s)
Originally committed to SVN as r4625.
2010-06-27 20:03:38 +00:00
Thomas Goyne af5d34590a Sort styles after lowercasing them rather than before so they actually get in the right order.
Originally committed to SVN as r4624.
2010-06-27 07:53:36 +00:00
Thomas Goyne cd0378519d Add float overload to VariableData and use it in visual_tool.cpp rather than pretending that float* and double* are the same thing.
Originally committed to SVN as r4623.
2010-06-27 07:53:31 +00:00
Thomas Goyne 75d9ecd14a Fix selection issues with visual tools
Originally committed to SVN as r4622.
2010-06-27 07:53:25 +00:00
Thomas Goyne 7f7771bcdc Remove unused variables
Originally committed to SVN as r4621.
2010-06-27 07:53:20 +00:00
Thomas Goyne caba46bf0b Remove features for deleted control points
Originally committed to SVN as r4620.
2010-06-27 07:53:14 +00:00
Thomas Goyne dc2836e9e5 Fix bug where features for the wrong line were displayed in the rectangular clip tool
Originally committed to SVN as r4619.
2010-06-27 07:53:08 +00:00
Thomas Goyne 44888bb008 Reenable Start/Cancel buttons in the font collector dialog even if the collection fails.
Originally committed to SVN as r4618.
2010-06-27 05:05:44 +00:00
Thomas Goyne 7c4bf32566 Don't allow deselection of the only selected line
Originally committed to SVN as r4617.
2010-06-27 04:55:19 +00:00
Thomas Goyne 11b30c8bb4 When the active line is deselected via ctrl-clicking, set the active line to a line which is selected.
Originally committed to SVN as r4616.
2010-06-27 04:55:14 +00:00
Thomas Goyne 74d887a4c4 Add ctrl-shift-click block selection adding
Originally committed to SVN as r4615.
2010-06-27 04:55:08 +00:00
Thomas Goyne 2f80c6b26a Update lastRow when rows are ctrl-clicked
Originally committed to SVN as r4614.
2010-06-27 04:55:03 +00:00
Thomas Goyne a47080137d Repaint rows when they are added or removed from the selection
Originally committed to SVN as r4613.
2010-06-27 04:54:58 +00:00
Thomas Goyne 4db892935c Remove redundant handler for ctrl-clicking the grid
Originally committed to SVN as r4612.
2010-06-27 04:54:52 +00:00
Thomas Goyne 934da32931 Select the first line when opening a file
Originally committed to SVN as r4611.
2010-06-27 04:54:46 +00:00
Thomas Goyne 5598b787c7 Fix gcc build errors
Originally committed to SVN as r4610.
2010-06-27 03:24:03 +00:00
Niels Martin Hansen c5c306f90c Make SubtitlesGrid::InsertLine() smarter about updating maps, saves quite a lot of time on big insertions.
Originally committed to SVN as r4609.
2010-06-26 15:49:05 +00:00
Niels Martin Hansen 22de62de77 Add selection change notification batching to the grid. This doesn't seem to actually improve performance, it might rather be line inserts that are glacial.
Originally committed to SVN as r4608.
2010-06-26 15:40:10 +00:00
Niels Martin Hansen 4c604931aa Fix mistake in DummySelectionController template class, should make G++ a little happier.
Originally committed to SVN as r4607.
2010-06-26 14:26:38 +00:00
Niels Martin Hansen 52627a0fc5 Show splash screen much earlier, and show main window much later. Also be smoother about the display of the main window, avoid flickery relayouting. Remove splash screen "click to close" behaviour as well as timed close, just hide it when the main window has been shown.
Originally committed to SVN as r4606.
2010-06-26 14:16:59 +00:00
Niels Martin Hansen c15f0ada62 Be more sure the audio display's grid pointer is initialised properly. Should fix audio loading.
Originally committed to SVN as r4605.
2010-06-26 14:09:15 +00:00
Niels Martin Hansen c9c2fa6404 Move "active line" responsibility to the grid. There are at the very least a bunch of redraw issues that need to be sorted out, probably much worse things are hiding.
Originally committed to SVN as r4604.
2010-06-26 11:32:16 +00:00
Niels Martin Hansen c4a27da4fc Change the grid to use more sensible maps to keep track of index/object mappings for subtitle lines, and follow the SelectionController model. (Hopefully the new maps can also give slightly better performance.)
Try to keep the original API intact. Some redundant or unused functions in SubtitleGrid were removed. The LoadFromAss() function was renamed to UpdateMaps() since that was its real purpose. (Note that SubtitleGrid now has an UpdateMaps() function that overshadows BaseGrid::UpdateMaps(), but SubtitleGrid::UpdateMaps() calls the hidden function. They are not virtual.)
This does not yet fix visual tool feature selection.
Generally, things just feel more broken still. Further work will fix things.

Originally committed to SVN as r4603.
2010-06-26 07:26:27 +00:00
Niels Martin Hansen 70d41d31b2 Remove the SelectionChangeSubscriber mechanism from the grid and implement some basic selection change notification through SelectionController.
Change SelectionListener interface so it receives the set of lines added and removed from selection, instead of just the complete new selection.
Update VisualTool<> to use SelectionListener to receive selection change notifications.

This change (temporarily, I hope) breaks feature selection in visual drag mode, when changing selection via the grid. This is caused by the grid selection change first clearing the entire selection, which sends a separate notification about selection clear. This causes the last visual feature to be deselected, and then the visual tool base reselects the active line, causing a new notification for selection to be sent. The active line happens to be the newly clicked line, and the selection notification enters during the externalChange guard being set, and is then ignored for feature update purposes. When control returns to the original SelectRow call in the grid, the line to be selected has already been selected and then nothing happens.
The best fix is to avoid two notifications being required to deselect all then reselect one line in the first place, so making the grid selection handling saner is the best fix.

Originally committed to SVN as r4602.
2010-06-26 04:38:02 +00:00
Niels Martin Hansen e60d476f4a Turn BaseGrid into a do-nothing SelectionController<AssEntry>.
Originally committed to SVN as r4601.
2010-06-25 01:49:12 +00:00
Niels Martin Hansen 1a626bb14e Add SelectionController adapted from ADR branch, now templatized on the item data type. Intentionally not making this a merge, the selection controller needs to logically come from trunk into ADR, even if it was added there originally.
Originally committed to SVN as r4600.
2010-06-25 01:44:29 +00:00
Niels Martin Hansen 4f0982c7d5 "Intelligently" append dialogue lines to the end of the Events section instead of to the absolute end of file. This will make appending lines slower if attachments are present, but much safer. Updates #1211.
Originally committed to SVN as r4598.
2010-06-24 20:48:49 +00:00
Niels Martin Hansen 6b36d730af Fix attachments dialogue infinite looping if closed with attachments present. Updates #1212.
Originally committed to SVN as r4596.
2010-06-24 20:43:23 +00:00
Niels Martin Hansen a71b83f61c Add some docstrings to Auto4 LuaAssFile class.
Originally committed to SVN as r4595.
2010-06-24 19:32:23 +00:00
Niels Martin Hansen eec24ce562 Remove empty attachments sections when the Attachments dialogue is closed. Updates #1212.
Originally committed to SVN as r4593.
2010-06-24 19:14:13 +00:00
Thomas Goyne e2a42ccb6c If undo/redo would result in there being no lines selected, select the last line
Originally committed to SVN as r4592.
2010-06-24 07:16:21 +00:00
Thomas Goyne d8e8f9eb68 Fix bad option names
Originally committed to SVN as r4591.
2010-06-24 06:26:44 +00:00
Niels Martin Hansen 3b1189a8b2 Make attachments dialogue set undo points. Updates #1216.
Originally committed to SVN as r4590.
2010-06-24 06:13:51 +00:00
Niels Martin Hansen 7521d2d29d Fix AssAttachment::Clone() not being const causing it to not override AssEntry::Clone(), and make sure the group field is also copied during cloning. Updates #1216.
Originally committed to SVN as r4589.
2010-06-24 06:13:06 +00:00
Amar Takhar 8e912e3ff6 Include <algorithm> to get std::for_each
Originally committed to SVN as r4587.
2010-06-24 01:51:18 +00:00
Amar Takhar 46da1e538d Merge r4450 to unbreak non precompiled header building.
Originally committed to SVN as r4586.
2010-06-24 01:50:16 +00:00
Amar Takhar b5ed0d6c8c wrap config.h include under LAGI and put -DLAGI when compiling to ensure it's only included when building libaegisub.
Originally committed to SVN as r4585.
2010-06-24 01:49:48 +00:00
Thomas Goyne 4f53324ca3 Add the name of the option to OptionValue's error messages
Originally committed to SVN as r4582.
2010-06-24 01:24:49 +00:00
Thomas Goyne e2f8e69612 Beat some semblance of sanity into ass_override and related files. Fixes a pile of crashes when tags are missing expected parameters.
Originally committed to SVN as r4581.
2010-06-24 01:24:43 +00:00
Thomas Goyne c64e764648 Make AssFixStylesFilter an order of magnitude faster
Originally committed to SVN as r4580.
2010-06-24 01:24:37 +00:00
Thomas Goyne d1f36bdc43 Eliminate unnessesary character set conversions in TextFileWriter
Originally committed to SVN as r4579.
2010-06-24 01:24:32 +00:00
Thomas Goyne 53fb43c7e6 Fix significantly incorrect handling of pretty much everything in AssTransformFramerateFilter and make it better at deciding when it actually needs to do anything.
Originally committed to SVN as r4578.
2010-06-24 01:24:26 +00:00
Thomas Goyne 627d423017 Fix memory leak in VariableData
Originally committed to SVN as r4577.
2010-06-24 01:24:21 +00:00
Thomas Goyne cf9eef80ab Fix memory leak in AssLimitToVisibleFilter
Originally committed to SVN as r4576.
2010-06-24 01:24:15 +00:00
Thomas Goyne 2b47f34e76 Fix a pile of actual memory leaks
Originally committed to SVN as r4575.
2010-06-24 01:24:09 +00:00
Thomas Goyne cbf201ab86 Fix some "leaks" of things that should actually be alive for the lifetime of the program to reduce noise.
Originally committed to SVN as r4574.
2010-06-24 01:24:02 +00:00
Thomas Goyne 50d1b3ed2d Rewrite the ass parsing code in visual_tool.cpp, eliminating a lot of repeated code and making it better at finding the correct values.
Originally committed to SVN as r4573.
2010-06-24 01:23:43 +00:00
Amar Takhar 4bb8e8ea22 Merge r4550: remove wx headers.
Originally committed to SVN as r4572.
2010-06-23 13:20:24 +00:00
Thomas Goyne a40b9c4b91 Simplify and speed up AssFile's copy constructor and assignment operator.
Originally committed to SVN as r4565.
2010-06-22 00:03:33 +00:00
Thomas Goyne 7958f85ef3 Remove pointless call to AssDialogue::SetEntryData in AssFile::CompressForStack; makes pushing files onto the undo stack about 50% faster
Originally committed to SVN as r4564.
2010-06-22 00:03:28 +00:00
Thomas Goyne 5ed401d23d Use vector<int> instead of vector<bool> for tracking which rows are selected. Makes undo roughly twice as fast.
Originally committed to SVN as r4563.
2010-06-22 00:03:22 +00:00
Thomas Goyne 358b2734da Fix crash when pasting over
Originally committed to SVN as r4562.
2010-06-22 00:03:16 +00:00
Thomas Goyne 8756dc1800 Add copy constructor to AssDialogue and use it in Clone
Originally committed to SVN as r4561.
2010-06-22 00:03:11 +00:00
Thomas Goyne fe9aa56d10 Remove pointless IntSwap function from utils.h
Originally committed to SVN as r4560.
2010-06-22 00:03:03 +00:00
Niels Martin Hansen e5eb91a269 * Fix bug in SRT parsing: In some cases a blank line too much is counted.
* Make SRT no longer coalesce line breaks, Aegisub will now write SRT files with blank lines in subtitles.
Updates #1213.

Originally committed to SVN as r4558.
2010-06-20 19:42:13 +00:00
Niels Martin Hansen 2fc8420ee9 Rewrite SRT parsing to use more flexible algorithm, allow more freeform files. Updates #1213.
Originally committed to SVN as r4557.
2010-06-20 19:07:43 +00:00
Niels Martin Hansen 4c01f9a36b Declare a SubtitleFormatParseError exception, its ancestry might not be final yet. (I'm thinking it needs a file format error class as base, which in turn inherits from agi::InvalidInput.) Updates #1213 in preparation for the actual patch.
Originally committed to SVN as r4556.
2010-06-20 19:04:58 +00:00
Niels Martin Hansen 5bd0981a72 Make AssFile::Load catch agi::Exception and report it properly. The catching of reading/parsing errors probably doesn't really belong there, but just making things work for now. Updates #1213 in preparation for the actual patch.
Originally committed to SVN as r4555.
2010-06-20 19:03:05 +00:00
Thomas Goyne 363198b2fa Add missing config:: in windows-specific code and move appname setting back before config file loading
Originally committed to SVN as r4549.
2010-06-18 07:23:17 +00:00
Thomas Goyne cfa1758d2a Improve the handling of selected features in the vector clip tool and moderately improve performance
Originally committed to SVN as r4548.
2010-06-18 07:14:23 +00:00
Thomas Goyne 227f6b1d69 In the vector clip tool, draw the line to be inserted between the right points when there are multiple paths in the clip
Originally committed to SVN as r4547.
2010-06-18 07:14:17 +00:00
Thomas Goyne 6830fbe1ba Fix bug where the color spectrum sometimes would not repaint when it changed
Originally committed to SVN as r4546.
2010-06-18 07:14:11 +00:00
Thomas Goyne 3376a2d76a Always repaint the video display when the mouse enters it if visual tools are only shown on mouseover
Originally committed to SVN as r4545.
2010-06-18 07:14:06 +00:00
Thomas Goyne 961365dfff Make rotation and scale tools set all selected lines rather than just the active one
Originally committed to SVN as r4544.
2010-06-18 07:14:00 +00:00
Thomas Goyne afec51c4ed Include config.h in lagi_pre.h so that the conditional inclusion of sys/time.h actually works
Originally committed to SVN as r4543.
2010-06-18 06:59:55 +00:00
Amar Takhar 8ee9737b6f Move mru,opt objects out of the main singleton and into a global config:: namespace. With exception of the log object these are initialised during startup to ensure they are initalised after the log object.
Originally committed to SVN as r4538.
2010-06-18 02:23:27 +00:00
Thomas Goyne 75bd20a6dd Fix the rest of the build errors when not using precompiled headers
Originally committed to SVN as r4530.
2010-06-17 00:23:44 +00:00
Thomas Goyne 61138e9b5d Add configure check for sys/time.h
Originally committed to SVN as r4529.
2010-06-16 07:49:35 +00:00
Thomas Goyne d6b68dfb25 Kill VideoContext::Refresh's arguments; one has never actually done anything and the other is the same in all places where Refresh is called.
Originally committed to SVN as r4528.
2010-06-16 06:20:39 +00:00
Thomas Goyne faf2e562cd Rename FrameMain::SubsBox to SubsGrid for consistency with the rest of Aegisub.
Originally committed to SVN as r4527.
2010-06-16 06:20:33 +00:00
Thomas Goyne 43f3502043 Eliminate double inclusion of frame_main.h and remove #pragma once
Originally committed to SVN as r4526.
2010-06-16 06:20:27 +00:00
Thomas Goyne 392ce99083 Kill AssDialogue::UpdateData, which last had a non-empty body 3.5 years ago
Originally committed to SVN as r4525.
2010-06-16 06:20:19 +00:00
Thomas Goyne 8086fae633 Document AssFile's public methods
Originally committed to SVN as r4524.
2010-06-16 06:20:14 +00:00
Thomas Goyne 166c95975b Templatize VariableData's getters and setters
Originally committed to SVN as r4523.
2010-06-16 06:20:06 +00:00
Thomas Goyne c7ea710267 Use VideoContext::JumpToTime where appropriate
Originally committed to SVN as r4522.
2010-06-16 06:19:49 +00:00
Niels Martin Hansen 0e155767ae Add missing includes to MSVC libaegisub project
Originally committed to SVN as r4519.
2010-06-14 21:35:57 +00:00
Karl Blomster fec1f47501 Make configure not break on testing for newer ffmpeg's by hardcoding a #define into the test program. This is pretty dumb but I don't know about autotools to fix it properly and it's not like it matters. Why is it compiling C code as extern "C" with a C++ compiler, anyway?
Originally committed to SVN as r4516.
2010-06-14 21:11:01 +00:00
Karl Blomster 0061a58210 Fix the ffmpeg configure test so it doesn't try to use a function that has been deprecated for well over a fucking year and a half (since before 0.5, in fact).
Originally committed to SVN as r4515.
2010-06-14 20:55:35 +00:00
Thomas Goyne 5338a60cdb Fix compilation errors when not using precompiled headers
Originally committed to SVN as r4511.
2010-06-14 19:26:27 +00:00
Amar Takhar 340cc1d7f1 Fix compilation with precompiled headers disabled.
Originally committed to SVN as r4504.
2010-06-14 18:02:58 +00:00
Amar Takhar 6989daa086 Merge r4497 to unbreak the build
Originally committed to SVN as r4498.
2010-06-13 06:21:43 +00:00
Amar Takhar 461616a47f Hook up default_path.json to the build
Originally committed to SVN as r4491.
2010-06-13 01:43:19 +00:00
Amar Takhar f497144525 Fix syntax errors
Originally committed to SVN as r4490.
2010-06-13 01:42:50 +00:00
Amar Takhar d8a9bac4b0 Handle the lack of a pre-existing config file.
Originally committed to SVN as r4489.
2010-06-13 01:29:32 +00:00
Karl Blomster 0a590aea04 Add the __STDC_CONSTANT_MACROS define to the ffms2 CFLAGS. Fixes compilation with newer ffmpeg's.
Originally committed to SVN as r4488.
2010-06-12 14:52:13 +00:00
Karl Blomster ea6dac551e Update ffms2 to r312. Fixes a bunch of rather critical bugs.
Originally committed to SVN as r4487.
2010-06-12 14:51:33 +00:00
Amar Takhar 60b9e5dee6 Define _X86_ so univeralchardet builds properly, this eventually needs to be fixed to use the autodetection code already in configure.in
Originally committed to SVN as r4486.
2010-06-12 07:04:46 +00:00
Amar Takhar cbdb906da0 Build universalchardet before libaegisub.
Originally committed to SVN as r4485.
2010-06-12 07:04:12 +00:00
Amar Takhar b1a0142c93 Fix r4483, close conditionals (i was a bit zealous in cutting.)
Originally committed to SVN as r4484.
2010-06-12 06:51:25 +00:00
Amar Takhar 74905e5f4d FFMPEG A/V providers were removed a long time ago, also add OSS as the alternative global before PA.
Originally committed to SVN as r4483.
2010-06-12 05:50:27 +00:00
Amar Takhar cd62441b70 Fix some status outputs, updates #1170, requires merging
Originally committed to SVN as r4482.
2010-06-12 05:48:02 +00:00
Amar Takhar c95eb3fcce universalchardet is no longer optional.
Originally committed to SVN as r4481.
2010-06-12 05:29:01 +00:00
Karl Blomster 62b63ca5b6 Fix a missing property sheet in the libaegisub vcproj
Originally committed to SVN as r4480.
2010-06-11 23:45:23 +00:00
Thomas Goyne ccdc863496 Fix copy/paste error in r4244
Originally committed to SVN as r4479.
2010-06-11 02:25:40 +00:00
Thomas Goyne 40da39e1c8 Make updating the subtitle preview window roughly 50% faster
Originally committed to SVN as r4478.
2010-06-11 02:25:34 +00:00
Thomas Goyne 4ef9d41601 Don't require that subtitles passed to SubtitlesProvider::LoadSubtitles be a copy that can be deleted
Originally committed to SVN as r4477.
2010-06-11 02:25:28 +00:00
Thomas Goyne 72cbf4939f Fix flickering in color picker
Originally committed to SVN as r4476.
2010-06-11 02:25:23 +00:00
Thomas Goyne 8c8e668758 Only include libresrc.h once rather than once per file packed
Originally committed to SVN as r4475.
2010-06-11 02:25:18 +00:00
Thomas Goyne de974fb723 Cast the correct parameter when ICONV_POSIX is defined
Originally committed to SVN as r4474.
2010-06-11 02:25:13 +00:00
Thomas Goyne 612b583e2b Move cajun includes into the cpp files rather than headers so that only files in libaegisub include them.
Originally committed to SVN as r4473.
2010-06-11 02:25:07 +00:00
Thomas Goyne c290b6b811 Silence some prefast warnings
Originally committed to SVN as r4472.
2010-06-11 02:24:59 +00:00
Amar Takhar bc40eeb827 Don't use a wxChar for exception messages.
Originally committed to SVN as r4471.
2010-06-10 04:52:47 +00:00
Amar Takhar 2c703a3baa Remove instances of ^USER and swap them with ^CONFIG, ^USER will still exist but won't be in the default config. Also add 'last opened' paths.
Originally committed to SVN as r4470.
2010-06-09 23:45:05 +00:00
Thomas Goyne d278c99652 Make the color picker dialog update the color instantly when used from the style editor, rather than waiting for the dialog to be closed, and revert if the dialog is cancelled. Updates #355.
Originally committed to SVN as r4469.
2010-06-09 08:14:50 +00:00
Amar Takhar ea577f8245 Re-work types.h for the second time, this is most likely not the final version, it's difficult to figure out a solution that makes the most sense when most of the code hasn't been written/moved over yet.
Originally committed to SVN as r4468.
2010-06-09 02:07:43 +00:00
Amar Takhar 9a3e1c58f0 Use an std::string for now when printing messages.
Originally committed to SVN as r4467.
2010-06-09 02:06:37 +00:00
Amar Takhar 3516b4ce74 Add a vsprops file to bring in include files for iconv, and in the future other contrib headers.
Originally committed to SVN as r4466.
2010-06-09 01:11:38 +00:00
Amar Takhar 931cc7f461 * Remove all instances of wxLogDebug and replace them with LOG_W, LOG_D, LOG_E and LOG_D_IF as required.
* Add LOG_(D|W|I)_IF for conditional logging.

Originally committed to SVN as r4465.
2010-06-08 23:21:39 +00:00
Amar Takhar 653ce8b13d Fix misspelled option name
Originally committed to SVN as r4464.
2010-06-08 12:07:56 +00:00
Thomas Goyne f361d1a67b Add support for rendering vector clips with multiple 'm' commands.
Originally committed to SVN as r4463.
2010-06-08 06:09:19 +00:00
Thomas Goyne c7da8d9f61 Store OptionValues used by VideoContext
Originally committed to SVN as r4462.
2010-06-08 06:09:13 +00:00
Thomas Goyne a12ec002c6 Fix crash when framestepping caused by an incorrect option name.
Originally committed to SVN as r4461.
2010-06-08 06:09:08 +00:00
Thomas Goyne ae099a3363 Vector clip tool always needs to repaint in modes 1-4.
Originally committed to SVN as r4460.
2010-06-08 06:09:02 +00:00
Thomas Goyne b867eec7f3 Make the vector clip visual tool use vertex arrays rather than immediate mode to render the spline
Originally committed to SVN as r4458.
2010-06-07 07:24:43 +00:00
Thomas Goyne fae2af36fc Only draw the line to the cursor in the rotatez tool if the cursor is over the video display.
Originally committed to SVN as r4457.
2010-06-07 07:24:37 +00:00
Thomas Goyne 83e35ac63d Only rerender the video display on mouse events if display will actually change
Originally committed to SVN as r4456.
2010-06-07 07:24:30 +00:00
Thomas Goyne 1b27b77ac3 Add glext.h to the precompiled header
Originally committed to SVN as r4455.
2010-06-07 07:24:25 +00:00
Thomas Goyne 303f4990a5 Update glext.h to a version that isn't four years old
Originally committed to SVN as r4454.
2010-06-07 07:24:18 +00:00
Amar Takhar ad0241e3df Add default_menu.json for safe keeping, I'm not sure if this is the final format.. whatever it ends up being this will be close.
Originally committed to SVN as r4453.
2010-06-07 06:40:19 +00:00
Amar Takhar d8f5d3bff0 Sigh, revert r4451, I checked this before I comitted but the reason it worked was due to a typo (in this case failure was what i was looking for): to do the const check the values must be initialised otherwise (all/most?) compilers will ignore keywords in a signature check unless you actually try to give it a real value.
Originally committed to SVN as r4452.
2010-06-06 03:24:01 +00:00
Amar Takhar 576d7dd8cc Unlike the other tests the iconv const check is just looking for the actual function signature it doesn't use it, we don't need to initialise anything..
Originally committed to SVN as r4451.
2010-06-06 03:11:41 +00:00
Amar Takhar 059a554d95 Include ../config.h to get AGI_ICONV_CONST from acconf.h.
Originally committed to SVN as r4450.
2010-06-06 03:01:04 +00:00
Thomas Goyne b49ea0af6f Conditionally const_cast source pointers passed to iconv to avoid invalid cast warnings
Originally committed to SVN as r4449.
2010-06-06 02:53:02 +00:00
Amar Takhar aa895f9a26 Follow previous conventions and change ICONV_CONST to AGI_ICONV_CONST as wx' defines ICONV_CONST.
Originally committed to SVN as r4448.
2010-06-06 02:46:36 +00:00
Amar Takhar b249faf6ce Use uintptr_t which is guaranteed to fit a pointer unlike int.
Originally committed to SVN as r4447.
2010-06-06 02:41:04 +00:00
Amar Takhar 4d9ff8d626 * Set ICONV_CONST to 1 if iconv is const or not, aparrantly this differs between versions (annoying!)
* Remove -fpermissive, this was required long ago but now there are only a couple of trivial fixes to make.

Originally committed to SVN as r4446.
2010-06-06 02:40:29 +00:00
Amar Takhar 2aeb0bdffb Sigh, -ansi isn't the solution since other compilers may define 'unix', for now the namespace has been called u_nix, hopefully this is safe but who knows...
Originally committed to SVN as r4445.
2010-06-06 02:32:50 +00:00
Amar Takhar acc9e53714 Remove stray ;'s
Originally committed to SVN as r4444.
2010-06-05 23:44:07 +00:00
Amar Takhar b01855ecbd Add -ansi to CPPFLAGS which stops GCC from being stupid and defining unprefixed pp macros (such as "unix"), while i'm here add -pedantic
Originally committed to SVN as r4443.
2010-06-05 23:42:49 +00:00
Thomas Goyne 3fbdf5b7e5 Make the vector clip tool mask based on winding number so that the masking matches VSFilter's clipping.
Originally committed to SVN as r4442.
2010-06-05 22:40:16 +00:00
Niels Martin Hansen ff34a08afd Make update checker use a compile-time list of tags to determine the appropriate updates to list, instead of a hard-coded OS check. The list of accepted tags is defined by the UPDATE_CHECKER_ACCEPT_TAGS macro. If this macro is undefined, the update checker will still compile, but will reject all updates with tags.
Updates #1132.

Originally committed to SVN as r4440.
2010-06-05 20:16:30 +00:00
Amar Takhar 2d9eee4ea9 Add struct tm which mimics the struct on unix. Also setup the types file into seperate namespaces for clarity. The corrosponding change to windows/utils.cpp snuck into r4437.
Originally committed to SVN as r4438.
2010-06-05 18:17:55 +00:00
Amar Takhar 1a7052040a Remove useless whitespace, I need to setup msvc to disable all it's auto-indentation features which are terrible.
Originally committed to SVN as r4437.
2010-06-05 18:16:16 +00:00
Amar Takhar 1c3f6ed111 Remove rpath hardcoding it's no longer needed.
Originally committed to SVN as r4434.
2010-06-04 13:04:50 +00:00
Amar Takhar abe6c734f4 Add dependency on iconv.
Originally committed to SVN as r4433.
2010-06-04 13:01:31 +00:00
Amar Takhar 083f1175a6 Remove iconv library dependency as this is brought in from libaegisub.
Originally committed to SVN as r4432.
2010-06-04 12:59:49 +00:00
Thomas Goyne eff4dcf404 Fix might-as-well-be-inifinite loop in VisualToolVectorClip
Originally committed to SVN as r4431.
2010-06-04 03:08:10 +00:00
Thomas Goyne 38d922c57a Remove time-consuming reparsing of the line in VisualTool::SetOverride
Originally committed to SVN as r4430.
2010-06-04 03:08:04 +00:00
Thomas Goyne 88f6bca9d7 Make ASS tag parsing ~50% faster.
Originally committed to SVN as r4429.
2010-06-04 03:07:58 +00:00
Thomas Goyne f001651865 Replace AssDialogueBlock::GetAsOverride etc. with dynamic_cast
Originally committed to SVN as r4428.
2010-06-04 03:07:52 +00:00
Thomas Goyne fe65f778b1 Don't set the line color for every visual feature as it's always the same
Originally committed to SVN as r4427.
2010-06-04 03:07:46 +00:00
Thomas Goyne 2659b79036 Update the edit box less often during visual tool drags, making drags ~20% faster.
Originally committed to SVN as r4426.
2010-06-04 03:07:41 +00:00
Thomas Goyne 625ce943f5 Cache OptionValue objects used by the video display
Originally committed to SVN as r4425.
2010-06-04 03:07:33 +00:00
Thomas Goyne 3d04db9e90 Fix build error when wx was not built with wxUSE_STL
Originally committed to SVN as r4424.
2010-06-03 20:54:46 +00:00
Thomas Goyne b6d29443a3 Move most character set conversion code to libaegisub and make everything use the new conversion functionality.
Originally committed to SVN as r4423.
2010-06-03 20:32:25 +00:00
Thomas Goyne 7337a11745 Explicitly set the charset to binary when loading subtitles from the video
Originally committed to SVN as r4422.
2010-06-03 20:32:17 +00:00
Thomas Goyne 71300869da Fix order that VisualToolVectorClip's members are initialized
Originally committed to SVN as r4421.
2010-06-03 20:32:10 +00:00
Thomas Goyne ca24f60a7e Fix memory leak when exporting a file fails
Originally committed to SVN as r4420.
2010-06-03 20:32:03 +00:00
Thomas Goyne f064624ecd Simplify charset detection
Originally committed to SVN as r4419.
2010-06-03 20:31:43 +00:00
Amar Takhar 401560b190 Add some debug trace info.
Originally committed to SVN as r4418.
2010-06-03 18:09:00 +00:00
Niels Martin Hansen 709718ffb6 Lesson: Don't code when tired.
Make a complete function call of the notify loop body, instead of some half syntax.

Originally committed to SVN as r4417.
2010-06-03 18:08:23 +00:00
Amar Takhar 1768a8138d Whoops, remove an artifact that remained when debugging: don't delete the message buffer.
Originally committed to SVN as r4416.
2010-06-03 08:32:42 +00:00
Niels Martin Hansen 5e8d5b221b Compiling, but untested, option change notifications. Doesn't seem to affect Aegisub aversely.
Has the limitation that one object can only subscribe once to one option value, but that shouldn't actually be a problem. (One object cannot have two different of its member functions subscribing to one option value.)

Originally committed to SVN as r4415.
2010-06-03 05:07:47 +00:00
Thomas Goyne 90893f1048 Make the capitalization of FFmpegSource in options consistent, as option names are now case-sensitive.
Originally committed to SVN as r4414.
2010-06-03 05:07:10 +00:00
Amar Takhar 2d1bea39cf * Change wxID_CLOSE to wxID_OK
* Destroy the dialogue when closed
 * Don't delete *sink.

Originally committed to SVN as r4413.
2010-06-03 03:07:43 +00:00
Amar Takhar 2e156b8c4f Add a temp stub to dialog_log.cpp to get it building on windows. This still has memory issues which I'll fix along with a new util function to get localtime_r() data on windows+unix.
Originally committed to SVN as r4412.
2010-06-03 01:22:02 +00:00
Amar Takhar 86a3d0792a Move */ up one line so it doesn't catch the closing brace for EmitSTDOUT::log
Originally committed to SVN as r4411.
2010-06-03 01:18:12 +00:00
Amar Takhar 3ba76f196f Commit a bunch of changes msvc wants to make anytime I open the solution: it's driving me nuts.
Originally committed to SVN as r4410.
2010-06-03 01:17:15 +00:00
Amar Takhar 61ee7ce92d Fill in time_log() with code from http://www.suacommunity.com/dictionary/gettimeofday-entry.php <-thanks!
Originally committed to SVN as r4409.
2010-06-03 01:09:41 +00:00
Amar Takhar b40d709924 Add dialog_log.(cpp|h) to the build: It's *very* annoying how msvc decides to randomly write nonsense config settings to the project.
Originally committed to SVN as r4408.
2010-06-03 01:06:05 +00:00
Amar Takhar f6bf25c397 Change the object for windows/log.cpp to log_windows.obj -- I'm starting to dislike msvc more and more, how can people develop using this program?
Originally committed to SVN as r4407.
2010-06-03 01:03:17 +00:00
Amar Takhar 719b7c2281 Add a basic "log window", this will be more polished and useful later on for now it's just something quick and dirty.
There are a few issues to fix:
 * Delete the pointer in frame_main from the modless dialog.
 * Fix string storage in the logging class.
 * Close button doesn't work.

Originally committed to SVN as r4406.
2010-06-02 23:47:39 +00:00
Amar Takhar fc9e01c68a * Forward declare the LogSink global
* Change GetSink() to return a const pointer.

Originally committed to SVN as r4405.
2010-06-02 23:45:51 +00:00
Thomas Goyne 6c13d8f250 Fix merge error in r4401.
Originally committed to SVN as r4403.
2010-06-02 22:54:38 +00:00
Thomas Goyne 9767b715ca Explicitly initialize VisualToolScale's members
Originally committed to SVN as r4402.
2010-06-02 07:22:59 +00:00
Thomas Goyne 7bf9e41526 Document gl_text, fix some minor memory leaks and fix a rendering error that happened only in debug builds.
Originally committed to SVN as r4401.
2010-06-02 07:22:53 +00:00
Thomas Goyne fd00cf9a21 Fix bug where visual tools could leave no lines selected.
Originally committed to SVN as r4400.
2010-06-02 07:22:48 +00:00
Amar Takhar d295ce7b0a Convert a bunch of wxLog* to the new logging method.
Originally committed to SVN as r4399.
2010-06-01 08:21:30 +00:00
Amar Takhar 798e18490d Add windows/log.cpp to the libaegisub project.
Originally committed to SVN as r4398.
2010-06-01 08:19:51 +00:00
Amar Takhar 33011cb5ed Split EmitterSTDOUT into unix/log.cpp and windows/log.cpp, the windows version is commented at the moment.
Originally committed to SVN as r4397.
2010-06-01 08:17:27 +00:00
Amar Takhar 139f675ede Add a return value to LogSink::Subscribe to make msvc happy.
Originally committed to SVN as r4396.
2010-06-01 08:08:33 +00:00
Amar Takhar 8eded1e7c6 Update project file, this should have been done in r4394.
Originally committed to SVN as r4395.
2010-06-01 08:03:51 +00:00
Amar Takhar 7e83443c3e Fix the Windows build, there are a couple of things to note:
* I rebroke the stdout logger I'll fix that in unix.
 * There is a new header libaegisub/types.h which is a temp solution until I sort out something more realistic.  It's too early to tell what the proper solution will be.

Originally committed to SVN as r4394.
2010-06-01 08:03:17 +00:00
Amar Takhar 002f284bea Fix r4383: trunk doesn't use wxString for exceptions anymore.
Originally committed to SVN as r4393.
2010-06-01 07:55:24 +00:00
Amar Takhar badee30d17 Sigh, not diffing before committing bites me again: remove useless deltas that shouldn't have been committed.
Originally committed to SVN as r4392.
2010-06-01 05:14:00 +00:00
Amar Takhar 37b904b75e Create time_log() to return a timeval so I can implement this on windows as well.
Originally committed to SVN as r4391.
2010-06-01 05:11:18 +00:00
Thomas Goyne ac42fcda5d Fix undo problems with cross and drag visual tools.
Originally committed to SVN as r4388.
2010-06-01 03:21:25 +00:00
Thomas Goyne da6c47c20b Load rotation from a line's style when it's not set by an override tag.
Originally committed to SVN as r4387.
2010-06-01 03:21:20 +00:00
Thomas Goyne 9e6454a798 Fix a few spots where x and y were swapped in the X/Y rotation tool.
Originally committed to SVN as r4386.
2010-06-01 03:21:14 +00:00
Niels Martin Hansen 0fe2071082 Add a null-pointer check to update checker. Updates #1164.
Originally committed to SVN as r4383.
2010-06-01 02:08:22 +00:00
Niels Martin Hansen db3c67cfaf Change description of framerate transform export filter to something more modern. Updates #1069.
Originally committed to SVN as r4379.
2010-06-01 00:06:08 +00:00
Amar Takhar 3ff3fdf4cc Fix the stdout print to make it more readable..
Originally committed to SVN as r4376.
2010-05-31 23:16:16 +00:00
Amar Takhar f7993ce3ac Remove the (59!) wxLogDebug lines, this is being rewritten by jfs so there's no point on porting it to the new logging system.
Originally committed to SVN as r4375.
2010-05-31 23:04:27 +00:00
Amar Takhar 0a453fe127 Move Serverity_ID below the definition of log where it should be.
Originally committed to SVN as r4373.
2010-05-31 22:47:38 +00:00
Amar Takhar 9d0c5a4890 Add Googles mutex.h which seems to be used in many of googles projects. It's better to use something that's well-tested rather than rolling our own. Also a huge time saver.
Originally committed to SVN as r4372.
2010-05-31 21:57:08 +00:00
Amar Takhar 9393850884 Commit the beginings of a logging api, this is fairly complete however it has no locking.
Originally committed to SVN as r4371.
2010-05-31 20:55:29 +00:00
Amar Takhar e7b859b9f7 Switch to using libaegisub for character set detection. There are some bugs here but it seems to be more consistent than the last version. There are two remaining issues left: when the character set is unknown we need to provide a full list to choose from. The second: if the file is detected as US-ASCII we need to give a parse error to the user if we run into problems. Right now we'll load the file fine and disable a lot of options.. with no message to the user.
Originally committed to SVN as r4370.
2010-05-29 02:25:19 +00:00
Amar Takhar 9d854b69f3 Don't bother storing storing a single charset into an std::string, instead insert it into the std::map and fix Single() to return the first element. This keeps things simple and also ensures that DetectAll() will always return atleast one element which wasn't being done before.
Originally committed to SVN as r4369.
2010-05-28 13:08:00 +00:00
Amar Takhar 6736f5e292 Add a change that was missed in r4367.
Originally committed to SVN as r4368.
2010-05-28 08:04:55 +00:00
Amar Takhar e408fe49c9 Add support for detecting character sets using UniversalChardet -- this superceeds character_detect.cpp.
Originally committed to SVN as r4367.
2010-05-28 07:40:21 +00:00
Amar Takhar 8dab221f8b Bring universalchardet up to 41661:ea9bbf0ff87f (2010-03-13).
Originally committed to SVN as r4366.
2010-05-27 02:20:34 +00:00
Thomas Goyne 6df5d97568 Eliminate a redundant rerender of the frame when committing changes from
the visual tools. Makes all visual tools roughly twice as fast when real
time mode is enabled.

Originally committed to SVN as r4365.
2010-05-26 22:09:00 +00:00
Thomas Goyne e120ecc190 Make move/pos toggle modify all selected lines
Originally committed to SVN as r4364.
2010-05-26 07:17:46 +00:00
Thomas Goyne 877eabdce7 Fix selection issues with visual features
Selections in drag mode now follow the following rules:

 * If a line is selected in the grid, at least one visual feature
   corresponding to the line is selected.

 * If a line has any features selected, that line is selected in the
   grid.

In addition, all control points now start out selected in the vector
clip tool, and all tools should no longer discard the current selection
at unpredictable or unintended times.

Updates #513.

Originally committed to SVN as r4363.
2010-05-26 07:17:39 +00:00
Thomas Goyne d2a81d871b Make several methods in BaseGrid static or const and clean up some of the implementations.
Originally committed to SVN as r4362.
2010-05-26 07:17:34 +00:00
Thomas Goyne acc1e93728 Also update origins when setting multiple lines with the drag tool. Updates #513
Originally committed to SVN as r4361.
2010-05-26 07:17:28 +00:00
Thomas Goyne 5283c1527b Add updating multiple lines at once to the cross visual tool and make it only happen if alt is held down in both cross and drag. Updates #513.
Originally committed to SVN as r4360.
2010-05-26 07:17:15 +00:00
Amar Takhar 2d57debd49 Commit the beginings of the Path class to hold the internal representation of paths, this is extremely rough since I have to wait until we can do charset conversion in libaegisub to handle windows paths before going any further.
Originally committed to SVN as r4359.
2010-05-24 17:57:07 +00:00
Amar Takhar d171d0aef8 Add a regression test for r4347.
Originally committed to SVN as r4358.
2010-05-24 05:58:46 +00:00
Grigori Goronzy e9c806d0de Handle libass messages with wxLog* family of functions
Originally committed to SVN as r4357.
2010-05-24 03:41:06 +00:00
Grigori Goronzy 8f67d48487 Initial support for external libass with pkg-config
This introduces the configure option --with-external-libass; the
internal copy is still used by default. Fixes #917.

Originally committed to SVN as r4356.
2010-05-24 02:44:31 +00:00
Grigori Goronzy 61ab7d1f2c Fix ALSA player compilation. (missing includes)
Originally committed to SVN as r4355.
2010-05-24 01:46:04 +00:00
Amar Takhar 25497cf87d Completely remove the usage of POSIX functions from Acs. I've discovered the hard way that most things POSIX on Windows is a complete disaster.
With this we're now using native functions and all unit tests pass.

The code used in Check() is still a proof of concept and will probably be rewritten as issues are exposed.

Originally committed to SVN as r4354.
2010-05-23 20:39:14 +00:00
Amar Takhar 69ae630488 Fix binary name: s/aegisub/test/
Originally committed to SVN as r4353.
2010-05-23 20:21:05 +00:00
Amar Takhar fc77763e95 Wrap the initial construction test with EXPECT_NO_THROW(), this will ensure any underlying exceptions are caught. The other tests need similar fixes which I'll look to later on unix.
Originally committed to SVN as r4352.
2010-05-23 20:12:34 +00:00
Amar Takhar c65de83b26 Remove empty quotes, I forgot DOS echo doesn't require it.
Originally committed to SVN as r4351.
2010-05-23 20:06:47 +00:00
Thomas Goyne 1e975eee89 Add double-click positioning to drag visual tool.
Sets the last clicked-on feature to the double-clicked spot and applies
the same relative movement to all other selected lines (including ones
not visible on the current frame).

Updates #513.

Originally committed to SVN as r4350.
2010-05-23 08:53:27 +00:00
Thomas Goyne 0dc6a082ca Fix memory leaks in Option
Originally committed to SVN as r4349.
2010-05-23 06:58:11 +00:00
Thomas Goyne 60a1bdc2df Fix memory leaks in mru.cpp
Originally committed to SVN as r4348.
2010-05-23 06:58:06 +00:00
Thomas Goyne 9fc28fc1d4 Make MRUManager::Remove work
Originally committed to SVN as r4347.
2010-05-23 06:58:01 +00:00
Thomas Goyne d5df0fd545 Fix incorrect setting of float values in the style editor introduced in 7a29bffb847ce2e2f877ddf773aec4afb821018b
Originally committed to SVN as r4346.
2010-05-23 06:57:54 +00:00
Amar Takhar f7f59e5e1d Add an ErrorString utility which converts the code from GetLastError() into a human readable std::string.
Originally committed to SVN as r4345.
2010-05-22 21:09:37 +00:00
Amar Takhar 12711d8c12 * Add util_windows.cpp to test project.
* Fix typo in util_windows.cpp.

Originally committed to SVN as r4344.
2010-05-22 01:41:23 +00:00
Amar Takhar ad005c3a9c Split unix/windows code into seperate files to preserve sanity.
Originally committed to SVN as r4343.
2010-05-22 01:38:07 +00:00
Amar Takhar 810ffa09c7 Convert the identifier to an std::string from wxString. For whatever reason wxString is producing addresses rather than strings when automatically converting. I've seen this behaviour before and it seems quite random. This will solve that problem.
Originally committed to SVN as r4342.
2010-05-22 01:22:53 +00:00
Amar Takhar cb1a82baaa * Add a post build event to setup the unit test resource directory.
* Fix the build target, for some reason this isn't being taken from the property sheet jfs will have to look at it later..

Originally committed to SVN as r4341.
2010-05-21 17:33:04 +00:00
Amar Takhar c1ad93ce93 Add a project for the unit tests.. this is incomplete (progress save)
Originally committed to SVN as r4340.
2010-05-21 06:06:46 +00:00
Amar Takhar 6a15775401 Add a temp (and ugly) workaround to get this building on windows. I'll make a proper solution when i next work on this file. (soonish)
Originally committed to SVN as r4339.
2010-05-21 06:03:20 +00:00
Thomas Goyne 9157465a18 Fix loading video/keyframes/timecodes from the MRU list.
Originally committed to SVN as r4338.
2010-05-21 04:40:38 +00:00
Amar Takhar a584361bb8 Add a few missing redirects.
Originally committed to SVN as r4337.
2010-05-21 04:03:43 +00:00
Amar Takhar 580bdb8271 Add a windows equivalent of setup.sh
Originally committed to SVN as r4336.
2010-05-21 04:02:08 +00:00
Thomas Goyne 68914197d5 Re-add local config file support for standalone installations.
Originally committed to SVN as r4335.
2010-05-21 03:52:11 +00:00
Thomas Goyne d3c33d5e7c Fix file saving on Windows.
Originally committed to SVN as r4333.
2010-05-21 03:07:48 +00:00
Amar Takhar cd8305987b Wrap io.h with _MSC_VER since it's only needed on windows. Eventually we'll have to create our own set of defined macros for various platforms.
Originally committed to SVN as r4332.
2010-05-21 01:19:40 +00:00
Amar Takhar 40e12403d5 Merge all changes from the libaegisub branch into trunk, the effective range is r4175:4330. All options have been re-done and now use Cajun to support a json-backed format.
Initial support for low-level access and file I/O methods are included as well.

Originally committed to SVN as r4331.
2010-05-21 01:13:36 +00:00
Thomas Goyne 23972b10bc Add selection and control of multiple visual features
Make all visual tools support selecting and manipulating multiple visual
features at once, allowing multiple lines to be moved at once, entire
vector clips to be translated, etc. Controls:

  - Left click: Select control clicked control only
  - Ctrl-left click: Add/remove control to selection
  - Drag control (with or without ctrl): Move all selected controls,
    after setting/adding to selection if target is not in the selection
  - Click on no control: Clear selection

Lots of little stuff to fix still.

Updates #513.

Originally committed to SVN as r4322.
2010-05-20 08:55:58 +00:00
Thomas Goyne 8ff2728322 Move all userdata in VisualDraggableFeature not used by VisualTool to subclasses specific to each tool that needs userdata.
Originally committed to SVN as r4321.
2010-05-20 08:55:52 +00:00
Thomas Goyne a282393b47 Template VisualTool on the type of draggable features to use
Originally committed to SVN as r4320.
2010-05-20 08:55:46 +00:00
Thomas Goyne 2ef8302a6d Add boost/shared_pointer.hpp to the precompiled header
Originally committed to SVN as r4319.
2010-05-20 08:55:41 +00:00
Thomas Goyne 40a0c8994a Simplify the VisualTool interface a bit.
Originally committed to SVN as r4318.
2010-05-20 08:55:35 +00:00
Thomas Goyne e023831134 Detangle the visual tools from SubsEditBox a bit by making changes to the file no longer go through the edit box.
Originally committed to SVN as r4317.
2010-05-20 08:55:29 +00:00
Thomas Goyne 34a7d21a42 Kill the redundant VisualToolEvent nonsense and make the drag tool just use OnSubTool like the vector clip mode.
Originally committed to SVN as r4316.
2010-05-20 08:55:23 +00:00
Thomas Goyne 2ec4a97dbb Fix bad coordinate conversion in the clip visual tool
Originally committed to SVN as r4315.
2010-05-20 08:55:18 +00:00
Thomas Goyne 0e527355eb Kill some code that was last uncommented before revision 1000.
Originally committed to SVN as r4314.
2010-05-20 08:55:13 +00:00
Thomas Goyne 519039131f Fix crash in freehand draw mode of the vector clip visual tool
Originally committed to SVN as r4313.
2010-05-20 08:55:08 +00:00
Thomas Goyne 94bffb5b9d Fix compile error in gcc introduced in r4307 (instantiating templates with private inner types is a msvc extension)
Originally committed to SVN as r4311.
2010-05-19 03:24:07 +00:00
Thomas Goyne f4124e373c Add single-axis modes to all visual tools
Make all visual tools only update the most-changed axis whenever shift
is held down. Previously the rotate and scale tools used ctrl for this
and shift for snapping to round values; these have been swapped for
consistency.

Closes #993.

Originally committed to SVN as r4310.
2010-05-19 03:24:01 +00:00
Thomas Goyne 115dacb37e Clean up VisualFeature a bit and make most of OpenGlWrapper's methods const
Originally committed to SVN as r4309.
2010-05-19 03:23:55 +00:00
Thomas Goyne 008d59d71e As we require RTTI anyway, kill AssEntry::GetAsDialogue/Style/Attachment and just use dynamic_cast
Originally committed to SVN as r4308.
2010-05-19 00:44:52 +00:00
Thomas Goyne 2124a1dbd3 Rework how sorting works and add sorting by style
Rather than going through a ton of work to ensure that every AssEvent
has a sensible start time that happens to leave it in the right place
after sorting, simply sort only consecutive blocks of AssDialogues and
leave everything else untouched. Note that this results in different
behavior when there are multiple [Events] sections in a file -- rather
than moving lines between sections and keeping the number of lines per
section constant, each section keeps the lines it had.

As it's now easy to do, also add sorting by style name and end time.

Closes #614.

Originally committed to SVN as r4307.
2010-05-19 00:44:44 +00:00
Thomas Goyne a573b0897b Add "Open Subtitles From Video" menu option. Closes #253.
Originally committed to SVN as r4306.
2010-05-19 00:44:37 +00:00
Thomas Goyne ea100e9bff Add simple automation macros to strip override tags and select overlapping lines. Closes #120.
Originally committed to SVN as r4305.
2010-05-19 00:44:31 +00:00
Thomas Goyne a073d48f26 Make all of the controls in the Style Manager dynamically sized. Results in slightly wider buttons with English and much better sized buttons in other languages. Updates #1101
Originally committed to SVN as r4303.
2010-05-17 19:48:17 +00:00
Thomas Goyne 49abae2698 Fix a merge conflict and some newline issues
Originally committed to SVN as r4290.
2010-05-16 07:06:08 +00:00
Thomas Goyne 2c876e79c3 Make visual tools use only screen coordinates.
Previously the visual typesetting tools and the overlay mask used
several coordinate frames, converting between them in many places in
inconsistent ways.  This elimiates all uses of coordinate frames other
than screen and script, and makes the conversion done in one place, and
only when parsing or serializing ASS.

This fixes:

 - A few minor rounding errors

 - Horrible brokeness when only part of the video frame is being
   displayed, due to higher levels of zoom than fit onscreen or panning
   the video

 - Distortion of the visual typesetting tools when the combination of
   overridden aspect ratio, script resolution, and video resolution did
   not result in square pixels.

 - Resolution-dependence of the visual typesetting tools, which resulted
   in some tools becoming hard to use at zooms outside the range of
   100-200%.

 - Some draggable controls used the mouse's script coordinates,
   resulting in noticable jerky movement at high zoom levels or when
   using strange script resolutions.

Closes #966.

Originally committed to SVN as r4289.
2010-05-16 06:39:11 +00:00
Thomas Goyne 74a9bdeb41 Limit the canvas size to the window's size to avoid things exploding at high zoom levels
Originally committed to SVN as r4288.
2010-05-16 06:39:06 +00:00
Thomas Goyne 94cf2949f1 Make the calculation of black borders in the video display happen on resize rather than on draw.
Originally committed to SVN as r4287.
2010-05-16 06:38:59 +00:00
Thomas Goyne 624df412ea Kill the horrifying PrettyFloat function and just use g instead of f everywhere it was used.
Originally committed to SVN as r4280.
2010-05-13 18:41:46 +00:00
Thomas Goyne 1654f4a102 Remove a redundant (and incorrect) check for if the mouse is over the video
Originally committed to SVN as r4279.
2010-05-13 18:37:51 +00:00
Thomas Goyne 247e756c9b Move doxygen stuff for VideoDisplay to the header and fill in some missing docs.
Originally committed to SVN as r4278.
2010-05-13 18:37:46 +00:00
Thomas Goyne 290353d467 Bump copyright years on video_display.*
Originally committed to SVN as r4277.
2010-05-13 18:37:41 +00:00
Thomas Goyne 5215049c07 Add mouse wheel video zooming
Originally committed to SVN as r4276.
2010-05-13 18:37:35 +00:00
Amar Takhar 81282bf06e Add LICENCE to EXTRA_DIST.
Originally committed to SVN as r4261.
2010-05-06 16:07:00 +00:00
Amar Takhar f002850e17 Fix distfile creation.
Originally committed to SVN as r4260.
2010-05-06 16:05:34 +00:00
Thomas Goyne c7e06e9451 Change the uses of -1 for invalid positions in the visual typesetting tools to INT_MIN, as -1 is sometimes a perfectly valid coordinate
Originally committed to SVN as r4258.
2010-05-01 01:45:16 +00:00
Thomas Goyne 5cbabf2d35 Add an option to only display visual typesetting tools when the mouse is over the video.
Originally committed to SVN as r4257.
2010-05-01 01:45:10 +00:00
Thomas Goyne 61c141a714 Change zoom to an arbitrary percentage rather than an index into a fixed list of allowed zooms
Originally committed to SVN as r4256.
2010-05-01 01:07:05 +00:00
Thomas Goyne 42781c1c62 Make the shift times history display one-based frame numbers when shifting the selection onwards. Updates #1098
Originally committed to SVN as r4255.
2010-05-01 01:07:00 +00:00
Thomas Goyne 7a7b7fb5e9 Add menu options for the tag hiding modes to the view menu. Closes #433
Originally committed to SVN as r4254.
2010-04-30 20:42:07 +00:00
Thomas Goyne 2fea4bb1ba Ensure that after using the select lines dialog, the active line is always one of the selected lines. Updates #1176.
Originally committed to SVN as r4253.
2010-04-30 20:42:01 +00:00
Thomas Goyne ae82498273 Make a few parameters in gl_text const references
Originally committed to SVN as r4252.
2010-04-30 16:15:18 +00:00
Thomas Goyne 47beda4c89 Fix build error introduced in r4250 when not using precompiled headers.
Originally committed to SVN as r4251.
2010-04-30 16:15:12 +00:00
Thomas Goyne c3a986414c Make OpenGLTextTexture use the smallest texture that is large enough to fit the requested glyph rather than always using 256x256
Originally committed to SVN as r4250.
2010-04-30 03:00:19 +00:00
Thomas Goyne 27a159793a (Re)add catch for wchar_t in VideoDisplay::Render as it turns out that some of the stuff it calls still throws strings
Originally committed to SVN as r4249.
2010-04-30 03:00:15 +00:00
Thomas Goyne fd701c67ec Kill supportsGlClampToEdge, which hasn't actually been used for a while
Originally committed to SVN as r4248.
2010-04-30 03:00:09 +00:00
Thomas Goyne b90fdcc111 Make the video display use OpenGL display lists, slightly simplifying the code and reducing the amount of state explicitly tracked.
Originally committed to SVN as r4247.
2010-04-30 03:00:04 +00:00
Thomas Goyne 5f82c5bb02 Make the style manager dialog select the new styles when copying styles between the current script and storage, and fix a few cases where buttons were incorrectly enabled or disabled. Updates #1186.
Originally committed to SVN as r4244.
2010-04-24 21:48:06 +00:00
Thomas Goyne de459275a1 Fix crash when using the drag visual tool on a line with a four-argument move tag. Closes #1002.
Originally committed to SVN as r4239.
2010-04-22 01:09:24 +00:00
Thomas Goyne 792c8ec66e Specifically catch exceptions thrown by the subtitle renderer so that we can give a slightly more useful error message.
Originally committed to SVN as r4238.
2010-04-22 01:09:16 +00:00
Kevin Ollivier aa417cf903 Remove unintentionally added tabs.
Originally committed to SVN as r4174.
2010-03-13 18:16:40 +00:00
Kevin Ollivier 9fcdfebf82 Fix the waf build after the libresrc changes, and also tweak the script to properly handle dependency tracking with the generated files.
Originally committed to SVN as r4173.
2010-03-13 17:50:51 +00:00
Kevin Ollivier 277f1959ad We should still increment currentItem when the file and dir tests both return false, as otherwise we get into infinite recursion processing the same item.
Originally committed to SVN as r4172.
2010-03-13 17:43:47 +00:00
Amar Takhar 6a9b0b5589 * Return an std::string
* Be const correct.
 * Use c_str() to ensure null termination.
 * Remove stray , from default_mru.json.

Originally committed to SVN as r4171.
2010-03-06 03:55:27 +00:00
Thomas Goyne 409bcc561a Update the windows build system to work with the changes made in r4169.
Originally committed to SVN as r4170.
2010-03-03 01:28:47 +00:00
Amar Takhar c3c14b0815 Change how libresrc is built:
* Instead of putting code into the .(c|h) files place it into two new files libresrc.(c|h)
 * Bitmaps now go into bitmaps.(c|h)
 * Default configs into default_config.(c|h)

With this approach we can easily embed any resources by simply calling it with common-respack and not having to do anything else.

Originally committed to SVN as r4169.
2010-03-03 00:44:17 +00:00
Amar Takhar e4364ae6f9 Fix typo. (from kovensky), should be merged to 2.1.9
Originally committed to SVN as r4164.
2010-03-01 19:36:57 +00:00
Thomas Goyne d63dab8a3e Fix a memory leak in csri caused by csri_wrap_insts never being freed.
Originally committed to SVN as r4158.
2010-02-26 00:18:33 +00:00
Thomas Goyne 0a8a495aea Fix a smattering of memory leaks.
Originally committed to SVN as r4157.
2010-02-25 21:45:39 +00:00
harukalover 41be900efa Fixed a memory leak that occurred whenever the Edit menu was opened due to the Undo/Redo items being replaced with new wxMenuItem's without deleting the previous items (now it just updates the label/enabled status without creating new wxMenuItem's)
Originally committed to SVN as r4139.
2010-02-21 06:09:28 +00:00
Niels Martin Hansen 6a431b9032 Do an additional range check before grabbing a dialogue line by index in BaseGrid. Not doing it makes MSVC debug runtimes spew assertions and whatnot. This shouldn't break anything... I hope it doesn't.
Originally committed to SVN as r4134.
2010-02-21 01:25:15 +00:00
Kevin Ollivier 5cafad1d81 Just call Next/PrevFrame now that the audio playing behavior is implemented inside those methods.
Originally committed to SVN as r4122.
2010-02-17 19:07:37 +00:00
Kevin Ollivier 3a58a48e1a Move the logic to play the audio on stepping through video into video_context so that the VideoSlider's Next/PrevFrame can behave consistently regardless of where they're called from.
Originally committed to SVN as r4121.
2010-02-17 19:04:41 +00:00
Kevin Ollivier 3082838aa1 Add an option to play audio when stepping through video, like some other video players do. Also, add .mov as a file format to load, as it is widely used on Mac and seems to work fine for me with ffmpeg.
Originally committed to SVN as r4120.
2010-02-17 06:24:29 +00:00
Kevin Ollivier 65b09da334 Add missing include.
Originally committed to SVN as r4107.
2010-02-15 03:06:04 +00:00
Thomas Goyne e5416f01dc Fix debug assertion in style manager when "Copy" is clicked with zero styles selected.
Originally committed to SVN as r4105.
2010-02-14 22:44:29 +00:00
Thomas Goyne 429a57ef68 Change the logic for when the style editor asks the user if they wish to update existing lines when renaming a style to be based on whether it is a newly created style rather than whether the style's name starts with "Copy of". Updates #1060.
Originally committed to SVN as r4103.
2010-02-14 22:26:45 +00:00
Thomas Goyne 509f748cfb Make VideoContext::SetVideo explicitly call VideoContext::UpdateDisplays rather than relying on the calling code restoring it to a consistent state. Updates #1159.
Originally committed to SVN as r4101.
2010-02-14 22:02:33 +00:00
Thomas Goyne 621cefe14e Fix compile error on non-windows caused by r4097.
Originally committed to SVN as r4099.
2010-02-14 18:06:56 +00:00
Thomas Goyne 175b2a4648 Rewrite the texture grid positioning code again, fixing several visual defects that showed up in OpenGL 1.1 mode. Updates #1153.
Originally committed to SVN as r4097.
2010-02-14 17:41:41 +00:00
Thomas Goyne c9ba8329ad Change all incorrect uses of __WXDEBUG__ to _DEBUG. __WXDEBUG__ being defined does not necessarily mean that it is a debug build, and by default it is defined in release builds of wx as of 2.9.1.
Originally committed to SVN as r4089.
2010-02-09 04:31:33 +00:00
Niels Martin Hansen cb8cafadbd Add video/script resolution correct factor to karaskel, updates #1139.
Originally committed to SVN as r4087.
2010-02-05 17:31:18 +00:00
Niels Martin Hansen 48e321f8ef Juggle a weird control structure to be more regular.
Originally committed to SVN as r4086.
2010-02-05 16:06:37 +00:00
Niels Martin Hansen 6fe0eb96be Define an RAII wrapper for the Win32 HANDLE type and make sure all handles created also get closed in the DSound2 audio player. Updates #1145.
Originally committed to SVN as r4084.
2010-02-05 15:13:11 +00:00
Niels Martin Hansen 702739b32e Doxygen-document DSound2 audio player
Originally committed to SVN as r4083.
2010-02-05 14:51:12 +00:00
Niels Martin Hansen fe65749623 Merge r4081, closes #1126.
Originally committed to SVN as r4082.
2010-02-05 13:22:43 +00:00
Niels Martin Hansen 8d5cde185d Fix rare furigana layout issue. Updates #1144.
Originally committed to SVN as r4079.
2010-02-05 12:51:20 +00:00
Thomas Goyne 7ac273eca0 Fix problems with how VideoDisplay's size was being set resulting in the border being subtracted from the video size and the video always taking up the full width of the box even at very low zoom levels. Updates #1137, #1140.
Originally committed to SVN as r4077.
2010-01-31 18:49:37 +00:00
Grigori Goronzy 08817a3e98 Add missing includes to fix compilation without precompiled headers.
Fixes #1129. Patch by buscher.

Originally committed to SVN as r4076.
2010-01-31 14:55:03 +00:00
Grigori Goronzy ba0cf4463f Delete gcc precompiled headers in distclean.
Originally committed to SVN as r4072.
2010-01-30 16:59:24 +00:00
Grigori Goronzy 5db8abd330 OSS player: convert device name to UTF-8 string.
Originally committed to SVN as r4071.
2010-01-30 15:08:50 +00:00
Grigori Goronzy f84b51531a Merge r4006 back intro trunk.
Originally committed to SVN as r4069.
2010-01-30 13:43:25 +00:00
Thomas Goyne b5064f8fc9 Replace lua's default lua module loader with one which uses our UTF-8-supporting script reader.
Originally committed to SVN as r4060.
2010-01-28 01:13:13 +00:00
Amar Takhar 4343fb44ef Forgot to add rpath info for the osx builds.
Originally committed to SVN as r4052.
2010-01-26 14:06:49 +00:00
Amar Takhar e89e7b4be2 Make dictionary printfs easier to read. (also add one for the thesaurus)
Originally committed to SVN as r4051.
2010-01-26 13:56:56 +00:00
Amar Takhar 0c9f32fbb8 Add the irc bot to freenode as well.
Originally committed to SVN as r4049.
2010-01-26 13:47:26 +00:00
Amar Takhar 5c00df7209 Fix -rpath reference so common-respack works correctly.
Originally committed to SVN as r4048.
2010-01-26 13:45:07 +00:00
Amar Takhar b822ec6343 Merge translations from 2.1.8.
Originally committed to SVN as r4047.
2010-01-26 13:43:02 +00:00
Amar Takhar 5ebab7adba Update aegisub.pot + .po files in preperation for merging the translations from 2.1.8 to trunk.
Originally committed to SVN as r4046.
2010-01-26 13:38:54 +00:00
Amar Takhar eece24e293 Delete all .mo files, we'll be generating these on build time see #1076.
Originally committed to SVN as r4045.
2010-01-26 13:22:14 +00:00
Amar Takhar 27a1d68ec4 Call OnUnhandledException() only when wxWidgets is compiled with exception handling.
Originally committed to SVN as r4044.
2010-01-26 13:18:53 +00:00
Amar Takhar 0cd4f1225d Merge 3906,r3909,r3910,r3912,r3928,r3931,r3932,r3933,r3935,r3936: merge update checker from 2.1.8, this also needs to be documented for doxygen. closes #1084.
Originally committed to SVN as r4042.
2010-01-26 13:14:05 +00:00
Amar Takhar f3f6a90bbe Fix wx-config references, also don't run configure under bash.
Originally committed to SVN as r4040.
2010-01-25 21:45:48 +00:00
Amar Takhar ac2a41e9f0 Fix location of wx-config to the general link.
Originally committed to SVN as r4039.
2010-01-25 15:13:26 +00:00
Thomas Goyne 0a12e60a36 Add the Automation include path to lua's module load path.
Originally committed to SVN as r4038.
2010-01-24 19:07:34 +00:00
Thomas Goyne 7ffc3d4080 Move more of the purely OpenGL-related code into VideoOutGL from VideoDisplay and simplify the calculation of the texture grid positions slightly.
Originally committed to SVN as r4037.
2010-01-24 19:05:20 +00:00
Thomas Goyne ba088237d7 Add some documentation for AegisubCSConv and TextFileReader.
Originally committed to SVN as r4036.
2010-01-24 18:56:51 +00:00
Amar Takhar c7d95e5590 Add greg to the about dialog credits.
Originally committed to SVN as r4035.
2010-01-24 02:37:47 +00:00
Amar Takhar 4a42ab1403 merge r4011,r4012 (Switch from Mac::Finder::DSStore to using AppleScript)
Originally committed to SVN as r4025.
2010-01-21 00:37:04 +00:00
Amar Takhar e247dec1f3 Merge r4010,r4013,r4014 (configure and bundle/dmg generation fixes.)
Originally committed to SVN as r4024.
2010-01-21 00:34:45 +00:00
Amar Takhar 113ae0cd6d merge r4007 (optimisation flag fix.)
Originally committed to SVN as r4023.
2010-01-21 00:30:42 +00:00
Amar Takhar 73ab47f8ec merge r3986 (configure release support.
Originally committed to SVN as r4022.
2010-01-21 00:29:26 +00:00
Amar Takhar f43bff1e97 merge r4003 (options dialogue layout fixes)
Originally committed to SVN as r4021.
2010-01-21 00:28:07 +00:00
Amar Takhar 89e2428dbe merge r3992 (restart-helper fixes)
Originally committed to SVN as r4020.
2010-01-21 00:26:45 +00:00
Amar Takhar 4221919d4f merge r3983,r4002 (more string fixes.)
Originally committed to SVN as r4019.
2010-01-21 00:24:59 +00:00
Amar Takhar 79c1716ccd merge r3982.
Originally committed to SVN as r4017.
2010-01-21 00:01:46 +00:00
Amar Takhar e76cfae9bb Merge r3974: asserts in colour picker dialog.
Originally committed to SVN as r4015.
2010-01-20 22:49:26 +00:00
Niels Martin Hansen f1fa69d528 Merge r3999 to trunk, updates #566.
Also, 4000 GET.

Originally committed to SVN as r4000.
2010-01-19 08:50:40 +00:00
Thomas Goyne 80fdea74e6 Merge r3994 from the 2.1.8 branch. Closes #999.
Originally committed to SVN as r3995.
2010-01-19 01:05:51 +00:00
Grigori Goronzy 8c8f59b5ff Fix ALSA player. Works On My Computer [tm].
Originally committed to SVN as r3990.
2010-01-15 22:58:51 +00:00
Amar Takhar 361f5228ba Merge r3977 (osx-fix-libs) from 2.1.8 closes #964.
Originally committed to SVN as r3978.
2010-01-12 13:00:24 +00:00
Grigori Goronzy 6006fb5bba Redirect mouse events from the color picker dialog to the dropper icon
to make the color dropper work on Unix/GTK. OS X still needs fixes.

Originally committed to SVN as r3975.
2010-01-12 03:19:49 +00:00
Grigori Goronzy e341e05fa2 Update libass to commit 8db4a5.
Originally committed to SVN as r3970.
2010-01-10 21:09:48 +00:00
Niels Martin Hansen 7e079a3fc2 Merge r3967 from 2.1.8, closes #971.
Originally committed to SVN as r3968.
2010-01-10 16:15:31 +00:00
Niels Martin Hansen 8c036dfc3b Merge r3965 back in trunk. Closes #791.
Originally committed to SVN as r3966.
2010-01-10 16:02:01 +00:00
Thomas Goyne 8657658c70 Fix undefined behavior sometimes resulting in a crash when copying styles to or from storage when the style name already exists. Patch by Paranoja. Closes #1096.
Originally committed to SVN as r3961.
2010-01-07 00:48:27 +00:00
Thomas Goyne a1902a0690 Remove the frequently unstable or nonfunctional attempt at automatically loading audio from the loaded video when playing with no audio loading. Updates #1090.
Originally committed to SVN as r3954.
2010-01-06 08:02:15 +00:00
Niels Martin Hansen f805ec707e Merge r3951 from 2.1.8 back in: fixing old URLs
Originally committed to SVN as r3952.
2010-01-06 05:23:58 +00:00
Amar Takhar dbc885fdb0 Merge r3929 to fix the video slider, updates #1073.
Originally committed to SVN as r3939.
2010-01-05 00:51:53 +00:00
Kevin Ollivier 5374441cdd Use correct framework header so that we get CFStringRef, etc. included as well.
Originally committed to SVN as r3938.
2010-01-05 00:50:09 +00:00
Thomas Goyne 8513fef7e2 Eliminate an unnecessary call to VideoContext::UpdateDisplays triggered by SubsEditBox::SetToLine, moderately improving responsiveness when working with lines that take a long time to render.
Originally committed to SVN as r3925.
2010-01-02 06:23:02 +00:00
Amar Takhar 931326e3c0 Add 1020 to license header, happy new year!
Originally committed to SVN as r3922.
2010-01-01 21:10:34 +00:00
Niels Martin Hansen 54ff8124b6 Merge r3907 back to trunk, closes #1072
Originally committed to SVN as r3908.
2009-12-27 19:49:27 +00:00
Amar Takhar fb9ddc45a3 We're using wx-trunk for OSX now, as the cocoa port is far ahead of the 2.9 branch.
Originally committed to SVN as r3905.
2009-12-26 00:26:37 +00:00
Amar Takhar b00a77c5f5 Add missing headers to quicktime_common.cpp and video_provider_quicktime.cpp.
Originally committed to SVN as r3899.
2009-12-25 04:32:36 +00:00
Amar Takhar e00936c3bf Add AC_PROG_RANLIB to configure.in, fixes 'make distclean'
Originally committed to SVN as r3898.
2009-12-25 04:31:59 +00:00
Amar Takhar face7faec3 Fix bundledirs-test target.
Originally committed to SVN as r3896.
2009-12-25 03:31:01 +00:00
Amar Takhar 6b454601da * Add a new function to libosxutil: OSX_OpenLocation which calls LSOpenCFURLRef, it accepts a URL (except for local paths) and opens the correct program using the Launcher.
* Add a new help menu option to access internal resources located within the bundle.

Closes #1033 and updates #1070.

Originally committed to SVN as r3895.
2009-12-25 03:28:15 +00:00
Amar Takhar fff128fcfa Add support for building the QuickTime A/V providers under OSX.
Originally committed to SVN as r3893.
2009-12-24 23:06:47 +00:00
Amar Takhar a49aa20a22 Merge r3891 (hunspell path fix.)
Originally committed to SVN as r3892.
2009-12-24 18:16:19 +00:00
Amar Takhar 660e392423 Update chinese translation -- this is an old version that was updated 2 days after the original submission. Unfortunatly it was never comitted.
Originally committed to SVN as r3887.
2009-12-22 19:18:29 +00:00
Amar Takhar 13761bd65e Add fi and zh_CN to LINGUAS.
Originally committed to SVN as r3886.
2009-12-22 18:52:33 +00:00
Amar Takhar ebc9222f32 Merge r3879.
Originally committed to SVN as r3880.
2009-12-22 05:21:32 +00:00
Amar Takhar ec6053a674 Merge r3877.
Originally committed to SVN as r3878.
2009-12-22 04:19:27 +00:00
Amar Takhar 69770d53d4 Switch automake version(s) to 1.10 from 1.9.
Originally committed to SVN as r3868.
2009-12-13 20:00:04 +00:00
Amar Takhar e82ea9d8b2 Fix some errors + better formatting for the custom email message. Also set it to only report problems and not successful builds.
Originally committed to SVN as r3867.
2009-12-13 19:58:34 +00:00
Amar Takhar 3e83cb7597 Add URL to transposed grid display.
Originally committed to SVN as r3866.
2009-12-13 19:56:31 +00:00
Thomas Goyne 2f2f0d9aac Fix some assorted VideoOutGL-related stupidity. Updates #1056.
Originally committed to SVN as r3864.
2009-12-13 19:27:45 +00:00
Amar Takhar fedd8ecce6 Commit a different patch than the one in #1064.. this sets the default automake required version to 1.10.. the detection for 1.11 is *after* 1.11 because we prefer to use that, though we do prefer to use 1.11 than 1.9 if it's available. Updates #1064
Originally committed to SVN as r3862.
2009-12-13 17:47:19 +00:00
Amar Takhar 608a73677d Remove /usr/share/fonts and /usr/X11R6/lib/fonts from fonts.conf. These will never be used under OSX they're for Unix and X respectivly. /usr/share/fonts is only useful for Unix users and the X path is useless under Aqua.
Originally committed to SVN as r3860.
2009-12-12 03:47:51 +00:00
Niels Martin Hansen eb938aa5ed Check video size on open and change zoom level to 50% or 25% if the video is greater than some proportions of the window size.
Updates #1054.

Originally committed to SVN as r3858.
2009-12-12 01:38:09 +00:00
Kevin Ollivier dd0da6744b Commit of start on waf build system. Uses the most recent waf release. Currently builds on OS X with ffmpeg, OpenAL and libass providers, do waf configure; waf build to build.
Originally committed to SVN as r3854.
2009-12-07 00:42:51 +00:00
Kevin Ollivier 31ec52b415 Fix constness issue that makes gcc on SnowLeopard fail to compile.
Originally committed to SVN as r3853.
2009-12-07 00:06:35 +00:00
Thomas Goyne fc75937466 Make some non-mutating hotkey methods const.
Originally committed to SVN as r3852.
2009-12-05 04:26:07 +00:00
Amar Takhar c3a6fbae6e Commit patch from Harukalover to fix prefs dialogue asserts. (tested) Updates #1053.
Originally committed to SVN as r3849.
2009-12-01 20:46:04 +00:00
Thomas Goyne a1f3fb7dc0 Prevent times from rounding to the magic zero in the framerate transform. Updates #1007.
Originally committed to SVN as r3839.
2009-12-01 01:56:06 +00:00
Thomas Goyne 4a31f0375f Add \fs+ and \fs- to the ASS parser so they aren't killed by transforms. Updates #1007.
Originally committed to SVN as r3838.
2009-12-01 01:27:32 +00:00
Amar Takhar 6127a66c6e Add a customer mail message format, far more useful than the default.
Originally committed to SVN as r3837.
2009-12-01 01:13:45 +00:00
Thomas Goyne 86f64b2962 Improve video operation errors somewhat. Updates #1020.
Originally committed to SVN as r3835.
2009-12-01 00:32:43 +00:00
Karl Blomster dadd09ff49 Remove SetCacheMax() function as it is no longer used.
Originally committed to SVN as r3833.
2009-11-29 19:12:40 +00:00
Karl Blomster e38b00fb51 Update documentation according to changes in r3831.
Originally committed to SVN as r3832.
2009-11-29 19:09:55 +00:00
Karl Blomster abd2597d0f Change GetDesiredCacheSize() to WantsCaching() since video providers aren't setting number of frames to cache anymore.
Originally committed to SVN as r3831.
2009-11-29 19:07:53 +00:00
Karl Blomster ed3b47b250 document new function introduced in r3829
Originally committed to SVN as r3830.
2009-11-29 19:01:32 +00:00
Karl Blomster 6b04f5ee8f Make the caching video provider use a user-configurable max cache size in bytes instead of a hardcoded number of frames. Defaults to using 32 MB (about 10 frames at 720p) of memory for the cache.
Originally committed to SVN as r3829.
2009-11-29 18:59:21 +00:00
Amar Takhar 0c34323b5d Hopefully this is the last test.
Originally committed to SVN as r3828.
2009-11-29 14:01:57 +00:00
Amar Takhar ddcb31cfa9 How much whitespace does it take... (another test.)
Originally committed to SVN as r3827.
2009-11-29 13:31:38 +00:00
Amar Takhar 1834434b13 Another commit to test the buildbot.
Originally committed to SVN as r3826.
2009-11-29 13:27:56 +00:00
Amar Takhar 7709a5bbb4 Bunk commit to test the buildbot.
Originally committed to SVN as r3825.
2009-11-29 13:16:08 +00:00
Karl Blomster 85d645b44a Allow user to set behavior of audio decoding errors during indexing with the FFMS2 providers.
Originally committed to SVN as r3822.
2009-11-28 21:13:47 +00:00
Karl Blomster b8561bf01d Update ffms2 to r238. Fixes #1048. This version is API and ABI compatible with the previous one so no further modifications are necessary.
Originally committed to SVN as r3820.
2009-11-28 20:04:06 +00:00
Karl Blomster e720bba41c Fix a bug that would occasionally cause opening audio using the ffms2 audio provider to fail with error "out of bounds track number selected".
Originally committed to SVN as r3818.
2009-11-21 22:08:03 +00:00
Karl Blomster 653427fbad Update ffms2 to r234, part 2. Compilation fixed again.
Originally committed to SVN as r3815.
2009-11-21 21:15:02 +00:00
Karl Blomster 1f4fa82726 Update ffms2 to r234, part 1. Compilation broken in this commit.
Originally committed to SVN as r3814.
2009-11-21 21:11:41 +00:00
Niels Martin Hansen 3e52c7a592 Update #1013 with a temporary fix. Changes to wxString in wx 2.9 caused the issue, because wxString::c_string() no longer returned a wchar_t* or char* and thus those weren't caught by the proper exception handler.
This fix should be replaced with a proper exception type later.

Originally committed to SVN as r3813.
2009-11-21 13:24:12 +00:00
Niels Martin Hansen 815ad4b8ca Change 2points' entry to his real name: Moritz Brunner. Updates #894.
Originally committed to SVN as r3810.
2009-11-18 18:46:43 +00:00
Amar Takhar 9058c51968 Change p-static entry to his real name: Ravi Pinjala. updates #894.
Originally committed to SVN as r3803.
2009-11-17 05:32:33 +00:00
Amar Takhar 9a4db2b466 Use the two new macros to supply auto-detection for lua. updates #989.
Originally committed to SVN as r3802.
2009-11-17 04:47:26 +00:00
Amar Takhar 932a7777be Add two new macros (custom) to search for headers in different directories and libraries with different names. updates #989.
Originally committed to SVN as r3801.
2009-11-17 04:46:46 +00:00
Thomas Goyne 9ff7c6abbb Remove some unused locals in frame_main_events.cpp that were last used in r106.
Originally committed to SVN as r3800.
2009-11-17 02:43:43 +00:00
Thomas Goyne feb77217c7 Fix bug where detaching loaded but hidden video had broken results.
Originally committed to SVN as r3798.
2009-11-17 01:37:18 +00:00
Amar Takhar 3719227e9e Include wx/display.h last, it needs some values that aren't inited by display.h itself. I'm not sure if this is a bug as a lot of other headers seem to have this problem too. Fixes compilation errors when not using precompiled headers (which loads about 30 headers before this one.) This fixes non-PCH compilation updates #1040
Originally committed to SVN as r3794.
2009-11-15 20:53:31 +00:00
Niels Martin Hansen 3c11e2831e Missed some headers in r3774, which caused compilation errors when precompiled headers were not used. Updates #1040.
Originally committed to SVN as r3776.
2009-11-14 01:06:11 +00:00
Niels Martin Hansen 58674d1cea Make detached video display reposition itself if it opens partially or entirely out of view. Updates #1040.
Originally committed to SVN as r3774.
2009-11-14 00:42:55 +00:00
Niels Martin Hansen d6b0cdcedf Blind but most likely correct fix missing \iclip support in cleantags.lua. Updates #1044.
Originally committed to SVN as r3772.
2009-11-13 22:13:58 +00:00
Amar Takhar ab857d115c Add libffms/include/*.h to the list of sources so the headers get included, found by rofflwalffls on irc, thanks!
Originally committed to SVN as r3769.
2009-11-07 03:08:49 +00:00
Amar Takhar 78ccb785cc Fill in license information, updates #1029.
Originally committed to SVN as r3766.
2009-11-05 04:24:25 +00:00
Amar Takhar 72ddd4ba6f Remove reference to prs cpp file missed in r3748, updates #1012.
Originally committed to SVN as r3763.
2009-11-04 07:10:15 +00:00
Niels Martin Hansen 3c75547292 Make "Untitled" and "untitled" translateable, updates #792.
Originally committed to SVN as r3761.
2009-11-04 05:27:09 +00:00
Niels Martin Hansen cd4905fe34 Fix build-error in DirectSoundPlayer2 when building Debug, signedness mismatch in an assert triggers a warning that causes an error.
Originally committed to SVN as r3758.
2009-11-04 04:16:25 +00:00
Niels Martin Hansen 129585a2f8 Remove the ability for Aegisub to do its own file type associations. It's something the installer should be doing.
Originally committed to SVN as r3757.
2009-11-03 02:42:19 +00:00
Amar Takhar 88d6c783b1 Remove boost.m4 from EXTRA_DIST it was nuked a long time ago.
Originally committed to SVN as r3756.
2009-11-02 21:44:08 +00:00
harukalover 3c2997e906 Fixed a crash that would occur if the mouse was left in a captured state after closing and reopening the color picker. Updates #1025
Originally committed to SVN as r3754.
2009-11-01 07:28:09 +00:00
Niels Martin Hansen d2834dca45 Re-integrate r3740 from the 2.1.8 branch to fix the DirectSoundPlayer2 buffer locking bug.
Updates #1028.

Originally committed to SVN as r3751.
2009-10-31 00:54:42 +00:00
Amar Takhar afd9133fc0 Remove PRS support, I've left the files in devel/prs they can be deleted at a later time.. Closes #1012.
Originally committed to SVN as r3748.
2009-10-28 01:10:11 +00:00
Amar Takhar 810c0a7eb0 Add an empty config.h and remove ../src from the build. We don't want to pollute libass with our config settings.
Originally committed to SVN as r3745.
2009-10-28 00:30:42 +00:00
Amar Takhar b2649ab510 Add libass license
Originally committed to SVN as r3744.
2009-10-28 00:30:12 +00:00
Amar Takhar b587ad3b8d Add boost license.
Originally committed to SVN as r3743.
2009-10-28 00:28:36 +00:00
Thomas Goyne 15cf221a3f Fix incorrect handling of flipped video when the texture size is larger than the video size.
Originally committed to SVN as r3742.
2009-10-27 20:59:27 +00:00
Thomas Goyne dcfdb02e6c Significantly reduce the number of unnecessary calls to VideoContext::GetFrame.
Originally committed to SVN as r3739.
2009-10-27 14:27:39 +00:00
Amar Takhar 7de7dba807 Merge r3733 for jfs, fixes #977
Originally committed to SVN as r3735.
2009-10-26 23:44:16 +00:00
Amar Takhar 002a5dd980 Merge r3732 for jfs, fixes #915
Originally committed to SVN as r3734.
2009-10-26 23:37:47 +00:00
Thomas Goyne 4fc2b90399 Add support for externally controlled frame data to AegiVideoFrame, and take advantage of this in the FFMS2 video provider to eliminate a copy of the frame data. Net speedup for seeking from beginning to end of several test files is 10-20%.
Originally committed to SVN as r3729.
2009-10-24 02:07:56 +00:00
Thomas Goyne c4d07cb525 Remove AegiVideoFrame::cppAlloc, which was only needed by the dshow video provider.
Originally committed to SVN as r3728.
2009-10-21 04:29:15 +00:00
Thomas Goyne 7581d41935 Remove AegiVideoFrame::GetFloat and some related code as it was only there for fextracker.
Originally committed to SVN as r3727.
2009-10-21 04:07:00 +00:00
Thomas Goyne df5ada1006 Make the video display only upload texture data when the frame has changed rather than every time Render is called.
Originally committed to SVN as r3726.
2009-10-20 19:07:18 +00:00
Amar Takhar c72ac65d0f Fix --enable-gcov:
* Rename GCOV_FLAGS -> GCOV_CFLAGS
 * Add GCOV_LDFLAGS (default is -lgcov)

Originally committed to SVN as r3724.
2009-10-20 03:35:42 +00:00
Thomas Goyne 5404b45017 Tweak how the OpenGL 1.1 code behaves slightly; distortion with Windows 7's OpenGL emulation is now at most .1% instead of at most 2%.
Originally committed to SVN as r3723.
2009-10-19 01:11:02 +00:00
Thomas Goyne 5b9da0c56a Fix some video output bugs related to a small maximum texture size which is not an even divisor of the video size.
Originally committed to SVN as r3717.
2009-10-17 03:41:12 +00:00
Thomas Goyne 3d58608230 Improve rendering with OpenGL 1.1, removing the visible seams at the cost of slight distortions at high zoom levels.
Originally committed to SVN as r3714.
2009-10-14 20:53:36 +00:00
Thomas Goyne 9ff8f42d7f Get the video display closer to working with W7's emulated OpenGL. It can now display video, but there are visible seams between the textures.
Originally committed to SVN as r3711.
2009-10-13 22:19:31 +00:00
harukalover 59cf4b656a Removed the log window which nobody seems to use. Closes #1026
Originally committed to SVN as r3710.
2009-10-13 21:53:50 +00:00
Thomas Goyne 3032c4f883 Fix a memory leak and a minor graphical glitch that sometimes happened to the video slider when switching visual typesetting modes.
Originally committed to SVN as r3709.
2009-10-13 17:28:39 +00:00
Thomas Goyne 389f296b4d Make the video display actually hide when the detached video dialog is minimized.
Originally committed to SVN as r3706.
2009-10-13 04:10:55 +00:00
Amar Takhar ddc3b57694 How lazy can I get for not regening configure to test this change... (yes, i did this time around.) Updates #1023.
Originally committed to SVN as r3703.
2009-10-12 06:06:44 +00:00
harukalover 7dcb6cd387 Fix the annoying habit of all debug output being printed twice
Originally committed to SVN as r3701.
2009-10-12 05:11:24 +00:00
Amar Takhar 669e11d10b Remove boost check as ffms has removed the usage of boost::format. This is trunk-only for now. Updates #1023.
Originally committed to SVN as r3691.
2009-10-12 00:14:36 +00:00
Karl Blomster e3583da740 Update ffms2 to r228. Removes the boost dependency.
Originally committed to SVN as r3690.
2009-10-12 00:11:15 +00:00
Thomas Goyne 68de84b427 Fix some minor quirks with detached video and the display mode.
Originally committed to SVN as r3688.
2009-10-11 22:10:08 +00:00
Thomas Goyne 5cf7724698 Disable zoom controls when video is detached as the zoom is ignored with detached video.
Originally committed to SVN as r3676.
2009-10-10 15:21:26 +00:00
Thomas Goyne 75f010f889 Make global hotkeys work when the detached video dialog is focused.
Originally committed to SVN as r3675.
2009-10-10 15:05:17 +00:00
Thomas Goyne c0364b7be1 Remove pointless keydown handlers on things that can't have keyboard focus.
Originally committed to SVN as r3674.
2009-10-10 02:13:15 +00:00
Thomas Goyne 983434a6c3 Make the video slider forward unprocessed key events to the video display.
Originally committed to SVN as r3672.
2009-10-09 22:27:27 +00:00
harukalover 36386e74fc Fixed the jump to dialog never displaying anything but 0 in the hour column. Updates #1003.
Originally committed to SVN as r3668.
2009-10-09 19:43:43 +00:00
Amar Takhar 14e2d9ad12 Add config.h to 8 files that were missing it, _all_ source files must include config.h at the very top.
Originally committed to SVN as r3666.
2009-10-09 16:34:38 +00:00
Amar Takhar 3873c4fc4e Remove @BOOST_CPPFLAGS@ as the boost detection is now disabled.
Originally committed to SVN as r3664.
2009-10-09 16:10:59 +00:00
Amar Takhar 2623b8380f Update universalchardet to 29631:4dd0cf2ba86f (2009-06-27). Closes #866.
Originally committed to SVN as r3662.
2009-10-09 15:37:55 +00:00
Amar Takhar 61c3a3149e Remove boost check, the macro I'm using has serious bugs that only shows up on some systems.
Originally committed to SVN as r3660.
2009-10-09 15:22:06 +00:00
Amar Takhar 7a53f7dd43 Fix a const issue in JpCntx.h.
Originally committed to SVN as r3656.
2009-10-09 14:50:43 +00:00
Amar Takhar 3bea135663 Check for lua.hpp usability not lua.h, Updates #998.
Originally committed to SVN as r3654.
2009-10-09 14:43:14 +00:00
Amar Takhar 42e0dd6ce4 Update universalchardet using a patch I made around 2009-02, the one we're currently using is from ~1998. I'll check again later to see if there are any updates to it before closing the ticket. Updates #866.
Originally committed to SVN as r3653.
2009-10-09 14:30:27 +00:00
Thomas Goyne 05c9ffde7a Make detached video work again.
Originally committed to SVN as r3651.
2009-10-09 02:21:30 +00:00
Amar Takhar 85d3ea9277 Commit patch for #1019 for jfs' as he doesn't have the branch compiling locally, I'll merge this to milestone:2.1.8 after this, updates #1019.
Originally committed to SVN as r3644.
2009-10-08 20:24:25 +00:00
Amar Takhar df259693d9 Add a check for boost which is now required by ffms.. this should be backported to 2.1.8.
Originally committed to SVN as r3639.
2009-10-07 01:34:47 +00:00
Thomas Goyne 37ec7ad62c Increase the maximum zoom to 300%.
Originally committed to SVN as r3634.
2009-10-06 17:43:15 +00:00
Thomas Goyne 1f27582b50 Remove some members of VideoContext that are no longer used with the rewritten video display.
Originally committed to SVN as r3633.
2009-10-06 16:19:36 +00:00
Thomas Goyne bead7360c4 Delete threaded video mode, as it never worked in the first place and is fundamentally flawed.
Originally committed to SVN as r3632.
2009-10-06 16:12:23 +00:00
Amar Takhar 9217476357 Bitten by precompiled headers round 2: the OpenGL headers must be included before the local headers.
Originally committed to SVN as r3631.
2009-10-06 16:08:39 +00:00
Amar Takhar ac260ec47b Sigh, bitten by precompiled headers, wxLogDebug requires <wx/log.h>.
Originally committed to SVN as r3630.
2009-10-06 15:47:43 +00:00
Amar Takhar c204c766ec Add two more debug printfs:
* Print the WxH of the frame size.
 * Print the size of the texture actually used.

Originally committed to SVN as r3629.
2009-10-06 15:28:22 +00:00
Amar Takhar bb4506354f Add a debug printf to display what texture sizes VideoOutGL::TestTexture is checking.
Originally committed to SVN as r3628.
2009-10-06 14:58:32 +00:00
Amar Takhar 21c5e7909c svn:eol-style native and svn:keywords Id to relevent files.
Originally committed to SVN as r3623.
2009-10-05 23:04:30 +00:00
Amar Takhar 4cc6610161 Commit jfs' patch to fix rounding errors as he doesn't have trunk going at the moment. Closes #1018.
Originally committed to SVN as r3622.
2009-10-05 22:46:28 +00:00
Amar Takhar 6364e127f6 Remove 10.5 SDK from cflags, this path was just a copy-and-paste-o from the osx (10.5/x86) factory.
Originally committed to SVN as r3621.
2009-10-05 22:12:13 +00:00
Thomas Goyne 40987da11a Fix spelling of video_out_gl.cpp.
Originally committed to SVN as r3620.
2009-10-05 21:32:44 +00:00
Thomas Goyne e7465e7519 More reporter tweaks to make it actually build and run on Windows.
Originally committed to SVN as r3619.
2009-10-05 21:02:02 +00:00
Thomas Goyne d677b85b66 Add required stubs for OpenGL info to the windows platform stub.
Originally committed to SVN as r3618.
2009-10-05 20:55:13 +00:00
Thomas Goyne 404e6cf081 Add support for flipped video to new video renderer.
Originally committed to SVN as r3617.
2009-10-05 20:50:04 +00:00
Amar Takhar c9bc025bb2 Add a ',' so --enable-debug and --prefix don't get mashed together, this was stopping ppc builds from being debug (annoying).
Originally committed to SVN as r3616.
2009-10-05 16:54:30 +00:00
Thomas Goyne cbd76e7010 Rewrite the video rendering code to support displaying videos which are larger than the maximum texture size. This does not currently support YV12 (which Aegisub currently never uses), but should be otherwise functional.
Originally committed to SVN as r3615.
2009-10-05 04:22:28 +00:00
Thomas Goyne 39954493c0 Add platform_windows.h and .cpp to the project.
Originally committed to SVN as r3614.
2009-10-05 02:43:14 +00:00
Thomas Goyne df58224b55 Add #pragma once to exception.h.
Originally committed to SVN as r3613.
2009-10-05 00:06:11 +00:00
Amar Takhar 0cecf3c598 Add a stub class for Windows.. whoever fills this in should take over the license.
Originally committed to SVN as r3612.
2009-10-03 17:45:34 +00:00
Amar Takhar 41f39f65d7 Fix locale dir under windows, I forgot to change it after copying and pasting some code from aegisub.
Originally committed to SVN as r3611.
2009-10-03 17:37:09 +00:00
Thomas Goyne e1469154ea Create vcproj for reporter and make it build (but not be very useful) on windows.
Originally committed to SVN as r3610.
2009-10-03 17:16:52 +00:00
Thomas Goyne d54ddc688b Make font_file_lister.cpp build on windows when freetype2 is disabled (broken by r3536).
Originally committed to SVN as r3609.
2009-10-02 23:15:31 +00:00
Thomas Goyne 6f38989076 Remove some files from the iconv project that we shouldn't have been building.
Originally committed to SVN as r3608.
2009-10-02 22:02:00 +00:00
Grigori Goronzy b0810a7663 Wrap() after SetFont() and don't SetMinSize() to a fixed size to calculate
reporter window dimensions correctly.

Originally committed to SVN as r3603.
2009-09-29 11:56:43 +00:00
Amar Takhar c3fe549d4d Place the OpenGL info strings into their own block. OS X reports these as completely different strings it was co-incidence that the actual vendor/card info is there on FreeBSD/Linux. It's likely other operating systems (eg. Windows) does the same thing as OS X. Eventually I'll re-add vendor information for the actual card once I figure out a way to get it on BSD/OS X.
Originally committed to SVN as r3601.
2009-09-28 08:08:16 +00:00
Amar Takhar 84e17451f9 Fill in most of the hardware fields for MAC.
Originally committed to SVN as r3600.
2009-09-28 05:16:36 +00:00
Amar Takhar b7caa012da Add list of available OpenGL extensions.
Originally committed to SVN as r3598.
2009-09-27 13:26:23 +00:00
Amar Takhar c821a7e172 * Fix commandline support, I have no idea what the !OnInit block was after OnInit(), I removed it and everthing works as expected.
* Add -x switch for dumping the report to report.xml

Unfortunatly this causes a flicker of the reporter as we need to create the main frame in order to gather some desktop metrics.

Originally committed to SVN as r3597.
2009-09-27 11:30:29 +00:00
Amar Takhar 38d5f06821 * Move VideoInfo under private:
* Add doxygen docs for GetVideoInfo().

Originally committed to SVN as r3595.
2009-09-27 09:58:13 +00:00
Amar Takhar b2a7247d01 Switch GetVideoInfo to use an enum and return a single value rather than use private member variables. There are a few reasons for this:
* Over time too many private member variables will be hard to look at.
 * Speed isn't a concern, but code managability is.
 * I opted to create a custom enum rather than use GLenum to avoid polluting platform.h with OpenGL headers.

Originally committed to SVN as r3594.
2009-09-27 09:50:04 +00:00
Amar Takhar c32899df9a * Remove Video entry as duplicates what's now under Display.
* Remove unessicary 'Video ' before renderer/version/vendor entries.
 * Put entries under Hardware->Display and bump them to the top of the list.

Originally committed to SVN as r3593.
2009-09-27 09:27:44 +00:00
Grigori Goronzy 400365d831 Move OpenGL code down into Platform as it's portable now
Originally committed to SVN as r3592.
2009-09-27 04:15:41 +00:00
Grigori Goronzy e0b36fdaff Use wxGL to make OpenGL usage portable
Originally committed to SVN as r3591.
2009-09-27 03:12:17 +00:00
Grigori Goronzy 9230d5360a Fix breakage due to OS X support, introduced by one of the last commits
Originally committed to SVN as r3590.
2009-09-27 02:18:09 +00:00
Grigori Goronzy d64f10faa9 Split up video into vendor/renderer/version and acquire video
adapter info via OpenGL/GLX on Unix.

Originally committed to SVN as r3589.
2009-09-27 02:18:05 +00:00
Amar Takhar eaf3353982 Fix location of config.dat on OSX.
Originally committed to SVN as r3588.
2009-09-27 01:53:42 +00:00
Amar Takhar 6a792f0635 Add support for OSX to the reporter, the base is from the BSD version which works seamlessly with the exception of different sysctl names. (not updated)
Originally committed to SVN as r3587.
2009-09-27 01:47:11 +00:00
Amar Takhar e0d4dde970 Remove the actual files as well.
Originally committed to SVN as r3586.
2009-09-27 01:28:36 +00:00
Amar Takhar 877f908064 Remove the haali* files that were unintentionally introduced in r3575, they're windows-only.
Originally committed to SVN as r3585.
2009-09-27 01:26:34 +00:00
Grigori Goronzy 4d422b1997 Minor fixes to the reporter Linux support
* drop BSD-specific includes
* document CPU cores/count vs. logical CPU count
* close files properly
* return memory size in bytes

Originally committed to SVN as r3584.
2009-09-27 01:20:29 +00:00
Grigori Goronzy 6ce51f9435 Add a forward declaration which is apparently needed with certain gcc
versions

Originally committed to SVN as r3583.
2009-09-27 01:20:12 +00:00
Karl Blomster 6490c82e79 Change the way ffms2 index cache files are named to use source filename (without path) + source file's size in bytes + source file modification time, instead of just source file path + size in bytes, in order to make reusing index cache files on other computers easier. Closes #1008.
Originally committed to SVN as r3582.
2009-09-27 00:32:19 +00:00
Amar Takhar ab269aac37 Set proper defines for the reporter.
Originally committed to SVN as r3581.
2009-09-27 00:23:32 +00:00
Karl Blomster 5217854199 Update ffms2 to r222. Fixes compilation with ancient ffmpeg's and is a better solution than verm's hack in r3578.
Originally committed to SVN as r3580.
2009-09-26 23:54:26 +00:00
Amar Takhar 16f5d0aea6 Make sure the reporter is built and installed as reporter-2.2.
Originally committed to SVN as r3579.
2009-09-26 23:09:39 +00:00
Amar Takhar cf8b0ae97c Comment out a couple of lines in src/core/matroskavideo.cpp and src/core/lavfvideo.cpp to get aegisub building again, thefluff is working on a proper fix.
Originally committed to SVN as r3578.
2009-09-26 23:05:47 +00:00
Amar Takhar 8802e0ba3d Remove -I../src from ffms, it hasn't been needed for a very long time.
Originally committed to SVN as r3577.
2009-09-26 22:58:56 +00:00
Karl Blomster 9d80eb066f Updating ffms2 to r221 (2.12), step 3/3: Aegisub interface
Originally committed to SVN as r3576.
2009-09-26 21:58:00 +00:00
Karl Blomster 6e39199cb4 Updating ffms2 to r221 (2.12), step 2/3: makefile
Originally committed to SVN as r3575.
2009-09-26 21:56:39 +00:00
Karl Blomster 6fe92bce72 Updating ffms2 to r221 (2.12), step 1/3: sources
Originally committed to SVN as r3574.
2009-09-26 21:56:15 +00:00
Amar Takhar 8322981b47 Use wxString in lieu of std::string to stop confusion on OSX, also makes more sense..
Originally committed to SVN as r3573.
2009-09-26 21:12:15 +00:00
Amar Takhar 56ff7c2133 Fix tab alignment.
Originally committed to SVN as r3572.
2009-09-26 20:31:28 +00:00
Amar Takhar 3ba3955e2f Fix doxygen markup in platform_unix_linux.cpp.
Originally committed to SVN as r3571.
2009-09-26 20:29:25 +00:00
Amar Takhar 71065e6f66 Clarify what Features2 can be.
Originally committed to SVN as r3570.
2009-09-26 20:19:36 +00:00
Amar Takhar e9c5762cf7 Remove unused header.
Originally committed to SVN as r3568.
2009-09-26 20:08:52 +00:00
Amar Takhar db35bacceb Use elif instead of nested ifdefs.
Originally committed to SVN as r3567.
2009-09-26 20:05:54 +00:00
Amar Takhar ecc15a9935 Add the reporter subdir to Makefile.am so it gets built.
Originally committed to SVN as r3565.
2009-09-26 20:00:34 +00:00
Amar Takhar e13ca226fb Document the platform class and fix doxygen markup.
Originally committed to SVN as r3564.
2009-09-26 19:59:24 +00:00
Niels Martin Hansen 9104079dab Uncomment stuff to close #716.
Originally committed to SVN as r3563.
2009-09-26 19:44:41 +00:00
Grigori Goronzy a299f79515 Basic Linux support for the reporter.
Gather basic CPU and memory information by parsing /proc/cpuinfo and
/proc/meminfo.

Originally committed to SVN as r3562.
2009-09-26 16:44:36 +00:00
Grigori Goronzy ce6cdd77ce Fix reporter compilation without precompiled headers
Originally committed to SVN as r3561.
2009-09-26 14:53:27 +00:00
Amar Takhar 4f01dab280 Add dynamic build support for *bsd and linux.
Originally committed to SVN as r3560.
2009-09-26 14:50:24 +00:00
Amar Takhar c7bbf95c9b Add quotes around PROJECT_NAME so the space doesn't get swallowed.
Originally committed to SVN as r3559.
2009-09-26 09:40:49 +00:00
Amar Takhar c98fe933a4 Add @ingroup tags and another doxygen comment.
Originally committed to SVN as r3558.
2009-09-26 09:38:17 +00:00
Amar Takhar 16a6616da7 Fix misnaming of a group (s/Unix/unix/)
Originally committed to SVN as r3557.
2009-09-26 09:31:08 +00:00
Amar Takhar 6c0e38b868 Fix a whole bunch of doxygen markup errors. Also add missing docs.
Originally committed to SVN as r3555.
2009-09-26 09:22:54 +00:00
Amar Takhar 3d08e60f5b Fix main index.
Originally committed to SVN as r3554.
2009-09-26 09:19:12 +00:00
Amar Takhar 9df3ce3cee SRC_PWD needs to be set before TRIM.
Originally committed to SVN as r3553.
2009-09-26 08:57:26 +00:00
Amar Takhar ad1a11b5a0 s/done/(aegisub|reporter)/ for clarity.
Originally committed to SVN as r3552.
2009-09-26 08:52:01 +00:00
Amar Takhar fd645ebec4 Sigh, add two missing commas.
Originally committed to SVN as r3551.
2009-09-26 08:47:14 +00:00
Amar Takhar 90da141dd4 Support split projects.
Originally committed to SVN as r3550.
2009-09-26 08:45:19 +00:00
Amar Takhar 3bc81569b3 Split doxygen generating into two steps (reporter and aegisub). This should be made triggerable so only aegisub/reporter docs are generated if sources are not touched in one or the other..
Originally committed to SVN as r3549.
2009-09-26 08:44:32 +00:00
Amar Takhar cda9ac3c3b Split doxygen generation into two parts, one for aegisub and another for the reporter.
Originally committed to SVN as r3548.
2009-09-26 08:37:12 +00:00
Amar Takhar dcca1694ce * Follow aegisub and rename wx_pre.h to r_pre.h
* Sort headers.
 * Include missing c/c++ std headers into r_pre.h

Originally committed to SVN as r3547.
2009-09-21 04:53:51 +00:00
Karl Blomster fcd8f4e04e Throw an error instead of crashing if user attempts to load audio with bitdepth >16bits/sample. Updates #996.
Originally committed to SVN as r3545.
2009-09-21 01:52:34 +00:00
Karl Blomster 3edb446bec Fix (?) a bug that caused VFR transformation export to be broken, which also affected certain video providers when external timecodes were used.
Originally committed to SVN as r3542.
2009-09-20 20:45:54 +00:00
Karl Blomster 57d549f538 unbreak the y4m provider
Originally committed to SVN as r3541.
2009-09-19 21:34:40 +00:00
Karl Blomster 7ba66342b0 silence a MSVC warning
Originally committed to SVN as r3540.
2009-09-19 20:15:59 +00:00
Amar Takhar fa9c8c17f8 Remove 35 of the 39 pragma once added in r3538. I didn't realise so many would be not required. This patch isn't tested on windows, I'll fix it after the buildbot takes a run at it.
Originally committed to SVN as r3539.
2009-09-18 03:01:51 +00:00
Amar Takhar 11e1935d76 Remove include guards in favour of '#pragma once'. Normally I would use an include guard however #pragama once is easier to spot and we already used it in mst of our files, this is for the sake of consistency until they're removed.
Originally committed to SVN as r3538.
2009-09-18 02:48:31 +00:00
Amar Takhar aea050fbee I have no idea how or why this change got in, but fix a license line wrap.
Originally committed to SVN as r3537.
2009-09-16 12:19:52 +00:00
Amar Takhar aba73d4308 Remove 'pragma once' from colour_button.h font_file_lister.h gl_wrap.h subs_edit_ctrl.h.
Originally committed to SVN as r3536.
2009-09-16 12:18:09 +00:00
Amar Takhar 130e840028 I thought subtitles_provider.h was in src/ I didn't realise it was an include when trying to revert it. Of course I'd have noticed that beforehand if I was paying attention to what svn told me. This should have been in r3533.
Originally committed to SVN as r3535.
2009-09-11 19:21:19 +00:00
Amar Takhar f41123aad4 Wrap shlobj.h with WIN32 again, it got removed in a previous commit.
Originally committed to SVN as r3534.
2009-09-11 18:55:33 +00:00
Amar Takhar 8504b4790d Remove '#pragma once' from 84 files that don't need it. Thanks to Plorkyeran for testing this on windows. The next step is to detangle the remaining files that currently require it.
Originally committed to SVN as r3533.
2009-09-11 18:51:48 +00:00
Amar Takhar a874981ed7 ass_entry.h actually does need include/aegisub/exception.h, didn't notice because of precompiled headers.
Originally committed to SVN as r3532.
2009-09-11 05:04:05 +00:00
Amar Takhar ca01bb2b86 Add an include guard in agi_pre.h, for whatever reason GCC likes to include the precompiled header twice. I've added a note that this needs to be looked at eventually.
Originally committed to SVN as r3531.
2009-09-11 04:35:45 +00:00
Amar Takhar b0df329ce9 Remove un-needed inclusion of include/aegisub/exception.h
Originally committed to SVN as r3530.
2009-09-11 04:35:11 +00:00
Amar Takhar b116610d12 Add missing headers that are in agi_pre.h but not the actual header, should fix the non-precompiled header build.
Originally committed to SVN as r3529.
2009-09-11 02:59:48 +00:00
Niels Martin Hansen 42a293ccca As <aegisub/exception.h> should become widely used soon enough, add it to the precompiled headers.
Protect <omp.h> from inclusion on compilers that don't support OpenMP.

Originally committed to SVN as r3528.
2009-09-11 02:49:58 +00:00
Niels Martin Hansen d1c70ef6d2 Protect agi_pre.h from double inclusion during PCH generation in MSVC.
Originally committed to SVN as r3527.
2009-09-11 02:47:14 +00:00
Niels Martin Hansen a3bf534b5e Fixes for internal logical consistency of exception.h. (Make sure we can actually support inner exceptions in all cases.)
Also make it follow the AGI_PRE pattern.

Originally committed to SVN as r3526.
2009-09-11 02:46:01 +00:00
Amar Takhar 774fb0f674 Fix all the headers in *., this includes:
* Wrapping all headers that are in agi_pre.h with AGI_PRE.
  * Sorting alphabetically.
  * Same operation as r3515.

Note: This is broken when precompiled headers are not in use, I'll fix that after this commit so the two changes don't get jumbled up.

Originally committed to SVN as r3525.
2009-09-11 02:36:34 +00:00
Amar Takhar 8eda8f2a9c Add <wx/arrstr.h> which was accidentally left out when moving the patch from one machine to the other in r3518.
Originally committed to SVN as r3524.
2009-09-11 02:30:10 +00:00
Amar Takhar e4271d6aac Add missing <fstream> header, this should fix compilation on unix/osx.
Originally committed to SVN as r3521.
2009-09-11 01:07:38 +00:00
Grigori Goronzy b017d60e39 Forward declaration for AutoloadScriptManager too
Seems to work without it for others, but I have no idea why. This
shouldn't harm in this case still.

Originally committed to SVN as r3520.
2009-09-10 23:28:15 +00:00
Niels Martin Hansen 6cc37d3f0b A bit more cleaning of precompiled headers for Windows builds. Comment on why things are done as they are. Also move a few headers only used in single files out of the precompiled header and into the places they're actually used.
Originally committed to SVN as r3519.
2009-09-10 23:08:38 +00:00
Amar Takhar 88276ed1f4 * Move some headers below the rest as they need wx settings that don't seem to be inited when the header is first in the list.
* Add some missing headers and reposition one from the file to header.
 * Revert r3516 as it's no longer needed.

Originally committed to SVN as r3518.
2009-09-10 22:48:29 +00:00
Niels Martin Hansen 1d80d6514b Juggle include order in agi_pre.h around a bit to make things work properly on Windows.
Originally committed to SVN as r3517.
2009-09-10 14:39:39 +00:00
Amar Takhar d455a61732 Set wxUSE_CHOICEDLG to 1, I don't know why this is required I'll look at it later.
Originally committed to SVN as r3516.
2009-09-10 13:43:31 +00:00
Amar Takhar d348b4e33e Fix all the headers in *.cpp, this includes:
* Wrapping all headers that are in agi_pre.h with AGI_PRE.
 * Sorting alphabetically.

Originally committed to SVN as r3515.
2009-09-10 13:06:40 +00:00
Amar Takhar 79397825cf Add missing wx/log.h, sort headers.
Originally committed to SVN as r3514.
2009-09-10 10:51:49 +00:00
Amar Takhar 7a8c5229fd * Remove wxprec.h from all files other than agi_pre.h. Including this in various headers is useless as it includes wx.h which includes dozens of 'common' wx headers. With this we're unable to tell which files rely on which interfaces. This commit removes them and manually places in required headers as-needed.
* Update agi_pre.h to include some missing headers, also move required windowsheaders to the top of the list
 * Use <> versus "" for the wx header in avisynth_wrap.cpp
 * Remove xx/wx.h from agi_pre.h as it's included by wxprec.h.

Originally committed to SVN as r3513.
2009-09-10 10:26:50 +00:00
Amar Takhar 84996c927f Add a whole slew of missing includes, prior to r3509 config_unix.h used to include stdwx.h, now that I'm fixing the headers I removed it which caused issues when not using precompiled headers.
Originally committed to SVN as r3512.
2009-09-10 05:25:25 +00:00
Amar Takhar 6a7e4769e3 Add several dozen more headers to agi_pre.h
Originally committed to SVN as r3510.
2009-09-10 04:29:04 +00:00
Amar Takhar 05ae13a8ab * Rename stdwx.h to agi_pre.h as it doesn't include wx headers only, it's confusing.
* Rename include guard to AGI_PRE.

Originally committed to SVN as r3509.
2009-09-10 04:14:28 +00:00
Thomas Goyne 132d8ba3ac Move #include "config.h" to before #define WX_PRE so that it does gets included at some point.
Originally committed to SVN as r3508.
2009-09-10 03:14:09 +00:00
Thomas Goyne e0cc5fc038 Wrap wx includes with _CRT_SECURE_NO_WARNINGS to make msvc stop hurfing and durfing.
Originally committed to SVN as r3507.
2009-09-10 02:52:34 +00:00
Amar Takhar bdbb8cc4ce Wrap config.h with WX_PRE so it doesn't get included twice. stdwx.h requires it to be included.
Originally committed to SVN as r3506.
2009-09-10 02:42:06 +00:00
Amar Takhar 3c1b52eb69 Add 79 missing wx includes to stdwx.h, the build is much faster on unix, should be the same for windows.
Originally committed to SVN as r3505.
2009-09-10 02:32:55 +00:00
Amar Takhar deeec2de18 Re-organise stdwx.h and sort alphabetically.
Originally committed to SVN as r3504.
2009-09-10 02:27:25 +00:00
Amar Takhar 925fa88c0c * Remove #pragma once.
* Sort wx headers and wrap with #ifndef WX_PRE.
 * Add missing heade rto stdwx.h.
M    src/ass_attachment.h
M    src/subs_grid.cpp
M    src/ass_dialogue.cpp
M    src/ass_attachment.cpp
M    src/aegisub_endian.h
M    src/audio_display.cpp
M    src/audio_karaoke.cpp
M    src/dialog_kara_timing_copy.cpp
M    src/ass_dialogue.h
M    src/text_file_writer.cpp
M    src/stdwx.h

Originally committed to SVN as r3503.
2009-09-10 02:23:43 +00:00
Amar Takhar d519f4589d * Remove main.h from files that don't require it.
* Remove include guard in main.h as it's no longer required.
 * Sort wx headers and wrap with #ifndef WX_PRE.
 * Add #define WX_PRE to stdwx.h.

Originally committed to SVN as r3502.
2009-09-10 02:07:55 +00:00
Thomas Goyne 1a4e7375fd Add some documentation to VideoDisplay and clean up the includes a bit.
Originally committed to SVN as r3501.
2009-09-10 01:41:34 +00:00
Grigori Goronzy a4f844c048 Fix another typo in the German translation, patch by basti2k.
Originally committed to SVN as r3500.
2009-09-09 12:25:03 +00:00
Amar Takhar 0992a68488 Rewrite how wxStackWalker works:
* Change from fstream to wxFile.
 * Create both text-based and xml based reports (for the reporter)

Originally committed to SVN as r3499.
2009-09-09 07:04:10 +00:00
Grigori Goronzy 5ab1eab906 OSS player: handle changing end position correctly
If the slider is moved to the playbar while the player is running,
the playback needs to be stopped.  Handle this situation properly.

Additionally, select a low-latency buffer policy if possible (OSS4
only).  This will make it possible to move the slide near the playbar
without stopping playback (the current writing position is always in
advance of the playback position by the buffer size!)

Originally committed to SVN as r3498.
2009-09-09 03:24:34 +00:00
Grigori Goronzy 9d0daf6821 Add OSS audio player
Tested on OSS4 (4front), FreeBSD 7.2 OSS and with ALSA's OSS emulation.
Bear with me, this is both my first serious C++ and OSS code.

Originally committed to SVN as r3497.
2009-09-08 22:06:07 +00:00
Amar Takhar b258daa120 Add the new icons + new source paths to EXTRA_DIST, it was still set to the XPMs.
Originally committed to SVN as r3496.
2009-09-06 02:39:32 +00:00
Amar Takhar a5730828d3 Remove __APPLE__ around SetBitmap() in AppendBitmapMenuItem, this gives us pretty icons in our menus on osx.
Originally committed to SVN as r3495.
2009-09-06 00:41:38 +00:00
Amar Takhar ba87160fdc Linux needs a specific wx-config path too for 2.9, this should fix ubuntu, debian is still broken.
Originally committed to SVN as r3494.
2009-09-06 00:01:06 +00:00
Amar Takhar ea5bdad036 Set path to correct wx-config, this shouild fix disting on freebsd.
Originally committed to SVN as r3493.
2009-09-05 23:58:25 +00:00
Amar Takhar 6c08c50d92 Revert 3489 the issue is more complex than I originally thought. Updates #1009.
Originally committed to SVN as r3490.
2009-09-05 20:19:13 +00:00
Amar Takhar 7bbf2e6ce8 * Add a check and warnming message if X_CFLAGS / X_LIBS isn't set (and a note that you need Imake)
* Remove two lines that have been commented for a year
 * Fix some error message wording.

Originally committed to SVN as r3489.
2009-09-05 19:53:18 +00:00
Amar Takhar c89dcae7fc Don't attempt to draw a NULL bitmap, OSX doesn't like this. (i'd gather that none of the other platforms do either but on osx it causes a crash.
Originally committed to SVN as r3488.
2009-09-05 04:06:38 +00:00
Amar Takhar 53b3f8468c Remove old MacRegisterDefaultTypeAndCreator that no longer wxist in wxCocoa. Add a note about how this is handled on unix and a todo item for fixing this on OSX.
Originally committed to SVN as r3487.
2009-09-05 03:56:45 +00:00
Amar Takhar 441e10c71f Switch the mac buildslaves to use wxCocoa from wxMac (carbon).
Originally committed to SVN as r3486.
2009-09-05 02:38:27 +00:00
Amar Takhar e545c96dc8 OSX doesn't like it when combo boxes are empty, so init styles to "Default" and actor to "Actor".
Originally committed to SVN as r3485.
2009-09-05 02:24:52 +00:00
Amar Takhar 2d96c5bf4b Remove a bunch of __WXMAC__ entries that are no longer required.
* Options uses a TreeBook like every other platform
 * Browse button now works in osx
 * wxGLCanvas is now the same as windows/unix

Originally committed to SVN as r3484.
2009-09-05 01:16:23 +00:00
Amar Takhar 878f451d72 Remove an old hack required for wx2.8, this is no longer required for 2.9. Closes #850.
Originally committed to SVN as r3483.
2009-09-04 05:12:49 +00:00
Amar Takhar c494b694a0 Disable setting of .DS_Store for now.
Originally committed to SVN as r3482.
2009-09-04 02:38:30 +00:00
Amar Takhar 99f421bf73 Set the .DS_Store file in the temp dmg directory rather than after it's mounted. jfs reported finder crashing after updating to 10.5.8. Setting it this way should work and avoid the issue of .DS_Store changing randomly as a folder won't show up on the desktop like a mounted image will.
Originally committed to SVN as r3481.
2009-09-04 02:16:39 +00:00
Amar Takhar 5a12ee807b Whoops, remove one last evil #pragma once that was left in while developing.
Originally committed to SVN as r3480.
2009-09-03 07:18:43 +00:00
Amar Takhar ccf71021af Sort the name map.
Originally committed to SVN as r3478.
2009-09-03 07:12:48 +00:00
Amar Takhar ad542ab8fc Drop the curl version from 7.19.2 to 7.18.2 beacuse debian/ubuntu have ancient versions installed.
Originally committed to SVN as r3477.
2009-09-03 07:10:57 +00:00
Amar Takhar 930f593d6a dd the beginings of the Aegisub Reporter, this is my first C++ program from scratch. (yes, that's a disclaimer)
What's left to be done:
  * Crash support. (only works for 'reports')
  * UI cleanups.
  * Interfacing with Aegisub to get proper metrics.
  * OSX support.
  * Windows support. (someone else will have to do this)
  * Server-side code.

There's probably a lot of other things I'm forgetting, anyone is free to commit to this, if you want to make major changes let me know beforehand.

Originally committed to SVN as r3475.
2009-09-03 06:53:55 +00:00
Amar Takhar 1155d1bcf8 wxUSE_STACKWALKER is defined to 0/1, so #ifdef doesn't work. (noticed by plork)
Originally committed to SVN as r3474.
2009-09-03 06:03:38 +00:00
Amar Takhar 95812a6c79 Mark DecodePathMaybeRelative as depreciated this is a legacy function that's a pain and no longer required for 2.2 it needs to be removed eventually.
Originally committed to SVN as r3473.
2009-09-03 05:27:49 +00:00
Amar Takhar 78b0765608 Vastly simplify saving of backup .ass files when crashing.
* Remove "Autorecovery path" option, this should not be user configurable.
 * Crashes are now saved as recovered/YYYY-MM-DD-HHMMSS_<name>.ass (no pruning)

Originally committed to SVN as r3472.
2009-09-03 05:27:11 +00:00
Amar Takhar 01df6ba169 Remove the dual exception messages and strip it down to 1 short one, removing all references to crashlog.txt.
Originally committed to SVN as r3471.
2009-09-02 20:46:15 +00:00
Amar Takhar bf275da4de Revert r3462, this is the same issue as described in r3466. Someone on windows will need to sort this out.
Originally committed to SVN as r3470.
2009-09-02 11:03:52 +00:00
Amar Takhar 65d2eda681 Silence warnings in MatroskaParser.c
Originally committed to SVN as r3469.
2009-09-02 10:06:25 +00:00
Amar Takhar 4aa6975a8d Whoops, I mis-placed the parentheses in r3458.
Originally committed to SVN as r3468.
2009-09-02 10:04:36 +00:00
Amar Takhar 46c824442b Remove useless typedef
Originally committed to SVN as r3467.
2009-09-02 10:04:03 +00:00
Amar Takhar e1a23412ac Revert r3461.. on unix iconv requires const char**, however for whatever reason msvc is complaining it can't convert it to char**. I have no idea why someone on windows will have to debug it.
Originally committed to SVN as r3466.
2009-09-02 09:40:52 +00:00
Amar Takhar 430286cf69 Silence warnings for the pulseaudio player.
Originally committed to SVN as r3465.
2009-09-02 09:00:03 +00:00
Amar Takhar 3aa7424998 Sprinkle const to remove warnings, add {} behind a while loop.
Originally committed to SVN as r3464.
2009-09-02 08:48:07 +00:00
Amar Takhar 7237e44291 Switch from long to wxCoord to remove warnings.
Originally committed to SVN as r3463.
2009-09-02 08:45:09 +00:00
Amar Takhar 256671d666 Add (const char**) cast to inptr in iconv to silence warning.
Originally committed to SVN as r3462.
2009-09-02 08:41:29 +00:00
Amar Takhar a02a63c4e5 Sprinkle const to remove warnings.
Originally committed to SVN as r3461.
2009-09-02 08:31:58 +00:00
Amar Takhar 89284f5a1c Sprinkle const to remove warnings.
Originally committed to SVN as r3460.
2009-09-02 08:28:30 +00:00
Amar Takhar 2bd2b7f3a3 Add empty {}'s after while statements to silence warnings (and for safety!
Originally committed to SVN as r3459.
2009-09-02 08:26:52 +00:00
Amar Takhar a16c8ed838 Add parentheses to silence warning. (and for clarity)
Originally committed to SVN as r3458.
2009-09-02 08:23:18 +00:00
Amar Takhar 24c7ceb0ab Add parentheses to silence warning. (and for clarity)
Originally committed to SVN as r3457.
2009-09-02 08:21:09 +00:00
Amar Takhar aacc50702f Add empty {}'s after while statements to silence warnings (and for safety!
Originally committed to SVN as r3456.
2009-09-02 08:19:24 +00:00
Amar Takhar 586f2297fc Add const to langs[] to silence warnings.
Originally committed to SVN as r3455.
2009-09-02 08:18:11 +00:00
Amar Takhar eceb72d95e Add (const char*) to silence warning to strcmp.
Originally committed to SVN as r3454.
2009-09-02 08:10:59 +00:00
Amar Takhar eb807fea3d Add (char *) before string constant to silence warning. to ass_read_memory.
Originally committed to SVN as r3453.
2009-09-02 08:06:51 +00:00
Amar Takhar 77e2eaef04 Comment two unused variables to silence warnings.
Originally committed to SVN as r3452.
2009-09-02 08:04:45 +00:00
Amar Takhar aef7375ddb * Add a new define WITH_EXCEPTIONS to allow exception handling to be forced on when in debug mode.
* Add --enable-debug-exceptions to set WITH_EXCEPTIONS.
 * Fix precompiled header msg using AC_RESULT. (forgot this in the original patch)

Originally committed to SVN as r3451.
2009-09-02 07:59:17 +00:00
Amar Takhar 1af100f284 Supplant ${HOME} with /home/verm, I forgot that the buildslaves run with an extremely limited env. This isn't a perm solution but it'll get us building for now.
Originally committed to SVN as r3450.
2009-09-02 05:01:54 +00:00
Amar Takhar ec28310df9 Sort ass_parse.c into the alphabet. (like the rest)
Originally committed to SVN as r3449.
2009-09-02 04:01:20 +00:00
Grigori Goronzy 6ccb1a5516 Fix inline function prototypes in libass.
Originally committed to SVN as r3448.
2009-09-02 03:29:35 +00:00
Grigori Goronzy a9b80dea4c Update libass and adjust to API changes.
Update the internal libass copy to git commit cf7c6e4c and fix the
libass provider; libass types were renamed.

Originally committed to SVN as r3446.
2009-09-02 01:23:51 +00:00
Grigori Goronzy f263c0f599 Fix lots of spelling and grammar errors in the German translation
(and some blatantly obvious mistranslations).

Originally committed to SVN as r3445.
2009-09-02 01:23:46 +00:00
Niels Martin Hansen 64c642c142 Revert r3431, it breaks the clipboard on Windows and is in fact also incorrect usage of the primary selection in X11 context. (I have never heard of anyone claiming clipboard usage not working on X11 before.)
This comment is in `include/wx/clipbrd.h`:
{{{
    // this allows to choose whether we work with CLIPBOARD (default) or
    // PRIMARY selection on X11-based systems
    //
    // on the other ones, working with primary selection does nothing: this
    // allows to write code which sets the primary selection when something is
    // selected without any ill effects (i.e. without overwriting the
    // clipboard which would be wrong on the platforms without X11 PRIMARY)
}}}
Note that it says that primary selection enabled causes the clipboard to do nothing on platforms that have no concept of primary selection, such as Windows and Mac.

On X11 the primary selection should only reflect an active selection of text (or similar) that the user has performed, and the contents of the primary selection buffer will essentially change all the time as the user changes selection. When the user chooses to explicitly copy something to the clipboard (as is the case with Aegisub, the only operation supported by us currently) the data is placed in a less ephemeral buffer which is the actual clipboard, separate from the primary selection, allowing the user to change the primary selection further without affecting the clipboard.

Originally committed to SVN as r3443.
2009-08-28 21:45:01 +00:00
Niels Martin Hansen b1225cdd1f Correct a use of wx event handling, which should also make FrameMain not require friend access to AudioDisplay.
Originally committed to SVN as r3442.
2009-08-28 21:15:39 +00:00
Amar Takhar 28a79d49ac Whoops, I nuked the reference counter initilisation by accident. in r3440.
Originally committed to SVN as r3441.
2009-08-25 05:31:20 +00:00
Amar Takhar 3eff6459cb * Clean up doxygen comments.
* Fix spacing between blocks.
 * Add some debugging info.

Originally committed to SVN as r3440.
2009-08-25 05:17:07 +00:00
Amar Takhar e0f84274b0 Add the languages button that was missed in r3437.
Originally committed to SVN as r3439.
2009-08-22 03:59:09 +00:00
Amar Takhar 3de6c63ddd Reformat the 'Enter aspect ratio' text to be formatted as a block rather than a very wide string that looked silly.
Originally committed to SVN as r3438.
2009-08-22 03:56:02 +00:00
Amar Takhar 775c73de29 Add new icons from Kaverin.
Originally committed to SVN as r3437.
2009-08-22 03:51:00 +00:00
Amar Takhar 0def838ef2 Add modified buttons from r3435.
Originally committed to SVN as r3436.
2009-08-22 03:50:12 +00:00
Amar Takhar 203f3ac4dd Add new buttons, commit changes to modified buttons.
Originally committed to SVN as r3435.
2009-08-21 23:10:43 +00:00
Amar Takhar 8ba5aa27be Move stream position info into it's own struct.. Looks like a few globals can't be helped due to how the AudioPlayer class is designed. If I have to use globals I'll atleast make them easier to manage.. Updates #997.
Originally committed to SVN as r3434.
2009-08-21 21:40:18 +00:00
Amar Takhar 5ea99a65e7 Remove unused global 'stopping' and remove unused mutex code. Updates #997.
Originally committed to SVN as r3433.
2009-08-21 20:28:43 +00:00
Amar Takhar 2df6b2fd38 Remove 'playing' global in favour of an IsPlaying function that uses Pa_IsStreamActive(). Updates #997.
Originally committed to SVN as r3432.
2009-08-21 20:08:58 +00:00
Amar Takhar f5a9af6a6c Call wxTheClipboard->UsePrimarySelection(true) when using wxClipboard, without getting into detail clipboard work very differently on X11. Without calling this copying to the clipboard won't work. I've just put it after every use of ->Open, this is safe as in every case Close() is called right after. This will fix clipboard copying on all unices.
Originally committed to SVN as r3431.
2009-08-20 02:31:33 +00:00
Amar Takhar 50d9dbd4f1 Add detach_video_menu and show_overscan_menu_checked <- this one isn't in use as you can't Check() a menu item that has a bitmap, we need to figure out an alternate solution. This probably involves flipping the bitmap to our own of a checkmark.
Originally committed to SVN as r3430.
2009-08-19 07:03:39 +00:00
Amar Takhar 2bf5f6656e Commit modified buttons from r3428.
Originally committed to SVN as r3429.
2009-08-19 06:48:50 +00:00
Amar Takhar 8fc5075a5b Update a bunch of icons and add detach_video_menu, show_overscan_menu_checked.
Originally committed to SVN as r3428.
2009-08-19 06:46:27 +00:00
Amar Takhar b2f4c07de9 PNG versions from r3426.
Originally committed to SVN as r3427.
2009-08-18 06:23:06 +00:00
Amar Takhar 3c32cfa312 Update SVGs from Kaverin.
Originally committed to SVN as r3426.
2009-08-18 06:20:58 +00:00
Amar Takhar 58965afc9a * Delete find_replace_button and find_next_button (these were blank anyway) and replace them with find_next_menu and find_replace_menu.
* Add new buttons open_audio_menu, open_audio_from_video_menu, close_audio_menu and close_video_menu.

Originally committed to SVN as r3425.
2009-08-18 01:28:15 +00:00
Amar Takhar 5cfa19f6b9 Add png versions of the modified SVG buttons from r3423.
Originally committed to SVN as r3424.
2009-08-18 01:24:00 +00:00
Amar Takhar 8d6c607251 Add close_audio_menu.svg find_replace_menu.svg find_next_menu.svg close_video_menu.svg open_audio_menu.svg open_audio_from_video_menu.svg + modifications to a couple dozen other buttons.
Originally committed to SVN as r3423.
2009-08-18 00:49:22 +00:00
Amar Takhar 6cae404100 Use /home/verm in lieu of ~ as it won't get expanded.
Originally committed to SVN as r3422.
2009-08-16 22:01:38 +00:00
Niels Martin Hansen f3e84bea88 Some more cache management stuff for the audio rendering.
Originally committed to SVN as r3421.
2009-08-16 16:22:59 +00:00
Amar Takhar bafe88cf38 Add '~/build/wx/share/aclocal' to ACLOCAL_FLAGS so autogen can find the correct wxwin.m4.. not sure if this will work, we'll see.
Originally committed to SVN as r3420.
2009-08-16 05:18:33 +00:00
Niels Martin Hansen 4526b0dc43 Try to get around G++'s dislike of my iterators by using an integer index instead.
Originally committed to SVN as r3419.
2009-08-16 04:31:29 +00:00
Amar Takhar b37310e286 Add a bunch of new icons from Kaverin.
Originally committed to SVN as r3418.
2009-08-16 03:54:44 +00:00
Niels Martin Hansen 56b40bc67a Will GCC like me better if I sprinkle some 'typename' around?
Originally committed to SVN as r3417.
2009-08-16 03:50:41 +00:00
Amar Takhar dd4ab361b0 Add several new icons to be used in the menu. These and the followin new icons will be available in the future when users are able to customise the menus.
Originally committed to SVN as r3416.
2009-08-16 02:39:19 +00:00
Niels Martin Hansen c97f91c137 Fix compilation errors on GCC.
Also fix a bug in the block cache where it wasn't the sorted order of the macroblocks by access count that was used in determining which ones to kill off.

Originally committed to SVN as r3415.
2009-08-16 01:10:20 +00:00
Niels Martin Hansen e9e3b2d107 Change AudioRenderer to use DataBlockCache.
Originally committed to SVN as r3414.
2009-08-16 00:28:26 +00:00
Niels Martin Hansen d29d267cce Did I say we were going to use a B+ tree for caching stuff? No I didn't, I never said so!
(Revert r3411 and r3410.)

Originally committed to SVN as r3413.
2009-08-15 21:56:28 +00:00
Niels Martin Hansen 76d94ec94c Add DataBlockCache template class. It parses but I don't know if it compiles yet.
Updates #951, #965, #990.

Originally committed to SVN as r3412.
2009-08-15 21:48:58 +00:00
Amar Takhar 324094960b Add btree/*.h to _SOURCES.
Originally committed to SVN as r3411.
2009-08-15 04:21:50 +00:00
Niels Martin Hansen 60e2cf3790 Add Anton Fedoruk's B+ Tree implementation, intended to be used for for audio display caching among other things.
Originally committed to SVN as r3410.
2009-08-15 04:20:25 +00:00
Amar Takhar 3b1a722e5c Add a \n after Kaverins entry to wrap (noticed by kaverin).
Originally committed to SVN as r3409.
2009-08-14 05:18:20 +00:00
harukalover 34913135c9 Removed a condition which would make clicking on a line that was already selected never update the editbox, this was wrong since the line's text can be changed by functions outside of direct editing in the editbox (e.g. automation scripts)
Originally committed to SVN as r3408.
2009-08-14 05:08:29 +00:00
Amar Takhar a31139a408 Reverse tooltips for the Cancel/Accept buttons in Split mode... I checked all of this carefully before I comitted, I guess I read what I wanted to see. (noticed by Kaverin)
Originally committed to SVN as r3407.
2009-08-14 04:57:32 +00:00
Amar Takhar edc7b00b97 PNG versions of the modified buttons.
Originally committed to SVN as r3406.
2009-08-14 03:17:16 +00:00
Amar Takhar 69eae15283 Add kara_split_accept and commit a whole bunch of modified buttons, all from Kaverin.
Originally committed to SVN as r3405.
2009-08-14 03:15:45 +00:00
Amar Takhar bebc71ef53 Change how the Split/Join mode buttons work. Previously there was a weird hack used to change the text of the buttons when the various modes were used. When switching to icons this was no longer possible -- Well you could switch the bitmap dynamically but that's really gross. Instead the two pairs of buttons are put into their own BoxSizers which are Shown and Hidden when each mode is used.
Originally committed to SVN as r3404.
2009-08-14 03:11:34 +00:00
Niels Martin Hansen d67176de9b Make some (do-nothing) destructors in the chardet library virtual, should fix some warnings on some GCC versions.
Originally committed to SVN as r3403.
2009-08-14 01:40:51 +00:00
Thomas Goyne 696e76379e Make the hotkeys for the visual typesetting modes customizable. Closes #992
Originally committed to SVN as r3402.
2009-08-13 22:07:43 +00:00
Amar Takhar 7634ce2d4e Add -force to 'hdiutil detach'.. this should stop the "Resource Busy" errors we keep on getting. I should have un-lazy'd myself a long time ago, though if I knew the fix this was this simple I would have.. guess I'm too used to every fix on OS X being long and convoluted. (argh)
Originally committed to SVN as r3401.
2009-08-13 19:35:42 +00:00
Niels Martin Hansen fd65666eb2 Forgot to change filenames in doxy comments when renaming audio_spectrum.*.
Originally committed to SVN as r3400.
2009-08-13 17:28:12 +00:00
Niels Martin Hansen dcebd9be94 Add constructor and destructor to AudioRendererBitmapProvider base class.
GCC warned that it was missing a virtual destructor while having virtual methods.

Originally committed to SVN as r3399.
2009-08-13 16:14:41 +00:00
Niels Martin Hansen f810fd20ce Rename audio_spectrum.* to audio_renderer_spectrum.* in preparation of converting the spectrum into a slave of AudioRenderer. See #951 and #990.
Originally committed to SVN as r3398.
2009-08-13 16:04:45 +00:00
Amar Takhar bb4207b380 It's tools/ now now scripts/ (should fix osx dmging.)
Originally committed to SVN as r3397.
2009-08-13 01:12:00 +00:00
Niels Martin Hansen 2a7e42c6a5 This should fix Mac builds failing on GL stuff.
Originally committed to SVN as r3396.
2009-08-13 00:35:45 +00:00
Niels Martin Hansen 09e27f5df3 Add two missing functions to audio_renderer.cpp to finally make it compile!
Originally committed to SVN as r3395.
2009-08-13 00:14:36 +00:00
Niels Martin Hansen 80364aaf01 Also forgot a wx include for wxMemoryDC in audio_renderer.cpp.
Originally committed to SVN as r3394.
2009-08-13 00:05:38 +00:00
Niels Martin Hansen 29f1272843 Uh oops, audio_renderer.cpp was including <set> instead of <map>...
Originally committed to SVN as r3393.
2009-08-13 00:04:16 +00:00
Niels Martin Hansen b9e7e178c2 Remove changelog.txt reference from MSVC project file, c.f. r3389.
Originally committed to SVN as r3392.
2009-08-12 23:48:27 +00:00
Niels Martin Hansen 5501c42cb0 Add (currently unused) AudioRendrer class and companions, see #951, #965 and #990.
Originally committed to SVN as r3390.
2009-08-12 23:42:53 +00:00
Niels Martin Hansen 0276b31225 Get rid of the unused and outdated changelog.txt.
Originally committed to SVN as r3389.
2009-08-11 18:21:58 +00:00
Amar Takhar f8963ff875 Update a bunch of icons from Kaverin and add the final two karaoke buttons.
Originally committed to SVN as r3388.
2009-08-11 17:01:02 +00:00
Amar Takhar 86e14fc0cc Add an Icons by: Phlip Cash entry for Kaverin to the about dialogue.
Originally committed to SVN as r3387.
2009-08-11 07:20:36 +00:00
Amar Takhar 986ccb95f8 Update doxygen build factory.
Originally committed to SVN as r3386.
2009-08-11 06:47:22 +00:00
Amar Takhar e046f753d9 Switch Karaoke mode button, join button and split button to new icons..
Originally committed to SVN as r3385.
2009-08-11 06:07:19 +00:00
Amar Takhar 24c25d01e3 Change the 'Commit' (text) button to button_audio_commit. (note: we really need to rename our icon reference/filenames)
Originally committed to SVN as r3384.
2009-08-11 05:50:11 +00:00
Amar Takhar 94965d1277 Add new icon: kara_timing_copier which replaces kanji_timer_button. Nothing has been changed other than the icon name. updates #870
Originally committed to SVN as r3383.
2009-08-11 05:35:25 +00:00
Amar Takhar c945d3e8e4 Follow-up r3381 and adjust modified icons, also add new kara_* icons.
Originally committed to SVN as r3382.
2009-08-11 05:28:16 +00:00
Amar Takhar 4427fb00db * Update some icons
* Remove kanji_timer_button.svg as it has been renamed.
 * Add kara_mode, kara_join, kara_timing_copier (previously kanji_timer_button) and kara_split.

Originally committed to SVN as r3381.
2009-08-11 05:25:00 +00:00
Amar Takhar 2106a1950c Update png icons to the latest from r3379.. eventually we need to compare the uncompressed DATA entry to detect if an icon has really changed or not..
Originally committed to SVN as r3380.
2009-08-09 05:53:47 +00:00
Amar Takhar 4f7a4eece9 Latest update of the icons from kaverin, all buttons done, woohoo\!
Originally committed to SVN as r3379.
2009-08-09 05:52:07 +00:00
Karl Blomster 26cccd2882 Add Simplified Chinese translation by nlnjnj.
Originally committed to SVN as r3378.
2009-08-08 13:36:07 +00:00
Karl Blomster 65fb2e7efa Remove a pointless attempt to reindex a file in the ffms2 video provider. It didn't help anything, in fact it just caused crashes since the source object was free'd after the first attempt. Fixes #976.
Originally committed to SVN as r3377.
2009-08-07 20:16:13 +00:00
Karl Blomster 1a182098fc Document the Y4M video provider.
Originally committed to SVN as r3376.
2009-08-07 19:59:37 +00:00
Amar Takhar c6c99a1fe6 Update icons, just two left find_button (binoculars) and the translation button (fish).
Originally committed to SVN as r3375.
2009-08-06 21:57:15 +00:00
Amar Takhar 7b0ded8edc Add SVG icons from Kaverin.
Originally committed to SVN as r3374.
2009-08-06 21:56:35 +00:00
Amar Takhar 27256ae44a Add libresrc.cpp, libresrc.h to CLEANFILES.
Originally committed to SVN as r3373.
2009-08-06 21:26:27 +00:00
Amar Takhar 5b5597a1c9 Delete BMP buttons, they're no longer in use..
Originally committed to SVN as r3372.
2009-08-06 21:19:50 +00:00
Amar Takhar 2bd48754bd Fix alignment of some --help messages.
Originally committed to SVN as r3371.
2009-08-06 04:39:35 +00:00
Amar Takhar 02581bf1f1 Add a new option --enable-gcc-prec which will enable the use of gcc precompiled headers, this speeds up the build time (including one time builds) by several oders of magnitude. closes #975
Originally committed to SVN as r3369.
2009-08-06 04:35:35 +00:00
Amar Takhar d899c816b8 Document kana_table.*
Originally committed to SVN as r3368.
2009-08-06 01:55:24 +00:00
Amar Takhar 6b8ac0d0ea Make the script chmod to 0644 after generating, I don't know why (yet) it uses such strict permissions..
Originally committed to SVN as r3366.
2009-08-05 22:04:52 +00:00
Niels Martin Hansen b6a63c15e6 Adjust throwing of exceptions to the new style documented in exception.h.
(Good thing nothing is catching these yet, and it's the only case of "new style" exceptions being used.)

Originally committed to SVN as r3365.
2009-08-05 20:52:44 +00:00
Niels Martin Hansen c731a9b437 Document exception.h
Originally committed to SVN as r3364.
2009-08-05 20:51:32 +00:00
Karl Blomster ad4a44a22b Document ffmpegsource_common.cpp/h.
Originally committed to SVN as r3363.
2009-08-05 11:21:00 +00:00
Amar Takhar c5f0ee3767 Make sure ../libffms/include is included very early on so it is picked up before any version installed system-wide.
Originally committed to SVN as r3361.
2009-08-05 04:02:40 +00:00
Niels Martin Hansen 7f106eaf91 Document namespace Aegisub
Originally committed to SVN as r3360.
2009-08-05 02:17:13 +00:00
Karl Blomster 47f9492832 Change WITH_PORTAUDIO2 to WITH_PORTAUDIO; this renaming was actually done ages ago but never got changed in config/config_windows0.h because nobody builds with it on Windows.
Originally committed to SVN as r3359.
2009-08-04 21:17:33 +00:00
Niels Martin Hansen f664a26b18 Rename Kanji Timer step 2: Rename things in docs (and include guard)
Updates #870.

Originally committed to SVN as r3358.
2009-08-04 02:00:30 +00:00
Niels Martin Hansen 96acbe33c3 Rename Kanji Timer step 1: Rename source files.
Updates #870.

Originally committed to SVN as r3357.
2009-08-04 01:53:26 +00:00
Niels Martin Hansen 8c08cb78a0 Make ffms2.dll not delayload, it's a required component and having it delayload only makes tracing loader errors harder.
Originally committed to SVN as r3355.
2009-08-03 21:32:39 +00:00
Thomas Goyne 755b40a966 Switch the safer autosaving to the standard method of writing to a different file then replacing the original.
Originally committed to SVN as r3354.
2009-08-02 20:39:36 +00:00
Thomas Goyne cca0de98cb Make autosave create a temporary backup of the current autosave file before saving so that an error while saving is less likely to cause data loss.
Originally committed to SVN as r3353.
2009-08-02 20:32:53 +00:00
Amar Takhar 5ccf95b9df Document Hunspell.
Originally committed to SVN as r3352.
2009-08-01 04:37:29 +00:00
Amar Takhar 6bde901e5e Document about dialogue.
Originally committed to SVN as r3351.
2009-08-01 04:02:20 +00:00
Niels Martin Hansen 332168f596 Fix Doxygen for avisynth_wrap.
Originally committed to SVN as r3350.
2009-08-01 03:41:42 +00:00
Amar Takhar 0fe2c476a4 It's @ticket not @issue, use as @ticket{<number>} instead of @ticket <number>.
Originally committed to SVN as r3349.
2009-08-01 03:40:47 +00:00
Niels Martin Hansen 51288bc06d Make a typedef of a function type, hoping to fix Doxygen warnings.
Originally committed to SVN as r3348.
2009-08-01 03:27:13 +00:00
Amar Takhar 718b1ca94a Fix a bunch of Doxygen warnings, two more left!
Originally committed to SVN as r3347.
2009-08-01 03:26:09 +00:00
Amar Takhar 45f7b8b8a2 Add a whole bunch of WITH_* flags to PREDEFINED, this includes a large chunk of code that wasn't getting added before. Most of the warnings have been fixed now other than a few extra that have cropped up due to the ifdef'd code being included. Thanks to jfs for spotting the fix.
Originally committed to SVN as r3346.
2009-08-01 03:10:56 +00:00
Niels Martin Hansen a5a8665859 Do a bit of documenting of audio display drawing functions.
Originally committed to SVN as r3345.
2009-08-01 02:32:26 +00:00
Amar Takhar db6e3d84c1 Fix setting the window as modified, I don't know if this will work in 10.4.. (fix from jfs)
Originally committed to SVN as r3344.
2009-08-01 02:00:30 +00:00
Niels Martin Hansen e42d184ec4 Add Doxygen documentation to audio spectrum code
Originally committed to SVN as r3343.
2009-08-01 01:55:17 +00:00
Amar Takhar d8200c669e Add some logic to copy files as links if they're links, and resolve all links to the final destination file then copy that. This is just part of the solution. The final solution will be to remove all symbolic links and change all library references (to symbolic links) to their actual versioned filename. Updates #964
Originally committed to SVN as r3342.
2009-07-31 23:47:22 +00:00
Thomas Goyne 4eba7657a2 Fix the slider in the color picker for non-GTK platforms. wx2.9 appears to have synchronized the behavior of changing the value of a slider across all platforms to how it behaved on GTK.
Originally committed to SVN as r3341.
2009-07-31 23:42:15 +00:00
Thomas Goyne 4472dfee12 Fix an assertion failure that happened whenever an ass override tag with too few parameters was parsed.
Originally committed to SVN as r3340.
2009-07-31 23:26:13 +00:00
Amar Takhar a91495c69d Remove wxBevelButton support as it's no loger required for 2.9.
Originally committed to SVN as r3339.
2009-07-31 20:34:23 +00:00
Amar Takhar 127a39626b * Build the restart-helper program in a makefile rather than in osx-bundle.sh
* Update paths to use tools/ instead of scripts/ in osx-bundle.sh

Originally committed to SVN as r3337.
2009-07-31 20:29:29 +00:00
Thomas Goyne 79e4065579 Add default values for the optional parameters of \move, fixing an assertion failure when they are not specified.
Originally committed to SVN as r3336.
2009-07-31 16:50:48 +00:00
Amar Takhar 2fcd872218 Kill the ffms2 group and make it all 'ffms'
Originally committed to SVN as r3335.
2009-07-30 06:40:25 +00:00
Amar Takhar cdfbcd6681 Add favicon.ico to the html header.
Originally committed to SVN as r3334.
2009-07-30 06:37:32 +00:00
Amar Takhar 4b88b4bdc5 Turn MACRO_EXPANSION and EXPAND_ONLY_PREDEF to on, also set a predefined macro for WXUNUSED(), this silences quite a few warnings.
Originally committed to SVN as r3332.
2009-07-30 05:57:29 +00:00
Amar Takhar e213d36b04 Exclude avisynth.h, MatroskaParser.? and md5.? from document generation.
Originally committed to SVN as r3331.
2009-07-30 04:32:21 +00:00
Amar Takhar 93f78921f3 Add missing @param in exception.h
Originally committed to SVN as r3330.
2009-07-30 04:29:12 +00:00
Amar Takhar 4e37bdea68 Cleanup doxygen markup.
Originally committed to SVN as r3329.
2009-07-30 04:27:48 +00:00
Amar Takhar 583cf55afb Add Doxygen skel info for video_provider_yuv4mpeg.h which was having errors in the first round.
Originally committed to SVN as r3328.
2009-07-30 04:25:52 +00:00
Amar Takhar d82d02010b Add Doxygen skeleton info for general include files.
Originally committed to SVN as r3327.
2009-07-30 04:24:23 +00:00
Amar Takhar d4b71ff85d add \ticket and \revision aliases, properly include the LICENCE file.
Originally committed to SVN as r3326.
2009-07-30 03:37:42 +00:00
Amar Takhar 2fd9b9d7e3 Fix a whole bunch of Doxygen warnings.
Originally committed to SVN as r3325.
2009-07-30 03:36:53 +00:00
Amar Takhar efb9ad0f0a Add a licence file.. only 4 years later right?!
Originally committed to SVN as r3324.
2009-07-30 03:31:25 +00:00
Amar Takhar cd8bb7c241 Document PortAudio player, this is broken in doxygen at the moment not sure why..
Originally committed to SVN as r3323.
2009-07-30 02:51:42 +00:00
Amar Takhar 612e007be6 Put the source guide on the main index, include the current dir so extra doxygen files are included.
Originally committed to SVN as r3322.
2009-07-30 02:22:06 +00:00
Amar Takhar cc08d39f2e Dcoument AegisubFileDropTarget.
Originally committed to SVN as r3321.
2009-07-30 02:09:21 +00:00
Amar Takhar 726f7a2b68 Help buildbot find doxygen.log
Originally committed to SVN as r3320.
2009-07-30 01:55:11 +00:00
Amar Takhar 1adf7d7a43 In our buildbots the build dir is actually builder/build, doxygen had /build/ set as an exclusion pattern which caused no files to be generated, this isn't a problem since we're only including src/ anyway. Things are vastly more simple now.
Originally committed to SVN as r3319.
2009-07-30 01:47:51 +00:00
Amar Takhar b9b7460a8f Whoops, HTML_FILE_EXTENSION got set to 'html' instead of '.html'. The former doesn't work very well..
Originally committed to SVN as r3318.
2009-07-30 01:23:08 +00:00
Amar Takhar 1e3b7678fc set HAVE_DOT=YES.
Originally committed to SVN as r3317.
2009-07-30 00:08:22 +00:00
Amar Takhar 2e4aa86804 Script to build using the tinderbox.
Originally committed to SVN as r3316.
2009-07-30 00:01:19 +00:00
Amar Takhar 7ef2e4f764 Add a new buildslave (shoyu) and Doxygen build factory, this is just a stub now I'll add it in a later commit.
Originally committed to SVN as r3314.
2009-07-29 23:29:00 +00:00
Amar Takhar 9dd3e9f2e2 Doxygen config files / setup.
Originally committed to SVN as r3313.
2009-07-29 23:05:41 +00:00
Amar Takhar 6ee2f98349 Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs.  This isn't the actual document in itself but empty documentation using any old documentation if it was there.

This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.

Some notes:
 * Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
 * Some multiline comments may have been munged into single line comments
 * Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
 * Enum comments can go after the enumeration itself '[value] /// comment'
 * include/aegisub/*.h haven't been converted yet, this will be done in a later commit
 * Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.

See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.

Originally committed to SVN as r3312.
2009-07-29 22:59:22 +00:00
Amar Takhar d6fbe6fc8e Add svn:keywords for files modified in r3310.
Originally committed to SVN as r3311.
2009-07-29 05:43:58 +00:00
Amar Takhar 12aa34088a Switch all headers to using Doxygen and cleanup contact info
* Swap old email + website address with 'Aegisub Project http://www.aegisub.org/'
 * Set categories for all files (jfs)
 * Add descriptions for each file (jfs)
 * Add $Id$ keyword

Originally committed to SVN as r3310.
2009-07-29 05:43:02 +00:00
Niels Martin Hansen 3097ca162d Handle ASS files with missing [Script Info] header better, updates #440.
This should get some additional regression testing before the bug is closed and the fix backported to 2.1.8.

Originally committed to SVN as r3308.
2009-07-29 01:59:12 +00:00
Niels Martin Hansen 174c17309b Remove progress dialogue and threaded call from Auto4 Lua export filter config dialogue production call. This somewhat breaks an undocumented part of the API but I don't think anything relies on this.
Should close #927.

Originally committed to SVN as r3307.
2009-07-28 15:39:52 +00:00
Niels Martin Hansen 049baecfc4 Fill in missing docs from r3304.
Originally committed to SVN as r3306.
2009-07-28 13:34:31 +00:00
Amar Takhar a1d04599e2 Add @ingroup libosxutil.
Originally committed to SVN as r3305.
2009-07-28 06:12:25 +00:00
Amar Takhar 373c0057b2 Document using the Doxygen format.
Originally committed to SVN as r3304.
2009-07-28 06:07:44 +00:00
Niels Martin Hansen 7f9099da90 Apparently dummy video needs "the VFR hack" or it's broken.
Originally committed to SVN as r3302.
2009-07-28 00:02:39 +00:00
Thomas Goyne 7aad443f48 Delete some code in SubsEditBox::SetOverride that did nothing.
Originally committed to SVN as r3301.
2009-07-27 23:55:17 +00:00
Karl Blomster 9fa6190a40 Added Korean translation by FreeTime. (Previous version was from 2006 or so.)
Originally committed to SVN as r3299.
2009-07-27 23:36:08 +00:00
Niels Martin Hansen 28e974e665 Fix crash (div by 0) introduced in r3295, updates #953.
(Blind fix, doesn't happen on Windows.)

Originally committed to SVN as r3297.
2009-07-27 21:11:39 +00:00
Niels Martin Hansen 675afab201 Hopefully fix build error on OS X, WindowRef and SetWindowModified() being undeclared in frame_main.
Originally committed to SVN as r3296.
2009-07-27 01:07:54 +00:00
Niels Martin Hansen f2e8333aea Fix #953, somewhat hackish: The grid never sized down because the scroll bar was a child window of it, and when a window has child windows, the bottom and rightmost coordinates of those together determine the minimum size of the containing window. This behaviour changes if those child windows are managed by a sizer. By putting the scroll bar into a sizer the problem goes away.
I think a better solution would be to change to use wxWindow::SetScrollbar() but that's a larger operation.

Originally committed to SVN as r3295.
2009-07-26 23:24:21 +00:00
Karl Blomster f066903d98 FFMS2 a/v providers should use UTF8 strings for the cache filenames, just like for every other file. Updates #955 but does not fix it since you still get bizarre popups that I have no idea where they're coming from if the write/touch operations fail.
This change should be merged into 2.1.8.

Originally committed to SVN as r3294.
2009-07-26 23:10:12 +00:00
Niels Martin Hansen 696ae74f8a Add some const-ness to the kana table, should fix compiler warnings on GCC.
Originally committed to SVN as r3293.
2009-07-26 17:25:04 +00:00
Amar Takhar c28b51d904 * Fix location of Intel wx config.
* Use -Wl,-rpath on Linux.

Originally committed to SVN as r3292.
2009-07-26 17:22:27 +00:00
Amar Takhar b0063ff46d * Add the libdir to our local wx installation using -rpath.
* Fix location of wx-config on the PPC buildbot.

Originally committed to SVN as r3291.
2009-07-26 16:46:50 +00:00
Amar Takhar 9159721be7 * Fix two syntax errors in master.cfg
* Add twistd.pid to svn:ignore

Originally committed to SVN as r3290.
2009-07-26 16:40:04 +00:00
Niels Martin Hansen c50d57838c More changes to Windows buildbot script, going to use VCBuild now instead of MSBuild.
Originally committed to SVN as r3288.
2009-07-26 14:33:23 +00:00
Niels Martin Hansen 18596a5f27 Shot at new, improved building script for Windows buildbot.
Originally committed to SVN as r3287.
2009-07-26 01:36:41 +00:00
Niels Martin Hansen e16fa24293 Updated solution file for Windows buildbot, added respack project
Originally committed to SVN as r3286.
2009-07-26 00:41:08 +00:00
Thomas Goyne d401e67402 Switch the main window's icon back to the .ico version on windows as it was rejecting the png one.
Originally committed to SVN as r3285.
2009-07-25 20:32:58 +00:00
Amar Takhar 0f841aae1a Convert the icon to png from xpm, I'm not sure how Windows will handle the alpha on this image.. someone on Windows will need to check.
Originally committed to SVN as r3284.
2009-07-25 20:07:07 +00:00
Amar Takhar 37010aee03 I thought res.rc was already updated, I should have looked.. this fixes breakage in r3281.
Originally committed to SVN as r3283.
2009-07-25 19:46:10 +00:00
Niels Martin Hansen f51e7b1483 Let's make setup.cpp fail on wx 2.8
Originally committed to SVN as r3282.
2009-07-25 19:39:34 +00:00
Amar Takhar 6da57c3c8d We don't need the XPM icons anymore, and eyedropper.cur/icon.ico have moved to windows/
Originally committed to SVN as r3281.
2009-07-25 19:29:08 +00:00
harukalover 072520bf5f Removed most of the wxWidgets 2.8 compatibility code
Originally committed to SVN as r3280.
2009-07-25 18:45:30 +00:00
Niels Martin Hansen 075439f405 Fix bugs in kara-templater causing tenv.relayer and tenv.restyle functions to fail.
Closes #950.

Originally committed to SVN as r3277.
2009-07-25 18:16:37 +00:00
Thomas Goyne 01505e3d37 Mostly fix unix build issues related to the new image embedding.
Originally committed to SVN as r3276.
2009-07-25 18:08:17 +00:00
Niels Martin Hansen 966f88e577 Move a bunch of project properties for respack into VSProps files:
* Support picking up wx from $solution/wxlib/ location
 * Use standard_outdirs
 * Move post-build resource-packing event into new VSProps

Originally committed to SVN as r3275.
2009-07-25 17:13:10 +00:00
Niels Martin Hansen 23767950a9 Let Aegisub project file pick up wx relative to the solution file, using VSProps from r3273.
Originally committed to SVN as r3274.
2009-07-25 16:57:11 +00:00
Niels Martin Hansen 0cd1058e8d VSProps files to pick up a wx installation relative to the solution file.
Originally committed to SVN as r3273.
2009-07-25 16:56:01 +00:00
Thomas Goyne e6d6a056c9 Change resources filename back to libresrc.cpp/h.
Originally committed to SVN as r3272.
2009-07-25 16:15:13 +00:00
Amar Takhar fb3431df66 Commit changes to support importing bitmaps as character strings, this is still broken however the final fix should be quite simple.
Originally committed to SVN as r3270.
2009-07-25 09:35:44 +00:00
Amar Takhar ffe628f29a Move tellg() usage to the start of the block rather than at the end, otherwise it would always return -1. This should be harmless for windows.
Originally committed to SVN as r3269.
2009-07-25 08:32:21 +00:00
Amar Takhar 2522102465 Change .wc_str() to .char_str() to fix unix build breakage, should be fine on windows..
Originally committed to SVN as r3268.
2009-07-25 08:01:30 +00:00
Amar Takhar a0099e7f74 s/scripts/tools/ after the rename
Originally committed to SVN as r3267.
2009-07-25 05:23:04 +00:00
Thomas Goyne c641c6e656 Switch all icons in Aegisub to use the new png versions, using a new small tool to store the pngs as byte arrays in a cpp file.
Originally committed to SVN as r3265.
2009-07-25 04:49:59 +00:00
Amar Takhar c87e0f2c7b Add icon.ico and eyedropper.cur to windows/ and splash.png to misc/.
Originally committed to SVN as r3264.
2009-07-25 03:32:06 +00:00
Amar Takhar 972c5e7f12 Add in missing buttons, which are very ugly scales of the original .bmp icons, these are for interm use until we have svg versions.
Originally committed to SVN as r3263.
2009-07-25 03:25:11 +00:00
Amar Takhar 586f3f8d2b Commit png versions of the (new) .svg icons Kaverin made, these have been made as original work or from the original .bmp icons.
Originally committed to SVN as r3262.
2009-07-25 03:23:35 +00:00
Amar Takhar d51396738b Revert part of r3260: SIGH, why can't svn let you ctrl-c out of a commit further down in the process? You can only do it if you catch it early, though it's also my fault for not paying attention that I had local changes.
Originally committed to SVN as r3261.
2009-07-25 02:34:33 +00:00
Amar Takhar 4a757421d9 Rename scripts/ to tools/ as it makes more sense, initially the directory only contained scripts however with the addition of our 3rd tool it makes sense to just rename the entire direectory. Keeping the old scripts/ dir around was just extra clutter and would probably cause confusion as to which place a new script/tool should go.
Originally committed to SVN as r3260.
2009-07-25 02:29:04 +00:00
Amar Takhar 75a5c70297 Remove some old scripts from Makefile.am that were used for the bmp->xpm conversion.
Originally committed to SVN as r3259.
2009-07-25 02:11:27 +00:00
Amar Takhar bab2720596 Fix fosx (10.5) build factory, also remove an obsoleted option.
Originally committed to SVN as r3258.
2009-07-24 19:31:34 +00:00
Amar Takhar 9002cddd3f Add OSX 10.5 buildslave setup.
Originally committed to SVN as r3257.
2009-07-24 19:29:04 +00:00
Amar Takhar 34773d4ea1 Fix the FreeBSD build factory.
Originally committed to SVN as r3256.
2009-07-24 07:55:56 +00:00
Karl Blomster 1e4119f337 Add quicktime audio provider to VS2008 project and to Makefile.am.
Originally committed to SVN as r3255.
2009-07-24 06:06:56 +00:00
Karl Blomster bec8951534 Implement a basic QuickTime audio provider. Currently a bit limited in functionality (it will convert everything to 16-bit mono), but seems to work fine with the one .mov test file I have. Also does a lot of ugly downcasting, I'll try to fix that later.
Originally committed to SVN as r3254.
2009-07-24 06:04:19 +00:00
Amar Takhar 8cb1e62831 Remove libresrc.h from config.h as it's now included per-file.
Originally committed to SVN as r3253.
2009-07-24 05:47:03 +00:00
Thomas Goyne e21337f34f Made it so that the font collector does not crash Aegisub when it is built with both no freetype and no fontconfig.
Originally committed to SVN as r3252.
2009-07-24 02:30:11 +00:00
Thomas Goyne 83bb2ecedd Fix the number of rows in another sizer.
Originally committed to SVN as r3251.
2009-07-24 02:18:11 +00:00
Thomas Goyne 766ae98a76 Add wxOK to some message boxes that specified flags without including either wxOK or wxYESNO.
Originally committed to SVN as r3250.
2009-07-24 02:10:41 +00:00
Thomas Goyne f81b147031 Remove a double addition of a single button to the kanji timer dialog.
Originally committed to SVN as r3249.
2009-07-24 02:06:15 +00:00
Karl Blomster f59dcf19f6 Add option to set FFMS2 logging level (i.e. how much spam FFmpeg prints to STDERR).
Option is called "ffmpegsource log level" and possible values are (in order of increasing spam) quiet, panic, fatal, error, warning, info, verbose, debug. The default is quiet, and I strongly recommend avoiding anything above warning.

Originally committed to SVN as r3248.
2009-07-24 01:41:16 +00:00
Thomas Goyne af6492d867 Fix the number of rows in several wxFlexGridSizers in the options dialog.
Originally committed to SVN as r3247.
2009-07-24 00:58:17 +00:00
Thomas Goyne 3eacb9ba42 Remove an unnecessary StretchSpacer from the color picker dialog that caused problems with wx 2.9.
Originally committed to SVN as r3246.
2009-07-24 00:50:31 +00:00
Thomas Goyne b7412a08c6 Make the windows buildbot not try to copy the now non-existent auto3 dll.
Originally committed to SVN as r3245.
2009-07-24 00:38:48 +00:00
Thomas Goyne fcbc9fcdc0 Move the libresrc include to the individual files that need it.
Originally committed to SVN as r3244.
2009-07-24 00:08:25 +00:00
Karl Blomster 7149e01888 Move more stuff to the common QT provider class and generalize initializing/de-initializing QuickTime.
Originally committed to SVN as r3243.
2009-07-23 23:57:12 +00:00
Thomas Goyne 87e96be4b5 Make the windows build system work with the XMP buttons.
Originally committed to SVN as r3242.
2009-07-23 23:54:06 +00:00
Amar Takhar 98dad055ff Switch from converting .bmp->XPM dynamically during the autogen step into building libresrc directly from the XPM buttons now that the .bmp files are gone.
Originally committed to SVN as r3241.
2009-07-23 23:51:13 +00:00
Amar Takhar 356ea76703 Commit libres files, these used to be automatically generated using some AWK scripts I wrote.
Originally committed to SVN as r3240.
2009-07-23 23:46:32 +00:00
Amar Takhar 0d40a537f4 Add XPM versions of the .bmp buttons.
Originally committed to SVN as r3239.
2009-07-23 23:44:27 +00:00
Amar Takhar 54c535789a Move bmp buttons from trunk/aegisub/src/bitmaps -> trunk/docs/art-sources/buttons now that we're using XPM buttons.
Originally committed to SVN as r3238.
2009-07-23 23:43:49 +00:00
Amar Takhar b62f52d8f8 Swap wxBITMAP(.*) with wxBitmap(.*_xpm) now that we're switching to xpm buttons on _all_ platforms, this makes things much easier.
Originally committed to SVN as r3237.
2009-07-23 23:38:04 +00:00
Amar Takhar bc7c028538 Add ACLOCAL_FLAGS to autogen and --with-wx-config to configure for linux build factory. This is required since there are no system packages for 2.9 (as it hasn't been released yet.)
Originally committed to SVN as r3236.
2009-07-23 22:56:04 +00:00
Amar Takhar 85330c01ae Remove PERL,Ruby from the scripting engine status at the bottom of configure output.
Originally committed to SVN as r3235.
2009-07-23 22:40:02 +00:00
Thomas Goyne 9fef5b0606 Kill aegisub-auto3.dll.
Originally committed to SVN as r3234.
2009-07-23 22:16:55 +00:00
Thomas Goyne 4f5f165d30 Removed the rest of the uses of delayload_libauto3.vsprops from aegisub_vs2008.vcproj.
Originally committed to SVN as r3233.
2009-07-23 21:26:54 +00:00
harukalover 6d82665116 Removed FloatSpinCtrl since it was unused and can be replaced by wxSpinCtrlDouble now that we have switched to wx2.9
Originally committed to SVN as r3232.
2009-07-23 21:02:39 +00:00
harukalover 581b515f22 Removed delayload_libauto3.vsprops now that auto3 is gone
Originally committed to SVN as r3231.
2009-07-23 20:55:46 +00:00
Amar Takhar b39aa27e3c Remove PERL, Ruby, auto3 (lua50) flags and variables as all 3 have been removed in trunk.
Originally committed to SVN as r3230.
2009-07-23 20:40:36 +00:00
Amar Takhar 423f934e3b Remove some commented lines, no point in keeping them in the file since the configs are under svn now.
Originally committed to SVN as r3229.
2009-07-23 20:23:41 +00:00
Amar Takhar 9cd0720036 Disable osx_bevelButton until we see how 2.9 looks on 10.4 (carbon) and 10.5 (coca).
Originally committed to SVN as r3228.
2009-07-23 20:22:07 +00:00
Amar Takhar 11ad86631a Switch configure.in to use the new wx2.9 m4 macros and change autogen.sh to look for wxwin29.mp4 versus wxwin28.mp4. This forces the requirement of wx2.9 now.
Originally committed to SVN as r3227.
2009-07-23 20:20:03 +00:00
Karl Blomster 8ef5d3869a Actually add the new common class files (derp) and add them to the makefile/msvc project.
Originally committed to SVN as r3226.
2009-07-23 20:19:42 +00:00
Karl Blomster 93477952c0 Factor a few things out of the QT video provider into a common QT class in preparation for eventually adding an audio provider sometime down the line.
Originally committed to SVN as r3225.
2009-07-23 20:17:09 +00:00
Karl Blomster ab1993467a Remove a bunch of no longer needed (since we removed Aegisub::string) string conversions via c_str()/wc_str(), and replace mb_str(wxConvUTF8) with utf8_str() where appropriate.
Originally committed to SVN as r3224.
2009-07-23 19:57:57 +00:00
Amar Takhar c11bf12504 Add build master/slave configurations..
Originally committed to SVN as r3223.
2009-07-23 19:38:19 +00:00
Amar Takhar aa86cdb062 Turn a few string joins into wxString::Format, also change a printf to wxLogDebug as it's unnecessary spam to the user, this fixes a weird error wx2.9 was having.
Originally committed to SVN as r3222.
2009-07-23 17:02:19 +00:00
Amar Takhar 0f6977fa39 Fix a cast issue in GetCacheFilename under wx2.9.. fix by jfs, thanks!
Originally committed to SVN as r3221.
2009-07-23 15:37:47 +00:00
Amar Takhar a0370f9004 Remove Aegisub::String class as it's causing problems in wx2.9. The original plan was to have it so external modules wouldn't have to depend on wx. We'll think of a different solution when the time comes. closes #940
Originally committed to SVN as r3220.
2009-07-23 15:16:53 +00:00
Amar Takhar e496c0487d Remove a couple of auto3 remnants from Makefile.am.
Originally committed to SVN as r3219.
2009-07-23 15:14:21 +00:00
Niels Martin Hansen 312aa52096 Make spectrum mode the default for the audio display, closes #943.
Originally committed to SVN as r3218.
2009-07-23 13:57:40 +00:00
Amar Takhar cd7e414b08 It looks like windows needs this change as well.
Originally committed to SVN as r3216.
2009-07-23 07:09:57 +00:00
Amar Takhar d14aa9d8f0 typedef String to wxString until we decide upon the removal of Aegisub::String. (i hope so!), this fixes wx2.8 and wx2.9 when using wc_str().
Originally committed to SVN as r3215.
2009-07-23 06:00:23 +00:00
Amar Takhar c170f7f096 c_str() -> wc_str() in preperation for wx2.9, these changes are required for Unix, should be harmless on Windows.
Originally committed to SVN as r3214.
2009-07-23 05:32:13 +00:00
Amar Takhar b127105f42 Remove extra FFmpegSourceProvider:: qualifier.
Originally committed to SVN as r3212.
2009-07-23 03:16:57 +00:00
Karl Blomster 7157d50e73 Re-fix the VFR fix in r3084 by restoring the old behavior (which was correct for the only existing providers at the time it was implemented, I think) under a special condition that only triggers for the AVS provider. This does not really actually fix any bugs; the new behavior wasn't any better (in fact it was probably incorrect in some cases) but at least this way doesn't have any of the regressions the new way might have introduced.
Originally committed to SVN as r3211.
2009-07-23 02:06:47 +00:00
Niels Martin Hansen 0475b95e60 Further removal of traces of Auto4 Perl and Ruby. (Is this some Pokemon game?)
Updates #930.

Originally committed to SVN as r3210.
2009-07-23 01:57:53 +00:00
Karl Blomster bec9378182 Remove video_provider_dshow.cpp from EXTRA_SOURCES in Makefile.am. Updates #930.
Originally committed to SVN as r3209.
2009-07-23 01:46:11 +00:00
Amar Takhar c6145f0b63 I don't know why there were .pm files under data_general.. updates #840 and #938.
Originally committed to SVN as r3208.
2009-07-23 01:45:11 +00:00
Niels Martin Hansen f35b48470a Seems Fluff forgot to remove some files from MSVC project when removing DShow video provider. Updates #930.
Originally committed to SVN as r3207.
2009-07-23 01:43:58 +00:00
Niels Martin Hansen 07900b05f0 Oops, build-breaker = me. Forgot to save MSVC project before committing so the removed property sheet was still referenced. Updates #938.
Originally committed to SVN as r3206.
2009-07-23 01:41:48 +00:00
Niels Martin Hansen 31657f94da The removal of Auto4 Ruby and Auto4 Perl code. Updates #665 and #938.
Originally committed to SVN as r3205.
2009-07-23 01:39:57 +00:00
Amar Takhar af5df13f00 Remove Auto4 Ruby from the (unix) build system, updates #665 and #938.
Originally committed to SVN as r3204.
2009-07-23 01:23:35 +00:00
Amar Takhar 3403a5faea Remove Auto4 PERL from the build system, updates #840 and #938.
Originally committed to SVN as r3203.
2009-07-23 01:18:51 +00:00
Amar Takhar d8c7515975 Remove a few auto3 files that wern't associated with auto3 in the Makefile.
Originally committed to SVN as r3202.
2009-07-23 01:11:27 +00:00
Niels Martin Hansen 3b917f61bf Fix a warning on GCC about initialisation order in Aegisub::Exception class.
Originally committed to SVN as r3201.
2009-07-23 01:11:22 +00:00
Niels Martin Hansen c52d45dd95 Missed a bunch of things removing Auto3...
Originally committed to SVN as r3200.
2009-07-23 00:49:54 +00:00
Amar Takhar dbf0f48713 Nuke auto3 from the Unix/OSX build system.
Originally committed to SVN as r3199.
2009-07-23 00:27:57 +00:00
Niels Martin Hansen 2fef9e3111 Remove libauto3 that somehow escaped before.
Originally committed to SVN as r3198.
2009-07-23 00:22:57 +00:00
Niels Martin Hansen 98d909b361 Remove Auto3 from Windows buildbot solution file, should unbreak that.
Originally committed to SVN as r3197.
2009-07-23 00:22:20 +00:00
Niels Martin Hansen be26ba4652 Surgically remove Automation 3.
Going to break UNIX build and Windows buildbot for now.

Originally committed to SVN as r3196.
2009-07-23 00:19:36 +00:00
Karl Blomster 352df194aa Remove the DirectShow VideoProvider. Fixes #930.
Originally committed to SVN as r3195.
2009-07-23 00:12:22 +00:00
Niels Martin Hansen 5e902e2ef1 Remove threaded-ness of Auto 4 Lua macro validation calls, updates #927.
Originally committed to SVN as r3194.
2009-07-22 23:07:46 +00:00
Niels Martin Hansen 520239fc1b Re-do "split by karaoke" code using the common ass_karaoke code and adding a little more sanity checking, fixes #929.
Originally committed to SVN as r3192.
2009-07-22 22:30:57 +00:00
harukalover ac33243a49 Fixed compilation with wxWidgets 2.9.0 again plus removed some unneeded #if's (wc_str is the same as c_str under 2.8)
Originally committed to SVN as r3191.
2009-07-22 19:52:59 +00:00
Niels Martin Hansen ff8c8e1817 Add exception.h declaring some base exception classes. For the sake of experimenting and showing the concept, change one (probably never thrown) exception to use the new style exceptions.
No new source files to compile, just a new header.

Originally committed to SVN as r3190.
2009-07-22 00:10:36 +00:00
Karl Blomster 8d5bae9558 Forgot to call Close() in the QT video provider's destructor.
Originally committed to SVN as r3189.
2009-07-21 21:04:38 +00:00
Karl Blomster 38c5f8200a Removed FFMS2 usage from the Avisynth video provider. If you want FFMS2, use the FFMS2 provider.
Originally committed to SVN as r3188.
2009-07-21 20:36:27 +00:00
Karl Blomster ce2a549517 Implemented a basic QuickTime video provider. Works in my simple tests on Windows, but I have no idea if it even compiles on Mac.
I leave it up to verm to add detection for it to configure; it's disabled by default (#ifdef'd out unless you #define WITH_QUICKTIME).

Originally committed to SVN as r3187.
2009-07-21 20:24:25 +00:00
Amar Takhar 909436578d Remove duplicate sources that are already built and used in wxAGG/
Originally committed to SVN as r3186.
2009-07-21 04:09:24 +00:00
Karl Blomster d1762c5270 The Great Colorspace Reworking of '09, part 2 of ???: change all video providers to always output RGB32, and remove the formatMask parameter of GetFrame(). This may break the dshow video provider but I have no way of testing it and AFAIK nobody else does either. If someone actually uses it, they can fix it themselves. Updates #926.
Originally committed to SVN as r3185.
2009-07-20 03:50:25 +00:00
Amar Takhar e7f2dc00f7 Set wxAUI_MGR_RECTANGLE_HINT on Unix as Transparent and Venitian don't work here. I'm not sure if this is the fault of WindowMaker or GTK eventaully I'll try some other WMs and see what happens. This fixes floating windows and dragging them back/repositioning.
Originally committed to SVN as r3184.
2009-07-20 03:32:21 +00:00
Amar Takhar 77bacc0e53 Comment DRAG_BOTH events as the menu item is commented, this silences asserts for them in gtk.
Originally committed to SVN as r3183.
2009-07-20 03:28:05 +00:00
Amar Takhar 5b61da8337 s/^static char/const char/ to keep gcc happy.
Originally committed to SVN as r3182.
2009-07-20 03:24:18 +00:00
Amar Takhar 00fec11a64 Replace degree symbols with \370.
Originally committed to SVN as r3181.
2009-07-20 03:19:22 +00:00
Karl Blomster eae6fea9d9 The Great Colorspace Reworking of '09, part 1 of ???: remove all traces of the YV12->RGB32 OpenGL shader program, as it was very broken and nobody ever used it. Updates #926.
Originally committed to SVN as r3180.
2009-07-20 01:32:01 +00:00
Karl Blomster 17abf6965e Remove some useless commented-out code and an unused variable in video_context.cpp; neither have been used since Moses crossed the Red Sea.
Originally committed to SVN as r3179.
2009-07-20 00:45:11 +00:00
Karl Blomster 9ff3762eaf Removed the extremely deprecated fps parameter of the video provider constructors, since it hasn't been used by anything for years and was of questionable utility when it actually was used in the Elder Days.
Originally committed to SVN as r3178.
2009-07-20 00:39:38 +00:00
Karl Blomster 9e150d282d Cosmetics in the y4m video provider
Originally committed to SVN as r3177.
2009-07-19 22:51:19 +00:00
Amar Takhar c329c4e047 Update to 9ad13b from the libass git repo. (http://greg.geekmind.org/viewgit/) This change also includes the ability to split off fontconfig cache updating into it's own step so dialogues can be used to warn the user about the font cache being updated (it can take several mins on slow machines with lots of fonts). Updates #841
Originally committed to SVN as r3176.
2009-07-19 19:33:29 +00:00
Amar Takhar ee537d06f6 Add missing <wx/filename.h> and <wx/log.h> headers.
Originally committed to SVN as r3175.
2009-07-19 18:50:27 +00:00
Amar Takhar 2ef6260938 Move +AM_PROG_CC_C_O after AC_PROG_CC to silence automake 1.10
Originally committed to SVN as r3169.
2009-07-19 18:33:08 +00:00
Karl Blomster 2b2a7f4212 Implement a YUV4MPEG video provider. (YUV4MPEG is an uncompressed video format originally created for use by mjpegtools but is also commonly used by a lot of Unix video software; see http://wiki.multimedia.cx/index.php?title=YUV4MPEG2 or http://manpages.ubuntu.com/manpages/karmic/en/man5/yuv4mpeg.5.html (man 5 yuv4mpeg, if you have mjpegtools installed) for a description of the format.)
Currently lacks a few features (no RFF flag parsing is done, interlacing is not supported and the colorspace conversion to RGB32 could stand considerable improvement) but at least now Aegisub is capable of reading video without FFMS2 or Avisynth. Updates #920.

Originally committed to SVN as r3168.
2009-07-19 04:13:46 +00:00
Karl Blomster ff0787d29c Updated German translation (fixes some typos etc) by Sebastian Billau (sebastian u billau a web d de). This translation update should be backported into 2.1.8.
Originally committed to SVN as r3165.
2009-07-18 21:00:57 +00:00
Karl Blomster c6a5ff07d7 Fix a very embarrassing bug (I mixed up the track masks in r3155).
Originally committed to SVN as r3164.
2009-07-18 20:03:32 +00:00
Thomas Goyne c02f953ee0 Made the style sorting code only append each style once even when multiple styles have the same name. Closes #922.
Originally committed to SVN as r3163.
2009-07-18 04:37:43 +00:00
Thomas Goyne 0fa0d9d17e Add some parentheses for clarity.
Originally committed to SVN as r3162.
2009-07-18 03:58:22 +00:00
Thomas Goyne 6608ff47b5 Made the check for duplicate style names when creating or editing styles case insensitive. Closes $777.
Originally committed to SVN as r3161.
2009-07-18 03:45:16 +00:00
Thomas Goyne a7d0b591f8 Rewrote code for copying styles to and from storages, making it correctly replace styles of the same name that already exist in the target. Updates #922.
Originally committed to SVN as r3160.
2009-07-18 02:52:46 +00:00
Thomas Goyne c2087304fc A few minor cleanups to the new charset conversion code.
Originally committed to SVN as r3159.
2009-07-18 00:58:13 +00:00
Amar Takhar 779dcadc69 Add missing fixes for libauto3 to Makefile.am and commit the actual changes to libauto3/
Originally committed to SVN as r3158.
2009-07-17 20:58:45 +00:00
Amar Takhar e2e859b8f4 Exit with the previous commands exit status incase it failes: In this case copying the aegisub binary into the bundle.
Originally committed to SVN as r3157.
2009-07-17 19:52:08 +00:00
Amar Takhar 51c7ead1b8 s/2_1/2_2/ in Makefile.am This is required for two reasons:
* Aegisub is monolithic
 * Automakes idea of sending flags to specific files is in creading 17,000 different libraries (which beacuse of point #1.)

Originally committed to SVN as r3156.
2009-07-17 19:50:59 +00:00
Karl Blomster 58539b885d Replace FFMSTrackMask[All|None] with #defines instead. (Was causing linking problems with some compilers for some reason).
Originally committed to SVN as r3155.
2009-07-16 21:40:17 +00:00
Amar Takhar 8af125b88c Remove FFMPEG files from _SOURCES -- these shouldn't have been here in the first place. Updates #921.
Originally committed to SVN as r3154.
2009-07-16 20:03:47 +00:00
Karl Blomster 62b036ac35 Fix accidental inclusion of test code in last commit.
Originally committed to SVN as r3153.
2009-07-16 19:25:43 +00:00
Karl Blomster 8087622edd Fix an ancient bug in the ffms2 video provider that caused access violations when trying to output YV12 images. Nobody discovered this before because nobody tried to use YV12.
Originally committed to SVN as r3152.
2009-07-16 19:20:14 +00:00
Amar Takhar fb8196dcf8 Chase r3148 and r3149 and remove the FFMPEG video provider from the unix build system. Updates #921.
Originally committed to SVN as r3150.
2009-07-16 19:16:31 +00:00
Karl Blomster cdc69b847f Remove the deprecated ffmpeg providers from the MSVC2008 project file.
Originally committed to SVN as r3149.
2009-07-16 19:11:00 +00:00
Karl Blomster dfea9f9713 Remove the deprecated ffmpeg audio/video providers. They have not yet been removed from any of the build systems; verm will remove them from the Unix one and I will remove them from the MSVC project file shortly.
Originally committed to SVN as r3148.
2009-07-16 19:08:40 +00:00
Karl Blomster e589bceaa6 The caching video provider should not force RGB32. Nobody really cared about this because Aegisub always uses RGB32 unless you flip secret switches and whatnot, but it's not right and other colorspaces may be used in the future.
Originally committed to SVN as r3147.
2009-07-16 18:50:16 +00:00
Karl Blomster 491fa10ff1 Fix a regression introduced by Plorkyeran's iconv patch that caused the text file reader to throw an exception when trying to read an empty file.
Originally committed to SVN as r3146.
2009-07-16 15:10:40 +00:00
Karl Blomster c33ed91b12 Implement support for multiple tracks in the FFMS2 audio and video providers. Files with more than one audio or video track will now let the user pick which one he/she wishes to load. Closes #905.
Originally committed to SVN as r3145.
2009-07-16 14:48:47 +00:00
Karl Blomster 5cb4d1cae3 Revert r3137 for video_provider_ffmpegsource.cpp; the patch fixed an issue that had already been fixed (by using UTF8 instead of the local codepage).
Originally committed to SVN as r3144.
2009-07-15 04:02:15 +00:00
Niels Martin Hansen ece75e0652 Make version checker include current version (source SVN revision) in request for latest.txt, for statistics purposes.
Originally committed to SVN as r3140.
2009-07-14 23:23:39 +00:00
Karl Blomster b2c1eced55 Make the name of the limit to visible lines export filter translatable. Fixes #789.
Originally committed to SVN as r3139.
2009-07-14 22:29:38 +00:00
Niels Martin Hansen 24de0a249a Add missing iconv include dir to MSVC project property sheet.
Originally committed to SVN as r3138.
2009-07-14 21:57:38 +00:00
Thomas Goyne 0ea2c53c1a Replaced most wx-based charset conversions with a custom iconv-based conversion. Closes #639, #666, #837, #849 and #877.
Originally committed to SVN as r3137.
2009-07-14 21:28:49 +00:00
Amar Takhar dac40729e0 s/greg_/Grigori Goronzy/ for the libass credit updates #894.
Originally committed to SVN as r3135.
2009-07-14 19:45:43 +00:00
Amar Takhar 49a116804d Change version in version.cpp and configure.in to 2.2.0, the string freeze is officially over and all the commits we've been holding back can now go in!
Originally committed to SVN as r3134.
2009-07-14 18:15:11 +00:00
Niels Martin Hansen 26c9dd2ce6 More cleanup of local config:
* Remove option from Options dialogue, it's an install-time thing really
 * Don't try to do file associations at startup if we're portable
 * General clean up of config handling code; properly make ?user point to ?data and then everything magically follows, makes a lot of handling cleaner

Originally committed to SVN as r3131.
2009-07-14 04:51:35 +00:00
Niels Martin Hansen f1c7ed639d Properly fix "local config" option, previously it only made config.dat local and kept everything else in %APPDATA% still. Now fixed, along with a load of other problematic uses of relative paths. Still a lot more to go.
This also makes a bit of sense of the default options for various paths that previously were implicitly relative to ?user or ?data but never explicitly specified in options.

Originally committed to SVN as r3130.
2009-07-14 03:02:17 +00:00
Karl Blomster 2f65a5bb68 Remove the dangerous CopyFile function that on Unix attempted to create hard links of files instead of copying them. Replace it with wxCopyFile instead. Patch by jfs. Fixes #912.
Originally committed to SVN as r3129.
2009-07-14 02:20:40 +00:00
Niels Martin Hansen 68481215c9 Apply patch to fix #910.
Originally committed to SVN as r3128.
2009-07-14 02:00:56 +00:00
Niels Martin Hansen 543fd177d5 More minor fixes to Windows installer... we're installing VSFilter 2.39e from guliverkli2 and not one from MPC-HC, and list a couple more files for the pre-install cleanup jobs.
Originally committed to SVN as r3127.
2009-07-14 00:15:42 +00:00
Amar Takhar 0816491057 Add src/core/*.h not core/*.h to SOURCES for distfiles.
Originally committed to SVN as r3126.
2009-07-13 23:26:03 +00:00
Niels Martin Hansen b73d64959e Even more changes to Windows installer:
* Include ffms2.pdb
 * Have some files/actions depend on multiple components

Originally committed to SVN as r3125.
2009-07-13 23:09:30 +00:00
Niels Martin Hansen 7eb58e57e2 Fix include path for MSVC project to point to the new location of ffms2 sources.
Originally committed to SVN as r3124.
2009-07-13 22:43:46 +00:00
Amar Takhar c2d4884148 Update libass to 94d4104 from http://greg.geekmind.org/viewgit/.
Originally committed to SVN as r3123.
2009-07-13 22:43:25 +00:00
Niels Martin Hansen 7532387444 Remove further deprecated compiler flags causing warnings from MSVC projects.
Originally committed to SVN as r3122.
2009-07-13 22:42:17 +00:00
Amar Takhar 75bfada57e Actually fix libosxutil includes, as many times as I'd like to belive using 'diff' to transfer from a working copy to a non-working copy is the safest I always endup convincing myself that it's impossible to screw-up a _two_ line patch.
Originally committed to SVN as r3121.
2009-07-13 22:38:43 +00:00
Niels Martin Hansen 882ea814ab Remove a deprecated compiler flag causing warnings during universalcharset build on Windows.
Originally committed to SVN as r3120.
2009-07-13 22:37:19 +00:00
Amar Takhar 11bda97f9d I can't belive these snuck in, I specifically ensured they wern't there but obviously I didn't do nearly a good enough job!
Originally committed to SVN as r3119.
2009-07-13 22:35:26 +00:00
Amar Takhar 4599eec308 Wrap libosxutils headers with "extern C"
Originally committed to SVN as r3118.
2009-07-13 22:32:11 +00:00
Amar Takhar 5ad6e777d3 Build changes for the new ffms, TheFluff will be comitting the aegisub changes shortly.
Originally committed to SVN as r3117.
2009-07-13 22:30:49 +00:00
Karl Blomster a45282bfbb Update the FFMS2 audio and video providers to use the new API features.
Originally committed to SVN as r3116.
2009-07-13 22:30:48 +00:00
Amar Takhar 5dc912bf4d Update to the latest ffms (r116) from http://code.google.com/p/ffmpegsource/.
Originally committed to SVN as r3115.
2009-07-13 22:27:40 +00:00
Amar Takhar 24be06341a Rename FFmpegsource2/ to libffms/ before the update to r115 from the ffms repo. This doens't make any build changes so things will be broken in this commit.
Originally committed to SVN as r3114.
2009-07-13 22:19:44 +00:00
Niels Martin Hansen 234ee0d3dc More little changes to Windows installer:
* Don't include dictionaries and thesaurii if they don't exist on the machine building the installer
 * Sprinkle some more 'solidbreak' flags around, hoping to make compact/custom installations spend less time decompressing huge files that won't be installed

Originally committed to SVN as r3113.
2009-07-13 21:48:53 +00:00
Niels Martin Hansen d665909687 Add Russian dictionary and thesaurus files to Windows installer.
Originally committed to SVN as r3112.
2009-07-13 21:38:58 +00:00
Niels Martin Hansen 9c4407729b Some changes to file ordering, and cosmetic changes, in Windows installer script.
Originally committed to SVN as r3111.
2009-07-13 21:26:28 +00:00
Niels Martin Hansen ac64269ade Preparing for 2.1.7 release, new URLs for latest.txt.
Originally committed to SVN as r3110.
2009-07-13 18:31:43 +00:00
Karl Blomster d37e0f69fb Missed two renamings in the last commit.
Originally committed to SVN as r3109.
2009-07-13 02:48:07 +00:00
Karl Blomster 1f55f362fb Hack in some compatibility #defines in FFMS2's utils.h so it'll compile with both older and newer ffmpeg versions. Reverts r3012. Part of this change based on a patch by CharlieB. Fixes #909.
Originally committed to SVN as r3108.
2009-07-13 02:34:41 +00:00
Amar Takhar 24da41faaf * BUILD_DARWIN was a define used for libass only, change it to __APPLE__ (sigh)
* char config_path -> const char *config_path for non-MAC builds. not sure how the first version got in.

Originally committed to SVN as r3107.
2009-07-12 20:10:25 +00:00
Thomas Goyne fa3f5d11ef Made selecting a line via the visual typesetting drag mode also update the grid's selection, fixing one way of getting the edit box out of sync with the other non-time controls.
Originally committed to SVN as r3106.
2009-07-12 05:30:01 +00:00
Amar Takhar 43adde723c Fix OSX: Move our local libass patch into aegisub itself as libass now supports specifying a fontconfig config file.
Originally committed to SVN as r3105.
2009-07-11 17:28:27 +00:00
Amar Takhar e250deb10f Nuke the Windows (MSVC) support as libass will be adding their own official support, it's not like we're using it anyway..
Originally committed to SVN as r3104.
2009-07-11 15:55:52 +00:00
Amar Takhar 76c2d1bd41 Remove mputils.(c|h) as they're no longer needed.
Originally committed to SVN as r3103.
2009-07-11 15:54:38 +00:00
Amar Takhar df2b0b5b67 Update libass to 15df37.
Originally committed to SVN as r3102.
2009-07-11 15:48:50 +00:00
Amar Takhar 06259dfb1e Disable Fortran checks, thanks Greg! For whatever reason I only looked at the autoconf source, sigh.
Originally committed to SVN as r3101.
2009-07-11 03:45:03 +00:00
Karl Blomster bf2b456f0c Re-fix the fix in r3091; the issue wasn't what I thought it was, it was that memory was being freed twice. Fixes #906.
Originally committed to SVN as r3100.
2009-07-08 13:30:24 +00:00
harukalover 6779781284 Fixed a memory leak that occurred when resetting hotkey defaults
Originally committed to SVN as r3099.
2009-07-06 05:01:55 +00:00
Amar Takhar fa54e72105 Even when we don't have any audio players audio_player.cpp is still required in order to register the fact that there are no audio players.
Originally committed to SVN as r3098.
2009-07-04 15:53:52 +00:00
Thomas Goyne 349dd2cfe4 Made the edit box only retain its internal undo history for changes made since the last commit or line switch rather than every state it has had since the program was started, fixing a gradual memory leak.
Originally committed to SVN as r3097.
2009-07-04 01:46:06 +00:00
harukalover 1cb43ba5c7 Increased the default size of the time edit control on wxGTK since it was still too small on some OS's after r3094
Originally committed to SVN as r3096.
2009-07-03 23:40:26 +00:00
Thomas Goyne 7ecbbf2e5c Fixed an issue with the Set Start/End to Video and Snap to Scene hotkeys and toolbar buttons where any uncommited changes in the editbox would be reverted. They now behave the same as setting the time via the text boxes.
Originally committed to SVN as r3095.
2009-07-03 18:35:46 +00:00
harukalover 4d0f48f303 Fixed the "Overwrite-Insertion in time boxes" option on Linux and enabled it as the default mode for the time edit boxes on all OS's instead of just Windows
Originally committed to SVN as r3094.
2009-07-02 17:29:20 +00:00
harukalover bd4644d1bd Fixed an issue with the spectrum slider not updating the color spectrum in the color picker dialog on Linux
Originally committed to SVN as r3093.
2009-07-02 03:33:28 +00:00
harukalover 58a7b112e1 Fixed removal of the color dropper tool on non-Windows platforms (it was still appearing, though misaligned in the color picker). updates #861
Originally committed to SVN as r3092.
2009-07-01 03:16:47 +00:00
Karl Blomster 383d0f3149 Fix a potential crash on exiting. (An invalid memory location could under certain circumstances be assigned to in the OpenGLTextTexture destructor.)
Originally committed to SVN as r3091.
2009-06-30 20:44:38 +00:00
harukalover b3a69668bf * Fixed an issue with aegisub not trying to open the local config.dat in Windows builds, fixes #902
* Fixed an issue with aegisub failing to start if a local config.dat existed but aegisub did not have permission to write to it

Originally committed to SVN as r3090.
2009-06-30 05:55:03 +00:00
harukalover 2e86a73205 Fixed a new[]/delete mismatch
Originally committed to SVN as r3089.
2009-06-30 05:29:15 +00:00
Amar Takhar e2aa20949d Add ass_cache_template.c to EXTRA_DIST. I remember fixing it, however I forgot to commit it..
Originally committed to SVN as r3088.
2009-06-28 23:39:42 +00:00
Amar Takhar 59e6ca965f Unbreak Unix/OSX from r3085, I'll let jfs do a proper fix when he's around. Updates #884.
Originally committed to SVN as r3087.
2009-06-25 02:31:35 +00:00
Niels Martin Hansen a4573a1c72 For whatever reason, the right-click-to-play-syllable code in karaoke mode was calling the audio player directly, instead of using the usual Play function in the audio display. Fixes #598 for real.
Originally committed to SVN as r3086.
2009-06-25 00:32:33 +00:00
Niels Martin Hansen beedca2fba Fix #884, annoying wxString::Trim is destructive and there's no non-destructive variant. Adding a new function to utils.cpp to test whether a string is "blank", ie. empty or whitespace-only, as well as a function to check if a wchar_t is a whitspace character.
Trimming was used to test whether a string was blank or not, and this caused the source syllable texts to be altered when the kanji interpolation algorithm was run.

Originally committed to SVN as r3085.
2009-06-24 22:22:45 +00:00
Karl Blomster a7760db77b Adjust the way VFR is handled in VideoContext::SetVideo; should be cleaner and less prone to odd bugs now (hopefully). Doesn't try to set CFR framerates on VFR videos anymore, for one thing. Fixes #864.
Originally committed to SVN as r3084.
2009-06-24 18:16:03 +00:00
Karl Blomster 2e9439c9f5 Implement timestamp reading from the container in the ffmpeg video provider. Updates #864.
Originally committed to SVN as r3083.
2009-06-24 17:43:36 +00:00
Karl Blomster 06ff786c60 Updated Czech translation by Christof (christof a totan d cz). Fixes #900
Originally committed to SVN as r3082.
2009-06-24 15:47:51 +00:00
harukalover ee37d42618 Fixed an issue with Shift to Current Frame not updating the time edit boxes in the subs edit box, resulting in commit using the previous no longer valid times. Fixes #897
Originally committed to SVN as r3081.
2009-06-19 22:18:30 +00:00
Niels Martin Hansen b0a9c3bc8d Add iconv project to Windows tinderbox solution file, and make the Aegisub project dependent on it, in preparation of iconv patch.
Originally committed to SVN as r3079.
2009-06-17 18:24:15 +00:00
Niels Martin Hansen 16a9521b0f Put iconv.vcproj in line with the other contrib etc. vcprojs:
* Add x64 configurations
 * Add contrib-outdirs.vsprop property sheet to put output dirs in line

Originally committed to SVN as r3078.
2009-06-17 17:55:30 +00:00
Thomas Goyne 80cb69f2ef Added a stripped down version of iconv with everything but libiconv and libcharset removed and a vcproj for building in MSVC added.
Originally committed to SVN as r3077.
2009-06-17 17:48:27 +00:00
Niels Martin Hansen ce60827866 I can't spell names...
Originally committed to SVN as r3076.
2009-06-17 04:10:11 +00:00
Niels Martin Hansen e20204610f New config for Windows buildbot.
* Add ffms2 support to build
 * Make sure Avisynth and ffms2 support is only built in 32 bit builds, as they can't work in 64 bit yet.

Originally committed to SVN as r3075.
2009-06-17 03:57:03 +00:00
Niels Martin Hansen 33d1b6d7d0 Change some nicknames for real names in About box, updates #894.
Originally committed to SVN as r3074.
2009-06-17 02:42:26 +00:00
harukalover d83b19e57b Fixed a memory leak that occurred from canceling loading of audio with cache type set to RAM
Originally committed to SVN as r3073.
2009-06-17 02:04:01 +00:00
Amar Takhar 0d54078d93 Add cs (Czech) to LINGAS, anytime a language is added don't forget to add the file here!
Originally committed to SVN as r3072.
2009-06-17 01:45:13 +00:00
Niels Martin Hansen b6e83c5edb New background for DMG for Mac OS X installs. Closes #869.
Originally committed to SVN as r3071.
2009-06-17 01:43:00 +00:00
Amar Takhar e571fe0500 Remove whats probably a cut and paste-o introduced in r3069.
Originally committed to SVN as r3070.
2009-06-17 01:02:32 +00:00
Niels Martin Hansen 531831250a Update credits in About box, see #894.
Originally committed to SVN as r3069.
2009-06-17 00:49:41 +00:00
Niels Martin Hansen b90baf0ef4 Fix #885, for some reason mouse events were firing in the audio display while some internal variables were invalid. Now mouse events are skipped if the display is missing a player or provider.
Originally committed to SVN as r3068.
2009-06-16 23:44:06 +00:00
Niels Martin Hansen 8e13869510 Got all the Unicode codepoints listed in Plorkyeran's patch and listed them in an array, to avoid encoding the source file as UTF-8 or UTF-16. Updates #710, seems to fix it but someone please confirm.
Originally committed to SVN as r3067.
2009-06-16 23:29:56 +00:00
Niels Martin Hansen de5c5ea24b Add all translations to installer, comment out those that aren't up to date.
This should be all required for 2.1.7, so close #863.

Originally committed to SVN as r3066.
2009-06-16 21:23:53 +00:00
Niels Martin Hansen e0a3aeca3d Fix #892, LuaScriptReader wasn't checking if opening the file actually succeeded.
Check, and throw an exception if it fails.

Originally committed to SVN as r3065.
2009-06-16 21:21:25 +00:00
Niels Martin Hansen bab71db434 * Change version string formatting to a cleaner format.
* Non-FINAL_RELEASE builds no longer show a version number, only SVN revision.
 * FINAL_RELEASE builds show SVN revision in About box only.
 * Also change FINAL_RELEASE version number to 2.1.7.

Originally committed to SVN as r3064.
2009-06-16 19:11:08 +00:00
Niels Martin Hansen 7097b3be3e New splash screen, following theme from Windows installer splash: Faded out and cropped shield in background, logo superimposed.
Closes #858 unless someone complains loudly.

Originally committed to SVN as r3063.
2009-06-16 19:08:54 +00:00
Niels Martin Hansen 4967c9d4a5 Updates to installer, see #863.
* Add bitmaps for large fonts configurations of Windows to installer.
 * Add auto-complete support to dir entry box in installer.
Thanks to ender.

Originally committed to SVN as r3062.
2009-06-16 18:17:33 +00:00
Niels Martin Hansen 9d47842aa7 Remove unused RuntimeTestLibrary code.
Originally committed to SVN as r3061.
2009-06-16 17:34:21 +00:00
Niels Martin Hansen 45f4a16001 Updated splash image for Windows installer, updates #863.
Also includes Paint.NET source image.

Originally committed to SVN as r3060.
2009-06-16 17:33:41 +00:00
Niels Martin Hansen 66a35cad87 Update license file installed with Windows version, also see #863.
Originally committed to SVN as r3059.
2009-06-16 17:23:59 +00:00
Niels Martin Hansen 766dcf3c3f More updates to installer, updates #863.
* Use a simple but (hopefully) very reliable way of detecting whether runtimes need to be installed: Check for an uninstaller entry for the runtimes.
 * Clean up from most, hopefully all, 2.x alpha and pre-release installers we have previously put out.
 * Also clean combinations of 1.x and 2.x pre-rel versions installed on top of each other.
 * TODO: List all completed translation files for installation.

Originally committed to SVN as r3058.
2009-06-16 17:09:42 +00:00
Niels Martin Hansen 9aaa1ed903 Installer updates for 2.1.7:
* Now picks up (almost) all files from a tree in src/ under dir with the .iss file
 * Perfect (I think) upgrade from 1.x versions
 * Remove the compile defines stuff, there's only one installer version
 * Good, old-fashioned unconditional installation of MSVC runtimes
To be done:
 * Upgrades from earlier 2.x versions (need to collect samples to test against)

Originally committed to SVN as r3057.
2009-06-16 02:06:09 +00:00
harukalover 0d1ede1ed1 Fixed a memory leak that would occur when loading audio while using the hard disk cache
Originally committed to SVN as r3056.
2009-06-14 04:29:20 +00:00
Niels Martin Hansen f20d079598 Fix #890, make the output formatting for Adobe Encore format use a format string for clearness, instead of string building.
Originally committed to SVN as r3055.
2009-06-14 02:42:52 +00:00
Amar Takhar ebcfe43d7e Add -I../FFmpegSource2 to AM_CXXFLAGS. This is *definatly* not the right way to do it, it's a temp measure until I figure out the best way to handle it.. updates #883.
Originally committed to SVN as r3054.
2009-06-12 17:26:56 +00:00
Niels Martin Hansen 5f7884ab22 Add FINAL_RELEASE and WITH_STARTUPLOG defines (both commented out) in config_windows0.h base.
Originally committed to SVN as r3053.
2009-06-12 17:13:22 +00:00
Karl Blomster 956f657c8d - Moved lib/ffms2.lib to FFmpegSource2/ffms2.lib.
- Deleted the lib folder since nothing uses it anymore.
- Modifed the #include of ffms.h in ffmpegsource_common.h to make it easier to use an external ffms2 instead of the one in the repository.
- Updated vs2008 project file to reflect these changes.
- Easily claims build breaker's hat.

Originally committed to SVN as r3052.
2009-06-12 17:10:45 +00:00
Niels Martin Hansen ac18b4889b Add super secret WITH_STARTUPLOG define, if enabled it causes insane amounts of message box spam during startup. Currently only implemented on Windows and should be disabled for almost all conceivable purposes.
Originally committed to SVN as r3051.
2009-06-12 16:59:53 +00:00
harukalover 769f61eaf3 Fixed a memory leak that would occur after using any help button
Originally committed to SVN as r3050.
2009-06-12 00:04:35 +00:00
harukalover 4eeb89710d Fixed compilation support with wxWidgets 2.9.0 (seems to work correctly besides some minor gui issues)
Originally committed to SVN as r3049.
2009-06-11 23:30:33 +00:00
harukalover 41f71ca3be Update link to bug tracker in Help menu
Originally committed to SVN as r3048.
2009-06-11 18:04:48 +00:00
harukalover 5d010113f0 Oops, r3045 caused crashing issues when closing the translation assistant again. Fixed the crash without having to revert the fix for the memory leaks again.
Originally committed to SVN as r3047.
2009-06-11 08:13:54 +00:00
Amar Takhar 8cfb941a3c Remove *portaudio2.(cpp|h) from the vcproj.
Originally committed to SVN as r3046.
2009-06-11 03:00:12 +00:00
harukalover 7ac69a31b3 * Fixed an issue with the translation assistant not remembering the last position it was placed at before closing it
* Fixed some memory leaks in the translation assistant

Originally committed to SVN as r3045.
2009-06-11 02:33:21 +00:00
harukalover 9abcbe19b3 Fixed a memory leak in the auto4 ScriptFactory
Originally committed to SVN as r3044.
2009-06-11 02:17:42 +00:00
Amar Takhar 1b9f38747b Supplant the portaudio player with the portaudio2 player. This still doesn't handle some of the issues that happen on linux, that will be fixed in a later commit, updates #876.
Originally committed to SVN as r3043.
2009-06-10 04:45:57 +00:00
Amar Takhar 17f1ccac06 Completely revert r2970 as line 84 causes crashes elsewhere. While the rest may not cause any issues it's better to deal with some leaking memory than hard crashes.
Originally committed to SVN as r3042.
2009-06-10 03:49:59 +00:00
harukalover 10b8a6253b Fixed a memory leak that would occur when using the visual typesetting tools
Originally committed to SVN as r3041.
2009-06-10 03:32:18 +00:00
Amar Takhar eb27337349 Revert line 85 from r2970 as it causes aegisub to crash in very interesting ways. It's most likely not aegisubs fault entirely however removing this does fix the issue.
Originally committed to SVN as r3040.
2009-06-10 03:32:15 +00:00
Amar Takhar 5cff8b2d6a Remove support for old FFMPEG releases, if you require or want this support you are officially on your own, closes #875.
Originally committed to SVN as r3039.
2009-06-10 02:21:20 +00:00
Amar Takhar e2015ca7e9 The finance department (jfs) let me know that we don't depreciate things here, only deprecate.
Originally committed to SVN as r3038.
2009-06-10 02:15:40 +00:00
Amar Takhar 357b527249 Ensure the system 'convert' utility is actually from ImageMagick.
Originally committed to SVN as r3037.
2009-06-10 02:13:24 +00:00
Amar Takhar 08d507e40c Disable FFMPEG provider, use --with-provider-ffmpeg to enable, closes #874.
Originally committed to SVN as r3036.
2009-06-10 02:09:00 +00:00
Amar Takhar f8219e4863 Set versions for ffmpeg: avcodec 52.27.0, avformat 52.32.0, avutil 50.3.0, postproc 51.2.0 and swscale 0.7.1, all of these are from r18642 in ffmpeg.. updates #831
Originally committed to SVN as r3035.
2009-06-09 20:47:28 +00:00
Niels Martin Hansen 3c169039a6 Updated Russian translation, closes #865.
Originally committed to SVN as r3034.
2009-06-08 15:04:01 +00:00
Niels Martin Hansen 837755b349 Fix #872, make the gridlines colour be the same as the text colour in the kanji timer display.
Originally committed to SVN as r3033.
2009-06-08 03:34:09 +00:00
Niels Martin Hansen 4f3569b7d9 Mostly rewrite the kanji timer. Now using a custom control that avoids most of the problems the old implementation using text-boxes had. The new implementation unifies the pre-grouping and post-grouping display into one.
The auto-matching algorithm for Japanese was also rewritten, I think the new code works somewhat better. (For the song I used for testing, I can just hit Enter most of the way through, more than I remember being able to with the old.)
There are some slight oddities with the way the display scrolls when the input goes too close to the edge, but while it can feel confusing it should still keep everything you want to see, visible.
Fixes #847 and #708.

Originally committed to SVN as r3032.
2009-06-08 02:37:09 +00:00
Niels Martin Hansen bcd7e64bbd Extend the kana table with a bunch more specialty characters and notations, and comment the existing esoteric katakana entries.
Updates #847.

Originally committed to SVN as r3031.
2009-06-07 23:51:15 +00:00
Niels Martin Hansen eae8edcd1f The KanaTable was missing a destructor. Nobody noticed because the old kanji timer code created but never deleted KanaTable objects on the heap... yes that was a memory leak that'll also get plugged by the rewrite of the kanji timer.
Updates #847.

Originally committed to SVN as r3030.
2009-06-07 23:15:02 +00:00
harukalover 1d945b9b3d Made the styling assistant require a double click to select a style, this fixes issues with mistakenly selecting a style when the user is just trying to focus the assistant
Originally committed to SVN as r3029.
2009-06-07 03:43:12 +00:00
Niels Martin Hansen a1677d3a2c The AssEntry::Clone() function ought to have been const all the time... make it. (Ugh, I had to make a const_cast in AssStyle::Clone().)
Originally committed to SVN as r3028.
2009-06-07 00:22:36 +00:00
Niels Martin Hansen 1e4ec69f7f The AssKaraoke parser can just as well take a const AssDialogue for parameter.
Originally committed to SVN as r3027.
2009-06-07 00:20:30 +00:00
Amar Takhar 92d5324084 Fix #846, patch from pomyk, thanks!
Originally committed to SVN as r3026.
2009-06-06 21:05:31 +00:00
Niels Martin Hansen 6e2240166f A bit of const correctness for AssDialogue
Originally committed to SVN as r3025.
2009-06-06 19:32:17 +00:00
Niels Martin Hansen 51c36f2803 Close #491 (again), force the min-size of the detached video to be (1,1) after creation and layout.
Originally committed to SVN as r3024.
2009-06-06 14:36:22 +00:00
Niels Martin Hansen 6e144e6589 Fix #491: Let the detached video dialogue take a parameter indicating the initial video size.
Originally committed to SVN as r3023.
2009-06-06 02:57:42 +00:00
Niels Martin Hansen d56b5b1bf6 Fix #598, repaint the audio display upon playback to get rid of any junk on it.
Originally committed to SVN as r3022.
2009-06-06 02:32:31 +00:00
Niels Martin Hansen 0f2d39e28f Fix #787, make the Paste and Paste Over commands in the Edit menu sensitive to the current format on the clipboard and only enable them if plain text is a supported format. They will also be enabled if the clipboard fails to open, as a safety device.
Originally committed to SVN as r3021.
2009-06-06 02:16:20 +00:00
Niels Martin Hansen c0586f690c Close #861, remove colour dropper tool on non-Windows platforms for now.
Originally committed to SVN as r3020.
2009-06-06 01:59:33 +00:00
Niels Martin Hansen 4b41b4ca4a Fix #607: Have style editor save its position and size during the session, similar to how several other dialogues already do. The stored position is not persistent, it is lost when Aegisub is closed.
Originally committed to SVN as r3019.
2009-06-05 02:02:55 +00:00
Niels Martin Hansen c74a02e57d Clean up code in Style Editor a bit, remove no longer needed performance measurement code.
Originally committed to SVN as r3018.
2009-06-05 01:49:06 +00:00
Niels Martin Hansen 2feefd85fd Close #839, the Shift Times function will now only do something if shifting by a non-zero number of milliseconds, or always if shifting by a number of frames (even zero).
Originally committed to SVN as r3017.
2009-06-05 00:02:26 +00:00
Niels Martin Hansen ce015fc820 Add sample endianness info to all audio providers (except one, intentionally; see the stream provider changeset), and make the converting audio provider convert to native endian when required. Updates #725 but needs some testing. Might break compilation in some places, but shouldn't. ("Works for me.")
Originally committed to SVN as r3016.
2009-06-04 23:02:29 +00:00
Niels Martin Hansen 88a5335004 Adjust calculation of secondary colour for checkerboard pattern in dummy video provider. New calculation produces better results for dark colours, the old calculation produced very high contrast patterns for dark colours.
Originally committed to SVN as r3015.
2009-06-04 02:28:46 +00:00
Niels Martin Hansen 26ac4e65f8 Another shot at fixing wxGLCanvas woes on Mac, updates #850. This time the code is also considerably simpler!
Originally committed to SVN as r3014.
2009-06-04 02:05:11 +00:00
Niels Martin Hansen d6a8a07845 Experimental stuff trying to fix wxGLContext errors on Mac, updates #850. Untested, might break build for Mac.
Originally committed to SVN as r3013.
2009-06-04 01:35:11 +00:00
Amar Takhar 4afd28b60a Revert part of r3005, rename AV_PKT_FLAG_KEY back to PKT_FLAG_KEY, ffmpeg has added a compat define for any programs still using the old define. This is a temporary measure until we figure out how to properly handle it.
Originally committed to SVN as r3012.
2009-06-04 00:17:14 +00:00
Niels Martin Hansen 390fb2d03c Remove all traces of local configuration support ("portable application") in non-Windows builds. Closes #856.
Originally committed to SVN as r3011.
2009-06-03 23:42:47 +00:00
Niels Martin Hansen 4b986b5a53 Make the visual typesetting toolbar a bit prettier on Vista and probably also Win7, by removing themed background that didn't blend in with the surroundings.
Originally committed to SVN as r3010.
2009-06-03 23:18:40 +00:00
Niels Martin Hansen f4939c082a Really fix detached video, closes #853.
Originally committed to SVN as r3009.
2009-06-03 23:08:40 +00:00
Niels Martin Hansen 6dc3015962 Work on fixing detached video, still broken but works a little better now. Updates #853.
Originally committed to SVN as r3008.
2009-06-03 23:01:03 +00:00
harukalover 614f2ef559 Fixed a memory leak that occurred when using undo/redo, fixes #330
Originally committed to SVN as r3007.
2009-06-03 19:55:39 +00:00
harukalover 1d55e6b7b2 Add some sanity checking to SelectRow to prevent an invalid row from being selected when undoing line insertions
Originally committed to SVN as r3006.
2009-06-03 19:04:54 +00:00
Fredrik Mellbin 1c5ff247f6 FFMS2:
Flag keyframes in generated packets more properly
Requires FFmpeg r19078 to compile because of the changed define names

Originally committed to SVN as r3005.
2009-06-03 14:35:21 +00:00
Amar Takhar ccde9fd3d8 Work around ancient versions of intltool...
Originally committed to SVN as r3004.
2009-06-02 01:58:00 +00:00
Amar Takhar 7eada86cde Print the configure commandline before running it.
Originally committed to SVN as r3003.
2009-06-02 01:56:47 +00:00
Amar Takhar bde1c68018 Fix FreeBSD dist building under buildbot.
Originally committed to SVN as r3002.
2009-06-02 01:56:29 +00:00
Amar Takhar d603ceeda9 Fix osx-bundle and osx-dmg breakage after adding buildbot support, both scripts now accept spaces in the directory names.
Originally committed to SVN as r3001.
2009-06-02 00:16:45 +00:00
Niels Martin Hansen f13d23509a Fix #859, or rather work around it. There's no good way to detect problematic regexes like the example, and the regex engine lies in wx, so we'll have to do with what wx offers. Put a limit of at most 1000 replacements per line processed, that "should be enough for everyone", and avoids infinite looping.
(Also 3000 GET!)

Originally committed to SVN as r3000.
2009-06-01 15:44:59 +00:00
Niels Martin Hansen 386cc9d3cd Reword error messages introduced in r2998 to make it Aegisub's fault and not the graphics drivers'. Even if our code is technically correct, it's still our problem.
Updates #799.

Originally committed to SVN as r2999.
2009-06-01 15:29:22 +00:00
Niels Martin Hansen 60970e5f29 Add some error catching in the OpenGL code, this should make most OpenGL-related problems less fatal, though it can still cause funky UI problems I think.
At least the user should get a slightly more useful error message now.
Updates #799.

Originally committed to SVN as r2998.
2009-06-01 15:26:26 +00:00
Niels Martin Hansen da78539ab2 Make DSound2 audio player use dynamic latency trickery and only do streaming (looping buffer) playback for long playback durations. This should fix most if not all "could not lock buffer" errors and close #855.
Originally committed to SVN as r2997.
2009-06-01 14:53:18 +00:00
Niels Martin Hansen db27d770f6 Fix #599, the wrong overload for wxSpinCtrl::SetValue was used causing only the edit control part to be updated.
Originally committed to SVN as r2996.
2009-06-01 13:57:34 +00:00
Karl Blomster fa73db1bf1 Update ffms2.lib
Originally committed to SVN as r2995.
2009-06-01 13:55:06 +00:00
Fredrik Mellbin 6542dd416d FFMS2: Improve LAVF audio seeking in weird files
Originally committed to SVN as r2994.
2009-05-29 16:35:10 +00:00
Fredrik Mellbin eaecf59d91 FFMS2: beta 9 TAG!
Originally committed to SVN as r2993.
2009-05-28 20:26:18 +00:00
Fredrik Mellbin ea80b6c130 Changes required to compile because of the previous commit
Originally committed to SVN as r2992.
2009-05-28 19:34:52 +00:00
Fredrik Mellbin 841150b2b7 FFMS2:
Renamed a public api function just because I can
Less access violations (AGAIN!)
Dumping now implies indexing too
Much better logic for automatically indexing files when FFAudioSource is used in avisynth
Changed defaults for FFIndex
Now FFmpeg's internal codec lists are used for lookup from the non-lavf based parts

Originally committed to SVN as r2991.
2009-05-28 19:33:14 +00:00
harukalover dfdea0298b Revert r2965 and r2961, although they fixed the memory leaks they also caused a crash when closing either dialog under some operating systems
Originally committed to SVN as r2990.
2009-05-27 02:08:21 +00:00
Karl Blomster 379f15659a Do COM initialization more properly (I think) in the FFMS2 providers.
Originally committed to SVN as r2989.
2009-05-25 16:42:33 +00:00
Karl Blomster 200b3393f9 Another missing ifdef in ffmsindex
Originally committed to SVN as r2988.
2009-05-25 16:28:28 +00:00
Fredrik Mellbin 9cb8cb25cf FFMS2: unix ifdefs in ffmsindex
Originally committed to SVN as r2987.
2009-05-25 16:25:43 +00:00
Karl Blomster c8b125943c Update FFMS2 providers to initialize COM when running under Windows, as per the new FFMS2 init procedure.
Originally committed to SVN as r2986.
2009-05-25 15:52:42 +00:00
Karl Blomster 50069248e9 Update FFMSIndex to work with the new audio dump method.
Also update ffms2.lib (again).

Originally committed to SVN as r2985.
2009-05-25 15:50:31 +00:00
Fredrik Mellbin 9fe7b04830 FFMS2: revert the initialization mess, instead require the caller to initialize com where it's needed
Originally committed to SVN as r2984.
2009-05-25 14:05:04 +00:00
Karl Blomster ab5bc99e94 Update ffms2.lib
Originally committed to SVN as r2983.
2009-05-25 13:44:27 +00:00
Niels Martin Hansen a1a4d797e7 Turn broken hotkeys.dat file into a non-fatal error. If the file is broken (usually meaning exists but empty) the existing file will now be copied to hotkeys.bak and the defaults restored and saved as hotkeys.dat.
Originally committed to SVN as r2982.
2009-05-24 23:19:28 +00:00
Fredrik Mellbin c8768d8043 FFMS2: more initialization fun
Originally committed to SVN as r2981.
2009-05-24 23:04:11 +00:00
Karl Blomster cf03d252ca Update ffms2.lib as per usual
Originally committed to SVN as r2980.
2009-05-23 23:03:57 +00:00
Fredrik Mellbin f1fbef752c FFMS2: The usual small fixes
Originally committed to SVN as r2979.
2009-05-23 20:04:38 +00:00
Fredrik Mellbin 3220a2301a FFMS2:
Simplify the avisynth filters
Small api change => you can now list a group of desired colorspace output formats for automatic selection, less functions can return errors
Less singnedness warnings

Originally committed to SVN as r2978.
2009-05-23 14:18:51 +00:00
Fredrik Mellbin e772ad5e10 FFMS2: Use the average fps for files opened with Haali's splitters
Originally committed to SVN as r2977.
2009-05-22 23:41:37 +00:00
Fredrik Mellbin 159552f36e FFMS2:
Fix the weird crash bug
Fix *nix compilation

Originally committed to SVN as r2976.
2009-05-22 23:28:08 +00:00
Fredrik Mellbin 870f46f85e FFMS2: Missing #ifdef
Originally committed to SVN as r2975.
2009-05-22 22:12:31 +00:00
Karl Blomster a3ad037940 Fix ffms2 providers to work with latest FFMS2 API changes.
Originally committed to SVN as r2974.
2009-05-22 21:44:02 +00:00
Karl Blomster 4775179491 Update ffms2.lib to get in sync with last commit.
Originally committed to SVN as r2973.
2009-05-22 21:30:57 +00:00
Fredrik Mellbin 4165b7c963 FFMS2:
Added audio decoding using Haali's splitters
Restructuring
Big API changes
Many bug fixes

Originally committed to SVN as r2972.
2009-05-22 21:28:02 +00:00
Niels Martin Hansen 2377b1455e Increase grabbing zone for karaoke split markers from 4 to 7 pixels, makes dragging much easier, speeding up work.
Originally committed to SVN as r2971.
2009-05-22 14:30:51 +00:00
harukalover 10a11ce0cc Fixed some of the larger memory leaks in the LibassSubtitlesProvider detected by valgrind
Originally committed to SVN as r2970.
2009-05-22 04:09:09 +00:00
harukalover 17f0e664f0 Initialize a variable in the audio display that sometimes was used without any initial value being assigned to it.
Originally committed to SVN as r2969.
2009-05-22 02:27:36 +00:00
Niels Martin Hansen ef4021f757 Make error handling in DSound2 audio player more robust. When an error happened in the playback thread, the error_happened flag was set, but was never cleared when the error was detected in the main thread. Furthermore, the main thread didn't act upon the error besides showing it, it kept acting as if the playback thread was still alive and playing, causing the error to be triggered continuously requiring you to kill Aegisub to get out.
Made the error_happened event reset itself after being checked so the check only succeeds the first time. (The playback thread returns from its threadproc upon error.) Mark playback thread as dead when error is detected, such that a new thread will be created next time playback is started, effectively making errors non-fatal.
Playback still works as expected, however I haven't tested what actually happens now when an error occurs.

Originally committed to SVN as r2968.
2009-05-22 01:41:31 +00:00
harukalover bceabf4848 Fixed some mismatched new[]/deletes in the audio display detected by valgrind
Originally committed to SVN as r2967.
2009-05-22 00:05:25 +00:00
harukalover fff437ea19 Fixed a memory leak in the CSRISubtitlesProvider
Originally committed to SVN as r2966.
2009-05-21 23:02:34 +00:00
harukalover b4a5032b2e Fixed some memory leaks in the kanji timer
Originally committed to SVN as r2965.
2009-05-21 22:57:43 +00:00
harukalover ecc4b618b3 Fixed a memory leak in the style manager, the storage of catalog styles was never being cleared when closed.
Originally committed to SVN as r2964.
2009-05-21 22:24:52 +00:00
harukalover acf2f5fa40 Fixed some memory leaks in the style manager detected by valgrind
Originally committed to SVN as r2963.
2009-05-21 22:15:32 +00:00
harukalover 68d2681193 Fixed a memory leak in the dummy video provider detected by valgrind. The video frame was being allocated but never deallocated.
Originally committed to SVN as r2962.
2009-05-21 19:49:23 +00:00
harukalover 350d9e5db7 Fixed some memory leaks in the translation assistant detected by valgrind
Originally committed to SVN as r2961.
2009-05-21 18:37:36 +00:00
Fredrik Mellbin dd1c706d5c FFMS2: More ICL warning inspired fixes
Originally committed to SVN as r2960.
2009-05-21 10:39:14 +00:00
Fredrik Mellbin ccf24ae3af FFMS2: ICL compilation fix
Originally committed to SVN as r2959.
2009-05-21 10:05:53 +00:00
Niels Martin Hansen 6eb7206aa3 Remove outdated VSFilter code.
All Aegisub patches to VSFilter were ported to the "guliverkli2" fork project on SourceForge. and several new patches were applied to that project since then.

Originally committed to SVN as r2958.
2009-05-21 00:03:20 +00:00
Fredrik Mellbin cb698b5c3f FFMS2: Another small typo after all the changes
Originally committed to SVN as r2957.
2009-05-20 22:40:55 +00:00
Fredrik Mellbin 67e9033899 FFMS2: Missing #ifdef
Originally committed to SVN as r2956.
2009-05-20 19:05:42 +00:00
Fredrik Mellbin 34c50c8cd9 FFMS2:
Split indexing into a 2 step process so track numbers/types become known in advance
Big code cleanup and renaming

Originally committed to SVN as r2955.
2009-05-20 18:57:03 +00:00
harukalover 083e2ee91c Initialized a variable that was being used before it was assigned an initial value
Originally committed to SVN as r2954.
2009-05-20 18:29:01 +00:00
Niels Martin Hansen 5bdcf2f63a Update #742, attempt fixing the bug. Removing wxEXPAND from some sizers, seems to work fine on Windows. Will test Mac build when tinderbox builds it.
Originally committed to SVN as r2953.
2009-05-18 23:37:41 +00:00
harukalover 6f0c5e6489 * Fixed some more memory leaks reported by valgrind and msvc by reimplementing a couple of singleton pattern based classes
* Fixed a memory leak that occurred from never deleting a wxBitmap allocated in OpenGLTextGlyph

Originally committed to SVN as r2952.
2009-05-18 05:51:37 +00:00
harukalover 392fbdfa4d Fix a bunch of memory leaks reported by valgrind and msvc about the registered factories never being cleared.
Originally committed to SVN as r2951.
2009-05-18 05:42:54 +00:00
harukalover 9891c28977 Add a corresponding PopEventHandler call for each PushEventHandler call, this fixes a couple of memory leaks reported by valgrind and msvc.
Originally committed to SVN as r2950.
2009-05-18 05:33:49 +00:00
harukalover f1bfb947cf Call TestDestroy() to ensure we can delete the FontsCollectorThread, fixes #561
Originally committed to SVN as r2949.
2009-05-18 05:24:07 +00:00
Karl Blomster 5717f81ef2 Update FFMS2 providers to account for FFMS2 API change in last commit.
Also update ffms2.lib to corresponding version.

Originally committed to SVN as r2948.
2009-05-17 22:12:46 +00:00
Fredrik Mellbin cd8d965324 FFMS2:
Some more API cleanup
General cleanup

Originally committed to SVN as r2947.
2009-05-17 22:02:43 +00:00
Karl Blomster 8195d36ee5 Update Japanese translation.
Originally committed to SVN as r2946.
2009-05-17 15:17:52 +00:00
harukalover 008f7f3853 Prevent an out of range exception from being thrown. (was commonly being thrown when commit was used on the last row of the grid)
Originally committed to SVN as r2945.
2009-05-17 05:47:28 +00:00
Niels Martin Hansen ef407b6e68 Make FFmpegSource video and audio providers build again after FFMS2 changes last night.
Originally committed to SVN as r2944.
2009-05-16 12:47:23 +00:00
Niels Martin Hansen 7fcfaa5dc6 Updated ffms2.lib.
Originally committed to SVN as r2943.
2009-05-16 12:46:50 +00:00
Niels Martin Hansen a312985f36 Split video backend and UI into separate groups in MSVC project file.
Originally committed to SVN as r2942.
2009-05-16 12:46:22 +00:00
Amar Takhar 0b583dcd0d As required by r2940 supply -DFFMS_EXPORTS when building the library.
Originally committed to SVN as r2941.
2009-05-16 12:13:27 +00:00
Fredrik Mellbin ab8f6e6239 FFMS2:
Rename lots of things, THIS BREAKS THE AEGISUB BUILD because of changed exported type and function names.
Fixed an uninitialized memory bug that would make it crash on unindexed audio tracks in mastroska.
Made ffms.h C-friendlier.
Exports the start time of an audio track in the audio properties.
Less signedness and type conversion warnings.

Originally committed to SVN as r2940.
2009-05-15 23:11:18 +00:00
Niels Martin Hansen f6bd6df490 Hack to fix #687, if playing to end of audio, changing the selection end shouldn't affect the playback end: it should still play to end of audio.
Originally committed to SVN as r2939.
2009-05-15 15:23:34 +00:00
Niels Martin Hansen a6c7a8a724 Apply Plorkyeran's patch to close #843.
Originally committed to SVN as r2938.
2009-05-15 12:44:36 +00:00
Karl Blomster 5bb56ae5d4 Fix gcc breakage caused by last commit, and remove an unused variable while at it.
Originally committed to SVN as r2937.
2009-05-15 12:31:09 +00:00
Karl Blomster a3cd374bc0 Add a bit of sanity checking to FractionalTime.
Originally committed to SVN as r2936.
2009-05-15 12:18:33 +00:00
harukalover 1520e51dd0 Fixed Replace Next not marking the script as modified.
Originally committed to SVN as r2935.
2009-05-15 02:50:43 +00:00
Niels Martin Hansen 988df0ab81 Fix #809, properly close all SRT overrides during export and ensure overrides in recombined lines do not affect each other (per the example I gave in the report.)
Originally committed to SVN as r2934.
2009-05-15 01:34:00 +00:00
Niels Martin Hansen 44e17e9e11 Converting audio provider didn't know about channel count during bitdepth and samplerate conversion and intermixed samples from channels and more, resulting in garbage output. Fixes #726.
Originally committed to SVN as r2933.
2009-05-15 00:48:43 +00:00
Niels Martin Hansen 863d89ba4f aegisub_endian.h was missing from MSVC project.
Originally committed to SVN as r2932.
2009-05-14 23:58:24 +00:00
Niels Martin Hansen 8ca726119f Fix #825 for good, I hope. Get some sense worked into the handling of AssEntry::StartMS and AssDialogue::Start using some private members and virtual getter/setter functions.
Originally committed to SVN as r2931.
2009-05-14 23:45:20 +00:00
Niels Martin Hansen fb6280b2e7 More const correctness in AssTime, broke build because I forgot to add const keyword to implementation too.
Originally committed to SVN as r2930.
2009-05-14 23:27:38 +00:00
Niels Martin Hansen 3977fff411 Const correctness in AssTime.
Originally committed to SVN as r2929.
2009-05-14 23:09:04 +00:00
Niels Martin Hansen 4e417a6dae Change audio autoscroll behaviour:
* In karaoke mode, instead of scrolling start to end of active line into view, scroll start of selection to end of line into view. This gives sensible results when horizontal zoom is great enough that the entire line isn't visible at once and the syllable is too far from the start of the line. This fixes #677.
* If the line is too long to fit in the display, always left-align it instead of sometimes left-aligning and sometimes centering. (I think the old behaviour depended on the actual scroll position.)

Originally committed to SVN as r2928.
2009-05-14 22:12:05 +00:00
Niels Martin Hansen 84b068b53a Undo last change, code *was* used after all. Strangely my compiler didn't complain on first try...
Removing the comment about "is this even used?" as well...

Originally committed to SVN as r2927.
2009-05-14 21:44:43 +00:00
Niels Martin Hansen cab268c9bb Remove some unused code from karaoke UI.
Originally committed to SVN as r2926.
2009-05-14 21:26:39 +00:00
Niels Martin Hansen 523421300d Split audio sources in MSVC project into Backend and UI groups.
Originally committed to SVN as r2925.
2009-05-14 21:25:08 +00:00
harukalover 1cc280216c * Fixed a mismatched new[]/delete
* Fixed a memory leak that would occur when loading subtitles from a matroska file

Originally committed to SVN as r2924.
2009-05-14 18:28:57 +00:00
harukalover ce15bc55bc * Fixed the styling assistant marking the script as modified when it was unfocused and the Enable preview checkbox was unchecked even if no changes actually were made in the styling assistant.
* Removed some no longer needed code in the styling assistant.

Originally committed to SVN as r2923.
2009-05-14 17:29:07 +00:00
Niels Martin Hansen 2acf887157 Fix #845 by counting how many output lines were produced by applying a template to a line, instead of assuming that a template always gets applied, even if it's a code template.
Originally committed to SVN as r2922.
2009-05-14 15:34:37 +00:00
harukalover f4808b82a0 Made the styling assistant modeless so the user can access other controls within aegisub without having to close the styling assistant, fixes #397
Originally committed to SVN as r2921.
2009-05-14 07:02:01 +00:00
Karl Blomster ffa5a2021d - Reworked the SMPTE timecode handling with Plorkyeran's help. It does now handle dropframe timecodes as well; the ms->SMPTE handling has been tested and seems reasonably correct, while the reverse conversion remains untested and unused. The Adobe Encore export filter will now use dropframe timecodes properly (previously it would play pretend with wallclock hours/minutes/seconds and incorrect frame numbers).
- Changed the SubtitleFormat::AskForFPS dialog box; removed the "PAL/NTSC only" choice and added a "show SMPTE dropframe" parameter instead. Also added 50fps as a choice.

- While I was at it, reworked the TranStation export filter so it actually looks ahead to see if the next line will overlap with the current, and if so, move the end time of the current line backwards one frame, which fixes #767

Originally committed to SVN as r2920.
2009-05-13 20:24:21 +00:00
Karl Blomster 7215f354b9 Update ffms2.lib as per Myrsloik's last commit.
Originally committed to SVN as r2919.
2009-05-12 21:31:44 +00:00
Fredrik Mellbin 68123167fe FFMS2: api change so the logging level can be set arbitrarily, it also defaults to quiet now
Originally committed to SVN as r2918.
2009-05-12 20:50:40 +00:00
Niels Martin Hansen 3ddf48665a Apparently not all platforms agree on providing MININT and MAXINT constants. Work around it by calculating those values ourselves.
Originally committed to SVN as r2917.
2009-05-12 20:48:05 +00:00
Niels Martin Hansen 55d5b668fa Integer-edits in Auto 4 Lua config dialogues now always get spin buttons. If no min/max is specified, minint/maxint are assumed.
Originally committed to SVN as r2916.
2009-05-12 20:26:19 +00:00
Niels Martin Hansen 0b4ecb9797 Normalise case for style section names.
fixes #690 (hopefully)

Originally committed to SVN as r2915.
2009-05-12 18:10:13 +00:00
Niels Martin Hansen 425ca55698 Bump kara-templater version number.
Originally committed to SVN as r2914.
2009-05-12 16:39:53 +00:00
Niels Martin Hansen d71fa2d85c Add support for variable loops in kara-templater, and add a few more utility functions.
- Variable loops are controlled using the tenv.maxloop(newmax) function to set the loop counter max. This is a wrapper around setting tenv.maxj.
- Add tenv.relayer(newlayer) function for changing the Layer of an output line.
- Add tenv.restyle(newstyle) function for changing the Style of an output line, despite this usually breaking positioning/sizing information.
- tenv.maxloops is an alias for tenv.maxloop.
- tenv.loopctl(newj, newmaxj) controls both loop variables if anyone wants to do that.
This closes #753 but documentation still needs to be written.

Originally committed to SVN as r2913.
2009-05-12 16:36:51 +00:00
Niels Martin Hansen 277adad41f Fix a bunch of bugs with config dialogues in Auto 4 Lua:
- When default buttons were present, pushing OK caused no button code to be returned at all.
- A load of controls not handling default/initial values properly, closes #775 and #776

Originally committed to SVN as r2912.
2009-05-12 15:32:11 +00:00
Niels Martin Hansen 28d4ed7c8a Extend Auto 4 Lua config dialogues test case to cover most interesting cases of controls.
Updates #775 and #776 since they need those cases.

Originally committed to SVN as r2911.
2009-05-12 15:24:07 +00:00
Niels Martin Hansen 05e847b6d2 Make AssColor::Parse() also understand HTML colours with a bit of help from wx.
Originally committed to SVN as r2910.
2009-05-12 15:14:35 +00:00
Karl Blomster ebcdf0ce46 Move the SMPTE timecode stuff out of the AssTime class and put it in a class of its own, FractionalTime. The AssTime to SMPTE part is tested and verified to work (in fact it looks like I unintentionally fixed an overlap bug in the TranStation export filter), while the SMPTE to AssTime part is completely untested (but it's currently not used anywhere so it's not like it matters).
Originally committed to SVN as r2909.
2009-05-10 03:50:58 +00:00
Karl Blomster 61a3c5657a Fix a memleak in the FFMS2 video provider (the frame was never unallocated on video close). Patch by Harukalover, fixes #838
Originally committed to SVN as r2908.
2009-05-10 00:12:04 +00:00
Fredrik Mellbin 2c354ba64e FFMS2: beta 8
Originally committed to SVN as r2907.
2009-05-09 21:59:24 +00:00
Karl Blomster f869cd0231 Fix a minor bug that caused the add leadin/leadout buttons to not update the time edit boxes. Patch by Harukalover, fixes #836.
Originally committed to SVN as r2906.
2009-05-07 17:52:29 +00:00
Karl Blomster 732ccbbb26 The buffer length/wanted latency in the dsound2 audio player are now tweakable in config.dat; the options are called "audio dsound buffer latency" and "audio dsound buffer length" respectively. Defaults to 100/5 respectively (should work for the people who used to get buffer errors); for better responsiveness try 80/4.
Originally committed to SVN as r2905.
2009-05-07 14:47:36 +00:00
Karl Blomster 4d83215690 Fix a bug (in a somewhat questionable manner) that would cause the text file writer to occasionally think the system locale was Unicode when it wasn't (by using an uninitialized variable in a condition). Should fix the issue with the SRT export filter failing to write "1" on the first line when using "local" as the text encoding.
Originally committed to SVN as r2904.
2009-05-06 19:14:10 +00:00
Karl Blomster 1e2a031765 Add Aegisub::Script::set_undo_point() to auto4-perl. Currently not all that useful since auto4-perl currently only supports macros and nothing else, and using a macro sets an undo point after execution automatically anyway.
Originally committed to SVN as r2903.
2009-05-06 12:25:08 +00:00
Karl Blomster 7b6a8811be change how ffmsindex is linked to ffms2 (use a #pragma instead of an extra dependency in the project file)
Originally committed to SVN as r2902.
2009-05-05 21:43:49 +00:00
Niels Martin Hansen 24aa9785ae Oops, had swapped size and value parameters in a memset call.
Originally committed to SVN as r2901.
2009-05-04 19:15:57 +00:00
Amar Takhar 97427e7b46 Sigh, make gawk happy, I despise gawk someone please get rid of it forever.
Originally committed to SVN as r2900.
2009-05-04 08:06:26 +00:00
Amar Takhar 763231423b Add a note why the 'sed' hack is nessicary.
Originally committed to SVN as r2899.
2009-05-04 06:52:45 +00:00
Amar Takhar 952935cbea Add a crappy sed hack to silence gcc warnings, sigh, I wish ImageMagick would update convert already.
Originally committed to SVN as r2898.
2009-05-04 06:51:02 +00:00
Amar Takhar b88254856b s/static/const/ to silence gcc warnings.
Originally committed to SVN as r2897.
2009-05-04 06:50:37 +00:00
Amar Takhar de2ec45cea Silence a bunch of gcc 'newline' warnings.
Originally committed to SVN as r2896.
2009-05-04 06:50:12 +00:00
Amar Takhar c2267bedcc Plug a bunch of memory leaks from uau in the mplayer2 repo: http://repo.or.cz/w/mplayer.git?a=commit;h=312d9e4b104741b834aa5d71b02228d0cd988a4e
libass: Fix cache lookup problem causing memory bloat

The cache code did hash lookups by storing key values in struct fields
and then hashing and comparing the struct as a single memory block. In
at least one case such a struct contained uninitialized padding bytes
which prevented the complete memory area of the struct from matching
even though the fields did. As a result the code failed to find
existing objects in the cache and stored new versions of them, causing
gigabytes of memory use in some circumstances. Initializing the struct
memory to zero before writing the fields avoided such memory use in
tests but is not guaranteed to work if I interpret the C standard
correctly (the compiler is allowed to write garbage over padding bytes
when changing struct member values).

Change the code to use struct-specific hashing and comparison
functions that work field by field to guarantee correct behavior.
Create these by replacing the struct definition with a template that
lists the fields and can be used the generate each of struct
definition, hash function and compare function with some preprocessor
magic (otherwise every field would need to be listed separately in all
three).

Originally committed to SVN as r2895.
2009-05-04 06:48:21 +00:00
Fredrik Mellbin b55460ede5 FFMS2:
Fix an old bug that would drop the first or second video frame
Greatly improved audio decoding by adding a small internal cache

Originally committed to SVN as r2894.
2009-05-03 19:25:54 +00:00
Karl Blomster c84a79fb7f Implemented an automated cache cleaner that keeps the FFMS2 index cache at a manageable size. Cleaning is started when video is opened with the FFMS2 video provider and runs in its own thread. Removal is based on last access time, and the FFMS2 providers now explicitly touch the index files on reading to make sure access time is updated.
By default the cache is kept below 42MB and 20 files; to change the defaults change "FFmpegSource max cache size" and "FFmpegSource max cache files" in config.dat. Either or both may be set to 0, but the cleaner will not delete the last index file in the directory, regardless of cache settings and of the file's size.

Originally committed to SVN as r2893.
2009-05-03 18:05:30 +00:00
Karl Blomster 0a4190ca98 Fix compilation breakage introduced in r2891.
Originally committed to SVN as r2892.
2009-05-02 20:06:06 +00:00
Karl Blomster 04e4249219 Don't let the MKV parser crash on certain MKV's for which it cannot determine the filesize by itself. (Adaption of Myrsloik's similar fix for FFMS2.)
Originally committed to SVN as r2891.
2009-05-02 19:40:55 +00:00
Fredrik Mellbin 94cf1e4c22 FFMS2: Add a missing function the updated matroska parser expects
Originally committed to SVN as r2890.
2009-05-01 16:58:15 +00:00
Amar Takhar 35cea05304 Add an sh script to generate snap tarballs upon successful builds of UNIX platforms (excluding Darwin).
Originally committed to SVN as r2889.
2009-05-01 03:58:23 +00:00
Niels Martin Hansen 7e38ebfd82 Ensure some fields in VideoContext get initialised.
Originally committed to SVN as r2888.
2009-04-30 22:13:10 +00:00
Karl Blomster 341fc0c019 Re-update the license on Haali's matroska parser.
Originally committed to SVN as r2887.
2009-04-29 21:19:45 +00:00
Amar Takhar 68b382994b Update libass from MPlayer r29129: Don't automatically wrap lines when WrapStyle==2.
Originally committed to SVN as r2886.
2009-04-29 21:06:54 +00:00
Fredrik Mellbin 91735eb86d FFMS2: Update Haali's matroska parser
Originally committed to SVN as r2885.
2009-04-29 21:06:07 +00:00
Karl Blomster 33c31e3eee Update Haali's MatroskaParser.c/.h in the main source tree (there's a copy in the FFMS2 folder as well, which will be updated later). Should fix a crash with x264-generated MKV's.
Originally committed to SVN as r2884.
2009-04-29 21:00:08 +00:00
Niels Martin Hansen 866f9d21fc Let AudioProvider::GetAudioWithVolume() catch exceptions in AudioProvider::GetAudio() and return blank audio when that happens. Errors are not logged or otherwise handled. This fixes #800 for most cases, even if poorly.
Originally committed to SVN as r2883.
2009-04-29 19:30:02 +00:00
Niels Martin Hansen 92202a99bf Some more delayload vsprops files.
Originally committed to SVN as r2882.
2009-04-29 19:08:40 +00:00
Karl Blomster aacf2e4c19 remove duplicate variable
Originally committed to SVN as r2881.
2009-04-29 17:42:48 +00:00
Karl Blomster 1b2d26c231 Fix a few memory leaks in the FFMS2 providers. Patch by Myrsloik.
Originally committed to SVN as r2880.
2009-04-29 17:40:02 +00:00
Fredrik Mellbin 338188b184 FFMS2: Beta 7 release
Fix 3 gcc warnings

Originally committed to SVN as r2879.
2009-04-29 16:39:15 +00:00
Karl Blomster 7f44500c89 Don't fail to read subtitles from MKV's that are named .mks or .mka, both of those are reported as supported formats in the "open subtitles" dialog box.
Originally committed to SVN as r2878.
2009-04-29 14:04:23 +00:00
Amar Takhar 6eb56f60cd s/32/??/ to include 64bit builds (what was I thinking?).. it's better than using '*' which could lead to a disaster.
Originally committed to SVN as r2877.
2009-04-29 08:07:22 +00:00
Amar Takhar 56fee329a2 Use 'SetFile' instead of '/usr/bin/SetFile' when creating the .dmg, 10.5 puts it in /usr/bin, on 10.4 it's in /Developer/Tools/.
Originally committed to SVN as r2876.
2009-04-29 07:55:40 +00:00
Amar Takhar e1effd407d * Favour '/usr/bin/perl' over 'perl' to ensure the base perl is always used. (it's required)
Originally committed to SVN as r2875.
2009-04-29 06:50:08 +00:00
Amar Takhar 667f950176 * Re-format the arch detection case.
* Fix an annoying buy, I hate the loops configure gets stuck in when you do "$blah" = "$blah" vs test "$blah..

Originally committed to SVN as r2874.
2009-04-29 00:49:38 +00:00
Amar Takhar 5b3a60c506 * Add support in configure.in to detect the arch.
* Add two new targets, osx-tinderbox-(bundle|dmg) to handle tinderbox building.

Originally committed to SVN as r2873.
2009-04-28 23:25:42 +00:00
Amar Takhar 023f61bdbd Change the buildslave dist name to dist.7z so the waterfall isn't cluttered. There's a link to the archive so it won't be an issue.
Originally committed to SVN as r2872.
2009-04-28 17:59:03 +00:00
Karl Blomster 8c44d698e4 Don't try to synch audio when there is no audio player/provider present. (Could cause a crash under certain rare conditions.) Thanks Avi for report and fix.
Originally committed to SVN as r2871.
2009-04-28 10:23:20 +00:00
Amar Takhar 606abde1a3 Add a batch file to generate a distfile that can be uploaded.
Originally committed to SVN as r2870.
2009-04-28 07:04:53 +00:00
Amar Takhar f18ed0748b Remove an extra line (more testing.)
Originally committed to SVN as r2869.
2009-04-28 05:25:37 +00:00
Amar Takhar ec87d3c63a Remove some EOF whitespace (more testing.)
Originally committed to SVN as r2868.
2009-04-28 05:24:28 +00:00
Amar Takhar 5eaa033697 Remove some EOF whitespace.
Originally committed to SVN as r2867.
2009-04-28 05:21:23 +00:00
Amar Takhar d226cdf33c Add some error-checking and exit 1's.
Originally committed to SVN as r2866.
2009-04-28 05:17:33 +00:00
Amar Takhar 5de0558228 Add exit codes to various commands to ensure the script fails and doesn't proceed to the next step(s).
Originally committed to SVN as r2865.
2009-04-28 05:11:32 +00:00
Amar Takhar c12d2d7636 Testing the tinderbox (a stub commit but still useful.)
Originally committed to SVN as r2864.
2009-04-28 05:08:18 +00:00
Amar Takhar 3648f61083 Testing the tinderbox.
Originally committed to SVN as r2863.
2009-04-27 20:58:42 +00:00
Niels Martin Hansen 0100118190 Fix include file search path in CSRI project file for VC++ in x64 configurations.
Originally committed to SVN as r2862.
2009-04-26 21:01:18 +00:00
Karl Blomster 51df55edd7 Fix some more minor editbox regressions introduced in r2859. Patch by Harukalover, updates #794
Originally committed to SVN as r2861.
2009-04-26 04:31:19 +00:00
Karl Blomster eed65e8945 Fix a minor graphical glitch in the time edit boxes introduced in r2859. Patch by Harukalover. updates #794
Originally committed to SVN as r2860.
2009-04-26 01:23:01 +00:00
Karl Blomster 31aed4c1a7 Fix a number of odd quirks regarding how grid selection is moved after committing multiple lines, and how audio selection moves after committing. See #794 for full details. Patch by Harukalover.
closes #64, #420, #794

Originally committed to SVN as r2859.
2009-04-26 01:02:23 +00:00
Karl Blomster 76cec3ec29 Fix a bug that would cause a crash under certain conditions when trying to change the properties of a recently deleted line. Patch by Plorkyeran, closes #815
Originally committed to SVN as r2858.
2009-04-26 00:25:33 +00:00
Karl Blomster 32eb3a8a62 Fix a bug that would cause the program to crash if CSRI was selected as subtitle renderer but no CSRI renderer was actually installed. Patch by Plorkyeran, closes: 462
Originally committed to SVN as r2857.
2009-04-26 00:11:29 +00:00
Karl Blomster 4dafa0ff10 Use less magic numbers
Originally committed to SVN as r2856.
2009-04-25 23:08:45 +00:00
Karl Blomster 4efd1b5567 Update ffms2.lib
Originally committed to SVN as r2855.
2009-04-25 23:04:06 +00:00
Amar Takhar 72c5828bc0 Sigh, add @set before the recently added environment variables (r2847)
Originally committed to SVN as r2854.
2009-04-25 23:00:29 +00:00
Fredrik Mellbin 140dc44882 FFMS2: Another much needed set of fixes to the Haali part
Originally committed to SVN as r2853.
2009-04-25 22:09:49 +00:00
Fredrik Mellbin a41e48a159 Fix the video provider after the FFMS2 changes part2
Originally committed to SVN as r2852.
2009-04-25 10:31:39 +00:00
Fredrik Mellbin f64b10978b Fix the video provider after the FFMS2 changes
Originally committed to SVN as r2851.
2009-04-25 09:26:03 +00:00
Fredrik Mellbin 8f7930e876 FFMS2: Even less enum forward declarations
Originally committed to SVN as r2850.
2009-04-25 09:09:14 +00:00
Fredrik Mellbin 6f6d1bdf3a FFMS2: Less enum forward declaration?
Originally committed to SVN as r2849.
2009-04-25 08:55:14 +00:00
Amar Takhar f8652576c8 Add CommonProgramFiles CommonProgramFiles(x86) ProgramFiles ProgramFiles(x86) to the build environment.
Originally committed to SVN as r2847.
2009-04-25 02:04:33 +00:00
Amar Takhar 57024a2e7c vc++ needs TMP/TEMP to be set in the env in order to work correctly.
Originally committed to SVN as r2846.
2009-04-24 23:23:48 +00:00
Fredrik Mellbin 6fae2955fd FFMS2:
Remove the dependency of pixfmt.h in ffms.h
Added the alternative FFMS_GetPixFmt() for getting the different pixel format values

Originally committed to SVN as r2845.
2009-04-24 19:56:19 +00:00
Karl Blomster aaad6b4ad6 Update ffms2.lib again
Originally committed to SVN as r2844.
2009-04-24 18:41:34 +00:00
Fredrik Mellbin 83586d2b18 FFMS2:
Several bugfixes which should fix crashes in recent versions
Added a simple regression test application
Removed a few useless functions from the API
Add TheFluff's FFmpegSource 1.21 syntax compatibility script

Originally committed to SVN as r2843.
2009-04-24 17:42:21 +00:00
Amar Takhar 45d6e37ee8 Whoops, remove trunk\ from the solution path.
Originally committed to SVN as r2842.
2009-04-24 04:16:01 +00:00
Amar Takhar c2e02322cf Add a bath file to compile aegisub, these will exist _per_ buildslave. It's probably better to keep it here anyway as build environments will not be changable without a historical record being kept. (it's also easier!)
Originally committed to SVN as r2841.
2009-04-24 04:00:04 +00:00
Amar Takhar fb36f6d4af Add a solution and windows config for Windows tinderbox building. Submitted by jfs, thanks!
Originally committed to SVN as r2840.
2009-04-23 20:26:07 +00:00
Karl Blomster 4c68bb5412 Updated German translation (by Sebastian Billau).
Originally committed to SVN as r2839.
2009-04-23 10:32:00 +00:00
Karl Blomster 53bc5a034d Avisynth video provider will now use ffmpegsource2 instead of ffmpegsource when so required.
Originally committed to SVN as r2838.
2009-04-23 02:09:05 +00:00
Fredrik Mellbin e42ae2d19d FFMS2: Various fixes to haali stuff
Originally committed to SVN as r2837.
2009-04-22 18:38:28 +00:00
Amar Takhar ff7ee2e776 Add a cross-compile condition to AC_RUN_IFELSE in AC_AGI_COMPILE to make cross-compiling work.
Originally committed to SVN as r2836.
2009-04-21 22:32:07 +00:00
Amar Takhar e2d0317df3 Bunk commit to trigger the build cluster.
Originally committed to SVN as r2835.
2009-04-21 18:48:59 +00:00
Amar Takhar af68c58f56 Add a command to autogen --skip-configure to allow the autogen/configure steps
to be split for the build tinderbox.

Originally committed to SVN as r2834.
2009-04-20 02:45:35 +00:00
Amar Takhar 544c325dde Fix typo.
Originally committed to SVN as r2833.
2009-04-20 02:43:32 +00:00
Niels Martin Hansen 2ba96af5b2 Remove outdated and unused Windows installer scripts.
Originally committed to SVN as r2832.
2009-04-19 20:48:08 +00:00
Niels Martin Hansen e2a75490c9 Remove the annoyance known as Tip of the Day. Right now it's completely inaccessible, but might return in a different incarnation when we get out of strings freeze.
Originally committed to SVN as r2831.
2009-04-18 15:29:13 +00:00
Niels Martin Hansen 6ec31a3a08 Simplify code to pick mapping size in PCMWAV provider, just use sizeof(void*) to determine address space size.
Originally committed to SVN as r2830.
2009-04-18 15:16:15 +00:00
Niels Martin Hansen f5bc001e90 Move more project settings into property sheet files.
Originally committed to SVN as r2829.
2009-04-18 13:40:52 +00:00
Niels Martin Hansen a749c23e8b Rename auto3 DLL to something less ugly.
Originally committed to SVN as r2828.
2009-04-18 13:31:08 +00:00
Karl Blomster f6016573c8 revert revision 2825 since apparently it broke all of jfs' changes
Originally committed to SVN as r2827.
2009-04-18 13:02:13 +00:00
Karl Blomster 65e69a51cf "Fix" an issue that would cause the FFMS2 audio provider to crash when fed with a unicode filename/path. The solution involves getting the "short path", no idea if it works on Unix. Fixes bugtracker issues #810 and #808.
Originally committed to SVN as r2826.
2009-04-18 10:54:20 +00:00
Karl Blomster caa26103f5 add portaudio_x86.dll to the list of delay-loaded dll's in the vs2008 project file
Originally committed to SVN as r2825.
2009-04-18 09:37:54 +00:00
Karl Blomster f20737b8b2 Fix an issue where the grid font face option's font browser button wouldn't actually update the setting. Patch by Harukalover, resolves bugtracker issues #706 and (partially) #821.
Originally committed to SVN as r2824.
2009-04-18 09:12:26 +00:00
Niels Martin Hansen 909275f0df Visual Studio loves not saving property sheets unless told to VERY explicitly. Missed one for Lua 5.0.
Originally committed to SVN as r2823.
2009-04-17 22:39:43 +00:00
Niels Martin Hansen 0fe7719162 Adjust hunspell VC project to also use property sheets.
Originally committed to SVN as r2822.
2009-04-17 22:34:03 +00:00
Niels Martin Hansen fe393f82af No longer support anything for Windows-builds but Visual Studio 2008/VC9.
Remove all outdated, unmaintained project files and some unused dirs, and other stuff related to outdated build methods.

Originally committed to SVN as r2821.
2009-04-17 22:08:37 +00:00
Niels Martin Hansen 30057004f1 Some changes to property sheets went unsaved before previous commit, oops.
(This made linking in various things impossible.)

Originally committed to SVN as r2820.
2009-04-17 21:58:17 +00:00
Niels Martin Hansen 77791217a0 Refactor Visual Studio 2008 build and make libauto3 and Lua 5.0 build on VC9.
* The most important project properties (especially paths) are now stored in VSProps files in generalised ways.
* Projects share VSProps files so they place output files in same locations and thus agree on where to find them.
* Avoid inconsistencies between build configurations/platforms as has happened often before.
* Now distributable binaries (aegisub.exe and aegisub-auto3.dll) will be placed in $(SolutionDir)/bin/, static libraries under $(SolutionDir)/lib/ and object files etc. under $(SolutionDir)/build/. Note that those locations are controlled by where the solution file is placed in the file system.
* libauto3 is no longer pulled in by a #pragma in auto4_auto3.c, but must instead be pulled in by making the aegisub project depend on the auto3 project, which must in turn depend on the lua50 project.
* Final binary filenames are now somewhat different. You get aegisub32.exe, aegisub64d.exe, aegisub-auto3lib32d.dll and more.
* There's still more that can be factored out, things like optimisation flags and defines.

Originally committed to SVN as r2819.
2009-04-17 21:53:48 +00:00
Niels Martin Hansen c55df071cf The lines.n value produced by Auto3 implementation was 1 too small causing the last line in a file to be eaten by karaskel.
Originally committed to SVN as r2818.
2009-04-17 21:34:43 +00:00
Niels Martin Hansen 5a76711a19 Make callables.c error properly if it's attempted compiled separately.
Originally committed to SVN as r2817.
2009-04-17 20:55:48 +00:00
Niels Martin Hansen 8a5933385d Make libauto3 better liked by MSVC 2008.
Originally committed to SVN as r2816.
2009-04-17 20:51:58 +00:00
Niels Martin Hansen b6ae30cc6c Force use of ANSI versions of Windows API's for runtime+loading of DLL's, causing problems when building with UNICODE defined.
Originally committed to SVN as r2815.
2009-04-17 20:20:37 +00:00
Karl Blomster cc26be476e add portaudio2 player to the vs2005 project as well while I'm at it
Originally committed to SVN as r2814.
2009-04-17 19:45:33 +00:00
Karl Blomster 8a6206e5d0 add portaudio2 audio player to config/config_windows0.h and the vs2008 project file
Originally committed to SVN as r2813.
2009-04-17 19:44:07 +00:00
Karl Blomster c3afb85af4 change buffer length/wanted latency in the dsound2 audio player to 80/4 (down from 100/5); should make it a bit more responsive
Originally committed to SVN as r2812.
2009-04-17 19:40:29 +00:00
Karl Blomster 0d6454087e update ffms2.lib
Originally committed to SVN as r2811.
2009-04-17 19:38:12 +00:00
Niels Martin Hansen 7a19b273b1 Fix crash in PCM audio provider when using files larger than the mapping size (256 MB on 32 bit). The length of mappings closer than mapping-size to the end of the file, when the file was larger, would not be adjusted to not cross the end of file.
Originally committed to SVN as r2810.
2009-04-17 16:34:06 +00:00
Amar Takhar 49e3895180 Re-order the functions so they're in line with every other player: Constructor,
Destructor, Open, Close, Play, Stop..  I rue the fact that I didn't do this at
the start.

Originally committed to SVN as r2809.
2009-04-17 13:58:44 +00:00
Karl Blomster d77c119d63 Fix a bug in FFMS2 that caused it to write timecodes with scientific notation.
Originally committed to SVN as r2808.
2009-04-17 03:25:10 +00:00
Amar Takhar 6c256fd181 * Remove a short-lived hack (hours?) and replace it with a
PaStreamFinishedCallback which is called anytime a PaCallback is exited with
  anything other than 0. (normal operation)  paStreamFinishedCallback handles
  stopping the audio stream when we've run to the end of the current selection
  or the stream is stopped.
* Add framesPerBuffer to paCallback debug output in preperation for dynamic
  buffers.
* Set paPrimeOutputBuffersUsingStreamCallback in Pa_OpenStream to prime the
  output buffer using the callback rather than initing with empty space which
  is the default.
* Indent paCallback decleration another level.

Originally committed to SVN as r2807.
2009-04-17 02:14:42 +00:00
Amar Takhar 50ce42d2e9 * Fold entire callback into a single if-else block.
* Remove 'end' variable and just return 0 if we have more to play.

Originally committed to SVN as r2806.
2009-04-16 20:55:14 +00:00
Amar Takhar eb65009f66 * Remove variable 'avail'.
* Fold lenAvailable logic into a ternary operator.
* Use GetAduioWithVolume instead of applying volume ourselves.
* Remove code used to zero rest of the buffer. (not required)

Originally committed to SVN as r2805.
2009-04-16 20:49:37 +00:00
Amar Takhar c6364bf43d * Set Pa_OpenStream to use paClipOff as we don't need any clipping
* Update comment (realPlayPos has been removed).
* Return from paCallback with paAbort if there is no more audio to play.
  Also set endPos to be less than the current playPos to stop the audio
  event timer.
* Add CPU usage statistics to debug printf in paCallback.

Originally committed to SVN as r2804.
2009-04-16 19:55:52 +00:00
Amar Takhar 3e864d10c9 Make debug printf's a perm fixture wrapped with PORTAUDIO2_DEBUG.
Originally committed to SVN as r2803.
2009-04-16 14:22:46 +00:00
Niels Martin Hansen 7271a74b54 Forgot to put license on VideoSink.h as well.
Originally committed to SVN as r2802.
2009-04-16 13:01:05 +00:00
Niels Martin Hansen 4da7a70608 Clarify license for VideoSink.cpp.
<jfs> hmm Haali, the VideoSink.cpp you have contributed to aegisub doesn't have a license attached... I see you put MatroskaParser.c into 3-clause BSD like the rest of aegisub though, what about VideoSink ?
<Haali> jfs: BSD license is ok for that file

Originally committed to SVN as r2801.
2009-04-16 12:15:57 +00:00
Amar Takhar 50214a2a6a Move the comment for the PortAudio library to setup.cpp.
Requested by: TheFluff

Originally committed to SVN as r2800.
2009-04-15 20:16:54 +00:00
Amar Takhar 50b7f33117 Don't initalise favorite to 0 (it's a a wxString).
Originally committed to SVN as r2799.
2009-04-15 20:11:53 +00:00
Amar Takhar 918945e03b Don't set the current position via the PortAudio callback, instead set
GetCurrentPosition() to return the correct value using Pa_GetStreamTime().  Not
only does it not work on every platform, there is no point in setting it during
the callback as GetCurrentPosition() isn't called very often (in comparison)
when updating the play bar.  Eventually this should be changed to update the
playbar via a callback to get a position that's a lot more accurate.

Originally committed to SVN as r2798.
2009-04-15 17:50:16 +00:00
Amar Takhar b63c2ea27c Add hidden option 'Audio PortAudio Device' to set the default portaudio output device.
Originally committed to SVN as r2797.
2009-04-15 11:26:43 +00:00
Amar Takhar aa85b2eb01 * Fix paCallback decleration
* Switch from PaOpenDefaultStream to Pa_OpenStream.
* Add Debug output
* Add GetOutputDevices which returns a list of available devices (unused)

Originally committed to SVN as r2796.
2009-04-15 10:26:22 +00:00
Niels Martin Hansen 558be555e2 Make the default ALSA device default.
(It should be "default", not "default:0" as the old default was.)

Originally committed to SVN as r2795.
2009-04-13 17:08:13 +00:00
Amar Takhar 2d6ba0cb22 Move FOUND_AUDIO_PLAYER above the rest of the audio players to preserve
link ordering.  Also add libaudio_player.a to the final link.

Originally committed to SVN as r2794.
2009-04-12 10:52:40 +00:00
Amar Takhar dc34db7f62 Early morning code-o, setting AM_CONDITIONAL _after_ the Makefiles are
generated isn't going to work very well.

Originally committed to SVN as r2793.
2009-04-12 10:48:20 +00:00
Amar Takhar 733814793e * Update comment
* Include audio_player_portaudio2.h instead of audio_player_portaudio.h.

Originally committed to SVN as r2792.
2009-04-12 10:30:38 +00:00
Amar Takhar 8dab71e974 Split audio_player.cpp into it's own convenience to avoid sending audio library
CFLAGS to every source file.

Originally committed to SVN as r2791.
2009-04-12 10:30:07 +00:00
Amar Takhar 95e9ccaf79 Add support for ALSA_(LD|C)FLAGS.
Originally committed to SVN as r2790.
2009-04-12 10:28:42 +00:00
Amar Takhar 21460ec589 Add block for WITH_PORTAUDIO2.
Originally committed to SVN as r2789.
2009-04-12 10:08:59 +00:00
Amar Takhar d71cbda47b * s/$found_audio/$found_audio_player/ for clarity.
* Add AM_CONDITIONAL for FOUND_AUDIO_PLAYER and FOUND_VIDEO_PROVIDER.

Originally committed to SVN as r2788.
2009-04-12 10:08:28 +00:00
Amar Takhar 579b46f097 Update PortAudio v19 support.
Originally committed to SVN as r2787.
2009-04-12 10:04:10 +00:00
Amar Takhar b89ec65c43 Move the PortAudio v19 check above the v18 check.
Originally committed to SVN as r2786.
2009-04-11 23:40:15 +00:00
Amar Takhar 97c857a94f Add 'PortAudio2' as an audio player.
Originally committed to SVN as r2785.
2009-04-11 23:23:30 +00:00
Amar Takhar 3247ad6c6c Change WITH_PORTAUDIO -> WITH_PORTAUDIO2
Originally committed to SVN as r2784.
2009-04-11 23:18:04 +00:00
Amar Takhar e61d0b77ac Update audio_player_portaudio2.* for PortAudio v19.
Originally committed to SVN as r2783.
2009-04-11 23:16:58 +00:00
Amar Takhar 23eea68fdd Verbatium copy of audio_player_portaudio.* -> audio_player_portaudio2.*
Originally committed to SVN as r2782.
2009-04-11 23:15:45 +00:00
Fredrik Mellbin d39d308d0d FFMS2 GCC compilation fix
Originally committed to SVN as r2781.
2009-04-11 19:43:18 +00:00
Fredrik Mellbin 6878e5884a FFMS2 beta 6 (the real commit)
Requires a recent FFmpeg
Changes the HAALITS define into HAALISOURCE

Originally committed to SVN as r2780.
2009-04-11 18:45:40 +00:00
Amar Takhar 5f5960ef00 * Fix check for libavutil/pixfmt.h
* Add detection for PortAudio2 (v19)

Originally committed to SVN as r2779.
2009-04-11 18:06:23 +00:00
Amar Takhar 26e427e838 Add a check for libavutil/pixfmt.h as a low-brow check for FFMPEG r18129+, this
needs to be fixed to check exact versions of the library.  For now this should
work.

Originally committed to SVN as r2778.
2009-04-11 08:13:09 +00:00
Amar Takhar d642bb37ab Fix an error message to be clearer.
Originally committed to SVN as r2777.
2009-04-11 07:51:50 +00:00
Amar Takhar d0b1ad983e Update libass to r29169 of MPlayer.
Originally committed to SVN as r2776.
2009-04-11 07:42:48 +00:00
Karl Blomster e00fae15d6 Add a -v option to ffmsindex.
Originally committed to SVN as r2775.
2009-04-07 01:12:12 +00:00
Karl Blomster 2960b0298c Fix ffms2 video provider to work with new ffms2 version (b6)
Originally committed to SVN as r2774.
2009-04-06 20:53:01 +00:00
Karl Blomster 245c91a271 Updated ffms2.lib
Originally committed to SVN as r2773.
2009-04-06 20:19:33 +00:00
Karl Blomster 1e47a9d3e5 FFMS2 compile fix for ffmpeg revisions >18129. Probably breaks backwards compatibility so it doesn't compile with older revisions anymore, have fun.
Originally committed to SVN as r2772.
2009-04-06 20:15:49 +00:00
Karl Blomster 036da35fe8 Rename a few internal utility functions (FloatToString, IntegerToString, StringToInt, StringToFix) to Aegi* so they do not conflict with identically named wxWidgets functions. Fixes bugtracker issue #819.
Originally committed to SVN as r2771.
2009-04-06 20:01:42 +00:00
Karl Blomster 0e299f9146 FFmpegSource2 beta 6, see ffms2.html for change details
Originally committed to SVN as r2770.
2009-04-06 19:14:55 +00:00
Karl Blomster 1d69da533c Add new (VSFilter 2.39) override tags to call tips and fix a typo. Patch by Harukalover.
Originally committed to SVN as r2769.
2009-03-30 22:10:24 +00:00
Karl Blomster 9bbf4c4281 FFmpegSource2 beta 5.
Fixes a bug with timecode writing, adds some additional documentation and resolves the issue with reading ffmsindex's progress reporting from another program.

Originally committed to SVN as r2768.
2009-03-30 22:09:33 +00:00
Rodrigo Braz Monteiro 6106546f74 Fixed windows project.
Originally committed to SVN as r2766.
2009-03-14 20:52:01 +00:00
Amar Takhar 01d522b344 * Add a (small) hack for scripts/osx-bundle.sh to handle libtools weirdness.
* Update path to reflect new repo changes.

Originally committed to SVN as r2765.
2009-03-13 04:27:24 +00:00
Amar Takhar 2cf7d9c80b Fix auto3 build after repo change.
Originally committed to SVN as r2764.
2009-03-13 04:13:11 +00:00
Amar Takhar b5ab061f02 Fix libass on OSX after the repo changes.
Originally committed to SVN as r2763.
2009-03-13 04:12:45 +00:00
Amar Takhar b2bcb09943 Fix vs2008 build (Patch from Haruka)
Originally committed to SVN as r2762.
2009-03-12 05:56:02 +00:00
Amar Takhar 8b21bd2b9f Sync libass with r28935 from MPlayer.
Originally committed to SVN as r2761.
2009-03-12 03:46:44 +00:00
Amar Takhar a9180cfcf7 Missed patch: Fix build for auto3 it moved from ./auto3 -> src/libauto3.
Originally committed to SVN as r2760.
2009-03-09 05:48:13 +00:00
Amar Takhar 7740439efd Remove dummy.txt it was used ages ago for testing the svn repository.
Originally committed to SVN as r2759.
2009-03-09 01:15:01 +00:00
Amar Takhar 689e353c90 Update the build system for the new repository layout.
Originally committed to SVN as r2757.
2009-03-09 00:58:38 +00:00
Amar Takhar 6c9013e2c9 SVN Transition Step 7/7
1. svn mv specs art-sources docs

* See r2749 for full description.

Originally committed to SVN as r2756.
2009-03-08 08:32:10 +00:00
Amar Takhar 792225317e SVN Transition Step 6/7
1. svn mv OverLua SSATool athenasub avisynth_prs kanamemo \
     motiontracker prs traydict unit_test vsfilter devel/

* See r2749 for full description.

Originally committed to SVN as r2755.
2009-03-08 08:31:54 +00:00
Amar Takhar 391219ea54 SVN Transition Step 5/7
1. svn mv assdraw csri hunspell lua51 contrib

* See r2749 for full description.

Originally committed to SVN as r2754.
2009-03-08 08:31:41 +00:00
Amar Takhar 99d2711245 SVN Transition Step 4/7
1. svn mv auto3 aegisub/src/libauto3
   1. svn mv installer aegisub/packages/win_installer

* See r2749 for full description.

Originally committed to SVN as r2753.
2009-03-08 08:31:28 +00:00
Amar Takhar 91d73ec8ea SVN Transition Step 3/7
1. cd aegisub/
  2. svn mv *cpp *h src/
  3. svn mv Makefile.am MatroskaParser.c auto4_perldata.inc bitmaps boost \
     changelog.txt config gl include libosxutil libresrc md5.c msvc mythes.cxx \
     mythes.hxx res.rc src/
  4. cd ..
  5. svn mv FFmpegSource2/ INSTALL Makefile.am README  acinclude.m4 \
     autogen.sh automation/ bin build configure.in desktop dummy.txt lib \
     libass/ m4macros/ packages/ po/ scripts/ universalchardet/ aegisub/
  6. mkdir -p docs/wiki_convert
  7. svn add docs/wiki_convert
  8. cd docs
  9. svn mv aegisub_convert_docs.pl convert.bat output wiki_convert/

* See r2749 for full description.

Originally committed to SVN as r2752.
2009-03-08 08:30:39 +00:00
Amar Takhar 5043e0d1fd SVN Transition Step 2/7
1. svn mv auto3/lua contrib/lua50

* See r2749 for full description.

Originally committed to SVN as r2751.
2009-03-08 08:20:07 +00:00
Niels Martin Hansen 9e69b413dd Updated cleantags script from ai-chan.
Originally committed to SVN as r2748.
2009-02-28 17:52:06 +00:00
Amar Takhar 6218649912 Move *all* AC_SUBST* out of any conditional blocks, also set them below
AM_CONDITIONAL where applicable.

Originally committed to SVN as r2747.
2009-02-22 22:04:21 +00:00
Amar Takhar bf730cf96e * Rework the debugging flags to set the variables conditionally on either being
enabled.
* Fix some cut-and-paste-o's (dunno how I managed these)
* Move AC_SUBST* outside of the conditionally enabled blocks
* Fix typo.

Originally committed to SVN as r2746.
2009-02-22 22:01:14 +00:00
Amar Takhar 4960863be2 Add --enable-gcov, --enable-efence and --enable-ccmalloc for gcov, Electric
Fence and ccmalloc support.  gcov support won't work without manual
intervention (for now) but some hooks will be added later to automate it.

Originally committed to SVN as r2745.
2009-02-22 05:38:46 +00:00
Amar Takhar 87cee933ed Updates from greg:
* Scale shadow displacement and blur size like border
  * Correctly re-initialize glyph_info_t.
  * When using pan-and-scan, use correct positions.
  * patch cleanups

Originally committed to SVN as r2744.
2009-02-22 05:17:47 +00:00
Amar Takhar 761f044526 Return NULL if n < 0 on line 886, for whatever reason on FreeBSD this falls
through exception handling and causes and abort().

Originally committed to SVN as r2743.
2009-02-19 23:58:06 +00:00
Niels Martin Hansen 1426f4f67b New Russian translation, thanks to z0rc.
Originally committed to SVN as r2742.
2009-02-18 20:05:29 +00:00
Amar Takhar 20a42c0752 Use $DICT_DIR to find diciontary files for copying inside the bundle.
The default is ~/dict.

Originally committed to SVN as r2741.
2009-02-18 06:00:17 +00:00
Amar Takhar 6ea67c624d Only enable -D_DEBUG if there is a debug version of wxWidgets installed.
Originally committed to SVN as r2740.
2009-02-17 09:08:27 +00:00
Amar Takhar 0eaa08c405 Add audio_provider_dummy.cpp to the build which is required when _DEBUG is used.
Originally committed to SVN as r2739.
2009-02-17 08:12:19 +00:00
Amar Takhar a2a793e344 On OS X affix -debug to the bundle name when --enable-debug is used.
Originally committed to SVN as r2738.
2009-02-17 06:37:39 +00:00
Amar Takhar 28b8c45b54 Add -D_DEBUG when --enable-debug is used, this can't be turned off as
anyone making a debug build should use any features to help out with
debugging.

Originally committed to SVN as r2737.
2009-02-17 02:27:31 +00:00
Amar Takhar 8dc0f77fa1 Substitute the FontConfig Cache dir in fonts.conf to use the proper (versioned)
path: ~/Library/Application Data/Aegisub-<AEGISUB_VERSION_DATA>

Originally committed to SVN as r2736.
2009-02-16 01:57:19 +00:00
Amar Takhar 8ba90af9cd Add missing files from aegisub/libosxutil/, packages/, and scripts/.
All of the missing files were related to OS X.

Originally committed to SVN as r2735.
2009-02-16 00:27:52 +00:00
Amar Takhar 5731efc46a Apply a fix from greg:
* 'Correctly' handle font aspect ratio in the case of PlayRes(X|Y) not matching
   the video aspect ratio. (to match vsfilter)

Originally committed to SVN as r2734.
2009-02-15 05:44:06 +00:00
Amar Takhar 2c2f85a93d Add changes from
http://greg.geekmind.org/mplayer/libass-snapshot-20090214.tar.gz

* \be filter with [1,2,1] kernel (like vsfilter)
* "decimal point" support, e.g. numbers with fractional parts are dealt with
  correctly
* shadow without border
* "compromise" fix for transparency + aa
* misc fixes: \be and \blur radius and a memory leak
* proper compositing of overlapping translucent outlines

Originally committed to SVN as r2733.
2009-02-14 19:19:35 +00:00
Amar Takhar 1f47e17d66 Add -pipe for C/C++.
Originally committed to SVN as r2732.
2009-02-14 19:08:44 +00:00
Amar Takhar 6495831ed0 Really disable -O2 when --enable-debug is used.
Originally committed to SVN as r2731.
2009-02-14 19:05:40 +00:00
Amar Takhar 88dc740d90 Add some more comments for clarity.
Originally committed to SVN as r2730.
2009-02-12 00:39:53 +00:00
Amar Takhar 5ce4e24f57 Disable -O2 when --enable-debug is used, it can/does do odd things.
Originally committed to SVN as r2729.
2009-02-11 16:50:16 +00:00
Amar Takhar a7da892c62 Add a few comments for clarity.
Originally committed to SVN as r2728.
2009-02-10 21:25:32 +00:00
Amar Takhar 90c6172db9 Add a new flag: --disable-compiler-flags which disables *all* default
compiler flags.

Originally committed to SVN as r2727.
2009-02-10 20:50:28 +00:00
Niels Martin Hansen 82f91ce1fc Oops, had a C++-style line comment in a C source file
Originally committed to SVN as r2726.
2009-02-09 18:10:16 +00:00
Niels Martin Hansen 2bd0ce3055 Updated version of stdint.h for MSVC
Originally committed to SVN as r2725.
2009-02-09 18:08:14 +00:00
http://greg.geekmind.org/mplayer/mplayer-libass-fixes.txt 372a5c6a1f Impliment changes from http://greg.geekmind.org/mplayer/mplayer-libass-fixes.patch
from: http://greg.geekmind.org/mplayer/mplayer-libass-fixes.txt
 * adds stubs for most features introduced in vsfilter 2.39
 * implements \blur and \be > 1
 * corrects fix_outline_and_shadow for transparency + aa
 * first-tag-wins for \pos and \move

Originally committed to SVN as r2724.
2009-02-06 05:58:22 +00:00
3499 changed files with 561818 additions and 470102 deletions

234
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,234 @@
name: Meson CI
on:
push:
branches:
- master
- feature
- cibuilds
pull_request:
branches:
- master
- feature
workflow_dispatch:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: Windows MSVC Release
os: windows-latest
msvc: true
buildtype: release
args: >-
-Ddefault_library=static
--force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng
-Dfreetype2:harfbuzz=disabled
-Dharfbuzz:freetype=disabled
-Dharfbuzz:cairo=disabled
-Dharfbuzz:glib=disabled
-Dharfbuzz:gobject=disabled
-Dharfbuzz:tests=disabled
-Dharfbuzz:docs=disabled
-Dharfbuzz:icu=disabled
-Dfribidi:tests=false
-Dfribidi:docs=false
-Dlibass:fontconfig=disabled
-Davisynth=enabled
-Dbestsource=enabled
-Dvapoursynth=enabled
- name: Windows MSVC Release (wx master)
os: windows-latest
msvc: true
buildtype: release
args: >-
-Ddefault_library=static
--force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng
-Dfreetype2:harfbuzz=disabled
-Dharfbuzz:freetype=disabled
-Dharfbuzz:cairo=disabled
-Dharfbuzz:glib=disabled
-Dharfbuzz:gobject=disabled
-Dharfbuzz:tests=disabled
-Dharfbuzz:docs=disabled
-Dharfbuzz:icu=disabled
-Dfribidi:tests=false
-Dfribidi:docs=false
-Dlibass:fontconfig=disabled
-Davisynth=enabled
-Dbestsource=enabled
-Dvapoursynth=enabled
-Dwx_version='3.3.0'
#- {
# name: Windows MinGW,
# os: windows-latest,
# msvc: false
#}
- {
name: Ubuntu Debug,
os: ubuntu-latest,
buildtype: debugoptimized,
args: ''
}
- {
name: Ubuntu Release,
os: ubuntu-latest,
buildtype: release,
args: ''
}
- name: Ubuntu AppImage
os: ubuntu-22.04
buildtype: release
appimage: true
# distro ffms is currently broken
args: >-
--prefix=/usr
-Dbuild_appimage=true
-Ddefault_library=static
--force-fallback-for=ffms2
-Davisynth=enabled
-Dbestsource=enabled
-Dvapoursynth=enabled
- {
name: macOS Release,
os: macos-12,
buildtype: release,
args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true -Dvapoursynth=enabled --force-fallback-for=ffms2
}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup Meson
run: |
python -m pip install --upgrade pip setuptools
pip install meson
- name: Setup MSVC
if: matrix.config.os == 'windows-latest' && matrix.config.msvc == true
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco install ninja innosetup
$moonscripturl = "https://github.com/leafo/moonscript/releases/download/win32-v0.5.0/moonscript-187bac54ee5a7450013e9c38e005a0e671b76f45.zip"
mkdir moonscript
Invoke-WebRequest -Uri $moonscripturl -OutFile ".\moonscript\moonscript.zip"
pushd moonscript
7z e moonscript.zip
Get-Location | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
popd
$gettexturl = "https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-static-64.zip"
Invoke-WebRequest -Uri $gettexturl -OutFile ".\gettext.zip"
Expand-Archive ".\gettext.zip" -DestinationPath gettext
pushd gettext/bin
Get-Location | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
popd
- name: Install dependencies (MacOS)
if: matrix.config.os == 'macos-12'
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
# brew update
brew install luarocks ninja
luarocks install luafilesystem 1.8.0
luarocks install moonscript --dev
brew install libass zlib ffms2 fftw hunspell
brew install pulseaudio # NO OpenAL in github CI
- name: Install dependencies (Linux)
if: startsWith(matrix.config.os, 'ubuntu-')
run: |
sudo apt-get update
sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev libhunspell-dev libuchardet-dev libpulse-dev libopenal-dev libjansson-dev nasm
- name: Configure
run: meson setup build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }}
- name: Build
run: meson compile -C build
- name: Run test
run: meson test -C build --verbose "gtest main"
# Windows artifacts
- name: Generate Windows installer
if: matrix.config.os == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
meson compile win-installer -C build
- name: Generate Windows portable installer
if: matrix.config.os == 'windows-latest'
run: cd build && ninja win-portable
- name: Upload artifacts - win_installer
uses: actions/upload-artifact@v3
if: matrix.config.os == 'windows-latest'
with:
name: ${{ matrix.config.name }} - installer
path: build/Aegisub-*.exe
if-no-files-found: error
- name: Upload artifacts - portable.zip
uses: actions/upload-artifact@v3
if: matrix.config.os == 'windows-latest'
with:
name: ${{ matrix.config.name }} - portable
path: build/aegisub-portable-64.zip
# macOS artifacts
- name: Generate macOS installer
if: matrix.config.os == 'macos-12'
run: |
meson compile osx-bundle -C build
meson compile osx-build-dmg -C build
- name: Upload artifacts - macOS dmg
uses: actions/upload-artifact@v3
if: matrix.config.os == 'macos-12'
with:
name: ${{ matrix.config.name }} - installer
path: build/Aegisub-*.dmg
if-no-files-found: error
# Linux artifacts (AppImage)
- name: Generate AppImage
if: matrix.config.appimage
run: |
mkdir -p appimage/appdir
meson install -C build --destdir=../appimage/appdir
cd appimage
sudo apt-get install libfuse2
curl -L "https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20220822-1/linuxdeploy-x86_64.AppImage" -o linuxdeploy
curl -L "https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage" -o appimagetool
chmod +x linuxdeploy appimagetool
./linuxdeploy --appdir appdir --desktop-file=appdir/aegisub.desktop
./appimagetool appdir
- name: Upload artifacts - Linux AppImage
uses: actions/upload-artifact@v3
if: matrix.config.appimage
with:
name: ${{ matrix.config.name }}
path: appimage/*.AppImage
if-no-files-found: error

49
.gitignore vendored Normal file
View File

@ -0,0 +1,49 @@
/tests/data
automation/vapoursynth/__pycache__
packages/desktop/aegisub.desktop
packages/desktop/aegisub.desktop.template
src/libresrc/bitmap.cpp
src/libresrc/bitmap.h
src/libresrc/default_config.cpp
src/libresrc/default_config.h
src/libresrc/default_config_platform.json
tests/*.json
tests/run
tools/osx-bundle-restart-helper
tools/repack-thes-dict
tools/repack-thes-dict.dSYM
# Platform-specific
.DS_Store
# Meson
build*/
subprojects/avisynth
subprojects/bestsource/
subprojects/boost*/
subprojects/cairo*
subprojects/dav1d
subprojects/ffmpeg
subprojects/ffms2
subprojects/fontconfig*
subprojects/freetype2
subprojects/fribidi
subprojects/glib*
subprojects/googletest-*
subprojects/harfbuzz
subprojects/icu
subprojects/jansson
subprojects/libass
subprojects/libffi*
subprojects/libpng-*
subprojects/luajit
subprojects/nasm-*
subprojects/packagecache
subprojects/proxy-libintl*
subprojects/wxWidgets
subprojects/zlib-*
subprojects/dirent-*
subprojects/hunspell-*
subprojects/uchardet-*
subprojects/vapoursynth

View File

@ -1,32 +0,0 @@
noinst_LIBRARIES = libffmpegsource2_aegisub.a
AM_CPPFLAGS = -I../aegisub -D__UNIX__ -DHAVE_STRLCPY @LIBAVFORMAT_CFLAGS@ @LIBAVCODEC_CFLAGS@ @LIBSWSCALE_CFLAGS@ @LIBAVUTIL_CFLAGS@ @LIBPOSTPROC_CFLAGS@
libffmpegsource2_aegisub_a_SOURCES = \
ffaudiosource.cpp \
ffms.cpp \
ffvideosource.cpp \
indexing.cpp \
MatroskaParser.c \
stdiostream.c \
utils.cpp \
wave64writer.cpp
libffmpegsource2_aegisub_a_SOURCES += \
MatroskaParser.h \
avisynth.h \
ffaudiosource.h \
ffavisynth.h \
ffms.h \
ffpp.h \
ffswscale.h \
ffvideosource.h \
indexing.h \
stdiostream.h \
utils.h \
wave64writer.h
EXTRA_DIST = \
ffms2.html

File diff suppressed because it is too large Load Diff

View File

@ -1,401 +0,0 @@
/*
* Copyright (c) 2004-2006 Mike Matsnev. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice immediately at the beginning of the file, without modification,
* this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Absolutely no warranty of function or purpose is made by the author
* Mike Matsnev.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: MatroskaParser.h,v 1.19 2006/03/11 10:57:13 mike Exp $
*
*/
#ifndef MATROSKA_PARSER_H
#define MATROSKA_PARSER_H
/* Random notes:
*
* The parser does not process frame data in any way and does not read it into
* the queue. The app should read it via mkv_ReadData if it is interested.
*
* The code here is 64-bit clean and was tested on FreeBSD/sparc 64-bit big endian
* system
*/
#include <stddef.h>
#ifdef MPDLLBUILD
#define X __declspec(dllexport)
#else
#ifdef MPDLL
#define X __declspec(dllimport)
#pragma comment(lib,"MatroskaParser")
#else
#define X
#endif
#endif
#define MATROSKA_COMPRESSION_SUPPORT
#define MATROSKA_INTEGER_ONLY
#ifdef __cplusplus
extern "C" {
#endif
/* 64-bit integers */
#ifdef _WIN32_WCE
typedef signed __int64 longlong;
typedef unsigned __int64 ulonglong;
#else
typedef signed long long longlong;
typedef unsigned long long ulonglong;
#endif
/* MKFLOATing point */
#ifdef MATROSKA_INTEGER_ONLY
typedef struct {
longlong v;
} MKFLOAT;
#else
typedef double MKFLOAT;
#endif
/* generic I/O */
struct InputStream {
/* read bytes from stream */
int (*read)(struct InputStream *cc,ulonglong pos,void *buffer,int count);
/* scan for a four byte signature, bytes must be nonzero */
longlong (*scan)(struct InputStream *cc,ulonglong start,unsigned signature);
/* get cache size, this is used to cap readahead */
unsigned (*getcachesize)(struct InputStream *cc);
/* fetch last error message */
const char *(*geterror)(struct InputStream *cc);
/* memory allocation */
void *(*memalloc)(struct InputStream *cc,size_t size);
void *(*memrealloc)(struct InputStream *cc,void *mem,size_t newsize);
void (*memfree)(struct InputStream *cc,void *mem);
/* zero return causes parser to abort open */
int (*progress)(struct InputStream *cc,ulonglong cur,ulonglong max);
/* get file size, optional, can be NULL or return -1 if filesize is unknown */
longlong (*getfilesize)(struct InputStream *cc);
};
typedef struct InputStream InputStream;
/* matroska file */
struct MatroskaFile; /* opaque */
typedef struct MatroskaFile MatroskaFile;
#define COMP_ZLIB 0
#define COMP_BZIP 1
#define COMP_LZO1X 2
#define COMP_PREPEND 3
#define TT_VIDEO 1
#define TT_AUDIO 2
#define TT_SUB 17
struct TrackInfo {
unsigned char Number;
unsigned char Type;
unsigned char TrackOverlay;
ulonglong UID;
ulonglong MinCache;
ulonglong MaxCache;
ulonglong DefaultDuration;
MKFLOAT TimecodeScale;
void *CodecPrivate;
unsigned CodecPrivateSize;
unsigned CompMethod;
void *CompMethodPrivate;
unsigned CompMethodPrivateSize;
unsigned MaxBlockAdditionID;
struct {
unsigned int Enabled:1;
unsigned int Default:1;
unsigned int Lacing:1;
unsigned int DecodeAll:1;
unsigned int CompEnabled:1;
};
union {
struct {
unsigned char StereoMode;
unsigned char DisplayUnit;
unsigned char AspectRatioType;
unsigned int PixelWidth;
unsigned int PixelHeight;
unsigned int DisplayWidth;
unsigned int DisplayHeight;
unsigned int CropL, CropT, CropR, CropB;
unsigned int ColourSpace;
MKFLOAT GammaValue;
struct {
unsigned int Interlaced:1;
};
} Video;
struct {
MKFLOAT SamplingFreq;
MKFLOAT OutputSamplingFreq;
unsigned char Channels;
unsigned char BitDepth;
} Audio;
} AV;
/* various strings */
char *Name;
char Language[4];
char *CodecID;
};
typedef struct TrackInfo TrackInfo;
struct SegmentInfo {
char UID[16];
char PrevUID[16];
char NextUID[16];
char *Filename;
char *PrevFilename;
char *NextFilename;
char *Title;
char *MuxingApp;
char *WritingApp;
ulonglong TimecodeScale;
ulonglong Duration;
longlong DateUTC;
char DateUTCValid;
};
typedef struct SegmentInfo SegmentInfo;
struct Attachment {
ulonglong Position;
ulonglong Length;
ulonglong UID;
char *Name;
char *Description;
char *MimeType;
};
typedef struct Attachment Attachment;
struct ChapterDisplay {
char *String;
char Language[4];
char Country[4];
};
struct ChapterCommand {
unsigned Time;
unsigned CommandLength;
void *Command;
};
struct ChapterProcess {
unsigned CodecID;
unsigned CodecPrivateLength;
void *CodecPrivate;
unsigned nCommands,nCommandsSize;
struct ChapterCommand *Commands;
};
struct Chapter {
ulonglong UID;
ulonglong Start;
ulonglong End;
unsigned nTracks,nTracksSize;
ulonglong *Tracks;
unsigned nDisplay,nDisplaySize;
struct ChapterDisplay *Display;
unsigned nChildren,nChildrenSize;
struct Chapter *Children;
unsigned nProcess,nProcessSize;
struct ChapterProcess *Process;
char SegmentUID[16];
struct {
unsigned int Hidden:1;
unsigned int Enabled:1;
// Editions
unsigned int Default:1;
unsigned int Ordered:1;
};
};
typedef struct Chapter Chapter;
#define TARGET_TRACK 0
#define TARGET_CHAPTER 1
#define TARGET_ATTACHMENT 2
#define TARGET_EDITION 3
struct Target {
ulonglong UID;
unsigned Type;
};
struct SimpleTag {
char *Name;
char *Value;
char Language[4];
unsigned Default:1;
};
struct Tag {
unsigned nTargets,nTargetsSize;
struct Target *Targets;
unsigned nSimpleTags,nSimpleTagsSize;
struct SimpleTag *SimpleTags;
};
typedef struct Tag Tag;
/* Open a matroska file
* io pointer is recorded inside MatroskaFile
*/
X MatroskaFile *mkv_Open(/* in */ InputStream *io,
/* out */ char *err_msg,
/* in */ unsigned msgsize);
#define MKVF_AVOID_SEEKS 1 /* use sequential reading only */
X MatroskaFile *mkv_OpenEx(/* in */ InputStream *io,
/* in */ ulonglong base,
/* in */ unsigned flags,
/* out */ char *err_msg,
/* in */ unsigned msgsize);
/* Close and deallocate mf
* NULL pointer is ok and is simply ignored
*/
X void mkv_Close(/* in */ MatroskaFile *mf);
/* Fetch the error message of the last failed operation */
X const char *mkv_GetLastError(/* in */ MatroskaFile *mf);
/* Get file information */
X SegmentInfo *mkv_GetFileInfo(/* in */ MatroskaFile *mf);
/* Get track information */
X unsigned int mkv_GetNumTracks(/* in */ MatroskaFile *mf);
X TrackInfo *mkv_GetTrackInfo(/* in */ MatroskaFile *mf,/* in */ unsigned track);
/* chapters, tags and attachments */
X void mkv_GetAttachments(/* in */ MatroskaFile *mf,
/* out */ Attachment **at,
/* out */ unsigned *count);
X void mkv_GetChapters(/* in */ MatroskaFile *mf,
/* out */ Chapter **ch,
/* out */ unsigned *count);
X void mkv_GetTags(/* in */ MatroskaFile *mf,
/* out */ Tag **tag,
/* out */ unsigned *count);
X ulonglong mkv_GetSegmentTop(MatroskaFile *mf);
/* Seek to specified timecode,
* if timecode is past end of file,
* all tracks are set to return EOF
* on next read
*/
#define MKVF_SEEK_TO_PREV_KEYFRAME 1
X void mkv_Seek(/* in */ MatroskaFile *mf,
/* in */ ulonglong timecode /* in ns */,
/* in */ unsigned flags);
X void mkv_SkipToKeyframe(MatroskaFile *mf);
X ulonglong mkv_GetLowestQTimecode(MatroskaFile *mf);
X int mkv_TruncFloat(MKFLOAT f);
/*************************************************************************
* reading data, pull model
*/
/* frame flags */
#define FRAME_UNKNOWN_START 0x00000001
#define FRAME_UNKNOWN_END 0x00000002
#define FRAME_KF 0x00000004
#define FRAME_GAP 0x00800000
#define FRAME_STREAM_MASK 0xff000000
#define FRAME_STREAM_SHIFT 24
/* This sets the masking flags for the parser,
* masked tracks [with 1s in their bit positions]
* will be ignored when reading file data.
* This call discards all parsed and queued frames
*/
X void mkv_SetTrackMask(/* in */ MatroskaFile *mf,/* in */ unsigned int mask);
/* Read one frame from the queue.
* mask specifies what tracks to ignore.
* Returns -1 if there are no more frames in the specified
* set of tracks, 0 on success
*/
X int mkv_ReadFrame(/* in */ MatroskaFile *mf,
/* in */ unsigned int mask,
/* out */ unsigned int *track,
/* out */ ulonglong *StartTime /* in ns */,
/* out */ ulonglong *EndTime /* in ns */,
/* out */ ulonglong *FilePos /* in bytes from start of file */,
/* out */ unsigned int *FrameSize /* in bytes */,
/* out */ unsigned int *FrameFlags);
#ifdef MATROSKA_COMPRESSION_SUPPORT
/* Compressed streams support */
struct CompressedStream;
typedef struct CompressedStream CompressedStream;
X CompressedStream *cs_Create(/* in */ MatroskaFile *mf,
/* in */ unsigned tracknum,
/* out */ char *errormsg,
/* in */ unsigned msgsize);
X void cs_Destroy(/* in */ CompressedStream *cs);
/* advance to the next frame in matroska stream, you need to pass values returned
* by mkv_ReadFrame */
X void cs_NextFrame(/* in */ CompressedStream *cs,
/* in */ ulonglong pos,
/* in */ unsigned size);
/* read and decode more data from current frame, return number of bytes decoded,
* 0 on end of frame, or -1 on error */
X int cs_ReadData(CompressedStream *cs,char *buffer,unsigned bufsize);
/* return error message for the last error */
X const char *cs_GetLastError(CompressedStream *cs);
#endif
#ifdef __cplusplus
}
#endif
#undef X
#endif

View File

@ -1,749 +0,0 @@
// Avisynth v2.5. Copyright 2002 Ben Rudiak-Gould et al.
// http://www.avisynth.org
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// Linking Avisynth statically or dynamically with other modules is making a
// combined work based on Avisynth. Thus, the terms and conditions of the GNU
// General Public License cover the whole combination.
//
// As a special exception, the copyright holders of Avisynth give you
// permission to link Avisynth with independent modules that communicate with
// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license
// terms of these independent modules, and to copy and distribute the
// resulting combined work under terms of your choice, provided that
// every copy of the combined work is accompanied by a complete copy of
// the source code of Avisynth (the version of Avisynth used to produce the
// combined work), being distributed under the terms of the GNU General
// Public License plus this exception. An independent module is a module
// which is not derived from or based on Avisynth, such as 3rd-party filters,
// import and export plugins, or graphical user interfaces.
#ifndef __AVISYNTH_H__
#define __AVISYNTH_H__
enum { AVISYNTH_INTERFACE_VERSION = 3 };
/* Define all types necessary for interfacing with avisynth.dll
Moved from internal.h */
// Win32 API macros, notably the types BYTE, DWORD, ULONG, etc.
#include <windef.h>
// COM interface macros
#include <objbase.h>
// Raster types used by VirtualDub & Avisynth
#define in64 (__int64)(unsigned short)
typedef unsigned long Pixel; // this will break on 64-bit machines!
typedef unsigned long Pixel32;
typedef unsigned char Pixel8;
typedef long PixCoord;
typedef long PixDim;
typedef long PixOffset;
/* Compiler-specific crap */
// Tell MSVC to stop precompiling here
#ifdef _MSC_VER
#pragma hdrstop
#endif
// Set up debugging macros for MS compilers; for others, step down to the
// standard <assert.h> interface
#ifdef _MSC_VER
#include <crtdbg.h>
#else
#define _RPT0(a,b) ((void)0)
#define _RPT1(a,b,c) ((void)0)
#define _RPT2(a,b,c,d) ((void)0)
#define _RPT3(a,b,c,d,e) ((void)0)
#define _RPT4(a,b,c,d,e,f) ((void)0)
#define _ASSERTE(x) assert(x)
#include <assert.h>
#endif
// I had problems with Premiere wanting 1-byte alignment for its structures,
// so I now set the Avisynth struct alignment explicitly here.
#pragma pack(push,8)
#define FRAME_ALIGN 16
// Default frame alignment is 16 bytes, to help P4, when using SSE2
// The VideoInfo struct holds global information about a clip (i.e.
// information that does not depend on the frame number). The GetVideoInfo
// method in IClip returns this struct.
// Audio Sample information
typedef float SFLOAT;
enum {SAMPLE_INT8 = 1<<0,
SAMPLE_INT16 = 1<<1,
SAMPLE_INT24 = 1<<2, // Int24 is a very stupid thing to code, but it's supported by some hardware.
SAMPLE_INT32 = 1<<3,
SAMPLE_FLOAT = 1<<4};
enum {
PLANAR_Y=1<<0,
PLANAR_U=1<<1,
PLANAR_V=1<<2,
PLANAR_ALIGNED=1<<3,
PLANAR_Y_ALIGNED=PLANAR_Y|PLANAR_ALIGNED,
PLANAR_U_ALIGNED=PLANAR_U|PLANAR_ALIGNED,
PLANAR_V_ALIGNED=PLANAR_V|PLANAR_ALIGNED,
};
struct VideoInfo {
int width, height; // width=0 means no video
unsigned fps_numerator, fps_denominator;
int num_frames;
// This is more extensible than previous versions. More properties can be added seeminglesly.
// Colorspace properties.
enum {
CS_BGR = 1<<28,
CS_YUV = 1<<29,
CS_INTERLEAVED = 1<<30,
CS_PLANAR = 1<<31
};
// Specific colorformats
enum { CS_UNKNOWN = 0,
CS_BGR24 = 1<<0 | CS_BGR | CS_INTERLEAVED,
CS_BGR32 = 1<<1 | CS_BGR | CS_INTERLEAVED,
CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED,
CS_YV12 = 1<<3 | CS_YUV | CS_PLANAR, // y-v-u, planar
CS_I420 = 1<<4 | CS_YUV | CS_PLANAR, // y-u-v, planar
CS_IYUV = 1<<4 | CS_YUV | CS_PLANAR // same as above
};
int pixel_type; // changed to int as of 2.5
int audio_samples_per_second; // 0 means no audio
int sample_type; // as of 2.5
__int64 num_audio_samples; // changed as of 2.5
int nchannels; // as of 2.5
// Imagetype properties
int image_type;
enum {
IT_BFF = 1<<0,
IT_TFF = 1<<1,
IT_FIELDBASED = 1<<2
};
// useful functions of the above
bool HasVideo() const { return (width!=0); }
bool HasAudio() const { return (audio_samples_per_second!=0); }
bool IsRGB() const { return !!(pixel_type&CS_BGR); }
bool IsRGB24() const { return (pixel_type&CS_BGR24)==CS_BGR24; } // Clear out additional properties
bool IsRGB32() const { return (pixel_type & CS_BGR32) == CS_BGR32 ; }
bool IsYUV() const { return !!(pixel_type&CS_YUV ); }
bool IsYUY2() const { return (pixel_type & CS_YUY2) == CS_YUY2; }
bool IsYV12() const { return ((pixel_type & CS_YV12) == CS_YV12)||((pixel_type & CS_I420) == CS_I420); }
bool IsColorSpace(int c_space) const { return ((pixel_type & c_space) == c_space); }
bool Is(int property) const { return ((pixel_type & property)==property ); }
bool IsPlanar() const { return !!(pixel_type & CS_PLANAR); }
bool IsFieldBased() const { return !!(image_type & IT_FIELDBASED); }
bool IsParityKnown() const { return ((image_type & IT_FIELDBASED)&&(image_type & (IT_BFF|IT_TFF))); }
bool IsBFF() const { return !!(image_type & IT_BFF); }
bool IsTFF() const { return !!(image_type & IT_TFF); }
bool IsVPlaneFirst() const {return ((pixel_type & CS_YV12) == CS_YV12); } // Don't use this
int BytesFromPixels(int pixels) const { return pixels * (BitsPerPixel()>>3); } // Will not work on planar images, but will return only luma planes
int RowSize() const { return BytesFromPixels(width); } // Also only returns first plane on planar images
int BMPSize() const { if (IsPlanar()) {int p = height * ((RowSize()+3) & ~3); p+=p>>1; return p; } return height * ((RowSize()+3) & ~3); }
__int64 AudioSamplesFromFrames(__int64 frames) const { return (fps_numerator && HasVideo()) ? ((__int64)(frames) * audio_samples_per_second * fps_denominator / fps_numerator) : 0; }
int FramesFromAudioSamples(__int64 samples) const { return (fps_denominator && HasAudio()) ? (int)((samples * (__int64)fps_numerator)/((__int64)fps_denominator * (__int64)audio_samples_per_second)) : 0; }
__int64 AudioSamplesFromBytes(__int64 bytes) const { return HasAudio() ? bytes / BytesPerAudioSample() : 0; }
__int64 BytesFromAudioSamples(__int64 samples) const { return samples * BytesPerAudioSample(); }
int AudioChannels() const { return HasAudio() ? nchannels : 0; }
int SampleType() const{ return sample_type;}
bool IsSampleType(int testtype) const{ return !!(sample_type&testtype);}
int SamplesPerSecond() const { return audio_samples_per_second; }
int BytesPerAudioSample() const { return nchannels*BytesPerChannelSample();}
void SetFieldBased(bool isfieldbased) { if (isfieldbased) image_type|=IT_FIELDBASED; else image_type&=~IT_FIELDBASED; }
void Set(int property) { image_type|=property; }
void Clear(int property) { image_type&=~property; }
int BitsPerPixel() const {
switch (pixel_type) {
case CS_BGR24:
return 24;
case CS_BGR32:
return 32;
case CS_YUY2:
return 16;
case CS_YV12:
case CS_I420:
return 12;
default:
return 0;
}
}
int BytesPerChannelSample() const {
switch (sample_type) {
case SAMPLE_INT8:
return sizeof(signed char);
case SAMPLE_INT16:
return sizeof(signed short);
case SAMPLE_INT24:
return 3;
case SAMPLE_INT32:
return sizeof(signed int);
case SAMPLE_FLOAT:
return sizeof(SFLOAT);
default:
_ASSERTE("Sample type not recognized!");
return 0;
}
}
// useful mutator
void SetFPS(unsigned numerator, unsigned denominator) {
if ((numerator == 0) || (denominator == 0)) {
fps_numerator = 0;
fps_denominator = 1;
}
else {
unsigned x=numerator, y=denominator;
while (y) { // find gcd
unsigned t = x%y; x = y; y = t;
}
fps_numerator = numerator/x;
fps_denominator = denominator/x;
}
}
// Range protected multiply-divide of FPS
void MulDivFPS(unsigned multiplier, unsigned divisor) {
unsigned __int64 numerator = UInt32x32To64(fps_numerator, multiplier);
unsigned __int64 denominator = UInt32x32To64(fps_denominator, divisor);
unsigned __int64 x=numerator, y=denominator;
while (y) { // find gcd
unsigned __int64 t = x%y; x = y; y = t;
}
numerator /= x; // normalize
denominator /= x;
unsigned __int64 temp = numerator | denominator; // Just looking top bit
unsigned u = 0;
while (temp & 0xffffffff80000000) { // or perhaps > 16777216*2
temp = Int64ShrlMod32(temp, 1);
u++;
}
if (u) { // Scale to fit
const unsigned round = 1 << (u-1);
SetFPS( (unsigned)Int64ShrlMod32(numerator + round, u),
(unsigned)Int64ShrlMod32(denominator + round, u) );
}
else {
fps_numerator = (unsigned)numerator;
fps_denominator = (unsigned)denominator;
}
}
// Test for same colorspace
bool IsSameColorspace(const VideoInfo& vi) const {
if (vi.pixel_type == pixel_type) return TRUE;
if (IsYV12() && vi.IsYV12()) return TRUE;
return FALSE;
}
};
// VideoFrameBuffer holds information about a memory block which is used
// for video data. For efficiency, instances of this class are not deleted
// when the refcount reaches zero; instead they're stored in a linked list
// to be reused. The instances are deleted when the corresponding AVS
// file is closed.
class VideoFrameBuffer {
BYTE* const data;
const int data_size;
// sequence_number is incremented every time the buffer is changed, so
// that stale views can tell they're no longer valid.
long sequence_number;
friend class VideoFrame;
friend class Cache;
friend class ScriptEnvironment;
long refcount;
public:
VideoFrameBuffer(int size);
VideoFrameBuffer();
~VideoFrameBuffer();
const BYTE* GetReadPtr() const { return data; }
BYTE* GetWritePtr() { ++sequence_number; return data; }
int GetDataSize() { return data_size; }
int GetSequenceNumber() { return sequence_number; }
int GetRefcount() { return refcount; }
};
class IClip;
class PClip;
class PVideoFrame;
class IScriptEnvironment;
class AVSValue;
// VideoFrame holds a "window" into a VideoFrameBuffer. Operator new
// is overloaded to recycle class instances.
class VideoFrame {
int refcount;
VideoFrameBuffer* const vfb;
const int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture.
friend class PVideoFrame;
void AddRef() { InterlockedIncrement((long *)&refcount); }
void Release() { if (refcount==1) InterlockedDecrement(&vfb->refcount); InterlockedDecrement((long *)&refcount); }
friend class ScriptEnvironment;
friend class Cache;
VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height);
VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV);
void* operator new(unsigned size);
// TESTME: OFFSET U/V may be switched to what could be expected from AVI standard!
public:
int GetPitch() const { return pitch; }
int GetPitch(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: return pitchUV;} return pitch; }
int GetRowSize() const { return row_size; }
int GetRowSize(int plane) const {
switch (plane) {
case PLANAR_U: case PLANAR_V: if (pitchUV) return row_size>>1; else return 0;
case PLANAR_U_ALIGNED: case PLANAR_V_ALIGNED:
if (pitchUV) {
int r = ((row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)) )>>1; // Aligned rowsize
if (r<=pitchUV)
return r;
return row_size>>1;
} else return 0;
case PLANAR_Y_ALIGNED:
int r = (row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)); // Aligned rowsize
if (r<=pitch)
return r;
return row_size;
}
return row_size; }
int GetHeight() const { return height; }
int GetHeight(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: if (pitchUV) return height>>1; return 0;} return height; }
// generally you shouldn't use these three
VideoFrameBuffer* GetFrameBuffer() const { return vfb; }
int GetOffset() const { return offset; }
int GetOffset(int plane) const { switch (plane) {case PLANAR_U: return offsetU;case PLANAR_V: return offsetV;default: return offset;}; }
// in plugins use env->SubFrame()
VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height) const;
VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV) const;
const BYTE* GetReadPtr() const { return vfb->GetReadPtr() + offset; }
const BYTE* GetReadPtr(int plane) const { return vfb->GetReadPtr() + GetOffset(plane); }
bool IsWritable() const { return (refcount == 1 && vfb->refcount == 1); }
BYTE* GetWritePtr() const {
if (vfb->GetRefcount()>1) {
_ASSERT(FALSE);
//throw AvisynthError("Internal Error - refcount was more than one!");
}
return IsWritable() ? (vfb->GetWritePtr() + offset) : 0;
}
BYTE* GetWritePtr(int plane) const {
if (plane==PLANAR_Y) {
if (vfb->GetRefcount()>1) {
_ASSERT(FALSE);
// throw AvisynthError("Internal Error - refcount was more than one!");
}
return IsWritable() ? vfb->GetWritePtr() + GetOffset(plane) : 0;
}
return vfb->data + GetOffset(plane);
}
~VideoFrame() { InterlockedDecrement(&vfb->refcount); }
};
enum {
CACHE_NOTHING=0,
CACHE_RANGE=1,
CACHE_ALL=2,
CACHE_AUDIO=3,
CACHE_AUDIO_NONE=4
};
// Base class for all filters.
class IClip {
friend class PClip;
friend class AVSValue;
int refcnt;
void AddRef() { InterlockedIncrement((long *)&refcnt); }
void Release() { InterlockedDecrement((long *)&refcnt); if (!refcnt) delete this; }
public:
IClip() : refcnt(0) {}
virtual int __stdcall GetVersion() { return AVISYNTH_INTERFACE_VERSION; }
virtual PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) = 0;
virtual bool __stdcall GetParity(int n) = 0; // return field parity if field_based, else parity of first field in frame
virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0; // start and count are in samples
virtual void __stdcall SetCacheHints(int cachehints,int frame_range) = 0 ; // We do not pass cache requests upwards, only to the next filter.
virtual const VideoInfo& __stdcall GetVideoInfo() = 0;
virtual __stdcall ~IClip() {}
};
// smart pointer to IClip
class PClip {
IClip* p;
IClip* GetPointerWithAddRef() const { if (p) p->AddRef(); return p; }
friend class AVSValue;
friend class VideoFrame;
void Init(IClip* x) {
if (x) x->AddRef();
p=x;
}
void Set(IClip* x) {
if (x) x->AddRef();
if (p) p->Release();
p=x;
}
public:
PClip() { p = 0; }
PClip(const PClip& x) { Init(x.p); }
PClip(IClip* x) { Init(x); }
void operator=(IClip* x) { Set(x); }
void operator=(const PClip& x) { Set(x.p); }
IClip* operator->() const { return p; }
// useful in conditional expressions
operator void*() const { return p; }
bool operator!() const { return !p; }
~PClip() { if (p) p->Release(); }
};
// smart pointer to VideoFrame
class PVideoFrame {
VideoFrame* p;
void Init(VideoFrame* x) {
if (x) x->AddRef();
p=x;
}
void Set(VideoFrame* x) {
if (x) x->AddRef();
if (p) p->Release();
p=x;
}
public:
PVideoFrame() { p = 0; }
PVideoFrame(const PVideoFrame& x) { Init(x.p); }
PVideoFrame(VideoFrame* x) { Init(x); }
void operator=(VideoFrame* x) { Set(x); }
void operator=(const PVideoFrame& x) { Set(x.p); }
VideoFrame* operator->() const { return p; }
// for conditional expressions
operator void*() const { return p; }
bool operator!() const { return !p; }
~PVideoFrame() { if (p) p->Release();}
};
class AVSValue {
public:
AVSValue() { type = 'v'; }
AVSValue(IClip* c) { type = 'c'; clip = c; if (c) c->AddRef(); }
AVSValue(const PClip& c) { type = 'c'; clip = c.GetPointerWithAddRef(); }
AVSValue(bool b) { type = 'b'; boolean = b; }
AVSValue(int i) { type = 'i'; integer = i; }
// AVSValue(__int64 l) { type = 'l'; longlong = l; }
AVSValue(float f) { type = 'f'; floating_pt = f; }
AVSValue(double f) { type = 'f'; floating_pt = float(f); }
AVSValue(const char* s) { type = 's'; string = s; }
AVSValue(const AVSValue* a, int size) { type = 'a'; array = a; array_size = size; }
AVSValue(const AVSValue& v) { Assign(&v, true); }
~AVSValue() { if (IsClip() && clip) clip->Release(); }
AVSValue& operator=(const AVSValue& v) { Assign(&v, false); return *this; }
// Note that we transparently allow 'int' to be treated as 'float'.
// There are no int<->bool conversions, though.
bool Defined() const { return type != 'v'; }
bool IsClip() const { return type == 'c'; }
bool IsBool() const { return type == 'b'; }
bool IsInt() const { return type == 'i'; }
// bool IsLong() const { return (type == 'l'|| type == 'i'); }
bool IsFloat() const { return type == 'f' || type == 'i'; }
bool IsString() const { return type == 's'; }
bool IsArray() const { return type == 'a'; }
PClip AsClip() const { _ASSERTE(IsClip()); return IsClip()?clip:0; }
bool AsBool() const { _ASSERTE(IsBool()); return boolean; }
int AsInt() const { _ASSERTE(IsInt()); return integer; }
// int AsLong() const { _ASSERTE(IsLong()); return longlong; }
const char* AsString() const { _ASSERTE(IsString()); return IsString()?string:0; }
double AsFloat() const { _ASSERTE(IsFloat()); return IsInt()?integer:floating_pt; }
bool AsBool(bool def) const { _ASSERTE(IsBool()||!Defined()); return IsBool() ? boolean : def; }
int AsInt(int def) const { _ASSERTE(IsInt()||!Defined()); return IsInt() ? integer : def; }
double AsFloat(double def) const { _ASSERTE(IsFloat()||!Defined()); return IsInt() ? integer : type=='f' ? floating_pt : def; }
const char* AsString(const char* def) const { _ASSERTE(IsString()||!Defined()); return IsString() ? string : def; }
int ArraySize() const { _ASSERTE(IsArray()); return IsArray()?array_size:1; }
const AVSValue& operator[](int index) const {
_ASSERTE(IsArray() && index>=0 && index<array_size);
return (IsArray() && index>=0 && index<array_size) ? array[index] : *this;
}
private:
short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
short array_size;
union {
IClip* clip;
bool boolean;
int integer;
float floating_pt;
const char* string;
const AVSValue* array;
// __int64 longlong;
};
void Assign(const AVSValue* src, bool init) {
if (src->IsClip() && src->clip)
src->clip->AddRef();
if (!init && IsClip() && clip)
clip->Release();
// make sure this copies the whole struct!
((__int32*)this)[0] = ((__int32*)src)[0];
((__int32*)this)[1] = ((__int32*)src)[1];
}
};
// instantiable null filter
class GenericVideoFilter : public IClip {
protected:
PClip child;
VideoInfo vi;
public:
GenericVideoFilter(PClip _child) : child(_child) { vi = child->GetVideoInfo(); }
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) { return child->GetFrame(n, env); }
void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) { child->GetAudio(buf, start, count, env); }
const VideoInfo& __stdcall GetVideoInfo() { return vi; }
bool __stdcall GetParity(int n) { return child->GetParity(n); }
void __stdcall SetCacheHints(int cachehints,int frame_range) { } ; // We do not pass cache requests upwards, only to the next filter.
};
class AvisynthError /* exception */ {
public:
const char* const msg;
AvisynthError(const char* _msg) : msg(_msg) {}
};
/* Helper classes useful to plugin authors */
class AlignPlanar : public GenericVideoFilter
{
public:
AlignPlanar(PClip _clip);
static PClip Create(PClip clip);
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env);
};
class FillBorder : public GenericVideoFilter
{
public:
FillBorder(PClip _clip);
static PClip Create(PClip clip);
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env);
};
class ConvertAudio : public GenericVideoFilter
/**
* Helper class to convert audio to any format
**/
{
public:
ConvertAudio(PClip _clip, int prefered_format);
void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env);
void __stdcall SetCacheHints(int cachehints,int frame_range); // We do pass cache requests upwards, to the cache!
static PClip Create(PClip clip, int sample_type, int prefered_type);
static AVSValue __cdecl Create_float(AVSValue args, void*, IScriptEnvironment*);
static AVSValue __cdecl Create_32bit(AVSValue args, void*, IScriptEnvironment*);
static AVSValue __cdecl Create_24bit(AVSValue args, void*, IScriptEnvironment*);
static AVSValue __cdecl Create_16bit(AVSValue args, void*, IScriptEnvironment*);
static AVSValue __cdecl Create_8bit(AVSValue args, void*, IScriptEnvironment*);
virtual ~ConvertAudio();
private:
void convertToFloat(char* inbuf, float* outbuf, char sample_type, int count);
void convertToFloat_3DN(char* inbuf, float* outbuf, char sample_type, int count);
void convertToFloat_SSE(char* inbuf, float* outbuf, char sample_type, int count);
void convertToFloat_SSE2(char* inbuf, float* outbuf, char sample_type, int count);
void convertFromFloat(float* inbuf, void* outbuf, char sample_type, int count);
void convertFromFloat_3DN(float* inbuf, void* outbuf, char sample_type, int count);
void convertFromFloat_SSE(float* inbuf, void* outbuf, char sample_type, int count);
void convertFromFloat_SSE2(float* inbuf, void* outbuf, char sample_type, int count);
__inline int Saturate_int8(float n);
__inline short Saturate_int16(float n);
__inline int Saturate_int24(float n);
__inline int Saturate_int32(float n);
char src_format;
char dst_format;
int src_bps;
char *tempbuffer;
SFLOAT *floatbuffer;
int tempbuffer_size;
};
// For GetCPUFlags. These are backwards-compatible with those in VirtualDub.
enum {
/* slowest CPU to support extension */
CPUF_FORCE = 0x01, // N/A
CPUF_FPU = 0x02, // 386/486DX
CPUF_MMX = 0x04, // P55C, K6, PII
CPUF_INTEGER_SSE = 0x08, // PIII, Athlon
CPUF_SSE = 0x10, // PIII, Athlon XP/MP
CPUF_SSE2 = 0x20, // PIV, Hammer
CPUF_3DNOW = 0x40, // K6-2
CPUF_3DNOW_EXT = 0x80, // Athlon
CPUF_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, which only Hammer
// will have anyway)
CPUF_SSE3 = 0x100, // Some P4 & Athlon 64.
};
#define MAX_INT 0x7fffffff
#define MIN_INT -0x7fffffff
class IScriptEnvironment {
public:
virtual __stdcall ~IScriptEnvironment() {}
virtual /*static*/ long __stdcall GetCPUFlags() = 0;
virtual char* __stdcall SaveString(const char* s, int length = -1) = 0;
virtual char* __stdcall Sprintf(const char* fmt, ...) = 0;
// note: val is really a va_list; I hope everyone typedefs va_list to a pointer
virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0;
__declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0;
class NotFound /*exception*/ {}; // thrown by Invoke and GetVar
typedef AVSValue (__cdecl *ApplyFunc)(AVSValue args, void* user_data, IScriptEnvironment* env);
virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data) = 0;
virtual bool __stdcall FunctionExists(const char* name) = 0;
virtual AVSValue __stdcall Invoke(const char* name, const AVSValue args, const char** arg_names=0) = 0;
virtual AVSValue __stdcall GetVar(const char* name) = 0;
virtual bool __stdcall SetVar(const char* name, const AVSValue& val) = 0;
virtual bool __stdcall SetGlobalVar(const char* name, const AVSValue& val) = 0;
virtual void __stdcall PushContext(int level=0) = 0;
virtual void __stdcall PopContext() = 0;
// align should be 4 or 8
virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=FRAME_ALIGN) = 0;
virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0;
virtual /*static*/ void __stdcall BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) = 0;
typedef void (__cdecl *ShutdownFunc)(void* user_data, IScriptEnvironment* env);
virtual void __stdcall AtExit(ShutdownFunc function, void* user_data) = 0;
virtual void __stdcall CheckVersion(int version = AVISYNTH_INTERFACE_VERSION) = 0;
virtual PVideoFrame __stdcall Subframe(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height) = 0;
virtual int __stdcall SetMemoryMax(int mem) = 0;
virtual int __stdcall SetWorkingDir(const char * newdir) = 0;
virtual void* __stdcall ManageCache(int key, void* data) = 0;
enum PlanarChromaAlignmentMode {
PlanarChromaAlignmentOff,
PlanarChromaAlignmentOn,
PlanarChromaAlignmentTest };
virtual bool __stdcall PlanarChromaAlignment(PlanarChromaAlignmentMode key) = 0;
virtual PVideoFrame __stdcall SubframePlanar(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV) = 0;
};
// avisynth.dll exports this; it's a way to use it as a library, without
// writing an AVS script or without going through AVIFile.
IScriptEnvironment* __stdcall CreateScriptEnvironment(int version = AVISYNTH_INTERFACE_VERSION);
#pragma pack(pop)
#endif //__AVISYNTH_H__

View File

@ -1,121 +0,0 @@
/*
* Copyright (c) 2004-2008 Mike Matsnev. All Rights Reserved.
*
* $Id: CoParser.h,v 1.21 2008/03/29 15:41:28 mike Exp $
*
*/
#ifndef COPARSER_H
#define COPARSER_H
// Generic multimedia container parsers support
// random access stream, this will be provided by
// IMMContainer's client
[uuid("8E192E9F-E536-4027-8D46-664CC7A102C5")]
interface IMMStream : public IUnknown {
// read count bytes starting at position
STDMETHOD(Read)( unsigned long long position,
void *buffer,
unsigned int *count) = 0;
// scan the file starting at position for the signature
// signature can't have zero bytes
STDMETHOD(Scan)( unsigned long long *position,
unsigned int signature) = 0;
};
[uuid("A237C873-C6AD-422E-90DB-7CB4627DCFD9")]
interface IMMStreamOpen : public IUnknown {
STDMETHOD(Open)(LPCWSTR name) = 0;
};
[uuid("D8FF7213-6E09-4256-A2E5-5872C798B128")]
interface IMMFrame : public IMediaSample2 {
// track number must be the same as returned by
// IMMContainer->EnumTracks() iterator
STDMETHOD_(unsigned, GetTrack)() = 0;
STDMETHOD(SetTrack)(unsigned) = 0;
STDMETHOD_(unsigned, GetPre)() = 0;
STDMETHOD(SetPre)(unsigned) = 0;
};
[uuid("B8324E2A-21A9-46A1-8922-70C55D06311A")]
interface IMMErrorInfo : public IUnknown {
STDMETHOD(LogError)(BSTR message) = 0; // message is owned by the caller
STDMETHOD(LogWarning)(BSTR message) = 0;
};
[uuid("C7120EDB-528C-4ebe-BB53-DA8E70E618EE")]
interface IMemAlloc : public IUnknown {
STDMETHOD(GetBuffer)(HANDLE hAbortEvt, DWORD size, IMMFrame **pS) = 0;
};
// container itself should support IPropertyBag and return
// at least Duration[UI8] (in ns) property
// if a containter supports multiple segments in the same
// physical file it should return SegmentTop[UI8] property
// that return the offset of the first byte after this
// segment's end
[uuid("A369001B-F292-45f7-A942-84F9C8C0718A")]
interface IMMContainer : public IUnknown {
STDMETHOD(Open)( IMMStream *stream,
unsigned long long position,
IMMErrorInfo *einfo,
IMemAlloc *alloc) = 0;
STDMETHOD(GetProgress)(unsigned long long *cur,unsigned long long *max) = 0;
STDMETHOD(AbortOpen)() = 0;
// pu->Next() returns objects supporting IPropertyBag interface
STDMETHOD(EnumTracks)(IEnumUnknown **pu) = 0;
// pu->Next() returns objects supporting IProperyBag and IEnumUnknown interfaces
STDMETHOD(EnumEditions)(IEnumUnknown **pu) = 0;
// pu->Next() returns objects supporting IProperyBag and IMMStream interfaces
STDMETHOD(EnumAttachments)(IEnumUnknown **pu) = 0;
// S_FALSE is end of stream, S_OK next valid frame returned, E_ABORT wait aborted
STDMETHOD(ReadFrame)(HANDLE hAbortEvt, IMMFrame **frame) = 0;
// seeking
STDMETHOD(Seek)(unsigned long long timecode,unsigned flags) = 0;
};
/* FIXME: duplicated in matroska parser
enum { // Track type
TT_VIDEO = 1,
TT_AUDIO = 2,
TT_SUBS = 17,
TT_INTERLEAVED = 0x10001,
};
*/
enum { // Seek flags
MMSF_PREV_KF = 1,
MMSF_NEXT_KF = 2
};
/* Track properties [IPropertyBag from EnumTracks->Next()]
Name Type Optional
DefaultDuration UI8 Yes in ns
Video.Interlaced BOOL Yes
Video.DisplayWidth UI4 Yes
Video.DisplayHeight UI4 Yes
Video.PixelWidth UI4 No
Video.PixelHeight UI4 No
CodecID BSTR No
Type UI4 No TT_* enumeration
CodecPrivate ARRAY|UI1 Yes
Audio.Channels UI4 No
Audio.BitDepth UI4 Yes
Audio.SamplingFreq UI4 No
Audio.OutputSamplingFreq UI4 Yes
Language BSTR Yes
Name BSTR Yes
FOURCC UI4 Yes
*/
#endif

View File

@ -1,368 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ffaudiosource.h"
#include <errno.h>
#ifdef __UNIX__
#define _snprintf snprintf
#endif
AudioBase::AudioBase() {
DecodingBuffer = new uint8_t[AVCODEC_MAX_AUDIO_FRAME_SIZE * 10];
};
AudioBase::~AudioBase() {
delete[] DecodingBuffer;
};
size_t AudioBase::FindClosestAudioKeyFrame(int64_t Sample) {
for (size_t i = 0; i < Frames.size(); i++) {
if (Frames[i].SampleStart == Sample && Frames[i].KeyFrame)
return i;
else if (Frames[i].SampleStart > Sample && Frames[i].KeyFrame)
return i - 1;
}
return Frames.size() - 1;
}
void FFAudioSource::Free(bool CloseCodec) {
if (CloseCodec)
avcodec_close(CodecContext);
av_close_input_file(FormatContext);
}
FFAudioSource::FFAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize) {
FormatContext = NULL;
AVCodec *Codec = NULL;
AudioTrack = Track;
Frames = (*TrackIndices)[AudioTrack];
if (Frames.size() == 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Audio track contains no frames");
throw ErrorMsg;
}
if (av_open_input_file(&FormatContext, SourceFile, NULL, 0, NULL) != 0) {
_snprintf(ErrorMsg, MsgSize, "Couldn't open '%s'", SourceFile);
throw ErrorMsg;
}
if (av_find_stream_info(FormatContext) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Couldn't find stream information");
throw ErrorMsg;
}
CodecContext = FormatContext->streams[AudioTrack]->codec;
Codec = avcodec_find_decoder(CodecContext->codec_id);
if (Codec == NULL) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Audio codec not found");
throw ErrorMsg;
}
if (avcodec_open(CodecContext, Codec) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Could not open audio codec");
throw ErrorMsg;
}
// Always try to decode a frame to make sure all required parameters are known
uint8_t DummyBuf[512];
if (GetAudio(DummyBuf, 0, 1, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
AP.BitsPerSample = av_get_bits_per_sample_format(CodecContext->sample_fmt);
AP.Channels = CodecContext->channels;;
AP.Float = AudioFMTIsFloat(CodecContext->sample_fmt);
AP.SampleRate = CodecContext->sample_rate;
AP.NumSamples = (Frames.back()).SampleStart;
if (AP.SampleRate <= 0 || AP.BitsPerSample <= 0) {
Free(true);
_snprintf(ErrorMsg, MsgSize, "Codec returned zero size audio");
throw ErrorMsg;
}
}
int FFAudioSource::DecodeNextAudioBlock(uint8_t *Buf, int64_t *Count, char *ErrorMsg, unsigned MsgSize) {
const size_t SizeConst = (av_get_bits_per_sample_format(CodecContext->sample_fmt) * CodecContext->channels) / 8;
int Ret = -1;
*Count = 0;
AVPacket Packet;
while (av_read_frame(FormatContext, &Packet) >= 0) {
if (Packet.stream_index == AudioTrack) {
uint8_t *Data = Packet.data;
int Size = Packet.size;
while (Size > 0) {
int TempOutputBufSize = AVCODEC_MAX_AUDIO_FRAME_SIZE * 10;
Ret = avcodec_decode_audio2(CodecContext, (int16_t *)Buf, &TempOutputBufSize, Data, Size);
if (Ret < 0) {// throw error or something?
av_free_packet(&Packet);
goto Done;
}
if (Ret > 0) {
Size -= Ret;
Data += Ret;
Buf += TempOutputBufSize;
if (SizeConst)
*Count += TempOutputBufSize / SizeConst;
}
}
av_free_packet(&Packet);
goto Done;
}
av_free_packet(&Packet);
}
Done:
return Ret;
}
int FFAudioSource::GetAudio(void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize) {
const size_t SizeConst = (av_get_bits_per_sample_format(CodecContext->sample_fmt) * CodecContext->channels) / 8;
size_t CurrentAudioBlock = FFMAX((int64_t)FindClosestAudioKeyFrame(Start) - 50, (int64_t)0);
memset(Buf, 0, SizeConst * Count);
AVPacket Packet;
avcodec_flush_buffers(CodecContext);
av_seek_frame(FormatContext, AudioTrack, Frames[CurrentAudioBlock].DTS, AVSEEK_FLAG_BACKWARD);
// Establish where we actually are
// Trigger on packet dts difference since groups can otherwise be indistinguishable
int64_t LastDTS = - 1;
while (av_read_frame(FormatContext, &Packet) >= 0) {
if (Packet.stream_index == AudioTrack) {
if (LastDTS < 0) {
LastDTS = Packet.dts;
} else if (LastDTS != Packet.dts) {
for (size_t i = 0; i < Frames.size(); i++)
if (Frames[i].DTS == Packet.dts) {
// The current match was consumed
CurrentAudioBlock = i + 1;
break;
}
av_free_packet(&Packet);
break;
}
}
av_free_packet(&Packet);
}
uint8_t *DstBuf = (uint8_t *)Buf;
int64_t RemainingSamples = Count;
int64_t DecodeCount;
do {
int64_t DecodeStart = Frames[CurrentAudioBlock].SampleStart;
int Ret = DecodeNextAudioBlock(DecodingBuffer, &DecodeCount, ErrorMsg, MsgSize);
if (Ret < 0) {
// FIXME
//Env->ThrowError("Bleh, bad audio decoding");
}
CurrentAudioBlock++;
int64_t OffsetBytes = SizeConst * FFMAX(0, Start - DecodeStart);
int64_t CopyBytes = FFMAX(0, SizeConst * FFMIN(RemainingSamples, DecodeCount - FFMAX(0, Start - DecodeStart)));
memcpy(DstBuf, DecodingBuffer + OffsetBytes, CopyBytes);
DstBuf += CopyBytes;
if (SizeConst)
RemainingSamples -= CopyBytes / SizeConst;
} while (RemainingSamples > 0 && CurrentAudioBlock < Frames.size());
return 0;
}
FFAudioSource::~FFAudioSource() {
Free(true);
}
void MatroskaAudioSource::Free(bool CloseCodec) {
if (CS)
cs_Destroy(CS);
if (MC.ST.fp) {
mkv_Close(MF);
fclose(MC.ST.fp);
}
if (CloseCodec)
avcodec_close(CodecContext);
av_free(CodecContext);
}
MatroskaAudioSource::MatroskaAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize) {
CodecContext = NULL;
AVCodec *Codec = NULL;
TrackInfo *TI = NULL;
CS = NULL;
Frames = (*TrackIndices)[Track];
if (Frames.size() == 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Audio track contains no frames");
throw ErrorMsg;
}
MC.ST.fp = fopen(SourceFile, "rb");
if (MC.ST.fp == NULL) {
_snprintf(ErrorMsg, MsgSize, "Can't open '%s': %s", SourceFile, strerror(errno));
throw ErrorMsg;
}
setvbuf(MC.ST.fp, NULL, _IOFBF, CACHESIZE);
MF = mkv_OpenEx(&MC.ST.base, 0, 0, ErrorMessage, sizeof(ErrorMessage));
if (MF == NULL) {
fclose(MC.ST.fp);
_snprintf(ErrorMsg, MsgSize, "Can't parse Matroska file: %s", ErrorMessage);
throw ErrorMsg;
}
mkv_SetTrackMask(MF, ~(1 << Track));
TI = mkv_GetTrackInfo(MF, Track);
if (TI->CompEnabled) {
CS = cs_Create(MF, Track, ErrorMessage, sizeof(ErrorMessage));
if (CS == NULL) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Can't create decompressor: %s", ErrorMessage);
throw ErrorMsg;
}
}
CodecContext = avcodec_alloc_context();
CodecContext->extradata = (uint8_t *)TI->CodecPrivate;
CodecContext->extradata_size = TI->CodecPrivateSize;
Codec = avcodec_find_decoder(MatroskaToFFCodecID(TI->CodecID, TI->CodecPrivate));
if (Codec == NULL) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Video codec not found");
throw ErrorMsg;
}
if (avcodec_open(CodecContext, Codec) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Could not open video codec");
throw ErrorMsg;
}
// Always try to decode a frame to make sure all required parameters are known
uint8_t DummyBuf[512];
if (GetAudio(DummyBuf, 0, 1, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
AP.BitsPerSample = av_get_bits_per_sample_format(CodecContext->sample_fmt);
AP.Channels = CodecContext->channels;;
AP.Float = AudioFMTIsFloat(CodecContext->sample_fmt);
AP.SampleRate = CodecContext->sample_rate;
AP.NumSamples = (Frames.back()).SampleStart;
if (AP.SampleRate <= 0 || AP.BitsPerSample <= 0) {
Free(true);
_snprintf(ErrorMsg, MsgSize, "Codec returned zero size audio");
throw ErrorMsg;
}
}
MatroskaAudioSource::~MatroskaAudioSource() {
Free(true);
}
int MatroskaAudioSource::GetAudio(void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize) {
const size_t SizeConst = (av_get_bits_per_sample_format(CodecContext->sample_fmt) * CodecContext->channels) / 8;
size_t CurrentAudioBlock = FFMAX((int64_t)FindClosestAudioKeyFrame(Start) - 10, (int64_t)0);
avcodec_flush_buffers(CodecContext);
memset(Buf, 0, SizeConst * Count);
uint8_t *DstBuf = (uint8_t *)Buf;
int64_t RemainingSamples = Count;
int64_t DecodeCount;
do {
int64_t DecodeStart = Frames[CurrentAudioBlock].SampleStart;
int Ret = DecodeNextAudioBlock(DecodingBuffer, &DecodeCount, Frames[CurrentAudioBlock].FilePos, Frames[CurrentAudioBlock].FrameSize, ErrorMsg, MsgSize);
if (Ret < 0) {
// FIXME
//Env->ThrowError("Bleh, bad audio decoding");
}
CurrentAudioBlock++;
int64_t OffsetBytes = SizeConst * FFMAX(0, Start - DecodeStart);
int64_t CopyBytes = FFMAX(0, SizeConst * FFMIN(RemainingSamples, DecodeCount - FFMAX(0, Start - DecodeStart)));
memcpy(DstBuf, DecodingBuffer + OffsetBytes, CopyBytes);
DstBuf += CopyBytes;
if (SizeConst)
RemainingSamples -= CopyBytes / SizeConst;
} while (RemainingSamples > 0 && CurrentAudioBlock < Frames.size());
return 0;
}
int MatroskaAudioSource::DecodeNextAudioBlock(uint8_t *Buf, int64_t *Count, uint64_t FilePos, unsigned int FrameSize, char *ErrorMsg, unsigned MsgSize) {
const size_t SizeConst = (av_get_bits_per_sample_format(CodecContext->sample_fmt) * CodecContext->channels) / 8;
int Ret = -1;
*Count = 0;
// FIXME check return
ReadFrame(FilePos, FrameSize, CS, MC, ErrorMsg, MsgSize);
int Size = FrameSize;
uint8_t *Data = MC.Buffer;
while (Size > 0) {
int TempOutputBufSize = AVCODEC_MAX_AUDIO_FRAME_SIZE;
Ret = avcodec_decode_audio2(CodecContext, (int16_t *)Buf, &TempOutputBufSize, Data, Size);
if (Ret < 0) // throw error or something?
goto Done;
if (Ret > 0) {
Size -= Ret;
Data += Ret;
Buf += TempOutputBufSize;
if (SizeConst)
*Count += TempOutputBufSize / SizeConst;
}
}
Done:
return Ret;
}

View File

@ -1,80 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef FFAUDIOSOURCE_H
#define FFAUDIOSOURCE_H
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
}
#include <vector>
#include "indexing.h"
#include "utils.h"
#include "ffms.h"
class AudioBase {
protected:
uint8_t *DecodingBuffer;
FrameInfoVector Frames;
AVCodecContext *CodecContext;
AudioProperties AP;
size_t FindClosestAudioKeyFrame(int64_t Sample);
public:
AudioBase();
~AudioBase();
const AudioProperties& GetAudioProperties() { return AP; }
virtual int GetAudio(void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize) = 0;
};
class FFAudioSource : public AudioBase {
private:
AVFormatContext *FormatContext;
int AudioTrack;
int DecodeNextAudioBlock(uint8_t *Buf, int64_t *Count, char *ErrorMsg, unsigned MsgSize);
void Free(bool CloseCodec);
public:
FFAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize);
~FFAudioSource();
int GetAudio(void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize);
};
class MatroskaAudioSource : public AudioBase {
private:
MatroskaFile *MF;
MatroskaReaderContext MC;
CompressedStream *CS;
char ErrorMessage[256];
int DecodeNextAudioBlock(uint8_t *Buf, int64_t *Count, uint64_t FilePos, unsigned int FrameSize, char *ErrorMsg, unsigned MsgSize);
void Free(bool CloseCodec);
public:
MatroskaAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize);
~MatroskaAudioSource();
int GetAudio(void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize);
};
#endif

View File

@ -1,190 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ffavisynth.h"
#include "utils.h"
AvisynthVideoSource::AvisynthVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, int FPSNum, int FPSDen, const char *PP, int Threads, int SeekMode, IScriptEnvironment* Env, char *ErrorMsg, unsigned MsgSize) {
memset(&VI, 0, sizeof(VI));
SWS = NULL;
ConvertToFormat = PIX_FMT_NONE;
this->FPSNum = FPSNum;
this->FPSDen = FPSDen;
VS = FFMS_CreateVideoSource(SourceFile, Track, TrackIndices, PP, Threads, SeekMode, ErrorMsg, MsgSize);
if (!VS)
Env->ThrowError(ErrorMsg);
const VideoProperties VP = *FFMS_GetVideoProperties(VS);
VI.image_type = VideoInfo::IT_TFF;
VI.width = VP.Width;
VI.height = VP.Height;
if (FPSNum > 0 && FPSDen > 0) {
VI.fps_denominator = FPSDen;
VI.fps_numerator = FPSNum;
VI.num_frames = ceil(((VP.LastTime - VP.FirstTime) * FPSNum) / FPSDen);
} else {
VI.fps_denominator = VP.FPSDenominator;
VI.fps_numerator = VP.FPSNumerator;
VI.num_frames = VP.NumFrames;
}
try {
InitOutputFormat(VP.PixelFormat, Env);
} catch (AvisynthError &) {
FFMS_DestroyVideoSource(VS);
throw;
}
// Set AR variables
Env->SetVar("FFSAR_NUM", VP.SARNum);
Env->SetVar("FFSAR_DEN", VP.SARDen);
Env->SetVar("FFSAR", VP.SARNum / (double)VP.SARDen);
// Set crop variables
Env->SetVar("FFCROP_LEFT", VP.CropLeft);
Env->SetVar("FFCROP_RIGHT", VP.CropRight);
Env->SetVar("FFCROP_TOP", VP.CropTop);
Env->SetVar("FFCROP_BOTTOM", VP.CropBottom);
}
AvisynthVideoSource::~AvisynthVideoSource() {
if (SWS)
sws_freeContext(SWS);
FFMS_DestroyVideoSource(VS);
}
void AvisynthVideoSource::InitOutputFormat(int CurrentFormat, IScriptEnvironment *Env) {
int Loss;
int BestFormat = avcodec_find_best_pix_fmt((1 << PIX_FMT_YUVJ420P) | (1 << PIX_FMT_YUV420P) | (1 << PIX_FMT_YUYV422) | (1 << PIX_FMT_RGB32) | (1 << PIX_FMT_BGR24), CurrentFormat, 1 /* Required to prevent pointless RGB32 => RGB24 conversion */, &Loss);
switch (BestFormat) {
case PIX_FMT_YUVJ420P: // stupid yv12 distinctions, also inexplicably completely undeniably incompatible with all other supported output formats
case PIX_FMT_YUV420P: VI.pixel_type = VideoInfo::CS_I420; break;
case PIX_FMT_YUYV422: VI.pixel_type = VideoInfo::CS_YUY2; break;
case PIX_FMT_RGB32: VI.pixel_type = VideoInfo::CS_BGR32; break;
case PIX_FMT_BGR24: VI.pixel_type = VideoInfo::CS_BGR24; break;
default:
Env->ThrowError("FFVideoSource: No suitable output format found");
}
if (BestFormat != CurrentFormat) {
ConvertToFormat = BestFormat;
SWS = sws_getContext(VI.width, VI.height, CurrentFormat, VI.width, VI.height, ConvertToFormat, GetCPUFlags() | SWS_BICUBIC, NULL, NULL, NULL);
}
if (BestFormat == PIX_FMT_YUVJ420P || BestFormat == PIX_FMT_YUV420P) {
VI.height -= VI.height & 1;
VI.width -= VI.width & 1;
}
if (BestFormat == PIX_FMT_YUYV422) {
VI.width -= VI.width & 1;
}
}
PVideoFrame AvisynthVideoSource::OutputFrame(const AVFrameLite *Frame, IScriptEnvironment *Env) {
// Yes, this function is overly complex and could probably be simplified
AVPicture *SrcPicture = reinterpret_cast<AVPicture *>(const_cast<AVFrameLite *>(Frame));
PVideoFrame Dst = Env->NewVideoFrame(VI);
if (ConvertToFormat != PIX_FMT_NONE && VI.pixel_type == VideoInfo::CS_I420) {
uint8_t *DstData[3] = {Dst->GetWritePtr(PLANAR_Y), Dst->GetWritePtr(PLANAR_U), Dst->GetWritePtr(PLANAR_V)};
int DstStride[3] = {Dst->GetPitch(PLANAR_Y), Dst->GetPitch(PLANAR_U), Dst->GetPitch(PLANAR_V)};
sws_scale(SWS, SrcPicture->data, SrcPicture->linesize, 0, VI.height, DstData, DstStride);
} else if (ConvertToFormat != PIX_FMT_NONE) {
if (VI.IsRGB()) {
uint8_t *DstData[1] = {Dst->GetWritePtr() + Dst->GetPitch() * (Dst->GetHeight() - 1)};
int DstStride[1] = {-Dst->GetPitch()};
sws_scale(SWS, SrcPicture->data, SrcPicture->linesize, 0, VI.height, DstData, DstStride);
} else {
uint8_t *DstData[1] = {Dst->GetWritePtr()};
int DstStride[1] = {Dst->GetPitch()};
sws_scale(SWS, SrcPicture->data, SrcPicture->linesize, 0, VI.height, DstData, DstStride);
}
} else if (VI.pixel_type == VideoInfo::CS_I420) {
Env->BitBlt(Dst->GetWritePtr(PLANAR_Y), Dst->GetPitch(PLANAR_Y), SrcPicture->data[0], SrcPicture->linesize[0], Dst->GetRowSize(PLANAR_Y), Dst->GetHeight(PLANAR_Y));
Env->BitBlt(Dst->GetWritePtr(PLANAR_U), Dst->GetPitch(PLANAR_U), SrcPicture->data[1], SrcPicture->linesize[1], Dst->GetRowSize(PLANAR_U), Dst->GetHeight(PLANAR_U));
Env->BitBlt(Dst->GetWritePtr(PLANAR_V), Dst->GetPitch(PLANAR_V), SrcPicture->data[2], SrcPicture->linesize[2], Dst->GetRowSize(PLANAR_V), Dst->GetHeight(PLANAR_V));
} else {
if (VI.IsRGB())
Env->BitBlt(Dst->GetWritePtr() + Dst->GetPitch() * (Dst->GetHeight() - 1), -Dst->GetPitch(), SrcPicture->data[0], SrcPicture->linesize[0], Dst->GetRowSize(), Dst->GetHeight());
else
Env->BitBlt(Dst->GetWritePtr(), Dst->GetPitch(), SrcPicture->data[0], SrcPicture->linesize[0], Dst->GetRowSize(), Dst->GetHeight());
}
return Dst;
}
PVideoFrame AvisynthVideoSource::GetFrame(int n, IScriptEnvironment *Env) {
char ErrorMsg[1024];
unsigned MsgSize = sizeof(ErrorMsg);
const AVFrameLite *Frame;
if (FPSNum > 0 && FPSDen > 0)
Frame = FFMS_GetFrameByTime(VS, FFMS_GetVideoProperties(VS)->FirstTime + (double)(n * (int64_t)FPSDen) / FPSNum, ErrorMsg, MsgSize);
else
Frame = FFMS_GetFrame(VS, n, ErrorMsg, MsgSize);
if (Frame == NULL)
Env->ThrowError("FFVideoSource: %s", ErrorMsg);
Env->SetVar("FFPICT_TYPE", Frame->PictType);
return OutputFrame(Frame, Env);
}
AvisynthAudioSource::AvisynthAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, IScriptEnvironment* Env, char *ErrorMsg, unsigned MsgSize) {
memset(&VI, 0, sizeof(VI));
AS = FFMS_CreateAudioSource(SourceFile, Track, TrackIndices, ErrorMsg, MsgSize);
if (!AS)
Env->ThrowError(ErrorMsg);
const AudioProperties AP = *FFMS_GetAudioProperties(AS);
VI.nchannels = AP.Channels;
VI.num_audio_samples = AP.NumSamples;
VI.audio_samples_per_second = AP.SampleRate;
if (AP.Float && AP.BitsPerSample == 32) {
VI.sample_type = SAMPLE_FLOAT;
} else {
switch (AP.BitsPerSample) {
case 8: VI.sample_type = SAMPLE_INT8; break;
case 16: VI.sample_type = SAMPLE_INT16; break;
case 24: VI.sample_type = SAMPLE_INT24; break;
case 32: VI.sample_type = SAMPLE_INT32; break;
default: Env->ThrowError("FFAudioSource: Bad audio format");
}
}
}
AvisynthAudioSource::~AvisynthAudioSource() {
FFMS_DestroyAudioSource(AS);
}
void AvisynthAudioSource::GetAudio(void* Buf, __int64 Start, __int64 Count, IScriptEnvironment *Env) {
char ErrorMsg[1024];
unsigned MsgSize = sizeof(ErrorMsg);
if (FFMS_GetAudio(AS, Buf, Start, Count, ErrorMsg, MsgSize))
Env->ThrowError(ErrorMsg);
}

View File

@ -1,70 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef FFAVISYNTH_H
#define FFAVISYNTH_H
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libpostproc/postprocess.h>
}
#include <windows.h>
#include "avisynth.h"
#include "ffms.h"
class AvisynthVideoSource : public IClip {
private:
VideoInfo VI;
VideoBase *VS;
SwsContext *SWS;
int ConvertToFormat;
int FPSNum;
int FPSDen;
void InitOutputFormat(int CurrentFormat, IScriptEnvironment *Env);
PVideoFrame OutputFrame(const AVFrameLite *SrcPicture, IScriptEnvironment *Env);
public:
AvisynthVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, int FPSNum, int FPSDen, const char *PP, int Threads, int SeekMode, IScriptEnvironment* Env, char *ErrorMsg, unsigned MsgSize);
~AvisynthVideoSource();
bool __stdcall GetParity(int n) { return false; }
void __stdcall SetCacheHints(int cachehints, int frame_range) { }
const VideoInfo& __stdcall GetVideoInfo() { return VI; }
void __stdcall GetAudio(void* Buf, __int64 Start, __int64 Count, IScriptEnvironment *Env) { }
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *Env);
};
class AvisynthAudioSource : public IClip {
private:
VideoInfo VI;
AudioBase *AS;
public:
AvisynthAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, IScriptEnvironment* Env, char *ErrorMsg, unsigned MsgSize);
~AvisynthAudioSource();
bool __stdcall GetParity(int n) { return false; }
void __stdcall SetCacheHints(int cachehints, int frame_range) { }
const VideoInfo& __stdcall GetVideoInfo() { return VI; }
void __stdcall GetAudio(void* Buf, __int64 Start, __int64 Count, IScriptEnvironment *Env);
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *Env) { return NULL; };
};
#endif

View File

@ -1,236 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include <string>
#include "ffms.h"
#include "ffavisynth.h"
#include "ffswscale.h"
#include "ffpp.h"
int GetNumberOfLogicalCPUs() {
SYSTEM_INFO SI;
GetSystemInfo(&SI);
return SI.dwNumberOfProcessors;
}
AVSValue __cdecl CreateFFIndex(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
FFMS_Init();
char ErrorMsg[1024];
unsigned MsgSize = sizeof(ErrorMsg);
if (!Args[0].Defined())
Env->ThrowError("FFIndex: No source specified");
const char *Source = Args[0].AsString();
const char *CacheFile = Args[1].AsString("");
int IndexMask = Args[2].AsInt(0);
int DumpMask = Args[3].AsInt(0);
const char *AudioFile = Args[4].AsString("");
bool OverWrite = Args[5].AsBool(false);
std::string DefaultCache(Source);
DefaultCache.append(".ffindex");
if (!strcmp(CacheFile, ""))
CacheFile = DefaultCache.c_str();
if (!strcmp(AudioFile, ""))
AudioFile = Source;
// Return values
// 0: Index already present
// 1: Index generated
// 2: Index forced to be overwritten
FrameIndex *Index = NULL;
if (OverWrite || !(Index = FFMS_ReadIndex(CacheFile, ErrorMsg, MsgSize))) {
if (!(Index = FFMS_MakeIndex(Source, IndexMask, DumpMask, AudioFile, true, NULL, NULL, ErrorMsg, MsgSize)))
Env->ThrowError("FFIndex: %s", ErrorMsg);
if (FFMS_WriteIndex(CacheFile, Index, ErrorMsg, MsgSize)) {
FFMS_DestroyFrameIndex(Index);
Env->ThrowError("FFIndex: %s", ErrorMsg);
}
FFMS_DestroyFrameIndex(Index);
if (!OverWrite)
return AVSValue(1);
else
return AVSValue(2);
} else {
FFMS_DestroyFrameIndex(Index);
return AVSValue(0);
}
}
AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
FFMS_Init();
char ErrorMsg[1024];
unsigned MsgSize = sizeof(ErrorMsg);
if (!Args[0].Defined())
Env->ThrowError("FFVideoSource: No source specified");
const char *Source = Args[0].AsString();
int Track = Args[1].AsInt(-1);
bool Cache = Args[2].AsBool(true);
const char *CacheFile = Args[3].AsString("");
int FPSNum = Args[4].AsInt(-1);
int FPSDen = Args[5].AsInt(1);
const char *PP = Args[6].AsString("");
int Threads = Args[7].AsInt(-1);
const char *Timecodes = Args[8].AsString("");
int SeekMode = Args[9].AsInt(1);
if (Track <= -2)
Env->ThrowError("FFVideoSource: No video track selected");
if (SeekMode < -1 || SeekMode > 3)
Env->ThrowError("FFVideoSource: Invalid seekmode selected");
if (Threads <= 0)
Threads = GetNumberOfLogicalCPUs();
if (Threads < 1)
Env->ThrowError("FFVideoSource: Invalid thread count");
if (!_stricmp(Source, Timecodes))
Env->ThrowError("FFVideoSource: Timecodes will overwrite the source");
std::string DefaultCache(Source);
DefaultCache.append(".ffindex");
if (!strcmp(CacheFile, ""))
CacheFile = DefaultCache.c_str();
FrameIndex *Index = NULL;
if (Cache)
Index = FFMS_ReadIndex(CacheFile, ErrorMsg, MsgSize);
if (!Index) {
if (!(Index = FFMS_MakeIndex(Source, 0, 0, NULL, true, NULL, NULL, ErrorMsg, MsgSize)))
Env->ThrowError("FFVideoSource: %s", ErrorMsg);
if (Cache)
if (FFMS_WriteIndex(CacheFile, Index, ErrorMsg, MsgSize)) {
FFMS_DestroyFrameIndex(Index);
Env->ThrowError("FFVideoSource: %s", ErrorMsg);
}
}
if (Track == -1)
Track = FFMS_GetFirstTrackOfType(Index, FFMS_TYPE_VIDEO, ErrorMsg, MsgSize);
if (Track < 0)
Env->ThrowError("FFVideoSource: No video track found");
if (strcmp(Timecodes, "")) {
if (FFMS_WriteTimecodes(FFMS_GetTITrackIndex(Index, Track, ErrorMsg, MsgSize), Timecodes, ErrorMsg, MsgSize)) {
FFMS_DestroyFrameIndex(Index);
Env->ThrowError("FFVideoSource: %s", ErrorMsg);
}
}
AvisynthVideoSource *Filter;
try {
Filter = new AvisynthVideoSource(Source, Track, Index, FPSNum, FPSDen, PP, Threads, SeekMode, Env, ErrorMsg, MsgSize);
} catch (...) {
FFMS_DestroyFrameIndex(Index);
throw;
}
FFMS_DestroyFrameIndex(Index);
return Filter;
}
AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
FFMS_Init();
char ErrorMsg[1024];
unsigned MsgSize = sizeof(ErrorMsg);
if (!Args[0].Defined())
Env->ThrowError("FFAudioSource: No source specified");
const char *Source = Args[0].AsString();
int Track = Args[1].AsInt(-1);
bool Cache = Args[2].AsBool(true);
const char *CacheFile = Args[3].AsString("");
if (Track <= -2)
Env->ThrowError("FFAudioSource: No audio track selected");
std::string DefaultCache(Source);
DefaultCache.append(".ffindex");
if (!strcmp(CacheFile, ""))
CacheFile = DefaultCache.c_str();
FrameIndex *Index = NULL;
if (Cache)
Index = FFMS_ReadIndex(CacheFile, ErrorMsg, MsgSize);
if (!Index) {
if (!(Index = FFMS_MakeIndex(Source, -1, 0, CacheFile, true, NULL, NULL, ErrorMsg, MsgSize)))
Env->ThrowError("FFAudioSource: %s", ErrorMsg);
if (Cache)
if (FFMS_WriteIndex(CacheFile, Index, ErrorMsg, MsgSize)) {
FFMS_DestroyFrameIndex(Index);
Env->ThrowError("FFAudioSource: %s", ErrorMsg);
}
}
if (Track == -1)
Track = FFMS_GetFirstTrackOfType(Index, FFMS_TYPE_AUDIO, ErrorMsg, MsgSize);
if (Track < 0)
Env->ThrowError("FFAudioSource: No audio track found");
AvisynthAudioSource *Filter;
try {
Filter = new AvisynthAudioSource(Source, Track, Index, Env, ErrorMsg, MsgSize);
} catch (...) {
FFMS_DestroyFrameIndex(Index);
throw;
}
FFMS_DestroyFrameIndex(Index);
return Filter;
}
AVSValue __cdecl CreateFFPP(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
return new FFPP(Args[0].AsClip(), Args[1].AsString(""), Env);
}
AVSValue __cdecl CreateSWScale(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
return new SWScale(Args[0].AsClip(), Args[1].AsInt(0), Args[2].AsInt(0), Args[3].AsString("BICUBIC"), Args[4].AsString(""), Env);
}
AVSValue __cdecl FFNoLog(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
FFMS_NoLog();
return 0;
}
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* Env) {
Env->AddFunction("FFIndex", "[source]s[cachefile]s[indexmask]i[dumpmask]i[audiofile]s[overwrite]b", CreateFFIndex, 0);
Env->AddFunction("FFVideoSource", "[source]s[track]i[cache]b[cachefile]s[fpsnum]i[fpsden]i[pp]s[threads]i[timecodes]s[seekmode]i", CreateFFVideoSource, 0);
Env->AddFunction("FFAudioSource", "[source]s[track]i[cache]b[cachefile]s", CreateFFAudioSource, 0);
Env->AddFunction("FFPP", "c[pp]s", CreateFFPP, 0);
Env->AddFunction("SWScale", "c[width]i[height]i[resizer]s[colorspace]s", CreateSWScale, 0);
Env->AddFunction("FFNoLog", "", FFNoLog, 0);
return "FFmpegSource - The Second Coming";
}

View File

@ -1,214 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ffms.h"
#include "ffvideosource.h"
#include "ffaudiosource.h"
#include "indexing.h"
#ifdef __UNIX__
#define _snprintf snprintf
#endif
FrameInfo::FrameInfo(int64_t DTS, bool KeyFrame) {
this->DTS = DTS;
this->SampleStart = 0;
this->FilePos = 0;
this->FrameSize = 0;
this->KeyFrame = KeyFrame;
}
FrameInfo::FrameInfo(int64_t DTS, int64_t SampleStart, bool KeyFrame) {
this->DTS = DTS;
this->SampleStart = SampleStart;
this->FilePos = 0;
this->FrameSize = 0;
this->KeyFrame = KeyFrame;
}
FrameInfo::FrameInfo(int64_t SampleStart, int64_t FilePos, unsigned int FrameSize, bool KeyFrame) {
this->DTS = 0;
this->SampleStart = SampleStart;
this->FilePos = FilePos;
this->FrameSize = FrameSize;
this->KeyFrame = KeyFrame;
}
FFMS_API(void) FFMS_Init() {
static bool InitDone = false;
if (!InitDone)
av_register_all();
InitDone = true;
}
FFMS_API(void) FFMS_NoLog() {
av_log_set_level(AV_LOG_QUIET);
}
FFMS_API(VideoBase *) FFMS_CreateVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, const char *PP, int Threads, int SeekMode, char *ErrorMsg, unsigned MsgSize) {
try {
switch (TrackIndices->Decoder) {
case 0: return new FFVideoSource(SourceFile, Track, TrackIndices, PP, Threads, SeekMode, ErrorMsg, MsgSize);
case 1: return new MatroskaVideoSource(SourceFile, Track, TrackIndices, PP, Threads, ErrorMsg, MsgSize);
#ifdef HAALITS
case 2: return new HaaliTSVideoSource(SourceFile, Track, TrackIndices, PP, Threads, ErrorMsg, MsgSize);
#endif
default:
_snprintf(ErrorMsg, MsgSize, "Unsupported format");
return NULL;
}
} catch (...) {
return NULL;
}
}
FFMS_API(AudioBase *) FFMS_CreateAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize) {
try {
switch (TrackIndices->Decoder) {
case 0: return new FFAudioSource(SourceFile, Track, TrackIndices, ErrorMsg, MsgSize);
case 1: return new MatroskaAudioSource(SourceFile, Track, TrackIndices, ErrorMsg, MsgSize);
default:
_snprintf(ErrorMsg, MsgSize, "Unsupported format");
return NULL;
}
} catch (...) {
return NULL;
}
}
FFMS_API(void) FFMS_DestroyVideoSource(VideoBase *VB) {
delete VB;
}
FFMS_API(void) FFMS_DestroyAudioSource(AudioBase *AB) {
delete AB;
}
FFMS_API(const VideoProperties *) FFMS_GetVideoProperties(VideoBase *VB) {
return &VB->GetVideoProperties();
}
FFMS_API(const AudioProperties *) FFMS_GetAudioProperties(AudioBase *AB) {
return &AB->GetAudioProperties();
}
FFMS_API(const AVFrameLite *) FFMS_GetFrame(VideoBase *VB, int n, char *ErrorMsg, unsigned MsgSize) {
return (AVFrameLite *)VB->GetFrame(n, ErrorMsg, MsgSize);
}
FFMS_API(const AVFrameLite *) FFMS_GetFrameByTime(VideoBase *VB, double Time, char *ErrorMsg, unsigned MsgSize) {
return (AVFrameLite *)VB->GetFrameByTime(Time, ErrorMsg, MsgSize);
}
FFMS_API(int) FFMS_GetAudio(AudioBase *AB, void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize) {
return AB->GetAudio(Buf, Start, Count, ErrorMsg, MsgSize);
}
FFMS_API(int) FFMS_SetOutputFormat(VideoBase *VB, int TargetFormat, int Width, int Height, char *ErrorMsg, unsigned MsgSize) {
return VB->SetOutputFormat(TargetFormat, Width, Height, ErrorMsg, MsgSize);
}
FFMS_API(void) FFMS_ResetOutputFormat(VideoBase *VB) {
VB->ResetOutputFormat();
}
FFMS_API(void) FFMS_DestroyFrameIndex(FrameIndex *FI) {
delete FI;
}
FFMS_API(int) FFMS_GetFirstTrackOfType(FrameIndex *TrackIndices, int TrackType, char *ErrorMsg, unsigned MsgSize) {
for (int i = 0; i < TrackIndices->size(); i++)
if ((*TrackIndices)[i].TT == TrackType)
return i;
_snprintf(ErrorMsg, MsgSize, "No suitable track found");
return -1;
}
FFMS_API(int) FFMS_GetNumTracks(FrameIndex *TrackIndices) {
return TrackIndices->size();
}
FFMS_API(int) FFMS_GetTrackType(FrameInfoVector *FIV) {
return FIV->TT;
}
FFMS_API(int) FFMS_GetNumFrames(FrameInfoVector *FIV) {
return FIV->size();
}
FFMS_API(const FrameInfo *) FFMS_GetFrameInfo(FrameInfoVector *FIV, int Frame, char *ErrorMsg, unsigned MsgSize) {
if (Frame < 0 || Frame >= FIV->size()) {
_snprintf(ErrorMsg, MsgSize, "Invalid frame specified");
return NULL;
} else {
return &(*FIV)[Frame];
}
}
FFMS_API(FrameInfoVector *) FFMS_GetTITrackIndex(FrameIndex *TrackIndices, int Track, char *ErrorMsg, unsigned MsgSize) {
if (Track < 0 || Track >= TrackIndices->size()) {
_snprintf(ErrorMsg, MsgSize, "Invalid track specified");
return NULL;
} else {
return &(*TrackIndices)[Track];
}
}
FFMS_API(FrameInfoVector *) FFMS_GetVSTrackIndex(VideoBase *VB) {
return VB->GetFrameInfoVector();
}
FFMS_API(int) FFMS_FindClosestKeyFrame(FrameInfoVector *FIV, int Frame, char *ErrorMsg, unsigned MsgSize) {
if (Frame < 0 || Frame >= FIV->size()) {
_snprintf(ErrorMsg, MsgSize, "Out of range frame specified");
return -1;
} else {
return FIV->FindClosestKeyFrame(Frame);
}
}
FFMS_API(int) FFMS_FrameFromDTS(FrameInfoVector *FIV, int64_t DTS) {
return FIV->FrameFromDTS(DTS);
}
FFMS_API(int) FFMS_ClosestFrameFromDTS(FrameInfoVector *FIV, int64_t DTS) {
return FIV->ClosestFrameFromDTS(DTS);
}
FFMS_API(const TrackTimeBase *) FFMS_GetTimeBase(FrameInfoVector *FIV) {
return &FIV->TB;
}
FFMS_API(int) FFMS_WriteTimecodes(FrameInfoVector *FIV, const char *TimecodeFile, char *ErrorMsg, unsigned MsgSize) {
return FIV->WriteTimecodes(TimecodeFile, ErrorMsg, MsgSize);
}
FFMS_API(FrameIndex *) FFMS_MakeIndex(const char *SourceFile, int IndexMask, int DumpMask, const char *AudioFile, bool IgnoreDecodeErrors, IndexCallback IP, void *Private, char *ErrorMsg, unsigned MsgSize) {
return MakeIndex(SourceFile, IndexMask, DumpMask, AudioFile, IgnoreDecodeErrors, IP, Private, ErrorMsg, MsgSize);
}
FFMS_API(FrameIndex *) FFMS_ReadIndex(const char *IndexFile, char *ErrorMsg, unsigned MsgSize) {
return ReadIndex(IndexFile, ErrorMsg, MsgSize);
}
FFMS_API(int) FFMS_WriteIndex(const char *IndexFile, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize) {
return WriteIndex(IndexFile, TrackIndices, ErrorMsg, MsgSize);
}

View File

@ -1,193 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef FFMS_H
#define FFMS_H
#include <stdint.h>
#define FFMS_EXPORTS
#ifdef __cplusplus
# define EXTERN_C extern "C"
#else
# define EXTERN_C
#endif
#ifdef _WIN32
# define FFMS_CC __stdcall
# ifdef FFMS_EXPORTS
# define FFMS_API(ret) EXTERN_C __declspec(dllexport) ret FFMS_CC
# else
# define FFMS_API(ret) EXTERN_C __declspec(dllimport) ret FFMS_CC
# endif
#else
# define FFMS_CC
# define FFMS_API(ret) EXTERN_C ret FFMS_CC
#endif
class VideoBase;
class AudioBase;
class FrameIndex;
class FrameInfoVector;
typedef int (FFMS_CC *IndexCallback)(int State, int64_t Current, int64_t Total, void *Private);
enum TrackType {
FFMS_TYPE_VIDEO = 0,
FFMS_TYPE_AUDIO = 1,
};
// PixelFormat declarations from avutil.h so external libraries don't necessarily have to include ffmpeg headers
enum FFMS_PixelFormat {
FFMS_PIX_FMT_NONE= -1,
FFMS_PIX_FMT_YUV420P, ///< Planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
FFMS_PIX_FMT_YUYV422, ///< Packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
FFMS_PIX_FMT_RGB24, ///< Packed RGB 8:8:8, 24bpp, RGBRGB...
FFMS_PIX_FMT_BGR24, ///< Packed RGB 8:8:8, 24bpp, BGRBGR...
FFMS_PIX_FMT_YUV422P, ///< Planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
FFMS_PIX_FMT_YUV444P, ///< Planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
FFMS_PIX_FMT_RGB32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in cpu endianness
FFMS_PIX_FMT_YUV410P, ///< Planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
FFMS_PIX_FMT_YUV411P, ///< Planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
FFMS_PIX_FMT_RGB565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in cpu endianness
FFMS_PIX_FMT_RGB555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in cpu endianness most significant bit to 0
FFMS_PIX_FMT_GRAY8, ///< Y , 8bpp
FFMS_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black
FFMS_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white
FFMS_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
FFMS_PIX_FMT_YUVJ420P, ///< Planar YUV 4:2:0, 12bpp, full scale (jpeg)
FFMS_PIX_FMT_YUVJ422P, ///< Planar YUV 4:2:2, 16bpp, full scale (jpeg)
FFMS_PIX_FMT_YUVJ444P, ///< Planar YUV 4:4:4, 24bpp, full scale (jpeg)
FFMS_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
FFMS_PIX_FMT_XVMC_MPEG2_IDCT,
FFMS_PIX_FMT_UYVY422, ///< Packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
FFMS_PIX_FMT_UYYVYY411, ///< Packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
FFMS_PIX_FMT_BGR32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in cpu endianness
FFMS_PIX_FMT_BGR565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), in cpu endianness
FFMS_PIX_FMT_BGR555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in cpu endianness most significant bit to 1
FFMS_PIX_FMT_BGR8, ///< Packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
FFMS_PIX_FMT_BGR4, ///< Packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
FFMS_PIX_FMT_BGR4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
FFMS_PIX_FMT_RGB8, ///< Packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
FFMS_PIX_FMT_RGB4, ///< Packed RGB 1:2:1, 4bpp, (msb)2R 3G 3B(lsb)
FFMS_PIX_FMT_RGB4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)2R 3G 3B(lsb)
FFMS_PIX_FMT_NV12, ///< Planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
FFMS_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
FFMS_PIX_FMT_RGB32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness
FFMS_PIX_FMT_BGR32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness
FFMS_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
FFMS_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
FFMS_PIX_FMT_YUV440P, ///< Planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
FFMS_PIX_FMT_YUVJ440P, ///< Planar YUV 4:4:0 full scale (jpeg)
FFMS_PIX_FMT_YUVA420P, ///< Planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
};
// This is a subset of the original AVFrame only containing the most used parts.
// Even if it might seem like a good idea to cast it back to a full AVFrame to
// access a few more values you really shouldn't do that. Only the values present
// in AVFrameLite are actually updated when postprocessing is used.
struct AVFrameLite {
uint8_t *Data[4];
int Linesize[4];
uint8_t *Base[4];
int KeyFrame;
int PictType;
};
struct TrackTimeBase {
int Num;
int Den;
};
class FrameInfo {
public:
int64_t DTS;
int64_t SampleStart;
int64_t FilePos;
unsigned int FrameSize;
bool KeyFrame;
FrameInfo(int64_t DTS, bool KeyFrame);
FrameInfo(int64_t DTS, int64_t SampleStart, bool KeyFrame);
FrameInfo(int64_t SampleStart, int64_t FilePos, unsigned int FrameSize, bool KeyFrame);
};
struct VideoProperties {
int Width;
int Height;
int FPSDenominator;
int FPSNumerator;
int NumFrames;
int PixelFormat;
int SARNum;
int SARDen;
int CropTop;
int CropBottom;
int CropLeft;
int CropRight;
double FirstTime;
double LastTime;
};
struct AudioProperties {
int SampleRate;
int Channels;
int BitsPerSample;
bool Float;
int64_t NumSamples;
};
// Most functions return 0 on success
// Functions without error message output can be assumed to never fail
FFMS_API(void) FFMS_Init();
FFMS_API(void) FFMS_NoLog();
FFMS_API(VideoBase *) FFMS_CreateVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, const char *PP, int Threads, int SeekMode, char *ErrorMsg, unsigned MsgSize);
FFMS_API(AudioBase *) FFMS_CreateAudioSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize);
FFMS_API(void) FFMS_DestroyVideoSource(VideoBase *VB);
FFMS_API(void) FFMS_DestroyAudioSource(AudioBase *AB);
FFMS_API(const VideoProperties *) FFMS_GetVideoProperties(VideoBase *VB);
FFMS_API(const AudioProperties *) FFMS_GetAudioProperties(AudioBase *AB);
FFMS_API(const AVFrameLite *) FFMS_GetFrame(VideoBase *VB, int n, char *ErrorMsg, unsigned MsgSize);
FFMS_API(const AVFrameLite *) FFMS_GetFrameByTime(VideoBase *VB, double Time, char *ErrorMsg, unsigned MsgSize);
FFMS_API(int) FFMS_GetAudio(AudioBase *AB, void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize);
FFMS_API(int) FFMS_SetOutputFormat(VideoBase *VB, int TargetFormat, int Width, int Height, char *ErrorMsg, unsigned MsgSize);
FFMS_API(void) FFMS_ResetOutputFormat(VideoBase *VB);
FFMS_API(void) FFMS_DestroyFrameIndex(FrameIndex *FI);
FFMS_API(int) FFMS_GetFirstTrackOfType(FrameIndex *TrackIndices, int TrackType, char *ErrorMsg, unsigned MsgSize);
FFMS_API(int) FFMS_GetNumTracks(FrameIndex *TrackIndices);
FFMS_API(int) FFMS_GetTrackType(FrameInfoVector *FIV);
FFMS_API(int) FFMS_GetNumFrames(FrameInfoVector *FIV);
FFMS_API(const FrameInfo *) FFMS_GetFrameInfo(FrameInfoVector *FIV, int Frame, char *ErrorMsg, unsigned MsgSize);
FFMS_API(FrameInfoVector *) FFMS_GetTITrackIndex(FrameIndex *TrackIndices, int Track, char *ErrorMsg, unsigned MsgSize);
FFMS_API(FrameInfoVector *) FFMS_GetVSTrackIndex(VideoBase *VB);
FFMS_API(FrameInfoVector *) FFMS_GetASTrackIndex(AudioBase *AB);
FFMS_API(int) FFMS_FindClosestKeyFrame(FrameInfoVector *FIV, int Frame, char *ErrorMsg, unsigned MsgSize);
FFMS_API(int) FFMS_FrameFromDTS(FrameInfoVector *FIV, int64_t DTS);
FFMS_API(int) FFMS_ClosestFrameFromDTS(FrameInfoVector *FIV, int64_t DTS);
FFMS_API(const TrackTimeBase *) FFMS_GetTimeBase(FrameInfoVector *FIV);
FFMS_API(int) FFMS_WriteTimecodes(FrameInfoVector *FIV, const char *TimecodeFile, char *ErrorMsg, unsigned MsgSize);
FFMS_API(FrameIndex *) FFMS_MakeIndex(const char *SourceFile, int IndexMask, int DumpMask, const char *AudioFile, bool IgnoreDecodeErrors, IndexCallback IP, void *Private, char *ErrorMsg, unsigned MsgSize);
FFMS_API(FrameIndex *) FFMS_ReadIndex(const char *IndexFile, char *ErrorMsg, unsigned MsgSize);
FFMS_API(int) FFMS_WriteIndex(const char *IndexFile, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize);
#endif

View File

@ -1,238 +0,0 @@
<html>
<head>
<title>
FFmpegSource2 Documentation
</title>
</head>
<body>
<h1>FFmpegSource2 Documentation</h1>
<p>
Opens files using ffmpeg and nothing else. May be frame accurate on good days. The source is MIT licensed and can be obtained from https://spaceboyz.net/svn/aegisub/trunk/FFmpegSource2. The precompiled binary is GPL licensed. If you are religious you may consider this the second coming.
</p>
<h2>Compatibility - Video</h2>
<ul>
<li>AVI, MKV, MP4, FLV: Frame accurate</li>
<li>WMV: Frame accurate(?) but avformat seems to pick keyframes relatively far away</li>
<li>OGM: Messed up first frame and seeking produces smearing with seekmode=3, incredibly slow seeking without, remux to mkv or avi</li>
<li>VOB: No rff flags applied, frame accurate?</li>
<li>MPG: Seeking seems to be off by one or two frames now and then</li>
<li>M2TS, TS: Linear access only (seekmode=-1)</li>
<li>Image files: Most formats can be opened if seekmode=-1 is set</li>
</ul>
<h2>Compatibility - Audio</h2>
<ul>
<li>All formats are written to separate wave64 files</li>
<li>No wave64 reader is provided</li>
</ul>
<h2>Usage</h2>
<p>
<b>FFIndex(string source, string cachefile = source + ".ffindex", int indexmask = 0, int dumpmask = 0, string audiofile = source, bool overwrite = false)</b><br />
Used to invoke indexing separately and to write audio tracks to disk as wave64 files
</p>
<p>
<b>FFVideoSource(string source, int track, bool cache = true, string cachefile = source + ".ffindex", int fpsnum = -1, int fpsden = 1, string pp, int threads = -1, string timecodes, int seekmode = 1)</b><br />
Opens video, will invoke indexing with the defaults if no preexisting index is found
</p>
<p>
<b>FFAudioSource(string source, int track, bool cache = true, string cachefile = source + ".ffindex")</b><br />
Opens audio, <b>if an index already exists it needs to contain a suitable audio index or empty audio will be returned</b>, will invoke indexing with the defaults if no preexisting index is found
</p>
<p>
<b>FFPP(clip, string pp)</b><br />
Separate postprocessing which also seems to include a few simple deinterlacers
</p>
<p>
<b>SWScale(clip, width = -1, height = -1, resizer = "BICUBIC", colorspace = "")</b><br />
Separate postprocessing which also seems to include a few simple deinterlacers
</p>
<b>FFNoLog()</b><br />
Disable all logging output from FFmpeg
</p>
<p>
<b>source:</b>
Source file.
</p>
<p>
<b>indexmask &amp; dumpmask:</b>
Which audio tracks to index/write to disk. Dumping a track also implies indexing since the same work has to be done anyway. It is a binary mask meaning that 7 corresponds to writing tracks 1-3. Non-audio tracks are ignored. -1 writes all tracks.
</p>
<p>
<b>audiofile:</b>
The base name to use for the decoded audio. Track number and delay is appended.
</p>
<p>
<b>overwrite:</b>
Forces reindexing even if a valid index already exists. May be useful for trackmask changes or testing.
</p>
<p>
<b>track:</b>
Track number as seen by the relevant demuxer, starts from 0, -1 means it will pick the first suitable track.
</p>
<p>
<b>fpsnum &amp; fpsden:</b>
For VFR -> CFR conversion. Setting fpsnum <= 0 means a 1:1 relation with the encoded frames.
</p>
<p>
<b>timecodes:</b>
File to output timecodes to, if the file exists it will be overwritten.
</p>
<p>
<b>cache:</b>
Write indexing information to a file for later use. This setting does not control if The video index is loaded which it always is if it exists.
</p>
<p>
<b>cachefile</b>
Where to write the cache information.
</p>
<p>
<b>pp:</b>
See the table below for a full description, an empty string means no processing. It is recommended to avoid the autoq option since it's currently unknown what effect it will have on the processing.
</p>
<p>
<b>threads:</b>
Sets the number of decoder threads used. Defaults to the number of cpus reported by windows. Ignored by lavc if the used decoder doesn't implement it.
</p>
<p>
<b>seekmode:</b>
Force how seeking is handled, has no effect on matroska files which always use the equivalent of seekmode=1<br />
<b>-1:</b> linear access without rewind, will throw an error if each successive requested frame number isn't bigger than the last one, only intended for opening images but might work on well with some obscure video format<br />
<b>0:</b> linear access, the definition of slow but should make some formats "usable"<br />
<b>1:</b> safe normal, bases seeking decisions on the reported keyframe positions<br />
<b>2:</b> unsafe normal, same as 1 but no error will be thrown if the exact destination has to be guessed<br />
<b>3:</b> aggressive, seek in the forward direction even if no closer keyframe is known to exist, only useful for testing and containers where avformat doesn't report keyframes properly
</p>
<p>
<b>width &amp; height:</b>
Width and height to resize to. Value below or equal to 0 is the same as specifying the input dimensions.
</p>
<p>
<b>resizer:</b>
Selects the resizer used for resampling the chroma planes and normal resizing. The available methods are: FAST_BILINEAR, BILINEAR, BICUBIC, X, POINT, AREA, BICUBLIN, GAUSS, SINC, LANCZOS and SPLINE.
</p>
<p>
<b>colorspace:</b>
The colorspace to convert to. The names are YV12, YUY2, RGB24, RGB32 and the empty string for same as input.
</p>
<h2>PP string format</h2>
<pre>
Available postprocessing filters:
Filters Options
short long name short long option Description
* * a autoq CPU power dependent enabler
c chrom chrominance filtering enabled
y nochrom chrominance filtering disabled
n noluma luma filtering disabled
hb hdeblock (2 threshold) horizontal deblocking filter
1. difference factor: default=32, higher -> more deblocking
2. flatness threshold: default=39, lower -> more deblocking
the h & v deblocking filters share these
so you can't set different thresholds for h / v
vb vdeblock (2 threshold) vertical deblocking filter
ha hadeblock (2 threshold) horizontal deblocking filter
va vadeblock (2 threshold) vertical deblocking filter
h1 x1hdeblock experimental h deblock filter 1
v1 x1vdeblock experimental v deblock filter 1
dr dering deringing filter
al autolevels automatic brightness / contrast
f fullyrange stretch luminance to (0..255)
lb linblenddeint linear blend deinterlacer
li linipoldeint linear interpolating deinterlace
ci cubicipoldeint cubic interpolating deinterlacer
md mediandeint median deinterlacer
fd ffmpegdeint ffmpeg deinterlacer
l5 lowpass5 FIR lowpass deinterlacer
de default hb:a,vb:a,dr:a
fa fast h1:a,v1:a,dr:a
ac ha:a:128:7,va:a,dr:a
tn tmpnoise (3 threshold) temporal noise reducer
1. <= 2. <= 3. larger -> stronger filtering
fq forceQuant <quantizer> force quantizer
Usage:
<filterName>[:<option>[:<option>...]][[,|/][-]<filterName>[:<option>...]]...
long form example:
vdeblock:autoq/hdeblock:autoq/linblenddeint default,-vdeblock
short form example:
vb:a/hb:a/lb de,-vb
more examples:
tn:64:128:256
</pre>
<h2>Compiling</h2>
<p><b>zlib</b> from http://www.zlib.net/</p>
<p><b>FFmpeg svn</b> from http://ffmpeg.mplayerhq.hu/</p>
<p><b>Required FFmpeg Configuration:</b>
./configure --enable-memalign-hack --enable-gpl --enable-swscale --enable-postproc
<p><b>Suggested Additional Options:</b>
--enable-w32threads --disable-encoders --disable-muxers --disable-debug</p>
<p>
Note that --enable-w32threads is required for multithreaded decoding to work.
</p>
<h2>Changes</h2>
<ul>
<li>2.00 beta 4<ul>
<li>Added the function FFNoLog which suppresses all messages from ffmpeg</li>
<li>Experimental new TS parsing using Haali's splitter (with bugs)</li>
<li>Everything is now compiled with VS2008 and GCC 4.3.2</li>
<li>Updated FFmpeg to rev 16383 (no libfaad2 this time)</li>
</ul></li>
<li>2.00 beta 3<ul>
<li>Compiled with libfaad2 again (has anyone seen a single aac file lavc can open right now?)</li>
<li>More API changes (and even more are likely to come)</li>
<li>Several access violations and memory leaks on opening and indexing files fixed</li>
<li>Added a VFR to CFR mode</li>
<li>Readded FFAudioSource support for other containers (glitches still present now and then but no separate raw cache is required and possibly less buggy)</li>
<li>Renamed the dll to FFMS2.dll, FFMS2 is now the official short name of the project</li>
<li>Updated FFmpeg to rev 15522</li>
</ul></li>
<li>2.00 beta 2<ul>
<li>More API changes (and more are likely to come)</li>
<li>Includes a simple CLI indexing application</li>
<li>FFIndex now takes a few more arguments</li>
<li>Readded FFAudioSource (only matroska supported for now)</li>
<li>Updated FFmpeg to rev 15396</li>
</ul></li>
<li>2.00 beta 1<ul>
<li>Can now be used as a stand alone library for making indices and retrieving frames</li>
<li>Rewrote most things</li>
<li>Updated FFmpeg to rev 15301</li>
</ul></li>
</ul>
</body>
</html>

View File

@ -1,201 +0,0 @@
// Copyright (c) 2008 Karl Blomster
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include <iostream>
#include <string>
#include <stdlib.h>
#include "ffms.h"
int TrackMask;
int DumpMask;
bool Overwrite;
bool IgnoreErrors;
std::string InputFile;
std::string CacheFile;
std::string AudioFile;
FrameIndex *Index;
void PrintUsage () {
using namespace std;
cout << "FFmpegSource2 indexing app" << endl
<< "Usage: ffmsindex [options] inputfile [outputfile]" << endl
<< "If no output filename is specified, inputfile.ffindex will be used." << endl << endl
<< "Options:" << endl
<< "-f Force overwriting of existing index file, if any (default: no)" << endl
<< "-s Silently skip indexing of audio tracks that cannot be read (default: no)" << endl
<< "-t N Set the audio indexing mask to N (-1 means index all tracks, 0 means index none, default: 0)" << endl
<< "-d N Set the audio decoding mask to N (mask syntax same as -t, default: 0)" << endl
<< "-a NAME Set the audio output base filename to NAME (default: input filename)";
}
void ParseCMDLine (int argc, char *argv[]) {
if (argc <= 1) {
PrintUsage();
throw "";
}
// defaults
InputFile = "";
CacheFile = "";
AudioFile = "";
TrackMask = 0;
DumpMask = 0;
Overwrite = false;
IgnoreErrors = false;
// argv[0] = name of program
int i = 1;
while (i < argc) {
std::string Option = argv[i];
std::string OptionArg = "";
if (i+1 < argc)
OptionArg = argv[i+1];
if (!Option.compare("-f")) {
Overwrite = true;
} else if (!Option.compare("-s")) {
IgnoreErrors = true;
} else if (!Option.compare("-t")) {
TrackMask = atoi(OptionArg.c_str());
i++;
} else if (!Option.compare("-d")) {
DumpMask = atoi(OptionArg.c_str());
i++;
} else if (!Option.compare("-a")) {
AudioFile = OptionArg;
i++;
} else if (InputFile.empty()) {
InputFile = argv[i];
} else if (CacheFile.empty()) {
CacheFile = argv[i];
} else {
std::cout << "Warning: ignoring unknown option " << argv[i] << std::endl;
}
i++;
}
if (InputFile.empty()) {
throw "Error: no input file specified";
}
if (CacheFile.empty()) {
CacheFile = InputFile;
CacheFile.append(".ffindex");
}
if (AudioFile.empty()) {
AudioFile = InputFile;
}
}
static int FFMS_CC UpdateProgress(int State, int64_t Current, int64_t Total, void *Private) {
using namespace std;
int *LastPercentage = (int *)Private;
int Percentage = int((double(Current)/double(Total)) * 100);
if (Percentage <= *LastPercentage)
return 0;
*LastPercentage = Percentage;
/*if (Percentage < 10)
cout << "\b\b";
else
cout << "\b\b\b"; */
cout << "Indexing, please wait... " << Percentage << "% \r";
return 0;
}
void DoIndexing () {
char FFMSErrMsg[1024];
int MsgSize = sizeof(FFMSErrMsg);
int Progress = 0;
Index = FFMS_ReadIndex(CacheFile.c_str(), FFMSErrMsg, MsgSize);
if (Overwrite || Index == NULL) {
std::cout << "Indexing, please wait... 0% \r";
Index = FFMS_MakeIndex(InputFile.c_str(), TrackMask, DumpMask, AudioFile.c_str(), IgnoreErrors, UpdateProgress, &Progress, FFMSErrMsg, MsgSize);
if (Index == NULL) {
std::string Err = "\nIndexing error: ";
Err.append(FFMSErrMsg);
throw Err;
}
if (Progress != 100)
std::cout << "Indexing, please wait... 100% \r";
std::cout << std::endl << "Writing index... ";
if (FFMS_WriteIndex(CacheFile.c_str(), Index, FFMSErrMsg, MsgSize)) {
std::string Err = "Error writing index: ";
Err.append(FFMSErrMsg);
throw Err;
}
std::cout << "done." << std::endl;
} else {
throw "Error: index file already exists, use -f if you are sure you want to overwrite it.";
}
}
int main(int argc, char *argv[]) {
try {
ParseCMDLine(argc, argv);
} catch (const char *Error) {
std::cout << std::endl << Error << std::endl;
return 1;
} catch (std::string Error) {
std::cout << std::endl << Error << std::endl;
return 1;
} catch (...) {
std::cout << std::endl << "Unknown error" << std::endl;
return 1;
}
FFMS_Init();
try {
DoIndexing();
} catch (const char *Error) {
std::cout << Error << std::endl;
FFMS_DestroyFrameIndex(Index);
return 1;
} catch (std::string Error) {
std::cout << std::endl << Error << std::endl;
FFMS_DestroyFrameIndex(Index);
return 1;
} catch (...) {
std::cout << std::endl << "Unknown error" << std::endl;
FFMS_DestroyFrameIndex(Index);
return 1;
}
FFMS_DestroyFrameIndex(Index);
return 0;
}

View File

@ -1,96 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ffpp.h"
#include "utils.h"
FFPP::FFPP(PClip AChild, const char *PP, IScriptEnvironment *Env) : GenericVideoFilter(AChild) {
if (!strcmp(PP, ""))
Env->ThrowError("FFPP: PP argument is empty");
PPContext = NULL;
PPMode = NULL;
SWSTo422P = NULL;
SWSFrom422P = NULL;
memset(&InputPicture, 0, sizeof(InputPicture));
memset(&OutputPicture, 0, sizeof(OutputPicture));
PPMode = pp_get_mode_by_name_and_quality((char *)PP, PP_QUALITY_MAX);
if (!PPMode)
Env->ThrowError("FFPP: Invalid postprocesing settings");
int Flags = GetCPUFlags();
if (vi.IsYV12()) {
Flags |= PP_FORMAT_420;
} else if (vi.IsYUY2()) {
Flags |= PP_FORMAT_422;
SWSTo422P = sws_getContext(vi.width, vi.height, PIX_FMT_YUV422, vi.width, vi.height, PIX_FMT_YUV422P, GetCPUFlags() | SWS_BICUBIC, NULL, NULL, NULL);
SWSFrom422P = sws_getContext(vi.width, vi.height, PIX_FMT_YUV422P, vi.width, vi.height, PIX_FMT_YUV422, GetCPUFlags() | SWS_BICUBIC, NULL, NULL, NULL);
avpicture_alloc(&InputPicture, PIX_FMT_YUV422P, vi.width, vi.height);
avpicture_alloc(&OutputPicture, PIX_FMT_YUV422P, vi.width, vi.height);
} else {
Env->ThrowError("FFPP: Only YV12 and YUY2 video supported");
}
PPContext = pp_get_context(vi.width, vi.height, Flags);
if (!PPContext)
Env->ThrowError("FFPP: Failed to create context");
}
FFPP::~FFPP() {
if (PPMode)
pp_free_mode(PPMode);
if (PPContext)
pp_free_context(PPContext);
if (SWSTo422P)
sws_freeContext(SWSTo422P);
if (SWSFrom422P)
sws_freeContext(SWSFrom422P);
avpicture_free(&InputPicture);
avpicture_free(&OutputPicture);
}
PVideoFrame FFPP::GetFrame(int n, IScriptEnvironment* Env) {
PVideoFrame Src = child->GetFrame(n, Env);
PVideoFrame Dst = Env->NewVideoFrame(vi);
if (vi.IsYV12()) {
const uint8_t *SrcData[3] = {(uint8_t *)Src->GetReadPtr(PLANAR_Y), (uint8_t *)Src->GetReadPtr(PLANAR_U), (uint8_t *)Src->GetReadPtr(PLANAR_V)};
int SrcStride[3] = {Src->GetPitch(PLANAR_Y), Src->GetPitch(PLANAR_U), Src->GetPitch(PLANAR_V)};
uint8_t *DstData[3] = {Dst->GetWritePtr(PLANAR_Y), Dst->GetWritePtr(PLANAR_U), Dst->GetWritePtr(PLANAR_V)};
int DstStride[3] = {Dst->GetPitch(PLANAR_Y), Dst->GetPitch(PLANAR_U), Dst->GetPitch(PLANAR_V)};
pp_postprocess(SrcData, SrcStride, DstData, DstStride, vi.width, vi.height, NULL, 0, PPMode, PPContext, 0);
} else if (vi.IsYUY2()) {
uint8_t *SrcData[1] = {(uint8_t *)Src->GetReadPtr()};
int SrcStride[1] = {Src->GetPitch()};
sws_scale(SWSTo422P, SrcData, SrcStride, 0, vi.height, InputPicture.data, InputPicture.linesize);
pp_postprocess(const_cast<const uint8_t **>(InputPicture.data), InputPicture.linesize, OutputPicture.data, OutputPicture.linesize, vi.width, vi.height, NULL, 0, PPMode, PPContext, 0);
uint8_t *DstData[1] = {Dst->GetWritePtr()};
int DstStride[1] = {Dst->GetPitch()};
sws_scale(SWSFrom422P, OutputPicture.data, OutputPicture.linesize, 0, vi.height, DstData, DstStride);
}
return Dst;
}

View File

@ -1,47 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef FFPP_H
#define FFPP_H
extern "C" {
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libpostproc/postprocess.h>
}
#include <windows.h>
#include "avisynth.h"
class FFPP : public GenericVideoFilter {
private:
pp_context_t *PPContext;
pp_mode_t *PPMode;
SwsContext *SWSTo422P;
SwsContext *SWSFrom422P;
AVPicture InputPicture;
AVPicture OutputPicture;
public:
FFPP(PClip AChild, const char *PP, IScriptEnvironment *Env);
~FFPP();
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* Env);
};
#endif

View File

@ -1,142 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ffswscale.h"
#include "utils.h"
int CSNameToPIXFMT(const char * ACSName, int ADefault) {
if (!_stricmp(ACSName, ""))
return ADefault;
if (!_stricmp(ACSName, "YV12"))
return PIX_FMT_YUV420P;
if (!_stricmp(ACSName, "YUY2"))
return PIX_FMT_YUYV422;
if (!_stricmp(ACSName, "RGB24"))
return PIX_FMT_BGR24;
if (!_stricmp(ACSName, "RGB32"))
return PIX_FMT_RGB32;
return PIX_FMT_NONE;
}
int ResizerNameToSWSResizer(const char *AResizerName) {
if (!_stricmp(AResizerName, "FAST_BILINEAR"))
return SWS_FAST_BILINEAR;
if (!_stricmp(AResizerName, "BILINEAR"))
return SWS_BILINEAR;
if (!_stricmp(AResizerName, "BICUBIC"))
return SWS_BICUBIC;
if (!_stricmp(AResizerName, "X"))
return SWS_X;
if (!_stricmp(AResizerName, "POINT"))
return SWS_POINT;
if (!_stricmp(AResizerName, "AREA"))
return SWS_AREA;
if (!_stricmp(AResizerName, "BICUBLIN"))
return SWS_BICUBLIN;
if (!_stricmp(AResizerName, "GAUSS"))
return SWS_GAUSS;
if (!_stricmp(AResizerName, "SINC"))
return SWS_SINC;
if (!_stricmp(AResizerName, "LANCZOS"))
return SWS_LANCZOS;
if (!_stricmp(AResizerName, "SPLINE"))
return SWS_SPLINE;
return 0;
}
SWScale::SWScale(PClip Child, int ResizeToWidth, int ResizeToHeight, const char *ResizerName, const char *ConvertToFormatName, IScriptEnvironment *Env) : GenericVideoFilter(Child) {
Context = NULL;
OrigWidth = vi.width;
OrigHeight = vi.height;
FlipOutput = vi.IsYUV();
int ConvertFromFormat = PIX_FMT_NONE;
if (vi.IsYV12())
ConvertFromFormat = PIX_FMT_YUV420P;
if (vi.IsYUY2())
ConvertFromFormat = PIX_FMT_YUYV422;
if (vi.IsRGB24())
ConvertFromFormat = PIX_FMT_BGR24;
if (vi.IsRGB32())
ConvertFromFormat = PIX_FMT_RGB32;
if (ResizeToHeight <= 0)
ResizeToHeight = OrigHeight;
else
vi.height = ResizeToHeight;
if (ResizeToWidth <= 0)
ResizeToWidth = OrigWidth;
else
vi.width = ResizeToWidth;
int ConvertToFormat = CSNameToPIXFMT(ConvertToFormatName, ConvertFromFormat);
if (ConvertToFormat == PIX_FMT_NONE)
Env->ThrowError("SWScale: Invalid colorspace specified (%s)", ConvertToFormatName);
switch (ConvertToFormat) {
case PIX_FMT_YUV420P: vi.pixel_type = VideoInfo::CS_I420; break;
case PIX_FMT_YUYV422: vi.pixel_type = VideoInfo::CS_YUY2; break;
case PIX_FMT_BGR24: vi.pixel_type = VideoInfo::CS_BGR24; break;
case PIX_FMT_RGB32: vi.pixel_type = VideoInfo::CS_BGR32; break;
}
FlipOutput ^= vi.IsYUV();
int Resizer = ResizerNameToSWSResizer(ResizerName);
if (Resizer == 0)
Env->ThrowError("SWScale: Invalid resizer specified (%s)", ResizerName);
if (ConvertToFormat == PIX_FMT_YUV420P && vi.height & 1)
Env->ThrowError("SWScale: mod 2 output height required");
if ((ConvertToFormat == PIX_FMT_YUV420P || ConvertToFormat == PIX_FMT_YUYV422) && vi.width & 1)
Env->ThrowError("SWScale: mod 2 output width required");
// may one day need a SWS_CS_DEFAULT in flags
Context = sws_getContext(OrigWidth, OrigHeight, ConvertFromFormat, vi.width, vi.height, ConvertToFormat, GetCPUFlags() | Resizer, NULL, NULL, NULL);
if (Context == NULL)
Env->ThrowError("SWScale: Context creation failed");
}
SWScale::~SWScale() {
if (Context)
sws_freeContext(Context);
}
PVideoFrame SWScale::GetFrame(int n, IScriptEnvironment *Env) {
PVideoFrame Src = child->GetFrame(n, Env);
PVideoFrame Dst = Env->NewVideoFrame(vi);
uint8_t *SrcData[3] = {(uint8_t *)Src->GetReadPtr(PLANAR_Y), (uint8_t *)Src->GetReadPtr(PLANAR_U), (uint8_t *)Src->GetReadPtr(PLANAR_V)};
int SrcStride[3] = {Src->GetPitch(PLANAR_Y), Src->GetPitch(PLANAR_U), Src->GetPitch(PLANAR_V)};
if (FlipOutput) {
uint8_t *DstData[3] = {Dst->GetWritePtr(PLANAR_Y) + Dst->GetPitch(PLANAR_Y) * (Dst->GetHeight(PLANAR_Y) - 1), Dst->GetWritePtr(PLANAR_U) + Dst->GetPitch(PLANAR_U) * (Dst->GetHeight(PLANAR_U) - 1), Dst->GetWritePtr(PLANAR_V) + Dst->GetPitch(PLANAR_V) * (Dst->GetHeight(PLANAR_V) - 1)};
int DstStride[3] = {-Dst->GetPitch(PLANAR_Y), -Dst->GetPitch(PLANAR_U), -Dst->GetPitch(PLANAR_V)};
sws_scale(Context, SrcData, SrcStride, 0, OrigHeight, DstData, DstStride);
} else {
uint8_t *DstData[3] = {Dst->GetWritePtr(PLANAR_Y), Dst->GetWritePtr(PLANAR_U), Dst->GetWritePtr(PLANAR_V)};
int DstStride[3] = {Dst->GetPitch(PLANAR_Y), Dst->GetPitch(PLANAR_U), Dst->GetPitch(PLANAR_V)};
sws_scale(Context, SrcData, SrcStride, 0, OrigHeight, DstData, DstStride);
}
return Dst;
}

View File

@ -1,43 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef FFSWSCALE_H
#define FFSWSCALE_H
extern "C" {
#include <libswscale/swscale.h>
}
#include <windows.h>
#include "avisynth.h"
class SWScale : public GenericVideoFilter {
private:
SwsContext *Context;
int OrigWidth;
int OrigHeight;
bool FlipOutput;
public:
SWScale(PClip Child, int ResizeToWidth, int ResizeToHeight, const char *ResizerName, const char *ConvertToFormatName, IScriptEnvironment *Env);
~SWScale();
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *Env);
};
#endif

View File

@ -1,799 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ffvideosource.h"
#include <errno.h>
#ifdef __UNIX__
#define _snprintf snprintf
#endif
int VideoBase::InitPP(const char *PP, int PixelFormat, char *ErrorMsg, unsigned MsgSize) {
if (PP == NULL || !strcmp(PP, ""))
return 0;
PPMode = pp_get_mode_by_name_and_quality(PP, PP_QUALITY_MAX);
if (!PPMode) {
_snprintf(ErrorMsg, MsgSize, "Invalid postprocesing settings");
return 1;
}
int Flags = GetCPUFlags();
switch (PixelFormat) {
case PIX_FMT_YUV420P: Flags |= PP_FORMAT_420; break;
case PIX_FMT_YUV422P: Flags |= PP_FORMAT_422; break;
case PIX_FMT_YUV411P: Flags |= PP_FORMAT_411; break;
case PIX_FMT_YUV444P: Flags |= PP_FORMAT_444; break;
default:
_snprintf(ErrorMsg, MsgSize, "Input format is not supported for postprocessing");
return 2;
}
PPContext = pp_get_context(VP.Width, VP.Height, Flags);
if (!(PPFrame = avcodec_alloc_frame())) {
_snprintf(ErrorMsg, MsgSize, "Failed to allocate temporary frame");
return 3;
}
if (avpicture_alloc((AVPicture *)PPFrame, PixelFormat, VP.Width, VP.Height) < 0) {
av_free(PPFrame);
PPFrame = NULL;
_snprintf(ErrorMsg, MsgSize, "Failed to allocate picture");
return 4;
}
FinalFrame = PPFrame;
return 0;
}
AVFrameLite *VideoBase::OutputFrame(AVFrame *Frame) {
if (PPContext) {
pp_postprocess(const_cast<const uint8_t **>(Frame->data), Frame->linesize, PPFrame->data, PPFrame->linesize, VP.Width, VP.Height, Frame->qscale_table, Frame->qstride, PPMode, PPContext, Frame->pict_type | (Frame->qscale_type ? PP_PICT_TYPE_QP2 : 0));
PPFrame->key_frame = Frame->key_frame;
PPFrame->pict_type = Frame->pict_type;
}
if (SWS) {
sws_scale(SWS, PPFrame->data, PPFrame->linesize, 0, VP.Height, FinalFrame->data, FinalFrame->linesize);
FinalFrame->key_frame = PPFrame->key_frame;
FinalFrame->pict_type = PPFrame->pict_type;
}
return reinterpret_cast<AVFrameLite *>(FinalFrame);
}
VideoBase::VideoBase() {
memset(&VP, 0, sizeof(VP));
PPContext = NULL;
PPMode = NULL;
SWS = NULL;
LastFrameNum = -1;
CurrentFrame = 0;
CodecContext = NULL;
DecodeFrame = avcodec_alloc_frame();
PPFrame = DecodeFrame;
FinalFrame = PPFrame;
}
VideoBase::~VideoBase() {
if (PPMode)
pp_free_mode(PPMode);
if (PPContext)
pp_free_context(PPContext);
if (SWS)
sws_freeContext(SWS);
if (FinalFrame != PPFrame) {
avpicture_free((AVPicture *)FinalFrame);
av_free(FinalFrame);
}
if (PPFrame != DecodeFrame) {
avpicture_free((AVPicture *)PPFrame);
av_free(PPFrame);
}
av_free(DecodeFrame);
}
AVFrameLite *VideoBase::GetFrameByTime(double Time, char *ErrorMsg, unsigned MsgSize) {
int Frame = Frames.ClosestFrameFromDTS((Time * 1000 * Frames.TB.Den) / Frames.TB.Num);
return GetFrame(Frame, ErrorMsg, MsgSize);
}
int VideoBase::SetOutputFormat(int TargetFormats, int Width, int Height, char *ErrorMsg, unsigned MsgSize) {
// FIXME: investigate the possible bug in avcodec_find_best_pix_fmt
// int Loss;
// int OutputFormat = avcodec_find_best_pix_fmt(TargetFormats,
// CodecContext->pix_fmt, 1 /* Required to prevent pointless RGB32 => RGB24 conversion */, &Loss);
// if (OutputFormat == -1)
// return -1;
int OutputFormat = TargetFormats;
SwsContext *NewSWS = NULL;
if (CodecContext->pix_fmt != OutputFormat || Width != CodecContext->width || Height != CodecContext->height) {
NewSWS = sws_getContext(CodecContext->width, CodecContext->height, CodecContext->pix_fmt, Width, Height,
OutputFormat, GetCPUFlags() | SWS_BICUBIC, NULL, NULL, NULL);
if (NewSWS == NULL) {
_snprintf(ErrorMsg, MsgSize, "Failed to allocate SWScale context");
return 1;
}
}
if (SWS)
sws_freeContext(SWS);
SWS = NewSWS;
VP.Height = Height;
VP.Width = Width;
VP.PixelFormat = OutputFormat;
// FIXME: In theory the allocations in this part could fail just like in InitPP but whatever
if (FinalFrame != PPFrame) {
avpicture_free((AVPicture *)FinalFrame);
av_free(FinalFrame);
}
if (SWS) {
FinalFrame = avcodec_alloc_frame();
avpicture_alloc((AVPicture *)FinalFrame, VP.PixelFormat, VP.Width, VP.Height);
} else {
FinalFrame = PPFrame;
}
return 0;
}
void VideoBase::ResetOutputFormat() {
if (SWS)
sws_freeContext(SWS);
SWS = NULL;
VP.Height = CodecContext->height;
VP.Width = CodecContext->width;
VP.PixelFormat = CodecContext->pix_fmt;
}
void FFVideoSource::Free(bool CloseCodec) {
if (CloseCodec)
avcodec_close(CodecContext);
av_close_input_file(FormatContext);
// how was it allocated? how was it deallocate? nobody knows
//av_free(FormatContext);
}
FFVideoSource::FFVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices,
const char *PP, int Threads, int SeekMode, char *ErrorMsg, unsigned MsgSize) {
FormatContext = NULL;
AVCodec *Codec = NULL;
this->SeekMode = SeekMode;
VideoTrack = Track;
Frames = (*TrackIndices)[VideoTrack];
if (Frames.size() == 0) {
_snprintf(ErrorMsg, MsgSize, "Video track contains no frames");
throw ErrorMsg;
}
if (av_open_input_file(&FormatContext, SourceFile, NULL, 0, NULL) != 0) {
_snprintf(ErrorMsg, MsgSize, "Couldn't open '%s'", SourceFile);
throw ErrorMsg;
}
if (av_find_stream_info(FormatContext) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Couldn't find stream information");
throw ErrorMsg;
}
if (SeekMode >= 0 && av_seek_frame(FormatContext, VideoTrack, Frames[0].DTS, AVSEEK_FLAG_BACKWARD) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Video track is unseekable");
throw ErrorMsg;
}
CodecContext = FormatContext->streams[VideoTrack]->codec;
CodecContext->thread_count = Threads;
Codec = avcodec_find_decoder(CodecContext->codec_id);
if (Codec == NULL) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Video codec not found");
throw ErrorMsg;
}
if (avcodec_open(CodecContext, Codec) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Could not open video codec");
throw ErrorMsg;
}
// Always try to decode a frame to make sure all required parameters are known
int64_t Dummy;
if (DecodeNextFrame(DecodeFrame, &Dummy, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
//VP.image_type = VideoInfo::IT_TFF;
VP.Width = CodecContext->width;
VP.Height = CodecContext->height;
VP.FPSDenominator = FormatContext->streams[VideoTrack]->time_base.num;
VP.FPSNumerator = FormatContext->streams[VideoTrack]->time_base.den;
VP.NumFrames = Frames.size();
VP.PixelFormat = CodecContext->pix_fmt;
VP.FirstTime = ((Frames.front().DTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
VP.LastTime = ((Frames.back().DTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
if (VP.Width <= 0 || VP.Height <= 0) {
Free(true);
_snprintf(ErrorMsg, MsgSize, "Codec returned zero size video");
throw ErrorMsg;
}
// sanity check framerate
if (VP.FPSDenominator > VP.FPSNumerator || VP.FPSDenominator <= 0 || VP.FPSNumerator <= 0) {
VP.FPSDenominator = 1;
VP.FPSNumerator = 30;
}
if (InitPP(PP, CodecContext->pix_fmt, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
// Adjust framerate to match the duration of the first frame
if (Frames.size() >= 2) {
unsigned int DTSDiff = (unsigned int)FFMAX(Frames[1].DTS - Frames[0].DTS, 1);
VP.FPSDenominator *= DTSDiff;
}
// Cannot "output" to PPFrame without doing all other initialization
// This is the additional mess required for seekmode=-1 to work in a reasonable way
OutputFrame(DecodeFrame);
LastFrameNum = 0;
// Set AR variables
VP.SARNum = CodecContext->sample_aspect_ratio.num;
VP.SARDen = CodecContext->sample_aspect_ratio.den;
}
FFVideoSource::~FFVideoSource() {
Free(true);
}
int FFVideoSource::DecodeNextFrame(AVFrame *AFrame, int64_t *AStartTime, char *ErrorMsg, unsigned MsgSize) {
AVPacket Packet;
int FrameFinished = 0;
*AStartTime = -1;
while (av_read_frame(FormatContext, &Packet) >= 0) {
if (Packet.stream_index == VideoTrack) {
if (*AStartTime < 0)
*AStartTime = Packet.dts;
avcodec_decode_video(CodecContext, AFrame, &FrameFinished, Packet.data, Packet.size);
}
av_free_packet(&Packet);
if (FrameFinished)
goto Done;
}
// Flush the last frames
if (CodecContext->has_b_frames)
avcodec_decode_video(CodecContext, AFrame, &FrameFinished, NULL, 0);
if (!FrameFinished)
goto Error;
// Ignore errors for now
Error:
Done:
return 0;
}
AVFrameLite *FFVideoSource::GetFrame(int n, char *ErrorMsg, unsigned MsgSize) {
// PPFrame always holds frame LastFrameNum even if no PP is applied
if (LastFrameNum == n)
return OutputFrame(DecodeFrame);
bool HasSeeked = false;
if (SeekMode >= 0) {
int ClosestKF = Frames.FindClosestKeyFrame(n);
if (SeekMode == 0) {
if (n < CurrentFrame) {
av_seek_frame(FormatContext, VideoTrack, Frames[0].DTS, AVSEEK_FLAG_BACKWARD);
avcodec_flush_buffers(CodecContext);
CurrentFrame = 0;
}
} else {
// 10 frames is used as a margin to prevent excessive seeking since the predicted best keyframe isn't always selected by avformat
if (n < CurrentFrame || ClosestKF > CurrentFrame + 10 || (SeekMode == 3 && n > CurrentFrame + 10)) {
av_seek_frame(FormatContext, VideoTrack, (SeekMode == 3) ? Frames[n].DTS : Frames[ClosestKF].DTS, AVSEEK_FLAG_BACKWARD);
avcodec_flush_buffers(CodecContext);
HasSeeked = true;
}
}
} else if (n < CurrentFrame) {
_snprintf(ErrorMsg, MsgSize, "Non-linear access attempted");
return NULL;
}
do {
int64_t StartTime;
if (DecodeNextFrame(DecodeFrame, &StartTime, ErrorMsg, MsgSize))
return NULL;
if (HasSeeked) {
HasSeeked = false;
// Is the seek destination time known? Does it belong to a frame?
if (StartTime < 0 || (CurrentFrame = Frames.FrameFromDTS(StartTime)) < 0) {
switch (SeekMode) {
case 1:
_snprintf(ErrorMsg, MsgSize, "Frame accurate seeking is not possible in this file");
return NULL;
case 2:
case 3:
CurrentFrame = Frames.ClosestFrameFromDTS(StartTime);
break;
default:
_snprintf(ErrorMsg, MsgSize, "Failed assertion");
return NULL;
}
}
}
CurrentFrame++;
} while (CurrentFrame <= n);
LastFrameNum = n;
return OutputFrame(DecodeFrame);
}
void MatroskaVideoSource::Free(bool CloseCodec) {
if (CS)
cs_Destroy(CS);
if (MC.ST.fp) {
mkv_Close(MF);
fclose(MC.ST.fp);
}
if (CloseCodec)
avcodec_close(CodecContext);
av_free(CodecContext);
}
MatroskaVideoSource::MatroskaVideoSource(const char *SourceFile, int Track,
FrameIndex *TrackIndices, const char *PP,
int Threads, char *ErrorMsg, unsigned MsgSize) {
AVCodec *Codec = NULL;
CodecContext = NULL;
TrackInfo *TI = NULL;
CS = NULL;
VideoTrack = Track;
Frames = (*TrackIndices)[VideoTrack];
if (Frames.size() == 0) {
_snprintf(ErrorMsg, MsgSize, "Video track contains no frames");
throw ErrorMsg;
}
MC.ST.fp = fopen(SourceFile, "rb");
if (MC.ST.fp == NULL) {
_snprintf(ErrorMsg, MsgSize, "Can't open '%s': %s", SourceFile, strerror(errno));
throw ErrorMsg;
}
setvbuf(MC.ST.fp, NULL, _IOFBF, CACHESIZE);
MF = mkv_OpenEx(&MC.ST.base, 0, 0, ErrorMessage, sizeof(ErrorMessage));
if (MF == NULL) {
fclose(MC.ST.fp);
_snprintf(ErrorMsg, MsgSize, "Can't parse Matroska file: %s", ErrorMessage);
throw ErrorMsg;
}
mkv_SetTrackMask(MF, ~(1 << VideoTrack));
TI = mkv_GetTrackInfo(MF, VideoTrack);
if (TI->CompEnabled) {
CS = cs_Create(MF, VideoTrack, ErrorMessage, sizeof(ErrorMessage));
if (CS == NULL) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Can't create decompressor: %s", ErrorMessage);
throw ErrorMsg;
}
}
CodecContext = avcodec_alloc_context();
CodecContext->extradata = (uint8_t *)TI->CodecPrivate;
CodecContext->extradata_size = TI->CodecPrivateSize;
CodecContext->thread_count = Threads;
Codec = avcodec_find_decoder(MatroskaToFFCodecID(TI->CodecID, TI->CodecPrivate));
if (Codec == NULL) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Video codec not found");
throw ErrorMsg;
}
if (avcodec_open(CodecContext, Codec) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Could not open video codec");
throw ErrorMsg;
}
// Always try to decode a frame to make sure all required parameters are known
int64_t Dummy;
if (DecodeNextFrame(DecodeFrame, &Dummy, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
VP.Width = CodecContext->width;
VP.Height = CodecContext->height;;
VP.FPSDenominator = 1;
VP.FPSNumerator = 30;
VP.NumFrames = Frames.size();
VP.PixelFormat = CodecContext->pix_fmt;
VP.FirstTime = ((Frames.front().DTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
VP.LastTime = ((Frames.back().DTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
if (VP.Width <= 0 || VP.Height <= 0) {
Free(true);
_snprintf(ErrorMsg, MsgSize, "Codec returned zero size video");
throw ErrorMsg;
}
if (InitPP(PP, CodecContext->pix_fmt, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
// Calculate the average framerate
if (Frames.size() >= 2) {
double DTSDiff = (double)(Frames.back().DTS - Frames.front().DTS);
VP.FPSDenominator = (unsigned int)(DTSDiff * mkv_TruncFloat(TI->TimecodeScale) / (double)1000 / (double)(VP.NumFrames - 1) + 0.5);
VP.FPSNumerator = 1000000;
}
// Output the already decoded frame so it isn't wasted
OutputFrame(DecodeFrame);
LastFrameNum = 0;
// Set AR variables
VP.SARNum = TI->AV.Video.DisplayWidth * TI->AV.Video.PixelHeight;
VP.SARDen = TI->AV.Video.DisplayHeight * TI->AV.Video.PixelWidth;
// Set crop variables
VP.CropLeft = TI->AV.Video.CropL;
VP.CropRight = TI->AV.Video.CropR;
VP.CropTop = TI->AV.Video.CropT;
VP.CropBottom = TI->AV.Video.CropB;
}
MatroskaVideoSource::~MatroskaVideoSource() {
Free(true);
}
int MatroskaVideoSource::DecodeNextFrame(AVFrame *AFrame, int64_t *AFirstStartTime, char *ErrorMsg, unsigned MsgSize) {
int FrameFinished = 0;
*AFirstStartTime = -1;
ulonglong StartTime, EndTime, FilePos;
unsigned int Track, FrameFlags, FrameSize;
while (mkv_ReadFrame(MF, 0, &Track, &StartTime, &EndTime, &FilePos, &FrameSize, &FrameFlags) == 0) {
if (*AFirstStartTime < 0)
*AFirstStartTime = StartTime;
if (ReadFrame(FilePos, FrameSize, CS, MC, ErrorMsg, MsgSize))
return 1;
avcodec_decode_video(CodecContext, AFrame, &FrameFinished, MC.Buffer, FrameSize);
if (FrameFinished)
goto Done;
}
// Flush the last frames
if (CodecContext->has_b_frames)
avcodec_decode_video(CodecContext, AFrame, &FrameFinished, NULL, 0);
if (!FrameFinished)
goto Error;
Error:
Done:
return 0;
}
AVFrameLite *MatroskaVideoSource::GetFrame(int n, char *ErrorMsg, unsigned MsgSize) {
// PPFrame always holds frame LastFrameNum even if no PP is applied
if (LastFrameNum == n)
return OutputFrame(DecodeFrame);
bool HasSeeked = false;
if (n < CurrentFrame || Frames.FindClosestKeyFrame(n) > CurrentFrame) {
mkv_Seek(MF, Frames[n].DTS, MKVF_SEEK_TO_PREV_KEYFRAME);
avcodec_flush_buffers(CodecContext);
HasSeeked = true;
}
do {
int64_t StartTime;
if (DecodeNextFrame(DecodeFrame, &StartTime, ErrorMsg, MsgSize))
return NULL;
if (HasSeeked) {
HasSeeked = false;
if (StartTime < 0 || (CurrentFrame = Frames.FrameFromDTS(StartTime)) < 0) {
_snprintf(ErrorMsg, MsgSize, "Frame accurate seeking is not possible in this file");
return NULL;
}
}
CurrentFrame++;
} while (CurrentFrame <= n);
LastFrameNum = n;
return OutputFrame(DecodeFrame);
}
#ifdef HAALITS
void HaaliTSVideoSource::Free(bool CloseCodec) {
if (CloseCodec)
avcodec_close(CodecContext);
av_free(CodecContext);
}
HaaliTSVideoSource::HaaliTSVideoSource(const char *SourceFile, int Track,
FrameIndex *TrackIndices, const char *PP,
int Threads, char *ErrorMsg, unsigned MsgSize) {
AVCodec *Codec = NULL;
CodecContext = NULL;
VideoTrack = Track;
Frames = (*TrackIndices)[VideoTrack];
if (Frames.size() == 0) {
_snprintf(ErrorMsg, MsgSize, "Video track contains no frames");
throw ErrorMsg;
}
::CoInitializeEx(NULL, COINIT_MULTITHREADED);
CLSID clsid = Haali_TS_Parser;
if (FAILED(pMMC.CoCreateInstance(clsid))) {
_snprintf(ErrorMsg, MsgSize, "Can't create parser");
throw ErrorMsg;
}
CComPtr<IMemAlloc> pMA;
if (FAILED(pMA.CoCreateInstance(CLSID_MemAlloc))) {
_snprintf(ErrorMsg, MsgSize, "Can't create memory allocator");
throw ErrorMsg;
}
CComPtr<IMMStream> pMS;
if (FAILED(pMS.CoCreateInstance(CLSID_DiskFile))) {
_snprintf(ErrorMsg, MsgSize, "Can't create disk file reader");
throw ErrorMsg;
}
WCHAR WSourceFile[2048];
mbstowcs(WSourceFile, SourceFile, 2000);
CComQIPtr<IMMStreamOpen> pMSO(pMS);
if (FAILED(pMSO->Open(WSourceFile))) {
_snprintf(ErrorMsg, MsgSize, "Can't open file");
throw ErrorMsg;
}
if (FAILED(pMMC->Open(pMS, 0, NULL, pMA))) {
_snprintf(ErrorMsg, MsgSize, "Can't parse file");
throw ErrorMsg;
}
BSTR CodecID = NULL;
uint8_t * CodecPrivate = NULL;
int CodecPrivateSize = 0;
int CurrentTrack = 0;
CComPtr<IEnumUnknown> pEU;
if (SUCCEEDED(pMMC->EnumTracks(&pEU))) {
CComPtr<IUnknown> pU;
while (pEU->Next(1, &pU, NULL) == S_OK) {
if (CurrentTrack++ == Track) {
CComQIPtr<IPropertyBag> pBag = pU;
if (pBag) {
VARIANT pV;
pV.vt = VT_EMPTY;
if (pBag->Read(L"CodecID", &pV, NULL) == S_OK)
CodecID = pV.bstrVal;
pV.vt = VT_EMPTY;
if (pBag->Read(L"CodecPrivate", &pV, NULL) == S_OK) {
CodecPrivate = (uint8_t *)pV.parray->pvData;
CodecPrivateSize = pV.parray->cbElements;
}
}
}
pU = NULL;
}
}
CodecContext = avcodec_alloc_context();
CodecContext->extradata = CodecPrivate;
CodecContext->extradata_size = CodecPrivateSize;
CodecContext->thread_count = Threads;
char ACodecID[2048];
wcstombs(ACodecID, CodecID, 2000);
Codec = avcodec_find_decoder(MatroskaToFFCodecID(ACodecID, CodecPrivate));
if (Codec == NULL) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Video codec not found");
throw ErrorMsg;
}
if (avcodec_open(CodecContext, Codec) < 0) {
Free(false);
_snprintf(ErrorMsg, MsgSize, "Could not open video codec");
throw ErrorMsg;
}
// Always try to decode a frame to make sure all required parameters are known
int64_t Dummy;
if (DecodeNextFrame(DecodeFrame, &Dummy, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
VP.Width = CodecContext->width;
VP.Height = CodecContext->height;;
VP.FPSDenominator = 1;
VP.FPSNumerator = 30;
VP.NumFrames = Frames.size();
VP.PixelFormat = CodecContext->pix_fmt;
VP.FirstTime = ((Frames.front().DTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
VP.LastTime = ((Frames.back().DTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
if (VP.Width <= 0 || VP.Height <= 0) {
Free(true);
_snprintf(ErrorMsg, MsgSize, "Codec returned zero size video");
throw ErrorMsg;
}
if (InitPP(PP, CodecContext->pix_fmt, ErrorMsg, MsgSize)) {
Free(true);
throw ErrorMsg;
}
// Calculate the average framerate
if (Frames.size() >= 2) {
double DTSDiff = (double)(Frames.back().DTS - Frames.front().DTS);
// FIXME
VP.FPSDenominator = (unsigned int)((DTSDiff * 1000000000) / (double)1000 / (double)(VP.NumFrames - 1) + 0.5);
VP.FPSNumerator = 1000000;
}
// Output the already decoded frame so it isn't wasted
OutputFrame(DecodeFrame);
LastFrameNum = 0;
// Set AR variables
// VP.SARNum = TI->AV.Video.DisplayWidth * TI->AV.Video.PixelHeight;
// VP.SARDen = TI->AV.Video.DisplayHeight * TI->AV.Video.PixelWidth;
// Set crop variables
// VP.CropLeft = TI->AV.Video.CropL;
// VP.CropRight = TI->AV.Video.CropR;
// VP.CropTop = TI->AV.Video.CropT;
// VP.CropBottom = TI->AV.Video.CropB;
}
HaaliTSVideoSource::~HaaliTSVideoSource() {
Free(true);
}
int HaaliTSVideoSource::DecodeNextFrame(AVFrame *AFrame, int64_t *AFirstStartTime, char *ErrorMsg, unsigned MsgSize) {
int FrameFinished = 0;
*AFirstStartTime = -1;
for (;;) {
CComPtr<IMMFrame> pMMF;
if (pMMC->ReadFrame(NULL, &pMMF) != S_OK)
break;
REFERENCE_TIME Ts, Te;
if (*AFirstStartTime < 0 && SUCCEEDED(pMMF->GetTime(&Ts, &Te)))
*AFirstStartTime = Ts;
if (pMMF->GetTrack() == VideoTrack) {
BYTE *Data = NULL;
if (FAILED(pMMF->GetPointer(&Data)))
goto Error;
avcodec_decode_video(CodecContext, AFrame, &FrameFinished, Data, pMMF->GetActualDataLength());
if (FrameFinished)
goto Done;
}
}
// Flush the last frames
if (CodecContext->has_b_frames)
avcodec_decode_video(CodecContext, AFrame, &FrameFinished, NULL, 0);
if (!FrameFinished)
goto Error;
Error:
Done:
return 0;
}
AVFrameLite *HaaliTSVideoSource::GetFrame(int n, char *ErrorMsg, unsigned MsgSize) {
// PPFrame always holds frame LastFrameNum even if no PP is applied
if (LastFrameNum == n)
return OutputFrame(DecodeFrame);
bool HasSeeked = false;
if (n < CurrentFrame || Frames.FindClosestKeyFrame(n) > CurrentFrame) {
int64_t dtsp = Frames[n].DTS;
pMMC->Seek(Frames[n].DTS, MMSF_PREV_KF);
// FIXME for some reason required to make it seek properly
//avcodec_flush_buffers(CodecContext);
HasSeeked = true;
}
do {
int64_t StartTime;
if (DecodeNextFrame(DecodeFrame, &StartTime, ErrorMsg, MsgSize))
return NULL;
if (HasSeeked) {
HasSeeked = false;
if (StartTime < 0 || (CurrentFrame = Frames.FrameFromDTS(StartTime)) < 0) {
_snprintf(ErrorMsg, MsgSize, "Frame accurate seeking is not possible in this file\n");
return NULL;
}
}
CurrentFrame++;
} while (CurrentFrame <= n);
LastFrameNum = n;
return OutputFrame(DecodeFrame);
}
#endif // HAALITS

View File

@ -1,120 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef FFVIDEOSOURCE_H
#define FFVIDEOSOURCE_H
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libpostproc/postprocess.h>
}
#include <vector>
#include "indexing.h"
#include "utils.h"
#include "ffms.h"
#ifdef HAALITS
# define _WIN32_DCOM
# include <windows.h>
# include <tchar.h>
# include <atlbase.h>
# include <dshow.h>
# include "CoParser.h"
# include <initguid.h>
# include "guids.h"
#endif
class VideoBase {
private:
pp_context_t *PPContext;
pp_mode_t *PPMode;
SwsContext *SWS;
protected:
VideoProperties VP;
AVFrame *DecodeFrame;
AVFrame *PPFrame;
AVFrame *FinalFrame;
int LastFrameNum;
FrameInfoVector Frames;
int VideoTrack;
int CurrentFrame;
AVCodecContext *CodecContext;
VideoBase();
int InitPP(const char *PP, int PixelFormat, char *ErrorMsg, unsigned MsgSize);
AVFrameLite *OutputFrame(AVFrame *Frame);
public:
virtual ~VideoBase();
const VideoProperties& GetVideoProperties() { return VP; }
FrameInfoVector *GetFrameInfoVector() { return &Frames; }
virtual AVFrameLite *GetFrame(int n, char *ErrorMsg, unsigned MsgSize) = 0;
AVFrameLite *GetFrameByTime(double Time, char *ErrorMsg, unsigned MsgSize);
int SetOutputFormat(int TargetFormats, int Width, int Height, char *ErrorMsg, unsigned MsgSize);
void ResetOutputFormat();
};
class FFVideoSource : public VideoBase {
private:
AVFormatContext *FormatContext;
int SeekMode;
void Free(bool CloseCodec);
int DecodeNextFrame(AVFrame *Frame, int64_t *DTS, char *ErrorMsg, unsigned MsgSize);
public:
FFVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, const char *PP, int Threads, int SeekMode, char *ErrorMsg, unsigned MsgSize);
~FFVideoSource();
AVFrameLite *GetFrame(int n, char *ErrorMsg, unsigned MsgSize);
};
class MatroskaVideoSource : public VideoBase {
private:
MatroskaFile *MF;
MatroskaReaderContext MC;
CompressedStream *CS;
char ErrorMessage[256];
void Free(bool CloseCodec);
int DecodeNextFrame(AVFrame *AFrame, int64_t *AFirstStartTime, char *ErrorMsg, unsigned MsgSize);
public:
MatroskaVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, const char *PP, int Threads, char *ErrorMsg, unsigned MsgSize);
~MatroskaVideoSource();
AVFrameLite *GetFrame(int n, char *ErrorMsg, unsigned MsgSize);
};
#ifdef HAALITS
class HaaliTSVideoSource : public VideoBase {
private:
CComPtr<IMMContainer> pMMC;
void Free(bool CloseCodec);
int DecodeNextFrame(AVFrame *AFrame, int64_t *AFirstStartTime, char *ErrorMsg, unsigned MsgSize);
public:
HaaliTSVideoSource(const char *SourceFile, int Track, FrameIndex *TrackIndices, const char *PP, int Threads, char *ErrorMsg, unsigned MsgSize);
~HaaliTSVideoSource();
AVFrameLite *GetFrame(int n, char *ErrorMsg, unsigned MsgSize);
};
#endif // HAALITS
#endif

View File

@ -1,138 +0,0 @@
/*
* Copyright (c) 2004-2008 Mike Matsnev. All Rights Reserved.
*
* $Id: guids.h,v 1.16 2008/03/29 15:41:30 mike Exp $
*
*/
#ifndef GUIDS_H
#define GUIDS_H
// {941A4793-A705-4312-8DFC-C11CA05F397E}
DEFINE_GUID(CLSID_RealAudioDecoder,
0x941A4793, 0xA705, 0x4312, 0x8D, 0xFC, 0xC1, 0x1C, 0xA0, 0x5F, 0x39, 0x7E);
// {B8CBBAD8-AA1A-4cea-B95E-730041A55EF0}
DEFINE_GUID(MEDIASUBTYPE_WavpackHybrid,
0xb8cbbad8, 0xaa1a, 0x4cea, 0xb9, 0x5e, 0x73, 0x0, 0x41, 0xa5, 0x5e, 0xf0);
// {1541C5C0-CDDF-477d-BC0A-86F8AE7F8354}
DEFINE_GUID(MEDIASUBTYPE_FLAC_FRAMED,
0x1541c5c0, 0xcddf, 0x477d, 0xbc, 0xa, 0x86, 0xf8, 0xae, 0x7f, 0x83, 0x54);
// {8D2FD10B-5841-4a6b-8905-588FEC1ADED9}
DEFINE_GUID(MEDIASUBTYPE_Vorbis2,
0x8d2fd10b, 0x5841, 0x4a6b, 0x89, 0x5, 0x58, 0x8f, 0xec, 0x1a, 0xde, 0xd9);
// {B36E107F-A938-4387-93C7-55E966757473}
DEFINE_GUID(FORMAT_VorbisFormat2,
0xb36e107f, 0xa938, 0x4387, 0x93, 0xc7, 0x55, 0xe9, 0x66, 0x75, 0x74, 0x73);
// {E487EB08-6B26-4be9-9DD3-993434D313FD}
DEFINE_GUID(MEDIATYPE_Subtitle,
0xe487eb08, 0x6b26, 0x4be9, 0x9d, 0xd3, 0x99, 0x34, 0x34, 0xd3, 0x13, 0xfd);
// {87C0B230-03A8-4fdf-8010-B27A5848200D}
DEFINE_GUID(MEDIASUBTYPE_UTF8,
0x87c0b230, 0x3a8, 0x4fdf, 0x80, 0x10, 0xb2, 0x7a, 0x58, 0x48, 0x20, 0xd);
// {3020560F-255A-4ddc-806E-6C5CC6DCD70A}
DEFINE_GUID(MEDIASUBTYPE_SSA,
0x3020560f, 0x255a, 0x4ddc, 0x80, 0x6e, 0x6c, 0x5c, 0xc6, 0xdc, 0xd7, 0xa);
// {326444F7-686F-47ff-A4B2-C8C96307B4C2}
DEFINE_GUID(MEDIASUBTYPE_ASS,
0x326444f7, 0x686f, 0x47ff, 0xa4, 0xb2, 0xc8, 0xc9, 0x63, 0x7, 0xb4, 0xc2);
// {370689E7-B226-4f67-978D-F10BC1A9C6AE}
DEFINE_GUID(MEDIASUBTYPE_ASS2,
0x370689e7, 0xb226, 0x4f67, 0x97, 0x8d, 0xf1, 0xb, 0xc1, 0xa9, 0xc6, 0xae);
// {B753B29A-0A96-45be-985F-68351D9CAB90}
DEFINE_GUID(MEDIASUBTYPE_USF,
0xb753b29a, 0xa96, 0x45be, 0x98, 0x5f, 0x68, 0x35, 0x1d, 0x9c, 0xab, 0x90);
// {F7239E31-9599-4e43-8DD5-FBAF75CF37F1}
DEFINE_GUID(MEDIASUBTYPE_VOBSUB,
0xf7239e31, 0x9599, 0x4e43, 0x8d, 0xd5, 0xfb, 0xaf, 0x75, 0xcf, 0x37, 0xf1);
// {0B10E53F-ABF9-4581-BE9C-2C9A5EC6F2E0}
DEFINE_GUID(MEDIASUBTYPE_VOBSUB2,
0xb10e53f, 0xabf9, 0x4581, 0xbe, 0x9c, 0x2c, 0x9a, 0x5e, 0xc6, 0xf2, 0xe0);
// {5965E924-63F9-4a64-B71E-F75188FD6384}
DEFINE_GUID(MEDIASUBTYPE_DXRSub,
0x5965e924, 0x63f9, 0x4a64, 0xb7, 0x1e, 0xf7, 0x51, 0x88, 0xfd, 0x63, 0x84);
// {A33D2F7D-96BC-4337-B23B-A8B9FBC295E9}
DEFINE_GUID(FORMAT_SubtitleInfo,
0xa33d2f7d, 0x96bc, 0x4337, 0xb2, 0x3b, 0xa8, 0xb9, 0xfb, 0xc2, 0x95, 0xe9);
DEFINE_GUID(MEDIASUBTYPE_AC3,
0x00002000, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
DEFINE_GUID(MEDIASUBTYPE_EAC3,
0x0000EAC3, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
DEFINE_GUID(MEDIASUBTYPE_DTS,
0x00002001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// {B855F837-194F-4d9a-9358-E31ED6B49D03}
DEFINE_GUID(MEDIASUBTYPE_VC1,
0xb855f837, 0x194f, 0x4d9a, 0x93, 0x58, 0xe3, 0x1e, 0xd6, 0xb4, 0x9d, 0x3);
// {93A22E7A-5091-45ef-BA61-6DA26156A5D0}
DEFINE_GUID(CLSID_DirectVobSubFilter,
0x93a22e7a, 0x5091, 0x45ef, 0xba, 0x61, 0x6d, 0xa2, 0x61, 0x56, 0xa5, 0xd0);
// {9852A670-F845-491b-9BE6-EBD841B8A613}
DEFINE_GUID(CLSID_DirectVobSubFilter2,
0x9852a670, 0xf845, 0x491b, 0x9b, 0xe6, 0xeb, 0xd8, 0x41, 0xb8, 0xa6, 0x13);
// {F6D90F11-9C73-11D3-B32E-00C04F990BB4}
DEFINE_GUID(CLSID_MSXML2,
0xF6D90F11, 0x9C73, 0x11D3, 0xB3, 0x2E, 0x00, 0xC0, 0x4F, 0x99, 0x0B, 0xB4);
// {9F062738-CD84-4F54-A3C4-BD5EB44F416B}
DEFINE_GUID(CLSID_SonicAudioDec,
0x9F062738, 0xCD84, 0x4F54, 0xA3, 0xC4, 0xBD, 0x5E, 0xB4, 0x4F, 0x41, 0x6B);
// {53D9DE0B-FC61-4650-9773-74D13CC7E582}
DEFINE_GUID(CLSID_DiskFile,
0x53d9de0b, 0xfc61, 0x4650, 0x97, 0x73, 0x74, 0xd1, 0x3c, 0xc7, 0xe5, 0x82);
// {BD4FB4BE-809D-487b-ADD6-F7D164247E52}
DEFINE_GUID(CLSID_HTTPStream,
0xbd4fb4be, 0x809d, 0x487b, 0xad, 0xd6, 0xf7, 0xd1, 0x64, 0x24, 0x7e, 0x52);
// {90C7D10E-CE9A-479b-A238-1A0F2396DE43}
DEFINE_GUID(CLSID_MemAlloc,
0x90c7d10e, 0xce9a, 0x479b, 0xa2, 0x38, 0x1a, 0xf, 0x23, 0x96, 0xde, 0x43);
DEFINE_GUID(MEDIASUBTYPE_WVC1,
0x31435657, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
DEFINE_GUID(MEDIASUBTYPE_WMV3,
0x33564d57, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
// FIXME: move somewhere else?
DEFINE_GUID(Haali_TS_Parser,
0xB841F346, 0x4835, 0x4de8, 0xAA, 0x5E, 0x2E, 0x7C, 0xD2, 0xD4, 0xC4, 0x35);
typedef struct tagVORBISFORMAT2
{
DWORD Channels;
DWORD SamplesPerSec;
DWORD BitsPerSample;
DWORD HeaderSize[3]; // 0: Identification, 1: Comment, 2: Setup
} VORBISFORMAT2, *PVORBISFORMAT2, FAR *LPVORBISFORMAT2;
#pragma pack(push, 1)
typedef struct {
DWORD dwOffset;
CHAR IsoLang[4]; // three letter lang code + terminating zero
WCHAR TrackName[256]; // 256 bytes ought to be enough for everyone :)
} SUBTITLEINFO;
#pragma pack(pop)
#endif

View File

@ -1,798 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include <iostream>
#include <fstream>
#include <set>
#include <algorithm>
#include <memory>
#include <errno.h>
#include "indexing.h"
#include "wave64writer.h"
#ifdef __UNIX__
#define _fseeki64 fseeko
#define _ftelli64 ftello
#define _snprintf snprintf
#endif
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include "MatroskaParser.h"
#include "stdiostream.h"
}
#ifdef _WIN32
# define _WIN32_DCOM
# include <windows.h>
# include <tchar.h>
# include <atlbase.h>
# include <dshow.h>
# include "CoParser.h"
# include <initguid.h>
# include "guids.h"
#endif
class MatroskaAudioContext {
public:
Wave64Writer *W64W;
AVCodecContext *CTX;
CompressedStream *CS;
int64_t CurrentSample;
MatroskaAudioContext() {
W64W = NULL;
CTX = NULL;
CS = NULL;
CurrentSample = 0;
}
~MatroskaAudioContext() {
delete W64W;
if (CTX) {
avcodec_close(CTX);
av_free(CTX);
}
if (CS)
cs_Destroy(CS);
}
};
class FFAudioContext {
public:
Wave64Writer *W64W;
AVCodecContext *CTX;
int64_t CurrentSample;
FFAudioContext() {
W64W = NULL;
CTX = NULL;
CurrentSample = 0;
}
~FFAudioContext() {
delete W64W;
if (CTX)
avcodec_close(CTX);
}
};
#ifdef HAALITS
class HaaliTSIndexMemory {
private:
int16_t *DecodingBuffer;
MatroskaAudioContext *AudioContexts;
public:
HaaliTSIndexMemory(int Tracks, int16_t *&DecodingBuffer, MatroskaAudioContext *&AudioContexts) {
DecodingBuffer = new int16_t[AVCODEC_MAX_AUDIO_FRAME_SIZE*10];
AudioContexts = new MatroskaAudioContext[Tracks];
this->DecodingBuffer = DecodingBuffer;
this->AudioContexts = AudioContexts;
}
~HaaliTSIndexMemory() {
delete [] DecodingBuffer;
delete [] AudioContexts;
}
};
#endif
class MatroskaIndexMemory {
private:
int16_t *DecodingBuffer;
MatroskaAudioContext *AudioContexts;
MatroskaFile *MF;
MatroskaReaderContext *MC;
public:
MatroskaIndexMemory(int Tracks, int16_t *&DecodingBuffer, MatroskaAudioContext *&AudioContexts, MatroskaFile *MF, MatroskaReaderContext *MC) {
DecodingBuffer = new int16_t[AVCODEC_MAX_AUDIO_FRAME_SIZE*10];
AudioContexts = new MatroskaAudioContext[Tracks];
this->DecodingBuffer = DecodingBuffer;
this->AudioContexts = AudioContexts;
this->MF = MF;
this->MC = MC;
}
~MatroskaIndexMemory() {
delete [] DecodingBuffer;
delete [] AudioContexts;
mkv_Close(MF);
fclose(MC->ST.fp);
}
};
class FFIndexMemory {
private:
int16_t *DecodingBuffer;
FFAudioContext *AudioContexts;
AVFormatContext *FormatContext;
public:
FFIndexMemory(int Tracks, int16_t *&DecodingBuffer, FFAudioContext *&AudioContexts, AVFormatContext *&FormatContext) {
DecodingBuffer = new int16_t[AVCODEC_MAX_AUDIO_FRAME_SIZE*10];
AudioContexts = new FFAudioContext[Tracks];
this->DecodingBuffer = DecodingBuffer;
this->AudioContexts = AudioContexts;
this->FormatContext = FormatContext;
}
~FFIndexMemory() {
delete [] DecodingBuffer;
delete [] AudioContexts;
av_close_input_file(FormatContext);
}
};
static bool DTSComparison(FrameInfo FI1, FrameInfo FI2) {
return FI1.DTS < FI2.DTS;
}
static void SortTrackIndices(FrameIndex *TrackIndices) {
for (FrameIndex::iterator Cur=TrackIndices->begin(); Cur!=TrackIndices->end(); Cur++)
std::sort(Cur->begin(), Cur->end(), DTSComparison);
}
int WriteIndex(const char *IndexFile, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize) {
std::ofstream Index(IndexFile, std::ios::out | std::ios::binary | std::ios::trunc);
if (!Index.is_open()) {
_snprintf(ErrorMsg, MsgSize, "Failed to open '%s' for writing", IndexFile);
return 1;
}
// Write the index file header
IndexHeader IH;
IH.Id = INDEXID;
IH.Version = INDEXVERSION;
IH.Tracks = TrackIndices->size();
IH.Decoder = TrackIndices->Decoder;
Index.write(reinterpret_cast<char *>(&IH), sizeof(IH));
for (unsigned int i = 0; i < IH.Tracks; i++) {
int TT = (*TrackIndices)[i].TT;
Index.write(reinterpret_cast<char *>(&TT), sizeof(TT));
int Num = (*TrackIndices)[i].TB.Num;
Index.write(reinterpret_cast<char *>(&Num), sizeof(Num));
int Den = (*TrackIndices)[i].TB.Den;
Index.write(reinterpret_cast<char *>(&Den), sizeof(Den));
size_t Frames = (*TrackIndices)[i].size();
Index.write(reinterpret_cast<char *>(&Frames), sizeof(Frames));
for (size_t j = 0; j < Frames; j++)
Index.write(reinterpret_cast<char *>(&(TrackIndices->at(i)[j])), sizeof(FrameInfo));
}
return 0;
}
#ifdef HAALITS
static FrameIndex *MakeHaaliTSIndex(const char *SourceFile, int IndexMask, int DumpMask, const char *AudioFile, bool IgnoreDecodeErrors, IndexCallback IP, void *Private, char *ErrorMsg, unsigned MsgSize) {
::CoInitializeEx(NULL, COINIT_MULTITHREADED);
CLSID clsid = Haali_TS_Parser;
CComPtr<IMMContainer> pMMC;
if (FAILED(pMMC.CoCreateInstance(clsid))) {
_snprintf(ErrorMsg, MsgSize, "Can't create parser");
return NULL;
}
CComPtr<IMemAlloc> pMA;
if (FAILED(pMA.CoCreateInstance(CLSID_MemAlloc))) {
_snprintf(ErrorMsg, MsgSize, "Can't create memory allocator");
return NULL;
}
CComPtr<IMMStream> pMS;
if (FAILED(pMS.CoCreateInstance(CLSID_DiskFile))) {
_snprintf(ErrorMsg, MsgSize, "Can't create disk file reader");
return NULL;
}
WCHAR WSourceFile[2048];
mbstowcs(WSourceFile, SourceFile, 2000);
CComQIPtr<IMMStreamOpen> pMSO(pMS);
if (FAILED(pMSO->Open(WSourceFile))) {
_snprintf(ErrorMsg, MsgSize, "Can't open file");
return NULL;
}
if (FAILED(pMMC->Open(pMS, 0, NULL, pMA))) {
_snprintf(ErrorMsg, MsgSize, "Can't parse file");
return NULL;
}
int NumTracks = 0;
CComPtr<IEnumUnknown> pEU;
if (SUCCEEDED(pMMC->EnumTracks(&pEU))) {
CComPtr<IUnknown> pU;
while (pEU->Next(1, &pU, NULL) == S_OK) {
NumTracks++;
pU = NULL;
}
}
// Audio stuff
int16_t *db;
MatroskaAudioContext *AudioContexts;
HaaliTSIndexMemory IM = HaaliTSIndexMemory(NumTracks, db, AudioContexts);
FrameIndex *TrackIndices = new FrameIndex();
TrackIndices->Decoder = 2;
int TrackTypes[32];
int CurrentTrack = 0;
pEU = NULL;
if (SUCCEEDED(pMMC->EnumTracks(&pEU))) {
CComPtr<IUnknown> pU;
while (pEU->Next(1, &pU, NULL) == S_OK) {
CComQIPtr<IPropertyBag> pBag = pU;
BSTR CodecID = NULL;
TrackTypes[CurrentTrack] = -200;
uint8_t * CodecPrivate = NULL;
int CodecPrivateSize = 0;
if (pBag) {
VARIANT pV;
pV.vt = VT_EMPTY;
if (pBag->Read(L"CodecID", &pV, NULL) == S_OK)
CodecID = pV.bstrVal;
pV.vt = VT_EMPTY;
if (pBag->Read(L"Type", &pV, NULL) == S_OK)
TrackTypes[CurrentTrack] = pV.uintVal;
pV.vt = VT_EMPTY;
if (pBag->Read(L"CodecPrivate", &pV, NULL) == S_OK) {
CodecPrivate = (uint8_t *)pV.parray->pvData;
CodecPrivateSize = pV.parray->cbElements;
}
}
TrackIndices->push_back(FrameInfoVector(1, 1000000000, TrackTypes[CurrentTrack] - 1));
if (IndexMask & (1 << CurrentTrack) && TrackTypes[CurrentTrack] == TT_AUDIO) {
AVCodecContext *AudioCodecContext = avcodec_alloc_context();
AudioCodecContext->extradata = CodecPrivate;
AudioCodecContext->extradata_size = CodecPrivateSize;
AudioContexts[CurrentTrack].CTX = AudioCodecContext;
char ACodecID[2048];
wcstombs(ACodecID, CodecID, 2000);
AVCodec *AudioCodec = avcodec_find_decoder(MatroskaToFFCodecID(ACodecID, NULL));
if (AudioCodec == NULL) {
av_free(AudioCodecContext);
AudioContexts[CurrentTrack].CTX = NULL;
_snprintf(ErrorMsg, MsgSize, "Audio codec not found");
return NULL;
}
if (avcodec_open(AudioCodecContext, AudioCodec) < 0) {
av_free(AudioCodecContext);
AudioContexts[CurrentTrack].CTX = NULL;
_snprintf(ErrorMsg, MsgSize, "Could not open audio codec");
return NULL;
}
} else {
IndexMask &= ~(1 << CurrentTrack);
}
pU = NULL;
CurrentTrack++;
}
}
//
for (;;) {
if (IP) {
if ((*IP)(0, 0, 1, Private)) {
_snprintf(ErrorMsg, MsgSize, "Cancelled by user");
delete TrackIndices;
return NULL;
}
}
CComPtr<IMMFrame> pMMF;
if (pMMC->ReadFrame(NULL, &pMMF) != S_OK)
break;
REFERENCE_TIME Ts, Te;
HRESULT hr = pMMF->GetTime(&Ts, &Te);
unsigned int CurrentTrack = pMMF->GetTrack();
// Only create index entries for video for now to save space
if (TrackTypes[CurrentTrack] == TT_VIDEO) {
(*TrackIndices)[CurrentTrack].push_back(FrameInfo(Ts, pMMF->IsSyncPoint() == S_OK));
} else if (TrackTypes[CurrentTrack] == TT_AUDIO && (IndexMask & (1 << CurrentTrack))) {
/* (*TrackIndices)[Track].push_back(FrameInfo(AudioContexts[Track].CurrentSample, FilePos, FrameSize, (FrameFlags & FRAME_KF) != 0));
ReadFrame(FilePos, FrameSize, AudioContexts[Track].CS, MC, ErrorMsg, MsgSize);
int Size = FrameSize;
uint8_t *Data = MC.Buffer;
AVCodecContext *AudioCodecContext = AudioContexts[Track].CTX;
while (Size > 0) {
int dbsize = AVCODEC_MAX_AUDIO_FRAME_SIZE*10;
int Ret = avcodec_decode_audio2(AudioCodecContext, db, &dbsize, Data, Size);
if (Ret < 0) {
if (IgnoreDecodeErrors) {
(*TrackIndices)[Track].clear();
IndexMask &= ~(1 << Track);
break;
} else {
_snprintf(ErrorMsg, MsgSize, "Audio decoding error");
delete TrackIndices;
return NULL;
}
}
if (Ret > 0) {
Size -= Ret;
Data += Ret;
}
if (dbsize > 0)
AudioContexts[Track].CurrentSample += (dbsize * 8) / (av_get_bits_per_sample_format(AudioCodecContext->sample_fmt) * AudioCodecContext->channels);
if (dbsize > 0 && (DumpMask & (1 << Track))) {
// Delay writer creation until after an audio frame has been decoded. This ensures that all parameters are known when writing the headers.
if (!AudioContexts[Track].W64W) {
char ABuf[50];
std::string WN(AudioFile);
int Offset = StartTime * mkv_TruncFloat(mkv_GetTrackInfo(MF, Track)->TimecodeScale) / (double)1000000;
_snprintf(ABuf, sizeof(ABuf), ".%02d.delay.%d.w64", Track, Offset);
WN += ABuf;
AudioContexts[Track].W64W = new Wave64Writer(WN.c_str(), av_get_bits_per_sample_format(AudioCodecContext->sample_fmt),
AudioCodecContext->channels, AudioCodecContext->sample_rate, AudioFMTIsFloat(AudioCodecContext->sample_fmt));
}
AudioContexts[Track].W64W->WriteData(db, dbsize);
}
}
*/
}
}
SortTrackIndices(TrackIndices);
return TrackIndices;
}
#endif
static FrameIndex *MakeMatroskaIndex(const char *SourceFile, int IndexMask, int DumpMask, const char *AudioFile, bool IgnoreDecodeErrors, IndexCallback IP, void *Private, char *ErrorMsg, unsigned MsgSize) {
MatroskaFile *MF;
char ErrorMessage[256];
MatroskaReaderContext MC;
MC.Buffer = NULL;
MC.BufferSize = 0;
InitStdIoStream(&MC.ST);
MC.ST.fp = fopen(SourceFile, "rb");
if (MC.ST.fp == NULL) {
_snprintf(ErrorMsg, MsgSize, "Can't open '%s': %s", SourceFile, strerror(errno));
return NULL;
}
setvbuf(MC.ST.fp, NULL, _IOFBF, CACHESIZE);
MF = mkv_OpenEx(&MC.ST.base, 0, 0, ErrorMessage, sizeof(ErrorMessage));
if (MF == NULL) {
fclose(MC.ST.fp);
_snprintf(ErrorMsg, MsgSize, "Can't parse Matroska file: %s", ErrorMessage);
return NULL;
}
// Audio stuff
int16_t *db;
MatroskaAudioContext *AudioContexts;
MatroskaIndexMemory IM = MatroskaIndexMemory(mkv_GetNumTracks(MF), db, AudioContexts, MF, &MC);
for (unsigned int i = 0; i < mkv_GetNumTracks(MF); i++) {
TrackInfo *TI = mkv_GetTrackInfo(MF, i);
if (IndexMask & (1 << i) && TI->Type == TT_AUDIO) {
AVCodecContext *AudioCodecContext = avcodec_alloc_context();
AudioCodecContext->extradata = (uint8_t *)TI->CodecPrivate;
AudioCodecContext->extradata_size = TI->CodecPrivateSize;
AudioContexts[i].CTX = AudioCodecContext;
if (TI->CompEnabled) {
AudioContexts[i].CS = cs_Create(MF, i, ErrorMessage, sizeof(ErrorMessage));
if (AudioContexts[i].CS == NULL) {
av_free(AudioCodecContext);
AudioContexts[i].CTX = NULL;
_snprintf(ErrorMsg, MsgSize, "Can't create decompressor: %s", ErrorMessage);
return NULL;
}
}
AVCodec *AudioCodec = avcodec_find_decoder(MatroskaToFFCodecID(TI->CodecID, TI->CodecPrivate));
if (AudioCodec == NULL) {
av_free(AudioCodecContext);
AudioContexts[i].CTX = NULL;
_snprintf(ErrorMsg, MsgSize, "Audio codec not found");
return NULL;
}
if (avcodec_open(AudioCodecContext, AudioCodec) < 0) {
av_free(AudioCodecContext);
AudioContexts[i].CTX = NULL;
_snprintf(ErrorMsg, MsgSize, "Could not open audio codec");
return NULL;
}
} else {
IndexMask &= ~(1 << i);
}
}
//
int64_t CurrentPos = _ftelli64(MC.ST.fp);
_fseeki64(MC.ST.fp, 0, SEEK_END);
int64_t SourceSize = _ftelli64(MC.ST.fp);
_fseeki64(MC.ST.fp, CurrentPos, SEEK_SET);
FrameIndex *TrackIndices = new FrameIndex();
TrackIndices->Decoder = 1;
for (unsigned int i = 0; i < mkv_GetNumTracks(MF); i++)
TrackIndices->push_back(FrameInfoVector(mkv_TruncFloat(mkv_GetTrackInfo(MF, i)->TimecodeScale), 1000000, mkv_GetTrackInfo(MF, i)->Type - 1));
ulonglong StartTime, EndTime, FilePos;
unsigned int Track, FrameFlags, FrameSize;
while (mkv_ReadFrame(MF, 0, &Track, &StartTime, &EndTime, &FilePos, &FrameSize, &FrameFlags) == 0) {
// Update progress
if (IP) {
if ((*IP)(0, _ftelli64(MC.ST.fp), SourceSize, Private)) {
_snprintf(ErrorMsg, MsgSize, "Cancelled by user");
delete TrackIndices;
return NULL;
}
}
// Only create index entries for video for now to save space
if (mkv_GetTrackInfo(MF, Track)->Type == TT_VIDEO) {
(*TrackIndices)[Track].push_back(FrameInfo(StartTime, (FrameFlags & FRAME_KF) != 0));
} else if (mkv_GetTrackInfo(MF, Track)->Type == TT_AUDIO && (IndexMask & (1 << Track))) {
(*TrackIndices)[Track].push_back(FrameInfo(AudioContexts[Track].CurrentSample, FilePos, FrameSize, (FrameFlags & FRAME_KF) != 0));
ReadFrame(FilePos, FrameSize, AudioContexts[Track].CS, MC, ErrorMsg, MsgSize);
int Size = FrameSize;
uint8_t *Data = MC.Buffer;
AVCodecContext *AudioCodecContext = AudioContexts[Track].CTX;
while (Size > 0) {
int dbsize = AVCODEC_MAX_AUDIO_FRAME_SIZE*10;
int Ret = avcodec_decode_audio2(AudioCodecContext, db, &dbsize, Data, Size);
if (Ret < 0) {
if (IgnoreDecodeErrors) {
(*TrackIndices)[Track].clear();
IndexMask &= ~(1 << Track);
break;
} else {
_snprintf(ErrorMsg, MsgSize, "Audio decoding error");
delete TrackIndices;
return NULL;
}
}
if (Ret > 0) {
Size -= Ret;
Data += Ret;
}
if (dbsize > 0)
AudioContexts[Track].CurrentSample += (dbsize * 8) / (av_get_bits_per_sample_format(AudioCodecContext->sample_fmt) * AudioCodecContext->channels);
if (dbsize > 0 && (DumpMask & (1 << Track))) {
// Delay writer creation until after an audio frame has been decoded. This ensures that all parameters are known when writing the headers.
if (!AudioContexts[Track].W64W) {
char ABuf[50];
std::string WN(AudioFile);
int Offset = StartTime * mkv_TruncFloat(mkv_GetTrackInfo(MF, Track)->TimecodeScale) / (double)1000000;
_snprintf(ABuf, sizeof(ABuf), ".%02d.delay.%d.w64", Track, Offset);
WN += ABuf;
AudioContexts[Track].W64W = new Wave64Writer(WN.c_str(), av_get_bits_per_sample_format(AudioCodecContext->sample_fmt),
AudioCodecContext->channels, AudioCodecContext->sample_rate, AudioFMTIsFloat(AudioCodecContext->sample_fmt));
}
AudioContexts[Track].W64W->WriteData(db, dbsize);
}
}
}
}
SortTrackIndices(TrackIndices);
return TrackIndices;
}
FrameIndex *MakeIndex(const char *SourceFile, int IndexMask, int DumpMask, const char *AudioFile, bool IgnoreDecodeErrors, IndexCallback IP, void *Private, char *ErrorMsg, unsigned MsgSize) {
AVFormatContext *FormatContext = NULL;
IndexMask |= DumpMask;
if (av_open_input_file(&FormatContext, SourceFile, NULL, 0, NULL) != 0) {
_snprintf(ErrorMsg, MsgSize, "Can't open '%s'", SourceFile);
return NULL;
}
// Do matroska indexing instead?
if (!strcmp(FormatContext->iformat->name, "matroska")) {
av_close_input_file(FormatContext);
return MakeMatroskaIndex(SourceFile, IndexMask, DumpMask, AudioFile, IgnoreDecodeErrors, IP, Private, ErrorMsg, MsgSize);
}
#ifdef HAALITS
// Do haali ts indexing instead?
if (!strcmp(FormatContext->iformat->name, "mpegts")) {
av_close_input_file(FormatContext);
return MakeHaaliTSIndex(SourceFile, IndexMask, DumpMask, AudioFile, IgnoreDecodeErrors, IP, Private, ErrorMsg, MsgSize);
}
#endif
if (av_find_stream_info(FormatContext) < 0) {
av_close_input_file(FormatContext);
_snprintf(ErrorMsg, MsgSize, "Couldn't find stream information");
return NULL;
}
// Audio stuff
int16_t *db;
FFAudioContext *AudioContexts;
FFIndexMemory IM = FFIndexMemory(FormatContext->nb_streams, db, AudioContexts, FormatContext);
for (unsigned int i = 0; i < FormatContext->nb_streams; i++) {
if (IndexMask & (1 << i) && FormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {
AVCodecContext *AudioCodecContext = FormatContext->streams[i]->codec;
AVCodec *AudioCodec = avcodec_find_decoder(AudioCodecContext->codec_id);
if (AudioCodec == NULL) {
_snprintf(ErrorMsg, MsgSize, "Audio codec not found");
return NULL;
}
if (avcodec_open(AudioCodecContext, AudioCodec) < 0) {
_snprintf(ErrorMsg, MsgSize, "Could not open audio codec");
return NULL;
}
AudioContexts[i].CTX = AudioCodecContext;
} else {
IndexMask &= ~(1 << i);
}
}
//
FrameIndex *TrackIndices = new FrameIndex();
TrackIndices->Decoder = 0;
for (unsigned int i = 0; i < FormatContext->nb_streams; i++)
TrackIndices->push_back(FrameInfoVector(FormatContext->streams[i]->time_base.num * 1000,
FormatContext->streams[i]->time_base.den,
FormatContext->streams[i]->codec->codec_type));
AVPacket Packet;
while (av_read_frame(FormatContext, &Packet) >= 0) {
// Update progress
if (IP) {
if ((*IP)(0, FormatContext->pb->pos, FormatContext->file_size, Private)) {
_snprintf(ErrorMsg, MsgSize, "Cancelled by user");
delete TrackIndices;
return NULL;
}
}
// Only create index entries for video for now to save space
if (FormatContext->streams[Packet.stream_index]->codec->codec_type == CODEC_TYPE_VIDEO) {
(*TrackIndices)[Packet.stream_index].push_back(FrameInfo(Packet.dts, (Packet.flags & PKT_FLAG_KEY) ? 1 : 0));
} else if (FormatContext->streams[Packet.stream_index]->codec->codec_type == CODEC_TYPE_AUDIO && (IndexMask & (1 << Packet.stream_index))) {
(*TrackIndices)[Packet.stream_index].push_back(FrameInfo(Packet.dts, AudioContexts[Packet.stream_index].CurrentSample, (Packet.flags & PKT_FLAG_KEY) ? 1 : 0));
AVCodecContext *AudioCodecContext = FormatContext->streams[Packet.stream_index]->codec;
int Size = Packet.size;
uint8_t *Data = Packet.data;
while (Size > 0) {
int dbsize = AVCODEC_MAX_AUDIO_FRAME_SIZE*10;
int Ret = avcodec_decode_audio2(AudioCodecContext, db, &dbsize, Data, Size);
if (Ret < 0) {
if (IgnoreDecodeErrors) {
(*TrackIndices)[Packet.stream_index].clear();
IndexMask &= ~(1 << Packet.stream_index);
break;
} else {
_snprintf(ErrorMsg, MsgSize, "Audio decoding error");
delete TrackIndices;
return NULL;
}
}
if (Ret > 0) {
Size -= Ret;
Data += Ret;
}
if (dbsize > 0)
AudioContexts[Packet.stream_index].CurrentSample += (dbsize * 8) / (av_get_bits_per_sample_format(AudioCodecContext->sample_fmt) * AudioCodecContext->channels);
if (dbsize > 0 && (DumpMask & (1 << Packet.stream_index))) {
// Delay writer creation until after an audio frame has been decoded. This ensures that all parameters are known when writing the headers.
if (!AudioContexts[Packet.stream_index].W64W) {
char ABuf[50];
std::string WN(AudioFile);
int Offset = (Packet.dts * FormatContext->streams[Packet.stream_index]->time_base.num)
/ (double)(FormatContext->streams[Packet.stream_index]->time_base.den * 1000);
_snprintf(ABuf, sizeof(ABuf), ".%02d.delay.%d.w64", Packet.stream_index, Offset);
WN += ABuf;
AudioContexts[Packet.stream_index].W64W = new Wave64Writer(WN.c_str(), av_get_bits_per_sample_format(AudioCodecContext->sample_fmt),
AudioCodecContext->channels, AudioCodecContext->sample_rate, AudioFMTIsFloat(AudioCodecContext->sample_fmt));
}
AudioContexts[Packet.stream_index].W64W->WriteData(db, dbsize);
}
}
}
av_free_packet(&Packet);
}
SortTrackIndices(TrackIndices);
return TrackIndices;
}
FrameIndex *ReadIndex(const char *IndexFile, char *ErrorMsg, unsigned MsgSize) {
std::ifstream Index(IndexFile, std::ios::in | std::ios::binary);
if (!Index.is_open()) {
_snprintf(ErrorMsg, MsgSize, "Failed to open '%s' for reading", IndexFile);
return NULL;
}
// Read the index file header
IndexHeader IH;
Index.read(reinterpret_cast<char *>(&IH), sizeof(IH));
if (IH.Id != INDEXID) {
_snprintf(ErrorMsg, MsgSize, "'%s' is not a valid index file", IndexFile);
return NULL;
}
if (IH.Version != INDEXVERSION) {
_snprintf(ErrorMsg, MsgSize, "'%s' is not the expected index version", IndexFile);
return NULL;
}
FrameIndex *TrackIndices = new FrameIndex();
try {
TrackIndices->Decoder = IH.Decoder;
for (unsigned int i = 0; i < IH.Tracks; i++) {
// Read how many records belong to the current stream
int TT;
Index.read(reinterpret_cast<char *>(&TT), sizeof(TT));
int Num;
Index.read(reinterpret_cast<char *>(&Num), sizeof(Num));
int Den;
Index.read(reinterpret_cast<char *>(&Den), sizeof(Den));
size_t Frames;
Index.read(reinterpret_cast<char *>(&Frames), sizeof(Frames));
TrackIndices->push_back(FrameInfoVector(Num, Den, TT));
FrameInfo FI(0, false);
for (size_t j = 0; j < Frames; j++) {
Index.read(reinterpret_cast<char *>(&FI), sizeof(FrameInfo));
TrackIndices->at(i).push_back(FI);
}
}
} catch (...) {
delete TrackIndices;
_snprintf(ErrorMsg, MsgSize, "Unknown error while reading index information in '%s'", IndexFile);
return NULL;
}
return TrackIndices;
}
int FrameInfoVector::WriteTimecodes(const char *TimecodeFile, char *ErrorMsg, unsigned MsgSize) {
std::ofstream Timecodes(TimecodeFile, std::ios::out | std::ios::trunc);
if (!Timecodes.is_open()) {
_snprintf(ErrorMsg, MsgSize, "Failed to open '%s' for writing", TimecodeFile);
return 1;
}
Timecodes << "# timecode format v2\n";
for (iterator Cur=begin(); Cur!=end(); Cur++)
Timecodes << (int64_t)((Cur->DTS * TB.Num) / (double)TB.Den) << "\n";
return 0;
}
int FrameInfoVector::FrameFromDTS(int64_t DTS) {
for (int i = 0; i < static_cast<int>(size()); i++)
if (at(i).DTS == DTS)
return i;
return -1;
}
int FrameInfoVector::ClosestFrameFromDTS(int64_t DTS) {
int Frame = 0;
int64_t BestDiff = 0xFFFFFFFFFFFFFFLL; // big number
for (int i = 0; i < static_cast<int>(size()); i++) {
int64_t CurrentDiff = FFABS(at(i).DTS - DTS);
if (CurrentDiff < BestDiff) {
BestDiff = CurrentDiff;
Frame = i;
}
}
//int64_t tmp = at(2).DTS - at(1).DTS;
//ATLASSERT(BestDiff == 0);
return Frame;
}
int FrameInfoVector::FindClosestKeyFrame(int Frame) {
Frame = FFMIN(FFMAX(Frame, 0), size() - 1);
for (int i = Frame; i > 0; i--)
if (at(i).KeyFrame)
return i;
return 0;
}
FrameInfoVector::FrameInfoVector() {
this->TT = 0;
this->TB.Num = 0;
this->TB.Den = 0;
}
FrameInfoVector::FrameInfoVector(int Num, int Den, int TT) {
this->TT = TT;
this->TB.Num = Num;
this->TB.Den = Den;
}

View File

@ -1,61 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef INDEXING_H
#define INDEXING_H
#include <vector>
#include "utils.h"
#include "ffms.h"
#define INDEXVERSION 11
#define INDEXID 0x53920873
struct IndexHeader {
uint32_t Id;
uint32_t Version;
uint32_t Tracks;
uint32_t Decoder;
};
class FrameInfoVector : public std::vector<FrameInfo> {
public:
int TT;
TrackTimeBase TB;
int FindClosestKeyFrame(int Frame);
int FrameFromDTS(int64_t DTS);
int ClosestFrameFromDTS(int64_t DTS);
int WriteTimecodes(const char *TimecodeFile, char *ErrorMsg, unsigned MsgSize);
FrameInfoVector();
FrameInfoVector(int Num, int Den, int TT);
};
class FrameIndex : public std::vector<FrameInfoVector> {
public:
int Decoder;
};
FrameIndex *MakeIndex(const char *SourceFile, int IndexMask, int DumpMask, const char *AudioFile, bool IgnoreDecodeErrors, IndexCallback IP, void *Private, char *ErrorMsg, unsigned MsgSize);
FrameIndex *ReadIndex(const char *IndexFile, char *ErrorMsg, unsigned MsgSize);
int WriteIndex(const char *IndexFile, FrameIndex *TrackIndices, char *ErrorMsg, unsigned MsgSize);
#endif

View File

@ -1,111 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "stdiostream.h"
#include <errno.h>
#ifdef __UNIX__
#define _fseeki64 fseeko
#define _ftelli64 ftello
#endif
/* StdIoStream methods */
/* read count bytes into buffer starting at file position pos
* return the number of bytes read, -1 on error or 0 on EOF
*/
int StdIoRead(StdIoStream *st, ulonglong pos, void *buffer, int count) {
size_t rd;
if (_fseeki64(st->fp, pos, SEEK_SET)) {
st->error = errno;
return -1;
}
rd = fread(buffer, 1, count, st->fp);
if (rd == 0) {
if (feof(st->fp))
return 0;
st->error = errno;
return -1;
}
return rd;
}
/* scan for a signature sig(big-endian) starting at file position pos
* return position of the first byte of signature or -1 if error/not found
*/
longlong StdIoScan(StdIoStream *st, ulonglong start, unsigned signature) {
int c;
unsigned cmp = 0;
FILE *fp = st->fp;
if (_fseeki64(fp, start, SEEK_SET))
return -1;
while ((c = getc(fp)) != EOF) {
cmp = ((cmp << 8) | c) & 0xffffffff;
if (cmp == signature)
return _ftelli64(fp) - 4;
}
return -1;
}
/* return cache size, this is used to limit readahead */
unsigned StdIoGetCacheSize(StdIoStream *st) {
return CACHESIZE;
}
/* return last error message */
const char *StdIoGetLastError(StdIoStream *st) {
return strerror(st->error);
}
/* memory allocation, this is done via stdlib */
void *StdIoMalloc(StdIoStream *st, size_t size) {
return malloc(size);
}
void *StdIoRealloc(StdIoStream *st, void *mem, size_t size) {
return realloc(mem,size);
}
void StdIoFree(StdIoStream *st, void *mem) {
free(mem);
}
/* progress report handler for lengthy operations
* returns 0 to abort operation, nonzero to continue
*/
int StdIoProgress(StdIoStream *st, ulonglong cur, ulonglong max) {
return 1;
}
void InitStdIoStream(StdIoStream *st) {
memset(st,0,sizeof(st));
st->base.read = StdIoRead;
st->base.scan = StdIoScan;
st->base.getcachesize = StdIoGetCacheSize;
st->base.geterror = StdIoGetLastError;
st->base.memalloc = StdIoMalloc;
st->base.memrealloc = StdIoRealloc;
st->base.memfree = StdIoFree;
st->base.progress = StdIoProgress;
}

View File

@ -1,80 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef STDIOSTREAM_H
#define STDIOSTREAM_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "MatroskaParser.h"
#define CACHESIZE 65536
/************\
* Structures *
\************/
/* first we need to create an I/O object that the parser will use to read the
* source file
*/
struct StdIoStream {
struct InputStream base;
FILE *fp;
int error;
};
typedef struct StdIoStream StdIoStream;
/***********\
* Functions *
\***********/
/* read count bytes into buffer starting at file position pos
* return the number of bytes read, -1 on error or 0 on EOF
*/
int StdIoRead(StdIoStream *st, ulonglong pos, void *buffer, int count);
/* scan for a signature sig(big-endian) starting at file position pos
* return position of the first byte of signature or -1 if error/not found
*/
longlong StdIoScan(StdIoStream *st, ulonglong start, unsigned signature);
/* return cache size, this is used to limit readahead */
unsigned StdIoGetCacheSize(StdIoStream *st);
/* return last error message */
const char *StdIoGetLastError(StdIoStream *st);
/* memory allocation, this is done via stdlib */
void *StdIoMalloc(StdIoStream *st, size_t size);
void *StdIoRealloc(StdIoStream *st, void *mem, size_t size);
void StdIoFree(StdIoStream *st, void *mem);
/* progress report handler for lengthy operations
* returns 0 to abort operation, nonzero to continue
*/
int StdIoProgress(StdIoStream *st, ulonglong cur, ulonglong max);
void InitStdIoStream(StdIoStream *st);
#endif /* #ifndef STDIOSTREAM_H */

View File

@ -1,444 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "utils.h"
#include <string.h>
#include <errno.h>
#ifdef _MSC_VER
# include <intrin.h>
#endif
#ifdef __UNIX__
#define _fseeki64 fseeko
#define _ftelli64 ftello
#define _snprintf snprintf
#endif
int GetCPUFlags() {
// FIXME Add proper feature detection when msvc isn't used
int Flags = PP_CPU_CAPS_MMX | PP_CPU_CAPS_MMX2;
#ifdef _MSC_VER
Flags = 0;
int CPUInfo[4];
__cpuid(CPUInfo, 0);
// PP and SWS defines have the same values for their defines so this actually works
if (CPUInfo[3] & (1 << 23))
Flags |= PP_CPU_CAPS_MMX;
if (CPUInfo[3] & (1 << 25))
Flags |= PP_CPU_CAPS_MMX2;
#endif
return Flags;
}
int ReadFrame(uint64_t FilePos, unsigned int &FrameSize, CompressedStream *CS, MatroskaReaderContext &Context, char *ErrorMsg, unsigned MsgSize) {
if (CS) {
char CSBuffer[4096];
unsigned int DecompressedFrameSize = 0;
cs_NextFrame(CS, FilePos, FrameSize);
for (;;) {
int ReadBytes = cs_ReadData(CS, CSBuffer, sizeof(CSBuffer));
if (ReadBytes < 0) {
_snprintf(ErrorMsg, MsgSize, "Error decompressing data: %s", cs_GetLastError(CS));
return 1;
}
if (ReadBytes == 0) {
FrameSize = DecompressedFrameSize;
return 0;
}
if (Context.BufferSize < DecompressedFrameSize + ReadBytes) {
Context.BufferSize = FrameSize;
Context.Buffer = (uint8_t *)realloc(Context.Buffer, Context.BufferSize + 16);
if (Context.Buffer == NULL) {
_snprintf(ErrorMsg, MsgSize, "Out of memory");
return 2;
}
}
memcpy(Context.Buffer + DecompressedFrameSize, CSBuffer, ReadBytes);
DecompressedFrameSize += ReadBytes;
}
} else {
if (_fseeki64(Context.ST.fp, FilePos, SEEK_SET)) {
_snprintf(ErrorMsg, MsgSize, "fseek(): %s", strerror(errno));
return 3;
}
if (Context.BufferSize < FrameSize) {
Context.BufferSize = FrameSize;
Context.Buffer = (uint8_t *)realloc(Context.Buffer, Context.BufferSize + 16);
if (Context.Buffer == NULL) {
_snprintf(ErrorMsg, MsgSize, "Out of memory");
return 4;
}
}
size_t ReadBytes = fread(Context.Buffer, 1, FrameSize, Context.ST.fp);
if (ReadBytes != FrameSize) {
if (ReadBytes == 0) {
if (feof(Context.ST.fp)) {
_snprintf(ErrorMsg, MsgSize, "Unexpected EOF while reading frame");
return 5;
} else {
_snprintf(ErrorMsg, MsgSize, "Error reading frame: %s", strerror(errno));
return 6;
}
} else {
_snprintf(ErrorMsg, MsgSize, "Short read while reading frame");
return 7;
}
_snprintf(ErrorMsg, MsgSize, "Unknown read error");
return 8;
}
return 0;
}
FrameSize = 0;
return 0;
}
bool AudioFMTIsFloat(SampleFormat FMT){
switch (FMT) {
case SAMPLE_FMT_FLT:
case SAMPLE_FMT_DBL:
return true;
default:
return false;
}
}
// used for matroska<->ffmpeg codec ID mapping to avoid Win32 dependency
typedef struct BITMAPINFOHEADER {
uint32_t biSize;
int32_t biWidth;
int32_t biHeight;
uint16_t biPlanes;
uint16_t biBitCount;
uint32_t biCompression;
uint32_t biSizeImage;
int32_t biXPelsPerMeter;
int32_t biYPelsPerMeter;
uint32_t biClrUsed;
uint32_t biClrImportant;
} BITMAPINFOHEADER;
#define MAKEFOURCC(ch0, ch1, ch2, ch3)\
((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8) |\
((uint32_t)(uint8_t)(ch2) << 16) | ((uint32_t)(uint8_t)(ch3) << 24 ))
CodecID MatroskaToFFCodecID(char *Codec, void *CodecPrivate) {
/* Video Codecs */
if (!strcmp(Codec, "V_MS/VFW/FOURCC")) {
// fourcc list from ffdshow
switch (((BITMAPINFOHEADER *)CodecPrivate)->biCompression) {
case MAKEFOURCC('F', 'F', 'D', 'S'):
case MAKEFOURCC('F', 'V', 'F', 'W'):
case MAKEFOURCC('X', 'V', 'I', 'D'):
case MAKEFOURCC('D', 'I', 'V', 'X'):
case MAKEFOURCC('D', 'X', '5', '0'):
case MAKEFOURCC('M', 'P', '4', 'V'):
case MAKEFOURCC('m', 'p', '4', 'v'): // This one may be my fault
case MAKEFOURCC('3', 'I', 'V', 'X'):
case MAKEFOURCC('W', 'V', '1', 'F'):
case MAKEFOURCC('F', 'M', 'P', '4'):
case MAKEFOURCC('S', 'M', 'P', '4'):
return CODEC_ID_MPEG4;
case MAKEFOURCC('D', 'I', 'V', '3'):
case MAKEFOURCC('D', 'V', 'X', '3'):
case MAKEFOURCC('M', 'P', '4', '3'):
return CODEC_ID_MSMPEG4V3;
case MAKEFOURCC('M', 'P', '4', '2'):
return CODEC_ID_MSMPEG4V2;
case MAKEFOURCC('M', 'P', '4', '1'):
return CODEC_ID_MSMPEG4V1;
case MAKEFOURCC('W', 'M', 'V', '1'):
return CODEC_ID_WMV1;
case MAKEFOURCC('W', 'M', 'V', '2'):
return CODEC_ID_WMV2;
case MAKEFOURCC('W', 'M', 'V', '3'):
return CODEC_ID_WMV3;
/*
case MAKEFOURCC('M', 'S', 'S', '1'):
case MAKEFOURCC('M', 'S', 'S', '2'):
case MAKEFOURCC('W', 'V', 'P', '2'):
case MAKEFOURCC('W', 'M', 'V', 'P'):
return CODEC_ID_WMV9_LIB;
*/
case MAKEFOURCC('W', 'V', 'C', '1'):
return CODEC_ID_VC1;
case MAKEFOURCC('V', 'P', '5', '0'):
return CODEC_ID_VP5;
case MAKEFOURCC('V', 'P', '6', '0'):
case MAKEFOURCC('V', 'P', '6', '1'):
case MAKEFOURCC('V', 'P', '6', '2'):
return CODEC_ID_VP6;
case MAKEFOURCC('V', 'P', '6', 'F'):
case MAKEFOURCC('F', 'L', 'V', '4'):
return CODEC_ID_VP6F;
case MAKEFOURCC('C', 'A', 'V', 'S'):
return CODEC_ID_CAVS;
case MAKEFOURCC('M', 'P', 'G', '1'):
case MAKEFOURCC('M', 'P', 'E', 'G'):
return CODEC_ID_MPEG2VIDEO; // not a typo
case MAKEFOURCC('M', 'P', 'G', '2'):
case MAKEFOURCC('E', 'M', '2', 'V'):
case MAKEFOURCC('M', 'M', 'E', 'S'):
return CODEC_ID_MPEG2VIDEO;
case MAKEFOURCC('H', '2', '6', '3'):
case MAKEFOURCC('S', '2', '6', '3'):
case MAKEFOURCC('L', '2', '6', '3'):
case MAKEFOURCC('M', '2', '6', '3'):
case MAKEFOURCC('U', '2', '6', '3'):
case MAKEFOURCC('X', '2', '6', '3'):
return CODEC_ID_H263;
case MAKEFOURCC('H', '2', '6', '4'):
case MAKEFOURCC('X', '2', '6', '4'):
case MAKEFOURCC('V', 'S', 'S', 'H'):
case MAKEFOURCC('D', 'A', 'V', 'C'):
case MAKEFOURCC('P', 'A', 'V', 'C'):
case MAKEFOURCC('A', 'V', 'C', '1'):
return CODEC_ID_H264;
case MAKEFOURCC('M', 'J', 'P', 'G'):
case MAKEFOURCC('L', 'J', 'P', 'G'):
case MAKEFOURCC('M', 'J', 'L', 'S'):
case MAKEFOURCC('J', 'P', 'E', 'G'): // questionable fourcc?
case MAKEFOURCC('A', 'V', 'R', 'N'):
case MAKEFOURCC('M', 'J', 'P', 'A'):
return CODEC_ID_MJPEG;
case MAKEFOURCC('D', 'V', 'S', 'D'):
case MAKEFOURCC('D', 'V', '2', '5'):
case MAKEFOURCC('D', 'V', '5', '0'):
case MAKEFOURCC('C', 'D', 'V', 'C'):
case MAKEFOURCC('C', 'D', 'V', '5'):
case MAKEFOURCC('D', 'V', 'I', 'S'):
case MAKEFOURCC('P', 'D', 'V', 'C'):
return CODEC_ID_DVVIDEO;
case MAKEFOURCC('H', 'F', 'Y', 'U'):
return CODEC_ID_HUFFYUV;
case MAKEFOURCC('F', 'F', 'V', 'H'):
return CODEC_ID_FFVHUFF;
case MAKEFOURCC('C', 'Y', 'U', 'V'):
return CODEC_ID_CYUV;
case MAKEFOURCC('A', 'S', 'V', '1'):
return CODEC_ID_ASV1;
case MAKEFOURCC('A', 'S', 'V', '2'):
return CODEC_ID_ASV2;
case MAKEFOURCC('V', 'C', 'R', '1'):
return CODEC_ID_VCR1;
case MAKEFOURCC('T', 'H', 'E', 'O'):
return CODEC_ID_THEORA;
case MAKEFOURCC('S', 'V', 'Q', '1'):
return CODEC_ID_SVQ1;
case MAKEFOURCC('S', 'V', 'Q', '3'):
return CODEC_ID_SVQ3;
case MAKEFOURCC('R', 'P', 'Z', 'A'):
return CODEC_ID_RPZA;
case MAKEFOURCC('F', 'F', 'V', '1'):
return CODEC_ID_FFV1;
case MAKEFOURCC('V', 'P', '3', '1'):
return CODEC_ID_VP3;
case MAKEFOURCC('R', 'L', 'E', '8'):
return CODEC_ID_MSRLE;
case MAKEFOURCC('M', 'S', 'Z', 'H'):
return CODEC_ID_MSZH;
case MAKEFOURCC('Z', 'L', 'I', 'B'):
return CODEC_ID_ZLIB;
case MAKEFOURCC('F', 'L', 'V', '1'):
return CODEC_ID_FLV1;
/*
case MAKEFOURCC('P', 'N', 'G', '1'):
return CODEC_ID_COREPNG;
*/
case MAKEFOURCC('M', 'P', 'N', 'G'):
return CODEC_ID_PNG;
/*
case MAKEFOURCC('A', 'V', 'I', 'S'):
return CODEC_ID_AVISYNTH;
*/
case MAKEFOURCC('C', 'R', 'A', 'M'):
return CODEC_ID_MSVIDEO1;
case MAKEFOURCC('R', 'T', '2', '1'):
return CODEC_ID_INDEO2;
case MAKEFOURCC('I', 'V', '3', '2'):
case MAKEFOURCC('I', 'V', '3', '1'):
return CODEC_ID_INDEO3;
case MAKEFOURCC('C', 'V', 'I', 'D'):
return CODEC_ID_CINEPAK;
case MAKEFOURCC('R', 'V', '1', '0'):
return CODEC_ID_RV10;
case MAKEFOURCC('R', 'V', '2', '0'):
return CODEC_ID_RV20;
case MAKEFOURCC('8', 'B', 'P', 'S'):
return CODEC_ID_8BPS;
case MAKEFOURCC('Q', 'R', 'L', 'E'):
return CODEC_ID_QTRLE;
case MAKEFOURCC('D', 'U', 'C', 'K'):
return CODEC_ID_TRUEMOTION1;
case MAKEFOURCC('T', 'M', '2', '0'):
return CODEC_ID_TRUEMOTION2;
case MAKEFOURCC('T', 'S', 'C', 'C'):
return CODEC_ID_TSCC;
case MAKEFOURCC('S', 'N', 'O', 'W'):
return CODEC_ID_SNOW;
case MAKEFOURCC('Q', 'P', 'E', 'G'):
case MAKEFOURCC('Q', '1', '_', '0'):
case MAKEFOURCC('Q', '1', '_', '1'):
return CODEC_ID_QPEG;
case MAKEFOURCC('H', '2', '6', '1'):
case MAKEFOURCC('M', '2', '6', '1'):
return CODEC_ID_H261;
case MAKEFOURCC('L', 'O', 'C', 'O'):
return CODEC_ID_LOCO;
case MAKEFOURCC('W', 'N', 'V', '1'):
return CODEC_ID_WNV1;
case MAKEFOURCC('C', 'S', 'C', 'D'):
return CODEC_ID_CSCD;
case MAKEFOURCC('Z', 'M', 'B', 'V'):
return CODEC_ID_ZMBV;
case MAKEFOURCC('U', 'L', 'T', 'I'):
return CODEC_ID_ULTI;
case MAKEFOURCC('V', 'I', 'X', 'L'):
return CODEC_ID_VIXL;
case MAKEFOURCC('A', 'A', 'S', 'C'):
return CODEC_ID_AASC;
case MAKEFOURCC('F', 'P', 'S', '1'):
return CODEC_ID_FRAPS;
default:
return CODEC_ID_NONE;
}
} else if (!strcmp(Codec, "V_MPEG4/ISO/AVC"))
return CODEC_ID_H264;
else if (!strcmp(Codec, "V_MPEG4/ISO/AP"))
return CODEC_ID_MPEG4;
else if (!strcmp(Codec, "V_MPEG4/ISO/ASP"))
return CODEC_ID_MPEG4;
else if (!strcmp(Codec, "V_MPEG4/ISO/SP"))
return CODEC_ID_MPEG4;
else if (!strcmp(Codec, "V_MPEG4/MS/V3"))
return CODEC_ID_MSMPEG4V3;
else if (!strcmp(Codec, "V_MPEG2"))
return CODEC_ID_MPEG2VIDEO;
else if (!strcmp(Codec, "V_MPEG1"))
return CODEC_ID_MPEG2VIDEO; // still not a typo
else if (!strcmp(Codec, "V_VC1"))
return CODEC_ID_VC1;
else if (!strcmp(Codec, "V_SNOW"))
return CODEC_ID_SNOW;
else if (!strcmp(Codec, "V_THEORA"))
return CODEC_ID_THEORA;
else if (!strcmp(Codec, "V_UNCOMPRESSED"))
return CODEC_ID_NONE; // bleh
else if (!strcmp(Codec, "V_QUICKTIME"))
return CODEC_ID_SVQ3; // no idea if this is right
else if (!strcmp(Codec, "V_CIPC"))
return CODEC_ID_NONE; // don't know, don't care
else if (!strncmp(Codec, "V_REAL/RV", 9)) {
switch (Codec[9]) {
case '1':
return CODEC_ID_RV10;
case '2':
return CODEC_ID_RV20;
case '3':
return CODEC_ID_RV30;
case '4':
return CODEC_ID_RV40;
default:
return CODEC_ID_NONE;
}
/* Audio Codecs */
} else if (!strcmp(Codec, "A_AC3"))
return CODEC_ID_AC3;
else if (!strcmp(Codec, "A_EAC3"))
return CODEC_ID_AC3;
else if (!strcmp(Codec, "A_MPEG/L3"))
return CODEC_ID_MP3;
else if (!strcmp(Codec, "A_MPEG/L2"))
return CODEC_ID_MP2;
else if (!strcmp(Codec, "A_MPEG/L1"))
return CODEC_ID_MP2; // correct?
else if (!strcmp(Codec, "A_DTS"))
return CODEC_ID_DTS;
else if (!strcmp(Codec, "A_PCM/INT/LIT")) {
/* FIXME
switch (TI->AV.Audio.BitDepth) {
case 8: return CODEC_ID_PCM_S8;
case 16: return CODEC_ID_PCM_S16LE;
case 24: return CODEC_ID_PCM_S24LE;
case 32: return CODEC_ID_PCM_S32LE;
default: return CODEC_ID_NONE;
}
*/
return CODEC_ID_NONE;
} else if (!strcmp(Codec, "A_PCM/INT/BIG")) {
/* FIXME
switch (TI->AV.Audio.BitDepth) {
case 8: return CODEC_ID_PCM_S8;
case 16: return CODEC_ID_PCM_S16BE;
case 24: return CODEC_ID_PCM_S24BE;
case 32: return CODEC_ID_PCM_S32BE;
default: return CODEC_ID_NONE;
}
*/
return CODEC_ID_NONE;
} else if (!strcmp(Codec, "A_PCM/FLOAT/IEEE"))
return CODEC_ID_PCM_F32LE; // only a most likely guess, may do bad things
else if (!strcmp(Codec, "A_FLAC"))
return CODEC_ID_FLAC;
else if (!strcmp(Codec, "A_MPC"))
return CODEC_ID_MUSEPACK8; // or is it CODEC_ID_MUSEPACK7? both?
else if (!strcmp(Codec, "A_TTA1"))
return CODEC_ID_TTA;
else if (!strcmp(Codec, "A_WAVPACK4"))
return CODEC_ID_WAVPACK;
else if (!strcmp(Codec, "A_VORBIS"))
return CODEC_ID_VORBIS;
else if (!strcmp(Codec, "A_REAL/14_4"))
return CODEC_ID_RA_144;
else if (!strcmp(Codec, "A_REAL/28_8"))
return CODEC_ID_RA_288;
else if (!strcmp(Codec, "A_REAL/COOK"))
return CODEC_ID_COOK;
else if (!strcmp(Codec, "A_REAL/SIPR"))
return CODEC_ID_NONE; // no sipr codec id?
else if (!strcmp(Codec, "A_REAL/ATRC"))
return CODEC_ID_ATRAC3;
else if (!strncmp(Codec, "A_AAC", 5))
return CODEC_ID_AAC;
else if (!strcmp(Codec, "A_SPEEX"))
return CODEC_ID_SPEEX;
else if (!strcmp(Codec, "A_QUICKTIME"))
return CODEC_ID_NONE; // no
else if (!strcmp(Codec, "A_MS/ACM")) {
// nothing useful here anyway?
//#include "Mmreg.h"
//((WAVEFORMATEX *)TI->CodecPrivate)->wFormatTag
return CODEC_ID_NONE;
} else {
return CODEC_ID_NONE;
}
}

View File

@ -1,56 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef UTILS_H
#define UTILS_H
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libpostproc/postprocess.h>
#include <libavutil/sha1.h>
#include "MatroskaParser.h"
#include "stdiostream.h"
}
struct MatroskaReaderContext {
public:
StdIoStream ST;
uint8_t *Buffer;
unsigned int BufferSize;
MatroskaReaderContext() {
InitStdIoStream(&ST);
Buffer = NULL;
BufferSize = 0;
}
~MatroskaReaderContext() {
free(Buffer);
}
};
int GetCPUFlags();
int ReadFrame(uint64_t FilePos, unsigned int &FrameSize, CompressedStream *CS, MatroskaReaderContext &Context, char *ErrorMsg, unsigned MsgSize);
bool AudioFMTIsFloat(SampleFormat FMT);
CodecID MatroskaToFFCodecID(char *Codec, void *CodecPrivate);
#endif

View File

@ -1,112 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "wave64writer.h"
#include <string.h>
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
#define WAVE_FORMAT_PCM 1
static const uint8_t GuidRIFF[16]={
// {66666972-912E-11CF-A5D6-28DB04C10000}
0x72, 0x69, 0x66, 0x66, 0x2E, 0x91, 0xCF, 0x11, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
};
static const uint8_t GuidWAVE[16]={
// {65766177-ACF3-11D3-8CD1-00C04F8EDB8A}
0x77, 0x61, 0x76, 0x65, 0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A
};
static const uint8_t Guidfmt[16]={
// {20746D66-ACF3-11D3-8CD1-00C04F8EDB8A}
0x66, 0x6D, 0x74, 0x20, 0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A
};
static const uint8_t Guiddata[16]={
// {61746164-ACF3-11D3-8CD1-00C04F8EDB8A}
0x64, 0x61, 0x74, 0x61, 0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A
};
Wave64Writer::Wave64Writer(const char *Filename, uint16_t BitsPerSample, uint16_t Channels, uint32_t SamplesPerSec, bool IsFloat) : std::ofstream(Filename, std::ios::out | std::ios::binary | std::ios::trunc) {
BytesWritten = 0;
this->BitsPerSample = BitsPerSample;
this->Channels = Channels;
this->SamplesPerSec = SamplesPerSec;
this->IsFloat = IsFloat;
if (!is_open())
throw "Failed to open destination file for writing";
WriteHeader(true, IsFloat);
}
Wave64Writer::~Wave64Writer() {
WriteHeader(false, IsFloat);
close();
}
void Wave64Writer::WriteHeader(bool Initial, bool IsFloat) {
FFMS_WAVEFORMATEX WFEX;
if (IsFloat)
WFEX.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
else
WFEX.wFormatTag = WAVE_FORMAT_PCM;
WFEX.nChannels = Channels;
WFEX.nSamplesPerSec = SamplesPerSec;
WFEX.nAvgBytesPerSec = (BitsPerSample * Channels * SamplesPerSec) / 8;
WFEX.nBlockAlign = (BitsPerSample * Channels) / 8;
WFEX.wBitsPerSample = BitsPerSample;
WFEX.cbSize = 0;
uint64_t Header[14];
memset(Header, 0, sizeof(Header));
memcpy(Header + 0, GuidRIFF, 16);
if (Initial) {
Header[2] = 0x7F00000000000000ull;
} else {
Header[2] = BytesWritten + sizeof(Header);
}
memcpy(Header + 3, GuidWAVE, 16);
memcpy(Header + 5, Guidfmt, 16);
Header[7] = 48;
memcpy(Header + 8, &WFEX, sizeof(WFEX));
memcpy(Header + 11, Guiddata, 16);
if (Initial)
Header[13] = 0x7E00000000000000ull;
else
Header[13] = BytesWritten + 24;
std::ios::streampos CPos = tellp();
seekp(0, std::ios::beg);
write(reinterpret_cast<const char *>(Header), sizeof(Header));
if (!Initial)
seekp(CPos, std::ios::beg);
}
void Wave64Writer::WriteData(void *Data, std::streamsize Length) {
write(reinterpret_cast<char *>(Data), Length);
BytesWritten += Length;
}

View File

@ -1,55 +0,0 @@
// Copyright (c) 2007-2008 Fredrik Mellbin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef WAVE64WRITER_H
#define WAVE64WRITER_H
#include <stdint.h>
#include <iostream>
#include <fstream>
// this is to avoid depending on windows.h etc.
typedef struct FFMS_WAVEFORMATEX {
uint16_t wFormatTag;
uint16_t nChannels;
uint32_t nSamplesPerSec;
uint32_t nAvgBytesPerSec;
uint16_t nBlockAlign;
uint16_t wBitsPerSample;
uint16_t cbSize;
} FFMS_WAVEFORMATEX;
class Wave64Writer : private std::ofstream {
public:
Wave64Writer(const char *Filename, uint16_t BitsPerSample, uint16_t Channels, uint32_t SamplesPerSec, bool IsFloat);
~Wave64Writer();
void WriteData(void *Data, std::streamsize Length);
private:
int32_t BitsPerSample;
int32_t Channels;
uint32_t SamplesPerSec;
uint64_t BytesWritten;
uint32_t HeaderSize;
bool IsFloat;
void WriteHeader(bool Initial, bool IsFloat);
};
#endif

View File

@ -1,2 +0,0 @@
* To be written.

44
LICENCE Normal file
View File

@ -0,0 +1,44 @@
Copyright (c) 2004-2012, Aegisub Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Aegisub Group nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
--- END AEGISUB LICENSE --
Any file that does not have a license in the header is covered by the above
license with exception to any directories that contain a license file, or are
covered by another license in the file itself.
The following directories and file are covered by their respective licenses as
follows:
src/gl/
- MIT license. See src/gl/glext.h
src/MatroskaParser.(c|h)
- Licensed to BSDL with permission from the author.
universalchardet/
- MPL 1.1

View File

@ -1,63 +0,0 @@
AUTOMAKE_OPTIONS = foreign
if HAVE_UNIVCHARDET
univchardet = universalchardet
endif
if HAVE_AUTO3_LUA
auto3 = auto3
endif
if WITH_LIBASS
libass = libass
endif
if HAVE_PROVIDER_FFMPEGSOURCE
ffmpegsource = FFmpegSource2
endif
SUBDIRS = \
$(univchardet) \
$(auto3) \
$(libass) \
$(ffmpegsource) \
aegisub \
automation \
po \
desktop
osx-bundle:
@SHELL@ scripts/osx-bundle.sh @PACKAGE_TARNAME@-@PACKAGE_VERSION@ @AEGISUB_VERSION_DATA@
osx-dmg:
@SHELL@ scripts/osx-dmg.sh @PACKAGE_TARNAME@-@PACKAGE_VERSION@ "@PACKAGE_TARNAME@ @PACKAGE_VERSION@"
EXTRA_DIST = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
config.guess \
config.sub \
depcomp \
install-sh \
missing \
INSTALL \
README \
svn_revision
# m4macros/
EXTRA_DIST += \
m4macros/check_gnu_make.m4 \
m4macros/acx_pthread.m4 \
m4macros/ac_agi.m4 \
m4macros/ax_lang_compiler_ms.m4 \
m4macros/ac_agi_mdcpucfg.m4 \
m4macros/ax_openmp.m4 \
m4macros/ax_check_gl.m4 \
m4macros/ac_flag.m4
CLEANFILES= \
intltool-extract \
intltool-merge \
intltool-update

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,138 +0,0 @@
/*
* Avisynth interface for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
// Must be included before <windows.h>, otherwise some macros from <windows.h> get in the way
#include "image.h"
#include <windows.h>
#include <string.h>
#include <memory.h>
#include "avisynth.h"
#include "overlua.h"
#include "vfr.h"
// Lots of code lifted from the CSRI avisynth.cpp
class OverLuaAvisynth : public GenericVideoFilter {
private:
OverLuaScript *script;
double spf; // seconds per frame - for frame/timestamp conversion
VFRTranslator *vfr;
public:
OverLuaAvisynth(PClip _child, IScriptEnvironment *env, const char *file, const char *datastring, const char *vfrfile)
: GenericVideoFilter(_child)
{
switch (vi.pixel_type) {
case VideoInfo::CS_BGR24:
case VideoInfo::CS_BGR32:
// safe
break;
default:
env->ThrowError("OverLua: Unsupported pixel format, only RGB formats supported");
}
try {
script = new OverLuaScript(file, datastring);
spf = (double)vi.fps_denominator / (double)vi.fps_numerator;
if (vfrfile)
vfr = GetVFRTranslator(vfrfile);
else
vfr = 0;
}
catch (const char *e) {
env->ThrowError(e);
}
catch (...) {
env->ThrowError("Unknown exception in OverLua");
}
}
~OverLuaAvisynth()
{
if (vfr)
delete vfr;
delete script;
}
PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *env)
{
OutputDebugStringW(L"Entering OverLua GetFrame\n");
PVideoFrame avsframe = child->GetFrame(n, env);
env->MakeWritable(&avsframe);
double frametime = n * spf;
if (vfr)
frametime = vfr->TimeStampFromFrameNumber(n);
ptrdiff_t stride = avsframe->GetPitch();
unsigned char *plane = avsframe->GetWritePtr();
plane += (vi.height - 1) * stride;
stride = -stride;
try {
switch (vi.pixel_type) {
case VideoInfo::CS_BGR24: {
ImageBGR *frame = new ImageBGR(vi.width, vi.height, stride, plane);
script->RenderFrameRGB(*frame, frametime);
} break;
case VideoInfo::CS_BGR32: {
ImageBGRX *frame = new ImageBGRX(vi.width, vi.height, stride, plane);
script->RenderFrameRGB(*frame, frametime);
} break;
}
}
catch (const char *e) {
wchar_t *ew = new wchar_t[2048];
MultiByteToWideChar(CP_UTF8, 0, e, -1, ew, 2048);
MessageBoxW(0, ew, L"OverLua execution error", MB_ICONERROR);
delete[] ew;
env->ThrowError(e);
}
catch (...) {
MessageBoxW(0, L"Unknown error", L"OverLua execution error", MB_ICONERROR);
env->ThrowError("OverLua: unknown execution error");
}
OutputDebugStringW(L"Leaving OverLua GetFrame\n");
return avsframe;
}
static AVSValue __cdecl Create(AVSValue args, void* user_data, IScriptEnvironment* env)
{
return new OverLuaAvisynth(args[0].AsClip(), env, args[1].AsString(), args[2].AsString(0), args[3].AsString(0));
}
};
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env)
{
env->AddFunction("OverLua", "cs[data]s[vfr]s", OverLuaAvisynth::Create, 0);
return "OverLua";
}

File diff suppressed because it is too large Load Diff

View File

@ -1,653 +0,0 @@
/*
* Lua interface for the cairo graphics library
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#ifndef CAIRO_WRAP_H
#define CAIRO_WRAP_H
#include "../lua51/src/lua.h"
#include <cairo.h>
#include <string>
#include <map>
int luaopen_cairo(lua_State *L);
template <class ChildClass>
class LuaCairoBase {
private:
// Default handlers for metatable stuff
static int lua_index(lua_State *L)
{
LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1);
return (*obj)->internal_lua_index(L);
}
static int lua_newindex(lua_State *L)
{
LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1);
return (*obj)->internal_lua_newindex(L);
}
static int lua_callobj(lua_State *L)
{
LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1);
return (*obj)->internal_lua_callobj(L);
}
static int lua_gc(lua_State *L)
{
LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1);
delete *obj;
return 0;
}
// Hidden constructors
LuaCairoBase() { }
LuaCairoBase(const LuaCairoBase &obj) { }
// List of callables
typedef std::map<std::string, lua_CFunction> CallableMap;
CallableMap callables;
// "Magic" value - used to test that pointers are really valid
lua_CFunction magic;
protected:
virtual int internal_lua_index(lua_State *L)
{
if (lua_type(L, 2) == LUA_TSTRING) {
const char *field = lua_tostring(L, 2);
CallableMap::iterator func = callables.find(field);
if (func != callables.end()) {
lua_pushvalue(L, 1);
lua_pushcclosure(L, func->second, 1);
return 1;
}
if (strcmp("_type", lua_tostring(L, 2))) {
lua_pushstring(L, GetTypeName());
return 1;
}
}
return 0;
}
virtual int internal_lua_newindex(lua_State *L)
{
lua_pushfstring(L, "Cairo object of type '%s' can not have field set", GetTypeName());
lua_error(L);
return 0;
}
virtual int internal_lua_callobj(lua_State *L)
{
lua_pushfstring(L, "Cairo objct of type '%s' can not be called", GetTypeName());
lua_error(L);
return 0;
}
virtual const char *GetTypeName() { return "_base"; }
virtual void CreateMetaTable(lua_State *L)
{
lua_newtable(L);
lua_pushcclosure(L, lua_index, 0);
lua_setfield(L, -2, "__index");
lua_pushcclosure(L, lua_newindex, 0);
lua_setfield(L, -2, "__newindex");
lua_pushcclosure(L, lua_callobj, 0);
lua_setfield(L, -2, "__call");
lua_pushcclosure(L, lua_gc, 0);
lua_setfield(L, -2, "__gc");
}
void AddCallable(lua_CFunction func, const char *name)
{
callables[name] = func;
}
// Primary constructor for use with inherited stuff
LuaCairoBase(lua_State *L)
{
LuaCairoBase **ud = (LuaCairoBase**)lua_newuserdata(L, sizeof(ChildClass*));
*ud = this;
CreateMetaTable(L);
lua_setmetatable(L, -2);
magic = luaopen_cairo;
}
public:
virtual ~LuaCairoBase() { }
// Helper: Get the object pointer from a callback
static ChildClass *GetObjPointer(lua_State *L, int index)
{
if (!lua_isuserdata(L, index)) {
lua_pushliteral(L, "Passed non-userdata where one expected");
lua_error(L);
}
ChildClass *obj = CheckPointer(*(void**)lua_touserdata(L, index));
return obj;
}
// Check whether a pointer plausibly points to an object of this class
static ChildClass *CheckPointer(void *ptr)
{
ChildClass *testptr = (ChildClass*)ptr;
if (testptr->magic == luaopen_cairo)
return testptr;
else
return 0;
}
};
#define CALLABLE(name) static int lua_ ## name (lua_State *L)
class LuaCairoContext : public LuaCairoBase<LuaCairoContext> {
private:
cairo_t *context;
CALLABLE(reference);
CALLABLE(status);
CALLABLE(save);
CALLABLE(restore);
CALLABLE(get_target);
CALLABLE(push_group);
CALLABLE(push_group_with_content);
CALLABLE(pop_group);
CALLABLE(pop_group_to_source);
CALLABLE(get_group_target);
CALLABLE(set_source_rgb);
CALLABLE(set_source_rgba);
CALLABLE(set_source);
CALLABLE(set_source_surface);
CALLABLE(get_source);
CALLABLE(set_antialias);
CALLABLE(get_antialias);
CALLABLE(set_dash);
CALLABLE(get_dash_count);
CALLABLE(get_dash);
CALLABLE(set_fill_rule);
CALLABLE(get_fill_rule);
CALLABLE(set_line_cap);
CALLABLE(get_line_cap);
CALLABLE(set_line_join);
CALLABLE(get_line_join);
CALLABLE(set_line_width);
CALLABLE(get_line_width);
CALLABLE(set_miter_limit);
CALLABLE(get_miter_limit);
CALLABLE(set_operator);
CALLABLE(get_operator);
CALLABLE(set_tolerance);
CALLABLE(get_tolerance);
CALLABLE(clip);
CALLABLE(clip_preserve);
CALLABLE(clip_extents);
CALLABLE(reset_clip);
// rectangle_list_destroy is not needed,
// copy_clip_rectangle_list will convert the rect list into a pure Lua structure
CALLABLE(copy_clip_rectangle_list);
CALLABLE(fill);
CALLABLE(fill_preserve);
CALLABLE(fill_extents);
CALLABLE(in_fill);
CALLABLE(mask);
CALLABLE(mask_surface);
CALLABLE(paint);
CALLABLE(paint_with_alpha);
CALLABLE(stroke);
CALLABLE(stroke_preserve);
CALLABLE(stroke_extents);
CALLABLE(in_stroke);
CALLABLE(copy_page);
CALLABLE(show_page);
// Path operations
CALLABLE(copy_path);
CALLABLE(copy_path_flat);
CALLABLE(append_path);
CALLABLE(get_current_point);
CALLABLE(new_path);
CALLABLE(new_sub_path);
CALLABLE(close_path);
CALLABLE(arc);
CALLABLE(arc_negative);
CALLABLE(curve_to);
CALLABLE(line_to);
CALLABLE(move_to);
CALLABLE(rectangle);
CALLABLE(glyph_path);
CALLABLE(text_path);
CALLABLE(rel_curve_to);
CALLABLE(rel_line_to);
CALLABLE(rel_move_to);
// Transformations
CALLABLE(translate);
CALLABLE(scale);
CALLABLE(rotate);
CALLABLE(transform);
CALLABLE(set_matrix);
CALLABLE(get_matrix);
CALLABLE(identity_matrix);
CALLABLE(user_to_device);
CALLABLE(user_to_device_distance);
CALLABLE(device_to_user);
CALLABLE(device_to_user_distance);
// Text/font operations
CALLABLE(select_font_face);
CALLABLE(set_font_size);
CALLABLE(set_font_matrix);
CALLABLE(get_font_matrix);
CALLABLE(set_font_options);
CALLABLE(get_font_options);
CALLABLE(set_font_face);
CALLABLE(get_font_face);
CALLABLE(set_scaled_font);
CALLABLE(get_scaled_font);
CALLABLE(show_text);
CALLABLE(show_glyphs);
CALLABLE(font_extents);
CALLABLE(text_extents);
CALLABLE(glyph_extents);
protected:
const char *GetTypeName();
public:
// Create another reference for a context
LuaCairoContext(lua_State *L, cairo_t *_context);
// Destructor
virtual ~LuaCairoContext();
};
class LuaCairoSurface : public LuaCairoBase<LuaCairoSurface> {
private:
CALLABLE(create_similar);
CALLABLE(reference);
CALLABLE(status);
// Create cairo context for this surface
// This deviates from the regular cairo API
CALLABLE(create_context);
CALLABLE(finish);
CALLABLE(flush);
CALLABLE(get_font_options);
CALLABLE(get_content);
CALLABLE(mark_dirty);
CALLABLE(mark_dirty_rectangle);
CALLABLE(set_device_offset);
CALLABLE(get_device_offset);
CALLABLE(set_fallback_resolution);
CALLABLE(get_type);
// Image surface functions
CALLABLE(image_get_format);
CALLABLE(image_get_width);
CALLABLE(image_get_height);
// These replace the get_data and get_stride functions
CALLABLE(image_set_pixel);
CALLABLE(image_get_pixel);
protected:
// Protected because inheriting classes might want it too
cairo_surface_t *surface;
const char *GetTypeName();
// For child classes that will set surface themselves
LuaCairoSurface(lua_State *L);
public:
// Create another reference for a surface
LuaCairoSurface(lua_State *L, cairo_surface_t *_surface);
// Destructor
virtual ~LuaCairoSurface();
cairo_surface_t *GetSurface() { return surface; }
// Creation functions - these aren't in image surface objects but in a global table
CALLABLE(image_surface_create);
};
class LuaCairoFontFace : public LuaCairoBase<LuaCairoFontFace> {
private:
cairo_font_face_t *font_face;
CALLABLE(create_scaled_font);
CALLABLE(reference);
CALLABLE(status);
CALLABLE(get_type);
protected:
const char *GetTypeName();
public:
// Create another reference for a font face
LuaCairoFontFace(lua_State *L, cairo_font_face_t *_font_face);
// Destructor
virtual ~LuaCairoFontFace();
cairo_font_face_t *GetFontFace() { return font_face; }
};
class LuaCairoScaledFont : public LuaCairoBase<LuaCairoScaledFont> {
private:
cairo_scaled_font_t *scaled_font;
CALLABLE(reference);
CALLABLE(status);
CALLABLE(extents);
CALLABLE(text_extents);
CALLABLE(glyph_extents);
CALLABLE(get_font_face);
CALLABLE(get_font_options);
CALLABLE(get_font_matrix);
CALLABLE(get_ctm);
CALLABLE(get_type);
protected:
const char *GetTypeName();
public:
// Create another reference for a scaled font
LuaCairoScaledFont(lua_State *L, cairo_scaled_font_t *_scaled_font);
// Destructor
virtual ~LuaCairoScaledFont();
cairo_scaled_font_t *GetScaledFont() { return scaled_font; }
};
class LuaCairoFontOptions : public LuaCairoBase<LuaCairoFontOptions> {
private:
cairo_font_options_t *font_options;
bool owned;
CALLABLE(copy);
CALLABLE(status);
CALLABLE(merge);
CALLABLE(hash);
CALLABLE(equal);
CALLABLE(set_antialias);
CALLABLE(get_antialias);
CALLABLE(set_subpixel_order);
CALLABLE(get_subpixel_order);
CALLABLE(set_hint_style);
CALLABLE(get_hint_style);
CALLABLE(set_hint_metrics);
CALLABLE(get_hint_metrics);
void RegFontOptionsCallables();
protected:
const char *GetTypeName();
public:
// Create a new font options object - will be owned
LuaCairoFontOptions(lua_State *L);
// Wrap an existing font options object - will not be owned
LuaCairoFontOptions(lua_State *L, cairo_font_options_t *_font_options);
// Destructor - only destroy font_options if owned
virtual ~LuaCairoFontOptions();
cairo_font_options_t *GetFontOptions() { return font_options; }
// Creation function - global
CALLABLE(create);
};
class LuaCairoMatrix : public LuaCairoBase<LuaCairoMatrix> {
private:
cairo_matrix_t matrix;
CALLABLE(init);
CALLABLE(init_identity);
CALLABLE(init_translate);
CALLABLE(init_scale);
CALLABLE(init_rotate);
CALLABLE(translate);
CALLABLE(scale);
CALLABLE(rotate);
// Matrix inversion
CALLABLE(invert);
// Matrix multiplication
CALLABLE(multiply);
CALLABLE(transform_distance);
CALLABLE(transform_point);
// Pointwise arithmetic on matrices - not part of cairo API
CALLABLE(op_add);
CALLABLE(op_sub);
CALLABLE(op_mul);
CALLABLE(op_div);
CALLABLE(op_unm);
// Equality operator
CALLABLE(op_eq);
// Not in cairo API
CALLABLE(copy);
void RegMatrixCallables(lua_State *L);
protected:
virtual int internal_lua_index(lua_State *L);
virtual int internal_lua_newindex(lua_State *L);
const char *GetTypeName();
// Extend the meta table with various operators
void CreateMetaTable(lua_State *L);
public:
// Create new matrix, inited to identity matrix
LuaCairoMatrix(lua_State *L);
// Duplicate exixting matrix
LuaCairoMatrix(lua_State *L, const cairo_matrix_t *_matrix);
// Destructor
virtual ~LuaCairoMatrix();
cairo_matrix_t *GetMatrix();
// Creation function - global
CALLABLE(create);
};
class LuaCairoPath : public LuaCairoBase<LuaCairoPath> {
private:
cairo_path_t *path;
// Specifies whether the memory for the cairo_path_t object is owned by the cairo library.
// If cairo owns it we cannot add/remove elements from the path.
bool cairo_owns_memory;
// Number of path elemts we have allocated memory for. Undefined if cairo_owns_memory.
// This is different from path->length because that specifies the number of elements in use.
size_t path_elements_allocated;
// Management
void EnsurePathOwned(); // ensure that we own the path memory
void EnsureSpaceFor(size_t n); // ensure we own the path memory and there's space to add at least n more elements
// TODO: figure out what methods are needed
// Something to iterate over the parts at least
// Support for creating/modifying paths?
CALLABLE(clear);
CALLABLE(move_to);
CALLABLE(line_to);
CALLABLE(curve_to);
CALLABLE(close);
// Functional programming support
CALLABLE(map); // transform each path segment with a function
CALLABLE(map_coords); // transform each coordinate pair with a function
CALLABLE(fold); // fold path segments into a single result value
CALLABLE(fold_coords); // fold coordinate pairs into a single result value
void RegPathCallables(lua_State *L);
protected:
virtual int internal_lua_index(lua_State *L);
const char *GetTypeName();
public:
// Create object with new path - we will own the memory
LuaCairoPath(lua_State *L);
// Create object based on path - does not copy path, and lets cairo own the memory
LuaCairoPath(lua_State *L, cairo_path_t *_path);
// Destructor
virtual ~LuaCairoPath();
cairo_path_t *GetPath() { return path; }
// Modifying the path
void ClearPath();
void MoveTo(double x, double y);
void LineTo(double x, double y);
void CurveTo(double x0, double y0, double x1, double y1, double x2, double y2);
void ClosePath();
};
class LuaCairoPattern : public LuaCairoBase<LuaCairoPattern> {
private:
cairo_pattern_t *pattern;
CALLABLE(add_color_stop_rgb);
CALLABLE(add_color_stop_rgba);
CALLABLE(get_color_stop_count);
CALLABLE(get_color_stop_rgba);
CALLABLE(get_rgba);
CALLABLE(get_surface);
CALLABLE(get_linear_points);
CALLABLE(get_radial_circles);
CALLABLE(reference);
CALLABLE(status);
CALLABLE(set_extend);
CALLABLE(get_extend);
CALLABLE(set_filter);
CALLABLE(get_filter);
CALLABLE(set_matrix);
CALLABLE(get_matrix);
CALLABLE(get_type);
protected:
const char *GetTypeName();
public:
// Create another reference for a pattern object
LuaCairoPattern(lua_State *L, cairo_pattern_t *_pattern);
// Destructor
virtual ~LuaCairoPattern();
cairo_pattern_t *GetPattern() { return pattern; }
// Creation functions - these aren't in pattern objects but in a global table
CALLABLE(create_rgb);
CALLABLE(create_rgba);
CALLABLE(create_for_surface);
CALLABLE(create_linear);
CALLABLE(create_radial);
};
#undef CALLABLE
#endif

View File

@ -1,207 +0,0 @@
/*
* CSRI interface for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
// CSRI interface is unmaintained for now
#if 0
#include <string.h>
#include <memory.h>
#define CSRI_OWN_HANDLES
#define CSRIAPI extern "C" __declspec(dllexport)
// Nothing special required here
typedef int csri_rend;
// Forward instance data
struct csri_inst;
#include "../csri/include/csri/csri.h"
#include "../csri/include/csri/logging.h"
#include "overlua.h"
// Instance data
struct csri_inst {
csri_fmt frame_format;
OverLuaScript *script;
};
// Renderer information definition
static const csri_info overlua_csri_info = {
"overlua",
"overlua-001",
"OverLua Lua-based advanced effects renderer",
"Niels Martin Hansen",
"Copyright 2007 Niels Martin Hansen (GPLv2)"
};
// Just something we can pass a pointer to
static const csri_rend overlua_csri_rend = 0;
// Name of the "overlua" extension format
static const char *overlua_format_ext_name = "jfs.overlua";
CSRIAPI csri_inst *csri_open_file(csri_rend *renderer,
const char *filename, struct csri_openflag *flags)
{
if (renderer != &overlua_csri_rend) return 0;
csri_inst *inst = new csri_inst;
inst->script = new OverLuaScript(filename);
return inst;
}
CSRIAPI csri_inst *csri_open_mem(csri_rend *renderer,
const void *data, size_t length, struct csri_openflag *flags)
{
if (renderer != &overlua_csri_rend) return 0;
csri_inst *inst = new csri_inst;
inst->script = new OverLuaScript(data, length);
return inst;
}
CSRIAPI void csri_close(csri_inst *inst)
{
delete inst->script;
delete inst;
return;
}
CSRIAPI int csri_request_fmt(csri_inst *inst, const struct csri_fmt *fmt)
{
// only support RGB formats
if (!csri_is_rgb(fmt->pixfmt))
return 0;
// get a private copy of it
memcpy(&inst->frame_format, fmt, sizeof(csri_fmt));
return 1;
}
CSRIAPI void csri_render(csri_inst *inst, struct csri_frame *frame, double time)
{
// check for correct pixfmt
if (frame->pixfmt != inst->frame_format.pixfmt) return;
BaseImageAggregate *olframe = 0;
switch (frame->pixfmt) {
#define HANDLE_RGB_FORMAT(fmtname, PixFmt) \
case fmtname: \
olframe = new BaseImageAggregateImpl<PixelFormat:: ## PixFmt>(inst->frame_format.width, inst->frame_format.height, frame->strides[0], frame->planes[0]); \
break;
HANDLE_RGB_FORMAT(CSRI_F_RGBA, RGBA)
HANDLE_RGB_FORMAT(CSRI_F_ARGB, ARGB)
HANDLE_RGB_FORMAT(CSRI_F_BGRA, BGRA)
HANDLE_RGB_FORMAT(CSRI_F_ABGR, ABGR)
HANDLE_RGB_FORMAT(CSRI_F_RGB_, RGBX)
HANDLE_RGB_FORMAT(CSRI_F__RGB, XRGB)
HANDLE_RGB_FORMAT(CSRI_F_BGR_, BGRX)
HANDLE_RGB_FORMAT(CSRI_F__BGR, XBGR)
HANDLE_RGB_FORMAT(CSRI_F_RGB, RGB)
HANDLE_RGB_FORMAT(CSRI_F_BGR, BGR)
default: break; // what, we don't support this!
#undef HANDLE_RGB_FORMAT
}
if (olframe) {
inst->script->RenderFrameRGB(*olframe, time);
}
}
CSRIAPI void *csri_query_ext(csri_rend *rend, csri_ext_id extname)
{
if (rend != &overlua_csri_rend)
return 0;
// Check for the OverLua format extension
if (strcmp(extname, overlua_format_ext_name) == 0)
// Nonsense return
return &overlua_format_ext_name;
// TODO: support logging
if (strcmp(extname, CSRI_EXT_LOGGING) == 0)
return 0;
return 0;
}
CSRIAPI struct csri_info *csri_renderer_info(csri_rend *rend)
{
if (rend == &overlua_csri_rend)
return (csri_info*)&overlua_csri_info;
return 0;
}
CSRIAPI csri_rend *csri_renderer_byname(const char *name,
const char *specific)
{
if (strcmp(name, overlua_csri_info.name) == 0)
if (!specific || strcmp(specific, overlua_csri_info.specific) == 0)
return (csri_rend*)&overlua_csri_rend;
return 0;
}
CSRIAPI csri_rend *csri_renderer_byext(unsigned n_ext, csri_ext_id *ext)
{
// Check if every extension is supported
while (n_ext-- > 0) {
if (!csri_query_ext((csri_rend*)&overlua_csri_rend, *ext))
return 0;
ext++;
}
return (csri_rend*)&overlua_csri_rend;
}
CSRIAPI csri_rend *csri_renderer_default()
{
return (csri_rend*)&overlua_csri_rend;
}
CSRIAPI csri_rend *csri_renderer_next(csri_rend *prev)
{
if (prev == 0)
return (csri_rend*)&overlua_csri_rend;
else
return 0;
}
#endif

View File

@ -1,232 +0,0 @@
Documentation for the RPN expression engine in OverLua
======================================================
For some graphics processing operationg, OverLua provides an RPN (Reverse
Polish Notation) to do fast calculations. This expression engine is designed
primarily to have very fast execution and be multithreading-safe in the
runtime.
The language is meant to support multi-variable calculations, so apart from
the usual arithmetic operators there is also an assignment operator. Finally
there is a limited number of temporary registers.
There is no explicit Lua interface to the expression engine, rather it is
implicitly used by some image processing functions. In those cases, a
program is passed as a string to the image processing function.
Stack machine execution model
-----------------------------
The expression evaluator is implemented as a stack machine with a number
of registers. Some of these registers are used for input and/or output
values and some are freely usable for temporary storage.
The stack holds numbers in 'double' precision, this is the only data type
supported by the machine. There are no practical limits on stack depth.
The registers also hold numbers in 'double' precision. Depending on the
function using the expression evaluator, different input/output registers
will be available. The input/output registers will usually be single-letter
names using uppercase letters. There are always exactly ten temporary
registers available, named "t0" to "t9", ie. lowercase "t" followed by
a digit. The contents of the temporary registers are undefined at the start
of program execution.
The program consists of a number of instructions executed sequentially. There
are three basic types of instructions:
- push
- call
- store
A 'push' instruction pushes a single number to the top of the stack. The
source of the number can either be a constant or a register.
A 'call' instruction pops some numbers from the stack, performs an operation
on them and pushes a single number back onto the stack. This includes basic
arithmetic operations such as addition, mulitiplication, but also functions
such as sinus, rounding and logarithms. How many numbers are popped from the
stack depends on the function.
The 'store' instruction pops one number from the stack and stores it into
a register, overwriting the previous number in the register.
After every instruction in the program has been executed, any remaining numbers
on the stack are discarded, and the numbers in the output registers are passed
to the function using the expression evaluator.
If a program operation attempt to pop a number from the stack when the stack
is empty, the machine halts with an error state, and the result of the program
is undefined.
Expression syntax
-----------------
The syntax used to specify programs is very straightforward.
The program consists of a number of tokens separated by whitespace. Each token
translates into one instruction.
A token can be a number. This translates into a 'push' instruction, pushing
that number as a constant. The format for numbers is the same as in C.
Examples: "1", "-5", "3.14", ".5" "2.998e8"
A token can be a register name. This translates into a 'push' instruction,
pushing the number in the register.
Examples: "X", "Y", "t0", "t6"
A token can be a basic arithmetic operator. These translate into 'call'
instructions. Each of these represent a function that pops two numbers,
performs the calculation and pushes the result.
The basic arithmetic operators are: + - * / ^
Examples:
Suppose the two previous instructions were "A B" where A and B are registers.
This means that now the stack contains B at the top and A just below.
Operator "+" will then calculate "A + B". Operator "-" will calculate "A - B".
Operator "*" will calculate "A * B". Operator "/" will calculate "A / B".
Operator "^" will calculate "A ^ B", ie. A raised to the power of B.
The result of illegal operations is undefined. It will most likely result in
an invalid number being pushed onto the stack, and operating on that number
will cause the error to propagate.
A token matching the name of a defined function will translate into a 'call'
instruction for the given function. A number of standard functions are always
available, see below for details.
An equal sign followed by the name of a register translated into a 'store'
instruction, that will pop the number at the top of the stack and store it
into the named register. There must not be any whitespace between the equal
sign and the register name.
Examples: "=X", "=t0"
Standard function library
-------------------------
The following functions are always available in the machine.
~ (tilde character)
Takes one argument, produces one result.
Unary minus. (Negate the argument.)
abs
Takes one argument, produces one result.
Return the absolute value.
floor
Takes one argument, produces one result.
Round towards negative infinity.
ceil
Takes one argument, produces one result.
Round towards positive infinity.
log
Takes one argument, produces one result.
Natural (base e) logarithm.
exp
Takes one argument, produces one result.
Natural exponentiation. (e to the power of x.)
sqrt
Takes one argument, produces one result.
Square root.
e
Takes no arguments, produces one result.
Push the value of e.
min
Takes two arguments, produces one result.
Return the smallest of the arguments.
max
Takes two arguments, produces one result.
Return the largest of the arguments.
pi
Takes no arguments, produces one result.
Push the value of pi.
sin
Takes one argument, produces one result.
Sinus function. Argument in radians.
cos
Takes one argument, produces one result.
Cosine function. Argument in radians.
tan
Takes one argument, produces one result.
Tangent function. Argument in radians.
asin
Takes one argument, produces one result.
Arc sinus function.
acos
Takes one argument, produces one result.
Arc cosine function.
atan
Takes one argument, produces one result.
Arc tangent function.
mod
Takes two arguments, produces one result.
Modulo operation.
rand
Takes no arguments, produces one result.
Return a random value in range 0..1.
ifgtz
Takes three arguments, produces one result.
If the first argument is greater than zero, return the second argument,
else return the third argument.
ifeqz
Takes three arguments, produces one result.
If the first argument is equal to zero, return the second argument,
else return the third argument.
Sample programs
---------------
For raster.pixel_value_map:
"rand =t0 t0 =R t0 =G t0 =B"
Create a field of random gray-values.
"0 =R 1 G - =G"
Zero out the red channel and invert the green channel.
For raster.pixel_coord_map:
"X .5 rand - + =X Y .5 rand - + =Y"
Create some jitter in the pixels.

View File

@ -1,451 +0,0 @@
Documentation for the cairo interface provided in OverLua
=========================================================
First, this file will mostly attempt to describe the differences between the
cairo C API and the provided Lua API. If you want more general and in-depth
information on cairo, please see the documentation for the C API:
<http://cairographics.org/manual/>
Note that almost all of the *_reference functions are unimplemented currently.
They should not be explicitly needed since Lua does its own management on
objects as well, you can just copy and keep a Lua cairo object and be
guaranteed the underlying cairo object won't be deleted until all Lua objects
referring to it are gone.
There are no *_destroy and *_get_reference_count functions either,
for this reason.
Finally the *_user_data functions are also removed from the API.
Conventions in this file
------------------------
Variable name Cairo object
surf Surface (cairo_surface_t)
ctx Context (cairo_t)
face Font face (cairo_font_face_t)
sf Scaled font (cairo_scaled_font_t)
fo Font options (cairo_font_options_t)
mat Matrix (cairo_matrix_t)
path Path (cairo_path_t)
pat Pattern (cairo_pattern_t)
x, y Coordinates
r, g, b, a Colour values (red, green, blue, alpha)
If more than one of an object type is used they will get numeric suffixes.
For matrix operations you might also see "matR", this is "result matrix".
More "OO-like" syntax
---------------------
This Lua cairo API provides a more common "OO-like" syntax for calls.
For example, the cairo_set_source_surface(ctx, surf, x, y) function maps to
ctx.set_source_surface(surf, x, y).
Creating initial objects
------------------------
Many of the objects you will use are created from or by other objects, but
you will need to create some non-dependant objects, most importantly image
surface objects. All the object creation functions live in the global "cairo"
table.
surf = cairo.image_surface_create(width, height, pixel_format)
Create a blank image surface object.
width and height are in pixels. pixel_format is a string and must be one
of "argb32", "rgb24", "a8" and "a1".
fo = cairo.font_options_create()
Create a new font options object.
mat = cairo.matrix_create()
Create a new matrix. It is initially the identity matrix.
pat = cairo.pattern_create_rgb(r, g, b)
pat = cairo.pattern_create_rgba(r, g, b, a)
pat = cairo.pattern_create_for_surface(surf)
pat = cairo.pattern_create_linear(x0, y0, x1, y1)
pat = cairo.pattern_create_radial(x0, y0, r0, x1, y1, r1)
Create various kinds of pattern objects.
ctx = surf.create_context()
Not strictly an "initial object", but cairo context objects are important
enough to explicitly list here. They are created by calling the
create_context() method in a surface object. This will create a context
object that draws to the surface it was created with.
Other functions that have changed API
-------------------------------------
Some functions have changed API to better match the Lua programming model.
ctx.set_dash()
ctx.set_dash(0)
ctx.set_dash(num[, offset])
ctx.set_dash(dashes[, offset])
There are several forms of the set_dash function. The two first disable
dashing entirely.
The third creates a repeating pattern of equal length on and off potions,
each "num" units long. The offset argument is optional, its default is 0.
The last creates a complex pattern. "dashes" must be a table of numbers
describing the dashing pattern. offset is optional, default is 0.
dashes, offset = ctx.get_dash()
Returns current dashing setting, in same format as the last form of set_dash
takes. If dashing is disabled, dashes will be an empty table.
(You won't need to use the ctx.get_dash_count() function.)
x0, y0, x1, y1 = ctx.clip_extents()
x0, y0, x1, y1 = ctx.fill_extents()
x0, y0, x1, y1 = ctx.stroke_extents()
Return the smallest rectangle bounding the area that would be affected if
performing a clip/fill/stroke operation.
x, y = ctx.get_current_point()
Get the current point for path gneration operations.
mat = ctx.get_matrix()
Get the current geometry transformation matrix.
x, y = ctx.user_to_device(x, y)
x, y = ctx.user_to_device_distance(x, y)
x, y = ctx.device_to_user(x, y)
x, y = ctx.device_to_user_distance(x, y)
Returns the transformation of a point between device and user-space
coordinates.
offset, r, g, b, a = pat.get_color_stop_rgba(index)
Returns nothing if the pattern is not a gradient pattern or the stop index
is out of range.
r, g, b, a = pat.get_rgba()
Returns nothing if the pattern is not a solid colour fill pattern.
surf = pat.get_surface()
Returns nothing if the pattern is not a surface pattern.
x0, y0, x1, y1 = pat.get_linear_points()
Returns nothing if the pattern is not a linear gradient pattern.
x0, y0, r0, x1, y1, r1 = pat.get_radial_circles()
Returns nothing if the pattern is not a radial gradient pattern.
extents = ctx.font_extents()
extents = sf.font_extents()
Get extents metrics for current font. The returned object is a Lua table
with fields identical to the C struct cairo_font_extents_t.
extents = ctx.tex_extents(utf8)
extents = sf.text_extents(utf8)
Get extents metrics for writing text given in utf8 with current font. The
returned object is a Lua table with fields identical to the C
struct cairo_text_extents_t.
fo = sf.get_font_options()
Get font options for a scaled font.
mat = sf.get_font_matrix()
Get text transformation matrix.
mat = sf.get_ctm()
Get the CTM. (Character transformation matrix?)
fo1.merge(fo2)
Merge font options fo2 into fo1.
hash = fo.hash()
Returns a hexadecimal string hash of fo.
fo1.equal(fo2)
Return true is fo1 equals fo2.
fo = surf.get_font_options()
Get current font options for surface.
x, y = surf.get_device_offset()
Get current device offset for surface.
a, r, g, b = surf.get_pixel(x, y)
r, g, b = surf.get_pixel(x, y)
a = surf.get_pixel(x, y)
Get colour value of a pixel on an image surface. This function replaces the
cairo_image_surface_get_data(surf) function for reading surface contents.
The number and meanings of return values depend on the surface pixel format.
surf.set_pixel() is not implemented yet.
matR = mat.copy()
Duplicate a matrix. Not in cairo C API.
mat.xx, mat.yx, mat.xy, mat.yy, mat.x0, mat.y0
Access the individual numbers in a matrix. These are both read and write.
Functional programming on path objects
--------------------------------------
The path object still hasn't been completely implemented, but two useful
functions do exist for it. These are functional programming style map and
fold functions.
path.map_coords(func)
Transform every coordinate pair in path using func.
func must be a function of type (x,y)->(x,y) ie. takes two arguments which
are the x and y coordinates of the point and returns two numbers which are
the new x and y coordinates of the point.
Example: Produce a "wavy" effect.
path.map_coords(function(x,y) return x+math.sin(x), y+math.cos(y) end)
res = path.fold_coords(func, start)
Produce a value by combining all the coordinate pairs using func.
func must be a function of type (r,x,y)->(r) ie. takes three argument which
are the current result and the x/y coordinates of the point, and returns a
new result.
When all points have been processed path.fold_coords returns the final result.
Example: Find the maximum X coordinate.
maxx = path.fold_coords(
function(maxx,x,y)
if not maxx then
return x
elseif x > maxx then
return x
else
return maxx
end
end, nil)
Enumeration mappings
--------------------
Everything represented by an enum in the cairo C API is represented by a
string in the Lua API. Any enums not listed here don't have any mappings
currently. (Which in turn means that any API requiring that enum is also
unimplemented.)
typedef enum _cairo_antialias {
CAIRO_ANTIALIAS_DEFAULT, "default"
CAIRO_ANTIALIAS_NONE, "none"
CAIRO_ANTIALIAS_GRAY, "gray"
CAIRO_ANTIALIAS_SUBPIXEL "subpixel"
} cairo_antialias_t;
typedef enum _cairo_fill_rule {
CAIRO_FILL_RULE_WINDING, "winding"
CAIRO_FILL_RULE_EVEN_ODD "even_odd"
} cairo_fill_rule_t;
typedef enum _cairo_line_cap {
CAIRO_LINE_CAP_BUTT, "butt"
CAIRO_LINE_CAP_ROUND, "round"
CAIRO_LINE_CAP_SQUARE "square"
} cairo_line_cap_t;
typedef enum _cairo_line_join {
CAIRO_LINE_JOIN_MITER, "miter"
CAIRO_LINE_JOIN_ROUND, "round"
CAIRO_LINE_JOIN_BEVEL "bevel"
} cairo_line_join_t;
typedef enum _cairo_operator {
CAIRO_OPERATOR_CLEAR, "clear"
CAIRO_OPERATOR_SOURCE, "source"
CAIRO_OPERATOR_OVER, "over"
CAIRO_OPERATOR_IN, "in"
CAIRO_OPERATOR_OUT, "out"
CAIRO_OPERATOR_ATOP, "atop"
CAIRO_OPERATOR_DEST, "dest"
CAIRO_OPERATOR_DEST_OVER, "dest_over"
CAIRO_OPERATOR_DEST_IN, "dest_in"
CAIRO_OPERATOR_DEST_OUT, "dest_out"
CAIRO_OPERATOR_DEST_ATOP, "dest_atop"
CAIRO_OPERATOR_XOR, "xor"
CAIRO_OPERATOR_ADD, "add"
CAIRO_OPERATOR_SATURATE "saturate"
} cairo_operator_t;
typedef enum _cairo_path_data_type {
CAIRO_PATH_MOVE_TO, "move_to"
CAIRO_PATH_LINE_TO, "line_to"
CAIRO_PATH_CURVE_TO, "curve_to"
CAIRO_PATH_CLOSE_PATH "close"
} cairo_path_data_type_t;
typedef enum _cairo_extend {
CAIRO_EXTEND_NONE, "none"
CAIRO_EXTEND_REPEAT, "repeat"
CAIRO_EXTEND_REFLECT, "reflect"
CAIRO_EXTEND_PAD "pad"
} cairo_extend_t;
typedef enum _cairo_filter {
CAIRO_FILTER_FAST, "fast"
CAIRO_FILTER_GOOD, "good"
CAIRO_FILTER_BEST, "best"
CAIRO_FILTER_NEAREST, "nearest"
CAIRO_FILTER_BILINEAR, "bilinear"
CAIRO_FILTER_GAUSSIAN "gaussian"
} cairo_filter_t;
typedef enum _cairo_pattern_type {
CAIRO_PATTERN_TYPE_SOLID, "solid"
CAIRO_PATTERN_TYPE_SURFACE, "surface"
CAIRO_PATTERN_TYPE_LINEAR, "linear"
CAIRO_PATTERN_TYPE_RADIAL "radial"
} cairo_pattern_type_t;
typedef enum _cairo_font_slant {
CAIRO_FONT_SLANT_NORMAL, "" (empty string)
CAIRO_FONT_SLANT_ITALIC, "italic"
CAIRO_FONT_SLANT_OBLIQUE "oblique"
} cairo_font_slant_t;
typedef enum _cairo_font_weight {
CAIRO_FONT_WEIGHT_NORMAL, "" (empty string)
CAIRO_FONT_WEIGHT_BOLD "bold"
} cairo_font_weight_t;
typedef enum _cairo_subpixel_order {
CAIRO_SUBPIXEL_ORDER_DEFAULT, "default"
CAIRO_SUBPIXEL_ORDER_RGB, "rgb"
CAIRO_SUBPIXEL_ORDER_BGR, "bgr"
CAIRO_SUBPIXEL_ORDER_VRGB, "vrgb"
CAIRO_SUBPIXEL_ORDER_VBGR "vbgr"
} cairo_subpixel_order_t;
typedef enum _cairo_hint_style {
CAIRO_HINT_STYLE_DEFAULT, "default"
CAIRO_HINT_STYLE_NONE, "none"
CAIRO_HINT_STYLE_SLIGHT, "slight"
CAIRO_HINT_STYLE_MEDIUM, "medium"
CAIRO_HINT_STYLE_FULL "full"
} cairo_hint_style_t;
typedef enum _cairo_hint_metrics {
CAIRO_HINT_METRICS_DEFAULT, "default"
CAIRO_HINT_METRICS_OFF, "on"
CAIRO_HINT_METRICS_ON "off"
} cairo_hint_metrics_t;
typedef enum _cairo_content {
CAIRO_CONTENT_COLOR, "c"
CAIRO_CONTENT_ALPHA, "a"
CAIRO_CONTENT_COLOR_ALPHA, "ca"
} cairo_content_t;
Tnis enum and everything dependent on it is probably BROKEN.
typedef enum _cairo_format {
CAIRO_FORMAT_ARGB32, "argb32"
CAIRO_FORMAT_RGB24, "rgb24"
CAIRO_FORMAT_A8, "a8"
CAIRO_FORMAT_A1, "a1"
/* CAIRO_FORMAT_RGB16_565 "rgb16_565" (do not use) */
} cairo_format_t;
typedef enum _cairo_status {
CAIRO_STATUS_SUCCESS, "success"
CAIRO_STATUS_NO_MEMORY, "no_memory"
CAIRO_STATUS_INVALID_RESTORE, "invalid_restore"
CAIRO_STATUS_INVALID_POP_GROUP, "invalid_pop_group"
CAIRO_STATUS_NO_CURRENT_POINT, "no_current_point"
CAIRO_STATUS_INVALID_MATRIX, "invalid_matrix"
CAIRO_STATUS_INVALID_STATUS, "invalid_status"
CAIRO_STATUS_NULL_POINTER, "null_pointer"
CAIRO_STATUS_INVALID_STRING, "invalid_string"
CAIRO_STATUS_INVALID_PATH_DATA, "invalid_path_data"
CAIRO_STATUS_READ_ERROR, "read_error"
CAIRO_STATUS_WRITE_ERROR, "write_error"
CAIRO_STATUS_SURFACE_FINISHED, "surface_finished"
CAIRO_STATUS_SURFACE_TYPE_MISMATCH, "surface_type_mismatch"
CAIRO_STATUS_PATTERN_TYPE_MISMATCH, "pattern_type_mismatch"
CAIRO_STATUS_INVALID_CONTENT, "invalid_content"
CAIRO_STATUS_INVALID_FORMAT, "invalid_format"
CAIRO_STATUS_INVALID_VISUAL, "invalid_visual"
CAIRO_STATUS_FILE_NOT_FOUND, "file_not_found"
CAIRO_STATUS_INVALID_DASH, "invalid_dash"
CAIRO_STATUS_INVALID_DSC_COMMENT, "invalid_dsc_comment"
CAIRO_STATUS_INVALID_INDEX, "invalid_index"
CAIRO_STATUS_CLIP_NOT_REPRESENTABLE "clip_not_representable"
} cairo_status_t;

View File

@ -1,62 +0,0 @@
Documentation for the fonts interface provided in OverLua
=========================================================
OverLua provides a simplified interface to create and manage Fontconfig
in-memory configurations, create FreeType font face objects from those
and basic manipulation of these font face objects.
It is possible to create cairo font face objects from the FreeType font
face objects, so the fonts can be used in cairo rendering. This is the
preferred way to produce text in OverLua.
This interface does not provide means to have Fontconfig load and use
configuration files, neither system-wide, per-user nor private ones.
The only way to load and use fonts is to explicitly name the font files
and load these. The purpose of this is to let OverLua scripts produce
predictable results, as the same font will always be selected regardless
of the system the script is running on.
See also:
Fontconfig documentation: <http://fontconfig.org/fontconfig-devel/>
FreeType 2 documentation: <http://www.freetype.org/freetype2/docs/reference/ft2-toc.html>
Font configuration object
-------------------------
OverLua keeps one global Fontconfig configuration object, which is
implicitly used for all operations. It is accessed through the global
'fonts' object.
The following operations are supported:
success = fonts.add_file(filename)
Attempts to load the specified font file and add all fonts in it to the
Fontconfig configuration. This uses the FcConfigAppFontAddFile C function
to perform the work.
On return, 'success' is a boolean which is 'true' on success and 'false'
otherwise.
cairofont = fonts.select(pattern, cairofo)
Select the font best matching the pattern given, and return an object
representing that font.
The pattern is a Lua table of key=value pairs, with the keys being the
properties Fontconfig understands, and the values the value you want
for that property.
'cairofo' is a cairo font options object. This parameter is optional.
You can see a list of known properties on: <http://fontconfig.org/fontconfig-user.html>
This function returns a cairo FreeType font object that can be selected
into a cairo context for rendering with.

View File

@ -1,230 +0,0 @@
OverLua provides a Lua 5.1 runtime environment with access to all
standard libraries.
The Avisynth filter
-------------------
The Avisynth filter version of OverLua exports one function:
OverLua(clip c, string scriptfile, string "datastring", string "vfrfile")
The clip c argument is self-explanatory, the clip to render on.
The scripfile is the path to the Lua script you want to load and run.
datastring is a freeform string to pass to the Lua script. This will often
be the path to a file with additional data for the script, such as timed
subtitles/karaoke.
vfrfile is the path to a timecode file Matroska format 1 or 2. If supplied,
it will be used to translate frame numbers to timestamps instead of relying
on the frame rate provided by Avisynth.
API the Lua script must implement
---------------------------------
Any initialisation, such as loading external data files, should be done
in the Lua script's global environment.
OverLua expects one function in the script:
function render_frame(frame, timestamp)
The function name must be literal "render_frame". It must not be local.
The "frame" parameter is a userdata object representing the video frame
there must be rendered to. Other functions take this object as parameter.
The "timestamp" parameter is a value of type "number", representing the
timestamp of the frame to be rendered, in seconds. The timestamp may be
non-integer with any precision.
The render_frame function should not return anything. Instead it modifies
the frame object.
The render_frame function should not assume that frames are requested in
any specific order.
If a "datastring" argument is supplied to the OverLua Avisynth function, the
argument value will be available through the global variable
"overlua_datastring" in the Lua script environment.
The frame object
----------------
The "frame" object passed to the render_frame function has a number of
fields accessible.
The frame is always stored as RGB. No alpha channel is supported.
frame.width
An integer number storing the width of the frame in pixels.
Read only.
frame.height
An integer number storing the height of the frame in pixels.
Read only.
red, green, blue = frame(x, y)
"red", "green" and "blue" will be numbers in range 0..255 that will receive
the respective colour channel values for the requested pixel.
"x" and "y" are the pixel coordinates for the pixel to retrieve
Pixel coordinates are counted from zero and start in the upper left corner.
A pixel with coordinates (X, Y) has pixel number Y*frame.width+X.
frame[n] = {red, green, blue}
Set the value of the given pixel.
The table on the right side of the equal sign must have at least three
entries which must all be numbers. They are taken as red, green and blue
values respectively, in regular enumeration order.
"n" is the pixel number to be set.
A pixel with coordinates (X, Y) has pixel number Y*frame.width+X.
Using a table constructor as shown is recommended.
surface = frame.create_cairo_surface()
Create a cairo rgb24 surface from the video frame. Drawing to the surface
will _not_ affect the video frame. If you want the changes to the surface
visible on the video you will need to overlay this surface on the video.
frame.overlay_cairo_surface(surface, x, y)
Overlay the given cairo surface at the video frame such that the upper,
left corner of the surface is positioned at pixel (x, y) on the video.
Only argb32 and rgb24 type surfaces are supported.
Proper alpha blending is used for argb32 surfaces.
Setting a pixel value for a pixel outside the frame has no effect.
Specifically, it will not produce an error or a warning message.
Reading a pixel value for a pixel outside the frame will return black,
ie. (0, 0, 0).
Vector graphics interface
-------------------------
OverLua uses the cairo library for all vector graphics handling, including
text handling.
See lua-cairo.txt for details.
Raster graphics processing interface
------------------------------------
A raster graphics processing interface is also provided, to post-process
the graphics produced by the vector graphics interface.
The raster graphics interface operates directly on cairo surfaces.
raster.gaussian_blur(surface, sigma)
Applies a strength sigma gaussian blur on the surface.
raster.box_blur(surface, size, repetitions)
Applies a box blur filter of variable size to the surface as many times as
specified. Please note that no specific optimisation is done for applying
box filters over more general filters and using box blur over gaussian blur
is probably no faster and might even be slower.
raster.directional_blur(surface, angle, sigma)
Apply a variable strength directional gaussian kernel blur to the image.
Also known as motion blur. The angle is given in radians.
raster.radial_blur(surface, cx, cy, sigma)
Apply a variable strength radial gaussian blur centered on pixel (cx,cy).
raster.invert(surface)
Invert the colour in the given surface.
For ARGB32 surfaces, only the colour channels are inverted, the alpha
channel is kept as-is.
For RGB24 surfaces, all channels are inverted.
For A8 and A1 surfaces the alpha is inverted.
raster.separable_filter(surface, filter, divisor)
Apply a custom separable filter over the image.
The filter must be a table of integers. After the convoluted value of each
pixel is calculated, it is divided by divisor before it's stored back to the
image.
Note that this function can only work on integers, floating point values in
the filter or divisor will be rounded first. To get higher precision, scale
up the filter and divisor. (Treat it as fixed-point math.)
The filter is one-dimensional, but is applied first horizontally and then
vertically ovre the image to get the final image.
raster.pixel_value_map(surface, expression)
Map an expression over every pixel RGB value in the surface. Only works for
ARGB32 and RGB24 surfaces.
The expression is an RPN expression in the OverLua Expression Evaluator
language, see expression-evaluator.txt for details.
No additional functions are made available to the expression evaluator by
this function.
The following new registers are made available to the expression evaluator:
R In range 0..1, red component. Input and output.
G Ditto, for green component.
B Ditto, for blue component.
A Ditto, for alpha component. (Only on ARGB32 surfaces.)
X X-coordinate of pixel being processed. Input only.
Y Y-coordinate of pixel being processed. Input only.
raster.pixel_coord_map(surface, expression)
Map each pixel coordinate pair to a new coordinate pair in the surface. Only
works for ARGB32 and RGB24 surfaces.
The expression is an RPN expression in the OverLua Expression Evaluator
language, see expression-evaluator.txt for details.
No additional functions are made available to the expression evaluator by
this function.
The following new registers are made available to the expression evaluator:
X Absolute pixel X coordinate. Input and output. The output may be
non-integer, in that case bilinear interpolation is used.
Y Ditto, for Y coordinate.
More filtering functions are planned, though no specifics yet.
Wishes/suggestions are welcome, and so are patches to add more functions.

View File

@ -1,55 +0,0 @@
--- Convert RGB colour to HSL (hue/saturation/luminance)
-- The output image will have H instead of R,
-- S instead of G and L instead of B.
function render_frame(f, t)
local w, h = f.width, f.height
for y = 0, h-1 do
for x = 0, w-1 do
local r, g, b = f(x, y)
local h, s, l = RGB2HSL(r, g, b)
f[y*w+x] = {h, s, l}
end
end
end
function clip_colorval(v)
if v < 0 then
return 0
elseif v > 255 then
return 255
else
return math.floor(v)
end
end
function RGB2HSL(R, G, B)
local r, g, b = R/255, G/255, B/255
local h, s, l
local minrgb, maxrgb = math.min(r, math.min(g, b)), math.max(r, math.max(g, b))
l = (minrgb + maxrgb) / 2
if minrgb == maxrgb then
h, s = 0, 0
else
if l < 0.5 then
s = (maxrgb - minrgb) / (maxrgb + minrgb)
else
s = (maxrgb - minrgb) / (2 - maxrgb - minrgb)
end
if r == maxrgb then
h = (g - b) / (maxrgb - minrgb) + 0
elseif g == maxrgb then
h = (b - r) / (maxrgb - minrgb) + 2
else
h = (r - g) / (maxrgb - minrgb) + 4
end
end
if h < 0 then h = h + 6 end
if h >= 6 then h = h - 6 end
return clip_colorval(h*255/6), clip_colorval(s*255), clip_colorval(l*255)
end

View File

@ -1,134 +0,0 @@
--[[
Sample script for OverLua
- demonstrate basic reading in an ASS subtitle file and rendering its lines on the video
Given into the public domain.
(You can do anything you want with this file, with no restrictions whatsoever.
You don't get any warranties of any kind either, though.)
Originally authored by Niels Martin Hansen.
]]
-- overlua_datastring is the string given to data= argument in Avisynth filter invocation
timing_input_file = overlua_datastring
-- You may want to get these from somewhere else
-- Or just stick to hardcoding all styling information
font_name = "Arial"
font_size = 24
-- A little check that an input file was actually given
assert(timing_input_file, "Missing input file")
-- An easier way to convert a string to a number and be guaranteed to get something useful
function parsenum(str)
return tonumber(str) or 0
end
-- Convert an ASS timestamp into a number of seconds
function parse_ass_time(ass)
local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)")
return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600
end
-- Not used here, but do some basic \k timing parsing
function parse_k_timing(text)
local syls = {}
local i = 1
for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do
local syl = {dur = parsenum(timing)/100, text = syltext, i = i}
table.insert(syls, syl)
i = i + 1
end
return syls
end
-- Really stupid ASS parser
function read_input_file(name)
for line in io.lines(name) do
-- You can catch Style lines in the same way if you want
local start_time, end_time, style, fx, text = line:match("Dialogue: 0,(.-),(.-),(.-),.-,0000,0000,0000,(.-),(.*)")
if text then
local ls = {}
ls.start_time = parse_ass_time(start_time)
ls.end_time = parse_ass_time(end_time)
ls.style = style
ls.fx = fx
ls.rawtext = text
ls.kara = parse_k_timing(text)
-- Clear out override blocks
ls.cleantext = text:gsub("{.-}", "")
table.insert(lines, ls)
end
end
end
-- Initialisation function, intended to be run on the first frame
-- I think it's better to delay initialisation until first frame is requested
-- rather than doing it immediately at load time.
-- I believe much encoding software might be more graceful about that.
function init()
if inited then return end
inited = true
lines = {}
read_input_file(timing_input_file)
end
-- Actual work function, this is what's called by OverLua for each frame
-- f is a video frame object, what we'll be drawing to
-- t is the timestamp of the frame, given in seconds (floating point)
function render_frame(f, t)
-- Just call init() every time, init itself makes sure it doesn't init more than once
init()
-- Find lines to be drawn
-- NOTE: This structure is very simplistic.
-- Advanced karaoke effects will probably need to build an object/effect list
-- as initialisation and then instead go over the list of objects/effects per frame,
-- instead of going over lines.
-- (Ie. preprocessing in the style of ASS karaoke generation.)
for i, line in pairs(lines) do
if line.start_time <= t and line.end_time > t then
-- Initial position of line
local x = 0
local y = f.height - 25
-- Initialise drawing surface and context
local surf = cairo.image_surface_create(f.width, f.height, "argb32")
local c = surf.create_context()
-- Select our font
c.select_font_face(font_name)
c.set_font_size(font_size)
-- Get sizing information for font and line text
if not line.te then line.te = c.text_extents(line.cleantext); line.fe = c.font_extents() end
-- Calculate centered position
x = (f.width - line.te.width) / 2 - line.te.x_bearing
-- Produce text path
c.move_to(x, y)
c.text_path(line.cleantext)
-- Draw a black border
-- It will be centered on the text outline
c.set_line_width(4)
c.set_line_join("round") -- default is "miter"
c.set_source_rgba(0, 0, 0, 1)
-- "preserve" to keep the text path in the context
c.stroke_preserve()
-- Apply a little box blur to the border, effectively \be1
raster.box_blur(surf, 3)
-- Draw a white fill - this will draw over the inner part of the border
c.set_source_rgba(1, 1, 1, 1)
c.fill()
-- Overlay on video
f.overlay_cairo_surface(surf, 0, 0)
end
end
end

View File

@ -1,235 +0,0 @@
--[[
Sample script for OverLua
- demonstrate basic reading in an ASS subtitle file and rendering its lines on the video
Given into the public domain.
(You can do anything you want with this file, with no restrictions whatsoever.
You don't get any warranties of any kind either, though.)
Originally authored by Niels Martin Hansen.
]]
-- Set up some parameters
timing_input_file = overlua_datastring
-- Just the font name to use.
font_name = "Arial"
-- This is height in pixels, I suppose ;)
font_size = 40
-- This is the position of the _baseline_ of the text, neither top, bottom nor center!
ypos = 50
-- Duration of fadein/out in seconds
fadetime = 1
-- Error out if no file name was given (data= in Avisynth invocation)
assert(timing_input_file, "Missing timing input file for sample effect.")
-- ASS file reading stuff
function parsenum(str)
return tonumber(str) or 0
end
function parse_ass_time(ass)
local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)")
return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600
end
function parse_k_timing(text)
local syls = {}
local cleantext = ""
local i = 1
for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do
local syl = {dur = parsenum(timing)/100, text = syltext, i = i}
table.insert(syls, syl)
cleantext = cleantext .. syltext
i = i + 1
end
return syls, cleantext
end
function read_input_file(name)
for line in io.lines(name) do
local start_time, end_time, fx, text = line:match("Dialogue: 0,(.-),(.-),Default,,0000,0000,0000,(.-),(.*)")
if text then
local ls = {}
ls.start_time = parse_ass_time(start_time)
ls.end_time = parse_ass_time(end_time)
ls.fx = fx
ls.rawtext = text
ls.kara, ls.cleantext = parse_k_timing(text)
table.insert(lines, ls)
end
end
end
function init()
if inited then return end
inited = true
lines = {}
read_input_file(timing_input_file)
end
-- Get/create a "sparks" texture, singleton-style
function get_sparks_texture(width, height)
-- Check if it already exists, just return it then
if sparks_texture then return sparks_texture end
-- We'll make a 128x128 black image with some blurred whitish spots on
local surf = cairo.image_surface_create(128, 128, "rgb24")
local c = surf.create_context()
-- Paint it all black
c.set_source_rgb(0,0,0)
c.paint()
-- Then create a very light yellow
c.set_source_rgb(1,1,0.9)
-- And create 50 small, random circles
for i = 1, 50 do
local x, y = math.random(120)+4, math.random(120)+4
c.arc(x, y, 3, 0, 2*math.pi)
c.fill()
end
-- And blur the result
raster.gaussian_blur(surf, 2.5)
-- Then create a texture of it.
-- sparks_texture becomes a global variable
sparks_texture = cairo.pattern_create_for_surface(surf)
sparks_texture.set_extend("repeat")
return sparks_texture
end
function render_frame(f, t)
init()
-- Create a blurred copy of the video frame
local fsurf = f.create_cairo_surface()
raster.gaussian_blur(fsurf, 5)
-- Function to create "wobble" effect on the text
local function blubble_mapper(x, y)
local nx = x + math.sin(x/30 + y/10 + t*2.0)*3
local ny = y + math.cos(y/20 + x/20 + t*2.3)*3
return nx, ny
end
-- Find lines to be drawn
for i, line in pairs(lines) do
-- Check if the line is within time range.
-- "In time range" means starts fadetime seconds later than current time or ends "fadetime" seconds earlier.
if line.start_time <= t+fadetime and line.end_time > t-fadetime then
local x = 0
local y = ypos
-- Prepare a surface to draw on
local surf = cairo.image_surface_create(f.width, 200, "argb32")
local c = surf.create_context()
-- Select the font
c.select_font_face(font_name)
c.set_font_size(font_size)
-- Get the text extents for the line text if we don't have them already
if not line.te then line.te = c.text_extents(line.cleantext); line.fe = c.font_extents() end
-- And calculate the start X to have the line centered
x = (f.width - line.te.width) / 2 - line.te.x_bearing
-- Then make a path for the text
c.move_to(x, y)
c.text_path(line.cleantext)
-- Create the "wobble" effect on the text
-- First get a Path object for the text
local path = c.copy_path()
-- Run the path through the mapping function
path.map_coords(blubble_mapper)
-- Clear the path in the context
c.new_path()
-- And add the modified path back
c.append_path(path)
-- Prepare drawing the text outline
c.set_line_width(8)
-- Red outline
c.set_source_rgba(1, 0, 0, 1)
-- Stroke it but keep the path in the canvas
c.stroke_preserve()
-- Blur this outline
raster.gaussian_blur(surf, 1.5)
-- Prepare another, smaller outline on top
c.set_line_width(3)
-- This one is white
c.set_source_rgba(1, 1, 1, 1)
-- Stroke that one too, but clear the path afterwards
c.stroke()
-- Now loop over the syllables to draw them one by one
local sumdur = line.start_time
for j, syl in pairs(line.kara) do
-- Get the text extents for this syllable
if not syl.te then syl.te = c.text_extents(syl.text) end
-- Prepare the path
c.move_to(x, y)
c.text_path(syl.text)
-- Wobble the path; this will work because the mapper is deterministic on X, Y and timestamp
local path = c.copy_path()
path.map_coords(blubble_mapper)
c.new_path()
c.append_path(path)
-- And advance X position
x = x + syl.te.x_advance
-- Now figure out whether this syllable is the active one or not
-- Use a more complicated test, this makes the first syllable be highlighted
-- also while the line is fading in, and the last while the line is fading out.
if (syl.i == 1 and t < sumdur+syl.dur) or
(syl.i == #line.kara and t > sumdur) or
(t >= sumdur and t < sumdur+syl.dur) then
-- Get the "sparks" texture
local sparks = get_sparks_texture()
-- Prepare a transformation matrix for it
local texmat = cairo.matrix_create()
texmat.init_rotate(t/10)
texmat.scale(3, 3)
sparks.set_matrix(texmat)
-- Use the texture
c.set_source(sparks)
-- And fill the path
c.fill()
else
-- Not the active syllable, fill it with a blurred video frame
-- Remember fsurf is the blurred video frame
c.set_source_surface(fsurf, 0, 0)
c.fill_preserve()
-- Also add a slight darkening to the fill
c.set_source_rgba(0, 0, 0, 0.2)
c.fill()
end
-- Advance the sum of syllable durations
sumdur = sumdur + syl.dur
end
-- Figure out whether we're past the actual start/end time of the line and do some fading then
local final = surf
if t < line.start_time or t > line.end_time then
-- Make invisibility the amount the line is invisible
local invisibility
if t < line.start_time then
invisibility = (line.start_time - t) / fadetime
else
invisibility = (t - line.end_time) / fadetime
end
-- We'll need a new surface object here
final = cairo.image_surface_create(surf.get_width(), surf.get_height(), "argb32")
local c = final.create_context()
-- So we can alpha-blend the original drawn text image onto it using invisibility as alpha
c.set_source_surface(surf, 0, 0)
c.paint_with_alpha(1-invisibility)
-- And then do some heavy blur-out
raster.gaussian_blur(final, invisibility*15)
end
-- Finally just overlay the text image on the video
f.overlay_cairo_surface(final, 0, 0)
end
end
end

View File

@ -1,645 +0,0 @@
--[[
Sample script for OverLua
- advanced karaoke effect, first version of Mendoi-Conclave Gundam 00 OP 1
Given into the public domain.
(You can do anything you want with this file, with no restrictions whatsoever.
You don't get any warranties of any kind either, though.)
Originally authored by Niels Martin Hansen.
While I can't prevent you from it, please don't use this effect script
verbatim or almost-verbatim for own productions. It's mainly intended for
showing techniques, just using it without modifications or with only light
modifications is what I'd consider "cheap".
Be aware that this effect is very slow at rendering, at full 720p resolution
it takes around 3 hours to render on my dual 2.2 GHz Opteron.
This effect is called "OH NOES" by the way. No special meaning to that.
It's best read from bottom to top.
]]
-- Virtual resolution, 720p
local virtual_res_x = 1280
local virtual_res_y = 720
-- Font names
--local latin_font = "Eras Bold ITC"
local latin_font = "Briem Akademi Std Semibold"
local latin_weight = ""
local kanji_font = "DFGSoGei-W9"
-- Font sizes
local romaji_size = 34
local engrish_size = 36
local kanji_size = 30
local tl_size = 36
-- Text positions (vertical only, assumed centered)
local romaji_pos_y = 55
local tl_pos_y = virtual_res_y - 38
local kanji_pos_y = virtual_res_y - 27
local kanji_pos_x = virtual_res_x - 55
local engrish_pos_y = virtual_res_y - 38
timing_input_file = overlua_datastring
assert(timing_input_file, "OH NOES! Missing timing input file.")
-- Here's some mostly standard input file parsing functions
function parsenum(str)
return tonumber(str) or 0
end
function parse_ass_time(ass)
local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)")
return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600
end
function parse_k_timing(text)
local syls = {}
local cleantext = ""
local i = 1
for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do
local syl = {dur = parsenum(timing)/100, text = syltext, i = i}
local maintext, furitext = syltext:match("(.-)|(.+)")
-- Note that there is a light support for Auto4 style furigana
-- in this script, but I haven't maintained it since it ended up being
-- unused.
if maintext and furitext and furitext ~= "" then
syl.text = maintext
syl.furi = furitext
end
table.insert(syls, syl)
cleantext = cleantext .. syl.text
i = i + 1
end
return syls, cleantext
end
function read_input_file(name)
for line in io.lines(name) do
local start_time, end_time, style, fx, text = line:match("Dialogue: 0,(.-),(.-),(.-),,0000,0000,0000,(.-),(.*)")
if text then
local ls = {}
ls.start_time = parse_ass_time(start_time)
ls.end_time = parse_ass_time(end_time)
ls.style = style
ls.fx = fx
ls.rawtext = text
ls.kara, ls.cleantext = parse_k_timing(text)
table.insert(lines, ls)
end
end
end
function init()
if inited then return end
inited = true
lines = {}
read_input_file(timing_input_file)
end
-- Calculate size and position of a line and its syllables
-- Only for horizontal lines, not vertical
function calc_line_metrics(ctx, line, font_name, font_size, pos_y)
if line.pos_x then return end
ctx.select_font_face(font_name, "", latin_weight)
ctx.set_font_size(font_size)
line.te = ctx.text_extents(line.cleantext)
line.fe = ctx.font_extents()
line.pos_x = (virtual_res_x - line.te.width) / 2 - line.te.x_bearing
line.pos_y = pos_y
if #line.kara < 2 then return end
local curx = line.pos_x
for i, syl in pairs(line.kara) do
syl.te = ctx.text_extents(syl.text)
syl.pos_x = curx
syl.center_x = curx + syl.te.x_bearing + syl.te.width/2
syl.center_y = pos_y - line.fe.ascent/2 + line.fe.descent/2
curx = curx + syl.te.x_advance
if syl.furi then
ctx.set_font_size(font_size/2)
syl.furite = ctx.text_extents(syl.furi)
syl.furife = ctx.font_extents()
ctx.set_font_size(font_size)
syl.furi_x = syl.center_x - syl.furite.width/2 - syl.furite.x_bearing
syl.furi_y = pos_y - line.fe.height
end
end
end
-- Paint the image of a line of text to a cairo context
-- Assumes the current path in the context is of the text to be painted
function paint_text(surf, ctx)
ctx.set_line_join("round")
ctx.set_source_rgba(0, 0.2, 0.3, 0.8)
ctx.set_line_width(3)
ctx.stroke_preserve()
raster.gaussian_blur(surf, 1.7)
ctx.set_source_rgba(1, 1, 1, 0.95)
ctx.fill()
end
-- Render one of the zoomed circles with some parameters
-- width and height are of the source area to be visible in the zoomed image
-- Some of this is a bit hacked, I just changed stuff around until it worked,
-- honestly. Analyse it if you want, it still doesn't fully make sense to me ;)
function make_zoomed_ellipsis(srcsurf, center_x, center_y, width, height)
local factor = 0.7
local target_width, target_height = math.ceil(width/factor), math.ceil(height/factor)
local target = cairo.image_surface_create(target_width, target_height, "argb32")
local targetctx = target.create_context()
local src_x, src_y = center_x - width/2, center_y - height/2
-- The basic premise is just taking the source surface, making an upscaling
-- pattern of it and fill a circle with the correct portion of it.
-- Actually pretty simple, it's just getting the numbers right.
local srcpat = cairo.pattern_create_for_surface(srcsurf)
srcpat.set_extend("none")
local srcpatmatrix = cairo.matrix_create()
srcpatmatrix.init_translate(src_x, src_y)
srcpatmatrix.scale(factor, factor)
srcpat.set_matrix(srcpatmatrix)
targetctx.scale(target_width, target_height)
targetctx.arc(0.5, 0.5, 0.5, 0, math.pi*2)
targetctx.scale(1/target_width, 1/target_height)
targetctx.set_source(srcpat)
targetctx.fill()
return target, target_width, target_height
end
-- Duration in seconds for the fade-in/-outs
local fadeinoutdur = 1.2
-- Paint a complete line of karaoke text with all effects, except the
-- zoom circles, to a context. It depends on l.textsurf containing the line
-- image.
-- The main attraction here is the fade-over effect.
function paint_kara_text(f, ctx, t, l)
local fade, fademask, fadetype
-- Check if we're fading in?
if t < l.start_time + fadeinoutdur and l.fx ~= "nofadein" then
-- Calculate the position of the fade
fade = 1 - (l.start_time - t + fadeinoutdur/2) / fadeinoutdur
-- Create a gradient pattern that shows only the relevant part of
-- the line for the fade.
fademask = cairo.pattern_create_linear(virtual_res_x*fade, virtual_res_y/2, virtual_res_x*fade - 100, virtual_res_y/2-30)
fademask.add_color_stop_rgba(0, 1, 1, 1, 0)
fademask.add_color_stop_rgba(0.05, 1, 1, 1, 1)
fademask.add_color_stop_rgba(0.3, 1, 1, 1, 0.2)
fademask.add_color_stop_rgba(1, 1, 1, 1, 1)
fadetype = "in"
end
-- Or fading out?
if l.end_time - fadeinoutdur <= t and l.fx ~= "last" and l.fx~= "nofadeout" then
-- Pretty much the same as for fade in, except that a different part of
-- the line is shown by the produced pattern
fade = (t - l.end_time + fadeinoutdur/2) / fadeinoutdur
fademask = cairo.pattern_create_linear(virtual_res_x*fade, virtual_res_y/2, virtual_res_x*fade + 100, virtual_res_y/2+30)
fademask.add_color_stop_rgba(0, 1, 1, 1, 0)
fademask.add_color_stop_rgba(0.05, 1, 1, 1, 1)
fademask.add_color_stop_rgba(0.3, 1, 1, 1, 0.2)
fademask.add_color_stop_rgba(1, 1, 1, 1, 1)
fadetype = "out"
end
-- Is the line even visible?!
if not fade and (t < l.start_time or l.end_time <= t) then return end
-- A function that calculates the distance between a point and the fade
-- The distance is calculated only along the X axis, so it's not the
-- shortest distance from the point to the "fade line".
-- Used to determine which side of the fade a point is on.
local function fadedist(x, y) -- on X axis
local fade_x_at_y = virtual_res_x*fade - (y - virtual_res_y/2) * 3/10
if fadetype == "in" then
return fade_x_at_y - x
else
return x - fade_x_at_y
end
end
-- We'll be painting the surface with the image of the text
ctx.set_source_surface(l.textsurf, 0, 0)
if fade then
-- So first paint the text with the fading-mask
ctx.mask(fademask)
-- Now generate a slightly different mask for the bloom effect
-- This one goes "both ways", it's not restricted to just one direction;
-- it gets limited later
local bloommask = cairo.pattern_create_linear(virtual_res_x*fade - 200, virtual_res_y/2-60, virtual_res_x*fade + 200, virtual_res_y/2+60)
bloommask.add_color_stop_rgba(0, 1, 1, 1, 0)
bloommask.add_color_stop_rgba(0.5, 1, 1, 1, 1)
bloommask.add_color_stop_rgba(1, 1, 1, 1, 0)
local bloom = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32")
local bc = bloom.create_context()
bc.set_source_surface(l.textsurf, 0, 0)
bc.mask(fademask)
-- Ok, this could be done in a faster way I bet... modify the colour of
-- the bloom effect depending on whether it's a fade in or out,
-- by running a pixel value mapping program over them.
if fadetype == "out" then
raster.pixel_value_map(bloom, "R 0.9 * =R G 0.1 * =G B 0.4 * =B")
else
raster.pixel_value_map(bloom, "R 0.22 * =R G 0.45 * =G B 0.44 * =B")
end
-- Now, three times, do an additive blending of a successively more
-- blurred version of the masked text.
-- Exploit that the text border is very dark, so it won't contribute
-- much at all to the overall result.
-- If the border was brighter a different image of the text would need
-- to be used instead.
-- This is what *really* kills the rendering speed!
ctx.set_operator("add")
raster.gaussian_blur(bloom, 3)
ctx.set_source_surface(bloom, 0, 0)
ctx.mask(bloommask)
raster.gaussian_blur(bloom, 3)
ctx.set_source_surface(bloom, 0, 0)
ctx.mask(bloommask)
raster.gaussian_blur(bloom, 3)
ctx.set_source_surface(bloom, 0, 0)
ctx.mask(bloommask)
ctx.set_operator("over")
else
-- We aren't fading, just do a plain paint of the text image
ctx.paint()
end
return fade, fademask, fadetype, fadedist
end
-- Line style processing functions
-- The entries in this table are matched with the line Style fields to pick
-- an appropriate handling function for the line.
stylefunc = {}
-- This is a generic handling function called by other functions
function stylefunc.generic(f, ctx, t, l, font_name, font_size, pos_y)
-- Fast return for irrelevant lines
if t < l.start_time - fadeinoutdur/2 then return end
if l.end_time + fadeinoutdur/2 <= t then return end
-- Make sure we have the positioning information for the line
calc_line_metrics(ctx, l, font_name, font_size, pos_y)
-- If it's the first time this line is processed, generate the image of it
if not l.textsurf then
-- Create surface for the text image
local textsurf = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32")
local c = textsurf.create_context()
-- Fill it with a path of the text
c.select_font_face(font_name, "", latin_weight)
c.set_font_size(font_size)
c.move_to(l.pos_x, l.pos_y)
c.text_path(l.cleantext)
for i, syl in pairs(l.kara) do
if syl.furi then
c.set_font_size(kanji_size/2)
c.move_to(syl.furi_x, syl.furi_y)
c.text_path(syl.furi)
end
end
paint_text(textsurf, c)
l.textsurf = textsurf
end
-- Check if we're on the last line which needs the "fade all out" effect
if l.fx == "last" and t > l.end_time - 1.5 then
fade_all_out = (l.end_time - t) / 1.5
else
fade_all_out = nil
end
-- Put the actual text onto the video image
local fade, fademask, fadetype, fadedist = paint_kara_text(f, ctx, t, l)
-- Search for a currently highlighted syllable in the text
local sumdur = l.start_time
local cursyl = -1
for i, syl in pairs(l.kara) do
syl.start_time = sumdur
if t >= sumdur and t < sumdur+syl.dur then
cursyl = i
end
sumdur = sumdur + syl.dur
end
if cursyl >= 1 then
-- There is a current syllable
-- Figure out where to put the zoom circle
local syl = l.kara[cursyl]
-- Assume it's at the center of the syllable for now
local zoompoint = {
cx = syl.center_x,
cy = syl.center_y,
size = math.max(syl.te.width, syl.te.height)
}
-- But check if we're time-wise close enough to the previous syllable
-- (if there is one) to do a transition from it
local prevsyl
if cursyl >= 2 then
local prevsyli = cursyl - 1
repeat
prevsyl = l.kara[prevsyli]
prevsyli = prevsyli - 1
until (prevsyl.dur > 0)
if syl.dur > 0.100 and t - syl.start_time < 0.100 then
local pcx, pcy = prevsyl.center_x, prevsyl.center_y
local psize = math.max(prevsyl.te.width, prevsyl.te.height)
local v = (t - syl.start_time) / 0.100
local iv = 1 - v
zoompoint.cx = iv * pcx + v * zoompoint.cx
zoompoint.cy = iv * pcy + v * zoompoint.cy
zoompoint.size = iv * psize + v * zoompoint.size
end
elseif cursyl == 1 and syl.dur > 0.100 and t - syl.start_time < 0.100 then
zoompoint.size = zoompoint.size * (t - syl.start_time) / 0.100
end
zoompoint.size = zoompoint.size * 1.1
-- Check that we aren't fading over and that the center of the zoom is
-- not outside the visible part of the line.
if not fade or fadedist(zoompoint.cx, zoompoint.cy) > 0 then
-- Insert (enable) the zoom point then
table.insert(zoompoints, zoompoint)
end
end
end
-- The Romaji and Engrish styles are both the same generic thing
function stylefunc.Romaji(f, ctx, t, l)
stylefunc.generic(f, ctx, t, l, latin_font, romaji_size, romaji_pos_y)
end
-- Engrish was used for the somewhat-English lines in the original lyrics
-- (I.e. not for the translation.)
function stylefunc.Engrish(f, ctx, t, l)
stylefunc.generic(f, ctx, t, l, latin_font, engrish_size, engrish_pos_y)
end
-- The vertical kanji need a rather different handling
function stylefunc.Kanji(f, ctx, t, l)
-- Again, check for fast skip
if t < l.start_time - fadeinoutdur/2 then return end
if l.end_time + fadeinoutdur/2 <= t then return end
-- Mostly the same as for the generic handling, except that we also
-- calculate the metrics here.
if not l.textsurf then
local textsurf = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32")
local c = textsurf.create_context()
c.select_font_face("@"..kanji_font)
c.set_font_size(kanji_size)
l.te = c.text_extents(l.cleantext)
l.fe = c.font_extents()
l.pos_x = kanji_pos_x
l.pos_y = (virtual_res_y - l.te.width) / 2 - l.te.x_bearing
local cury = l.pos_y
for i, syl in pairs(l.kara) do
syl.te = c.text_extents(syl.text)
syl.pos_y = cury
syl.center_y = cury + syl.te.x_bearing + syl.te.width/2
syl.center_x = kanji_pos_x + l.fe.ascent/2 - l.fe.descent/2
cury = cury + syl.te.x_advance
end
c.translate(l.pos_x, l.pos_y)
c.rotate(math.pi/2)
c.move_to(0,0)
c.text_path(l.cleantext)
paint_text(textsurf, c)
l.textsurf = textsurf
end
local fade, fademask, fadetype, fadedist = paint_kara_text(f, ctx, t, l)
-- Lots of copy-paste (code re-use!) here, slightly adapted for vertical
-- text rather than horizontal stuff.
local sumdur = l.start_time
local cursyl = -1
for i, syl in pairs(l.kara) do
syl.start_time = sumdur
if t >= sumdur and t < sumdur+syl.dur then
cursyl = i
end
sumdur = sumdur + syl.dur
end
if cursyl >= 1 then
local syl = l.kara[cursyl]
local zoompoint = {
cx = syl.center_x,
cy = syl.center_y,
size = math.max(syl.te.width, syl.te.height)
}
local prevsyl
if cursyl >= 2 then
local prevsyli = cursyl - 1
repeat
prevsyl = l.kara[prevsyli]
prevsyli = prevsyli - 1
until (prevsyl.dur > 0)
if syl.dur > 0.100 and t - syl.start_time < 0.100 then
local pcx, pcy = prevsyl.center_x, prevsyl.center_y
local psize = math.max(prevsyl.te.width, prevsyl.te.height)
local v = (t - syl.start_time) / 0.100
local iv = 1 - v
zoompoint.cx = iv * pcx + v * zoompoint.cx
zoompoint.cy = iv * pcy + v * zoompoint.cy
zoompoint.size = iv * psize + v * zoompoint.size
end
elseif cursyl == 1 and syl.dur > 0.100 and t - syl.start_time < 0.100 then
zoompoint.size = zoompoint.size * (t - syl.start_time) / 0.100
end
zoompoint.size = zoompoint.size * 1.1
if not fade or fadedist(zoompoint.cx, zoompoint.cy) > 0 then
table.insert(zoompoints, zoompoint)
end
end
end
-- The translation lines get a somewhat simplified handling again.
-- Originally separated out because some translated lines were split into two
-- stacked lines, but that was dropped again.
function stylefunc.TL(f, ctx, t, l)
if t < l.start_time - fadeinoutdur/2 then return end
if l.end_time + fadeinoutdur/2 <= t then return end
local line1, line2 = l.rawtext, l.rawtext:find("\\n", 1, true)
if line2 then
line1 = l.rawtext:sub(line2+2)
line2 = l.rawtext:sub(1, line2-1)
else
line2 = ""
end
if not l.textsurf then
local textsurf = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32")
local c = textsurf.create_context()
c.select_font_face(latin_font, "", latin_weight)
c.set_font_size(tl_size)
l.te1 = c.text_extents(line1)
l.te2 = c.text_extents(line2)
l.fe = c.font_extents()
l.pos1_x = (virtual_res_x - l.te1.width) / 2 - l.te1.x_bearing
l.pos2_x = (virtual_res_x - l.te2.width) / 2 - l.te2.x_bearing
l.pos1_y = tl_pos_y
l.pos2_y = tl_pos_y - l.fe.height
c.move_to(l.pos1_x, l.pos1_y)
c.text_path(line1)
c.move_to(l.pos2_x, l.pos2_y)
c.text_path(line2)
paint_text(textsurf, c)
l.textsurf = textsurf
end
paint_kara_text(f, ctx, t, l)
end
-- Paint a zoom circle onto the video
-- zp is one of the zoompoint structures generated in the style functions
function draw_zoompoint(surf, ctx, t, zp)
if zp.size < 5 then return end
local zoom, zoom_width, zoom_height = make_zoomed_ellipsis(surf, zp.cx, zp.cy, zp.size*1.2, zp.size*1.2)
local glow = cairo.image_surface_create(zoom_width+50, zoom_height+50, "argb32")
local gc = glow.create_context()
-- Hue-rotation
-- Based on HSL-to-RGB code from Aegisub
local r, g, b
local cspeed = 1/5
local sat = 69
local q = math.floor((cspeed*t) % 6)
local qf = ((cspeed*t) % 6 - q) * (255-sat)
if q == 0 then
r = 255
g = sat + qf
b = sat
elseif q == 1 then
r = sat + 255 - qf
g = 255
b = sat
elseif q == 2 then
r = sat
g = 255
b = sat + qf
elseif q == 3 then
r = sat
g = sat + 255 - qf
b = 255
elseif q == 4 then
r = sat + qf
g = qf
b = 255
elseif q == 5 then
r = 255
g = sat
b = qf + 255 - qf
end
-- Circle-tail-chaser thing
-- Just a bunch of increasingly opaque lines drawn from a center
-- and overlapping enough to create a sense of continuity.
gc.set_line_width(6)
for a = 0, 1, 1/zoom_height do
gc.set_source_rgba(r/255, g/255, b/255, a)
gc.move_to(zoom_width/2+25, zoom_height/2+25)
gc.rel_line_to((zoom_width/2+5) * math.sin(-t*8-a*math.pi*2), (zoom_height/2+5) * math.cos(-t*8-a*math.pi*2))
gc.stroke()
end
-- Love gaussian blur!
raster.gaussian_blur(glow, 2)
-- Use additive blend to put the tail-chaser onto the video
ctx.set_source_surface(glow, zp.cx-zoom_width/2-25, zp.cy-zoom_height/2-25)
local oldop = ctx.get_operator()
ctx.set_operator("add")
ctx.paint()
ctx.set_operator(oldop)
-- And regular blend for the zoom circle
ctx.set_source_surface(zoom, zp.cx-zoom_width/2, zp.cy-zoom_height/2)
ctx.paint()
end
function render_frame(f, t)
-- Make sure we're initialised
init()
-- Clear the list of zoom points
zoompoints = {}
-- Create a surface and context from the video
local worksurf = f.create_cairo_surface()
local workctx = worksurf.create_context()
-- This should make it possible to render on different resolution videos,
-- but I don't think it works
workctx.scale(f.width / virtual_res_x, f.height / virtual_res_y)
-- Run over each input line, processing it
-- This will draw the main text and transition effects
for i, line in pairs(lines) do
if stylefunc[line.style] then
stylefunc[line.style](worksurf, workctx, t, line)
end
end
-- Then go over the zoom points and draw those on top
-- If this isn't done after all lines have been drawn, lines that are close
-- to each other could end up overlapping each others' zoom circles.
for i, zp in pairs(zoompoints) do
draw_zoompoint(worksurf, workctx, t, zp)
end
-- If we're fading it all out, make the karaoke less visible by doing
-- an alpha paint over with the original video frame.
if fade_all_out then
local vidsurf = f.create_cairo_surface()
workctx.set_source_surface(vidsurf, 0, 0)
workctx.paint_with_alpha(1-fade_all_out)
end
-- Finally put the video frame back
f.overlay_cairo_surface(worksurf, 0, 0)
end

View File

@ -1,432 +0,0 @@
--[[
Sample script for OverLua
- advanced karaoke effect, Prism Ark OP kara effect for Anime-Share Fansubs
Given into the public domain.
(You can do anything you want with this file, with no restrictions whatsoever.
You don't get any warranties of any kind either, though.)
Originally authored by Niels Martin Hansen.
Not an extremely advanced effect, but showcases improved parsing of ASS files
and using information from the Style lines for the styling information.
Pretty fast to render at SD resolutions.
As for other effects, please consider that it's not much fun to just re-use
an effect someone else wrote, especially not verbatim. If you elect to use
this sample for something, I ask you to do something original with it. I
can't force you, but please :)
I'm leaving several sections of this script mostly unexplained, because I've
for a large part copied those from the Gundam 00 OP 1 effect (sample3) I did
a few days before this one.
Please see sample3.lua for explanations of those, if you need them.
]]
---- START CONFIGURATION ----
-- Duration of line fade-in/outs, in seconds
local line_fade_duration = 0.5
-- Minimum duration of highlights, also seconds
local syl_highlight_duration = 0.5
---- END CONFIGURATION ----
-- Trim spaces from beginning and end of string
function string.trim(s)
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
-- Script and video resolutions
local sres_x, sres_y
local vres_x, vres_y
-- Stuff read from style definitions
local font_name = {}
local font_size = {}
local font_bold = {}
local font_italic = {}
local pos_v = {}
local vertical = {}
local color1, color2, color3, color4 = {}, {}, {}, {}
-- Input lines
local lines = {}
-- Read input file
function read_field(ass_line, num)
local val, rest = ass_line:match("(.-),(.*)")
if not rest then
return ass_line, ""
elseif num > 1 then
return val, read_field(rest, num-1)
else
return val, rest
end
end
function parsenum(str)
return tonumber(str) or 0
end
function parse_ass_time(ass)
local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)")
return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600
end
function parse_style_color(color)
local res = {r = 0, g = 0, b = 0, a = 0}
local a, b, g, r = color:match("&H(%x%x)(%x%x)(%x%x)(%x%x)")
res.r = tonumber(r, 16) / 255
res.g = tonumber(g, 16) / 255
res.b = tonumber(b, 16) / 255
res.a = 1 - tonumber(a, 16) / 255 -- Alpha has inverse meaning in ASS and cairo
return res
end
function parse_k_timing(text, start_time)
local syls = {}
local cleantext = ""
local i = 1
local curtime = start_time
for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do
local syl = {}
syl.dur = parsenum(timing)/100
syl.text = syltext
syl.i = i
syl.start_time = curtime
syl.end_time = curtime + syl.dur
table.insert(syls, syl)
cleantext = cleantext .. syl.text
i = i + 1
curtime = curtime + syl.dur
end
if cleantext == "" then
cleantext = text
end
return syls, cleantext
end
function read_input_file(name)
for line in io.lines(name) do
-- Try PlayResX/PlayResY
local playresx = line:match("^PlayResX: (.*)")
if playresx then
sres_x = parsenum(playresx)
end
local playresy = line:match("^PlayResY: (.*)")
if playresy then
sres_y = parsenum(playresy)
end
-- Try dialogue line
-- Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
local dialogue_line = line:match("^Dialogue:(.*)")
if dialogue_line then
local layer, start_time, end_time, style, actor, margin_l, margin_r, margin_v, effect, text = read_field(dialogue_line, 9)
local ls = {}
ls.layer = parsenum(layer)
ls.start_time = parse_ass_time(start_time)
ls.end_time = parse_ass_time(end_time)
ls.style = style:trim()
ls.actor = actor:trim()
ls.effect = effect:trim()
ls.rawtext = text
ls.kara, ls.cleantext = parse_k_timing(text, ls.start_time)
table.insert(lines, ls)
end
-- Try style line
-- Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
local style_line = line:match("^Style:(.*)")
if style_line then
local name, font, size, c1, c2, c3, c4, bold, italic, underline, overstrike, scalex, scaley, spacing, angle, borderstyle, outline, shadow, alignment, margin_l, margin_r, margin_v, encoding = read_field(style_line, 22)
-- Direct data
name = name:trim()
font_name[name] = font:trim()
font_size[name] = parsenum(size)
color1[name] = parse_style_color(c1)
color2[name] = parse_style_color(c2)
color3[name] = parse_style_color(c3)
color4[name] = parse_style_color(c4)
font_bold[name] = (parsenum(bold) ~= 0) and "bold" or ""
font_italic[name] = (parsenum(italic) ~= 0) and "italic" or ""
-- Derived data
if font:match("@") then
vertical[name] = true
end
alignment = parsenum(alignment)
if alignment <= 3 then
if vertical[name] then
pos_v[name] = sres_x - parsenum(margin_v)
else
pos_v[name] = sres_y - parsenum(margin_v)
end
elseif alignment <= 6 then
if vertical[name] then
pos_v[name] = sres_x / 2
else
pos_v[name] = sres_y / 2
end
else
pos_v[name] = parsenum(margin_v)
end
end
end
end
function init(f)
if inited then return end
inited = true
vres_x = f.width
vres_y = f.height
read_input_file(overlua_datastring)
end
-- Mask for noise over background
local noisemask, noisemaskctx, noisemaskfilled
-- Additional images to overlay the frame
local frame_overlays = {}
-- Calculate size and position of a line and its syllables
function calc_line_metrics(ctx, line)
if line.pos_x then return end
assert(font_name[line.style], "No font name for style " .. line.style)
ctx.select_font_face(font_name[line.style], font_italic[line.style], font_bold[line.style])
ctx.set_font_size(font_size[line.style])
line.te = ctx.text_extents(line.cleantext)
line.fe = ctx.font_extents()
if vertical[line.style] then
line.pos_x = pos_v[line.style]
line.pos_y = (sres_y - line.te.width) / 2 - line.te.x_bearing
else
line.pos_x = (sres_x - line.te.width) / 2 - line.te.x_bearing
line.pos_y = pos_v[line.style]
end
if #line.kara < 2 then return end
local curx = line.pos_x
local cury = line.pos_y
for i, syl in pairs(line.kara) do
syl.te = ctx.text_extents(syl.text)
if vertical[line.style] then
syl.pos_x = line.pos_x
syl.pos_y = cury
syl.center_x = syl.pos_x + syl.te.x_bearing + syl.te.width/2
syl.center_y = cury - line.fe.ascent/2 + line.fe.descent/2
else
syl.pos_x = curx
syl.pos_y = line.pos_y
syl.center_x = curx + syl.te.x_bearing + syl.te.width/2
syl.center_y = syl.pos_y - line.fe.ascent/2 + line.fe.descent/2
end
curx = curx + syl.te.x_advance
cury = cury + syl.te.x_advance
end
end
-- Style handling functions
local stylefunc = {}
function stylefunc.generic(t, line)
if not line.textsurf then
line.textsurf = cairo.image_surface_create(sres_x, sres_y, "argb32")
local c = line.textsurf.create_context()
c.select_font_face(font_name[line.style], font_italic[line.style], font_bold[line.style])
c.set_font_size(font_size[line.style])
if vertical[line.style] then
c.translate(line.pos_x, line.pos_y)
c.rotate(math.pi/2)
c.move_to(0,0)
else
c.move_to(line.pos_x, line.pos_y)
end
c.text_path(line.cleantext)
local c1, c3 = color1[line.style], color3[line.style]
c.set_source_rgba(c1.r, c1.g, c1.b, c1.a)
c.set_line_join("round")
c.set_line_width(4)
c.stroke_preserve()
c.set_source_rgba(c3.r, c3.g, c3.b, c3.a)
c.fill()
end
-- Fade-factor (alpha for line)
local fade = 0
if t < line.start_time and t >= line.start_time - line_fade_duration then
fade = 1 - (line.start_time - t) / line_fade_duration
elseif t >= line.end_time and t < line.end_time + line_fade_duration then
fade = 1 - (t - line.end_time) / line_fade_duration
elseif t >= line.start_time and t < line.end_time then
fade = 1
else
fade = 0
end
if fade > 0 then
local lo = {} -- line overlay
lo.surf = line.textsurf
lo.x, lo.y = 0, 0
lo.alpha = 0.85 * fade
lo.operator = "over"
lo.name = "line"
table.insert(frame_overlays, lo)
noisemaskctx.set_source_surface(line.textsurf, 0, 0)
noisemaskctx.paint_with_alpha(fade)
noisemaskfilled = true
end
for i, syl in pairs(line.kara) do
if syl.end_time < syl.start_time + syl_highlight_duration then
syl.end_time = syl.start_time + syl_highlight_duration
end
if t >= syl.start_time and t < syl.end_time then
local sw, sh = syl.te.width*3, line.fe.height*3
if vertical[line.style] then
sw, sh = sh, sw
end
local fade = (syl.end_time - t) / (syl.end_time - syl.start_time)
local surf = cairo.image_surface_create(sw, sh, "argb32")
local ctx = surf.create_context()
ctx.select_font_face(font_name[line.style], font_italic[line.style], font_bold[line.style])
ctx.set_font_size(font_size[line.style]*2)
local te, fe = ctx.text_extents(syl.text), ctx.font_extents()
local rx, ry = (sw - te.width) / 2 + te.x_bearing, (sh - fe.height) / 2 + fe.ascent
assert(not vertical[line.style], "Can't handle vertical kara in syllable highlight code - poke jfs if you need this")
ctx.move_to(rx, ry)
ctx.text_path(syl.text)
local path = ctx.copy_path()
local function modpath(x, y)
local cx = math.sin(y/sh*math.pi)
local cy = math.sin(x/sw*math.pi)
cx = cx * x + (1-cx)/2*sw
cy = cy * y + (1-cy)/2*sh
return fade*x+(1-fade)*cx, fade*y+(1-fade)*cy
end
path.map_coords(modpath)
ctx.new_path()
ctx.append_path(path)
local c2, c3 = color2[line.style], color3[line.style]
for b = 8, 1, -3 do
local bs = cairo.image_surface_create(sw, sh, "argb32")
local bc = bs.create_context()
bc.set_source_rgba(c2.r, c2.g, c2.b, c2.a)
bc.append_path(path)
bc.fill()
raster.gaussian_blur(bs, b)
local bo = {}
bo.surf = bs
bo.x = syl.center_x - sw/2
bo.y = syl.center_y - sh/2
bo.alpha = fade
bo.operator = "add"
bo.name = "blur " .. b
table.insert(frame_overlays, bo)
end
ctx.set_source_rgba(c3.r, c3.g, c3.b, c3.a)
ctx.set_line_join("round")
ctx.set_operator("over")
ctx.set_line_width(3*fade)
ctx.stroke_preserve()
ctx.set_operator("dest_out")
ctx.fill()
raster.box_blur(surf, 3, 2)
local so = {}
so.surf = surf
so.x = syl.center_x - sw/2
so.y = syl.center_y - sh/2
so.alpha = 1
so.operator = "over"
so.name = string.format("bord %s %.1f %.1f (%.1f,%.1f)", syl.text, sw, sh, rx, ry)
table.insert(frame_overlays, so)
end
end
end
stylefunc.Romaji = stylefunc.generic
stylefunc.Kanji = stylefunc.generic
stylefunc.English = stylefunc.generic
-- Main rendering function
function render_frame(f, t)
init(f)
local surf = f.create_cairo_surface()
local ctx = surf.create_context()
ctx.scale(vres_x/sres_x, vres_y/sres_y)
-- The line rendering functions add the mask of the line they rendered to
-- this image. It will be used to draw the glow around all lines.
-- It has to be done in this way to avoid the glows from nearby lines to
-- interfere and produce double effect.
noisemask = cairo.image_surface_create(sres_x, sres_y, "argb32")
noisemaskctx = noisemask.create_context()
-- Set to true as soon as anything is put into the noise mask
-- This is merely an optimisation to avoid doing anything when there aren't
-- any lines on screen.
noisemaskfilled = false
-- List of images to overlay on the video frame, after the noise mask.
frame_overlays = {}
for i, line in pairs(lines) do
if stylefunc[line.style] then
calc_line_metrics(ctx, line)
stylefunc[line.style](t, line)
end
end
if noisemaskfilled then
-- Greenish and jittery version of the frame
local noiseimg = f.create_cairo_surface()
raster.box_blur(noiseimg, 5, 2)
raster.pixel_value_map(noiseimg, "G rand 0.4 * + =G G 1 - 1 G ifgtz =G")
-- Blurred version of the noisemask
raster.gaussian_blur(noisemask, 8)
-- Mask additive paint the noise mask: only show the area near the text
-- and have it do interesting things with the video.
ctx.set_source_surface(noiseimg, 0, 0)
ctx.set_operator("add")
ctx.mask_surface(noisemask, 0, 0)
end
-- Paint generated overlays onto the video.
for i, o in pairs(frame_overlays) do
ctx.set_source_surface(o.surf, o.x, o.y)
ctx.set_operator(o.operator)
ctx.paint_with_alpha(o.alpha)
end
f.overlay_cairo_surface(surf, 0, 0)
end

View File

@ -1,14 +0,0 @@
function render_frame(f, t)
local w, h = f.width, f.height
for x = 0, 20 do
for y = 0, 20 do
f[y*w+x] = {x*10,y*10,255}
end
end
for x = 21, 40 do
for y = 0, h-1 do
local r, g, b = f(x,y)
f[y*w+x] = {255-r, 255-g, 255-b}
end
end
end

View File

@ -1,42 +0,0 @@
function render_frame(f, t)
--local surf = cairo.image_surface_create(200,200,"argb32")
local surf = f.create_cairo_surface()
local ctx = surf.create_context()
ctx.set_source_rgba(1, 0.5, 0.5, 0.75)
ctx.move_to(10, 10)
ctx.line_to(10, 200)
ctx.line_to(300, 10)
ctx.close_path()
ctx.fill_preserve()
ctx.set_source_rgba(0,0,0,1)
ctx.stroke()
ctx.push_group()
ctx.select_font_face("Arial", "italic", "")
ctx.set_font_size(35)
ctx.move_to(100,100)
ctx.text_path(string.format("Time: %.3fs", t))
ctx.set_source_rgba(0,1,0,0.8)
ctx.set_line_width(4)
ctx.stroke_preserve()
ctx.set_source_rgba(0,0,1,1)
ctx.fill()
ctx.pop_group_to_source()
ctx.paint_with_alpha(0.5)
f.overlay_cairo_surface(surf, 0, 0)
surf = cairo.image_surface_create(400, 200, "argb32")
ctx = surf.create_context()
ctx.select_font_face("Arial", "", "bold")
ctx.set_source_rgba(1, 1, 1, 1)
ctx.set_font_size(40)
ctx.move_to(100, 100)
ctx.text_path("OverLua")
ctx.fill()
raster.directional_blur(surf, t, 5)
f.overlay_cairo_surface(surf, 200, 50)
end

View File

@ -1,15 +0,0 @@
function render_frame(f, t)
local surf = f.create_cairo_surface()
--raster.gaussian_blur(surf, t)--1+(1-math.cos(t*10))*2)
--raster.invert(surf)
--raster.separable_filter(surf, {-1, 3, -1}, 1)
--raster.directional_blur(surf, t, t/10)
--raster.radial_blur(surf, 200, 200, t/60)
raster.pixel_value_map(surf, "G rand 0.1 * + =G G 1 - 1 G ifgtz =G")
raster.pixel_coord_map(surf, "X .5 rand - + =X Y .5 rand - + =Y")
f.overlay_cairo_surface(surf, 0, 0)
--surf = cairo.image_surface_create(200, 200, "rgb24")
--raster.pixel_value_map(surf, "rand =t0 t0 =R t0 =G t0 =B")
--f.overlay_cairo_surface(surf, 20, 20)
end

View File

@ -1,65 +0,0 @@
function render_frame(f, t)
-- Some data
local basex, basey = 100, 100
local thetext = overlua_datastring or "OverLua R0xx0rz?"
-- Create a new blank surface to draw on
local surf = cairo.image_surface_create(f.width, f.height, "argb32")
-- And a context to go with it. Drawing happens through the context.
local c = surf.create_context()
-- The source video is 16:9 anamorphic, so create a scaling matrix
local scaling = cairo.matrix_create()
scaling.init_scale(f.width/853, f.height/480)
-- And set it for the surface
c.set_matrix(scaling)
-- Create a surface of the video frame...
local fs = f.create_cairo_surface()
-- .. and blur it a bit
raster.gaussian_blur(fs, 2)
-- Then create a pattern from it, that can be used for filling shapes with
local fspattern = cairo.pattern_create_for_surface(fs)
-- Also apply the scaling matrix to the pattern
fspattern.set_matrix(scaling)
-- Prepare a few things
c.select_font_face("Gill Sans Std UltraBold", "", "bold")
c.set_font_size(42)
c.set_line_width(4)
c.set_line_join("round")
-- First stroke the text a bit above and to the left of main
c.move_to(basex-2, basey-2)
c.set_source_rgba(0.8, 0.8, 1, 0.8)
c.text_path(thetext)
c.stroke()
-- Then a bit below and to the right, so it overlaps the first stroking a bit
c.move_to(basex+2, basey+2)
c.set_source_rgba(0.4, 0.4, 0.5, 0.8)
c.text_path(thetext)
c.stroke()
-- And blur them both together, also softening the border
raster.gaussian_blur(surf, 3)
-- Now prepare the main text fill and the real location
c.move_to(basex, basey)
c.text_path(thetext)
-- First a thing black outline
c.set_source_rgba(0, 0, 0, 1)
c.set_line_width(2)
c.stroke_preserve() -- _preserve version to keep the outline
-- Then use the blurred video frame as fill source
c.set_source(fspattern)
c.fill_preserve()
-- And create a very dark colour
-- Adding this on top of the first fill will create a reddening effect
c.set_source_rgba(0.1, 0, 0, 1)
c.set_operator("add")
c.fill()
-- Finally draw the surface onto the video
f.overlay_cairo_surface(surf, 0, 0)
end

View File

@ -1,573 +0,0 @@
/*
* OverLua expression engine
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#include "expression_engine.h"
#include <math.h>
namespace ExpressionEngine {
// Builtin functions
static bool f_abs(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(fabs(v));
return true;
} else {
return false;
}
}
static const Function fs_abs = {"abs", f_abs};
static bool f_floor(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(floor(v));
return true;
} else {
return false;
}
}
static const Function fs_floor = {"floor", f_floor};
static bool f_ceil(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(ceil(v));
return true;
} else {
return false;
}
}
static const Function fs_ceil = {"ceil", f_ceil};
static bool f_log(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(log(v));
return true;
} else {
return false;
}
}
static const Function fs_log = {"log", f_log};
static bool f_exp(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(exp(v));
return true;
} else {
return false;
}
}
static const Function fs_exp = {"exp", f_exp};
static bool f_sqrt(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(sqrt(v));
return true;
} else {
return false;
}
}
static const Function fs_sqrt = {"sqrt", f_sqrt};
static bool f_e(Stack &stack, void *data)
{
stack.push_back(2.71828182845904523536);
return true;
}
static const Function fs_e = {"e", f_e};
static bool f_min(Stack &stack, void *data)
{
if (stack.size() >= 2) {
double v1 = stack.back();
stack.pop_back();
double v2 = stack.back();
stack.pop_back();
if (v1 < v2)
stack.push_back(v1);
else
stack.push_back(v2);
return true;
} else {
return false;
}
}
static const Function fs_min = {"min", f_min};
static bool f_max(Stack &stack, void *data)
{
if (stack.size() >= 2) {
double v1 = stack.back();
stack.pop_back();
double v2 = stack.back();
stack.pop_back();
if (v1 > v2)
stack.push_back(v1);
else
stack.push_back(v2);
return true;
} else {
return false;
}
}
static const Function fs_max = {"max", f_max};
static bool f_pi(Stack &stack, void *data)
{
stack.push_back(3.14159265358979323846);
return true;
}
static const Function fs_pi = {"pi", f_pi};
static bool f_sin(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(sin(v));
return true;
} else {
return false;
}
}
static const Function fs_sin = {"sin", f_sin};
static bool f_cos(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(cos(v));
return true;
} else {
return false;
}
}
static const Function fs_cos = {"cos", f_cos};
static bool f_tan(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(tan(v));
return true;
} else {
return false;
}
}
static const Function fs_tan = {"tan", f_tan};
static bool f_asin(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(asin(v));
return true;
} else {
return false;
}
}
static const Function fs_asin = {"asin", f_asin};
static bool f_acos(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(acos(v));
return true;
} else {
return false;
}
}
static const Function fs_acos = {"acos", f_acos};
static bool f_atan(Stack &stack, void *data)
{
if (stack.size() >= 1) {
double v = stack.back();
stack.pop_back();
stack.push_back(atan(v));
return true;
} else {
return false;
}
}
static const Function fs_atan = {"atan", f_atan};
static bool f_mod(Stack &stack, void *data)
{
if (stack.size() >= 2) {
double v1 = stack.back();
stack.pop_back();
double v2 = stack.back();
stack.pop_back();
stack.push_back(fmod(v2, v1));
return true;
} else {
return false;
}
}
static const Function fs_mod = {"mod", f_mod};
static bool f_rand(Stack &stack, void *data)
{
stack.push_back((double)rand()/RAND_MAX);
return true;
}
static const Function fs_rand = {"rand", f_rand};
static bool f_ifgtz(Stack &stack, void *data)
{
if (stack.size() >= 3) {
double v1 = stack.back();
stack.pop_back();
double v2 = stack.back();
stack.pop_back();
double v3 = stack.back();
stack.pop_back();
if (v3 > 0)
stack.push_back(v2);
else
stack.push_back(v1);
return true;
} else {
return false;
}
}
static const Function fs_ifgtz = {"ifgtz", f_ifgtz};
static bool f_ifeqz(Stack &stack, void *data)
{
if (stack.size() >= 3) {
double v1 = stack.back();
stack.pop_back();
double v2 = stack.back();
stack.pop_back();
double v3 = stack.back();
stack.pop_back();
if (v3 == 0)
stack.push_back(v2);
else
stack.push_back(v1);
return true;
} else {
return false;
}
}
static const Function fs_ifeqz = {"ifeqz", f_ifeqz};
// Machine specification
Specification::Specification()
{
// Add standard functions
functions.push_back(fs_abs);
functions.push_back(fs_floor);
functions.push_back(fs_ceil);
functions.push_back(fs_log);
functions.push_back(fs_exp);
functions.push_back(fs_sqrt);
functions.push_back(fs_e);
functions.push_back(fs_min);
functions.push_back(fs_max);
functions.push_back(fs_pi);
functions.push_back(fs_sin);
functions.push_back(fs_cos);
functions.push_back(fs_tan);
functions.push_back(fs_asin);
functions.push_back(fs_acos);
functions.push_back(fs_atan);
functions.push_back(fs_mod);
functions.push_back(fs_rand);
functions.push_back(fs_ifgtz);
functions.push_back(fs_ifeqz);
}
// Machine runner
bool Machine::Run()
{
// Prepare the stack
std::vector<double> stack;
stack.reserve(16);
// Assume the registers are already initialised like the manager wants
// Execute the program
for (size_t pc = 0; pc < program.size(); pc++) {
Instruction &i = program[pc];
switch (i.op) {
double v1, v2; // values for operators;
case INST_PUSH_CONST:
stack.push_back(i.vd);
break;
case INST_PUSH_REG:
stack.push_back(registers[i.vu]);
break;
case INST_ADD:
if (stack.size() < 2) return false;
v1 = stack.back(); stack.pop_back();
v2 = stack.back(); stack.pop_back();
stack.push_back(v2+v1);
break;
case INST_SUB:
if (stack.size() < 2) return false;
v1 = stack.back(); stack.pop_back();
v2 = stack.back(); stack.pop_back();
stack.push_back(v2-v1);
break;
case INST_MUL:
if (stack.size() < 2) return false;
v1 = stack.back(); stack.pop_back();
v2 = stack.back(); stack.pop_back();
stack.push_back(v2*v1);
break;
case INST_DIV:
if (stack.size() < 2) return false;
v1 = stack.back(); stack.pop_back();
v2 = stack.back(); stack.pop_back();
stack.push_back(v2/v1);
break;
case INST_POW:
if (stack.size() < 2) return false;
v1 = stack.back(); stack.pop_back();
v2 = stack.back(); stack.pop_back();
stack.push_back(pow(v2, v1));
break;
case INST_UNM:
if (stack.size() < 1) return false;
v1 = stack.back(); stack.pop_back();
stack.push_back(-v1);
break;
case INST_CALL:
if (!i.vf(stack, i.vfd))
return false;
break;
case INST_STORE:
if (stack.size() < 1) return false;
v1 = stack.back(); stack.pop_back();
registers[i.vu] = v1;
break;
default:
return false;
}
}
// The registers should now be in the final state
return true;
}
static const char *parse_register_name(const char *source, const std::vector<std::string> &registers, size_t &index)
{
// Find end of the potential register name
// That is, end of string or whitespace
const char *end = source;
while (*end && *end != ' ' && *end != '\t' && *end != '\n' && *end != '\r') end++;
// Now end points to one past last character in name
std::string regname(source, end-source);
if (regname.size() == 0) return 0;
// Check for supplied register name
for (size_t i = 0; i < registers.size(); i++) {
if (regname == registers[i]) {
index = i;
return end;
}
}
// Check for temp register name
if (regname[0] == 't' && regname.size() == 2) {
if (regname[1] >= '0' && regname[1] <= '9') {
index = registers.size() + regname[1] - '0';
return end;
}
}
// Nothing matches
return 0;
}
static const char *parse_function_name(const char *source, const std::vector<Function> &functions, FunctionPtr &funcptr, void *&funcdata)
{
// Find end of the potential function name
// That is, end of string or whitespace
const char *end = source;
while (*end && *end != ' ' && *end != '\t' && *end != '\n' && *end != '\r') end++;
// Now end points to one past last character in name
std::string funcname(source, end-source);
if (funcname.size() == 0) return 0;
// Check for supplied register name
for (size_t i = 0; i < functions.size(); i++) {
if (funcname == functions[i].name) {
funcptr = functions[i].function;
funcdata = functions[i].data;
return end;
}
}
return 0;
}
Machine::Machine(const ExpressionEngine::Specification &spec, const char *source)
{
// Set up the registers
const size_t temp_register_count = 10;
registers.resize(spec.registers.size() + temp_register_count);
program.reserve(64);
// Parse the program
while (*source) {
Instruction i;
// Skip whitespace
while (*source && (*source == ' ' || *source == '\t' || *source == '\n' || *source == '\r')) source++;
if (!*source) break;
// First see if it can be read as a number constant
{
char *tmp = 0;
double v = strtod(source, &tmp);
if (tmp && source != tmp) {
// Could be read, so we have a constant here
source = tmp;
i.op = INST_PUSH_CONST;
i.vd = v;
program.push_back(i);
continue;
}
}
// Not a number constant
// Check for arithmetic operator
if (*source == '+') {
source++;
i.op = INST_ADD;
program.push_back(i);
}
else if (*source == '-') {
source++;
i.op = INST_SUB;
program.push_back(i);
}
else if (*source == '*') {
source++;
i.op = INST_MUL;
program.push_back(i);
}
else if (*source == '/') {
source++;
i.op = INST_DIV;
program.push_back(i);
}
else if (*source == '^') {
source++;
i.op = INST_POW;
program.push_back(i);
}
else if (*source == '~') {
source++;
i.op = INST_UNM;
program.push_back(i);
}
// Check for assignment
else if (*source == '=') {
i.op = INST_STORE;
const char *tmp = parse_register_name(source+1, spec.registers, i.vu);
if (!tmp) throw source; // No register name found, error
source = tmp;
program.push_back(i);
}
// Register push or function call
else {
const char *tmp = parse_register_name(source, spec.registers, i.vu);
if (tmp) {
// Register push
i.op = INST_PUSH_REG;
source = tmp;
program.push_back(i);
}
else {
tmp = parse_function_name(source, spec.functions, i.vf, i.vfd);
if (tmp) {
// Function call
i.op = INST_CALL;
source = tmp;
program.push_back(i);
}
else {
// Nothing, error
throw source;
}
}
}
} /* end while */
} /* end Machine::Machine() */
};

View File

@ -1,116 +0,0 @@
/*
* OverLua expression engine
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#ifndef EXPRESSION_ENGINE_H
#define EXPRESSION_ENGINE_H
#include <vector>
#include <string>
namespace ExpressionEngine {
// The stack passed around
typedef std::vector<double> Stack;
// Type of callable functions
typedef bool (*FunctionPtr)(Stack &stack, void *data);
// A callable function
struct Function {
// The name of the function
const char *name;
// Function pointer; null for builtins
FunctionPtr function;
// Function data
void *data;
};
// A machine specification that can compile programs
struct Specification {
// The input and output register names
// The index of a register name in this vector translates to the register's number in the machine
std::vector<std::string> registers;
// The callable functions
std::vector<Function> functions;
// Just adds standard functions to functions vector
Specification();
};
// Operation type
enum Opcode {
INST_PUSH_CONST = 0,
INST_PUSH_REG,
INST_ADD,
INST_SUB,
INST_MUL,
INST_DIV,
INST_POW,
INST_UNM, // unary minus
INST_CALL,
INST_STORE
};
// A single program instruction
struct Instruction {
Opcode op;
union {
double vd; // double value, for const push
size_t vu; // uint value, for register indices
struct {
FunctionPtr vf; // function to call
void *vfd; // data for function
};
};
};
// A program is a sequence of instructions
typedef std::vector<Instruction> Program;
// A machine running a program
struct Machine {
// Values in the registers
std::vector<double> registers;
// The program
Program program;
// Run the machine.
// Return true is no errors, false if error
bool Run();
// Create a machine from a specification and a program source
Machine(const Specification &spec, const char *source);
// Create a blank machine
Machine() { }
};
};
#endif

View File

@ -1,668 +0,0 @@
/*
* OverLua RGB(A) image interface
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#ifndef VIDEO_FRAME_H
#define VIDEO_FRAME_H
#include "../lua51/src/lua.h"
#include "../lua51/src/lauxlib.h"
#include "cairo_wrap.h"
#include <stddef.h>
#include <memory.h>
#include <stdint.h>
#include <omp.h>
#include <math.h>
#include <assert.h>
// Forward
class BaseImageAggregate;
// Supported pixel formats
namespace PixelFormat {
// A constant value with a fake assignment operator, taking up no space
template <class T, T v>
struct NopAssigningConstant {
operator T() const { return v; }
void operator = (const T &n) { }
};
typedef NopAssigningConstant<uint8_t,255> ROA; // "read only alpha"
typedef NopAssigningConstant<uint8_t,0> ROC; // "read only colour"
// 24 bit formats
struct RGB {
uint8_t r, g, b;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline ROA A() const { return ROA(); }
RGB() : r(0), g(0), b(0) { }
template <class PixFmt> RGB(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); }
};
struct BGR {
uint8_t b, g, r;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline ROA A() const { return ROA(); }
BGR() : r(0), g(0), b(0) { }
template <class PixFmt> BGR(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); }
};
// 32 bit alpha-less formats
struct RGBX {
uint8_t r, g, b, x;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline ROA A() const { return ROA(); }
RGBX() : r(0), g(0), b(0) { }
template <class PixFmt> RGBX(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); }
};
struct BGRX {
uint8_t b, g, r, x;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline ROA A() const { return ROA(); }
BGRX() : r(0), g(0), b(0) { }
template <class PixFmt> BGRX(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); }
};
struct XRGB {
uint8_t x, r, g, b;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline ROA A() const { return ROA(); }
XRGB() : r(0), g(0), b(0) { }
template <class PixFmt> XRGB(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); }
};
struct XBGR {
uint8_t x, b, g, r;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline ROA A() const { return ROA(); }
XBGR() : r(0), g(0), b(0) { }
template <class PixFmt> XBGR(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); }
};
// 32 bit with alpha
struct RGBA {
uint8_t r, g, b, a;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline uint8_t &A() { return a; } inline uint8_t A() const { return a; }
RGBA() : r(0), g(0), b(0), a(0) { }
template <class PixFmt> RGBA(const PixFmt &src) { a = src.a; r = src.r; g = src.g; b = src.b; }
};
struct BGRA {
uint8_t b, g, r, a;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline uint8_t &A() { return a; } inline uint8_t A() const { return a; }
BGRA() : r(0), g(0), b(0), a(0) { }
template <class PixFmt> BGRA(const PixFmt &src) { a = src.A(); r = src.R(); g = src.G(); b = src.B(); }
};
struct ARGB {
uint8_t a, r, g, b;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline uint8_t &A() { return a; } inline uint8_t A() const { return a; }
ARGB() : r(0), g(0), b(0), a(0) { }
template <class PixFmt> ARGB(const PixFmt &src) { a = src.A(); r = src.R(); g = src.G(); b = src.B(); }
};
struct ABGR {
uint8_t a, b, g, r;
inline uint8_t &R() { return r; } inline uint8_t R() const { return r; }
inline uint8_t &G() { return g; } inline uint8_t G() const { return g; }
inline uint8_t &B() { return b; } inline uint8_t B() const { return b; }
inline uint8_t &A() { return a; } inline uint8_t A() const { return a; }
ABGR() : r(0), g(0), b(0), a(0) { }
template <class PixFmt> ABGR(const PixFmt &src) { a = src.A(); r = src.R(); g = src.G(); b = src.B(); }
};
// Alpha only
struct A8 {
uint8_t a;
inline ROC R() const { return ROC(); }
inline ROC G() const { return ROC(); }
inline ROC B() const { return ROC(); }
inline uint8_t &A() { return a; } inline uint8_t A() const { return a; }
A8() : a(0) { }
template <class PixFmt> A8(const PixFmt &src) { a = src.A(); }
};
// cairo types
// These are only true for little endian architectures
// If OverLua is ever to run on big endian archs some conditional compiling should be used here
typedef BGRX cairo_rgb24;
typedef BGRA cairo_argb32;
};
// Support any interleaved RGB format with 8 bit per channel
// You usually don't want to instance this class directly,
// look at OverLuaFrameAggregate defined below
template<class PixFmt>
class BaseImage {
public:
typedef BaseImage<PixFmt> MyType;
// video properties
int width;
int height;
ptrdiff_t stride;
unsigned char *data;
// Access a pixel value
inline const PixFmt &Pixel(int x, int y) const
{
return *((PixFmt*)(data + y*stride) + x)
}
inline PixFmt &Pixel(int x, int y)
{
return *((PixFmt*)(data + y*stride) + x);
}
BaseImage(unsigned _width, unsigned _height, ptrdiff_t _stride, unsigned char *_data)
: width(_width), height(_height), stride(_stride), data(_data)
{
owndata = false;
// nothing further to init
}
BaseImage(const MyType &src, bool copydata = false)
{
width = src.width;
height = src.height;
stride = src.stride;
owndata = copydata;
if (copydata) {
data = new unsigned char[height*stride];
memcpy(data, src.data, height*stride);
} else {
data = src.data;
}
}
~BaseImage()
{
if (owndata)
delete[] data;
}
// should never be called more than once on the same C++ object
void CreateLuaObject(lua_State *L, BaseImageAggregate *aggregate = 0)
{
// create userdata object
MyType **ud = (MyType**)lua_newuserdata(L, sizeof(MyType*));
*ud = this;
// create metatable
lua_newtable(L);
lua_pushcclosure(L, lua_indexget, 0);
lua_setfield(L, -2, "__index");
lua_pushcclosure(L, lua_indexset, 0);
lua_setfield(L, -2, "__newindex");
lua_pushcclosure(L, lua_getpixel, 0);
lua_setfield(L, -2, "__call");
lua_pushcclosure(L, lua_finalize, 0);
lua_setfield(L, -2, "__gc");
if (aggregate) {
lua_pushlightuserdata(L, aggregate);
lua_setfield(L, -2, "image");
}
lua_setmetatable(L, -2);
}
private:
bool owndata;
// set a pixel colour
static int lua_indexset(lua_State *L)
{
// first arg = object
// second arg = index
// third arg = value
MyType **ud = (MyType**)lua_touserdata(L, 1);
if (lua_isnumber(L, 2)) {
if (lua_istable(L, 3)) {
int n = (int)lua_tointeger(L, 2);
int x = n % (*ud)->width;
int y = n / (*ud)->width;
if (x < 0 || y < 0 || x >= (*ud)->width || y >= (*ud)->height) return 0;
// read first three entries from table
PixFmt color;
lua_pushnil(L);
if (!lua_next(L, 3)) goto badtable;
if (!lua_isnumber(L, -1)) goto badtable;
color.r = (unsigned char)lua_tointeger(L, -1);
lua_pop(L, 1);
if (!lua_next(L, 3)) goto badtable;
if (!lua_isnumber(L, -1)) goto badtable;
color.g = (unsigned char)lua_tointeger(L, -1);
lua_pop(L, 1);
if (!lua_next(L, 3)) goto badtable;
if (!lua_isnumber(L, -1)) goto badtable;
color.b = (unsigned char)lua_tointeger(L, -1);
lua_pop(L, 2);
(*ud)->Pixel(x, y) = color;
return 0;
} else {
badtable:
lua_pushliteral(L, "Value set into image pixel must be a table with 3 entries");
lua_error(L);
return 0;
}
}
lua_pushliteral(L, "Undefined field in image");
lua_error(L);
return 0;
}
// get a pixel colour or some other property
static int lua_indexget(lua_State *L)
{
// first arg = object
// second arg = index
MyType **ud = (MyType**)lua_touserdata(L, 1);
if (lua_type(L, 2) == LUA_TSTRING) {
const char *fieldname = lua_tostring(L, 2);
if (strcmp(fieldname, "width") == 0) {
lua_pushnumber(L, (*ud)->width);
} else if (strcmp(fieldname, "height") == 0) {
lua_pushnumber(L, (*ud)->height);
} else if (strcmp(fieldname, "copy") == 0) {
lua_pushvalue(L, 1);
lua_pushcclosure(L, lua_copyfunc, 1);
} else if (strcmp(fieldname, "create_cairo_surface") == 0) {
lua_pushvalue(L, 1);
lua_pushcclosure(L, lua_create_cairo_surface, 1);
} else if (strcmp(fieldname, "overlay_cairo_surface") == 0) {
lua_pushvalue(L, 1);
lua_pushcclosure(L, lua_overlay_cairo_surface, 1);
} else {
lua_pushfstring(L, "Undefined field name in image: %s", fieldname);
lua_error(L);
}
return 1;
}
lua_pushfstring(L, "Unhandled field type indexing image: %s", lua_typename(L, lua_type(L, 2)));
lua_error(L);
return 0;
}
static int lua_getpixel(lua_State *L)
{
// first arg = object
// second arg = x
// third arg = y
MyType **ud = (MyType**)lua_touserdata(L, 1);
int x = luaL_checkint(L, 2);
int y = luaL_checkint(L, 3);
if (x < 0 || y < 0 || x >= (*ud)->width || y >= (*ud)->height) {
lua_pushinteger(L, 0);
lua_pushinteger(L, 0);
lua_pushinteger(L, 0);
} else {
const PixFmt &p = (*ud)->Pixel(x, y);
lua_pushinteger(L, p.r);
lua_pushinteger(L, p.g);
lua_pushinteger(L, p.b);
}
return 3;
}
static int lua_finalize(lua_State *L)
{
MyType **ud = (MyType**)lua_touserdata(L, 1);
delete *ud;
return 0;
}
static int lua_copyfunc(lua_State *L)
{
MyType **ud = (MyType**)lua_touserdata(L, lua_upvalueindex(1));
MyType *copy = new MyType(**ud, true);
copy->CreateLuaObject(L);
return 1;
}
static int lua_create_cairo_surface(lua_State *L)
{
MyType **ud = (MyType**)lua_touserdata(L, lua_upvalueindex(1));
// Create a new surface of same resolution
// Always RGB24 format since we don't support video with alpha
cairo_surface_t *surf = cairo_image_surface_create(CAIRO_FORMAT_RGB24, (*ud)->width, (*ud)->height);
if (!surf || cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS) {
lua_pushliteral(L, "Unable to create cairo surface from image");
lua_error(L);
return 0;
}
// Prepare copying pixels from frame to surface
unsigned char *surfdata = cairo_image_surface_get_data(surf);
int surfstride = cairo_image_surface_get_stride(surf);
// Copy pixels
int height = (*ud)->height;
int width = (*ud)->width;
#pragma omp parallel for
for (int y = 0; y < height; y++) {
PixFmt *ipix = (PixFmt*)((*ud)->data + y*((*ud)->stride));
PixelFormat::cairo_rgb24 *opix = (PixelFormat::cairo_rgb24*)(surfdata + y*surfstride);
for (int x = 0; x < width; x++) {
*opix++ = *ipix++;
}
}
cairo_surface_mark_dirty(surf);
// Create Lua object
LuaCairoSurface *lsurf = new LuaCairoSurface(L, surf);
// Release our reference to the surface
cairo_surface_destroy(surf);
// Return it to Lua
return 1;
}
static int lua_overlay_cairo_surface(lua_State *L)
{
// Get inputs
MyType **ud = (MyType**)lua_touserdata(L, lua_upvalueindex(1));
LuaCairoSurface *surfwrap = LuaCairoSurface::GetObjPointer(L, 1);
if (!surfwrap) {
lua_pushliteral(L, "Argument to overlay_cairo_surface is not a cairo surface");
lua_error(L);
return 0;
}
int xpos = luaL_checkint(L, 2);
int ypos = luaL_checkint(L, 3);
// More argument checks
cairo_surface_t *surf = surfwrap->GetSurface();
if (cairo_surface_get_type(surf) != CAIRO_SURFACE_TYPE_IMAGE) {
lua_pushliteral(L, "Argument to overlay_cairo_surface is not a cairo image surface");
lua_error(L);
return 0;
}
// Prepare some data
int fwidth = (*ud)->width, fheight = (*ud)->height;
int swidth = cairo_image_surface_get_width(surf), sheight = cairo_image_surface_get_height(surf);
int sstride = cairo_image_surface_get_stride(surf);
// Prepare and get read pointer for source image
cairo_surface_flush(surf);
unsigned char *sdata = cairo_image_surface_get_data(surf);
// Check that the overlaid surface won't be entirely outside the frame
if (xpos <= -swidth || ypos <= -sheight || xpos > fwidth || ypos > fheight)
return 0;
// Pick overlay algorithm
cairo_format_t sformat = cairo_image_surface_get_format(surf);
if (sformat == CAIRO_FORMAT_ARGB32) {
// This has pre-multipled alpha
int fy = ypos; // frame y
if (fy < 0) fy = 0, sdata -= ypos, sheight -= ypos;
int slines_to_compose = sheight, flines_to_compose = fheight;
int lines_to_compose = (slines_to_compose<flines_to_compose)?slines_to_compose:flines_to_compose;
#pragma omp parallel for
for (int composition_line = 0; composition_line < lines_to_compose; composition_line++) {
PixelFormat::cairo_argb32 *sline = (PixelFormat::cairo_argb32*)(sdata + composition_line*sstride);
int fx = xpos;
int sx = 0;
if (fx < 0) fx = 0, sx = -xpos;
for ( ; sx < swidth && fx < fwidth; fx++, sx++) {
PixFmt &pix = (*ud)->Pixel(fx, fy+composition_line);
unsigned char a = 0xff - sline[sx].a;
pix.r = sline[sx].r + a*pix.r/255;
pix.g = sline[sx].g + a*pix.g/255;
pix.b = sline[sx].b + a*pix.b/255;
}
}
}
else if (sformat == CAIRO_FORMAT_RGB24) {
// Assume opaque alpha for all pixels
int fy = ypos; // frame y
if (fy < 0) fy = 0, sdata -= ypos, sheight -= ypos;
int slines_to_compose = sheight, flines_to_compose = fheight;
int lines_to_compose = (slines_to_compose<flines_to_compose)?slines_to_compose:flines_to_compose;
#pragma omp parallel for
for (int composition_line = 0; composition_line < lines_to_compose; composition_line++) {
PixelFormat::cairo_rgb24 *sline = (PixelFormat::cairo_rgb24*)(sdata + composition_line*sstride);
int fx = xpos;
int sx = 0;
if (fx < 0) fx = 0, sx = -xpos;
for ( ; sx < swidth && fx < fwidth; fx++, sx++) {
(*ud)->Pixel(fx, fy+composition_line) = sline[sx];
}
}
}
else if (sformat == CAIRO_FORMAT_A8) {
// This one is problematic - it doesn't contain any colour information
// Two primary choices would be to fill with either black or white,
// but neither would be an optimum solution.
// A third option would be to take a fourth argument to this function,
// specifying the colour to be used.
lua_pushliteral(L, "8 bpp alpha images are not (yet) supported for overlay operations");
lua_error(L);
return 0;
}
else if (sformat == CAIRO_FORMAT_A1) {
lua_pushliteral(L, "1 bpp alpha images are not supported for overlay operations");
lua_error(L);
return 0;
}
else {
lua_pushliteral(L, "Unknown source image format for overlay operation");
lua_error(L);
return 0;
}
return 0;
}
};
// Now something so we can pretend all images have the same pixel format
// and can pass around pointers to objects of one fixed base class.
class BaseImageAggregate {
public:
virtual PixelFormat::ARGB GetPixel(int x, int y) = 0;
virtual void SetPixel(int x, int y, const PixelFormat::ARGB &val) = 0;
virtual unsigned GetWidth() = 0;
virtual unsigned GetHeight() = 0;
virtual void CreateLuaObject(lua_State *L) = 0;
};
template <class PixFmt>
class BaseImageAggregateImpl : public BaseImageAggregate {
public:
typedef BaseImage<PixFmt> ImageType;
private:
ImageType *frame;
bool ownframe;
public:
BaseImageAggregateImpl(unsigned _width, unsigned _height, ptrdiff_t _stride, unsigned char *_data)
{
frame = new ImageType(_width, _height, _stride, _data);
ownframe = true;
}
BaseImageAggregateImpl(ImageType *_frame)
{
frame = _frame;
ownframe = false;
}
PixelFormat::ARGB GetPixel(int x, int y)
{
return PixelFormat::ARGB(frame->Pixel(x, y));
}
void SetPixel(int x, int y, const PixelFormat::ARGB &val)
{
frame->Pixel(x, y) = PixFmt(val);
}
unsigned GetWidth()
{
return frame->width;
}
unsigned GetHeight()
{
return frame->height;
}
void CreateLuaObject(lua_State *L)
{
frame->CreateLuaObject(L, this);
}
};
// All common, sensible formats
typedef BaseImageAggregateImpl<PixelFormat::RGB> ImageRGB;
typedef BaseImageAggregateImpl<PixelFormat::BGR> ImageBGR;
typedef BaseImageAggregateImpl<PixelFormat::RGBX> ImageRGBX;
typedef BaseImageAggregateImpl<PixelFormat::BGRX> ImageBGRX;
typedef BaseImageAggregateImpl<PixelFormat::XRGB> ImageXRGB;
typedef BaseImageAggregateImpl<PixelFormat::XBGR> ImageXBGR;
typedef BaseImageAggregateImpl<PixelFormat::RGBA> ImageRGBA;
typedef BaseImageAggregateImpl<PixelFormat::BGRA> ImageBGRA;
typedef BaseImageAggregateImpl<PixelFormat::ARGB> ImageARGB;
typedef BaseImageAggregateImpl<PixelFormat::ABGR> ImageABGR;
// Access pixels with various edge conditions
namespace EdgeCondition {
template<class PixFmt>
struct Blackness {
static inline PixFmt &get(BaseImage<PixFmt> &img, int x, int y)
{
if (x < 0 || y < 0 || x >= img.width || x >= img.height) {
return PixFmt(); // all construct with all zeroes
} else {
return img.Pixel(x,y);
}
}
};
template<class PixFmt>
struct Closest {
static inline PixFmt &get(BaseImage<PixFmt> &img, int x, int y)
{
if (x < 0) x = 0;
if (y < 0) y = 0;
if (x >= img.width) x = img.width-1;
if (y >= img.height) y = img.height - 1;
return img.Pixel(x,y);
}
};
template<class PixFmt>
struct Repeat {
static inline PixFmt &get(BaseImage<PixFmt> &img, int x, int y)
{
while (x < 0) x += img.width;
while (y < 0) y += img.height;
while (x >= img.width) x -= img.width;
while (y >= img.height) y -= img.height;
return img.Pixel(x,y);
}
};
template<class PixFmt>
struct Mirror {
static inline PixFmt &get(BaseImage<PixFmt> &img, int x, int y)
{
while (x < 0) x += img.width*2;
while (y < 0) y += img.height*2;
while (x >= img.width*2) x -= img.width*2;
while (y >= img.height*2) y -= img.height*2;
if (x >= img.width) x = img.width*2 - x;
if (y >= img.height) y = img.height*2 - y;
return img.Pixel(x,y);
}
};
}
// FIXME: this is completely broken, the compiler won't accept it
// when instantiated with one of the EdgeCondition functions for EdgeCond
template<class PixFmt, typename EdgeCond>
inline PixFmt GetPixelBilinear(BaseImage<PixFmt> &img, double x, double y)
{
PixFmt res;
double xpct = x - floor(x), ypct = y - floor(y);
if (xpct == 0 && ypct == 0)
return EdgeCond::get(img, (int)x, (int)y);
const PixFmt &src11 = EdgeCond::get(img, (int)x, (int)y);
const PixFmt &src12 = EdgeCond::get(img, (int)x, 1+(int)y);
const PixFmt &src21 = EdgeCond::get(img, 1+(int)x, (int)y);
const PixFmt &src22 = EdgeCond::get(img, 1+(int)x, 1+(int)y);
res.R() = (uint8_t)((1-xpct) * (1-ypct) * src11.R() + (1-xpct) * ypct * src12.R() + xpct * (1-ypct) * src21.R() + xpct * ypct * src22.R());
res.G() = (uint8_t)((1-xpct) * (1-ypct) * src11.G() + (1-xpct) * ypct * src12.G() + xpct * (1-ypct) * src21.G() + xpct * ypct * src22.G());
res.B() = (uint8_t)((1-xpct) * (1-ypct) * src11.B() + (1-xpct) * ypct * src12.B() + xpct * (1-ypct) * src21.B() + xpct * ypct * src22.B());
res.A() = (uint8_t)((1-xpct) * (1-ypct) * src11.A() + (1-xpct) * ypct * src12.A() + xpct * (1-ypct) * src21.A() + xpct * ypct * src22.A());
return res;
}
#endif

View File

@ -1,134 +0,0 @@
--[[
assfile.lua - Functions for parsing ASS format subtitles
Part of OverLua, licensed under GPLv2
]]
module "assfile"
-- Parsing helper functions
local function trim(s)
return (s:gsub("^[ \t\r\n]*(.-)[ \t\r\n]*$", "%1"))
end
local function num(s)
return tonumber(trim(s)) or 0
end
-- Which file format we're working with.
-- Changing this changes the behaviour of various parsing functions.
-- Valid values: "SSA4", "ASS", "ASS2", "ASS3", "AS5"
-- Other versions aren't supported.
-- This is usually automatically set by the whole-file parsing functions.
format = "SSA4"
-- Create a solid colour fill style
-- Colours are "cairo compatible", ie. range 0 to 1
-- A colour never stores alpha, that's a separate property
function color(r, g, b, a)
r, g, b, a = r or 0, g or 0, b or 0, a or 0
return {class="solid", r=r, g=g, b=b, a=a}
end
-- Parse a colour in SSA, ASS or HTML format
function parse_color(s)
end
-- Base style, this defines the defaults used for undefined fields in read-in styles
default_style = {
-- Default style has no name
name = nil,
-- Well, sensible on Windows
font_face = "Arial",
font_size = "24",
font_language = "C", -- Language to assume text is in, affects some rendering
font_vertical = false, -- Vertical layout, replaces use of "@-fonts"
font_bold = false,
font_italic = false,
font_underline = false,
font_overstrike = false,
-- Fill style
fill1 = color(1, 1, 1, 1), -- Fill, white
fill2 = color(1, 0, 0, 1), -- Pre-karaoke fill, red
fill3 = color(0, 0, 0, 1), -- Outline, black
fill4 = color(0, 0, 0, 0.5), -- Shadow, semi-transparent black
-- Border size
outline = 2,
shadow = 2,
opaque_box = false,
-- Scaling
scale_x = 1.00,
scale_y = 1.00,
-- Spacing
spacing_char = 0, -- Extra inter-character spacing
spacing_line = 0, -- Extra inter-line spacing
baseline_shift = 0, -- Shift baseline this amount against line advance direction
-- Text positioning
margin_l = 10,
margin_r = 10,
margin_t = 10,
margin_b = 10,
align_x = 0.5, -- Bouding box centered between left/right margins
align_y = 1.0, -- Bounding box placed at bottom of screen
inner_align_x = 0.5, -- Lines centered inside bounding box
inner_align_y = 1.0, -- Lines at bottom of bounding box
break_style = "smart_top", -- "Smart-wrap", earlier lines wider (alt. "smart_bottom", "simple", "none")
pos_rel = "video", -- Positioning relative to video frame (alt. "screen")
pos_x = nil, -- Don't override positioning
pos_y = nil,
-- Rotation/reshaping
origin = nil, -- Automatic, at center of text
angle_x = 0,
angle_y = 0,
angle_z = 0,
shear_x = 0,
shear_y = 0,
baseline_transform = nil,
bounding_box_transform = nil,
-- Misc.
blend_mode = "normal", -- Alt. "add", "multiply"
clip_rect = nil,
clip_shape = nil,
blur = 0,
-- Animation
fade = nil,
animation = nil
}
-- Parse a Style line
function read_style(t)
if format == "AS5" then
error("Found Style line in an AS5 file, where it's unsupported.\nLine: %s", t)
elseif format == "SSA4" then
local name, font_face, font_size, color1, color2, color3, color4,
bold, italic, underline, overstrike, border, outline, shadow,
align, margin_l, margin_r, margin_v, alpha, encoding
= t:match("^.-:(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$")
name = trim(name)
font_face = trim(name)
font_size = num(font_size)
end
end
-- Parse a StyleEx line
function read_style_ex(t)
if format ~= "ASS3" and format ~= "AS5" then
error("Found StyleEx line in format that doesn't support it.\nFormat is \"%s\".\nLine is: %s", format, t)
end
end
-- Merge two styles by "overlaying" a style upon a base
-- Produces a new style
-- Fields where the overlay has a defined value, the output style has the value of overlay,
-- but in fields where overlay is nil, the output has the base value.
-- (Pretty much "out.field = overlay.field or base.field".)
-- Animation lists are merged however, but this may produce weird results
-- if the animations overlap in non-trivial ways. (Just pretend this says "undefined behaviour.")
function merge_styles(base, overlay)
end

View File

@ -1 +0,0 @@
This directory contains various helper scripts for use with OverLua.

View File

@ -1,118 +0,0 @@
/*
* C++ interface for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#include "overlua.h"
#include <stdio.h>
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN
#include <windows.h>
#endif
struct FileScriptReader {
static const size_t datasize = 0x10000;
char *data;
FILE *file;
FileScriptReader() { data = new char[datasize]; }
~FileScriptReader() { delete[] data; }
static const char *reader(lua_State *L, void *data, size_t *size)
{
FileScriptReader *self = (FileScriptReader*)data;
*size = fread(self->data, 1, self->datasize, self->file);
if (*size) return self->data;
else return 0;
}
};
OverLuaScript::OverLuaScript(const char *filename, const char *datastring)
{
FileScriptReader reader;
#ifdef WIN32
wchar_t *filenamew = new wchar_t[MAX_PATH];
MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenamew, MAX_PATH);
reader.file = _wfopen(filenamew, L"r");
delete[] filenamew;
#else
reader.file = fopen(filename, "r");
#endif
Create(reader, filename, datastring);
fclose(reader.file);
}
struct MemScriptReader {
const void *memdata;
size_t memdatasize;
static const char *reader(lua_State *L, void *data, size_t *size)
{
MemScriptReader *self = (MemScriptReader*)data;
*size = self->memdatasize;
self->memdatasize = 0;
if (*size) return (const char*)self->memdata;
else return 0;
}
};
int OverLuaScript::lua_debug_print(lua_State *L)
{
const char *str = luaL_checkstring(L, 1);
#ifdef WIN32
OutputDebugStringA(str); // ought to be W version but conversion is such a hassle
#else
printf(str);
#endif
return 0;
}
OverLuaScript::OverLuaScript(const void *data, size_t length, const char *datastring)
{
MemScriptReader reader;
reader.memdata = data;
reader.memdatasize = length;
Create(reader, "Memory script", datastring);
}
OverLuaScript::~OverLuaScript()
{
lua_close(L);
}
void OverLuaScript::RenderFrameRGB(BaseImageAggregate &frame, double time)
{
lua_getglobal(L, "render_frame");
frame.CreateLuaObject(L);
lua_pushnumber(L, time);
if (lua_pcall(L, 2, 0, 0)) {
const char *err = lua_tostring(L, -1);
throw err;
}
lua_gc(L, LUA_GCCOLLECT, 0);
}

View File

@ -1,96 +0,0 @@
/*
* C++ interface for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#ifndef OVERLUA_H
#define OVERLUA_H
// assume we're in aegisub's svn tree and
// are building with the aegisub patched lua
#include "../lua51/src/lua.h"
#include "../lua51/src/lualib.h"
#include "../lua51/src/lauxlib.h"
#include <stddef.h>
#include "image.h"
#include "cairo_wrap.h"
#include "raster_ops.h"
class OverLuaScript {
private:
lua_State *L;
// No default constructor
OverLuaScript() { }
template <class ScriptReaderClass>
void Create(ScriptReaderClass &reader, const char *chunkname, const char *datastring)
{
int err;
L = luaL_newstate();
// Base Lua libs
luaL_openlibs(L);
// Cairo lib
lua_pushcfunction(L, luaopen_cairo); lua_call(L, 0, 0);
// Raster library
lua_pushcfunction(L, luaopen_raster); lua_call(L, 0, 0);
// Debug print
lua_pushcclosure(L, lua_debug_print, 0);
lua_setglobal(L, "dprint");
// Datastring
if (datastring)
lua_pushstring(L, datastring);
else
lua_pushnil(L);
lua_setglobal(L, "overlua_datastring");
err = lua_load(L, reader.reader, &reader, chunkname);
// todo: better error handling
if (err == LUA_ERRSYNTAX) throw lua_tostring(L, -1);
if (err == LUA_ERRMEM) throw "Memory error";
err = lua_pcall(L, 0, 0, 0);
if (err == LUA_ERRRUN) throw lua_tostring(L, -1);
if (err == LUA_ERRMEM) throw "Memory error";
if (err == LUA_ERRERR) throw "Error-handler error";
}
static int lua_debug_print(lua_State *L);
public:
OverLuaScript(const char *filename, const char *_datastring = 0);
OverLuaScript(const void *data, size_t length, const char *_datastring = 0);
virtual ~OverLuaScript();
void RenderFrameRGB(BaseImageAggregate &frame, double time);
};
#endif

View File

@ -1,720 +0,0 @@
/*
* Raster image operations for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#include "cairo_wrap.h"
#include "image.h"
#include <math.h>
#include <omp.h>
#include <stdint.h>
#include "expression_engine.h"
#include "raster_ops.h"
#include "../lua51/src/lauxlib.h"
static inline cairo_surface_t *CheckSurface(lua_State *L, int idx)
{
LuaCairoSurface *surfobj = LuaCairoSurface::GetObjPointer(L, idx);
cairo_surface_t *surf = surfobj->GetSurface();
if (cairo_surface_get_type(surf) != CAIRO_SURFACE_TYPE_IMAGE) {
lua_pushliteral(L, "Object for raster operation is not an image surface. Video frames are not accepted.");
lua_error(L);
}
return surf;
}
static inline double NormalDist(double sigma, double x)
{
if (sigma <= 0 && x == 0) return 1;
else if (sigma <= 0) return 0;
else return exp(-(x*x)/(2*sigma*sigma)) / (sigma * sqrt(2*3.1415926535));
}
// Filter an image in horizontal direction with a one-dimensional filter
// PixelWidth is the distance in bytes between pixels
template<ptrdiff_t PixelWidth>
void SeparableFilterX(unsigned char *src, unsigned char *dst, int width, int height, ptrdiff_t stride, int *kernel, int kernel_size, int divisor)
{
#pragma omp parallel for
for (int y = 0; y < height; y++) {
unsigned char *in = src + y*stride;
unsigned char *out = dst + y*stride;
for (int x = 0; x < width; x++) {
int accum = 0;
for (int k = 0; k < kernel_size; k++) {
int xofs = k - kernel_size/2;
//if (x+xofs < 0 || x+xofs >= width) continue;
if (x+xofs < 0) xofs += width;
if (x+xofs >= width) xofs -= width;
accum += (int)(in[xofs*PixelWidth] * kernel[k]);
}
accum /= divisor;
if (accum > 255) accum = 255;
if (accum < 0) accum = 0;
*out = (unsigned char)accum;
in+=PixelWidth;
out+=PixelWidth;
}
}
}
// Filter an image in vertical direction with a one-dimensional filter
// This one templated with PixelWidth since the channel interlacing is horizontal only,
// filtering once vertically will automatically catch all channels.
// (Width must be multiplied by pixel width for that to happen though.)
void SeparableFilterY(unsigned char *src, unsigned char *dst, int width, int height, ptrdiff_t stride, int *kernel, int kernel_size, int divisor)
{
#pragma omp parallel for
for (int x = 0; x < width; x++) {
unsigned char *in = src + x;
unsigned char *out = dst + x;
for (int y = 0; y < height; y++) {
int accum = 0;
for (int k = 0; k < kernel_size; k++) {
int yofs = k - kernel_size/2;
//if (y+yofs < 0 || y+yofs >= height) continue;
if (y+yofs < 0) yofs += height;
if (y+yofs >= height) yofs -= height;
accum += (int)(in[yofs*stride] * kernel[k]);
}
accum /= divisor;
if (accum > 255) accum = 255;
if (accum < 0) accum = 0;
*out = (unsigned char)accum;
in += stride;
out += stride;
}
}
}
// Apply a simple separable FIR filter to an image
void ApplySeparableFilter(lua_State *L, cairo_surface_t *surf, int *kernel, int kernel_size, int divisor)
{
// Get surface properties
cairo_surface_flush(surf);
int width = cairo_image_surface_get_width(surf);
int height = cairo_image_surface_get_height(surf);
ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf);
cairo_format_t format = cairo_image_surface_get_format(surf);
unsigned char *data = cairo_image_surface_get_data(surf);
if (format != CAIRO_FORMAT_ARGB32 && format != CAIRO_FORMAT_RGB24 && format != CAIRO_FORMAT_A8) {
lua_pushliteral(L, "Unsupported image format for raster operation");
lua_error(L);
}
// Work image
unsigned char *wimg = new unsigned char[height*stride];
// Do the filtering
if (format == CAIRO_FORMAT_ARGB32 || format == CAIRO_FORMAT_RGB24) {
// Horizontal
SeparableFilterX<4>(data+0, wimg+0, width, height, stride, kernel, kernel_size, divisor);
SeparableFilterX<4>(data+1, wimg+1, width, height, stride, kernel, kernel_size, divisor);
SeparableFilterX<4>(data+2, wimg+2, width, height, stride, kernel, kernel_size, divisor);
SeparableFilterX<4>(data+3, wimg+3, width, height, stride, kernel, kernel_size, divisor);
// Vertical
//memcpy(data, wimg, height*stride);
SeparableFilterY(wimg, data, width*4, height, stride, kernel, kernel_size, divisor);
} else if (format == CAIRO_FORMAT_A8) {
// Horizontal
SeparableFilterX<1>(data, wimg, width, height, stride, kernel, kernel_size, divisor);
// Vertical
SeparableFilterY(wimg, data, width, height, stride, kernel, kernel_size, divisor);
}
// Clean up
cairo_surface_mark_dirty(surf);
delete[] wimg;
}
// Apply a general filter an image
template <class FilterType>
void ApplyGeneralFilter(lua_State *L, cairo_surface_t *surf, FilterType &filter)
{
// Get surface properties
cairo_surface_flush(surf);
int width = cairo_image_surface_get_width(surf);
int height = cairo_image_surface_get_height(surf);
ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf);
cairo_format_t format = cairo_image_surface_get_format(surf);
unsigned char *data = cairo_image_surface_get_data(surf);
if (format != CAIRO_FORMAT_ARGB32 && format != CAIRO_FORMAT_RGB24 && format != CAIRO_FORMAT_A8) {
lua_pushliteral(L, "Unsupported image format for raster operation");
lua_error(L);
}
// Source image copy
unsigned char *wimg = new unsigned char[height*stride];
memcpy(wimg, data, height*stride);
if (format == CAIRO_FORMAT_ARGB32) {
BaseImage<PixelFormat::cairo_argb32> src(width, height, stride, wimg);
BaseImage<PixelFormat::cairo_argb32> dst(width, height, stride, data);
#pragma omp parallel for
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
dst.Pixel(x,y) = filter.argb32(src, x, y);
}
}
} else if (format == CAIRO_FORMAT_RGB24) {
BaseImage<PixelFormat::cairo_rgb24> src(width, height, stride, wimg);
BaseImage<PixelFormat::cairo_rgb24> dst(width, height, stride, data);
#pragma omp parallel for
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
dst.Pixel(x,y) = filter.rgb24(src, x, y);
}
}
} else if (format == CAIRO_FORMAT_A8) {
BaseImage<PixelFormat::A8> src(width, height, stride, wimg);
BaseImage<PixelFormat::A8> dst(width, height, stride, data);
#pragma omp parallel for
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
dst.Pixel(x,y) = filter.a8(src, x, y);
}
}
}
// Clean up
cairo_surface_mark_dirty(surf);
delete[] wimg;
}
struct GaussianKernel {
int *kernel;
int width;
int divisor;
GaussianKernel(double sigma)
{
width = (int)(sigma*3 + 0.5) | 1; // binary-or with 1 to make sure the number is odd
if (width < 3) width = 3;
kernel = new int[width];
kernel[width/2] = (int)(NormalDist(sigma, 0) * 255);
divisor = kernel[width/2];
for (int x = width/2-1; x >= 0; x--) {
int val = (int)(NormalDist(sigma, width/2-x) * 255 + 0.5);
divisor += val*2;
kernel[x] = val;
kernel[width - x - 1] = val;
}
}
~GaussianKernel()
{
delete[] kernel;
}
};
// raster.gaussian_blur(imgsurf, sigma)
static int gaussian_blur(lua_State *L)
{
// Get arguments
cairo_surface_t *surf = CheckSurface(L, 1);
double sigma = luaL_checknumber(L, 2);
// Generate gaussian kernel
GaussianKernel gk(sigma);
ApplySeparableFilter(L, surf, gk.kernel, gk.width, gk.divisor);
return 0;
}
// n tap box blur
static int box_blur(lua_State *L)
{
cairo_surface_t *surf = CheckSurface(L, 1);
int width = luaL_checkint(L, 2);
if (width <= 0) { luaL_error(L, "Width of box kernel for raster.box must be larger than zero, specified to %d.", width); return 0; }
int applications = luaL_optint(L, 3, 1);
int *kernel = new int[width];
for (int i = 0; i < width; i++)
kernel[i] = 1;
while (applications-- > 0)
ApplySeparableFilter(L, surf, kernel, width, width);
delete[] kernel;
return 0;
}
// TODO: figure out how to make this use bilinear pixel grabbing instead
struct DirectionalBlurFilter {
GaussianKernel gk;
double xstep, ystep;
DirectionalBlurFilter(double angle, double sigma) :
gk(sigma)
{
xstep = cos(angle);
ystep = -sin(angle);
}
inline PixelFormat::A8 a8(BaseImage<PixelFormat::A8> &src, int x, int y)
{
int a = 0;
for (int t = -gk.width/2, i = 0; i < gk.width; t++, i++) {
PixelFormat::A8 &srcpx = GetPixelBilinear<PixelFormat::A8, EdgeCondition::Repeat<PixelFormat::A8> >(src, x+xstep*t, y+ystep*t);
//PixelFormat::A8 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t));
a += srcpx.A() * gk.kernel[i];
}
PixelFormat::A8 res;
a = a / gk.divisor; if (a < 0) a = 0; if (a > 255) a = 255;
res.A() = a;
return res;
}
inline PixelFormat::cairo_rgb24 rgb24(BaseImage<PixelFormat::cairo_rgb24> &src, int x, int y)
{
int r = 0, g = 0, b = 0;
for (int t = -gk.width/2, i = 0; i < gk.width; t++, i++) {
PixelFormat::cairo_rgb24 &srcpx = GetPixelBilinear<PixelFormat::cairo_rgb24, EdgeCondition::Repeat<PixelFormat::cairo_rgb24> >(src, x+xstep*t, y+ystep*t);
//PixelFormat::cairo_rgb24 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t));
r += srcpx.R() * gk.kernel[i];
g += srcpx.G() * gk.kernel[i];
b += srcpx.B() * gk.kernel[i];
}
PixelFormat::cairo_rgb24 res;
r = r / gk.divisor; if (r < 0) r = 0; if (r > 255) r = 255;
g = g / gk.divisor; if (g < 0) g = 0; if (g > 255) g = 255;
b = b / gk.divisor; if (b < 0) b = 0; if (b > 255) b = 255;
res.R() = r;
res.G() = g;
res.B() = b;
return res;
}
inline PixelFormat::cairo_argb32 argb32(BaseImage<PixelFormat::cairo_argb32> &src, int x, int y)
{
int a = 0, r = 0, g = 0, b = 0;
for (int t = -gk.width/2, i = 0; i < gk.width; t++, i++) {
PixelFormat::cairo_argb32 &srcpx = GetPixelBilinear<PixelFormat::cairo_argb32, EdgeCondition::Repeat<PixelFormat::cairo_argb32> >(src, x+xstep*t, y+ystep*t);
//PixelFormat::cairo_argb32 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t));
a += srcpx.A() * gk.kernel[i];
r += srcpx.R() * gk.kernel[i];
g += srcpx.G() * gk.kernel[i];
b += srcpx.B() * gk.kernel[i];
}
PixelFormat::cairo_argb32 res;
a = a / gk.divisor; if (a < 0) a = 0; if (a > 255) a = 255;
r = r / gk.divisor; if (r < 0) r = 0; if (r > 255) r = 255;
g = g / gk.divisor; if (g < 0) g = 0; if (g > 255) g = 255;
b = b / gk.divisor; if (b < 0) b = 0; if (b > 255) b = 255;
res.A() = a;
res.R() = r;
res.G() = g;
res.B() = b;
return res;
}
};
static int directional_blur(lua_State *L)
{
cairo_surface_t *surf = CheckSurface(L, 1);
double angle = luaL_checknumber(L, 2);
double sigma = luaL_checknumber(L, 3);
DirectionalBlurFilter filter(angle, sigma);
ApplyGeneralFilter(L, surf, filter);
return 0;
}
struct RadialBlurFilter {
GaussianKernel gk;
int cx, cy;
RadialBlurFilter(int x, int y, double sigma) :
gk(sigma), cx(x), cy(y)
{
}
inline PixelFormat::A8 a8(BaseImage<PixelFormat::A8> &src, int x, int y)
{
if (x == cx && y == cy) return src.Pixel(x, y);
double xstep = x-cx, ystep = y-cy, ivlen = 1/sqrt(xstep*xstep+ystep*ystep);
xstep *= ivlen; ystep *= ivlen;
int divisor = 0;
int a = 0;
for (int t = 0, i = gk.width/2; i < gk.width; t++, i++) {
PixelFormat::A8 &srcpx = GetPixelBilinear<PixelFormat::A8, EdgeCondition::Repeat<PixelFormat::A8> >(src, x+xstep*t, y+ystep*t);
//PixelFormat::A8 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t));
a += srcpx.A() * gk.kernel[i];
divisor += gk.kernel[i];
}
PixelFormat::A8 res;
a = a / divisor; if (a < 0) a = 0; if (a > 255) a = 255;
res.A() = a;
return res;
}
inline PixelFormat::cairo_rgb24 rgb24(BaseImage<PixelFormat::cairo_rgb24> &src, int x, int y)
{
if (x == cx && y == cy) return src.Pixel(x, y);
double xstep = x-cx, ystep = y-cy, ivlen = 1/sqrt(xstep*xstep+ystep*ystep);
xstep *= ivlen; ystep *= ivlen;
int divisor = 0;
int r = 0, g = 0, b = 0;
for (int t = 0, i = gk.width/2; i < gk.width; t++, i++) {
PixelFormat::cairo_rgb24 &srcpx = GetPixelBilinear<PixelFormat::cairo_rgb24, EdgeCondition::Repeat<PixelFormat::cairo_rgb24> >(src, x+xstep*t, y+ystep*t);
//PixelFormat::cairo_rgb24 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t));
r += srcpx.R() * gk.kernel[i];
g += srcpx.G() * gk.kernel[i];
b += srcpx.B() * gk.kernel[i];
divisor += gk.kernel[i];
}
PixelFormat::cairo_rgb24 res;
r = r / divisor; if (r < 0) r = 0; if (r > 255) r = 255;
g = g / divisor; if (g < 0) g = 0; if (g > 255) g = 255;
b = b / divisor; if (b < 0) b = 0; if (b > 255) b = 255;
res.R() = r;
res.G() = g;
res.B() = b;
return res;
}
inline PixelFormat::cairo_argb32 argb32(BaseImage<PixelFormat::cairo_argb32> &src, int x, int y)
{
if (x == cx && y == cy) return src.Pixel(x, y);
double xstep = x-cx, ystep = y-cy, ivlen = 1/sqrt(xstep*xstep+ystep*ystep);
xstep *= ivlen; ystep *= ivlen;
int divisor = 0;
int a = 0, r = 0, g = 0, b = 0;
for (int t = 0, i = gk.width/2; i < gk.width; t++, i++) {
PixelFormat::cairo_argb32 &srcpx = GetPixelBilinear<PixelFormat::cairo_argb32, EdgeCondition::Repeat<PixelFormat::cairo_argb32> >(src, x+xstep*t, y+ystep*t);
//PixelFormat::cairo_argb32 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t));
a += srcpx.A() * gk.kernel[i];
r += srcpx.R() * gk.kernel[i];
g += srcpx.G() * gk.kernel[i];
b += srcpx.B() * gk.kernel[i];
divisor += gk.kernel[i];
}
PixelFormat::cairo_argb32 res;
a = a / divisor; if (a < 0) a = 0; if (a > 255) a = 255;
r = r / divisor; if (r < 0) r = 0; if (r > 255) r = 255;
g = g / divisor; if (g < 0) g = 0; if (g > 255) g = 255;
b = b / divisor; if (b < 0) b = 0; if (b > 255) b = 255;
res.A() = a;
res.R() = r;
res.G() = g;
res.B() = b;
return res;
}
};
static int radial_blur(lua_State *L)
{
cairo_surface_t *surf = CheckSurface(L, 1);
int x = luaL_checkint(L, 2);
int y = luaL_checkint(L, 3);
double sigma = luaL_checknumber(L, 4);
RadialBlurFilter filter(x, y, sigma);
ApplyGeneralFilter(L, surf, filter);
return 0;
}
static int invert_image(lua_State *L)
{
cairo_surface_t *surf = CheckSurface(L, 1);
cairo_surface_flush(surf);
int width = cairo_image_surface_get_width(surf);
int height = cairo_image_surface_get_height(surf);
ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf);
unsigned char *data = cairo_image_surface_get_data(surf);
cairo_format_t format = cairo_image_surface_get_format(surf);
// ARGB32 and RGB24 must be treated differently due to the premultipled alpha in ARGB32
// Also the alpha in ARGB32 is not inverted, only the colour channels
if (format == CAIRO_FORMAT_ARGB32) {
#pragma omp parallel for
for (int y = 0; y < height; y++) {
uint32_t *line = (uint32_t*)(data + y*stride);
for (int x = 0; x < width; x++, line++) {
// The R, G and B channels are in range 0..a, and inverting means calculating
// max-current, so inversion here is a-c for each channel.
unsigned char a = (*line & 0xff000000) >> 24;
unsigned char r = (*line & 0x00ff0000) >> 16;
unsigned char g = (*line & 0x0000ff00) >> 8;
unsigned char b = *line & 0x000000ff;
*line = (a<<24) | ((a-r)<<16) | ((a-g)<<8) | (a-b);
}
}
}
else if (format == CAIRO_FORMAT_RGB24) {
#pragma omp parallel for
for (int y = 0; y < height; y++) {
uint32_t *line = (uint32_t*)(data + y*stride);
for (int x = 0; x < width; x++, line++) {
// Invert R, G and B channels by XOR'ing them with 0xff each.
*line = *line ^ 0x00ffffff;
}
}
}
else if (format == CAIRO_FORMAT_A8) {
#pragma omp parallel for
for (int y = 0; y < height; y++) {
unsigned char *line = data + y*stride;
for (int x = 0; x < width; x++, line++) {
*line = ~ *line;
}
}
}
else if (format == CAIRO_FORMAT_A1) {
int lwidth = (width + 31) / 32; // "long-width", width in 32 bit longints, rounded up
#pragma omp parallel for
for (int y = 0; y < height; y++) {
// Pixels are stored packed into 32 bit quantities
uint32_t *line = (uint32_t*)(data + y*stride);
for (int x = 0; x < lwidth; x++, line++) {
// Yes this means we might end up inverting too many bits.. hopefully won't happen.
// (And even then, who would seriously use A1 surfaces?)
*line = ~ *line;
}
}
}
cairo_surface_mark_dirty(surf);
return 0;
}
static int separable_filter(lua_State *L)
{
cairo_surface_t *surf = CheckSurface(L, 1);
if (!lua_istable(L, 2)) {
luaL_error(L, "Expected table as second argument to raster.separable_filter, got %s", luaL_typename(L, 2));
return 0;
}
int divisor = luaL_checkint(L, 3);
int width = (int)lua_objlen(L, 2);
if (width < 1) {
luaL_error(L, "Cannot apply empty filter");
return 0;
}
int *kernel = new int[width];
int i = 0;
lua_pushnil(L);
while (lua_next(L, 2)) {
if (lua_isnumber(L, -1)) {
kernel[i] = (int)lua_tointeger(L, -1);
}
i++;
lua_pop(L, 1);
}
ApplySeparableFilter(L, surf, kernel, width, divisor);
delete[] kernel;
return 0;
}
static int pixel_value_map(lua_State *L)
{
cairo_surface_t *surf = CheckSurface(L, 1);
const char *program = luaL_checkstring(L, 2);
// Init image
cairo_surface_flush(surf);
int width = cairo_image_surface_get_width(surf);
int height = cairo_image_surface_get_height(surf);
ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf);
unsigned char *data = cairo_image_surface_get_data(surf);
cairo_format_t format = cairo_image_surface_get_format(surf);
// Set up engine specs
ExpressionEngine::Specification spec;
if (format == CAIRO_FORMAT_ARGB32) {
spec.registers.resize(6);
spec.registers[0] = "R";
spec.registers[1] = "G";
spec.registers[2] = "B";
spec.registers[3] = "A";
spec.registers[4] = "X";
spec.registers[5] = "Y";
}
else if (format == CAIRO_FORMAT_RGB24) {
spec.registers.resize(5);
spec.registers[0] = "R";
spec.registers[1] = "G";
spec.registers[2] = "B";
spec.registers[3] = "X";
spec.registers[4] = "Y";
}
else {
luaL_error(L, "Unsupported pixel format");
}
// Compile program
ExpressionEngine::Machine machine;
try {
machine = ExpressionEngine::Machine(spec, program);
}
catch (const char *e) {
// This is a parse error
luaL_error(L, "Error in expression program near\"%s\"", e);
}
if (format == CAIRO_FORMAT_ARGB32) {
BaseImage<PixelFormat::cairo_argb32> img(width, height, stride, data);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
PixelFormat::cairo_argb32 &p = img.Pixel(x, y);
machine.registers[0] = (double)p.R() / 255.0;
machine.registers[1] = (double)p.G() / 255.0;
machine.registers[2] = (double)p.B() / 255.0;
machine.registers[3] = (double)p.A() / 255.0;
machine.registers[4] = x;
machine.registers[5] = y;
machine.Run();
p.R() = (uint8_t)(machine.registers[0] * 255);
p.G() = (uint8_t)(machine.registers[1] * 255);
p.B() = (uint8_t)(machine.registers[2] * 255);
p.A() = (uint8_t)(machine.registers[3] * 255);
}
}
}
else if (format == CAIRO_FORMAT_RGB24) {
BaseImage<PixelFormat::cairo_rgb24> img(width, height, stride, data);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
PixelFormat::cairo_rgb24 &p = img.Pixel(x, y);
machine.registers[0] = (double)p.R() / 255.0;
machine.registers[1] = (double)p.G() / 255.0;
machine.registers[2] = (double)p.B() / 255.0;
machine.registers[3] = x;
machine.registers[4] = y;
machine.Run();
p.R() = (uint8_t)(machine.registers[0] * 255);
p.G() = (uint8_t)(machine.registers[1] * 255);
p.B() = (uint8_t)(machine.registers[2] * 255);
}
}
}
else {
luaL_error(L, "Unsupported pixel format");
}
cairo_surface_mark_dirty(surf);
return 0;
}
static int pixel_coord_map(lua_State *L)
{
cairo_surface_t *surf = CheckSurface(L, 1);
const char *program = luaL_checkstring(L, 2);
// Set up engine specs
ExpressionEngine::Specification spec;
spec.registers.resize(2);
spec.registers[0] = "X";
spec.registers[1] = "Y";
// Compile program
ExpressionEngine::Machine machine;
try {
machine = ExpressionEngine::Machine(spec, program);
}
catch (const char *e) {
// This is a parse error
luaL_error(L, "Error in expression program near\"%s\"", e);
}
// Init image
cairo_surface_flush(surf);
int width = cairo_image_surface_get_width(surf);
int height = cairo_image_surface_get_height(surf);
ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf);
unsigned char *data = cairo_image_surface_get_data(surf);
cairo_format_t format = cairo_image_surface_get_format(surf);
unsigned char *work = new unsigned char[height * stride];
memcpy(work, data, height*stride);
if (format == CAIRO_FORMAT_ARGB32) {
BaseImage<PixelFormat::cairo_argb32> simg(width, height, stride, work);
BaseImage<PixelFormat::cairo_argb32> dimg(width, height, stride, data);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
machine.registers[0] = x;
machine.registers[1] = y;
machine.Run();
dimg.Pixel(x, y) = GetPixelBilinear<PixelFormat::cairo_argb32, EdgeCondition::Mirror<PixelFormat::cairo_argb32> >(simg, machine.registers[0], machine.registers[1]);
}
}
}
else if (format == CAIRO_FORMAT_RGB24) {
BaseImage<PixelFormat::cairo_rgb24> simg(width, height, stride, work);
BaseImage<PixelFormat::cairo_rgb24> dimg(width, height, stride, data);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
machine.registers[0] = x;
machine.registers[1] = y;
machine.Run();
dimg.Pixel(x, y) = GetPixelBilinear<PixelFormat::cairo_rgb24, EdgeCondition::Mirror<PixelFormat::cairo_rgb24> >(simg, machine.registers[0], machine.registers[1]);
}
}
}
else {
luaL_error(L, "Unsupported pixel format");
}
delete[] work;
cairo_surface_mark_dirty(surf);
return 0;
}
// Registration
static luaL_Reg rasterlib[] = {
{"gaussian_blur", gaussian_blur}, {"box_blur", box_blur},
{"directional_blur", directional_blur}, {"radial_blur", radial_blur},
{"separable_filter", separable_filter},
{"invert", invert_image},
{"pixel_value_map", pixel_value_map}, {"pixel_coord_map", pixel_coord_map},
{NULL, NULL}
};
int luaopen_raster(lua_State *L)
{
luaL_register(L, "raster", rasterlib);
return 0;
}

View File

@ -1,30 +0,0 @@
/*
* Raster image operations for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
// Everything is implemented in the .cpp file as static functions.
int luaopen_raster(lua_State *L);

View File

@ -1,45 +0,0 @@
OverLua is a plugin library that runs a Lua script to process video frames,
primarily intended to produce advanced overlay graphics. The target audience
is currently primarily programmers.
The name is intended as a pun on Overlay and Lua.
To help produce overlay graphics, OverLua provides an interface to the
cairo vector graphics library. A library of functions to do raster-based
graphics processing is also included.
Curerently the only known-working plugin interface to OverLua is the Avisynth
interface. A CSRI interface is also included but it's neither tested nor
actively maintained. Patches to make the CSRI interface work are most welcome.
Further interfaces would also be appreciated, eg. one for mencoder.
The most thorough documentation is still the source code but I'm working on
throwing together something more useful. See the other text files included
in the distribution.
Notes on the pre-built DLL file
-------------------------------
The included pre-built DLL is compiled with Microsoft Visual C++ 2005 SP1
and so will require the runtime library for that version of the compiler.
You can download the required runtime library at this location:
<http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&DisplayLang=en>
The DLL is no longer built with SSE2. Appanrently some people still use
CPU's without SSE2 support.
Finally, the DLL is built with OpenMP optimisations enabled, which means it
will take advantage of multi-core and other SMP systems if available. The
OpenMP optimisations are only in the raster image filtering and the
cairo surface/video frame interaction functions. If you do not use the raster
graphics operations much you won't see much gain from this SMP support either.
Licensing
---------
OverLua is licensed under version 2 of the GNU General Public License. This
means that you get no warranties of any kind.
See the file GPLv2.txt for details.

View File

@ -1,184 +0,0 @@
/*
* VFR translation functions for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#include "vfr.h"
#include <stdio.h>
#include <string.h>
#include <vector>
// Work with seconds per frame (spf) here instead of fps since that's more natural for the translation we're doing
class TimecodesV1 : public VFRTranslator {
private:
// Used when sections run out
double default_spf;
double first_non_section_timestamp;
int first_non_section_frame;
// Also generate sections for unspecified ones
// (use the default framerate then)
struct FrameRateSection {
double start_time;
double spf;
int start_frame;
int end_frame;
};
std::vector<FrameRateSection> sections;
public:
virtual double TimeStampFromFrameNumber(int n)
{
// Find correct section
for (size_t i = 0; i < sections.size(); i++) {
FrameRateSection &sect = sections[i];
if (n >= sect.start_frame && n <= sect.end_frame) {
return sect.start_time + (n - sect.start_frame) * sect.spf;
}
}
// Not in a section
if (n < 0) return 0.0;
return first_non_section_timestamp + (n - first_non_section_frame) * default_spf;
}
TimecodesV1(FILE *vfrfile)
{
char buf[100];
default_spf = -1;
double cur_time = 0.0;
FrameRateSection temp_section;
temp_section.start_time = 0.0;
temp_section.spf = -1;
temp_section.start_frame = 0;
temp_section.end_frame = 0;
while (fgets(buf, 100, vfrfile)) {
// Comment?
if (buf[0] == '#') continue;
if (strncmp(buf, "Assume ", 7) == 0 && default_spf < 0) {
char *num = buf+7;
default_spf = atof(num);
if (default_spf > 0)
default_spf = 1 / default_spf;
else
default_spf = -1;
temp_section.spf = default_spf;
continue;
}
int start_frame, end_frame;
double fps;
if (scanf("%d,%d,%f", &start_frame, &end_frame, &fps) == 3) {
// Finish the current temp section
temp_section.end_frame = start_frame - 1;
if (temp_section.end_frame >= temp_section.start_frame) {
cur_time += (temp_section.end_frame - temp_section.start_frame + 1) * temp_section.spf;
sections.push_back(temp_section);
}
// Insert the section corresponding to this line
temp_section.spf = 1/fps;
temp_section.start_frame = start_frame;
temp_section.end_frame = end_frame;
temp_section.start_time = cur_time;
cur_time += (end_frame - start_frame + 1) / fps;
sections.push_back(temp_section);
// Begin new temp section
temp_section.spf = default_spf;
temp_section.start_frame = end_frame + 1;
temp_section.end_frame = end_frame; // yes, negative duration
temp_section.start_time = cur_time;
}
}
first_non_section_timestamp = cur_time;
first_non_section_frame = temp_section.start_frame;
}
};
class TimecodesV2 : public VFRTranslator {
private:
// Main data
std::vector<double> timestamps;
// For when data are exhausted (well, they shouldn't, then the vfr file is bad)
int last_known_frame;
double last_known_timestamp;
double assumed_spf;
public:
virtual double TimeStampFromFrameNumber(int n)
{
if (n < (int)timestamps.size() && n >= 0) {
return timestamps[n];
}
if (n < 0) return 0.0;
return last_known_timestamp + (n - last_known_frame) * assumed_spf;
}
TimecodesV2(FILE *vfrfile)
{
char buf[50];
timestamps.reserve(8192); // should be enough for most cases
while (fgets(buf, 50, vfrfile)) {
// Comment?
if (buf[0] == '#') continue;
// Otherwise assume it's a good timestamp
timestamps.push_back(atof(buf));
}
last_known_frame = (int)timestamps.size()-1;
last_known_timestamp = timestamps[last_known_frame];
assumed_spf = 1/25.0; // yes, this is stupid - anyone got a better idea?
}
};
VFRTranslator *GetVFRTranslator(const char *vfrfile)
{
char buf[32];
buf[19] = 0; // In "# timecode format v1" the version number is character index 19
FILE *f = fopen(vfrfile, "r");
VFRTranslator *res = 0;
if (fgets(buf, 32, f) && buf[0] == '#') {
// So do some really shoddy parsing here, assume the file is good
if (buf[19] == '1') {
res = new TimecodesV1(f);
} else if (buf[19] == '2') {
res = new TimecodesV2(f);
}
}
fclose(f);
return res;
}

View File

@ -1,37 +0,0 @@
/*
* VFR translation functions for OverLua
*
Copyright 2007 Niels Martin Hansen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact:
E-mail: <jiifurusu@gmail.com>
IRC: jfs in #aegisub on irc.rizon.net
*/
#ifndef VFR_H
#define VFR_H
class VFRTranslator {
public:
virtual double TimeStampFromFrameNumber(int n) = 0;
};
VFRTranslator *GetVFRTranslator(const char *vfrfile);
#endif

1
README
View File

@ -1 +0,0 @@
* To be written.

186
README.md Normal file
View File

@ -0,0 +1,186 @@
## arch1t3cht's Aegisub "fork"
Download release builds [here](https://github.com/arch1t3cht/Aegisub/releases), or the latest CI builds [here](https://github.com/arch1t3cht/Aegisub/actions).
The release page also has detailed list of all changes and new features. If you're interested in the technical details or want to compile yourself, read on.
### Don't we have enough Aegisub forks already??
We absolutely do, and I'm aware that adding another one [doesn't sound like](https://xkcd.com/927/) a [good idea on paper](https://cdn.discordapp.com/attachments/425357202963038208/1007103606421459004/unknown.png). However,
- None of the existing forks are completely satisfying at the moment:
- [wangqr's fork](https://github.com/wangqr/Aegisub) is actively maintained, but focussing more on stability. It's missing most of the modern features.
- [AegisubDC](https://github.com/Ristellise/AegisubDC) has the most modern features (in particular video-panning), but is Windows-only and not actively maintained anymore.
- [The TypesettingTools fork](https://github.com/TypesettingTools/Aegisub) is the one that will one day become the upstream version and builds relatively effortlessly on all operating systems, but at the moment it's not moving much. It's the base for this fork, and I hope to one day merge most of these additions into it.
- Only PR'ing the changes in here to various forks would cause even more chaos
- ~~I try to convince myself that this isn't really a "fork" in the traditional sense - one which aims to provide extended support and stability fixes. It's a collection of new feature additions which I built myself, together with some of the most important new features floating around other forks.~~ At this point it's probably too late to still be saying this. Still, the general mission hasn't changed. This fork collects new features and critical bugfixes, but won't be putting extra time into maintenance aspects like cleanup and refactors. Partly, this is also because any big refactors would make it harder to pull these changes into upstream repositories or future forks.
While this is usually also the version of Aegisub I'm currently using, I make no promises on stability. **Don't** use this version if you're just looking for any version of Aegisub - this is mostly intended for typesetting and other advanced usage.
### Organization
Being a collection of different feature additions, this repository consists of a set of branches for different features, so that they can easily be merged into other repositories. The [`feature`](https://github.com/arch1t3cht/Aegisub/tree/feature) branch merges together all the features I deem as currently usable. Due to the structure of the repository, I will be force-pushing to this branch and some of the individual branches very frequently, so they're not ideal for basing further branches on.
The `cibuilds` branch makes some CI builds of snapshots of `feature` at relevant points in time.
### Branch/Feature list
This list is for navigating the repository. Go to the [release page](https://github.com/arch1t3cht/Aegisub/releases) for a more structured changelog.
- [`folding`](https://github.com/arch1t3cht/Aegisub/tree/folding): Add the ability to visually group and collapse lines in the subtitle grid
- [`lua_api`](https://github.com/arch1t3cht/Aegisub/tree/lua_api): Add new functions to the Lua automation API, like controlling the selection or cursor in the text edit box
- [`vector_clip_actions`](https://github.com/arch1t3cht/Aegisub/tree/vector_clip_actions): Make the different modes of the vector clip tool (lines, bezier curves, adding points, etc) bindable to hotkeys
- [`color_picker_fix2`](https://github.com/arch1t3cht/Aegisub/tree/color_picker_fix2): Add an option (under "Interface") to restrict the color picker to the window, which fixes the color picker on Linux in a lot of cases.
- [`avisynth`](https://github.com/arch1t3cht/Aegisub/tree/avisynth): Reenable Avisynth support on Windows and enable Avisynth on Linux
- [`bestsource`](https://github.com/arch1t3cht/Aegisub/tree/bestsource): Add BestSource audio and video source. This source is slower than others by multiple orders of magnitude, but in exchange it can guarantee exact seeking.
- [`vapoursynth`](https://github.com/arch1t3cht/Aegisub/tree/vapoursynth): Add Vapoursynth audio and video source
- [`bugfixes`](https://github.com/arch1t3cht/Aegisub/tree/bugfixes): Various fixes necessary for compilation. Most branches are based on this.
- [`workarounds`](https://github.com/arch1t3cht/Aegisub/tree/workarounds): Same as `bugfixes`, but these are hacky fixes that probably shouldn't be pulled without more work.
- [`fixes`](https://github.com/arch1t3cht/Aegisub/tree/fixes): Miscellaneous bugfixes
- [`misc`](https://github.com/arch1t3cht/Aegisub/tree/misc): Other miscellaneous additions
- [`wangqr_gui`](https://github.com/arch1t3cht/Aegisub/tree/wangqr_gui): Merge wangqr's changes regarding the GUI. In particular, add high-DPI compatibility.
- [`misc_dc`](https://github.com/arch1t3cht/Aegisub/tree/misc_dc): Miscellaneous changes taken from AegisubDC
- [`xa2-ds`](https://github.com/arch1t3cht/Aegisub/tree/xa2-ds): Add XAudio2 backend and allow stereo playback for some other backends, by wangqr and Shinon.
- [`stereo`](https://github.com/arch1t3cht/Aegisub/tree/stereo): Add multi-channel support for the other audio backends where possible.
- [`video_panning_option`](https://github.com/arch1t3cht/Aegisub/tree/video_panning_option): Merge [moex3's video zoom and panning](https://github.com/TypesettingTools/Aegisub/pull/150), with several bugfixes and more options to control zoom behavior
- [`spectrum-frequency-mapping`](https://github.com/arch1t3cht/Aegisub/tree/spectrum-frequency-mapping): Merge EleonoreMizo's [spectrum display improvements](https://github.com/TypesettingTools/Aegisub/pull/94), and also make Shift+Scroll vertically zoom the audio display
- [`wangqr_time_video`](https://github.com/arch1t3cht/Aegisub/tree/wangqr_time_video): Merge wangqr's feature adding a tool for timing subtitles to changes in the video
### Troubleshooting
I'll gladly take any bug reports, but if you encounter an issue, please check first if it occurs only on my fork, or also on [earlier TSTools builds](https://github.com/TypesettingTools/Aegisub/actions).
If it wasn't introduced by my fork, I can still take a look, but I can't promise anything.
You can find me for support on various servers, including the cave and the TSTools server linked below.
#### Aegisub on Linux doesn't recognize my GTK theme
This is probably because you're building with wxgtk2. Building with wxgtk3 fixes this, but causes some problems of its own (notably the broken color picker, occasional crashes when opening file dialogs from automation scripts, and general layouting issues).
The exact way of switching depends on your Linux distribution, but essentially you need to ensure that `wx-config` or the next best variant of it points to wxgtk3. If it points to wxgtk2 by default and deinstalling wxgtk2 isn't an option, you can also temporarily move it out of the path or use a `native-file` in your meson project. Then, fully reconfigure meson using `meson configure --clearcache` and `meson setup --reconfigure`.
#### The video is desynced / Frames don't appear at the right time
This is probably due to the ffms2 seeking bug ([#394](https://github.com/FFMS/ffms2/issues/394)). On Windows, this specific regression shouldn't happen anymore. On Linux, you need to install the latest git version of ffms2 - for example the [`ffms2-git`](https://aur.archlinux.org/packages/ffms2-git) AUR package on Arch linux, or just compile it yourself.
If it's not because of this particular bug, you can also try an alternative video source like LSMASHSource via Avisynth or Vapoursynth, or BestSource.
#### On Windows: Aegisub crashes whenever I open a video
If you're compiling yourself, try adding `--force-fallback-for=zlib` to the meson options.
### Compilation
If you're just looking to install Aegisub, you might want to check out the [releases page](https://github.com/arch1t3cht/Aegisub/releases) or the [CI builds](https://github.com/arch1t3cht/Aegisub/actions) first.
For compilation on Windows, see the TSTools documentation below. Also check the [GitHub workflow](https://github.com/arch1t3cht/Aegisub/blob/cibuilds/.github/workflows/ci.yml) for the project arguments.
On Arch Linux, there is an AUR package called [aegisub-arch1t3cht-git](https://aur.archlinux.org/packages/aegisub-arch1t3cht-git). It's not maintained by me but seems to work.
On other Linux distributions or for manual compilation you can use this package or the [TSTools PKGBUILD](https://aur.archlinux.org/packages/aegisub-ttools-meson-git) as a reference, in particular for installing the necessary dependencies if you don't want to compile them yourself.
If all dependencies are installed:
- Install Meson
- Clone the repository
- In the repository, run `meson setup build --buildtype=release` for the default configuration. See below for further options.
- `cd` to the `build` directory and run `ninja`
- You'll get an `aegisub` binary in the `build` folder. To install it to a system-wide location, run `ninja install`. To install to `/usr` instead of `/usr/local`, pass `--prefix=/usr` when configuring or reconfiguring meson.
- When recompiling after pulling new commits, skip the `meson setup` setup and just immediately run `ninja` from the build directory - even when the build configuration changed.
#### Compilation flags
Some features are not enabled by default. To enable them, pass `-D<feature>=enabled` with the `meson setup` command:
- `-Davisynth=enabled`: Avisynth support
- `-Dbestsource=enabled`: BestSource
- `-Dvapoursynth=enabled`: Vapoursynth support
You can also disable options that are active by default in the same way. Check the file `meson_options.txt` for all options.
To change the options of an existing build directory, run `meson setup --reconfigure <new arguments>` from inside the `build` directory.
### Dependencies
Apart from the dependencies for the TSTools version, there are some additional dependencies. These are cloned and compiled from scratch if not found, but you might want to install binaries instead:
- `jansson`: For BestSource
- `ffmpeg`: Becomes a direct dependency when compiling with BestSource
- `avisynth` (or `avisynthplus`): Optional run-time dependency for the Avisynth source
- `vapoursynth`: Optional run-time dependency for the VapourSynth source
The following VapourSynth plugins are used by the default scripts set in the default configuration:
- [`lsmas`](https://github.com/AkarinVS/L-SMASH-Works): For LWLibavSource
- [`bas`](https://github.com/vapoursynth/bestaudiosource): For BestAudioSource
- [`wwxd`](https://github.com/dubhater/vapoursynth-wwxd) and [`scxvid`](https://github.com/dubhater/vapoursynth-scxvid) (depending on settings): For keyframe generation
# Aegisub
For binaries and general information [see the homepage](http://www.aegisub.org).
The bug tracker can be found at https://github.com/Aegisub/Aegisub/issues.
Support is available on [Discord](https://discord.com/invite/AZaVyPr) or [IRC](irc://irc.rizon.net/aegisub).
## Building Aegisub
### Windows
Prerequisites:
1. Visual Studio (Community edition of any recent version is fine)
2. The June 2010 DirectX SDK (the final release before DirectSound was dropped)
3. Python 3
4. Meson
5. CMake
6. Powershell execution policy set to Unrestricted
There are a few optional dependencies that must be installed and on your PATH:
1. msgfmt, to build the translations
2. InnoSetup, to build the regular installer
3. 7zip, to build the regular installer
4. Moonscript, to build the regular installer
All other dependencies are either stored in the repository or are included as submodules.
Building:
1. Clone Aegisub's repository: `git clone https://github.com/arch1t3cht/Aegisub.git`
2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static` (if building for release, add `--buildtype=release`)
3. Build with `cd build` and `ninja`
You should now have a binary: `aegisub.exe`.
Installer:
You can generate the installer with `ninja win-installer` after a successful build. This assumes a working internet connection and installation of the optional dependencies.
You can generate the portable zip with `ninja win-portable` after a successful build.
### OS X
A vaguely recent version of Xcode and the corresponding command-line tools are required.
For personal usage, you can use pip and homebrew to install almost all of Aegisub's dependencies:
pip3 install meson
brew install cmake ninja pkg-config libass boost zlib ffms2 fftw hunspell
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
Once the dependencies are installed, build Aegisub with `meson build && meson compile -C build`.
#### Build dmg
```bash
meson build_static -Ddefault_library=static -Dbuildtype=debugoptimized -Dbuild_osx_bundle=true -Dlocal_boost=true
meson compile -C build_static
meson test -C build_static --verbose
meson compile osx-bundle -C build_static
meson compile osx-build-dmg -C build_static
```
## Updating Moonscript
From within the Moonscript repository, run `bin/moon bin/splat.moon -l moonscript moonscript/ > bin/moonscript.lua`.
Open the newly created `bin/moonscript.lua`, and within it make the following changes:
1. Prepend the final line of the file, `package.preload["moonscript"]()`, with a `return`, producing `return package.preload["moonscript"]()`.
2. Within the function at `package.preload['moonscript.base']`, remove references to `moon_loader`, `insert_loader`, and `remove_loader`. This means removing their declarations, definitions, and entries in the returned table.
3. Within the function at `package.preload['moonscript']`, remove the line `_with_0.insert_loader()`.
The file is now ready for use, to be placed in `automation/include` within the Aegisub repo.
## License
All files in this repository are licensed under various GPL-compatible BSD-style licenses; see LICENCE and the individual source files for more information.
The official Windows and OS X builds are GPLv2 due to including fftw3.

View File

@ -1,77 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("SSATool")]
[assembly: AssemblyDescription("A typesetting tool for Advanced Substation Alpha files.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SSATool")]
[assembly: AssemblyCopyright("Dan Donovan")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.3.6.0")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile(@"c:\documents and settings\administrator\my documents\visual studio projects\ssatool.snk")]
[assembly: AssemblyKeyName("")]

View File

@ -1,89 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
//using System.Collections;
using System.Collections.Generic;
namespace SSATool
{
public class Condition : ICloneable {
public string ConditionOne;
public string ConditionOp;
public string ConditionTwo;
public bool ConditionEnabled;
public Condition() { }
public Condition(string ConditionOne, string ConditionOp, string ConditionTwo, bool ConditionEnabled) {
this.ConditionOne = ConditionOne;
this.ConditionOp = ConditionOp;
this.ConditionTwo = ConditionTwo;
this.ConditionEnabled = ConditionEnabled;
}
public object Clone() {
return this.MemberwiseClone();
}
}
public class ConditionColl {
protected List<Condition> conditionColl;
public ConditionColl() {
conditionColl = new List<Condition>();
}
public int ConditionCount {
get { return conditionColl.Count; }
}
public void AddCondition(string CondOne, string CondOp, string CondTwo) {
Condition newCond = new Condition(CondOne,CondOp,CondTwo,true);
conditionColl.Add(newCond);
}
public void AddCondition(string CondOne, string CondOp, string CondTwo, bool CondEnabled) {
Condition newCond = new Condition();
newCond.ConditionOne = CondOne;
newCond.ConditionOp = CondOp;
newCond.ConditionTwo = CondTwo;
newCond.ConditionEnabled = CondEnabled;
conditionColl.Add(newCond);
}
public void AddCondition(Condition tc) {
conditionColl.Add(tc);
}
public Condition GetCondition(int index) {
return conditionColl[index];
}
public void RemoveCondition(int index) {
if (conditionColl.Count > index) conditionColl.RemoveAt(index);
}
public List<Condition> CloneConditions() {
List<Condition> nl = new List<Condition>();
for(int index=0;index!=conditionColl.Count;index+=1)
nl.Add((Condition)conditionColl[index].Clone());
return nl;
}
}
}

View File

@ -1,252 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace SSATool
{
/// <summary>
/// Summary description for ConditionDialog.
/// </summary>
public class ConditionDialog : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button cmdCancel;
private System.Windows.Forms.Button cmdOK;
private System.Windows.Forms.TextBox txtC1;
private System.Windows.Forms.TextBox txtC2;
private System.Windows.Forms.Label lblPrompt;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public ConditionDialog() {
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtC1 = new System.Windows.Forms.TextBox();
this.txtC2 = new System.Windows.Forms.TextBox();
this.lblPrompt = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.cmdCancel = new System.Windows.Forms.Button();
this.cmdOK = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.Location = new System.Drawing.Point(8, 56);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(128, 20);
this.label1.TabIndex = 6;
this.label1.Text = "Condition One:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label2.Location = new System.Drawing.Point(8, 80);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(128, 20);
this.label2.TabIndex = 7;
this.label2.Text = "Condition Two:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label3.Location = new System.Drawing.Point(8, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(128, 20);
this.label3.TabIndex = 8;
this.label3.Text = "Comparison:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtC1
//
this.txtC1.Location = new System.Drawing.Point(144, 56);
this.txtC1.Name = "txtC1";
this.txtC1.Size = new System.Drawing.Size(336, 20);
this.txtC1.TabIndex = 0;
this.txtC1.Text = "";
this.txtC1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtC_KeyPress);
//
// txtC2
//
this.txtC2.Location = new System.Drawing.Point(144, 80);
this.txtC2.Name = "txtC2";
this.txtC2.Size = new System.Drawing.Size(336, 20);
this.txtC2.TabIndex = 1;
this.txtC2.Text = "";
this.txtC2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtC_KeyPress);
//
// lblPrompt
//
this.lblPrompt.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblPrompt.Location = new System.Drawing.Point(0, 8);
this.lblPrompt.Name = "lblPrompt";
this.lblPrompt.Size = new System.Drawing.Size(480, 40);
this.lblPrompt.TabIndex = 5;
//
// comboBox1
//
this.comboBox1.ImeMode = System.Windows.Forms.ImeMode.Off;
this.comboBox1.Items.AddRange(new object[] {
"=",
"==",
"!=",
"!==",
">",
">=",
"<",
"<="});
this.comboBox1.Location = new System.Drawing.Point(144, 104);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(120, 21);
this.comboBox1.TabIndex = 2;
this.comboBox1.Text = "==";
this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress);
//
// cmdCancel
//
this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cmdCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.cmdCancel.Location = new System.Drawing.Point(384, 104);
this.cmdCancel.Name = "cmdCancel";
this.cmdCancel.Size = new System.Drawing.Size(96, 24);
this.cmdCancel.TabIndex = 4;
this.cmdCancel.Text = "Cancel";
//
// cmdOK
//
this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.cmdOK.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.cmdOK.Location = new System.Drawing.Point(272, 104);
this.cmdOK.Name = "cmdOK";
this.cmdOK.Size = new System.Drawing.Size(96, 24);
this.cmdOK.TabIndex = 3;
this.cmdOK.Text = "OK";
//
// ConditionDialog
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(488, 135);
this.Controls.Add(this.cmdOK);
this.Controls.Add(this.cmdCancel);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.lblPrompt);
this.Controls.Add(this.txtC2);
this.Controls.Add(this.txtC1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ConditionDialog";
this.Text = "ConditionDialog";
this.Load += new System.EventHandler(this.ConditionDialog_Load);
this.ResumeLayout(false);
}
#endregion
private void ConditionDialog_Load(object sender, System.EventArgs e) {
}
public static ConditionDialogResult Show(string prompt, string title, int xpos, int ypos) {
using (ConditionDialog form = new ConditionDialog()) {
form.Text = title;
form.lblPrompt.Text = prompt;
if (xpos >= 0 && ypos >= 0) {
form.StartPosition = FormStartPosition.Manual;
form.Left = xpos;
form.Top = ypos;
}
DialogResult result = form.ShowDialog();
ConditionDialogResult retval = new ConditionDialogResult();
if (result == DialogResult.OK) {
retval.ConditionOne = form.txtC1.Text;
retval.ConditionTwo = form.txtC2.Text;
retval.ConditionComp = form.comboBox1.Text;
retval.OK = true;
}
return retval;
}
}
private void txtC_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) {
if ((e.KeyChar == (char)10) || (e.KeyChar == (char)13)) {
e.Handled = true;
cmdOK.PerformClick();
}
}
private void comboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) {
e.Handled = true; // We don't want anyone typing here anyway!
if (e.KeyChar == (char)Keys.Enter)
cmdOK.PerformClick();
}
public static ConditionDialogResult Show(string prompt, string title) {
return Show(prompt, title, -1, -1);
}
}
public class ConditionDialogResult {
public string ConditionOne;
public string ConditionTwo;
public string ConditionComp;
public bool OK;
}
}

View File

@ -1,211 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtC1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtC1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="txtC1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtC2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtC2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="txtC2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblPrompt.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblPrompt.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblPrompt.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="comboBox1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="comboBox1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="comboBox1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.Name">
<value>ConditionDialog</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root>

View File

@ -1,57 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace SSATool {
public static class DetectEncoding {
// This detection could use some serious improving.
// All detection should return the occurances as an integer.
public static int DetectSJIS(byte[] input) {
int occ=0;
byte lastMatched=0;
byte thisbyte;
for (int index=0;index!=input.Length;index++) {
thisbyte = input[index];
if ((lastMatched==130&&thisbyte>=159&&thisbyte<=241) ||
(lastMatched==131&&thisbyte>=64&&thisbyte<=151)) occ++;
else if (thisbyte==130||thisbyte==131||thisbyte>=136) lastMatched=thisbyte;
else lastMatched=0;
}
return occ;
}
public static int DetectEUCJP(byte[] input) {
int occ=0;
byte lastMatched=0;
byte thisbyte;
for (int index=0;index!=input.Length;index++) {
thisbyte = input[index];
if (lastMatched>=163&&lastMatched<=250&&thisbyte>=160) occ++;
else if (thisbyte>=163&&thisbyte<=250) lastMatched=thisbyte;
else lastMatched=0;
}
return occ;
}
}
}

View File

@ -1,739 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Windows.Forms;
using System.Collections.Generic;
namespace SSATool {
public static class Evaluate {
public static string ScriptParse(string input) {
char[] charain = input.ToCharArray(); // It is over twice as fast to parse this as a character array!
StringBuilder sb = new StringBuilder();
int dIndex = 0, eIndex = 0, pIndex = 0, lastIndex = -1, parenLevel = 0, index;
bool foundds = false;
for (index=0;index<input.Length;index+=1) {
if (charain[index].Equals('$')) {
if (parenLevel == 0) {
if (index != (lastIndex+1))
sb.Append(input, lastIndex+1, index-(lastIndex+1));
dIndex = index;
foundds = true;
}
}
else if (charain[index].Equals('(')) {
if ((parenLevel == 0)) pIndex = index;
parenLevel+=1;
}
else if (charain[index].Equals(')')) {
parenLevel--;
if ((parenLevel == 0) && (foundds) && (pIndex != 0)) {
eIndex = index;
sb.Append(ScriptParse_Helper(input.Substring(dIndex+1, pIndex-(dIndex+1)), ScriptParse(input.Substring(pIndex+1, index-(pIndex+1)))));
lastIndex = eIndex;
foundds = false;
}
else if (parenLevel == 0) {
sb.Append(input.Substring(lastIndex+1, pIndex-lastIndex) + ScriptParse(input.Substring(pIndex+1, index-(pIndex+1))) + ")");
lastIndex = eIndex = index;
}
}
}
if (input.Length > lastIndex) sb.Append(input, lastIndex+1, input.Length-(lastIndex+1));
return sb.ToString();
}
public static string ScriptParse_Helper(string function, string args) {
unsafe {
switch (function) {
case "eval":
return Evaluate.Eval(args).ToString();
case "logic":
return Evaluate.Eval(args).ToString();
case "iif":
string[] tok = args.Split(",".ToCharArray());
if (tok.Length != 3) return "error";
else if (Evaluate.Eval(tok[0]).Equals(true)) return tok[1];
else return tok[2];
case "len":
return args.Length.ToString(Util.nfi);
case "left":
string[] tokl = args.Split(",".ToCharArray());
if ((tokl.Length != 2) || (!Evaluate.isNum(tokl[1]))) return "error";
else try {
return tokl[0].Substring(0, int.Parse(tokl[1], Util.cfi));
} catch {
return "error";
}
case "mid":
string[] tokm = args.Split(",".ToCharArray());
if ((tokm.Length != 3) || (!Evaluate.isNum(tokm[1])) || (!Evaluate.isNum(tokm[2]))) return "error";
else try {
return tokm[0].Substring(int.Parse(tokm[1]), int.Parse(tokm[2], Util.cfi));
} catch {
return "error";
}
case "right":
string[] tokr = args.Split(",".ToCharArray());
if ((tokr.Length != 2) || (!Evaluate.isNum(tokr[1]))) return "error";
else try {
return tokr[0].Substring(tokr[0].Length - int.Parse(tokr[1], Util.cfi), int.Parse(tokr[1], Util.cfi));
} catch {
return "error";
}
case "str":
string[] str = args.Split(",".ToCharArray());
if ((str.Length != 2) || (!Evaluate.isNum(str[1]))) return "error";
else try {
string retstr = String.Empty;
for (int strindex=0;strindex<int.Parse(str[1], Util.cfi);strindex--)
retstr = retstr + str[0];
return retstr;
} catch {
return "error";
}
case "randlist":
string[] splitlist = args.Split(",".ToCharArray());
return splitlist[Evaluate.rand.Next(0, splitlist.Length)];
case "listindex":
string[] splitlist2 = args.Split(",".ToCharArray());
if ((splitlist2.Length < 2) || (Evaluate.isNum(splitlist2[0]) == false)) return "error";
int index = int.Parse(splitlist2[0], Util.cfi);
if ((index < 1) || (index <= splitlist2.Length)) return "error";
return splitlist2[index];
case "listindexwrap":
string[] splitlist3 = args.Split(",".ToCharArray());
if ((splitlist3.Length < 2) || (Evaluate.isNum(splitlist3[0]) == false)) return "error";
int index2 = int.Parse(splitlist3[0], Util.cfi);
if (index2 < 1) return "error";
return splitlist3[index2%splitlist3.Length];
case "listindexlast":
string[] splitlist4 = args.Split(",".ToCharArray());
if ((splitlist4.Length < 2) || (Evaluate.isNum(splitlist4[0]) == false)) return "error";
int index3 = int.Parse(splitlist4[0], Util.cfi);
if (index3 < 1) return "error";
else if (index3 >= splitlist4.Length) return splitlist4[splitlist4.Length-1];
else return splitlist4[index3];
default: // Unrecognized function... Let's treat it as a string.
return "$" + function + "(" + args + ")";
}
}
}
public static readonly Random rand = new Random();
private static SortedList<string, char> ops;
private static SortedList<string, object> constants;
private static void evaluate_stack_tops_function(Stack numStack, Stack<string> funcStack) {
short numParams = (short)numStack.Pop();
string func = funcStack.Pop();
switch (func.ToLowerInvariant()) {
case "rand" :
if (numParams > 2) throw new ArgumentException("Eval.rand");
switch (numParams) {
case 0 :
numStack.Push(rand.Next());
break;
case 1 :
int randOneR = Convert.ToInt32(numStack.Pop());
numStack.Push(rand.Next(randOneR));
break;
case 2 :
int randOne, randTwo;
randTwo = Convert.ToInt32(numStack.Pop(), Util.nfi);
randOne = Convert.ToInt32(numStack.Pop(), Util.nfi);
numStack.Push(rand.Next(randOne,randTwo));
break;
}
break;
case "randf" :
if (numParams > 2) throw new ArgumentException("Eval.randf");
switch (numParams) {
case 0 :
numStack.Push(rand.NextDouble());
break;
case 1 :
double randOneRF = (double)numStack.Pop();
numStack.Push(rand.NextDouble()*randOneRF);
break;
case 2 :
double randOneF, randTwoF;
randTwoF = (double)numStack.Pop();
randOneF = (double)numStack.Pop();
numStack.Push(randOneF + rand.NextDouble()*(randTwoF-randOneF));
break;
}
break;
case "randlist" :
int listindex = rand.Next(0, numParams - 1);
string randlist = string.Empty;
for (int i = 0; i != numParams; i += 1) {
if (i == listindex) randlist = (string)numStack.Pop();
else numStack.Pop();
}
numStack.Push(randlist);
break;
case "round" :
if (numParams != 2) throw new ArgumentException("Eval.round");
double roundme;
int dplaces;
dplaces = Convert.ToInt32(numStack.Pop(), Util.nfi);
roundme = (double) numStack.Pop();
numStack.Push(Math.Round(roundme,dplaces));
break;
case "bound" :
if (numParams != 3) throw new ArgumentException("Eval.bound");
double num, min, max;
max = (double) numStack.Pop();
min = (double) numStack.Pop();
num = (double) numStack.Pop();
num = ((num < min) ? min : num);
num = ((num > max) ? max : num);
numStack.Push(num);
break;
case "max" :
if (numParams < 2) throw new ArgumentException("Eval.max");
double ansMax;
ansMax = Math.Max((double)numStack.Pop(),(double)numStack.Pop());
for(int index=2;index!=numParams;index+=1) {
ansMax = Math.Max(ansMax,(double)numStack.Pop());
}
numStack.Push(ansMax);
break;
case "min" :
if (numParams < 2) throw new ArgumentException("Eval.min");
double ansMin;
ansMin = Math.Min((double)numStack.Pop(),(double)numStack.Pop());
for(int index=2;index!=numParams;index+=1) {
ansMin = Math.Min(ansMin,(double)numStack.Pop());
}
numStack.Push(ansMin);
break;
case "ceil" :
if (numParams != 1) throw new ArgumentException("Eval.ceil");
double ceil;
ceil = (double) numStack.Pop();
numStack.Push(Math.Ceiling(ceil));
break;
case "floor" :
if (numParams != 1) throw new ArgumentException("Eval.floor");
double floor;
floor = (double) numStack.Pop();
numStack.Push(Math.Floor(floor));
break;
case "int" :
if (numParams != 1) throw new ArgumentException("Eval.int");
double thisnum;
thisnum = (double) numStack.Pop();
numStack.Push(Convert.ToInt32(thisnum,Util.nfi));
break;
case "abs" :
if (numParams != 1) throw new ArgumentException("Eval.abs");
double abs;
abs = (double) numStack.Pop();
numStack.Push(Math.Abs(abs));
break;
case "sin" :
if (numParams != 1) throw new ArgumentException("Eval.sin");
double sin;
sin = (double) numStack.Pop();
numStack.Push(Math.Sin(sin));
break;
case "asin" :
if (numParams != 1) throw new ArgumentException("Eval.asin");
double asin;
asin = (double) numStack.Pop();
numStack.Push(Math.Asin(asin));
break;
case "cos" :
if (numParams != 1) throw new ArgumentException("Eval.cos");
double cos;
cos = (double) numStack.Pop();
numStack.Push(Math.Cos(cos));
break;
case "acos" :
if (numParams != 1) throw new ArgumentException("Eval.acos");
double acos;
acos = (double) numStack.Pop();
numStack.Push(Math.Acos(acos));
break;
case "tan" :
if (numParams != 1) throw new ArgumentException("Eval.tan");
double tan;
tan = (double) numStack.Pop();
numStack.Push(Math.Tan(tan));
break;
case "atan" :
if (numParams != 1) throw new ArgumentException("Eval.atan");
double atan;
atan = (double) numStack.Pop();
numStack.Push(Math.Atan(atan));
break;
case "atan2" :
if (numParams != 1) throw new ArgumentException("Eval.atan2");
double atanx,atany;
atanx = (double) numStack.Pop();
atany = (double) numStack.Pop();
numStack.Push(Math.Atan2(atanx,atany));
break;
case "log" :
if (numParams != 1) throw new ArgumentException("Eval.log");
double log;
log = (double) numStack.Pop();
numStack.Push(Math.Log(log));
break;
case "sqrt" :
if (numParams != 1) throw new ArgumentException("Eval.sqrt");
numStack.Push(Math.Sqrt((double)numStack.Pop()));
break;
case "len" :
if (numParams != 1) throw new ArgumentException("Eval.len");
numStack.Push(((string)numStack.Pop()).Length);
break;
case "fact" :
case "factorial" :
if (numParams != 1) throw new ArgumentException("Eval.fact");
numStack.Push(Convert.ToDouble(Factorial(Convert.ToInt32(numStack.Pop(), Util.nfi)), Util.nfi));
break;
case "gcd" :
if (numParams != 2) throw new ArgumentException("Eval.gcd");
numStack.Push(EuclidGCD(Convert.ToInt32(numStack.Pop(), Util.nfi), Convert.ToInt32(numStack.Pop(), Util.nfi)));
break;
case "lcm" :
if (numParams != 2) throw new ArgumentException("Eval.lcm");
int lcm2 = Convert.ToInt32(numStack.Pop(),Util.nfi);
int lcm1 = Convert.ToInt32(numStack.Pop(),Util.nfi);
numStack.Push((lcm1+lcm2)/EuclidGCD(lcm1,lcm2));
break;
default :
if (numParams==1 && numStack.Peek() is string) // might be a string w/o quotes, so push it back on as one
numStack.Push(func+"("+numStack.Pop()+")");
break;
}
}
private static void evaluate_stack_tops(Stack numStack, System.Collections.Generic.Stack<char> opStack, System.Collections.Generic.Stack<string> funcStack, bool safetyKill) {
if (((numStack.Count != 0) || (funcStack.Count != 0)) && (opStack.Count != 0) && (!opStack.Peek().Equals(","))) {
char Operation = opStack.Pop();
if (Operation == '@') { // @ is the placeholder for a function. The function itself is in funcStack.
evaluate_stack_tops_function(numStack, funcStack);
}
else if (Operation == '~') {
object obj = numStack.Pop();
if (obj is bool) numStack.Push(!(bool)obj);
else if (obj is int) numStack.Push(~(int)obj);
else numStack.Push(obj);
}
else if (Operation == '!') {
int fact = Convert.ToInt32(numStack.Pop(), Util.cfi);
numStack.Push(Convert.ToDouble(Factorial(fact), Util.nfi));
}
else if (numStack.Count >= 2) {
object objOne, objTwo;
objTwo = numStack.Pop();
objOne = numStack.Pop();
try {
switch (Operation) {
case 'c': // concatenation
numStack.Push((string)objOne + objTwo.ToString());
break;
case '^': // power
numStack.Push(Math.Pow((double)objOne, (double)objTwo));
break;
case '*': // multiplication
numStack.Push((double)objOne * (double)objTwo);
break;
case '/': // division
numStack.Push((double)objOne / (double)objTwo);
break;
case '%': // modulus
//numStack.Push((int)(double)objOne%(int)(double)objTwo);
numStack.Push(Math.IEEERemainder((double)objOne, (double)objTwo));
break;
case '+': // addition
numStack.Push((double)objOne + (double)objTwo);
break;
case '-': // subtraction
numStack.Push((double)objOne - (double)objTwo);
break;
case '>': // greater than
numStack.Push(doCompare(objOne, objTwo, false) >= 0);
break;
case 'G': // greater than or equal to
numStack.Push(doCompare(objOne, objTwo, false) == 1);
break;
case '<': // less than
numStack.Push(doCompare(objOne, objTwo, false) == -1);
break;
case 'L': // less than or equal to
numStack.Push(doCompare(objOne, objTwo, false) <= 0);
break;
case '=': // case-sensitive equal
numStack.Push(doCompare(objOne, objTwo, false) == 0);
break;
case 'i': // case-insensitive equal
numStack.Push(doCompare(objOne, objTwo, true) == 0);
break;
case 'N': // case-sensitive not equal
numStack.Push(doCompare(objOne, objTwo, false) != 0);
break;
case 'I': // case-insensitive not equal
numStack.Push(doCompare(objOne, objTwo, true) != 0);
break;
case '&': // bitwise-and
numStack.Push((int)objOne & (int)objTwo);
break;
case 'X': // bitwise-xor
numStack.Push((int)objOne ^ (int)objTwo);
break;
case '|': // bitwise-or
numStack.Push((int)objOne | (int)objTwo);
break;
case 'A': // boolean and
numStack.Push((bool)objOne && (bool)objTwo);
break;
case 'O': // boolean or
numStack.Push((bool)objOne || (bool)objTwo);
break;
case 'r': // shift right
numStack.Push((int)objOne >> (int)objTwo);
break;
case 'l': // shift left
numStack.Push((int)objOne << (int)objTwo);
break;
}
} catch { throw new FormatException(); }
}
// Can't make sense of the stacks, so just clear them...
else if (safetyKill) {
funcStack.Clear();
opStack.Clear();
numStack.Clear();
}
}
}
private static int doCompare(object objOne, object objTwo, bool caseIns) {
if (objOne is string || objTwo is string)
return String.Compare(objOne.ToString(), objTwo.ToString(), caseIns);
else if (objOne is bool && objTwo is bool)
return ((bool)objOne).CompareTo((bool)objTwo);
else if (objOne is double && objTwo is double)
return ((double)objOne).CompareTo((double)objTwo);
else if (objOne is bool && objTwo is double)
return ((bool)objOne).CompareTo((double)objTwo!=0.0);
else if (objOne is double && objTwo is bool)
return ((double)objOne!=0.0).CompareTo((bool)objTwo);
/*
else if (objOne is int && objTwo is int)
return ((int)objOne).CompareTo((int)objTwo);
else if (objOne is bool && objTwo is int)
return ((bool)objOne).CompareTo((int)objTwo!=0);
else if (objOne is int && objTwo is bool)
return ((int)objOne!=0).CompareTo((bool)objTwo);
else if (objOne is double && objTwo is int)
return ((double)objOne).CompareTo((double)(int)objTwo);
else if (objOne is int && objTwo is double)
return ((double)(int)objOne).CompareTo((double)objTwo);
*/
throw new ArgumentException("Eval.doCompare");
}
public static bool isNum(string input) {
if (input.Length == 0) return false;
char[] charain = input.ToCharArray();
for (int index=(input.StartsWith("-")?1:0);index<input.Length;index+=1)
if ((!char.IsDigit(charain[index])) && (charain[index] != '.')) return false;
return true;
}
public static int EuclidGCD(int u, int v) {
int k = 0;
if ((u|v)==0) return 0;
while (((u|v)&1)==0) { /* while both u and v are even */
u >>= 1; /* shift u right, dividing it by 2 */
v >>= 1; /* shift v right, dividing it by 2 */
k+=1; /* add a power of 2 to the final result */
}
/* At this point either u or v (or both) is odd */
do {
if ((u & 1) == 0) /* if u is even */
u >>= 1; /* divide u by 2 */
else if ((v & 1) == 0) /* else if v is even */
v >>= 1; /* divide v by 2 */
else if (u >= v) /* u and v are both odd */
u = (u-v) >> 1;
else /* u and v both odd, v > u */
v = (v-u) >> 1;
} while (u > 0);
return v << k; /* returns v * 2^k */
}
public static int Factorial(int x) {
int result=1;
for (int index = x; index != 0; index--) {
result *= index;
}
return result;
}
private static byte opOrder(char tOp) {
byte retVal;
switch (tOp) {
case '!': // factorial
retVal = 20;
break;
case '@': // function
retVal=16;
break;
case ',': // function argument separator
retVal=15;
break;
case 'c': // concatenation
retVal=14;
break;
case '~': // inversion
retVal=13;
break;
case '^': // power
retVal=12;
break;
case '*': // multiplication
case '/': // division
case '%': // modulus
case '\\': // integer division
retVal=11;
break;
case '+': // addition
case '-': // subtraction
retVal=10;
break;
case '>': // greater than
case 'G': // greater than or equal to
case '<': // less than
case 'L': // less than or equal to
retVal=8;
break;
case '=': // case-sensitive equal
case 'i': // case-insensitive equal
case 'N': // case-sensitive not equal
case 'I': // case-insensitive not equal
retVal=7;
break;
case '&': // bitwise-and
retVal=6;
break;
case 'X': // bitwise-xor
retVal=5;
break;
case '|': // bitwise-or
retVal=4;
break;
case 'A': // boolean and
retVal=3;
break;
case 'O': // boolean or
retVal=2;
break;
case 'r': // shift right
case 'l': // shift left
retVal=9;
break;
default: // not an operation
retVal=0;
break;
}
return retVal;
}
public static bool isOp(char i, short pos) {
if (pos==1) return ("!+-*/\\%^&|=<>~".IndexOf(i) != -1);
else if (pos==2) return ("&|^=)".IndexOf(i) != -1);
else if (pos==3) return i=='=';
return false;
}
public static void FillOpsList() {
ops = new SortedList<string, char>(23);
ops.Add(">>", 'r');
ops.Add(">=", 'G');
ops.Add(">", '>');
ops.Add("===", '=');
ops.Add("==", '=');
ops.Add("=", 'i');
ops.Add("<=", 'L');
ops.Add("<<", 'l');
ops.Add("<", '<');
ops.Add("+", '+');
ops.Add("||", 'O');
ops.Add("|", '|');
ops.Add("^^", 'X');
ops.Add("^", '^');
ops.Add("/", '/');
ops.Add("*", '*');
ops.Add("&&", 'A');
ops.Add("&", '&');
ops.Add("%", '%');
ops.Add("-", '-');
ops.Add("!==", 'I');
ops.Add("!=", 'N');
ops.Add("!", '!');
ops.Add("~", '~');
constants = new SortedList<string, object>(6);
constants.Add("e", Math.E);
constants.Add("false",false);
constants.Add("g", 1.6180339887498948482045868);
constants.Add("pi", Math.PI);
constants.Add("true", true);
constants.Add("y", 0.5772156649015328606065120);
}
public static object Eval(string input) {
char[] charain = input.ToCharArray();
Stack<char> opStack = new Stack<char>(16);
Stack numStack = new Stack(16);
Stack<string> funcStack = new Stack<string>(8);
string buff;
int i = 0, pLevel;
char thisOp;
short loop, numParams;
bool lastwasop = true;
bool isnumber, isfloat, infunc, inquotes, unknownString = false;
while (i < charain.Length) {
if (charain[i].Equals('(')) {
pLevel = 1;
buff = string.Empty;
while (pLevel!=0 && ++i<charain.Length) {
if (charain[i].Equals('(')) pLevel+=1;
if (charain[i].Equals(')')) pLevel--;
if (pLevel!=0 || !charain[i].Equals(')')) buff += charain[i];
}
numStack.Push(Eval(buff));
lastwasop = false;
}
else if ((!lastwasop||charain[i]!='-'||(i!=0&&charain[i-1]=='!')) && isOp(charain[i], 1)) {
buff = charain[i].ToString(Util.cfi);
loop=1;
while (++i<charain.Length && loop++<=3 && isOp(charain[i], loop))
buff += charain[i];
i--;
thisOp = ops[buff];
if (!unknownString && thisOp.Equals('+') && numStack.Count!=0 && numStack.Peek() is string) thisOp='c';
while (opStack.Count!=0 && numStack.Count!=0 && opOrder(thisOp)<=opOrder(opStack.Peek()))
evaluate_stack_tops(numStack, opStack, funcStack, false);
opStack.Push(thisOp);
lastwasop=true;
unknownString = false;
}
else if (charain[i] != ' ') {
buff = string.Empty;
if (charain[i].Equals('"')) {
while (i++!=charain.Length && charain[i]!='"')
buff += charain[i];
numStack.Push(buff);
}
else {
isnumber = true;
isfloat = infunc = inquotes = false;
pLevel = numParams = 0;
if (charain[i].Equals('-')) {
buff = "-";
i+=1;
}
while (i!=charain.Length && (!isOp(charain[i], 1) || infunc)) {
if (charain[i].Equals('(')) {
if (pLevel==0) {
funcStack.Push(buff);
buff = string.Empty;
opStack.Push('@');
infunc = true;
}
else buff += '(';
pLevel+=1;
}
else if (infunc && charain[i]==')') {
pLevel--;
if (pLevel==0) {
numStack.Push(Eval(buff));
numParams+=1;
}
else buff += ')';
}
else if (infunc && pLevel==1 && charain[i]==',') {
numStack.Push(Eval(buff));
numParams+=1;
buff = string.Empty;
}
else {
if (inquotes || charain[i]!=' ') {
if (charain[i] == '"') inquotes = !inquotes;
if (!(char.IsDigit(charain[i])||charain[i]=='.')) isnumber = false;
if (charain[i] == '.') isfloat=true;
buff += charain[i];
}
}
i+=1;
}
if (!infunc) {
if (isnumber) {
if (isfloat = true) numStack.Push(double.Parse(buff, Util.cfi)); // effectively disable ints (for now, at least)
else numStack.Push(int.Parse(buff, Util.cfi));
}
else if (constants.ContainsKey(buff.ToLowerInvariant())) numStack.Push(constants[buff.ToLowerInvariant()]);
else {
numStack.Push(buff);
//unknownString = true;
}
}
else numStack.Push(numParams);
i--;
}
lastwasop = false;
}
i+=1;
}
while (opStack.Count!=0 && numStack.Count!=0)
evaluate_stack_tops(numStack, opStack, funcStack, false);
if (numStack.Count != 0) return numStack.Pop();
else return false;
}
}
}

View File

@ -1,19 +0,0 @@
<?xml version="1.0"?>
<PSSA>
<Files />
<Layer Enabled="True" PerSyllable="True" RemoveK="False" AddAll="False" AddOnce="False" DontAddText="False" AddText="True" AddK="True" AddASSA="True" AddClosingBracket="True" Repetitions="1">
<Effect InstanceName="Hide previous" Name="Raw code" Enabled="True">
<Option Name="Code">\1a&amp;HFF&amp;\2a&amp;HFF&amp;\3a&amp;HFF&amp;\4a&amp;HFF&amp;</Option>
<Condition ConditionOne="%karanum%" ConditionTwo="0" ConditionOperation="==" Enabled="True" />
<Condition ConditionOne="%layernumlps%" ConditionTwo="0" ConditionOperation="!=" Enabled="True" />
</Effect>
<Effect InstanceName="Main Code" Name="Raw code" Enabled="True">
<Option Name="Code">\r\t(%karastart%,%karamid%,\fscx50)\t(%karamid%,%karaend%,\fscx100)</Option>
<Condition ConditionOne="%karanum%" ConditionTwo="%layernumlps%" ConditionOperation="==" Enabled="True" />
</Effect>
<Effect InstanceName="Hide next" Name="Raw code" Enabled="True">
<Option Name="Code">\r\1a&amp;HFF&amp;\2a&amp;HFF&amp;\3a&amp;HFF&amp;\4a&amp;HFF&amp;</Option>
<Condition ConditionOne="%karanum%" ConditionTwo="$eval(%layernumlps%+1)" ConditionOperation="==" Enabled="True" />
</Effect>
</Layer>
</PSSA>

View File

@ -1,661 +0,0 @@
<html>
<head>
<title>SSATool Readme</title>
<style type="text/css">
<!--
.header { background: #A0D0FF; border: thin black; margin-top: 0px; margin-bottom: 12px; color: #000000; padding: 6px; text-align: center; margin-left: 0px; margin-right: 0px; }
.box { background: #C0C0C0; border: thin black; color: #000000; width: 75%; border-color: #000000; text-align: left; padding-top: 4px; padding-bottom: 16px; padding-left: 12px; padding-right: 12px; }
.exp { background: #DADADA; border-style: solid; border: thick black; margin-left: 32px; margin-right: 32px; margin-bottom: 24px; line-height: 130%; }
.subinfo { background: #D4D4D4; border: thin black; color: #000000; border-color: #000000; text-align: left; margin-left: 48px; margin-right: 32px; }
#optlist li { list-style-type: square; line-height: 125%; }
#sublist li { list-style-type: circle; line-height: 150%; }
p { text-indent: 32px; }
h3 { text-indent: 10px; }
h4 { text-indent: 10px; }
-->
</style>
</head>
<body>
<center>
<h1>SSATool 4.3</h1><br />
<h2>Purpose</h2>To automate the creation and manipulation of Advanced Substation Alpha files.<br /><br />
<h2>Functions</h2>
<div class="box">
<div class="header">Shifting</div>
<div class="exp">
SSATool can shift a file by entering a time (hour:minutes:seconds.subseconds), by a given number of frames, or by specifying an 'old' time and the new time that it should be shifted to. Shifting by time or frames require a given direction, while time difference already has a direction, given the 2 times.
</div>
<h4>Shifting options</h4>
<div class="subinfo">
<ul id="optlist">
<li>Shift Start/End times: You may choose to only shift the start or end times of each line.</li>
<li>Replace negative times: If you're shifting backwards and some times end up negative, this option will replace them with a 0 time. After all, who wants to see subtitles before you even watch the video?</li>
<ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Commands</div>
<div class="exp">
These are parameterless functions that don't take much explaining.
</div>
<ul id="sublist">
<li>Strip SSA: Strips all SSA code except for \k,\K,\kf,\ko. Useful for when you want to undo typesetting to a file but keep the timing.</li>
<li>Removes duplicate dialogue lines. If you've got a file that used layer per syllable type karaoke and you strip SSA, you'll have several duplicate lines.</li>
<li>Change last \k based on line length: Goes through dialog lines, and adjusts the length of the last syllable to match the length of the line. It is possible for this value to turn out negative if the timing is way off, so use it with care.</li>
</ul>
</div><br /><br />
<div class="box">
<div class="header">Length-based \k or \K</div>
<div class="exp">
This changes each syllable to \k or \K as determined by a threshold.
</div>
<div class="subinfo">
<ul id="optlist">
<li>Threshold: Anything above or equal to this gets changed to \K and anything under it uses \k.</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Scale Resolution</div>
<div class="exp">
SSATool can change a resolution of a SSA file for you. If you have two different files that you want to merge, but they have different resolutions, then you must use a function like this.
</div>
<h4>Scaling options</h4>
<div class="subinfo">
<ul id="optlist">
<li>Scale factor: Pretty straightforwardly, the amount that you want to scale by.</li>
<li>Scale PlayRes: Scale PlayResX/PlayResY in the header, if they're already there. They must be checked for this to do anything.</li>
</ul>
</div>
<h4>Scaled Parameters</h4>
<div class="subinfo">
<ul id="optlist">
<li>Style lines: Font size, outline, shadow, margins</li>
<li>Dialogue lines: Margin overrides</li>
<li>\bord: using Y scale</li>
<li>\clip: using X and Y scales</li>
<li>\fs: using Y scale</li>
<li>\fsp: using X scale</li>
<li>\move: using X and Y scales</li>
<li>\org: using X and Y scales</li>
<li>\p: Coordinates will be scaled with X and Y scales. If a \p1 is in a \clip, it DOES continue past the clip unless you \p0.</li>
<li>\pbo: using Y scale</li>
<li>\pos: using X and Y scales</li>
<li>\shad: using Y scale</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Lead-in/out</div>
<div class="exp">
This adds a lead-in/out to lines. It can add a \k to the beginning of the line to compensate. It does not current affect other tags like \t, \move, etc.
</div>
<h4>Options</h4>
<div class="subinfo">
<ul id="optlist">
<li>In Time: If checked, this is the amount of lead-in time. If it's a number, it's interpreted as seconds. Else it's interpreted as a timecode.</li>
<li>Out Time: If checked, this is the amount of lead-out time. If it's a number, it's interpreted as seconds. Else it's interpreted as a timecode.</li>
<li>Affect only karaoke lines: Affect only lines with \k in them if checked.</li>
<li>Add empty \k for karaoke: Add a \k to compensate for lead-in time to lines that have \k in them already.</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Gradient Maker</div>
<div class="exp">
This will create a gradient by making several lines using clip. You may type text in, or you may select a line from the loaded file and click "Copy Selected List Item to Input." If the line has dialogue: ... in it (IE the information for the line and not just the line itself), then select that and click the "Move Selected" button next to the "Before Grad." textbox. This will place that text before each line without actually putting it in the gradient. Fill in the boxes and click Create.
</div>
<h3>Options:</h3>
<div class="subinfo">
<ul id="optlist">
<li>Before Gradient: This is text that doesn't get gradiented. Put all the Dialogue: ... stuff here. This is easily accomplished by highlighting the appropriate text in the "Gradient Text" field and clicking the "Move Selected" button.</li>
<li>Clip Lines: How many lines the gradient will span. More lines is more precise.</li>
<li>Start/End Pos: The start and end positions in coordinate form x,y. Only include the part that will increase, IE if you want to go across a 640x480 screen horizontally, only x should be increasing here, and the height of 480 is an offset (it's always there), so leave height 0 here.</li>
<li>Offset: Static values that are added to the second X and Y positions. See the above example, where the offset here would be 0,480.</li>
<li>Start/End Value: The start and end colors in (A)BGR form. They can be in decimal form or in hex form with leading H. Do not include ampersands. Alpha is optional (as denoted by the parenthesis).</li>
<li>Linear/Log/Exp grad: These control how the colors are scaled: linearly, logarithmically, or exponentially (base^ratio). If you use one of the latter two, set the base to something greater than 1.</li>
<li>Turnaround: This will allow you to go from the start value to the end value somewhere in the middle of the gradient, and then back to start RGB. It's a percentage. At 50%, it will turn around at the halfway point.</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Blur</div>
<div class="exp">
This allows you to use layered alpha blurring. Make sure your input does not have a \bord or \pos coordinate in it, unless you're doing a glow, which does allow \pos. Also, if your line has dialogue: ... in it, make sure to select that part of the line and click the "Move Selected" button next to the "Before Blur" textbox.
</div>
<h3>Options:</h3>
<div class="subinfo">
<ul id="optlist">
<li>Before Blur: This is text that doesn't get blurred. Put all the Dialogue: ... stuff here. This is easily accomplished by highlighting the appropriate text in the "Blur Text" field and clicking the "Move Selected" button.</li>
<li>Type: This allows you to select "true blur" or glow. True blur will move the line around with different alpha values given a position of the text. Glow will just leave the text in the same spot while creating subsequently larger borders with more alpha.</li>
<li>Lines: Only used with glow option. Creates the given amount of lines where each line has a larger border than the last.</li>
<li>Start/End alpha: Start and end alpha values. Decimal or hex with leading H. Omit the ampersands.</li>
<li>Blur Radius: How many pixels the blur should be.</li>
<li>Position: Only needed for true blur: The position on the screen where the text is in x,y form. Pixels will be added/subtracted to this value.</li>
<li>Linear/Log/Exp blur: These control how the alpha values are scaled: linearly, logarithmically, or exponentially (base^ratio). If you use one of the latter two, set the base to something greater than 1.</li>
<li>Affect: Will blur the selected elements (\1c, \2c, \3c, and/or \4c). Not applicable to glow.</li>
<li>On subsequent lines...: If not blurred, the elements selected here will have &HFF& alpha values for all lines except the main line.</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Notebox Maker</div>
<div class="exp">
This allows you to easily create cool looking noteboxes from templates contained in the included XML file. Noteboxes can be one or two lines long and each template must specifically give code for each length. See the included file for an example. Templates may be of different resolutions. If a script is loaded which contains PlayResX and/or PlayResY, the generated notebox will be automatically resampled to the script size. Otherwise, the generated notebox will be at the default resolution of the template.
</div>
<h3>Options:</h3>
<div class="subinfo">
<ul id="optlist">
<li>Copy styles to file: The styles for the notebox will not be inserted into your file just by generation of a notebox. You can use this button to insert them automatically in that case.</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Error Checker</div>
<div class="exp">
This will check a file for some common errors. It checks dialogue and style lines.</li>
</div>
<h4>Checks for:</h4>
<div class="subinfo">
<ul id="sublist">
<li>Unopened/unclosed parenthesis</li>
<li>Unopened/unclosed brackets</li>
<li>No trailing ampersand in color/alpha values</li>
<li>Lowercase H for hex</li>
<li>Malformed transformations (\t(time,time)\effect)</li>
<li>Decimals without leading integers (.01 vs. 0.01)</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Font Test</div>
<div class="exp">
This will search a file for all fonts used and check if they are installed on your system. If fonts are not installed, you may search a directory for the fonts. It does not make sure the files it finds have the needed styles. It only matches by font name.
</div>
</div><br /><br />
<div class="box">
<div class="header">Manual Transform</div>
<div class="exp">
How many times have you wished you could use \t on something that doesn't allow it? How many times have you wanted a nonlinear acceleration parameter for \move? Here's a function that will automatically interpolate these things like \t, but it's much more powerful.
</div>
<h3>Zones/the Times Listbox</h3>
<div class="subinfo">
<p>Manual Transform is based on zones, which are made up of a start and end time. There must be at least one zone. Each additional zone uses the end time of the previous zone as its start time. So if you entered the times of 0:00:00.00, 0:01:00.00 and 0:02:00.00, there are two zones: one from 0:00:00.00-0:01:00.00 and one from 0:01.00.00-0:02:00.00.</p>
<p>Based on these different zones, you can have variables which can scale differently at different times. Numbers can scale linearly during one zone and exponentially during another if you like. Text can change between zones.</p>
<p>If this flexibility is not required, just entering a start time and an end time, making one zone only, will keep things simple.</p>
</div>
<h3>Variables</h3>
<div class="subinfo">
<p>This is the data that gets scaled. To add a variable, click the new button and type a name into the popup. You can then edit the values for each time by clicking on the appropriate field in the variable list. You may use either a string or a number. Numbers will be scaled automatically, whereas strings will switch over when a new zone is reached.</p>
<p>If you enter a string and a number under the same variable, then it will treat both as a string. If you have a string and a number and a number (2 zones), it will print the string until it hits the second zone, where it will then scale between the two numbers. That is to say that if, in the current zone, the start and end variable values are both numbers, the number will be scaled; If one or both are non-numbers, both will be treated as strings.</p>
<p>Acceleration: You can use linear, logarithmic or exponential acceleration for each variable and zone. Exponential acceleration has 2 forms: ratio^base, which is specified by just entering a number > 1, or base^ratio by specifying exp<i>base</i> (Example: exp2). Specify a log transform by typing log<i>base</i>. If none of these are specified or are incorrectly entered, a linear transform will be used. ASSA itself uses ratio^base for acceleration, so the default behavior (entering a number) works the same as entering that number into \t.</p>
</div>
<h3>Other options</h3>
<div class="subinfo">
<ul id="optlist">
<li>Code is how SSATool puts the variables together to form the text that gets output. To add the line times, use <b>%starttime%</b> and <b>%endtime%</b> in the code. To use a variable in the code, surround the variable name with percentage signs. You may use scripting functions here. If you're scaling an integer, you're going to want to round it with scripting because it will be printed as a decimal otherwise.</li>
<li>Times: Enter the times for this to span. You must enter at least two times. You may enter more than one time to create different zones where variables can be scaled differently. Times should be the first thing you add.</li>
<li>Frame Rate: The framerate of the video. All entered and output times will be snapped to the nearest frame.</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Kanji timing</div>
<div class="exp">
This function will allow you to time Kanji (or pretty much any other East Asian character set) from Roman letters. You may combine \k times, but this function can't work with \t as it can't be sure how to handle the times. It could also technically be used in reverse, but it's not capable of splitting syllables from the source style.<br /><br />
You must have your two character sets entered in different styles. The kanji may already be timed, but those times will be overridden if so. Empty syllables will be copied alone, or will be combined with the surrounding syllables if those are to be combined.
</div>
<h3>Options</h3>
<div class="subinfo">
<ul id="optlist">
<li>Styles: Select your source and destination styles here. The source style will be used for times and all ASSA code. Destination lines will be overwritten in the list. Note: Any ASSA code appearing before the \k will be directly copied, and ASSA code after the \k is currently not copied at all.</li>
<li>Start: Brings the first lines of each style into the corresponding text fields.</li>
<li>Link: When you have selected corresponding syllables, this will pair them up and you will see them appear in the group list.</li>
<li>Unlink last: If you've made a mistake, this will unlink the last pair. You may use it as many times as needed.</li>
<li>Skip source line: Skip the current source line.</li>
<li>Skip destination line: Skip the current destination line. It won't be modified at all.</li>
<li>Go back a line: Goes back to the last line for both the source and destination. It does not undo any changes made, but you may redo it.</li>
<li>Accept line: When all of the grouping for a line is finished, this will modify the line in the list and automatically load the next lines for source and destination.</li>
</ul>
</div>
<h3>Keyboard shortcuts</h3>
<div class="subinfo">
<div class="subinfo">
Don't use the mouse to highlight grouping. If you incorrectly try to split syllables from the source, the function won't work right, so please use the following keyboard shortcuts while the destination textbox has focus. They're much faster.
</div>
<ul id="optlist">
<li>Right/left arrows: Select more or less text from the destination, respectively.</li>
<li>Up/down arrows: Select more or less text from the source, respectively. The source text is locked so it can not be split, but you may combine syllables from it.</li>
<li>Enter: Link the selected text, or if all text is linked, accept the line and move on to the next.</li>
<li>Backspace: Undo the previous linked text.</li>
</ul>
</div>
</div><br /><br />
<div class="box">
<div class="header">Karaoke effects</div>
<div class="exp">
The karaoke effect generator is a complex karaoke effects automator. In simple terms, it could be called a "\k to \t converter," though it is not limited to transformations. You have several variables (listed below) and scripting functions (listed further below in another section) available to use in template effects. You also have "raw code," which will just dump anything you put in there into the SSA. You can use variables in any of the effect fields. You may use raw code to accomplish anything that the other effects can do. Other effect templates are there just to make it easier for you to make presets. There's an effects editor to add your own presets available under the Effects menu.
</div>
<h3>Layers</h3>
<div class="subinfo">
<p>Layers are the basis of the effects system. They are, in essence, one of the base elements of ASSA itself. The simplest implementation of a layer is a single dialogue line. That's it. The subtitler program reads each line and decides where each line goes, and in what order they go.</p>
<p>However, in SSATool, layers are different than how SSA itself looks at them. A layer is how SSATool processes a line in order to add effects. Depending on the complexity of an effect, it may take from one to several lines to accomplish. That is, you might have two or three or even dozens of dialogue lines composing what we see as one line! So each layer in SSATool will add another dialogue line with the same text but potentially different overrides. But to make things even more confusing, there's an exception: Layer-Per-Syllable. What happens if you want to do something to a syllable in a karaoke as its "turn" comes up, but the command to do what you want to do is a command that affects the whole dialogue line, even if you use \r? You often have to make a dialogue line corresponding to each syllable.</p>
<p>This is what layer-per-syllable does. It will dynamically create a new dialogue line (layer) for each syllable. You're typically going to want to see each line only for the syllable it corresponds to, because that's the basic reason why layer-per-syllable exists. To accomplish that, you're going to want to have a couple of effects in addition to your transformation code. These extra effects will be to make the line invisible except at the corresponding syllable. You'll use conditions (explained below) to apply alpha codes before and after this syllable. A sample layer-per-syllable project file should be bundled to show you how to go about it. Don't use it as a basis every time you want to do layer-per-syllable, because it will ensure that you don't understand how the process works. To make karaoke, you must first understand how ASSA renders karaoke.</p>
<p>To enable layer-per-syllable mode, simply add a layer and make sure the Layer-per-Syllable checkbox is clicked. You may combine layer-per-syllable layers together or with fixed layers if you like.</p>
</div>
<h3>Conditions</h3>
<div class="subinfo">
<p>There are two types of conditions in the karaoke effects generator: effect conditions and layer conditions. They both do the same thing, but they work on a different scope. For both, you enter two things to compare. These things may be numbers or strings, and you may use variables and scripting functions (listed below).</p>
<ul id="optlist">
<br /><li>With effect conditions, each condition must be true for that effect to be applied, or it will just be skipped for that syllable. There is no condition checking for effects on a per-line scope, meaning the conditions are only checked per syllable, not per line. This is the more flexible option of the two.</li>
<br /><li>With layer conditions, each of these must work out for all of the effects in that layer to be applied. By default, if this is not met, there will be no dialogue line created at all. However, when you create your layer conditions, you may option to create the dialogue line WITHOUT effects if the conditions are not met. For fixed layers, the option is called, "Add line unchanged if layer conditions not met." If you're using layer-per-syllable, just that option will add the line several times (once per syllable) if the layer conditions aren't met, so you'll also want to enable the option, "Only add it once."</li>
</ul>
</div>
<h3>Layout</h3>
<div class="subinfo">
<p>The layout of the karaoke effects section can be a little confusing at first. At the left, there's a treeview. This holds information about all layers and effects. You can add a layer via the button under it. Once you have added and selected a layer, you may add effects to it through that button. You may drag items around the treeview to reorder them or to move effects to a different layer. You may duplicate or remove layers or effects through the corresponding buttons.</p>
<p>When you select a layer in the treeview, the layer options page automatically shows up. Here, you can add layer conditions or change the options for the layer. When you click on an effect, you get a tabbed setup where you can view the options for that effect or the conditions. To change an option for an effect, just click on the corresponding field.</p>
</div>
<h3>Options</h3>
<div class="subinfo">
<ul id="optlist">
<li>Don't add the syllable text: This will leave out the actual text for the syllable. You may add it yourself in your effects using the %text% variable. This allows you to split a \k if you like.</li>
<li>Remove \k: This will remove \k, \K, \ko and \kf after applying effects. Keep a backup file before you use this option in case timing needs to be changed later.</li>
<li>Add line unchanged if conditions not met: If layer conditions aren't met, add the dialogue line with no effects. You could get missing dialogue lines without this option.</li>
<li>Only add it once: An extension of the above for layer-per-syllable mode to prevent dialogue lines from being added multiple times when layer conditions are not met.</li>
<li>Layer-per-Syllable: Enable Layer-per-Syllable mode for this layer. See the explanation above.</li>
<li>Repetitions: This only applies to non-LPS layers. The layer will be repeated this amount of times. It only applies to karaoke lines, not regular dialogue lines.</li>
</ul>
</div>
<h3>Karaoke variables</h3>
<div class="subinfo">
<table border="0" cellspacing="8">
<tr>
<td width="150">%karastart%</td>
<td>Start time of current kara block in milliseconds.</td>
</tr><tr>
<td>%karastart[n]%</td>
<td>Start time of kara block <i>n</i> in milliseconds. Yes, the square brackets should be there. You may use other variables in the brackets (except for another variable with brackets). Example: %karastart[%totkaranum%]%</td>
</tr><tr>
<td>%karaend%</td>
<td>End time of current kara block in milliseconds.</td>
</tr><tr>
<td>%karaend[n]%</td>
<td>End time of kara block <i>n</i> in milliseconds. Yes, the square brackets should be there. You may use other variables in the brackets (except for another variable with brackets).</td>
</tr><tr>
<td>%karamid%</td>
<td>Mid point of current kara block in milliseconds. ((start+end)/2)</td>
</tr><tr>
<td>%karalen%</td>
<td>Length of current kara block in milliseconds.</td>
</tr><tr>
<td>%karalen[n]%</td>
<td>Length of kara block n in milliseconds. Yes, the square brackets should be there. You may use other variables in the brackets (except for another variable with brackets.</td>
</tr><tr>
<td>%karanum%</td>
<td>The number of the kara block being evaluated, indexed from 0.</td>
</tr><tr>
<td>%karanumtot%</td>
<td>The total number of kara blocks in this line. If you compare with %karanum%, make sure to add 1 to %karanum% since it starts at 0.</td>
</tr><tr>
<td>%linestart%</td>
<td>Start time of current line in seconds in seconds</td>
</tr><tr>
<td>%lineend%</td>
<td>End time of current line in seconds</td>
</tr><tr>
<td>%linelen%</td>
<td>Length of current line in seconds</td>
</tr><tr>
<td>%layernum%</td>
<td>The current layer number, indexed from 0.</td>
</tr><tr>
<td>%layernumtot%</td>
<td>The total number of layers</td>
</tr><tr>
<td>%layernumlps%</td>
<td>The current layer number in layer-per-syllable mode. In fixed layer mode, this is also also used when repetitions of the layer is set > 1. Indexed from 0.</td>
</tr><tr>
<td>%layernumlpstot%</td>
<td>The total number of layers in layer-per-syllable mode. In fixed layer mode, it is the total number of repetitions of the current layer.</td>
</tr><tr>
<td>%name%</td>
<td>The name (SSA) or actor (ASS) of the line.</td>
</tr><tr>
<td>%style%</td>
<td>The name of the current style</td>
</tr><tr>
<td>%text%</td>
<td>The text inside of the current syllable. Recommended for use with "Don't add the syllable text itself" in the Layer Conditions+Options tab, but can be used by itself.</td>
</tr>
</table>
</div>
</div><br /><br />
<div class="box">
<div class="header">Scripting</div>
<h4>Functions</h4>
<div class="subinfo">
<table border="0" cellspacing="8">
<tr>
<td width="200">$eval(expression)</td>
<td>Does math/logic. It supports the sub-functions listed in the table below. Strings used in this must be surrounded by double quotes. Not using quotes should work in most situations, but this is mostly for reasons of backwards compatibility. If used for logic, it will return True or False (as booleans, so no quotes around them).</td>
</tr><tr>
<td>$iif(expression,t, f)</td>
<td>Inline if (a conditional statement). The expression may be a boolean logic expression, or it may be something that evaluates to true or false. If the expression is True, it returns the second argument. If it's false, it returns the third. If it (or you) messes up, it returns "error".</td>
</tr><tr>
<td>$len(text)</td>
<td>Returns the length of <i>text</i>.</td>
</tr><tr>
<td>$left(text,length)</td>
<td>Returns the first <i>length</i> characters of <i>text</i>.</td>
</tr><tr>
<td>$listindex(n,item,item,...)</td>
<td>Returns the n<super>th</super> supplied item indexed from 1. Returns "error" if the supplied value is incorrect.</td>
</tr><tr>
<td>$listindexlast(item,item,item,...)</td>
<td>Returns the n<super>th</super> supplied item indexed from 1. Returns "error" if the supplied value is less than one. Returns the last value if the index is too big.</td>
</tr><tr>
<td>$listindexwrap(item,item,item,...)</td>
<td>Returns the n<super>th</super> supplied item indexed from 1. Returns "error" if the supplied value is less than one. Wraps around to the beginning of the list if the index is too big.</td>
</tr><tr>
<td>$mid(text,start,length)</td>
<td>Returns <i>length</i> characters of <i>text</i>, starting at <i>start</i>. The first character is indexed as 0.</td>
</tr><tr>
<td>$randlist(item,item,item,...)</td>
<td>Returns a random item from the given inputs.</td>
</tr><tr>
<td>$right(text,length)</td>
<td>Returns the last <i>length</i> characters of <i>text</i>.</td>
</tr><tr>
<td>$str(text,n)</td>
<td>Repeats <i>text</i> <i>n</i> times.</td>
</tr>
</table>
</div>
<br /><br />
<h4>Eval Sub-Functions</h4>
<div class="subinfo">
<table border="0" cellspacing="8">
<tr>
<td width="200">abs</td>
<td>Return the absolute value of a number.</td>
</tr><tr>
<td>acos</td>
<td>Returns the arc-cosine of a number.</td>
</tr><tr>
<td>asin</td>
<td>Returns the arc-sin of a number.</td>
</tr><tr>
<td>atan</td>
<td>Returns the arc-tangent of a number given an angle.</td>
</tr><tr>
<td>atan2</td>
<td>Returns the arc-tangent of a coordinate. Format: atan2(x,y)</td>
</tr><tr>
<td>bound</td>
<td>Bounds a number between 2 values. Takes 3 parameters: Number, LBound, UBound. Returns LBound if Number < LBound, or UBound if Number > UBound. Otherwise returns Number.</td>
</tr><tr>
<td>ceil</td>
<td>Rounds up. Example: ceil(5.01) returns 6</td>
</tr><tr>
<td>cos</td>
<td>Return the cosine of a number.</td>
</tr><tr>
<td>fact</td>
<td>Computes the factorial of an integer. This is the same as the ! operator.</td>
</tr><tr>
<td>floor</td>
<td>Rounds down. Example: floor(5.99) returns 5. floor(-5.99) returns -6.</td>
</tr><tr>
<td>int</td>
<td>Returns the integer of a number. int(-5.99) returns -5.</td>
</tr><tr>
<td>len</td>
<td>Returns the length of a string.</td>
</tr><tr>
<td>log</td>
<td>Return the log of a number. It's base e. If you want a different base, do log(number)/log(base)</td>
</tr><tr>
<td>max</td>
<td>Return the higher of 2 numbers.</td>
</tr><tr>
<td>min</td>
<td>Return the lower of 2 numbers.</td>
</tr><tr>
<td>rand</td>
<td>Returns a bounded random integer. rand() gives you an integer from 0 to 1, rand(maxvalue) gives an integerfrom 0 to maxvalue, and rand(low,high) from low to high</td>
</tr><tr>
<td>randf
<td>Returns a bounded double precision floating point number. randf() gives you a double from 0 to 1, randf(maxvalue) gives a double from 0 to maxvalue, and randf(low,high) from low to high</td>
</tr><tr>
<td>round</td>
<td>Rounds a number to the given number of decimal places. Format: round(number,decimal places)</td>
</tr><tr>
<td>sin</td>
<td>Return the sin of a number.</td>
</tr><tr>
<td>sqrt</td>
<td>Return the square root of a number.</td>
</tr><tr>
<td>tan</td>
<td>Return the tangent of a number.</td>
</tr>
</table><br />
Take note that these do NOT have a leading $ like the above functions. They must be used INSIDE of $eval.
</div>
<br /><br />
<h4>Data types supported by eval</h4>
<div class="subinfo">
<table border="0" cellspacing="8">
<tr>
<td>Boolean</td>
<td>true or false. Capitalization does not matter. Do not enclose in quotes.</td>
</tr><tr>
<td width="60">Integer</td>
<td>Support not done, numbers currently treated as double. All mathematical/bitwise operations are available.</td>
</tr><tr>
<td>Double</td>
<td>Double-precision floating point number. All mathematical operations except modulus are available.</td>
</tr><tr>
<td>Point</td>
<td>An x,y pair. You may add or subtract points, or you may add, subtract, multiply or divide points by scalars. Not finished.</td>
</tr><tr>
<td>String</td>
<td>A string. + may be used to concatenate strings. All strings MUST be enclosed by quotes.</td>
</tr>
</table><br />
Boolean logic comparisons are available with all types. Also, note that conditions in the karaoke effects tool internally use $eval, so strings must be enclosed in quotes in there. Variables that are strings currently do NOT automatically do so.
</div>
<br /><br />
<h4>Constants supported by eval</h4>
<div class="subinfo">
<table border="0" cellspacing="8">
<tr>
<td>e</td>
<td>e, the natural logarithmic base.</td>
</tr><tr>
<td width="60">g</td>
<td>The golden ratio.</td>
</tr><tr>
<td>Pi</td>
<td>Pi.</td>
</tr><tr>
<td>y</td>
<td>Euler's constant.</td>
</tr>
</table><br />
All numerical constants are double precision (64-bit) floating points.
</div>
<br /><br />
<h4>Mathematical/Bitwise operators</h4>
<div class="subinfo">
<table border="0" cellspacing="8">
<tr>
<td width="60">+</td>
<td>Add</td>
</tr><tr>
<td>-</td>
<td>Subtract</td>
</tr><tr>
<td>*</td>
<td>Multiply</td>
</tr><tr>
<td>/</td>
<td>Divide</td>
</tr><tr>
<td>!</td>
<td>Factorial</td>
</tr><tr>
<td>%</td>
<td>Modulus (remainder after integer division)</td>
</tr><tr>
<td>&</td>
<td>Bitwise and</td>
</tr><tr>
<td>\</td>
<td>Bitwise or</td>
</tr><tr>
<td>\</td>
<td>Bitwise xor</td>
</tr><tr>
<td>&lt;&lt;</td>
<td>Shift left</td>
</tr><tr>
<td>&gt;&gt;</td>
<td>Shift right</td>
</tr><tr>
<td>~</td>
<td>Inversion</td>
</tr>
</table>
</div>
<br /><br />
<h4>Boolean/comparison operators</h4>
<div class="subinfo">
<table border="0" cellspacing="8">
<tr>
<td width="60">=</td>
<td>Equal to (if used with text, is case insensitive)</td>
</tr><tr>
<td>&lt;&gt;</td>
<td>Equal to (if used with text, is case sensitive)</td>
</tr><tr>
<td>==</td>
<td>Equal to (if used with text, is case sensitive)</td>
</tr><tr>
<td>!=</td>
<td>Not equal to (if used with text, is case insensitive)</td>
</tr><tr>
<td>!=</td>
<td>Not equal to (if used with text, is case sensitive)</td>
</tr><tr>
<td>&gt;</td>
<td>Greater than</td>
</tr><tr>
<td>&gt;=</td>
<td>Greater than or equal to</td>
</tr><tr>
<td>&lt;</td>
<td>Less than</td>
</tr><tr>
<td>&lt;=</td>
<td>Less than or equal to</td>
</tr><tr>
<td>||</td>
<td>Boolean or</td>
</tr><tr>
<td>&&</td>
<td>Boolean and</td>
</tr>
</table>
</div>
</div><br /><br />
<div class="box">
<div class="header">Effect and project files</div>
<h3>Effect files</h3>
<div class="subinfo">
Effect files are XML files that hold all preset effects except for "raw code," which is built in. They use the extension exml. You may edit them in a text editor by using the bundled effects as a template. There's also an effects editor in the program to write them for you.
</div><br />
<h3>Project files</h3>
<div class="subinfo">
Project files are also XML files, but they are in a different format than the effect files. They contain all layer, filter and condition information as well as the filename to the loaded SSA, if applicable. They are not a script - they do not keep track of your commands, but merely karaoke effects information. They may be edited in a text editor, but I only recommend doing that if you want to make a slight modification to an existing file.
</div>
</div><br /><br />
<div class="box">
<div class="header">File Encoding</div>
SSATool will open most common file encodings including ANSI (using your local codepage), Shift-JIS, and Unicode in 1, 2, or 4 octet versions. Some encodings, such as Shift-JIS are notoriously hard to detect, so if your file includes Japanese text and you're unsure of the encoding, please make sure to find out, or that it displays correctly if you use the open file option without the SJIS.<br /><br />
As of version 4.1, SSATool employs extremely simple algorithms for attempting to detect Shift-JIS and EUC-JP. If a file is under 4KB, 100 or more characters detected with either encoding will trigger a prompt asking to reload using that encoding. If the file is 4KB-8KB, the threshold is 300, and if the file is 8KB or more, 600.
</div><br /><br />
<div class="box">
<div class="header">Thanks</div>
The following are people I want to thank for helping me with this, be that by testing, lending me webspace, putting up educational code samples on the web, etc. Some will be in names, and others will be in online nicknames.<br />
<div class="subinfo">
<ul>
<li>DeathWolf - testing, feature suggestions, webspace</li>
<li>Neil Davidson - the <a href="http://www.codeproject.com/csharp/GetSaveFileName.asp?print=true">save file dialog w/ encoding</a> I'm using</li>
<li>PovRayMan - icon</li>
<li>SCR512 - testing</li>
<li>zalas - feature suggestions</li>
<li>Dead-Cow - testing</li>
<li>Nikolai - testing, feature suggestions</li>
<li>Anyone else I forgot</li>
</ul>
</div>
</div><br /><br />
SSATool is copyright (C) 2005-2006 Dan Donovan. It is free to use.
</center>
</body>
</html>

View File

@ -1,492 +0,0 @@
4.3.6
-Fix saving a project file with default layer names not showing any names when loading the file again
-Fix small bug loading v5/6 scripts
4.3.5
-Truetype Collection (TTC) font files are supported in the font finder
-Factorial should work now
-More optimizations/cleanups
4.3.4
-Fixed/tweaked some UI stuff
-More resize code added
-Fixed double click in error list
-Optimized some stuff
-All karaoke variables now index from 0, not 1. This will break backwards compatibility with some karaoke, but it has never been consistent, so I am changing it.
-Fixed %karamid%
4.3.3
-A bunch of fixes for noteboxes
-Don't bother to scale resolution if the factor is 1:1
4.3.2
-Workaround for crash when line is 259 characters long
-Workaround to prevent splitter from stealing focus on resize (by design, MS? What were you thinking?)
-Fix in default notebox template
4.3.1
-Search/replace now affects everything as it used to
-Unparsable dialogue/style lines are now parsed as strings, displayed with green background
-Changing time precision or running search/replace refreshes the list automatically
4.3.0.2
-Fixed karaoke condition buttons
4.3.0
-Added notebox generator, see readme
-List and utility panel are now resizable panes
-Fixed a bug in resolution scaling
-Fixed error checker crash
-Fixed kanji timing crash
4.2.0.10
-Fixed strip SSA leaving off the last syllable
4.2.0.9
-Fixed a bunch of functions that did nothing
4.2.0.8
-Gradient fixes
-Make screen update when you copy text from gradient/blur/etc to it, and don't copy text backwards
4.2.0.7
-v6 script support improved
-Fix so that you can do both lead-in and lead-out
-A bunch of UI crashes from 4.2.0 fixed
4.2.0.6
-Timecodes may now be unapplied
4.2.0
-Lead no longer makes the list backwards
-Undo/redo optimized and now support adding/removing lines
-Fixed styles
-Optimizations, including overall memory usage
-Fixed lead and remove duplicate lines
-Reading negative times supported
-Other misc fixes, mostly UI-related
-Some Math constants added to $eval, see readme
-Boolean inversion is now denoted as ~ as opposed to ! in $eval
-Added LCM and GCD to $eval
-Fix loading some files through command line
-Fix to reading ARGB colors
-Timecode transform added
-Double clicking a line in the list will bring up the modify line dialogue box
-Bold, Italic, etc. now specified as -1 (instead of 1) as per specs. Parsing will work correctly with either.
4.1.0
-V6 scripts (AKA V4++) supported
-Fixed a bug with %layernum% when you have disabled layers
-Undo/redo added
-Fixed a couple of bugs with kanji timing
-Effects files now use .exml extension. Old files may be renamed.
-Manual transform times are now displayed in the listbox as entered, but are snapped internally to be between frames.
-Conditions may now be edited directly instead of removing/readding
-Completely rewritten script engine combining $logic and $eval
-Workaround to prevent resaving UTF-16 files as UTF-8 by default
-You may now edit the names for karaoke layers and effects.
-Error checker now looks for decimals without leading integers (.1 vs 0.1)
-Rudamentary SJIS/EUC-JP detection
-Fixes to gradient maker
-Lots of general optimizations and other internal code changes
-Put layer condition checking back to per line instead of per syllable, as it should be
-Added karaoke syllable-per-line mode
4.0.0
-Resolution scaling now has separate scale parameters for X and Y, no longer affects all lines, and no longer crashes
-FPS is now a global parameter
-Added option for ms precision. A modified VSFilter is required for it to work.
-Lead-in/out now affect \t and \move
-Karaoke layer options layed out a little differently
-Added kanji timing
-Fixed a possible crash with karaoke effects for short lines
-Fixed trying to save a project file as ANSI
-Various interface tweaks
3.7.3
-Fixed %text% for syllables with no text
-Fixed logic with non-number, non-digit characters, such as space.
3.7.2
-Fixed $iif when a condition is false
-Fix crash trying to remove an item in the karaoke tree when nothing is selected
-Adding an effect to the karaoke tree selects it automatically
-Added $str, see readme
-Fixed one layer being disabled affecting all layers below it
-Fixed one effect having unmet conditions disabling all effects below it
3.7.1
-Added lead-in/out. It does not yet correct for \t, \move, etc.
3.7.0
-Converting to C# 2.0. Filesize is much smaller. New bugs may be introduced.
-Fixed bug loading project files where layers didn't specify repetitions.
3.6.0
-Added repetitions to karaoke effects. See readme.
-Removing effects should work better now.
-$logic should correctly interpret strings with numbers
3.5.0
-Programming structure improved
-Random tweaks here and there
-Fixed cloning (copying effects, duplicating layers) in many cases
-Select first karaoke effects layer (if there is one) when loading a project
-Added manual transform. See readme.
-Improved precision of shifting by frame. Start times are now always rounded down (floor), while end times are rounded up (ceil)
-Changed interface for karaoke effects to use a treeview for layers and effects
-Fixed a bunch of eval functions
-Font names can now contain anything except \ or }
-Fix parameter order for $eval(round)
3.2.5
-Script parser should handle parenthesis better now.
-Made $eval play nicer with decimals
-(hopefully) fixed one parameter functions for $eval
-$eval should bail and return String.Empty if it can't make sense of the data it's given
-Added sqrt() to $eval (or you can still do ^0.5)
-Fixed =/== in $evallogic/$iif
-Strings in $evallogic/$iif no longer are expected to be in quotes
3.2.4
-Fixed <, <=, >, >=
3.2.3
-Fixed a few bugs with writing XML Project files
-Fixed a bug when loading an XML project file that options would become confused between filters with multiple instances
-Fixed a couple of bugs that rendered effect conditions pretty much useless
-%layernum% and %layernumlps% now index from 1, not 0
-Pressing enter in the condition dialog box will click OK automatically
3.2.2
-The selected line information now properly moves when the form is resized.
3.2.1
-You can now load files (except effects files) through the command line (do "Open With" in Explorer)
3.2.0
-Karaoke effects generator can now allow you to edit the actual text for each syllable by setting "don't add the syllable text itself" in Layer Conditions+Options and using %text%.
-Length-based \k / \K fixed again
3.1.0
-Select/Deselect Line Range now accept the last line number (IE if you have a 10 line file, 1-10 works now)
-Slight optimization to how effects are created
-Blur now only has two types: true blur and glow. However, it is more powerful than before. See the readme for more.
-Blur no longer adds an empty line at the end
-Exponential blur no longer disregards BlurStart for the center line.
-Gradient now accepts a parameter called mirror. See the readme, but know that leaving it at 100 (%) will act the same as it used to.
-Added $listindex, $listindexwrap, $listindexlast functions
3.0.3 (3.0.2019.28843)
-Adding the same effect multiple times no longer mixes up the options between them.
-Fixed length-based \k / \K
3.0.2 (3.0.2017.31380)
-Offset in gradient maker now only affects the second X,Y pair in \clip
3.0.1 (3.0.2017.27737)
-Detecting unclosed parenthesis/brackets at the end of the line now works.
3.0 (3.0.2017.5108)
-Added $len, $left, $mid, $right
-Slight optimizations in $iif
-Added select/deselect line range to list menu. If you don't know the line numbers, click on the lines and use the go to line option and it'll show the current line.
-Made go to line show the selected line number by default and added a label to show this as well
-Optimizations to shifting and length based \k-\K
-Fixed strip SSA
-Fixed linear glow type blur accuracy
-Error checker will now report unclosed ampersands in \alpha, \2c, \2a, \3c, \3a, \4c, \4a
-Error checker will now report lowercase hex markers in \alpha
3.0 beta 6 (3.0.1975.5261)
-Fixed shifting if your file is 10 hours or more
-Fixed font check sometimes adding fonts more than once
-Workaround for looking for vertical fonts (@fonts). It will just omit the @. It doesn't check if the font is actually capable of being vertical.
-Added ability to search for fonts that aren't installed in a directory
-Saving as UTF-8 fixed
3.0 beta 5 (3.0.1958.3274)
-Fixed shifting cutting off part of the line in many cases.
3.0 beta 4
-Made form resizable
-Made default (and minimum) form width 1024 for those people using 1024x768
-Fixed logarithmic glow blur alpha values
-Fixed logarithmic and exponential gradient values when using a start color > 0
-Added font checker. Make good use of it. I know I will.
3.0 beta 3
-Fixed some menu options that weren't doing anything
-Double clicking on a line in error checking now takes you to the line in question. Also added a couple of checks for style lines.
-Added a layered blur option.
-Added option to do logarithmic and exponential gradients.
-Removed messagebox popping up with $iif
-Added some more error checks for various functions (not talking about the error checker, but when you enter invalid parameters to functions)
3.0 beta 2 (3.0.1948.40271)
-Also check for colors/alpha with lowercase hex codes (including the H) and also where there is not a trailing ampersand
-Scale PlayResX and PlayResY too
-Fixed eval
-Added the "list" menu with some useful list functions
-Performance increases in scripting/eval/evallogic. Thanks to DeathWolf for helping with this.
-Fixed effect conditions
3.0 beta 1 (3.0.1948.26940)
-Complete rewrite of application using C# 1.1, so you now need .NET to run it. Speed increases and GUI improvements result.
-Variables have changed formats. See readme.
-Scripting language is much different. See readme.
-Project files and effects list files both use XML now. They are not backwards compatible.
-Program supports basically all normal encodings, including UTF-16 (Unicode) that previous versions didn't.
-Gradient maker can do \1c, \2c, \3c, \4c (user selectable) and can handle RGBA (in ARGB order) and decimal input
-Resolution scaling now scales a lot more stuff. See readme.
--Old versions--
2.0.161
-Even bigger speedup
-Completely rewrote effects procedure, kept the old one as it may be buggy, as usual
-Made after 3.0 for those looking to avoid .Net (bad choice though)
2.0.158
-HUGE speedup
-Will no longer affect non-karaoke dialog lines
-Probably buggy
-Made after 3.0 for those looking to avoid .Net (bad choice though)
2.0.157
-More bugfixes and speedups
2.0.154
-More bugfixes
-Layer-per-syllable and fixed layer modes may be combined
-New variables dealing with layers: $layernumtot$, $layernumlps$, $layernumlpstot$. If you have a "legacy" layer-per-syllable file, open the PSSA in Notepad and add PerSyllable=True. When using $layernum$ for layer-per-syllable, you must now use $layernumlps$.
1.6.153
-Fixed several bugs introduced in the last release
-More speedups
-Added $style$ variable (see readme)
-Added ability to resize the program
1.5.152
-Fixed $iif with more than one comparison
-Some other random bugfixes
-There should be a minor speedup all around, but I don't know if it'll be noticeable
1.5.151
-Added ability to insert a gradient into a file without replacing a line
1.5.150
-A small bugfix in the gradient maker. Not sure if it even affected anything.
1.5.149
-Added some more to gradient maker
-New HTML readme
1.5.146
-Added a bunch of stuff to gradient maker, such as copying to/from the SSA file and automatically adding text before and after the line.
-Gradient maker no longer adds 1 extra line
1.4.145
-Another fix
1.4.144
-Fixed a gradient maker problem having to do with some parts of it being unfinished and disabled.
1.4.143
-More gradient maker work
-Added $randlist
1.3.142
-Started to implement a gradient maker. It's not done and what is done is experimental.
1.2.141
-New version scheme, actually using minor (and eventually major) version numbers instead of just build numbers.
-Added ability to change font in Listbox, including encoding.
1.1.140
-Fixed strip SSA, it should no longer strip numbers after \kf.
1.1.139
-Added: \k or \K depending on the length of the syllable
-Fixed a little big with scaling where it would try to work on lines it shouldn't be (though it shouldn't have messed anything up)
1.1.138
-Added: SSA Resolution Scaling. Use at your own risk.
-Removed: Old load/save projects
-Removed: Old add effects procedure.
1.1.137
-Fixed: Shifting now correctly abides the lines being checked/unchecked
1.1.136
-Some minor interface tweaks
-Added 'Move Down' for effects
1.1.135
-Restructured/cleaned up the code for adding karaoke effects. The old code will be left in for a little while until I can be sure there are no bugs in the new code. Please try the new code, but make sure you save before doing so.
1.1.134
-Fixed: Reparsing styles (made typo last build)
1.1.133
-Fixed: Read ASS Styles reparsing (also made slightly faster)
1.1.132
-Fixed: Read ASS Styles ([v4+ styles]) correctly.
1.1.131
-Fixed: Layer conditions and effect count were, in certain conditions, obtained from the wrong layer. This has been (hopefully) corrected.
1.1.130
-Fixed shifting...
1.1.129
-Fixed (I don't know): Shifting............. last time? Nah...
1.1.128
-Fixed (probably): Shifting... again. Should be accurate and not crash.
1.1.127
-Fixed (maybe): Shifting should be more accurate.
1.1.126
-Fixed: Effect condition checkboxes now correctly show as checked/unchecked when the condition is active/inactive as opposed to always being checked.
-Fixed: Layer condition checkboxes now correctly show as checked/unchecked when the condition is active/inactive as opposed to always being checked.
-Fixed: Effect conditions should no longer crash when loading a project.
-Fixed: Layer conditions should now correctly load as layer conditions instead of effect conditions when loading a project.
1.1.125
-Added: $lastkaranzkstart$
-Fixed: Trying to move/copy an effect when there are no effects no longer creates a blank effect.
1.1.124
-Fixed effects list not being correctly loaded if you open a SSA/ASS/PSSA from the command line.
1.1.123
-Added ability to load SSA/ASS and PSSA (project files) from command line. You can now associate SSATool with SSA, ASS and/or PSSA files and it will open them.
1.1.122
-Effects can now use variables in the code line and not just the options lines. If you don't know what this means, don't worry about it.
1.1.121
-Forgot to comment out some code before hitting compile in last version that made load project crash. Fixed.
-Added script tracing in the help tab... Every call to the script parser adds a line to the listbox. It will be at least 2 lines per script call.
1.1.120
-Fixed bug in $calc where a negative as the first number would not be recognized.
-Fixed: Trying to delete a layer when there are no layers no longer crashes.
-Fixed: Trying to delete an effect condition when there are no effect conditions no longer crashes.
-Fixes to load project
1.1.119
-Fixed: Shifting by difference now works in both directions.
-Fixed: Shifting bug introduced last version for times w/o decimals hopefully fixed.
-Improvement: Times are now stored as double precision instead of single precision.
1.1.118
-Fixed: Trying to save in various situations as opposed to save as no longer results in a crash
-Fixed: $rand no longer returns 0 or gives type mismatch crashes
-Fixed: Trying to move an effect up when there is no effect to move up no longer results in a crash
-Fixed: Copying or moving an effect to another layer now includes the conditons.
-Fixed: Shifting times should no longer mess up if a time has a decimal >= .995 (which was rounded as 1.0 before, screwing things up)
1.1.117
-Fixed: Scripting should now properly support recursion.
1.1.116
-Fixed bug where closing the program did not unload it from memory.
-Fixed select/deselect all styles.
1.1.115
-Added script functions: and, nand, or, nor, not, xor
-Added operator info to readme
-Added script testing/debugging in the help tab. This is mostly for me, but you may test your own logic on it if you like.
1.1.114
-Fix stupid typo in new load project. Effects should correctly load now...
1.1.113
-Fixed new project format to actually attempt to load the SSA file itself
-Added a progress popup w/ cancel option for karaoke effects
-Added list of variables to readme
1.1.112
-New project format. Please only use the old format if you find bugs in the new one.
-Added time shifting by difference.
1.1.111
-Make multicharacter comparisons (!=, <>, etc) work correctly
-Fixed saving a ssa file without the extension causing a crash. Really this time.
1.1.110
-Changed to common dialog for open/save
-Added version number to form title
-Minor code cleanup, slightly smaller file
1.1.109
-Removed preview in the open box because it was causing problems for some computers.
-Fixed saving a ssa file without the extension causing a crash.
-Added remove duplicate dialog lines option-Useful for when stripping a multilayer SSA leaves you with duplicate lines.
-Added tooltips for a few things.
1.1.108
-Minor tweaks in open/save windows
-Fixed major multilayering bug introduced in build 105.
1.1.107
-Fix (allow) removal of effect conditions.
1.1.106
-Fix checkmarks in layer conditions tab.
1.1.105
-Remove limit of 100 layers
-Fixed condition checking
-Saving/loading project now also saves conditions.
-Added "layer per syllable" mode
-Added ability to not add layers to the output if the conditions are not met (as opposed to adding the line unchanged)
-Added "Invert Line Selection" for the SSA list.
1.1.104
-Changed name to SSATool.
-Changed the UI around.
-Fixed: $iif should now work correctly when comparing numbers, as opposed to comparing them as strings
-Added ability to define custom conditions specifying when each layer and each filter are used.
-Added variable $karanumtot$ to tell how many syllables are on the line.
1.0.103
-Added ability to effect only certain lines.
-Added option to shift only start/end times.
1.0.102
-Changed format of effects file and project files to get around some delimiting issues and to make more readable if you open them in a text editor.
-Changed extension of project file to .pssa to get around a VB quirk (*.aas would also return .aasp files)
-Added scripting functions: bound, round, int, sin, cos, tan, log, exp, abs
-Calc now supports parenthesis and uses the order of operations instead of left-to-right processing.
-Fixed floor behavior
1.0.101
-Made copy/move to layer work again.
-Added scripting functions: ceil, floor. math is now a synonym for calc.
1.0.100
-Implemented simple inline scripting. Supported functions: iif, rand, randf (floating), calc (math)
-Added variable $layernum$
1.0.99
-Fixed bug with enabling/disabling filters
-Implemented save/load project, does not save layer conditions yet
-Fixed saving effects list
-Speedups
1.0.98
-Finished implementing the effects editor.
1.0.97
-The default style may now be effected. SSA by default calls Default *Default in your lines, which was screwing up the comparison.
-Time shifting now correctly rounds decimals insdtead of giving you several numbers as an exponential.
-Stripping a SSA will now copy lines which have unselected styles instead of leaving them out.

View File

@ -1,17 +0,0 @@
<?xml version="1.0"?>
<ESSA>
<Effect Name="Transformation" Code="\t($Start Time$,$End Time$,$Acceleration$,$Code$)">
<Option Name="Start Time">%karastart%</Option>
<Option Name="End Time">%karaend%</Option>
<Option Name="Acceleration">1</Option>
<Option Name="Code"></Option>
</Effect>
<Effect Name="Move" Code="\move($Start X$,$Start Y$,$End X$,$End Y$,$Start Time$,$End Time$)">
<Option Name="Start X"></Option>
<Option Name="Start Y"></Option>
<Option Name="End X"></Option>
<Option Name="End Y"></Option>
<Option Name="Start Time">0</Option>
<Option Name="End Time">$eval(%linelen%*1000)</Option>
</Effect>
</ESSA>

View File

@ -1,67 +0,0 @@
<?xml version="1.0"?>
<NSSA>
<Note name="getfresh v4" author="getfresh" desc="Notebox by getfresh. Start a little early and end a little late as it fades+scrolls in." resx="1024" resy="768">
<Styles version="5">
<Style>Style: NoteBOX1,Arial,29,&amp;HFFD6AE85,&amp;HFFFFFFFF,&amp;HFFFFFFFF,&amp;HFF000000,0,0,0,0,100,100,0,0.00,1,0,0,7,0,0,0,0</Style>
<Style>Style: NoteBOX2,Arial,29,&amp;HFFFFFFFF,&amp;HFFFFFFFF,&amp;HFF000000,&amp;HFF000000,1,0,0,0,100,100,0,0.00,1,0.5,1.5,7,0,0,0,128</Style>
<Style>Style: NoteBOX3,Arial,29,&amp;HFFC9471E,&amp;HFFFFFFFF,&amp;HFFFFFFFF,&amp;HFF000000,0,0,0,0,100,100,0,0.00,1,0,0,7,0,0,0,0</Style>
</Styles>
<LSet lines="1">
<line style="NoteBOX1">{\pos(174,-99)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy70\t(0,500,\1a&amp;Haa&amp;\3a&amp;H00&amp;\4a&amp;H00&amp;)\t(3500,4000,,\alpha&amp;HFF&amp;)\bord3}{\p1}m 0 0 l 690 0 690 80 0 80{\p0}</line>
<line style="NoteBOX3">{\pos(254,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy144\fscx200\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,,\alpha&amp;HFF&amp;)\bord1.5}{\p1}m 0 0 l 1 0 1 47 0 47{\p0}</line>
<line style="NoteBOX3">{\pos(255,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy146\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 1 0 1 48 0 48{\p0}</line>
<line style="NoteBOX3">{\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy100\t(0,500,\alpha&amp;H40&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 700 0 700 3 0 3{\p0}</line>
<line style="NoteBOX3">{\pos(170,-35)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy150\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 699 0 699 3 0 3{\p0}</line>
<line style="NoteBOX3">{\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy77\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 1 0 1 93 0 93{\p0}</line>
<line style="NoteBOX3">{\pos(868,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy77\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 1 0 1 93 0 93{\p0}</line>
<line style="NoteBOX3">{\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy77\t(0,500,\1a&amp;HCA&amp;\3a&amp;H00&amp;\4a&amp;H00&amp;)\t(3500,4000,,\alpha&amp;HFF&amp;)\bord3}{\p1}m 0 0 l 699 0 699 93 0 93{\p0}</line>
<line style="NoteBOX1">{\pos(184,-86)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)\1c&amp;HFFFFFF&amp;\3c&amp;H000000&amp;\bord0.5\shad1.5\b1\i1}NOTE</line>
<line style="NoteBOX2">{\pos(264,-92)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)\fs40}%line1%</line>
</LSet>
<LSet lines="2">
<line style="NoteBOX1">{\pos(174,-99)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy150\t(0,500,\1a&amp;Haa&amp;\3a&amp;H00&amp;\4a&amp;H00&amp;)\t(3500,4000,,\alpha&amp;HFF&amp;)\bord3}{\p1}m 0 0 l 690 0 690 80 0 80{\p0}</line>
<line style="NoteBOX3">{\pos(254,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy142\fscx200\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,,\alpha&amp;HFF&amp;)\bord1.5}{\p1}m 0 0 l 1 0 1 47 0 47{\p0}</line>
<line style="NoteBOX3">{\pos(173,-41)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy150\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)\bord1.5}{\p1}m 0 0 l 82 0 82 1 0 1{\p0}</line>
<line style="NoteBOX3">{\pos(255,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy130\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 1 0 1 48 0 48{\p0}</line>
<line style="NoteBOX3">{\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy150\t(0,500,\alpha&amp;H50&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 700 0 700 3 0 3{\p0}</line>
<line style="NoteBOX3">{\pos(170,28)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy150\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 699 0 699 3 0 3{\p0}</line>
<line style="NoteBOX3">{\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy150\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 2 0 2 93 0 93{\p0}</line>
<line style="NoteBOX3">{\pos(868,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy150\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)}{\p1}m 0 0 l 1 0 1 93 0 93{\p0}</line>
<line style="NoteBOX1">{\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\fscy145\t(0,500,\1a&amp;HCA&amp;\3a&amp;H00&amp;\4a&amp;H00&amp;)\t(3500,4000,,\alpha&amp;HFF&amp;)\bord3}{\p1}m 0 0 l 699 0 699 93 0 93{\p0}</line>
<line style="NoteBOX3">{\pos(184,-87)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)\1c&amp;HFFFFFF&amp;\3c&amp;H000000&amp;\bord0.5\shad1.5\b1\i1}NOTE</line>
<line style="NoteBOX2">{\pos(264,-85)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)\fs40}%line1%</line>
<line style="NoteBOX2">{\pos(180,-28)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&amp;HFF&amp;}0\N{\r\t(0,500,\alpha&amp;H00&amp;)\t(3500,4000,\alpha&amp;HFF&amp;)\fs40}%line2%</line>
</LSet>
</Note>
</NSSA>
<!--
Style: NoteBOX1,Arial,29,&HFFF6E0FF,&HFFFFFFFF,&HFF000000,&HFF000000,0,0,0,0,100,100,0,0,1,0,0,7,0,0,0,0
Style: NoteBOX2,Arial,29,&HFFFFFFFF,&HFFFFFFFF,&HFF000000,&HFF000000,0,0,0,0,100,100,0,0,1,0.5,0,7,0,0,0,128
{\pos(174,-74)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy70\t(0,500,\1a&Haa&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&Hff&)\bord2}{\p1}m 0 0 l 690 0 690 60 0 60{\p0}
{\pos(254,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy144\fscx200\t(0,500,\alpha&H00&)\t(3500,4000,,\alpha&Hff&)\bord1.5}{\p1}m 0 0 l 1 0 1 35 0 35{\p0}
{\pos(255,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy146\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 1 0 1 36 0 36{\p0}
{\pos(170,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy100\t(0,500,\alpha&H40&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 700 0 700 2 0 2{\p0}
{\pos(170,-26)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 699 0 699 2 0 2{\p0}
{\pos(170,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy77\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 1 0 1 70 0 70{\p0}
{\pos(868,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy77\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 1 0 1 70 0 70{\p0}
{\pos(170,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy77\t(0,500,\1a&Hca&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&Hff&)\bord2}{\p1}m 0 0 l 699 0 699 70 0 70{\p0}
{\pos(184,-68)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)\1c&HFFFFFF&\bord0\shad1.5\bord0.5\3c&H000000&\b1\i1}NOTE
{\pos(264,-69)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)\shad1.5\b1\fs30}%line1%
{\pos(174,-74)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy150\t(0,500,\1a&Haa&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&Hff&)\bord2}{\p1}m 0 0 l 690 0 690 60 0 60{\p0}
{\pos(254,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy142\fscx200\t(0,500,\alpha&H00&)\t(3500,4000,,\alpha&Hff&)\bord1.5}{\p1}m 0 0 l 1 0 1 35 0 35{\p0}
{\pos(173,-31)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)\bord1.5}{\p1}m 0 0 l 82 0 82 1 0 1{\p0}
{\pos(255,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy130\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 1 0 1 36 0 36{\p0}
{\pos(170,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy150\t(0,500,\alpha&H50&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 700 0 700 2 0 2{\p0}
{\pos(170,21)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 699 0 699 2 0 2{\p0}
{\pos(170,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 2 0 2 70 0 70{\p0}
{\pos(868,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)}{\p1}m 0 0 l 1 0 1 70 0 70{\p0}
{\pos(170,-79)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\fscy145\t(0,500,\1a&Hca&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&Hff&)\bord2}{\p1}m 0 0 l 699 0 699 70 0 70{\p0}
{\pos(184,-70)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)\1c&HFFFFFF&\bord0\shad1.5\bord0.5\3c&H000000&\b1\i1}NOTE
{\pos(264,-64)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)\shad1.5\b1\fs30}%line1%
{\pos(180,-21)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&Hff&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&Hff&)\shad1.5\b1\fs30}%line2%
-->

View File

@ -1,194 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections;
using System.Collections.Generic; //.Net 2.0
namespace SSATool {
public class Filter : ConditionColl, System.Collections.Generic.IEnumerable<FilterOption>, IEquatable<Filter> {
private Filter template;
protected List<FilterOption> fOptions;
public string Name, Code;
public bool Enabled;
public Filter() : base() {
fOptions = new List<FilterOption>();
Enabled = true;
}
public Filter(List<FilterOption> optionsList) : base() {
fOptions = optionsList;
Code = String.Empty;
}
public Filter(string name) : this() {
Name = name;
Code = String.Empty;
}
public Filter(string name, string code) : this() {
Name = name;
Code = code;
}
public Filter(string name, List<FilterOption> optionsList)
: this(optionsList) {
Name = name;
Enabled = true;
}
bool System.IEquatable<Filter>.Equals(Filter f) {
return (String.CompareOrdinal(this.Name, f.Name) == 0);
}
public override string ToString() {
return Name;
}
public int NumOptions {
get { return fOptions.Count; }
}
public Filter Template {
get { return template; }
}
public void AddOption(string Name,string Val) {
fOptions.Add(new FilterOption(Name,Val));
}
public void AddOption(FilterOption fo) {
fOptions.Add(fo);
}
public void SetOptionValueByIndex(int index, string val) {
if (fOptions.Count > index) fOptions[index].Value = val;
}
public void SetOptionValueByName(string name, string val) {
for (int index=0;index<fOptions.Count;index+=1)
if (string.CompareOrdinal(fOptions[index].Name,name) == 0)
fOptions[index].Value = val;
}
public void SetOptionNameByIndex(int index, string name) {
if (fOptions.Count > index) fOptions[index].Name = name;
}
public void SetOptionByIndex(int index, string name, string val) {
if (fOptions.Count > index) {
fOptions[index].Name = name;
fOptions[index].Value = val;
}
}
public FilterOption GetOptionByIndex(int index) {
return fOptions[index];
}
public string GetOptionValueByIndex(int index) {
return fOptions[index].Value;
}
public FilterOption GetOptionByName(string name) {
for(int index=0;index<fOptions.Count;index+=1)
if (fOptions[index].Name == name)
return fOptions[index];
return (FilterOption) null;
}
public string GetOptionValueByName(string name) {
for(int index=0;index<fOptions.Count;index+=1)
if (fOptions[index].Name == name)
return fOptions[index].Value;
return null;
}
public void RemoveOptionByIndex(int index) {
fOptions.RemoveAt(index);
}
public void RemoveOptionByName(string name) {
for(int index=0;index<fOptions.Count;index+=1)
if (fOptions[index].Name == name) fOptions.RemoveAt(index);
}
public List<FilterOption> CloneOptions() {
List<FilterOption> nl = new List<FilterOption>();
for(int index=0;index!=fOptions.Count;index+=1)
nl.Add((FilterOption)fOptions[index].Clone());
return nl;
}
public object Clone() {
Filter nf = new Filter(Name, CloneOptions());
nf.conditionColl = CloneConditions();
nf.template = (this.template==null)?this:this.template;
return nf;
}
#region IEnumerable Members
IEnumerator<FilterOption> IEnumerable<FilterOption>.GetEnumerator() {
return new FilterEnumerator(this);
}
public System.Collections.IEnumerator GetEnumerator() {
return new FilterEnumerator(this);
}
#endregion
}
public class FilterEnumerator : IEnumerator<FilterOption>, IDisposable {
Filter f;
int index;
public void Dispose() {
}
public FilterEnumerator(Filter f) {
this.f = f;
Reset();
}
public void Reset() {
index=-1;
}
object IEnumerator.Current {
get { return f.GetOptionByIndex(index); }
}
public FilterOption Current {
get { return f.GetOptionByIndex(index); }
}
public bool MoveNext() {
if (++index >= f.NumOptions) return false;
else return true;
}
}
public class FilterOption : ICloneable {
public string Name;
public string Value;
public FilterOption() { }
public FilterOption(string name, string val) {
Name = name;
Value = val;
}
public object Clone() {
return new FilterOption(Name,Value);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,241 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="cmdSearchReplace.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label12.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label11.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdShift.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkShiftNoNeg.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkShiftEnd.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkShiftStart.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="radTShiftBack.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="radTShiftForward.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="radFShiftBackward.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="radFShiftForward.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label5.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label7.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label6.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label10.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label9.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label8.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdNewLayer.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdDelLayer.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdAddEffect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdCopyEffect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdMoveEffect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdMoveEffDown.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdMoveEffUp.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdDelEffect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkDelEffectCondition.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdAddEffectCondition.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkAddOnce.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkAddAnyway.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkRemoveK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="chkLayerPerSyllable.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdDelLayerCondition.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="CmdNewLayerCondition.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdDoEffects.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdDupLayer.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdReloadFile.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdSSAInvertSel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdSSADeselall.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdSSASelall.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdReparse.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdDeselAll.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="cmdSelAll.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>On</value>
</data>
<data name="lstSSA.Font" type="System.Drawing.Font, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>MS UI Gothic, 9pt</value>
</data>
</root>

File diff suppressed because it is too large Load Diff

View File

@ -1,223 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace SSATool
{
/// <summary>
/// Summary description for InputBox.
///
public class InputBox : System.Windows.Forms.Form {
#region Windows Contols and Constructor
private System.Windows.Forms.Label lblPrompt;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txtInput;
/// <summary>
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public InputBox() {
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
#endregion
#region Dispose
/// <summary>
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing ) {
if( disposing ) {
if(components != null) {
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent() {
this.lblPrompt = new System.Windows.Forms.Label();
this.btnOK = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.txtInput = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// lblPrompt
//
this.lblPrompt.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblPrompt.BackColor = System.Drawing.SystemColors.Control;
this.lblPrompt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblPrompt.Location = new System.Drawing.Point(12, 9);
this.lblPrompt.Name = "lblPrompt";
this.lblPrompt.Size = new System.Drawing.Size(302, 82);
this.lblPrompt.TabIndex = 3;
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnOK.Location = new System.Drawing.Point(326, 24);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(64, 24);
this.btnOK.TabIndex = 1;
this.btnOK.Text = "&OK";
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button1.Location = new System.Drawing.Point(326, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(64, 24);
this.button1.TabIndex = 2;
this.button1.Text = "&Cancel";
//
// txtInput
//
this.txtInput.ImeMode = System.Windows.Forms.ImeMode.Off;
this.txtInput.Location = new System.Drawing.Point(8, 100);
this.txtInput.Name = "txtInput";
this.txtInput.Size = new System.Drawing.Size(379, 20);
this.txtInput.TabIndex = 0;
this.txtInput.Text = "";
this.txtInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtInput_KeyPress);
//
// InputBox
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(398, 128);
this.Controls.Add(this.txtInput);
this.Controls.Add(this.button1);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.lblPrompt);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.ImeMode = System.Windows.Forms.ImeMode.Off;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "InputBox";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "InputBox";
this.ResumeLayout(false);
}
#endregion
#region Private Variables
string formCaption = string.Empty;
string formPrompt = string.Empty;
string inputResponse = string.Empty;
string defaultValue = string.Empty;
#endregion
#region Public Properties
public string FormCaption {
get{return formCaption;}
set{formCaption = value;}
} // property FormCaption
public string FormPrompt {
get{return formPrompt;}
set{formPrompt = value;}
} // property FormPrompt
public string InputResponse {
get{return inputResponse;}
set{inputResponse = value;}
} // property InputResponse
public string DefaultValue {
get{return defaultValue;}
set{defaultValue = value;}
} // property DefaultValue
#endregion
#region Form and Control Events
public static InputBoxResult Show(string prompt, string title, string defaultResponse,
int xpos, int ypos) {
using (InputBox form = new InputBox()) {
form.lblPrompt.Text = prompt;
form.Text = title;
form.txtInput.Text = defaultResponse;
if (xpos >= 0 && ypos >= 0) {
form.StartPosition = FormStartPosition.Manual;
form.Left = xpos;
form.Top = ypos;
}
DialogResult result = form.ShowDialog();
InputBoxResult retval = new InputBoxResult();
if (result == DialogResult.OK) {
retval.Text = form.txtInput.Text;
retval.OK = true;
}
return retval;
}
}
private void txtInput_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) {
if ((e.KeyChar == '\r') || (e.KeyChar == '\n')) {
btnOK.PerformClick();
e.Handled = true;
}
else if (e.KeyChar == 27) { //escape key
button1.PerformClick();
e.Handled = true;
}
}
public static InputBoxResult Show(string prompt, string title, string defaultText) {
return Show(prompt, title, defaultText, -1, -1);
}
}
#endregion
public class InputBoxResult {
public bool OK;
public string Text;
}
}

View File

@ -1,166 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lblPrompt.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblPrompt.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblPrompt.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="button1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="button1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="button1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtInput.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="txtInput.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="txtInput.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.Name">
<value>InputBox</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root>

View File

@ -1,126 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections;
using System.Collections.Generic; //.Net 2.0
namespace SSATool
{
public class Layer : ConditionColl, IEnumerable, ICloneable {
private List<Filter> filterColl;
public string Name;
public int Repetitions;
public bool Enabled;
public bool PerSyllable, SyllablePerLine;
public bool AddAll, AddOnce;
public bool AddK, AddASSA, AddBracket, AddText;
public Layer() {
filterColl = new List<Filter>();
Enabled = true;
PerSyllable = SyllablePerLine = AddAll = AddOnce = false;
AddK = AddASSA = AddBracket = AddText = true;
Repetitions = 1;
}
public int Count {
get { return filterColl.Count; }
}
public Filter GetFilter(int index) {
return filterColl[index];
}
public void AddFilter(Filter tf) {
filterColl.Add(tf);
}
public void InsertFilter(int index, Filter tf) {
filterColl.Insert(index,tf);
}
public void RemoveFilter(int index) {
if (filterColl.Count > index) filterColl.RemoveAt(index);
}
public void SwapFilterPositions(int indexone, int indextwo) {
if ((filterColl.Count > Math.Max(indexone,indextwo)) && (indexone != indextwo)) {
Filter swap;
swap = filterColl[indexone];
filterColl[indexone] = filterColl[indextwo];
filterColl[indextwo] = swap;
}
}
public List<Filter> CloneFilters() {
List<Filter> nl = new List<Filter>();
for (int index=0;index!=filterColl.Count;index+=1)
nl.Add((Filter)filterColl[index].Clone());
return nl;
}
public object Clone() {
Layer nl = (Layer)this.MemberwiseClone();
nl.filterColl = CloneFilters();
nl.conditionColl = CloneConditions();
return nl;
}
public IEnumerator GetEnumerator() {
return new LayerEnumerator(this);
}
}
public class LayerEnumerator : IEnumerator {
Layer l;
int index;
#region IEnumerator Members
public void Reset() {
index = -1;
}
public object Current {
get {
return l.GetFilter(index);
}
}
public bool MoveNext() {
if (++index >= l.Count) return false;
else return true;
}
#endregion
internal LayerEnumerator(Layer l) {
this.l = l;
Reset();
}
}
}

View File

@ -1,305 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace SSATool {
public enum LineType {
dialogue,
comment,
style,
other,
error
}
public class DialogueLine : ICloneable {
public TimeSpan start, end;
public Style style;
public string actor, effect;
public string text;
public int marginl, marginr, margint, marginb;
public int layer;
public bool marked;
public override string ToString() {
string retStr = String.Format("Dialogue: {0},{1},{2},{3},{4},{5:D4},{6:D4},{7:D4},{8}{9},{10}",
(Form1.sver==4)?("Marked="+(this.marked?"1":"0")):this.layer.ToString(Util.nfi),
Util.TimeSpanSSA(this.start,false,1),
Util.TimeSpanSSA(this.end,true,1),
this.style.name, this.actor,
this.marginl, this.marginr, this.margint,
((Form1.sver == 6) ? this.marginb.ToString(Util.nfi).PadLeft(4, '0') + "," : String.Empty),
this.effect,this.text);
return retStr;
}
public Object Clone() {
return this.MemberwiseClone(); // A shallow memberwise-clone is fine
}
/// <summary>
/// Return just the text of the line without any SSA
/// </summary>
/// <returns></returns>
public string JustText {
get {
string justtext = string.Empty;
char[] linechar = this.text.ToCharArray();
bool inCode = false;
for (int charindex = 0; charindex != this.text.Length; charindex+=1) {
if (linechar[charindex] == '{') inCode = true;
else if (linechar[charindex] == '}') inCode = false;
else if (!inCode) justtext = justtext + linechar[charindex];
}
return justtext;
}
}
/// <summary>
/// Return the margin of this line, taking overrides into account
/// </summary>
/// <returns>The margin as a rectangle</returns>
public RectangleF GetMargin() {
int Marginl = (this.marginl==0)?this.style.marginl:this.marginl;
int Margint = (this.margint==0)?this.style.margint:this.margint;
int Marginb = (this.marginb==0)?this.style.marginb:this.marginb;
int Marginr = (this.marginr==0)?this.style.marginr:this.marginr;
int Height = Form1.ResY - (Margint+Marginb);
int Width = Form1.ResX - (Marginl+Marginr);
return new RectangleF(Marginl, Margint, Width, Height);
}
/// <summary>
/// Find the bounding rectangle of an area of the line
/// </summary>
/// <param name="startIndex"></param>
/// <param name="length"></param>
/// <returns>The bounding rectangle</returns>
public RectangleF GetRect(int startIndex, int length) {
Graphics graphics = Form1.listSSAg;
StringFormat format = new System.Drawing.StringFormat();
CharacterRange[] ranges = { new CharacterRange(startIndex, length) };
Region[] regions = new Region[1];
RectangleF margin, rect;
margin = this.GetMargin();
format.SetMeasurableCharacterRanges(ranges);
int align = this.style.scrAlignment;
switch (align&3) {
case 1:
format.LineAlignment = StringAlignment.Near;
break;
case 2:
format.LineAlignment = StringAlignment.Center;
break;
default:
format.LineAlignment = StringAlignment.Far;
break;
}
switch (align&12) {
case 0:
format.Alignment = StringAlignment.Far;
break;
case 4:
format.Alignment = StringAlignment.Near;
break;
default:
format.Alignment = StringAlignment.Center;
break;
}
regions = graphics.MeasureCharacterRanges(this.JustText, this.style.GetFont(), margin, format);
rect = regions[0].GetBounds(graphics);
rect = new RectangleF(margin.X+rect.X, margin.Y+rect.Y, rect.Width, rect.Height);
return rect;
}
public static DialogueLine ParseLine(string theLine, LineType lt) {
try {
DialogueLine retLine = new DialogueLine();
char[] linechar = theLine.ToCharArray();
string buff = String.Empty;
int pos = 0;
bool neg = false;
for (int index = (Form1.sver == 4) ? 17 : 9; index != linechar.Length; index+=1) {
if ((pos<9||pos==9&&Form1.sver==6) && linechar[index].Equals(',')) {
switch (pos) {
case 0:
if (Form1.sver == 4) retLine.marked = linechar[index - 1].Equals('1');
else retLine.layer = int.Parse(buff, Util.cfi);
break;
case 1:
if (neg) retLine.start = TimeSpan.Parse(buff.Replace("-", String.Empty)).Negate();
else retLine.start = TimeSpan.Parse(buff);
break;
case 2:
if (neg) retLine.end = TimeSpan.Parse(buff.Replace("-", String.Empty)).Negate();
else retLine.end = TimeSpan.Parse(buff);
break;
case 3:
retLine.style = Form1.styleColl.Find(delegate(Style s) { return s.Equals(buff); });
if (retLine.style == null) retLine.style = new Style(buff);
break;
case 4:
retLine.actor = buff;
break;
case 5:
retLine.marginl = int.Parse(buff, Util.cfi);
break;
case 6:
retLine.marginr = int.Parse(buff, Util.cfi);
break;
case 7:
retLine.margint = int.Parse(buff, Util.cfi);
break;
case 8:
if (Form1.sver < 6) retLine.effect = buff;
else retLine.marginb = int.Parse(buff, Util.cfi);
break;
case 9:
retLine.effect = buff;
break;
}
pos += 1;
buff = string.Empty;
neg = false;
}
else if ((pos != 0 || char.IsDigit(linechar[index])) && (pos == 3 || pos == 4 || pos >= 8 || !char.IsWhiteSpace(linechar[index]))) {
buff += linechar[index];
neg = neg || (linechar[index] == '-');
}
}
retLine.text = buff;
return retLine;
} catch {
throw new FormatException();
}
}
public DialogueLine() { }
public DialogueLine(TimeSpan StartTime, TimeSpan EndTime, Style Style) {
start = StartTime;
end = EndTime;
style = Style;
}
public DialogueLine(string Text) {
text = Text;
}
public DialogueLine(Style Style, string Text) : this(Text) {
style = Style;
}
}
public class Line : IEquatable<Line>, ICloneable {
public LineType lineType;
public object line;
public bool enabled, selected;
public Line() {
this.enabled = true;
}
public static LineType getLineType(string theLine) {
if (theLine.Length > 20 && String.Compare(theLine.Substring(0, 9), "dialogue:", true, Util.cfi) == 0)
return LineType.dialogue;
else if (theLine.Length > 8 && String.Compare(theLine.Substring(0, 8), "comment:", true, Util.cfi) == 0)
return LineType.comment;
else if (theLine.Length > 20 && String.Compare(theLine.Substring(0, 6), "style:", true, Util.cfi) == 0)
return LineType.style;
else
return LineType.other;
}
public static Line ParseLine(string inStr) {
Line l = new Line();
l.lineType = getLineType(inStr);
switch (l.lineType) {
case LineType.dialogue:
try {
l.line = DialogueLine.ParseLine(inStr, LineType.dialogue);
} catch {
l.lineType = LineType.error;
l.line = inStr;
}
break;
case LineType.style:
try {
Style s = Style.ParseStyle(inStr);
l.line = s;
Form1.styleColl.Add(s);
} catch {
l.lineType = LineType.error;
l.line = inStr;
}
break;
default:
if (inStr.Length > 8 && String.Compare(inStr.Substring(0, 7), "playres", true, Util.cfi) == 0) {
switch (inStr.ToCharArray()[7]) {
case 'x':
case 'X':
Form1.ResX = int.Parse(inStr.Substring(9, inStr.Length - 9), Util.cfi);
break;
case 'y':
case 'Y':
Form1.ResY = int.Parse(inStr.Substring(9, inStr.Length - 9), Util.cfi);
break;
}
}
else if (inStr.Length > 10 && String.Compare(inStr.Substring(0, 10), "scripttype", true, Util.cfi) == 0) {
//TODO: Improve this detection
inStr = inStr.TrimEnd();
if (inStr.EndsWith("+=1")) Form1.sver = 6;
else if (inStr.EndsWith("+")) Form1.sver = 5;
else Form1.sver = 4;
}
l.line = inStr;
break;
}
return l;
}
bool System.IEquatable<Line>.Equals(Line line) {
return this.line==line.line;
}
public override int GetHashCode() {
return base.GetHashCode();
}
public Object Clone() {
Line retLine = new Line();
retLine.enabled = this.enabled;
retLine.lineType = this.lineType;
if (this.lineType == LineType.dialogue)
retLine.line = ((DialogueLine)line).Clone();
else if (this.lineType == LineType.style)
retLine.line = ((Style)line).Clone();
else
retLine.line = this.line;
return retLine;
}
public override string ToString() {
return line.ToString();
}
}
}

View File

@ -1,368 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
//using System.ComponentModel.Design;
//using System.Windows.Forms.Design;
//using System.Drawing.Design;
namespace SSATool {
/// <summary>
/// Summary description for ListViewES.
/// </summary>
public class ListViewES : System.Windows.Forms.ListView {
private System.Windows.Forms.TextBox textBox1;
private ComboBox comboBox1;
private System.ComponentModel.Container components = null;
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.textBox1 = new System.Windows.Forms.TextBox();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Enabled = false;
this.textBox1.Location = new System.Drawing.Point(17, 17);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(20, 13);
this.textBox1.TabIndex = 1;
this.textBox1.Visible = false;
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
//
// comboBox1
//
this.comboBox1.Cursor = System.Windows.Forms.Cursors.Default;
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.Enabled = false;
this.comboBox1.ImeMode = System.Windows.Forms.ImeMode.Disable;
this.comboBox1.IntegralHeight = false;
this.comboBox1.Location = new System.Drawing.Point(32, 32);
this.comboBox1.Margin = new System.Windows.Forms.Padding(1);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
this.comboBox1.Visible = false;
this.comboBox1.Leave += new System.EventHandler(this.ListViewES_Leave);
this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
//
// ListViewES
//
this.Controls.Add(this.textBox1);
this.Controls.Add(this.comboBox1);
this.LabelEdit = true;
this.Size = new System.Drawing.Size(992, 616);
this.View = System.Windows.Forms.View.Details;
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ListViewES_MouseUp);
this.Leave += new System.EventHandler(this.ListViewES_Leave);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public event LabelSubEditEventHandler SubItemClicked;
public event LabelSubEditEventHandler SubItemBeginEditing;
public event LabelSubEditEndEventHandler SubItemEndEditing;
public event ScrollEventHandler OnScroll;
public ListViewES() {
InitializeComponent();
//this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
this.DoubleBuffered = true;
}
protected override void Dispose(bool disposing) {
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
public new void SetStyle(System.Windows.Forms.ControlStyles flag, bool value) {
base.SetStyle(flag, value);
}
private ListViewItem item;
private int subItemIndex;
private Control c;
public int ItemsOnScreen {
get {
Rectangle tib = this.TopItem.Bounds;
int offH = this.Height - tib.Top;
int height = tib.Height;
int num = Convert.ToInt32(Math.Floor((float)offH / height),Util.nfi);
return num;
}
}
public void StartEditing(ListViewItem item, int subitem) {
if (c != null) EndEditing(true);
this.item = item;
this.subItemIndex = subitem;
c = (Control) this.textBox1;
StartEditingHelper();
}
public void StartEditing(ListViewItem item, int subitem, string[] ComboChoices) {
if (c != null) EndEditing(true);
this.item = item;
this.subItemIndex = subitem;
c = (Control)this.comboBox1;
comboBox1.Items.Clear();
comboBox1.Items.AddRange(ComboChoices);
StartEditingHelper();
}
private void StartEditingHelper() {
this.SuspendLayout();
c.Enabled = true;
PositionControl();
c.Text = item.SubItems[subItemIndex].Text;
c.Show();
c.Focus();
this.ResumeLayout(true);
}
private void PositionControl() {
if (c != null) {
c.Bounds = this.GetSubItemBounds(item, subItemIndex);
//if (GridLines == true) c.Height -= 1;
if (this.CheckBoxes==true && subItemIndex==0) {
c.Left += 20;
c.Width -= 22;
}
else {
c.Left += 4;
c.Width -= 6;
}
}
}
private void EndEditing(bool saveValue) {
if ((item != null) && (subItemIndex != -1)) {
this.SuspendLayout();
if (saveValue) item.SubItems[subItemIndex].Text = c.Text;
if (SubItemEndEditing != null)
this.SubItemEndEditing(this,
new LabelSubEditEndEventArgs(item, subItemIndex,
item.SubItems[subItemIndex].Text, !saveValue));
this.item = null;
this.subItemIndex = -1;
c.Text = String.Empty;
c.Hide();
c.Enabled = false;
this.ResumeLayout(true);
saveValue = true;
c = null;
}
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) {
if (e.KeyChar == (char)(int)Keys.Enter) {
EndEditing(true);
e.Handled = true;
}
else if (e.KeyChar == (char)(int)Keys.Escape) {
EndEditing(false);
e.Handled = true;
}
}
private void ListViewES_MouseUp(object sender, MouseEventArgs e) {
if (c != null) EndEditing(true);
if (this.View==System.Windows.Forms.View.Details) {
int index;
ListViewItem lvi;
index = this.GetSubItemAt(e.X,e.Y,out lvi);
if ((index != -1) && ((this.CheckBoxes == false) || (e.X > 15))) {
LabelSubEditEventArgs lsa = new LabelSubEditEventArgs(lvi, index);
if (SubItemBeginEditing != null) this.SubItemBeginEditing(this, lsa);
if (SubItemClicked != null) this.SubItemClicked(this, lsa);
else if (this.LabelEdit == true) this.StartEditing(lvi, index);
}
}
}
public int GetSubItemAt(int x, int y, out ListViewItem item) {
if (this.Items.Count != 0) {
Rectangle tib = this.TopItem.Bounds;
int left = tib.Left;
if (left < 0) {
item = null;
return -1;
}
int offH = this.Height - tib.Top;
int top = this.TopItem.Index;
int height = tib.Height;
int bottom = top + Convert.ToInt32(Math.Floor((float)offH / (float)height),Util.nfi);
int row = top - 1 + Convert.ToInt32((((float)bottom - top) * ((float)y / offH)),Util.nfi);
if ((row < this.Items.Count) && (row >= 0)) {
for(int column=0;column<this.Columns.Count;column+=1) {
left += this.Columns[column].Width;
if (x <= left) { item = this.Items[row]; return column;}
}
}
}
item = null;
return -1;
}
public Rectangle GetSubItemBounds(ListViewItem Item, int SubItem) {
if (SubItem >= this.Columns.Count)
throw new IndexOutOfRangeException("SubItem " + SubItem + " out of range");
else if (Item == null)
return Rectangle.Empty; // throw new ArgumentNullException("Item");
int top, left, width, height;
//Item.EnsureVisible();
Rectangle bounds = Item.GetBounds(ItemBoundsPortion.Entire);
top = bounds.Top;
width = this.Columns[SubItem].Width;
height = bounds.Height;
left = bounds.Left;
for(int index=0;index<SubItem;index+=1)
left += this.Columns[index].Width;
return new Rectangle(new Point(left,top),new Size(width,height));
}
/// <summary>
/// Used to recreate the list items when columns are modified
/// </summary>
public void RecopyListItems() {
this.BeginUpdate();
string[] news;
ListViewItem lvi;
for(int outerindex=0; outerindex!=this.Items.Count; outerindex+=1) {
lvi = this.Items[outerindex];
news = new string[this.Columns.Count];
// Can't copy more parameters than in the old one,
// and can't copy more than the new one can store
for(int index=0;index!=lvi.SubItems.Count&&index!=news.Length;index+=1) {
news[index] = lvi.SubItems[index].Text;
}
this.Items[outerindex] = new ListViewItem(news);
}
this.EndUpdate();
}
private void ListViewES_Leave(object sender, EventArgs e) {
EndEditing(true);
}
//[Category("Action")]
//public event ScrollEventHandler Scrolled = null;
[Serializable]
public delegate void LabelSubEditEventHandler(
object sender,
LabelSubEditEventArgs e
);
[Serializable]
public delegate void LabelSubEditEndEventHandler(
object sender,
LabelSubEditEndEventArgs e
);
public class LabelSubEditEventArgs : EventArgs {
private int _subIndex;
private ListViewItem _item;
public LabelSubEditEventArgs(ListViewItem lvi, int subItem) {
_subIndex = subItem;
_item = lvi;
}
public ListViewItem Item {
get { return _item; }
}
public int SubIndex {
get { return _subIndex; }
}
}
public class LabelSubEditEndEventArgs : LabelSubEditEventArgs {
string _text;
bool _cancel;
public LabelSubEditEndEventArgs(ListViewItem lvi, int subItem, string text, bool cancel) :
base(lvi,subItem) {
_text = text;
_cancel = cancel;
}
public bool Cancel {
get { return _cancel; }
}
public string Text {
get { return _text; }
}
}
private const int WM_HSCROLL = 0x114;
private const int WM_VSCROLL = 0x115;
protected override void WndProc(ref System.Windows.Forms.Message msg) {
if ((msg.Msg == WM_HSCROLL) || (msg.Msg == WM_VSCROLL)) {
if (c!=null) PositionControl();
if (OnScroll != null) OnScroll(this,new ScrollEventArgs(ScrollEventType.EndScroll,0,0,(msg.Msg == WM_HSCROLL)?ScrollOrientation.HorizontalScroll:ScrollOrientation.VerticalScroll));
base.WndProc(ref msg);
}
else base.WndProc(ref msg);
}
}
}

View File

@ -1,180 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace SSATool {
public class ManualTransform {
public static MTVars ListViewToMTV(ListView lv) {
double expbase, opt;
MTVars mtv = new MTVars();
MTVars.MTVariable mtvar;
ListViewItem lvi;
string text;
for(int lvindex=0;lvindex!=lv.Items.Count;lvindex+=1){
lvi = lv.Items[lvindex];
mtvar = new MTVars.MTVariable(lvi.Text);
for(int index=1;index<lvi.SubItems.Count;index+=2) {
text = lvi.SubItems[index].Text;
if (double.TryParse(text,out opt)) mtvar.AddOption(opt);
else mtvar.AddOption(text);
}
for(int index=2;index<lvi.SubItems.Count;index+=2) {
text = lvi.SubItems[index].Text.ToLower(Util.cfi);
Util.ScaleRatioS srs = new Util.ScaleRatioS();
expbase = 1;
if (double.TryParse(text, out opt)) {
srs.srt = Util.ScaleRatioType.Polynomial;
expbase = opt;
}
if ((text.StartsWith("log")) && (double.TryParse(text.Substring(3,text.Length-3), out opt))) {
srs.srt = Util.ScaleRatioType.Logarithmic;
expbase = opt;
}
else if ((text.StartsWith("exp")) && (double.TryParse(text.Substring(3, text.Length-3), out opt))) {
srs.srt = Util.ScaleRatioType.Exponential;
expbase = opt;
}
srs.expbase = expbase;
mtvar.AddAccel(srs);
}
mtv.AddVariable(mtvar);
}
return mtv;
}
public static string DoTransform(List<TimeSpan> TransformTimes, MTVars Vars, string Code, double FrameRate) {
double fp = 1.0/FrameRate;
double ratio;
TimeSpan frame = TimeSpan.FromSeconds(fp);
TimeSpan curtime;
StringBuilder sb = new StringBuilder(6144);
MTVars.MTVariable mtv;
string rep, repwith, output;
int index, windex, comp;
/* The times are already sorted because the listbox is sorted.
* We'll loop from the first time to the last time
* and figure out which section we're in then.
* I'm doing this because rounding problems could otherwise
* cause us to miss a frame between sections or give us an
* invalid offset (for example, each frame was .02 seconds off in time)
*/
index = windex = 0;
curtime = TransformTimes[0];
TransformTimes[TransformTimes.Count-1].Add(frame);
while(curtime.CompareTo(TransformTimes[TransformTimes.Count-1]) == -1) {
// Find out what zone we're in (0-based)
while((comp = curtime.CompareTo(TransformTimes[windex])) == -1)
windex+=1;
sb.Append(
Code.Replace("%starttime%",
Util.TimeSpanSSA(
(index==0&&curtime.CompareTo(TimeSpan.Zero)==-1)?TimeSpan.Zero:curtime,false,1))
.Replace("%endtime%",Util.TimeSpanSSA(curtime=curtime.Add(frame),false,1))
); // curtime is incremented in the line above this, notice the single equals
for(int mtindex=0;mtindex!=Vars.Count;mtindex+=1){
mtv = Vars.GetVariable(mtindex);
ratio = Convert.ToDouble(curtime.Subtract(TransformTimes[0]).Ticks,Util.nfi)
/ Convert.ToDouble(((TransformTimes[windex+1]).Subtract(frame.Add(TransformTimes[windex]))).Ticks,Util.nfi);
rep = "%" + mtv.Name + "%";
repwith = mtv.Value(windex,ratio).ToString();
sb.Replace(rep,repwith);
}
sb.AppendLine();
index+=1;
}
output = sb.ToString().TrimEnd();
if (Code.Contains("$")) return Evaluate.ScriptParse(output);
return output;
}
public class MTVars {
private List<MTVariable> varList;
public MTVars() {
varList = new List<MTVariable>(4);
}
public int Count {
get { return varList.Count; }
}
public void AddVariable(MTVariable mtvar) {
varList.Add(mtvar);
}
public MTVariable GetVariable(int index) {
return varList[index];
}
public class MTVariable {
private ArrayList optList;
private List<Util.ScaleRatioS> accelList;
private string _name;
public object Value(int index) {
return optList[index];
}
public object Value(int index, double ratio) {
if ((optList[index] is string) || (optList[index+1] is string))
return optList[index];
else return (double)optList[index] + Util.ScaleRatio(ratio,accelList[index])
*((double)optList[index+1]-(double)optList[index]);
}
public MTVariable(string name) {
optList = new ArrayList();
accelList = new List<Util.ScaleRatioS>();
_name = name;
}
public void AddOption(object opt) {
optList.Add(opt);
}
public void AddAccel(Util.ScaleRatioS srs) {
accelList.Add(srs);
}
public string Name {
get { return _name; }
}
}
}
}
}

View File

@ -1,184 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Xml;
namespace SSATool {
public static class Notebox {
public struct NoteBox {
public string name;
public string author;
public string description;
public int resx, resy;
public List<NoteBoxLine> nblines;
public List<Style> stylelist;
}
public struct NoteBoxLine {
public int maxLines;
public List<DialogueLine> lines;
}
public static List<Notebox.NoteBox> noteBoxColl;
public static List<Style> nbStyleColl;
public static void readNoteBoxes() {
if (File.Exists("notebox.xml")) {
noteBoxColl = new List<NoteBox>();
NoteBox nb;
NoteBoxLine thisnbl;
List<NoteBoxLine> nblList;
List<DialogueLine> thisNoteList;
List<Style> slist;
int stylever, lsetindex;
Form1.FormMain.cmbNBStyle.Items.Clear();
XmlDocument xDocM = new XmlDocument();
try {
xDocM.Load("notebox.xml");
XmlNode xDoc = xDocM.SelectSingleNode("NSSA");
XmlNodeList notes = xDoc.SelectNodes("Note");
foreach (XmlNode nnode in notes) {
nb = new NoteBox();
slist = new List<Style>(3);
nblList = new List<NoteBoxLine>(2);
nb.name = (nnode.Attributes["name"] != null) ? nnode.Attributes["name"].Value : "Untitled";
nb.author = (nnode.Attributes["author"] != null) ? nnode.Attributes["author"].Value : "Unknown";
nb.description = (nnode.Attributes["desc"] != null) ? nnode.Attributes["desc"].Value : "";
nb.resx = (nnode.Attributes["resx"] != null) ? int.Parse(nnode.Attributes["resx"].Value) : 640;
nb.resy = (nnode.Attributes["resy"] != null) ? int.Parse(nnode.Attributes["resy"].Value) : 480;
XmlNode styles = nnode.SelectSingleNode("Styles");
stylever = (styles.Attributes["version"] != null) ? int.Parse(styles.Attributes["version"].Value) : 0;
if (styles != null) {
XmlNodeList stylelist = styles.SelectNodes("Style");
foreach (XmlNode style in stylelist) {
slist.Add(Style.ParseStyle(style.InnerText, stylever));
}
}
nb.stylelist = slist;
XmlNodeList lsets = nnode.SelectNodes("LSet");
for (lsetindex = 0; lsetindex != lsets.Count; lsetindex+=1) {
XmlNode lsnode = lsets[lsetindex];
thisNoteList = new List<DialogueLine>(16);
XmlNodeList lines = lsnode.SelectNodes("line");
foreach (XmlNode lnode in lines) {
if (lnode.Attributes["style"]==null)
thisNoteList.Add(new DialogueLine(lnode.InnerText));
else
thisNoteList.Add(new DialogueLine(new Style(lnode.Attributes["style"].Value),lnode.InnerText));
}
thisnbl = new NoteBoxLine();
thisnbl.lines = thisNoteList;
thisnbl.maxLines = (lsnode.Attributes["lines"] != null) ? int.Parse(lsnode.Attributes["lines"].Value) : 1;
nblList.Add(thisnbl);
}
nb.nblines = nblList;
noteBoxColl.Add(nb);
Form1.FormMain.cmbNBStyle.Items.Add(nb.name + " by " + nb.author);
Form1.FormMain.cmbNBStyle.SelectedIndex = 0;
}
} catch {
MessageBox.Show("Error parsing noteboxes.");
}
}
}
public static void DoNotebox(string Line1, string Line2, int NoteboxIndex) {
double scalefactorx=0, scalefactory=0;
int lines = String.IsNullOrEmpty(Line2) ? 1 : 2;
NoteBox nb = noteBoxColl[NoteboxIndex];
NoteBoxLine nbl = nb.nblines.Find(delegate(NoteBoxLine n) { return n.maxLines.Equals(lines); });
StringBuilder sb = new StringBuilder(1024);
TimeSpan startTime, endTime;
Line line;
DialogueLine dl;
nbStyleColl = new List<Style>(4);
if (Form1.ResX > 0 && nb.resx > 0) scalefactorx = ((double)Form1.ResX / nb.resx);
if (Form1.ResY > 0 && nb.resy > 0) scalefactory = ((double)Form1.ResY / nb.resy);
if (scalefactorx == 0 && scalefactory != 0) scalefactorx = scalefactory;
else if (scalefactory == 0 && scalefactorx != 0) scalefactory = scalefactorx;
else if ((scalefactorx+scalefactory)==0) scalefactorx = scalefactory = 1.0;
startTime = TimeSpan.Parse(Form1.FormMain.maskedTextNBStart.Text);
endTime = TimeSpan.Parse(Form1.FormMain.maskedTextNBEnd.Text);
Resscale rs = new Resscale(scalefactorx,scalefactory);
for (int index = 0; index != nbl.lines.Count; index+=1) {
line = new Line();
line.lineType = LineType.dialogue;
dl = (DialogueLine)(nbl.lines[index].Clone());
dl.start = startTime;
dl.end = endTime;
line.line = dl;
dl.text = dl.text.Replace("%line1%",Line1).Replace("%line2%",Line2);
dl = rs.ScaleDialogue(dl);
dl.style = nb.stylelist.Find(delegate(Style s) { return s.name.Equals(dl.style.name); });
dl.style = (Style)(dl.style.Clone());
if (nbStyleColl.Contains(dl.style) == false) nbStyleColl.Add(rs.ScaleStyle(dl.style));
sb.AppendLine(dl.ToString());
}
Form1.FormMain.textNBOut.Text = sb.ToString().TrimEnd();
sb = new StringBuilder(1024);
for (int index = 0; index != nb.stylelist.Count; index+=1)
sb.AppendLine(nb.stylelist[index].ToString());
Form1.FormMain.textNBStyles.Text = sb.ToString().TrimEnd();
}
public static void CopyStyles() {
int styleLine = -1;
Line newLine;
for (int index = 0; index != Form1.lineColl.Count; index+=1) {
if (Form1.lineColl[index].lineType == LineType.style) {
styleLine = index;
break;
}
}
if (styleLine != -1) {
for (int index = 0; index != nbStyleColl.Count; index+=1) {
if (Form1.styleColl.Contains(nbStyleColl[index]) == false) {
newLine = new Line();
newLine.lineType = LineType.style;
newLine.line = nbStyleColl[index];
Form1.lineColl.Insert(styleLine, newLine);
Form1.styleColl.Add(nbStyleColl[index]);
}
}
Form1.FormMain.ExtractStyles();
}
}
}
}

View File

@ -1,181 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace SSATool {
public class Resscale {
public static Regex rscale = new Regex(@"(\\[a-zA-Z]+\(?)([0-9,\-]+)", RegexOptions.IgnoreCase | RegexOptions.Singleline);
public static Regex rscaledrawing = new Regex(@"{.*\\p(?<scale>\d+)(.*?((\s*(c|([mnlbsp](\s+(?<num>\d+\.?\d*))+)))+))+", RegexOptions.IgnoreCase | RegexOptions.Singleline);
public double scalefactorx, scalefactory;
StringBuilder sb;
GroupCollection gc;
Match m;
MatchCollection mc;
string[] split;
string linetok;
int lastindex, tokindex;
int pscale;
bool x; // x or y coordinate, used for drawing
public Resscale(double ScaleFactorX, double ScaleFactorY) {
scalefactorx = ScaleFactorX;
scalefactory = ScaleFactorY;
}
public Style ScaleStyle(Style s) {
//No need to scale 1:1
if (scalefactorx==1.0 && scalefactory==1.0) return s;
s.fontSize *= (float)scalefactory;
s.shadowDepth *= scalefactory;
s.outlineWidth *= scalefactory;
s.margint = Convert.ToInt32(Math.Round(s.margint * scalefactory, 0), Util.nfi);
s.marginb = Convert.ToInt32(Math.Round(s.marginb * scalefactory, 0), Util.nfi);
s.marginl = Convert.ToInt32(Math.Round(s.marginl * scalefactorx, 0), Util.nfi);
s.marginr = Convert.ToInt32(Math.Round(s.marginr * scalefactorx, 0), Util.nfi);
return s;
}
public DialogueLine ScaleDialogue(DialogueLine dl) {
//No need to scale 1:1
if (scalefactorx==1.0 && scalefactory==1.0) return dl;
sb = new StringBuilder(1024);
linetok = dl.text;
lastindex = 0;
mc = rscale.Matches(linetok);
for (int mindex = 0; mindex != mc.Count; mindex+=1) {
m = mc[mindex];
if (m.Index > lastindex)
sb.Append(linetok.Substring(lastindex, m.Index - lastindex));
gc = m.Groups; //gc[1] is the command with parenthesis, gc[2] is all the params
sb.Append(gc[1]);
switch (gc[1].Value) {
case "\\pos(":
split = gc[2].Value.Split(",".ToCharArray());
sb.Append(String.Format("{0},{1}",
Math.Round((double.Parse(split[0], Util.nfi) * scalefactorx), 0),
Math.Round((double.Parse(split[1], Util.nfi) * scalefactory), 0)));
break;
case "\\org(":
split = gc[2].Value.Split(",".ToCharArray());
sb.Append(String.Format("{0},{1}",
Math.Round((double.Parse(split[0], Util.nfi) * scalefactorx), 0),
Math.Round((double.Parse(split[1], Util.nfi) * scalefactory), 0)));
break;
case "\\clip(":
split = gc[2].Value.Split(",".ToCharArray());
// if it doesn't have 4 tokens, it's either malformed or a drawing type clip
// and if it's a drawing type clip, the drawing itself will be caught later
if (split.Length == 4) {
try {
String.Format("{0},{1},{2},{3}",
Math.Round((double.Parse(split[0], Util.cfi) * scalefactorx), 0),
Math.Round((double.Parse(split[1], Util.cfi) * scalefactory), 0),
Math.Round((double.Parse(split[2], Util.cfi) * scalefactorx), 0),
Math.Round((double.Parse(split[3], Util.cfi) * scalefactory), 0));
} catch { }
}
break;
case "\\move(":
split = gc[2].Value.Split(",".ToCharArray());
tokindex = 0;
for (tokindex = 0; tokindex != split.Length; tokindex+=1) {
if (tokindex != 1) sb.Append(",");
if (tokindex < 5)
//Tokens will alternate x and y, so tokindex&1==0 should mean x, otherwise y
sb.Append(Math.Round((double.Parse(split[tokindex], Util.cfi) * (((tokindex&1) == 0) ? scalefactorx : scalefactory)), 0));
else //5 and 6 are times, don't scale them
sb.Append(split[tokindex]);
}
break;
case "\\bord":
sb.Append(Math.Round((double.Parse(gc[2].Value, Util.cfi) * scalefactory), 0));
break;
case "\\shad":
sb.Append(Math.Round((double.Parse(gc[2].Value, Util.cfi) * scalefactory), 0));
break;
case "\\fs":
sb.Append(Math.Round((double.Parse(gc[2].Value, Util.cfi) * scalefactory), 0));
break;
case "\\fsp":
sb.Append(Math.Round((double.Parse(gc[2].Value, Util.cfi) * scalefactorx), 0));
break;
case "\\pbo":
sb.Append(Math.Round((double.Parse(gc[2].Value, Util.cfi) * scalefactory), 0));
break;
default:
sb.Append(gc[2]); // don't know what it is, don't touch the params
break;
}
lastindex = m.Index + m.Length;
}
if (linetok.Length > lastindex)
sb.Append(linetok.Substring(lastindex, linetok.Length - lastindex));
if (rscaledrawing.IsMatch(linetok)) { // linetok isn't current yet but it's enough to just find a match
linetok = sb.ToString();
x = true; // x first
sb = new StringBuilder(1024);
lastindex = 0;
mc = rscaledrawing.Matches(linetok);
for (int mindex = 0; mindex != mc.Count; mindex+=1) {
m = mc[mindex];
pscale = int.Parse(m.Groups["scale"].Value);
foreach (Capture c in m.Groups["num"].Captures) {
if (c.Index > lastindex)
sb.Append(linetok.Substring(lastindex, c.Index - lastindex));
sb.Append((pscale > 0) ? Math.Round(double.Parse(c.Value) * (x ? scalefactorx : scalefactory), 0).ToString(Util.cfi) : c.Value);
x = !x; // Alternate X and Y
lastindex = c.Index + c.Length;
}
}
if (linetok.Length > lastindex)
sb.Append(linetok.Substring(lastindex, linetok.Length - lastindex));
}
dl.text = sb.ToString();
return dl;
}
}
}

View File

@ -1,169 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0C46ECAB-3C2E-43E6-A039-99ADC77F50E7}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>ssa24ov.ico</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>SSATool</AssemblyName>
<AssemblyOriginatorKeyFile>ssatool.snk</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>WinExe</OutputType>
<RootNamespace>SSATool</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<SignManifests>false</SignManifests>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Acceleration.cs" />
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Condition.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ConditionDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DetectEncoding.cs" />
<Compile Include="Filter.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="formEffectsEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="InputBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Layer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Line.cs" />
<Compile Include="ListViewES.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ManualTransform.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Notebox.cs" />
<Compile Include="Resscale.cs" />
<Compile Include="SaveFileDialogWithEncoding.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Evaluate.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Style.cs" />
<Compile Include="TimeCodes.cs" />
<Compile Include="Undo.cs" />
<Compile Include="util.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="ConditionDialog.resx">
<DependentUpon>ConditionDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.ja.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="formEffectsEditor.resx">
<DependentUpon>formEffectsEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="InputBox.resx">
<DependentUpon>InputBox.cs</DependentUpon>
</EmbeddedResource>
<Content Include="ssa24ov.ico" />
</ItemGroup>
<ItemGroup>
<None Include="ssatool.snk" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,70 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastOpenVersion>7.10.3077</LastOpenVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>
</ReferencePath>
<CopyProjectDestinationFolder>
</CopyProjectDestinationFolder>
<CopyProjectUncPath>
</CopyProjectUncPath>
<CopyProjectOption>0</CopyProjectOption>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory>
</InstallUrlHistory>
<SupportUrlHistory>
</SupportUrlHistory>
<UpdateUrlHistory>
</UpdateUrlHistory>
<BootstrapperUrlHistory>
</BootstrapperUrlHistory>
<ApplicationRevision>0</ApplicationRevision>
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>true</StartWithIE>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>true</StartWithIE>
</PropertyGroup>
</Project>

View File

@ -1,19 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SSATool", "SSATool.csproj", "{0C46ECAB-3C2E-43E6-A039-99ADC77F50E7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0C46ECAB-3C2E-43E6-A039-99ADC77F50E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C46ECAB-3C2E-43E6-A039-99ADC77F50E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C46ECAB-3C2E-43E6-A039-99ADC77F50E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C46ECAB-3C2E-43E6-A039-99ADC77F50E7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -1,346 +0,0 @@
using System;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
public enum EncodingType {
//UTF8=0,
//UTF8WithPreamble,
//Unicode,
//Ansi
ANSI,
BigEndianUnicode,
Unicode,
UTF8,
Shift_JIS
};
public class SaveFileDialogWithEncoding {
private delegate int OFNHookProcDelegate(int hdlg, int msg, int wParam, int lParam);
private int m_LabelHandle=0;
private int m_ComboHandle=0;
private string m_Filter="";
private string m_DefaultExt="";
private string m_FileName="";
private EncodingType m_EncodingType;
private Screen m_ActiveScreen;
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
private struct OPENFILENAME {
public int lStructSize;
public IntPtr hwndOwner;
public int hInstance;
[MarshalAs(UnmanagedType.LPTStr)] public string lpstrFilter;
[MarshalAs(UnmanagedType.LPTStr)] public string lpstrCustomFilter;
public int nMaxCustFilter;
public int nFilterIndex;
[MarshalAs(UnmanagedType.LPTStr)] public string lpstrFile;
public int nMaxFile;
[MarshalAs(UnmanagedType.LPTStr)] public string lpstrFileTitle;
public int nMaxFileTitle;
[MarshalAs(UnmanagedType.LPTStr)] public string lpstrInitialDir;
[MarshalAs(UnmanagedType.LPTStr)] public string lpstrTitle;
public int Flags;
public short nFileOffset;
public short nFileExtension;
[MarshalAs(UnmanagedType.LPTStr)] public string lpstrDefExt;
public int lCustData;
public OFNHookProcDelegate lpfnHook;
[MarshalAs(UnmanagedType.LPTStr)] public string lpTemplateName;
//only if on nt 5.0 or higher
public int pvReserved;
public int dwReserved;
public int FlagsEx;
}
[DllImport("Comdlg32.dll", CharSet=CharSet.Auto, SetLastError=true)]
private static extern bool GetSaveFileName(ref OPENFILENAME lpofn);
[DllImport("Comdlg32.dll")]
private static extern int CommDlgExtendedError();
[DllImport("user32.dll")]
private static extern bool SetWindowPos(int hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
private struct RECT {
public int Left;
public int Top;
public int Right;
public int Bottom;
}
private struct POINT {
public int X;
public int Y;
}
private struct NMHDR {
public int HwndFrom;
public int IdFrom;
public int Code;
}
[DllImport("user32.dll")]
private static extern bool GetWindowRect(int hWnd, ref RECT lpRect);
[DllImport("user32.dll")]
private static extern int GetParent(int hWnd);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern bool SetWindowText(int hWnd, string lpString);
[DllImport("user32.dll")]
private static extern int SendMessage(int hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern int SendMessage(int hWnd, int Msg, int wParam, string lParam);
[DllImport("user32.dll")]
private static extern bool DestroyWindow(int hwnd);
private const int OFN_ENABLEHOOK=0x00000020;
private const int OFN_EXPLORER=0x00080000;
private const int OFN_FILEMUSTEXIST=0x00001000;
private const int OFN_HIDEREADONLY=0x00000004;
private const int OFN_CREATEPROMPT=0x00002000;
private const int OFN_NOTESTFILECREATE=0x00010000;
private const int OFN_OVERWRITEPROMPT=0x00000002;
private const int OFN_PATHMUSTEXIST=0x00000800;
private const int SWP_NOSIZE=0x0001;
private const int SWP_NOMOVE=0x0002;
private const int SWP_NOZORDER=0x0004;
private const int WM_INITDIALOG=0x110;
private const int WM_DESTROY=0x2;
private const int WM_SETFONT=0x0030;
private const int WM_GETFONT=0x0031;
private const int CBS_DROPDOWNLIST=0x0003;
private const int CBS_HASSTRINGS=0x0200;
private const int CB_ADDSTRING=0x0143;
private const int CB_SETCURSEL=0x014E;
private const int CB_GETCURSEL=0x0147;
private const uint WS_VISIBLE=0x10000000;
private const uint WS_CHILD=0x40000000;
private const uint WS_TABSTOP=0x00010000;
private const int CDN_FILEOK=-606;
private const int WM_NOTIFY=0x004E;
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern int GetDlgItem(int hDlg, int nIDDlgItem);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern int CreateWindowEx(int dwExStyle, string lpClassName, string lpWindowName, uint dwStyle, int x, int y, int nWidth, int nHeight, int hWndParent, int hMenu, int hInstance, int lpParam);
[DllImport("user32.dll")]
private static extern bool ScreenToClient(int hWnd, ref POINT lpPoint);
private int HookProc(int hdlg, int msg, int wParam, int lParam) {
switch (msg) {
case WM_INITDIALOG:
//we need to centre the dialog
Rectangle sr=m_ActiveScreen.Bounds;
RECT cr=new RECT();
int parent=GetParent(hdlg);
GetWindowRect(parent, ref cr);
int x=(sr.Right + sr.Left - (cr.Right-cr.Left))/2;
int y=(sr.Bottom + sr.Top - (cr.Bottom-cr.Top))/2;
SetWindowPos(parent, 0, x, y, cr.Right-cr.Left, cr.Bottom - cr.Top + 32, SWP_NOZORDER);
//we need to find the label to position our new label under
int fileTypeWindow=GetDlgItem(parent, 0x441);
RECT aboveRect=new RECT();
GetWindowRect(fileTypeWindow, ref aboveRect);
//now convert the label's screen co-ordinates to client co-ordinates
POINT point=new POINT();
point.X=aboveRect.Left;
point.Y=aboveRect.Bottom;
ScreenToClient(parent, ref point);
//create the label
int labelHandle=CreateWindowEx(0, "STATIC", "mylabel", WS_VISIBLE | WS_CHILD | WS_TABSTOP, point.X, point.Y + 12, 200, 100, parent, 0, 0, 0);
SetWindowText(labelHandle, "&Encoding:");
int fontHandle=SendMessage(fileTypeWindow, WM_GETFONT, 0, 0);
SendMessage(labelHandle, WM_SETFONT, fontHandle, 0);
//we now need to find the combo-box to position the new combo-box under
int fileComboWindow=GetDlgItem(parent, 0x470);
aboveRect=new RECT();
GetWindowRect(fileComboWindow, ref aboveRect);
point=new POINT();
point.X=aboveRect.Left;
point.Y=aboveRect.Bottom;
ScreenToClient(parent, ref point);
POINT rightPoint=new POINT();
rightPoint.X=aboveRect.Right;
rightPoint.Y=aboveRect.Top;
ScreenToClient(parent, ref rightPoint);
//we create the new combobox
int comboHandle=CreateWindowEx(0, "ComboBox", "mycombobox", WS_VISIBLE | WS_CHILD | CBS_HASSTRINGS | CBS_DROPDOWNLIST | WS_TABSTOP, point.X, point.Y + 8, rightPoint.X-point.X, 100, parent, 0, 0, 0);
SendMessage(comboHandle, WM_SETFONT, fontHandle, 0);
//and add the encodings we want to offer
SendMessage(comboHandle, CB_ADDSTRING, 0, "ANSI");
SendMessage(comboHandle, CB_ADDSTRING, 0, "BigEndianUnicode");
SendMessage(comboHandle, CB_ADDSTRING, 0, "Unicode");
SendMessage(comboHandle, CB_ADDSTRING, 0, "UTF-8");
SendMessage(comboHandle, CB_ADDSTRING, 0, "SJIS");
SendMessage(comboHandle, CB_SETCURSEL, (int)m_EncodingType, 0);
//remember the handles of the controls we have created so we can destroy them after
m_LabelHandle=labelHandle;
m_ComboHandle=comboHandle;
break;
case WM_DESTROY:
//destroy the handles we have created
if (m_ComboHandle!=0) {
DestroyWindow(m_ComboHandle);
}
if (m_LabelHandle!=0) {
DestroyWindow(m_LabelHandle);
}
break;
case WM_NOTIFY:
//we need to intercept the CDN_FILEOK message
//which is sent when the user selects a filename
NMHDR nmhdr=(NMHDR)Marshal.PtrToStructure(new IntPtr(lParam), typeof(NMHDR));
if (nmhdr.Code==CDN_FILEOK) {
//a file has been selected
//we need to get the encoding
m_EncodingType=(EncodingType)SendMessage(m_ComboHandle, CB_GETCURSEL, 0, 0);
}
break;
}
return 0;
}
public string DefaultExt {
get { return m_DefaultExt; }
set { m_DefaultExt=value; }
}
public string Filter {
get { return m_Filter; }
set { m_Filter=value; }
}
public string FileName {
get { return m_FileName; }
set { m_FileName=value; }
}
public EncodingType EncodingType {
get { return m_EncodingType; }
set { m_EncodingType=value; }
}
public DialogResult ShowDialog(IntPtr ownerhwnd, Screen ownerscreen) {
return ShowDialog(ownerhwnd,ownerscreen,"Unicode");
}
public DialogResult ShowDialog(IntPtr ownerhwnd, Screen ownerscreen, string encoding) {
//m_EncodingType = stringToEncodingType(encoding);
//set up the struct and populate it
OPENFILENAME ofn=new OPENFILENAME();
ofn.lStructSize= Marshal.SizeOf( ofn );
ofn.lpstrFilter= m_Filter.Replace('|', '\0') + '\0';
ofn.lpstrFile = m_FileName + new string(' ', 512);
ofn.nMaxFile= ofn.lpstrFile.Length;
ofn.lpstrFileTitle= System.IO.Path.GetFileName(m_FileName) + new string(' ', 512);
ofn.nMaxFileTitle = ofn.lpstrFileTitle.Length;
ofn.lpstrTitle= "Save file as";
ofn.lpstrDefExt=m_DefaultExt;
//position the dialog above the active window
ofn.hwndOwner=ownerhwnd;
//we need to find out the active screen so the dialog box is
//centred on the correct display
m_ActiveScreen=ownerscreen;
//set up some sensible flags
ofn.Flags=OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_NOTESTFILECREATE | OFN_ENABLEHOOK | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
//this is where the hook is set. Note that we can use a C# delegate in place of a C function pointer
ofn.lpfnHook=new OFNHookProcDelegate(HookProc);
//if we're running on Windows 98/ME then the struct is smaller
if (System.Environment.OSVersion.Platform!=PlatformID.Win32NT) {
ofn.lStructSize-=12;
}
//show the dialog
if (!GetSaveFileName(ref ofn)) {
int ret=CommDlgExtendedError();
if (ret!=0) {
throw new ApplicationException("Couldn't show file open dialog - " + ret.ToString());
}
return DialogResult.Cancel;
}
m_FileName=ofn.lpstrFile;
return DialogResult.OK;
}
public static System.Text.Encoding stringToEncodingType(string input) {
unsafe {
switch (input) {
case "ASCII" : return System.Text.Encoding.ASCII;
case "ANSI" : return System.Text.Encoding.GetEncoding(1252);
case "BigEndianUnicode" : return System.Text.Encoding.BigEndianUnicode;
case "SJIS" :
case "Shift_JIS" : return System.Text.Encoding.GetEncoding("shift_jis");
case "UTF8" :
case "UTF-8" : return System.Text.Encoding.UTF8;
case "Unicode" :
default : return System.Text.Encoding.Unicode;
}
}
}
}

View File

@ -1,214 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
namespace SSATool {
/// <summary>
/// (A)SSA style (copied/adapted from VSFilter)
/// </summary>
public class Style : ICloneable {
public double outlineWidth;
public double shadowDepth;
public double fontScaleX, fontScaleY; // percent
public double fontSpacing; // +/- pixels
public double fontAngleZ, fontAngleX, fontAngleY;
public float fontSize;
public string name, fontName;
public Color[] colors; //pri,sec,outline/bg,shadow
public int marginl, marginr, margint, marginb;
public int charset;
public int scrAlignment; // 1 - 9: as on the numpad, 0: default
public int borderStyle; // 0: outline, 1: opaque box
public bool fBlur, fBold, fItalic, fUnderline, fStrikeOut;
public bool enabled;
public byte relativeTo;
public Style() {
// Set default values
name = "Default";
fontName = "Arial";
fontSize = 20;
colors = new System.Drawing.Color[4];
colors[0] = System.Drawing.Color.White;
colors[1] = System.Drawing.Color.FromArgb(0,0xFF,0xFF,0);
colors[2] = System.Drawing.Color.Black;
colors[3] = System.Drawing.Color.Black;
marginl = marginr = margint = marginb = 30;
scrAlignment = 2;
borderStyle = 0;
outlineWidth = 2;
shadowDepth = 3;
fontScaleX = fontScaleY = 100.0;
fontSpacing = 0;
fBlur = fBold = fItalic = fUnderline = false;
fontAngleZ = fontAngleX = fontAngleY = 0;
enabled = true;
}
public Style(string Name) : this() {
this.name=Name;
}
public Object Clone() {
return this.MemberwiseClone();
}
public Font GetFont() {
float size = (float)fontSize;
Font prelim = new Font(fontName, size);
FontFamily ff = prelim.FontFamily;
FontStyle fs = FontStyle.Regular;
if (fBold) fs |= FontStyle.Bold;
if (fItalic) fs |= FontStyle.Italic;
if (fUnderline) fs |= FontStyle.Underline;
if (fStrikeOut) fs |= FontStyle.Strikeout;
bool vsfilter=true;
bool scaledpi=false;
if (vsfilter)
size *= ff.GetEmHeight(fs) / (ff.GetCellAscent(fs) + ff.GetCellDescent(fs));
if (scaledpi)
size*=(72.0f/Form1.listSSAg.DpiY);
return new System.Drawing.Font(fontName, size, fs);
}
public Rectangle GetMarginRect() {
if (Form1.sver <= 5) marginb = margint;
return new Rectangle(marginl,marginr,Form1.ResX-(marginl+marginr),Form1.ResY-(margint+marginb));
}
public override bool Equals(object obj) {
if (obj is Style) {
Style s = (Style)obj;
return ((String.Equals(this.fontName, s.fontName, StringComparison.OrdinalIgnoreCase)) &&
(this.fontSize.Equals(s.fontSize)) &&
(this.fItalic.Equals(s.fItalic)) &&
(this.fUnderline.Equals(s.fUnderline)) &&
(this.fStrikeOut.Equals(s.fStrikeOut)) &&
(this.colors[0].Equals(s.colors[0])) &&
(this.colors[1].Equals(s.colors[1])) &&
(this.colors[2].Equals(s.colors[2])) &&
(this.colors[3].Equals(s.colors[3])) &&
(this.scrAlignment == s.scrAlignment) &&
(this.borderStyle == s.borderStyle) &&
(this.outlineWidth == s.outlineWidth) &&
(this.shadowDepth == s.shadowDepth) &&
(this.fontScaleX == s.fontScaleX) &&
(this.fontScaleY == s.fontScaleY) &&
(this.fontSpacing == s.fontSpacing) &&
(this.fBold == s.fBold) &&
(this.fBlur == s.fBlur) &&
(this.fontAngleZ == s.fontAngleZ) &&
(this.fontAngleX == s.fontAngleX) &&
(this.fontAngleY == s.fontAngleY));
}
else if (obj is string) return (String.Equals(this.name, (string)obj, StringComparison.OrdinalIgnoreCase));
else return false;
}
public override int GetHashCode() {
return base.GetHashCode ();
}
public override string ToString() {
uint andMask = (Form1.sver==4)?0xFFFFFF:0xFFFFFFFF; // cut out alpha if v4 with this and
string retStr = String.Format("Style: {0},{1},{2},&H{3:X6}&,&H{4:X6}&,&H{5:X6}&,&H{6:X6}&,{7},{8},",
this.name, this.fontName, this.fontSize, this.colors[0].ToArgb()&andMask,
this.colors[1].ToArgb()&andMask, this.colors[2].ToArgb()&andMask,
this.colors[3].ToArgb()&andMask, (this.fBold ? "-1" : "0"), (this.fItalic ? "-1" : "0"));
if (Form1.sver >= 5) {
retStr = String.Format("{0}{1},{2},{3},{4},{5},{6},",
retStr,
(this.fUnderline ? "-1" : "0"),
(this.fStrikeOut ? "-1" : "0"),
this.fontScaleX, this.fontScaleY,
this.fontSpacing, this.fontAngleZ);
}
retStr += String.Format("{0},{1},{2},{3},{4:G4},{5:G4},{6:G4},",
this.borderStyle, this.outlineWidth, this.shadowDepth,
this.scrAlignment, this.marginl, this.marginr, this.margint);
if (Form1.sver >= 6) retStr += Convert.ToString(this.marginb,Util.cfi) + ",";
else if (Form1.sver == 4) retStr += Convert.ToString(this.colors[0].A,Util.cfi) + ",";
retStr += Convert.ToString(this.charset,Util.cfi);
if (Form1.sver >= 6) retStr += "," + this.relativeTo.ToString(Util.cfi);
return retStr;
}
public static Style ParseStyle(string inStr) {
return ParseStyle(inStr, Form1.sver);
}
public static Style ParseStyle(string inStr, int scriptVer) {
int startpos = inStr.IndexOf(':')+1;
string[] xInfo = inStr.Substring(startpos,inStr.Length-startpos).TrimStart().Split(",".ToCharArray());
Style style = new Style();
int index;
uint alpha = (scriptVer != 4 ? 0 : (Util.ReadColor(xInfo[16]) << 24));
style.name = xInfo[0];
style.fontName = xInfo[1];
style.fontSize = float.Parse(xInfo[2]);
style.colors[0] = Util.uintToColor(Util.ReadColor(xInfo[3])+alpha);
style.colors[1] = Util.uintToColor(Util.ReadColor(xInfo[4])+alpha);
style.colors[2] = Util.uintToColor(Util.ReadColor(xInfo[5])+alpha);
style.colors[3] = Util.uintToColor(Util.ReadColor(xInfo[6])+alpha);
style.fBold = !String.Equals(xInfo[7], "0", StringComparison.Ordinal);
style.fItalic = !String.Equals(xInfo[index=8], "0", StringComparison.Ordinal);
if (scriptVer >= 5) {
style.fUnderline = !String.Equals(xInfo[++index], "0", StringComparison.Ordinal);
style.fStrikeOut = !String.Equals(xInfo[++index], "0", StringComparison.Ordinal);
style.fontScaleX = double.Parse(xInfo[++index]);
style.fontScaleY = double.Parse(xInfo[++index]);
style.fontSpacing = double.Parse(xInfo[++index]);
style.fontAngleZ = double.Parse(xInfo[++index]);
}
style.borderStyle = int.Parse(xInfo[++index]);
style.outlineWidth = double.Parse(xInfo[++index]);
style.shadowDepth = double.Parse(xInfo[++index]);
style.scrAlignment = int.Parse(xInfo[++index]);
style.marginl = int.Parse(xInfo[++index]);
style.marginr = int.Parse(xInfo[++index]);
style.margint = int.Parse(xInfo[++index]);
if (scriptVer >= 6) style.marginb = int.Parse(xInfo[++index]);
if (scriptVer == 4) index++; //alphaLevel is in v4 only and is taken care of at the top (uint alpha), so just advance the index
style.charset = int.Parse(xInfo[++index]);
if (scriptVer >= 6) style.relativeTo = byte.Parse(xInfo[++index]);
//Following is code from VSFilter, but since we're not interpreting this, merely spitting it back out the way it came in, we don't currently need it
//if (sver <= 4) style.scrAlignment = ((style.scrAlignment & 4) == 1) ? ((style.scrAlignment & 3) + 6) // top
// : ((style.scrAlignment & 8) == 1) ? ((style.scrAlignment & 3) + 3) // mid
// : (style.scrAlignment & 3); // bottom
return style;
}
}
}

View File

@ -1,101 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Text;
using System.IO;
namespace SSATool {
public class TimeCodes {
private float[] times;
private double frameRate;
public TimeCodes(string filename, double frameRate) {
this.frameRate = frameRate;
double AssumeFPS = 29.97;
string thisline;
int frames = 0, index;
bool v1;
StreamReader fs = new StreamReader(filename);
thisline = fs.ReadLine(); // Save the first line now
if (string.Compare(thisline, "# timecode format v1", true, Util.cfi) == 0) v1 = true;
else if (string.Compare(thisline, "# timecode format v2", true, Util.cfi) == 0) v1 = false;
else throw new InvalidDataException("File was not detected as an MKV TimeCode v1 or v2 file.");
//count frames
while (!fs.EndOfStream) {
if ((fs.Peek() != '#') && ((thisline = fs.ReadLine()).Length > 3)) {
if (v1 == false) frames+=1;
else frames = Math.Max(frames, int.Parse(thisline.Split(",".ToCharArray())[1]));
}
else if ((fs.Peek() == 'A' || fs.Peek() == 'a') && (string.Compare(thisline.Split(" ".ToCharArray())[0], "assumefps", true, Util.cfi) == 0))
AssumeFPS = double.Parse(thisline.Split(" ".ToCharArray())[1]);
}
fs.Close();
//restart, actually saving info
fs = new StreamReader(filename);
while ((fs.Peek() == '#') || (fs.Peek() == 'a') || (fs.Peek() == 'A'))
fs.ReadLine();
times = new float[frames];
for (index = 0;index < frames;index+=1) {
if (v1) {
string[] splitv1 = fs.ReadLine().Split(",".ToCharArray());
for (;index <= int.Parse(splitv1[1]);index+=1) // frames is the number of frames with v1, so index SHOULD go up for every frame
times[index] = ((index != 0) ? times[index - 1] : 0) + (float)(1.0 / ((splitv1.Length == 3) ? float.Parse(splitv1[2]) : AssumeFPS));
}
else
times[index] = float.Parse(fs.ReadLine());
}
fs.Close();
}
/// <summary>
/// Finds the frame number of a given VFR time, so that frame number can be used to convert to a CFR time
/// </summary>
/// <param name="time">The time in MILLISECONDS</param>
/// <returns></returns>
public int FindFrame(float time) {
int k, low = 0, high = times.Length-1;
while (low!=high) {
k=(int)Math.Ceiling((high+low)/2.0f);
if (times[k].CompareTo(time) == -1)
low=k;
else if (k!=0 && times[k-1].CompareTo(time) == -1)
return k;
else high=k;
}
return 0;
}
public TimeSpan GetTimeInverse(TimeSpan time) {
int frame = System.Convert.ToInt32(time.TotalSeconds * frameRate, Util.cfi);
return TimeSpan.FromMilliseconds((frame<times.Length)?times[frame]:0);
}
public TimeSpan GetTime(TimeSpan time) {
return TimeSpan.FromSeconds(FindFrame((float)time.TotalMilliseconds) / frameRate);
}
}
}

View File

@ -1,44 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace SSATool {
//This could be simplified
public struct Undo {
public List<int> DeleteLines;
public List<UndoLine> AddLines;
}
public struct UndoLine {
public int index;
public Line line;
}
public struct LineUndo {
public int index;
public Line line;
}
public struct LineCUndo {
public int index;
public Line line;
}
}

View File

@ -1,103 +0,0 @@
Name=Raw code (first \k only)
Code=$Code$
FstK=True
ONam=Code
ODef=
Name=Position
Code=\pos($x$,$y$)
FstK=True
ONam=x
ODef=
ONam=y
ODef=
Name=Origin
Code=\org($x$,$y$)
FstK=True
ONam=x
ODef=
ONam=y
ODef=
Name=Transformation
Code=\t($Start Time$,$End Time$,$Acceleration$,$Code$)
ONam=Start Time
ODef=%karastart%
ONam=End Time
ODef=%karaend%
ONam=Acceleration
ODef=1
ONam=Code
ODef=
Name=Move
Code=\move($Start X$,$Start Y$,$End X$,$End Y$,$Start Time$,$End Time$)
FstK=True
ONam=Start X
ODef=
ONam=Start Y
ODef=
ONam=End X
ODef=
ONam=End Y
ODef=
ONam=Start Time
ODef=
ONam=End Time
ODef=
Name=Revert
Code=\r
Name=Expanding Border
Code=\bord$Initial Border Size$\3a&$Initial Border Alpha$\t(%karastart%,%karaend%,\bord$Expanded Border Size$\3a&$Expanded Border Alpha$&)\t(%karaend%,%karaend%,\bord$Initial Border Size$\3a&$Initial Border Alpha$&)
ONam=Initial Border Size
ODef=1
ONam=Expanded Border Size
ODef=12
ONam=Initial Border Alpha
ODef=H00
ONam=Expanded Border Alpha
ODef=H60
Name=Font Size
Code=\fs$Size$
ONam=Size
ODef=20
Name=Font Scaling (X)
Code=\fscx$Scaling$
ONam=Scaling
ODef=100
Name=Font Scaling (X)
Code=\fscy$Scaling$
ONam=Scaling
ODef=100
Name=Font Spacing (X)
Code=\fspx$Spacing$
ONam=Spacing
ODef=0
Name=Font Spacing (Y)
Code=\fspy$Spacing$
ONam=Spacing
ODef=0
Name=Font Rotation (X)
Code=\frx$Rotation$
ONam=Rotation
ODef=0
Name=Font Rotation (Y)
Code=\fry$Rotation$
ONam=Rotation
ODef=0
Name=Font Rotation (Z)
Code=\frz$Rotation$
ONam=Rotation
ODef=0

View File

@ -1,9 +0,0 @@
<?xml version="1.0"?>
<ESSA>
<Effect Name="Transformation" Code="\t($Start Time$,$End Time$,$Acceleration$,$Code$)">
<Option Name="Start Time">%karastart%</Option>
<Option Name="End Time">%karaend%</Option>
<Option Name="Acceleration">1</Option>
<Option Name="Code"></Option>
</Effect>
</ESSA>

View File

@ -1,434 +0,0 @@
/*
SSATool - A collection of utilities for Advanced Substation Alpha
Copyright (C) 2007 Dan Donovan
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; ONLY under version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
using System;
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace SSATool
{
/// <summary>
/// Summary description for formEffectsEditor.
/// </summary>
public class formEffectsEditor : System.Windows.Forms.Form
{
#region form stuff
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.Button cmdNewEffect;
private System.Windows.Forms.Button cmdDelEffect;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtCode;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtDefaultVal;
private System.Windows.Forms.TextBox txtOptName;
private System.ComponentModel.Container components = null;
private System.Windows.Forms.ListBox lstEffects;
private System.Windows.Forms.Button cmdChangeOpt;
private System.Windows.Forms.Button cmdRemoveOpt;
private System.Windows.Forms.Button cmdNewOpt;
private System.Windows.Forms.ListBox lstParams;
private System.Windows.Forms.MenuItem menuLoadEffectsFile;
private System.Windows.Forms.MenuItem menuSaveEffectsFile;
private System.Windows.Forms.MenuItem menuClose;
private System.Windows.Forms.Button cmdChangeCode;
#endregion
private System.Collections.Generic.List<Filter> tColl;
public formEffectsEditor(System.Collections.Generic.List<Filter> templateFilterColl) {
InitializeComponent();
tColl = templateFilterColl;
}
public formEffectsEditor() {
InitializeComponent();
tColl = new System.Collections.Generic.List<Filter>();
}
protected override void Dispose(bool disposing) {
if(disposing) {
if(components != null)
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lstEffects = new System.Windows.Forms.ListBox();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuLoadEffectsFile = new System.Windows.Forms.MenuItem();
this.menuSaveEffectsFile = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuClose = new System.Windows.Forms.MenuItem();
this.cmdNewEffect = new System.Windows.Forms.Button();
this.cmdDelEffect = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmdChangeCode = new System.Windows.Forms.Button();
this.txtOptName = new System.Windows.Forms.TextBox();
this.txtDefaultVal = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtCode = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.cmdChangeOpt = new System.Windows.Forms.Button();
this.cmdRemoveOpt = new System.Windows.Forms.Button();
this.cmdNewOpt = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.lstParams = new System.Windows.Forms.ListBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// lstEffects
//
this.lstEffects.Location = new System.Drawing.Point(0, 8);
this.lstEffects.Name = "lstEffects";
this.lstEffects.Size = new System.Drawing.Size(160, 251);
this.lstEffects.TabIndex = 0;
this.lstEffects.SelectedIndexChanged += new System.EventHandler(this.lstEffects_SelectedIndexChanged);
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuLoadEffectsFile,
this.menuSaveEffectsFile,
this.menuItem4,
this.menuClose});
this.menuItem1.Text = "File";
//
// menuLoadEffectsFile
//
this.menuLoadEffectsFile.Index = 0;
this.menuLoadEffectsFile.Text = "Load Effects File";
//
// menuSaveEffectsFile
//
this.menuSaveEffectsFile.Index = 1;
this.menuSaveEffectsFile.Text = "Save Effects File";
this.menuSaveEffectsFile.Click += new System.EventHandler(this.menuSaveEffectsFile_Click);
//
// menuItem4
//
this.menuItem4.Index = 2;
this.menuItem4.Text = "-";
//
// menuClose
//
this.menuClose.Index = 3;
this.menuClose.Text = "Exit";
this.menuClose.Click += new System.EventHandler(this.menuClose_Click);
//
// cmdNewEffect
//
this.cmdNewEffect.Location = new System.Drawing.Point(0, 264);
this.cmdNewEffect.Name = "cmdNewEffect";
this.cmdNewEffect.Size = new System.Drawing.Size(80, 24);
this.cmdNewEffect.TabIndex = 1;
this.cmdNewEffect.Text = "New";
this.cmdNewEffect.Click += new System.EventHandler(this.cmdNewEffect_Click);
//
// cmdDelEffect
//
this.cmdDelEffect.Location = new System.Drawing.Point(80, 264);
this.cmdDelEffect.Name = "cmdDelEffect";
this.cmdDelEffect.Size = new System.Drawing.Size(80, 24);
this.cmdDelEffect.TabIndex = 2;
this.cmdDelEffect.Text = "Remove";
this.cmdDelEffect.Click += new System.EventHandler(this.cmdDelEffect_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.cmdChangeCode);
this.groupBox1.Controls.Add(this.txtOptName);
this.groupBox1.Controls.Add(this.txtDefaultVal);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtCode);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.cmdChangeOpt);
this.groupBox1.Controls.Add(this.cmdRemoveOpt);
this.groupBox1.Controls.Add(this.cmdNewOpt);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.lstParams);
this.groupBox1.Location = new System.Drawing.Point(168, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(416, 280);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Selected Effect";
//
// cmdChangeCode
//
this.cmdChangeCode.Location = new System.Drawing.Point(328, 256);
this.cmdChangeCode.Name = "cmdChangeCode";
this.cmdChangeCode.Size = new System.Drawing.Size(80, 18);
this.cmdChangeCode.TabIndex = 11;
this.cmdChangeCode.Text = "Change";
this.cmdChangeCode.Click += new System.EventHandler(this.cmdChangeCode_Click);
//
// txtOptName
//
this.txtOptName.Location = new System.Drawing.Point(104, 144);
this.txtOptName.Name = "txtOptName";
this.txtOptName.Size = new System.Drawing.Size(304, 20);
this.txtOptName.TabIndex = 10;
this.txtOptName.Text = "";
//
// txtDefaultVal
//
this.txtDefaultVal.Location = new System.Drawing.Point(104, 168);
this.txtDefaultVal.Name = "txtDefaultVal";
this.txtDefaultVal.Size = new System.Drawing.Size(304, 20);
this.txtDefaultVal.TabIndex = 9;
this.txtDefaultVal.Text = "";
//
// label4
//
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label4.Location = new System.Drawing.Point(8, 168);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(96, 24);
this.label4.TabIndex = 8;
this.label4.Text = "Default Value:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label3.Location = new System.Drawing.Point(8, 144);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 24);
this.label3.TabIndex = 7;
this.label3.Text = "Option Name:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtCode
//
this.txtCode.Location = new System.Drawing.Point(8, 256);
this.txtCode.Name = "txtCode";
this.txtCode.Size = new System.Drawing.Size(312, 20);
this.txtCode.TabIndex = 6;
this.txtCode.Text = "";
this.txtCode.TextChanged += new System.EventHandler(this.txtCode_TextChanged);
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label2.Location = new System.Drawing.Point(8, 192);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(400, 64);
this.label2.TabIndex = 5;
this.label2.Text = "Code: Put together the SSA code using the variables above (surrounded by dollar s" +
"igns, IE length would be $length$) here. You may use variables as well.";
this.label2.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
//
// cmdChangeOpt
//
this.cmdChangeOpt.Location = new System.Drawing.Point(296, 104);
this.cmdChangeOpt.Name = "cmdChangeOpt";
this.cmdChangeOpt.Size = new System.Drawing.Size(112, 24);
this.cmdChangeOpt.TabIndex = 4;
this.cmdChangeOpt.Text = "Change";
this.cmdChangeOpt.Click += new System.EventHandler(this.cmdChangeOpt_Click);
//
// cmdRemoveOpt
//
this.cmdRemoveOpt.Location = new System.Drawing.Point(296, 64);
this.cmdRemoveOpt.Name = "cmdRemoveOpt";
this.cmdRemoveOpt.Size = new System.Drawing.Size(112, 24);
this.cmdRemoveOpt.TabIndex = 3;
this.cmdRemoveOpt.Text = "Remove";
this.cmdRemoveOpt.Click += new System.EventHandler(this.cmdRemoveOpt_Click);
//
// cmdNewOpt
//
this.cmdNewOpt.Location = new System.Drawing.Point(296, 40);
this.cmdNewOpt.Name = "cmdNewOpt";
this.cmdNewOpt.Size = new System.Drawing.Size(112, 24);
this.cmdNewOpt.TabIndex = 2;
this.cmdNewOpt.Text = "New";
this.cmdNewOpt.Click += new System.EventHandler(this.cmdNewOpt_Click);
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.Location = new System.Drawing.Point(8, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(280, 16);
this.label1.TabIndex = 1;
this.label1.Text = "Parameters";
this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
//
// lstParams
//
this.lstParams.Location = new System.Drawing.Point(8, 40);
this.lstParams.Name = "lstParams";
this.lstParams.Size = new System.Drawing.Size(280, 95);
this.lstParams.TabIndex = 0;
this.lstParams.SelectedIndexChanged += new System.EventHandler(this.lstParams_SelectedIndexChanged);
//
// formEffectsEditor
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(584, 291);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.cmdDelEffect);
this.Controls.Add(this.cmdNewEffect);
this.Controls.Add(this.lstEffects);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.ImeMode = System.Windows.Forms.ImeMode.On;
this.MaximizeBox = false;
this.Menu = this.mainMenu1;
this.Name = "formEffectsEditor";
this.Text = "SSATool Effects Editor";
this.Load += new System.EventHandler(this.formEffectsEditor_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void formEffectsEditor_Load(object sender, System.EventArgs e) {
foreach(Filter tf in tColl)
lstEffects.Items.Add(tf.ToString());
}
private void cmdNewEffect_Click(object sender, System.EventArgs e) {
InputBoxResult newvalue = InputBox.Show("Enter the name of the new effect:","Input",String.Empty);
if (newvalue.OK == true) {
int index, cmp;
for(index=0;index<tColl.Count;index++) {
cmp = newvalue.Text.CompareTo(tColl[index].ToString());
if (cmp == 0) {
MessageBox.Show("An effect of that name already exists.");
return;
}
if (cmp == -1) break;
}
Filter nt = new Filter(newvalue.Text);
tColl.Insert(index, nt);
}
}
private void cmdDelEffect_Click(object sender, System.EventArgs e) {
if (lstEffects.SelectedItems.Count != 0) {
tColl.RemoveAt(lstEffects.SelectedIndex);
lstEffects.Items.RemoveAt(lstEffects.SelectedIndex);
}
}
private void cmdNewOpt_Click(object sender, System.EventArgs e) {
if (lstEffects.SelectedItems.Count != 0) {
(tColl[lstEffects.SelectedIndex]).AddOption("New Option",String.Empty);
lstParams.Items.Add("New Option");
}
else MessageBox.Show("Select an effect first.");
}
private void cmdRemoveOpt_Click(object sender, System.EventArgs e) {
if ((lstEffects.SelectedItems.Count != 0) && (lstParams.SelectedItems.Count != 0)) {
(tColl[lstEffects.SelectedIndex]).RemoveOptionByIndex(lstParams.SelectedIndex);
lstParams.Items.RemoveAt(lstParams.SelectedIndex);
}
else MessageBox.Show("Select an effect first.");
}
private void cmdChangeOpt_Click(object sender, System.EventArgs e) {
if ((lstEffects.SelectedItems.Count != 0) && (lstParams.SelectedItems.Count != 0)) {
(tColl[lstEffects.SelectedIndex]).SetOptionByIndex(lstParams.SelectedIndex,txtOptName.Text,txtDefaultVal.Text);
lstParams.Items.Clear();
foreach(FilterOption fo in (Filter)tColl[lstEffects.SelectedIndex]) {
lstParams.Items.Add(fo.Name);
}
}
else MessageBox.Show("Select an effect and a parameter first.");
}
private void cmdChangeCode_Click(object sender, System.EventArgs e) {
if (lstEffects.SelectedItems.Count != 0)
(tColl[lstEffects.SelectedIndex]).Code = txtCode.Text;
else MessageBox.Show("Select an effect first.");
}
private void txtCode_TextChanged(object sender, System.EventArgs e) {
if (lstEffects.SelectedItems.Count != 0)
(tColl[lstEffects.SelectedIndex]).Code = txtCode.Text;
}
private void lstEffects_SelectedIndexChanged(object sender, System.EventArgs e) {
lstParams.Items.Clear();
if (lstEffects.SelectedItems.Count != 0) {
foreach(FilterOption fo in (tColl[lstEffects.SelectedIndex])) {
lstParams.Items.Add(fo.Name);
txtCode.Text = (tColl[lstEffects.SelectedIndex]).Code;
}
}
}
private void lstParams_SelectedIndexChanged(object sender, System.EventArgs e) {
if ((lstEffects.SelectedItems.Count != 0) && (lstParams.SelectedItems.Count != 0)) {
txtOptName.Text = lstParams.Items[lstParams.SelectedIndex].ToString();
txtDefaultVal.Text = (tColl[lstEffects.SelectedIndex]).GetOptionValueByName(lstParams.Items[lstParams.SelectedIndex].ToString());
}
else
txtOptName.Text = txtDefaultVal.Text = String.Empty;
}
private void menuClose_Click(object sender, System.EventArgs e) {
this.Close();
}
private void menuSaveEffectsFile_Click(object sender, System.EventArgs e) {
SaveFileDialogWithEncoding ofd=new SaveFileDialogWithEncoding();
ofd.DefaultExt="exml";
ofd.EncodingType=EncodingType.ANSI;
ofd.Filter="XML effect files (*.exml)|*.exml|All files (*.*)|*.*";
if (ofd.ShowDialog((IntPtr)this.Handle,Screen.FromControl(this))==DialogResult.OK) {
Form1.SaveEffectsFile(ofd.FileName,tColl);
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More