Diffstat (limited to 'noncore/multimedia/opieplayer3/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer3/videowidget.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer3/videowidget.cpp b/noncore/multimedia/opieplayer3/videowidget.cpp index c5c63c7..a28d47d 100644 --- a/noncore/multimedia/opieplayer3/videowidget.cpp +++ b/noncore/multimedia/opieplayer3/videowidget.cpp | |||
@@ -19,16 +19,20 @@ VideoWidget::VideoWidget( QWidget * parent, const char * name, WFlags f) | |||
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 | ||
22 | m_PosSlider = new QSlider(QSlider::Horizontal,this); | 23 | m_PosSlider = new QSlider(QSlider::Horizontal,this); |
23 | m_PosSlider->setTickInterval(60); | 24 | m_PosSlider->setTickInterval(60); |
24 | connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int))); | 25 | connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int))); |
25 | connect(m_PosSlider,SIGNAL(sliderMoved(int)),this,SLOT(slotNewPos(int))); | 26 | connect(m_PosSlider,SIGNAL(sliderMoved(int)),this,SLOT(slotNewPos(int))); |
26 | connect(m_PosSlider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed())); | 27 | connect(m_PosSlider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed())); |
27 | connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased())); | 28 | connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased())); |
29 | #endif | ||
28 | connect(m_Videodisplay,SIGNAL(videoResized ( const QSize & )),this,SLOT(slot_Videoresized(const QSize&))); | 30 | connect(m_Videodisplay,SIGNAL(videoResized ( const QSize & )),this,SLOT(slot_Videoresized(const QSize&))); |
29 | connect(m_Videodisplay,SIGNAL(clicked()),this,SLOT(slotClicked())); | 31 | connect(m_Videodisplay,SIGNAL(clicked()),this,SLOT(slotClicked())); |
32 | #if 0 | ||
30 | m_pressed = false; | 33 | m_pressed = false; |
31 | m_uppos=0; | 34 | m_uppos=0; |
35 | #endif | ||
32 | } | 36 | } |
33 | 37 | ||
34 | VideoWidget::~VideoWidget() | 38 | VideoWidget::~VideoWidget() |
@@ -45,53 +49,70 @@ void VideoWidget::closeEvent(QCloseEvent*e) | |||
45 | { | 49 | { |
46 | } | 50 | } |
47 | 51 | ||
48 | void VideoWidget::slotNewPos(int pos) | 52 | void VideoWidget::slotNewPos(int /*pos*/) |
49 | { | 53 | { |
54 | #if 0 | ||
50 | if (!m_xineLib) return; | 55 | if (!m_xineLib) return; |
51 | if (m_uppos==pos) return; | 56 | if (m_uppos==pos) return; |
52 | m_xineLib->seekTo(pos); | 57 | m_xineLib->seekTo(pos); |
58 | #endif | ||
53 | } | 59 | } |
54 | 60 | ||
55 | void VideoWidget::sliderPressed() | 61 | void VideoWidget::sliderPressed() |
56 | { | 62 | { |
63 | #if 0 | ||
57 | m_pressed = true; | 64 | m_pressed = true; |
65 | #endif | ||
58 | } | 66 | } |
59 | 67 | ||
60 | void VideoWidget::sliderReleased() | 68 | void VideoWidget::sliderReleased() |
61 | { | 69 | { |
70 | #if 0 | ||
62 | m_pressed = false; | 71 | m_pressed = false; |
72 | #endif | ||
63 | } | 73 | } |
64 | 74 | ||
65 | void VideoWidget::fullScreen(bool how) | 75 | void VideoWidget::fullScreen(bool /* how */) |
66 | { | 76 | { |
77 | #if 0 | ||
67 | if (how) { | 78 | if (how) { |
68 | m_PosSlider->hide(); | 79 | m_PosSlider->hide(); |
69 | } else { | 80 | } else { |
70 | m_PosSlider->show(); | 81 | m_PosSlider->show(); |
71 | } | 82 | } |
83 | #endif | ||
72 | } | 84 | } |
73 | 85 | ||
74 | void VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib) | 86 | int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib) |
75 | { | 87 | { |
76 | m_current = aLnk; | 88 | m_current = aLnk; |
89 | bool recon; | ||
77 | if (m_xineLib != aLib) { | 90 | if (m_xineLib != aLib) { |
78 | disconnect(m_xineLib); | 91 | if (m_xineLib) disconnect(m_xineLib); |
79 | m_xineLib = aLib; | 92 | m_xineLib = aLib; |
80 | if (aLib) m_xineLib->setWidget(m_Videodisplay); | 93 | if (aLib) m_xineLib->setWidget(m_Videodisplay); |
81 | } | 94 | } |
82 | if (!m_xineLib) { | 95 | if (!m_xineLib) { |
83 | return; | 96 | return -1; |
84 | } | 97 | } |
85 | connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped())); | 98 | connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped())); |
99 | #if 0 | ||
86 | m_uppos=0; | 100 | m_uppos=0; |
87 | m_PosSlider->setValue(0); | 101 | m_PosSlider->setValue(0); |
102 | #endif | ||
88 | m_xineLib->setWidget(m_Videodisplay); | 103 | m_xineLib->setWidget(m_Videodisplay); |
89 | m_xineLib->setShowVideo(true); | 104 | m_xineLib->setShowVideo(true); |
90 | m_xineLib->resize(m_Videodisplay->size()); | 105 | m_xineLib->resize(m_Videodisplay->size()); |
91 | m_xineLib->play(m_current.file()); | 106 | int res = m_xineLib->play(m_current.file()); |
92 | int l = m_xineLib->length(); | 107 | odebug << "Xine play: " << res << oendl; |
108 | if (res != 1) { | ||
109 | return -2; | ||
110 | } | ||
111 | return m_xineLib->length(); | ||
112 | #if 0 | ||
93 | m_PosSlider->setRange(0,l); | 113 | m_PosSlider->setRange(0,l); |
94 | m_PosSlider->setPageStep(l/10); | 114 | m_PosSlider->setPageStep(l/10); |
115 | #endif | ||
95 | } | 116 | } |
96 | 117 | ||
97 | void VideoWidget::stopPlaying() | 118 | void VideoWidget::stopPlaying() |
@@ -114,9 +135,11 @@ void VideoWidget::slot_Videoresized(const QSize&s) | |||
114 | } | 135 | } |
115 | } | 136 | } |
116 | 137 | ||
117 | void VideoWidget::updatePos(int val) | 138 | void VideoWidget::updatePos(int /*val*/) |
118 | { | 139 | { |
140 | #if 0 | ||
119 | if (m_pressed) return; | 141 | if (m_pressed) return; |
120 | m_uppos = val; | 142 | m_uppos = val; |
121 | m_PosSlider->setValue(val); | 143 | m_PosSlider->setValue(val); |
144 | #endif | ||
122 | } | 145 | } |