summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayer.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp52
1 files changed, 29 insertions, 23 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 5411a64..8d8e4e5 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -13,2 +13,3 @@
13#include "audiowidget.h" 13#include "audiowidget.h"
14#include "volumecontrol.h"
14 15
@@ -41,2 +42,4 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
41 42
43 volControl = new VolumeControl;
44
42} 45}
@@ -44,2 +47,4 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
44MediaPlayer::~MediaPlayer() { 47MediaPlayer::~MediaPlayer() {
48 delete xineControl;
49 delete volControl;
45} 50}
@@ -73,3 +78,3 @@ void MediaPlayer::setPlaying( bool play ) {
73 } 78 }
74 79
75 xineControl->play( currentFile->file() ); 80 xineControl->play( currentFile->file() );
@@ -94,3 +99,3 @@ void MediaPlayer::setPlaying( bool play ) {
94 audioUI->setTickerText( currentFile->file( ) ); 99 audioUI->setTickerText( currentFile->file( ) );
95 100
96} 101}
@@ -127,5 +132,3 @@ void MediaPlayer::startDecreasingVolume() {
127 startTimer( 100 ); 132 startTimer( 100 );
128 // da kommt demnächst osound denk ich mal 133 volControl->decVol(2);
129 /////////////////////////// lets just move those change volume here
130 // AudioDevice::decreaseVolume();
131} 134}
@@ -136,3 +139,3 @@ void MediaPlayer::startIncreasingVolume() {
136 startTimer( 100 ); 139 startTimer( 100 );
137 // AudioDevice::increaseVolume(); 140 volControl->incVol(2);
138} 141}
@@ -156,16 +159,17 @@ void MediaPlayer::stopChangingVolume() {
156void MediaPlayer::timerEvent( QTimerEvent * ) { 159void MediaPlayer::timerEvent( QTimerEvent * ) {
157 // if ( volumeDirection == +1 ) 160 if ( volumeDirection == +1 ) {
158 // AudioDevice::increaseVolume(); 161 volControl->incVol(2);
159 // else if ( volumeDirection == -1 ) 162 } else if ( volumeDirection == -1 ) {
160 // AudioDevice::decreaseVolume(); 163 volControl->decVol(2);
164 }
161 165
162// Display an on-screen display volume
163 unsigned int l, r, v; bool m;
164 166
165// TODO FIXME 167 // TODO FIXME
166// AudioDevice::getVolume( l, r, m ); 168 int v;
167// v = ((l + r) * 11) / (2*0xFFFF); 169 v = volControl->getVolume();
170 v = v / 10;
168 171
169 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) 172 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) {
170 return; 173 return;
174 }
171 175
@@ -175,4 +179,5 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
175 if ( drawnOnScreenDisplay ) { 179 if ( drawnOnScreenDisplay ) {
176 if ( onScreenDisplayVolume > v ) 180 if ( onScreenDisplayVolume > v ) {
177 audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE ); 181 audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE );
182 }
178 } 183 }
@@ -193,6 +198,7 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
193 for ( unsigned int i = 0; i < 10; i++ ) { 198 for ( unsigned int i = 0; i < 10; i++ ) {
194 if ( v > i ) 199 if ( v > i ) {
195 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); 200 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
196 else 201 } else {
197 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); 202 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
203 }
198 } 204 }