TEST_F(AnimationEffectStackTest, ForwardsFillDiscarding) { play(makeKeyframeEffect( makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))), 2); play(makeKeyframeEffect( makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(2))), 6); play(makeKeyframeEffect( makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(3))), 4); document->compositorPendingAnimations().update(); ActiveInterpolationsMap interpolations; updateTimeline(11); ThreadState::current()->collectAllGarbage(); interpolations = EffectStack::activeInterpolations( &element->elementAnimations()->effectStack(), nullptr, nullptr, KeyframeEffectReadOnly::DefaultPriority); EXPECT_EQ(1u, interpolations.size()); EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize) ->equals(AnimatableDouble::create(3).get())); EXPECT_EQ(3u, sampledEffectCount()); updateTimeline(13); ThreadState::current()->collectAllGarbage(); interpolations = EffectStack::activeInterpolations( &element->elementAnimations()->effectStack(), nullptr, nullptr, KeyframeEffectReadOnly::DefaultPriority); EXPECT_EQ(1u, interpolations.size()); EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize) ->equals(AnimatableDouble::create(3).get())); EXPECT_EQ(3u, sampledEffectCount()); updateTimeline(15); ThreadState::current()->collectAllGarbage(); interpolations = EffectStack::activeInterpolations( &element->elementAnimations()->effectStack(), nullptr, nullptr, KeyframeEffectReadOnly::DefaultPriority); EXPECT_EQ(1u, interpolations.size()); EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize) ->equals(AnimatableDouble::create(3).get())); EXPECT_EQ(2u, sampledEffectCount()); updateTimeline(17); ThreadState::current()->collectAllGarbage(); interpolations = EffectStack::activeInterpolations( &element->elementAnimations()->effectStack(), nullptr, nullptr, KeyframeEffectReadOnly::DefaultPriority); EXPECT_EQ(1u, interpolations.size()); EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize) ->equals(AnimatableDouble::create(3).get())); EXPECT_EQ(1u, sampledEffectCount()); }
void ofxTLVideoPlayer::draw(){ if(player == NULL){ return; } if( autoUpdateTimelineOnDraw ) { updateTimeline(); } // cout << "in out is " << inFrame << " " << outFrame << endl; ofPushStyle(); if(thumbsEnabled && getDrawRect().height > 10){ ofSetColor(255); for(int i = 0; i < videoThumbs.size(); i++){ if(videoThumbs[i].visible){ videoThumbs[i].thumb.draw(videoThumbs[i].displayRect); } } for(int i = 0; i < videoThumbs.size(); i++){ if(videoThumbs[i].visible){ if (!thumbsEnabled) { ofFill(); ofSetColor(0); ofRect(videoThumbs[i].displayRect); } ofNoFill(); ofSetColor(255, 150, 0); ofDrawBitmapString(ofToString(videoThumbs[i].framenum), videoThumbs[i].displayRect.x+5, videoThumbs[i].displayRect.y+15); ofRect(videoThumbs[i].displayRect); } } } int selectedFrameX = screenXForIndex(selectedFrame); ofSetColor(0, 125, 255); ofLine(selectedFrameX, bounds.y, selectedFrameX, bounds.y+bounds.height); ofDrawBitmapString(ofToString(selectedFrame), selectedFrameX, bounds.y+35); if(inFrame != -1){ ofSetLineWidth(2); ofSetColor(timeline->getColors().highlightColor); int inFrameX = screenXForIndex(inFrame); int outFrameX = screenXForIndex(outFrame); ofLine(inFrameX, bounds.y, inFrameX, bounds.y+bounds.height); ofLine(outFrameX, bounds.y, outFrameX, bounds.y+bounds.height); ofSetColor(timeline->getColors().keyColor); ofDrawBitmapString("IN: " + ofToString(inFrameX), inFrameX + 5, bounds.y + 10); ofDrawBitmapString("OUT: " + ofToString(outFrameX), outFrameX + 5, bounds.y + bounds.height - 20); } ofPopStyle(); }
void CuculusView::slotSendTweetResult( KJob *j ) { Cuculus::PostJob *job = static_cast<Cuculus::PostJob *>( j ); if ( job->error() ) { qDebug() << "ERROR" << job->errorText(); } else { qDebug() << "SUCCESS SENDING TWEET"; updateTimeline(); } }
CuculusView::CuculusView(QWidget *) : m_currentTweetIndex( 0 ) { setObjectName( "view" ); m_model = new CuculusModel; QBoxLayout *mainLayout = new QHBoxLayout( this ); QBoxLayout *topLayout = new QVBoxLayout; mainLayout->addLayout( topLayout ); m_timeLabel = new QLabel; topLayout->addWidget( m_timeLabel ); m_timeLabel->setAlignment( Qt::AlignCenter ); connect( &m_timeLabelTimer, SIGNAL( timeout() ), SLOT( updateTimeLabel() ) ); m_timeLabelTimer.start( 60 * 1000 ); QBoxLayout *countLayout = new QHBoxLayout; topLayout->addLayout( countLayout ); QLabel *label = new QLabel( i18n("What are you doing?") ); countLayout->addWidget( label ); countLayout->addStretch( 1 ); m_countLabel = new QLabel; countLayout->addWidget( m_countLabel ); m_tweetEdit = new QTextEdit; m_tweetEdit->setFixedHeight( 60 ); topLayout->addWidget( m_tweetEdit ); connect( m_tweetEdit, SIGNAL( textChanged() ), SLOT( updateEditCount() ) ); connect( m_tweetEdit, SIGNAL( textChanged() ), SLOT( checkUpdateButton() ) ); m_updateButton = new QPushButton( "Update" ); topLayout->addWidget( m_updateButton ); connect( m_updateButton, SIGNAL( clicked() ), SLOT( sendTweet() ) ); QBoxLayout *updateLayout = new QHBoxLayout; topLayout->addLayout( updateLayout ); updateLayout->addStretch( 1 ); QPushButton *button = new QPushButton( "Get latest tweets" ); updateLayout->addWidget( button ); connect( button, SIGNAL( clicked() ), SLOT( updateTimeline() ) ); m_upButton = new QPushButton; connect( m_upButton, SIGNAL( clicked() ), SLOT( pageUp() ) ); QString picPath = KStandardDirs::locate( "appdata", "1uparrow.png" ); m_upButton->setIcon( QPixmap( picPath ) ); topLayout->addWidget( m_upButton ); m_tweetsView = new TweetListView; topLayout->addWidget( m_tweetsView, 1 ); m_tweetsView->setStyleSheet("background-color: white"); m_downButton = new QPushButton; connect( m_downButton, SIGNAL( clicked() ), SLOT( pageDown() ) ); picPath = KStandardDirs::locate( "appdata", "1downarrow.png" ); m_downButton->setIcon( QPixmap( picPath ) ); topLayout->addWidget( m_downButton ); FriendsView *friendsView = new FriendsView; mainLayout->addWidget( friendsView ); updateEditCount(); checkUpdateButton(); updateTimeLabel(); updatePageButtons(); settingsChanged(); setAutoFillBackground(true); updateTimeline(); }