author | simon <simon> | 2002-12-04 11:55:24 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-04 11:55:24 (UTC) |
commit | ba2de7d7233c0fbbd8ef31fae7aa5a9ded70225e (patch) (unidiff) | |
tree | b84f73c9df4610b4cf957031c8ca7d0ece407614 | |
parent | d75c4d9a27fcfc38ac3f9fd58f6b398809ec6a94 (diff) | |
download | opie-ba2de7d7233c0fbbd8ef31fae7aa5a9ded70225e.zip opie-ba2de7d7233c0fbbd8ef31fae7aa5a9ded70225e.tar.gz opie-ba2de7d7233c0fbbd8ef31fae7aa5a9ded70225e.tar.bz2 |
- scanForAudio and scanForVideo is scanFiles in the file list view, so
removed the former and connect to the latter
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 13 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 2 |
2 files changed, 2 insertions, 13 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index e754067..86b3424 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -34,131 +34,131 @@ | |||
34 | #include <qpe/qpetoolbar.h> | 34 | #include <qpe/qpetoolbar.h> |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | #include <qpe/storage.h> | 36 | #include <qpe/storage.h> |
37 | #include <qpe/mimetype.h> | 37 | #include <qpe/mimetype.h> |
38 | #include <qpe/global.h> | 38 | #include <qpe/global.h> |
39 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | 40 | ||
41 | #include <qdatetime.h> | 41 | #include <qdatetime.h> |
42 | #include <qdir.h> | 42 | #include <qdir.h> |
43 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
44 | #include <qregexp.h> | 44 | #include <qregexp.h> |
45 | #include <qtextstream.h> | 45 | #include <qtextstream.h> |
46 | 46 | ||
47 | #include "playlistselection.h" | 47 | #include "playlistselection.h" |
48 | #include "playlistwidget.h" | 48 | #include "playlistwidget.h" |
49 | #include "mediaplayerstate.h" | 49 | #include "mediaplayerstate.h" |
50 | #include "inputDialog.h" | 50 | #include "inputDialog.h" |
51 | #include "om3u.h" | 51 | #include "om3u.h" |
52 | #include "playlistfileview.h" | 52 | #include "playlistfileview.h" |
53 | 53 | ||
54 | //only needed for the random play | 54 | //only needed for the random play |
55 | #include <stdlib.h> | 55 | #include <stdlib.h> |
56 | #include <assert.h> | 56 | #include <assert.h> |
57 | 57 | ||
58 | #include "audiowidget.h" | 58 | #include "audiowidget.h" |
59 | #include "videowidget.h" | 59 | #include "videowidget.h" |
60 | 60 | ||
61 | extern MediaPlayerState *mediaPlayerState; | 61 | extern MediaPlayerState *mediaPlayerState; |
62 | // extern AudioWidget *audioUI; | 62 | // extern AudioWidget *audioUI; |
63 | // extern VideoWidget *videoUI; | 63 | // extern VideoWidget *videoUI; |
64 | 64 | ||
65 | PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) | 65 | PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
66 | : PlayListWidgetGui( mediaPlayerState, parent, name ) { | 66 | : PlayListWidgetGui( mediaPlayerState, parent, name ) { |
67 | 67 | ||
68 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), | 68 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), |
69 | "opieplayer2/add_to_playlist", | 69 | "opieplayer2/add_to_playlist", |
70 | this , SLOT(addSelected() ) ); | 70 | this , SLOT(addSelected() ) ); |
71 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), | 71 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), |
72 | "opieplayer2/remove_from_playlist", | 72 | "opieplayer2/remove_from_playlist", |
73 | this , SLOT(removeSelected() ) ); | 73 | this , SLOT(removeSelected() ) ); |
74 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", | 74 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", |
75 | this , SLOT( btnPlay( bool) ), TRUE ); | 75 | this , SLOT( btnPlay( bool) ), TRUE ); |
76 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", | 76 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", |
77 | &mediaPlayerState, SLOT( setShuffled( bool ) ), TRUE ); | 77 | &mediaPlayerState, SLOT( setShuffled( bool ) ), TRUE ); |
78 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", | 78 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", |
79 | &mediaPlayerState, SLOT( setLooping( bool ) ), TRUE ); | 79 | &mediaPlayerState, SLOT( setLooping( bool ) ), TRUE ); |
80 | 80 | ||
81 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 81 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
82 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), | 82 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), |
83 | this, SLOT( addAllMusicToList() ) ); | 83 | this, SLOT( addAllMusicToList() ) ); |
84 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), | 84 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), |
85 | this, SLOT( addAllVideoToList() ) ); | 85 | this, SLOT( addAllVideoToList() ) ); |
86 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), | 86 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), |
87 | this, SLOT( addAllToList() ) ); | 87 | this, SLOT( addAllToList() ) ); |
88 | pmPlayList->insertSeparator(-1); | 88 | pmPlayList->insertSeparator(-1); |
89 | // (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), | 89 | // (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), |
90 | // this, SLOT( saveList() ) ); | 90 | // this, SLOT( saveList() ) ); |
91 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), | 91 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), |
92 | this, SLOT(writem3u() ) ); | 92 | this, SLOT(writem3u() ) ); |
93 | pmPlayList->insertSeparator(-1); | 93 | pmPlayList->insertSeparator(-1); |
94 | (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), | 94 | (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), |
95 | this,SLOT( openFile() ) ); | 95 | this,SLOT( openFile() ) ); |
96 | pmPlayList->insertSeparator(-1); | 96 | pmPlayList->insertSeparator(-1); |
97 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), | 97 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), |
98 | this,SLOT( scanForAudio() ) ); | 98 | audioView, SLOT( scanFiles() ) ); |
99 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), | 99 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), |
100 | this,SLOT( scanForVideo() ) ); | 100 | videoView, SLOT( scanFiles() ) ); |
101 | 101 | ||
102 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), | 102 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), |
103 | &mediaPlayerState, SLOT( toggleFullscreen() ) ); | 103 | &mediaPlayerState, SLOT( toggleFullscreen() ) ); |
104 | 104 | ||
105 | Config cfg( "OpiePlayer" ); | 105 | Config cfg( "OpiePlayer" ); |
106 | bool b= cfg.readBoolEntry("FullScreen", 0); | 106 | bool b= cfg.readBoolEntry("FullScreen", 0); |
107 | mediaPlayerState.setFullscreen( b ); | 107 | mediaPlayerState.setFullscreen( b ); |
108 | pmView->setItemChecked( -16, b ); | 108 | pmView->setItemChecked( -16, b ); |
109 | 109 | ||
110 | (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", | 110 | (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", |
111 | d->selectedFiles, SLOT(moveSelectedUp() ) ); | 111 | d->selectedFiles, SLOT(moveSelectedUp() ) ); |
112 | (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", | 112 | (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", |
113 | d->selectedFiles, SLOT(removeSelected() ) ); | 113 | d->selectedFiles, SLOT(removeSelected() ) ); |
114 | (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", | 114 | (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", |
115 | d->selectedFiles, SLOT(moveSelectedDown() ) ); | 115 | d->selectedFiles, SLOT(moveSelectedDown() ) ); |
116 | // QVBox *stretch2 = new QVBox( vbox1 ); | 116 | // QVBox *stretch2 = new QVBox( vbox1 ); |
117 | 117 | ||
118 | connect( tbDeletePlaylist, ( SIGNAL( released() ) ), | 118 | connect( tbDeletePlaylist, ( SIGNAL( released() ) ), |
119 | SLOT( deletePlaylist() ) ); | 119 | SLOT( deletePlaylist() ) ); |
120 | connect( pmView, SIGNAL( activated( int ) ), | 120 | connect( pmView, SIGNAL( activated( int ) ), |
121 | this, SLOT( pmViewActivated( int ) ) ); | 121 | this, SLOT( pmViewActivated( int ) ) ); |
122 | connect( skinsMenu, SIGNAL( activated( int ) ) , | 122 | connect( skinsMenu, SIGNAL( activated( int ) ) , |
123 | this, SLOT( skinsMenuActivated( int ) ) ); | 123 | this, SLOT( skinsMenuActivated( int ) ) ); |
124 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), | 124 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), |
125 | this,SLOT( playlistViewPressed( int, QListViewItem *, const QPoint&, int ) ) ); | 125 | this,SLOT( playlistViewPressed( int, QListViewItem *, const QPoint&, int ) ) ); |
126 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int ) ), | 126 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int ) ), |
127 | this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int ) ) ); | 127 | this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int ) ) ); |
128 | connect( audioView, SIGNAL( returnPressed( QListViewItem *) ), | 128 | connect( audioView, SIGNAL( returnPressed( QListViewItem *) ), |
129 | this,SLOT( playIt( QListViewItem *) ) ); | 129 | this,SLOT( playIt( QListViewItem *) ) ); |
130 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), | 130 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), |
131 | this, SLOT( addToSelection( QListViewItem *) ) ); | 131 | this, SLOT( addToSelection( QListViewItem *) ) ); |
132 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), | 132 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), |
133 | this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int) ) ); | 133 | this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int) ) ); |
134 | connect( videoView, SIGNAL( returnPressed( QListViewItem *) ), | 134 | connect( videoView, SIGNAL( returnPressed( QListViewItem *) ), |
135 | this,SLOT( playIt( QListViewItem *) ) ); | 135 | this,SLOT( playIt( QListViewItem *) ) ); |
136 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), | 136 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), |
137 | this, SLOT( addToSelection( QListViewItem *) ) ); | 137 | this, SLOT( addToSelection( QListViewItem *) ) ); |
138 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), | 138 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), |
139 | this, SLOT( loadList( const DocLnk & ) ) ); | 139 | this, SLOT( loadList( const DocLnk & ) ) ); |
140 | connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), | 140 | connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), |
141 | this, SLOT( tabChanged( QWidget* ) ) ); | 141 | this, SLOT( tabChanged( QWidget* ) ) ); |
142 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), | 142 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), |
143 | d->tbPlay, SLOT( setOn( bool ) ) ); | 143 | d->tbPlay, SLOT( setOn( bool ) ) ); |
144 | connect( &mediaPlayerState, SIGNAL( loopingToggled( bool ) ), | 144 | connect( &mediaPlayerState, SIGNAL( loopingToggled( bool ) ), |
145 | d->tbLoop, SLOT( setOn( bool ) ) ); | 145 | d->tbLoop, SLOT( setOn( bool ) ) ); |
146 | connect( &mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), | 146 | connect( &mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), |
147 | d->tbShuffle, SLOT( setOn( bool ) ) ); | 147 | d->tbShuffle, SLOT( setOn( bool ) ) ); |
148 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), | 148 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), |
149 | this, SLOT( playIt( QListViewItem *) ) ); | 149 | this, SLOT( playIt( QListViewItem *) ) ); |
150 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), | 150 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), |
151 | &mediaPlayerState, SLOT( setVideoGamma( int ) ) ); | 151 | &mediaPlayerState, SLOT( setVideoGamma( int ) ) ); |
152 | 152 | ||
153 | // see which skins are installed | 153 | // see which skins are installed |
154 | populateSkinsMenu(); | 154 | populateSkinsMenu(); |
155 | initializeStates(); | 155 | initializeStates(); |
156 | 156 | ||
157 | cfg.setGroup("PlayList"); | 157 | cfg.setGroup("PlayList"); |
158 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); | 158 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); |
159 | loadList(DocLnk( currentPlaylist ) ); | 159 | loadList(DocLnk( currentPlaylist ) ); |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | PlayListWidget::~PlayListWidget() { | 163 | PlayListWidget::~PlayListWidget() { |
164 | delete d; | 164 | delete d; |
@@ -556,137 +556,128 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
556 | d->tbPlay->setEnabled( !d->selectedFiles->isEmpty() ); | 556 | d->tbPlay->setEnabled( !d->selectedFiles->isEmpty() ); |
557 | } | 557 | } |
558 | break; | 558 | break; |
559 | case AudioFiles: | 559 | case AudioFiles: |
560 | { | 560 | { |
561 | audioView->populateView(); | 561 | audioView->populateView(); |
562 | 562 | ||
563 | if( !tbDeletePlaylist->isHidden() ) { | 563 | if( !tbDeletePlaylist->isHidden() ) { |
564 | tbDeletePlaylist->hide(); | 564 | tbDeletePlaylist->hide(); |
565 | } | 565 | } |
566 | d->tbRemoveFromList->setEnabled(FALSE); | 566 | d->tbRemoveFromList->setEnabled(FALSE); |
567 | d->tbAddToList->setEnabled(TRUE); | 567 | d->tbAddToList->setEnabled(TRUE); |
568 | } | 568 | } |
569 | break; | 569 | break; |
570 | case VideoFiles: | 570 | case VideoFiles: |
571 | { | 571 | { |
572 | videoView->populateView(); | 572 | videoView->populateView(); |
573 | if( !tbDeletePlaylist->isHidden() ) { | 573 | if( !tbDeletePlaylist->isHidden() ) { |
574 | tbDeletePlaylist->hide(); | 574 | tbDeletePlaylist->hide(); |
575 | } | 575 | } |
576 | d->tbRemoveFromList->setEnabled(FALSE); | 576 | d->tbRemoveFromList->setEnabled(FALSE); |
577 | d->tbAddToList->setEnabled(TRUE); | 577 | d->tbAddToList->setEnabled(TRUE); |
578 | } | 578 | } |
579 | break; | 579 | break; |
580 | case PlayLists: | 580 | case PlayLists: |
581 | { | 581 | { |
582 | if( tbDeletePlaylist->isHidden() ) { | 582 | if( tbDeletePlaylist->isHidden() ) { |
583 | tbDeletePlaylist->show(); | 583 | tbDeletePlaylist->show(); |
584 | } | 584 | } |
585 | playLists->reread(); | 585 | playLists->reread(); |
586 | d->tbAddToList->setEnabled(FALSE); | 586 | d->tbAddToList->setEnabled(FALSE); |
587 | 587 | ||
588 | d->tbPlay->setEnabled( false ); | 588 | d->tbPlay->setEnabled( false ); |
589 | } | 589 | } |
590 | break; | 590 | break; |
591 | }; | 591 | }; |
592 | } | 592 | } |
593 | 593 | ||
594 | 594 | ||
595 | void PlayListWidget::btnPlay(bool b) { | 595 | void PlayListWidget::btnPlay(bool b) { |
596 | // mediaPlayerState->setPlaying(false); | 596 | // mediaPlayerState->setPlaying(false); |
597 | mediaPlayerState.setPlaying(b); | 597 | mediaPlayerState.setPlaying(b); |
598 | insanityBool=FALSE; | 598 | insanityBool=FALSE; |
599 | } | 599 | } |
600 | 600 | ||
601 | void PlayListWidget::deletePlaylist() { | 601 | void PlayListWidget::deletePlaylist() { |
602 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), | 602 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), |
603 | (tr("You really want to delete\nthis playlist?")), | 603 | (tr("You really want to delete\nthis playlist?")), |
604 | (tr("Yes")), (tr("No")), 0 )){ | 604 | (tr("Yes")), (tr("No")), 0 )){ |
605 | case 0: // Yes clicked, | 605 | case 0: // Yes clicked, |
606 | QFile().remove(playLists->selectedDocument().file()); | 606 | QFile().remove(playLists->selectedDocument().file()); |
607 | QFile().remove(playLists->selectedDocument().linkFile()); | 607 | QFile().remove(playLists->selectedDocument().linkFile()); |
608 | playLists->reread(); | 608 | playLists->reread(); |
609 | break; | 609 | break; |
610 | case 1: // Cancel | 610 | case 1: // Cancel |
611 | break; | 611 | break; |
612 | }; | 612 | }; |
613 | } | 613 | } |
614 | 614 | ||
615 | 615 | ||
616 | void PlayListWidget::playSelected() { | 616 | void PlayListWidget::playSelected() { |
617 | btnPlay( TRUE); | 617 | btnPlay( TRUE); |
618 | } | 618 | } |
619 | 619 | ||
620 | |||
621 | void PlayListWidget::scanForAudio() { | ||
622 | audioView->scanFiles(); | ||
623 | } | ||
624 | |||
625 | void PlayListWidget::scanForVideo() { | ||
626 | videoView->scanFiles(); | ||
627 | } | ||
628 | |||
629 | QListView *PlayListWidget::currentFileListView() const | 620 | QListView *PlayListWidget::currentFileListView() const |
630 | { | 621 | { |
631 | switch ( currentTab() ) { | 622 | switch ( currentTab() ) { |
632 | case AudioFiles: return audioView; | 623 | case AudioFiles: return audioView; |
633 | case VideoFiles: return videoView; | 624 | case VideoFiles: return videoView; |
634 | default: assert( false ); | 625 | default: assert( false ); |
635 | } | 626 | } |
636 | return 0; | 627 | return 0; |
637 | } | 628 | } |
638 | 629 | ||
639 | bool PlayListWidget::inFileListMode() const | 630 | bool PlayListWidget::inFileListMode() const |
640 | { | 631 | { |
641 | TabType tab = currentTab(); | 632 | TabType tab = currentTab(); |
642 | return tab == AudioFiles || tab == VideoFiles; | 633 | return tab == AudioFiles || tab == VideoFiles; |
643 | } | 634 | } |
644 | 635 | ||
645 | void PlayListWidget::openFile() { | 636 | void PlayListWidget::openFile() { |
646 | // http://66.28.164.33:2080 | 637 | // http://66.28.164.33:2080 |
647 | // http://somafm.com/star0242.m3u | 638 | // http://somafm.com/star0242.m3u |
648 | QString filename, name; | 639 | QString filename, name; |
649 | InputDialog *fileDlg; | 640 | InputDialog *fileDlg; |
650 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 641 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
651 | fileDlg->exec(); | 642 | fileDlg->exec(); |
652 | if( fileDlg->result() == 1 ) { | 643 | if( fileDlg->result() == 1 ) { |
653 | filename = fileDlg->text(); | 644 | filename = fileDlg->text(); |
654 | qDebug( "Selected filename is " + filename ); | 645 | qDebug( "Selected filename is " + filename ); |
655 | // Om3u *m3uList; | 646 | // Om3u *m3uList; |
656 | DocLnk lnk; | 647 | DocLnk lnk; |
657 | Config cfg( "OpiePlayer" ); | 648 | Config cfg( "OpiePlayer" ); |
658 | cfg.setGroup("PlayList"); | 649 | cfg.setGroup("PlayList"); |
659 | 650 | ||
660 | if(filename.left(4) == "http") { | 651 | if(filename.left(4) == "http") { |
661 | QString m3uFile, m3uFilePath; | 652 | QString m3uFile, m3uFilePath; |
662 | if(filename.find(":",8,TRUE) != -1) { //found a port | 653 | if(filename.find(":",8,TRUE) != -1) { //found a port |
663 | m3uFile = filename.left( filename.find( ":",8,TRUE)); | 654 | m3uFile = filename.left( filename.find( ":",8,TRUE)); |
664 | m3uFile = m3uFile.right( 7); | 655 | m3uFile = m3uFile.right( 7); |
665 | } else if(filename.left(4) == "http"){ | 656 | } else if(filename.left(4) == "http"){ |
666 | m3uFile=filename; | 657 | m3uFile=filename; |
667 | m3uFile = m3uFile.right( m3uFile.length() - 7); | 658 | m3uFile = m3uFile.right( m3uFile.length() - 7); |
668 | } else{ | 659 | } else{ |
669 | m3uFile=filename; | 660 | m3uFile=filename; |
670 | } | 661 | } |
671 | 662 | ||
672 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile); | 663 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile); |
673 | lnk.setName( filename ); //sets name | 664 | lnk.setName( filename ); //sets name |
674 | lnk.setFile( filename ); //sets file name | 665 | lnk.setFile( filename ); //sets file name |
675 | 666 | ||
676 | // lnk.setIcon("opieplayer2/musicfile"); | 667 | // lnk.setIcon("opieplayer2/musicfile"); |
677 | 668 | ||
678 | d->selectedFiles->addToSelection( lnk ); | 669 | d->selectedFiles->addToSelection( lnk ); |
679 | writeCurrentM3u(); | 670 | writeCurrentM3u(); |
680 | d->selectedFiles->setSelectedItem( lnk.name()); | 671 | d->selectedFiles->setSelectedItem( lnk.name()); |
681 | } | 672 | } |
682 | else if( filename.right( 3) == "m3u" ) { | 673 | else if( filename.right( 3) == "m3u" ) { |
683 | readm3u( filename ); | 674 | readm3u( filename ); |
684 | 675 | ||
685 | } else if( filename.right(3) == "pls" ) { | 676 | } else if( filename.right(3) == "pls" ) { |
686 | readPls( filename ); | 677 | readPls( filename ); |
687 | } else { | 678 | } else { |
688 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 679 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
689 | lnk.setFile( filename ); //sets file name | 680 | lnk.setFile( filename ); //sets file name |
690 | d->selectedFiles->addToSelection( lnk); | 681 | d->selectedFiles->addToSelection( lnk); |
691 | writeCurrentM3u(); | 682 | writeCurrentM3u(); |
692 | d->selectedFiles->setSelectedItem( lnk.name()); | 683 | d->selectedFiles->setSelectedItem( lnk.name()); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index 8c22f17..5c8f30c 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h | |||
@@ -47,95 +47,93 @@ | |||
47 | //class PlayListWidgetPrivate; | 47 | //class PlayListWidgetPrivate; |
48 | class Config; | 48 | class Config; |
49 | class QListViewItem; | 49 | class QListViewItem; |
50 | class QListView; | 50 | class QListView; |
51 | class QPoint; | 51 | class QPoint; |
52 | class QAction; | 52 | class QAction; |
53 | class QLabel; | 53 | class QLabel; |
54 | 54 | ||
55 | class PlayListWidget : public PlayListWidgetGui { | 55 | class PlayListWidget : public PlayListWidgetGui { |
56 | Q_OBJECT | 56 | Q_OBJECT |
57 | public: | 57 | public: |
58 | enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; | 58 | enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; |
59 | enum { TabTypeCount = 4 }; | 59 | enum { TabTypeCount = 4 }; |
60 | 60 | ||
61 | struct Entry | 61 | struct Entry |
62 | { | 62 | { |
63 | Entry( const QString &_name, const QString &_fileName ) | 63 | Entry( const QString &_name, const QString &_fileName ) |
64 | : name( _name ), file( _fileName ) {} | 64 | : name( _name ), file( _fileName ) {} |
65 | Entry( const QString &_fileName ) | 65 | Entry( const QString &_fileName ) |
66 | : name( _fileName ), file( _fileName ) {} | 66 | : name( _fileName ), file( _fileName ) {} |
67 | 67 | ||
68 | QString name; | 68 | QString name; |
69 | QString file; | 69 | QString file; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); | 72 | PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); |
73 | ~PlayListWidget(); | 73 | ~PlayListWidget(); |
74 | 74 | ||
75 | // retrieve the current playlist entry (media file link) | 75 | // retrieve the current playlist entry (media file link) |
76 | const DocLnk *current() const; | 76 | const DocLnk *current() const; |
77 | void useSelectedDocument(); | 77 | void useSelectedDocument(); |
78 | TabType currentTab() const; | 78 | TabType currentTab() const; |
79 | 79 | ||
80 | Entry currentEntry() const; | 80 | Entry currentEntry() const; |
81 | 81 | ||
82 | public slots: | 82 | public slots: |
83 | bool first(); | 83 | bool first(); |
84 | bool last(); | 84 | bool last(); |
85 | bool next(); | 85 | bool next(); |
86 | bool prev(); | 86 | bool prev(); |
87 | void writeDefaultPlaylist( ); | 87 | void writeDefaultPlaylist( ); |
88 | QString currentFileListPathName() const; | 88 | QString currentFileListPathName() const; |
89 | protected: | 89 | protected: |
90 | void keyReleaseEvent( QKeyEvent *e); | 90 | void keyReleaseEvent( QKeyEvent *e); |
91 | 91 | ||
92 | signals: | 92 | signals: |
93 | void skinSelected(); | 93 | void skinSelected(); |
94 | 94 | ||
95 | private: | 95 | private: |
96 | int defaultSkinIndex; | 96 | int defaultSkinIndex; |
97 | void readm3u(const QString &); | 97 | void readm3u(const QString &); |
98 | void readPls(const QString &); | 98 | void readPls(const QString &); |
99 | void initializeStates(); | 99 | void initializeStates(); |
100 | 100 | ||
101 | QListView *currentFileListView() const; | 101 | QListView *currentFileListView() const; |
102 | 102 | ||
103 | bool inFileListMode() const; | 103 | bool inFileListMode() const; |
104 | 104 | ||
105 | private slots: | 105 | private slots: |
106 | void populateSkinsMenu(); | 106 | void populateSkinsMenu(); |
107 | void skinsMenuActivated(int); | 107 | void skinsMenuActivated(int); |
108 | void pmViewActivated(int); | 108 | void pmViewActivated(int); |
109 | void writem3u(); | 109 | void writem3u(); |
110 | void writeCurrentM3u(); | 110 | void writeCurrentM3u(); |
111 | void scanForAudio(); | ||
112 | void scanForVideo(); | ||
113 | void openFile(); | 111 | void openFile(); |
114 | void setDocument( const QString& fileref ); | 112 | void setDocument( const QString& fileref ); |
115 | void addToSelection( const DocLnk& ); // Add a media file to the playlist | 113 | void addToSelection( const DocLnk& ); // Add a media file to the playlist |
116 | void addToSelection( QListViewItem* ); // Add a media file to the playlist | 114 | void addToSelection( QListViewItem* ); // Add a media file to the playlist |
117 | void clearList(); | 115 | void clearList(); |
118 | void addAllToList(); | 116 | void addAllToList(); |
119 | void addAllMusicToList(); | 117 | void addAllMusicToList(); |
120 | void addAllVideoToList(); | 118 | void addAllVideoToList(); |
121 | void saveList(); // Save the playlist | 119 | void saveList(); // Save the playlist |
122 | void loadList( const DocLnk &); // Load a playlist | 120 | void loadList( const DocLnk &); // Load a playlist |
123 | void playIt( QListViewItem *); | 121 | void playIt( QListViewItem *); |
124 | void btnPlay(bool); | 122 | void btnPlay(bool); |
125 | void deletePlaylist(); | 123 | void deletePlaylist(); |
126 | void addSelected(); | 124 | void addSelected(); |
127 | void removeSelected(); | 125 | void removeSelected(); |
128 | void tabChanged(QWidget*); | 126 | void tabChanged(QWidget*); |
129 | void viewPressed( int, QListViewItem *, const QPoint&, int); | 127 | void viewPressed( int, QListViewItem *, const QPoint&, int); |
130 | void playlistViewPressed( int, QListViewItem *, const QPoint&, int); | 128 | void playlistViewPressed( int, QListViewItem *, const QPoint&, int); |
131 | void playSelected(); | 129 | void playSelected(); |
132 | 130 | ||
133 | private: | 131 | private: |
134 | bool fromSetDocument; | 132 | bool fromSetDocument; |
135 | bool insanityBool; | 133 | bool insanityBool; |
136 | QString setDocFileRef, currentPlayList; | 134 | QString setDocFileRef, currentPlayList; |
137 | int selected; | 135 | int selected; |
138 | }; | 136 | }; |
139 | 137 | ||
140 | #endif // PLAY_LIST_WIDGET_H | 138 | #endif // PLAY_LIST_WIDGET_H |
141 | 139 | ||