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
|
|
|
|
2007-01-21 07:30:19 +01:00
|
|
|
#pragma once
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
#include <wx/wxprec.h>
|
2007-06-19 06:14:25 +02:00
|
|
|
#include <wx/glcanvas.h>
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/combobox.h>
|
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;
|
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-09-10 03:41:34 +02:00
|
|
|
/// The width of the display
|
|
|
|
int w;
|
|
|
|
/// The height of the display
|
|
|
|
int h;
|
|
|
|
|
|
|
|
/// The x-coordinate of the top left of the area containing video.
|
|
|
|
/// Always zero unless the display is detatched and is wider than the video.
|
|
|
|
int dx1;
|
|
|
|
/// The x-coordinate of the bottom right of the area containing video.
|
|
|
|
/// Always equal to the width of the video unless the display is detatched and is wider than the video.
|
|
|
|
int dx2;
|
|
|
|
/// The y-coordinate of the top left of the area containing video.
|
|
|
|
/// Always zero unless the display is detatched and is taller than the video.
|
|
|
|
int dy1;
|
|
|
|
/// The y-coordinate of the bottom of the area containing video.
|
|
|
|
/// Always equal to the height of the video unless the display is detatched and is taller than the video.
|
|
|
|
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-09-10 03:41:34 +02:00
|
|
|
/// The VideoBox this display is contained in
|
2007-01-11 04:53:20 +01:00
|
|
|
VideoBox *box;
|
2006-12-18 03:44:38 +01:00
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
public:
|
|
|
|
/// 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-09-10 03:41:34 +02:00
|
|
|
/// Whether the display can be freely resized by the user
|
2007-01-23 07:32:16 +01:00
|
|
|
bool freeSize;
|
2006-01-29 21:48:05 +01:00
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
/// The video position slider; not used by VideoDisplay
|
2006-01-16 22:02:54 +01:00
|
|
|
VideoSlider *ControlSlider;
|
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-09-10 03:41:34 +02:00
|
|
|
/// The display for the absolute time of the video position
|
2006-01-16 22:02:54 +01:00
|
|
|
wxTextCtrl *PositionDisplay;
|
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 display for the the video position relative to the current subtitle line
|
2006-01-16 22:02:54 +01:00
|
|
|
wxTextCtrl *SubsPosition;
|
|
|
|
|
2009-09-10 03:41:34 +02:00
|
|
|
VideoDisplay(wxWindow* parent, wxWindowID id, VideoBox *box, 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
|
|
|
|
|
|
|
void Render();
|
|
|
|
|
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);
|
2006-01-16 22:02:54 +01:00
|
|
|
void UpdatePositionDisplay();
|
2007-01-21 07:30:19 +01:00
|
|
|
void UpdateSize();
|
2006-01-22 13:44:53 +01:00
|
|
|
void SetZoom(double value);
|
2006-01-16 22:02:54 +01:00
|
|
|
void SetZoomPos(int pos);
|
|
|
|
void UpdateSubsRelativeTime();
|
2007-07-01 02:19:55 +02:00
|
|
|
void SetVisualMode(int mode);
|
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
|
|
|
};
|