From 6d4a56d3912f068f73644301380a64c948f87793 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 22 Jan 2012 05:59:23 +0000 Subject: [PATCH] Delete most of VideoBox's members VideoBox is down to one method so it doesn't actually need to be able to reference most of the stuff it constructs. Originally committed to SVN as r6331. --- aegisub/src/dialog_detached_video.cpp | 1 + aegisub/src/video_box.cpp | 24 ++++++++++++++---------- aegisub/src/video_box.h | 21 +-------------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/aegisub/src/dialog_detached_video.cpp b/aegisub/src/dialog_detached_video.cpp index 57d318e8b..c845da8d9 100644 --- a/aegisub/src/dialog_detached_video.cpp +++ b/aegisub/src/dialog_detached_video.cpp @@ -38,6 +38,7 @@ #ifndef AGI_PRE #include +#include #include /// Must be included last. #endif diff --git a/aegisub/src/video_box.cpp b/aegisub/src/video_box.cpp index aa2f91f65..fe322aaad 100644 --- a/aegisub/src/video_box.cpp +++ b/aegisub/src/video_box.cpp @@ -37,11 +37,19 @@ #include "config.h" #ifndef AGI_PRE -#include +#include +#include #include +#include +#include #include +#include +#include +#include #endif +#include "video_box.h" + #include "include/aegisub/context.h" #include "include/aegisub/toolbar.h" @@ -49,15 +57,12 @@ #include "ass_file.h" #include "command/command.h" #include "compat.h" -#include "help_button.h" #include "libresrc/libresrc.h" #include "main.h" #include "selection_controller.h" -#include "subs_grid.h" #include "toggle_bitmap.h" #include "tooltip_manager.h" #include "utils.h" -#include "video_box.h" #include "video_context.h" #include "video_display.h" #include "video_slider.h" @@ -75,7 +80,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) , context(context) { // Visual controls sub-toolbar - visualSubToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,wxTB_HORIZONTAL | wxTB_BOTTOM | wxTB_FLAT); + wxToolBar *visualSubToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,wxTB_HORIZONTAL | wxTB_BOTTOM | wxTB_FLAT); // Buttons wxSizer *videoBottomSizer = new wxBoxSizer(wxHORIZONTAL); @@ -85,7 +90,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) videoBottomSizer->Add(new ToggleBitmap(this, context, "video/opt/autoscroll", 24, "Video"), 0, wxTOP | wxLEFT | wxBOTTOM | wxALIGN_CENTER, 2); // Seek - videoSlider = new VideoSlider(this, context); + VideoSlider *videoSlider = new VideoSlider(this, context); videoSlider->SetToolTip(_("Seek video.")); // Position @@ -101,15 +106,15 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) for (int i = 1 ; i <= 24; ++i) { choices.Add(wxString::Format("%g%%", i * 12.5)); } - zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN); + wxComboBox *zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN); // Typesetting buttons - visualToolBar = toolbar::GetToolbar(this, "visual_tools", context, "Video", true); + wxToolBar *visualToolBar = toolbar::GetToolbar(this, "visual_tools", context, "Video", true); // Avoid ugly themed background on Vista and possibly also Win7 visualToolBar->SetBackgroundStyle(wxBG_STYLE_COLOUR); visualToolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - videoDisplay = new VideoDisplay(visualSubToolBar,isDetached,zoomBox,this,context); + VideoDisplay *videoDisplay = new VideoDisplay(visualSubToolBar, isDetached, zoomBox, this, context); // Top sizer // Detached and attached video needs different flags, see bugs #742 and #853 @@ -188,5 +193,4 @@ void VideoBox::UpdateTimeBoxes() { time - active_line->Start, time - active_line->End)); } - } diff --git a/aegisub/src/video_box.h b/aegisub/src/video_box.h index c55846c28..034de1b12 100644 --- a/aegisub/src/video_box.h +++ b/aegisub/src/video_box.h @@ -38,10 +38,6 @@ #include #include -#include -#include -#include -#include #endif #include @@ -50,10 +46,8 @@ namespace agi { struct Context; } class AssDialogue; -class ToggleBitmap; -class VideoDisplay; -class VideoSlider; class wxComboBox; +class wxTextCtrl; /// DOCME /// @class VideoBox @@ -65,7 +59,6 @@ class VideoBox : public wxPanel, private SelectionListener { agi::Context *context; ///< Project context wxTextCtrl *VideoPosition; ///< Current frame/time wxTextCtrl *VideoSubsPos; ///< Time relative to the active subtitle line - wxComboBox *zoomBox; /// Update VideoPosition and VideoSubsPos void UpdateTimeBoxes(); @@ -73,18 +66,6 @@ class VideoBox : public wxPanel, private SelectionListener { void OnSelectedSetChanged(Selection const&, Selection const&) { } void OnActiveLineChanged(AssDialogue*) { UpdateTimeBoxes(); } - /// DOCME - wxToolBar *visualToolBar; - - /// DOCME - wxToolBar *visualSubToolBar; - - /// DOCME - VideoDisplay *videoDisplay; - - /// DOCME - VideoSlider *videoSlider; - public: VideoBox(wxWindow *parent, bool isDetached, agi::Context *context); ~VideoBox();