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 | |||
@@ -66,67 +66,67 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par | |||
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) ), |
@@ -588,73 +588,64 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
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") { |
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 | |||
@@ -79,63 +79,61 @@ public: | |||
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 | ||