author | llornkcor <llornkcor> | 2003-06-11 22:11:38 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-06-11 22:11:38 (UTC) |
commit | 24097a2790fd7bb241a0a8da24ef2996e4f4ad15 (patch) (unidiff) | |
tree | 142e0fb758067bc9a601b3bd2dabdff27675c0f3 /core | |
parent | 188319af82322c84f02e1abb848d908ca8f9e26c (diff) | |
download | opie-24097a2790fd7bb241a0a8da24ef2996e4f4ad15.zip opie-24097a2790fd7bb241a0a8da24ef2996e4f4ad15.tar.gz opie-24097a2790fd7bb241a0a8da24ef2996e4f4ad15.tar.bz2 |
fix setDoc for playlists and others. remove qDebugs
-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 16 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 31 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 24 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol_threaded.cpp | 18 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 6 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/om3u.cpp | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 142 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 14 |
10 files changed, 117 insertions, 142 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 73e41dc..d01d2ba 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -149,3 +149,3 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
149 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | 149 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { |
150 | qDebug("creating new audio device"); | 150 | // qDebug("creating new audio device"); |
151 | // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; | 151 | // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; |
@@ -155,3 +155,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
155 | d->bytesPerSample = bps; | 155 | d->bytesPerSample = bps; |
156 | qDebug("%d",bps); | 156 | // qDebug("%d",bps); |
157 | int format=0; | 157 | int format=0; |
@@ -160,3 +160,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
160 | else format = AFMT_S16_LE; | 160 | else format = AFMT_S16_LE; |
161 | qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); | 161 | // qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); |
162 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 162 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
@@ -193,6 +193,6 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
193 | perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); | 193 | perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); |
194 | qDebug("freq %d", d->frequency); | 194 | // qDebug("freq %d", d->frequency); |
195 | if(ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency )==-1) | 195 | if(ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency )==-1) |
196 | perror("ioctl(\"SNDCTL_DSP_SPEED\")"); | 196 | perror("ioctl(\"SNDCTL_DSP_SPEED\")"); |
197 | qDebug("channels %d",d->channels); | 197 | // qDebug("channels %d",d->channels); |
198 | if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) { | 198 | if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) { |
@@ -220,3 +220,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
220 | AudioDevice::~AudioDevice() { | 220 | AudioDevice::~AudioDevice() { |
221 | qDebug("destryo audiodevice"); | 221 | // qDebug("destryo audiodevice"); |
222 | // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; | 222 | // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; |
@@ -244,3 +244,3 @@ void AudioDevice::write( char *buffer, unsigned int length ) | |||
244 | if ( t != (int)length) { | 244 | if ( t != (int)length) { |
245 | qDebug("Ahhh!! memcpys 1"); | 245 | // qDebug("Ahhh!! memcpys 1"); |
246 | memcpy(d->unwrittenBuffer,buffer+t,length-t); | 246 | memcpy(d->unwrittenBuffer,buffer+t,length-t); |
@@ -307,3 +307,3 @@ int AudioDevice::bytesWritten() { | |||
307 | if ( ioctl( d->handle, SNDCTL_DSP_GETODELAY, &buffered ) ) { | 307 | if ( ioctl( d->handle, SNDCTL_DSP_GETODELAY, &buffered ) ) { |
308 | qDebug( "failed to get audio device position" ); | 308 | // qDebug( "failed to get audio device position" ); |
309 | return -1; | 309 | return -1; |
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index a1973e9..b187cb4 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -78,3 +78,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
78 | setCaption( tr("OpiePlayer") ); | 78 | setCaption( tr("OpiePlayer") ); |
79 | qDebug("<<<<<audioWidget"); | 79 | // qDebug("<<<<<audioWidget"); |
80 | 80 | ||
@@ -92,3 +92,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
92 | 92 | ||
93 | qDebug("skin path " + skinPath); | 93 | // qDebug("skin path " + skinPath); |
94 | 94 | ||
@@ -162,3 +162,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
162 | setPlaying( mediaPlayerState->playing() ); | 162 | setPlaying( mediaPlayerState->playing() ); |
163 | 163 | this->setFocus(); | |
164 | } | 164 | } |
@@ -167,13 +167,14 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
167 | AudioWidget::~AudioWidget() { | 167 | AudioWidget::~AudioWidget() { |
168 | // setPlaying( false); | ||
168 | 169 | ||
169 | for ( int i = 0; i < 10; i++ ) { | 170 | for ( int i = 0; i < 10; i++ ) { |
170 | delete buttonPixUp[i]; | 171 | if(buttonPixUp[i]) delete buttonPixUp[i]; |
171 | delete buttonPixDown[i]; | 172 | if(buttonPixDown[i]) delete buttonPixDown[i]; |
172 | } | 173 | } |
173 | delete pixBg; | 174 | if(pixBg) delete pixBg; |
174 | delete imgUp; | 175 | if(imgUp) delete imgUp; |
175 | delete imgDn; | 176 | if(imgDn) delete imgDn; |
176 | delete imgButtonMask; | 177 | if(imgButtonMask) delete imgButtonMask; |
177 | for ( int i = 0; i < 10; i++ ) { | 178 | for ( int i = 0; i < 10; i++ ) { |
178 | delete masks[i]; | 179 | if(masks[i]) delete masks[i]; |
179 | } | 180 | } |
@@ -281,2 +282,3 @@ void AudioWidget::setView( char view ) { | |||
281 | } | 282 | } |
283 | |||
282 | } | 284 | } |
@@ -292,2 +294,3 @@ static QString timeAsString( long length ) { | |||
292 | void AudioWidget::updateSlider( long i, long max ) { | 294 | void AudioWidget::updateSlider( long i, long max ) { |
295 | this->setFocus(); | ||
293 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); | 296 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); |
@@ -359,4 +362,4 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
359 | 362 | ||
360 | if ( isOnButton && i == AudioVolumeUp ) | 363 | // if ( isOnButton && i == AudioVolumeUp ) |
361 | qDebug("on up"); | 364 | // qDebug("on up"); |
362 | 365 | ||
@@ -367,3 +370,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
367 | case AudioVolumeUp: | 370 | case AudioVolumeUp: |
368 | qDebug("more clicked"); | 371 | // qDebug("more clicked"); |
369 | emit moreClicked(); | 372 | emit moreClicked(); |
@@ -371,3 +374,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
371 | case AudioVolumeDown: | 374 | case AudioVolumeDown: |
372 | qDebug("less clicked"); | 375 | // qDebug("less clicked"); |
373 | emit lessClicked(); | 376 | emit lessClicked(); |
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 8cf0a75..82242a3 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp | |||
@@ -102,3 +102,3 @@ LoopControl::LoopControl( QObject *parent, const char *name ) | |||
102 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); | 102 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); |
103 | qDebug("starting loopcontrol"); | 103 | //qDebug("starting loopcontrol"); |
104 | audioMutex = new Mutex; | 104 | audioMutex = new Mutex; |
@@ -114,3 +114,3 @@ qDebug("starting loopcontrol"); | |||
114 | } else { | 114 | } else { |
115 | qDebug( "Error setting up a realtime thread, reverting to using a normal thread." ); | 115 | // qDebug( "Error setting up a realtime thread, reverting to using a normal thread." ); |
116 | pthread_attr_destroy(&audio_attr); | 116 | pthread_attr_destroy(&audio_attr); |
@@ -119,3 +119,3 @@ qDebug("starting loopcontrol"); | |||
119 | #endif | 119 | #endif |
120 | qDebug("create audio thread"); | 120 | //qDebug("create audio thread"); |
121 | pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); | 121 | pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); |
@@ -229,4 +229,4 @@ void LoopControl::startAudio() { | |||
229 | 229 | ||
230 | if ( currentSample != audioSampleCounter + 1 ) | 230 | // if ( currentSample != audioSampleCounter + 1 ) |
231 | qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); | 231 | // qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); |
232 | 232 | ||
@@ -243,3 +243,3 @@ void LoopControl::startAudio() { | |||
243 | else if ( sampleWaitTime <= -5000 ) { | 243 | else if ( sampleWaitTime <= -5000 ) { |
244 | qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 244 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
245 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 245 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
@@ -363,3 +363,3 @@ bool LoopControl::init( const QString& filename ) { | |||
363 | 363 | ||
364 | qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); | 364 | // qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); |
365 | 365 | ||
@@ -389,3 +389,3 @@ bool LoopControl::init( const QString& filename ) { | |||
389 | 389 | ||
390 | qDebug( "LC- channels = %d", channels ); | 390 | // qDebug( "LC- channels = %d", channels ); |
391 | 391 | ||
@@ -395,3 +395,3 @@ bool LoopControl::init( const QString& filename ) { | |||
395 | total_audio_samples += 1000; | 395 | total_audio_samples += 1000; |
396 | qDebug("total samples %d", total_audio_samples); | 396 | // qDebug("total samples %d", total_audio_samples); |
397 | mediaPlayerState->setLength( total_audio_samples ); | 397 | mediaPlayerState->setLength( total_audio_samples ); |
@@ -399,3 +399,3 @@ bool LoopControl::init( const QString& filename ) { | |||
399 | freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); | 399 | freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); |
400 | qDebug( "LC- frequency = %d", freq ); | 400 | // qDebug( "LC- frequency = %d", freq ); |
401 | 401 | ||
@@ -405,3 +405,3 @@ bool LoopControl::init( const QString& filename ) { | |||
405 | bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); | 405 | bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); |
406 | qDebug("using stupid hack"); | 406 | // qDebug("using stupid hack"); |
407 | } else { | 407 | } else { |
@@ -453,3 +453,3 @@ bool LoopControl::init( const QString& filename ) { | |||
453 | void LoopControl::play() { | 453 | void LoopControl::play() { |
454 | qDebug("LC- play"); | 454 | // qDebug("LC- play"); |
455 | mediaPlayerState->setPosition( 0); //uglyhack | 455 | mediaPlayerState->setPosition( 0); //uglyhack |
diff --git a/core/multimedia/opieplayer/loopcontrol_threaded.cpp b/core/multimedia/opieplayer/loopcontrol_threaded.cpp index e99c97b..364e77b 100644 --- a/core/multimedia/opieplayer/loopcontrol_threaded.cpp +++ b/core/multimedia/opieplayer/loopcontrol_threaded.cpp | |||
@@ -194,3 +194,3 @@ void LoopControl::setPosition( long pos ) { | |||
194 | audioMutex->lock(); | 194 | audioMutex->lock(); |
195 | qDebug("setting position"); | 195 | //qDebug("setting position"); |
196 | playtime.restart(); | 196 | playtime.restart(); |
@@ -310,3 +310,3 @@ void LoopControl::startVideo() { | |||
310 | if ( current_frame > prev_frame + 1 ) { | 310 | if ( current_frame > prev_frame + 1 ) { |
311 | qDebug("skipped a frame"); | 311 | // qDebug("skipped a frame"); |
312 | mediaPlayerState->curDecoder()->videoSetFrame( current_frame, stream ); | 312 | mediaPlayerState->curDecoder()->videoSetFrame( current_frame, stream ); |
@@ -343,4 +343,4 @@ void LoopControl::startAudio() { | |||
343 | 343 | ||
344 | if ( currentSample != audioSampleCounter + 1 ) | 344 | // if ( currentSample != audioSampleCounter + 1 ) |
345 | qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); | 345 | // qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); |
346 | audioMutex->unlock(); | 346 | audioMutex->unlock(); |
@@ -373,3 +373,3 @@ void LoopControl::startAudio() { | |||
373 | if ( sampleWaitTime <= -2000 ) { | 373 | if ( sampleWaitTime <= -2000 ) { |
374 | qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 374 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
375 | mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 375 | mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
@@ -404,3 +404,3 @@ void LoopControl::startAudio() { | |||
404 | 404 | ||
405 | qDebug( "End of file" ); | 405 | // qDebug( "End of file" ); |
406 | 406 | ||
@@ -418,3 +418,3 @@ void LoopControl::killTimers() { | |||
418 | if ( pthread_join(video_tid,&thread_result) != 0 ) | 418 | if ( pthread_join(video_tid,&thread_result) != 0 ) |
419 | qDebug("thread join error 1"); | 419 | // qDebug("thread join error 1"); |
420 | pthread_attr_destroy(&video_attr); | 420 | pthread_attr_destroy(&video_attr); |
@@ -428,3 +428,3 @@ void LoopControl::killTimers() { | |||
428 | if ( pthread_join(audio_tid,&thread_result) != 0 ) | 428 | if ( pthread_join(audio_tid,&thread_result) != 0 ) |
429 | qDebug("thread join error 2"); | 429 | // qDebug("thread join error 2"); |
430 | pthread_attr_destroy(&audio_attr); | 430 | pthread_attr_destroy(&audio_attr); |
@@ -515,3 +515,3 @@ bool LoopControl::init( const QString& filename ) { | |||
515 | 515 | ||
516 | qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); | 516 | // qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); |
517 | 517 | ||
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index 4f3823a..753b2e3 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp | |||
@@ -82,3 +82,3 @@ void MediaPlayer::play() { | |||
82 | void MediaPlayer::setPlaying( bool play ) { | 82 | void MediaPlayer::setPlaying( bool play ) { |
83 | qDebug("MediaPlayer setPlaying"); | 83 | // qDebug("MediaPlayer setPlaying %d", play); |
84 | if ( !play ) { | 84 | if ( !play ) { |
@@ -93,3 +93,3 @@ void MediaPlayer::setPlaying( bool play ) { | |||
93 | } | 93 | } |
94 | qDebug("about to ctrash"); | 94 | // qDebug("about to ctrash"); |
95 | const DocLnk *playListCurrent = playList->current(); | 95 | const DocLnk *playListCurrent = playList->current(); |
@@ -258,3 +258,3 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | |||
258 | case Key_F12: //home | 258 | case Key_F12: //home |
259 | qDebug("Blank here"); | 259 | // qDebug("Blank here"); |
260 | break; | 260 | break; |
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp index cf166d6..6823076 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.cpp +++ b/core/multimedia/opieplayer/mediaplayerstate.cpp | |||
@@ -129,3 +129,3 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { | |||
129 | void MediaPlayerState::loadPlugins() { | 129 | void MediaPlayerState::loadPlugins() { |
130 | qDebug("load plugins"); | 130 | // qDebug("load plugins"); |
131 | #ifndef QT_NO_COMPONENT | 131 | #ifndef QT_NO_COMPONENT |
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp index 3541e5f..8b92a8c 100644 --- a/core/multimedia/opieplayer/om3u.cpp +++ b/core/multimedia/opieplayer/om3u.cpp | |||
@@ -72,3 +72,3 @@ void Om3u::readM3u() { | |||
72 | s=t.readLine(); | 72 | s=t.readLine(); |
73 | qDebug(s); | 73 | // qDebug(s); |
74 | if( s.find( "#", 0, TRUE) == -1 ) { | 74 | if( s.find( "#", 0, TRUE) == -1 ) { |
@@ -137,3 +137,3 @@ void Om3u::write() { //writes list to m3u file | |||
137 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 137 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
138 | qDebug(*it); | 138 | // qDebug(*it); |
139 | list += *it+"\n"; | 139 | list += *it+"\n"; |
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index 67187f8..94567f2 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp | |||
@@ -196,3 +196,3 @@ void PlayListSelection::writeCurrent( Config& cfg ) { | |||
196 | cfg.writeEntry("current", item->text(0) ); | 196 | cfg.writeEntry("current", item->text(0) ); |
197 | qDebug(item->text(0)); | 197 | // qDebug(item->text(0)); |
198 | 198 | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 7ea95ab..1fc7dd8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -309,3 +309,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
309 | LTab = new QWidget( tabWidget, "LTab" ); | 309 | LTab = new QWidget( tabWidget, "LTab" ); |
310 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy | 310 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE); |
311 | 311 | ||
@@ -315,3 +315,2 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
315 | layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 315 | layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
316 | // playLists->setMinimumSize(233,260); | ||
317 | 316 | ||
@@ -360,8 +359,8 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
360 | readConfig( cfg ); | 359 | readConfig( cfg ); |
361 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); | 360 | |
362 | loadList(DocLnk( currentPlaylist)); | 361 | currentPlayList = cfg.readEntry("CurrentPlaylist","default"); |
363 | setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlaylist))); | 362 | loadList(DocLnk( currentPlayList)); |
363 | setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlayList))); | ||
364 | 364 | ||
365 | initializeStates(); | 365 | initializeStates(); |
366 | // audioUI->setFocus(); | ||
367 | } | 366 | } |
@@ -423,11 +422,12 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
423 | // of disk space, but check it anyway. | 422 | // of disk space, but check it anyway. |
424 | if ( !lnk->writeLink() ) { | 423 | // if ( !lnk->writeLink() ) { |
425 | QMessageBox::critical( 0, tr("Out of space"), | 424 | // QMessageBox::critical( 0, tr("Out of space"), |
426 | tr( "There was a problem saving " | 425 | // tr( "There was a problem saving " |
427 | "the playlist.\n" | 426 | // "the playlist.\n" |
428 | "Your playlist " | 427 | // "Your playlist " |
429 | "may be missing some entries\n" | 428 | // "may be missing some entries\n" |
430 | "the next time you start it." ) | 429 | // "the next time you start it." ) |
431 | ); | 430 | // ); |
432 | } | 431 | // } |
432 | |||
433 | } | 433 | } |
@@ -449,2 +449,3 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { | |||
449 | mediaPlayerState->setPlaying( true); | 449 | mediaPlayerState->setPlaying( true); |
450 | |||
450 | } | 451 | } |
@@ -455,2 +456,7 @@ void PlayListWidget::clearList() { | |||
455 | d->selectedFiles->removeSelected(); | 456 | d->selectedFiles->removeSelected(); |
457 | Config cfg( "OpiePlayer" ); | ||
458 | cfg.setGroup("PlayList"); | ||
459 | cfg.writeEntry("CurrentPlaylist",""); | ||
460 | currentPlayList=""; | ||
461 | |||
456 | } | 462 | } |
@@ -499,6 +505,3 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
499 | d->setDocumentUsed = TRUE; | 505 | d->setDocumentUsed = TRUE; |
500 | d->selectedFiles->setSelected(d->selectedFiles->firstChild(),true ); | 506 | setDocumentEx(fileref); |
501 | mediaPlayerState->setPlaying( FALSE ); | ||
502 | qApp->processEvents(); | ||
503 | mediaPlayerState->setPlaying( TRUE ); | ||
504 | } | 507 | } |
@@ -506,3 +509,5 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
506 | void PlayListWidget::setDocumentEx(const QString& fileref) { | 509 | void PlayListWidget::setDocumentEx(const QString& fileref) { |
507 | 510 | qDebug("opieplayer receive "+fileref); | |
511 | clearList(); | ||
512 | DocLnk lnk; | ||
508 | QFileInfo fileInfo(fileref); | 513 | QFileInfo fileInfo(fileref); |
@@ -513,3 +518,3 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
513 | } | 518 | } |
514 | qDebug("setDocument "+fileref); | 519 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref); |
515 | QString extension = fileInfo.extension(false); | 520 | QString extension = fileInfo.extension(false); |
@@ -523,5 +528,5 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
523 | clearList(); | 528 | clearList(); |
524 | DocLnk lnk; | ||
525 | lnk.setName( fileInfo.baseName() ); //sets name | 529 | lnk.setName( fileInfo.baseName() ); //sets name |
526 | lnk.setFile( fileref ); //sets file name | 530 | lnk.setFile( fileref ); //sets file name |
531 | lnk.setIcon("Sound"); | ||
527 | //addToSelection( lnk ); | 532 | //addToSelection( lnk ); |
@@ -531,9 +536,18 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
531 | } else { | 536 | } else { |
532 | clearList(); | 537 | if( fileref.find(".desktop",0,TRUE) != -1) { |
533 | DocLnk lnk; | 538 | lnk = DocLnk(fileref); |
539 | } else { | ||
534 | lnk.setName( fileInfo.baseName() ); //sets name | 540 | lnk.setName( fileInfo.baseName() ); //sets name |
535 | lnk.setFile( fileref ); //sets file name | 541 | lnk.setFile( fileref ); //sets file name |
542 | lnk.setIcon("Sound"); | ||
543 | } | ||
544 | |||
536 | addToSelection( lnk ); | 545 | addToSelection( lnk ); |
537 | // addToSelection( DocLnk( fileref ) ); | 546 | // addToSelection( DocLnk( fileref ) ); |
547 | lnk.removeLinkFile(); | ||
548 | // qApp->processEvents(); | ||
549 | } | ||
550 | setCaption(tr("OpiePlayer")); | ||
538 | d->setDocumentUsed = TRUE; | 551 | d->setDocumentUsed = TRUE; |
552 | d->selectedFiles->setSelected(d->selectedFiles->firstChild(),true ); | ||
539 | mediaPlayerState->setPlaying( FALSE ); | 553 | mediaPlayerState->setPlaying( FALSE ); |
@@ -541,5 +555,3 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
541 | mediaPlayerState->setPlaying( TRUE ); | 555 | mediaPlayerState->setPlaying( TRUE ); |
542 | // qApp->processEvents(); | 556 | |
543 | setCaption(tr("OpiePlayer")); | ||
544 | } | ||
545 | } | 557 | } |
@@ -548,4 +560,3 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { | |||
548 | void PlayListWidget::setActiveWindow() { | 560 | void PlayListWidget::setActiveWindow() { |
549 | qDebug("SETTING active window"); | 561 | // qDebug("SETTING active window"); |
550 | |||
551 | // When we get raised we need to ensure that it switches views | 562 | // When we get raised we need to ensure that it switches views |
@@ -563,18 +574,2 @@ void PlayListWidget::useSelectedDocument() { | |||
563 | const DocLnk *PlayListWidget::current() { // this is fugly | 574 | const DocLnk *PlayListWidget::current() { // this is fugly |
564 | |||
565 | // if( fromSetDocument) { | ||
566 | // qDebug("from setDoc"); | ||
567 | // DocLnkSet files; | ||
568 | // Global::findDocuments(&files, "video/*;audio/*"); | ||
569 | // QListIterator<DocLnk> dit( files.children() ); | ||
570 | // for ( ; dit.current(); ++dit ) { | ||
571 | // if(dit.current()->linkFile() == setDocFileRef) { | ||
572 | // qDebug(setDocFileRef); | ||
573 | // return dit; | ||
574 | // } | ||
575 | // } | ||
576 | // } else | ||
577 | |||
578 | qDebug("current"); | ||
579 | |||
580 | switch (tabWidget->currentPageIndex()) { | 575 | switch (tabWidget->currentPageIndex()) { |
@@ -582,3 +577,3 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
582 | { | 577 | { |
583 | qDebug("playlist"); | 578 | // qDebug("playlist"); |
584 | if ( mediaPlayerState->playlist() ) { | 579 | if ( mediaPlayerState->playlist() ) { |
@@ -595,3 +590,3 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
595 | { | 590 | { |
596 | qDebug("audioView"); | 591 | // qDebug("audioView"); |
597 | QListIterator<DocLnk> dit( files.children() ); | 592 | QListIterator<DocLnk> dit( files.children() ); |
@@ -599,3 +594,2 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
599 | if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { | 594 | if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { |
600 | qDebug("here"); | ||
601 | insanityBool=TRUE; | 595 | insanityBool=TRUE; |
@@ -608,3 +602,2 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
608 | { | 602 | { |
609 | qDebug("videoView"); | ||
610 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 603 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
@@ -719,3 +712,2 @@ void PlayListWidget::setView( char view ) { | |||
719 | void PlayListWidget::addSelected() { | 712 | void PlayListWidget::addSelected() { |
720 | qDebug("addSelected"); | ||
721 | DocLnk lnk; | 713 | DocLnk lnk; |
@@ -769,3 +761,2 @@ void PlayListWidget::playIt( QListViewItem *) { | |||
769 | // mediaPlayerState->curPosition =0; | 761 | // mediaPlayerState->curPosition =0; |
770 | qDebug("playIt"); | ||
771 | // mediaPlayerState->setPlaying(FALSE); | 762 | // mediaPlayerState->setPlaying(FALSE); |
@@ -843,3 +834,2 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
843 | void PlayListWidget::btnPlay(bool b) { | 834 | void PlayListWidget::btnPlay(bool b) { |
844 | qDebug("<<<<<<<<<<<<<<<BtnPlay %d", b); | ||
845 | // mediaPlayerState->setPlaying(b); | 835 | // mediaPlayerState->setPlaying(b); |
@@ -848,3 +838,2 @@ void PlayListWidget::btnPlay(bool b) { | |||
848 | { | 838 | { |
849 | qDebug("1"); | ||
850 | // if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 | 839 | // if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 |
@@ -861,3 +850,2 @@ void PlayListWidget::btnPlay(bool b) { | |||
861 | { | 850 | { |
862 | qDebug("2"); | ||
863 | // d->selectedFiles->unSelect(); | 851 | // d->selectedFiles->unSelect(); |
@@ -873,3 +861,2 @@ void PlayListWidget::btnPlay(bool b) { | |||
873 | { | 861 | { |
874 | qDebug("3"); | ||
875 | 862 | ||
@@ -924,3 +911,2 @@ void PlayListWidget::playSelected() | |||
924 | { | 911 | { |
925 | qDebug("playSelected"); | ||
926 | btnPlay( true); | 912 | btnPlay( true); |
@@ -951,3 +937,3 @@ void PlayListWidget::listDelete() { | |||
951 | cfg.setGroup("PlayList"); | 937 | cfg.setGroup("PlayList"); |
952 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 938 | currentPlayList = cfg.readEntry("CurrentPlaylist",""); |
953 | QString file; | 939 | QString file; |
@@ -1075,3 +1061,2 @@ void PlayListWidget::populateVideoView() { | |||
1075 | void PlayListWidget::openFile() { | 1061 | void PlayListWidget::openFile() { |
1076 | qDebug("<<<<<<<<<OPEN File"); | ||
1077 | QString filename, name; | 1062 | QString filename, name; |
@@ -1082,4 +1067,3 @@ void PlayListWidget::openFile() { | |||
1082 | filename = fileDlg->text(); | 1067 | filename = fileDlg->text(); |
1083 | qDebug( "Selected filename is " + filename ); | 1068 | // qDebug( "Selected filename is " + filename ); |
1084 | // Om3u *m3uList; | ||
1085 | DocLnk lnk; | 1069 | DocLnk lnk; |
@@ -1093,3 +1077,2 @@ void PlayListWidget::openFile() { | |||
1093 | 1077 | ||
1094 | // m3uFile = filename.left( filename.find( ":",8,TRUE)); | ||
1095 | m3uFile = filename; | 1078 | m3uFile = filename; |
@@ -1099,11 +1082,3 @@ void PlayListWidget::openFile() { | |||
1099 | filename = m3uFile; | 1082 | filename = m3uFile; |
1100 | // qDebug("1 "+m3uFile); | 1083 | = } |
1101 | // } else if(filename.left(4) == "http"){ | ||
1102 | // m3uFile=filename; | ||
1103 | // m3uFile = m3uFile.right( m3uFile.length() - 7); | ||
1104 | // qDebug("2 "+m3uFile); | ||
1105 | // } else{ | ||
1106 | // m3uFile=filename; | ||
1107 | // qDebug("3 "+m3uFile); | ||
1108 | } | ||
1109 | lnk.setName( m3uFile ); //sets name | 1084 | lnk.setName( m3uFile ); //sets name |
@@ -1123,2 +1098,3 @@ void PlayListWidget::openFile() { | |||
1123 | d->selectedFiles->addToSelection( lnk); | 1098 | d->selectedFiles->addToSelection( lnk); |
1099 | lnk.removeLinkFile(); | ||
1124 | writeCurrentM3u(); | 1100 | writeCurrentM3u(); |
@@ -1136,3 +1112,3 @@ reads m3u and shows files/urls to playlist widget */ | |||
1136 | void PlayListWidget::readm3u( const QString &filename ) { | 1112 | void PlayListWidget::readm3u( const QString &filename ) { |
1137 | qDebug( "read m3u filename " + filename ); | 1113 | // qDebug( "read m3u filename " + filename ); |
1138 | 1114 | ||
@@ -1193,3 +1169,3 @@ void PlayListWidget::readPls( const QString &filename ) { | |||
1193 | 1169 | ||
1194 | qDebug( "pls filename is " + filename ); | 1170 | // qDebug( "pls filename is " + filename ); |
1195 | Om3u *m3uList; | 1171 | Om3u *m3uList; |
@@ -1236,8 +1212,8 @@ void PlayListWidget::readPls( const QString &filename ) { | |||
1236 | void PlayListWidget::writeCurrentM3u() { | 1212 | void PlayListWidget::writeCurrentM3u() { |
1237 | qDebug("writing to current m3u"); | 1213 | // qDebug("writing to current m3u"); |
1238 | Config cfg( "OpiePlayer" ); | 1214 | Config cfg( "OpiePlayer" ); |
1239 | cfg.setGroup("PlayList"); | 1215 | cfg.setGroup("PlayList"); |
1240 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 1216 | currentPlayList = cfg.readEntry("CurrentPlaylist",""); |
1241 | Om3u *m3uList; | 1217 | Om3u *m3uList; |
1242 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 1218 | m3uList = new Om3u( currentPlayList, IO_ReadWrite | IO_Truncate ); |
1243 | 1219 | ||
@@ -1245,3 +1221,3 @@ void PlayListWidget::writeCurrentM3u() { | |||
1245 | do { | 1221 | do { |
1246 | qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); | 1222 | // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); |
1247 | m3uList->add( d->selectedFiles->current()->file() ); | 1223 | m3uList->add( d->selectedFiles->current()->file() ); |
@@ -1249,3 +1225,3 @@ void PlayListWidget::writeCurrentM3u() { | |||
1249 | while ( d->selectedFiles->next() ); | 1225 | while ( d->selectedFiles->next() ); |
1250 | qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 1226 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); |
1251 | m3uList->write(); | 1227 | m3uList->write(); |
@@ -1306,3 +1282,3 @@ void PlayListWidget::writem3u() { | |||
1306 | if(!lnk.writeLink()) { | 1282 | if(!lnk.writeLink()) { |
1307 | qDebug("Writing doclink did not work"); | 1283 | // qDebug("Writing doclink did not work"); |
1308 | } | 1284 | } |
@@ -1336,3 +1312,2 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1336 | case Key_Q: //add to playlist | 1312 | case Key_Q: //add to playlist |
1337 | qDebug("Add"); | ||
1338 | addSelected(); | 1313 | addSelected(); |
@@ -1347,3 +1322,2 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1347 | case Key_Space: | 1322 | case Key_Space: |
1348 | qDebug("Play"); | ||
1349 | // playSelected(); puh | 1323 | // playSelected(); puh |
@@ -1400,3 +1374,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) | |||
1400 | void PlayListWidget::doBlank() { | 1374 | void PlayListWidget::doBlank() { |
1401 | qDebug("do blanking"); | 1375 | // qDebug("do blanking"); |
1402 | fd=open("/dev/fb0",O_RDWR); | 1376 | fd=open("/dev/fb0",O_RDWR); |
@@ -1412,3 +1386,3 @@ void PlayListWidget::doUnblank() { | |||
1412 | // fd=open("/dev/fb0",O_RDWR); | 1386 | // fd=open("/dev/fb0",O_RDWR); |
1413 | qDebug("do unblanking"); | 1387 | // qDebug("do unblanking"); |
1414 | if (fd != -1) { | 1388 | if (fd != -1) { |
@@ -1463,3 +1437,3 @@ void PlayListWidget::skinsMenuActivated( int item ) { | |||
1463 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1437 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1464 | qDebug("qcop message "+msg ); | 1438 | // qDebug("qcop message "+msg ); |
1465 | QDataStream stream ( data, IO_ReadOnly ); | 1439 | QDataStream stream ( data, IO_ReadOnly ); |
@@ -1500,3 +1474,2 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | |||
1500 | stream >> file; | 1474 | stream >> file; |
1501 | |||
1502 | } else if ( msg == "setDocument(QString)" ) { //loop or not loop | 1475 | } else if ( msg == "setDocument(QString)" ) { //loop or not loop |
@@ -1504,3 +1477,2 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | |||
1504 | } | 1477 | } |
1505 | |||
1506 | } | 1478 | } |
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index 48104ca..02c8568 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp | |||
@@ -88,3 +88,3 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
88 | 88 | ||
89 | qDebug("skin path " + skinPath); | 89 | // qDebug("skin path " + skinPath); |
90 | 90 | ||
@@ -103,3 +103,3 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
103 | "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); | 103 | "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); |
104 | qDebug("loading "+filename); | 104 | // qDebug("loading "+filename); |
105 | masks[i] = new QBitmap( filename ); | 105 | masks[i] = new QBitmap( filename ); |
@@ -121,3 +121,3 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
121 | } | 121 | } |
122 | qDebug("finished loading first pics"); | 122 | // qDebug("finished loading first pics"); |
123 | for ( int i = 0; i < 7; i++ ) | 123 | for ( int i = 0; i < 7; i++ ) |
@@ -353,3 +353,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
353 | case VideoPlay: { | 353 | case VideoPlay: { |
354 | qDebug("play"); | 354 | // qDebug("play"); |
355 | if( !mediaPlayerState->playing()) { | 355 | if( !mediaPlayerState->playing()) { |
@@ -361,3 +361,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
361 | if( mediaPlayerState->isPaused ) { | 361 | if( mediaPlayerState->isPaused ) { |
362 | qDebug("isPaused"); | 362 | // qDebug("isPaused"); |
363 | setToggleButton( i, FALSE ); | 363 | setToggleButton( i, FALSE ); |
@@ -366,3 +366,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
366 | } else if( !mediaPlayerState->isPaused ) { | 366 | } else if( !mediaPlayerState->isPaused ) { |
367 | qDebug("is not paused"); | 367 | // qDebug("is not paused"); |
368 | setToggleButton( i, TRUE ); | 368 | setToggleButton( i, TRUE ); |
@@ -375,3 +375,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
375 | 375 | ||
376 | case VideoStop: qDebug("stop"); mediaPlayerState->setPlaying( FALSE ); setToggleButton( i+1, true); setToggleButton( i, true ); return; | 376 | case VideoStop: mediaPlayerState->setPlaying( FALSE ); setToggleButton( i+1, true); setToggleButton( i, true ); return; |
377 | case VideoNext: mediaPlayerState->setNext(); return; | 377 | case VideoNext: mediaPlayerState->setNext(); return; |