X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrackattachment.cpp;h=64704b11b5290bab5e17d24da21e06f61b9eb230;hb=0443ca05cbd306487131f5f5bd3b91181ae4a733;hp=eb2d563561c6fcf7864d00c1a8a170f943c7e624;hpb=5fa009f4af8d0a2e4f52929e1ee29f5c93986ab6;p=r2c2.git diff --git a/source/libr2c2/trackattachment.cpp b/source/libr2c2/trackattachment.cpp index eb2d563..64704b1 100644 --- a/source/libr2c2/trackattachment.cpp +++ b/source/libr2c2/trackattachment.cpp @@ -8,8 +8,7 @@ using namespace std; namespace R2C2 { TrackAttachment::TrackAttachment(Layout &l): - Object(l), - offset(0) + Object(l) { layout.signal_object_removed.connect(sigc::mem_fun(this, &TrackAttachment::object_removed)); } @@ -23,18 +22,17 @@ TrackAttachment::~TrackAttachment() float TrackAttachment::get_offset_from_endpoint(unsigned epi) const { if(epi==track.entry()) - return offset; + return track.offset(); else - return track->get_type().get_path_length(0)-offset; + return track->get_type().get_path_length(0)-track.offset(); } -void TrackAttachment::attach_to(const TrackIter &t, float o) +void TrackAttachment::attach_to(const TrackOffsetIter &t) { if(track) track->remove_attachment(*this); track = t; - offset = o; if(track) track->add_attachment(*this); @@ -74,13 +72,13 @@ void TrackAttachment::attach_to_closest(float limit) if(adiff