summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp39
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h1
2 files changed, 26 insertions, 14 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index c6de5e6..5d0f6de 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -364,4 +364,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
initializeStates();
+ // audioUI->setFocus();
}
@@ -371,7 +372,7 @@ PlayListWidget::~PlayListWidget() {
writeConfig( cfg );
- if ( d->current )
- delete d->current;
- delete d;
+ if ( d->current )
+ delete d->current;
+ if(d) delete d;
}
@@ -495,6 +496,13 @@ void PlayListWidget::addAllVideoToList() {
void PlayListWidget::setDocument(const QString& fileref) {
- qDebug(fileref);
- fromSetDocument = TRUE;
+ fromSetDocument = true;
+ d->setDocumentUsed = TRUE;
+ mediaPlayerState->setPlaying( FALSE );
+ qApp->processEvents();
+ mediaPlayerState->setPlaying( TRUE );
+}
+
+void PlayListWidget::setDocumentEx(const QString& fileref) {
+
QFileInfo fileInfo(fileref);
if ( !fileInfo.exists() ) {
@@ -503,5 +511,5 @@ void PlayListWidget::setDocument(const QString& fileref) {
return;
}
-// qDebug("setDocument "+fileref);
+ qDebug("setDocument "+fileref);
QString extension = fileInfo.extension(false);
if( extension.find( "m3u", 0, false) != -1) { //is m3u
@@ -531,5 +539,5 @@ void PlayListWidget::setDocument(const QString& fileref) {
qApp->processEvents();
mediaPlayerState->setPlaying( TRUE );
- qApp->processEvents();
+ // qApp->processEvents();
setCaption(tr("OpiePlayer"));
}
@@ -760,5 +768,5 @@ void PlayListWidget::playIt( QListViewItem *) {
// mediaPlayerState->curPosition =0;
qDebug("playIt");
- mediaPlayerState->setPlaying(FALSE);
+ // mediaPlayerState->setPlaying(FALSE);
mediaPlayerState->setPlaying(TRUE);
d->selectedFiles->unSelect();
@@ -783,5 +791,6 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
d->selectedFiles->addToSelection( lnk);
- writeCurrentM3u();
+ if(tabWidget->currentPageIndex() == 0)
+ writeCurrentM3u();
// tabWidget->setCurrentPage(0);
@@ -832,5 +841,5 @@ void PlayListWidget::tabChanged(QWidget *) {
void PlayListWidget::btnPlay(bool b) {
- qDebug("<<<<<<<<<<<<<<<BtnPlay");
+ qDebug("<<<<<<<<<<<<<<<BtnPlay %d", b);
// mediaPlayerState->setPlaying(b);
switch ( tabWidget->currentPageIndex()) {
@@ -853,5 +862,5 @@ void PlayListWidget::btnPlay(bool b) {
// d->selectedFiles->unSelect();
addToSelection( audioView->currentItem() );
- mediaPlayerState->setPlaying(true);
+ mediaPlayerState->setPlaying( b);
d->selectedFiles->removeSelected( );
d->selectedFiles->unSelect();
@@ -865,5 +874,5 @@ void PlayListWidget::btnPlay(bool b) {
addToSelection( videoView->currentItem() );
- mediaPlayerState->setPlaying(true);
+ mediaPlayerState->setPlaying( b);
// qApp->processEvents();
d->selectedFiles->removeSelected( );
@@ -1460,5 +1469,5 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
} else if ( msg == "togglePause()" ) {
mediaPlayerState->togglePaused();
- } else if ( msg == "next()" ) { //select next in list
+ } else if ( msg == "next()" ) { //select next in lis
mediaPlayerState->setNext();
} else if ( msg == "prev()" ) { //select previous in list
@@ -1477,5 +1486,5 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
QString file;
stream >> file;
- setDocument( (const QString &) file);
+ setDocumentEx( (const QString &) file);
} else if ( msg == "add(QString)" ) { //add to playlist
QString file;
@@ -1490,4 +1499,6 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
stream >> file;
+ } else if ( msg == "setDocument(QString)" ) { //loop or not loop
+ QCopEnvelope h("QPE/Application/opieplayer", "raise()");
}
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h
index e66bcb9..0c0e367 100644
--- a/core/multimedia/opieplayer/playlistwidget.h
+++ b/core/multimedia/opieplayer/playlistwidget.h
@@ -103,4 +103,5 @@ private slots:
void openFile();
void setDocument( const QString& fileref );
+ void setDocumentEx( const QString& fileref );
void addToSelection( const DocLnk& ); // Add a media file to the playlist
void addToSelection( QListViewItem* ); // Add a media file to the playlist