summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 43e3133..13cc4ed 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -98,98 +98,100 @@ void MediaPlayer::next() {
98 if ( playList->first() ) { 98 if ( playList->first() ) {
99 play(); 99 play();
100 } 100 }
101 } else { 101 } else {
102 mediaPlayerState->setList(); 102 mediaPlayerState->setList();
103 } 103 }
104} 104}
105 105
106 106
107void MediaPlayer::startDecreasingVolume() { 107void MediaPlayer::startDecreasingVolume() {
108 volumeDirection = -1; 108 volumeDirection = -1;
109 startTimer( 100 ); 109 startTimer( 100 );
110 // da kommt demnächst osound denk ich mal 110 // da kommt demnächst osound denk ich mal
111 /////////////////////////// lets just move those change volume here 111 /////////////////////////// lets just move those change volume here
112 // AudioDevice::decreaseVolume(); 112 // AudioDevice::decreaseVolume();
113} 113}
114 114
115 115
116void MediaPlayer::startIncreasingVolume() { 116void MediaPlayer::startIncreasingVolume() {
117 volumeDirection = +1; 117 volumeDirection = +1;
118 startTimer( 100 ); 118 startTimer( 100 );
119 // AudioDevice::increaseVolume(); 119 // AudioDevice::increaseVolume();
120} 120}
121 121
122 122
123bool drawnOnScreenDisplay = FALSE; 123bool drawnOnScreenDisplay = FALSE;
124unsigned int onScreenDisplayVolume = 0; 124unsigned int onScreenDisplayVolume = 0;
125const int yoff = 110; 125const int yoff = 110;
126 126
127void MediaPlayer::stopChangingVolume() { 127void MediaPlayer::stopChangingVolume() {
128 killTimers(); 128 killTimers();
129 // Get rid of the on-screen display stuff 129 // Get rid of the on-screen display stuff
130 drawnOnScreenDisplay = FALSE; 130 drawnOnScreenDisplay = FALSE;
131 onScreenDisplayVolume = 0; 131 onScreenDisplayVolume = 0;
132 int w = audioUI->width(); 132 int w = audioUI->width();
133 int h = audioUI->height(); 133 int h = audioUI->height();
134 audioUI->repaint( (w - 200) / 2, h - yoff, 200 + 9, 70, FALSE ); 134 audioUI->repaint( (w - 200) / 2, h - yoff, 200 + 9, 70, FALSE );
135} 135}
136 136
137 137
138void MediaPlayer::timerEvent( QTimerEvent * ) { 138void MediaPlayer::timerEvent( QTimerEvent * ) {
139 // if ( volumeDirection == +1 ) 139 // if ( volumeDirection == +1 )
140 // AudioDevice::increaseVolume(); 140 // AudioDevice::increaseVolume();
141 // else if ( volumeDirection == -1 ) 141 // else if ( volumeDirection == -1 )
142 // AudioDevice::decreaseVolume(); 142 // AudioDevice::decreaseVolume();
143 143
144// Display an on-screen display volume 144// Display an on-screen display volume
145 unsigned int l, r, v; bool m; 145 unsigned int l, r, v; bool m;
146 AudioDevice::getVolume( l, r, m ); 146
147 v = ((l + r) * 11) / (2*0xFFFF); 147// TODO FIXME
148// AudioDevice::getVolume( l, r, m );
149// v = ((l + r) * 11) / (2*0xFFFF);
148 150
149 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) 151 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v )
150 return; 152 return;
151 153
152 int w = audioUI->width(); 154 int w = audioUI->width();
153 int h = audioUI->height(); 155 int h = audioUI->height();
154 156
155 if ( drawnOnScreenDisplay ) { 157 if ( drawnOnScreenDisplay ) {
156 if ( onScreenDisplayVolume > v ) 158 if ( onScreenDisplayVolume > v )
157 audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE ); 159 audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE );
158 } 160 }
159 161
160 drawnOnScreenDisplay = TRUE; 162 drawnOnScreenDisplay = TRUE;
161 onScreenDisplayVolume = v; 163 onScreenDisplayVolume = v;
162 164
163 QPainter p( audioUI ); 165 QPainter p( audioUI );
164 p.setPen( QColor( 0x10, 0xD0, 0x10 ) ); 166 p.setPen( QColor( 0x10, 0xD0, 0x10 ) );
165 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) ); 167 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) );
166 168
167 QFont f; 169 QFont f;
168 f.setPixelSize( 20 ); 170 f.setPixelSize( 20 );
169 f.setBold( TRUE ); 171 f.setBold( TRUE );
170 p.setFont( f ); 172 p.setFont( f );
171 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); 173 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") );
172 174
173 for ( unsigned int i = 0; i < 10; i++ ) { 175 for ( unsigned int i = 0; i < 10; i++ ) {
174 if ( v > i ) 176 if ( v > i )
175 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); 177 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
176 else 178 else
177 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); 179 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
178 } 180 }
179} 181}
180 182
181void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { 183void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
182 switch ( e->key() ) { 184 switch ( e->key() ) {
183////////////////////////////// Zaurus keys 185////////////////////////////// Zaurus keys
184 case Key_Home: 186 case Key_Home:
185 break; 187 break;
186 case Key_F9: //activity 188 case Key_F9: //activity
187 break; 189 break;
188 case Key_F10: //contacts 190 case Key_F10: //contacts
189 break; 191 break;
190 case Key_F11: //menu 192 case Key_F11: //menu
191 break; 193 break;
192 case Key_F12: //home 194 case Key_F12: //home
193 qDebug("Blank here"); 195 qDebug("Blank here");
194 break; 196 break;
195 case Key_F13: //mail 197 case Key_F13: //mail