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.
|
|
|
|
//
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// AEGISUB
|
|
|
|
//
|
|
|
|
// Website: http://aegisub.cellosoft.com
|
|
|
|
// Contact: mailto:zeratul@cellosoft.com
|
|
|
|
//
|
|
|
|
|
|
|
|
|
2007-01-21 07:30:19 +01:00
|
|
|
#pragma once
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
///////////
|
|
|
|
// Headers
|
|
|
|
#include <wx/wxprec.h>
|
2006-05-10 02:33:44 +02:00
|
|
|
#ifdef __WINDOWS__
|
2006-01-16 22:02:54 +01:00
|
|
|
#include <windows.h>
|
2006-02-26 03:53:45 +01:00
|
|
|
#endif
|
2006-01-16 22:02:54 +01:00
|
|
|
#include <time.h>
|
2007-01-21 07:30:19 +01:00
|
|
|
#include "video_context.h"
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
//////////////
|
|
|
|
// Prototypes
|
|
|
|
class SubtitlesGrid;
|
|
|
|
class VideoSlider;
|
|
|
|
class AudioProvider;
|
|
|
|
class AudioDisplay;
|
|
|
|
class AssDialogue;
|
2006-01-22 13:44:53 +01:00
|
|
|
class VideoProvider;
|
2007-01-08 22:11:06 +01:00
|
|
|
class VideoDisplayVisual;
|
2007-01-11 04:53:20 +01:00
|
|
|
class VideoBox;
|
2007-01-08 22:11:06 +01:00
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
//////////////
|
|
|
|
// Main class
|
2007-01-21 07:30:19 +01:00
|
|
|
class VideoDisplay: public wxGLCanvas {
|
2006-01-16 22:02:54 +01:00
|
|
|
friend class AudioProvider;
|
2007-01-08 22:11:06 +01:00
|
|
|
friend class VideoDisplayVisual;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
wxSize origSize;
|
2007-01-21 07:30:19 +01:00
|
|
|
int w,h;
|
2007-01-23 07:32:16 +01:00
|
|
|
int dx1,dx2,dy1,dy2;
|
2007-01-23 21:50:41 +01:00
|
|
|
bool locked;
|
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);
|
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);
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
public:
|
2007-01-11 07:15:56 +01:00
|
|
|
VideoDisplayVisual *visual;
|
2007-01-11 04:53:20 +01:00
|
|
|
VideoBox *box;
|
2006-12-18 03:44:38 +01:00
|
|
|
|
2006-02-19 03:31:25 +01:00
|
|
|
double zoomValue;
|
2007-01-23 07:32:16 +01:00
|
|
|
bool freeSize;
|
2006-01-29 21:48:05 +01:00
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
VideoSlider *ControlSlider;
|
|
|
|
wxComboBox *zoomBox;
|
|
|
|
wxTextCtrl *PositionDisplay;
|
|
|
|
wxTextCtrl *SubsPosition;
|
|
|
|
|
|
|
|
VideoDisplay(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr);
|
|
|
|
~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-12-18 03:44:38 +01:00
|
|
|
void DrawText(wxPoint Pos, wxString Text);
|
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();
|
|
|
|
|
2006-01-19 11:33:56 +01:00
|
|
|
DECLARE_EVENT_TABLE()
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|
|
|
|
|