Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 14 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistselection.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 38 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.cpp | 24 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 8 |
10 files changed, 67 insertions, 67 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 28a42eb..36def67 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -124,25 +124,25 @@ void AudioWidget::sliderPressed() { | |||
124 | } | 124 | } |
125 | 125 | ||
126 | 126 | ||
127 | void AudioWidget::sliderReleased() { | 127 | void AudioWidget::sliderReleased() { |
128 | audioSliderBeingMoved = FALSE; | 128 | audioSliderBeingMoved = FALSE; |
129 | if ( slider.width() == 0 ) | 129 | if ( slider.width() == 0 ) |
130 | return; | 130 | return; |
131 | long val = long((double)slider.value() * mediaPlayerState.length() / slider.width()); | 131 | long val = long((double)slider.value() * mediaPlayerState.length() / slider.width()); |
132 | mediaPlayerState.setPosition( val ); | 132 | mediaPlayerState.setPosition( val ); |
133 | } | 133 | } |
134 | 134 | ||
135 | void AudioWidget::setPosition( long i ) { | 135 | void AudioWidget::setPosition( long i ) { |
136 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); | 136 | // odebug << "<<<<<<<<<<<<<<<<<<<<<<<<set position " << i << "" << oendl; |
137 | updateSlider( i, mediaPlayerState.length() ); | 137 | updateSlider( i, mediaPlayerState.length() ); |
138 | } | 138 | } |
139 | 139 | ||
140 | 140 | ||
141 | void AudioWidget::setLength( long max ) { | 141 | void AudioWidget::setLength( long max ) { |
142 | updateSlider( mediaPlayerState.position(), max ); | 142 | updateSlider( mediaPlayerState.position(), max ); |
143 | } | 143 | } |
144 | 144 | ||
145 | 145 | ||
146 | void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) { | 146 | void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) { |
147 | if ( mediaType == MediaPlayerState::Audio ) { | 147 | if ( mediaType == MediaPlayerState::Audio ) { |
148 | // startTimer( 150 ); | 148 | // startTimer( 150 ); |
@@ -178,37 +178,37 @@ void AudioWidget::loadSkin() | |||
178 | time.setFocusPolicy( QWidget::NoFocus ); | 178 | time.setFocusPolicy( QWidget::NoFocus ); |
179 | time.setAlignment( Qt::AlignCenter ); | 179 | time.setAlignment( Qt::AlignCenter ); |
180 | 180 | ||
181 | // time.setFrame(FALSE); | 181 | // time.setFrame(FALSE); |
182 | // changeTextColor( &time ); | 182 | // changeTextColor( &time ); |
183 | 183 | ||
184 | resizeEvent( 0 ); | 184 | resizeEvent( 0 ); |
185 | } | 185 | } |
186 | 186 | ||
187 | void AudioWidget::setSeekable( bool isSeekable ) { | 187 | void AudioWidget::setSeekable( bool isSeekable ) { |
188 | 188 | ||
189 | if ( !isSeekable ) { | 189 | if ( !isSeekable ) { |
190 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | 190 | odebug << "<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>" << oendl; |
191 | if( !slider.isHidden()) { | 191 | if( !slider.isHidden()) { |
192 | slider.hide(); | 192 | slider.hide(); |
193 | } | 193 | } |
194 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 194 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
195 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 195 | disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
196 | disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 196 | disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
197 | disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 197 | disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
198 | } else { | 198 | } else { |
199 | // this stops the slider from being moved, thus | 199 | // this stops the slider from being moved, thus |
200 | // does not stop stream when it reaches the end | 200 | // does not stop stream when it reaches the end |
201 | slider.show(); | 201 | slider.show(); |
202 | qDebug( " CONNECT SET POSTION " ); | 202 | odebug << " CONNECT SET POSTION " << oendl; |
203 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 203 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
204 | connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 204 | connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
205 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 205 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
206 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 206 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | 210 | ||
211 | static QString timeAsString( long length ) { | 211 | static QString timeAsString( long length ) { |
212 | int minutes = length / 60; | 212 | int minutes = length / 60; |
213 | int seconds = length % 60; | 213 | int seconds = length % 60; |
214 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); | 214 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); |
@@ -262,25 +262,25 @@ void AudioWidget::timerEvent( QTimerEvent * ) { | |||
262 | } else if ( skipDirection == -1 ) { | 262 | } else if ( skipDirection == -1 ) { |
263 | mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); | 263 | mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
267 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { | 267 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { |
268 | switch ( e->key() ) { | 268 | switch ( e->key() ) { |
269 | ////////////////////////////// Zaurus keys | 269 | ////////////////////////////// Zaurus keys |
270 | case Key_Home: | 270 | case Key_Home: |
271 | break; | 271 | break; |
272 | case Key_F9: //activity | 272 | case Key_F9: //activity |
273 | hide(); | 273 | hide(); |
274 | // qDebug("Audio F9"); | 274 | // odebug << "Audio F9" << oendl; |
275 | e->accept(); | 275 | e->accept(); |
276 | break; | 276 | break; |
277 | case Key_F10: //contacts | 277 | case Key_F10: //contacts |
278 | break; | 278 | break; |
279 | case Key_F11: //menu | 279 | case Key_F11: //menu |
280 | mediaPlayerState.toggleBlank(); | 280 | mediaPlayerState.toggleBlank(); |
281 | e->accept(); | 281 | e->accept(); |
282 | break; | 282 | break; |
283 | case Key_F12: //home | 283 | case Key_F12: //home |
284 | break; | 284 | break; |
285 | case Key_F13: //mail | 285 | case Key_F13: //mail |
286 | mediaPlayerState.toggleBlank(); | 286 | mediaPlayerState.toggleBlank(); |
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index a42b8e5..5c24dbe 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -97,28 +97,28 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | if ( initMode == InitializeImmediately ) { | 99 | if ( initMode == InitializeImmediately ) { |
100 | initialize(); | 100 | initialize(); |
101 | m_initialized = true; | 101 | m_initialized = true; |
102 | } | 102 | } |
103 | else | 103 | else |
104 | start(); | 104 | start(); |
105 | } | 105 | } |
106 | 106 | ||
107 | void Lib::run() | 107 | void Lib::run() |
108 | { | 108 | { |
109 | qDebug( "Lib::run() started" ); | 109 | odebug << "Lib::run() started" << oendl; |
110 | initialize(); | 110 | initialize(); |
111 | m_initialized = true; | 111 | m_initialized = true; |
112 | qDebug( "Lib::run() finished" ); | 112 | odebug << "Lib::run() finished" << oendl; |
113 | } | 113 | } |
114 | 114 | ||
115 | void Lib::initialize() | 115 | void Lib::initialize() |
116 | { | 116 | { |
117 | m_duringInitialization = true; | 117 | m_duringInitialization = true; |
118 | m_xine = xine_new( ); | 118 | m_xine = xine_new( ); |
119 | 119 | ||
120 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; | 120 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; |
121 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); | 121 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); |
122 | 122 | ||
123 | xine_init( m_xine ); | 123 | xine_init( m_xine ); |
124 | 124 | ||
@@ -206,25 +206,25 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) { | |||
206 | //m_queue = xine_event_new_queue (m_stream); | 206 | //m_queue = xine_event_new_queue (m_stream); |
207 | //xine_event_create_listener_thread (m_queue, xine_event_handler, this); | 207 | //xine_event_create_listener_thread (m_queue, xine_event_handler, this); |
208 | 208 | ||
209 | if ( !xine_open( m_stream, str.utf8().data() ) ) { | 209 | if ( !xine_open( m_stream, str.utf8().data() ) ) { |
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | return xine_play( m_stream, startPos, start_time); | 212 | return xine_play( m_stream, startPos, start_time); |
213 | } | 213 | } |
214 | 214 | ||
215 | void Lib::stop() { | 215 | void Lib::stop() { |
216 | assert( m_initialized ); | 216 | assert( m_initialized ); |
217 | 217 | ||
218 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); | 218 | odebug << "<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>" << oendl; |
219 | xine_stop( m_stream ); | 219 | xine_stop( m_stream ); |
220 | } | 220 | } |
221 | 221 | ||
222 | void Lib::pause( bool toggle ) { | 222 | void Lib::pause( bool toggle ) { |
223 | assert( m_initialized ); | 223 | assert( m_initialized ); |
224 | 224 | ||
225 | xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); | 225 | xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); |
226 | } | 226 | } |
227 | 227 | ||
228 | int Lib::speed() const { | 228 | int Lib::speed() const { |
229 | assert( m_initialized ); | 229 | assert( m_initialized ); |
230 | 230 | ||
@@ -318,27 +318,27 @@ QString Lib::metaInfo( int number) const { | |||
318 | 318 | ||
319 | int Lib::error() const { | 319 | int Lib::error() const { |
320 | assert( m_initialized ); | 320 | assert( m_initialized ); |
321 | 321 | ||
322 | return xine_get_error( m_stream ); | 322 | return xine_get_error( m_stream ); |
323 | }; | 323 | }; |
324 | 324 | ||
325 | void Lib::ensureInitialized() | 325 | void Lib::ensureInitialized() |
326 | { | 326 | { |
327 | if ( m_initialized ) | 327 | if ( m_initialized ) |
328 | return; | 328 | return; |
329 | 329 | ||
330 | qDebug( "waiting for initialization thread to finish" ); | 330 | odebug << "waiting for initialization thread to finish" << oendl; |
331 | wait(); | 331 | wait(); |
332 | qDebug( "initialization thread finished!" ); | 332 | odebug << "initialization thread finished!" << oendl; |
333 | } | 333 | } |
334 | 334 | ||
335 | void Lib::setWidget( XineVideoWidget *widget ) | 335 | void Lib::setWidget( XineVideoWidget *widget ) |
336 | { | 336 | { |
337 | m_wid = widget; | 337 | m_wid = widget; |
338 | resize ( m_wid-> size ( ) ); | 338 | resize ( m_wid-> size ( ) ); |
339 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); | 339 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); |
340 | m_wid->repaint(); | 340 | m_wid->repaint(); |
341 | } | 341 | } |
342 | 342 | ||
343 | void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) | 343 | void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) |
344 | { | 344 | { |
@@ -413,20 +413,20 @@ void Lib::xine_event_handler( void* user_data, const xine_event_t* t ) { | |||
413 | ( (Lib*)user_data)->handleXineEvent( t ); | 413 | ( (Lib*)user_data)->handleXineEvent( t ); |
414 | } | 414 | } |
415 | 415 | ||
416 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, | 416 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, |
417 | int width, int height, int bytes ) { | 417 | int width, int height, int bytes ) { |
418 | ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); | 418 | ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); |
419 | } | 419 | } |
420 | 420 | ||
421 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | 421 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { |
422 | assert( m_initialized ); | 422 | assert( m_initialized ); |
423 | 423 | ||
424 | if ( !m_video ) { | 424 | if ( !m_video ) { |
425 | qWarning("not showing video now"); | 425 | owarn << "not showing video now" << oendl; |
426 | return; | 426 | return; |
427 | } | 427 | } |
428 | 428 | ||
429 | assert( m_wid ); | 429 | assert( m_wid ); |
430 | 430 | ||
431 | m_wid-> setVideoFrame ( frame, width, height, bytes ); | 431 | m_wid-> setVideoFrame ( frame, width, height, bytes ); |
432 | } | 432 | } |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index a236775..7e38fc7 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -143,25 +143,25 @@ void MediaPlayer::next() { | |||
143 | 143 | ||
144 | if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist | 144 | if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist |
145 | if ( playList.next() ) { | 145 | if ( playList.next() ) { |
146 | play(); | 146 | play(); |
147 | } else if ( mediaPlayerState.isLooping() ) { | 147 | } else if ( mediaPlayerState.isLooping() ) { |
148 | if ( playList.first() ) { | 148 | if ( playList.first() ) { |
149 | play(); | 149 | play(); |
150 | } | 150 | } |
151 | } else { | 151 | } else { |
152 | mediaPlayerState.setList(); | 152 | mediaPlayerState.setList(); |
153 | } | 153 | } |
154 | } else { //if playing from file list, let's just stop | 154 | } else { //if playing from file list, let's just stop |
155 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); | 155 | odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl; |
156 | mediaPlayerState.setPlaying(false); | 156 | mediaPlayerState.setPlaying(false); |
157 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); | 157 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); |
158 | if(l) mediaPlayerState.setLooping(l); | 158 | if(l) mediaPlayerState.setLooping(l); |
159 | if(r) mediaPlayerState.setShuffled(r); | 159 | if(r) mediaPlayerState.setShuffled(r); |
160 | } | 160 | } |
161 | qApp->processEvents(); | 161 | qApp->processEvents(); |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
165 | void MediaPlayer::startDecreasingVolume() { | 165 | void MediaPlayer::startDecreasingVolume() { |
166 | volumeDirection = -1; | 166 | volumeDirection = -1; |
167 | startTimer( 100 ); | 167 | startTimer( 100 ); |
@@ -276,69 +276,69 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { | |||
276 | } | 276 | } |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | 280 | ||
281 | void MediaPlayer::blank( bool b ) { | 281 | void MediaPlayer::blank( bool b ) { |
282 | fd=open("/dev/fb0",O_RDWR); | 282 | fd=open("/dev/fb0",O_RDWR); |
283 | #ifdef QT_QWS_SL5XXX | 283 | #ifdef QT_QWS_SL5XXX |
284 | fl= open( "/dev/fl", O_RDWR ); | 284 | fl= open( "/dev/fl", O_RDWR ); |
285 | #endif | 285 | #endif |
286 | if (fd != -1) { | 286 | if (fd != -1) { |
287 | if ( b ) { | 287 | if ( b ) { |
288 | qDebug("do blanking"); | 288 | odebug << "do blanking" << oendl; |
289 | #ifdef QT_QWS_SL5XXX | 289 | #ifdef QT_QWS_SL5XXX |
290 | ioctl( fd, FBIOBLANK, 1 ); | 290 | ioctl( fd, FBIOBLANK, 1 ); |
291 | if(fl !=-1) { | 291 | if(fl !=-1) { |
292 | ioctl( fl, 2 ); | 292 | ioctl( fl, 2 ); |
293 | ::close(fl); | 293 | ::close(fl); |
294 | } | 294 | } |
295 | #else | 295 | #else |
296 | ioctl( fd, FBIOBLANK, 3 ); | 296 | ioctl( fd, FBIOBLANK, 3 ); |
297 | #endif | 297 | #endif |
298 | isBlanked = TRUE; | 298 | isBlanked = TRUE; |
299 | } else { | 299 | } else { |
300 | qDebug("do unblanking"); | 300 | odebug << "do unblanking" << oendl; |
301 | ioctl( fd, FBIOBLANK, 0); | 301 | ioctl( fd, FBIOBLANK, 0); |
302 | #ifdef QT_QWS_SL5XXX | 302 | #ifdef QT_QWS_SL5XXX |
303 | if(fl != -1) { | 303 | if(fl != -1) { |
304 | ioctl( fl, 1); | 304 | ioctl( fl, 1); |
305 | ::close(fl); | 305 | ::close(fl); |
306 | } | 306 | } |
307 | #endif | 307 | #endif |
308 | isBlanked = FALSE; | 308 | isBlanked = FALSE; |
309 | } | 309 | } |
310 | close( fd ); | 310 | close( fd ); |
311 | } else { | 311 | } else { |
312 | qDebug("<< /dev/fb0 could not be opened >>"); | 312 | odebug << "<< /dev/fb0 could not be opened >>" << oendl; |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | 316 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { |
317 | switch ( e->key() ) { | 317 | switch ( e->key() ) { |
318 | ////////////////////////////// Zaurus keys | 318 | ////////////////////////////// Zaurus keys |
319 | case Key_Home: | 319 | case Key_Home: |
320 | break; | 320 | break; |
321 | case Key_F9: //activity | 321 | case Key_F9: //activity |
322 | break; | 322 | break; |
323 | case Key_F10: //contacts | 323 | case Key_F10: //contacts |
324 | break; | 324 | break; |
325 | case Key_F11: //menu | 325 | case Key_F11: //menu |
326 | break; | 326 | break; |
327 | case Key_F12: //home | 327 | case Key_F12: //home |
328 | qDebug("Blank here"); | 328 | odebug << "Blank here" << oendl; |
329 | // mediaPlayerState->toggleBlank(); | 329 | // mediaPlayerState->toggleBlank(); |
330 | break; | 330 | break; |
331 | case Key_F13: //mail | 331 | case Key_F13: //mail |
332 | qDebug("Blank here"); | 332 | odebug << "Blank here" << oendl; |
333 | // mediaPlayerState->toggleBlank(); | 333 | // mediaPlayerState->toggleBlank(); |
334 | break; | 334 | break; |
335 | } | 335 | } |
336 | } | 336 | } |
337 | 337 | ||
338 | void MediaPlayer::cleanUp() {// this happens on closing | 338 | void MediaPlayer::cleanUp() {// this happens on closing |
339 | Config cfg( "OpiePlayer" ); | 339 | Config cfg( "OpiePlayer" ); |
340 | mediaPlayerState.writeConfig( cfg ); | 340 | mediaPlayerState.writeConfig( cfg ); |
341 | playList.writeDefaultPlaylist( ); | 341 | playList.writeDefaultPlaylist( ); |
342 | 342 | ||
343 | // QPEApplication::grabKeyboard(); | 343 | // QPEApplication::grabKeyboard(); |
344 | // QPEApplication::ungrabKeyboard(); | 344 | // QPEApplication::ungrabKeyboard(); |
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 26d5e15..95dbab5 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp | |||
@@ -28,68 +28,68 @@ | |||
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include "om3u.h" | 32 | #include "om3u.h" |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | //extern PlayListWidget *playList; | 36 | //extern PlayListWidget *playList; |
37 | 37 | ||
38 | Om3u::Om3u( const QString &filePath, int mode) | 38 | Om3u::Om3u( const QString &filePath, int mode) |
39 | : QStringList (){ | 39 | : QStringList (){ |
40 | qDebug("<<<<<<<new m3u "+filePath); | 40 | odebug << "<<<<<<<new m3u "+filePath << oendl; |
41 | f.setName(filePath); | 41 | f.setName(filePath); |
42 | f.open(mode); | 42 | f.open(mode); |
43 | } | 43 | } |
44 | 44 | ||
45 | Om3u::~Om3u(){} | 45 | Om3u::~Om3u(){} |
46 | 46 | ||
47 | void Om3u::readM3u() { | 47 | void Om3u::readM3u() { |
48 | // qDebug("<<<<<<reading m3u "+f.name()); | 48 | // odebug << "<<<<<<reading m3u "+f.name() << oendl; |
49 | QTextStream t(&f); | 49 | QTextStream t(&f); |
50 | t.setEncoding(QTextStream::UnicodeUTF8); | 50 | t.setEncoding(QTextStream::UnicodeUTF8); |
51 | QString s; | 51 | QString s; |
52 | while ( !t.atEnd() ) { | 52 | while ( !t.atEnd() ) { |
53 | s=t.readLine(); | 53 | s=t.readLine(); |
54 | // qDebug(s); | 54 | // odebug << s << oendl; |
55 | if( s.find( "#", 0, TRUE) == -1 ) { | 55 | if( s.find( "#", 0, TRUE) == -1 ) { |
56 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { | 56 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { |
57 | s = s.right( s.length() -2 ); | 57 | s = s.right( s.length() -2 ); |
58 | QFileInfo f( s ); | 58 | QFileInfo f( s ); |
59 | QString name = f.baseName(); | 59 | QString name = f.baseName(); |
60 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); | 60 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); |
61 | s=s.replace( QRegExp( "\\" ), "/" ); | 61 | s=s.replace( QRegExp( "\\" ), "/" ); |
62 | append(s); | 62 | append(s); |
63 | // qDebug(s); | 63 | // odebug << s << oendl; |
64 | } else { // is url | 64 | } else { // is url |
65 | QString name; | 65 | QString name; |
66 | name = s; | 66 | name = s; |
67 | append(name); | 67 | append(name); |
68 | } | 68 | } |
69 | } | 69 | } |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | void Om3u::readPls() { //it's a pls file | 73 | void Om3u::readPls() { //it's a pls file |
74 | QTextStream t( &f ); | 74 | QTextStream t( &f ); |
75 | t.setEncoding(QTextStream::UnicodeUTF8); | 75 | t.setEncoding(QTextStream::UnicodeUTF8); |
76 | QString s; | 76 | QString s; |
77 | while ( !t.atEnd() ) { | 77 | while ( !t.atEnd() ) { |
78 | s = t.readLine(); | 78 | s = t.readLine(); |
79 | if( s.left(4) == "File" ) { | 79 | if( s.left(4) == "File" ) { |
80 | s = s.right( s.length() - s.find("=",0,true)-1 ); | 80 | s = s.right( s.length() - s.find("=",0,true)-1 ); |
81 | s = s.stripWhiteSpace(); | 81 | s = s.stripWhiteSpace(); |
82 | s.replace( QRegExp( "%20" )," "); | 82 | s.replace( QRegExp( "%20" )," "); |
83 | // qDebug( "adding " + s + " to playlist" ); | 83 | // odebug << "adding " + s + " to playlist" << oendl; |
84 | // numberofentries=2 | 84 | // numberofentries=2 |
85 | // File1=http | 85 | // File1=http |
86 | // Title | 86 | // Title |
87 | // Length | 87 | // Length |
88 | // Version | 88 | // Version |
89 | // File2=http | 89 | // File2=http |
90 | s = s.replace( QRegExp( "\\" ), "/" ); | 90 | s = s.replace( QRegExp( "\\" ), "/" ); |
91 | QFileInfo f( s ); | 91 | QFileInfo f( s ); |
92 | QString name = f.baseName(); | 92 | QString name = f.baseName(); |
93 | if( name.left( 4 ) == "http" ) { | 93 | if( name.left( 4 ) == "http" ) { |
94 | name = s.right( s.length() - 7); | 94 | name = s.right( s.length() - 7); |
95 | } else { | 95 | } else { |
@@ -105,41 +105,41 @@ void Om3u::readPls() { //it's a pls file | |||
105 | append(s); | 105 | append(s); |
106 | } | 106 | } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | void Om3u::write() { //writes list to m3u file | 111 | void Om3u::write() { //writes list to m3u file |
112 | QString list; | 112 | QString list; |
113 | QTextStream t(&f); | 113 | QTextStream t(&f); |
114 | t.setEncoding(QTextStream::UnicodeUTF8); | 114 | t.setEncoding(QTextStream::UnicodeUTF8); |
115 | if(count()>0) { | 115 | if(count()>0) { |
116 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 116 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
117 | // qDebug(*it); | 117 | // odebug << *it << oendl; |
118 | t << *it << "\n"; | 118 | t << *it << "\n"; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | // f.close(); | 121 | // f.close(); |
122 | } | 122 | } |
123 | 123 | ||
124 | void Om3u::add(const QString &filePath) { //adds to m3u file | 124 | void Om3u::add(const QString &filePath) { //adds to m3u file |
125 | append(filePath); | 125 | append(filePath); |
126 | } | 126 | } |
127 | 127 | ||
128 | void Om3u::remove(const QString &filePath) { //removes from m3u list | 128 | void Om3u::remove(const QString &filePath) { //removes from m3u list |
129 | QString list, currentFile; | 129 | QString list, currentFile; |
130 | if(count()>0) { | 130 | if(count()>0) { |
131 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 131 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
132 | currentFile=*it; | 132 | currentFile=*it; |
133 | // qDebug(*it); | 133 | // odebug << *it << oendl; |
134 | 134 | ||
135 | if( filePath != currentFile) | 135 | if( filePath != currentFile) |
136 | list += currentFile+"\n"; | 136 | list += currentFile+"\n"; |
137 | } | 137 | } |
138 | f.writeBlock( list, list.length() ); | 138 | f.writeBlock( list, list.length() ); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | void Om3u::deleteFile(const QString &/*filePath*/) {//deletes m3u file | 142 | void Om3u::deleteFile(const QString &/*filePath*/) {//deletes m3u file |
143 | f.close(); | 143 | f.close(); |
144 | f.remove(); | 144 | f.remove(); |
145 | 145 | ||
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp index 015896f..3499837 100644 --- a/noncore/multimedia/opieplayer2/playlistselection.cpp +++ b/noncore/multimedia/opieplayer2/playlistselection.cpp | |||
@@ -35,46 +35,46 @@ public: | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | const DocLnk *file() const { return fl; } | 37 | const DocLnk *file() const { return fl; } |
38 | 38 | ||
39 | private: | 39 | private: |
40 | const DocLnk *fl; | 40 | const DocLnk *fl; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | 43 | ||
44 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | 44 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) |
45 | : QListView( parent, name ) | 45 | : QListView( parent, name ) |
46 | { | 46 | { |
47 | // qDebug("starting playlistselector"); | 47 | // odebug << "starting playlistselector" << oendl; |
48 | // #ifdef USE_PLAYLIST_BACKGROUND | 48 | // #ifdef USE_PLAYLIST_BACKGROUND |
49 | // setStaticBackground( TRUE ); | 49 | // setStaticBackground( TRUE ); |
50 | // setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); | 50 | // setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); |
51 | 51 | ||
52 | // setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); | 52 | // setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); |
53 | // #endif | 53 | // #endif |
54 | // addColumn("Title",236); | 54 | // addColumn("Title",236); |
55 | // setAllColumnsShowFocus( TRUE ); | 55 | // setAllColumnsShowFocus( TRUE ); |
56 | addColumn( tr( "Playlist Selection" ) ); | 56 | addColumn( tr( "Playlist Selection" ) ); |
57 | header()->hide(); | 57 | header()->hide(); |
58 | setSorting( -1, FALSE ); | 58 | setSorting( -1, FALSE ); |
59 | } | 59 | } |
60 | 60 | ||
61 | 61 | ||
62 | PlayListSelection::~PlayListSelection() { | 62 | PlayListSelection::~PlayListSelection() { |
63 | } | 63 | } |
64 | 64 | ||
65 | 65 | ||
66 | // #ifdef USE_PLAYLIST_BACKGROUND | 66 | // #ifdef USE_PLAYLIST_BACKGROUND |
67 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { | 67 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { |
68 | // qDebug("drawBackground"); | 68 | // odebug << "drawBackground" << oendl; |
69 | p->fillRect( r, QBrush( white ) ); | 69 | p->fillRect( r, QBrush( white ) ); |
70 | // QImage logo = Resource::loadImage( "launcher/opielogo" ); | 70 | // QImage logo = Resource::loadImage( "launcher/opielogo" ); |
71 | // if ( !logo.isNull() ) | 71 | // if ( !logo.isNull() ) |
72 | // p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); | 72 | // p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); |
73 | } | 73 | } |
74 | // #endif | 74 | // #endif |
75 | 75 | ||
76 | 76 | ||
77 | void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { | 77 | void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { |
78 | if ( event->state() == QMouseEvent::LeftButton ) { | 78 | if ( event->state() == QMouseEvent::LeftButton ) { |
79 | QListViewItem *currentItem = selectedItem(); | 79 | QListViewItem *currentItem = selectedItem(); |
80 | QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); | 80 | QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); |
@@ -175,32 +175,32 @@ bool PlayListSelection::last() { | |||
175 | 175 | ||
176 | void PlayListSelection::unSelect() | 176 | void PlayListSelection::unSelect() |
177 | { | 177 | { |
178 | //QListViewItem *item = selectedItem(); | 178 | //QListViewItem *item = selectedItem(); |
179 | setSelected( currentItem(), FALSE); | 179 | setSelected( currentItem(), FALSE); |
180 | } | 180 | } |
181 | 181 | ||
182 | void PlayListSelection::writeCurrent( Config& cfg ) { | 182 | void PlayListSelection::writeCurrent( Config& cfg ) { |
183 | cfg.setGroup("PlayList"); | 183 | cfg.setGroup("PlayList"); |
184 | QListViewItem *item = selectedItem(); | 184 | QListViewItem *item = selectedItem(); |
185 | if ( item ) | 185 | if ( item ) |
186 | cfg.writeEntry("current", item->text(0) ); | 186 | cfg.writeEntry("current", item->text(0) ); |
187 | qDebug(item->text(0)); | 187 | odebug << item->text(0) << oendl; |
188 | 188 | ||
189 | } | 189 | } |
190 | 190 | ||
191 | void PlayListSelection::setSelectedItem(const QString &strk ) { | 191 | void PlayListSelection::setSelectedItem(const QString &strk ) { |
192 | 192 | ||
193 | unSelect(); | 193 | unSelect(); |
194 | QListViewItemIterator it( this ); | 194 | QListViewItemIterator it( this ); |
195 | for ( ; it.current(); ++it ) { | 195 | for ( ; it.current(); ++it ) { |
196 | // qDebug( it.current()->text(0)); | 196 | // odebug << it.current()->text(0) << oendl; |
197 | if( strk == it.current()->text(0)) { | 197 | if( strk == it.current()->text(0)) { |
198 | // qDebug( "We have a match "+strk); | 198 | // odebug << "We have a match "+strk << oendl; |
199 | setSelected( it.current(), TRUE); | 199 | setSelected( it.current(), TRUE); |
200 | ensureItemVisible( it.current() ); | 200 | ensureItemVisible( it.current() ); |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | } | 203 | } |
204 | // setSelected( item, TRUE ); | 204 | // setSelected( item, TRUE ); |
205 | // ensureItemVisible( selectedItem() ); | 205 | // ensureItemVisible( selectedItem() ); |
206 | } | 206 | } |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 4460833..956d206 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -173,29 +173,29 @@ void PlayListWidget::initializeStates() { | |||
173 | d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); | 173 | d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); |
174 | d->playListFrame->show(); | 174 | d->playListFrame->show(); |
175 | } | 175 | } |
176 | 176 | ||
177 | void PlayListWidget::writeDefaultPlaylist() { | 177 | void PlayListWidget::writeDefaultPlaylist() { |
178 | 178 | ||
179 | Config config( "OpiePlayer" ); | 179 | Config config( "OpiePlayer" ); |
180 | config.setGroup( "PlayList" ); | 180 | config.setGroup( "PlayList" ); |
181 | QString filename=QPEApplication::documentDir() + "/default.m3u"; | 181 | QString filename=QPEApplication::documentDir() + "/default.m3u"; |
182 | QString currentString = config.readEntry( "CurrentPlaylist", filename); | 182 | QString currentString = config.readEntry( "CurrentPlaylist", filename); |
183 | if( currentString == filename) { | 183 | if( currentString == filename) { |
184 | Om3u *m3uList; | 184 | Om3u *m3uList; |
185 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); | 185 | // odebug << "<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>" << oendl; |
186 | if( d->selectedFiles->first() ) { | 186 | if( d->selectedFiles->first() ) { |
187 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 187 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
188 | do { | 188 | do { |
189 | // qDebug(d->selectedFiles->current()->file()); | 189 | // odebug << d->selectedFiles->current()->file() << oendl; |
190 | m3uList->add( d->selectedFiles->current()->file() ); | 190 | m3uList->add( d->selectedFiles->current()->file() ); |
191 | } | 191 | } |
192 | while ( d->selectedFiles->next() ); | 192 | while ( d->selectedFiles->next() ); |
193 | 193 | ||
194 | m3uList->write(); | 194 | m3uList->write(); |
195 | m3uList->close(); | 195 | m3uList->close(); |
196 | delete m3uList; | 196 | delete m3uList; |
197 | 197 | ||
198 | } | 198 | } |
199 | } | 199 | } |
200 | } | 200 | } |
201 | 201 | ||
@@ -316,25 +316,25 @@ void PlayListWidget::addAllVideoToList() { | |||
316 | filename = videoIt.current()->text(3); | 316 | filename = videoIt.current()->text(3); |
317 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 317 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
318 | lnk.setFile( filename ); //sets file name | 318 | lnk.setFile( filename ); //sets file name |
319 | d->selectedFiles->addToSelection( lnk); | 319 | d->selectedFiles->addToSelection( lnk); |
320 | } | 320 | } |
321 | tabWidget->setCurrentPage(0); | 321 | tabWidget->setCurrentPage(0); |
322 | writeCurrentM3u(); | 322 | writeCurrentM3u(); |
323 | d->selectedFiles->first(); | 323 | d->selectedFiles->first(); |
324 | } | 324 | } |
325 | 325 | ||
326 | 326 | ||
327 | void PlayListWidget::setDocument( const QString& fileref ) { | 327 | void PlayListWidget::setDocument( const QString& fileref ) { |
328 | // qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref ); | 328 | // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl; |
329 | fromSetDocument = TRUE; | 329 | fromSetDocument = TRUE; |
330 | QFileInfo fileInfo(fileref); | 330 | QFileInfo fileInfo(fileref); |
331 | 331 | ||
332 | if ( !fileInfo.exists() ) { | 332 | if ( !fileInfo.exists() ) { |
333 | QMessageBox::warning( this, tr( "Invalid File" ), | 333 | QMessageBox::warning( this, tr( "Invalid File" ), |
334 | tr( "There was a problem in getting the file." ) ); | 334 | tr( "There was a problem in getting the file." ) ); |
335 | return; | 335 | return; |
336 | } | 336 | } |
337 | 337 | ||
338 | clearList(); | 338 | clearList(); |
339 | QString extension = fileInfo.extension(false); | 339 | QString extension = fileInfo.extension(false); |
340 | 340 | ||
@@ -392,25 +392,25 @@ bool PlayListWidget::prev() { | |||
392 | if ( mediaPlayerState->isLooping() ) { | 392 | if ( mediaPlayerState->isLooping() ) { |
393 | return d->selectedFiles->last(); | 393 | return d->selectedFiles->last(); |
394 | } else { | 394 | } else { |
395 | return FALSE; | 395 | return FALSE; |
396 | } | 396 | } |
397 | } | 397 | } |
398 | return TRUE; | 398 | return TRUE; |
399 | } | 399 | } |
400 | } | 400 | } |
401 | 401 | ||
402 | 402 | ||
403 | bool PlayListWidget::next() { | 403 | bool PlayListWidget::next() { |
404 | //qDebug("<<<<<<<<<<<<next()"); | 404 | //odebug << "<<<<<<<<<<<<next()" << oendl; |
405 | if ( mediaPlayerState->isShuffled() ) { | 405 | if ( mediaPlayerState->isShuffled() ) { |
406 | return prev(); | 406 | return prev(); |
407 | } else { | 407 | } else { |
408 | if ( !d->selectedFiles->next() ) { | 408 | if ( !d->selectedFiles->next() ) { |
409 | if ( mediaPlayerState->isLooping() ) { | 409 | if ( mediaPlayerState->isLooping() ) { |
410 | return d->selectedFiles->first(); | 410 | return d->selectedFiles->first(); |
411 | } else { | 411 | } else { |
412 | return FALSE; | 412 | return FALSE; |
413 | } | 413 | } |
414 | } | 414 | } |
415 | return TRUE; | 415 | return TRUE; |
416 | } | 416 | } |
@@ -603,25 +603,25 @@ bool PlayListWidget::inFileListMode() const | |||
603 | return tab == AudioFiles || tab == VideoFiles; | 603 | return tab == AudioFiles || tab == VideoFiles; |
604 | } | 604 | } |
605 | 605 | ||
606 | void PlayListWidget::openURL() { | 606 | void PlayListWidget::openURL() { |
607 | // http://66.28.164.33:2080 | 607 | // http://66.28.164.33:2080 |
608 | // http://somafm.com/star0242.m3u | 608 | // http://somafm.com/star0242.m3u |
609 | QString filename, name; | 609 | QString filename, name; |
610 | InputDialog *fileDlg; | 610 | InputDialog *fileDlg; |
611 | fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); | 611 | fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); |
612 | fileDlg->exec(); | 612 | fileDlg->exec(); |
613 | if( fileDlg->result() == 1 ) { | 613 | if( fileDlg->result() == 1 ) { |
614 | filename = fileDlg->text(); | 614 | filename = fileDlg->text(); |
615 | qDebug( "Selected filename is " + filename ); | 615 | odebug << "Selected filename is " + filename << oendl; |
616 | // Om3u *m3uList; | 616 | // Om3u *m3uList; |
617 | DocLnk lnk; | 617 | DocLnk lnk; |
618 | Config cfg( "OpiePlayer" ); | 618 | Config cfg( "OpiePlayer" ); |
619 | cfg.setGroup("PlayList"); | 619 | cfg.setGroup("PlayList"); |
620 | 620 | ||
621 | if(filename.left(4) == "http") { | 621 | if(filename.left(4) == "http") { |
622 | QString m3uFile, m3uFilePath; | 622 | QString m3uFile, m3uFilePath; |
623 | if(filename.find(":",8,TRUE) != -1) { //found a port | 623 | if(filename.find(":",8,TRUE) != -1) { //found a port |
624 | m3uFile = filename.left( filename.find( ":",8,TRUE)); | 624 | m3uFile = filename.left( filename.find( ":",8,TRUE)); |
625 | m3uFile = m3uFile.right( 7); | 625 | m3uFile = m3uFile.right( 7); |
626 | } else if(filename.left(4) == "http"){ | 626 | } else if(filename.left(4) == "http"){ |
627 | m3uFile=filename; | 627 | m3uFile=filename; |
@@ -679,56 +679,56 @@ void PlayListWidget::openFile() { | |||
679 | 679 | ||
680 | QString str = OFileDialog::getOpenFileName( 1, | 680 | QString str = OFileDialog::getOpenFileName( 1, |
681 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", | 681 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", |
682 | types, 0 ); | 682 | types, 0 ); |
683 | 683 | ||
684 | if(str.left(2) == "//") { | 684 | if(str.left(2) == "//") { |
685 | str=str.right(str.length()-1); | 685 | str=str.right(str.length()-1); |
686 | } | 686 | } |
687 | cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); | 687 | cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); |
688 | 688 | ||
689 | if( !str.isEmpty() ) { | 689 | if( !str.isEmpty() ) { |
690 | 690 | ||
691 | qDebug( "Selected filename is " + str ); | 691 | odebug << "Selected filename is " + str << oendl; |
692 | filename = str; | 692 | filename = str; |
693 | DocLnk lnk; | 693 | DocLnk lnk; |
694 | 694 | ||
695 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { | 695 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { |
696 | readListFromFile( filename ); | 696 | readListFromFile( filename ); |
697 | } else { | 697 | } else { |
698 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 698 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
699 | lnk.setFile( filename ); //sets file name | 699 | lnk.setFile( filename ); //sets file name |
700 | d->selectedFiles->addToSelection( lnk ); | 700 | d->selectedFiles->addToSelection( lnk ); |
701 | writeCurrentM3u(); | 701 | writeCurrentM3u(); |
702 | d->selectedFiles->setSelectedItem( lnk.name() ); | 702 | d->selectedFiles->setSelectedItem( lnk.name() ); |
703 | } | 703 | } |
704 | } | 704 | } |
705 | } | 705 | } |
706 | 706 | ||
707 | 707 | ||
708 | void PlayListWidget::readListFromFile( const QString &filename ) { | 708 | void PlayListWidget::readListFromFile( const QString &filename ) { |
709 | qDebug( "read list filename " + filename ); | 709 | odebug << "read list filename " + filename << oendl; |
710 | QFileInfo fi(filename); | 710 | QFileInfo fi(filename); |
711 | Om3u *m3uList; | 711 | Om3u *m3uList; |
712 | QString s, name; | 712 | QString s, name; |
713 | m3uList = new Om3u( filename, IO_ReadOnly ); | 713 | m3uList = new Om3u( filename, IO_ReadOnly ); |
714 | if(fi.extension(false).find("m3u",0,false) != -1 ) | 714 | if(fi.extension(false).find("m3u",0,false) != -1 ) |
715 | m3uList->readM3u(); | 715 | m3uList->readM3u(); |
716 | else if(fi.extension(false).find("pls",0,false) != -1 ) | 716 | else if(fi.extension(false).find("pls",0,false) != -1 ) |
717 | m3uList->readPls(); | 717 | m3uList->readPls(); |
718 | 718 | ||
719 | DocLnk lnk; | 719 | DocLnk lnk; |
720 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 720 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
721 | s = *it; | 721 | s = *it; |
722 | // qDebug(s); | 722 | // odebug << s << oendl; |
723 | if(s.left(4)=="http") { | 723 | if(s.left(4)=="http") { |
724 | lnk.setName( s ); //sets file name | 724 | lnk.setName( s ); //sets file name |
725 | lnk.setIcon("opieplayer2/musicfile"); | 725 | lnk.setIcon("opieplayer2/musicfile"); |
726 | lnk.setFile( s ); //sets file name | 726 | lnk.setFile( s ); //sets file name |
727 | 727 | ||
728 | } else { //is file | 728 | } else { //is file |
729 | lnk.setName( QFileInfo(s).baseName()); | 729 | lnk.setName( QFileInfo(s).baseName()); |
730 | if(s.left(1) != "/") { | 730 | if(s.left(1) != "/") { |
731 | 731 | ||
732 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); | 732 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); |
733 | } else { | 733 | } else { |
734 | lnk.setFile( s); | 734 | lnk.setFile( s); |
@@ -744,39 +744,39 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
744 | currentPlayList=filename; | 744 | currentPlayList=filename; |
745 | 745 | ||
746 | m3uList->close(); | 746 | m3uList->close(); |
747 | delete m3uList; | 747 | delete m3uList; |
748 | 748 | ||
749 | d->selectedFiles->setSelectedItem( s); | 749 | d->selectedFiles->setSelectedItem( s); |
750 | setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); | 750 | setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); |
751 | 751 | ||
752 | } | 752 | } |
753 | 753 | ||
754 | // writes current playlist to current m3u file */ | 754 | // writes current playlist to current m3u file */ |
755 | void PlayListWidget::writeCurrentM3u() { | 755 | void PlayListWidget::writeCurrentM3u() { |
756 | qDebug("writing to current m3u"); | 756 | odebug << "writing to current m3u" << oendl; |
757 | Config cfg( "OpiePlayer" ); | 757 | Config cfg( "OpiePlayer" ); |
758 | cfg.setGroup("PlayList"); | 758 | cfg.setGroup("PlayList"); |
759 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); | 759 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); |
760 | 760 | ||
761 | Om3u *m3uList; | 761 | Om3u *m3uList; |
762 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 762 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); |
763 | if( d->selectedFiles->first()) { | 763 | if( d->selectedFiles->first()) { |
764 | 764 | ||
765 | do { | 765 | do { |
766 | // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file()); | 766 | // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; |
767 | m3uList->add( d->selectedFiles->current()->file() ); | 767 | m3uList->add( d->selectedFiles->current()->file() ); |
768 | } | 768 | } |
769 | while ( d->selectedFiles->next() ); | 769 | while ( d->selectedFiles->next() ); |
770 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 770 | // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; |
771 | m3uList->write(); | 771 | m3uList->write(); |
772 | m3uList->close(); | 772 | m3uList->close(); |
773 | } | 773 | } |
774 | delete m3uList; | 774 | delete m3uList; |
775 | 775 | ||
776 | } | 776 | } |
777 | 777 | ||
778 | /* | 778 | /* |
779 | writes current playlist to m3u file */ | 779 | writes current playlist to m3u file */ |
780 | void PlayListWidget::writem3u() { | 780 | void PlayListWidget::writem3u() { |
781 | //InputDilog *fileDlg; | 781 | //InputDilog *fileDlg; |
782 | //fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); | 782 | //fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); |
@@ -803,63 +803,63 @@ void PlayListWidget::writem3u() { | |||
803 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", | 803 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", |
804 | types, 0 ); | 804 | types, 0 ); |
805 | if(str.left(2) == "//") str=str.right(str.length()-1); | 805 | if(str.left(2) == "//") str=str.right(str.length()-1); |
806 | cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); | 806 | cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); |
807 | 807 | ||
808 | 808 | ||
809 | QString name, filename, list; | 809 | QString name, filename, list; |
810 | Om3u *m3uList; | 810 | Om3u *m3uList; |
811 | 811 | ||
812 | if( !str.isEmpty() ) { | 812 | if( !str.isEmpty() ) { |
813 | name = str; | 813 | name = str; |
814 | // name = fileDlg->text(); | 814 | // name = fileDlg->text(); |
815 | // qDebug( filename ); | 815 | // odebug << filename << oendl; |
816 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 816 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
817 | filename = name; | 817 | filename = name; |
818 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); | 818 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); |
819 | } | 819 | } |
820 | else //otherwise dump it somewhere noticable | 820 | else //otherwise dump it somewhere noticable |
821 | filename = QPEApplication::documentDir() + "/" + name; | 821 | filename = QPEApplication::documentDir() + "/" + name; |
822 | 822 | ||
823 | if( filename.right( 3 ) != "m3u" ) //needs filename extension | 823 | if( filename.right( 3 ) != "m3u" ) //needs filename extension |
824 | filename += ".m3u"; | 824 | filename += ".m3u"; |
825 | 825 | ||
826 | if( d->selectedFiles->first()) { //ramble through playlist view | 826 | if( d->selectedFiles->first()) { //ramble through playlist view |
827 | m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate); | 827 | m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate); |
828 | 828 | ||
829 | do { | 829 | do { |
830 | m3uList->add( d->selectedFiles->current()->file()); | 830 | m3uList->add( d->selectedFiles->current()->file()); |
831 | } | 831 | } |
832 | while ( d->selectedFiles->next() ); | 832 | while ( d->selectedFiles->next() ); |
833 | // qDebug( list ); | 833 | // odebug << list << oendl; |
834 | m3uList->write(); | 834 | m3uList->write(); |
835 | m3uList->close(); | 835 | m3uList->close(); |
836 | delete m3uList; | 836 | delete m3uList; |
837 | 837 | ||
838 | //delete fileDlg; | 838 | //delete fileDlg; |
839 | 839 | ||
840 | DocLnk lnk; | 840 | DocLnk lnk; |
841 | lnk.setFile( filename); | 841 | lnk.setFile( filename); |
842 | lnk.setIcon("opieplayer2/playlist2"); | 842 | lnk.setIcon("opieplayer2/playlist2"); |
843 | lnk.setName( name); //sets file name | 843 | lnk.setName( name); //sets file name |
844 | 844 | ||
845 | // qDebug(filename); | 845 | // odebug << filename << oendl; |
846 | Config config( "OpiePlayer" ); | 846 | Config config( "OpiePlayer" ); |
847 | config.setGroup( "PlayList" ); | 847 | config.setGroup( "PlayList" ); |
848 | 848 | ||
849 | config.writeEntry("CurrentPlaylist",filename); | 849 | config.writeEntry("CurrentPlaylist",filename); |
850 | currentPlayList=filename; | 850 | currentPlayList=filename; |
851 | 851 | ||
852 | if(!lnk.writeLink()) { | 852 | if(!lnk.writeLink()) { |
853 | qDebug("Writing doclink did not work"); | 853 | odebug << "Writing doclink did not work" << oendl; |
854 | } | 854 | } |
855 | 855 | ||
856 | setCaption(tr("OpiePlayer: ") + name); | 856 | setCaption(tr("OpiePlayer: ") + name); |
857 | } | 857 | } |
858 | } | 858 | } |
859 | } | 859 | } |
860 | 860 | ||
861 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | 861 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { |
862 | switch ( e->key() ) { | 862 | switch ( e->key() ) { |
863 | ////////////////////////////// Zaurus keys | 863 | ////////////////////////////// Zaurus keys |
864 | case Key_F9: //activity | 864 | case Key_F9: //activity |
865 | // if(audioUI->isHidden()) | 865 | // if(audioUI->isHidden()) |
@@ -875,25 +875,25 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
875 | // doBlank(); | 875 | // doBlank(); |
876 | break; | 876 | break; |
877 | case Key_F13: //mail | 877 | case Key_F13: //mail |
878 | // doUnblank(); | 878 | // doUnblank(); |
879 | break; | 879 | break; |
880 | case Key_Q: //add to playlist | 880 | case Key_Q: //add to playlist |
881 | addSelected(); | 881 | addSelected(); |
882 | break; | 882 | break; |
883 | case Key_R: //remove from playlist | 883 | case Key_R: //remove from playlist |
884 | removeSelected(); | 884 | removeSelected(); |
885 | break; | 885 | break; |
886 | // case Key_P: //play | 886 | // case Key_P: //play |
887 | // qDebug("Play"); | 887 | // odebug << "Play" << oendl; |
888 | // playSelected(); | 888 | // playSelected(); |
889 | // break; | 889 | // break; |
890 | case Key_Space: | 890 | case Key_Space: |
891 | // playSelected(); puh | 891 | // playSelected(); puh |
892 | break; | 892 | break; |
893 | case Key_1: | 893 | case Key_1: |
894 | tabWidget->setCurrentPage( 0 ); | 894 | tabWidget->setCurrentPage( 0 ); |
895 | break; | 895 | break; |
896 | case Key_2: | 896 | case Key_2: |
897 | tabWidget->setCurrentPage( 1 ); | 897 | tabWidget->setCurrentPage( 1 ); |
898 | break; | 898 | break; |
899 | case Key_3: | 899 | case Key_3: |
@@ -905,25 +905,25 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
905 | case Key_Down: | 905 | case Key_Down: |
906 | if ( !d->selectedFiles->next() ) | 906 | if ( !d->selectedFiles->next() ) |
907 | d->selectedFiles->first(); | 907 | d->selectedFiles->first(); |
908 | break; | 908 | break; |
909 | case Key_Up: | 909 | case Key_Up: |
910 | if ( !d->selectedFiles->prev() ) | 910 | if ( !d->selectedFiles->prev() ) |
911 | // d->selectedFiles->last(); | 911 | // d->selectedFiles->last(); |
912 | break; | 912 | break; |
913 | } | 913 | } |
914 | } | 914 | } |
915 | 915 | ||
916 | void PlayListWidget::pmViewActivated(int index) { | 916 | void PlayListWidget::pmViewActivated(int index) { |
917 | // qDebug("%d", index); | 917 | // odebug << "" << index << "" << oendl; |
918 | switch(index) { | 918 | switch(index) { |
919 | case -16: | 919 | case -16: |
920 | { | 920 | { |
921 | mediaPlayerState->toggleFullscreen(); | 921 | mediaPlayerState->toggleFullscreen(); |
922 | bool b=mediaPlayerState->isFullscreen(); | 922 | bool b=mediaPlayerState->isFullscreen(); |
923 | pmView->setItemChecked( index, b); | 923 | pmView->setItemChecked( index, b); |
924 | Config cfg( "OpiePlayer" ); | 924 | Config cfg( "OpiePlayer" ); |
925 | cfg.writeEntry( "FullScreen", b ); | 925 | cfg.writeEntry( "FullScreen", b ); |
926 | } | 926 | } |
927 | break; | 927 | break; |
928 | }; | 928 | }; |
929 | } | 929 | } |
@@ -935,25 +935,25 @@ void PlayListWidget::populateSkinsMenu() { | |||
935 | Config cfg( "OpiePlayer" ); | 935 | Config cfg( "OpiePlayer" ); |
936 | cfg.setGroup("Options" ); | 936 | cfg.setGroup("Options" ); |
937 | QString skin = cfg.readEntry( "Skin", "default" ); | 937 | QString skin = cfg.readEntry( "Skin", "default" ); |
938 | 938 | ||
939 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); | 939 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); |
940 | skinsDir.setFilter( QDir::Dirs ); | 940 | skinsDir.setFilter( QDir::Dirs ); |
941 | skinsDir.setSorting(QDir::Name ); | 941 | skinsDir.setSorting(QDir::Name ); |
942 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | 942 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); |
943 | QFileInfoListIterator it( *skinslist ); | 943 | QFileInfoListIterator it( *skinslist ); |
944 | QFileInfo *fi; | 944 | QFileInfo *fi; |
945 | while ( ( fi = it.current() ) ) { | 945 | while ( ( fi = it.current() ) ) { |
946 | skinName = fi->fileName(); | 946 | skinName = fi->fileName(); |
947 | // qDebug( fi->fileName() ); | 947 | // odebug << fi->fileName() << oendl; |
948 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 948 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
949 | item = skinsMenu->insertItem( fi->fileName() ) ; | 949 | item = skinsMenu->insertItem( fi->fileName() ) ; |
950 | } | 950 | } |
951 | if( skinName == "default" ) { | 951 | if( skinName == "default" ) { |
952 | defaultSkinIndex = item; | 952 | defaultSkinIndex = item; |
953 | } | 953 | } |
954 | if( skinName == skin ) { | 954 | if( skinName == skin ) { |
955 | skinsMenu->setItemChecked( item, TRUE ); | 955 | skinsMenu->setItemChecked( item, TRUE ); |
956 | } | 956 | } |
957 | ++it; | 957 | ++it; |
958 | } | 958 | } |
959 | } | 959 | } |
@@ -991,25 +991,25 @@ PlayListWidget::Entry PlayListWidget::currentEntry() const | |||
991 | return Entry( lnk->name(), lnk->file() ); | 991 | return Entry( lnk->name(), lnk->file() ); |
992 | } | 992 | } |
993 | 993 | ||
994 | return Entry( currentFileListPathName() ); | 994 | return Entry( currentFileListPathName() ); |
995 | } | 995 | } |
996 | 996 | ||
997 | QString PlayListWidget::currentFileListPathName() const { | 997 | QString PlayListWidget::currentFileListPathName() const { |
998 | return currentFileListView->currentItem()->text( 3 ); | 998 | return currentFileListView->currentItem()->text( 3 ); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1002 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1003 | qDebug("qcop message "+msg ); | 1003 | odebug << "qcop message "+msg << oendl; |
1004 | QDataStream stream ( data, IO_ReadOnly ); | 1004 | QDataStream stream ( data, IO_ReadOnly ); |
1005 | if ( msg == "play()" ) { //plays current selection | 1005 | if ( msg == "play()" ) { //plays current selection |
1006 | btnPlay( true); | 1006 | btnPlay( true); |
1007 | } else if ( msg == "stop()" ) { | 1007 | } else if ( msg == "stop()" ) { |
1008 | mediaPlayerState->setPlaying( false); | 1008 | mediaPlayerState->setPlaying( false); |
1009 | } else if ( msg == "togglePause()" ) { | 1009 | } else if ( msg == "togglePause()" ) { |
1010 | mediaPlayerState->togglePaused(); | 1010 | mediaPlayerState->togglePaused(); |
1011 | } else if ( msg == "next()" ) { //select next in list | 1011 | } else if ( msg == "next()" ) { //select next in list |
1012 | mediaPlayerState->setNext(); | 1012 | mediaPlayerState->setNext(); |
1013 | } else if ( msg == "prev()" ) { //select previous in list | 1013 | } else if ( msg == "prev()" ) { //select previous in list |
1014 | mediaPlayerState->setPrev(); | 1014 | mediaPlayerState->setPrev(); |
1015 | } else if ( msg == "toggleLooping()" ) { //loop or not loop | 1015 | } else if ( msg == "toggleLooping()" ) { //loop or not loop |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 2ff190d..922f9d7 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -174,20 +174,20 @@ PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) | |||
174 | PlayListWidgetGui::~PlayListWidgetGui() { | 174 | PlayListWidgetGui::~PlayListWidgetGui() { |
175 | } | 175 | } |
176 | 176 | ||
177 | void PlayListWidgetGui::setView( char view ) { | 177 | void PlayListWidgetGui::setView( char view ) { |
178 | if ( view == 'l' ) | 178 | if ( view == 'l' ) |
179 | showMaximized(); | 179 | showMaximized(); |
180 | else | 180 | else |
181 | hide(); | 181 | hide(); |
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | void PlayListWidgetGui::setActiveWindow() { | 185 | void PlayListWidgetGui::setActiveWindow() { |
186 | // qDebug("SETTING active window"); | 186 | // odebug << "SETTING active window" << oendl; |
187 | // When we get raised we need to ensure that it switches views | 187 | // When we get raised we need to ensure that it switches views |
188 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); | 188 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); |
189 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate | 189 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
190 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back | 190 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back |
191 | } | 191 | } |
192 | 192 | ||
193 | 193 | ||
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp index 7c38983..84f5f87 100644 --- a/noncore/multimedia/opieplayer2/skin.cpp +++ b/noncore/multimedia/opieplayer2/skin.cpp | |||
@@ -169,29 +169,29 @@ SkinCache::SkinCache() | |||
169 | // ... and one background pixmap | 169 | // ... and one background pixmap |
170 | m_backgroundPixmapCache.setMaxCost( 1 ); | 170 | m_backgroundPixmapCache.setMaxCost( 1 ); |
171 | } | 171 | } |
172 | 172 | ||
173 | SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &fileNameInfix ) | 173 | SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &fileNameInfix ) |
174 | { | 174 | { |
175 | QString key = skinPath + fileNameInfix; | 175 | QString key = skinPath + fileNameInfix; |
176 | 176 | ||
177 | SkinData *data = m_cache.take( key ); | 177 | SkinData *data = m_cache.take( key ); |
178 | if ( !data ) | 178 | if ( !data ) |
179 | data = new SkinData; | 179 | data = new SkinData; |
180 | else | 180 | else |
181 | qDebug( "SkinCache: hit" ); | 181 | odebug << "SkinCache: hit" << oendl; |
182 | 182 | ||
183 | QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath ); | 183 | QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath ); |
184 | if ( bgPixmap ) { | 184 | if ( bgPixmap ) { |
185 | qDebug( "SkinCache: hit on bgpixmap" ); | 185 | odebug << "SkinCache: hit on bgpixmap" << oendl; |
186 | data->backgroundPixmap = *bgPixmap; | 186 | data->backgroundPixmap = *bgPixmap; |
187 | } | 187 | } |
188 | else | 188 | else |
189 | data->backgroundPixmap = QPixmap(); | 189 | data->backgroundPixmap = QPixmap(); |
190 | 190 | ||
191 | return data; | 191 | return data; |
192 | } | 192 | } |
193 | 193 | ||
194 | void SkinCache::store( const QString &skinPath, const QString &fileNameInfix, SkinData *data ) | 194 | void SkinCache::store( const QString &skinPath, const QString &fileNameInfix, SkinData *data ) |
195 | { | 195 | { |
196 | QPixmap *backgroundPixmap = new QPixmap( data->backgroundPixmap ); | 196 | QPixmap *backgroundPixmap = new QPixmap( data->backgroundPixmap ); |
197 | 197 | ||
@@ -209,114 +209,114 @@ void SkinCache::store( const QString &skinPath, const QString &fileNameInfix, Sk | |||
209 | } | 209 | } |
210 | 210 | ||
211 | SkinLoader::IncrementalLoader::IncrementalLoader( const Info &info ) | 211 | SkinLoader::IncrementalLoader::IncrementalLoader( const Info &info ) |
212 | : m_skin( info.skinName, info.fileNameInfix ), m_info( info ) | 212 | : m_skin( info.skinName, info.fileNameInfix ), m_info( info ) |
213 | { | 213 | { |
214 | m_currentState = LoadBackgroundPixmap; | 214 | m_currentState = LoadBackgroundPixmap; |
215 | } | 215 | } |
216 | 216 | ||
217 | SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadStep() | 217 | SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadStep() |
218 | { | 218 | { |
219 | switch ( m_currentState ) { | 219 | switch ( m_currentState ) { |
220 | case LoadBackgroundPixmap: | 220 | case LoadBackgroundPixmap: |
221 | qDebug( "load bgpixmap" ); | 221 | odebug << "load bgpixmap" << oendl; |
222 | m_skin.backgroundPixmap(); | 222 | m_skin.backgroundPixmap(); |
223 | m_currentState = LoadButtonUpImage; | 223 | m_currentState = LoadButtonUpImage; |
224 | break; | 224 | break; |
225 | case LoadButtonUpImage: | 225 | case LoadButtonUpImage: |
226 | qDebug( "load upimage" ); | 226 | odebug << "load upimage" << oendl; |
227 | m_skin.buttonUpImage(); | 227 | m_skin.buttonUpImage(); |
228 | m_currentState = LoadButtonDownImage; | 228 | m_currentState = LoadButtonDownImage; |
229 | break; | 229 | break; |
230 | case LoadButtonDownImage: | 230 | case LoadButtonDownImage: |
231 | qDebug( "load downimage" ); | 231 | odebug << "load downimage" << oendl; |
232 | m_skin.buttonDownImage(); | 232 | m_skin.buttonDownImage(); |
233 | m_currentState = LoadButtonMasks; | 233 | m_currentState = LoadButtonMasks; |
234 | m_currentButton = 0; | 234 | m_currentButton = 0; |
235 | break; | 235 | break; |
236 | case LoadButtonMasks: | 236 | case LoadButtonMasks: |
237 | qDebug( "load button masks %i", m_currentButton ); | 237 | odebug << "load button masks " << m_currentButton << "" << oendl; |
238 | m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName ); | 238 | m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName ); |
239 | 239 | ||
240 | m_currentButton++; | 240 | m_currentButton++; |
241 | if ( m_currentButton >= m_info.buttonCount ) | 241 | if ( m_currentButton >= m_info.buttonCount ) |
242 | m_currentState = LoadButtonMask; | 242 | m_currentState = LoadButtonMask; |
243 | 243 | ||
244 | break; | 244 | break; |
245 | case LoadButtonMask: | 245 | case LoadButtonMask: |
246 | qDebug( "load whole mask" ); | 246 | odebug << "load whole mask" << oendl; |
247 | m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount ); | 247 | m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount ); |
248 | return LoadingCompleted; | 248 | return LoadingCompleted; |
249 | } | 249 | } |
250 | 250 | ||
251 | return MoreToCome; | 251 | return MoreToCome; |
252 | } | 252 | } |
253 | 253 | ||
254 | SkinLoader::SkinLoader() | 254 | SkinLoader::SkinLoader() |
255 | : m_currentLoader( 0 ), m_timerId( -1 ) | 255 | : m_currentLoader( 0 ), m_timerId( -1 ) |
256 | { | 256 | { |
257 | } | 257 | } |
258 | 258 | ||
259 | SkinLoader::~SkinLoader() | 259 | SkinLoader::~SkinLoader() |
260 | { | 260 | { |
261 | qDebug( "SkinLoader::~SkinLoader()" ); | 261 | odebug << "SkinLoader::~SkinLoader()" << oendl; |
262 | killTimers(); | 262 | killTimers(); |
263 | delete m_currentLoader; | 263 | delete m_currentLoader; |
264 | } | 264 | } |
265 | 265 | ||
266 | void SkinLoader::schedule( const MediaWidget::GUIInfo &guiInfo ) | 266 | void SkinLoader::schedule( const MediaWidget::GUIInfo &guiInfo ) |
267 | { | 267 | { |
268 | schedule( Skin::defaultSkinName(), guiInfo ); | 268 | schedule( Skin::defaultSkinName(), guiInfo ); |
269 | } | 269 | } |
270 | 270 | ||
271 | void SkinLoader::schedule( const QString &skinName, const MediaWidget::GUIInfo &guiInfo ) | 271 | void SkinLoader::schedule( const QString &skinName, const MediaWidget::GUIInfo &guiInfo ) |
272 | { | 272 | { |
273 | pendingSkins << Info( skinName, guiInfo ); | 273 | pendingSkins << Info( skinName, guiInfo ); |
274 | } | 274 | } |
275 | 275 | ||
276 | void SkinLoader::start() | 276 | void SkinLoader::start() |
277 | { | 277 | { |
278 | assert( m_timerId == -1 ); | 278 | assert( m_timerId == -1 ); |
279 | m_timerId = startTimer( 100 /* ms */ ); | 279 | m_timerId = startTimer( 100 /* ms */ ); |
280 | qDebug( "SkinLoader::start() %d jobs", pendingSkins.count() ); | 280 | odebug << "SkinLoader::start() " << pendingSkins.count() << " jobs" << oendl; |
281 | } | 281 | } |
282 | 282 | ||
283 | void SkinLoader::timerEvent( QTimerEvent *ev ) | 283 | void SkinLoader::timerEvent( QTimerEvent *ev ) |
284 | { | 284 | { |
285 | if ( ev->timerId() != m_timerId ) { | 285 | if ( ev->timerId() != m_timerId ) { |
286 | QObject::timerEvent( ev ); | 286 | QObject::timerEvent( ev ); |
287 | return; | 287 | return; |
288 | } | 288 | } |
289 | 289 | ||
290 | if ( !m_currentLoader ) { | 290 | if ( !m_currentLoader ) { |
291 | 291 | ||
292 | if ( pendingSkins.isEmpty() ) { | 292 | if ( pendingSkins.isEmpty() ) { |
293 | qDebug( "all jobs done" ); | 293 | odebug << "all jobs done" << oendl; |
294 | killTimer( m_timerId ); | 294 | killTimer( m_timerId ); |
295 | m_timerId = -1; | 295 | m_timerId = -1; |
296 | // ### qt3: use deleteLater(); | 296 | // ### qt3: use deleteLater(); |
297 | QTimer::singleShot( 0, this, SLOT( deleteMe() ) ); | 297 | QTimer::singleShot( 0, this, SLOT( deleteMe() ) ); |
298 | return; | 298 | return; |
299 | } | 299 | } |
300 | 300 | ||
301 | Info nfo = *pendingSkins.begin(); | 301 | Info nfo = *pendingSkins.begin(); |
302 | pendingSkins.remove( pendingSkins.begin() ); | 302 | pendingSkins.remove( pendingSkins.begin() ); |
303 | 303 | ||
304 | m_currentLoader = new IncrementalLoader( nfo ); | 304 | m_currentLoader = new IncrementalLoader( nfo ); |
305 | qDebug( "new loader %i jobs left", pendingSkins.count() ); | 305 | odebug << "new loader " << pendingSkins.count() << " jobs left" << oendl; |
306 | } | 306 | } |
307 | 307 | ||
308 | if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) { | 308 | if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) { |
309 | delete m_currentLoader; | 309 | delete m_currentLoader; |
310 | m_currentLoader = 0; | 310 | m_currentLoader = 0; |
311 | } | 311 | } |
312 | 312 | ||
313 | qDebug( "finished step" ); | 313 | odebug << "finished step" << oendl; |
314 | } | 314 | } |
315 | 315 | ||
316 | void SkinLoader::deleteMe() | 316 | void SkinLoader::deleteMe() |
317 | { | 317 | { |
318 | delete this; | 318 | delete this; |
319 | } | 319 | } |
320 | 320 | ||
321 | /* vim: et sw=4 ts=4 | 321 | /* vim: et sw=4 ts=4 |
322 | */ | 322 | */ |
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp index fb951b4..d8b8abe 100644 --- a/noncore/multimedia/opieplayer2/threadutil.cpp +++ b/noncore/multimedia/opieplayer2/threadutil.cpp | |||
@@ -178,34 +178,34 @@ Thread::Thread() | |||
178 | 178 | ||
179 | Thread::~Thread() | 179 | Thread::~Thread() |
180 | { | 180 | { |
181 | assert( d->isRunning == false ); | 181 | assert( d->isRunning == false ); |
182 | delete d; | 182 | delete d; |
183 | } | 183 | } |
184 | 184 | ||
185 | void Thread::start() | 185 | void Thread::start() |
186 | { | 186 | { |
187 | AutoLock lock( d->guard ); | 187 | AutoLock lock( d->guard ); |
188 | 188 | ||
189 | if ( d->isRunning ) { | 189 | if ( d->isRunning ) { |
190 | qDebug( "ThreadUtil::Thread::start() called for running thread." ); | 190 | odebug << "ThreadUtil::Thread::start() called for running thread." << oendl; |
191 | return; | 191 | return; |
192 | } | 192 | } |
193 | 193 | ||
194 | pthread_attr_t attributes; | 194 | pthread_attr_t attributes; |
195 | pthread_attr_init( &attributes ); | 195 | pthread_attr_init( &attributes ); |
196 | pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); | 196 | pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); |
197 | int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); | 197 | int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); |
198 | if ( err != 0 ) { | 198 | if ( err != 0 ) { |
199 | qDebug( "ThreadUtil::Thread::start() : can't create thread: %s", strerror( err ) ); | 199 | odebug << "ThreadUtil::Thread::start() : can't create thread: " << strerror( err ) << "" << oendl; |
200 | pthread_attr_destroy( &attributes ); | 200 | pthread_attr_destroy( &attributes ); |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | pthread_attr_destroy( &attributes ); | 203 | pthread_attr_destroy( &attributes ); |
204 | } | 204 | } |
205 | 205 | ||
206 | void Thread::terminate() | 206 | void Thread::terminate() |
207 | { | 207 | { |
208 | AutoLock lock( d->guard ); | 208 | AutoLock lock( d->guard ); |
209 | if ( !d->isRunning ) | 209 | if ( !d->isRunning ) |
210 | return; | 210 | return; |
211 | 211 | ||
@@ -275,25 +275,25 @@ ChannelMessage::ChannelMessage( int type ) | |||
275 | } | 275 | } |
276 | 276 | ||
277 | ChannelMessage::~ChannelMessage() | 277 | ChannelMessage::~ChannelMessage() |
278 | { | 278 | { |
279 | if ( m_guard.isLocked() ) | 279 | if ( m_guard.isLocked() ) |
280 | m_guard.unlock(); | 280 | m_guard.unlock(); |
281 | } | 281 | } |
282 | 282 | ||
283 | void ChannelMessage::reply() | 283 | void ChannelMessage::reply() |
284 | { | 284 | { |
285 | if ( !m_isCall ) | 285 | if ( !m_isCall ) |
286 | { | 286 | { |
287 | qDebug( "ChannelMessage::reply() - can't reply oneway message!" ); | 287 | odebug << "ChannelMessage::reply() - can't reply oneway message!" << oendl; |
288 | return; | 288 | return; |
289 | } | 289 | } |
290 | 290 | ||
291 | if ( m_inEventHandler ) | 291 | if ( m_inEventHandler ) |
292 | { | 292 | { |
293 | m_replied = true; | 293 | m_replied = true; |
294 | return; | 294 | return; |
295 | } | 295 | } |
296 | 296 | ||
297 | m_condition.wakeOne(); | 297 | m_condition.wakeOne(); |
298 | m_guard.unlock(); | 298 | m_guard.unlock(); |
299 | } | 299 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 8f11b2e..94f99f8 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -84,43 +84,43 @@ XineControl::~XineControl() { | |||
84 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 84 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
85 | } | 85 | } |
86 | #endif | 86 | #endif |
87 | delete libXine; | 87 | delete libXine; |
88 | } | 88 | } |
89 | 89 | ||
90 | void XineControl::play( const QString& fileName ) { | 90 | void XineControl::play( const QString& fileName ) { |
91 | 91 | ||
92 | hasVideoChannel = FALSE; | 92 | hasVideoChannel = FALSE; |
93 | hasAudioChannel = FALSE; | 93 | hasAudioChannel = FALSE; |
94 | m_fileName = fileName; | 94 | m_fileName = fileName; |
95 | 95 | ||
96 | qDebug("<<FILENAME: " + fileName + ">>>>"); | 96 | odebug << "<<FILENAME: " + fileName + ">>>>" << oendl; |
97 | 97 | ||
98 | if ( !libXine->play( fileName, 0, 0 ) ) { | 98 | if ( !libXine->play( fileName, 0, 0 ) ) { |
99 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); | 99 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); |
100 | // toggle stop so the the play button is reset | 100 | // toggle stop so the the play button is reset |
101 | mediaPlayerState.setPlaying( false ); | 101 | mediaPlayerState.setPlaying( false ); |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | mediaPlayerState.setPlaying( true ); | 104 | mediaPlayerState.setPlaying( true ); |
105 | 105 | ||
106 | MediaPlayerState::DisplayType displayType; | 106 | MediaPlayerState::DisplayType displayType; |
107 | if ( !libXine->hasVideo() ) { | 107 | if ( !libXine->hasVideo() ) { |
108 | displayType = MediaPlayerState::Audio; | 108 | displayType = MediaPlayerState::Audio; |
109 | qDebug("HAS AUDIO"); | 109 | odebug << "HAS AUDIO" << oendl; |
110 | libXine->setShowVideo( false ); | 110 | libXine->setShowVideo( false ); |
111 | hasAudioChannel = TRUE; | 111 | hasAudioChannel = TRUE; |
112 | } else { | 112 | } else { |
113 | displayType = MediaPlayerState::Video; | 113 | displayType = MediaPlayerState::Video; |
114 | qDebug("HAS VIDEO"); | 114 | odebug << "HAS VIDEO" << oendl; |
115 | libXine->setShowVideo( true ); | 115 | libXine->setShowVideo( true ); |
116 | hasVideoChannel = TRUE; | 116 | hasVideoChannel = TRUE; |
117 | } | 117 | } |
118 | // determine if slider is shown | 118 | // determine if slider is shown |
119 | mediaPlayerState.setIsSeekable( libXine->isSeekable() ); | 119 | mediaPlayerState.setIsSeekable( libXine->isSeekable() ); |
120 | 120 | ||
121 | // which gui (video / audio) | 121 | // which gui (video / audio) |
122 | mediaPlayerState.setDisplayType( displayType ); | 122 | mediaPlayerState.setDisplayType( displayType ); |
123 | 123 | ||
124 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 124 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
125 | if ( !disabledSuspendScreenSaver ) { | 125 | if ( !disabledSuspendScreenSaver ) { |
126 | disabledSuspendScreenSaver = TRUE; | 126 | disabledSuspendScreenSaver = TRUE; |
@@ -234,25 +234,25 @@ QString XineControl::getMetaInfo() { | |||
234 | } | 234 | } |
235 | 235 | ||
236 | if ( !libXine->metaInfo( 5 ).isEmpty() ) { | 236 | if ( !libXine->metaInfo( 5 ).isEmpty() ) { |
237 | returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); | 237 | returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); |
238 | } | 238 | } |
239 | return returnString; | 239 | return returnString; |
240 | } | 240 | } |
241 | 241 | ||
242 | QString XineControl::getErrorCode() { | 242 | QString XineControl::getErrorCode() { |
243 | 243 | ||
244 | int errorCode = libXine->error(); | 244 | int errorCode = libXine->error(); |
245 | 245 | ||
246 | qDebug( QString("ERRORCODE: %1 ").arg(errorCode) ); | 246 | odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl; |
247 | 247 | ||
248 | if ( errorCode == 1 ) { | 248 | if ( errorCode == 1 ) { |
249 | return tr( "No input plugin found for this media type" ); | 249 | return tr( "No input plugin found for this media type" ); |
250 | } else if ( errorCode == 2 ) { | 250 | } else if ( errorCode == 2 ) { |
251 | return tr( "No demux plugin found for this media type" ); | 251 | return tr( "No demux plugin found for this media type" ); |
252 | } else if ( errorCode == 3 ) { | 252 | } else if ( errorCode == 3 ) { |
253 | return tr( "Demuxing failed for this media type" ); | 253 | return tr( "Demuxing failed for this media type" ); |
254 | } else if ( errorCode == 4 ) { | 254 | } else if ( errorCode == 4 ) { |
255 | return tr( "Malformed MRL" ); | 255 | return tr( "Malformed MRL" ); |
256 | } else { | 256 | } else { |
257 | return tr( "Some other error" ); | 257 | return tr( "Some other error" ); |
258 | } | 258 | } |