1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
5 ** $Id: keyframe.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === S T A R T =========================================================== */
24 #ifndef __SYNFIG_KEYFRAME_H
25 #define __SYNFIG_KEYFRAME_H
27 /* === H E A D E R S ======================================================= */
36 /* === M A C R O S ========================================================= */
38 /* === T Y P E D E F S ===================================================== */
40 /* === C L A S S E S & S T R U C T S ======================================= */
45 class Keyframe : public UniqueID
57 Keyframe(const Time &time);
61 void set_time(Time x) { time_=x; }
63 Time get_time()const { return time_; }
65 void set_description(String x) { desc_=x; }
67 String get_description()const { return desc_; }
69 const GUID& get_guid()const { return guid_; }
70 void set_guid(const GUID& x) { guid_=x; }
72 using UniqueID::operator<;
73 using UniqueID::operator==;
74 using UniqueID::operator!=;
75 using UniqueID::operator=;
77 bool operator<(const Keyframe &rhs)const { return time_<rhs.time_; }
78 bool operator<(const Time &rhs)const { return time_<rhs; }
80 // bool operator==(const Keyframe &rhs)const { return id_==rhs.id_; }
81 bool operator==(const Time &rhs)const { return time_==rhs; }
83 // bool operator!=(const Keyframe &rhs)const { return id_!=rhs.id_; }
84 bool operator!=(const Time &rhs)const { return time_!=rhs; }
85 }; // END of class Keyframe
87 class KeyframeList : public std::vector<Keyframe>
92 iterator add(const Keyframe &x);
94 void erase(const UniqueID &x);
96 iterator find(const UniqueID &x);
98 const_iterator find(const UniqueID &x)const;
100 //! Finds the keyframe at an exact point in time
101 iterator find(const Time &x);
103 //! Finds the keyframe after that point in time
104 iterator find_next(const Time &x);
106 //! Finds the keyframe before that point in time
107 iterator find_prev(const Time &x);
109 const_iterator find(const Time &x)const;
110 const_iterator find_next(const Time &x)const;
111 const_iterator find_prev(const Time &x)const;
113 void find_prev_next(const Time& time, Time &prev, Time &next)const;
115 void insert_time(const Time& location, const Time& delta);
121 //typedef std::list<Keyframe> KeyframeList;
123 }; // END of namespace synfig
125 /* === E N D =============================================================== */