Bug 94476 - Kbemusedsrv support for amarok
Summary: Kbemusedsrv support for amarok
Status: RESOLVED FIXED
Alias: None
Product: kde-bluetooth
Classification: Miscellaneous
Component: kbluetoothd (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-05 19:24 UTC by cerebro84
Modified: 2005-03-20 17:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Script to control amaroK via bemused (1.32 KB, application/x-bzip2)
2004-12-07 13:51 UTC, cerebro84
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cerebro84 2004-12-05 19:24:11 UTC
Version:           3.3.0 (using KDE 3.3.89 (CVS >= 20041129), Gentoo)
Compiler:          gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.6.9-gentoo-r6y

Hi,
I noticed that a noatun controller is offered in addition to the xmms one. amaroK is very popular, and it's popularity is still growing but... it isn't in the list. I think it should be.
Comment 1 cerebro84 2004-12-07 13:51:34 UTC
Created attachment 8564 [details]
Script to control amaroK via bemused
Comment 2 cerebro84 2004-12-07 13:58:34 UTC
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
Comment 3 Stanislav Karchebny 2004-12-08 08:35:02 UTC
If this is for amaroK, why its product is kde-bluetooth then?
Comment 4 cerebro84 2004-12-08 12:06:01 UTC
Just because it was born as a feature request for kbemusedserver... Should I open another feature request under the name of amaroK?
Comment 5 Fred Schättgen 2004-12-08 12:35:11 UTC
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.
Comment 6 cerebro84 2004-12-08 12:43:08 UTC
It's both :)
I think native support would be better, if it allowed to control the playlist 
too!

Comment 7 Mike Diehl 2004-12-14 02:14:45 UTC
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.


Comment 8 Mike Diehl 2004-12-14 04:12:29 UTC
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! */


Comment 9 Patrick Steiner 2005-02-16 07:21:46 UTC
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
Comment 10 Fred Schättgen 2005-02-16 17:25:47 UTC
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));


Comment 11 cerebro84 2005-02-18 01:31:18 UTC
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?

Comment 12 Fred Schättgen 2005-02-18 02:53:30 UTC
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.
Comment 13 cerebro84 2005-02-18 11:25:29 UTC
Ok you were right just updated bluez-utils and everything's allright.

Comment 14 Martin Kleinhans 2005-03-15 16:15:06 UTC
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 ).
Comment 15 Fred Schättgen 2005-03-20 17:31:43 UTC
Patch applied, thanks alot, Martin - and sorry that it took me so long.