Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 90 |
1 files changed, 46 insertions, 44 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 | |||
@@ -21,23 +21,25 @@ | |||
21 | #define QTOPIA_INTERNAL_FSLP | 21 | #define QTOPIA_INTERNAL_FSLP |
22 | 22 | ||
23 | #include <qtoolbar.h> | 23 | #include "playlistselection.h" |
24 | #include "playlistwidget.h" | ||
25 | #include "mediaplayerstate.h" | ||
26 | #include "inputDialog.h" | ||
27 | #include "audiowidget.h" | ||
28 | #include "videowidget.h" | ||
29 | |||
30 | /* OPIE */ | ||
24 | #include <qpe/qpemenubar.h> | 31 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/lnkproperties.h> | 32 | #include <qpe/lnkproperties.h> |
33 | #include <opie2/odebug.h> | ||
26 | 34 | ||
35 | /* QT */ | ||
36 | #include <qtoolbar.h> | ||
27 | #include <qaction.h> | 37 | #include <qaction.h> |
28 | #include <qlayout.h> | 38 | #include <qlayout.h> |
29 | #include <qmessagebox.h> | 39 | #include <qmessagebox.h> |
30 | |||
31 | //#include <qtimer.h> | 40 | //#include <qtimer.h> |
32 | 41 | ||
33 | #include "playlistselection.h" | 42 | /* STD */ |
34 | #include "playlistwidget.h" | ||
35 | #include "mediaplayerstate.h" | ||
36 | |||
37 | #include "inputDialog.h" | ||
38 | |||
39 | #include <stdlib.h> | 43 | #include <stdlib.h> |
40 | #include "audiowidget.h" | ||
41 | #include "videowidget.h" | ||
42 | 44 | ||
43 | #include <unistd.h> | 45 | #include <unistd.h> |
@@ -390,5 +392,5 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
390 | QString entryName; | 392 | QString entryName; |
391 | entryName.sprintf( "File%i", noOfFiles + 1 ); | 393 | entryName.sprintf( "File%i", noOfFiles + 1 ); |
392 | // qDebug(entryName); | 394 | // odebug << entryName << oendl; |
393 | cfg.writeEntry( entryName, lnk->linkFile() ); | 395 | cfg.writeEntry( entryName, lnk->linkFile() ); |
394 | // if this link does exist, add it so we have the file | 396 | // if this link does exist, add it so we have the file |
@@ -484,5 +486,5 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
484 | 486 | ||
485 | void PlayListWidget::setDocumentEx(const QString& fileref) { | 487 | void PlayListWidget::setDocumentEx(const QString& fileref) { |
486 | qDebug("opieplayer receive "+fileref); | 488 | odebug << "opieplayer receive "+fileref << oendl; |
487 | clearList(); | 489 | clearList(); |
488 | DocLnk lnk; | 490 | DocLnk lnk; |
@@ -493,5 +495,5 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
493 | return; | 495 | return; |
494 | } | 496 | } |
495 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref); | 497 | // odebug << "<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref << oendl; |
496 | QString extension = fileInfo.extension(false); | 498 | QString extension = fileInfo.extension(false); |
497 | if( extension.find( "m3u", 0, false) != -1) { //is m3u | 499 | if( extension.find( "m3u", 0, false) != -1) { //is m3u |
@@ -535,5 +537,5 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
535 | 537 | ||
536 | void PlayListWidget::setActiveWindow() { | 538 | void PlayListWidget::setActiveWindow() { |
537 | // qDebug("SETTING active window"); | 539 | // odebug << "SETTING active window" << oendl; |
538 | // When we get raised we need to ensure that it switches views | 540 | // When we get raised we need to ensure that it switches views |
539 | char origView = mediaPlayerState->view(); | 541 | char origView = mediaPlayerState->view(); |
@@ -552,5 +554,5 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
552 | case 0: //playlist | 554 | case 0: //playlist |
553 | { | 555 | { |
554 | // qDebug("playlist"); | 556 | // odebug << "playlist" << oendl; |
555 | if ( mediaPlayerState->playlist() ) { | 557 | if ( mediaPlayerState->playlist() ) { |
556 | return d->selectedFiles->current(); | 558 | return d->selectedFiles->current(); |
@@ -565,5 +567,5 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
565 | case 1://audio | 567 | case 1://audio |
566 | { | 568 | { |
567 | // qDebug("audioView"); | 569 | // odebug << "audioView" << oendl; |
568 | QListIterator<DocLnk> dit( files.children() ); | 570 | QListIterator<DocLnk> dit( files.children() ); |
569 | for ( ; dit.current(); ++dit ) { | 571 | for ( ; dit.current(); ++dit ) { |
@@ -661,9 +663,9 @@ void PlayListWidget::saveList() { | |||
661 | void PlayListWidget::loadList( const DocLnk & lnk) { | 663 | void PlayListWidget::loadList( const DocLnk & lnk) { |
662 | QString name = lnk.name(); | 664 | QString name = lnk.name(); |
663 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); | 665 | // odebug << "<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name << oendl; |
664 | 666 | ||
665 | if( name.length()>0) { | 667 | if( name.length()>0) { |
666 | setCaption("OpiePlayer: "+name); | 668 | setCaption("OpiePlayer: "+name); |
667 | // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); | 669 | // odebug << "<<<<<<<<<<<<load list "+ lnk.file() << oendl; |
668 | clearList(); | 670 | clearList(); |
669 | readm3u(lnk.file()); | 671 | readm3u(lnk.file()); |
@@ -819,5 +821,5 @@ void PlayListWidget::btnPlay(bool b) { | |||
819 | mediaPlayerState->setPlaying(b); | 821 | mediaPlayerState->setPlaying(b); |
820 | insanityBool=FALSE; | 822 | insanityBool=FALSE; |
821 | qDebug("insanity"); | 823 | odebug << "insanity" << oendl; |
822 | // } | 824 | // } |
823 | } | 825 | } |
@@ -952,5 +954,5 @@ void PlayListWidget::listDelete() { | |||
952 | 954 | ||
953 | void PlayListWidget::scanForAudio() { | 955 | void PlayListWidget::scanForAudio() { |
954 | // qDebug("scan for audio"); | 956 | // odebug << "scan for audio" << oendl; |
955 | files.detachChildren(); | 957 | files.detachChildren(); |
956 | QListIterator<DocLnk> sdit( files.children() ); | 958 | QListIterator<DocLnk> sdit( files.children() ); |
@@ -962,5 +964,5 @@ void PlayListWidget::scanForAudio() { | |||
962 | } | 964 | } |
963 | void PlayListWidget::scanForVideo() { | 965 | void PlayListWidget::scanForVideo() { |
964 | // qDebug("scan for video"); | 966 | // odebug << "scan for video" << oendl; |
965 | vFiles.detachChildren(); | 967 | vFiles.detachChildren(); |
966 | QListIterator<DocLnk> sdit( vFiles.children() ); | 968 | QListIterator<DocLnk> sdit( vFiles.children() ); |
@@ -997,5 +999,5 @@ void PlayListWidget::populateAudioView() { | |||
997 | else | 999 | else |
998 | size = QFile( dit.current()->file() ).size(); | 1000 | size = QFile( dit.current()->file() ).size(); |
999 | // qDebug(dit.current()->name()); | 1001 | // odebug << dit.current()->name() << oendl; |
1000 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), | 1002 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), |
1001 | QString::number(size ), storage, dit.current()->file()); | 1003 | QString::number(size ), storage, dit.current()->file()); |
@@ -1041,5 +1043,5 @@ void PlayListWidget::openFile() { | |||
1041 | if( fileDlg->result() == 1 ) { | 1043 | if( fileDlg->result() == 1 ) { |
1042 | filename = fileDlg->text(); | 1044 | filename = fileDlg->text(); |
1043 | // qDebug( "Selected filename is " + filename ); | 1045 | // odebug << "Selected filename is " + filename << oendl; |
1044 | DocLnk lnk; | 1046 | DocLnk lnk; |
1045 | Config cfg( "OpiePlayer" ); | 1047 | Config cfg( "OpiePlayer" ); |
@@ -1086,5 +1088,5 @@ void PlayListWidget::openFile() { | |||
1086 | reads m3u and shows files/urls to playlist widget */ | 1088 | reads m3u and shows files/urls to playlist widget */ |
1087 | void PlayListWidget::readm3u( const QString &filename ) { | 1089 | void PlayListWidget::readm3u( const QString &filename ) { |
1088 | // qDebug( "read m3u filename " + filename ); | 1090 | // odebug << "read m3u filename " + filename << oendl; |
1089 | 1091 | ||
1090 | Om3u *m3uList; | 1092 | Om3u *m3uList; |
@@ -1095,5 +1097,5 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
1095 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 1097 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
1096 | s = *it; | 1098 | s = *it; |
1097 | // qDebug("reading "+ s); | 1099 | // odebug << "reading "+ s << oendl; |
1098 | if(s.left(4)=="http") { | 1100 | if(s.left(4)=="http") { |
1099 | lnk.setName( s ); //sets file name | 1101 | lnk.setName( s ); //sets file name |
@@ -1112,9 +1114,9 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
1112 | // if(s.right(4) == '.') {//if regular file | 1114 | // if(s.right(4) == '.') {//if regular file |
1113 | if(s.left(1) != "/") { | 1115 | if(s.left(1) != "/") { |
1114 | // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); | 1116 | // odebug << "set link "+QFileInfo(filename).dirPath()+"/"+s << oendl; |
1115 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); | 1117 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); |
1116 | lnk.setIcon("SoundPlayer"); | 1118 | lnk.setIcon("SoundPlayer"); |
1117 | } else { | 1119 | } else { |
1118 | // qDebug("set link2 "+s); | 1120 | // odebug << "set link2 "+s << oendl; |
1119 | lnk.setFile( s); | 1121 | lnk.setFile( s); |
1120 | lnk.setIcon("SoundPlayer"); | 1122 | lnk.setIcon("SoundPlayer"); |
@@ -1143,5 +1145,5 @@ reads pls and adds files/urls to playlist */ | |||
1143 | void PlayListWidget::readPls( const QString &filename ) { | 1145 | void PlayListWidget::readPls( const QString &filename ) { |
1144 | 1146 | ||
1145 | // qDebug( "pls filename is " + filename ); | 1147 | // odebug << "pls filename is " + filename << oendl; |
1146 | Om3u *m3uList; | 1148 | Om3u *m3uList; |
1147 | QString s, name; | 1149 | QString s, name; |
@@ -1186,5 +1188,5 @@ void PlayListWidget::readPls( const QString &filename ) { | |||
1186 | writes current playlist to current m3u file */ | 1188 | writes current playlist to current m3u file */ |
1187 | void PlayListWidget::writeCurrentM3u() { | 1189 | void PlayListWidget::writeCurrentM3u() { |
1188 | // qDebug("writing to current m3u"); | 1190 | // odebug << "writing to current m3u" << oendl; |
1189 | Config cfg( "OpiePlayer" ); | 1191 | Config cfg( "OpiePlayer" ); |
1190 | cfg.setGroup("PlayList"); | 1192 | cfg.setGroup("PlayList"); |
@@ -1195,9 +1197,9 @@ void PlayListWidget::writeCurrentM3u() { | |||
1195 | if( d->selectedFiles->first()) { | 1197 | if( d->selectedFiles->first()) { |
1196 | do { | 1198 | do { |
1197 | // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); | 1199 | // odebug << "writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; |
1198 | m3uList->add( d->selectedFiles->current()->file() ); | 1200 | m3uList->add( d->selectedFiles->current()->file() ); |
1199 | } | 1201 | } |
1200 | while ( d->selectedFiles->next() ); | 1202 | while ( d->selectedFiles->next() ); |
1201 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 1203 | // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; |
1202 | m3uList->write(); | 1204 | m3uList->write(); |
1203 | m3uList->close(); | 1205 | m3uList->close(); |
@@ -1218,5 +1220,5 @@ void PlayListWidget::writem3u() { | |||
1218 | if( fileDlg->result() == 1 ) { | 1220 | if( fileDlg->result() == 1 ) { |
1219 | name = fileDlg->text(); | 1221 | name = fileDlg->text(); |
1220 | // qDebug( filename ); | 1222 | // odebug << filename << oendl; |
1221 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 1223 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
1222 | filename = name; | 1224 | filename = name; |
@@ -1236,5 +1238,5 @@ void PlayListWidget::writem3u() { | |||
1236 | } | 1238 | } |
1237 | while ( d->selectedFiles->next() ); | 1239 | while ( d->selectedFiles->next() ); |
1238 | // qDebug( list ); | 1240 | // odebug << list << oendl; |
1239 | m3uList->write(); | 1241 | m3uList->write(); |
1240 | m3uList->close(); | 1242 | m3uList->close(); |
@@ -1248,5 +1250,5 @@ void PlayListWidget::writem3u() { | |||
1248 | lnk.setName( name); //sets file name | 1250 | lnk.setName( name); //sets file name |
1249 | 1251 | ||
1250 | // qDebug(filename); | 1252 | // odebug << filename << oendl; |
1251 | Config config( "OpiePlayer" ); | 1253 | Config config( "OpiePlayer" ); |
1252 | config.setGroup( "PlayList" ); | 1254 | config.setGroup( "PlayList" ); |
@@ -1256,5 +1258,5 @@ void PlayListWidget::writem3u() { | |||
1256 | 1258 | ||
1257 | if(!lnk.writeLink()) { | 1259 | if(!lnk.writeLink()) { |
1258 | // qDebug("Writing doclink did not work"); | 1260 | // odebug << "Writing doclink did not work" << oendl; |
1259 | } | 1261 | } |
1260 | 1262 | ||
@@ -1292,5 +1294,5 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1292 | break; | 1294 | break; |
1293 | // case Key_P: //play | 1295 | // case Key_P: //play |
1294 | // qDebug("Play"); | 1296 | // odebug << "Play" << oendl; |
1295 | // playSelected(); | 1297 | // playSelected(); |
1296 | // break; | 1298 | // break; |
@@ -1326,9 +1328,9 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1326 | void PlayListWidget::keyPressEvent( QKeyEvent *) | 1328 | void PlayListWidget::keyPressEvent( QKeyEvent *) |
1327 | { | 1329 | { |
1328 | // qDebug("Key press"); | 1330 | // odebug << "Key press" << oendl; |
1329 | // switch ( e->key() ) { | 1331 | // switch ( e->key() ) { |
1330 | // ////////////////////////////// Zaurus keys | 1332 | // ////////////////////////////// Zaurus keys |
1331 | // case Key_A: //add to playlist | 1333 | // case Key_A: //add to playlist |
1332 | // qDebug("Add"); | 1334 | // odebug << "Add" << oendl; |
1333 | // addSelected(); | 1335 | // addSelected(); |
1334 | // break; | 1336 | // break; |
@@ -1337,9 +1339,9 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) | |||
1337 | // break; | 1339 | // break; |
1338 | // case Key_P: //play | 1340 | // case Key_P: //play |
1339 | // qDebug("Play"); | 1341 | // odebug << "Play" << oendl; |
1340 | // playSelected(); | 1342 | // playSelected(); |
1341 | // break; | 1343 | // break; |
1342 | // case Key_Space: | 1344 | // case Key_Space: |
1343 | // qDebug("Play"); | 1345 | // odebug << "Play" << oendl; |
1344 | // playSelected(); | 1346 | // playSelected(); |
1345 | // break; | 1347 | // break; |
@@ -1348,5 +1350,5 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) | |||
1348 | 1350 | ||
1349 | void PlayListWidget::doBlank() { | 1351 | void PlayListWidget::doBlank() { |
1350 | // qDebug("do blanking"); | 1352 | // odebug << "do blanking" << oendl; |
1351 | #ifdef QT_QWS_DEVFS | 1353 | #ifdef QT_QWS_DEVFS |
1352 | fd=open("/dev/fb/0",O_RDWR); | 1354 | fd=open("/dev/fb/0",O_RDWR); |
@@ -1364,5 +1366,5 @@ void PlayListWidget::doUnblank() { | |||
1364 | // int fd; | 1366 | // int fd; |
1365 | // fd=open("/dev/fb0",O_RDWR); | 1367 | // fd=open("/dev/fb0",O_RDWR); |
1366 | // qDebug("do unblanking"); | 1368 | // odebug << "do unblanking" << oendl; |
1367 | if (fd != -1) { | 1369 | if (fd != -1) { |
1368 | ioctl(fd,FBIOBLANK,0); | 1370 | ioctl(fd,FBIOBLANK,0); |
@@ -1389,5 +1391,5 @@ void PlayListWidget::populateSkinsMenu() { | |||
1389 | while ( ( fi = it.current() ) ) { | 1391 | while ( ( fi = it.current() ) ) { |
1390 | skinName = fi->fileName(); | 1392 | skinName = fi->fileName(); |
1391 | // qDebug( fi->fileName() ); | 1393 | // odebug << fi->fileName() << oendl; |
1392 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 1394 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
1393 | item = skinsMenu->insertItem( fi->fileName() ) ; | 1395 | item = skinsMenu->insertItem( fi->fileName() ) ; |
@@ -1415,5 +1417,5 @@ void PlayListWidget::skinsMenuActivated( int item ) { | |||
1415 | 1417 | ||
1416 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1418 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1417 | // qDebug("qcop message "+msg ); | 1419 | // odebug << "qcop message "+msg << oendl; |
1418 | QDataStream stream ( data, IO_ReadOnly ); | 1420 | QDataStream stream ( data, IO_ReadOnly ); |
1419 | if ( msg == "play()" ) { //plays current selection | 1421 | if ( msg == "play()" ) { //plays current selection |