Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 176 |
1 files changed, 89 insertions, 87 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 3609f5d..d85ce50 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -22,6 +22,16 @@ -#include <qtoolbar.h> +#include "playlistselection.h" +#include "playlistwidget.h" +#include "mediaplayerstate.h" +#include "inputDialog.h" +#include "audiowidget.h" +#include "videowidget.h" + +/* OPIE */ #include <qpe/qpemenubar.h> #include <qpe/lnkproperties.h> +#include <opie2/odebug.h> +/* QT */ +#include <qtoolbar.h> #include <qaction.h> @@ -29,14 +39,6 @@ #include <qmessagebox.h> - //#include <qtimer.h> -#include "playlistselection.h" -#include "playlistwidget.h" -#include "mediaplayerstate.h" - -#include "inputDialog.h" - +/* STD */ #include <stdlib.h> -#include "audiowidget.h" -#include "videowidget.h" @@ -147,3 +149,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) tbDeletePlaylist->setFixedSize(20,20); - + d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist", @@ -194,6 +196,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); - + tabWidget = new QTabWidget( hbox6, "tabWidget" ); // tabWidget->setTabShape(QTabWidget::Triangular); - + QWidget *pTab; @@ -206,3 +208,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) // Add the playlist area - + QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); @@ -223,3 +225,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) - + QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch @@ -243,3 +245,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) audioView->addColumn( tr( "Path" ), -1 ); - + audioView->setColumnAlignment(1, Qt::AlignRight); @@ -251,3 +253,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) audioView->setSorting( 3, TRUE ); - + tabWidget->insertTab(aTab,tr("Audio")); @@ -259,3 +261,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) // videowidget - + QWidget *vTab; @@ -268,3 +270,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) layoutV->addMultiCellWidget( videoView, 0, 0, 0, 1 ); - + videoView->addColumn(tr("Title"),-1); @@ -305,3 +307,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) this,SLOT( viewPressed(int,QListViewItem*,const QPoint&,int)) ); - + connect( audioView, SIGNAL( returnPressed(QListViewItem*)), @@ -339,3 +341,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlayList))); - + initializeStates(); @@ -391,3 +393,3 @@ void PlayListWidget::writeConfig( Config& cfg ) const { entryName.sprintf( "File%i", noOfFiles + 1 ); -// qDebug(entryName); +// odebug << entryName << oendl; cfg.writeEntry( entryName, lnk->linkFile() ); @@ -408,3 +410,3 @@ void PlayListWidget::writeConfig( Config& cfg ) const { - } + } noOfFiles++; @@ -448,3 +450,3 @@ void PlayListWidget::addAllToList() { tabWidget->setCurrentPage(0); - + writeCurrentM3u(); @@ -456,3 +458,3 @@ void PlayListWidget::addAllMusicToList() { QListIterator<DocLnk> dit( files.children() ); - for ( ; dit.current(); ++dit ) + for ( ; dit.current(); ++dit ) if(QFileInfo(dit.current()->file()).exists()) @@ -460,3 +462,3 @@ void PlayListWidget::addAllMusicToList() { tabWidget->setCurrentPage(0); - + writeCurrentM3u(); @@ -472,3 +474,3 @@ void PlayListWidget::addAllVideoToList() { tabWidget->setCurrentPage(0); - + writeCurrentM3u(); @@ -485,3 +487,3 @@ void PlayListWidget::setDocument(const QString& fileref) { void PlayListWidget::setDocumentEx(const QString& fileref) { - qDebug("opieplayer receive "+fileref); + odebug << "opieplayer receive "+fileref << oendl; clearList(); @@ -494,3 +496,3 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { } - // qDebug("<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref); + // odebug << "<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref << oendl; QString extension = fileInfo.extension(false); @@ -536,3 +538,3 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { void PlayListWidget::setActiveWindow() { - // qDebug("SETTING active window"); + // odebug << "SETTING active window" << oendl; // When we get raised we need to ensure that it switches views @@ -553,3 +555,3 @@ const DocLnk *PlayListWidget::current() { // this is fugly { - // qDebug("playlist"); + // odebug << "playlist" << oendl; if ( mediaPlayerState->playlist() ) { @@ -566,3 +568,3 @@ const DocLnk *PlayListWidget::current() { // this is fugly { - // qDebug("audioView"); + // odebug << "audioView" << oendl; QListIterator<DocLnk> dit( files.children() ); @@ -574,3 +576,3 @@ const DocLnk *PlayListWidget::current() { // this is fugly } - } + } break; @@ -662,3 +664,3 @@ void PlayListWidget::loadList( const DocLnk & lnk) { QString name = lnk.name(); - // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); + // odebug << "<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name << oendl; @@ -666,3 +668,3 @@ void PlayListWidget::loadList( const DocLnk & lnk) { setCaption("OpiePlayer: "+name); - // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); + // odebug << "<<<<<<<<<<<<load list "+ lnk.file() << oendl; clearList(); @@ -674,3 +676,3 @@ void PlayListWidget::loadList( const DocLnk & lnk) { void PlayListWidget::setPlaylist( bool shown ) { - if ( shown ) + if ( shown ) d->playListFrame->show(); @@ -709,3 +711,3 @@ void PlayListWidget::addSelected() { break; - + case 2: { // video @@ -726,3 +728,3 @@ void PlayListWidget::addSelected() { // tabWidget->setCurrentPage(0); - writeCurrentM3u(); + writeCurrentM3u(); @@ -759,7 +761,7 @@ void PlayListWidget::addToSelection( QListViewItem *it) { d->selectedFiles->addToSelection( lnk); - + if(tabWidget->currentPageIndex() == 0) - writeCurrentM3u(); + writeCurrentM3u(); // tabWidget->setCurrentPage(0); - + } @@ -820,3 +822,3 @@ void PlayListWidget::btnPlay(bool b) { insanityBool=FALSE; - qDebug("insanity"); + odebug << "insanity" << oendl; // } @@ -832,3 +834,3 @@ void PlayListWidget::btnPlay(bool b) { tabWidget->setCurrentPage(1); - insanityBool=FALSE; + insanityBool=FALSE; }// audioView->clearSelection(); @@ -837,3 +839,3 @@ void PlayListWidget::btnPlay(bool b) { { - + addToSelection( videoView->currentItem() ); @@ -848,3 +850,3 @@ void PlayListWidget::btnPlay(bool b) { }; - + } @@ -876,5 +878,5 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint&, int m.insertSeparator(); - if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) + if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); - + m.exec( QCursor::pos() ); @@ -895,3 +897,3 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoi case 1: - + break; @@ -917,3 +919,3 @@ void PlayListWidget::listDelete() { switch ( tabWidget->currentPageIndex()) { - case 0: + case 0: break; @@ -953,3 +955,3 @@ void PlayListWidget::listDelete() { void PlayListWidget::scanForAudio() { - // qDebug("scan for audio"); + // odebug << "scan for audio" << oendl; files.detachChildren(); @@ -963,3 +965,3 @@ void PlayListWidget::scanForAudio() { void PlayListWidget::scanForVideo() { - // qDebug("scan for video"); + // odebug << "scan for video" << oendl; vFiles.detachChildren(); @@ -996,5 +998,5 @@ void PlayListWidget::populateAudioView() { size=0; - else + else size = QFile( dit.current()->file() ).size(); - // qDebug(dit.current()->name()); + // odebug << dit.current()->name() << oendl; newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), @@ -1042,3 +1044,3 @@ void PlayListWidget::openFile() { filename = fileDlg->text(); - // qDebug( "Selected filename is " + filename ); + // odebug << "Selected filename is " + filename << oendl; DocLnk lnk; @@ -1077,3 +1079,3 @@ void PlayListWidget::openFile() { } - + if( fileDlg ) { @@ -1086,4 +1088,4 @@ void PlayListWidget::openFile() { reads m3u and shows files/urls to playlist widget */ -void PlayListWidget::readm3u( const QString &filename ) { - // qDebug( "read m3u filename " + filename ); +void PlayListWidget::readm3u( const QString &filename ) { + // odebug << "read m3u filename " + filename << oendl; @@ -1096,3 +1098,3 @@ void PlayListWidget::readm3u( const QString &filename ) { s = *it; - // qDebug("reading "+ s); + // odebug << "reading "+ s << oendl; if(s.left(4)=="http") { @@ -1107,3 +1109,3 @@ void PlayListWidget::readm3u( const QString &filename ) { lnk.setFile( s ); //sets file name - + } else { @@ -1112,4 +1114,4 @@ void PlayListWidget::readm3u( const QString &filename ) { // if(s.right(4) == '.') {//if regular file - if(s.left(1) != "/") { - // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); + if(s.left(1) != "/") { + // odebug << "set link "+QFileInfo(filename).dirPath()+"/"+s << oendl; lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); @@ -1117,3 +1119,3 @@ void PlayListWidget::readm3u( const QString &filename ) { } else { - // qDebug("set link2 "+s); + // odebug << "set link2 "+s << oendl; lnk.setFile( s); @@ -1137,3 +1139,3 @@ void PlayListWidget::readm3u( const QString &filename ) { setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(filename))); - + } @@ -1144,3 +1146,3 @@ void PlayListWidget::readPls( const QString &filename ) { - // qDebug( "pls filename is " + filename ); + // odebug << "pls filename is " + filename << oendl; Om3u *m3uList; @@ -1187,3 +1189,3 @@ void PlayListWidget::readPls( const QString &filename ) { void PlayListWidget::writeCurrentM3u() { - // qDebug("writing to current m3u"); + // odebug << "writing to current m3u" << oendl; Config cfg( "OpiePlayer" ); @@ -1196,3 +1198,3 @@ void PlayListWidget::writeCurrentM3u() { do { - // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); + // odebug << "writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; m3uList->add( d->selectedFiles->current()->file() ); @@ -1200,3 +1202,3 @@ void PlayListWidget::writeCurrentM3u() { while ( d->selectedFiles->next() ); - // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); + // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; m3uList->write(); @@ -1219,3 +1221,3 @@ void PlayListWidget::writem3u() { name = fileDlg->text(); - // qDebug( filename ); + // odebug << filename << oendl; if( name.find("/",0,true) != -1) {// assume they specify a file path @@ -1229,3 +1231,3 @@ void PlayListWidget::writem3u() { filename += ".m3u"; - + if( d->selectedFiles->first()) { @@ -1237,3 +1239,3 @@ void PlayListWidget::writem3u() { while ( d->selectedFiles->next() ); - // qDebug( list ); + // odebug << list << oendl; m3uList->write(); @@ -1241,3 +1243,3 @@ void PlayListWidget::writem3u() { if(m3uList) delete m3uList; - + if(fileDlg) delete fileDlg; @@ -1249,6 +1251,6 @@ void PlayListWidget::writem3u() { - // qDebug(filename); + // odebug << filename << oendl; Config config( "OpiePlayer" ); config.setGroup( "PlayList" ); - + config.writeEntry("CurrentPlaylist",filename); @@ -1257,3 +1259,3 @@ void PlayListWidget::writem3u() { if(!lnk.writeLink()) { - // qDebug("Writing doclink did not work"); + // odebug << "Writing doclink did not work" << oendl; } @@ -1293,3 +1295,3 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) // case Key_P: //play -// qDebug("Play"); +// odebug << "Play" << oendl; // playSelected(); @@ -1309,3 +1311,3 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) case Key_4: - tabWidget->setCurrentPage(3); + tabWidget->setCurrentPage(3); break; @@ -1321,3 +1323,3 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) break; - + } @@ -1327,3 +1329,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) { -// qDebug("Key press"); +// odebug << "Key press" << oendl; // switch ( e->key() ) { @@ -1331,3 +1333,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) // case Key_A: //add to playlist -// qDebug("Add"); +// odebug << "Add" << oendl; // addSelected(); @@ -1338,3 +1340,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) // case Key_P: //play -// qDebug("Play"); +// odebug << "Play" << oendl; // playSelected(); @@ -1342,3 +1344,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) // case Key_Space: -// qDebug("Play"); +// odebug << "Play" << oendl; // playSelected(); @@ -1349,3 +1351,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) void PlayListWidget::doBlank() { - // qDebug("do blanking"); + // odebug << "do blanking" << oendl; #ifdef QT_QWS_DEVFS @@ -1365,3 +1367,3 @@ void PlayListWidget::doUnblank() { // fd=open("/dev/fb0",O_RDWR); - // qDebug("do unblanking"); + // odebug << "do unblanking" << oendl; if (fd != -1) { @@ -1390,3 +1392,3 @@ void PlayListWidget::populateSkinsMenu() { skinName = fi->fileName(); - // qDebug( fi->fileName() ); + // odebug << fi->fileName() << oendl; if( skinName != "." && skinName != ".." && skinName !="CVS" ) { @@ -1416,3 +1418,3 @@ void PlayListWidget::skinsMenuActivated( int item ) { void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { - // qDebug("qcop message "+msg ); + // odebug << "qcop message "+msg << oendl; QDataStream stream ( data, IO_ReadOnly ); @@ -1425,5 +1427,5 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { } else if ( msg == "next()" ) { //select next in lis - mediaPlayerState->setNext(); + mediaPlayerState->setNext(); } else if ( msg == "prev()" ) { //select previous in list - mediaPlayerState->setPrev(); + mediaPlayerState->setPrev(); } else if ( msg == "toggleLooping()" ) { //loop or not loop |