Make all of VideoBox's members private

Originally committed to SVN as r5846.
This commit is contained in:
Thomas Goyne 2011-11-12 01:23:29 +00:00
parent feb752c24c
commit 51149104d9
6 changed files with 12 additions and 20 deletions

View file

@ -69,7 +69,7 @@ DialogDetachedVideo::DialogDetachedVideo(agi::Context *context, const wxSize &in
// Video area; // Video area;
VideoBox *videoBox = new VideoBox(panel, true, context); VideoBox *videoBox = new VideoBox(panel, true, context);
videoBox->videoDisplay->SetMinClientSize(initialDisplaySize); context->videoDisplay->SetMinClientSize(initialDisplaySize);
videoBox->Layout(); videoBox->Layout();
// Set sizer // Set sizer
@ -79,7 +79,7 @@ DialogDetachedVideo::DialogDetachedVideo(agi::Context *context, const wxSize &in
mainSizer->SetSizeHints(this); mainSizer->SetSizeHints(this);
// Ensure we can grow smaller, without these the window is locked to at least the initial size // Ensure we can grow smaller, without these the window is locked to at least the initial size
videoBox->videoDisplay->SetMinSize(wxSize(1,1)); context->videoDisplay->SetMinSize(wxSize(1,1));
videoBox->SetMinSize(wxSize(1,1)); videoBox->SetMinSize(wxSize(1,1));
SetMinSize(wxSize(1,1)); SetMinSize(wxSize(1,1));

View file

@ -410,12 +410,12 @@ void FrameMain::OnVideoOpen() {
vidy = context->videoController->GetHeight(); vidy = context->videoController->GetHeight();
// Set zoom level based on video resolution and window size // Set zoom level based on video resolution and window size
double zoom = videoBox->videoDisplay->GetZoom(); double zoom = context->videoDisplay->GetZoom();
wxSize windowSize = GetSize(); wxSize windowSize = GetSize();
if (vidx*3*zoom > windowSize.GetX()*4 || vidy*4*zoom > windowSize.GetY()*6) if (vidx*3*zoom > windowSize.GetX()*4 || vidy*4*zoom > windowSize.GetY()*6)
videoBox->videoDisplay->SetZoom(zoom * .25); context->videoDisplay->SetZoom(zoom * .25);
else if (vidx*3*zoom > windowSize.GetX()*2 || vidy*4*zoom > windowSize.GetY()*3) else if (vidx*3*zoom > windowSize.GetX()*2 || vidy*4*zoom > windowSize.GetY()*3)
videoBox->videoDisplay->SetZoom(zoom * .5); context->videoDisplay->SetZoom(zoom * .5);
// Check that the video size matches the script video size specified // Check that the video size matches the script video size specified
int scriptx = context->ass->GetScriptInfoAsInt("PlayResX"); int scriptx = context->ass->GetScriptInfoAsInt("PlayResX");
@ -663,7 +663,7 @@ void FrameMain::OnSubtitlesOpen() {
double videoZoom = 0.; double videoZoom = 0.;
if (context->ass->GetScriptInfo("Video Zoom Percent").ToDouble(&videoZoom)) if (context->ass->GetScriptInfo("Video Zoom Percent").ToDouble(&videoZoom))
videoBox->videoDisplay->SetZoom(videoZoom); context->videoDisplay->SetZoom(videoZoom);
} }
} }

View file

@ -110,7 +110,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context)
visualToolBar->SetBackgroundStyle(wxBG_STYLE_COLOUR); visualToolBar->SetBackgroundStyle(wxBG_STYLE_COLOUR);
visualToolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); visualToolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
videoDisplay = new VideoDisplay(this,isDetached,zoomBox,this,context); videoDisplay = new VideoDisplay(visualSubToolBar,isDetached,zoomBox,this,context);
// Top sizer // Top sizer
// Detached and attached video needs different flags, see bugs #742 and #853 // Detached and attached video needs different flags, see bugs #742 and #853

View file

