|
From: Yoda-JM <yo...@us...> - 2009-08-17 18:24:35
|
Module: performous
Branch: master
Commit: 155fdbfa776eeeb3699b90202bb0313f589a5b1a
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Aug 17 20:19:22 2009 +0200
Used SingStarCover class inside ss_extract
---
tools/CMakeLists.txt | 26 +++++++++++++++-----------
tools/ss_extract.cpp | 8 ++++++--
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 3f457d2..8793b5b 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -25,22 +25,26 @@ endif(CMAKE_COMPILER_IS_GNUCXX)
if (LibXML++_FOUND)
if (Boost_FOUND)
- add_executable(ss_extract ss_extract.cpp pak.cpp ipu_conv.cpp)
- target_link_libraries(ss_extract ${LibXML++_LIBRARIES} ${Boost_LIBRARIES})
- set(targets ${targets} ss_extract)
+ if (Magick++_FOUND)
+ add_executable(ss_extract ss_extract.cpp pak.cpp ipu_conv.cpp ss_cover.cpp)
+ target_link_libraries(ss_extract ${LibXML++_LIBRARIES} ${Boost_LIBRARIES} ${Magick++_LIBRARIES})
+ set(targets ${targets} ss_extract)
+ else (Magick++_FOUND)
+ message("No Magick++ found, not building ss_extract")
+ endif (Magick++_FOUND)
else (Boost_FOUND)
- message("Boost.Filesystem not found, not building ss_extract")
+ message("No Boost.Filesystem found, not building ss_extract")
endif (Boost_FOUND)
- if (Magick++_FOUND)
- add_executable(ss_cover_conv cover_conv.cpp pak.cpp ss_cover.cpp)
- target_link_libraries(ss_cover_conv ${Magick++_LIBRARIES} ${LibXML++_LIBRARIES})
+ if (Magick++_FOUND)
+ add_executable(ss_cover_conv cover_conv.cpp pak.cpp ss_cover.cpp)
+ target_link_libraries(ss_cover_conv ${Magick++_LIBRARIES} ${LibXML++_LIBRARIES})
set(targets ${targets} ss_cover_conv)
- else (Magick++_FOUND)
- message("No Magick++ found, not building ss_cover_conv")
- endif (Magick++_FOUND)
+ else (Magick++_FOUND)
+ message("No Magick++ found, not building ss_cover_conv")
+ endif (Magick++_FOUND)
else (LibXML++_FOUND)
- message("No LibXML++ found, not building ss_extract nor ss_cover_conv")
+ message("No LibXML++ found, not building ss_extract nor ss_cover_conv")
endif (LibXML++_FOUND)
if (Boost_FOUND)
diff --git a/tools/ss_extract.cpp b/tools/ss_extract.cpp
index 83e7699..c8a2cee 100644
--- a/tools/ss_extract.cpp
+++ b/tools/ss_extract.cpp
@@ -14,9 +14,11 @@
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
+#include <boost/lexical_cast.hpp>
#include "pak.h"
#include "ipuconv.hh"
+#include "ss_cover.hh"
namespace fs = boost::filesystem;
@@ -318,8 +320,10 @@ struct Process {
}
}
std::cerr << ">>> Extracting cover image" << std::endl;
- // FIXME: use internally instead of separate program
- std::system(("ss_cover_conv \"" + dvdPath + "/pack_ee.pak\" " + id + " \"" + path.string() + "/cover.jpg\"").c_str());
+ try {
+ SingstarCover c = SingstarCover(dvdPath + "/pack_ee.pak", boost::lexical_cast<unsigned int>(id));
+ c.write(path.string() + "/cover.jpg");
+ } catch (...) {}
remove = "";
if (video) {
std::cerr << ">>> Extracting video" << std::endl;
|