Changes to how video controls are related.

Originally committed to SVN as r768.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-11 03:53:20 +00:00
parent 88a00fbdb0
commit 1e4a5b8050
5 changed files with 33 additions and 13 deletions

View file

@ -438,7 +438,7 @@ void FrameMain::InitContents() {
// Video area; // Video area;
videoBox = new VideoBox(Panel); videoBox = new VideoBox(Panel);
TopSizer->Add(videoBox->VideoSizer,0,wxEXPAND,0); TopSizer->Add(videoBox,0,wxEXPAND,0);
videoBox->videoDisplay->zoomBox = ZoomBox; videoBox->videoDisplay->zoomBox = ZoomBox;
// Subtitles area // Subtitles area
@ -764,7 +764,7 @@ void FrameMain::SetDisplayMode(int mode) {
} }
// Set display // Set display
TopSizer->Show(videoBox->VideoSizer,showVid,true); TopSizer->Show(videoBox,showVid,true);
ToolSizer->Show(audioBox,showAudio,true); ToolSizer->Show(audioBox,showAudio,true);
} }
@ -774,13 +774,10 @@ void FrameMain::SetDisplayMode(int mode) {
EditBox->SetSplitLineMode(); EditBox->SetSplitLineMode();
MainSizer->CalcMin(); MainSizer->CalcMin();
MainSizer->RecalcSizes(); MainSizer->RecalcSizes();
videoBox->VideoSizer->Layout(); //videoBox->VideoSizer->Layout();
MainSizer->Layout(); MainSizer->Layout();
Layout(); Layout();
Show(true); Show(true);
//int cw,ch;
//GetSize(&cw,&ch);
//SetSize(cw-1,ch-1);
Thaw(); Thaw();
} }

View file

