Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 70b7cef..2118051 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -624,21 +624,12 @@ void PlayListWidget::saveList() { | |||
624 | delete d->current; | 624 | delete d->current; |
625 | filename = fileDlg->LineEdit1->text();//+".playlist"; | 625 | filename = fileDlg->LineEdit1->text();//+".playlist"; |
626 | // qDebug("saving playlist "+filename+".playlist"); | 626 | // qDebug("saving playlist "+filename+".playlist"); |
627 | Config cfg( filename +".playlist"); | 627 | Config cfg( filename +".playlist"); |
628 | writeConfig( cfg ); | 628 | writeConfig( cfg ); |
629 | 629 | ||
630 | // qDebug("same name so delete lnk??"); | ||
631 | // if( playLists->selected()->name() == filename) { | ||
632 | |||
633 | // qDebug("same name so delete lnk"); | ||
634 | // QFile().remove(playLists->selected()->file()); | ||
635 | // QFile().remove(playLists->selected()->linkFile()); | ||
636 | // playLists->reread(); | ||
637 | // } | ||
638 | // qDebug("new doclnk"); | ||
639 | DocLnk lnk; | 630 | DocLnk lnk; |
640 | // lnk.setComment( ""); | 631 | // lnk.setComment( ""); |
641 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property | 632 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property |
642 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | 633 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D |
643 | lnk.setIcon("opieplayer/playlist2"); | 634 | lnk.setIcon("opieplayer/playlist2"); |
644 | lnk.setName( filename); //sets file name | 635 | lnk.setName( filename); //sets file name |
@@ -844,23 +835,25 @@ void PlayListWidget::btnPlay(bool b) { | |||
844 | { | 835 | { |
845 | addToSelection( audioView->selectedItem() ); | 836 | addToSelection( audioView->selectedItem() ); |
846 | mediaPlayerState->setPlaying(b); | 837 | mediaPlayerState->setPlaying(b); |
847 | d->selectedFiles->removeSelected( ); | 838 | d->selectedFiles->removeSelected( ); |
848 | tabWidget->setCurrentPage(1); | 839 | tabWidget->setCurrentPage(1); |
849 | d->selectedFiles->unSelect(); | 840 | d->selectedFiles->unSelect(); |
841 | insanityBool=FALSE; | ||
850 | // audioView->clearSelection(); | 842 | // audioView->clearSelection(); |
851 | } | 843 | } |
852 | break; | 844 | break; |
853 | case 2: | 845 | case 2: |
854 | { | 846 | { |
855 | addToSelection( videoView->selectedItem() ); | 847 | addToSelection( videoView->selectedItem() ); |
856 | mediaPlayerState->setPlaying(b); | 848 | mediaPlayerState->setPlaying(b); |
857 | qApp->processEvents(); | 849 | qApp->processEvents(); |
858 | d->selectedFiles->removeSelected( ); | 850 | d->selectedFiles->removeSelected( ); |
859 | tabWidget->setCurrentPage(2); | 851 | tabWidget->setCurrentPage(2); |
860 | d->selectedFiles->unSelect(); | 852 | d->selectedFiles->unSelect(); |
853 | insanityBool=FALSE; | ||
861 | // videoView->clearSelection(); | 854 | // videoView->clearSelection(); |
862 | } | 855 | } |
863 | break; | 856 | break; |
864 | }; | 857 | }; |
865 | } | 858 | } |
866 | 859 | ||
@@ -896,13 +889,13 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& | |||
896 | }; | 889 | }; |
897 | } | 890 | } |
898 | 891 | ||
899 | void PlayListWidget::playSelected() | 892 | void PlayListWidget::playSelected() |
900 | { | 893 | { |
901 | btnPlay( TRUE); | 894 | btnPlay( TRUE); |
902 | d->selectedFiles->unSelect(); | 895 | // d->selectedFiles->unSelect(); |
903 | } | 896 | } |
904 | 897 | ||
905 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) | 898 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) |
906 | { | 899 | { |
907 | switch (mouse) { | 900 | switch (mouse) { |
908 | case 1: | 901 | case 1: |
@@ -1021,28 +1014,22 @@ void PlayListWidget::openFile() { | |||
1021 | QString filename, name; | 1014 | QString filename, name; |
1022 | InputDialog *fileDlg; | 1015 | InputDialog *fileDlg; |
1023 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 1016 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
1024 | fileDlg->exec(); | 1017 | fileDlg->exec(); |
1025 | if( fileDlg->result() == 1 ) { | 1018 | if( fileDlg->result() == 1 ) { |
1026 | filename = fileDlg->LineEdit1->text(); | 1019 | filename = fileDlg->LineEdit1->text(); |
1027 | |||
1028 | // InputDialog *fileDlg2; | ||
1029 | // fileDlg2 = new InputDialog(this,tr("Name"),TRUE, 0); | ||
1030 | // fileDlg2->exec(); | ||
1031 | // if( fileDlg2->result() == 1 ) { | ||
1032 | // name = fileDlg2->LineEdit1->text(); | ||
1033 | // } | ||
1034 | //http://205.188.234.129:8030 | 1020 | //http://205.188.234.129:8030 |
1035 | // http://66.28.68.70:8000 | 1021 | // http://66.28.68.70:8000 |
1036 | qDebug(filename); | 1022 | qDebug(filename); |
1023 | if(filename.right(3) == "m3u") | ||
1024 | readm3u( filename); | ||
1025 | else if(filename.right(3) == "pls") | ||
1026 | readPls( filename); | ||
1027 | else { | ||
1037 | DocLnk lnk; | 1028 | DocLnk lnk; |
1038 | // if(filename.left(7) == "http://") | 1029 | |
1039 | // name= filename.right(filename.length()-filename.find("http://")-7); | ||
1040 | // else name = filename; | ||
1041 | // qDebug("name is "+name); | ||
1042 | // lnk.setComment(filename); | ||
1043 | lnk.setName(filename); //sets file name | 1030 | lnk.setName(filename); //sets file name |
1044 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") | 1031 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") |
1045 | filename += "/"; | 1032 | filename += "/"; |
1046 | lnk.setFile(filename); //sets File property | 1033 | lnk.setFile(filename); //sets File property |
1047 | 1034 | ||
1048 | lnk.setType("audio/x-mpegurl"); | 1035 | lnk.setType("audio/x-mpegurl"); |
@@ -1052,13 +1039,13 @@ void PlayListWidget::openFile() { | |||
1052 | if(!lnk.writeLink()) | 1039 | if(!lnk.writeLink()) |
1053 | qDebug("Writing doclink did not work"); | 1040 | qDebug("Writing doclink did not work"); |
1054 | d->selectedFiles->addToSelection( lnk); | 1041 | d->selectedFiles->addToSelection( lnk); |
1055 | // if(fileDlg2) | 1042 | // if(fileDlg2) |
1056 | // delete fileDlg2; | 1043 | // delete fileDlg2; |
1057 | } | 1044 | } |
1058 | 1045 | } | |
1059 | if(fileDlg) | 1046 | if(fileDlg) |
1060 | delete fileDlg; | 1047 | delete fileDlg; |
1061 | } | 1048 | } |
1062 | 1049 | ||
1063 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | 1050 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) |
1064 | { | 1051 | { |
@@ -1102,6 +1089,18 @@ void PlayListWidget::doUnblank() { | |||
1102 | ioctl(fd,FBIOBLANK,0); | 1089 | ioctl(fd,FBIOBLANK,0); |
1103 | close(fd); | 1090 | close(fd); |
1104 | } | 1091 | } |
1105 | QCopEnvelope h("QPE/System", "setBacklight(int)"); | 1092 | QCopEnvelope h("QPE/System", "setBacklight(int)"); |
1106 | h <<-3;// v[1]; // -3 Force on | 1093 | h <<-3;// v[1]; // -3 Force on |
1107 | } | 1094 | } |
1095 | |||
1096 | void PlayListWidget::readm3u(const QString &filename) { | ||
1097 | |||
1098 | } | ||
1099 | |||
1100 | void PlayListWidget::writem3u(const QString &filename) { | ||
1101 | |||
1102 | } | ||
1103 | |||
1104 | void PlayListWidget::readPls(const QString &filename) { | ||
1105 | |||
1106 | } | ||