1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        VideoPropDlg.h
3 // Purpose:     The video properties dialog
4 // Author:      Alex Thuering
5 // Created:     09.09.2010
6 // RCS-ID:      $Id: VideoPropDlg.h,v 1.13 2014/09/27 06:00:25 ntalex Exp $
7 // Copyright:   (c) Alex Thuering
8 // Licence:     GPL
9 /////////////////////////////////////////////////////////////////////////////
10 #ifndef VIDEO_PROP_DLG_H
11 #define VIDEO_PROP_DLG_H
12 
13 #include "Pgc.h"
14 #include "mediactrl_ffmpeg.h"
15 
16 //(*Headers(VideoPropDlg)
17 #include <wx/sizer.h>
18 #include <wx/stattext.h>
19 #include <wx/textctrl.h>
20 #include <wx/checkbox.h>
21 #include <wx/spinctrl.h>
22 #include <wx/slider.h>
23 #include <wx/choice.h>
24 #include <wx/bmpbuttn.h>
25 #include <wx/gbsizer.h>
26 #include <wx/dialog.h>
27 #include <wx/spinbutt.h>
28 //*)
29 
30 class VideoPropDlg: public wxDialog {
31 public:
32 	/** Constructor */
33 	VideoPropDlg(wxWindow* parent, DVD* dvd, Vob* vob, AspectRatio aspectRatio);
34 	virtual ~VideoPropDlg();
35 
36     /** Displays dialog */
37 	virtual int ShowModal();
38 
39 	/** Returns selected video format */
40     VideoFormat GetVideoFormat();
41 
42 	/** Returns selected aspect ratio */
43     AspectRatio GetAspectRatio();
44 
45 private:
46 	//(*Declarations(VideoPropDlg)
47 	wxTextCtrl* m_filtersCtrl;
48 	wxStaticText* m_durText;
49 	wxCheckBox* m_keepAspectCtrl;
50 	wxChoice* m_interlacedChoice;
51 	wxSlider* m_slider;
52 	wxSpinButton* m_frameSpinBt;
53 	wxSpinCtrl* m_cropBottom;
54 	wxStaticBoxSizer* m_padBox;
55 	wxSpinCtrl* m_padLeft;
56 	wxSpinButton* m_startFrameSpin;
57 	wxTextCtrl* m_startCtrl;
58 	wxSpinCtrl* m_cropTop;
59 	MediaCtrlFF* m_mediaCtrl;
60 	wxSpinButton* m_endSpin;
61 	wxSpinCtrl* m_fadeOutCtrl;
62 	wxSpinCtrl* m_fadeInCtrl;
63 	wxChoice* m_dstChoice;
64 	wxTextCtrl* m_timeCtrl;
65 	wxBitmapButton* m_startBt;
66 	wxTextCtrl* m_endCtrl;
67 	wxStaticText* m_fileNameText;
68 	wxChoice* m_ffChoice;
69 	wxBitmapButton* m_endBt;
70 	wxChoice* m_aspectChoice;
71 	wxStaticBoxSizer* m_cropBox;
72 	wxSpinCtrl* m_padTop;
73 	wxSpinCtrl* m_padBottom;
74 	wxChoice* m_keepAspectChoice;
75 	wxStaticText* m_srcText;
76 	wxSpinButton* m_endFrameSpin;
77 	wxSpinCtrl* m_cropRight;
78 	wxSpinButton* m_timeSpinBt;
79 	wxSpinCtrl* m_cropLeft;
80 	wxSpinCtrl* m_padRight;
81 	wxSpinButton* m_startSpin;
82 	//*)
83 
84 	//(*Identifiers(VideoPropDlg)
85 	static const long ID_STATICTEXT2;
86 	static const long ID_STATICTEXT4;
87 	static const long ID_STATICTEXT3;
88 	static const long DST_CHOICE_ID;
89 	static const long ASPECT_CHOICE_ID;
90 	static const long INTERLACED_CHOICE_ID;
91 	static const long FF_CHOICE_ID;
92 	static const long KEEP_ASPECT_CB_ID;
93 	static const long KEEP_ASPECT_CHOICE_ID;
94 	static const long ID_SPINCTRL1;
95 	static const long ID_SPINCTRL4;
96 	static const long ID_SPINCTRL3;
97 	static const long ID_SPINCTRL2;
98 	static const long ID_SPINCTRL5;
99 	static const long ID_SPINCTRL6;
100 	static const long ID_SPINCTRL7;
101 	static const long ID_SPINCTRL8;
102 	static const long ID_SPINCTRL9;
103 	static const long ID_SPINCTRL10;
104 	static const long ID_TEXTCTRL1;
105 	static const long ID_CUSTOM1;
106 	static const long ID_SLIDER;
107 	static const long ID_TIME_CTRL;
108 	static const long ID_TIME_SPINB;
109 	static const long ID_FRAME_SPINBT;
110 	static const long ID_TEXTCTRL2;
111 	static const long ID_SPINBUTTON1;
112 	static const long ID_SPINBUTTON2;
113 	static const long START_BT_ID;
114 	static const long ID_TEXTCTRL3;
115 	static const long ID_SPINBUTTON3;
116 	static const long ID_SPINBUTTON4;
117 	static const long ID_RESET_TIME_BT;
118 	//*)
119 
120 	/** The DVD */
121 	DVD* m_dvd;
122 	Vob* m_vob;
123 	Stream* m_stream;
124 	AspectRatio m_aspectRatio;
125 	VideoFormat m_lastFormat;
126 	long m_videoPos;
127 	vector<int> GetPad();
128 	vector<int> GetCrop();
129 	void UpdatePadCrop();
130 	void SeekVideo(long pos, bool updateTimeCtrl = true);
131 	//(*Handlers(VideoPropDlg)
132 	void OnChangeFormat(wxCommandEvent& event);
133 	void OnChangeAspect(wxCommandEvent& event);
134 	void OnChangeKeepAspect(wxCommandEvent& event);
135 	void OnChangeBorder(wxSpinEvent& event);
136 	void OnChangeCrop(wxSpinEvent& event);
137 	void OnChangeTime(wxCommandEvent& event);
138 	void OnStartBt(wxCommandEvent& event);
139 	void OnEndBt(wxCommandEvent& event);
140 	void OnSliderScroll(wxScrollEvent& event);
141 	void OnTimeSpin(wxSpinEvent& event);
142 	void OnInterlaced(wxCommandEvent& event);
143 	void OnOkBt(wxCommandEvent& event);
144 	void OnFrameSpin(wxSpinEvent& event);
145 	void OnStartSpin(wxSpinEvent& event);
146 	void OnStartFrameSpin(wxSpinEvent& event);
147 	void OnEndSpin(wxSpinEvent& event);
148 	void OnEndFrameSpin(wxSpinEvent& event);
149 	void OnFrameSpinDown(wxSpinEvent& event);
150 	void OnStartFrameSpinDown(wxSpinEvent& event);
151 	void OnEndFrameSpinDown(wxSpinEvent& event);
152 	void OnStartSpinDown(wxSpinEvent& event);
153 	void OnEndSpinDown(wxSpinEvent& event);
154 	//*)
155 	DECLARE_EVENT_TABLE()
156 };
157 
158 #endif // VIDEO_PROP_DLG_H
159