Bug 94988 - support libtunepimp-0.4.0
Summary: support libtunepimp-0.4.0
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.3.6
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 116566 119505 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-12 15:50 UTC by Michel Albert
Modified: 2006-06-11 12:32 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
quick-n-dirty (untested) build fix (2.35 KB, patch)
2005-11-17 20:10 UTC, Rex Dieter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Albert 2004-12-12 15:50:51 UTC
Version:           1.2-beta2 (using KDE KDE 3.3.1)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) 
OS:                Linux

Hi,
just wanted to compile the newest version (1.2-beta2), but I failed due to the following compiler error. I als included the compilation command, so I hope it gives you some insight. The same error is in the CVS version. I did the checkout on 14:40 on 12. Dec. 2004. Here goes:

g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../amarok/src/amarokcore -I../../amarok/src/amarokcore -I../../amar                   ok/src/analyzers -I../../amarok/src/engine -I../../amarok/src/plugin -I/usr/kde/3.3/include/arts -I/usr/incl                   ude/taglib -I../../amarok/src/sqlite  -I/usr/kde/3.3/include -I/usr/qt/3/include -I/usr/X11R6/include   -DQT                   _THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SO                   URCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBU                   G -O2 -march=athlon-xp -pipe -O2 -mcpu=i686 -fomit-frame-pointer -Wformat-security -Wmissing-format-attribut                   e -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COM                   PAT -DQT_NO_TRANSLATION  -c -o osd.o `test -f 'osd.cpp' || echo './'`osd.cpp
/usr/local/include/tunepimp/tp_c.h: In member function `int 
   KTRMRequestHandler::startLookup(KTRMLookup*)':
/usr/local/include/tunepimp/tp_c.h:633: error: too few arguments to function `
   int tp_AddFile(void*, const char*, int)'
ktrm.cpp:68: error: at this point in file
ktrm.cpp: In constructor `KTRMRequestHandler::KTRMRequestHandler()':
ktrm.cpp:123: error: invalid conversion from `void (*)(void*, void*, 
   TPCallbackEnum, int)' to `void (*)(void*, void*, TPCallbackEnum, int, 
   TPFileStatus)'
ktrm.cpp: In member function `virtual void KTRMLookup::collision()':
ktrm.cpp:518: error: base operand of `->' has non-pointer type `artistresult_t'
ktrm.cpp:519: error: base operand of `->' has non-pointer type `albumresult_t'
ktrm.cpp:521: error: base operand of `->' has non-pointer type `albumresult_t'
Comment 1 Mark Kretschmann 2004-12-12 16:06:48 UTC
Did you use --enable-final? amaroK does not support that.

Comment 2 Mark Kretschmann 2004-12-24 09:27:01 UTC
Invalid, because --enable-final is unsupported.
Comment 3 Thiago Macieira 2004-12-24 16:52:59 UTC
It should be.
Comment 4 Michael Pyne 2005-05-05 22:14:39 UTC
For those looking at this bug and getting a similar error, it's probably caused by using tunepimp CVS, which is not supported.  Please use tunepimp 0.3.x
Comment 5 Wim Bakker 2005-11-17 12:55:44 UTC
I used the latest release tunepimp-0.4.0 , apparently that is not supported either than?
Comment 6 Rex Dieter 2005-11-17 20:07:34 UTC
Verified against libtunepimp-0.4.0.  See also bug #116575 (kdemultimedia/juk)
Comment 7 Rex Dieter 2005-11-17 20:10:36 UTC
Created attachment 13516 [details]
quick-n-dirty (untested) build fix
Comment 8 Rex Dieter 2005-11-18 14:58:38 UTC
*** Bug 116566 has been marked as a duplicate of this bug. ***
Comment 9 Alexandre Oliveira 2006-01-04 16:33:20 UTC
*** Bug 119505 has been marked as a duplicate of this bug. ***
Comment 10 Rex Dieter 2006-01-04 17:05:31 UTC
It appears the quick-n-dirty patch included here has at least one big problem: amarok hangs when trying to use "Fill in the tag with Musicbrainz" feature on unsupported filetypes (ie, on mp3's, but when using a libtunepimp built without mp3 support).
Comment 11 Dirk Mueller 2006-01-17 17:42:38 UTC
SVN commit 499350 by mueller:

support musicbrainz 0.4.x
BUG:94988


 M  +3 -1      configure.in.in  
 M  +26 -3     src/ktrm.cpp  


--- branches/stable/extragear/multimedia/amarok/configure.in.in #499349:499350
@@ -591,7 +591,9 @@
 fi
 
 if test "$build_musicbrainz" = "yes"; then
-    AC_DEFINE(HAVE_TUNEPIMP, 1, [have TunePimp])
+    AC_CHECK_LIB(tunepimp, tp_SetFileNameEncoding,
+      AC_DEFINE(HAVE_TUNEPIMP, 4, [have MusicBrainz 0.4.x]),
+      AC_DEFINE(HAVE_TUNEPIMP, 1, [have MusicBrainz]))
     LIB_TUNEPIMP="-ltunepimp"
     have_tunepimp=yes
 else
--- branches/stable/extragear/multimedia/amarok/src/ktrm.cpp #499349:499350
@@ -42,7 +42,11 @@
 
 extern "C"
 {
+#if HAVE_TUNEPIMP >= 4
+    static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFileStatus status);
+#else
     static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId);
