summaryrefslogtreecommitdiff
authoralwin <alwin>2005-04-12 16:35:06 (UTC)
committer alwin <alwin>2005-04-12 16:35:06 (UTC)
commit4fd936e4096ba9c732bde17a48489bfbb94b19ba (patch) (unidiff)
treefa96015a24e24298c227bfa19314603debb1586d
parent6df2eb36803e072ea9db62153b762250742610f0 (diff)
downloadopie-4fd936e4096ba9c732bde17a48489bfbb94b19ba.zip
opie-4fd936e4096ba9c732bde17a48489bfbb94b19ba.tar.gz
opie-4fd936e4096ba9c732bde17a48489bfbb94b19ba.tar.bz2
some gui stuff
may switch if videos will scaled up even if display size is larger than video size
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer3/audiowidget.cpp110
-rw-r--r--noncore/multimedia/opieplayer3/audiowidget.h10
-rw-r--r--noncore/multimedia/opieplayer3/mwindow.cpp81
-rw-r--r--noncore/multimedia/opieplayer3/mwindow.h16
-rw-r--r--noncore/multimedia/opieplayer3/playlist.cpp40
-rw-r--r--noncore/multimedia/opieplayer3/playlist.h2
-rw-r--r--noncore/multimedia/opieplayer3/videowidget.cpp77
-rw-r--r--noncore/multimedia/opieplayer3/videowidget.h11
8 files changed, 152 insertions, 195 deletions
diff --git a/noncore/multimedia/opieplayer3/audiowidget.cpp b/noncore/multimedia/opieplayer3/audiowidget.cpp
index b435c1b..aeebf45 100644
--- a/noncore/multimedia/opieplayer3/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer3/audiowidget.cpp
@@ -19,12 +19,2 @@ AudioWidget::AudioWidget( QWidget * parent, const char * name, WFlags f)
19 m_InfoBox = new QTextView(this); 19 m_InfoBox = new QTextView(this);
20#if 0
21 m_PosSlider = new QSlider(QSlider::Horizontal,this);
22 m_PosSlider->setTickInterval(60);
23 connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int)));
24 connect(m_PosSlider,SIGNAL(sliderMoved(int)),this,SLOT(slotNewPos(int)));
25 connect(m_PosSlider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed()));
26 connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased()));
27 m_pressed = false;
28 m_uppos=0;
29#endif
30} 20}
@@ -35,34 +25,2 @@ AudioWidget::~AudioWidget()
35 25
36void AudioWidget::slotNewPos(int /* pos*/)
37{
38 if (!m_xineLib) return;
39#if 0
40 if (m_uppos==pos) return;
41 m_xineLib->seekTo(pos);
42#endif
43}
44
45void AudioWidget::sliderPressed()
46{
47#if 0
48 m_pressed = true;
49#endif
50}
51
52void AudioWidget::sliderReleased()
53{
54#if 0
55 m_pressed = false;
56#endif
57}
58
59void AudioWidget::closeEvent(QCloseEvent*e)
60{
61 odebug << "AudioWidget::closeEvent(QCloseEvent*e)" << oendl;
62 if (m_xineLib) {
63 m_xineLib->stop();
64 }
65 QWidget::closeEvent(e);
66}
67
68int AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib) 26int AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
@@ -77,8 +35,3 @@ int AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
77 } 35 }
78#if 0 36 int res = m_xineLib->play(m_current.file(),0,0);
79 m_uppos=0;
80 m_PosSlider->setValue(0);
81#endif
82 m_xineLib->setShowVideo(false);
83 int res = m_xineLib->play(m_current.file());
84 if (res != 1) { 37 if (res != 1) {
@@ -86,2 +39,6 @@ int AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
86 } 39 }
40 if (!m_xineLib->hasVideo()) {
41 m_xineLib->setShowVideo( false );
42 }
43
87 // title 44 // title
@@ -94,37 +51,35 @@ int AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
94 int l = m_xineLib->length(); 51 int l = m_xineLib->length();
95 int tmp = l; 52 QString laenge = secToString(l);
96#if 0 53 QString text = "<qt><center><table border=\"0\">";
97 m_PosSlider->setRange(0,l);
98#endif
99 QString laenge="";
100 int h = l/3600;
101 l-=h*3600;
102 int m = l/60;
103 l-=m*60;
104 if (h>0) {
105 laenge+=QString("%1 h").arg(h);
106 }
107 if (m>0) {
108 if (!laenge.isEmpty()) laenge+=" ";
109 laenge+=QString("%1 m").arg(m);
110 }
111 if (l>0) {
112 if (!laenge.isEmpty()) laenge+=" ";
113 laenge+=QString("%1 s").arg(l);
114 }
115 QString text = "<qt>";
116 if (artist.length()) { 54 if (artist.length()) {
117 text+="<H2><center>"+artist+"</center></h2>"; 55 text+="<tr><td>"+tr("Artist: ")+"</td><td><b>"+artist+"</b></td></tr>";
118 } 56 }
119 if (title.length()) { 57 if (title.length()) {
120 text+="<H2><center>"+title+"</center></h2>"; 58 text+="<tr><td>"+tr("Title: ")+"</td><td><font size=\"+2\">"+title+"</font></td></tr>";
121 } else { 59 } else {
122 text+="<H2><center>"+m_current.name()+"</center></h2>"; 60 text+="<tr><td>"+tr("Filename: ")+"</td><td><b>"+m_current.name()+"</b></td></tr>";
123 } 61 }
124 if (album.length()) { 62 if (album.length()) {
125 text+="<H2><center>"+album+"</center></h2>"; 63 text+="<tr><td>"+tr("Album: ")+"</td><td><b>"+album+"</b></td></tr>";
126 } 64 }
127 text+="<h3><center>"+laenge+"</center></h3>"; 65 text+="<tr><td>"+tr("Length: ")+"</td><td><b>"+laenge+"</b></td></tr>";
66 text+="</table></center></qt>";
128 m_InfoBox->setText(text); 67 m_InfoBox->setText(text);
129 return tmp; 68 return l;
69}
70
71QString AudioWidget::secToString(int sec)
72{
73 int l = sec;
74 int h = l/3600;
75 l-=h*3600;
76 int m = l/60;
77 l-=m*60;
78 QString s = "";
79 if (h>0) {
80 s.sprintf("%2i:%2i:%2i",h,m,l);
81 } else {
82 s.sprintf("%02i:%02i",m,l);
83 }
84 return s;
130} 85}
@@ -140,7 +95,2 @@ void AudioWidget::updatePos(int /* val */)
140{ 95{
141#if 0
142 if (m_pressed) return;
143 m_uppos = val;
144 m_PosSlider->setValue(val);
145#endif
146} 96}
diff --git a/noncore/multimedia/opieplayer3/audiowidget.h b/noncore/multimedia/opieplayer3/audiowidget.h
index 5e5dc09..abdd781 100644
--- a/noncore/multimedia/opieplayer3/audiowidget.h
+++ b/noncore/multimedia/opieplayer3/audiowidget.h
@@ -34,13 +34,5 @@ protected:
34 QTextView*m_InfoBox; 34 QTextView*m_InfoBox;
35#if 0
36 QSlider*m_PosSlider;
37 bool m_pressed;
38 int m_uppos;
39#endif
40 35
36 static QString secToString(int sec);
41protected slots: 37protected slots:
42 virtual void closeEvent(QCloseEvent*e);
43 virtual void slotNewPos(int pos);
44 virtual void sliderPressed();
45 virtual void sliderReleased();
46}; 38};
diff --git a/noncore/multimedia/opieplayer3/mwindow.cpp b/noncore/multimedia/opieplayer3/mwindow.cpp
index 57418f0..75d1490 100644
--- a/noncore/multimedia/opieplayer3/mwindow.cpp
+++ b/noncore/multimedia/opieplayer3/mwindow.cpp
@@ -62,2 +62,3 @@ PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f)
62{ 62{
63 checkLib();
63 setCaption( QObject::tr("Opie Mediaplayer 3" ) ); 64 setCaption( QObject::tr("Opie Mediaplayer 3" ) );
@@ -71,5 +72,5 @@ PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f)
71 m_l->addWidget(m_stack); 72 m_l->addWidget(m_stack);
72 m_scrollBar = new QSlider(QSlider::Horizontal,m_MainBox); 73 m_PosSlider = new QSlider(QSlider::Horizontal,m_MainBox);
73 m_l->addWidget(m_scrollBar); 74 m_l->addWidget(m_PosSlider);
74 m_scrollBar->setEnabled(false); 75 m_PosSlider->setEnabled(false);
75 76
@@ -89,4 +90,10 @@ PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f)
89 90
91 connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int)));
92 connect(m_PosSlider,SIGNAL(sliderMoved(int)),this,SLOT(slotNewPos(int)));
93 connect(m_PosSlider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed()));
94 connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased()));
95 m_pressed = false;
96 m_uppos=0;
97
90 m_stack->raiseWidget(stack_list); 98 m_stack->raiseWidget(stack_list);
91 m_PlayLib = 0;
92 m_LastItem = 0; 99 m_LastItem = 0;
@@ -101,2 +108,3 @@ void PMainWindow::slotListChanged(int count)
101{ 108{
109 playersGroup->setEnabled(count>0);
102 if (!m_playList->isVisible()) { 110 if (!m_playList->isVisible()) {
@@ -119,4 +127,5 @@ void PMainWindow::checkLib()
119 if (m_PlayLib == 0) { 127 if (m_PlayLib == 0) {
120 m_PlayLib = new XINE::Lib(XINE::Lib::InitializeImmediately); 128 m_PlayLib = new XINE::Lib(XINE::Lib::InitializeInThread);
121 m_PlayLib->ensureInitialized(); 129 qApp->processEvents();
130// m_PlayLib->ensureInitialized();
122 connect(m_PlayLib,SIGNAL(stopped()),this,SLOT(slotStopped())); 131 connect(m_PlayLib,SIGNAL(stopped()),this,SLOT(slotStopped()));
@@ -201,3 +210,3 @@ void PMainWindow::slotUserStop()
201 m_PlayLib->stop(); 210 m_PlayLib->stop();
202 m_scrollBar->setEnabled(false); 211 m_PosSlider->setEnabled(false);
203 hideVideo(); 212 hideVideo();
@@ -233,3 +242,3 @@ void PMainWindow::slotPlayCurrent()
233 if (m_PlayLib) m_PlayLib->stop(); 242 if (m_PlayLib) m_PlayLib->stop();
234 m_scrollBar->setEnabled(false); 243 m_PosSlider->setEnabled(false);
235 a_playAction->setOn(false); 244 a_playAction->setOn(false);
@@ -239,6 +248,6 @@ void PMainWindow::slotPlayCurrent()
239 } 248 }
240 checkLib();
241 m_CurrentPos = 0; 249 m_CurrentPos = 0;
242 m_playList->setCurrentItem(m_LastItem); 250 m_playList->setCurrentItem(m_LastItem);
243 odebug << "Pos: " << m_PlayLib->currentTime() << oendl; 251 m_uppos = 0;
252 m_PosSlider->setValue(0);
244 int result = 0; 253 int result = 0;
@@ -260,5 +269,5 @@ void PMainWindow::slotPlayCurrent()
260 odebug << "Range: " << result << oendl; 269 odebug << "Range: " << result << oendl;
261 m_scrollBar->setRange(0,result); 270 m_PosSlider->setEnabled(true);
262 m_scrollBar->setValue(0); 271 m_PosSlider->setRange(0,m_PlayLib->length());
263 m_scrollBar->setEnabled(true); 272 m_PosSlider->setValue(m_PlayLib->currentTime());
264 QTimer::singleShot( 500, this, SLOT( slotCheckPos() ) ); 273 QTimer::singleShot( 500, this, SLOT( slotCheckPos() ) );
@@ -291,2 +300,3 @@ void PMainWindow::slotStopped()
291 if (!m_playing) return; 300 if (!m_playing) return;
301 odebug << "Slot stopped" << oendl;
292 m_playing = false; 302 m_playing = false;
@@ -298,4 +308,7 @@ void PMainWindow::slotCheckPos()
298 if (!m_playing) return; 308 if (!m_playing) return;
299 //emit sigPos(m_PlayLib->currentTime()); 309 if (!m_pressed) {
300 m_scrollBar->setValue(m_PlayLib->currentTime()); 310 m_uppos = m_PlayLib->currentTime();
311 emit sigPos(m_uppos);
312 m_PosSlider->setValue(m_PlayLib->currentTime());
313 }
301 QTimer::singleShot( 1000, this, SLOT( slotCheckPos() ) ); 314 QTimer::singleShot( 1000, this, SLOT( slotCheckPos() ) );
@@ -317,5 +330,5 @@ void PMainWindow::setupActions()
317 connect(a_addDir,SIGNAL(activated()),m_playList,SLOT(slotAppendDir())); 330 connect(a_addDir,SIGNAL(activated()),m_playList,SLOT(slotAppendDir()));
318 a_loadPlaylist = new QAction(tr("Append .m3u playlist"),Resource::loadIconSet("opieplayer2/add_to_playlist"),0,0,this,0,false); 331 a_loadPlaylist = new QAction(tr("Append playlist"),Resource::loadIconSet("opieplayer2/add_to_playlist"),0,0,this,0,false);
319 connect(a_loadPlaylist,SIGNAL(activated()),m_playList,SLOT(slotOpenM3u())); 332 connect(a_loadPlaylist,SIGNAL(activated()),m_playList,SLOT(slotOpenM3u()));
320 a_savePlaylist = new QAction(tr("Save .m3u playlist"),Resource::loadIconSet("save"),0,0,this,0,false); 333 a_savePlaylist = new QAction(tr("Save playlist"),Resource::loadIconSet("save"),0,0,this,0,false);
321 connect(a_savePlaylist,SIGNAL(activated()),m_playList,SLOT(slotSaveAsM3u())); 334 connect(a_savePlaylist,SIGNAL(activated()),m_playList,SLOT(slotSaveAsM3u()));
@@ -353,2 +366,3 @@ void PMainWindow::setupActions()
353 366
367
354 /* initial states of actions */ 368 /* initial states of actions */
@@ -357,2 +371,9 @@ void PMainWindow::setupActions()
357 a_ShowMedia->setEnabled(false); 371 a_ShowMedia->setEnabled(false);
372 playersGroup->setEnabled(false);
373
374 settingsGroup = new QActionGroup(this,"configgroup",false);
375
376 a_Scaleup = new QAction(tr("Scale videos larger"),Resource::loadIconSet( "fullscreen" ), 0, 0, this, 0, true );
377 connect(a_Scaleup,SIGNAL(toggled(bool)),this,SLOT(slot_scaleupToggled(bool)));
378 settingsGroup->insert(a_Scaleup);
358} 379}
@@ -429,4 +450,28 @@ void PMainWindow::setupMenu()
429 m_menuBar->insertItem(tr("Playing"),playMenu); 450 m_menuBar->insertItem(tr("Playing"),playMenu);
430
431 playersGroup->addTo(playMenu); 451 playersGroup->addTo(playMenu);
452 configMenu = new QPopupMenu(m_menuBar);
453 m_menuBar->insertItem(tr("Config"),configMenu);
454 settingsGroup->addTo(configMenu);
455}
456
457void PMainWindow::slotNewPos(int pos)
458{
459 if (!m_PlayLib) return;
460 if (m_uppos==pos) return;
461 m_PlayLib->seekTo(pos);
462}
463
464void PMainWindow::sliderPressed()
465{
466 m_pressed = true;
467}
468
469void PMainWindow::sliderReleased()
470{
471 m_pressed = false;
472}
473
474void PMainWindow::slot_scaleupToggled(bool how)
475{
476 m_VideoPlayer->scaleUp(how);
432} 477}
diff --git a/noncore/multimedia/opieplayer3/mwindow.h b/noncore/multimedia/opieplayer3/mwindow.h
index 10c7a29..5d011d5 100644
--- a/noncore/multimedia/opieplayer3/mwindow.h
+++ b/noncore/multimedia/opieplayer3/mwindow.h
@@ -84,3 +84,3 @@ protected:
84 QWidget*m_MainBox; 84 QWidget*m_MainBox;
85 QSlider*m_scrollBar; 85 QSlider*m_PosSlider;
86 86
@@ -89,5 +89,6 @@ protected:
89 QAction*a_addDir,*a_loadPlaylist,*a_savePlaylist; 89 QAction*a_addDir,*a_loadPlaylist,*a_savePlaylist;
90 QActionGroup*playersGroup,*playlistOnly; 90 QAction*a_Scaleup;
91 QActionGroup*playersGroup,*playlistOnly,*settingsGroup;
91 QToolBar*m_toolBar; 92 QToolBar*m_toolBar;
92 QPopupMenu *fileMenu,*dispMenu,*playMenu; 93 QPopupMenu *fileMenu,*dispMenu,*playMenu,*configMenu;
93 QMenuBar*m_menuBar; 94 QMenuBar*m_menuBar;
@@ -101,4 +102,6 @@ protected:
101 void hideVideo(); 102 void hideVideo();
102
103 bool m_playing:1; 103 bool m_playing:1;
104 bool m_pressed:1;
105 int m_uppos;
106
104 int m_CurrentPos; 107 int m_CurrentPos;
@@ -124,2 +127,7 @@ protected slots:
124 virtual void slotListChanged(int); 127 virtual void slotListChanged(int);
128 virtual void slotNewPos(int pos);
129 virtual void sliderPressed();
130 virtual void sliderReleased();
131 virtual void slot_scaleupToggled(bool);
132
125 133
diff --git a/noncore/multimedia/opieplayer3/playlist.cpp b/noncore/multimedia/opieplayer3/playlist.cpp
index babe8ce..2eb40e3 100644
--- a/noncore/multimedia/opieplayer3/playlist.cpp
+++ b/noncore/multimedia/opieplayer3/playlist.cpp
@@ -106,2 +106,3 @@ void PlaylistView::checkLib()
106 m_Infolib = new XINE::Lib(XINE::Lib::InitializeImmediately); 106 m_Infolib = new XINE::Lib(XINE::Lib::InitializeImmediately);
107 connect(m_Infolib,SIGNAL(stopped()),this,SLOT(slotDummyStop()));
107 m_Infolib->ensureInitialized(); 108 m_Infolib->ensureInitialized();
@@ -110,5 +111,15 @@ void PlaylistView::checkLib()
110 111
112void PlaylistView::slotDummyStop()
113{
114 odebug << "void PlaylistView::slotDummyStop()" << oendl;
115}
116
111void PlaylistView::slotAddFile(const DocLnk&aLink) 117void PlaylistView::slotAddFile(const DocLnk&aLink)
112{ 118{
113 addFile(aLink.file(),aLink.name()); 119 QFileInfo f(aLink.file());
120 if (f.extension(FALSE).lower()=="m3u"||f.extension(FALSE).lower()=="pls") {
121 readPlayList(aLink.file());
122 } else {
123 addFile(aLink.file(),aLink.name());
124 }
114 emit contentChanged(childCount()); 125 emit contentChanged(childCount());
@@ -121,4 +132,2 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName)
121 checkLib(); 132 checkLib();
122 m_Infolib->stop();
123
124 QString name = aName; 133 QString name = aName;
@@ -128,2 +137,4 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName)
128 int i = m_Infolib->setfile(aFile.utf8().data()); 137 int i = m_Infolib->setfile(aFile.utf8().data());
138 /* realy! otherwise we get an "stopped" signal when playing! - I don't know why */
139 m_Infolib->stop();
129 odebug << "File set: " << i << " ("<<aFile.utf8().data()<<")"<<oendl; 140 odebug << "File set: " << i << " ("<<aFile.utf8().data()<<")"<<oendl;
@@ -182,11 +193,5 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName)
182 if (h>0) { 193 if (h>0) {
183 codec+=QString("%1 h").arg(h); 194 codec.sprintf("%2i:%2i:%2i h",h,m,l);
184 } 195 } else {
185 if (m>0) { 196 codec.sprintf("%02i:%02i m",m,l);
186 if (!codec.isEmpty()) codec+=" ";
187 codec+=QString("%1 m").arg(m);
188 }
189 if (l>0) {
190 if (!codec.isEmpty()) codec+=" ";
191 codec+=QString("%1 s").arg(l);
192 } 197 }
@@ -218,3 +223,3 @@ void PlaylistView::slotOpenM3u()
218 mimeTypes.insert("Playlists",types); 223 mimeTypes.insert("Playlists",types);
219 mimeTypes.insert("All",types); 224// mimeTypes.insert("All",types);
220 QString fileName= Opie::Ui::OFileDialog::getOpenFileName(Opie::Ui::OFileSelector::EXTENDED, 225 QString fileName= Opie::Ui::OFileDialog::getOpenFileName(Opie::Ui::OFileSelector::EXTENDED,
@@ -224,2 +229,8 @@ void PlaylistView::slotOpenM3u()
224 } 229 }
230 readPlayList(fileName);
231 emit contentChanged(childCount());
232}
233
234void PlaylistView::readPlayList(const QString&fileName)
235{
225 QFileInfo f(fileName); 236 QFileInfo f(fileName);
@@ -235,3 +246,2 @@ void PlaylistView::slotOpenM3u()
235 } 246 }
236 emit contentChanged(childCount());
237} 247}
@@ -244,5 +254,5 @@ void PlaylistView::slotSaveAsM3u()
244 mimeTypes.insert("Playlists",types); 254 mimeTypes.insert("Playlists",types);
245 mimeTypes.insert("All",types);
246 QString fileName= Opie::Ui::OFileDialog::getSaveFileName(Opie::Ui::OFileSelector::EXTENDED, 255 QString fileName= Opie::Ui::OFileDialog::getSaveFileName(Opie::Ui::OFileSelector::EXTENDED,
247 m_lastDir,"playlist.m3u", mimeTypes); 256 m_lastDir,"playlist.m3u", mimeTypes);
257 odebug << "Save as " << fileName << oendl;
248 if (fileName.isEmpty()) { 258 if (fileName.isEmpty()) {
diff --git a/noncore/multimedia/opieplayer3/playlist.h b/noncore/multimedia/opieplayer3/playlist.h
index 4a9268c..3c9a68d 100644
--- a/noncore/multimedia/opieplayer3/playlist.h
+++ b/noncore/multimedia/opieplayer3/playlist.h
@@ -97,2 +97,3 @@ public slots:
97 virtual void slotSaveAsM3u(); 97 virtual void slotSaveAsM3u();
98 virtual void slotDummyStop();
98 99
@@ -100,2 +101,3 @@ protected:
100 void checkLib(); 101 void checkLib();
102 void readPlayList(const QString&);
101 QStringList columnLabels; 103 QStringList columnLabels;
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)
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);
@@ -21,16 +21,4 @@ VideoWidget::VideoWidget( QWidget * parent, const char * name, WFlags f)
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}
@@ -43,3 +31,2 @@ void VideoWidget::slotClicked()
43{ 31{
44 odebug << "clicked " << oendl;
45 emit videoclicked(); 32 emit videoclicked();
@@ -51,34 +38,4 @@ void VideoWidget::closeEvent(QCloseEvent*e)
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}
@@ -98,10 +55,7 @@ int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
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;
@@ -111,6 +65,2 @@ int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
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}
@@ -126,3 +76,2 @@ void VideoWidget::slotStopped()
126{ 76{
127// check fullscreen here!
128} 77}
@@ -131,5 +80,8 @@ void 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 }
@@ -137,9 +89,12 @@ void VideoWidget::slot_Videoresized(const QSize&s)
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}
diff --git a/noncore/multimedia/opieplayer3/videowidget.h b/noncore/multimedia/opieplayer3/videowidget.h
index 935a648..e082407 100644
--- a/noncore/multimedia/opieplayer3/videowidget.h
+++ b/noncore/multimedia/opieplayer3/videowidget.h
@@ -24,2 +24,3 @@ public:
24 void fullScreen(bool how); 24 void fullScreen(bool how);
25 void scaleUp(bool how);
25 26
@@ -38,7 +39,4 @@ protected:
38 QWidget * m_holder; 39 QWidget * m_holder;
39#if 0 40 QSize vSize;
40 QSlider*m_PosSlider; 41 bool m_scaleUp:1;
41 bool m_pressed:1;
42 int m_uppos;
43#endif
44 42
@@ -46,5 +44,2 @@ protected slots:
46 virtual void closeEvent(QCloseEvent*e); 44 virtual void closeEvent(QCloseEvent*e);
47 virtual void slotNewPos(int pos);
48 virtual void sliderPressed();
49 virtual void sliderReleased();
50 virtual void slot_Videoresized(const QSize&); 45 virtual void slot_Videoresized(const QSize&);