Commit Graph

136 Commits

Author SHA1 Message Date
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 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 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 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
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 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 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 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 8c8b149236 Fix a few warnings in the reporter
Originally committed to SVN as r5219.
2011-01-16 07:18:06 +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 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 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 64ebce6c0f Move NextFrame and PrevFrame from VideoSlider to VideoContext
Originally committed to SVN as r5200.
2011-01-16 07:15:53 +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
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 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 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 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 3345797ff6 Use signals in AudioController and AudioTimingController
Originally committed to SVN as r4907.
2010-12-08 08:09:16 +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 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 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 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 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 f37e1bf87a Fix thread warnings on shutdown on unix
Originally committed to SVN as r4766.
2010-08-27 01:01:35 +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 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 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 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 35e33bd036 Fix crash when video loading fails.
Originally committed to SVN as r4705.
2010-07-23 06:40:12 +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 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
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
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 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 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 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 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
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
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 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 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 c290b6b811 Silence some prefast warnings
Originally committed to SVN as r4472.
2010-06-11 02:24:59 +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
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 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 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 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 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
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 86f64b2962 Improve video operation errors somewhat. Updates #1020.
Originally committed to SVN as r3835.
2009-12-01 00:32:43 +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
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
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 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 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
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
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 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
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
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
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
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
Niels Martin Hansen 68481215c9 Apply patch to fix #910.
Originally committed to SVN as r3128.
2009-07-14 02:00:56 +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
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
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
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 a6c7a8a724 Apply Plorkyeran's patch to close #843.
Originally committed to SVN as r2938.
2009-05-15 12:44:36 +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 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
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
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