00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CL_Align__
00022 #define __CL_Align__
00023
00024 #include "CL_API.h"
00025 #include "CL_Clip.h"
00026
00027 enum CL_Alignment { NO_ALIGN =0,
00028 STRETCH_TO_FILL,
00029 ALIGN_TO_START,
00030 ALIGN_TO_END,
00031 SHIFT_TO_FIRST,
00032 TRUNC_TO_FIRST,
00033 STRETCH_TO_FIRST,
00034 TRUNC_TO_MIN,
00035 SQUASH_TO_MIN };
00036
00037 class CL_API CL_Align
00038 {
00039 public:
00040
00041 CL_Align();
00042 ~CL_Align();
00043
00044
00045 int getAlignment(CL_TrackListC &toAlign,
00046 CL_Alignment align,
00047 float &start, float &end);
00048
00049
00050
00051 int align(CL_TrackListC &toAlign,CL_Clip *dest,
00052 CL_Alignment align, float rate,
00053 float *fstart = 0, float *fend = 0);
00054
00055
00056
00057 int alignOnly(CL_TrackListC &toAlign, CL_Clip *dest,
00058 CL_Alignment align, float rate);
00059
00060
00061
00062
00063 int needsAlignment(float rate);
00064
00065
00066
00067
00068
00069 int align(const CL_Track *source,
00070 CL_Alignment align,
00071 float *dest, float rate);
00072
00073
00074
00075
00076 int align(const CL_Track *source,
00077 CL_Alignment align,
00078 float *dest, float rate,
00079 float segstart, float segend);
00080
00081
00082
00083 int getNumSamples() const { return myNumSamples; }
00084 private:
00085
00086 float findEarliestStart() const;
00087 float findLatestEnd() const;
00088 float findLatestStart() const;
00089 float findEarliestEnd() const;
00090
00091 const CL_Clip *findLongestClip(float *cliplen=0) const;
00092 const CL_Clip *findShortestClip(float *cliplen=0) const;
00093
00094 void alignNone(CL_Clip *dest,float start,float end);
00095
00096 void alignStart(CL_Clip *dest,float length);
00097 void alignEnd(CL_Clip *dest,float length);
00098
00099 void alignStretch(CL_Clip *dest);
00100
00101
00102 CL_TrackListC *myTracks;
00103 int myNumSamples;
00104 float myStart;
00105 float myEnd;
00106 };
00107
00108 #endif