@ -75,7 +75,6 @@ class VideoBox : public wxPanel, private SelectionListener<AssDialogue> {
void OnSelectedSetChanged(Selection const&, Selection const&) { } void OnSelectedSetChanged(Selection const&, Selection const&) { }
void OnActiveLineChanged(AssDialogue*) { UpdateTimeBoxes(); } void OnActiveLineChanged(AssDialogue*) { UpdateTimeBoxes(); }
public:
/// DOCME /// DOCME
wxToolBar *visualToolBar; wxToolBar *visualToolBar;
@ -89,6 +88,7 @@ public:
/// DOCME /// DOCME
VideoSlider *videoSlider; VideoSlider *videoSlider;
public:
VideoBox(wxWindow *parent, bool isDetached, agi::Context *context); VideoBox(wxWindow *parent, bool isDetached, agi::Context *context);
~VideoBox(); ~VideoBox();
}; };

View file

@ -67,7 +67,6 @@
#include "threaded_frame_source.h" #include "threaded_frame_source.h"
#include "utils.h" #include "utils.h"
#include "video_out_gl.h" #include "video_out_gl.h"
#include "video_box.h"
#include "video_context.h" #include "video_context.h"
#include "visual_tool.h" #include "visual_tool.h"
@ -89,7 +88,7 @@ public:
#define E(cmd) cmd; if (GLenum err = glGetError()) throw OpenGlException(#cmd, err) #define E(cmd) cmd; if (GLenum err = glGetError()) throw OpenGlException(#cmd, err)
VideoDisplay::VideoDisplay( VideoDisplay::VideoDisplay(
VideoBox *box, wxToolBar *visualSubToolBar,
bool freeSize, bool freeSize,
wxComboBox *zoomBox, wxComboBox *zoomBox,
wxWindow* parent, wxWindow* parent,
@ -107,13 +106,10 @@ VideoDisplay::VideoDisplay(
, viewport_height(0) , viewport_height(0)
, zoomValue(OPT_GET("Video/Default Zoom")->GetInt() * .125 + .125) , zoomValue(OPT_GET("Video/Default Zoom")->GetInt() * .125 + .125)
, videoOut(new VideoOutGL()) , videoOut(new VideoOutGL())
, toolBar(box->visualSubToolBar) , toolBar(visualSubToolBar)
, zoomBox(zoomBox) , zoomBox(zoomBox)
, box(box)
, freeSize(freeSize) , freeSize(freeSize)
{ {
assert(box);
zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.)); zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.));
zoomBox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &VideoDisplay::SetZoomFromBox, this); zoomBox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &VideoDisplay::SetZoomFromBox, this);
@ -320,7 +316,7 @@ void VideoDisplay::UpdateSize(int arType, double arValue) {
SetMaxClientSize(size); SetMaxClientSize(size);
SetEvtHandlerEnabled(false); SetEvtHandlerEnabled(false);
box->GetParent()->Layout(); GetGrandParent()->Layout();
// The sizer makes us use the full width, which at very low zoom levels // The sizer makes us use the full width, which at very low zoom levels
// results in stretched video, so after using the sizer to update the // results in stretched video, so after using the sizer to update the

View file

@ -48,7 +48,6 @@
// Prototypes // Prototypes
class FrameReadyEvent; class FrameReadyEvent;
class VideoBox;
class VideoContext; class VideoContext;
class VideoOutGL; class VideoOutGL;
class VisualToolBase; class VisualToolBase;
@ -111,9 +110,6 @@ class VideoDisplay : public wxGLCanvas {
/// The dropdown box for selecting zoom levels /// The dropdown box for selecting zoom levels
wxComboBox *zoomBox; wxComboBox *zoomBox;
/// The VideoBox this display is contained in
VideoBox *box;
/// Whether the display can be freely resized by the user /// Whether the display can be freely resized by the user
bool freeSize; bool freeSize;
@ -149,7 +145,7 @@ class VideoDisplay : public wxGLCanvas {
public: public:
/// @brief Constructor /// @brief Constructor
VideoDisplay( VideoDisplay(
VideoBox *box, wxToolBar *visualSubToolBar,
bool isDetached, bool isDetached,
wxComboBox *zoomBox, wxComboBox *zoomBox,
wxWindow* parent, wxWindow* parent,