summaryrefslogtreecommitdiff
authorbipolar <bipolar>2002-03-06 02:57:58 (UTC)
committer bipolar <bipolar>2002-03-06 02:57:58 (UTC)
commitf8e5caafffd11726cf0b0ea6a69c19aaad379533 (patch) (unidiff)
treee29820f9a66f6446a9329cc0404c045f1b20f148
parent406bed0f501ea131ba31dbdecdde8c1fe8b15806 (diff)
downloadopie-f8e5caafffd11726cf0b0ea6a69c19aaad379533.zip
opie-f8e5caafffd11726cf0b0ea6a69c19aaad379533.tar.gz
opie-f8e5caafffd11726cf0b0ea6a69c19aaad379533.tar.bz2
ljp:fixed stuff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp21
-rw-r--r--core/multimedia/opieplayer/playlistselection.h1
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp35
3 files changed, 29 insertions, 28 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index d70df51..d6aff66 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
@@ -1,181 +1,184 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <qpe/applnk.h> 20#include <qpe/applnk.h>
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpainter.h> 22#include <qpainter.h>
23#include <qimage.h> 23#include <qimage.h>
24#include <qheader.h> 24#include <qheader.h>
25#include <qlistview.h> 25#include <qlistview.h>
26#include <qlist.h> 26#include <qlist.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28 28
29#include "playlistselection.h" 29#include "playlistselection.h"
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33class PlayListSelectionItem : public QListViewItem { 33class PlayListSelectionItem : public QListViewItem {
34public: 34public:
35 PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) { 35 PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) {
36 setText( 0, f->name() ); 36 setText( 0, f->name() );
37 setPixmap( 0, f->pixmap() ); 37 setPixmap( 0, f->pixmap() );
38 } 38 }
39 39
40 ~PlayListSelectionItem() { 40 ~PlayListSelectionItem() {
41 }; 41 };
42 42
43 const DocLnk *file() const { return fl; } 43 const DocLnk *file() const { return fl; }
44 44
45private: 45private:
46 const DocLnk *fl; 46 const DocLnk *fl;
47}; 47};
48 48
49 49
50PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) 50PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
51 : QListView( parent, name ) 51 : QListView( parent, name )
52{ 52{
53 qDebug("starting playlistselector");
53// #ifdef USE_PLAYLIST_BACKGROUND 54// #ifdef USE_PLAYLIST_BACKGROUND
54 setStaticBackground( TRUE ); 55// setStaticBackground( TRUE );
55// setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) ); 56// setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) );
56 setBackgroundPixmap( Resource::loadPixmap( "opielogo" ) ); 57
58// setBackgroundPixmap( Resource::loadPixmap( "opielogo" ) );
57// #endif 59// #endif
58// addColumn("Title",236); 60// addColumn("Title",236);
59// setAllColumnsShowFocus( TRUE ); 61// setAllColumnsShowFocus( TRUE );
60 addColumn( tr( "Playlist Selection" ) ); 62 addColumn( tr( "Playlist Selection" ) );
61 header()->hide(); 63 header()->hide();
62 setSorting( -1, FALSE ); 64 setSorting( -1, FALSE );
63} 65}
64 66
65 67
66PlayListSelection::~PlayListSelection() { 68PlayListSelection::~PlayListSelection() {
67} 69}
68 70
69 71
70// #ifdef USE_PLAYLIST_BACKGROUND 72// #ifdef USE_PLAYLIST_BACKGROUND
71void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { 73void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
72 p->fillRect( r, QBrush( white ) ); 74// qDebug("drawBackground");
73// QImage logo = Resource::loadImage( "mpegplayer/background" ); 75// p->fillRect( r, QBrush( white ) );
74 QImage logo = Resource::loadImage( "opielogo" ); 76// QImage logo = Resource::loadImage( "mpegplayer/background" );
75 if ( !logo.isNull() ) 77// // QImage logo = Resource::loadImage( "opielogo" );
76 p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); 78// if ( !logo.isNull() )
79// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
77} 80}
78// #endif 81// #endif
79 82
80 83
81void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { 84void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
82 if ( event->state() == QMouseEvent::LeftButton ) { 85 if ( event->state() == QMouseEvent::LeftButton ) {
83 QListViewItem *currentItem = selectedItem(); 86 QListViewItem *currentItem = selectedItem();
84 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); 87 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) );
85 if ( currentItem && currentItem->itemAbove() == itemUnder ) 88 if ( currentItem && currentItem->itemAbove() == itemUnder )
86 moveSelectedUp(); 89 moveSelectedUp();
87 else if ( currentItem && currentItem->itemBelow() == itemUnder ) 90 else if ( currentItem && currentItem->itemBelow() == itemUnder )
88 moveSelectedDown(); 91 moveSelectedDown();
89 } 92 }
90} 93}
91 94
92 95
93const DocLnk *PlayListSelection::current() { 96const DocLnk *PlayListSelection::current() {
94 PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem(); 97 PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem();
95 if ( item ) 98 if ( item )
96 return item->file(); 99 return item->file();
97 return NULL; 100 return NULL;
98} 101}
99 102
100 103
101void PlayListSelection::addToSelection( const DocLnk &lnk ) { 104void PlayListSelection::addToSelection( const DocLnk &lnk ) {
102 PlayListSelectionItem *item = new PlayListSelectionItem( this, new DocLnk( lnk ) ); 105 PlayListSelectionItem *item = new PlayListSelectionItem( this, new DocLnk( lnk ) );
103 QListViewItem *current = selectedItem(); 106 QListViewItem *current = selectedItem();
104 if ( current ) 107 if ( current )
105 item->moveItem( current ); 108 item->moveItem( current );
106 setSelected( item, TRUE ); 109 setSelected( item, TRUE );
107 ensureItemVisible( selectedItem() ); 110 ensureItemVisible( selectedItem() );
108} 111}
109 112
110 113
111void PlayListSelection::removeSelected() { 114void PlayListSelection::removeSelected() {
112 QListViewItem *item = selectedItem(); 115 QListViewItem *item = selectedItem();
113 if ( item ) 116 if ( item )
114 delete item; 117 delete item;
115 setSelected( currentItem(), TRUE ); 118 setSelected( currentItem(), TRUE );
116 ensureItemVisible( selectedItem() ); 119 ensureItemVisible( selectedItem() );
117} 120}
118 121
119 122
120void PlayListSelection::moveSelectedUp() { 123void PlayListSelection::moveSelectedUp() {
121 QListViewItem *item = selectedItem(); 124 QListViewItem *item = selectedItem();
122 if ( item && item->itemAbove() ) 125 if ( item && item->itemAbove() )
123 item->itemAbove()->moveItem( item ); 126 item->itemAbove()->moveItem( item );
124 ensureItemVisible( selectedItem() ); 127 ensureItemVisible( selectedItem() );
125} 128}
126 129
127 130
128void PlayListSelection::moveSelectedDown() { 131void PlayListSelection::moveSelectedDown() {
129 QListViewItem *item = selectedItem(); 132 QListViewItem *item = selectedItem();
130 if ( item && item->itemBelow() ) 133 if ( item && item->itemBelow() )
131 item->moveItem( item->itemBelow() ); 134 item->moveItem( item->itemBelow() );
132 ensureItemVisible( selectedItem() ); 135 ensureItemVisible( selectedItem() );
133} 136}
134 137
135 138
136bool PlayListSelection::prev() { 139bool PlayListSelection::prev() {
137 QListViewItem *item = selectedItem(); 140 QListViewItem *item = selectedItem();
138 if ( item && item->itemAbove() ) 141 if ( item && item->itemAbove() )
139 setSelected( item->itemAbove(), TRUE ); 142 setSelected( item->itemAbove(), TRUE );
140 else 143 else
141 return FALSE; 144 return FALSE;
142 ensureItemVisible( selectedItem() ); 145 ensureItemVisible( selectedItem() );
143 return TRUE; 146 return TRUE;
144} 147}
145 148
146 149
147bool PlayListSelection::next() { 150bool PlayListSelection::next() {
148 QListViewItem *item = selectedItem(); 151 QListViewItem *item = selectedItem();
149 if ( item && item->itemBelow() ) 152 if ( item && item->itemBelow() )
150 setSelected( item->itemBelow(), TRUE ); 153 setSelected( item->itemBelow(), TRUE );
151 else 154 else
152 return FALSE; 155 return FALSE;
153 ensureItemVisible( selectedItem() ); 156 ensureItemVisible( selectedItem() );
154 return TRUE; 157 return TRUE;
155} 158}
156 159
157 160
158bool PlayListSelection::first() { 161bool PlayListSelection::first() {
159 QListViewItem *item = firstChild(); 162 QListViewItem *item = firstChild();
160 if ( item ) 163 if ( item )
161 setSelected( item, TRUE ); 164 setSelected( item, TRUE );
162 else 165 else
163 return FALSE; 166 return FALSE;
164 ensureItemVisible( selectedItem() ); 167 ensureItemVisible( selectedItem() );
165 return TRUE; 168 return TRUE;
166} 169}
167 170
168 171
169bool PlayListSelection::last() { 172bool PlayListSelection::last() {
170 QListViewItem *prevItem = NULL; 173 QListViewItem *prevItem = NULL;
171 QListViewItem *item = firstChild(); 174 QListViewItem *item = firstChild();
172 while ( ( item = item->nextSibling() ) ) 175 while ( ( item = item->nextSibling() ) )
173 prevItem = item; 176 prevItem = item;
174 if ( prevItem ) 177 if ( prevItem )
175 setSelected( prevItem, TRUE ); 178 setSelected( prevItem, TRUE );
176 else 179 else
177 return FALSE; 180 return FALSE;
178 ensureItemVisible( selectedItem() ); 181 ensureItemVisible( selectedItem() );
179 return TRUE; 182 return TRUE;
180} 183}
181 184
diff --git a/core/multimedia/opieplayer/playlistselection.h b/core/multimedia/opieplayer/playlistselection.h
index 57e10f1..b0d249c 100644
--- a/core/multimedia/opieplayer/playlistselection.h
+++ b/core/multimedia/opieplayer/playlistselection.h
@@ -1,61 +1,60 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef PLAY_LIST_SELECTION_H 20#ifndef PLAY_LIST_SELECTION_H
21#define PLAY_LIST_SELECTION_H 21#define PLAY_LIST_SELECTION_H
22 22
23#include <qlist.h> 23#include <qlist.h>
24#include <qlistview.h> 24#include <qlistview.h>
25#include <qpe/applnk.h> 25#include <qpe/applnk.h>
26 26
27 27
28class PlayListSelection : public QListView { 28class PlayListSelection : public QListView {
29 Q_OBJECT 29 Q_OBJECT
30public: 30public:
31 PlayListSelection( QWidget *parent, const char *name=0 ); 31 PlayListSelection( QWidget *parent, const char *name=0 );
32 ~PlayListSelection(); 32 ~PlayListSelection();
33 33
34 const DocLnk *current(); // retrieve the current playlist entry (media file link) 34 const DocLnk *current(); // retrieve the current playlist entry (media file link)
35
36public slots: 35public slots:
37 void addToSelection( const DocLnk & ); // Add a media file to the playlist 36 void addToSelection( const DocLnk & ); // Add a media file to the playlist
38 void removeSelected(); // Remove a media file from the playlist 37 void removeSelected(); // Remove a media file from the playlist
39 void moveSelectedUp(); // Move the media file up the playlist so it is played earlier 38 void moveSelectedUp(); // Move the media file up the playlist so it is played earlier
40 void moveSelectedDown(); // Move the media file down the playlist so it is played later 39 void moveSelectedDown(); // Move the media file down the playlist so it is played later
41 bool prev(); 40 bool prev();
42 bool next(); 41 bool next();
43 bool first(); 42 bool first();
44 bool last(); 43 bool last();
45 44
46protected: 45protected:
47 virtual void contentsMouseMoveEvent(QMouseEvent *); 46 virtual void contentsMouseMoveEvent(QMouseEvent *);
48/* #ifdef USE_PLAYLIST_BACKGROUND */ 47/* #ifdef USE_PLAYLIST_BACKGROUND */
49 virtual void drawBackground( QPainter *p, const QRect &r ); 48 virtual void drawBackground( QPainter *p, const QRect &r );
50 virtual void paintEmptyArea( QPainter *p, const QRect &r ) { drawBackground( p, r ); }; 49 virtual void paintEmptyArea( QPainter *p, const QRect &r ) { drawBackground( p, r ); };
51/* #endif */ 50/* #endif */
52 51
53private: 52private:
54 QList<DocLnk> selectedList; 53 QList<DocLnk> selectedList;
55 const DocLnk *lnk; 54 const DocLnk *lnk;
56}; 55};
57 56
58 57
59#endif // PLAY_LIST_SELECTION_H 58#endif // PLAY_LIST_SELECTION_H
60 59
61 60
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index a6202bc..3171a84 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -37,724 +37,723 @@
37#include <qlistbox.h> 37#include <qlistbox.h>
38#include <qmainwindow.h> 38#include <qmainwindow.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qtoolbutton.h> 40#include <qtoolbutton.h>
41#include <qtabwidget.h> 41#include <qtabwidget.h>
42#include <qlistview.h> 42#include <qlistview.h>
43#include <qpoint.h> 43#include <qpoint.h>
44#include <qlineedit.h> 44#include <qlineedit.h>
45#include <qpushbutton.h> 45#include <qpushbutton.h>
46 46
47//#include <qtimer.h> 47//#include <qtimer.h>
48 48
49#include "playlistselection.h" 49#include "playlistselection.h"
50#include "playlistwidget.h" 50#include "playlistwidget.h"
51#include "mediaplayerstate.h" 51#include "mediaplayerstate.h"
52 52
53#include "inputDialog.h" 53#include "inputDialog.h"
54 54
55#include <stdlib.h> 55#include <stdlib.h>
56 56
57#define BUTTONS_ON_TOOLBAR 57#define BUTTONS_ON_TOOLBAR
58#define SIDE_BUTTONS 58#define SIDE_BUTTONS
59#define CAN_SAVE_LOAD_PLAYLISTS 59#define CAN_SAVE_LOAD_PLAYLISTS
60 60
61extern MediaPlayerState *mediaPlayerState; 61extern MediaPlayerState *mediaPlayerState;
62 62
63// class myFileSelector { 63// class myFileSelector {
64 64
65// }; 65// };
66class PlayListWidgetPrivate { 66class PlayListWidgetPrivate {
67public: 67public:
68 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; 68 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
69 QFrame *playListFrame; 69 QFrame *playListFrame;
70 FileSelector *files; 70 FileSelector *files;
71 PlayListSelection *selectedFiles; 71 PlayListSelection *selectedFiles;
72 bool setDocumentUsed; 72 bool setDocumentUsed;
73 DocLnk *current; 73 DocLnk *current;
74}; 74};
75 75
76 76
77class ToolButton : public QToolButton { 77class ToolButton : public QToolButton {
78public: 78public:
79 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) 79 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
80 : QToolButton( parent, name ) { 80 : QToolButton( parent, name ) {
81 setTextLabel( name ); 81 setTextLabel( name );
82 setPixmap( Resource::loadPixmap( icon ) ); 82 setPixmap( Resource::loadPixmap( icon ) );
83 setAutoRaise( TRUE ); 83 setAutoRaise( TRUE );
84 setFocusPolicy( QWidget::NoFocus ); 84 setFocusPolicy( QWidget::NoFocus );
85 setToggleButton( t ); 85 setToggleButton( t );
86 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); 86 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
87 QPEMenuToolFocusManager::manager()->addWidget( this ); 87 QPEMenuToolFocusManager::manager()->addWidget( this );
88 } 88 }
89}; 89};
90 90
91 91
92class MenuItem : public QAction { 92class MenuItem : public QAction {
93public: 93public:
94 MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) 94 MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot )
95 : QAction( text, QString::null, 0, 0 ) { 95 : QAction( text, QString::null, 0, 0 ) {
96 connect( this, SIGNAL( activated() ), handler, slot ); 96 connect( this, SIGNAL( activated() ), handler, slot );
97 addTo( parent ); 97 addTo( parent );
98 } 98 }
99}; 99};
100 100
101 101
102PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) 102PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
103 : QMainWindow( parent, name, fl ) { 103 : QMainWindow( parent, name, fl ) {
104 104
105 d = new PlayListWidgetPrivate; 105 d = new PlayListWidgetPrivate;
106 d->setDocumentUsed = FALSE; 106 d->setDocumentUsed = FALSE;
107 d->current = NULL; 107 d->current = NULL;
108// menuTimer = new QTimer( this ,"menu timer"), 108// menuTimer = new QTimer( this ,"menu timer"),
109// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); 109// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) );
110 110
111 setBackgroundMode( PaletteButton ); 111 setBackgroundMode( PaletteButton );
112 112
113 setCaption( tr("OpiePlayer") ); 113 setCaption( tr("OpiePlayer") );
114 setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); 114 setIcon( Resource::loadPixmap( "MPEGPlayer" ) );
115 115
116 setToolBarsMovable( FALSE ); 116 setToolBarsMovable( FALSE );
117 117
118 // Create Toolbar 118 // Create Toolbar
119 QPEToolBar *toolbar = new QPEToolBar( this ); 119 QPEToolBar *toolbar = new QPEToolBar( this );
120 toolbar->setHorizontalStretchable( TRUE ); 120 toolbar->setHorizontalStretchable( TRUE );
121 121
122 // Create Menubar 122 // Create Menubar
123 QPEMenuBar *menu = new QPEMenuBar( toolbar ); 123 QPEMenuBar *menu = new QPEMenuBar( toolbar );
124 menu->setMargin( 0 ); 124 menu->setMargin( 0 );
125 125
126 QPEToolBar *bar = new QPEToolBar( this ); 126 QPEToolBar *bar = new QPEToolBar( this );
127 bar->setLabel( tr( "Play Operations" ) ); 127 bar->setLabel( tr( "Play Operations" ) );
128// d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "mpegplayer/play_current_list", 128// d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "mpegplayer/play_current_list",
129// this , SLOT( addSelected()) ); 129// this , SLOT( addSelected()) );
130 tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); 130 tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close");
131 tbDeletePlaylist->setFlat(TRUE); 131 tbDeletePlaylist->setFlat(TRUE);
132 tbDeletePlaylist->setFixedSize(20,20); 132 tbDeletePlaylist->setFixedSize(20,20);
133 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); 133 connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist()));
134 134
135 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "mpegplayer/add_to_playlist", 135 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "mpegplayer/add_to_playlist",
136 this , SLOT(addSelected()) ); 136 this , SLOT(addSelected()) );
137 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist", 137 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist",
138 this , SLOT(removeSelected()) ); 138 this , SLOT(removeSelected()) );
139// d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); 139// d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE );
140 d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", 140 d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play",
141 this , SLOT( btnPlay(bool) ), TRUE ); 141 this , SLOT( btnPlay(bool) ), TRUE );
142 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"mpegplayer/shuffle", 142 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"mpegplayer/shuffle",
143 mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); 143 mediaPlayerState, SLOT(setShuffled(bool)), TRUE );
144 d->tbLoop = new ToolButton( bar, tr( "Loop" ),"mpegplayer/loop", 144 d->tbLoop = new ToolButton( bar, tr( "Loop" ),"mpegplayer/loop",
145 mediaPlayerState, SLOT(setLooping(bool)), TRUE ); 145 mediaPlayerState, SLOT(setLooping(bool)), TRUE );
146 tbDeletePlaylist->hide(); 146 tbDeletePlaylist->hide();
147 147
148 QPopupMenu *pmPlayList = new QPopupMenu( this ); 148 QPopupMenu *pmPlayList = new QPopupMenu( this );
149 menu->insertItem( tr( "File" ), pmPlayList ); 149 menu->insertItem( tr( "File" ), pmPlayList );
150 new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); 150 new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
151 new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); 151 new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) );
152 new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); 152 new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) );
153 new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); 153 new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) );
154 new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); 154 new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) );
155 // new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) ); 155 // new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) );
156 156
157 QPopupMenu *pmView = new QPopupMenu( this ); 157 QPopupMenu *pmView = new QPopupMenu( this );
158 menu->insertItem( tr( "View" ), pmView ); 158 menu->insertItem( tr( "View" ), pmView );
159 159
160 fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); 160 fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0);
161 connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); 161 connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) );
162 fullScreenButton->addTo(pmView); 162 fullScreenButton->addTo(pmView);
163 scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("mpegplayer/scale"), QString::null, 0, this, 0); 163 scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("mpegplayer/scale"), QString::null, 0, this, 0);
164 connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); 164 connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) );
165 scaleButton->addTo(pmView); 165 scaleButton->addTo(pmView);
166 166
167 QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); 167 QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton );
168 QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); 168 QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton );
169 169
170 QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); 170 QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton );
171 171
172 tabWidget = new QTabWidget( hbox6, "tabWidget" ); 172 tabWidget = new QTabWidget( hbox6, "tabWidget" );
173 tabWidget->setTabShape(QTabWidget::Triangular); 173 tabWidget->setTabShape(QTabWidget::Triangular);
174 174
175 QWidget *pTab; 175 QWidget *pTab;
176 pTab = new QWidget( tabWidget, "pTab" ); 176 pTab = new QWidget( tabWidget, "pTab" );
177 playlistView = new QListView( pTab, "Videoview" ); 177 playlistView = new QListView( pTab, "Videoview" );
178 playlistView->setMinimumSize(236,260); 178 playlistView->setMinimumSize(236,260);
179 tabWidget->insertTab( pTab,"Playlist"); 179 tabWidget->insertTab( pTab,"Playlist");
180 180
181 // Add the playlist area 181 // Add the playlist area
182 182
183 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); 183 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton );
184 d->playListFrame = vbox3; 184 d->playListFrame = vbox3;
185 d->playListFrame ->setMinimumSize(235,260); 185 d->playListFrame ->setMinimumSize(235,260);
186 186
187 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); 187 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton );
188 188
189 d->selectedFiles = new PlayListSelection( hbox2); 189 d->selectedFiles = new PlayListSelection( hbox2);
190 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); 190 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton );
191 191
192 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch 192 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch
193 new ToolButton( vbox1, tr( "Move Up" ), "mpegplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); 193 new ToolButton( vbox1, tr( "Move Up" ), "mpegplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) );
194 new ToolButton( vbox1, tr( "Remove" ), "mpegplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); 194 new ToolButton( vbox1, tr( "Remove" ), "mpegplayer/cut", d->selectedFiles, SLOT(removeSelected()) );
195 new ToolButton( vbox1, tr( "Move Down" ), "mpegplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); 195 new ToolButton( vbox1, tr( "Move Down" ), "mpegplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) );
196 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch 196 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch
197 197
198 QWidget *aTab; 198 QWidget *aTab;
199 aTab = new QWidget( tabWidget, "aTab" ); 199 aTab = new QWidget( tabWidget, "aTab" );
200 audioView = new QListView( aTab, "Audioview" ); 200 audioView = new QListView( aTab, "Audioview" );
201 audioView->setMinimumSize(233,260); 201 audioView->setMinimumSize(233,260);
202 audioView->addColumn( "Title",150); 202 audioView->addColumn( "Title",150);
203 audioView->addColumn("Size", 45); 203 audioView->addColumn("Size", 45);
204 audioView->addColumn("Media",35); 204 audioView->addColumn("Media",35);
205 audioView->setColumnAlignment(1, Qt::AlignRight); 205 audioView->setColumnAlignment(1, Qt::AlignRight);
206 audioView->setColumnAlignment(2, Qt::AlignRight); 206 audioView->setColumnAlignment(2, Qt::AlignRight);
207 tabWidget->insertTab(aTab,"Audio"); 207 tabWidget->insertTab(aTab,"Audio");
208// audioView 208// audioView
209 Global::findDocuments(&files, "audio/*"); 209 Global::findDocuments(&files, "audio/*");
210 QListIterator<DocLnk> dit( files.children() ); 210 QListIterator<DocLnk> dit( files.children() );
211 QString storage; 211 QString storage;
212 for ( ; dit.current(); ++dit ) { 212 for ( ; dit.current(); ++dit ) {
213 QListViewItem * newItem; 213 QListViewItem * newItem;
214 if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; 214 if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF";
215 else if(dit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; 215 else if(dit.current()->file().find("/mnt/hda") != -1 ) storage="CF";
216 else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD"; 216 else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD";
217 else storage="RAM"; 217 else storage="RAM";
218 if ( QFile( dit.current()->file()).exists() ) { 218 if ( QFile( dit.current()->file()).exists() ) {
219 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); 219 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage);
220 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); 220 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" ));
221 } 221 }
222 } 222 }
223// videowidget 223// videowidget
224 224
225 QWidget *vTab; 225 QWidget *vTab;
226 vTab = new QWidget( tabWidget, "vTab" ); 226 vTab = new QWidget( tabWidget, "vTab" );
227 videoView = new QListView( vTab, "Videoview" ); 227 videoView = new QListView( vTab, "Videoview" );
228 videoView->setMinimumSize(233,260); 228 videoView->setMinimumSize(233,260);
229 229
230 videoView->addColumn("Title",150); 230 videoView->addColumn("Title",150);
231 videoView->addColumn("Size",45); 231 videoView->addColumn("Size",45);
232 videoView->addColumn("Media",35); 232 videoView->addColumn("Media",35);
233 videoView->setColumnAlignment(1, Qt::AlignRight); 233 videoView->setColumnAlignment(1, Qt::AlignRight);
234 videoView->setColumnAlignment(2, Qt::AlignRight); 234 videoView->setColumnAlignment(2, Qt::AlignRight);
235 235
236 tabWidget->insertTab( vTab,"Video"); 236 tabWidget->insertTab( vTab,"Video");
237 237
238 Global::findDocuments(&vFiles, "video/*"); 238 Global::findDocuments(&vFiles, "video/*");
239 QListIterator<DocLnk> Vdit( vFiles.children() ); 239 QListIterator<DocLnk> Vdit( vFiles.children() );
240 for ( ; Vdit.current(); ++Vdit ) { 240 for ( ; Vdit.current(); ++Vdit ) {
241 if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; 241 if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF";
242 else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; 242 else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage="CF";
243 else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD"; 243 else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD";
244 else storage="RAM"; 244 else storage="RAM";
245 QListViewItem * newItem; 245 QListViewItem * newItem;
246 if ( QFile( Vdit.current()->file()).exists() ) { 246 if ( QFile( Vdit.current()->file()).exists() ) {
247 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); 247 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage);
248 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); 248 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" ));
249 } 249 }
250 } 250 }
251 251
252//playlists list 252//playlists list
253 QWidget *LTab; 253 QWidget *LTab;
254 LTab = new QWidget( tabWidget, "LTab" ); 254 LTab = new QWidget( tabWidget, "LTab" );
255 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy 255 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy
256 playLists->setMinimumSize(233,260);; 256 playLists->setMinimumSize(233,260);;
257 tabWidget->insertTab(LTab,"Lists"); 257 tabWidget->insertTab(LTab,"Lists");
258 connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); 258 connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) );
259// connect( playLists, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); 259// connect( playLists, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) );
260 260
261 261
262// add the library area 262// add the library area
263 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 263 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
264 264
265 265
266 connect( audioView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), 266 connect( audioView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)),
267 this, SLOT( fauxPlay( QListViewItem *) ) ); 267 this, SLOT( fauxPlay( QListViewItem *) ) );
268 connect( videoView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), 268 connect( videoView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)),
269 this, SLOT( fauxPlay( QListViewItem *)) ); 269 this, SLOT( fauxPlay( QListViewItem *)) );
270 270
271// connect( audioView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) ); 271// connect( audioView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) );
272// connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) ); 272// connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) );
273 273
274 connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); 274 connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
275 connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); 275 connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
276 276
277 connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); 277 connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*)));
278 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); 278 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) );
279 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); 279 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) );
280 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); 280 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) );
281 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); 281 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) );
282 282
283 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); 283 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) );
284// connect( d->selectedFiles, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) ); 284// connect( d->selectedFiles, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) );
285 285
286 setCentralWidget( vbox5 ); 286 setCentralWidget( vbox5 );
287 287
288 Config cfg( "MediaPlayer" ); 288 Config cfg( "MediaPlayer" );
289 readConfig( cfg ); 289 readConfig( cfg );
290 290
291 initializeStates(); 291 initializeStates();
292} 292}
293 293
294 294
295PlayListWidget::~PlayListWidget() { 295PlayListWidget::~PlayListWidget() {
296 Config cfg( "MediaPlayer" ); 296 Config cfg( "MediaPlayer" );
297 writeConfig( cfg ); 297 writeConfig( cfg );
298 298
299 if ( d->current ) 299 if ( d->current )
300 delete d->current; 300 delete d->current;
301 delete d; 301 delete d;
302} 302}
303 303
304 304
305void PlayListWidget::initializeStates() { 305void PlayListWidget::initializeStates() {
306 306
307 d->tbPlay->setOn( mediaPlayerState->playing() ); 307 d->tbPlay->setOn( mediaPlayerState->playing() );
308 d->tbLoop->setOn( mediaPlayerState->looping() ); 308 d->tbLoop->setOn( mediaPlayerState->looping() );
309 d->tbShuffle->setOn( mediaPlayerState->shuffled() ); 309 d->tbShuffle->setOn( mediaPlayerState->shuffled() );
310// d->tbFull->setOn( mediaPlayerState->fullscreen() ); 310// d->tbFull->setOn( mediaPlayerState->fullscreen() );
311// d->tbScale->setOn( mediaPlayerState->scaled() ); 311// d->tbScale->setOn( mediaPlayerState->scaled() );
312// d->tbScale->setEnabled( mediaPlayerState->fullscreen() ); 312// d->tbScale->setEnabled( mediaPlayerState->fullscreen() );
313// setPlaylist( mediaPlayerState->playlist() ); 313// setPlaylist( mediaPlayerState->playlist() );
314 setPlaylist( true); 314 setPlaylist( true);
315 d->selectedFiles->first(); 315 d->selectedFiles->first();
316 316
317} 317}
318 318
319 319
320void PlayListWidget::readConfig( Config& cfg ) { 320void PlayListWidget::readConfig( Config& cfg ) {
321 cfg.setGroup("PlayList"); 321 cfg.setGroup("PlayList");
322 322
323 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 323 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
324 324
325 for ( int i = 0; i < noOfFiles; i++ ) { 325 for ( int i = 0; i < noOfFiles; i++ ) {
326 QString entryName; 326 QString entryName;
327 entryName.sprintf( "File%i", i + 1 ); 327 entryName.sprintf( "File%i", i + 1 );
328 QString linkFile = cfg.readEntry( entryName ); 328 QString linkFile = cfg.readEntry( entryName );
329 DocLnk lnk( linkFile ); 329 DocLnk lnk( linkFile );
330 if ( lnk.isValid() ) 330 if ( lnk.isValid() )
331 d->selectedFiles->addToSelection( lnk ); 331 d->selectedFiles->addToSelection( lnk );
332 } 332 }
333} 333}
334 334
335 335
336void PlayListWidget::writeConfig( Config& cfg ) const { 336void PlayListWidget::writeConfig( Config& cfg ) const {
337 cfg.setGroup("PlayList"); 337 cfg.setGroup("PlayList");
338 338
339 int noOfFiles = 0; 339 int noOfFiles = 0;
340 340
341 d->selectedFiles->first(); 341 d->selectedFiles->first();
342 do { 342 do {
343 const DocLnk *lnk = d->selectedFiles->current(); 343 const DocLnk *lnk = d->selectedFiles->current();
344 if ( lnk ) { 344 if ( lnk ) {
345 QString entryName; 345 QString entryName;
346 entryName.sprintf( "File%i", noOfFiles + 1 ); 346 entryName.sprintf( "File%i", noOfFiles + 1 );
347 cfg.writeEntry( entryName, lnk->linkFile() ); 347 cfg.writeEntry( entryName, lnk->linkFile() );
348 // if this link does exist, add it so we have the file 348 // if this link does exist, add it so we have the file
349 // next time... 349 // next time...
350 if ( !QFile::exists( lnk->linkFile() ) ) { 350 if ( !QFile::exists( lnk->linkFile() ) ) {
351 // the way writing lnks doesn't really check for out 351 // the way writing lnks doesn't really check for out
352 // of disk space, but check it anyway. 352 // of disk space, but check it anyway.
353 if ( !lnk->writeLink() ) { 353 if ( !lnk->writeLink() ) {
354 QMessageBox::critical( 0, tr("Out of space"), 354 QMessageBox::critical( 0, tr("Out of space"),
355 tr( "There was a problem saving " 355 tr( "There was a problem saving "
356 "the playlist.\n" 356 "the playlist.\n"
357 "Your playlist " 357 "Your playlist "
358 "may be missing some entries\n" 358 "may be missing some entries\n"
359 "the next time you start it." ) 359 "the next time you start it." )
360 ); 360 );
361 } 361 }
362 } 362 }
363 noOfFiles++; 363 noOfFiles++;
364 } 364 }
365 } while ( d->selectedFiles->next() ); 365 } while ( d->selectedFiles->next() );
366 366
367 cfg.writeEntry("NumberOfFiles", noOfFiles ); 367 cfg.writeEntry("NumberOfFiles", noOfFiles );
368 368
369 369
370} 370}
371 371
372 372
373void PlayListWidget::addToSelection( const DocLnk& lnk ) { 373void PlayListWidget::addToSelection( const DocLnk& lnk ) {
374 qDebug("add"); 374 qDebug("add");
375 d->setDocumentUsed = FALSE; 375 d->setDocumentUsed = FALSE;
376 if ( mediaPlayerState->playlist() ) 376 if ( mediaPlayerState->playlist() )
377 d->selectedFiles->addToSelection( lnk ); 377 d->selectedFiles->addToSelection( lnk );
378 else 378 else
379 mediaPlayerState->setPlaying( TRUE ); 379 mediaPlayerState->setPlaying( TRUE );
380} 380}
381 381
382 382
383void PlayListWidget::clearList() { 383void PlayListWidget::clearList() {
384 while ( first() ) 384 while ( first() )
385 d->selectedFiles->removeSelected(); 385 d->selectedFiles->removeSelected();
386} 386}
387 387
388 388
389void PlayListWidget::addAllToList() { 389void PlayListWidget::addAllToList() {
390 DocLnkSet files; 390 DocLnkSet files;
391 Global::findDocuments(&files, "video/*;audio/*"); 391 Global::findDocuments(&files, "video/*;audio/*");
392 QListIterator<DocLnk> dit( files.children() ); 392 QListIterator<DocLnk> dit( files.children() );
393 for ( ; dit.current(); ++dit ) 393 for ( ; dit.current(); ++dit )
394 d->selectedFiles->addToSelection( **dit ); 394 d->selectedFiles->addToSelection( **dit );
395} 395}
396 396
397 397
398void PlayListWidget::addAllMusicToList() { 398void PlayListWidget::addAllMusicToList() {
399 DocLnkSet files; 399 DocLnkSet files;
400 Global::findDocuments(&files, "audio/*"); 400 Global::findDocuments(&files, "audio/*");
401 QListIterator<DocLnk> dit( files.children() ); 401 QListIterator<DocLnk> dit( files.children() );
402 for ( ; dit.current(); ++dit ) 402 for ( ; dit.current(); ++dit )
403 d->selectedFiles->addToSelection( **dit ); 403 d->selectedFiles->addToSelection( **dit );
404} 404}
405 405
406 406
407void PlayListWidget::addAllVideoToList() { 407void PlayListWidget::addAllVideoToList() {
408 DocLnkSet files; 408 DocLnkSet files;
409 Global::findDocuments(&files, "video/*"); 409 Global::findDocuments(&files, "video/*");
410 QListIterator<DocLnk> dit( files.children() ); 410 QListIterator<DocLnk> dit( files.children() );
411 for ( ; dit.current(); ++dit ) 411 for ( ; dit.current(); ++dit )
412 d->selectedFiles->addToSelection( **dit ); 412 d->selectedFiles->addToSelection( **dit );
413} 413}
414 414
415 415
416void PlayListWidget::setDocument(const QString& fileref) { 416void PlayListWidget::setDocument(const QString& fileref) {
417 if ( fileref.isNull() ) { 417 if ( fileref.isNull() ) {
418 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); 418 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) );
419 return; 419 return;
420 } 420 }
421 if(fileref.find("playlist",0,TRUE) == -1) {
421 addToSelection( DocLnk( fileref ) ); 422 addToSelection( DocLnk( fileref ) );
422 d->setDocumentUsed = TRUE; 423 d->setDocumentUsed = TRUE;
423 qApp->processEvents(); 424 qApp->processEvents();
424 mediaPlayerState->setPlaying( FALSE ); 425 mediaPlayerState->setPlaying( FALSE );
425 qApp->processEvents(); 426 qApp->processEvents();
426 mediaPlayerState->setPlaying( TRUE ); 427 mediaPlayerState->setPlaying( TRUE );
427 d->selectedFiles->removeSelected( ); 428 d->selectedFiles->removeSelected( );
429 } else {
430 loadList(DocLnk(fileref));
431 d->selectedFiles->first();
432// mediaPlayerState->setPlaying( TRUE );
433// mediaPlayerState->setPlaying( FALSE );
434
435 }
428} 436}
429 437
430 438
431void PlayListWidget::setActiveWindow() { 439void PlayListWidget::setActiveWindow() {
432 // When we get raised we need to ensure that it switches views 440 // When we get raised we need to ensure that it switches views
433 char origView = mediaPlayerState->view(); 441 char origView = mediaPlayerState->view();
434 mediaPlayerState->setView( 'l' ); // invalidate 442 mediaPlayerState->setView( 'l' ); // invalidate
435 mediaPlayerState->setView( origView ); // now switch back 443 mediaPlayerState->setView( origView ); // now switch back
436} 444}
437 445
438 446
439void PlayListWidget::useSelectedDocument() { 447void PlayListWidget::useSelectedDocument() {
440 d->setDocumentUsed = FALSE; 448 d->setDocumentUsed = FALSE;
441} 449}
442 450
443 451
444const DocLnk *PlayListWidget::current() { 452const DocLnk *PlayListWidget::current() {
445 453
446// qDebug("in Playlist widget ::current"); 454// qDebug("in Playlist widget ::current");
447 if ( mediaPlayerState->playlist() ) { 455 if ( mediaPlayerState->playlist() ) {
448 return d->selectedFiles->current(); 456 return d->selectedFiles->current();
449 } 457 }
450 else if ( d->setDocumentUsed && d->current ) { 458 else if ( d->setDocumentUsed && d->current ) {
451 return d->current; 459 return d->current;
452 } else { 460 } else {
453 return d->files->selected(); 461 return d->files->selected();
454 } 462 }
455} 463}
456 464
457 465
458bool PlayListWidget::prev() { 466bool PlayListWidget::prev() {
459 if ( mediaPlayerState->playlist() ) { 467 if ( mediaPlayerState->playlist() ) {
460 if ( mediaPlayerState->shuffled() ) { 468 if ( mediaPlayerState->shuffled() ) {
461 const DocLnk *cur = current(); 469 const DocLnk *cur = current();
462 int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); 470 int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0));
463 for ( int i = 0; i < j; i++ ) { 471 for ( int i = 0; i < j; i++ ) {
464 if ( !d->selectedFiles->next() ) 472 if ( !d->selectedFiles->next() )
465 d->selectedFiles->first(); 473 d->selectedFiles->first();
466 } 474 }
467 if ( cur == current() ) 475 if ( cur == current() )
468 if ( !d->selectedFiles->next() ) 476 if ( !d->selectedFiles->next() )
469 d->selectedFiles->first(); 477 d->selectedFiles->first();
470 return TRUE; 478 return TRUE;
471 } else { 479 } else {
472 if ( !d->selectedFiles->prev() ) { 480 if ( !d->selectedFiles->prev() ) {
473 if ( mediaPlayerState->looping() ) { 481 if ( mediaPlayerState->looping() ) {
474 return d->selectedFiles->last(); 482 return d->selectedFiles->last();
475 } else { 483 } else {
476 return FALSE; 484 return FALSE;
477 } 485 }
478 } 486 }
479 return TRUE; 487 return TRUE;
480 } 488 }
481 } else { 489 } else {
482 return mediaPlayerState->looping(); 490 return mediaPlayerState->looping();
483 } 491 }
484} 492}
485 493
486 494
487bool PlayListWidget::next() { 495bool PlayListWidget::next() {
488 if ( mediaPlayerState->playlist() ) { 496 if ( mediaPlayerState->playlist() ) {
489 if ( mediaPlayerState->shuffled() ) { 497 if ( mediaPlayerState->shuffled() ) {
490 return prev(); 498 return prev();
491 } else { 499 } else {
492 if ( !d->selectedFiles->next() ) { 500 if ( !d->selectedFiles->next() ) {
493 if ( mediaPlayerState->looping() ) { 501 if ( mediaPlayerState->looping() ) {
494 return d->selectedFiles->first(); 502 return d->selectedFiles->first();
495 } else { 503 } else {
496 return FALSE; 504 return FALSE;
497 } 505 }
498 } 506 }
499 return TRUE; 507 return TRUE;
500 } 508 }
501 } else { 509 } else {
502 return mediaPlayerState->looping(); 510 return mediaPlayerState->looping();
503 } 511 }
504} 512}
505 513
506 514
507bool PlayListWidget::first() { 515bool PlayListWidget::first() {
508 if ( mediaPlayerState->playlist() ) 516 if ( mediaPlayerState->playlist() )
509 return d->selectedFiles->first(); 517 return d->selectedFiles->first();
510 else 518 else
511 return mediaPlayerState->looping(); 519 return mediaPlayerState->looping();
512} 520}
513 521
514 522
515bool PlayListWidget::last() { 523bool PlayListWidget::last() {
516 if ( mediaPlayerState->playlist() ) 524 if ( mediaPlayerState->playlist() )
517 return d->selectedFiles->last(); 525 return d->selectedFiles->last();
518 else 526 else
519 return mediaPlayerState->looping(); 527 return mediaPlayerState->looping();
520} 528}
521 529
522 530
523void PlayListWidget::saveList() { 531void PlayListWidget::saveList() {
524 532
525 QString filename; 533 QString filename;
526 InputDialog *fileDlg; 534 InputDialog *fileDlg;
527 fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0); 535 fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0);
528 fileDlg->exec(); 536 fileDlg->exec();
529 if( fileDlg->result() == 1 ) { 537 if( fileDlg->result() == 1 ) {
530 filename = fileDlg->LineEdit1->text();//+".playlist"; 538 filename = fileDlg->LineEdit1->text();//+".playlist";
531 qDebug("saving playlist "+filename+".playlist"); 539 qDebug("saving playlist "+filename+".playlist");
532
533// DocLnk *lnk;
534// lnk.setName( filename); //sets file name
535// // lnk.setComment(title);
536// lnk.setFile( filename+".playlist"); //sets File property
537// lnk.setType("player/plain");// hey is this a REGISTERED mime type?!?!? ;D
538// lnk.setIcon("MPEGPlayer");
539// if(!lnk.writeLink())
540// qDebug("Writing doclink did not work");
541
542 Config cfg( filename +".playlist"); 540 Config cfg( filename +".playlist");
543 writeConfig( cfg ); 541 writeConfig( cfg );
542 DocLnk lnk;
543 lnk.setName( filename); //sets file name
544// lnk.setComment( "");
545 lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property
546 lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D
547 lnk.setIcon("mpegplayer/playlist2");
548 if(!lnk.writeLink())
549 qDebug("Writing doclink did not work");
544 } 550 }
545 DocLnk lnk;
546 lnk.setName( filename); //sets file name
547// lnk.setComment(title);
548 lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property
549 lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D
550 lnk.setIcon("MPEGPlayer");
551 if(!lnk.writeLink())
552 qDebug("Writing doclink did not work");
553 551
554 if(fileDlg) 552 if(fileDlg)
555 delete fileDlg; 553 delete fileDlg;
554
556} 555}
557 556
558 557
559void PlayListWidget::loadList( const DocLnk & lnk) { 558void PlayListWidget::loadList( const DocLnk & lnk) {
560 qDebug("load list "+ lnk.name()+".playlist"); 559 qDebug("load list "+ lnk.name()+".playlist");
561 clearList(); 560 clearList();
562 Config cfg( lnk.name()+".playlist"); 561 Config cfg( lnk.name()+".playlist");
563 readConfig(cfg); 562 readConfig(cfg);
564 tabWidget->setCurrentPage(0); 563 tabWidget->setCurrentPage(0);
565 setCaption("OpiePlayer: "+lnk.name()); 564 setCaption("OpiePlayer: "+lnk.name());
566} 565}
567 566
568 567
569void PlayListWidget::setPlaylist( bool shown ) { 568void PlayListWidget::setPlaylist( bool shown ) {
570 if ( shown ) 569 if ( shown )
571 d->playListFrame->show(); 570 d->playListFrame->show();
572 else 571 else
573 d->playListFrame->hide(); 572 d->playListFrame->hide();
574} 573}
575 574
576 575
577void PlayListWidget::setView( char view ) { 576void PlayListWidget::setView( char view ) {
578 if ( view == 'l' ) 577 if ( view == 'l' )
579 showMaximized(); 578 showMaximized();
580 else 579 else
581 hide(); 580 hide();
582} 581}
583 582
584void PlayListWidget::addSelected() { 583void PlayListWidget::addSelected() {
585 584
586 switch (tabWidget->currentPageIndex()) { 585 switch (tabWidget->currentPageIndex()) {
587 case 0: //playlist 586 case 0: //playlist
588 break; 587 break;
589 case 1: { //audio 588 case 1: { //audio
590 addToSelection( audioView->selectedItem() ); 589 addToSelection( audioView->selectedItem() );
591 } 590 }
592 break; 591 break;
593 case 2: { // video 592 case 2: { // video
594 addToSelection( videoView->selectedItem() ); 593 addToSelection( videoView->selectedItem() );
595 } 594 }
596 break; 595 break;
597 }; 596 };
598} 597}
599 598
600void PlayListWidget::removeSelected() { 599void PlayListWidget::removeSelected() {
601 d->selectedFiles->removeSelected( ); 600 d->selectedFiles->removeSelected( );
602} 601}
603 602
604 603
605void PlayListWidget::playIt( QListViewItem *it) { 604void PlayListWidget::playIt( QListViewItem *it) {
606// d->setDocumentUsed = FALSE; 605// d->setDocumentUsed = FALSE;
607 mediaPlayerState->setPlaying(TRUE); 606 mediaPlayerState->setPlaying(TRUE);
608} 607}
609 608
610void PlayListWidget::addToSelection( QListViewItem *it) { 609void PlayListWidget::addToSelection( QListViewItem *it) {
611 d->setDocumentUsed = FALSE; 610 d->setDocumentUsed = FALSE;
612 611
613 if(it) { 612 if(it) {
614// qDebug("add to selection"); 613// qDebug("add to selection");
615 switch (tabWidget->currentPageIndex()) { 614 switch (tabWidget->currentPageIndex()) {
616 case 1: { 615 case 1: {
617// qDebug("case 1"); 616// qDebug("case 1");
618 QListIterator<DocLnk> dit( files.children() ); 617 QListIterator<DocLnk> dit( files.children() );
619 for ( ; dit.current(); ++dit ) { 618 for ( ; dit.current(); ++dit ) {
620// qDebug(dit.current()->name()); 619// qDebug(dit.current()->name());
621 if( dit.current()->name() == it->text(0)) { 620 if( dit.current()->name() == it->text(0)) {
622 d->selectedFiles->addToSelection( **dit ); 621 d->selectedFiles->addToSelection( **dit );
623 } 622 }
624 } 623 }
625 } 624 }
626 break; 625 break;
627 case 2: { 626 case 2: {
628// qDebug("case 2"); 627// qDebug("case 2");
629 QListIterator<DocLnk> dit( vFiles.children() ); 628 QListIterator<DocLnk> dit( vFiles.children() );
630 for ( ; dit.current(); ++dit ) { 629 for ( ; dit.current(); ++dit ) {
631// qDebug(dit.current()->name()); 630// qDebug(dit.current()->name());
632 if( dit.current()->name() == it->text(0)) { 631 if( dit.current()->name() == it->text(0)) {
633 d->selectedFiles->addToSelection( **dit ); 632 d->selectedFiles->addToSelection( **dit );
634 } 633 }
635 } 634 }
636 } 635 }
637 break; 636 break;
638 case 0: 637 case 0:
639 break; 638 break;
640 }; 639 };
641 tabWidget->setCurrentPage(0); 640 tabWidget->setCurrentPage(0);
642// mediaPlayerState->setPlaying( TRUE ); 641// mediaPlayerState->setPlaying( TRUE );
643 } 642 }
644} 643}
645 644
646void PlayListWidget::tabChanged(QWidget *widg) { 645void PlayListWidget::tabChanged(QWidget *widg) {
647 646
648 switch ( tabWidget->currentPageIndex()) { 647 switch ( tabWidget->currentPageIndex()) {
649 case 0: 648 case 0:
650 { 649 {
651 if( !tbDeletePlaylist->isHidden()) 650 if( !tbDeletePlaylist->isHidden())
652 tbDeletePlaylist->hide(); 651 tbDeletePlaylist->hide();
653 d->tbRemoveFromList->setEnabled(TRUE); 652 d->tbRemoveFromList->setEnabled(TRUE);
654 d->tbAddToList->setEnabled(FALSE); 653 d->tbAddToList->setEnabled(FALSE);
655 } 654 }
656 break; 655 break;
657 case 1: 656 case 1:
658 { 657 {
659 if( !tbDeletePlaylist->isHidden()) 658 if( !tbDeletePlaylist->isHidden())
660 tbDeletePlaylist->hide(); 659 tbDeletePlaylist->hide();
661 d->tbRemoveFromList->setEnabled(FALSE); 660 d->tbRemoveFromList->setEnabled(FALSE);
662 d->tbAddToList->setEnabled(TRUE); 661 d->tbAddToList->setEnabled(TRUE);
663 } 662 }
664 break; 663 break;
665 case 2: 664 case 2:
666 { 665 {
667 if( !tbDeletePlaylist->isHidden()) 666 if( !tbDeletePlaylist->isHidden())
668 tbDeletePlaylist->hide(); 667 tbDeletePlaylist->hide();
669 d->tbRemoveFromList->setEnabled(FALSE); 668 d->tbRemoveFromList->setEnabled(FALSE);
670 d->tbAddToList->setEnabled(TRUE); 669 d->tbAddToList->setEnabled(TRUE);
671 } 670 }
672 break; 671 break;
673 case 3: 672 case 3:
674 { 673 {
675 if( tbDeletePlaylist->isHidden()) 674 if( tbDeletePlaylist->isHidden())
676 tbDeletePlaylist->show(); 675 tbDeletePlaylist->show();
677 playLists->reread(); 676 playLists->reread();
678 } 677 }
679 break; 678 break;
680 }; 679 };
681} 680}
682 681
683/* 682/*
684 list is right clicked*/ 683 list is right clicked*/
685void PlayListWidget::fauxPlay(QListViewItem *it) { 684void PlayListWidget::fauxPlay(QListViewItem *it) {
686 685
687 switch (tabWidget->currentPageIndex()) { 686 switch (tabWidget->currentPageIndex()) {
688 case 0: //playlist 687 case 0: //playlist
689 break; 688 break;
690 case 1: { //audio 689 case 1: { //audio
691 QListIterator<DocLnk> dit( files.children() ); 690 QListIterator<DocLnk> dit( files.children() );
692 for ( ; dit.current(); ++dit ) { 691 for ( ; dit.current(); ++dit ) {
693// qDebug(dit.current()->name()); 692// qDebug(dit.current()->name());
694 if( dit.current()->name() == it->text(0)) { 693 if( dit.current()->name() == it->text(0)) {
695 d->selectedFiles->addToSelection( **dit ); 694 d->selectedFiles->addToSelection( **dit );
696 } 695 }
697 } 696 }
698 } 697 }
699 break; 698 break;
700 case 2: { // video 699 case 2: { // video
701 QListIterator<DocLnk> dit( vFiles.children() ); 700 QListIterator<DocLnk> dit( vFiles.children() );
702 for ( ; dit.current(); ++dit ) { 701 for ( ; dit.current(); ++dit ) {
703// qDebug(dit.current()->name()); 702// qDebug(dit.current()->name());
704 if( dit.current()->name() == it->text(0)) { 703 if( dit.current()->name() == it->text(0)) {
705 d->selectedFiles->addToSelection( **dit ); 704 d->selectedFiles->addToSelection( **dit );
706 } 705 }
707 } 706 }
708 } 707 }
709 break; 708 break;
710 }; 709 };
711 mediaPlayerState->setPlaying( TRUE ); 710 mediaPlayerState->setPlaying( TRUE );
712// tabWidget->setCurrentPage(0); 711// tabWidget->setCurrentPage(0);
713 d->selectedFiles->removeSelected(); 712 d->selectedFiles->removeSelected();
714} 713}
715 714
716/* 715/*
717 play button is pressed*/ 716 play button is pressed*/
718void PlayListWidget::btnPlay(bool b) { // this is fugly 717void PlayListWidget::btnPlay(bool b) { // this is fugly
719 switch ( tabWidget->currentPageIndex()) { 718 switch ( tabWidget->currentPageIndex()) {
720 case 0: 719 case 0:
721 { 720 {
722 mediaPlayerState->setPlaying(b); 721 mediaPlayerState->setPlaying(b);
723 } 722 }
724 break; 723 break;
725 case 1: 724 case 1:
726 { 725 {
727 addToSelection( audioView->selectedItem() ); 726 addToSelection( audioView->selectedItem() );
728 mediaPlayerState->setPlaying(b); 727 mediaPlayerState->setPlaying(b);
729 qApp->processEvents(); 728 qApp->processEvents();
730 d->selectedFiles->removeSelected( ); 729 d->selectedFiles->removeSelected( );
731 tabWidget->setCurrentPage(1); 730 tabWidget->setCurrentPage(1);
732 } 731 }
733 break; 732 break;
734 case 2: 733 case 2:
735 { 734 {
736 addToSelection( videoView->selectedItem() ); 735 addToSelection( videoView->selectedItem() );
737 mediaPlayerState->setPlaying(b); 736 mediaPlayerState->setPlaying(b);
738 qApp->processEvents(); 737 qApp->processEvents();
739 d->selectedFiles->removeSelected( ); 738 d->selectedFiles->removeSelected( );
740 tabWidget->setCurrentPage(2); 739 tabWidget->setCurrentPage(2);
741 } 740 }
742 break; 741 break;
743 }; 742 };
744 743
745} 744}
746 745
747void PlayListWidget::deletePlaylist() { 746void PlayListWidget::deletePlaylist() {
748 switch( QMessageBox::information( this, (tr("Remove Playlist?")), 747 switch( QMessageBox::information( this, (tr("Remove Playlist?")),
749 (tr("You really want to delete\nthis playlist?")), 748 (tr("You really want to delete\nthis playlist?")),
750 (tr("Yes")), (tr("No")), 0 )){ 749 (tr("Yes")), (tr("No")), 0 )){
751 case 0: // Yes clicked, 750 case 0: // Yes clicked,
752 QFile().remove(playLists->selected()->file()); 751 QFile().remove(playLists->selected()->file());
753 QFile().remove(playLists->selected()->linkFile()); 752 QFile().remove(playLists->selected()->linkFile());
754 playLists->reread(); 753 playLists->reread();
755 break; 754 break;
756 case 1: // Cancel 755 case 1: // Cancel
757 break; 756 break;
758 }; 757 };
759 758
760} 759}