-rw-r--r-- | noncore/multimedia/opieplayer3/mwindow.cpp | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer3/mwindow.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer3/playlist.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer3/videowidget.cpp | 1 |
4 files changed, 14 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer3/mwindow.cpp b/noncore/multimedia/opieplayer3/mwindow.cpp index 75d1490..0898c7b 100644 --- a/noncore/multimedia/opieplayer3/mwindow.cpp +++ b/noncore/multimedia/opieplayer3/mwindow.cpp | |||
@@ -40,12 +40,13 @@ | |||
40 | #include <opie2/oapplicationfactory.h> | 40 | #include <opie2/oapplicationfactory.h> |
41 | #include <opie2/owidgetstack.h> | 41 | #include <opie2/owidgetstack.h> |
42 | #include <opie2/ofileselector.h> | 42 | #include <opie2/ofileselector.h> |
43 | #include <opie2/odebug.h> | 43 | #include <opie2/odebug.h> |
44 | 44 | ||
45 | #include <qpe/resource.h> | 45 | #include <qpe/resource.h> |
46 | #include <qpe/qpeapplication.h> | ||
46 | 47 | ||
47 | #include <qfileinfo.h> | 48 | #include <qfileinfo.h> |
48 | #include <qfile.h> | 49 | #include <qfile.h> |
49 | #include <qtoolbar.h> | 50 | #include <qtoolbar.h> |
50 | #include <qpopupmenu.h> | 51 | #include <qpopupmenu.h> |
51 | #include <qmenubar.h> | 52 | #include <qmenubar.h> |
@@ -58,13 +59,13 @@ OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) | |||
58 | using namespace Opie::Ui; | 59 | using namespace Opie::Ui; |
59 | 60 | ||
60 | PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f) | 61 | PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f) |
61 | : QMainWindow(w,name,f) | 62 | : QMainWindow(w,name,f) |
62 | { | 63 | { |
63 | checkLib(); | 64 | checkLib(); |
64 | setCaption( QObject::tr("Opie Mediaplayer 3" ) ); | 65 | setCaption(appTitle()); |
65 | 66 | ||
66 | m_MainBox = new QWidget(this); | 67 | m_MainBox = new QWidget(this); |
67 | 68 | ||
68 | QVBoxLayout*m_l = new QVBoxLayout(m_MainBox); | 69 | QVBoxLayout*m_l = new QVBoxLayout(m_MainBox); |
69 | 70 | ||
70 | m_stack = new OWidgetStack(m_MainBox); | 71 | m_stack = new OWidgetStack(m_MainBox); |
@@ -208,12 +209,13 @@ void PMainWindow::slotUserStop() | |||
208 | if (!m_playing || !m_PlayLib) return; | 209 | if (!m_playing || !m_PlayLib) return; |
209 | m_playing = false; | 210 | m_playing = false; |
210 | m_PlayLib->stop(); | 211 | m_PlayLib->stop(); |
211 | m_PosSlider->setEnabled(false); | 212 | m_PosSlider->setEnabled(false); |
212 | hideVideo(); | 213 | hideVideo(); |
213 | slotShowList(); | 214 | slotShowList(); |
215 | setCaption(appTitle()); | ||
214 | } | 216 | } |
215 | 217 | ||
216 | void PMainWindow::slotTogglePlay(bool how) | 218 | void PMainWindow::slotTogglePlay(bool how) |
217 | { | 219 | { |
218 | if (how == m_playing) { | 220 | if (how == m_playing) { |
219 | if (how) { | 221 | if (how) { |
@@ -241,12 +243,13 @@ void PMainWindow::slotPlayCurrent() | |||
241 | if (!m_LastItem) { | 243 | if (!m_LastItem) { |
242 | if (m_PlayLib) m_PlayLib->stop(); | 244 | if (m_PlayLib) m_PlayLib->stop(); |
243 | m_PosSlider->setEnabled(false); | 245 | m_PosSlider->setEnabled(false); |
244 | a_playAction->setOn(false); | 246 | a_playAction->setOn(false); |
245 | hideVideo(); | 247 | hideVideo(); |
246 | slotShowList(); | 248 | slotShowList(); |
249 | setCaption(appTitle()); | ||
247 | return; | 250 | return; |
248 | } | 251 | } |
249 | m_CurrentPos = 0; | 252 | m_CurrentPos = 0; |
250 | m_playList->setCurrentItem(m_LastItem); | 253 | m_playList->setCurrentItem(m_LastItem); |
251 | m_uppos = 0; | 254 | m_uppos = 0; |
252 | m_PosSlider->setValue(0); | 255 | m_PosSlider->setValue(0); |
@@ -263,12 +266,13 @@ void PMainWindow::slotPlayCurrent() | |||
263 | } | 266 | } |
264 | if (result<0) { | 267 | if (result<0) { |
265 | // fehler | 268 | // fehler |
266 | return; | 269 | return; |
267 | } | 270 | } |
268 | mediaWindowraised(); | 271 | mediaWindowraised(); |
272 | setCaption(appTitle()+" - "+m_LastItem->Lnk().name()); | ||
269 | odebug << "Range: " << result << oendl; | 273 | odebug << "Range: " << result << oendl; |
270 | m_PosSlider->setEnabled(true); | 274 | m_PosSlider->setEnabled(true); |
271 | m_PosSlider->setRange(0,m_PlayLib->length()); | 275 | m_PosSlider->setRange(0,m_PlayLib->length()); |
272 | m_PosSlider->setValue(m_PlayLib->currentTime()); | 276 | m_PosSlider->setValue(m_PlayLib->currentTime()); |
273 | QTimer::singleShot( 500, this, SLOT( slotCheckPos() ) ); | 277 | QTimer::singleShot( 500, this, SLOT( slotCheckPos() ) ); |
274 | } | 278 | } |
@@ -308,13 +312,14 @@ void PMainWindow::slotCheckPos() | |||
308 | if (!m_playing) return; | 312 | if (!m_playing) return; |
309 | if (!m_pressed) { | 313 | if (!m_pressed) { |
310 | m_uppos = m_PlayLib->currentTime(); | 314 | m_uppos = m_PlayLib->currentTime(); |
311 | emit sigPos(m_uppos); | 315 | emit sigPos(m_uppos); |
312 | m_PosSlider->setValue(m_PlayLib->currentTime()); | 316 | m_PosSlider->setValue(m_PlayLib->currentTime()); |
313 | } | 317 | } |
314 | QTimer::singleShot( 1000, this, SLOT( slotCheckPos() ) ); | 318 | qApp->processEvents(100); |
319 | QTimer::singleShot( 900, this, SLOT( slotCheckPos() ) ); | ||
315 | } | 320 | } |
316 | 321 | ||
317 | void PMainWindow::slotRemoveFiles() | 322 | void PMainWindow::slotRemoveFiles() |
318 | { | 323 | { |
319 | if (m_playing||!m_playList->isVisible()) return; | 324 | if (m_playing||!m_playList->isVisible()) return; |
320 | PlaylistItem* Item = m_playList->currentItem(); | 325 | PlaylistItem* Item = m_playList->currentItem(); |
diff --git a/noncore/multimedia/opieplayer3/mwindow.h b/noncore/multimedia/opieplayer3/mwindow.h index 5d011d5..3ea9a52 100644 --- a/noncore/multimedia/opieplayer3/mwindow.h +++ b/noncore/multimedia/opieplayer3/mwindow.h | |||
@@ -61,12 +61,13 @@ class PlaylistItem; | |||
61 | class QSlider; | 61 | class QSlider; |
62 | 62 | ||
63 | class PMainWindow : public QMainWindow { | 63 | class PMainWindow : public QMainWindow { |
64 | Q_OBJECT | 64 | Q_OBJECT |
65 | public: | 65 | public: |
66 | static QString appName() { return QString::fromLatin1("opie-mediaplayer3" ); } | 66 | static QString appName() { return QString::fromLatin1("opie-mediaplayer3" ); } |
67 | static QString appTitle() {return QString::fromLatin1("Opie Mediaplayer 3" ); } | ||
67 | PMainWindow(QWidget*, const char*, WFlags ); | 68 | PMainWindow(QWidget*, const char*, WFlags ); |
68 | virtual ~PMainWindow(); | 69 | virtual ~PMainWindow(); |
69 | 70 | ||
70 | public slots: | 71 | public slots: |
71 | virtual void slotVideoclicked(); | 72 | virtual void slotVideoclicked(); |
72 | protected: | 73 | protected: |
diff --git a/noncore/multimedia/opieplayer3/playlist.cpp b/noncore/multimedia/opieplayer3/playlist.cpp index 2eb40e3..6f2e668 100644 --- a/noncore/multimedia/opieplayer3/playlist.cpp +++ b/noncore/multimedia/opieplayer3/playlist.cpp | |||
@@ -161,12 +161,14 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName) | |||
161 | break; | 161 | break; |
162 | } | 162 | } |
163 | QMessageBox::warning(0,tr("Error reading fileheader"),msg); | 163 | QMessageBox::warning(0,tr("Error reading fileheader"),msg); |
164 | return; | 164 | return; |
165 | } | 165 | } |
166 | m_lastItem = m_items.last(); | 166 | m_lastItem = m_items.last(); |
167 | PlaylistItem*_it = currentItem(); | ||
168 | |||
167 | if (m_lastItem) { | 169 | if (m_lastItem) { |
168 | m_lastItem = new PlaylistItem(aFile,this,m_lastItem); | 170 | m_lastItem = new PlaylistItem(aFile,this,m_lastItem); |
169 | } else { | 171 | } else { |
170 | m_lastItem = new PlaylistItem(aFile,this); | 172 | m_lastItem = new PlaylistItem(aFile,this); |
171 | } | 173 | } |
172 | m_lastItem->setExpandable(false); | 174 | m_lastItem->setExpandable(false); |
@@ -196,13 +198,15 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName) | |||
196 | codec.sprintf("%02i:%02i m",m,l); | 198 | codec.sprintf("%02i:%02i m",m,l); |
197 | } | 199 | } |
198 | // time | 200 | // time |
199 | m_lastItem->setText(COL_TIME,codec); | 201 | m_lastItem->setText(COL_TIME,codec); |
200 | m_lastItem->Video(m_Infolib->hasVideo()); | 202 | m_lastItem->Video(m_Infolib->hasVideo()); |
201 | m_items.append(m_lastItem); | 203 | m_items.append(m_lastItem); |
202 | setSelected(m_lastItem,true); | 204 | if (_it==NULL) { |
205 | setSelected(m_lastItem,true); | ||
206 | } | ||
203 | } | 207 | } |
204 | 208 | ||
205 | void PlaylistView::slotAppendDir() | 209 | void PlaylistView::slotAppendDir() |
206 | { | 210 | { |
207 | QString _dir = Opie::Ui::OFileDialog::getDirectory(Opie::Ui::OFileSelector::Extended,m_lastDir,0,m_lastDir); | 211 | QString _dir = Opie::Ui::OFileDialog::getDirectory(Opie::Ui::OFileSelector::Extended,m_lastDir,0,m_lastDir); |
208 | if (_dir.isEmpty()) return; | 212 | if (_dir.isEmpty()) return; |
diff --git a/noncore/multimedia/opieplayer3/videowidget.cpp b/noncore/multimedia/opieplayer3/videowidget.cpp index 833ecb4..414400b 100644 --- a/noncore/multimedia/opieplayer3/videowidget.cpp +++ b/noncore/multimedia/opieplayer3/videowidget.cpp | |||
@@ -54,12 +54,13 @@ int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib) | |||
54 | } | 54 | } |
55 | connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped())); | 55 | connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped())); |
56 | m_xineLib->setWidget(m_Videodisplay); | 56 | m_xineLib->setWidget(m_Videodisplay); |
57 | m_xineLib->setShowVideo(true); | 57 | m_xineLib->setShowVideo(true); |
58 | int res = m_xineLib->play(m_current.file()); | 58 | int res = m_xineLib->play(m_current.file()); |
59 | vSize = m_xineLib->videoSize(); | 59 | vSize = m_xineLib->videoSize(); |
60 | |||
60 | slot_Videoresized(m_Videodisplay->size()); | 61 | slot_Videoresized(m_Videodisplay->size()); |
61 | odebug << "Xine play: " << res << oendl; | 62 | odebug << "Xine play: " << res << oendl; |
62 | if (res != 1) { | 63 | if (res != 1) { |
63 | return -2; | 64 | return -2; |
64 | } | 65 | } |
65 | return m_xineLib->length(); | 66 | return m_xineLib->length(); |