diff --git a/libs/ardour/ardour/segment_descriptor.h b/libs/ardour/ardour/segment_descriptor.h index 26471a3989..f9e7aac285 100644 --- a/libs/ardour/ardour/segment_descriptor.h +++ b/libs/ardour/ardour/segment_descriptor.h @@ -34,6 +34,7 @@ namespace ARDOUR { class SegmentDescriptor { public: SegmentDescriptor (); + SegmentDescriptor (XMLNode const &, int version); /* This object does not use the tempo map to convert between time * domains, since it describes things that are not (always) on the diff --git a/libs/ardour/segment_descriptor.cc b/libs/ardour/segment_descriptor.cc index 80baa90f02..32e246e270 100644 --- a/libs/ardour/segment_descriptor.cc +++ b/libs/ardour/segment_descriptor.cc @@ -16,9 +16,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "pbd/xml++.h" #include "pbd/enumwriter.h" +#include "pbd/failed_constructor.h" #include "pbd/i18n.h" +#include "pbd/xml++.h" #include "temporal/tempo.h" @@ -36,6 +37,19 @@ SegmentDescriptor::SegmentDescriptor () { } + +SegmentDescriptor::SegmentDescriptor (XMLNode const & node, int version) + : _time_domain (AudioTime) + , _position_samples (0) + , _duration_samples (0) + , _tempo (120, 4) + , _meter (4, 4) +{ + if (!set_state (node, version)) { + throw failed_constructor (); + } +} + void SegmentDescriptor::set_position (samplepos_t s) {