Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 142 |
1 files changed, 57 insertions, 85 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 7ea95ab..1fc7dd8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -307,13 +307,12 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
307 | 307 | ||
308 | QWidget *LTab; | 308 | QWidget *LTab; |
309 | LTab = new QWidget( tabWidget, "LTab" ); | 309 | LTab = new QWidget( tabWidget, "LTab" ); |
310 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy | 310 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE); |
311 | 311 | ||
312 | QGridLayout *layoutL = new QGridLayout( LTab ); | 312 | QGridLayout *layoutL = new QGridLayout( LTab ); |
313 | layoutL->setSpacing( 2); | 313 | layoutL->setSpacing( 2); |
314 | layoutL->setMargin( 2); | 314 | layoutL->setMargin( 2); |
315 | layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 315 | layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
316 | // playLists->setMinimumSize(233,260); | ||
317 | 316 | ||
318 | tabWidget->insertTab(LTab,tr("Lists")); | 317 | tabWidget->insertTab(LTab,tr("Lists")); |
319 | 318 | ||
@@ -358,12 +357,12 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
358 | 357 | ||
359 | Config cfg( "OpiePlayer" ); | 358 | Config cfg( "OpiePlayer" ); |
360 | readConfig( cfg ); | 359 | readConfig( cfg ); |
361 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); | 360 | |
362 | loadList(DocLnk( currentPlaylist)); | 361 | currentPlayList = cfg.readEntry("CurrentPlaylist","default"); |
363 | setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlaylist))); | 362 | loadList(DocLnk( currentPlayList)); |
363 | setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlayList))); | ||
364 | 364 | ||
365 | initializeStates(); | 365 | initializeStates(); |
366 | // audioUI->setFocus(); | ||
367 | } | 366 | } |
368 | 367 | ||
369 | 368 | ||
@@ -421,15 +420,16 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
421 | if ( !QFile::exists( lnk->linkFile() ) ) { | 420 | if ( !QFile::exists( lnk->linkFile() ) ) { |
422 | // the way writing lnks doesn't really check for out | 421 | // the way writing lnks doesn't really check for out |
423 | // of disk space, but check it anyway. | 422 | // of disk space, but check it anyway. |
424 | if ( !lnk->writeLink() ) { | 423 | // if ( !lnk->writeLink() ) { |
425 | QMessageBox::critical( 0, tr("Out of space"), | 424 | // QMessageBox::critical( 0, tr("Out of space"), |
426 | tr( "There was a problem saving " | 425 | // tr( "There was a problem saving " |
427 | "the playlist.\n" | 426 | // "the playlist.\n" |
428 | "Your playlist " | 427 | // "Your playlist " |
429 | "may be missing some entries\n" | 428 | // "may be missing some entries\n" |
430 | "the next time you start it." ) | 429 | // "the next time you start it." ) |
431 | ); | 430 | // ); |
432 | } | 431 | // } |
432 | |||
433 | } | 433 | } |
434 | noOfFiles++; | 434 | noOfFiles++; |
435 | } | 435 | } |
@@ -447,12 +447,18 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { | |||
447 | } | 447 | } |
448 | else | 448 | else |
449 | mediaPlayerState->setPlaying( true); | 449 | mediaPlayerState->setPlaying( true); |
450 | |||
450 | } | 451 | } |
451 | 452 | ||
452 | 453 | ||
453 | void PlayListWidget::clearList() { | 454 | void PlayListWidget::clearList() { |
454 | while ( first() ) | 455 | while ( first() ) |
455 | d->selectedFiles->removeSelected(); | 456 | d->selectedFiles->removeSelected(); |
457 | Config cfg( "OpiePlayer" ); | ||
458 | cfg.setGroup("PlayList"); | ||
459 | cfg.writeEntry("CurrentPlaylist",""); | ||
460 | currentPlayList=""; | ||
461 | |||
456 | } | 462 | } |
457 | 463 | ||
458 | 464 | ||
@@ -497,21 +503,20 @@ void PlayListWidget::addAllVideoToList() { | |||
497 | void PlayListWidget::setDocument(const QString& fileref) { | 503 | void PlayListWidget::setDocument(const QString& fileref) { |
498 | fromSetDocument = true; | 504 | fromSetDocument = true; |
499 | d->setDocumentUsed = TRUE; | 505 | d->setDocumentUsed = TRUE; |
500 | d->selectedFiles->setSelected(d->selectedFiles->firstChild(),true ); | 506 | setDocumentEx(fileref); |
501 | mediaPlayerState->setPlaying( FALSE ); | ||
502 | qApp->processEvents(); | ||
503 | mediaPlayerState->setPlaying( TRUE ); | ||
504 | } | 507 | } |
505 | 508 | ||
506 | void PlayListWidget::setDocumentEx(const QString& fileref) { | 509 | void PlayListWidget::setDocumentEx(const QString& fileref) { |
507 | 510 | qDebug("opieplayer receive "+fileref); | |
511 | clearList(); | ||
512 | DocLnk lnk; | ||
508 | QFileInfo fileInfo(fileref); | 513 | QFileInfo fileInfo(fileref); |
509 | if ( !fileInfo.exists() ) { | 514 | if ( !fileInfo.exists() ) { |
510 | QMessageBox::critical( 0, tr( "Invalid File" ), | 515 | QMessageBox::critical( 0, tr( "Invalid File" ), |
511 | tr( "There was a problem in getting the file." ) ); | 516 | tr( "There was a problem in getting the file." ) ); |
512 | return; | 517 | return; |
513 | } | 518 | } |
514 | qDebug("setDocument "+fileref); | 519 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref); |
515 | QString extension = fileInfo.extension(false); | 520 | QString extension = fileInfo.extension(false); |
516 | if( extension.find( "m3u", 0, false) != -1) { //is m3u | 521 | if( extension.find( "m3u", 0, false) != -1) { //is m3u |
517 | readm3u( fileref); | 522 | readm3u( fileref); |
@@ -521,33 +526,39 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
521 | } | 526 | } |
522 | else if( fileref.find("playlist",0,TRUE) != -1) {//is playlist | 527 | else if( fileref.find("playlist",0,TRUE) != -1) {//is playlist |
523 | clearList(); | 528 | clearList(); |
524 | DocLnk lnk; | ||
525 | lnk.setName( fileInfo.baseName() ); //sets name | 529 | lnk.setName( fileInfo.baseName() ); //sets name |
526 | lnk.setFile( fileref ); //sets file name | 530 | lnk.setFile( fileref ); //sets file name |
531 | lnk.setIcon("Sound"); | ||
527 | //addToSelection( lnk ); | 532 | //addToSelection( lnk ); |
528 | 533 | ||
529 | loadList( lnk); | 534 | loadList( lnk); |
530 | d->selectedFiles->first(); | 535 | d->selectedFiles->first(); |
531 | } else { | 536 | } else { |
532 | clearList(); | 537 | if( fileref.find(".desktop",0,TRUE) != -1) { |
533 | DocLnk lnk; | 538 | lnk = DocLnk(fileref); |
539 | } else { | ||
534 | lnk.setName( fileInfo.baseName() ); //sets name | 540 | lnk.setName( fileInfo.baseName() ); //sets name |
535 | lnk.setFile( fileref ); //sets file name | 541 | lnk.setFile( fileref ); //sets file name |
542 | lnk.setIcon("Sound"); | ||
543 | } | ||
544 | |||
536 | addToSelection( lnk ); | 545 | addToSelection( lnk ); |
537 | // addToSelection( DocLnk( fileref ) ); | 546 | // addToSelection( DocLnk( fileref ) ); |
547 | lnk.removeLinkFile(); | ||
548 | // qApp->processEvents(); | ||
549 | } | ||
550 | setCaption(tr("OpiePlayer")); | ||
538 | d->setDocumentUsed = TRUE; | 551 | d->setDocumentUsed = TRUE; |
552 | d->selectedFiles->setSelected(d->selectedFiles->firstChild(),true ); | ||
539 | mediaPlayerState->setPlaying( FALSE ); | 553 | mediaPlayerState->setPlaying( FALSE ); |
540 | qApp->processEvents(); | 554 | qApp->processEvents(); |
541 | mediaPlayerState->setPlaying( TRUE ); | 555 | mediaPlayerState->setPlaying( TRUE ); |
542 | // qApp->processEvents(); | 556 | |
543 | setCaption(tr("OpiePlayer")); | ||
544 | } | ||
545 | } | 557 | } |
546 | 558 | ||
547 | 559 | ||
548 | void PlayListWidget::setActiveWindow() { | 560 | void PlayListWidget::setActiveWindow() { |
549 | qDebug("SETTING active window"); | 561 | // qDebug("SETTING active window"); |
550 | |||
551 | // When we get raised we need to ensure that it switches views | 562 | // When we get raised we need to ensure that it switches views |
552 | char origView = mediaPlayerState->view(); | 563 | char origView = mediaPlayerState->view(); |
553 | mediaPlayerState->setView( 'l' ); // invalidate | 564 | mediaPlayerState->setView( 'l' ); // invalidate |
@@ -561,26 +572,10 @@ void PlayListWidget::useSelectedDocument() { | |||
561 | 572 | ||
562 | 573 | ||
563 | const DocLnk *PlayListWidget::current() { // this is fugly | 574 | const DocLnk *PlayListWidget::current() { // this is fugly |
564 | |||
565 | // if( fromSetDocument) { | ||
566 | // qDebug("from setDoc"); | ||
567 | // DocLnkSet files; | ||
568 | // Global::findDocuments(&files, "video/*;audio/*"); | ||
569 | // QListIterator<DocLnk> dit( files.children() ); | ||
570 | // for ( ; dit.current(); ++dit ) { | ||
571 | // if(dit.current()->linkFile() == setDocFileRef) { | ||
572 | // qDebug(setDocFileRef); | ||
573 | // return dit; | ||
574 | // } | ||
575 | // } | ||
576 | // } else | ||
577 | |||
578 | qDebug("current"); | ||
579 | |||
580 | switch (tabWidget->currentPageIndex()) { | 575 | switch (tabWidget->currentPageIndex()) { |
581 | case 0: //playlist | 576 | case 0: //playlist |
582 | { | 577 | { |
583 | qDebug("playlist"); | 578 | // qDebug("playlist"); |
584 | if ( mediaPlayerState->playlist() ) { | 579 | if ( mediaPlayerState->playlist() ) { |
585 | return d->selectedFiles->current(); | 580 | return d->selectedFiles->current(); |
586 | } | 581 | } |
@@ -593,11 +588,10 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
593 | break; | 588 | break; |
594 | case 1://audio | 589 | case 1://audio |
595 | { | 590 | { |
596 | qDebug("audioView"); | 591 | // qDebug("audioView"); |
597 | QListIterator<DocLnk> dit( files.children() ); | 592 | QListIterator<DocLnk> dit( files.children() ); |
598 | for ( ; dit.current(); ++dit ) { | 593 | for ( ; dit.current(); ++dit ) { |
599 | if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { | 594 | if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { |
600 | qDebug("here"); | ||
601 | insanityBool=TRUE; | 595 | insanityBool=TRUE; |
602 | return dit; | 596 | return dit; |
603 | } | 597 | } |
@@ -606,7 +600,6 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
606 | break; | 600 | break; |
607 | case 2: // video | 601 | case 2: // video |
608 | { | 602 | { |
609 | qDebug("videoView"); | ||
610 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 603 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
611 | for ( ; Vdit.current(); ++Vdit ) { | 604 | for ( ; Vdit.current(); ++Vdit ) { |
612 | if( Vdit.current()->name() == videoView->currentItem()->text(0) && !insanityBool) { | 605 | if( Vdit.current()->name() == videoView->currentItem()->text(0) && !insanityBool) { |
@@ -717,7 +710,6 @@ void PlayListWidget::setView( char view ) { | |||
717 | } | 710 | } |
718 | 711 | ||
719 | void PlayListWidget::addSelected() { | 712 | void PlayListWidget::addSelected() { |
720 | qDebug("addSelected"); | ||
721 | DocLnk lnk; | 713 | DocLnk lnk; |
722 | QString filename; | 714 | QString filename; |
723 | switch (tabWidget->currentPageIndex()) { | 715 | switch (tabWidget->currentPageIndex()) { |
@@ -767,7 +759,6 @@ void PlayListWidget::removeSelected() { | |||
767 | void PlayListWidget::playIt( QListViewItem *) { | 759 | void PlayListWidget::playIt( QListViewItem *) { |
768 | // d->setDocumentUsed = FALSE; | 760 | // d->setDocumentUsed = FALSE; |
769 | // mediaPlayerState->curPosition =0; | 761 | // mediaPlayerState->curPosition =0; |
770 | qDebug("playIt"); | ||
771 | // mediaPlayerState->setPlaying(FALSE); | 762 | // mediaPlayerState->setPlaying(FALSE); |
772 | mediaPlayerState->setPlaying(TRUE); | 763 | mediaPlayerState->setPlaying(TRUE); |
773 | d->selectedFiles->unSelect(); | 764 | d->selectedFiles->unSelect(); |
@@ -841,12 +832,10 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
841 | } | 832 | } |
842 | 833 | ||
843 | void PlayListWidget::btnPlay(bool b) { | 834 | void PlayListWidget::btnPlay(bool b) { |
844 | qDebug("<<<<<<<<<<<<<<<BtnPlay %d", b); | ||
845 | // mediaPlayerState->setPlaying(b); | 835 | // mediaPlayerState->setPlaying(b); |
846 | switch ( tabWidget->currentPageIndex()) { | 836 | switch ( tabWidget->currentPageIndex()) { |
847 | case 0: | 837 | case 0: |
848 | { | 838 | { |
849 | qDebug("1"); | ||
850 | // if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 | 839 | // if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 |
851 | // if( d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { | 840 | // if( d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { |
852 | // QMessageBox::message("Note","You are trying to play\na malformed url."); | 841 | // QMessageBox::message("Note","You are trying to play\na malformed url."); |
@@ -859,7 +848,6 @@ void PlayListWidget::btnPlay(bool b) { | |||
859 | break; | 848 | break; |
860 | case 1: | 849 | case 1: |
861 | { | 850 | { |
862 | qDebug("2"); | ||
863 | // d->selectedFiles->unSelect(); | 851 | // d->selectedFiles->unSelect(); |
864 | addToSelection( audioView->currentItem() ); | 852 | addToSelection( audioView->currentItem() ); |
865 | mediaPlayerState->setPlaying( b); | 853 | mediaPlayerState->setPlaying( b); |
@@ -871,7 +859,6 @@ void PlayListWidget::btnPlay(bool b) { | |||
871 | break; | 859 | break; |
872 | case 2: | 860 | case 2: |
873 | { | 861 | { |
874 | qDebug("3"); | ||
875 | 862 | ||
876 | addToSelection( videoView->currentItem() ); | 863 | addToSelection( videoView->currentItem() ); |
877 | mediaPlayerState->setPlaying( b); | 864 | mediaPlayerState->setPlaying( b); |
@@ -922,7 +909,6 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint&, int | |||
922 | 909 | ||
923 | void PlayListWidget::playSelected() | 910 | void PlayListWidget::playSelected() |
924 | { | 911 | { |
925 | qDebug("playSelected"); | ||
926 | btnPlay( true); | 912 | btnPlay( true); |
927 | // d->selectedFiles->unSelect(); | 913 | // d->selectedFiles->unSelect(); |
928 | } | 914 | } |
@@ -949,7 +935,7 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoi | |||
949 | void PlayListWidget::listDelete() { | 935 | void PlayListWidget::listDelete() { |
950 | Config cfg( "OpiePlayer" ); | 936 | Config cfg( "OpiePlayer" ); |
951 | cfg.setGroup("PlayList"); | 937 | cfg.setGroup("PlayList"); |
952 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 938 | currentPlayList = cfg.readEntry("CurrentPlaylist",""); |
953 | QString file; | 939 | QString file; |
954 | // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); | 940 | // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
955 | switch ( tabWidget->currentPageIndex()) { | 941 | switch ( tabWidget->currentPageIndex()) { |
@@ -1073,15 +1059,13 @@ void PlayListWidget::populateVideoView() { | |||
1073 | } | 1059 | } |
1074 | 1060 | ||
1075 | void PlayListWidget::openFile() { | 1061 | void PlayListWidget::openFile() { |
1076 | qDebug("<<<<<<<<<OPEN File"); | ||
1077 | QString filename, name; | 1062 | QString filename, name; |
1078 | InputDialog *fileDlg; | 1063 | InputDialog *fileDlg; |
1079 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 1064 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
1080 | fileDlg->exec(); | 1065 | fileDlg->exec(); |
1081 | if( fileDlg->result() == 1 ) { | 1066 | if( fileDlg->result() == 1 ) { |
1082 | filename = fileDlg->text(); | 1067 | filename = fileDlg->text(); |
1083 | qDebug( "Selected filename is " + filename ); | 1068 | // qDebug( "Selected filename is " + filename ); |
1084 | // Om3u *m3uList; | ||
1085 | DocLnk lnk; | 1069 | DocLnk lnk; |
1086 | Config cfg( "OpiePlayer" ); | 1070 | Config cfg( "OpiePlayer" ); |
1087 | cfg.setGroup("PlayList"); | 1071 | cfg.setGroup("PlayList"); |
@@ -1091,21 +1075,12 @@ void PlayListWidget::openFile() { | |||
1091 | if(filename.left(4) == "http") { | 1075 | if(filename.left(4) == "http") { |
1092 | if(filename.find(":",8,TRUE) != -1) { //found a port | 1076 | if(filename.find(":",8,TRUE) != -1) { //found a port |
1093 | 1077 | ||
1094 | // m3uFile = filename.left( filename.find( ":",8,TRUE)); | ||
1095 | m3uFile = filename; | 1078 | m3uFile = filename; |
1096 | if( m3uFile.right( 1 ).find( '/' ) == -1) { | 1079 | if( m3uFile.right( 1 ).find( '/' ) == -1) { |
1097 | m3uFile += "/"; | 1080 | m3uFile += "/"; |
1098 | } | 1081 | } |
1099 | filename = m3uFile; | 1082 | filename = m3uFile; |
1100 | // qDebug("1 "+m3uFile); | 1083 | = } |
1101 | // } else if(filename.left(4) == "http"){ | ||
1102 | // m3uFile=filename; | ||
1103 | // m3uFile = m3uFile.right( m3uFile.length() - 7); | ||
1104 | // qDebug("2 "+m3uFile); | ||
1105 | // } else{ | ||
1106 | // m3uFile=filename; | ||
1107 | // qDebug("3 "+m3uFile); | ||
1108 | } | ||
1109 | lnk.setName( m3uFile ); //sets name | 1084 | lnk.setName( m3uFile ); //sets name |
1110 | lnk.setFile( filename ); //sets file name | 1085 | lnk.setFile( filename ); //sets file name |
1111 | lnk.setIcon("opieplayer2/musicfile"); | 1086 | lnk.setIcon("opieplayer2/musicfile"); |
@@ -1121,6 +1096,7 @@ void PlayListWidget::openFile() { | |||
1121 | lnk.setName( fullBaseName ( QFileInfo(filename)) ); //sets name | 1096 | lnk.setName( fullBaseName ( QFileInfo(filename)) ); //sets name |
1122 | lnk.setFile( filename ); //sets file name | 1097 | lnk.setFile( filename ); //sets file name |
1123 | d->selectedFiles->addToSelection( lnk); | 1098 | d->selectedFiles->addToSelection( lnk); |
1099 | lnk.removeLinkFile(); | ||
1124 | writeCurrentM3u(); | 1100 | writeCurrentM3u(); |
1125 | } | 1101 | } |
1126 | } | 1102 | } |
@@ -1134,7 +1110,7 @@ void PlayListWidget::openFile() { | |||
1134 | /* | 1110 | /* |
1135 | reads m3u and shows files/urls to playlist widget */ | 1111 | reads m3u and shows files/urls to playlist widget */ |
1136 | void PlayListWidget::readm3u( const QString &filename ) { | 1112 | void PlayListWidget::readm3u( const QString &filename ) { |
1137 | qDebug( "read m3u filename " + filename ); | 1113 | // qDebug( "read m3u filename " + filename ); |
1138 | 1114 | ||
1139 | Om3u *m3uList; | 1115 | Om3u *m3uList; |
1140 | QString s, name; | 1116 | QString s, name; |
@@ -1191,7 +1167,7 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
1191 | reads pls and adds files/urls to playlist */ | 1167 | reads pls and adds files/urls to playlist */ |
1192 | void PlayListWidget::readPls( const QString &filename ) { | 1168 | void PlayListWidget::readPls( const QString &filename ) { |
1193 | 1169 | ||
1194 | qDebug( "pls filename is " + filename ); | 1170 | // qDebug( "pls filename is " + filename ); |
1195 | Om3u *m3uList; | 1171 | Om3u *m3uList; |
1196 | QString s, name; | 1172 | QString s, name; |
1197 | m3uList = new Om3u( filename, IO_ReadOnly ); | 1173 | m3uList = new Om3u( filename, IO_ReadOnly ); |
@@ -1234,20 +1210,20 @@ void PlayListWidget::readPls( const QString &filename ) { | |||
1234 | /* | 1210 | /* |
1235 | writes current playlist to current m3u file */ | 1211 | writes current playlist to current m3u file */ |
1236 | void PlayListWidget::writeCurrentM3u() { | 1212 | void PlayListWidget::writeCurrentM3u() { |
1237 | qDebug("writing to current m3u"); | 1213 | // qDebug("writing to current m3u"); |
1238 | Config cfg( "OpiePlayer" ); | 1214 | Config cfg( "OpiePlayer" ); |
1239 | cfg.setGroup("PlayList"); | 1215 | cfg.setGroup("PlayList"); |
1240 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 1216 | currentPlayList = cfg.readEntry("CurrentPlaylist",""); |
1241 | Om3u *m3uList; | 1217 | Om3u *m3uList; |
1242 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 1218 | m3uList = new Om3u( currentPlayList, IO_ReadWrite | IO_Truncate ); |
1243 | 1219 | ||
1244 | if( d->selectedFiles->first()) { | 1220 | if( d->selectedFiles->first()) { |
1245 | do { | 1221 | do { |
1246 | qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); | 1222 | // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); |
1247 | m3uList->add( d->selectedFiles->current()->file() ); | 1223 | m3uList->add( d->selectedFiles->current()->file() ); |
1248 | } | 1224 | } |
1249 | while ( d->selectedFiles->next() ); | 1225 | while ( d->selectedFiles->next() ); |
1250 | qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 1226 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); |
1251 | m3uList->write(); | 1227 | m3uList->write(); |
1252 | m3uList->close(); | 1228 | m3uList->close(); |
1253 | 1229 | ||
@@ -1304,7 +1280,7 @@ void PlayListWidget::writem3u() { | |||
1304 | currentPlayList=filename; | 1280 | currentPlayList=filename; |
1305 | 1281 | ||
1306 | if(!lnk.writeLink()) { | 1282 | if(!lnk.writeLink()) { |
1307 | qDebug("Writing doclink did not work"); | 1283 | // qDebug("Writing doclink did not work"); |
1308 | } | 1284 | } |
1309 | 1285 | ||
1310 | setCaption(tr("OpiePlayer: ") + name); | 1286 | setCaption(tr("OpiePlayer: ") + name); |
@@ -1334,7 +1310,6 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1334 | // doUnblank(); | 1310 | // doUnblank(); |
1335 | break; | 1311 | break; |
1336 | case Key_Q: //add to playlist | 1312 | case Key_Q: //add to playlist |
1337 | qDebug("Add"); | ||
1338 | addSelected(); | 1313 | addSelected(); |
1339 | break; | 1314 | break; |
1340 | case Key_R: //remove from playlist | 1315 | case Key_R: //remove from playlist |
@@ -1345,7 +1320,6 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1345 | // playSelected(); | 1320 | // playSelected(); |
1346 | // break; | 1321 | // break; |
1347 | case Key_Space: | 1322 | case Key_Space: |
1348 | qDebug("Play"); | ||
1349 | // playSelected(); puh | 1323 | // playSelected(); puh |
1350 | break; | 1324 | break; |
1351 | case Key_1: | 1325 | case Key_1: |
@@ -1398,7 +1372,7 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) | |||
1398 | } | 1372 | } |
1399 | 1373 | ||
1400 | void PlayListWidget::doBlank() { | 1374 | void PlayListWidget::doBlank() { |
1401 | qDebug("do blanking"); | 1375 | // qDebug("do blanking"); |
1402 | fd=open("/dev/fb0",O_RDWR); | 1376 | fd=open("/dev/fb0",O_RDWR); |
1403 | if (fd != -1) { | 1377 | if (fd != -1) { |
1404 | ioctl(fd,FBIOBLANK,1); | 1378 | ioctl(fd,FBIOBLANK,1); |
@@ -1410,7 +1384,7 @@ void PlayListWidget::doUnblank() { | |||
1410 | // this crashes opieplayer with a segfault | 1384 | // this crashes opieplayer with a segfault |
1411 | // int fd; | 1385 | // int fd; |
1412 | // fd=open("/dev/fb0",O_RDWR); | 1386 | // fd=open("/dev/fb0",O_RDWR); |
1413 | qDebug("do unblanking"); | 1387 | // qDebug("do unblanking"); |
1414 | if (fd != -1) { | 1388 | if (fd != -1) { |
1415 | ioctl(fd,FBIOBLANK,0); | 1389 | ioctl(fd,FBIOBLANK,0); |
1416 | close(fd); | 1390 | close(fd); |
@@ -1461,7 +1435,7 @@ void PlayListWidget::skinsMenuActivated( int item ) { | |||
1461 | } | 1435 | } |
1462 | 1436 | ||
1463 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1437 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1464 | qDebug("qcop message "+msg ); | 1438 | // qDebug("qcop message "+msg ); |
1465 | QDataStream stream ( data, IO_ReadOnly ); | 1439 | QDataStream stream ( data, IO_ReadOnly ); |
1466 | if ( msg == "play()" ) { //plays current selection | 1440 | if ( msg == "play()" ) { //plays current selection |
1467 | btnPlay( true); | 1441 | btnPlay( true); |
@@ -1498,9 +1472,7 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | |||
1498 | } else if ( msg == "rem(QString)" ) { //remove from playlist | 1472 | } else if ( msg == "rem(QString)" ) { //remove from playlist |
1499 | QString file; | 1473 | QString file; |
1500 | stream >> file; | 1474 | stream >> file; |
1501 | |||
1502 | } else if ( msg == "setDocument(QString)" ) { //loop or not loop | 1475 | } else if ( msg == "setDocument(QString)" ) { //loop or not loop |
1503 | QCopEnvelope h("QPE/Application/opieplayer", "raise()"); | 1476 | QCopEnvelope h("QPE/Application/opieplayer", "raise()"); |
1504 | } | 1477 | } |
1505 | |||
1506 | } | 1478 | } |