00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __DEMOPAJA_TIMESEGMENTC_H__
00015 #define __DEMOPAJA_TIMESEGMENTC_H__
00016
00017
00018 #include "DataBlockI.h"
00019 #include "PajaTypes.h"
00020 #include "EditableI.h"
00021 #include "KeyC.h"
00022 #include "UndoC.h"
00023 #include "FileIO.h"
00024 #include <vector>
00025
00026
00027 namespace Composition {
00028
00030
00046 class TimeSegmentC : public Edit::EditableI
00047 {
00048 public:
00050
00052 static TimeSegmentC* create_new();
00054
00058 static TimeSegmentC* create_new( PajaTypes::int32 i32SegmentStart, PajaTypes::int32 i32SegmentEnd );
00059
00061
00063 virtual Edit::DataBlockI* create();
00065 virtual Edit::DataBlockI* create( Edit::EditableI* pOriginal );
00067 virtual void copy( Edit::EditableI* pEditable );
00069 virtual void restore( Edit::EditableI* pEditable );
00070
00072 virtual PajaTypes::int32 get_segment_start();
00074 virtual void set_segment_start( PajaTypes::int32 i32Start );
00075
00077 virtual PajaTypes::int32 get_key_count();
00079 virtual KeyC* get_key( PajaTypes::int32 i32Index );
00081 virtual void del_key( PajaTypes::int32 i32Index );
00082
00084
00087 virtual PajaTypes::int32 get_key_time( PajaTypes::int32 i32Index );
00088
00090
00093 virtual void set_key_time( PajaTypes::int32 i32Index, PajaTypes::int32 i32Time );
00094
00096
00099 virtual KeyC* get_key_at_time( PajaTypes::int32 i32Time );
00101
00104 virtual KeyC* add_key_at_time( PajaTypes::int32 i32Time );
00105
00107 virtual void sort_keys();
00108
00110 virtual bool is_visible( PajaTypes::int32 i32Time );
00111
00113 virtual PajaTypes::uint32 save( FileIO::SaveC* pSave );
00115 virtual PajaTypes::uint32 load( FileIO::LoadC* pLoad );
00116
00117 protected:
00119 TimeSegmentC();
00121 TimeSegmentC( PajaTypes::int32 i32SegmentStart, PajaTypes::int32 i32SegmentLength );
00123 TimeSegmentC( Edit::EditableI* pOriginal );
00125 virtual ~TimeSegmentC();
00126
00127 private:
00128 PajaTypes::int32 m_i32SegmentStart;
00129 std::vector<KeyC*> m_rTrimKeys;
00130 };
00131
00132 };
00133
00134 #endif // __DEMOPAJA_TIMESEGMENTC_H__