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;
VideoBox *videoBox = new VideoBox(panel, true, context);
videoBox->videoDisplay->SetMinClientSize(initialDisplaySize);
context->videoDisplay->SetMinClientSize(initialDisplaySize);
videoBox->Layout();
// Set sizer
@ -79,7 +79,7 @@ DialogDetachedVideo::DialogDetachedVideo(agi::Context *context, const wxSize &in
mainSizer->SetSizeHints(this);
// 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));
SetMinSize(wxSize(1,1));

View file

@ -410,12 +410,12 @@ void FrameMain::OnVideoOpen() {
vidy = context->videoController->GetHeight();
// Set zoom level based on video resolution and window size
double zoom = videoBox->videoDisplay->GetZoom();
double zoom = context->videoDisplay->GetZoom();
wxSize windowSize = GetSize();
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)
videoBox->videoDisplay->SetZoom(zoom * .5);
context->videoDisplay->SetZoom(zoom * .5);
// Check that the video size matches the script video size specified
int scriptx = context->ass->GetScriptInfoAsInt("PlayResX");
@ -663,7 +663,7 @@ void FrameMain::OnSubtitlesOpen() {
double videoZoom = 0.;
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->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
videoDisplay = new VideoDisplay(this,isDetached,zoomBox,this,context);
videoDisplay = new VideoDisplay(visualSubToolBar,isDetached,zoomBox,this,context);
// Top sizer
// 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 OnActiveLineChanged(AssDialogue*) { UpdateTimeBoxes(); }
public:
/// DOCME
wxToolBar *visualToolBar;
@ -89,6 +88,7 @@ public:
/// DOCME
VideoSlider *videoSlider;
public:
VideoBox(wxWindow *parent, bool isDetached, agi::Context *context);
~VideoBox();
};

View file

@ -67,7 +67,6 @@
#include "threaded_frame_source.h"
#include "utils.h"
#include "video_out_gl.h"
#include "video_box.h"
#include "video_context.h"
#include "visual_tool.h"
@ -89,7 +88,7 @@ public:
#define E(cmd) cmd; if (GLenum err = glGetError()) throw OpenGlException(#cmd, err)
VideoDisplay::VideoDisplay(
VideoBox *box,
wxToolBar *visualSubToolBar,
bool freeSize,
wxComboBox *zoomBox,
wxWindow* parent,
@ -107,13 +106,10 @@ VideoDisplay::VideoDisplay(
, viewport_height(0)
, zoomValue(OPT_GET("Video/Default Zoom")->GetInt() * .125 + .125)
, videoOut(new VideoOutGL())
, toolBar(box->visualSubToolBar)
, toolBar(visualSubToolBar)
, zoomBox(zoomBox)
, box(box)
, freeSize(freeSize)
{
assert(box);
zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.));
zoomBox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &VideoDisplay::SetZoomFromBox, this);
@ -320,7 +316,7 @@ void VideoDisplay::UpdateSize(int arType, double arValue) {
SetMaxClientSize(size);
SetEvtHandlerEnabled(false);
box->GetParent()->Layout();
GetGrandParent()->Layout();
// 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

View file

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