第三方框架改为仓内子集并完善构建忽略规则
完整 NIM_Duilib_Framework 仓库移至父目录,third_party 仅保留实际使用的 base、duilib、bin/resources 与许可证;.gitignore 覆盖 MSBuild 与打包产物。
This commit is contained in:
1 parent
249e8548de
commit
e1e26acc49
391 files changed
+342850
No files matched your search
@@ -0,0 +1,108 @@
|
||||
#ifndef UI_ANIMATION_ANIMATIONPLAYER_H_
|
||||
#define UI_ANIMATION_ANIMATIONPLAYER_H_
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace ui
|
||||
{
|
||||
|
||||
typedef std::function<void (int)> PlayCallback;
|
||||
typedef std::function<void (void)> CompleteCallback;
|
||||
|
||||
class UILIB_API AnimationPlayerBase : public nbase::SupportWeakCallback
|
||||
{
|
||||
public:
|
||||
AnimationPlayerBase();
|
||||
~AnimationPlayerBase() { }
|
||||
|
||||
void SetAnimationType(int type) { m_animationType = type; };
|
||||
int GetAnimationType() const { return m_animationType; };
|
||||
void SetStartValue(int startValue) { m_startValue = startValue; }
|
||||
int GetStartValue() { return m_startValue; }
|
||||
|
||||
void SetEndValue(int endValue) { m_endValue = endValue; }
|
||||
int GetEndValue() { return m_endValue; }
|
||||
|
||||
void SetTotalMillSeconds(int totalMillSeconds) { m_totalMillSeconds = totalMillSeconds; }
|
||||
bool IsPlaying() { return m_bPlaying; }
|
||||
bool IsFirstRun() { return m_bFirstRun; }
|
||||
|
||||
void SetCallback(const PlayCallback& callback) { m_playCallback = callback; }
|
||||
void SetCompleteCallback(const CompleteCallback& callback) { m_completeCallback = callback; }
|
||||
|
||||
void Reset();
|
||||
virtual void Init();
|
||||
virtual void Start();
|
||||
virtual void Stop();
|
||||
virtual void Continue();
|
||||
virtual void ReverseContinue();
|
||||
virtual void StartTimer();
|
||||
virtual int GetCurrentValue() = 0;
|
||||
|
||||
private:
|
||||
void Play();
|
||||
void ReverseAllValue();
|
||||
void Complete();
|
||||
|
||||
protected:
|
||||
int m_animationType;
|
||||
int m_startValue;
|
||||
int m_endValue;
|
||||
int m_currentValue;
|
||||
|
||||
int m_totalMillSeconds;
|
||||
double m_palyedMillSeconds;
|
||||
int m_elapseMillSeconds;
|
||||
|
||||
bool m_bFirstRun;
|
||||
bool m_bPlaying;
|
||||
bool m_reverseStart;
|
||||
|
||||
PlayCallback m_playCallback;
|
||||
CompleteCallback m_completeCallback;
|
||||
|
||||
LARGE_INTEGER m_currentTime;
|
||||
LARGE_INTEGER m_timeFrequency;
|
||||
|
||||
nbase::WeakCallbackFlag m_weakFlagOwner;
|
||||
};
|
||||
|
||||
|
||||
class UILIB_API AnimationPlayer : public AnimationPlayerBase
|
||||
{
|
||||
public:
|
||||
AnimationPlayer();
|
||||
|
||||
virtual void Init() override;
|
||||
virtual void StartTimer() override;
|
||||
virtual int GetCurrentValue() override;
|
||||
|
||||
void InitFactor();
|
||||
virtual void SetSpeedUpfactorA(double factorA) { m_speedUpfactorA = factorA; }
|
||||
virtual void SetSpeedDownfactorA(double factorA) { m_speedDownfactorA = factorA; }
|
||||
|
||||
void SetMaxTotalMillSeconds(int maxTotalMillSeconds) { m_maxTotalMillSeconds = maxTotalMillSeconds; }
|
||||
void SetLinearSpeed(double linearSpeed) { m_linearSpeed = linearSpeed; }
|
||||
void SetSpeedUpRatio(double speedUpRatio) { m_speedUpRatio = speedUpRatio; }
|
||||
void SetSpeedDownRatio(double speedDownRatio) { m_speedDownRatio = speedDownRatio; }
|
||||
|
||||
private:
|
||||
double m_speedUpRatio;
|
||||
double m_speedDownRatio;
|
||||
double m_speedUpMillSeconds;
|
||||
|
||||
double m_linearSpeed;
|
||||
double m_linerMillSeconds;
|
||||
|
||||
double m_speedDownMillSeconds;
|
||||
|
||||
double m_speedUpfactorA;
|
||||
double m_speedDownfactorA;
|
||||
double m_speedDownfactorB;
|
||||
|
||||
int m_maxTotalMillSeconds;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
|
||||
#endif // UI_ANIMATION_ANIMATIONPLAYER_H_
|
||||
Reference in new issue
Block a user