2007-01-08 22:11:06 +01:00
|
|
|
// Copyright (c) 2005-2007, Rodrigo Braz Monteiro
|
2006-01-16 22:02:54 +01:00
|
|
|
// 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/
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file video_display.h
|
|
|
|
/// @see video_display.cpp
|
|
|
|
/// @ingroup video main_ui
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
2007-06-19 06:14:25 +02:00
|
|
|
#include <wx/glcanvas.h>
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/combobox.h>
|
2009-09-10 12:26:50 +02:00
|
|
|
#include <wx/textctrl.h>
|
2009-10-13 19:28:39 +02:00
|
|
|
#include <memory>
|
2009-09-11 04:36:34 +02:00
|
|
|
#endif
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Prototypes
|
|
|
|
class VideoSlider;
|
2007-07-01 02:19:55 +02:00
|
|
|
class VisualTool;
|
2007-01-11 04:53:20 +01:00
|
|
|
class VideoBox;
|
2009-10-05 06:22:28 +02:00
|
|
|
class VideoOutGL;
|
2007-01-08 22:11:06 +01:00
|
|
|
|
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
|
|
|
/// DOCME
|
|
|
|
/// @class VideoDisplay
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2007-01-21 07:30:19 +01:00
|
|
|
class VideoDisplay: public wxGLCanvas {
|
2006-01-16 22:02:54 +01:00
|
|
|
private:
|
2009-09-10 03:41:34 +02:00
|
|
|
/// The current visual typesetting mode
|
2007-07-01 02:19:55 +02:00
|
|
|
int visualMode;
|
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
/// The unscaled size of the displayed video
|
2006-01-16 22:02:54 +01:00
|
|
|
wxSize origSize;
|
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
|
|
|
|
2009-10-05 06:22:28 +02:00
|
|
|
/// The frame number currently being displayed
|
|
|
|
int currentFrame;
|
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
/// The width of the display
|
|
|
|
int w;
|
|
|
|
/// The height of the display
|
|
|
|
int h;
|
|
|
|
|
2010-01-24 20:05:20 +01:00
|
|
|
/// The x-coordinate of the bottom left of the area containing video.
|
2009-09-10 03:41:34 +02:00
|
|
|
/// Always zero unless the display is detatched and is wider than the video.
|
|
|
|
int dx1;
|
2010-01-24 20:05:20 +01:00
|
|
|
/// The width of the screen area containing video
|
2009-09-10 03:41:34 +02:00
|
|
|
int dx2;
|
2010-01-24 20:05:20 +01:00
|
|
|
/// The y-coordinate of the bottom left of the area containing video.
|
2009-09-10 03:41:34 +02:00
|
|
|
/// Always zero unless the display is detatched and is taller than the video.
|
|
|
|
int dy1;
|
2010-01-24 20:05:20 +01:00
|
|
|
/// The height of the screen area containing video
|
2009-09-10 03:41:34 +02:00
|
|
|
int dy2;
|
|
|
|
|
|
|
|
/// The x position of the mouse
|
|
|
|
int mouse_x;
|
|
|
|
/// The y position of the mouse
|
|
|
|
int mouse_y;
|
|
|
|
|
|
|
|
/// Lock to disable mouse updates during resize operations
|
2007-01-23 21:50:41 +01:00
|
|
|
bool locked;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2007-06-28 22:29:56 +02:00
|
|
|
void DrawTVEffects();
|
|
|
|
void DrawOverscanMask(int sizeH,int sizeV,wxColour color,double alpha=0.5);
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2007-01-09 02:52:30 +01:00
|
|
|
void OnKey(wxKeyEvent &event);
|
2007-05-28 20:45:57 +02:00
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
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
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
/// @brief NOP event handler
|
|
|
|
/// @param event Unused
|
2007-01-21 07:30:19 +01:00
|
|
|
void OnEraseBackground(wxEraseEvent &event) {}
|
2007-01-23 05:42:08 +01:00
|
|
|
void OnSizeEvent(wxSizeEvent &event);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2007-04-08 00:03:06 +02:00
|
|
|
void OnCopyCoords(wxCommandEvent &event);
|
|
|
|
void OnCopyToClipboard(wxCommandEvent &event);
|
|
|
|
void OnSaveSnapshot(wxCommandEvent &event);
|
|
|
|
void OnCopyToClipboardRaw(wxCommandEvent &event);
|
|
|
|
void OnSaveSnapshotRaw(wxCommandEvent &event);
|
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
/// The current zoom level, where 1.0 = 100%
|
|
|
|
double zoomValue;
|
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
|
|
|
|
2009-10-05 06:22:28 +02:00
|
|
|
/// The video position slider
|
|
|
|
VideoSlider *ControlSlider;
|
|
|
|
|
|
|
|
/// The display for the the video position relative to the current subtitle line
|
|
|
|
wxTextCtrl *SubsPosition;
|
|
|
|
|
|
|
|
/// The display for the absolute time of the video position
|
|
|
|
wxTextCtrl *PositionDisplay;
|
2006-12-18 03:44:38 +01:00
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
/// The current visual typesetting tool
|
|
|
|
VisualTool *visual;
|
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
|
|
|
|
2009-10-05 06:22:28 +02:00
|
|
|
/// The video renderer
|
2009-10-13 19:28:39 +02:00
|
|
|
std::auto_ptr<VideoOutGL> videoOut;
|
2006-01-29 21:48:05 +01:00
|
|
|
|
2009-10-05 06:22:28 +02:00
|
|
|
public:
|
|
|
|
/// The VideoBox this display is contained in
|
|
|
|
VideoBox *box;
|
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
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
/// The dropdown box for selecting zoom levels
|
2006-01-16 22:02:54 +01:00
|
|
|
wxComboBox *zoomBox;
|
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
|
|
|
|
2009-10-05 06:22:28 +02:00
|
|
|
/// Whether the display can be freely resized by the user
|
|
|
|
bool freeSize;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2009-10-05 06:22:28 +02:00
|
|
|
VideoDisplay(VideoBox *box, VideoSlider *ControlSlider, wxTextCtrl *PositionDisplay, wxTextCtrl *SubsPosition, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr);
|
2006-01-16 22:02:54 +01:00
|
|
|
~VideoDisplay();
|
|
|
|
void Reset();
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2009-10-05 06:22:28 +02:00
|
|
|
void SetFrame(int frameNumber);
|
|
|
|
int GetFrame() const { return currentFrame; }
|
|
|
|
void SetFrameRange(int from, int to);
|
|
|
|
|
2009-10-27 15:27:39 +01:00
|
|
|
void Render();
|
2007-01-21 07:30:19 +01:00
|
|
|
|
2007-04-18 06:51:17 +02:00
|
|
|
void ShowCursor(bool show);
|
2007-01-23 07:32:16 +01:00
|
|
|
void ConvertMouseCoords(int &x,int &y);
|
2007-01-21 07:30:19 +01:00
|
|
|
void UpdateSize();
|
2010-05-01 03:07:05 +02:00
|
|
|
/// @brief Set the zoom level
|
|
|
|
/// @param value The new zoom level
|
2006-01-22 13:44:53 +01:00
|
|
|
void SetZoom(double value);
|
2010-05-01 03:07:05 +02:00
|
|
|
/// @brief Set the zoom level to that indicated by the dropdown
|
|
|
|
void SetZoomFromBox();
|
|
|
|
/// @brief Get the current zoom level
|
|
|
|
double GetZoom();
|
2009-10-05 06:22:28 +02:00
|
|
|
void SetVisualMode(int mode, bool render = false);
|
|
|
|
|
|
|
|
void OnSubTool(wxCommandEvent &event);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2006-01-19 11:33:56 +01:00
|
|
|
DECLARE_EVENT_TABLE()
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|