summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 8acc488..06b1a04 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -1,366 +1,368 @@
1#include <qpe/qpeapplication.h> 1#include <qpe/qpeapplication.h>
2#include <qpe/qlibrary.h> 2#include <qpe/qlibrary.h>
3#include <qpe/resource.h> 3#include <qpe/resource.h>
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/qcopenvelope_qws.h> 5#include <qpe/qcopenvelope_qws.h>
6#include <qfileinfo.h> 6#include <qfileinfo.h>
7 7
8#include <qmainwindow.h> 8#include <qmainwindow.h>
9#include <qmessagebox.h> 9#include <qmessagebox.h>
10#include <qwidgetstack.h> 10#include <qwidgetstack.h>
11#include <qfile.h> 11#include <qfile.h>
12 12
13#include "mediaplayer.h" 13#include "mediaplayer.h"
14#include "playlistwidget.h" 14#include "playlistwidget.h"
15#include "audiowidget.h" 15#include "audiowidget.h"
16#include "videowidget.h" 16#include "videowidget.h"
17#include "volumecontrol.h" 17#include "volumecontrol.h"
18 18
19#include "mediaplayerstate.h" 19#include "mediaplayerstate.h"
20 20
21// for setBacklight() 21// for setBacklight()
22#include <linux/fb.h> 22#include <linux/fb.h>
23#include <sys/file.h> 23#include <sys/file.h>
24#include <sys/ioctl.h> 24#include <sys/ioctl.h>
25 25
26 26
27 27
28 28
29#define FBIOBLANK 0x4611 29#define FBIOBLANK 0x4611
30 30
31MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) 31MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
32 : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { 32 : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) {
33 33
34 audioUI = 0; 34 audioUI = 0;
35 videoUI = 0; 35 videoUI = 0;
36 xineControl = 0; 36 xineControl = 0;
37 recreateAudioAndVideoWidgets(); 37 recreateAudioAndVideoWidgets();
38 38
39 fd=-1;fl=-1; 39 fd=-1;fl=-1;
40 playList.setCaption( tr( "OpiePlayer: Initializating" ) ); 40 playList.setCaption( tr( "OpiePlayer: Initializating" ) );
41 41
42 qApp->processEvents(); 42 qApp->processEvents();
43 // QPEApplication::grabKeyboard(); // EVIL 43 // QPEApplication::grabKeyboard(); // EVIL
44 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 44 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
45 45
46 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); 46 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
47 47
48 connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); 48 connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
49 49
50 connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); 50 connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
51 connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 51 connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
52 connect( &mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) ); 52 connect( &mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
53 53
54 volControl = new VolumeControl; 54 volControl = new VolumeControl;
55 Config cfg( "OpiePlayer" ); 55 Config cfg( "OpiePlayer" );
56 cfg.setGroup("PlayList"); 56 cfg.setGroup("PlayList");
57 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); 57 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
58 playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); 58 playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() );
59} 59}
60 60
61MediaPlayer::~MediaPlayer() { 61MediaPlayer::~MediaPlayer() {
62 delete xineControl; 62 delete xineControl;
63 delete audioUI;
64 delete videoUI;
63 delete volControl; 65 delete volControl;
64} 66}
65 67
66void MediaPlayer::pauseCheck( bool b ) { 68void MediaPlayer::pauseCheck( bool b ) {
67 if ( b && !mediaPlayerState.isPlaying() ) { 69 if ( b && !mediaPlayerState.isPlaying() ) {
68 mediaPlayerState.setPaused( FALSE ); 70 mediaPlayerState.setPaused( FALSE );
69 } 71 }
70} 72}
71 73
72void MediaPlayer::play() { 74void MediaPlayer::play() {
73 mediaPlayerState.setPlaying( FALSE ); 75 mediaPlayerState.setPlaying( FALSE );
74 mediaPlayerState.setPlaying( TRUE ); 76 mediaPlayerState.setPlaying( TRUE );
75} 77}
76 78
77void MediaPlayer::setPlaying( bool play ) { 79void MediaPlayer::setPlaying( bool play ) {
78 if ( !play ) { 80 if ( !play ) {
79 return; 81 return;
80 } 82 }
81 83
82 if ( mediaPlayerState.isPaused() ) { 84 if ( mediaPlayerState.isPaused() ) {
83 mediaPlayerState.setPaused( FALSE ); 85 mediaPlayerState.setPaused( FALSE );
84 return; 86 return;
85 } 87 }
86 88
87 QString tickerText, time, fileName; 89 QString tickerText, time, fileName;
88 if ( playList.currentTab() != PlayListWidget::CurrentPlayList ) { 90 if ( playList.currentTab() != PlayListWidget::CurrentPlayList ) {
89 //if playing in file list.. play in a different way 91 //if playing in file list.. play in a different way
90 // random and looping settings enabled causes problems here, 92 // random and looping settings enabled causes problems here,
91 // since there is no selected file in the playlist, but a selected file in the file list, 93 // since there is no selected file in the playlist, but a selected file in the file list,
92 // so we remember and shutoff 94 // so we remember and shutoff
93 l = mediaPlayerState.isLooping(); 95 l = mediaPlayerState.isLooping();
94 if(l) { 96 if(l) {
95 mediaPlayerState.setLooping( false ); 97 mediaPlayerState.setLooping( false );
96 } 98 }
97 r = mediaPlayerState.isShuffled(); 99 r = mediaPlayerState.isShuffled();
98 mediaPlayerState.setShuffled( false ); 100 mediaPlayerState.setShuffled( false );
99 } 101 }
100 102
101 PlayListWidget::Entry playListEntry = playList.currentEntry(); 103 PlayListWidget::Entry playListEntry = playList.currentEntry();
102 fileName = playListEntry.name; 104 fileName = playListEntry.name;
103 xineControl->play( playListEntry.file ); 105 xineControl->play( playListEntry.file );
104 106
105 long seconds = mediaPlayerState.length(); 107 long seconds = mediaPlayerState.length();
106 time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); 108 time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
107 109
108 if( fileName.left(4) == "http" ) { 110 if( fileName.left(4) == "http" ) {
109 fileName = QFileInfo( fileName ).baseName(); 111 fileName = QFileInfo( fileName ).baseName();
110 if ( xineControl->getMetaInfo().isEmpty() ) { 112 if ( xineControl->getMetaInfo().isEmpty() ) {
111 tickerText = tr( " File: " ) + fileName; 113 tickerText = tr( " File: " ) + fileName;
112 } else { 114 } else {
113 tickerText = xineControl->getMetaInfo(); 115 tickerText = xineControl->getMetaInfo();
114 } 116 }
115 } else { 117 } else {
116 if ( xineControl->getMetaInfo().isEmpty() ) { 118 if ( xineControl->getMetaInfo().isEmpty() ) {
117 tickerText = tr( " File: " ) + fileName + tr( ", Length: " ) + time + " "; 119 tickerText = tr( " File: " ) + fileName + tr( ", Length: " ) + time + " ";
118 } else { 120 } else {
119 tickerText = xineControl->getMetaInfo() + " Length: " + time + " "; 121 tickerText = xineControl->getMetaInfo() + " Length: " + time + " ";
120 } 122 }
121 } 123 }
122 audioUI->setTickerText( tickerText ); 124 audioUI->setTickerText( tickerText );
123} 125}
124 126
125 127
126void MediaPlayer::prev() { 128void MediaPlayer::prev() {
127 if( playList.currentTab() == PlayListWidget::CurrentPlayList ) { //if using the playlist 129 if( playList.currentTab() == PlayListWidget::CurrentPlayList ) { //if using the playlist
128 if ( playList.prev() ) { 130 if ( playList.prev() ) {
129 play(); 131 play();
130 } else if ( mediaPlayerState.isLooping() ) { 132 } else if ( mediaPlayerState.isLooping() ) {
131 if ( playList.last() ) { 133 if ( playList.last() ) {
132 play(); 134 play();
133 } 135 }
134 } else { 136 } else {
135 mediaPlayerState.setList(); 137 mediaPlayerState.setList();
136 } 138 }
137 } 139 }
138} 140}
139 141
140 142
141void MediaPlayer::next() { 143void MediaPlayer::next() {
142 144
143 if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist 145 if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist
144 if ( playList.next() ) { 146 if ( playList.next() ) {
145 play(); 147 play();
146 } else if ( mediaPlayerState.isLooping() ) { 148 } else if ( mediaPlayerState.isLooping() ) {
147 if ( playList.first() ) { 149 if ( playList.first() ) {
148 play(); 150 play();
149 } 151 }
150 } else { 152 } else {
151 mediaPlayerState.setList(); 153 mediaPlayerState.setList();
152 } 154 }
153 } else { //if playing from file list, let's just stop 155 } else { //if playing from file list, let's just stop
154 qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); 156 qDebug("<<<<<<<<<<<<<<<<<stop for filelists");
155 mediaPlayerState.setPlaying(false); 157 mediaPlayerState.setPlaying(false);
156 mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); 158 mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection );
157 if(l) mediaPlayerState.setLooping(l); 159 if(l) mediaPlayerState.setLooping(l);
158 if(r) mediaPlayerState.setShuffled(r); 160 if(r) mediaPlayerState.setShuffled(r);
159 } 161 }
160 qApp->processEvents(); 162 qApp->processEvents();
161} 163}
162 164
163 165
164void MediaPlayer::startDecreasingVolume() { 166void MediaPlayer::startDecreasingVolume() {
165 volumeDirection = -1; 167 volumeDirection = -1;
166 startTimer( 100 ); 168 startTimer( 100 );
167 volControl->decVol(2); 169 volControl->decVol(2);
168} 170}
169 171
170 172
171void MediaPlayer::startIncreasingVolume() { 173void MediaPlayer::startIncreasingVolume() {
172 volumeDirection = +1; 174 volumeDirection = +1;
173 startTimer( 100 ); 175 startTimer( 100 );
174 volControl->incVol(2); 176 volControl->incVol(2);
175} 177}
176 178
177 179
178bool drawnOnScreenDisplay = FALSE; 180bool drawnOnScreenDisplay = FALSE;
179unsigned int onScreenDisplayVolume = 0; 181unsigned int onScreenDisplayVolume = 0;
180const int yoff = 110; 182const int yoff = 110;
181 183
182void MediaPlayer::stopChangingVolume() { 184void MediaPlayer::stopChangingVolume() {
183 killTimers(); 185 killTimers();
184 // Get rid of the on-screen display stuff 186 // Get rid of the on-screen display stuff
185 drawnOnScreenDisplay = FALSE; 187 drawnOnScreenDisplay = FALSE;
186 onScreenDisplayVolume = 0; 188 onScreenDisplayVolume = 0;
187 int w=0; 189 int w=0;
188 int h=0; 190 int h=0;
189 if( !xineControl->hasVideo() ) { 191 if( !xineControl->hasVideo() ) {
190 w = audioUI->width(); 192 w = audioUI->width();
191 h = audioUI->height(); 193 h = audioUI->height();
192 audioUI->repaint( ( w - 200 ) / 2, h - yoff, 200 + 9, 70, FALSE ); 194 audioUI->repaint( ( w - 200 ) / 2, h - yoff, 200 + 9, 70, FALSE );
193 } else { 195 } else {
194 w = videoUI->width(); 196 w = videoUI->width();
195 h = videoUI->height(); 197 h = videoUI->height();
196 videoUI->repaint( ( w - 200 ) / 2, h - yoff, 200 + 9, 70, FALSE ); 198 videoUI->repaint( ( w - 200 ) / 2, h - yoff, 200 + 9, 70, FALSE );
197 } 199 }
198} 200}
199 201
200 202
201void MediaPlayer::timerEvent( QTimerEvent * ) { 203void MediaPlayer::timerEvent( QTimerEvent * ) {
202 if ( volumeDirection == +1 ) { 204 if ( volumeDirection == +1 ) {
203 volControl->incVol( 2 ); 205 volControl->incVol( 2 );
204 } else if ( volumeDirection == -1 ) { 206 } else if ( volumeDirection == -1 ) {
205 volControl->decVol( 2 ); 207 volControl->decVol( 2 );
206 } 208 }
207 209
208 210
209 // TODO FIXME 211 // TODO FIXME
210 // huh?? 212 // huh??
211 unsigned int v= 0; 213 unsigned int v= 0;
212 v = volControl->volume(); 214 v = volControl->volume();
213 v = v / 10; 215 v = v / 10;
214 216
215 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { 217 if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) {
216 return; 218 return;
217 } 219 }
218 220
219 int w=0; int h=0; 221 int w=0; int h=0;
220 if( !xineControl->hasVideo() ) { 222 if( !xineControl->hasVideo() ) {
221 w = audioUI->width(); 223 w = audioUI->width();
222 h = audioUI->height(); 224 h = audioUI->height();
223 225
224 if ( drawnOnScreenDisplay ) { 226 if ( drawnOnScreenDisplay ) {
225 if ( onScreenDisplayVolume > v ) { 227 if ( onScreenDisplayVolume > v ) {
226 audioUI->repaint( ( w - 200 ) / 2 + v * 20 + 0, h - yoff + 40, ( onScreenDisplayVolume - v ) * 20 + 9, 30, FALSE ); 228 audioUI->repaint( ( w - 200 ) / 2 + v * 20 + 0, h - yoff + 40, ( onScreenDisplayVolume - v ) * 20 + 9, 30, FALSE );
227 } 229 }
228 } 230 }
229 drawnOnScreenDisplay = TRUE; 231 drawnOnScreenDisplay = TRUE;
230 onScreenDisplayVolume = v; 232 onScreenDisplayVolume = v;
231 QPainter p( audioUI ); 233 QPainter p( audioUI );
232 p.setPen( QColor( 0x10, 0xD0, 0x10 ) ); 234 p.setPen( QColor( 0x10, 0xD0, 0x10 ) );
233 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) ); 235 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) );
234 236
235 QFont f; 237 QFont f;
236 f.setPixelSize( 20 ); 238 f.setPixelSize( 20 );
237 f.setBold( TRUE ); 239 f.setBold( TRUE );
238 p.setFont( f ); 240 p.setFont( f );
239 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); 241 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") );
240 242
241 for ( unsigned int i = 0; i < 10; i++ ) { 243 for ( unsigned int i = 0; i < 10; i++ ) {
242 if ( v > i ) { 244 if ( v > i ) {
243 p.drawRect( ( w - 200 ) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); 245 p.drawRect( ( w - 200 ) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
244 } else { 246 } else {
245 p.drawRect( ( w - 200 ) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); 247 p.drawRect( ( w - 200 ) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
246 } 248 }
247 } 249 }
248 } else { 250 } else {
249 w = videoUI->width(); 251 w = videoUI->width();
250 h = videoUI->height(); 252 h = videoUI->height();
251 253
252 if ( drawnOnScreenDisplay ) { 254 if ( drawnOnScreenDisplay ) {
253 if ( onScreenDisplayVolume > v ) { 255 if ( onScreenDisplayVolume > v ) {
254 videoUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, ( onScreenDisplayVolume - v ) * 20 + 9, 30, FALSE ); 256 videoUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, ( onScreenDisplayVolume - v ) * 20 + 9, 30, FALSE );
255 } 257 }
256 } 258 }
257 drawnOnScreenDisplay = TRUE; 259 drawnOnScreenDisplay = TRUE;
258 onScreenDisplayVolume = v; 260 onScreenDisplayVolume = v;
259 QPainter p( videoUI ); 261 QPainter p( videoUI );
260 p.setPen( QColor( 0x10, 0xD0, 0x10 ) ); 262 p.setPen( QColor( 0x10, 0xD0, 0x10 ) );
261 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) ); 263 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) );
262 264
263 QFont f; 265 QFont f;
264 f.setPixelSize( 20 ); 266 f.setPixelSize( 20 );
265 f.setBold( TRUE ); 267 f.setBold( TRUE );
266 p.setFont( f ); 268 p.setFont( f );
267 p.drawText( (w - 200) / 2, h - yoff + 20, tr( "Volume" ) ); 269 p.drawText( (w - 200) / 2, h - yoff + 20, tr( "Volume" ) );
268 270
269 for ( unsigned int i = 0; i < 10; i++ ) { 271 for ( unsigned int i = 0; i < 10; i++ ) {
270 if ( v > i ) { 272 if ( v > i ) {
271 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); 273 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
272 } else { 274 } else {
273 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); 275 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
274 } 276 }
275 } 277 }
276 } 278 }
277} 279}
278 280
279 281
280void MediaPlayer::blank( bool b ) { 282void MediaPlayer::blank( bool b ) {
281 fd=open("/dev/fb0",O_RDWR); 283 fd=open("/dev/fb0",O_RDWR);
282#ifdef QT_QWS_EBX 284#ifdef QT_QWS_EBX
283 fl= open( "/dev/fl", O_RDWR ); 285 fl= open( "/dev/fl", O_RDWR );
284#endif 286#endif
285 if (fd != -1) { 287 if (fd != -1) {
286 if ( b ) { 288 if ( b ) {
287 qDebug("do blanking"); 289 qDebug("do blanking");
288#ifdef QT_QWS_EBX 290#ifdef QT_QWS_EBX
289 ioctl( fd, FBIOBLANK, 1 ); 291 ioctl( fd, FBIOBLANK, 1 );
290 if(fl !=-1) { 292 if(fl !=-1) {
291 ioctl( fl, 2 ); 293 ioctl( fl, 2 );
292 ::close(fl); 294 ::close(fl);
293 } 295 }
294#else 296#else
295 ioctl( fd, FBIOBLANK, 3 ); 297 ioctl( fd, FBIOBLANK, 3 );
296#endif 298#endif
297 isBlanked = TRUE; 299 isBlanked = TRUE;
298 } else { 300 } else {
299 qDebug("do unblanking"); 301 qDebug("do unblanking");
300 ioctl( fd, FBIOBLANK, 0); 302 ioctl( fd, FBIOBLANK, 0);
301#ifdef QT_QWS_EBX 303#ifdef QT_QWS_EBX
302 if(fl != -1) { 304 if(fl != -1) {
303 ioctl( fl, 1); 305 ioctl( fl, 1);
304 ::close(fl); 306 ::close(fl);
305 } 307 }
306#endif 308#endif
307 isBlanked = FALSE; 309 isBlanked = FALSE;
308 } 310 }
309 close( fd ); 311 close( fd );
310 } else { 312 } else {
311 qDebug("<< /dev/fb0 could not be opened >>"); 313 qDebug("<< /dev/fb0 could not be opened >>");
312 } 314 }
313} 315}
314 316
315void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { 317void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
316 switch ( e->key() ) { 318 switch ( e->key() ) {
317////////////////////////////// Zaurus keys 319////////////////////////////// Zaurus keys
318 case Key_Home: 320 case Key_Home:
319 break; 321 break;
320 case Key_F9: //activity 322 case Key_F9: //activity
321 break; 323 break;
322 case Key_F10: //contacts 324 case Key_F10: //contacts
323 break; 325 break;
324 case Key_F11: //menu 326 case Key_F11: //menu
325 break; 327 break;
326 case Key_F12: //home 328 case Key_F12: //home
327 qDebug("Blank here"); 329 qDebug("Blank here");
328// mediaPlayerState->toggleBlank(); 330// mediaPlayerState->toggleBlank();
329 break; 331 break;
330 case Key_F13: //mail 332 case Key_F13: //mail
331 qDebug("Blank here"); 333 qDebug("Blank here");
332 // mediaPlayerState->toggleBlank(); 334 // mediaPlayerState->toggleBlank();
333 break; 335 break;
334 } 336 }
335} 337}
336 338
337void MediaPlayer::cleanUp() {// this happens on closing 339void MediaPlayer::cleanUp() {// this happens on closing
338 Config cfg( "OpiePlayer" ); 340 Config cfg( "OpiePlayer" );
339 mediaPlayerState.writeConfig( cfg ); 341 mediaPlayerState.writeConfig( cfg );
340 playList.writeDefaultPlaylist( ); 342 playList.writeDefaultPlaylist( );
341 343
342// QPEApplication::grabKeyboard(); 344// QPEApplication::grabKeyboard();
343// QPEApplication::ungrabKeyboard(); 345// QPEApplication::ungrabKeyboard();
344} 346}
345 347
346void MediaPlayer::recreateAudioAndVideoWidgets() 348void MediaPlayer::recreateAudioAndVideoWidgets()
347{ 349{
348 delete xineControl; 350 delete xineControl;
349 delete audioUI; 351 delete audioUI;
350 delete videoUI; 352 delete videoUI;
351 audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" ); 353 audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" );
352 videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); 354 videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" );
353 355
354 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 356 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
355 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 357 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
356 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 358 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
357 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 359 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
358 360
359 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 361 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
360 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 362 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
361 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 363 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
362 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 364 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
363 365
364 xineControl = new XineControl( videoUI, mediaPlayerState ); 366 xineControl = new XineControl( videoUI, mediaPlayerState );
365} 367}
366 368