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) (side-by-side diff)
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) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp13
-rw-r--r--core/multimedia/opieplayer/wavplugin/wavplugin.cpp2
2 files changed, 6 insertions, 9 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() {
Global::findDocuments(&files, "video/*");
QListIterator<DocLnk> dit( files.children() );
for ( ; dit.current(); ++dit )
d->selectedFiles->addToSelection( **dit );
}
void PlayListWidget::setDocument(const QString& fileref) {
if ( fileref.isNull() ) {
QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) );
return;
}
- if ( mediaPlayerState->playlist() )
- addToSelection( DocLnk( fileref ) );
- else {
- d->setDocumentUsed = TRUE;
- if ( d->current )
- delete d->current;
- d->current = new DocLnk( fileref );
- }
+ addToSelection( DocLnk( fileref ) );
+ d->setDocumentUsed = TRUE;
+ qApp->processEvents();
mediaPlayerState->setPlaying( FALSE );
+ qApp->processEvents();
mediaPlayerState->setPlaying( TRUE );
+ d->selectedFiles->removeSelected( );
}
void PlayListWidget::setActiveWindow() {
// When we get raised we need to ensure that it switches views
char origView = mediaPlayerState->view();
mediaPlayerState->setView( 'l' ); // invalidate
mediaPlayerState->setView( origView ); // now switch back
}
void 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:
WavPluginData() {
max = out = sound_buffer_size;
wavedata_remaining = 0;
samples_due = 0;
samples = -1;
}
// expands out samples to the frequency of 44kHz //not any more
bool add( short *output, long count, long& done, bool stereo )
{
done = 0;
- qApp->processEvents();
if ( input == 0 ) {
qDebug("no input");
return FALSE;
}
while ( count ) {
int l,r;
if ( getSample(l, r) == FALSE ) {
qDebug("didn't get sample");
return FALSE;
}
@@ -233,24 +232,25 @@ bool WavPlugin::open( const QString& path ) {
d->wavedata_remaining = 0;
d->samples_due = 0;
d->input = new QFile( path );
if ( d->input->open(IO_ReadOnly) == FALSE ) {
qDebug("couldn't open file");
delete d->input;
d->input = 0;
return FALSE;
}
d->initialise();
+ qApp->processEvents();
return TRUE;
}
bool WavPlugin::close() {
// qDebug( "WavPlugin::close" );
d->input->close();
delete d->input;
d->input = 0;
return TRUE;