#include <vector>
#include <string>
-#include <sigc++/sigc++.h>
/* If you are using an installed libdcp, these #includes would need to be changed to
#include <libdcp/dcp.h>
for 2K projectors.
*/
boost::shared_ptr<libdcp::MonoPictureAsset> picture_asset (
- new libdcp::MonoPictureAsset (sigc::ptr_fun (&video_frame), "My Film DCP", "video.mxf", 0, 24, 48, 1998, 1080)
+ new libdcp::MonoPictureAsset (video_frame, "My Film DCP", "video.mxf", 0, 24, 48, 1998, 1080)
);
/* Now we will create a `sound asset', which is made up of a WAV file for each channel of audio. Here we're using
#include <string>
#include <boost/filesystem.hpp>
-#include <sigc++/sigc++.h>
#include "types.h"
namespace ASDCP {
#include "asset_map.h"
#include "util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using boost::shared_ptr;
using namespace libdcp;
AssetMap::AssetMap (string file)
#include "asset_map.h"
#include "reel.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using std::stringstream;
+using std::ofstream;
+using std::ostream;
+using boost::shared_ptr;
using namespace libdcp;
DCP::DCP (string directory)
: _directory (directory)
{
- filesystem::create_directories (directory);
+ boost::filesystem::create_directories (directory);
}
void
string pkl_path = write_pkl (pkl_uuid);
write_volindex ();
- write_assetmap (pkl_uuid, filesystem::file_size (pkl_path));
+ write_assetmap (pkl_uuid, boost::filesystem::file_size (pkl_path));
}
std::string
{
assert (!_cpls.empty ());
- filesystem::path p;
+ boost::filesystem::path p;
p /= _directory;
stringstream s;
s << pkl_uuid << "_pkl.xml";
void
DCP::write_volindex () const
{
- filesystem::path p;
+ boost::filesystem::path p;
p /= _directory;
p /= "VOLINDEX.xml";
ofstream vi (p.string().c_str());
void
DCP::write_assetmap (string pkl_uuid, int pkl_length) const
{
- filesystem::path p;
+ boost::filesystem::path p;
p /= _directory;
p /= "ASSETMAP.xml";
ofstream am (p.string().c_str());
shared_ptr<AssetMap> asset_map;
try {
- filesystem::path p = _directory;
+ boost::filesystem::path p = _directory;
p /= "ASSETMAP";
- if (filesystem::exists (p)) {
+ if (boost::filesystem::exists (p)) {
asset_map.reset (new AssetMap (p.string ()));
} else {
p = _directory;
p /= "ASSETMAP.xml";
- if (filesystem::exists (p)) {
+ if (boost::filesystem::exists (p)) {
asset_map.reset (new AssetMap (p.string ()));
} else {
throw DCPReadError ("could not find AssetMap file");
throw XMLError ("unsupported asset chunk count");
}
- filesystem::path t = _directory;
+ boost::filesystem::path t = _directory;
t /= (*i)->chunks.front()->path;
if (ends_with (t.string(), ".mxf") || ends_with (t.string(), ".ttf")) {
void
CPL::write_xml () const
{
- filesystem::path p;
+ boost::filesystem::path p;
p /= _directory;
stringstream s;
s << _uuid << "_cpl.xml";
os.close ();
_digest = make_digest (p.string (), 0);
- _length = filesystem::file_size (p.string ());
+ _length = boost::filesystem::file_size (p.string ());
}
void
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
-#include <sigc++/sigc++.h>
+#include <boost/signals2.hpp>
#include "types.h"
namespace xmlpp {
/** Emitted with a parameter between 0 and 1 to indicate progress
* for long jobs.
*/
- sigc::signal1<void, float> Progress;
+ boost::signals2::signal<void (float)> Progress;
private:
#include "util.h"
#include "metadata.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
using namespace libdcp;
-MXFAsset::MXFAsset (string directory, string file_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length)
+MXFAsset::MXFAsset (string directory, string file_name, boost::signals2::signal<void (float)>* progress, int fps, int entry_point, int length)
: Asset (directory, file_name)
, _progress (progress)
, _fps (fps)
#ifndef LIBDCP_MXF_ASSET_H
#define LIBDCP_MXF_ASSET_H
+#include <boost/signals2.hpp>
#include "asset.h"
namespace libdcp
* @param entry_point The entry point of this MXF; ie the first frame that should be used.
* @param length Length in frames.
*/
- MXFAsset (std::string directory, std::string file_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length);
+ MXFAsset (std::string directory, std::string file_name, boost::signals2::signal<void (float)>* progress, int fps, int entry_point, int length);
virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const;
void fill_writer_info (ASDCP::WriterInfo* w) const;
/** Signal to emit to report progress */
- sigc::signal1<void, float>* _progress;
+ boost::signals2::signal<void (float)>* _progress;
/** Frames per second */
int _fps;
int _entry_point;
#include "exceptions.h"
#include "picture_frame.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::ostream;
+using std::list;
+using std::vector;
+using std::max;
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
+using boost::lexical_cast;
using namespace libdcp;
-PictureAsset::PictureAsset (string directory, string mxf_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length)
+PictureAsset::PictureAsset (string directory, string mxf_name, boost::signals2::signal<void (float)>* progress, int fps, int entry_point, int length)
: MXFAsset (directory, mxf_name, progress, fps, entry_point, length)
, _width (0)
, _height (0)
MonoPictureAsset::MonoPictureAsset (
- sigc::slot<string, int> get_path,
+ boost::function<string (int)> get_path,
string directory,
string mxf_name,
- sigc::signal1<void, float>* progress,
+ boost::signals2::signal<void (float)>* progress,
int fps,
int length,
int width,
vector<string> const & files,
string directory,
string mxf_name,
- sigc::signal1<void, float>* progress,
+ boost::signals2::signal<void (float)>* progress,
int fps,
int length,
int width,
{
_width = width;
_height = height;
- construct (sigc::bind (sigc::mem_fun (*this, &MonoPictureAsset::path_from_list), files));
+ construct (boost::bind (&MonoPictureAsset::path_from_list, this, _1, files));
}
MonoPictureAsset::MonoPictureAsset (string directory, string mxf_name, int fps, int entry_point, int length)
}
void
-MonoPictureAsset::construct (sigc::slot<string, int> get_path)
+MonoPictureAsset::construct (boost::function<string (int)> get_path)
{
ASDCP::JP2K::CodestreamParser j2k_parser;
ASDCP::JP2K::FrameBuffer frame_buffer (4 * Kumu::Megabyte);
class PictureAsset : public MXFAsset
{
public:
- PictureAsset (std::string directory, std::string mxf_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length);
+ PictureAsset (std::string directory, std::string mxf_name, boost::signals2::signal<void (float)>* progress, int fps, int entry_point, int length);
/** Write details of this asset to a CPL stream.
* @param s Stream.
std::vector<std::string> const & files,
std::string directory,
std::string mxf_name,
- sigc::signal1<void, float>* progress,
+ boost::signals2::signal<void (float)>* progress,
int fps,
int length,
int width,
* @param height Height of images in pixels.
*/
MonoPictureAsset (
- sigc::slot<std::string, int> get_path,
+ boost::function<std::string (int)> get_path,
std::string directory,
std::string mxf_name,
- sigc::signal1<void, float>* progress,
+ boost::signals2::signal<void (float)>* progress,
int fps,
int length,
int width,
private:
std::string path_from_list (int f, std::vector<std::string> const & files) const;
- void construct (sigc::slot<std::string, int>);
+ void construct (boost::function<std::string (int)>);
};
/** A 3D (stereoscopic) picture asset */
#include "lut.h"
#include "util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using boost::shared_ptr;
using namespace libdcp;
/** Make a picture frame from a 2D (monoscopic) asset.
#include "exceptions.h"
#include "sound_frame.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::ostream;
+using std::vector;
+using std::list;
+using boost::shared_ptr;
+using boost::lexical_cast;
using namespace libdcp;
SoundAsset::SoundAsset (
- vector<string> const & files, string directory, string mxf_name, sigc::signal1<void, float>* progress, int fps, int length
+ vector<string> const & files, string directory, string mxf_name, boost::signals2::signal<void (float)>* progress, int fps, int length
)
: MXFAsset (directory, mxf_name, progress, fps, 0, length)
, _channels (files.size ())
, _sampling_rate (0)
{
- construct (sigc::bind (sigc::mem_fun (*this, &SoundAsset::path_from_channel), files));
+ construct (boost::bind (&SoundAsset::path_from_channel, this, _1, files));
}
SoundAsset::SoundAsset (
- sigc::slot<string, Channel> get_path, string directory, string mxf_name, sigc::signal1<void, float>* progress, int fps, int length, int channels
+ boost::function<string (Channel)> get_path,
+ string directory,
+ string mxf_name,
+ boost::signals2::signal<void (float)>* progress,
+ int fps, int length, int channels
)
: MXFAsset (directory, mxf_name, progress, fps, 0, length)
, _channels (channels)
}
void
-SoundAsset::construct (sigc::slot<string, Channel> get_path)
+SoundAsset::construct (boost::function<string (Channel)> get_path)
{
ASDCP::Rational asdcp_fps (_fps, 1);
std::vector<std::string> const & files,
std::string directory,
std::string mxf_name,
- sigc::signal1<void, float>* progress,
+ boost::signals2::signal<void (float)>* progress,
int fps,
int length
);
* @param channels Number of audio channels.
*/
SoundAsset (
- sigc::slot<std::string, Channel> get_path,
+ boost::function<std::string (Channel)> get_path,
std::string directory,
std::string mxf_name,
- sigc::signal1<void, float>* progress,
+ boost::signals2::signal<void (float)>* progress,
int fps,
int length,
int channels
}
private:
- void construct (sigc::slot<std::string, Channel> get_path);
+ void construct (boost::function<std::string (Channel)> get_path);
std::string path_from_channel (Channel channel, std::vector<std::string> const & files);
/** Number of channels in the asset */
#include "subtitle_asset.h"
#include "util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using std::ostream;
+using std::ofstream;
+using std::stringstream;
+using boost::shared_ptr;
+using boost::lexical_cast;
using namespace libdcp;
SubtitleAsset::SubtitleAsset (string directory, string xml_file)
#include "argb_frame.h"
#include "lut.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::min;
+using std::max;
+using boost::shared_ptr;
using namespace libdcp;
string
}
string
-libdcp::make_digest (string filename, sigc::signal1<void, float>* progress)
+libdcp::make_digest (string filename, boost::signals2::signal<void (float)>* progress)
{
- int const file_size = filesystem::file_size (filename);
+ int const file_size = boost::filesystem::file_size (filename);
Kumu::FileReader reader;
if (ASDCP_FAILURE (reader.OpenRead (filename.c_str ()))) {
#include <string>
#include <stdint.h>
-#include <sigc++/sigc++.h>
+#include <boost/signals2.hpp>
#include <openjpeg.h>
#include "types.h"
* progress; the parameter will start at 0.5 and proceed to 1.
* @return Digest.
*/
-extern std::string make_digest (std::string filename, sigc::signal1<void, float>* progress);
+extern std::string make_digest (std::string filename, boost::signals2::signal<void (float)>* progress);
extern std::string content_kind_to_string (ContentKind kind);
extern ContentKind content_kind_from_string (std::string kind);
obj.name = 'libdcp'
obj.target = 'dcp'
obj.export_includes = ['.']
- obj.uselib = 'BOOST_FILESYSTEM OPENSSL SIGC++ LIBXML++ OPENJPEG'
+ obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 OPENSSL SIGC++ LIBXML++ OPENJPEG'
obj.use = 'libkumu-libdcp libasdcp-libdcp'
obj.source = """
asset.cc
#define BOOST_TEST_MODULE libdcp_test
#include <boost/test/unit_test.hpp>
-using namespace std;
-using namespace boost;
+using std::string;
+using std::vector;
+using std::list;
+using boost::shared_ptr;
string
j2c (int)
t->product_name = "OpenDCP";
t->product_version = "0.0.25";
t->issue_date = "2012-07-17T04:45:18+00:00";
- filesystem::remove_all ("build/test/foo");
- filesystem::create_directories ("build/test/foo");
+ boost::filesystem::remove_all ("build/test/foo");
+ boost::filesystem::create_directories ("build/test/foo");
libdcp::DCP d ("build/test/foo");
shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/foo", "A Test DCP", libdcp::FEATURE, 24, 24));
shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset (
- sigc::ptr_fun (&j2c),
+ j2c,
"build/test/foo",
"video.mxf",
&d.Progress,
));
shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset (
- sigc::ptr_fun (&wav),
- "build/test/foo",
- "audio.mxf",
- &(d.Progress),
- 24,
- 24,
- 2
- ));
-
+ wav,
+ "build/test/foo",
+ "audio.mxf",
+ &(d.Progress),
+ 24,
+ 24,
+ 2
+ ));
+
cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ())));
d.add_cpl (cpl);
#include "picture_asset.h"
#include "subtitle_asset.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::cerr;
+using std::cout;
+using std::list;
+using boost::shared_ptr;
using namespace libdcp;
static void
exit (EXIT_FAILURE);
}
- if (!filesystem::exists (argv[optind])) {
+ if (!boost::filesystem::exists (argv[optind])) {
cerr << argv[0] << ": DCP " << argv[optind] << " not found.\n";
exit (EXIT_FAILURE);
}
conf.env.append_value('CXXFLAGS', '-DLIBDCP_POSIX')
conf.check_cfg(package = 'openssl', args = '--cflags --libs', uselib_store = 'OPENSSL', mandatory = True)
- conf.check_cfg(package = 'sigc++-2.0', args = '--cflags --libs', uselib_store = 'SIGC++', mandatory = True)
conf.check_cfg(package = 'libxml++-2.6', args = '--cflags --libs', uselib_store = 'LIBXML++', mandatory = True)
conf.check_cc(fragment = """
lib = ['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
uselib_store = 'BOOST_FILESYSTEM')
+ conf.check_cxx(fragment = """
+ #include <boost/signals2.hpp>\n
+ int main() { boost::signals2::signal<void (int)> x; }\n
+ """,
+ msg = 'Checking for boost signals2 library',
+ uselib_store = 'BOOST_SIGNALS2')
+
lut.make_luts()
conf.recurse('test')