summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer3/videowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer3/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer3/videowidget.cpp77
1 files changed, 16 insertions, 61 deletions
diff --git a/noncore/multimedia/opieplayer3/videowidget.cpp b/noncore/multimedia/opieplayer3/videowidget.cpp
index a28d47d..833ecb4 100644
--- a/noncore/multimedia/opieplayer3/videowidget.cpp
+++ b/noncore/multimedia/opieplayer3/videowidget.cpp
@@ -15,24 +15,12 @@ VideoWidget::VideoWidget( QWidget * parent, const char * name, WFlags f)
15 :QWidget(parent,name,f) 15 :QWidget(parent,name,f)
16{ 16{
17 m_xineLib = 0; 17 m_xineLib = 0;
18 18 m_scaleUp = false;
19 m_MainLayout = new QVBoxLayout(this); 19 m_MainLayout = new QVBoxLayout(this);
20 m_MainLayout->setAutoAdd(true); 20 m_MainLayout->setAutoAdd(true);
21 m_Videodisplay = new XineVideoWidget(this,"videodisp"); 21 m_Videodisplay = new XineVideoWidget(this,"videodisp");
22#if 0
23 m_PosSlider = new QSlider(QSlider::Horizontal,this);
24 m_PosSlider->setTickInterval(60);
25 connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int)));
26 connect(m_PosSlider,SIGNAL(sliderMoved(int)),this,SLOT(slotNewPos(int)));
27 connect(m_PosSlider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed()));
28 connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased()));
29#endif
30 connect(m_Videodisplay,SIGNAL(videoResized ( const QSize & )),this,SLOT(slot_Videoresized(const QSize&))); 22 connect(m_Videodisplay,SIGNAL(videoResized ( const QSize & )),this,SLOT(slot_Videoresized(const QSize&)));
31 connect(m_Videodisplay,SIGNAL(clicked()),this,SLOT(slotClicked())); 23 connect(m_Videodisplay,SIGNAL(clicked()),this,SLOT(slotClicked()));
32#if 0
33 m_pressed = false;
34 m_uppos=0;
35#endif
36} 24}
37 25
38VideoWidget::~VideoWidget() 26VideoWidget::~VideoWidget()
@@ -41,7 +29,6 @@ VideoWidget::~VideoWidget()
41 29
42void VideoWidget::slotClicked() 30void VideoWidget::slotClicked()
43{ 31{
44 odebug << "clicked " << oendl;
45 emit videoclicked(); 32 emit videoclicked();
46} 33}
47 34
@@ -49,38 +36,8 @@ void VideoWidget::closeEvent(QCloseEvent*e)
49{ 36{
50} 37}
51 38
52void VideoWidget::slotNewPos(int /*pos*/)
53{
54#if 0
55 if (!m_xineLib) return;
56 if (m_uppos==pos) return;
57 m_xineLib->seekTo(pos);
58#endif
59}
60
61void VideoWidget::sliderPressed()
62{
63#if 0
64 m_pressed = true;
65#endif
66}
67
68void VideoWidget::sliderReleased()
69{
70#if 0
71 m_pressed = false;
72#endif
73}
74
75void VideoWidget::fullScreen(bool /* how */) 39void VideoWidget::fullScreen(bool /* how */)
76{ 40{
77#if 0
78 if (how) {
79 m_PosSlider->hide();
80 } else {
81 m_PosSlider->show();
82 }
83#endif
84} 41}
85 42
86int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib) 43int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
@@ -96,23 +53,16 @@ int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
96 return -1; 53 return -1;
97 } 54 }
98 connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped())); 55 connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped()));
99#if 0
100 m_uppos=0;
101 m_PosSlider->setValue(0);
102#endif
103 m_xineLib->setWidget(m_Videodisplay); 56 m_xineLib->setWidget(m_Videodisplay);
104 m_xineLib->setShowVideo(true); 57 m_xineLib->setShowVideo(true);
105 m_xineLib->resize(m_Videodisplay->size());
106 int res = m_xineLib->play(m_current.file()); 58 int res = m_xineLib->play(m_current.file());
59 vSize = m_xineLib->videoSize();
60 slot_Videoresized(m_Videodisplay->size());
107 odebug << "Xine play: " << res << oendl; 61 odebug << "Xine play: " << res << oendl;
108 if (res != 1) { 62 if (res != 1) {
109 return -2; 63 return -2;
110 } 64 }
111 return m_xineLib->length(); 65 return m_xineLib->length();
112#if 0
113 m_PosSlider->setRange(0,l);
114 m_PosSlider->setPageStep(l/10);
115#endif
116} 66}
117 67
118void VideoWidget::stopPlaying() 68void VideoWidget::stopPlaying()
@@ -124,22 +74,27 @@ void VideoWidget::stopPlaying()
124 74
125void VideoWidget::slotStopped() 75void VideoWidget::slotStopped()
126{ 76{
127// check fullscreen here!
128} 77}
129 78
130void VideoWidget::slot_Videoresized(const QSize&s) 79void VideoWidget::slot_Videoresized(const QSize&s)
131{ 80{
132 odebug << "Videoresized: " << s << oendl;
133 if (m_xineLib) { 81 if (m_xineLib) {
134 m_xineLib->resize(s); 82 if (vSize.width()<s.width()&&vSize.height()<s.height()&&!m_scaleUp) {
83 m_xineLib->resize(vSize);
84 } else {
85 m_xineLib->resize(s);
86 }
135 } 87 }
136} 88}
137 89
90void VideoWidget::scaleUp(bool how)
91{
92 if (how == m_scaleUp) return;
93 m_scaleUp = how;
94 slot_Videoresized(m_Videodisplay->size());
95 m_Videodisplay->repaint();
96}
97
138void VideoWidget::updatePos(int /*val*/) 98void VideoWidget::updatePos(int /*val*/)
139{ 99{
140#if 0
141 if (m_pressed) return;
142 m_uppos = val;
143 m_PosSlider->setValue(val);
144#endif
145} 100}