@ -47,9 +47,11 @@
/////////////// ///////////////
// Constructor // Constructor
VideoBox::VideoBox(wxPanel *parent) { VideoBox::VideoBox(wxWindow *parent)
: wxPanel (parent,-1)
{
// Buttons // Buttons
videoPage = parent; videoPage = this;
wxBitmapButton *VideoPlayButton = new wxBitmapButton(videoPage,Video_Play,wxBITMAP(button_play),wxDefaultPosition,wxSize(25,-1)); wxBitmapButton *VideoPlayButton = new wxBitmapButton(videoPage,Video_Play,wxBITMAP(button_play),wxDefaultPosition,wxSize(25,-1));
VideoPlayButton->SetToolTip(_("Play video starting on this position")); VideoPlayButton->SetToolTip(_("Play video starting on this position"));
wxBitmapButton *VideoPlayLineButton = new wxBitmapButton(videoPage,Video_Play_Line,wxBITMAP(button_playline),wxDefaultPosition,wxSize(25,-1)); wxBitmapButton *VideoPlayLineButton = new wxBitmapButton(videoPage,Video_Play_Line,wxBITMAP(button_playline),wxDefaultPosition,wxSize(25,-1));
@ -82,11 +84,26 @@ VideoBox::VideoBox(wxPanel *parent) {
videoDisplay->ControlSlider = videoSlider; videoDisplay->ControlSlider = videoSlider;
videoDisplay->PositionDisplay = VideoPosition; videoDisplay->PositionDisplay = VideoPosition;
videoDisplay->SubsPosition = VideoSubsPos; videoDisplay->SubsPosition = VideoSubsPos;
videoDisplay->box = this;
videoDisplay->Reset(); videoDisplay->Reset();
// Set display // Set display
videoSlider->Display = videoDisplay; videoSlider->Display = videoDisplay;
// Typesetting buttons
wxSizer *typeSizer = new wxBoxSizer(wxVERTICAL);
typeSizer->Add(new wxButton(videoPage,-1,_T("a"),wxDefaultPosition,wxSize(20,20)),0,0,0);
typeSizer->Add(new wxButton(videoPage,-1,_T("b"),wxDefaultPosition,wxSize(20,20)),0,0,0);
typeSizer->Add(new wxButton(videoPage,-1,_T("c"),wxDefaultPosition,wxSize(20,20)),0,0,0);
typeSizer->Add(new wxButton(videoPage,-1,_T("d"),wxDefaultPosition,wxSize(20,20)),0,0,0);
typeSizer->Add(new wxButton(videoPage,-1,_T("e"),wxDefaultPosition,wxSize(20,20)),0,0,0);
typeSizer->AddStretchSpacer(1);
// Top sizer
wxSizer *topSizer = new wxBoxSizer(wxHORIZONTAL);
topSizer->Add(typeSizer,0,wxEXPAND,0);
topSizer->Add(videoDisplay,1,wxEXPAND,0);
// Sizers // Sizers
videoSliderSizer = new wxBoxSizer(wxHORIZONTAL); videoSliderSizer = new wxBoxSizer(wxHORIZONTAL);
videoSliderSizer->Add(videoSlider,1,wxEXPAND|wxLEFT,0); videoSliderSizer->Add(videoSlider,1,wxEXPAND|wxLEFT,0);
@ -101,7 +118,8 @@ VideoBox::VideoBox(wxPanel *parent) {
videoBottomSizer->Add(VideoPosition,1,wxLEFT|wxALIGN_CENTER,5); videoBottomSizer->Add(VideoPosition,1,wxLEFT|wxALIGN_CENTER,5);
videoBottomSizer->Add(VideoSubsPos,1,wxALIGN_CENTER,0); videoBottomSizer->Add(VideoSubsPos,1,wxALIGN_CENTER,0);
VideoSizer = new wxBoxSizer(wxVERTICAL); VideoSizer = new wxBoxSizer(wxVERTICAL);
VideoSizer->Add(videoDisplay,1,wxEXPAND,0); VideoSizer->Add(topSizer,1,wxEXPAND,0);
VideoSizer->Add(videoSliderSizer,0,wxEXPAND,0); VideoSizer->Add(videoSliderSizer,0,wxEXPAND,0);
VideoSizer->Add(videoBottomSizer,0,wxEXPAND,0); VideoSizer->Add(videoBottomSizer,0,wxEXPAND,0);
SetSizer(VideoSizer);
} }

View file

@ -53,19 +53,19 @@ class ToggleBitmap;
/////////////////// ///////////////////
// Video box class // Video box class
class VideoBox { class VideoBox : public wxPanel {
public: public:
ToggleBitmap *AutoScroll; ToggleBitmap *AutoScroll;
wxBoxSizer *VideoSizer; wxBoxSizer *VideoSizer;
wxBoxSizer *videoSliderSizer; wxBoxSizer *videoSliderSizer;
wxPanel *videoPage; wxWindow *videoPage;
wxTextCtrl *VideoPosition; wxTextCtrl *VideoPosition;
wxTextCtrl *VideoSubsPos; wxTextCtrl *VideoSubsPos;
VideoDisplay *videoDisplay; VideoDisplay *videoDisplay;
VideoSlider *videoSlider; VideoSlider *videoSlider;
//VideoZoomSlider *zoomSlider; //VideoZoomSlider *zoomSlider;
VideoBox (wxPanel *parent); VideoBox (wxWindow *parent);
}; };

View file

@ -59,6 +59,7 @@
#include "audio_display.h" #include "audio_display.h"
#include "main.h" #include "main.h"
#include "video_slider.h" #include "video_slider.h"
#include "video_box.h"
#if USE_FEXTRACKER == 1 #if USE_FEXTRACKER == 1
#include "../FexTrackerSource/FexTracker.h" #include "../FexTrackerSource/FexTracker.h"
#include "../FexTrackerSource/FexTrackingFeature.h" #include "../FexTrackerSource/FexTrackingFeature.h"
@ -136,6 +137,8 @@ void VideoDisplay::UpdateSize() {
int _w,_h; int _w,_h;
GetSize(&_w,&_h); GetSize(&_w,&_h);
SetSizeHints(_w,_h,_w,_h); SetSizeHints(_w,_h,_w,_h);
box->VideoSizer->Fit(box);
} }
} }
@ -375,7 +378,7 @@ void VideoDisplay::SetZoom(double value) {
provider->SetZoom(value); provider->SetZoom(value);
UpdateSize(); UpdateSize();
RefreshVideo(); RefreshVideo();
GetParent()->Layout(); box->GetParent()->Layout();
} }
} }

View file

@ -56,6 +56,7 @@ class AudioDisplay;
class AssDialogue; class AssDialogue;
class VideoProvider; class VideoProvider;
class VideoDisplayVisual; class VideoDisplayVisual;
class VideoBox;
////////////// //////////////
@ -114,6 +115,7 @@ public:
void SetKeyFramesName(wxString name) { keyFramesFilename = name; } void SetKeyFramesName(wxString name) { keyFramesFilename = name; }
VideoProvider *provider; VideoProvider *provider;
VideoBox *box;
SubtitlesGrid *grid; SubtitlesGrid *grid;
wxString videoName; wxString videoName;