Summary: | Kbemusedsrv support for amarok | ||
---|---|---|---|
Product: | kde-bluetooth | Reporter: | cerebro84 |
Component: | kbluetoothd | Assignee: | Unassigned bugs mailing-list <unassigned-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | berk |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Script to control amaroK via bemused |
Description
cerebro84
2004-12-05 19:24:11 UTC
Created attachment 8564 [details]
Script to control amaroK via bemused
OK, as you can see I implemented it through a script... However, there are some commands I couldn't implement: - FADE: there isn't a dcop call to choose if stop has to be faded or not - PLST: I've found no way to get amaroK's playlist - PLEN: There's no way to know how long is a playlist. - INFO-repeat: There's no way to know if repeat is on or off - INFO-shuffle: as above - DINF-samplerate: same as above - DINF-channels: see above If this is for amaroK, why its product is kde-bluetooth then? Just because it was born as a feature request for kbemusedserver... Should I open another feature request under the name of amaroK? No, it a feature request for kdebluetooth, so it is at the right place already. I'll have a look at the script tonight and if it works I'll put it into the CVS. Thanks alot for the script btw :) Or maybe it's not even that complicated to add native support for amarok. It's both :) I think native support would be better, if it allowed to control the playlist too! CVS commit by mdiehl: Added a DCOP call to return the sample rate of the current track. CCBUG: 94476 M +1 -0 ChangeLog 1.423 M +5 -0 src/amarokcore/amarokdcophandler.cpp 1.49 M +1 -0 src/amarokcore/amarokdcophandler.h 1.31 M +1 -1 src/amarokcore/amarokdcopiface.h 1.29 --- kdeextragear-1/amarok/src/amarokcore/amarokdcophandler.cpp #1.48:1.49 @@ -170,4 +170,9 @@ namespace amaroK } + int DcopHandler::sampleRate() + { + return EngineController::instance()->bundle().sampleRate(); + } + // Ok, that should be enough, have fun :-) --- kdeextragear-1/amarok/src/amarokcore/amarokdcophandler.h #1.30:1.31 @@ -58,4 +58,5 @@ class DcopHandler : public QObject, virt virtual QString comment(); virtual QString bitrate(); + virtual int sampleRate(); virtual QString encodedURL(); virtual QString coverImage(); --- kdeextragear-1/amarok/src/amarokcore/amarokdcopiface.h #1.28:1.29 @@ -70,5 +70,5 @@ k_dcop: virtual QString comment() = 0; ///< Return the comment of the currently playing track. virtual QString bitrate() = 0; ///< Return the bitrate of the currently playing track (XX kbps). - + virtual int sampleRate() = 0; ///< Return the sample rate of the currently playing track. virtual QString encodedURL() = 0; ///< Return the encoded URL of the currently playing track. virtual QString coverImage() = 0; ///< Return the encoded URL of the current track's cover image --- kdeextragear-1/amarok/ChangeLog #1.422:1.423 @@ -5,4 +5,5 @@ VERSION 1.2-beta3: + ADD: DCOP call to return the sample rate. ADD: DCOP call to return the track number.(BR 94825) FIX: GStreamer-engine provides better scope synchronisation. CVS commit by mdiehl: Add randomModeStatus, repeatTrackStatus, and repeatPlaylistStatus DCOP calls. CCBUG: 94476 M +15 -0 amarokdcophandler.cpp 1.50 M +3 -0 amarokdcophandler.h 1.32 M +3 -0 amarokdcopiface.h 1.30 --- kdeextragear-1/amarok/src/amarokcore/amarokdcophandler.cpp #1.49:1.50 @@ -107,4 +107,19 @@ namespace amaroK } + bool DcopHandler::repeatTrackStatus() + { + return AmarokConfig::repeatTrack(); + } + + bool DcopHandler::repeatPlaylistStatus() + { + return AmarokConfig::repeatPlaylist(); + } + + bool DcopHandler::randomModeStatus() + { + return AmarokConfig::randomMode(); + } + // Now for the DCOP id3 output stuff --- kdeextragear-1/amarok/src/amarokcore/amarokdcophandler.h #1.31:1.32 @@ -63,4 +63,7 @@ class DcopHandler : public QObject, virt virtual bool isPlaying(); virtual int status(); + virtual bool repeatTrackStatus(); + virtual bool repeatPlaylistStatus(); + virtual bool randomModeStatus(); virtual void setVolume(int); virtual int getVolume(); --- kdeextragear-1/amarok/src/amarokcore/amarokdcopiface.h #1.29:1.30 @@ -55,4 +55,7 @@ k_dcop: virtual bool isPlaying() = 0; ///< DEPRECATED Return true if something is playing now. virtual int status() = 0; ///< Return playback status: 0 - stopped, 1 - paused, 2 - playing. < 0 - error + virtual bool repeatTrackStatus() = 0; ///< Return repeat track status. + virtual bool repeatPlaylistStatus() = 0; ///< Return repeat playlist status. + virtual bool randomModeStatus() = 0; ///< Return random mode status. /* Compatibility method (used by mediacontrol as well). DO NOT TOUCH! */ hi, i have written a patch to include amarok support into the kbemused-server. playlist functions doesnt work yet, but i´ll to this in the next few days. the patch can be found on my hp: http://sickpeople.wmc-allstars.com/law/files/kdebluetooth/kdebluetooth_amarok_patch_0.1.tar.bz2 patrick CVS commit by schaettgen: Added initial version of an amarokcontroller for bemused by Patrick Steiner Thanks for the patch :) CCBUGS:94476 A amarokcontroller.cpp 1.1 [UNKNOWN] A amarokcontroller.h 1.1 [UNKNOWN] M +2 -2 Makefile.am 1.12 M +3 -0 kbemusedsrv.cpp 1.23 --- kdeextragear-3/kdebluetooth/bemused/Makefile.am #1.11:1.12 @@ -5,5 +5,5 @@ # these are the headers for your project -noinst_HEADERS = kbemusedsrv.h controller.h xmmscontroller.h noatuncontroller.h scriptscontroller.h dcopcall.h kurltableitem.h dcopinterface.h +noinst_HEADERS = kbemusedsrv.h controller.h xmmscontroller.h noatuncontroller.h amarokcontroller.h scriptscontroller.h dcopcall.h kurltableitem.h dcopinterface.h # let automoc handle all of the meta source files (moc) @@ -21,5 +21,5 @@ # the application source, library search path, and link libraries -kbemusedsrv_SOURCES = main.cpp kbemusedsrv.cpp maindialogbase.ui controller.cpp xmmscontroller.cpp noatuncontroller.cpp scriptscontroller.cpp dcopcall.cpp dcopinterface.skel kurltableitem.cpp logdialogbase.ui +kbemusedsrv_SOURCES = main.cpp kbemusedsrv.cpp maindialogbase.ui controller.cpp xmmscontroller.cpp noatuncontroller.cpp amarokcontroller.cpp scriptscontroller.cpp dcopcall.cpp dcopinterface.skel kurltableitem.cpp logdialogbase.ui kbemusedsrv_LDFLAGS = $(KDE_RPATH) -lkio $(LIB_KDEUI) $(XMMS_LIBS) $(BLUETOOTH_LIBS) $(all_libraries) kbemusedsrv_LDADD = ../libkbluetooth/libkbluetooth.la --- kdeextragear-3/kdebluetooth/bemused/kbemusedsrv.cpp #1.22:1.23 @@ -49,4 +49,5 @@ #include "xmmscontroller.h" #include "noatuncontroller.h" +#include "amarokcontroller.h" #include "scriptscontroller.h" #include "kurltableitem.h" @@ -130,4 +131,6 @@ MainDialog::MainDialog(int s, QString ad } // Keep alphabetical for the config screens + // edit by Patrick Steiner + controllers.append(new AmarokController(this)); controllers.append(new NoatunController(this)); controllers.append(new ScriptsController(this)); make[5]: Entering directory `/home/giuseppe/cvs/kdeextragear-3/kdebluetooth/kbluetoothd/kbluetoothd' if g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../kdebluetooth -I/usr/kde/cvs/include -I/usr/qt/3/include -I/usr/X11R6/include -I/usr/kde/cvs/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -MT rfcommportlistener.o -MD -MP -MF ".deps/rfcommportlistener.Tpo" \ -c -o rfcommportlistener.o `test -f 'rfcommportlistener.cpp' || echo './'`rfcommportlistener.cpp; \ then mv -f ".deps/rfcommportlistener.Tpo" ".deps/rfcommportlistener.Po"; \ else rm -f ".deps/rfcommportlistener.Tpo"; exit 1; \ fi rfcommportlistener.cpp: In member function `virtual bool RfcommPortListener::acquirePort()': rfcommportlistener.cpp:111: error: `RFCOMM_LM_AUTH' undeclared (first use this function) rfcommportlistener.cpp:111: error: (Each undeclared identifier is reported only once for each function it appears in.) rfcommportlistener.cpp:115: error: `RFCOMM_LM_ENCRYPT' undeclared (first use this function) rfcommportlistener.cpp:119: error: `RFCOMM_LM' undeclared (first use this function) make[5]: *** [rfcommportlistener.o] Error 1 make[5]: Leaving directory `/home/giuseppe/cvs/kdeextragear-3/kdebluetooth/kbluetoothd/kbluetoothd' What's the problem? Your bluetooth headers are probably outdated. Which version are you using? This has nothing to do with this bug btw., so let's discuss this on the mailinglist. Ok you were right just updated bluez-utils and everything's allright. Hi, I patched the amaroK-controller in CVS to support playlist-handling, as the newest version of amaroK has enough DCOP functions to handle this. The patch can be found at http://gorath.it.augustakom.net/amarokcontroller.rar All playlist commands are supported ( add, add&play, clear, select ). Patch applied, thanks alot, Martin - and sorry that it took me so long. |