MXFAsset::MXFAsset (string directory, string file_name)
: Asset (directory, file_name)
, _progress (0)
- , _edit_rate (0)
- , _entry_point (0)
- , _intrinsic_duration (0)
- , _duration (0)
{
}
MXFAsset::MXFAsset (string directory, string file_name, boost::signals2::signal<void (float)>* progress, int edit_rate, int intrinsic_duration)
- : Asset (directory, file_name)
+ : Asset (directory, file_name, edit_rate, intrinsic_duration)
, _progress (progress)
- , _edit_rate (edit_rate)
- , _entry_point (0)
- , _intrinsic_duration (intrinsic_duration)
- , _duration (intrinsic_duration)
{
}
}
bool
-MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions, list<string>& notes) const
+MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
- shared_ptr<const MXFAsset> other_mxf = dynamic_pointer_cast<const MXFAsset> (other);
- if (!other_mxf) {
- notes.push_back ("comparing an MXF asset with a non-MXF asset");
+ if (!Asset::equals (other, opt, note)) {
return false;
}
- if (_file_name != other_mxf->_file_name) {
- notes.push_back ("MXF names differ");
- return false;
- }
-
- if (_edit_rate != other_mxf->_edit_rate) {
- notes.push_back ("MXF edit rates differ");
+ shared_ptr<const MXFAsset> other_mxf = dynamic_pointer_cast<const MXFAsset> (other);
+ if (!other_mxf) {
+ note (ERROR, "comparing an MXF asset with a non-MXF asset");
return false;
}
- if (_intrinsic_duration != other_mxf->_intrinsic_duration) {
- notes.push_back ("MXF intrinsic durations differ");
- return false;
- }
-
- if (_duration != other_mxf->_duration) {
- notes.push_back ("MXF durations differ");
- return false;
+ if (_file_name != other_mxf->_file_name) {
+ note (ERROR, "MXF names differ");
+ if (!opt.mxf_names_can_differ) {
+ return false;
+ }
}
return true;