author | simon <simon> | 2002-12-08 22:25:56 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 22:25:56 (UTC) |
commit | 5d3f3d429bb6247741a30c00a344302a2c9a20c0 (patch) (unidiff) | |
tree | e33d2bfc6d5c19eba28a2ef454ec0d492e340ea9 | |
parent | 00252c667bf6c6af3f2a1d2519bf23e448e8f174 (diff) | |
download | opie-5d3f3d429bb6247741a30c00a344302a2c9a20c0.zip opie-5d3f3d429bb6247741a30c00a344302a2c9a20c0.tar.gz opie-5d3f3d429bb6247741a30c00a344302a2c9a20c0.tar.bz2 |
- no need to include audio and videowidget.h here
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 7f851bd..5886458 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -1,208 +1,206 @@ | |||
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 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 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 <qpe/qpemenubar.h> | 34 | #include <qpe/qpemenubar.h> |
35 | #include <qpe/qpetoolbar.h> | 35 | #include <qpe/qpetoolbar.h> |
36 | #include <qpe/fileselector.h> | 36 | #include <qpe/fileselector.h> |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #include <qpe/storage.h> | 38 | #include <qpe/storage.h> |
39 | #include <qpe/mimetype.h> | 39 | #include <qpe/mimetype.h> |
40 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
41 | #include <qpe/global.h> | 41 | #include <qpe/global.h> |
42 | #include <qpe/resource.h> | 42 | #include <qpe/resource.h> |
43 | 43 | ||
44 | #include <qpopupmenu.h> | 44 | #include <qpopupmenu.h> |
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qcursor.h> | 46 | #include <qcursor.h> |
47 | #include <qdir.h> | 47 | #include <qdir.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | 49 | ||
50 | #include "playlistselection.h" | 50 | #include "playlistselection.h" |
51 | #include "playlistwidget.h" | 51 | #include "playlistwidget.h" |
52 | #include "mediaplayerstate.h" | 52 | #include "mediaplayerstate.h" |
53 | #include "inputDialog.h" | 53 | #include "inputDialog.h" |
54 | #include "playlistfileview.h" | 54 | #include "playlistfileview.h" |
55 | 55 | ||
56 | //only needed for the random play | 56 | //only needed for the random play |
57 | #include <stdlib.h> | 57 | #include <stdlib.h> |
58 | 58 | ||
59 | #include "audiowidget.h" | ||
60 | #include "videowidget.h" | ||
61 | #include "mediaplayerstate.h" | 59 | #include "mediaplayerstate.h" |
62 | 60 | ||
63 | PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent, const char* name ) | 61 | PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent, const char* name ) |
64 | : QMainWindow( parent, name ), mediaPlayerState( _mediaPlayerState ) { | 62 | : QMainWindow( parent, name ), mediaPlayerState( _mediaPlayerState ) { |
65 | 63 | ||
66 | d = new PlayListWidgetPrivate; | 64 | d = new PlayListWidgetPrivate; |
67 | d->setDocumentUsed = FALSE; | 65 | d->setDocumentUsed = FALSE; |
68 | 66 | ||
69 | setBackgroundMode( PaletteButton ); | 67 | setBackgroundMode( PaletteButton ); |
70 | setToolBarsMovable( FALSE ); | 68 | setToolBarsMovable( FALSE ); |
71 | 69 | ||
72 | // Create Toolbar | 70 | // Create Toolbar |
73 | QPEToolBar *toolbar = new QPEToolBar( this ); | 71 | QPEToolBar *toolbar = new QPEToolBar( this ); |
74 | toolbar->setHorizontalStretchable( TRUE ); | 72 | toolbar->setHorizontalStretchable( TRUE ); |
75 | 73 | ||
76 | // Create Menubar | 74 | // Create Menubar |
77 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 75 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
78 | menu->setMargin( 0 ); | 76 | menu->setMargin( 0 ); |
79 | 77 | ||
80 | bar = new QPEToolBar( this ); | 78 | bar = new QPEToolBar( this ); |
81 | bar->setLabel( tr( "Play Operations" ) ); | 79 | bar->setLabel( tr( "Play Operations" ) ); |
82 | 80 | ||
83 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 81 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); |
84 | tbDeletePlaylist->setFlat( TRUE ); | 82 | tbDeletePlaylist->setFlat( TRUE ); |
85 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 83 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
86 | 84 | ||
87 | tbDeletePlaylist->hide(); | 85 | tbDeletePlaylist->hide(); |
88 | 86 | ||
89 | pmPlayList = new QPopupMenu( this ); | 87 | pmPlayList = new QPopupMenu( this ); |
90 | menu->insertItem( tr( "File" ), pmPlayList ); | 88 | menu->insertItem( tr( "File" ), pmPlayList ); |
91 | 89 | ||
92 | pmView = new QPopupMenu( this ); | 90 | pmView = new QPopupMenu( this ); |
93 | menu->insertItem( tr( "View" ), pmView ); | 91 | menu->insertItem( tr( "View" ), pmView ); |
94 | pmView->isCheckable(); | 92 | pmView->isCheckable(); |
95 | 93 | ||
96 | skinsMenu = new QPopupMenu( this ); | 94 | skinsMenu = new QPopupMenu( this ); |
97 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 95 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
98 | skinsMenu->isCheckable(); | 96 | skinsMenu->isCheckable(); |
99 | 97 | ||
100 | gammaMenu = new QPopupMenu( this ); | 98 | gammaMenu = new QPopupMenu( this ); |
101 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); | 99 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
102 | 100 | ||
103 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 101 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
104 | gammaSlider->setRange( -40, 40 ); | 102 | gammaSlider->setRange( -40, 40 ); |
105 | gammaSlider->setTickmarks( QSlider::Left ); | 103 | gammaSlider->setTickmarks( QSlider::Left ); |
106 | gammaSlider->setTickInterval( 20 ); | 104 | gammaSlider->setTickInterval( 20 ); |
107 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); | 105 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); |
108 | gammaSlider->setValue( 0 ); | 106 | gammaSlider->setValue( 0 ); |
109 | gammaSlider->setMinimumHeight( 50 ); | 107 | gammaSlider->setMinimumHeight( 50 ); |
110 | 108 | ||
111 | gammaLCD = new QLCDNumber( 3, gammaMenu ); | 109 | gammaLCD = new QLCDNumber( 3, gammaMenu ); |
112 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); | 110 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); |
113 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); | 111 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); |
114 | 112 | ||
115 | gammaMenu->insertItem( gammaSlider ); | 113 | gammaMenu->insertItem( gammaSlider ); |
116 | gammaMenu->insertItem( gammaLCD ); | 114 | gammaMenu->insertItem( gammaLCD ); |
117 | 115 | ||
118 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); | 116 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); |
119 | 117 | ||
120 | vbox5 = new QVBox( this ); | 118 | vbox5 = new QVBox( this ); |
121 | QVBox *vbox4 = new QVBox( vbox5 ); | 119 | QVBox *vbox4 = new QVBox( vbox5 ); |
122 | QHBox *hbox6 = new QHBox( vbox4 ); | 120 | QHBox *hbox6 = new QHBox( vbox4 ); |
123 | 121 | ||
124 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 122 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
125 | 123 | ||
126 | QWidget *pTab; | 124 | QWidget *pTab; |
127 | pTab = new QWidget( tabWidget, "pTab" ); | 125 | pTab = new QWidget( tabWidget, "pTab" ); |
128 | tabWidget->insertTab( pTab, "Playlist"); | 126 | tabWidget->insertTab( pTab, "Playlist"); |
129 | 127 | ||
130 | QGridLayout *Playout = new QGridLayout( pTab ); | 128 | QGridLayout *Playout = new QGridLayout( pTab ); |
131 | Playout->setSpacing( 2); | 129 | Playout->setSpacing( 2); |
132 | Playout->setMargin( 2); | 130 | Playout->setMargin( 2); |
133 | 131 | ||
134 | // Add the playlist area | 132 | // Add the playlist area |
135 | QVBox *vbox3 = new QVBox( pTab ); | 133 | QVBox *vbox3 = new QVBox( pTab ); |
136 | d->playListFrame = vbox3; | 134 | d->playListFrame = vbox3; |
137 | 135 | ||
138 | QHBox *hbox2 = new QHBox( vbox3 ); | 136 | QHBox *hbox2 = new QHBox( vbox3 ); |
139 | d->selectedFiles = new PlayListSelection( hbox2 ); | 137 | d->selectedFiles = new PlayListSelection( hbox2 ); |
140 | 138 | ||
141 | vbox1 = new QVBox( hbox2 ); | 139 | vbox1 = new QVBox( hbox2 ); |
142 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); | 140 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); |
143 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch | 141 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch |
144 | 142 | ||
145 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 143 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
146 | 144 | ||
147 | QWidget *aTab; | 145 | QWidget *aTab; |
148 | aTab = new QWidget( tabWidget, "aTab" ); | 146 | aTab = new QWidget( tabWidget, "aTab" ); |
149 | 147 | ||
150 | QGridLayout *Alayout = new QGridLayout( aTab ); | 148 | QGridLayout *Alayout = new QGridLayout( aTab ); |
151 | Alayout->setSpacing( 2 ); | 149 | Alayout->setSpacing( 2 ); |
152 | Alayout->setMargin( 2 ); | 150 | Alayout->setMargin( 2 ); |
153 | // no m3u's here please | 151 | // no m3u's here please |
154 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;audio/x-ogg", "opieplayer2/musicfile", aTab, "Audioview" ); | 152 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;audio/x-ogg", "opieplayer2/musicfile", aTab, "Audioview" ); |
155 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 153 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
156 | tabWidget->insertTab( aTab, tr( "Audio" ) ); | 154 | tabWidget->insertTab( aTab, tr( "Audio" ) ); |
157 | 155 | ||
158 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); | 156 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); |
159 | 157 | ||
160 | QWidget *vTab; | 158 | QWidget *vTab; |
161 | vTab = new QWidget( tabWidget, "vTab" ); | 159 | vTab = new QWidget( tabWidget, "vTab" ); |
162 | 160 | ||
163 | QGridLayout *Vlayout = new QGridLayout( vTab ); | 161 | QGridLayout *Vlayout = new QGridLayout( vTab ); |
164 | Vlayout->setSpacing( 2 ); | 162 | Vlayout->setSpacing( 2 ); |
165 | Vlayout->setMargin( 2 ); | 163 | Vlayout->setMargin( 2 ); |
166 | videoView = new PlayListFileView( "video/*", "opieplayer2/videofile", vTab, "Videoview" ); | 164 | videoView = new PlayListFileView( "video/*", "opieplayer2/videofile", vTab, "Videoview" ); |
167 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | 165 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); |
168 | 166 | ||
169 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); | 167 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); |
170 | 168 | ||
171 | tabWidget->insertTab( vTab, tr( "Video" ) ); | 169 | tabWidget->insertTab( vTab, tr( "Video" ) ); |
172 | 170 | ||
173 | //playlists list | 171 | //playlists list |
174 | QWidget *LTab; | 172 | QWidget *LTab; |
175 | LTab = new QWidget( tabWidget, "LTab" ); | 173 | LTab = new QWidget( tabWidget, "LTab" ); |
176 | QGridLayout *Llayout = new QGridLayout( LTab ); | 174 | QGridLayout *Llayout = new QGridLayout( LTab ); |
177 | Llayout->setSpacing( 2 ); | 175 | Llayout->setSpacing( 2 ); |
178 | Llayout->setMargin( 2 ); | 176 | Llayout->setMargin( 2 ); |
179 | 177 | ||
180 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); | 178 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); |
181 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 179 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
182 | 180 | ||
183 | tabWidget->insertTab( LTab, tr( "Lists" ) ); | 181 | tabWidget->insertTab( LTab, tr( "Lists" ) ); |
184 | 182 | ||
185 | setCentralWidget( vbox5 ); | 183 | setCentralWidget( vbox5 ); |
186 | } | 184 | } |
187 | 185 | ||
188 | 186 | ||
189 | 187 | ||
190 | PlayListWidgetGui::~PlayListWidgetGui() { | 188 | PlayListWidgetGui::~PlayListWidgetGui() { |
191 | } | 189 | } |
192 | 190 | ||
193 | void PlayListWidgetGui::setView( char view ) { | 191 | void PlayListWidgetGui::setView( char view ) { |
194 | if ( view == 'l' ) | 192 | if ( view == 'l' ) |
195 | showMaximized(); | 193 | showMaximized(); |
196 | else | 194 | else |
197 | hide(); | 195 | hide(); |
198 | } | 196 | } |
199 | 197 | ||
200 | 198 | ||
201 | void PlayListWidgetGui::setActiveWindow() { | 199 | void PlayListWidgetGui::setActiveWindow() { |
202 | // qDebug("SETTING active window"); | 200 | // qDebug("SETTING active window"); |
203 | // When we get raised we need to ensure that it switches views | 201 | // When we get raised we need to ensure that it switches views |
204 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState.displayType(); | 202 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState.displayType(); |
205 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); // invalidate | 203 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
206 | mediaPlayerState.setDisplayType( origDisplayType ); // now switch back | 204 | mediaPlayerState.setDisplayType( origDisplayType ); // now switch back |
207 | } | 205 | } |
208 | 206 | ||