2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #include "mainanimation.h"
13 using namespace boost
;
15 MainAnimation::MainAnimation(double speed
)
16 : AnimationGroup(true)
23 connect(&m_timer
, SIGNAL(timeout()), this, SLOT(tick()));
26 void MainAnimation::addAnimation(const shared_ptr
<Animation
>& a
) {
27 AnimationGroup::addPostAnimation(a
);
31 void MainAnimation::stop() {
32 AnimationGroup::stop();
35 void MainAnimation::tick() {
36 animationAdvance( int(m_time
.elapsed()*m_speed
) + m_translate
);
39 void MainAnimation::setSpeed(double speed
) {
40 int e
= m_time
.elapsed();
41 m_translate
= int((e
*m_speed
+ m_translate
) - e
*speed
);
45 void MainAnimation::setDelay(int delay
) {
46 m_timer
.setInterval(delay
);
49 #include "mainanimation.moc"