summaryrefslogtreecommitdiff
path: root/noncore/multimedia
authorllornkcor <llornkcor>2002-09-04 23:38:09 (UTC)
committer llornkcor <llornkcor>2002-09-04 23:38:09 (UTC)
commit3f2a74813b552c6f7a4450ec6294bbbcc5b811c5 (patch) (unidiff)
treea29f6d3436365b13b71615052cf08817225d0d78 /noncore/multimedia
parent95d24f601f7845e49092068ad358030024fa6097 (diff)
downloadopie-3f2a74813b552c6f7a4450ec6294bbbcc5b811c5.zip
opie-3f2a74813b552c6f7a4450ec6294bbbcc5b811c5.tar.gz
opie-3f2a74813b552c6f7a4450ec6294bbbcc5b811c5.tar.bz2
change playing in file lists. no loop mode
Diffstat (limited to 'noncore/multimedia') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/inputDialog.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp48
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.h3
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp84
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h3
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.cpp2
7 files changed, 97 insertions, 45 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 040e965..446fa45 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -455,2 +455,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
455 } 455 }
456 qDebug("mouseEvent %d", i);
456 switch (i) { 457 switch (i) {
diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp
index 9edb1d3..62240b2 100644
--- a/noncore/multimedia/opieplayer2/inputDialog.cpp
+++ b/noncore/multimedia/opieplayer2/inputDialog.cpp
@@ -27,2 +27,3 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags
27 LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); 27 LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) );
28 LineEdit1->setFocus();
28} 29}
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index bf2acc8..553e3c1 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -5,2 +5,3 @@
5#include <qpe/qcopenvelope_qws.h> 5#include <qpe/qcopenvelope_qws.h>
6#include <qfileinfo.h>
6 7
@@ -91,2 +92,4 @@ void MediaPlayer::setPlaying( bool play ) {
91 92
93 QString tickerText, time, fileName;
94 if( playList->whichList() == 0 ) { //check for filelist
92 const DocLnk *playListCurrent = playList->current(); 95 const DocLnk *playListCurrent = playList->current();
@@ -95,17 +98,32 @@ void MediaPlayer::setPlaying( bool play ) {
95 } 98 }
96
97 xineControl->play( currentFile->file() ); 99 xineControl->play( currentFile->file() );
100 fileName = currentFile->name();
101 long seconds = mediaPlayerState->length();//
102 time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
103 qDebug(time);
98 104
105 } else { //if playing in file list.. play in a different way
106 // random and looping settings enabled causes problems here,
107 // since there is no selected file in the playlist, but a selected file in the file list,
108 // so we remember and shutoff
109 l = mediaPlayerState->looping();
110 if(l)
111 mediaPlayerState->setLooping( false );
112 r = mediaPlayerState->shuffled();
113 mediaPlayerState->setShuffled(false);
114
115 fileName = playList->currentFileListPathName();
116 xineControl->play( fileName);
99 long seconds = mediaPlayerState->length();// 117 long seconds = mediaPlayerState->length();//
100 QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); 118 time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
101 qDebug(time); 119 qDebug(time);
120 if( fileName.left(4) != "http" )
121 fileName = QFileInfo( fileName).baseName();
102 122
103 QString tickerText; 123 }
104 if( currentFile->file().left(4) == "http" ) 124 if( fileName.left(4) == "http" )
105 tickerText= tr( " File: " ) + currentFile->name(); 125 tickerText= tr( " File: " ) + fileName;
106 else 126 else
107 tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; 127 tickerText = tr( " File: " ) + fileName + tr(", Length: ") + time;
108 128 audioUI->setTickerText( tickerText );
109 audioUI->setTickerText( currentFile->file( ) );
110
111} 129}
@@ -114,2 +132,3 @@ void MediaPlayer::setPlaying( bool play ) {
114void MediaPlayer::prev() { 132void MediaPlayer::prev() {
133 if(playList->whichList() == 0) { //if using the playlist
115 if ( playList->prev() ) { 134 if ( playList->prev() ) {
@@ -124,2 +143,3 @@ void MediaPlayer::prev() {
124} 143}
144}
125 145
@@ -127,2 +147,4 @@ void MediaPlayer::prev() {
127void MediaPlayer::next() { 147void MediaPlayer::next() {
148
149 if(playList->whichList() == 0) { //if using the playlist
128 if ( playList->next() ) { 150 if ( playList->next() ) {
@@ -136,2 +158,10 @@ void MediaPlayer::next() {
136 } 158 }
159 } else { //if playing from file list, let's just stop
160 qDebug("<<<<<<<<<<<<<<<<<stop for filelists");
161 mediaPlayerState->setPlaying(false);
162 mediaPlayerState->setView('l');
163 if(l) mediaPlayerState->setLooping(l);
164 if(r) mediaPlayerState->setShuffled(r);
165 }
166 qApp->processEvents();
137} 167}
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h
index 81fab88..05be128 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.h
+++ b/noncore/multimedia/opieplayer2/mediaplayer.h
@@ -19,3 +19,2 @@ public:
19 ~MediaPlayer(); 19 ~MediaPlayer();
20
21private slots: 20private slots:
@@ -36,3 +35,3 @@ protected:
36private: 35private:
37 bool isBlanked; 36 bool isBlanked, l, r;
38 int fd; 37 int fd;
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 3bd04bc..15c70c3 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -323,3 +323,3 @@ void PlayListWidget::useSelectedDocument() {
323const DocLnk *PlayListWidget::current() { // this is fugly 323const DocLnk *PlayListWidget::current() { // this is fugly
324 switch ( tabWidget->currentPageIndex() ) { 324 switch ( whichList() ) {
325 case 0: //playlist 325 case 0: //playlist
@@ -396,2 +396,3 @@ bool PlayListWidget::prev() {
396bool PlayListWidget::next() { 396bool PlayListWidget::next() {
397qDebug("<<<<<<<<<<<<next()");
397 if ( mediaPlayerState->playlist() ) { 398 if ( mediaPlayerState->playlist() ) {
@@ -499,3 +500,3 @@ void PlayListWidget::addSelected() {
499 500
500 switch (tabWidget->currentPageIndex()) { 501 switch (whichList()) {
501 case 0: //playlist 502 case 0: //playlist
@@ -559,3 +560,3 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
559 if(it) { 560 if(it) {
560 switch (tabWidget->currentPageIndex()) { 561 switch ( whichList()) {
561 case 1: { 562 case 1: {
@@ -590,3 +591,3 @@ void PlayListWidget::tabChanged(QWidget *) {
590 591
591 switch ( tabWidget->currentPageIndex()) { 592 switch ( whichList()) {
592 case 0: 593 case 0:
@@ -636,31 +637,30 @@ void PlayListWidget::tabChanged(QWidget *) {
636void PlayListWidget::btnPlay(bool b) { 637void PlayListWidget::btnPlay(bool b) {
637 // mediaPlayerState->setPlaying(b);
638 switch ( tabWidget->currentPageIndex()) {
639 case 0:
640 {
641 mediaPlayerState->setPlaying(b);
642 }
643 break;
644 case 1:
645 {
646 addToSelection( audioView->currentItem() );
647 mediaPlayerState->setPlaying(b);
648 d->selectedFiles->removeSelected( );
649 tabWidget->setCurrentPage(1);
650 d->selectedFiles->unSelect();
651 insanityBool=FALSE;
652 }// audioView->clearSelection();
653 break;
654 case 2:
655 {
656 addToSelection( videoView->currentItem() );
657 mediaPlayerState->setPlaying(b); 638 mediaPlayerState->setPlaying(b);
658 qApp->processEvents(); 639 qApp->processEvents();
659 d->selectedFiles->removeSelected( );
660 tabWidget->setCurrentPage(2);
661 d->selectedFiles->unSelect();
662 insanityBool=FALSE; 640 insanityBool=FALSE;
663 }// videoView->clearSelection(); 641// switch ( whichList()) {
664 break; 642// case 0:
665 }; 643// {
644// mediaPlayerState->setPlaying(b);
645// }
646// break;
647// case 1:
648// {
649// mediaPlayerState->setPlaying(b);
650// qApp->processEvents();
651// insanityBool=FALSE;
652// }// audioView->clearSelection();
653// break;
654// case 2:
655// {
656// // addToSelection( videoView->currentItem() );
657// mediaPlayerState->setPlaying(b);
658// qApp->processEvents();
659// // d->selectedFiles->removeSelected( );
660// // tabWidget->setCurrentPage(2);
661// // d->selectedFiles->unSelect();
662// insanityBool=FALSE;
663// }// videoView->clearSelection();
664// break;
665// };
666 666
@@ -738,3 +738,4 @@ void PlayListWidget::populateAudioView() {
738 size = QFile( dit.current()->file() ).size(); 738 size = QFile( dit.current()->file() ).size();
739 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number(size ), storage); 739 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(),
740 QString::number(size ), storage, dit.current()->file());
740 newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); 741 newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) );
@@ -757,3 +758,3 @@ void PlayListWidget::populateVideoView() {
757 videoView->clear(); 758 videoView->clear();
758 QString storage; 759 QString storage, pathName;
759 for ( ; Vdit.current(); ++Vdit ) { 760 for ( ; Vdit.current(); ++Vdit ) {
@@ -764,2 +765,3 @@ void PlayListWidget::populateVideoView() {
764 storage=name; 765 storage=name;
766 pathName=path;
765 } 767 }
@@ -770,3 +772,3 @@ void PlayListWidget::populateVideoView() {
770 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), 772 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(),
771 QString::number( QFile( Vdit.current()->file() ).size() ), storage ); 773 QString::number( QFile( Vdit.current()->file() ).size() ), storage, Vdit.current()->file());
772 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); 774 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) );
@@ -1064 +1066,17 @@ void PlayListWidget::skinsMenuActivated( int item ) {
1064} 1066}
1067
1068int PlayListWidget::whichList() {
1069 return tabWidget->currentPageIndex();
1070}
1071
1072QString PlayListWidget::currentFileListPathName() {
1073 switch (whichList()) {
1074 case 1:
1075 return audioView->currentItem()->text(3);
1076 break;
1077 case 2:
1078 return videoView->currentItem()->text(3);
1079 break;
1080 };
1081 return "";
1082}
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index dcfdd48..2873dca 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -68,2 +68,3 @@ public:
68 int selected; 68 int selected;
69 int whichList();
69 70
@@ -75,3 +76,3 @@ public slots:
75 void writeConfig( Config& cfg ) const; 76 void writeConfig( Config& cfg ) const;
76 77 QString currentFileListPathName();
77protected: 78protected:
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
index 250833c..f073102 100644
--- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
@@ -157,2 +157,3 @@ PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags
157 audioView->addColumn( tr( "Media" ), -1 ); 157 audioView->addColumn( tr( "Media" ), -1 );
158 audioView->addColumn( tr( "Path" ), 0 );
158 audioView->setColumnAlignment( 1, Qt::AlignRight ); 159 audioView->setColumnAlignment( 1, Qt::AlignRight );
@@ -178,2 +179,3 @@ PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags
178 videoView->addColumn(tr( "Media" ), -1 ); 179 videoView->addColumn(tr( "Media" ), -1 );
180 videoView->addColumn(tr( "Path" ), 0 );
179 videoView->setColumnAlignment( 1, Qt::AlignRight ); 181 videoView->setColumnAlignment( 1, Qt::AlignRight );