summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/videowidget.cpp
authordrw <drw>2005-06-15 19:44:04 (UTC)
committer drw <drw>2005-06-15 19:44:04 (UTC)
commit1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e (patch) (unidiff)
treecb873e7e3f7330368b857d8fe69826d6a9e4e68a /core/multimedia/opieplayer/videowidget.cpp
parentdfad70bb3964d6f7142660ea4349d4af0349b46d (diff)
downloadopie-1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e.zip
opie-1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e.tar.gz
opie-1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e.tar.bz2
Resource -> OResource and fix doc headers
Diffstat (limited to 'core/multimedia/opieplayer/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index c545511..89dd89e 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -1,55 +1,56 @@
1/********************************************************************** 1/**********************************************************************
2 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
3 ** 3 **
4 ** This file is part of Qtopia Environment. 4 ** This file is part of 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 20
21#include "videowidget.h" 21#include "videowidget.h"
22#include "mediaplayerstate.h" 22#include "mediaplayerstate.h"
23 23
24/* OPIE */ 24/* OPIE */
25#include <qpe/resource.h>
26#include <qpe/mediaplayerplugininterface.h> 25#include <qpe/mediaplayerplugininterface.h>
27#include <qpe/config.h> 26#include <qpe/config.h>
28#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
29#include <opie2/odebug.h> 28#include <opie2/odebug.h>
29#include <opie2/oresource.h>
30 30
31/* QT */ 31/* QT */
32#include <qbitmap.h>
32#include <qdir.h> 33#include <qdir.h>
33#include <qslider.h> 34#include <qslider.h>
34 35
35 36
36#ifdef Q_WS_QWS 37#ifdef Q_WS_QWS
37# define USE_DIRECT_PAINTER 38# define USE_DIRECT_PAINTER
38# include <qdirectpainter_qws.h> 39# include <qdirectpainter_qws.h>
39# include <qgfxraster_qws.h> 40# include <qgfxraster_qws.h>
40#endif 41#endif
41 42
42 43
43extern MediaPlayerState *mediaPlayerState; 44extern MediaPlayerState *mediaPlayerState;
44 45
45 46
46static const int xo = 2; // movable x offset 47static const int xo = 2; // movable x offset
47static const int yo = 0; // movable y offset 48static const int yo = 0; // movable y offset
48 49
49 50
50struct MediaButton { 51struct MediaButton {
51// int xPos, yPos; 52// int xPos, yPos;
52 bool isToggle, isHeld, isDown; 53 bool isToggle, isHeld, isDown;
53// int controlType; 54// int controlType;
54}; 55};
55 56
@@ -69,51 +70,51 @@ MediaButton videoButtons[] = {
69 70
70const char *skinV_mask_file_names[7] = { 71const char *skinV_mask_file_names[7] = {
71 "stop","play","back","fwd","up","down","full" 72 "stop","play","back","fwd","up","down","full"
72}; 73};
73 74
74static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); 75static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton));
75 76
76VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : 77VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
77 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) 78 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 )
78{ 79{
79 setCaption( tr("OpiePlayer") ); 80 setCaption( tr("OpiePlayer") );
80 Config cfg("OpiePlayer"); 81 Config cfg("OpiePlayer");
81 82
82 cfg.setGroup("Options"); 83 cfg.setGroup("Options");
83 skin = cfg.readEntry("Skin","default"); 84 skin = cfg.readEntry("Skin","default");
84 85
85 QString skinPath; 86 QString skinPath;
86 skinPath = "opieplayer2/skins/" + skin; 87 skinPath = "opieplayer2/skins/" + skin;
87 if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) 88 if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists())
88 skinPath = "opieplayer2/skins/default"; 89 skinPath = "opieplayer2/skins/default";
89 90
90 91
91// QString skinPath = "opieplayer2/skins/" + skin; 92// QString skinPath = "opieplayer2/skins/" + skin;
92 93
93 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 94 pixBg = new QPixmap( Opie::Core::OResource::loadPixmap( QString("%1/background").arg(skinPath) ) );
94 imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); 95 imgUp = new QImage( Opie::Core::OResource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
95 imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); 96 imgDn = new QImage( Opie::Core::OResource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
96 97
97 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); 98 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
98 imgButtonMask->fill( 0 ); 99 imgButtonMask->fill( 0 );
99 100
100 for ( int i = 0; i < 7; i++ ) { 101 for ( int i = 0; i < 7; i++ ) {
101 QString filename = QString( QPEApplication::qpeDir() + "pics/" + skinPath + 102 QString filename = QString( QPEApplication::qpeDir() + "pics/" + skinPath +
102 "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); 103 "/skinV_mask_" + skinV_mask_file_names[i] + ".png" );
103 // odebug << "loading "+filename << oendl; 104 // odebug << "loading "+filename << oendl;
104 masks[i] = new QBitmap( filename ); 105 masks[i] = new QBitmap( filename );
105 106
106 if ( !masks[i]->isNull() ) { 107 if ( !masks[i]->isNull() ) {
107 QImage imgMask = masks[i]->convertToImage(); 108 QImage imgMask = masks[i]->convertToImage();
108 uchar **dest = imgButtonMask->jumpTable(); 109 uchar **dest = imgButtonMask->jumpTable();
109 for ( int y = 0; y < imgUp->height(); y++ ) { 110 for ( int y = 0; y < imgUp->height(); y++ ) {
110 uchar *line = dest[y]; 111 uchar *line = dest[y];
111 for ( int x = 0; x < imgUp->width(); x++ ) { 112 for ( int x = 0; x < imgUp->width(); x++ ) {
112 if ( !qRed( imgMask.pixel( x, y ) ) ) 113 if ( !qRed( imgMask.pixel( x, y ) ) )
113 line[x] = i + 1; 114 line[x] = i + 1;
114 } 115 }
115 } 116 }
116 } 117 }
117 } 118 }
118 for ( int i = 0; i < 7; i++ ) { 119 for ( int i = 0; i < 7; i++ ) {
119 buttonPixUp[i] = NULL; 120 buttonPixUp[i] = NULL;