summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/audiowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 2c54ae6..4242aa6 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -15,48 +15,50 @@
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#include "mediaplayerstate.h" 36#include "mediaplayerstate.h"
37#include "playlistwidget.h" 37#include "playlistwidget.h"
38 38
39#include <qpe/qpeapplication.h>
40
39namespace 41namespace
40{ 42{
41 43
42const int xo = -2; // movable x offset 44const int xo = -2; // movable x offset
43const int yo = 22; // movable y offset 45const int yo = 22; // movable y offset
44 46
45const MediaWidget::SkinButtonInfo skinInfo[] = 47const MediaWidget::SkinButtonInfo skinInfo[] =
46{ 48{
47 { MediaWidget::Play, "play", MediaWidget::ToggleButton }, 49 { MediaWidget::Play, "play", MediaWidget::ToggleButton },
48 { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, 50 { MediaWidget::Stop, "stop", MediaWidget::NormalButton },
49 { MediaWidget::Next, "next", MediaWidget::NormalButton }, 51 { MediaWidget::Next, "next", MediaWidget::NormalButton },
50 { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, 52 { MediaWidget::Previous, "prev", MediaWidget::NormalButton },
51 { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, 53 { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton },
52 { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, 54 { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton },
53 { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, 55 { MediaWidget::Loop, "loop", MediaWidget::ToggleButton },
54 { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, 56 { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton },
55 { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, 57 { MediaWidget::Forward, "forward", MediaWidget::NormalButton },
56 { MediaWidget::Back, "back", MediaWidget::NormalButton } 58 { MediaWidget::Back, "back", MediaWidget::NormalButton }
57}; 59};
58 60
59const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); 61const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] );
60 62
61void changeTextColor( QWidget * w) { 63void changeTextColor( QWidget * w) {
62 QPalette p = w->palette(); 64 QPalette p = w->palette();
@@ -124,49 +126,49 @@ void AudioWidget::sliderPressed() {
124 126
125 127
126void AudioWidget::sliderReleased() { 128void AudioWidget::sliderReleased() {
127 audioSliderBeingMoved = FALSE; 129 audioSliderBeingMoved = FALSE;
128 if ( slider.width() == 0 ) 130 if ( slider.width() == 0 )
129 return; 131 return;
130 long val = long((double)slider.value() * mediaPlayerState.length() / slider.width()); 132 long val = long((double)slider.value() * mediaPlayerState.length() / slider.width());
131 mediaPlayerState.setPosition( val ); 133 mediaPlayerState.setPosition( val );
132} 134}
133 135
134void AudioWidget::setPosition( long i ) { 136void AudioWidget::setPosition( long i ) {
135 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); 137 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
136 updateSlider( i, mediaPlayerState.length() ); 138 updateSlider( i, mediaPlayerState.length() );
137} 139}
138 140
139 141
140void AudioWidget::setLength( long max ) { 142void AudioWidget::setLength( long max ) {
141 updateSlider( mediaPlayerState.position(), max ); 143 updateSlider( mediaPlayerState.position(), max );
142} 144}
143 145
144 146
145void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) { 147void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) {
146 if ( mediaType == MediaPlayerState::Audio ) { 148 if ( mediaType == MediaPlayerState::Audio ) {
147 // startTimer( 150 ); 149 // startTimer( 150 );
148 showMaximized(); 150 QPEApplication::showDialog( this );
149 return; 151 return;
150 } 152 }
151 153
152 killTimers(); 154 killTimers();
153 hide(); 155 hide();
154} 156}
155 157
156void AudioWidget::loadSkin() 158void AudioWidget::loadSkin()
157{ 159{
158 loadDefaultSkin( guiInfo() ); 160 loadDefaultSkin( guiInfo() );
159 161
160 songInfo.setFocusPolicy( QWidget::NoFocus ); 162 songInfo.setFocusPolicy( QWidget::NoFocus );
161// changeTextColor( &songInfo ); 163// changeTextColor( &songInfo );
162// songInfo.setBackgroundColor( QColor( 167, 212, 167 )); 164// songInfo.setBackgroundColor( QColor( 167, 212, 167 ));
163// songInfo.setFrameStyle( QFrame::NoFrame); 165// songInfo.setFrameStyle( QFrame::NoFrame);
164 songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); 166 songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken );
165// songInfo.setForegroundColor(Qt::white); 167// songInfo.setForegroundColor(Qt::white);
166 168
167 slider.setFixedHeight( 20 ); 169 slider.setFixedHeight( 20 );
168 slider.setMinValue( 0 ); 170 slider.setMinValue( 0 );
169 slider.setMaxValue( 1 ); 171 slider.setMaxValue( 1 );
170 slider.setFocusPolicy( QWidget::NoFocus ); 172 slider.setFocusPolicy( QWidget::NoFocus );
171 slider.setBackgroundPixmap( backgroundPixmap ); 173 slider.setBackgroundPixmap( backgroundPixmap );
172 174