add XMLNode constructor for SegmentDescriptor

This commit is contained in:
Paul Davis 2022-01-13 17:38:40 -07:00
parent 680a27c29d
commit b9a798ebb8
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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)
{