mirror of https://github.com/odrling/Aegisub
Added an early GUI for visual typesetting.
Originally committed to SVN as r771.
This commit is contained in:
parent
71b8e4b81f
commit
31c2cd5455
|
@ -128,7 +128,6 @@ void OptionsManager::LoadDefaults() {
|
||||||
SetInt(_T("Video Default Zoom"), 7);
|
SetInt(_T("Video Default Zoom"), 7);
|
||||||
SetInt(_T("Video Fast Jump Step"), 10);
|
SetInt(_T("Video Fast Jump Step"), 10);
|
||||||
SetText(_T("Video Screenshot Path"),_T("?video"));
|
SetText(_T("Video Screenshot Path"),_T("?video"));
|
||||||
SetBool(_T("Video Visual Realtime"),false);
|
|
||||||
SetModificationType(MOD_VIDEO);
|
SetModificationType(MOD_VIDEO);
|
||||||
SetBool(_T("Show keyframes on video slider"),true);
|
SetBool(_T("Show keyframes on video slider"),true);
|
||||||
|
|
||||||
|
@ -282,6 +281,8 @@ void OptionsManager::LoadDefaults() {
|
||||||
SetBool(_T("Audio Spectrum"),false);
|
SetBool(_T("Audio Spectrum"),false);
|
||||||
SetInt(_T("Audio Sample Rate"),0);
|
SetInt(_T("Audio Sample Rate"),0);
|
||||||
|
|
||||||
|
SetBool(_T("Video Visual Realtime"),false);
|
||||||
|
|
||||||
SetInt(_T("Timing processor key start before thres"),5);
|
SetInt(_T("Timing processor key start before thres"),5);
|
||||||
SetInt(_T("Timing processor key start after thres"),4);
|
SetInt(_T("Timing processor key start after thres"),4);
|
||||||
SetInt(_T("Timing processor key end before thres"),5);
|
SetInt(_T("Timing processor key end before thres"),5);
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include <wx/rawbmp.h>
|
#include <wx/rawbmp.h>
|
||||||
#include "video_box.h"
|
#include "video_box.h"
|
||||||
#include "video_display.h"
|
#include "video_display.h"
|
||||||
|
#include "video_display_visual.h"
|
||||||
#include "video_zoom.h"
|
#include "video_zoom.h"
|
||||||
#include "video_slider.h"
|
#include "video_slider.h"
|
||||||
#include "frame_main.h"
|
#include "frame_main.h"
|
||||||
|
@ -116,12 +117,30 @@ VideoBox::VideoBox(wxWindow *parent)
|
||||||
videoSlider->Display = videoDisplay;
|
videoSlider->Display = videoDisplay;
|
||||||
|
|
||||||
// Typesetting buttons
|
// Typesetting buttons
|
||||||
|
standard = new wxButton(videoPage,Video_Mode_Standard,_T("n"),wxDefaultPosition,wxSize(20,20));
|
||||||
|
standard->SetToolTip(_("Standard mode, double click sets position."));
|
||||||
|
drag = new wxButton(videoPage,Video_Mode_Drag,_T("d"),wxDefaultPosition,wxSize(20,20));
|
||||||
|
drag->SetToolTip(_("Drag subtitles."));
|
||||||
|
rotatez = new wxButton(videoPage,Video_Mode_Rotate_Z,_T("z"),wxDefaultPosition,wxSize(20,20));
|
||||||
|
rotatez->SetToolTip(_("Rotate subtitles on their Z axis."));
|
||||||
|
rotatexy = new wxButton(videoPage,Video_Mode_Rotate_XY,_T("x"),wxDefaultPosition,wxSize(20,20));
|
||||||
|
rotatexy->SetToolTip(_("Rotate subtitles on their X and Y axes."));
|
||||||
|
scale = new wxButton(videoPage,Video_Mode_Scale,_T("s"),wxDefaultPosition,wxSize(20,20));
|
||||||
|
scale->SetToolTip(_("Scale subtitles on X and Y axes."));
|
||||||
|
clip = new wxButton(videoPage,Video_Mode_Clip,_T("c"),wxDefaultPosition,wxSize(20,20));
|
||||||
|
clip->SetToolTip(_("Clip subtitles to a rectangle."));
|
||||||
|
realtime = new wxToggleButton(videoPage,Video_Mode_Realtime,_T("r"),wxDefaultPosition,wxSize(20,20));
|
||||||
|
realtime->SetToolTip(_("Toggle realtime display of changes."));
|
||||||
|
bool isRealtime = Options.AsBool(_T("Video Visual Realtime"));
|
||||||
|
realtime->SetValue(isRealtime);
|
||||||
wxSizer *typeSizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *typeSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
//typeSizer->Add(new wxButton(videoPage,-1,_T("a"),wxDefaultPosition,wxSize(20,20)),0,0,0);
|
typeSizer->Add(standard,0,0,0);
|
||||||
//typeSizer->Add(new wxButton(videoPage,-1,_T("b"),wxDefaultPosition,wxSize(20,20)),0,0,0);
|
typeSizer->Add(drag,0,0,0);
|
||||||
//typeSizer->Add(new wxButton(videoPage,-1,_T("c"),wxDefaultPosition,wxSize(20,20)),0,0,0);
|
typeSizer->Add(rotatez,0,0,0);
|
||||||
//typeSizer->Add(new wxButton(videoPage,-1,_T("d"),wxDefaultPosition,wxSize(20,20)),0,0,0);
|
typeSizer->Add(rotatexy,0,0,0);
|
||||||
//typeSizer->Add(new wxButton(videoPage,-1,_T("e"),wxDefaultPosition,wxSize(20,20)),0,0,0);
|
typeSizer->Add(scale,0,0,0);
|
||||||
|
typeSizer->Add(clip,0,wxBOTTOM,5);
|
||||||
|
typeSizer->Add(realtime,0,0,0);
|
||||||
typeSizer->AddStretchSpacer(1);
|
typeSizer->AddStretchSpacer(1);
|
||||||
|
|
||||||
// Top sizer
|
// Top sizer
|
||||||
|
@ -160,6 +179,14 @@ BEGIN_EVENT_TABLE(VideoBox, wxPanel)
|
||||||
EVT_BUTTON(Video_Stop, VideoBox::OnVideoStop)
|
EVT_BUTTON(Video_Stop, VideoBox::OnVideoStop)
|
||||||
EVT_TOGGLEBUTTON(Video_Auto_Scroll, VideoBox::OnVideoToggleScroll)
|
EVT_TOGGLEBUTTON(Video_Auto_Scroll, VideoBox::OnVideoToggleScroll)
|
||||||
|
|
||||||
|
EVT_BUTTON(Video_Mode_Standard, VideoBox::OnModeStandard)
|
||||||
|
EVT_BUTTON(Video_Mode_Drag, VideoBox::OnModeDrag)
|
||||||
|
EVT_BUTTON(Video_Mode_Rotate_Z, VideoBox::OnModeRotateZ)
|
||||||
|
EVT_BUTTON(Video_Mode_Rotate_XY, VideoBox::OnModeRotateXY)
|
||||||
|
EVT_BUTTON(Video_Mode_Scale, VideoBox::OnModeScale)
|
||||||
|
EVT_BUTTON(Video_Mode_Clip, VideoBox::OnModeClip)
|
||||||
|
EVT_TOGGLEBUTTON(Video_Mode_Realtime, VideoBox::OnToggleRealtime)
|
||||||
|
|
||||||
#if USE_FEXTRACKER == 1
|
#if USE_FEXTRACKER == 1
|
||||||
EVT_BUTTON(Video_Tracker_Menu, VideoBox::OnVideoTrackerMenu)
|
EVT_BUTTON(Video_Tracker_Menu, VideoBox::OnVideoTrackerMenu)
|
||||||
EVT_MENU(Video_Track_Points, VideoBox::OnVideoTrackPoints)
|
EVT_MENU(Video_Track_Points, VideoBox::OnVideoTrackPoints)
|
||||||
|
@ -207,6 +234,55 @@ void VideoBox::OnVideoToggleScroll(wxCommandEvent &event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////
|
||||||
|
// Standard mode
|
||||||
|
void VideoBox::OnModeStandard(wxCommandEvent &event) {
|
||||||
|
videoDisplay->visual->SetMode(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////
|
||||||
|
// Drag mode
|
||||||
|
void VideoBox::OnModeDrag(wxCommandEvent &event) {
|
||||||
|
videoDisplay->visual->SetMode(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////
|
||||||
|
// Rotate Z mode
|
||||||
|
void VideoBox::OnModeRotateZ(wxCommandEvent &event) {
|
||||||
|
videoDisplay->visual->SetMode(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////
|
||||||
|
// Rotate XY mode
|
||||||
|
void VideoBox::OnModeRotateXY(wxCommandEvent &event) {
|
||||||
|
videoDisplay->visual->SetMode(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////
|
||||||
|
// Scale mode
|
||||||
|
void VideoBox::OnModeScale(wxCommandEvent &event) {
|
||||||
|
videoDisplay->visual->SetMode(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////
|
||||||
|
// Clip mode
|
||||||
|
void VideoBox::OnModeClip(wxCommandEvent &event) {
|
||||||
|
videoDisplay->visual->SetMode(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////
|
||||||
|
// Realtime toggle
|
||||||
|
void VideoBox::OnToggleRealtime(wxCommandEvent &event) {
|
||||||
|
Options.SetBool(_T("Video Visual Realtime"),realtime->GetValue());
|
||||||
|
Options.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////// HERE BE DRAGONS //////////////////////////////
|
/////////////////////// HERE BE DRAGONS //////////////////////////////
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
///////////
|
///////////
|
||||||
// Headers
|
// Headers
|
||||||
#include <wx/wxprec.h>
|
#include <wx/wxprec.h>
|
||||||
|
#include <wx/tglbtn.h>
|
||||||
|
|
||||||
|
|
||||||
//////////////
|
//////////////
|
||||||
|
@ -55,11 +56,27 @@ class FrameMain;
|
||||||
// Video box class
|
// Video box class
|
||||||
class VideoBox : public wxPanel {
|
class VideoBox : public wxPanel {
|
||||||
private:
|
private:
|
||||||
|
wxButton *standard;
|
||||||
|
wxButton *drag;
|
||||||
|
wxButton *rotatez;
|
||||||
|
wxButton *rotatexy;
|
||||||
|
wxButton *scale;
|
||||||
|
wxButton *clip;
|
||||||
|
wxToggleButton *realtime;
|
||||||
|
|
||||||
void OnVideoPlay(wxCommandEvent &event);
|
void OnVideoPlay(wxCommandEvent &event);
|
||||||
void OnVideoPlayLine(wxCommandEvent &event);
|
void OnVideoPlayLine(wxCommandEvent &event);
|
||||||
void OnVideoStop(wxCommandEvent &event);
|
void OnVideoStop(wxCommandEvent &event);
|
||||||
void OnVideoToggleScroll(wxCommandEvent &event);
|
void OnVideoToggleScroll(wxCommandEvent &event);
|
||||||
|
|
||||||
|
void OnModeStandard(wxCommandEvent &event);
|
||||||
|
void OnModeDrag(wxCommandEvent &event);
|
||||||
|
void OnModeRotateZ(wxCommandEvent &event);
|
||||||
|
void OnModeRotateXY(wxCommandEvent &event);
|
||||||
|
void OnModeScale(wxCommandEvent &event);
|
||||||
|
void OnModeClip(wxCommandEvent &event);
|
||||||
|
void OnToggleRealtime(wxCommandEvent &event);
|
||||||
|
|
||||||
void OnVideoTrackerMenu(wxCommandEvent &event);
|
void OnVideoTrackerMenu(wxCommandEvent &event);
|
||||||
void OnVideoTrackPoints(wxCommandEvent &event);
|
void OnVideoTrackPoints(wxCommandEvent &event);
|
||||||
void OnVideoTrackPointAdd(wxCommandEvent &event);
|
void OnVideoTrackPointAdd(wxCommandEvent &event);
|
||||||
|
@ -111,7 +128,15 @@ enum {
|
||||||
Video_Track_Movement_MoveAfter,
|
Video_Track_Movement_MoveAfter,
|
||||||
Video_Track_Split_Line,
|
Video_Track_Split_Line,
|
||||||
Video_Track_Link_File,
|
Video_Track_Link_File,
|
||||||
Video_Track_Movement_Empty
|
Video_Track_Movement_Empty,
|
||||||
|
|
||||||
|
Video_Mode_Standard,
|
||||||
|
Video_Mode_Drag,
|
||||||
|
Video_Mode_Rotate_Z,
|
||||||
|
Video_Mode_Rotate_XY,
|
||||||
|
Video_Mode_Scale,
|
||||||
|
Video_Mode_Clip,
|
||||||
|
Video_Mode_Realtime
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -87,8 +87,6 @@ private:
|
||||||
double arValue;
|
double arValue;
|
||||||
int arType;
|
int arType;
|
||||||
|
|
||||||
VideoDisplayVisual *visual;
|
|
||||||
|
|
||||||
wxBitmap GetFrame(int n);
|
wxBitmap GetFrame(int n);
|
||||||
wxBitmap GetFrame() { return GetFrame(frame_n); };
|
wxBitmap GetFrame() { return GetFrame(frame_n); };
|
||||||
|
|
||||||
|
@ -114,6 +112,7 @@ public:
|
||||||
wxString GetKeyFramesName() { return keyFramesFilename; }
|
wxString GetKeyFramesName() { return keyFramesFilename; }
|
||||||
void SetKeyFramesName(wxString name) { keyFramesFilename = name; }
|
void SetKeyFramesName(wxString name) { keyFramesFilename = name; }
|
||||||
|
|
||||||
|
VideoDisplayVisual *visual;
|
||||||
VideoProvider *provider;
|
VideoProvider *provider;
|
||||||
VideoBox *box;
|
VideoBox *box;
|
||||||
|
|
||||||
|
|
|
@ -78,11 +78,12 @@ private:
|
||||||
|
|
||||||
void DrawTrackingOverlay(wxDC &dc);
|
void DrawTrackingOverlay(wxDC &dc);
|
||||||
void DrawOverlay();
|
void DrawOverlay();
|
||||||
void SetMode(int mode);
|
|
||||||
void OnMouseEvent(wxMouseEvent &event);
|
void OnMouseEvent(wxMouseEvent &event);
|
||||||
void OnKeyEvent(wxKeyEvent &event);
|
void OnKeyEvent(wxKeyEvent &event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
void SetMode(int mode);
|
||||||
|
|
||||||
VideoDisplayVisual(VideoDisplay *parent);
|
VideoDisplayVisual(VideoDisplay *parent);
|
||||||
~VideoDisplayVisual();
|
~VideoDisplayVisual();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue