author | harlekin <harlekin> | 2002-08-18 17:35:58 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-18 17:35:58 (UTC) |
commit | a5c95b42314fe8f7bdcfe2644e980d43c257fee0 (patch) (unidiff) | |
tree | dc27b266a5e1e60fa269e2182a9cfd36507b12ca /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | 6171a4b58f242c75e9ce02728651ca4fb743e747 (diff) | |
download | opie-a5c95b42314fe8f7bdcfe2644e980d43c257fee0.zip opie-a5c95b42314fe8f7bdcfe2644e980d43c257fee0.tar.gz opie-a5c95b42314fe8f7bdcfe2644e980d43c257fee0.tar.bz2 |
hack to make startup faster, still need sanity checks
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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 | |||
@@ -14,94 +14,97 @@ | |||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = 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> |
50 | # include <qgfxraster_qws.h> | 51 | # include <qgfxraster_qws.h> |
51 | #endif | 52 | #endif |
52 | 53 | ||
53 | 54 | ||
54 | extern MediaPlayerState *mediaPlayerState; | 55 | extern MediaPlayerState *mediaPlayerState; |
55 | 56 | ||
56 | 57 | ||
57 | static const int xo = 2; // movable x offset | 58 | static const int xo = 2; // movable x offset |
58 | static const int yo = 0; // movable y offset | 59 | static const int yo = 0; // movable y offset |
59 | 60 | ||
60 | 61 | ||
61 | struct MediaButton { | 62 | struct MediaButton { |
62 | bool isToggle, isHeld, isDown; | 63 | bool isToggle, isHeld, isDown; |
63 | }; | 64 | }; |
64 | 65 | ||
65 | MediaButton videoButtons[] = { | 66 | MediaButton videoButtons[] = { |
66 | { FALSE, FALSE, FALSE }, // stop | 67 | { FALSE, FALSE, FALSE }, // stop |
67 | { TRUE, FALSE, FALSE }, // play | 68 | { TRUE, FALSE, FALSE }, // play |
68 | { FALSE, FALSE, FALSE }, // previous | 69 | { FALSE, FALSE, FALSE }, // previous |
69 | { FALSE, FALSE, FALSE }, // next | 70 | { FALSE, FALSE, FALSE }, // next |
70 | { FALSE, FALSE, FALSE }, // volUp | 71 | { FALSE, FALSE, FALSE }, // volUp |
71 | { FALSE, FALSE, FALSE }, // volDown | 72 | { FALSE, FALSE, FALSE }, // volDown |
72 | { TRUE, FALSE, FALSE } // fullscreen | 73 | { TRUE, FALSE, FALSE } // fullscreen |
73 | }; | 74 | }; |
74 | 75 | ||
75 | const char *skinV_mask_file_names[7] = { | 76 | const 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 | ||
79 | static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); | 80 | static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); |
80 | 81 | ||
81 | 82 | ||
82 | VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | 83 | VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : |
83 | QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | 84 | QWidget( 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; |
96 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | 99 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); |
97 | imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); | 100 | imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); |
98 | imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); | 101 | imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); |
99 | 102 | ||
100 | imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); | 103 | imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); |
101 | imgButtonMask->fill( 0 ); | 104 | imgButtonMask->fill( 0 ); |
102 | 105 | ||
103 | for ( int i = 0; i < 7; i++ ) { | 106 | for ( int i = 0; i < 7; i++ ) { |
104 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png"; | 107 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png"; |
105 | masks[i] = new QBitmap( filename ); | 108 | masks[i] = new QBitmap( filename ); |
106 | 109 | ||
107 | if ( !masks[i]->isNull() ) { | 110 | if ( !masks[i]->isNull() ) { |