/Users/airy/Sources/augui/AUGUIFramework/Controls/TTimeLineControl.h

Go to the documentation of this file.
00001 /*
00002  *  TTimeLineControl.h
00003  *  Automat
00004  *
00005  *  Created by Stefan Kirch on Sun Jun 06 2004.
00006  *  Copyright (c) 2004 Stefan Kirch. All rights reserved.
00007  *
00008  */
00009 
00010 // -----------------------------------------------------------------------------
00011 
00012 #ifndef TTimeLineControl_H_
00013 #define TTimeLineControl_H_
00014 
00015 #include "TViewNoCompositingCompatible.h"
00016 
00017 // -----------------------------------------------------------------------------
00018 
00019 enum
00020 {       
00021     kTlc_SelectSyncOffset       = 0,
00022     kTlc_SelectMarkerLeft       = 1,
00023     kTlc_SelectMarkerRight  = 2,
00024     kTlc_SelectLoop                     = 3,
00025     kTlc_SelectPoint            = 4,
00026         kTlc_SelectNone                 = 5,
00027         
00028         kTlc_NumberOfPresets    = 16,
00029         kTlc_NumberOfPoints             = 64
00030 };
00031 
00032 typedef struct TLPoint
00033 {
00034         float   time;
00035         float   value;
00036 }
00037 TLPoint;
00038 
00039 typedef struct TLData
00040 {
00041         float   syncOffsetTime;
00042         float   leftMarkerTime;
00043         float   rightMarkerTime;
00044         
00045         int             syncOffsetIndex;
00046         int             leftMarkerIndex;
00047         int             rightMarkerIndex;
00048 
00049         float   markerDelta;
00050         
00051         int             numOfActivePoints;
00052         int             activeIndex;
00053         
00054     TLPoint points[kTlc_NumberOfPoints];
00055         float   timeDelta[kTlc_NumberOfPoints - 1];
00056 }
00057 TLData;
00058 
00059 // -----------------------------------------------------------------------------
00060 
00061 class TTimeLineControl:public TViewNoCompositingCompatible
00062 {
00063         AUGUIDefineControl(TTimeLineControl, TViewNoCompositingCompatible, "timeline");
00064 
00065 public:
00066         static  const                   OSType copyData = 'cpyD';
00067         static  void                    initTLData(TLData* data);
00068         static  void                    updateTLData(TLData* data);
00069 
00070 protected:
00071 
00072         TTimeLineControl(HIViewRef inControl);
00073     virtual ~TTimeLineControl();
00074         
00075     virtual ControlKind         GetKind();
00076         
00077         virtual bool                    UseNonblockingTracking(){return true;}
00078         
00079     virtual OSStatus            Initialize(TCarbonEvent& inEvent);
00080         
00081         virtual OSStatus                StartTracking(TCarbonEvent&inEvent, HIPoint& from);
00082     virtual OSStatus            StillTracking(TCarbonEvent&inEvent, HIPoint& from);
00083         
00084     virtual void                        DrawStaticBackground(RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing);
00085     virtual void                        CompatibleDraw(RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing);
00086         
00087     virtual void                        TitleChanged();
00088     virtual void                        ValueChanged();
00089         
00090         virtual OSStatus                SetData(OSType inTag, ControlPartCode inPart, Size inSize, const void* inPtr);
00091         virtual OSStatus                GetData(OSType inTag, ControlPartCode inPart, Size inSize, Size* outSize, void* inPtr);
00092 
00093 private:
00094         
00095         void                                    printTLData();
00096         
00097         CGImageRef                              mBackImage;
00098         float                                   mX, mY, mMemo, mTopValue, mTopNormalize;
00099         int                                             mMode;
00100         
00101         float                                   mLoopHandleOffset, mLoopHandleHeight, mLoopAreaHeight;
00102         float                                   mLineWidth, mRed, mGreen, mBlue, mAlpha;
00103         
00104         TLData                                  mData;
00105 };
00106 
00107 #endif
00108 
00109 // -----------------------------------------------------------------------------





Generated on Sat Jul 8 13:02:20 2006 for AUGUI Framework by doxygen1.4.6

hosted on SourceForge.net Logo