2007-01-21 07:30:19 +01:00
|
|
|
// Copyright (c) 2005-2007, Rodrigo Braz Monteiro
|
|
|
|
// 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.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2007-01-21 07:30:19 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file video_context.h
|
|
|
|
/// @see video_context.cpp
|
|
|
|
/// @ingroup video
|
|
|
|
///
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
2007-01-21 07:30:19 +01:00
|
|
|
#include <time.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
|
|
|
|
#include <list>
|
2010-07-08 06:29:04 +02:00
|
|
|
#include <memory>
|
2009-09-11 04:36:34 +02:00
|
|
|
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/timer.h>
|
2008-01-20 07:14:40 +01:00
|
|
|
#include <wx/stopwatch.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#endif
|
|
|
|
|
2012-03-25 06:05:38 +02:00
|
|
|
#include <libaegisub/scoped_ptr.h>
|
2010-12-31 22:02:42 +01:00
|
|
|
#include <libaegisub/signal.h>
|
2010-07-08 06:29:04 +02:00
|
|
|
#include <libaegisub/vfr.h>
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2010-08-02 08:32:01 +02:00
|
|
|
class AegiVideoFrame;
|
2010-07-23 07:58:39 +02:00
|
|
|
class SubtitlesProviderErrorEvent;
|
|
|
|
class ThreadedFrameSource;
|
2007-01-21 07:30:19 +01:00
|
|
|
class VideoProvider;
|
2010-07-23 07:58:39 +02:00
|
|
|
class VideoProviderErrorEvent;
|
2010-06-08 08:09:13 +02:00
|
|
|
|
|
|
|
namespace agi {
|
2011-01-16 08:17:08 +01:00
|
|
|
struct Context;
|
2010-06-08 08:09:13 +02:00
|
|
|
class OptionValue;
|
|
|
|
}
|
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-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @class VideoContext
|
2012-03-12 01:07:09 +01:00
|
|
|
/// @brief Manage a bunch of things vaguely related to video playback
|
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-30 00:59:22 +02:00
|
|
|
///
|
2012-03-12 01:07:09 +01:00
|
|
|
/// VideoContext's core responsibility is opening and playing videos. Along
|
|
|
|
/// with that, it also manages video timecodes and keyframes, and some
|
|
|
|
/// video-related UI properties
|
2007-01-21 07:30:19 +01:00
|
|
|
class VideoContext : public wxEvtHandler {
|
2010-12-07 20:09:28 +01:00
|
|
|
/// Current frame number changed (new frame number)
|
2010-12-07 20:09:21 +01:00
|
|
|
agi::signal::Signal<int> Seek;
|
|
|
|
/// A new video was opened
|
|
|
|
agi::signal::Signal<> VideoOpen;
|
2010-12-07 20:09:28 +01:00
|
|
|
/// New keyframes opened (new keyframe data)
|
2010-12-07 20:09:21 +01:00
|
|
|
agi::signal::Signal<std::vector<int> const&> KeyframesOpen;
|
2010-12-31 22:03:18 +01:00
|
|
|
/// New timecodes opened (new timecode data)
|
|
|
|
agi::signal::Signal<agi::vfr::Framerate const&> TimecodesOpen;
|
2010-12-07 20:09:28 +01:00
|
|
|
/// Aspect ratio was changed (type, value)
|
|
|
|
agi::signal::Signal<int, double> ARChange;
|
2010-12-07 20:09:21 +01:00
|
|
|
|
2011-01-16 08:17:08 +01:00
|
|
|
agi::Context *context;
|
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// The video provider owned by the threaded frame source, or NULL if no
|
|
|
|
/// video is open
|
2011-12-06 01:17:36 +01:00
|
|
|
VideoProvider *videoProvider;
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Asynchronous provider of video frames
|
2012-03-25 06:05:38 +02:00
|
|
|
agi::scoped_ptr<ThreadedFrameSource> provider;
|
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-30 00:59:22 +02:00
|
|
|
|
2010-08-26 20:38:37 +02:00
|
|
|
/// Filename of currently open video
|
|
|
|
wxString videoFile;
|
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// List of frame numbers which are keyframes
|
2010-07-08 06:29:04 +02:00
|
|
|
std::vector<int> keyFrames;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// File name of the currently open keyframes or empty if keyframes are not overridden
|
2007-01-21 07:30:19 +01:00
|
|
|
wxString keyFramesFilename;
|
|
|
|
|
2012-03-12 01:07:09 +01:00
|
|
|
/// Playback timer used to periodically check if we should go to the next
|
|
|
|
/// frame while playing video
|
2007-01-21 07:30:19 +01:00
|
|
|
wxTimer playback;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-05 06:26:45 +01:00
|
|
|
/// Time since playback was last started
|
2008-01-20 07:14:40 +01:00
|
|
|
wxStopWatch playTime;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// The start time of the first frame of the current playback; undefined if
|
|
|
|
/// video is not currently playing
|
2011-12-05 06:26:45 +01:00
|
|
|
int startMS;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// The last frame to play if video is currently playing
|
2007-01-21 07:30:19 +01:00
|
|
|
int endFrame;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// The frame number which was last requested from the video provider,
|
|
|
|
/// which may not be the same thing as the currently displayed frame
|
2007-01-21 07:30:19 +01:00
|
|
|
int frame_n;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// The picture aspect ratio of the video if the aspect ratio has been
|
|
|
|
/// overridden by the user
|
2007-01-23 07:32:16 +01:00
|
|
|
double arValue;
|
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-30 00:59:22 +02:00
|
|
|
|
2012-03-12 01:07:09 +01:00
|
|
|
/// @brief The current AR type
|
|
|
|
///
|
|
|
|
/// 0 is square pixels; 1-3 are predefined ARs; 4 is custom, where the real
|
|
|
|
/// AR is in arValue
|
2007-01-23 07:32:16 +01:00
|
|
|
int arType;
|
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Does the currently loaded video file have subtitles muxed into it?
|
2010-05-19 02:44:37 +02:00
|
|
|
bool hasSubtitles;
|
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Filename of the currently loaded timecodes file, or empty if timecodes
|
2012-03-12 01:07:09 +01:00
|
|
|
/// have not been overridden
|
2010-07-08 06:29:04 +02:00
|
|
|
wxString ovrTimecodeFile;
|
|
|
|
|
2012-03-12 01:07:09 +01:00
|
|
|
/// Cached option for audio playing when frame stepping
|
2010-11-08 06:08:24 +01:00
|
|
|
const agi::OptionValue* playAudioOnStep;
|
2010-06-08 08:09:13 +02:00
|
|
|
|
2007-01-21 07:30:19 +01:00
|
|
|
void OnPlayTimer(wxTimerEvent &event);
|
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// The timecodes from the video file
|
2010-07-08 06:29:04 +02:00
|
|
|
agi::vfr::Framerate videoFPS;
|
2011-12-06 01:18:04 +01:00
|
|
|
/// External timecode which have been loaded, if any
|
2010-07-08 06:29:04 +02:00
|
|
|
agi::vfr::Framerate ovrFPS;
|
|
|
|
|
2010-07-23 07:58:39 +02:00
|
|
|
void OnVideoError(VideoProviderErrorEvent const& err);
|
|
|
|
void OnSubtitlesError(SubtitlesProviderErrorEvent const& err);
|
|
|
|
|
2011-01-16 08:16:40 +01:00
|
|
|
void OnSubtitlesCommit();
|
|
|
|
void OnSubtitlesSave();
|
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Close the video, keyframes and timecodes
|
2011-11-23 19:32:37 +01:00
|
|
|
void Reset();
|
|
|
|
|
2007-01-21 07:30:19 +01:00
|
|
|
public:
|
|
|
|
VideoContext();
|
|
|
|
~VideoContext();
|
|
|
|
|
2011-01-16 08:17:08 +01:00
|
|
|
/// @brief Set the context that this is the video controller for
|
|
|
|
/// @param context Initialized project context
|
|
|
|
///
|
|
|
|
/// Once this is no longer a singleton this can probably be moved into
|
|
|
|
/// the constructor
|
|
|
|
void SetContext(agi::Context *context);
|
|
|
|
|
2010-07-08 06:29:04 +02:00
|
|
|
/// @brief Get the video provider used for the currently open video
|
2011-12-06 01:17:36 +01:00
|
|
|
VideoProvider *GetProvider() const { return videoProvider; }
|
2011-12-06 01:18:04 +01:00
|
|
|
|
|
|
|
/// Synchronously get a video frame
|
|
|
|
/// @param n Frame number to get
|
|
|
|
/// @param raw If true, subtitles are not rendered on the frame
|
|
|
|
/// @return The requested frame
|
2010-09-16 00:10:48 +02:00
|
|
|
std::tr1::shared_ptr<AegiVideoFrame> GetFrame(int n, bool raw = false);
|
2011-12-06 01:18:04 +01:00
|
|
|
|
|
|
|
/// Asynchronously get a video frame, triggering a EVT_FRAME_READY event when it's ready
|
|
|
|
/// @param n Frame number to get
|
2010-07-23 07:58:39 +02:00
|
|
|
void GetFrameAsync(int n);
|
2007-04-08 00:03:06 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Is there a video loaded?
|
2011-12-05 06:26:45 +01:00
|
|
|
bool IsLoaded() const { return !!videoProvider; }
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:17:54 +01:00
|
|
|
/// Get the file name of the currently open video, if any
|
|
|
|
wxString GetVideoName() const { return videoFile; }
|
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Is the video currently playing?
|
2011-12-05 06:26:45 +01:00
|
|
|
bool IsPlaying() const { return playback.IsRunning(); }
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Does the video file loaded have muxed subtitles that we can load?
|
2010-07-08 06:29:04 +02:00
|
|
|
bool HasSubtitles() const { return hasSubtitles; }
|
2010-05-19 02:44:37 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Get the width of the currently open video
|
2010-07-08 06:29:04 +02:00
|
|
|
int GetWidth() const;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Get the height of the currently open video
|
2010-07-08 06:29:04 +02:00
|
|
|
int GetHeight() const;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Get the length in frames of the currently open video
|
2011-12-05 06:26:45 +01:00
|
|
|
int GetLength() const;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Get the current frame number
|
2010-07-08 06:29:04 +02:00
|
|
|
int GetFrameN() const { return frame_n; }
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2012-03-12 01:07:09 +01:00
|
|
|
/// Get the actual aspect ratio from a predefined AR type
|
2010-07-08 06:29:04 +02:00
|
|
|
double GetARFromType(int type) const;
|
2011-12-06 01:18:04 +01:00
|
|
|
|
|
|
|
/// Override the aspect ratio of the currently loaded video
|
|
|
|
/// @param type Aspect ratio type from 0-4
|
|
|
|
/// @param value If type is 4 (custom), the aspect ratio to use
|
|
|
|
void SetAspectRatio(int type, double value=1.0);
|
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-30 00:59:22 +02:00
|
|
|
|
2012-03-12 01:07:09 +01:00
|
|
|
/// Get the current AR type
|
2010-07-08 06:29:04 +02:00
|
|
|
int GetAspectRatioType() const { return arType; }
|
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-30 00:59:22 +02:00
|
|
|
|
2011-12-06 01:18:04 +01:00
|
|
|
/// Get the current aspect ratio of the video
|
2010-07-08 06:29:04 +02:00
|
|
|
double GetAspectRatioValue() const { return arValue; }
|
2007-01-23 07:32:16 +01:00
|
|
|
|
2010-07-08 06:29:04 +02:00
|
|
|
/// @brief Open a new video
|
|
|
|
/// @param filename Video to open, or empty to close the current video
|
2007-01-21 07:30:19 +01:00
|
|
|
void SetVideo(const wxString &filename);
|
2010-08-26 20:38:37 +02:00
|
|
|
/// @brief Close and reopen the current video
|
|
|
|
void Reload();
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2010-07-08 06:29:04 +02:00
|
|
|
/// @brief Jump to the beginning of a frame
|
|
|
|
/// @param n Frame number to jump to
|
2007-01-21 07:30:19 +01:00
|
|
|
void JumpToFrame(int n);
|
2010-07-08 06:29:04 +02:00
|
|
|
/// @brief Jump to a time
|
|
|
|
/// @param ms Time to jump to in milliseconds
|
|
|
|
/// @param end Type of time
|
|
|
|
void JumpToTime(int ms, agi::vfr::Time end = agi::vfr::START);
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2010-07-08 06:29:04 +02:00
|
|
|
/// Starting playing the video
|
2007-01-21 07:30:19 +01:00
|
|
|
void Play();
|
2010-07-08 06:29:04 +02:00
|
|
|
/// Play the next frame then stop
|
2011-01-16 08:15:53 +01:00
|
|
|
void NextFrame();
|
2010-07-08 06:29:04 +02:00
|
|
|
/// Play the previous frame then stop
|
2011-01-16 08:15:53 +01:00
|
|
|
void PrevFrame();
|
2010-07-08 06:29:04 +02:00
|
|
|
/// Seek to the beginning of the current line, then play to the end of it
|
2007-01-21 07:30:19 +01:00
|
|
|
void PlayLine();
|
2010-07-08 06:29:04 +02:00
|
|
|
/// Stop playing
|
2007-01-21 07:30:19 +01:00
|
|
|
void Stop();
|
|
|
|
|
2010-12-07 20:09:21 +01:00
|
|
|
DEFINE_SIGNAL_ADDERS(Seek, AddSeekListener)
|
|
|
|
DEFINE_SIGNAL_ADDERS(VideoOpen, AddVideoOpenListener)
|
2010-12-31 22:03:18 +01:00
|
|
|
DEFINE_SIGNAL_ADDERS(KeyframesOpen, AddKeyframesListener)
|
|
|
|
DEFINE_SIGNAL_ADDERS(TimecodesOpen, AddTimecodesListener)
|
2010-12-07 20:09:28 +01:00
|
|
|
DEFINE_SIGNAL_ADDERS(ARChange, AddARChangeListener)
|
2010-12-07 20:09:21 +01:00
|
|
|
|
2010-07-08 06:29:04 +02:00
|
|
|
const std::vector<int>& GetKeyFrames() const { return keyFrames; };
|
|
|
|
wxString GetKeyFramesName() const { return keyFramesFilename; }
|
|
|
|
void LoadKeyframes(wxString filename);
|
|
|
|
void SaveKeyframes(wxString filename);
|
|
|
|
void CloseKeyframes();
|
|
|
|
bool OverKeyFramesLoaded() const { return !keyFramesFilename.empty(); }
|
|
|
|
bool KeyFramesLoaded() const { return !keyFrames.empty(); }
|
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-30 00:59:22 +02:00
|
|
|
|
2010-07-08 06:29:04 +02:00
|
|
|
wxString GetTimecodesName() const { return ovrTimecodeFile; }
|
|
|
|
void LoadTimecodes(wxString filename);
|
|
|
|
void SaveTimecodes(wxString filename);
|
|
|
|
void CloseTimecodes();
|
|
|
|
bool OverTimecodesLoaded() const { return ovrFPS.IsLoaded(); }
|
|
|
|
bool TimecodesLoaded() const { return videoFPS.IsLoaded() || ovrFPS.IsLoaded(); };
|
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-30 00:59:22 +02:00
|
|
|
|
2010-07-08 06:29:04 +02:00
|
|
|
const agi::vfr::Framerate& FPS() const { return ovrFPS.IsLoaded() ? ovrFPS : videoFPS; }
|
2012-10-09 17:04:38 +02:00
|
|
|
const agi::vfr::Framerate& VideoFPS() const { return videoFPS; }
|
2010-07-08 06:29:04 +02:00
|
|
|
|
|
|
|
int TimeAtFrame(int frame, agi::vfr::Time type = agi::vfr::EXACT) const;
|
|
|
|
int FrameAtTime(int time, agi::vfr::Time type = agi::vfr::EXACT) const;
|
2007-01-21 07:30:19 +01:00
|
|
|
|
|
|
|
static VideoContext *Get();
|
2010-08-27 03:01:35 +02:00
|
|
|
static void OnExit();
|
2007-01-21 07:30:19 +01:00
|
|
|
};
|