-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 46 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 4 |
2 files changed, 50 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index a0bf4db..5e1be2f 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -144,2 +144,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); + channel = new QCopChannel( "QPE/Application/opieplayer", this ); + connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), + this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); @@ -1422 +1425,44 @@ void PlayListWidget::skinsMenuActivated( int item ) { } + +void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { + qDebug("qcop message "+msg ); + QDataStream stream ( data, IO_ReadOnly ); + if ( msg == "play()" ) { //plays current selection + btnPlay( true); + } else if ( msg == "stop()" ) { + mediaPlayerState->setPlaying( false); + } else if ( msg == "togglePause()" ) { + mediaPlayerState->togglePaused(); + } else if ( msg == "next()" ) { //select next in list + mediaPlayerState->setNext(); + } else if ( msg == "prev()" ) { //select previous in list + mediaPlayerState->setPrev(); + } else if ( msg == "toggleLooping()" ) { //loop or not loop + mediaPlayerState->toggleLooping(); + } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled + mediaPlayerState->toggleShuffled(); + } else if ( msg == "volUp()" ) { //volume more +// emit moreClicked(); +// emit moreReleased(); + } else if ( msg == "volDown()" ) { //volume less +// emit lessClicked(); +// emit lessReleased(); + } else if ( msg == "play(QString)" ) { //play this now + QString file; + stream >> file; + setDocument( (const QString &) file); + } else if ( msg == "add(QString)" ) { //add to playlist + QString file; + stream >> file; + QFileInfo fileInfo(file); + DocLnk lnk; + lnk.setName( fileInfo.baseName() ); //sets name + lnk.setFile( file ); //sets file name + addToSelection( lnk ); + } else if ( msg == "rem(QString)" ) { //remove from playlist + QString file; + stream >> file; + + } + +} diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index 1118b76..e66bcb9 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h @@ -28,2 +28,4 @@ +#include <qpe/qcopenvelope_qws.h> + #include "om3u.h" @@ -70,2 +72,3 @@ public slots: protected: + QCopChannel * channel; QPopupMenu *skinsMenu; @@ -92,2 +95,3 @@ private slots: + void qcopReceive(const QCString&, const QByteArray&); void populateSkinsMenu(); |