author | bipolar <bipolar> | 2002-03-06 02:57:58 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-06 02:57:58 (UTC) |
commit | f8e5caafffd11726cf0b0ea6a69c19aaad379533 (patch) (side-by-side diff) | |
tree | e29820f9a66f6446a9329cc0404c045f1b20f148 | |
parent | 406bed0f501ea131ba31dbdecdde8c1fe8b15806 (diff) | |
download | opie-f8e5caafffd11726cf0b0ea6a69c19aaad379533.zip opie-f8e5caafffd11726cf0b0ea6a69c19aaad379533.tar.gz opie-f8e5caafffd11726cf0b0ea6a69c19aaad379533.tar.bz2 |
ljp:fixed stuff
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 21 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.h | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 35 |
3 files changed, 29 insertions, 28 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index d70df51..d6aff66 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp @@ -37,56 +37,59 @@ public: setPixmap( 0, f->pixmap() ); } ~PlayListSelectionItem() { }; const DocLnk *file() const { return fl; } private: const DocLnk *fl; }; PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) : QListView( parent, name ) { + qDebug("starting playlistselector"); // #ifdef USE_PLAYLIST_BACKGROUND - setStaticBackground( TRUE ); -// setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) ); - setBackgroundPixmap( Resource::loadPixmap( "opielogo" ) ); +// setStaticBackground( TRUE ); +// setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) ); + +// setBackgroundPixmap( Resource::loadPixmap( "opielogo" ) ); // #endif // addColumn("Title",236); // setAllColumnsShowFocus( TRUE ); - addColumn( tr( "Playlist Selection" ) ); + addColumn( tr( "Playlist Selection" ) ); header()->hide(); setSorting( -1, FALSE ); } PlayListSelection::~PlayListSelection() { } // #ifdef USE_PLAYLIST_BACKGROUND void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { - p->fillRect( r, QBrush( white ) ); -// QImage logo = Resource::loadImage( "mpegplayer/background" ); - QImage logo = Resource::loadImage( "opielogo" ); - if ( !logo.isNull() ) - p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); +// qDebug("drawBackground"); +// p->fillRect( r, QBrush( white ) ); +// QImage logo = Resource::loadImage( "mpegplayer/background" ); +// // QImage logo = Resource::loadImage( "opielogo" ); +// if ( !logo.isNull() ) +// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); } // #endif void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { if ( event->state() == QMouseEvent::LeftButton ) { QListViewItem *currentItem = selectedItem(); QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); if ( currentItem && currentItem->itemAbove() == itemUnder ) moveSelectedUp(); else if ( currentItem && currentItem->itemBelow() == itemUnder ) moveSelectedDown(); } } diff --git a/core/multimedia/opieplayer/playlistselection.h b/core/multimedia/opieplayer/playlistselection.h index 57e10f1..b0d249c 100644 --- a/core/multimedia/opieplayer/playlistselection.h +++ b/core/multimedia/opieplayer/playlistselection.h @@ -19,33 +19,32 @@ **********************************************************************/ #ifndef PLAY_LIST_SELECTION_H #define PLAY_LIST_SELECTION_H #include <qlist.h> #include <qlistview.h> #include <qpe/applnk.h> class PlayListSelection : public QListView { Q_OBJECT public: PlayListSelection( QWidget *parent, const char *name=0 ); ~PlayListSelection(); const DocLnk *current(); // retrieve the current playlist entry (media file link) - public slots: void addToSelection( const DocLnk & ); // Add a media file to the playlist void removeSelected(); // Remove a media file from the playlist void moveSelectedUp(); // Move the media file up the playlist so it is played earlier void moveSelectedDown(); // Move the media file down the playlist so it is played later bool prev(); bool next(); bool first(); bool last(); protected: virtual void contentsMouseMoveEvent(QMouseEvent *); /* #ifdef USE_PLAYLIST_BACKGROUND */ virtual void drawBackground( QPainter *p, const QRect &r ); virtual void paintEmptyArea( QPainter *p, const QRect &r ) { drawBackground( p, r ); }; /* #endif */ diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index a6202bc..3171a84 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -405,39 +405,47 @@ void PlayListWidget::addAllMusicToList() { void PlayListWidget::addAllVideoToList() { DocLnkSet files; Global::findDocuments(&files, "video/*"); QListIterator<DocLnk> dit( files.children() ); for ( ; dit.current(); ++dit ) d->selectedFiles->addToSelection( **dit ); } void PlayListWidget::setDocument(const QString& fileref) { if ( fileref.isNull() ) { QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); return; } + if(fileref.find("playlist",0,TRUE) == -1) { addToSelection( DocLnk( fileref ) ); d->setDocumentUsed = TRUE; qApp->processEvents(); mediaPlayerState->setPlaying( FALSE ); qApp->processEvents(); mediaPlayerState->setPlaying( TRUE ); d->selectedFiles->removeSelected( ); + } else { + loadList(DocLnk(fileref)); + d->selectedFiles->first(); +// mediaPlayerState->setPlaying( TRUE ); +// mediaPlayerState->setPlaying( FALSE ); + + } } void PlayListWidget::setActiveWindow() { // When we get raised we need to ensure that it switches views char origView = mediaPlayerState->view(); mediaPlayerState->setView( 'l' ); // invalidate mediaPlayerState->setView( origView ); // now switch back } void PlayListWidget::useSelectedDocument() { d->setDocumentUsed = FALSE; } @@ -516,56 +524,47 @@ bool PlayListWidget::last() { if ( mediaPlayerState->playlist() ) return d->selectedFiles->last(); else return mediaPlayerState->looping(); } void PlayListWidget::saveList() { QString filename; InputDialog *fileDlg; fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->LineEdit1->text();//+".playlist"; qDebug("saving playlist "+filename+".playlist"); - -// DocLnk *lnk; -// lnk.setName( filename); //sets file name -// // lnk.setComment(title); -// lnk.setFile( filename+".playlist"); //sets File property -// lnk.setType("player/plain");// hey is this a REGISTERED mime type?!?!? ;D -// lnk.setIcon("MPEGPlayer"); -// if(!lnk.writeLink()) -// qDebug("Writing doclink did not work"); - Config cfg( filename +".playlist"); writeConfig( cfg ); + DocLnk lnk; + lnk.setName( filename); //sets file name +// lnk.setComment( ""); + lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property + lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D + lnk.setIcon("mpegplayer/playlist2"); + if(!lnk.writeLink()) + qDebug("Writing doclink did not work"); } - DocLnk lnk; - lnk.setName( filename); //sets file name -// lnk.setComment(title); - lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property - lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D - lnk.setIcon("MPEGPlayer"); - if(!lnk.writeLink()) - qDebug("Writing doclink did not work"); if(fileDlg) delete fileDlg; + } void PlayListWidget::loadList( const DocLnk & lnk) { qDebug("load list "+ lnk.name()+".playlist"); clearList(); Config cfg( lnk.name()+".playlist"); readConfig(cfg); tabWidget->setCurrentPage(0); setCaption("OpiePlayer: "+lnk.name()); } void PlayListWidget::setPlaylist( bool shown ) { if ( shown ) d->playListFrame->show(); |