From 8ba149a7e693d16fb1ebcd6784bc3d77b1d10f40 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 24 Jul 2012 02:40:37 +0000 Subject: [PATCH] Actually save the video zoom to the subtitles file Originally committed to SVN as r6948. --- aegisub/src/video_display.cpp | 6 ++++++ aegisub/src/video_display.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 2941c8d87..fee55d989 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -115,6 +115,8 @@ VideoDisplay::VideoDisplay( slots.push_back(con->videoController->AddVideoOpenListener(&VideoDisplay::UpdateSize, this)); slots.push_back(con->videoController->AddARChangeListener(&VideoDisplay::UpdateSize, this)); + slots.push_back(con->ass->AddFileSaveListener(&VideoDisplay::OnSubtitlesSave, this)); + Bind(wxEVT_PAINT, std::tr1::bind(&VideoDisplay::Render, this)); Bind(wxEVT_SIZE, &VideoDisplay::OnSizeEvent, this); Bind(wxEVT_CONTEXT_MENU, &VideoDisplay::OnContextMenu, this); @@ -427,3 +429,7 @@ void VideoDisplay::Unload() { videoOut.reset(); tool.reset(); } + +void VideoDisplay::OnSubtitlesSave() { + con->ass->SetScriptInfo("Video Zoom Percent", wxString::Format("%g", zoomValue)); +} diff --git a/aegisub/src/video_display.h b/aegisub/src/video_display.h index 05b032a49..076bd2261 100644 --- a/aegisub/src/video_display.h +++ b/aegisub/src/video_display.h @@ -144,6 +144,8 @@ class VideoDisplay : public wxGLCanvas { void OnSizeEvent(wxSizeEvent &event); void OnContextMenu(wxContextMenuEvent&); + void OnSubtitlesSave(); + public: /// @brief Constructor VideoDisplay(