-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 49f1786..30be4ba 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -1,192 +1,192 @@ | |||
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 <qtoolbar.h> | 34 | #include <qtoolbar.h> |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | 36 | ||
37 | #include <qlayout.h> | 37 | #include <qlayout.h> |
38 | #include <qmenubar.h> | 38 | #include <qmenubar.h> |
39 | 39 | ||
40 | #include "playlistselection.h" | 40 | #include "playlistselection.h" |
41 | #include "playlistwidget.h" | 41 | #include "playlistwidget.h" |
42 | #include "mediaplayerstate.h" | 42 | #include "mediaplayerstate.h" |
43 | #include "inputDialog.h" | 43 | #include "inputDialog.h" |
44 | #include "playlistfileview.h" | 44 | #include "playlistfileview.h" |
45 | 45 | ||
46 | 46 | ||
47 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) | 47 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) |
48 | : QMainWindow( parent, name ) { | 48 | : QMainWindow( parent, name ) { |
49 | 49 | ||
50 | d = new PlayListWidgetPrivate; | 50 | d = new PlayListWidgetPrivate; |
51 | d->setDocumentUsed = FALSE; | 51 | d->setDocumentUsed = FALSE; |
52 | 52 | ||
53 | setBackgroundMode( PaletteButton ); | 53 | setBackgroundMode( PaletteButton ); |
54 | setToolBarsMovable( FALSE ); | 54 | setToolBarsMovable( FALSE ); |
55 | 55 | ||
56 | // Create Toolbar | 56 | // Create Toolbar |
57 | QToolBar *toolbar = new QToolBar( this ); | 57 | QToolBar *toolbar = new QToolBar( this ); |
58 | toolbar->setHorizontalStretchable( TRUE ); | 58 | toolbar->setHorizontalStretchable( TRUE ); |
59 | 59 | ||
60 | // Create Menubar | 60 | // Create Menubar |
61 | QMenuBar *menu = new QMenuBar( toolbar ); | 61 | QMenuBar *menu = new QMenuBar( toolbar ); |
62 | menu->setMargin( 0 ); | 62 | menu->setMargin( 0 ); |
63 | 63 | ||
64 | bar = new QToolBar( this ); | 64 | bar = new QToolBar( this ); |
65 | bar->setLabel( tr( "Play Operations" ) ); | 65 | bar->setLabel( tr( "Play Operations" ) ); |
66 | 66 | ||
67 | tbDeletePlaylist = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), | 67 | tbDeletePlaylist = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), |
68 | "", bar, "close" ); | 68 | "", bar, "close" ); |
69 | tbDeletePlaylist->setFlat( TRUE ); | 69 | tbDeletePlaylist->setFlat( TRUE ); |
70 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 70 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
71 | 71 | ||
72 | tbDeletePlaylist->hide(); | 72 | tbDeletePlaylist->hide(); |
73 | 73 | ||
74 | pmPlayList = new QPopupMenu( this ); | 74 | pmPlayList = new QPopupMenu( this ); |
75 | menu->insertItem( tr( "File" ), pmPlayList ); | 75 | menu->insertItem( tr( "File" ), pmPlayList ); |
76 | 76 | ||
77 | pmView = new QPopupMenu( this ); | 77 | pmView = new QPopupMenu( this ); |
78 | menu->insertItem( tr( "View" ), pmView ); | 78 | menu->insertItem( tr( "View" ), pmView ); |
79 | pmView->isCheckable(); | 79 | pmView->isCheckable(); |
80 | 80 | ||
81 | skinsMenu = new QPopupMenu( this ); | 81 | skinsMenu = new QPopupMenu( this ); |
82 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 82 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
83 | skinsMenu->isCheckable(); | 83 | skinsMenu->isCheckable(); |
84 | 84 | ||
85 | gammaMenu = new QPopupMenu( this ); | 85 | gammaMenu = new QPopupMenu( this ); |
86 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); | 86 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
87 | 87 | ||
88 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 88 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
89 | gammaSlider->setRange( -40, 40 ); | 89 | gammaSlider->setRange( -40, 40 ); |
90 | gammaSlider->setTickmarks( QSlider::Left ); | 90 | gammaSlider->setTickmarks( QSlider::Left ); |
91 | gammaSlider->setTickInterval( 20 ); | 91 | gammaSlider->setTickInterval( 20 ); |
92 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); | 92 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); |
93 | gammaSlider->setValue( 0 ); | 93 | gammaSlider->setValue( 0 ); |
94 | gammaSlider->setMinimumHeight( 50 ); | 94 | gammaSlider->setMinimumHeight( 50 ); |
95 | 95 | ||
96 | gammaLCD = new QLCDNumber( 3, gammaMenu ); | 96 | gammaLCD = new QLCDNumber( 3, gammaMenu ); |
97 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); | 97 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); |
98 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); | 98 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); |
99 | 99 | ||
100 | gammaMenu->insertItem( gammaSlider ); | 100 | gammaMenu->insertItem( gammaSlider ); |
101 | gammaMenu->insertItem( gammaLCD ); | 101 | gammaMenu->insertItem( gammaLCD ); |
102 | 102 | ||
103 | connect( gammaSlider, SIGNAL( valueChanged(int) ), gammaLCD, SLOT( display(int) ) ); | 103 | connect( gammaSlider, SIGNAL( valueChanged(int) ), gammaLCD, SLOT( display(int) ) ); |
104 | 104 | ||
105 | vbox5 = new QVBox( this ); | 105 | vbox5 = new QVBox( this ); |
106 | QVBox *vbox4 = new QVBox( vbox5 ); | 106 | QVBox *vbox4 = new QVBox( vbox5 ); |
107 | QHBox *hbox6 = new QHBox( vbox4 ); | 107 | QHBox *hbox6 = new QHBox( vbox4 ); |
108 | 108 | ||
109 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 109 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
110 | 110 | ||
111 | playListTab = new QWidget( tabWidget, "PlayListTab" ); | 111 | playListTab = new QWidget( tabWidget, "PlayListTab" ); |
112 | tabWidget->insertTab( playListTab, "Playlist"); | 112 | tabWidget->insertTab( playListTab, "Playlist"); |
113 | 113 | ||
114 | QGridLayout *Playout = new QGridLayout( playListTab ); | 114 | QGridLayout *Playout = new QGridLayout( playListTab ); |
115 | Playout->setSpacing( 2); | 115 | Playout->setSpacing( 2); |
116 | Playout->setMargin( 2); | 116 | Playout->setMargin( 2); |
117 | 117 | ||
118 | // Add the playlist area | 118 | // Add the playlist area |
119 | QVBox *vbox3 = new QVBox( playListTab ); | 119 | QVBox *vbox3 = new QVBox( playListTab ); |
120 | d->playListFrame = vbox3; | 120 | d->playListFrame = vbox3; |
121 | 121 | ||
122 | QHBox *hbox2 = new QHBox( vbox3 ); | 122 | QHBox *hbox2 = new QHBox( vbox3 ); |
123 | d->selectedFiles = new PlayListSelection( hbox2 ); | 123 | d->selectedFiles = new PlayListSelection( hbox2 ); |
124 | 124 | ||
125 | vbox1 = new QVBox( hbox2 ); | 125 | vbox1 = new QVBox( hbox2 ); |
126 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); | 126 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); |
127 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch | 127 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch |
128 | 128 | ||
129 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 129 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
130 | 130 | ||
131 | QWidget *aTab; | 131 | QWidget *aTab; |
132 | aTab = new QWidget( tabWidget, "aTab" ); | 132 | aTab = new QWidget( tabWidget, "aTab" ); |
133 | 133 | ||
134 | QGridLayout *Alayout = new QGridLayout( aTab ); | 134 | QGridLayout *Alayout = new QGridLayout( aTab ); |
135 | Alayout->setSpacing( 2 ); | 135 | Alayout->setSpacing( 2 ); |
136 | Alayout->setMargin( 2 ); | 136 | Alayout->setMargin( 2 ); |
137 | // no m3u's here please | 137 | // no m3u's here please |
138 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;application/ogg", "opieplayer2/musicfile", aTab, "Audioview" ); | 138 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;audio/x-ogg;application/ogg", "opieplayer2/musicfile", aTab, "Audioview" ); |
139 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 139 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
140 | tabWidget->insertTab( aTab, tr( "Audio" ) ); | 140 | tabWidget->insertTab( aTab, tr( "Audio" ) ); |
141 | 141 | ||
142 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); | 142 | QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold ); |
143 | 143 | ||
144 | QWidget *vTab; | 144 | QWidget *vTab; |
145 | vTab = new QWidget( tabWidget, "vTab" ); | 145 | vTab = new QWidget( tabWidget, "vTab" ); |
146 | 146 | ||
147 | QGridLayout *Vlayout = new QGridLayout( vTab ); | 147 | QGridLayout *Vlayout = new QGridLayout( vTab ); |
148 | Vlayout->setSpacing( 2 ); | 148 | Vlayout->setSpacing( 2 ); |
149 | Vlayout->setMargin( 2 ); | 149 | Vlayout->setMargin( 2 ); |
150 | videoView = new PlayListFileView( "video/*", "opieplayer2/videofile", vTab, "Videoview" ); | 150 | videoView = new PlayListFileView( "video/*", "opieplayer2/videofile", vTab, "Videoview" ); |
151 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | 151 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); |
152 | 152 | ||
153 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); | 153 | QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold ); |
154 | 154 | ||
155 | tabWidget->insertTab( vTab, tr( "Video" ) ); | 155 | tabWidget->insertTab( vTab, tr( "Video" ) ); |
156 | 156 | ||
157 | //playlists list | 157 | //playlists list |
158 | QWidget *LTab; | 158 | QWidget *LTab; |
159 | LTab = new QWidget( tabWidget, "LTab" ); | 159 | LTab = new QWidget( tabWidget, "LTab" ); |
160 | QGridLayout *Llayout = new QGridLayout( LTab ); | 160 | QGridLayout *Llayout = new QGridLayout( LTab ); |
161 | Llayout->setSpacing( 2 ); | 161 | Llayout->setSpacing( 2 ); |
162 | Llayout->setMargin( 2 ); | 162 | Llayout->setMargin( 2 ); |
163 | 163 | ||
164 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); | 164 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE ); |
165 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 165 | Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
166 | 166 | ||
167 | tabWidget->insertTab( LTab, tr( "Lists" ) ); | 167 | tabWidget->insertTab( LTab, tr( "Lists" ) ); |
168 | 168 | ||
169 | setCentralWidget( vbox5 ); | 169 | setCentralWidget( vbox5 ); |
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | PlayListWidgetGui::~PlayListWidgetGui() { | 174 | PlayListWidgetGui::~PlayListWidgetGui() { |
175 | } | 175 | } |
176 | 176 | ||
177 | void PlayListWidgetGui::setView( char view ) { | 177 | void PlayListWidgetGui::setView( char view ) { |
178 | if ( view == 'l' ) | 178 | if ( view == 'l' ) |
179 | showMaximized(); | 179 | showMaximized(); |
180 | else | 180 | else |
181 | hide(); | 181 | hide(); |
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | void PlayListWidgetGui::setActiveWindow() { | 185 | void PlayListWidgetGui::setActiveWindow() { |
186 | // When we get raised we need to ensure that it switches views | 186 | // When we get raised we need to ensure that it switches views |
187 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); | 187 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); |
188 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate | 188 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
189 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back | 189 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back |
190 | } | 190 | } |
191 | 191 | ||
192 | 192 | ||