+#endif
 }
 
 /**
@@ -66,7 +70,11 @@
         int id;
 
         if(!m_fileMap.contains(lookup->file())) {
+#if HAVE_TUNEPIMP >= 4
+            id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()), 0);
+#else
             id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()));
+#endif
             m_fileMap.insert(lookup->file(), id);
         }
         else {
@@ -121,7 +129,11 @@
         tp_SetAutoSaveThreshold(m_pimp, -1);
         tp_SetMoveFiles(m_pimp, false);
         tp_SetRenameFiles(m_pimp, false);
+#if HAVE_TUNEPIMP >= 4
+        tp_SetFileNameEncoding(m_pimp, "UTF-8");
+#else
         tp_SetUseUTF8(m_pimp, true);
+#endif
         tp_SetNotifyCallback(m_pimp, TRMNotifyCallback, 0);
 
         if(KProtocolManager::useProxy()) {
@@ -244,14 +256,19 @@
 /**
  * Callback fuction for TunePimp lookup events.
  */
-
-static void TRMNotifyCallback(tunepimp_t pimp, void *, TPCallbackEnum type, int fileId)
+#if HAVE_TUNEPIMP >= 4
+static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFileStatus status)
+#else
+static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId)
+#endif
 {
     if(type != tpFileChanged)
         return;
 
     track_t track = tp_GetTrack(pimp, fileId);
+#if HAVE_TUNEPIMP < 4
     TPFileStatus status = tr_GetStatus(track);
+#endif
 
     switch(status) {
     case eRecognized:
@@ -556,10 +573,16 @@
                 KTRMResult result;
 
                 result.d->title = QString::fromUtf8(tracks[i]->name);
+#if HAVE_TUNEPIMP >= 4
+ 		result.d->artist = QString::fromUtf8(tracks[i]->artist.name);
+                result.d->album = QString::fromUtf8(tracks[i]->album.name);
+                result.d->year = tracks[i]->album.releaseYear;
+#else
                 result.d->artist = QString::fromUtf8(tracks[i]->artist->name);
                 result.d->album = QString::fromUtf8(tracks[i]->album->name);
+                result.d->year = tracks[i]->album->releaseYear;
+#endif
                 result.d->track = tracks[i]->trackNum;
-                result.d->year = tracks[i]->album->releaseYear;
                 result.d->relevance =
                     4 * stringSimilarity(strList,result.d->title) +
                     2 * stringSimilarity(strList,result.d->artist) +
Comment 12 Dirk Mueller 2006-01-17 17:43:39 UTC
SVN commit 499352 by mueller:

musicbrainz 0.4.x support
CCBUG:94988


 M  +3 -1      configure.in.in  
 M  +26 -3     src/ktrm.cpp  


--- trunk/extragear/multimedia/amarok/configure.in.in #499351:499352
@@ -694,7 +694,9 @@
 fi
 
 if test "$build_musicbrainz" = "yes"; then
-    AC_DEFINE(HAVE_TUNEPIMP, 1, [have TunePimp])
+    AC_CHECK_LIB(tunepimp, tp_SetFileNameEncoding,
+      AC_DEFINE(HAVE_TUNEPIMP, 4, [have MusicBrainz 0.4.x]),
+      AC_DEFINE(HAVE_TUNEPIMP, 1, [have MusicBrainz]))
     LIB_TUNEPIMP="-ltunepimp"
     have_tunepimp=yes
 else
--- trunk/extragear/multimedia/amarok/src/ktrm.cpp #499351:499352
@@ -42,7 +42,11 @@
 
 extern "C"
 {
+#if HAVE_TUNEPIMP >= 4
+    static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFileStatus status);
+#else
     static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId);
+#endif
 }
 
 /**
@@ -66,7 +70,11 @@
         int id;
 
         if(!m_fileMap.contains(lookup->file())) {
+#if HAVE_TUNEPIMP >= 4
+            id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()), 0);
+#else
             id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()));
+#endif
             m_fileMap.insert(lookup->file(), id);
         }
         else {
@@ -121,7 +129,11 @@
         tp_SetAutoSaveThreshold(m_pimp, -1);
         tp_SetMoveFiles(m_pimp, false);
         tp_SetRenameFiles(m_pimp, false);
+#if HAVE_TUNEPIMP >= 4
+        tp_SetFileNameEncoding(m_pimp, "UTF-8");
+#else
         tp_SetUseUTF8(m_pimp, true);
+#endif
         tp_SetNotifyCallback(m_pimp, TRMNotifyCallback, 0);
 
         if(KProtocolManager::useProxy()) {
@@ -244,14 +256,19 @@
 /**
  * Callback fuction for TunePimp lookup events.
  */
-
-static void TRMNotifyCallback(tunepimp_t pimp, void *, TPCallbackEnum type, int fileId)
+#if HAVE_TUNEPIMP >= 4
+static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFileStatus status)
+#else
+static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId)
+#endif
 {
     if(type != tpFileChanged)
         return;
 
     track_t track = tp_GetTrack(pimp, fileId);
+#if HAVE_TUNEPIMP < 4
     TPFileStatus status = tr_GetStatus(track);
+#endif
 
     switch(status) {
     case eRecognized:
@@ -556,10 +573,16 @@
                 KTRMResult result;
 
                 result.d->title = QString::fromUtf8(tracks[i]->name);
+#if HAVE_TUNEPIMP >= 4
+ 		result.d->artist = QString::fromUtf8(tracks[i]->artist.name);
+                result.d->album = QString::fromUtf8(tracks[i]->album.name);
+                result.d->year = tracks[i]->album.releaseYear;
+#else
                 result.d->artist = QString::fromUtf8(tracks[i]->artist->name);
                 result.d->album = QString::fromUtf8(tracks[i]->album->name);
+                result.d->year = tracks[i]->album->releaseYear;
+#endif
                 result.d->track = tracks[i]->trackNum;
-                result.d->year = tracks[i]->album->releaseYear;
                 result.d->relevance =
                     4 * stringSimilarity(strList,result.d->title) +
                     2 * stringSimilarity(strList,result.d->artist) +