author | llornkcor <llornkcor> | 2003-05-04 21:34:02 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-05-04 21:34:02 (UTC) |
commit | 2894d0b14c0b3efa3ce259214b5aa597a6abfed1 (patch) (side-by-side diff) | |
tree | 8dec50e12adb1b66eaf20e1caa4f384a43033073 /noncore/multimedia/opieplayer2/playlistwidget.cpp | |
parent | 7372d0271b19bc6ead8e796a949746ae45fe13fa (diff) | |
download | opie-2894d0b14c0b3efa3ce259214b5aa597a6abfed1.zip opie-2894d0b14c0b3efa3ce259214b5aa597a6abfed1.tar.gz opie-2894d0b14c0b3efa3ce259214b5aa597a6abfed1.tar.bz2 |
added a few convience qcop messages. see readme for more info. not totally finished yet
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 580460e..c91a565 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -148,6 +148,11 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par populateSkinsMenu(); initializeStates(); + channel = new QCopChannel( "QPE/Application/opieplayer2", this ); + connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), + this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); + + cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); loadList(DocLnk( currentPlaylist ) ); @@ -914,3 +919,47 @@ PlayListWidget::Entry PlayListWidget::currentEntry() const QString PlayListWidget::currentFileListPathName() const { return currentFileListView->currentItem()->text( 3 ); } + + +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; + + } + +} |