ASPiK SDK
animator.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __animator__
6 #define __animator__
7 
8 #include "../vstguifwd.h"
9 #include <string>
10 #include <functional>
11 #include <memory>
12 
13 namespace VSTGUI {
14 namespace Animation {
15 
16 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
21 {
22 public:
23  //-----------------------------------------------------------------------------
25  //-----------------------------------------------------------------------------
27 
32  void addAnimation (CView* view, IdStringPtr name, IAnimationTarget* target, ITimingFunction* timingFunction, CBaseObject* notificationObject = nullptr);
33 
39  void addAnimation (CView* view, IdStringPtr name, IAnimationTarget* target, ITimingFunction* timingFunction, DoneFunction notification);
40 
45  void removeAnimation (CView* view, IdStringPtr name);
46 
48  void removeAnimations (CView* view);
50 
52 
53  Animator (); // do not use this, instead use CFrame::getAnimator()
54  void onTimer ();
55 
56 protected:
57  ~Animator () noexcept override;
58 
59  struct Impl;
60  std::unique_ptr<Impl> pImpl;
62 };
63 
64 extern IdStringPtr kMsgAnimationFinished;
65 
66 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
73 {
74 public:
75  FinishedMessage (CView* view, const std::string& name, IAnimationTarget* target) : view (view), name (name), target (target) {}
76 
77  CView* getView () const { return view; }
78  const IdStringPtr getName () const { return name.c_str (); }
79  IAnimationTarget* getTarget () const { return target; }
80 
81  CLASS_METHODS_NOCOPY(FinishedMessage, CBaseObject)
82 protected:
83  CView* view;
84  const std::string& name;
85  IAnimationTarget* target;
86 };
87 
88 }} // namespaces
89 
90 #endif // __animator__
Animation Finished Message Object.
Definition: animator.h:72
void removeAnimation(CView *view, IdStringPtr name)
Definition: animator.cpp:290
Base Object with reference counter.
Definition: vstguibase.h:276
Animation timing function interface.
Definition: itimingfunction.h:17
void addAnimation(CView *view, IdStringPtr name, IAnimationTarget *target, ITimingFunction *timingFunction, CBaseObject *notificationObject=nullptr)
Definition: animator.cpp:275
Definition: customcontrols.cpp:8
void removeAnimations(CView *view)
Definition: animator.cpp:309
Definition: vstguibase.h:247
Base Class of all view objects.
Definition: cview.h:44
Animation runner.
Definition: animator.h:20
Animation target interface.
Definition: ianimationtarget.h:17