X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrackattachment.h;fp=source%2Flibr2c2%2Ftrackattachment.h;h=8551250ae7507dc2db2d65ab09a7239a1dd71ed4;hb=895fdb9568cda40898e5bb646061c14a41dc0124;hp=0000000000000000000000000000000000000000;hpb=f23c8d8cbc4e72b45e3a719b2cf974ce35d054e9;p=r2c2.git diff --git a/source/libr2c2/trackattachment.h b/source/libr2c2/trackattachment.h new file mode 100644 index 0000000..8551250 --- /dev/null +++ b/source/libr2c2/trackattachment.h @@ -0,0 +1,34 @@ +#ifndef LIBR2C2_TRACKATTACHMENT_H_ +#define LIBR2C2_TRACKATTACHMENT_H_ + +#include "object.h" +#include "trackiter.h" + +namespace R2C2 { + +class TrackAttachment: public Object +{ +protected: + TrackIter track; + float offset; + + TrackAttachment(Layout &); +public: + virtual ~TrackAttachment(); + + const TrackIter &get_track_iter() const { return track; } + Track *get_track() const { return track.track(); } + unsigned get_entry() const { return track.entry(); } + float get_offset() const { return offset; } +protected: + void attach_to(const TrackIter &, float); + void attach_to_closest(float); + float find_offset(const TrackIter &, const Vector &); + +public: + virtual Track *get_parent() const { return track.track(); } +}; + +} // namespace R2C2 + +#endif