author | llornkcor <llornkcor> | 2002-08-22 01:35:24 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-22 01:35:24 (UTC) |
commit | ee90b966cfc262770ef5a45c2bad0af6766245a2 (patch) (side-by-side diff) | |
tree | 3b80601759e3a2418b1b805229e4ea074fd7708f | |
parent | dbf4e3458811379488842f5d83650c7e4c6831aa (diff) | |
download | opie-ee90b966cfc262770ef5a45c2bad0af6766245a2.zip opie-ee90b966cfc262770ef5a45c2bad0af6766245a2.tar.gz opie-ee90b966cfc262770ef5a45c2bad0af6766245a2.tar.bz2 |
should scan for file at startup
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 11 |
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 @@ -162,48 +162,49 @@ void MediaPlayer::stopChangingVolume() { onScreenDisplayVolume = 0; int w=0; int h=0; if( !xineControl->hasVideo()) { w = audioUI->width(); h = audioUI->height(); audioUI->repaint( (w - 200) / 2, h - yoff, 200 + 9, 70, FALSE ); } else { w = videoUI->width(); h = videoUI->height(); videoUI->repaint( (w - 200) / 2, h - yoff, 200 + 9, 70, FALSE ); } } void MediaPlayer::timerEvent( QTimerEvent * ) { if ( volumeDirection == +1 ) { volControl->incVol(2); } else if ( volumeDirection == -1 ) { volControl->decVol(2); } // TODO FIXME + // huh?? unsigned int v= 0; v = volControl->volume(); v = v / 10; if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { return; } int w=0; int h=0; if( !xineControl->hasVideo()) { w = audioUI->width(); h = audioUI->height(); if ( drawnOnScreenDisplay ) { if ( onScreenDisplayVolume > v ) { audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE ); } } drawnOnScreenDisplay = TRUE; onScreenDisplayVolume = v; QPainter p( audioUI ); p.setPen( QColor( 0x10, 0xD0, 0x10 ) ); p.setBrush( QColor( 0x10, 0xD0, 0x10 ) ); 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 @@ -104,57 +104,58 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int ) ), this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int ) ) ); connect( audioView, SIGNAL( returnPressed( QListViewItem *) ), this,SLOT( playIt( QListViewItem *) ) ); connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int) ) ); connect( videoView, SIGNAL( returnPressed( QListViewItem *) ), this,SLOT( playIt( QListViewItem *) ) ); connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), this, SLOT( tabChanged( QWidget* ) ) ); connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); readConfig( cfg ); QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "" ); loadList(DocLnk( currentPlaylist ) ); setCaption( tr( "OpiePlayer: " ) + currentPlaylist ); // see which skins are installed + videoScan=FALSE; + audioScan=FALSE; populateSkinsMenu(); initializeStates(); } PlayListWidget::~PlayListWidget() { -/* fixing symptoms and not sources is entirely stupid - zecke */ -// Config cfg( "OpiePlayer" ); -// writeConfig( cfg ); + // WTF?!@?! + if ( d->current ) { delete d->current; } delete d; } void PlayListWidget::initializeStates() { d->tbPlay->setOn( mediaPlayerState->playing() ); d->tbLoop->setOn( mediaPlayerState->looping() ); d->tbShuffle->setOn( mediaPlayerState->shuffled() ); setPlaylist( true ); } void PlayListWidget::readConfig( Config& cfg ) { cfg.setGroup( "PlayList" ); QString currentString = cfg.readEntry( "current", "" ); int noOfFiles = cfg.readNumEntry( "NumberOfFiles", 0 ); for ( int i = 0; i < noOfFiles; i++ ) { QString entryName; entryName.sprintf( "File%i", i + 1 ); QString linkFile = cfg.readEntry( entryName ); if( QFileInfo( linkFile ).exists() ) { @@ -763,49 +764,49 @@ void PlayListWidget::populateVideoView() { QListViewItem * newItem; if ( QFile( Vdit.current()->file() ).exists() ) { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file() ).size() ), storage ); newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); } } } void PlayListWidget::openFile() { QString filename, name; InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->text(); qDebug( "Selected filename is " + filename ); if( filename.right( 3 ) == "m3u" ) { readm3u( filename ); } else if( filename.right(3) == "pls" ) { readPls( filename ); } else { - /* FIXME ....... AUDIO/X-MPEGURL is bad*/ + // this doesnt need fixing DocLnk lnk; lnk.setName( filename ); //sets file name lnk.setFile( filename ); //sets File property //qWarning( "Mimetype: " + MimeType( QFile::encodeName(filename) ).id() ); lnk.setType( MimeType( QFile::encodeName(filename) ).id() ); lnk.setExec( "opieplayer" ); lnk.setIcon( "opieplayer2/MPEGPlayer" ); if( !lnk.writeLink() ) { qDebug( "Writing doclink did not work" ); } d->selectedFiles->addToSelection( lnk ); } } if( fileDlg ) { delete fileDlg; } } void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { switch ( e->key() ) { ////////////////////////////// Zaurus keys case Key_F9: //activity // if(audioUI->isHidden()) @@ -908,48 +909,50 @@ void PlayListWidget::readm3u( const QString &filename ) { } i++; } } } } f.close(); } void PlayListWidget::writem3u() { InputDialog *fileDlg; fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); fileDlg->exec(); QString filename, list; if( fileDlg->result() == 1 ) { filename = fileDlg->text(); qDebug( filename ); int noOfFiles = 0; d->selectedFiles->first(); do { // we dont check for existance because of url's // qDebug(d->selectedFiles->current()->file()); // so maybe we should do some net checking to ,-) + // no, cause it takes to long... + list += d->selectedFiles->current()->file() + "\n"; noOfFiles++; } while ( d->selectedFiles->next() ); qDebug( list ); if( filename.left( 1) != "/" ) { filename=QPEApplication::documentDir() + "/" + filename; } if( filename.right( 3 ) != "m3u" ) { filename=filename+".m3u"; } QFile f( filename ); f.open( IO_WriteOnly ); f.writeBlock( list, list.length() ); f.close(); } if( fileDlg ) { delete fileDlg; } } void PlayListWidget::readPls( const QString &filename ) { qDebug( "pls filename is " + filename ); |