summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp46
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h4
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
@@ -142,6 +142,9 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
videoScan = FALSE;
// menuTimer = new QTimer( this ,"menu timer"),
// 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&)) );
setBackgroundMode( PaletteButton );
@@ -1420,3 +1423,46 @@ void PlayListWidget::skinsMenuActivated( int item ) {
cfg.setGroup("Options");
cfg.writeEntry("Skin", skinsMenu->text( 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
@@ -26,6 +26,8 @@
#include <qpe/fileselector.h>
#include <qpushbutton.h>
+#include <qpe/qcopenvelope_qws.h>
+
#include "om3u.h"
/* #include <qtimer.h> */
@@ -68,6 +70,7 @@ public slots:
/* void setFullScreen(); */
/* void setScaled(); */
protected:
+ QCopChannel * channel;
QPopupMenu *skinsMenu;
/* void contentsMousePressEvent( QMouseEvent * e ); */
/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
@@ -90,6 +93,7 @@ private:
void populateVideoView();
private slots:
+ void qcopReceive(const QCString&, const QByteArray&);
void populateSkinsMenu();
void skinsMenuActivated(int);
void writem3u();