1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_KEYFRAME_H
26 #define __SYNFIG_KEYFRAME_H
28 /* === H E A D E R S ======================================================= */
37 /* === M A C R O S ========================================================= */
39 /* === T Y P E D E F S ===================================================== */
41 /* === C L A S S E S & S T R U C T S ======================================= */
46 class Keyframe : public UniqueID
58 Keyframe(const Time &time);
62 void set_time(Time x) { time_=x; }
64 Time get_time()const { return time_; }
66 void set_description(String x) { desc_=x; }
68 String get_description()const { return desc_; }
70 const GUID& get_guid()const { return guid_; }
71 void set_guid(const GUID& x) { guid_=x; }
73 using UniqueID::operator<;
74 using UniqueID::operator==;
75 using UniqueID::operator!=;
76 using UniqueID::operator=;
78 bool operator<(const Keyframe &rhs)const { return time_<rhs.time_; }
79 bool operator<(const Time &rhs)const { return time_<rhs; }
81 // bool operator==(const Keyframe &rhs)const { return id_==rhs.id_; }
82 bool operator==(const Time &rhs)const { return time_==rhs; }
84 // bool operator!=(const Keyframe &rhs)const { return id_!=rhs.id_; }
85 bool operator!=(const Time &rhs)const { return time_!=rhs; }
86 }; // END of class Keyframe
88 class KeyframeList : public std::vector<Keyframe>
93 iterator add(const Keyframe &x);
95 void erase(const UniqueID &x);
97 iterator find(const UniqueID &x);
99 const_iterator find(const UniqueID &x)const;
101 //! Finds the keyframe at an exact point in time
102 iterator find(const Time &x);
104 //! Finds the keyframe after that point in time
105 iterator find_next(const Time &x);
107 //! Finds the keyframe before that point in time
108 iterator find_prev(const Time &x);
110 const_iterator find(const Time &x)const;
111 const_iterator find_next(const Time &x)const;
112 const_iterator find_prev(const Time &x)const;
114 void find_prev_next(const Time& time, Time &prev, Time &next)const;
116 void insert_time(const Time& location, const Time& delta);
122 //typedef std::list<Keyframe> KeyframeList;
124 }; // END of namespace synfig
126 /* === E N D =============================================================== */