Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 84aba55..1a5e474 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -1,97 +1,98 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002,2003 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002,2003 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; General Public License for more | 22 | ..}^=.= = ; General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = General Public License along with | 26 | -_. . . )=. = General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qtoolbar.h> | 34 | #include <qtoolbar.h> |
35 | 35 | ||
36 | #include <opie/ofiledialog.h> | 36 | #include <opie2/ofiledialog.h> |
37 | 37 | ||
38 | #include <qmessagebox.h> | 38 | #include <qmessagebox.h> |
39 | 39 | ||
40 | #include "playlistselection.h" | 40 | #include "playlistselection.h" |
41 | #include "playlistwidget.h" | 41 | #include "playlistwidget.h" |
42 | #include "mediaplayer.h" | 42 | #include "mediaplayer.h" |
43 | #include "inputDialog.h" | 43 | #include "inputDialog.h" |
44 | #include "om3u.h" | 44 | #include "om3u.h" |
45 | #include "playlistfileview.h" | 45 | #include "playlistfileview.h" |
46 | 46 | ||
47 | //only needed for the random play | 47 | //only needed for the random play |
48 | #include <assert.h> | 48 | #include <assert.h> |
49 | 49 | ||
50 | using namespace Opie::Ui; | ||
50 | PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) | 51 | PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) |
51 | : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) | 52 | : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) |
52 | { | 53 | { |
53 | mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); | 54 | mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); |
54 | m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); | 55 | m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); |
55 | 56 | ||
56 | 57 | ||
57 | 58 | ||
58 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), | 59 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), |
59 | "opieplayer2/add_to_playlist", | 60 | "opieplayer2/add_to_playlist", |
60 | this , SLOT(addSelected() ) ); | 61 | this , SLOT(addSelected() ) ); |
61 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), | 62 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), |
62 | "opieplayer2/remove_from_playlist", | 63 | "opieplayer2/remove_from_playlist", |
63 | this , SLOT(removeSelected() ) ); | 64 | this , SLOT(removeSelected() ) ); |
64 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", | 65 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", |
65 | this , SLOT( btnPlay(bool) ), TRUE ); | 66 | this , SLOT( btnPlay(bool) ), TRUE ); |
66 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", | 67 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", |
67 | mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); | 68 | mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); |
68 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", | 69 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", |
69 | mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); | 70 | mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); |
70 | 71 | ||
71 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 72 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
72 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), | 73 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), |
73 | this, SLOT( addAllMusicToList() ) ); | 74 | this, SLOT( addAllMusicToList() ) ); |
74 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), | 75 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), |
75 | this, SLOT( addAllVideoToList() ) ); | 76 | this, SLOT( addAllVideoToList() ) ); |
76 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), | 77 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), |
77 | this, SLOT( addAllToList() ) ); | 78 | this, SLOT( addAllToList() ) ); |
78 | pmPlayList->insertSeparator(-1); | 79 | pmPlayList->insertSeparator(-1); |
79 | (void)new MenuItem( pmPlayList, tr( "Add File" ), | 80 | (void)new MenuItem( pmPlayList, tr( "Add File" ), |
80 | this,SLOT( openFile() ) ); | 81 | this,SLOT( openFile() ) ); |
81 | (void)new MenuItem( pmPlayList, tr("Add URL"), | 82 | (void)new MenuItem( pmPlayList, tr("Add URL"), |
82 | this,SLOT( openURL() ) ); | 83 | this,SLOT( openURL() ) ); |
83 | pmPlayList->insertSeparator(-1); | 84 | pmPlayList->insertSeparator(-1); |
84 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), | 85 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), |
85 | this, SLOT(writem3u() ) ); | 86 | this, SLOT(writem3u() ) ); |
86 | pmPlayList->insertSeparator(-1); | 87 | pmPlayList->insertSeparator(-1); |
87 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), | 88 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), |
88 | audioView, SLOT( scanFiles() ) ); | 89 | audioView, SLOT( scanFiles() ) ); |
89 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), | 90 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), |
90 | videoView, SLOT( scanFiles() ) ); | 91 | videoView, SLOT( scanFiles() ) ); |
91 | 92 | ||
92 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), | 93 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), |
93 | mediaPlayerState, SLOT( toggleFullscreen() ) ); | 94 | mediaPlayerState, SLOT( toggleFullscreen() ) ); |
94 | 95 | ||
95 | Config cfg( "OpiePlayer" ); | 96 | Config cfg( "OpiePlayer" ); |
96 | bool b= cfg.readBoolEntry("FullScreen", 0); | 97 | bool b= cfg.readBoolEntry("FullScreen", 0); |
97 | mediaPlayerState->setFullscreen( b ); | 98 | mediaPlayerState->setFullscreen( b ); |