summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/audiowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 452117c..28a42eb 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -1,86 +1,87 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3 3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com> 5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =. 7 =.
8 .=l. 8 .=l.
9           .>+-= 9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can 10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under 11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public 12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software 13.="- .-=="i,     .._ License as published by the Free Software
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 34
35#include "audiowidget.h" 35#include "audiowidget.h"
36 36
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38 38
39using namespace Opie::Ui;
39namespace 40namespace
40{ 41{
41 42
42const int xo = -2; // movable x offset 43const int xo = -2; // movable x offset
43const int yo = 22; // movable y offset 44const int yo = 22; // movable y offset
44 45
45const MediaWidget::SkinButtonInfo skinInfo[] = 46const MediaWidget::SkinButtonInfo skinInfo[] =
46{ 47{
47 { MediaWidget::Play, "play", MediaWidget::ToggleButton }, 48 { MediaWidget::Play, "play", MediaWidget::ToggleButton },
48 { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, 49 { MediaWidget::Stop, "stop", MediaWidget::NormalButton },
49 { MediaWidget::Next, "next", MediaWidget::NormalButton }, 50 { MediaWidget::Next, "next", MediaWidget::NormalButton },
50 { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, 51 { MediaWidget::Previous, "prev", MediaWidget::NormalButton },
51 { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, 52 { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton },
52 { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, 53 { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton },
53 { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, 54 { MediaWidget::Loop, "loop", MediaWidget::ToggleButton },
54 { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, 55 { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton },
55 { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, 56 { MediaWidget::Forward, "forward", MediaWidget::NormalButton },
56 { MediaWidget::Back, "back", MediaWidget::NormalButton } 57 { MediaWidget::Back, "back", MediaWidget::NormalButton }
57}; 58};
58 59
59const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); 60const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] );
60 61
61void changeTextColor( QWidget * w) { 62void changeTextColor( QWidget * w) {
62 QPalette p = w->palette(); 63 QPalette p = w->palette();
63 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); 64 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) );
64 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); 65 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) );
65 w->setPalette( p ); 66 w->setPalette( p );
66} 67}
67 68
68} 69}
69 70
70AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : 71AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) :
71 72
72 MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), 73 MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ),
73 audioSliderBeingMoved( false ) 74 audioSliderBeingMoved( false )
74{ 75{
75 setCaption( tr("OpiePlayer") ); 76 setCaption( tr("OpiePlayer") );
76 77
77 loadSkin(); 78 loadSkin();
78 79
79 connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); 80 connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
80 connect( &mediaPlayerState, SIGNAL( isSeekableToggled(bool) ), this, SLOT( setSeekable(bool) ) ); 81 connect( &mediaPlayerState, SIGNAL( isSeekableToggled(bool) ), this, SLOT( setSeekable(bool) ) );
81 82
82 connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); 83 connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) );
83 connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); 84 connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) );
84 connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); 85 connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) );
85 connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); 86 connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) );
86 87