summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-08-22 01:35:24 (UTC)
committer llornkcor <llornkcor>2002-08-22 01:35:24 (UTC)
commitee90b966cfc262770ef5a45c2bad0af6766245a2 (patch) (unidiff)
tree3b80601759e3a2418b1b805229e4ea074fd7708f
parentdbf4e3458811379488842f5d83650c7e4c6831aa (diff)
downloadopie-ee90b966cfc262770ef5a45c2bad0af6766245a2.zip
opie-ee90b966cfc262770ef5a45c2bad0af6766245a2.tar.gz
opie-ee90b966cfc262770ef5a45c2bad0af6766245a2.tar.bz2
should scan for file at startup
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp11
2 files changed, 8 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 603d426..bf2acc8 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -174,24 +174,25 @@ void MediaPlayer::stopChangingVolume() {
174} 174}
175 175
176 176
177void MediaPlayer::timerEvent( QTimerEvent * ) { 177void MediaPlayer::timerEvent( QTimerEvent * ) {
178 if ( volumeDirection == +1 ) { 178 if ( volumeDirection == +1 ) {
179 volControl->incVol(2); 179 volControl->incVol(2);
180 } else if ( volumeDirection == -1 ) { 180 } else if ( volumeDirection == -1 ) {
181 volControl->decVol(2); 181 volControl->decVol(2);
182 } 182 }
183 183
184 184
185 // TODO FIXME 185 // TODO FIXME
186 // huh??
186 unsigned int v= 0; 187 unsigned int v= 0;
187 v = volControl->volume(); 188 v = volControl->volume();
188 v = v / 10; 189 v = v / 10;
189 190
190 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { 191 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) {
191 return; 192 return;
192 } 193 }
193 194
194 int w=0; int h=0; 195 int w=0; int h=0;
195 if( !xineControl->hasVideo()) { 196 if( !xineControl->hasVideo()) {
196 w = audioUI->width(); 197 w = audioUI->width();
197 h = audioUI->height(); 198 h = audioUI->height();
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 6c7f6ba..603a7a3 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -116,33 +116,34 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
116 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); 116 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) );
117 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); 117 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) );
118 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); 118 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) );
119 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); 119 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) );
120 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); 120 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) );
121 121
122 readConfig( cfg ); 122 readConfig( cfg );
123 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "" ); 123 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "" );
124 loadList(DocLnk( currentPlaylist ) ); 124 loadList(DocLnk( currentPlaylist ) );
125 setCaption( tr( "OpiePlayer: " ) + currentPlaylist ); 125 setCaption( tr( "OpiePlayer: " ) + currentPlaylist );
126 126
127 // see which skins are installed 127 // see which skins are installed
128 videoScan=FALSE;
129 audioScan=FALSE;
128 populateSkinsMenu(); 130 populateSkinsMenu();
129 initializeStates(); 131 initializeStates();
130} 132}
131 133
132 134
133PlayListWidget::~PlayListWidget() { 135PlayListWidget::~PlayListWidget() {
134/* fixing symptoms and not sources is entirely stupid - zecke */ 136 // WTF?!@?!
135// Config cfg( "OpiePlayer" ); 137
136// writeConfig( cfg );
137 if ( d->current ) { 138 if ( d->current ) {
138 delete d->current; 139 delete d->current;
139 } 140 }
140 delete d; 141 delete d;
141} 142}
142 143
143 144
144void PlayListWidget::initializeStates() { 145void PlayListWidget::initializeStates() {
145 d->tbPlay->setOn( mediaPlayerState->playing() ); 146 d->tbPlay->setOn( mediaPlayerState->playing() );
146 d->tbLoop->setOn( mediaPlayerState->looping() ); 147 d->tbLoop->setOn( mediaPlayerState->looping() );
147 d->tbShuffle->setOn( mediaPlayerState->shuffled() ); 148 d->tbShuffle->setOn( mediaPlayerState->shuffled() );
148 setPlaylist( true ); 149 setPlaylist( true );
@@ -775,25 +776,25 @@ void PlayListWidget::openFile() {
775 InputDialog *fileDlg; 776 InputDialog *fileDlg;
776 fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); 777 fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0);
777 fileDlg->exec(); 778 fileDlg->exec();
778 if( fileDlg->result() == 1 ) { 779 if( fileDlg->result() == 1 ) {
779 filename = fileDlg->text(); 780 filename = fileDlg->text();
780 781
781 qDebug( "Selected filename is " + filename ); 782 qDebug( "Selected filename is " + filename );
782 if( filename.right( 3 ) == "m3u" ) { 783 if( filename.right( 3 ) == "m3u" ) {
783 readm3u( filename ); 784 readm3u( filename );
784 } else if( filename.right(3) == "pls" ) { 785 } else if( filename.right(3) == "pls" ) {
785 readPls( filename ); 786 readPls( filename );
786 } else { 787 } else {
787 /* FIXME ....... AUDIO/X-MPEGURL is bad*/ 788 // this doesnt need fixing
788 DocLnk lnk; 789 DocLnk lnk;
789 lnk.setName( filename ); //sets file name 790 lnk.setName( filename ); //sets file name
790 lnk.setFile( filename ); //sets File property 791 lnk.setFile( filename ); //sets File property
791 //qWarning( "Mimetype: " + MimeType( QFile::encodeName(filename) ).id() ); 792 //qWarning( "Mimetype: " + MimeType( QFile::encodeName(filename) ).id() );
792 lnk.setType( MimeType( QFile::encodeName(filename) ).id() ); 793 lnk.setType( MimeType( QFile::encodeName(filename) ).id() );
793 lnk.setExec( "opieplayer" ); 794 lnk.setExec( "opieplayer" );
794 lnk.setIcon( "opieplayer2/MPEGPlayer" ); 795 lnk.setIcon( "opieplayer2/MPEGPlayer" );
795 796
796 if( !lnk.writeLink() ) { 797 if( !lnk.writeLink() ) {
797 qDebug( "Writing doclink did not work" ); 798 qDebug( "Writing doclink did not work" );
798 } 799 }
799 d->selectedFiles->addToSelection( lnk ); 800 d->selectedFiles->addToSelection( lnk );
@@ -920,24 +921,26 @@ void PlayListWidget::writem3u() {
920 fileDlg->exec(); 921 fileDlg->exec();
921 QString filename, list; 922 QString filename, list;
922 if( fileDlg->result() == 1 ) { 923 if( fileDlg->result() == 1 ) {
923 filename = fileDlg->text(); 924 filename = fileDlg->text();
924 qDebug( filename ); 925 qDebug( filename );
925 int noOfFiles = 0; 926 int noOfFiles = 0;
926 d->selectedFiles->first(); 927 d->selectedFiles->first();
927 do { 928 do {
928 // we dont check for existance because of url's 929 // we dont check for existance because of url's
929 // qDebug(d->selectedFiles->current()->file()); 930 // qDebug(d->selectedFiles->current()->file());
930 931
931 // so maybe we should do some net checking to ,-) 932 // so maybe we should do some net checking to ,-)
933 // no, cause it takes to long...
934
932 list += d->selectedFiles->current()->file() + "\n"; 935 list += d->selectedFiles->current()->file() + "\n";
933 noOfFiles++; 936 noOfFiles++;
934 } 937 }
935 while ( d->selectedFiles->next() ); 938 while ( d->selectedFiles->next() );
936 qDebug( list ); 939 qDebug( list );
937 if( filename.left( 1) != "/" ) { 940 if( filename.left( 1) != "/" ) {
938 filename=QPEApplication::documentDir() + "/" + filename; 941 filename=QPEApplication::documentDir() + "/" + filename;
939 } 942 }
940 if( filename.right( 3 ) != "m3u" ) { 943 if( filename.right( 3 ) != "m3u" ) {
941 filename=filename+".m3u"; 944 filename=filename+".m3u";
942 } 945 }
943 QFile f( filename ); 946 QFile f( filename );