summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/audiowidget.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 8bcc567..7da2d54 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -1,84 +1,85 @@
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#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/config.h> 22#include <qpe/config.h>
23 23
24#include <qdir.h> 24#include <qdir.h>
25#include "audiowidget.h" 25#include "audiowidget.h"
26#include "mediaplayerstate.h" 26#include "mediaplayerstate.h"
27 27
28#include <stdlib.h> 28#include <stdlib.h>
29#include <stdio.h> 29#include <stdio.h>
30 30
31extern MediaPlayerState *mediaPlayerState; 31extern MediaPlayerState *mediaPlayerState;
32 32
33 33
34static const int xo = -2; // movable x offset 34static const int xo = -2; // movable x offset
35static const int yo = 22; // movable y offset 35static const int yo = 22; // movable y offset
36 36
37using namespace Opie::Ui;
37struct MediaButton { 38struct MediaButton {
38 bool isToggle, isHeld, isDown; 39 bool isToggle, isHeld, isDown;
39}; 40};
40 41
41//Layout information for the audioButtons (and if it is a toggle button or not) 42//Layout information for the audioButtons (and if it is a toggle button or not)
42MediaButton audioButtons[] = { 43MediaButton audioButtons[] = {
43 { TRUE, FALSE, FALSE }, // play 44 { TRUE, FALSE, FALSE }, // play
44 { FALSE, FALSE, FALSE }, // stop 45 { FALSE, FALSE, FALSE }, // stop
45 { FALSE, FALSE, FALSE }, // next 46 { FALSE, FALSE, FALSE }, // next
46 { FALSE, FALSE, FALSE }, // previous 47 { FALSE, FALSE, FALSE }, // previous
47 { FALSE, FALSE, FALSE }, // volume up 48 { FALSE, FALSE, FALSE }, // volume up
48 { FALSE, FALSE, FALSE }, // volume down 49 { FALSE, FALSE, FALSE }, // volume down
49 { TRUE, FALSE, FALSE }, // repeat/loop 50 { TRUE, FALSE, FALSE }, // repeat/loop
50 { FALSE, FALSE, FALSE }, // playlist 51 { FALSE, FALSE, FALSE }, // playlist
51 { FALSE, FALSE, FALSE }, // forward 52 { FALSE, FALSE, FALSE }, // forward
52 { FALSE, FALSE, FALSE } // back 53 { FALSE, FALSE, FALSE } // back
53}; 54};
54 55
55const char *skin_mask_file_names[10] = { 56const char *skin_mask_file_names[10] = {
56 "play", "stop", "next", "prev", "up", 57 "play", "stop", "next", "prev", "up",
57 "down", "loop", "playlist", "forward", "back" 58 "down", "loop", "playlist", "forward", "back"
58}; 59};
59 60
60static void changeTextColor( QWidget *w ) { 61static void changeTextColor( QWidget *w ) {
61 QPalette p = w->palette(); 62 QPalette p = w->palette();
62 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); 63 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) );
63 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); 64 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) );
64 w->setPalette( p ); 65 w->setPalette( p );
65} 66}
66 67
67static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); 68static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton));
68 69
69AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 70AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
70 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) 71 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this )
71{ 72{
72 setCaption( tr("OpiePlayer") ); 73 setCaption( tr("OpiePlayer") );
73 // qDebug("<<<<<audioWidget"); 74 // qDebug("<<<<<audioWidget");
74 75
75 Config cfg("OpiePlayer"); 76 Config cfg("OpiePlayer");
76 cfg.setGroup("Options"); 77 cfg.setGroup("Options");
77 skin = cfg.readEntry("Skin","default"); 78 skin = cfg.readEntry("Skin","default");
78 //skin = "scaleTest"; 79 //skin = "scaleTest";
79// color of background, frame, degree of transparency 80// color of background, frame, degree of transparency
80 81
81// QString skinPath = "opieplayer/skins/" + skin; 82// QString skinPath = "opieplayer/skins/" + skin;
82 QString skinPath; 83 QString skinPath;
83 skinPath = "opieplayer2/skins/" + skin; 84 skinPath = "opieplayer2/skins/" + skin;
84 if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) 85 if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists())