summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer3/videowidget.cpp
Side-by-side diff
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
@@ -17,3 +17,3 @@ VideoWidget::VideoWidget( QWidget * parent, const char * name, WFlags f)
m_xineLib = 0;
-
+ m_scaleUp = false;
m_MainLayout = new QVBoxLayout(this);
@@ -21,16 +21,4 @@ VideoWidget::VideoWidget( QWidget * parent, const char * name, WFlags f)
m_Videodisplay = new XineVideoWidget(this,"videodisp");
-#if 0
- m_PosSlider = new QSlider(QSlider::Horizontal,this);
- m_PosSlider->setTickInterval(60);
- connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int)));
- connect(m_PosSlider,SIGNAL(sliderMoved(int)),this,SLOT(slotNewPos(int)));
- connect(m_PosSlider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed()));
- connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased()));
-#endif
connect(m_Videodisplay,SIGNAL(videoResized ( const QSize & )),this,SLOT(slot_Videoresized(const QSize&)));
connect(m_Videodisplay,SIGNAL(clicked()),this,SLOT(slotClicked()));
-#if 0
- m_pressed = false;
- m_uppos=0;
-#endif
}
@@ -43,3 +31,2 @@ void VideoWidget::slotClicked()
{
- odebug << "clicked " << oendl;
emit videoclicked();
@@ -51,34 +38,4 @@ void VideoWidget::closeEvent(QCloseEvent*e)
-void VideoWidget::slotNewPos(int /*pos*/)
-{
-#if 0
- if (!m_xineLib) return;
- if (m_uppos==pos) return;
- m_xineLib->seekTo(pos);
-#endif
-}
-
-void VideoWidget::sliderPressed()
-{
-#if 0
- m_pressed = true;
-#endif
-}
-
-void VideoWidget::sliderReleased()
-{
-#if 0
- m_pressed = false;
-#endif
-}
-
void VideoWidget::fullScreen(bool /* how */)
{
-#if 0
- if (how) {
- m_PosSlider->hide();
- } else {
- m_PosSlider->show();
- }
-#endif
}
@@ -98,10 +55,7 @@ int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped()));
-#if 0
- m_uppos=0;
- m_PosSlider->setValue(0);
-#endif
m_xineLib->setWidget(m_Videodisplay);
m_xineLib->setShowVideo(true);
- m_xineLib->resize(m_Videodisplay->size());
int res = m_xineLib->play(m_current.file());
+ vSize = m_xineLib->videoSize();
+ slot_Videoresized(m_Videodisplay->size());
odebug << "Xine play: " << res << oendl;
@@ -111,6 +65,2 @@ int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
return m_xineLib->length();
-#if 0
- m_PosSlider->setRange(0,l);
- m_PosSlider->setPageStep(l/10);
-#endif
}
@@ -126,3 +76,2 @@ void VideoWidget::slotStopped()
{
-// check fullscreen here!
}
@@ -131,5 +80,8 @@ void VideoWidget::slot_Videoresized(const QSize&s)
{
- odebug << "Videoresized: " << s << oendl;
if (m_xineLib) {
- m_xineLib->resize(s);
+ if (vSize.width()<s.width()&&vSize.height()<s.height()&&!m_scaleUp) {
+ m_xineLib->resize(vSize);
+ } else {
+ m_xineLib->resize(s);
+ }
}
@@ -137,9 +89,12 @@ void VideoWidget::slot_Videoresized(const QSize&s)
+void VideoWidget::scaleUp(bool how)
+{
+ if (how == m_scaleUp) return;
+ m_scaleUp = how;
+ slot_Videoresized(m_Videodisplay->size());
+ m_Videodisplay->repaint();
+}
+
void VideoWidget::updatePos(int /*val*/)
{
-#if 0
- if (m_pressed) return;
- m_uppos = val;
- m_PosSlider->setValue(val);
-#endif
}