summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/opieplayer2.pro11
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp455
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h69
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.cpp207
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.h126
5 files changed, 507 insertions, 361 deletions
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro
index 3a47c06..a83a624 100644
--- a/noncore/multimedia/opieplayer2/opieplayer2.pro
+++ b/noncore/multimedia/opieplayer2/opieplayer2.pro
@@ -1,4 +1,4 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on release 2#CONFIG = qt warn_on release
3#CONFIG = qt warn_on debug 3CONFIG = qt warn_on debug
4DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
@@ -6,3 +6,3 @@ HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\
6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ 6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \
7 frame.h lib.h xinevideowidget.h volumecontrol.h\ 7 frame.h lib.h xinevideowidget.h volumecontrol.h playlistwidgetgui.h\
8 alphablend.h yuv2rgb.h 8 alphablend.h yuv2rgb.h
@@ -12,2 +12,3 @@ SOURCES = main.cpp \
12 frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\ 12 frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\
13 playlistwidgetgui.cpp\
13 alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S 14 alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S
@@ -20,4 +21,4 @@ OBJECTS_DIR=qpeobj
20 21
21INCLUDEPATH += $(OPIEDIR)/include 22#INCLUDEPATH += $(OPIEDIR)/include
22DEPENDPATH += $(OPIEDIR)/include 23#DEPENDPATH += $(OPIEDIR)/include
23 24
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 098322b..6c7f6ba 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -1,33 +1,43 @@
1/*
2                This file is part of the Opie Project
3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =.
8 .=l.
9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details.
24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA.
31
32*/
1 33
2#define QTOPIA_INTERNAL_FSLP
3#include <qpe/qpemenubar.h>
4#include <qpe/qpetoolbar.h> 34#include <qpe/qpetoolbar.h>
5#include <qpe/fileselector.h>
6#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
7#include <qpe/lnkproperties.h>
8#include <qpe/storage.h> 36#include <qpe/storage.h>
9#include <qpe/mimetype.h> 37#include <qpe/mimetype.h>
10
11#include <qpe/applnk.h>
12#include <qpopupmenu.h>
13#include <qpe/config.h>
14#include <qpe/global.h> 38#include <qpe/global.h>
15#include <qpe/resource.h> 39#include <qpe/resource.h>
16#include <qaction.h> 40
17#include <qcursor.h>
18#include <qimage.h>
19#include <qfile.h>
20#include <qdir.h> 41#include <qdir.h>
21#include <qlayout.h>
22#include <qlabel.h>
23#include <qlist.h>
24#include <qlistbox.h>
25#include <qmainwindow.h>
26#include <qmessagebox.h> 42#include <qmessagebox.h>
27#include <qtoolbutton.h>
28#include <qtabwidget.h>
29#include <qlistview.h>
30#include <qpoint.h>
31#include <qlineedit.h>
32#include <qpushbutton.h>
33#include <qregexp.h> 43#include <qregexp.h>
@@ -35,3 +45,2 @@
35 45
36
37#include "playlistselection.h" 46#include "playlistselection.h"
@@ -39,6 +48,7 @@
39#include "mediaplayerstate.h" 48#include "mediaplayerstate.h"
40
41#include "inputDialog.h" 49#include "inputDialog.h"
42 50
51//only needed for the random play
43#include <stdlib.h> 52#include <stdlib.h>
53
44#include "audiowidget.h" 54#include "audiowidget.h"
@@ -46,6 +56,2 @@
46 56
47#define BUTTONS_ON_TOOLBAR
48#define SIDE_BUTTONS
49#define CAN_SAVE_LOAD_PLAYLISTS
50
51extern MediaPlayerState *mediaPlayerState; 57extern MediaPlayerState *mediaPlayerState;
@@ -53,70 +59,4 @@ extern MediaPlayerState *mediaPlayerState;
53 59
54class PlayListWidgetPrivate {
55public:
56 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
57 QFrame *playListFrame;
58 FileSelector *files;
59 PlayListSelection *selectedFiles;
60 bool setDocumentUsed;
61 DocLnk *current;
62};
63
64
65class ToolButton : public QToolButton {
66public:
67 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
68 : QToolButton( parent, name ) {
69 setTextLabel( name );
70 setPixmap( Resource::loadPixmap( icon ) );
71 setAutoRaise( TRUE );
72 setFocusPolicy( QWidget::NoFocus );
73 setToggleButton( t );
74 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
75 QPEMenuToolFocusManager::manager()->addWidget( this );
76 }
77};
78
79
80class MenuItem : public QAction {
81public:
82 MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot )
83 : QAction( text, QString::null, 0, 0 ) {
84 connect( this, SIGNAL( activated() ), handler, slot );
85 addTo( parent );
86 }
87};
88
89
90PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) 60PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
91 : QMainWindow( parent, name, fl ) { 61 : PlayListWidgetGui( parent, name, fl ) {
92
93 d = new PlayListWidgetPrivate;
94 d->setDocumentUsed = FALSE;
95 d->current = NULL;
96 fromSetDocument = FALSE;
97 insanityBool=FALSE;
98 audioScan = FALSE;
99 videoScan = FALSE;
100
101 setBackgroundMode( PaletteButton );
102
103// setCaption( tr("OpiePlayer") );
104// setIcon( Resource::loadPixmap( "opieplayer2/MPEGPlayer" ) );
105
106 setToolBarsMovable( FALSE );
107
108 // Create Toolbar
109 QPEToolBar *toolbar = new QPEToolBar( this );
110 toolbar->setHorizontalStretchable( TRUE );
111
112 // Create Menubar
113 QPEMenuBar *menu = new QPEMenuBar( toolbar );
114 menu->setMargin( 0 );
115
116 QPEToolBar *bar = new QPEToolBar( this );
117 bar->setLabel( tr( "Play Operations" ) );
118
119 tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close");
120 tbDeletePlaylist->setFlat(TRUE);
121 tbDeletePlaylist->setFixedSize(20,20);
122 62
@@ -132,6 +72,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
132 mediaPlayerState, SLOT(setLooping(bool)), TRUE ); 72 mediaPlayerState, SLOT(setLooping(bool)), TRUE );
133 tbDeletePlaylist->hide();
134 73
135 QPopupMenu *pmPlayList = new QPopupMenu( this );
136 menu->insertItem( tr( "File" ), pmPlayList );
137 (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); 74 (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
@@ -149,6 +86,2 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
149 86
150 pmView = new QPopupMenu( this );
151 menu->insertItem( tr( "View" ), pmView );
152 pmView->isCheckable();
153
154 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); 87 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) );
@@ -160,41 +93,2 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
160 93
161 // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) );
162
163 pmView->insertSeparator(-1);
164
165 skinsMenu = new QPopupMenu( this );
166 pmView->insertItem( tr( "Skins" ), skinsMenu );
167 skinsMenu->isCheckable();
168 populateSkinsMenu();
169
170 QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton );
171 QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton );
172
173 QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton );
174
175 tabWidget = new QTabWidget( hbox6, "tabWidget" );
176 // tabWidget->setTabShape(QTabWidget::Triangular);
177
178 QWidget *pTab;
179 pTab = new QWidget( tabWidget, "pTab" );
180 tabWidget->insertTab( pTab,"Playlist");
181
182
183 QGridLayout *Playout = new QGridLayout( pTab );
184 Playout->setSpacing( 2);
185 Playout->setMargin( 2);
186
187 // Add the playlist area
188
189 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton );
190 d->playListFrame = vbox3;
191
192 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton );
193
194 d->selectedFiles = new PlayListSelection( hbox2);
195 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton );
196
197 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold);
198
199 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch
200 (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); 94 (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) );
@@ -202,78 +96,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
202 (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); 96 (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) );
203 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch 97 QVBox *stretch2 = new QVBox( vbox1 );
204
205
206 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 );
207
208 QWidget *aTab;
209 aTab = new QWidget( tabWidget, "aTab" );
210
211 QGridLayout *Alayout = new QGridLayout( aTab );
212 Alayout->setSpacing( 2);
213 Alayout->setMargin( 2);
214
215 audioView = new QListView( aTab, "Audioview" );
216 audioView->addColumn( tr("Title"),140);
217 audioView->addColumn(tr("Size"), -1);
218 audioView->addColumn(tr("Media"),-1);
219 audioView->setColumnAlignment(1, Qt::AlignRight);
220 audioView->setColumnAlignment(2, Qt::AlignRight);
221 audioView->setAllColumnsShowFocus(TRUE);
222 audioView->setSorting(0,TRUE);
223
224 audioView->setMultiSelection( TRUE );
225 audioView->setSelectionMode( QListView::Extended);
226
227 Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 );
228
229 tabWidget->insertTab(aTab,tr("Audio"));
230
231 QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold);
232
233 QWidget *vTab;
234 vTab = new QWidget( tabWidget, "vTab" );
235
236 QGridLayout *Vlayout = new QGridLayout( vTab );
237 Vlayout->setSpacing( 2);
238 Vlayout->setMargin( 2);
239
240 videoView = new QListView( vTab, "Videoview" );
241
242 videoView->addColumn(tr("Title"),140);
243 videoView->addColumn(tr("Size"),-1);
244 videoView->addColumn(tr("Media"),-1);
245 videoView->setColumnAlignment(1, Qt::AlignRight);
246 videoView->setColumnAlignment(2, Qt::AlignRight);
247 videoView->setAllColumnsShowFocus(TRUE);
248 videoView->setSorting(0,TRUE);
249
250 videoView->setMultiSelection( TRUE );
251 videoView->setSelectionMode( QListView::Extended);
252
253 Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 );
254
255 QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold);
256
257 tabWidget->insertTab( vTab,tr("Video"));
258
259 //playlists list
260 QWidget *LTab;
261 LTab = new QWidget( tabWidget, "LTab" );
262 QGridLayout *Llayout = new QGridLayout( LTab );
263 Llayout->setSpacing( 2);
264 Llayout->setMargin( 2);
265
266 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy
267 Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 );
268
269 tabWidget->insertTab(LTab,tr("Lists"));
270 98
271 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); 99 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist()));
272
273 connect( pmView, SIGNAL( activated(int)), this, SLOT( pmViewActivated(int) ) ); 100 connect( pmView, SIGNAL( activated(int)), this, SLOT( pmViewActivated(int) ) );
274
275 connect( skinsMenu, SIGNAL( activated(int)), this, SLOT(skinsMenuActivated(int) ) ); 101 connect( skinsMenu, SIGNAL( activated(int)), this, SLOT(skinsMenuActivated(int) ) );
276
277 // connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled() ) );
278
279 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 102 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
@@ -298,4 +121,2 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
298 121
299 setCentralWidget( vbox5 );
300
301 readConfig( cfg ); 122 readConfig( cfg );
@@ -305,2 +126,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
305 126
127 // see which skins are installed
128 populateSkinsMenu();
306 initializeStates(); 129 initializeStates();
@@ -313,3 +136,2 @@ PlayListWidget::~PlayListWidget() {
313// writeConfig( cfg ); 136// writeConfig( cfg );
314
315 if ( d->current ) { 137 if ( d->current ) {
@@ -322,3 +144,2 @@ PlayListWidget::~PlayListWidget() {
322void PlayListWidget::initializeStates() { 144void PlayListWidget::initializeStates() {
323
324 d->tbPlay->setOn( mediaPlayerState->playing() ); 145 d->tbPlay->setOn( mediaPlayerState->playing() );
@@ -350,3 +171,2 @@ void PlayListWidget::readConfig( Config& cfg ) {
350void PlayListWidget::writeConfig( Config& cfg ) const { 171void PlayListWidget::writeConfig( Config& cfg ) const {
351
352 d->selectedFiles->writeCurrent( cfg); 172 d->selectedFiles->writeCurrent( cfg);
@@ -402,2 +222,34 @@ void PlayListWidget::clearList() {
402 222
223void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint& , int) {
224 switch (mouse) {
225 case 1:
226 break;
227 case 2:
228 {
229 QPopupMenu m;
230 m.insertItem( tr( "Play" ), this, SLOT( playSelected() ));
231 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() ));
232 m.exec( QCursor::pos() );
233 }
234 break;
235 }
236}
237
238
239void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoint& , int ) {
240 switch (mouse) {
241 case 1:
242 break;
243 case 2:
244 {
245 QPopupMenu m;
246 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() ));
247 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() ));
248 m.exec( QCursor::pos() );
249 }
250 break;
251 }
252}
253
254
403void PlayListWidget::addAllToList() { 255void PlayListWidget::addAllToList() {
@@ -426,6 +278,8 @@ void PlayListWidget::addAllVideoToList() {
426 QListIterator<DocLnk> dit( vFiles.children() ); 278 QListIterator<DocLnk> dit( vFiles.children() );
427 for ( ; dit.current(); ++dit ) 279 for ( ; dit.current(); ++dit ) {
428 if(QFileInfo( dit.current()->file()).exists()) 280 if( QFileInfo( dit.current()->file() ).exists() ) {
429 d->selectedFiles->addToSelection( **dit ); 281 d->selectedFiles->addToSelection( **dit );
430} 282}
283 }
284}
431 285
@@ -433,3 +287,3 @@ void PlayListWidget::addAllVideoToList() {
433void PlayListWidget::setDocument(const QString& fileref) { 287void PlayListWidget::setDocument(const QString& fileref) {
434 qDebug(fileref); 288 //qDebug( fileref );
435 fromSetDocument = TRUE; 289 fromSetDocument = TRUE;
@@ -461,11 +315,2 @@ void PlayListWidget::setDocument(const QString& fileref) {
461 315
462void PlayListWidget::setActiveWindow() {
463// qDebug("SETTING active window");
464 // When we get raised we need to ensure that it switches views
465 char origView = mediaPlayerState->view();
466 mediaPlayerState->setView( 'l' ); // invalidate
467 mediaPlayerState->setView( origView ); // now switch back
468}
469
470
471void PlayListWidget::useSelectedDocument() { 316void PlayListWidget::useSelectedDocument() {
@@ -476,3 +321,2 @@ void PlayListWidget::useSelectedDocument() {
476const DocLnk *PlayListWidget::current() { // this is fugly 321const DocLnk *PlayListWidget::current() { // this is fugly
477
478 switch (tabWidget->currentPageIndex()) { 322 switch (tabWidget->currentPageIndex()) {
@@ -518,2 +362,3 @@ const DocLnk *PlayListWidget::current() { // this is fugly
518 362
363
519bool PlayListWidget::prev() { 364bool PlayListWidget::prev() {
@@ -528,4 +373,5 @@ bool PlayListWidget::prev() {
528 if ( cur == current() ) 373 if ( cur == current() )
529 if ( !d->selectedFiles->next() ) 374 if ( !d->selectedFiles->next() ) {
530 d->selectedFiles->first(); 375 d->selectedFiles->first();
376 }
531 return TRUE; 377 return TRUE;
@@ -632,5 +478,5 @@ void PlayListWidget::loadList( const DocLnk & lnk) {
632 } 478 }
633
634} 479}
635 480
481
636void PlayListWidget::setPlaylist( bool shown ) { 482void PlayListWidget::setPlaylist( bool shown ) {
@@ -643,8 +489,2 @@ void PlayListWidget::setPlaylist( bool shown ) {
643 489
644void PlayListWidget::setView( char view ) {
645 if ( view == 'l' )
646 showMaximized();
647 else
648 hide();
649}
650 490
@@ -699,2 +539,3 @@ void PlayListWidget::addSelected() {
699 539
540
700void PlayListWidget::removeSelected() { 541void PlayListWidget::removeSelected() {
@@ -703,2 +544,3 @@ void PlayListWidget::removeSelected() {
703 544
545
704void PlayListWidget::playIt( QListViewItem *it) { 546void PlayListWidget::playIt( QListViewItem *it) {
@@ -710,2 +552,3 @@ void PlayListWidget::playIt( QListViewItem *it) {
710 552
553
711void PlayListWidget::addToSelection( QListViewItem *it) { 554void PlayListWidget::addToSelection( QListViewItem *it) {
@@ -742,2 +585,3 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
742 585
586
743void PlayListWidget::tabChanged(QWidget *) { 587void PlayListWidget::tabChanged(QWidget *) {
@@ -747,4 +591,5 @@ void PlayListWidget::tabChanged(QWidget *) {
747 { 591 {
748 if( !tbDeletePlaylist->isHidden()) 592 if( !tbDeletePlaylist->isHidden() ) {
749 tbDeletePlaylist->hide(); 593 tbDeletePlaylist->hide();
594 }
750 d->tbRemoveFromList->setEnabled(TRUE); 595 d->tbRemoveFromList->setEnabled(TRUE);
@@ -758,4 +603,5 @@ void PlayListWidget::tabChanged(QWidget *) {
758 603
759 if( !tbDeletePlaylist->isHidden()) 604 if( !tbDeletePlaylist->isHidden() ) {
760 tbDeletePlaylist->hide(); 605 tbDeletePlaylist->hide();
606 }
761 d->tbRemoveFromList->setEnabled(FALSE); 607 d->tbRemoveFromList->setEnabled(FALSE);
@@ -768,4 +614,5 @@ void PlayListWidget::tabChanged(QWidget *) {
768 populateVideoView(); 614 populateVideoView();
769 if( !tbDeletePlaylist->isHidden()) 615 if( !tbDeletePlaylist->isHidden() ) {
770 tbDeletePlaylist->hide(); 616 tbDeletePlaylist->hide();
617 }
771 d->tbRemoveFromList->setEnabled(FALSE); 618 d->tbRemoveFromList->setEnabled(FALSE);
@@ -776,4 +623,5 @@ void PlayListWidget::tabChanged(QWidget *) {
776 { 623 {
777 if( tbDeletePlaylist->isHidden()) 624 if( tbDeletePlaylist->isHidden() ) {
778 tbDeletePlaylist->show(); 625 tbDeletePlaylist->show();
626 }
779 playLists->reread(); 627 playLists->reread();
@@ -784,4 +632,4 @@ void PlayListWidget::tabChanged(QWidget *) {
784 632
785void PlayListWidget::btnPlay(bool b) {
786 633
634void PlayListWidget::btnPlay(bool b) {
787 // mediaPlayerState->setPlaying(b); 635 // mediaPlayerState->setPlaying(b);
@@ -832,15 +680,2 @@ void PlayListWidget::deletePlaylist() {
832 680
833void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint& , int) {
834 switch (mouse) {
835 case 1:
836 break;
837 case 2:{
838 QPopupMenu m;
839 m.insertItem( tr( "Play" ), this, SLOT( playSelected() ));
840 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() ));
841 m.exec( QCursor::pos() );
842 }
843 break;
844 };
845}
846 681
@@ -850,18 +685,2 @@ void PlayListWidget::playSelected() {
850 685
851void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoint& , int ) {
852 switch (mouse) {
853 case 1:
854
855 break;
856 case 2:
857 {
858 QPopupMenu m;
859 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() ));
860 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() ));
861 m.exec( QCursor::pos() );
862 }
863 break;
864 };
865}
866
867 686
@@ -890,3 +709,2 @@ void PlayListWidget::scanForVideo() {
890void PlayListWidget::populateAudioView() { 709void PlayListWidget::populateAudioView() {
891
892 audioView->clear(); 710 audioView->clear();
@@ -894,3 +712,5 @@ void PlayListWidget::populateAudioView() {
894 const QList<FileSystem> &fs = storageInfo.fileSystems(); 712 const QList<FileSystem> &fs = storageInfo.fileSystems();
895 if(!audioScan) scanForAudio(); 713 if(!audioScan) {
714 scanForAudio();
715 }
896 716
@@ -904,3 +724,5 @@ void PlayListWidget::populateAudioView() {
904 const QString path = (*it)->path(); 724 const QString path = (*it)->path();
905 if(dit.current()->file().find(path) != -1 ) storage=name; 725 if(dit.current()->file().find(path) != -1 ) {
726 storage = name;
727 }
906 } 728 }
@@ -915,5 +737,5 @@ void PlayListWidget::populateAudioView() {
915 } 737 }
916
917} 738}
918 739
740
919void PlayListWidget::populateVideoView() { 741void PlayListWidget::populateVideoView() {
@@ -923,3 +745,5 @@ void PlayListWidget::populateVideoView() {
923 745
924 if(!videoScan ) scanForVideo(); 746 if(!videoScan ) {
747 scanForVideo();
748 }
925 749
@@ -933,3 +757,5 @@ void PlayListWidget::populateVideoView() {
933 const QString path = (*it)->path(); 757 const QString path = (*it)->path();
934 if( Vdit.current()->file().find(path) != -1 ) storage=name; 758 if( Vdit.current()->file().find(path) != -1 ) {
759 storage=name;
760 }
935 } 761 }
@@ -945,2 +771,3 @@ void PlayListWidget::populateVideoView() {
945 771
772
946void PlayListWidget::openFile() { 773void PlayListWidget::openFile() {
@@ -961,3 +788,2 @@ void PlayListWidget::openFile() {
961 DocLnk lnk; 788 DocLnk lnk;
962
963 lnk.setName(filename); //sets file name 789 lnk.setName(filename); //sets file name
@@ -980,4 +806,3 @@ void PlayListWidget::openFile() {
980 806
981void PlayListWidget::keyReleaseEvent( QKeyEvent *e) 807void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) {
982{
983 switch ( e->key() ) { 808 switch ( e->key() ) {
@@ -1039,29 +864,3 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
1039 864
1040void PlayListWidget::keyPressEvent( QKeyEvent *)
1041{
1042 // qDebug("Key press");
1043 // switch ( e->key() ) {
1044 // ////////////////////////////// Zaurus keys
1045 // case Key_A: //add to playlist
1046 // qDebug("Add");
1047 // addSelected();
1048 // break;
1049 // case Key_R: //remove from playlist
1050 // removeSelected();
1051 // break;
1052 // case Key_P: //play
1053 // qDebug("Play");
1054 // playSelected();
1055 // break;
1056 // case Key_Space:
1057 // qDebug("Play");
1058 // playSelected();
1059 // break;
1060 // }
1061}
1062
1063
1064
1065void PlayListWidget::readm3u(const QString &filename) { 865void PlayListWidget::readm3u(const QString &filename) {
1066
1067 qDebug("m3u filename is "+filename); 866 qDebug("m3u filename is "+filename);
@@ -1080,3 +879,2 @@ void PlayListWidget::readm3u(const QString &filename) {
1080 s=s.right(s.length()-2); 879 s=s.right(s.length()-2);
1081 // if(QFile(s).exists()) {
1082 DocLnk lnk( s ); 880 DocLnk lnk( s );
@@ -1091,3 +889,2 @@ void PlayListWidget::readm3u(const QString &filename) {
1091 d->selectedFiles->addToSelection( lnk); 889 d->selectedFiles->addToSelection( lnk);
1092 // }
1093 } else { // is url 890 } else { // is url
@@ -1120,3 +917,2 @@ void PlayListWidget::readm3u(const QString &filename) {
1120void PlayListWidget::writem3u() { 917void PlayListWidget::writem3u() {
1121
1122 InputDialog *fileDlg; 918 InputDialog *fileDlg;
@@ -1133,2 +929,4 @@ void PlayListWidget::writem3u() {
1133 // qDebug(d->selectedFiles->current()->file()); 929 // qDebug(d->selectedFiles->current()->file());
930
931 // so maybe we should do some net checking to ,-)
1134 list += d->selectedFiles->current()->file()+"\n"; 932 list += d->selectedFiles->current()->file()+"\n";
@@ -1138,7 +936,8 @@ void PlayListWidget::writem3u() {
1138 qDebug(list); 936 qDebug(list);
1139 if(filename.left(1) != "/") 937 if( filename.left( 1) != "/" ) {
1140 filename=QPEApplication::documentDir()+"/"+filename; 938 filename=QPEApplication::documentDir()+"/"+filename;
1141 if(filename.right(3) != "m3u") 939 }
940 if( filename.right( 3 ) != "m3u" ) {
1142 filename=filename+".m3u"; 941 filename=filename+".m3u";
1143 942 }
1144 QFile f(filename); 943 QFile f(filename);
@@ -1148,3 +947,5 @@ void PlayListWidget::writem3u() {
1148 } 947 }
1149 if(fileDlg) delete fileDlg; 948 if( fileDlg ) {
949 delete fileDlg;
950 }
1150} 951}
@@ -1176,6 +977,7 @@ void PlayListWidget::readPls(const QString &filename) {
1176 QString name = f.baseName(); 977 QString name = f.baseName();
1177 if(name.left(4)=="http") 978 if( name.left( 4 ) == "http" ) {
1178 name = s.right( s.length() - 7); 979 name = s.right( s.length() - 7);
1179 else 980 } else {
1180 name=s; 981 name=s;
982 }
1181 name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); 983 name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1);
@@ -1185,4 +987,5 @@ void PlayListWidget::readPls(const QString &filename) {
1185 else { //if its a url 987 else { //if its a url
1186 if( name.right(1).find('/') == -1) 988 if( name.right( 1 ).find( '/' ) == -1) {
1187 s+="/"; 989 s+="/";
990 }
1188 lnk.setFile( s); 991 lnk.setFile( s);
@@ -1191,3 +994,3 @@ void PlayListWidget::readPls(const QString &filename) {
1191 994
1192 qDebug("DocLnk add "+name); 995 //qDebug("DocLnk add "+name);
1193 d->selectedFiles->addToSelection( lnk); 996 d->selectedFiles->addToSelection( lnk);
@@ -1204,3 +1007,2 @@ void PlayListWidget::pmViewActivated(int index) {
1204 { 1007 {
1205
1206 mediaPlayerState->toggleFullscreen(); 1008 mediaPlayerState->toggleFullscreen();
@@ -1210,3 +1012,2 @@ void PlayListWidget::pmViewActivated(int index) {
1210 cfg.writeEntry("FullScreen", b); 1012 cfg.writeEntry("FullScreen", b);
1211
1212 } 1013 }
@@ -1233,9 +1034,11 @@ void PlayListWidget::populateSkinsMenu() {
1233 qDebug( fi->fileName()); 1034 qDebug( fi->fileName());
1234 if( skinName != "." && skinName != ".." && skinName !="CVS") 1035 if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
1235 item = skinsMenu->insertItem( fi->fileName()); 1036 item = skinsMenu->insertItem( fi->fileName());
1236 if( skinName == "default") 1037 }
1038 if( skinName == "default" ) {
1237 defaultSkinIndex = item; 1039 defaultSkinIndex = item;
1238 if( skinName == skin) 1040 }
1041 if( skinName == skin ) {
1239 skinsMenu->setItemChecked( item, TRUE); 1042 skinsMenu->setItemChecked( item, TRUE);
1240 1043 }
1241 ++it; 1044 ++it;
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 8710a99..2742252 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -1 +1,33 @@
1/*
2                This file is part of the Opie Project
3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =.
8 .=l.
9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details.
24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA.
31
32*/
1 33
@@ -11,6 +43,6 @@
11 43
12/* #include <qtimer.h> */ 44#include "playlistwidgetgui.h"
13 45
14 46
15class PlayListWidgetPrivate; 47//class PlayListWidgetPrivate;
16class Config; 48class Config;
@@ -22,3 +54,3 @@ class QLabel;
22 54
23class PlayListWidget : public QMainWindow { 55class PlayListWidget : public PlayListWidgetGui {
24 Q_OBJECT 56 Q_OBJECT
@@ -27,10 +59,4 @@ public:
27 ~PlayListWidget(); 59 ~PlayListWidget();
28 QTabWidget * tabWidget;
29// MenuItem *fullScreenButton, *scaleButton;
30// QAction *fullScreenButton, *scaleButton;
31 DocLnkSet files; 60 DocLnkSet files;
32 DocLnkSet vFiles; 61 DocLnkSet vFiles;
33 QListView *audioView, *videoView, *playlistView;
34 QLabel *libString;
35 QPopupMenu *pmView ;
36 bool fromSetDocument; 62 bool fromSetDocument;
@@ -41,6 +67,4 @@ public:
41 void useSelectedDocument(); 67 void useSelectedDocument();
42/* QTimer * menuTimer; */
43 FileSelector* playLists;
44 QPushButton *tbDeletePlaylist;
45 int selected; 68 int selected;
69
46public slots: 70public slots:
@@ -51,12 +75,8 @@ public slots:
51 void writeConfig( Config& cfg ) const; 75 void writeConfig( Config& cfg ) const;
52/* void setFullScreen(); */ 76
53/* void setScaled(); */
54protected: 77protected:
55/* void contentsMousePressEvent( QMouseEvent * e ); */
56/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
57void keyReleaseEvent( QKeyEvent *e); 78void keyReleaseEvent( QKeyEvent *e);
58void keyPressEvent( QKeyEvent *e); 79
59private: 80private:
60 int defaultSkinIndex; 81 int defaultSkinIndex;
61 QPopupMenu *skinsMenu;
62 bool audioScan, videoScan; 82 bool audioScan, videoScan;
@@ -64,8 +84,7 @@ private:
64 void readPls(const QString &); 84 void readPls(const QString &);
65
66 void initializeStates(); 85 void initializeStates();
67 void readConfig( Config& cfg ); 86 void readConfig( Config& cfg );
68 PlayListWidgetPrivate *d; // Private implementation data
69 void populateAudioView(); 87 void populateAudioView();
70 void populateVideoView(); 88 void populateVideoView();
89
71private slots: 90private slots:
@@ -81,5 +100,3 @@ private slots:
81 void addToSelection( QListViewItem* ); // Add a media file to the playlist 100 void addToSelection( QListViewItem* ); // Add a media file to the playlist
82 void setActiveWindow(); // need to handle this to show the right view
83 void setPlaylist( bool ); // Show/Hide the playlist 101 void setPlaylist( bool ); // Show/Hide the playlist
84 void setView( char );
85 void clearList(); 102 void clearList();
@@ -91,3 +108,2 @@ private slots:
91 void playIt( QListViewItem *); 108 void playIt( QListViewItem *);
92
93 void btnPlay(bool); 109 void btnPlay(bool);
@@ -100,11 +116,4 @@ private slots:
100 void playSelected(); 116 void playSelected();
101
102protected slots:
103/* void cancelMenuTimer(); */
104/* void showFileMenu(); */
105
106
107}; 117};
108 118
109
110#endif // PLAY_LIST_WIDGET_H 119#endif // PLAY_LIST_WIDGET_H
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
new file mode 100644
index 0000000..6ecd016
--- a/dev/null
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
@@ -0,0 +1,207 @@
1/*
2                This file is part of the Opie Project
3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =.
8 .=l.
9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details.
24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA.
31
32*/
33
34#include <qpe/qpemenubar.h>
35#include <qpe/qpetoolbar.h>
36#include <qpe/fileselector.h>
37#include <qpe/qpeapplication.h>
38#include <qpe/storage.h>
39#include <qpe/mimetype.h>
40#include <qpe/config.h>
41#include <qpe/global.h>
42#include <qpe/resource.h>
43
44#include <qpopupmenu.h>
45#include <qaction.h>
46#include <qcursor.h>
47#include <qdir.h>
48#include <qlayout.h>
49
50#include "playlistselection.h"
51#include "playlistwidget.h"
52#include "mediaplayerstate.h"
53#include "inputDialog.h"
54
55//only needed for the random play
56#include <stdlib.h>
57
58#include "audiowidget.h"
59#include "videowidget.h"
60#include "mediaplayerstate.h"
61
62extern MediaPlayerState *mediaPlayerState;
63
64PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags fl )
65 : QMainWindow( parent, name, fl ) {
66
67 d = new PlayListWidgetPrivate;
68 d->setDocumentUsed = FALSE;
69 d->current = NULL;
70
71 setBackgroundMode( PaletteButton );
72 setToolBarsMovable( FALSE );
73
74 // Create Toolbar
75 QPEToolBar *toolbar = new QPEToolBar( this );
76 toolbar->setHorizontalStretchable( TRUE );
77
78 // Create Menubar
79 QPEMenuBar *menu = new QPEMenuBar( toolbar );
80 menu->setMargin( 0 );
81
82 bar = new QPEToolBar( this );
83 bar->setLabel( tr( "Play Operations" ) );
84
85 tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" );
86 tbDeletePlaylist->setFlat( TRUE );
87 tbDeletePlaylist->setFixedSize( 20, 20 );
88
89 tbDeletePlaylist->hide();
90
91 pmPlayList = new QPopupMenu( this );
92 menu->insertItem( tr( "File" ), pmPlayList );
93
94 pmView = new QPopupMenu( this );
95 menu->insertItem( tr( "View" ), pmView );
96 pmView->isCheckable();
97
98 skinsMenu = new QPopupMenu( this );
99 pmView->insertItem( tr( "Skins" ), skinsMenu );
100 skinsMenu->isCheckable();
101
102 vbox5 = new QVBox( this );
103 QVBox *vbox4 = new QVBox( vbox5 );
104 QHBox *hbox6 = new QHBox( vbox4 );
105
106 tabWidget = new QTabWidget( hbox6, "tabWidget" );
107
108 QWidget *pTab;
109 pTab = new QWidget( tabWidget, "pTab" );
110 tabWidget->insertTab( pTab,"Playlist");
111
112 QGridLayout *Playout = new QGridLayout( pTab );
113 Playout->setSpacing( 2);
114 Playout->setMargin( 2);
115
116 // Add the playlist area
117 QVBox *vbox3 = new QVBox( pTab );
118 d->playListFrame = vbox3;
119
120 QHBox *hbox2 = new QHBox( vbox3 );
121 d->selectedFiles = new PlayListSelection( hbox2 );
122
123 vbox1 = new QVBox( hbox2 );
124 QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold );
125 QVBox *stretch1 = new QVBox( vbox1 ); // add stretch
126
127 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 );
128
129 QWidget *aTab;
130 aTab = new QWidget( tabWidget, "aTab" );
131
132 QGridLayout *Alayout = new QGridLayout( aTab );
133 Alayout->setSpacing( 2 );
134 Alayout->setMargin( 2 );
135 audioView = new QListView( aTab, "Audioview" );
136 audioView->addColumn( tr( "Title" ), 140 );
137 audioView->addColumn( tr( "Size" ), -1 );
138 audioView->addColumn( tr( "Media" ), -1 );
139 audioView->setColumnAlignment( 1, Qt::AlignRight );
140 audioView->setColumnAlignment( 2, Qt::AlignRight );
141 audioView->setAllColumnsShowFocus( TRUE );
142 audioView->setSorting( 0, TRUE );
143 audioView->setMultiSelection( TRUE );
144 audioView->setSelectionMode( QListView::Extended );
145 Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 );
146 tabWidget->insertTab( aTab, tr( "Audio" ) );
147
148 QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold );
149
150 QWidget *vTab;
151 vTab = new QWidget( tabWidget, "vTab" );
152
153 QGridLayout *Vlayout = new QGridLayout( vTab );
154 Vlayout->setSpacing( 2 );
155 Vlayout->setMargin( 2 );
156 videoView = new QListView( vTab, "Videoview" );
157 videoView->addColumn( tr( "Title" ), 140);
158 videoView->addColumn( tr( "Size" ), -1 );
159 videoView->addColumn(tr( "Media" ), -1 );
160 videoView->setColumnAlignment( 1, Qt::AlignRight );
161 videoView->setColumnAlignment( 2, Qt::AlignRight );
162 videoView->setAllColumnsShowFocus( TRUE );
163 videoView->setSorting( 0, TRUE );
164 videoView->setMultiSelection( TRUE );
165 videoView->setSelectionMode( QListView::Extended );
166 Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 );
167
168 QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold );
169
170 tabWidget->insertTab( vTab, tr( "Video" ) );
171
172 //playlists list
173 QWidget *LTab;
174 LTab = new QWidget( tabWidget, "LTab" );
175 QGridLayout *Llayout = new QGridLayout( LTab );
176 Llayout->setSpacing( 2 );
177 Llayout->setMargin( 2 );
178
179 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE ); //buggy
180 Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 );
181
182 tabWidget->insertTab( LTab, tr( "Lists" ) );
183
184 setCentralWidget( vbox5 );
185}
186
187
188
189PlayListWidgetGui::~PlayListWidgetGui() {
190}
191
192void PlayListWidgetGui::setView( char view ) {
193 if ( view == 'l' )
194 showMaximized();
195 else
196 hide();
197}
198
199
200void PlayListWidgetGui::setActiveWindow() {
201 // qDebug("SETTING active window");
202 // When we get raised we need to ensure that it switches views
203 char origView = mediaPlayerState->view();
204 mediaPlayerState->setView( 'l' ); // invalidate
205 mediaPlayerState->setView( origView ); // now switch back
206}
207
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h
new file mode 100644
index 0000000..4c8d737
--- a/dev/null
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h
@@ -0,0 +1,126 @@
1/*
2                This file is part of the Opie Project
3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =.
8 .=l.
9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details.
24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA.
31
32*/
33
34#ifndef PLAY_LIST_WIDGET_GUI_H
35#define PLAY_LIST_WIDGET_GUI_H
36
37#include <qmainwindow.h>
38#include <qpe/applnk.h>
39#include <qpe/resource.h>
40#include <qpe/qpemenubar.h>
41
42#include <qtabwidget.h>
43#include <qpe/fileselector.h>
44#include <qpushbutton.h>
45#include <qpopupmenu.h>
46#include <qaction.h>
47
48
49class PlayListWidgetPrivate;
50class PlayListSelection;
51
52class Config;
53class QPEToolBar;
54class QListViewItem;
55class QListView;
56class QPoint;
57class QAction;
58class QLabel;
59
60class PlayListWidgetPrivate {
61public:
62 QToolButton *tbPlay, *tbFull, *tbLoop, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
63 QFrame *playListFrame;
64 FileSelector *files;
65 PlayListSelection *selectedFiles;
66 bool setDocumentUsed;
67 DocLnk *current;
68};
69
70
71class ToolButton : public QToolButton {
72public:
73 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
74 : QToolButton( parent, name ) {
75 setTextLabel( name );
76 setPixmap( Resource::loadPixmap( icon ) );
77 setAutoRaise( TRUE );
78 setFocusPolicy( QWidget::NoFocus );
79 setToggleButton( t );
80 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
81 QPEMenuToolFocusManager::manager()->addWidget( this );
82 }
83};
84
85
86class MenuItem : public QAction {
87
88public:
89 MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot )
90 : QAction( text, QString::null, 0, 0 ) {
91 connect( this, SIGNAL( activated() ), handler, slot );
92 addTo( parent );
93 }
94};
95
96class PlayListWidgetGui : public QMainWindow {
97 Q_OBJECT
98public:
99 PlayListWidgetGui( QWidget* parent=0, const char* name=0, WFlags fl=0 );
100 ~PlayListWidgetGui();
101
102protected:
103 QTabWidget * tabWidget;
104 QListView *audioView, *videoView, *playlistView;
105 QLabel *libString;
106 QPopupMenu *pmView ;
107 bool fromSetDocument;
108 bool insanityBool;
109 QString setDocFileRef;
110 // retrieve the current playlist entry (media file link)
111 QPushButton *tbDeletePlaylist;
112 int selected;
113 QPopupMenu *pmPlayList;
114 FileSelector* playLists;
115 QPopupMenu *skinsMenu;
116 PlayListWidgetPrivate *d; // Private implementation data
117 QVBox *vbox1;
118 QVBox *vbox5;
119 QPEToolBar *bar;
120 void setActiveWindow(); // need to handle this to show the right view
121 void setView( char );
122
123};
124
125#endif
126