summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-18 17:35:58 (UTC)
committer harlekin <harlekin>2002-08-18 17:35:58 (UTC)
commita5c95b42314fe8f7bdcfe2644e980d43c257fee0 (patch) (unidiff)
treedc27b266a5e1e60fa269e2182a9cfd36507b12ca
parent6171a4b58f242c75e9ce02728651ca4fb743e747 (diff)
downloadopie-a5c95b42314fe8f7bdcfe2644e980d43c257fee0.zip
opie-a5c95b42314fe8f7bdcfe2644e980d43c257fee0.tar.gz
opie-a5c95b42314fe8f7bdcfe2644e980d43c257fee0.tar.bz2
hack to make startup faster, still need sanity checks
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/main.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp3
5 files changed, 13 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 604ed3a..6d867e5 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -119,24 +119,27 @@ const char *skin_mask_file_names[10] = {
119static void changeTextColor( QWidget *w ) { 119static void changeTextColor( QWidget *w ) {
120 QPalette p = w->palette(); 120 QPalette p = w->palette();
121 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); 121 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) );
122 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); 122 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) );
123 w->setPalette( p ); 123 w->setPalette( p );
124} 124}
125 125
126static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); 126static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton));
127 127
128 128
129AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 129AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
130 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { 130 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
131
132
133
131 setCaption( tr("OpiePlayer") ); 134 setCaption( tr("OpiePlayer") );
132 135
133 Config cfg("OpiePlayer"); 136 Config cfg("OpiePlayer");
134 cfg.setGroup("Options"); 137 cfg.setGroup("Options");
135 skin = cfg.readEntry("Skin","default"); 138 skin = cfg.readEntry("Skin","default");
136 //skin = "scaleTest"; 139 //skin = "scaleTest";
137// color of background, frame, degree of transparency 140// color of background, frame, degree of transparency
138 141
139 QString skinPath = "opieplayer2/skins/" + skin; 142 QString skinPath = "opieplayer2/skins/" + skin;
140 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 143 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
141 imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); 144 imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
142 imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); 145 imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) );
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp
index 827f773..e951554 100644
--- a/noncore/multimedia/opieplayer2/main.cpp
+++ b/noncore/multimedia/opieplayer2/main.cpp
@@ -9,25 +9,26 @@
9MediaPlayerState *mediaPlayerState; 9MediaPlayerState *mediaPlayerState;
10PlayListWidget *playList; 10PlayListWidget *playList;
11AudioWidget *audioUI; 11AudioWidget *audioUI;
12VideoWidget *videoUI; 12VideoWidget *videoUI;
13 13
14int main(int argc, char **argv) { 14int main(int argc, char **argv) {
15 QPEApplication a(argc,argv); 15 QPEApplication a(argc,argv);
16 16
17 MediaPlayerState st( 0, "mediaPlayerState" ); 17 MediaPlayerState st( 0, "mediaPlayerState" );
18 mediaPlayerState = &st; 18 mediaPlayerState = &st;
19 PlayListWidget pl( 0, "playList" ); 19 PlayListWidget pl( 0, "playList" );
20 playList = &pl; 20 playList = &pl;
21 pl.showMaximized();
21 AudioWidget aw( 0, "audioUI" ); 22 AudioWidget aw( 0, "audioUI" );
22 audioUI = &aw; 23 audioUI = &aw;
23 VideoWidget vw( 0, "videoUI" ); 24 VideoWidget vw( 0, "videoUI" );
24 videoUI = &vw; 25 videoUI = &vw;
25 26 a.processEvents();
26 MediaPlayer mp( 0, "mediaPlayer" ); 27 MediaPlayer mp( 0, "mediaPlayer" );
27 28
28 a.showMainDocumentWidget(&pl); 29 a.showMainDocumentWidget(&pl);
29 30
30 return a.exec(); 31 return a.exec();
31} 32}
32 33
33 34
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 87f4f0c..5531e81 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -25,27 +25,26 @@
25 25
26extern AudioWidget *audioUI; 26extern AudioWidget *audioUI;
27extern VideoWidget *videoUI; 27extern VideoWidget *videoUI;
28extern PlayListWidget *playList; 28extern PlayListWidget *playList;
29extern MediaPlayerState *mediaPlayerState; 29extern MediaPlayerState *mediaPlayerState;
30 30
31 31
32#define FBIOBLANK 0x4611 32#define FBIOBLANK 0x4611
33 33
34MediaPlayer::MediaPlayer( QObject *parent, const char *name ) 34MediaPlayer::MediaPlayer( QObject *parent, const char *name )
35 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { 35 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
36 36
37 37 qApp->processEvents();
38 // xineControl = new XineControl(); 38 // QPEApplication::grabKeyboard(); // EVIL
39// QPEApplication::grabKeyboard(); // EVIL
40 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 39 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
41 40
42 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); 41 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
43 42
44 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); 43 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
45 44
46 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); 45 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
47 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 46 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
48 connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) ); 47 connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
49 48
50 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 49 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
51 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 50 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 874800a..39f5090 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -193,43 +193,43 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
193 193
194 d->selectedFiles = new PlayListSelection( hbox2); 194 d->selectedFiles = new PlayListSelection( hbox2);
195 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); 195 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton );
196 196
197 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); 197 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold);
198 198
199 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch 199 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch
200 new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); 200 new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) );
201 new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) ); 201 new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) );
202 new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); 202 new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) );
203 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch 203 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch
204 204
205 205
206 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); 206 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 );
207 207
208 QWidget *aTab; 208 QWidget *aTab;
209 aTab = new QWidget( tabWidget, "aTab" ); 209 aTab = new QWidget( tabWidget, "aTab" );
210 210
211 QGridLayout *Alayout = new QGridLayout( aTab ); 211 QGridLayout *Alayout = new QGridLayout( aTab );
212 Alayout->setSpacing( 2); 212 Alayout->setSpacing( 2);
213 Alayout->setMargin( 2); 213 Alayout->setMargin( 2);
214 214
215 audioView = new QListView( aTab, "Audioview" ); 215 audioView = new QListView( aTab, "Audioview" );
216 audioView->addColumn( tr("Title"),140); 216 audioView->addColumn( tr("Title"),140);
217 audioView->addColumn(tr("Size"), -1); 217 audioView->addColumn(tr("Size"), -1);
218 audioView->addColumn(tr("Media"),-1); 218 audioView->addColumn(tr("Media"),-1);
219 audioView->setColumnAlignment(1, Qt::AlignRight); 219 audioView->setColumnAlignment(1, Qt::AlignRight);
220 audioView->setColumnAlignment(2, Qt::AlignRight); 220 audioView->setColumnAlignment(2, Qt::AlignRight);
221 audioView->setAllColumnsShowFocus(TRUE); 221 audioView->setAllColumnsShowFocus(TRUE);
222 audioView->setSorting(0,TRUE); 222 audioView->setSorting(0,TRUE);
223 223
224 audioView->setMultiSelection( TRUE ); 224 audioView->setMultiSelection( TRUE );
225 audioView->setSelectionMode( QListView::Extended); 225 audioView->setSelectionMode( QListView::Extended);
226 226
227 Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); 227 Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 );
228 228
229 tabWidget->insertTab(aTab,tr("Audio")); 229 tabWidget->insertTab(aTab,tr("Audio"));
230 230
231 QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); 231 QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold);
232 232
233 QWidget *vTab; 233 QWidget *vTab;
234 vTab = new QWidget( tabWidget, "vTab" ); 234 vTab = new QWidget( tabWidget, "vTab" );
235 235
@@ -237,25 +237,25 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
237 Vlayout->setSpacing( 2); 237 Vlayout->setSpacing( 2);
238 Vlayout->setMargin( 2); 238 Vlayout->setMargin( 2);
239 239
240 videoView = new QListView( vTab, "Videoview" ); 240 videoView = new QListView( vTab, "Videoview" );
241 241
242 videoView->addColumn(tr("Title"),140); 242 videoView->addColumn(tr("Title"),140);
243 videoView->addColumn(tr("Size"),-1); 243 videoView->addColumn(tr("Size"),-1);
244 videoView->addColumn(tr("Media"),-1); 244 videoView->addColumn(tr("Media"),-1);
245 videoView->setColumnAlignment(1, Qt::AlignRight); 245 videoView->setColumnAlignment(1, Qt::AlignRight);
246 videoView->setColumnAlignment(2, Qt::AlignRight); 246 videoView->setColumnAlignment(2, Qt::AlignRight);
247 videoView->setAllColumnsShowFocus(TRUE); 247 videoView->setAllColumnsShowFocus(TRUE);
248 videoView->setSorting(0,TRUE); 248 videoView->setSorting(0,TRUE);
249 249
250 videoView->setMultiSelection( TRUE ); 250 videoView->setMultiSelection( TRUE );
251 videoView->setSelectionMode( QListView::Extended); 251 videoView->setSelectionMode( QListView::Extended);
252 252
253 Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); 253 Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 );
254 254
255 QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); 255 QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold);
256 256
257 tabWidget->insertTab( vTab,tr("Video")); 257 tabWidget->insertTab( vTab,tr("Video"));
258 258
259 //playlists list 259 //playlists list
260 QWidget *LTab; 260 QWidget *LTab;
261 LTab = new QWidget( tabWidget, "LTab" ); 261 LTab = new QWidget( tabWidget, "LTab" );
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index ddb4d74..60a3563 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -26,24 +26,25 @@
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#include <qpe/resource.h> 34#include <qpe/resource.h>
35#include <qpe/mediaplayerplugininterface.h> 35#include <qpe/mediaplayerplugininterface.h>
36#include <qpe/config.h> 36#include <qpe/config.h>
37 37
38
38#include <qwidget.h> 39#include <qwidget.h>
39#include <qpainter.h> 40#include <qpainter.h>
40#include <qpixmap.h> 41#include <qpixmap.h>
41#include <qslider.h> 42#include <qslider.h>
42#include <qdrawutil.h> 43#include <qdrawutil.h>
43#include "videowidget.h" 44#include "videowidget.h"
44#include "mediaplayerstate.h" 45#include "mediaplayerstate.h"
45 46
46 47
47#ifdef Q_WS_QWS 48#ifdef Q_WS_QWS
48# define USE_DIRECT_PAINTER 49# define USE_DIRECT_PAINTER
49# include <qdirectpainter_qws.h> 50# include <qdirectpainter_qws.h>
@@ -72,24 +73,26 @@ MediaButton videoButtons[] = {
72 { TRUE, FALSE, FALSE } // fullscreen 73 { TRUE, FALSE, FALSE } // fullscreen
73}; 74};
74 75
75const char *skinV_mask_file_names[7] = { 76const char *skinV_mask_file_names[7] = {
76"stop","play","back","fwd","up","down","full" 77"stop","play","back","fwd","up","down","full"
77}; 78};
78 79
79static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); 80static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton));
80 81
81 82
82VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : 83VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
83QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { 84QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
85
86
84 setCaption( tr("OpiePlayer - Video") ); 87 setCaption( tr("OpiePlayer - Video") );
85 88
86 videoFrame = new XineVideoWidget ( this, "Video frame" ); 89 videoFrame = new XineVideoWidget ( this, "Video frame" );
87 90
88 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); 91 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
89 connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) ); 92 connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) );
90 93
91 Config cfg("OpiePlayer"); 94 Config cfg("OpiePlayer");
92 cfg.setGroup("Options"); 95 cfg.setGroup("Options");
93 skin = cfg.readEntry("Skin","default"); 96 skin = cfg.readEntry("Skin","default");
94 97
95 QString skinPath = "opieplayer2/skins/" + skin; 98 QString skinPath = "opieplayer2/skins/" + skin;