diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-25 20:52:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-25 20:52:58 +0100 |
| commit | ee7187c25d83a47a106493e66b89888eca6d4344 (patch) | |
| tree | 68ee60efb9044bf5a201925f89c9f8ddbfe7df81 /src | |
| parent | c597fcee56abc2e6d92e3cfbbfe3c7817d9d0cbe (diff) | |
Use signals2 rather than sigc++
Diffstat (limited to 'src')
| -rw-r--r-- | src/asset.h | 1 | ||||
| -rw-r--r-- | src/asset_map.cc | 5 | ||||
| -rw-r--r-- | src/dcp.cc | 30 | ||||
| -rw-r--r-- | src/dcp.h | 4 | ||||
| -rw-r--r-- | src/mxf_asset.cc | 8 | ||||
| -rw-r--r-- | src/mxf_asset.h | 5 | ||||
| -rw-r--r-- | src/picture_asset.cc | 22 | ||||
| -rw-r--r-- | src/picture_asset.h | 10 | ||||
| -rw-r--r-- | src/picture_frame.cc | 4 | ||||
| -rw-r--r-- | src/sound_asset.cc | 21 | ||||
| -rw-r--r-- | src/sound_asset.h | 8 | ||||
| -rw-r--r-- | src/subtitle_asset.cc | 9 | ||||
| -rw-r--r-- | src/util.cc | 11 | ||||
| -rw-r--r-- | src/util.h | 4 | ||||
| -rw-r--r-- | src/wscript | 2 |
15 files changed, 87 insertions, 57 deletions
diff --git a/src/asset.h b/src/asset.h index d518a5b9..c40ec91b 100644 --- a/src/asset.h +++ b/src/asset.h @@ -26,7 +26,6 @@ #include <string> #include <boost/filesystem.hpp> -#include <sigc++/sigc++.h> #include "types.h" namespace ASDCP { diff --git a/src/asset_map.cc b/src/asset_map.cc index 4d6b1870..4fda0a89 100644 --- a/src/asset_map.cc +++ b/src/asset_map.cc @@ -24,8 +24,9 @@ #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) @@ -41,14 +41,18 @@ #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 @@ -62,7 +66,7 @@ DCP::write_xml () const 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 @@ -70,7 +74,7 @@ DCP::write_pkl (string pkl_uuid) const { assert (!_cpls.empty ()); - filesystem::path p; + boost::filesystem::path p; p /= _directory; stringstream s; s << pkl_uuid << "_pkl.xml"; @@ -105,7 +109,7 @@ DCP::write_pkl (string pkl_uuid) const void DCP::write_volindex () const { - filesystem::path p; + boost::filesystem::path p; p /= _directory; p /= "VOLINDEX.xml"; ofstream vi (p.string().c_str()); @@ -119,7 +123,7 @@ DCP::write_volindex () const 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()); @@ -167,14 +171,14 @@ DCP::read (bool require_mxfs) 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"); @@ -190,7 +194,7 @@ DCP::read (bool require_mxfs) 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")) { @@ -421,7 +425,7 @@ CPL::add_reel (shared_ptr<const Reel> reel) void CPL::write_xml () const { - filesystem::path p; + boost::filesystem::path p; p /= _directory; stringstream s; s << _uuid << "_cpl.xml"; @@ -455,7 +459,7 @@ CPL::write_xml () const os.close (); _digest = make_digest (p.string (), 0); - _length = filesystem::file_size (p.string ()); + _length = boost::filesystem::file_size (p.string ()); } void @@ -27,7 +27,7 @@ #include <string> #include <vector> #include <boost/shared_ptr.hpp> -#include <sigc++/sigc++.h> +#include <boost/signals2.hpp> #include "types.h" namespace xmlpp { @@ -153,7 +153,7 @@ public: /** 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: diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc index ead97b9e..95412d0c 100644 --- a/src/mxf_asset.cc +++ b/src/mxf_asset.cc @@ -30,11 +30,13 @@ #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) diff --git a/src/mxf_asset.h b/src/mxf_asset.h index 240e042d..03f2aa6b 100644 --- a/src/mxf_asset.h +++ b/src/mxf_asset.h @@ -20,6 +20,7 @@ #ifndef LIBDCP_MXF_ASSET_H #define LIBDCP_MXF_ASSET_H +#include <boost/signals2.hpp> #include "asset.h" namespace libdcp @@ -36,7 +37,7 @@ public: * @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; @@ -49,7 +50,7 @@ protected: 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; diff --git a/src/picture_asset.cc b/src/picture_asset.cc index 12dfd1aa..ef5d40d4 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -36,11 +36,17 @@ #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) @@ -125,10 +131,10 @@ PictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, list<s 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, @@ -144,7 +150,7 @@ MonoPictureAsset::MonoPictureAsset ( 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, @@ -153,7 +159,7 @@ MonoPictureAsset::MonoPictureAsset ( { _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) @@ -174,7 +180,7 @@ MonoPictureAsset::MonoPictureAsset (string directory, string mxf_name, int fps, } 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); diff --git a/src/picture_asset.h b/src/picture_asset.h index da3eb7d0..08eb338a 100644 --- a/src/picture_asset.h +++ b/src/picture_asset.h @@ -34,7 +34,7 @@ class StereoPictureFrame; 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. @@ -83,7 +83,7 @@ public: 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, @@ -102,10 +102,10 @@ public: * @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, @@ -119,7 +119,7 @@ public: 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 */ diff --git a/src/picture_frame.cc b/src/picture_frame.cc index 06788da5..a2b90a0b 100644 --- a/src/picture_frame.cc +++ b/src/picture_frame.cc @@ -26,8 +26,8 @@ #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. diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 9ec3b2f9..0d0e1cd4 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -32,22 +32,31 @@ #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) @@ -84,7 +93,7 @@ SoundAsset::path_from_channel (Channel channel, vector<string> const & files) } void -SoundAsset::construct (sigc::slot<string, Channel> get_path) +SoundAsset::construct (boost::function<string (Channel)> get_path) { ASDCP::Rational asdcp_fps (_fps, 1); diff --git a/src/sound_asset.h b/src/sound_asset.h index a19d6726..3189c067 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -49,7 +49,7 @@ public: 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 ); @@ -65,10 +65,10 @@ public: * @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 @@ -100,7 +100,7 @@ public: } 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 */ diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 8e15ba1a..9f1aa9d9 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -22,8 +22,13 @@ #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) diff --git a/src/util.cc b/src/util.cc index 22041180..c5ddb611 100644 --- a/src/util.cc +++ b/src/util.cc @@ -36,8 +36,11 @@ #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 @@ -51,9 +54,9 @@ libdcp::make_uuid () } 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 ()))) { @@ -23,7 +23,7 @@ #include <string> #include <stdint.h> -#include <sigc++/sigc++.h> +#include <boost/signals2.hpp> #include <openjpeg.h> #include "types.h" @@ -42,7 +42,7 @@ extern std::string make_uuid (); * 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); diff --git a/src/wscript b/src/wscript index 037695b8..6c7f2392 100644 --- a/src/wscript +++ b/src/wscript @@ -3,7 +3,7 @@ def build(bld): 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 |
