]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/trackattachment.cpp
Add a function to retrieve track attachments in order
[r2c2.git] / source / libr2c2 / trackattachment.cpp
index 29521fdc064659457d3dfaa97da30d3fc0b79563..eb2d563561c6fcf7864d00c1a8a170f943c7e624 100644 (file)
@@ -20,6 +20,14 @@ TrackAttachment::~TrackAttachment()
                track->remove_attachment(*this);
 }
 
+float TrackAttachment::get_offset_from_endpoint(unsigned epi) const
+{
+       if(epi==track.entry())
+               return offset;
+       else
+               return track->get_type().get_path_length(0)-offset;
+}
+
 void TrackAttachment::attach_to(const TrackIter &t, float o)
 {
        if(track)