Fix building of phonon-vlc
authorMartin T. H. Sandsmark <sandsmark@samfundet.no>
Tue, 29 Dec 2009 15:13:32 +0000 (16:13 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 29 Dec 2009 15:14:19 +0000 (16:14 +0100)
.gitignore
bindings/phonon/vlc-kde/CMakeLists.txt [new file with mode: 0644]
bindings/phonon/vlc/vlcloader.cpp
bindings/phonon/vlc/vlcmediaobject.cpp

index 88ba9ce..8ae2d0e 100644 (file)
@@ -44,7 +44,6 @@ vlc_install_dir/*
 # Ignore CMake Stuff
 cmake
 CMakeFiles
-CMakeLists.txt
 CTestTestfile.cmake
 cmake_install.cmake
 cmake_uninstall.cmake
diff --git a/bindings/phonon/vlc-kde/CMakeLists.txt b/bindings/phonon/vlc-kde/CMakeLists.txt
new file mode 100644 (file)
index 0000000..24b986a
--- /dev/null
@@ -0,0 +1,40 @@
+project(phonon-vlc)
+include_directories(${QT_INCLUDES} 
+                    ${VLC_INCLUDE_DIRS} 
+                    ${CMAKE_CURRENT_SOURCE_DIR})
+
+add_definitions(-D_PHONON_BACKEND_VERSION_4_2)
+
+set(phonon_vlc_SRCS
+    audiooutput.cpp
+    backend.cpp
+    devicemanager.cpp
+    effect.cpp
+    effectmanager.cpp
+    mediacontroller.cpp
+    mediaobject.cpp
+    seekstack.cpp
+    sinknode.cpp
+    videowidget.cpp
+    vlcloader.cpp
+    vlcmediacontroller.cpp
+    vlcmediaobject.cpp
+    vlcvideowidget.cpp
+    widgetnopaintevent.cpp)
+
+automoc4(phonon_vlc phonon_vlc_SRCS)
+add_library(phonon_vlc MODULE ${phonon_vlc_SRCS})
+
+set_target_properties(phonon_vlc PROPERTIES PREFIX "")
+target_link_libraries(phonon_vlc ${PHONON_LIBS} ${VLC_LIBRARIES})
+
+if(WIN32)
+    install(TARGETS phonon_vlc DESTINATION bin/phonon_backend)
+else(WIN32)
+    install(TARGETS phonon_vlc DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/phonon_backend)
+endif(WIN32)
+install(FILES vlc.desktop DESTINATION ${SERVICES_INSTALL_DIR}/phononbackends)
+
+if(BUILD_TESTS)
+    add_subdirectory(tests)
+endif(BUILD_TESTS)
index 9350d69..c85fff0 100644 (file)
@@ -93,7 +93,7 @@ void vlcRelease()
 void vlcExceptionRaised()
 {
     if (libvlc_exception_raised(vlc_exception)) {
-        qDebug() << "libvlc exception:" << libvlc_exception_get_message(vlc_exception);
+        qDebug() << "libvlc exception:" << libvlc_errmsg();
         libvlc_exception_clear(vlc_exception);
     }
 }
index 3c2286f..ca9760f 100644 (file)
@@ -172,7 +172,7 @@ void VLCMediaObject::seekInternal(qint64 milliseconds)
 
 QString VLCMediaObject::errorString() const
 {
-    return libvlc_exception_get_message(vlc_exception);
+    return libvlc_errmsg();
 }
 
 bool VLCMediaObject::hasVideo() const
@@ -210,7 +210,7 @@ void VLCMediaObject::connectToAllVLCEvents()
 
 
     // Get event manager from media descriptor object
-    p_vlc_media_event_manager = libvlc_media_event_manager(p_vlc_media, vlc_exception);
+    p_vlc_media_event_manager = libvlc_media_event_manager(p_vlc_media);
     libvlc_event_type_t eventsMedia[] = {
         libvlc_MediaMetaChanged,
         libvlc_MediaSubItemAdded,
@@ -379,40 +379,40 @@ void VLCMediaObject::updateMetaData()
     QMultiMap<QString, QString> metaDataMap;
 
     metaDataMap.insert(QLatin1String("ARTIST"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Artist, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Artist)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("ALBUM"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Album, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Album)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("TITLE"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Title, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Title)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("DATE"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Date, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Date)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("GENRE"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Genre, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Genre)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("TRACKNUMBER"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_TrackNumber, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_TrackNumber)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("DESCRIPTION"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Description, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Description)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("COPYRIGHT"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_TrackNumber, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_TrackNumber)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("URL"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_URL, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_URL)));
     vlcExceptionRaised();
     metaDataMap.insert(QLatin1String("ENCODEDBY"),
-                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_EncodedBy, vlc_exception)));
+                       QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_EncodedBy)));
 
     qDebug() << "updateMetaData(): artist:"
-    << libvlc_media_get_meta(p_vlc_media, libvlc_meta_Artist, vlc_exception);
+    << libvlc_media_get_meta(p_vlc_media, libvlc_meta_Artist);
     vlcExceptionRaised();
     qDebug() << "updateMetaData(): title:"
-    << libvlc_media_get_meta(p_vlc_media, libvlc_meta_Title, vlc_exception);
+    << libvlc_media_get_meta(p_vlc_media, libvlc_meta_Title);
     vlcExceptionRaised();
 
     emit metaDataChanged(metaDataMap);