summaryrefslogtreecommitdiff
path: root/core
authorbipolar <bipolar>2002-03-05 00:42:40 (UTC)
committer bipolar <bipolar>2002-03-05 00:42:40 (UTC)
commitdbc93b5de1b20489a05ce61e42874bf944165223 (patch) (unidiff)
tree97faa0273f33a873d2eaa266a2f1e2ad2c2b3a96 /core
parent25be6fb98284dfa0c549d30db5b64c09798ee36d (diff)
downloadopie-dbc93b5de1b20489a05ce61e42874bf944165223.zip
opie-dbc93b5de1b20489a05ce61e42874bf944165223.tar.gz
opie-dbc93b5de1b20489a05ce61e42874bf944165223.tar.bz2
committed by ljp: fixed a problem opening files from docs tab being added to playlist.
fixed (hopefully) problem with player redraw when playing wavfiles
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp9
-rw-r--r--core/multimedia/opieplayer/wavplugin/wavplugin.cpp2
2 files changed, 4 insertions, 7 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 1a0c7ca..a6202bc 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -409,34 +409,31 @@ void PlayListWidget::addAllVideoToList() {
409 Global::findDocuments(&files, "video/*"); 409 Global::findDocuments(&files, "video/*");
410 QListIterator<DocLnk> dit( files.children() ); 410 QListIterator<DocLnk> dit( files.children() );
411 for ( ; dit.current(); ++dit ) 411 for ( ; dit.current(); ++dit )
412 d->selectedFiles->addToSelection( **dit ); 412 d->selectedFiles->addToSelection( **dit );
413} 413}
414 414
415 415
416void PlayListWidget::setDocument(const QString& fileref) { 416void PlayListWidget::setDocument(const QString& fileref) {
417 if ( fileref.isNull() ) { 417 if ( fileref.isNull() ) {
418 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); 418 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) );
419 return; 419 return;
420 } 420 }
421 if ( mediaPlayerState->playlist() )
422 addToSelection( DocLnk( fileref ) ); 421 addToSelection( DocLnk( fileref ) );
423 else {
424 d->setDocumentUsed = TRUE; 422 d->setDocumentUsed = TRUE;
425 if ( d->current ) 423 qApp->processEvents();
426 delete d->current;
427 d->current = new DocLnk( fileref );
428 }
429 mediaPlayerState->setPlaying( FALSE ); 424 mediaPlayerState->setPlaying( FALSE );
425 qApp->processEvents();
430 mediaPlayerState->setPlaying( TRUE ); 426 mediaPlayerState->setPlaying( TRUE );
427 d->selectedFiles->removeSelected( );
431} 428}
432 429
433 430
434void PlayListWidget::setActiveWindow() { 431void PlayListWidget::setActiveWindow() {
435 // When we get raised we need to ensure that it switches views 432 // When we get raised we need to ensure that it switches views
436 char origView = mediaPlayerState->view(); 433 char origView = mediaPlayerState->view();
437 mediaPlayerState->setView( 'l' ); // invalidate 434 mediaPlayerState->setView( 'l' ); // invalidate
438 mediaPlayerState->setView( origView ); // now switch back 435 mediaPlayerState->setView( origView ); // now switch back
439} 436}
440 437
441 438
442void PlayListWidget::useSelectedDocument() { 439void PlayListWidget::useSelectedDocument() {
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
index 4a0da16..4e82900 100644
--- a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
+++ b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
@@ -65,25 +65,24 @@ public:
65 65
66 WavPluginData() { 66 WavPluginData() {
67 max = out = sound_buffer_size; 67 max = out = sound_buffer_size;
68 wavedata_remaining = 0; 68 wavedata_remaining = 0;
69 samples_due = 0; 69 samples_due = 0;
70 samples = -1; 70 samples = -1;
71 } 71 }
72 72
73 // expands out samples to the frequency of 44kHz //not any more 73 // expands out samples to the frequency of 44kHz //not any more
74 bool add( short *output, long count, long& done, bool stereo ) 74 bool add( short *output, long count, long& done, bool stereo )
75 { 75 {
76 done = 0; 76 done = 0;
77 qApp->processEvents();
78 77
79 if ( input == 0 ) { 78 if ( input == 0 ) {
80 qDebug("no input"); 79 qDebug("no input");
81 return FALSE; 80 return FALSE;
82 } 81 }
83 82
84 while ( count ) { 83 while ( count ) {
85 int l,r; 84 int l,r;
86 if ( getSample(l, r) == FALSE ) { 85 if ( getSample(l, r) == FALSE ) {
87 qDebug("didn't get sample"); 86 qDebug("didn't get sample");
88 return FALSE; 87 return FALSE;
89 } 88 }
@@ -233,24 +232,25 @@ bool WavPlugin::open( const QString& path ) {
233 d->wavedata_remaining = 0; 232 d->wavedata_remaining = 0;
234 d->samples_due = 0; 233 d->samples_due = 0;
235 234
236 d->input = new QFile( path ); 235 d->input = new QFile( path );
237 if ( d->input->open(IO_ReadOnly) == FALSE ) { 236 if ( d->input->open(IO_ReadOnly) == FALSE ) {
238 qDebug("couldn't open file"); 237 qDebug("couldn't open file");
239 delete d->input; 238 delete d->input;
240 d->input = 0; 239 d->input = 0;
241 return FALSE; 240 return FALSE;
242 } 241 }
243 242
244 d->initialise(); 243 d->initialise();
244 qApp->processEvents();
245 245
246 return TRUE; 246 return TRUE;
247} 247}
248 248
249 249
250bool WavPlugin::close() { 250bool WavPlugin::close() {
251// qDebug( "WavPlugin::close" ); 251// qDebug( "WavPlugin::close" );
252 252
253 d->input->close(); 253 d->input->close();
254 delete d->input; 254 delete d->input;
255 d->input = 0; 255 d->input = 0;
256 return TRUE; 256 return TRUE;