rev 3105 - trunk/packages/kdeutils/debian/patches

Christopher Martin chrsmrtn at costa.debian.org
Thu Feb 9 01:11:12 UTC 2006


Author: chrsmrtn
Date: 2006-02-09 01:11:11 +0000 (Thu, 09 Feb 2006)
New Revision: 3105

Added:
   trunk/packages/kdeutils/debian/patches/12_superkaramba_xmms.diff
Log:
Kevin Krammer's xmms/superakamba dlopen patch.


Added: trunk/packages/kdeutils/debian/patches/12_superkaramba_xmms.diff
===================================================================
--- trunk/packages/kdeutils/debian/patches/12_superkaramba_xmms.diff	2006-02-08 23:47:53 UTC (rev 3104)
+++ trunk/packages/kdeutils/debian/patches/12_superkaramba_xmms.diff	2006-02-09 01:11:11 UTC (rev 3105)
@@ -0,0 +1,219 @@
+--- kde.orig/superkaramba/src/xmmssensor.cpp
++++ kde.patched/superkaramba/src/xmmssensor.cpp
+@@ -10,11 +10,122 @@
+ #include "xmmssensor.h"
+ 
+ #ifdef HAVE_XMMS
+-#include <xmmsctrl.h>
++#include <qlibrary.h>
++
++class XMMSSensor::XMMS
++{
++public:
++    XMMS() : libxmms( 0 )
++    {
++        libxmms = new QLibrary( "/usr/lib/libxmms.so.1" );
++        if ( !libxmms->load() )
++        {
++            delete libxmms;
++            libxmms = 0;
++        }
++
++        if ( libxmms != 0 )
++        {
++            // resolve functions
++            *(void**) (&xmms_remote_is_running) =
++                    libxmms->resolve( "xmms_remote_is_running" );
++
++            *(void**) (&xmms_remote_is_playing) =
++                    libxmms->resolve( "xmms_remote_is_playing" );
++
++            *(void**) (&xmms_remote_get_playlist_title) =
++                    libxmms->resolve( "xmms_remote_get_playlist_title" );
++
++            *(void**) (&xmms_remote_get_playlist_time) =
++                    libxmms->resolve( "xmms_remote_get_playlist_time" );
++
++            *(void**) (&xmms_remote_get_playlist_pos) =
++                    libxmms->resolve( "xmms_remote_get_playlist_pos" );
++
++            *(void**) (&xmms_remote_get_output_time) =
++                    libxmms->resolve( "xmms_remote_get_output_time" );
++        }
++    }
++
++    bool isInitialized() const
++    {
++        return libxmms != 0 &&
++               xmms_remote_is_running != 0 &&
++               xmms_remote_is_playing != 0 &&
++               xmms_remote_get_playlist_title != 0 &&
++               xmms_remote_get_playlist_time  != 0 &&
++               xmms_remote_get_playlist_pos   != 0 &&
++               xmms_remote_get_output_time    != 0;
++    }
++
++    bool isRunning(int session)
++    {
++        if ( !isInitialized() ) return false;
++
++        return (*xmms_remote_is_running)(session);
++    }
++
++    bool isPlaying(int session)
++    {
++        if ( !isInitialized() ) return false;
++
++        return (*xmms_remote_is_playing)(session);
++    }
++
++    char* getPlaylistTitle(int session, int pos)
++    {
++        if ( !isInitialized() ) return "";
++
++        return (*xmms_remote_get_playlist_title)(session, pos);
++    }
++
++    int getPlaylistTime(int session, int pos)
++    {
++        if ( !isInitialized() ) return 0;
++
++        return (*xmms_remote_get_playlist_time)(session, pos);
++    }
++
++    int getPlaylistPos(int session)
++    {
++        if ( !isInitialized() ) return 0;
++
++        return (*xmms_remote_get_playlist_pos)(session);
++    }
++
++    int getOutputTime(int session)
++    {
++        if ( !isInitialized() ) return 0;
++
++        return (*xmms_remote_get_output_time)(session);
++    }
++
++private:
++    QLibrary* libxmms;
++
++    bool (*xmms_remote_is_running)(int);
++    bool (*xmms_remote_is_playing)(int);
++
++    char* (*xmms_remote_get_playlist_title)(int, int);
++    int   (*xmms_remote_get_playlist_time)(int, int);
++    int   (*xmms_remote_get_playlist_pos)(int);
++    int   (*xmms_remote_get_output_time)(int);
++};
++
++#else // No XMMS
++
++class XMMSSensor::XMMS
++{
++public:
++    XMMS() {}
++
++    bool isInitialized() const { return false; }
++};
+ #endif // HAVE_XMMS
+ 
++
+ XMMSSensor::XMMSSensor( int interval, const QString &encoding )
+-    : Sensor( interval )
++    : Sensor( interval ), xmms( 0 )
+ {
+      if( !encoding.isEmpty() )
+     {
+@@ -25,9 +136,13 @@
+     else
+         codec = QTextCodec::codecForLocale();
+ 
++    xmms = new XMMS();
++
+ }
+ XMMSSensor::~XMMSSensor()
+-{}
++{
++    delete xmms;
++}
+ 
+ void XMMSSensor::update()
+ {
+@@ -43,21 +158,21 @@
+     int songLength = 0;
+     int currentTime = 0;
+     bool isPlaying = false;
+-    bool isRunning = xmms_remote_is_running(0);
++    bool isRunning = xmms->isRunning(0);
+ 
+     if( isRunning )
+     {
+-        isPlaying = xmms_remote_is_playing(0);
+-        pos = xmms_remote_get_playlist_pos(0);
++        isPlaying = xmms->isPlaying(0);
++        pos = xmms->getPlaylistPos(0);
+         qDebug("unicode start");
+-        title = codec->toUnicode( QCString( xmms_remote_get_playlist_title( 0, pos ) )  );
++        title = codec->toUnicode( QCString( xmms->getPlaylistTitle( 0, pos ) )  );
+         qDebug("unicode end");
+         if( title.isEmpty() )
+             title = "XMMS";
+ 
+         qDebug("Title: %s", title.ascii());
+-        songLength = xmms_remote_get_playlist_time( 0, pos );
+-        currentTime = xmms_remote_get_output_time( 0 );
++        songLength = xmms->getPlaylistTime( 0, pos );
++        currentTime = xmms->getOutputTime( 0 );
+     }
+ #endif // HAVE_XMMS
+ 
+@@ -144,6 +259,9 @@
+ 
+ }
+ 
++bool XMMSSensor::hasXMMS() const
++{
++    return xmms->isInitialized();
++}
+ 
+-
+ #include "xmmssensor.moc"
+--- kde.orig/superkaramba/src/xmmssensor.h
++++ kde.patched/superkaramba/src/xmmssensor.h
+@@ -28,10 +28,13 @@
+     ~XMMSSensor();
+     void update();
+     void setMaxValue( SensorParams *);
++    bool hasXMMS() const;
+ 
+ private:
+     QTextCodec *codec;
+ 
++    class XMMS;
++    XMMS *xmms;
+ };
+ 
+ 
+--- kde.orig/superkaramba/src/Makefile.am
++++ kde.patched/superkaramba/src/Makefile.am
+@@ -1,5 +1,5 @@
+ # set the include path for X, qt and KDE
+-INCLUDES = $(all_includes) $(XMMS_INCLUDES) $(PYTHONINC)
++INCLUDES = $(all_includes) $(PYTHONINC)
+ 
+ # these are the headers for your project
+ noinst_HEADERS = karamba.h karambaapp.h karamba_python.h lineparser.h \
+@@ -40,9 +40,9 @@
+ 
+ # kde_cfg_DATA = superkaramba.kcfg
+ 
+-superkaramba_LDFLAGS = -Wl,-export-dynamic  $(KDE_RPATH) $(all_libraries) $(PYTHONLIB) $(XMMS_LDFLAGS)
+-#superkaramba_LDADD = -lkio $(LIB_KDEUI) $(XMMS_LDADD) $(LIBPYTHON) $(LIBKVM) $(MY_LIBKNEWSTUFF)
+-superkaramba_LDADD = -lkio $(LIB_KDEUI) $(XMMS_LIBS) $(LIBPYTHON) $(LIBKVM) $(MY_LIBKNEWSTUFF)
++superkaramba_LDFLAGS = -Wl,-export-dynamic  $(KDE_RPATH) $(all_libraries) $(PYTHONLIB)
++#superkaramba_LDADD = -lkio $(LIB_KDEUI) $(LIBPYTHON) $(LIBKVM) $(MY_LIBKNEWSTUFF)
++superkaramba_LDADD = -lkio $(LIB_KDEUI) $(LIBPYTHON) $(LIBKVM) $(MY_LIBKNEWSTUFF)
+ 
+ # this is where the desktop file will go
+ shelldesktopdir = $(kde_appsdir)/Utilities




More information about the pkg-kde-commits mailing list