forked from mia/Aegisub
Overscan mask fully implemented. Toggleable via video menu.
Originally committed to SVN as r1310.
This commit is contained in:
parent
4d4cbe1fcc
commit
2f911574d6
5 changed files with 20 additions and 2 deletions
|
@ -392,6 +392,7 @@ void FrameMain::InitMenu() {
|
|||
AspectMenu->AppendCheckItem(Menu_Video_AR_235, _("&Cinematic (2.35)"), _("Forces video to 2.35 aspect ratio"));
|
||||
AspectMenu->AppendCheckItem(Menu_Video_AR_Custom, _("Custom..."), _("Forces video to a custom aspect ratio"));
|
||||
videoMenu->Append(AspectParent);
|
||||
videoMenu->AppendCheckItem(Menu_Video_Overscan, _("Show overscan mask"), _("Show a mask over the video, indicating areas that might get cropped off by overscan on televisions."));
|
||||
videoMenu->AppendSeparator();
|
||||
AppendBitmapMenuItem(videoMenu,Menu_Video_JumpTo, _("&Jump To...\t") + Hotkeys.GetText(_T("Video Jump")), _("Jump to frame or time"), wxBITMAP(jumpto_button));
|
||||
AppendBitmapMenuItem(videoMenu,Menu_Subs_Snap_Video_To_Start, _("Jump video to start\t") + Hotkeys.GetText(_T("Jump Video To Start")), _("Jumps the video to the start frame of current subtitle"), wxBITMAP(video_to_substart));
|
||||
|
|
|
@ -161,6 +161,7 @@ private:
|
|||
void OnSetARCustom (wxCommandEvent &event);
|
||||
void OnDetachVideo (wxCommandEvent &event);
|
||||
void OnDummyVideo (wxCommandEvent &event);
|
||||
void OnOverscan (wxCommandEvent &event);
|
||||
|
||||
void OnOpenAudio (wxCommandEvent &event);
|
||||
void OnOpenAudioFromVideo (wxCommandEvent &event);
|
||||
|
@ -320,6 +321,7 @@ enum {
|
|||
Menu_Video_Play,
|
||||
Menu_Video_Detach,
|
||||
Menu_Video_Dummy,
|
||||
Menu_Video_Overscan,
|
||||
|
||||
Menu_Audio_Open_File,
|
||||
Menu_Audio_Open_From_Video,
|
||||
|
|
|
@ -135,6 +135,7 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame)
|
|||
EVT_MENU(Menu_Video_Select_Visible, FrameMain::OnSelectVisible)
|
||||
EVT_MENU(Menu_Video_Detach, FrameMain::OnDetachVideo)
|
||||
EVT_MENU(Menu_Video_Dummy, FrameMain::OnDummyVideo)
|
||||
EVT_MENU(Menu_Video_Overscan, FrameMain::OnOverscan)
|
||||
|
||||
EVT_MENU(Menu_Audio_Open_File, FrameMain::OnOpenAudio)
|
||||
EVT_MENU(Menu_Audio_Open_From_Video, FrameMain::OnOpenAudioFromVideo)
|
||||
|
@ -319,6 +320,9 @@ void FrameMain::OnMenuOpen (wxMenuEvent &event) {
|
|||
case 4: MenuBar->Check(Menu_Video_AR_Custom,true); break;
|
||||
}
|
||||
|
||||
// Set overscan mask
|
||||
MenuBar->Check(Menu_Video_Overscan,Options.AsBool(_T("Show Overscan Mask")));
|
||||
|
||||
// Rebuild recent lists
|
||||
RebuildRecentList(_T("Recent vid"),RecentVids,Menu_Video_Recent);
|
||||
RebuildRecentList(_T("Recent timecodes"),RecentTimecodes,Menu_Timecodes_Recent);
|
||||
|
@ -816,6 +820,16 @@ void FrameMain::OnDummyVideo (wxCommandEvent &event) {
|
|||
}
|
||||
|
||||
|
||||
///////////////////
|
||||
// Overscan toggle
|
||||
void FrameMain::OnOverscan (wxCommandEvent &event) {
|
||||
Options.SetBool(_T("Show overscan mask"),event.IsChecked());
|
||||
Options.Save();
|
||||
VideoContext::Get()->Stop();
|
||||
videoBox->videoDisplay->Render();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////
|
||||
// Open jump to dialog
|
||||
void FrameMain::OnJumpTo(wxCommandEvent& WXUNUSED(event)) {
|
||||
|
|
|
@ -144,6 +144,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults) {
|
|||
SetText(_T("Video Screenshot Path"),_T("?video"));
|
||||
SetModificationType(MOD_VIDEO);
|
||||
SetBool(_T("Show keyframes on video slider"),true);
|
||||
SetBool(_T("Show overscan mask"),false);
|
||||
|
||||
// Video Provider (Advanced)
|
||||
SetModificationType(MOD_VIDEO_RELOAD);
|
||||
|
|
|
@ -292,7 +292,7 @@ void VideoDisplay::DrawTVEffects() {
|
|||
int sw,sh;
|
||||
VideoContext *context = VideoContext::Get();
|
||||
context->GetScriptSize(sw,sh);
|
||||
bool drawOverscan = false;
|
||||
bool drawOverscan = Options.AsBool(_T("Show Overscan Mask"));
|
||||
|
||||
// Draw overscan mask
|
||||
if (drawOverscan) {
|
||||
|
@ -310,7 +310,7 @@ void VideoDisplay::DrawOverscanMask(int sizeH,int sizeV,wxColour colour,double a
|
|||
int sw,sh;
|
||||
VideoContext *context = VideoContext::Get();
|
||||
context->GetScriptSize(sw,sh);
|
||||
int rad1 = 24;
|
||||
int rad1 = int(sh * 0.05);
|
||||
int gapH = sizeH+rad1;
|
||||
int gapV = sizeV+rad1;
|
||||
int rad2 = (int)sqrt(double(gapH*gapH + gapV*gapV))+1;
|
||||
|
|
Loading…
Reference in a new issue