Beispiel #1
0
void QgsComposerMouseHandles::selectionChanged()
{
  //listen out for selected items' size and rotation changed signals
  QList<QGraphicsItem *> itemList = composition()->items();
  QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
  for ( ; itemIt != itemList.end(); ++itemIt )
  {
    QgsComposerItem* item = dynamic_cast<QgsComposerItem *>( *itemIt );
    if ( item )
    {
      if ( item->selected() )
      {
        QObject::connect( item, SIGNAL( sizeChanged() ), this, SLOT( selectedItemSizeChanged() ) );
        QObject::connect( item, SIGNAL( itemRotationChanged( double ) ), this, SLOT( selectedItemRotationChanged() ) );
        QObject::connect( item, SIGNAL( frameChanged() ), this, SLOT( selectedItemSizeChanged() ) );
        QObject::connect( item, SIGNAL( lockChanged() ), this, SLOT( selectedItemSizeChanged() ) );
      }
      else
      {
        QObject::disconnect( item, SIGNAL( sizeChanged() ), this, nullptr );
        QObject::disconnect( item, SIGNAL( itemRotationChanged( double ) ), this, nullptr );
        QObject::disconnect( item, SIGNAL( frameChanged() ), this, nullptr );
        QObject::disconnect( item, SIGNAL( lockChanged() ), this, nullptr );
      }
    }
void BlackBerryAnimationBase::animationTimerFired(WebCore::Timer<BlackBerryAnimationBase>*)
{
    double time = WTF::currentTime();
    double previousValue = m_currentValue;
    m_currentTime += (time - m_previousFrameTime) * 1000;
    m_previousFrameTime = time;

    if (m_currentTime > m_duration) {
#if ENABLE_FRAME_COUNTER_DEBUG
        Olympia::Platform::log(Olympia::Platform::LogLevelInfo, "Animation finished. Frames rendered = %d Frames/Sec = %f\n", m_frameCount + 1, (double)(m_frameCount + 1) / m_currentTime * 1000);
#endif
        stop();
        frameChanged(-1.0, previousValue);
        return;
    }

    if (!m_canRenderNextFrame)
        return;

#if ENABLE_FRAME_COUNTER_DEBUG
        m_frameCount++;
#endif
        m_canRenderNextFrame = false;
        m_currentValue = valueForTimeLinear(m_currentTime);
        frameChanged(m_currentValue, previousValue);
}
Beispiel #3
0
void PreviewRuler::setRenderer( GenericRenderer* renderer )
{
    if ( m_renderer )
    {
        disconnect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason ) ) );
    }
    m_renderer = renderer;

    connect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason) ),
             this, SLOT( update() ) );
    connect( m_renderer, SIGNAL( frameChanged(qint64, MainWorkflow::FrameChangedReason) ),
             this, SLOT( updateTimecode( qint64 ) ) );
    connect( m_renderer, SIGNAL( stopped() ),
             this, SLOT( clear() ) );
}
Beispiel #4
0
void PhTimeCodeEdit::onTextChanged(QString text)
{
	if(isTimeCode()) {
		PhFrame frame = PhTimeCode::frameFromString(text, _tcType);
		emit frameChanged(frame, _tcType);
	}
}
void VideoInputControlThread::run()
{
    struct timeval	start_loop;
    struct timeval	stop_loop;
    unsigned long long	elapsedTime;
    int framesCount = 0;

    while (this->running || framesCount != 0) {
        gettimeofday(&start_loop, NULL);

        if (this->isCapturing()) {
            VideoFramePointer frame = VideoFramePointer(this->device->getFrame());

            emit frameChanged(frame);
        }

        gettimeofday(&stop_loop, NULL);

        elapsedTime = (stop_loop.tv_sec - start_loop.tv_sec) * _USECOND;
        elapsedTime = elapsedTime + (stop_loop.tv_usec - start_loop.tv_usec);

        if (elapsedTime < this->videoConfig.delta_time)
            this->usleep(this->videoConfig.delta_time - elapsedTime);

        framesCount = (framesCount + 1) % this->videoConfig.fps;
    }

}
Beispiel #6
0
int _movie::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    typedef Phonon::VideoWidget QMocSuperClass;
    _id = QMocSuperClass::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: stateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 1: aboutToFinish(); break;
        case 2: finished(); break;
        case 3: SoundOnEvent(); break;
        case 4: EVENT_OnEvent(); break;
        case 5: EVENT_OnTick((*reinterpret_cast< t_long(*)>(_a[1]))); break;
        case 6: EVENT_OnStateChanged((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 7: EVENT_OnAboutToFinish(); break;
        case 8: EVENT_OnFinished(); break;
        case 9: EVENT_OnMutedChanged((*reinterpret_cast< t_boolean(*)>(_a[1]))); break;
        case 10: EVENT_OnVolumeChanged((*reinterpret_cast< t_integer(*)>(_a[1]))); break;
        case 11: EVENT_OnPlayingTitleChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 12: EVENT_OnBufferStatus((*reinterpret_cast< t_integer(*)>(_a[1]))); break;
        case 13: EVENT_OnTotalTimeChanged((*reinterpret_cast< t_long(*)>(_a[1]))); break;
        case 14: frameChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 15: cursoranimation_frameChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        }
        _id -= 16;
    }
    return _id;
}
Beispiel #7
0
void RealPaintWidget::setFrame( qreal f , bool played)
{
	for(int i=0; i<layers.size(); i++)
		layers[i]->setCurrentFrameForLayer((int)(f),played);

	if(currentFrame != int(f) && !played)
	{
		currentFrame = int(f);
		emit frameChanged( qreal(currentFrame) );
		selection.reset();
	}

	update();

	if(played)
	{
		this->setEnabled(false);
		emit isPlayed();
		return;
	}

	if( !layers[currentLayer]->isContainsFrame( currentFrame ))
	{
		this->setEnabled(false);
		emit isFrame(false);
	}
	else
	{
		this->setEnabled(true);
		emit isFrame(true);
	}
}
Beispiel #8
0
void
ClipRenderer::togglePlayPause( bool forcePause )
{
    if ( m_clipLoaded == false )
    {
        emit frameChanged( 0, Vlmc::Renderer );
        startPreview();
        return ;
    }
    if ( m_paused == false && m_isRendering == true )
    {
        m_mediaPlayer->pause();
        m_paused = true;
    }
    else if ( forcePause == false )
    {
        if ( m_isRendering == false )
        {
            m_mediaPlayer->play();
            m_mediaPlayer->setPosition( m_begin / ( m_end - m_begin ) );
            m_isRendering = true;
        }
        else
            m_mediaPlayer->play();
        m_paused = false;
    }
}
SpriteAnimationItem::SpriteAnimationItem(QState *parent)
    : QState(parent)
    , m_spriteSheet(new SpriteSheet)
    , m_spriteAnimation(new QPropertyAnimation(this))
{
    connect(m_spriteSheet, SIGNAL(sourceChanged()), this, SIGNAL(sourceChanged()));
    connect(m_spriteSheet, SIGNAL(frameChanged()), this, SIGNAL(frameChanged()));
    connect(m_spriteSheet, SIGNAL(framesChanged()), this, SIGNAL(framesChanged()));
    connect(m_spriteSheet, SIGNAL(initialFrameChanged()), this, SIGNAL(initialFrameChanged()));

    connect(m_spriteAnimation, SIGNAL(finished()), this, SIGNAL(finished()));

    m_spriteAnimation->setTargetObject(m_spriteSheet);
    m_spriteAnimation->setPropertyName("frame");
    m_spriteAnimation->setStartValue(0);
}
Beispiel #10
0
void PaintWidget::addFrame(int position)
{
	painter.layers[painter.currentLayer]->addFrameForLayer( position, false );
	painter.setFrame( position, false );
	emit frameChanged(qreal(position));
	emit StateChanged("Add frame");
}
Beispiel #11
0
void paintFrame(){
  if(frameChanged()){
    OrbitOledClear();

    OrbitOledMoveTo((int)(g.x1),(int)g.y1);
    OrbitOledFillRect((int)(g.x1+guns1),(int)(g.y1+guns1));
    // gy2=gy-((gsize2-gsize)/2);
    OrbitOledMoveTo((int)(g.x2),(int)g.y2);
    OrbitOledFillRect((int)(g.x2+guns2),(int)(g.y2+guns2));
    OrbitOledUpdate();
    for(int i=0;i<maxGeese;i++){
      if(ge[i].valid){
        OrbitOledMoveTo((int)ge[i].x,(int)ge[i].y);
        OrbitOledFillRect((int)ge[i].x+geeseSize,(int)ge[i].y+geeseSize);
      }
    }
    OrbitOledUpdate();
    for(int i=0;i<maxBullet;i++){
      if(b[i].valid){
        OrbitOledMoveTo((int)b[i].x,(int)b[i].y);
        OrbitOledFillRect((int)b[i].x+bulletSize,(int)b[i].y+bulletSize);
      }
    }
    OrbitOledUpdate();
  }
}
Beispiel #12
0
void
TimeLine::seekFrame(SequenceTime frame,
                    bool updateLastCaller,
                    const EffectInstancePtr& caller,
                    TimelineChangeReasonEnum reason)
{
    if (reason != eTimelineChangeReasonPlaybackSeek) {
        Q_EMIT frameAboutToChange();
    }
    bool changed = false;
    {
        QMutexLocker l(&_lock);
        if (_currentFrame != frame) {
            _currentFrame = frame;
            changed = true;
        }
        _lastSeekReason = reason;
    }

    if (_project && updateLastCaller) {
        _project->getApp()->setLastViewerUsingTimeline( caller ? caller->getNode() : NodePtr() );
    }
    if (changed) {
        Q_EMIT frameChanged(frame, (int)reason);
    }
}
Beispiel #13
0
void WaveformView::playSegment(LipsyncPhrase *fPhrase, LipsyncWord *fWord, LipsyncPhoneme *fPhoneme, int32 fScrubFrame)
{
    bool playSegment = false;
    QMediaPlayer *audioPlayer = fDoc->GetAudioPlayer();
    int32 startFrame;
    fAudioStopFrame = -1;
    if (audioPlayer)
    {
        if (fPhrase)
        {
            playSegment = true;
            startFrame = fPhrase->fStartFrame;
            fAudioStopFrame = fPhrase->fEndFrame + 1;
        }
        else if (fWord)
        {
            playSegment = true;
            startFrame = fWord->fStartFrame;
            fAudioStopFrame = fWord->fEndFrame + 1;
        }
        else if (fPhoneme)
        {
            playSegment = true;
            startFrame = fPhoneme->fFrame;
            fAudioStopFrame = startFrame + 1;
        }
        if (playSegment)
        {
            float f = ((real)startFrame / (real)fDoc->Fps()) * 1000.0f;
            audioPlayer->setPosition(PG_ROUND(f));
            audioPlayer->play();
            emit(frameChanged(fScrubFrame));
        }
    }
}
void MatchReplayController::changeFrame() {
	switch (mode) {
	case Mode::REPLAY_REWIND_2:
		ticks -= 2; break;
	case Mode::REPLAY_REWIND_4:
		ticks -= 4; break;
	case Mode::REPLAY_REWIND_8:
		ticks -= 8; break;
	case Mode::REPLAY_PLAY:
		ticks += 1; break;
	case Mode::REPLAY_FORWARD_2:
		ticks += 2; break;
	case Mode::REPLAY_FORWARD_4:
		ticks += 4; break;
	case Mode::REPLAY_FORWARD_8:
		ticks += 8; break;
	default:
		break;
	}

	int old = ticks;
	ticks = Math::clamp<int>(0, ticks, recording->size() - 1);

	if (ticks == old)
		emit frameChanged((*recording)[ticks]);
}
void BlackBerryAnimationBase::start()
{
    m_previousFrameTime = WTF::currentTime();
    frameChanged(m_currentValue, m_currentValue);
    m_timer.startRepeating(.001 * m_updateInterval);
    m_isRunning = true;
}
Beispiel #16
0
MediaPlayer::MediaPlayer(Data::DataManager * const _dataManager)
	:dataManager(_dataManager)
	,player(_dataManager)
{
	auto videoWidget = new Video::Widget();
	auto surface = videoWidget->videoSurface();

	player.start(surface);
	mediaControl = player.getMediaControl();

	playPauseButton = new QPushButton;
	playPauseButton->setEnabled(false);
	playPauseButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
	playPauseButton->setText("PlayPause");

	connect(playPauseButton, SIGNAL(clicked()),this, SLOT(playPause()));

	positionSlider = new QSlider(Qt::Horizontal);
	positionSlider->setRange(0, 10000);
	connect(positionSlider, SIGNAL(sliderMoved(int)),this, SLOT(sliderChanged(int)));
	connect(positionSlider, SIGNAL(sliderPressed()),this, SLOT(sliderPressed()));
	connect(positionSlider, SIGNAL(sliderReleased()),this, SLOT(sliderReleased()));

	connect(surface, SIGNAL(frameChanged(I8u)),this, SLOT(frameChanged(I8u)));
	connect(surface, SIGNAL(durationFramesChanged(I8u)),this, SLOT(durationFramesChanged(I8u)));

	connect(this, SIGNAL(setSlider(int)),positionSlider, SLOT(setValue(int)));
	
	QBoxLayout * controlLayout = new QHBoxLayout;
	controlLayout->addWidget(playPauseButton);
	controlLayout->addWidget(positionSlider);

	QBoxLayout * layout = new QVBoxLayout;
	layout->addWidget(videoWidget);
	layout->addLayout(controlLayout);

	createActions();
	createMenus();

	auto window = new QWidget;
	window->setLayout(layout);
	setCentralWidget(window);

	setWindowTitle(tr("Media Player"));
	resize(600, 600);
	
}
Beispiel #17
0
void Q3Frame::setMargin(int w)
{
    if (marg == w)
        return;
    marg = w;
    update();
    frameChanged();
}
Beispiel #18
0
void QgsComposerShape::refreshSymbol()
{
  mMaxSymbolBleed = QgsSymbolLayerUtils::estimateMaxSymbolBleed( mShapeStyleSymbol );
  updateBoundingRect();

  update();
  emit frameChanged();
}
Beispiel #19
0
void ApiTraceModel::changed(ApiTraceEvent *event)
{
    if (event->type() == ApiTraceEvent::Call) {
        callChanged(static_cast<ApiTraceCall*>(event));
    } else if (event->type() == ApiTraceEvent::Frame) {
        frameChanged(static_cast<ApiTraceFrame*>(event));
    }
}
djvGlslTestPlaybackToolBar::djvGlslTestPlaybackToolBar(
    djvGlslTestPlayback * playback,
    djvGlslTestContext *  context,
    QWidget *             parent) :
    QToolBar(parent),
    _playback(playback),
    _buttons(0),
    _slider (0)
{
    QWidget * widget = new QWidget;
    widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    
    _buttons = new djvPlaybackButtons(context);
    
    _slider = new djvViewFrameSlider(context);
    
    QHBoxLayout * layout = new QHBoxLayout(widget);
    layout->setMargin(5);
    layout->setSpacing(5);
    layout->addWidget(_buttons);
    layout->addWidget(_slider);
    
    addWidget(widget);
    setMovable(false);
    setFloatable(false);
    
    _buttons->setPlayback(playback->playback());
    
    _slider->setFrameList(playback->sequence().frames);
    _slider->setSpeed(playback->sequence().speed);
    
    _slider->connect(
        _playback,
        SIGNAL(frameChanged(qint64)),
        SLOT(setFrame(qint64)));
    
    _playback->connect(
        _buttons,
        SIGNAL(playbackChanged(djvPlaybackUtil::PLAYBACK)),
        SLOT(setPlayback(djvPlaybackUtil::PLAYBACK)));
    
    _playback->connect(
        _slider,
        SIGNAL(frameChanged(qint64)),
        SLOT(setFrame(qint64)));
}
Beispiel #21
0
void	FakePlayer::newTick()
{
 //   qDebug() << frameNumber;
    emit frameChanged(frameNumber++);
    if (duration != 0 && frameNumber * (int)interval >= duration) {
        emit finished();
        timer.stop();
    }
}
Beispiel #22
0
void
TracksRuler::mouseMoveEvent( QMouseEvent* event )
{
    if ( event->buttons() == Qt::LeftButton &&
         event->modifiers() == Qt::NoModifier )
    {
        emit frameChanged( qMax( (qreal)0, (qreal)( event->x() + offset() ) / m_factor ), Vlmc::RulerCursor );
    }
}
Beispiel #23
0
void QgsAnimatedIcon::disconnectFrameChanged( const QObject * receiver, const char * method )
{
  if ( disconnect( this, SIGNAL( frameChanged() ), receiver, method ) )
  {
    mCount--;
  }
  mMovie->setPaused( mCount == 0 );
  QgsDebugMsgLevel( QString( "mCount = %1" ).arg( mCount ), 3 );
}
Beispiel #24
0
void MarkerData::setFrame(int frame)
{
  if (frame>=0 && frame<size() && current_frame!=frame) {
    current_frame=frame;
    emit frameChanged(frame);

  }

}
Beispiel #25
0
void
MainWorkflow::previousFrame( Workflow::TrackType trackType )
{
    QWriteLocker    lock( m_currentFrameLock );

    --m_currentFrame[trackType];
    if ( trackType == Workflow::VideoTrack )
        emit frameChanged( m_currentFrame[Workflow::VideoTrack], Vlmc::Renderer );
}
Beispiel #26
0
void
MainWorkflow::setCurrentFrame( qint64 currentFrame, Vlmc::FrameChangedReason reason )
{
    QWriteLocker    lock( m_currentFrameLock );

    for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i)
        m_currentFrame[i] = currentFrame;
    emit frameChanged( currentFrame, reason );
}
Beispiel #27
0
void PreviewRuler::setFrame( qint64 frame, bool broadcastEvent /*= false*/ )
{
    m_frame = frame;
    if ( m_isSliding && broadcastEvent == true )
    {
        emit frameChanged( frame, MainWorkflow::PreviewCursor );
    }
    update();
}
Beispiel #28
0
QgsGrassImport::~QgsGrassImport()
{
  if ( mFutureWatcher && !mFutureWatcher->isFinished() )
  {
    QgsDebugMsg( "mFutureWatcher not finished -> waitForFinished()" );
    mFutureWatcher->waitForFinished();
  }
  QgsGrassImportIcon::instance()->disconnectFrameChanged( this, SLOT( frameChanged() ) );
}
void QQuickAnimatedImage::movieUpdate()
{
    Q_D(QQuickAnimatedImage);

    if (d->_movie) {
        d->setImage(d->_movie->currentPixmap().toImage());
        emit frameChanged();
    }
}
Beispiel #30
0
void QgsComposerShape::refreshSymbol()
{
  QgsRenderContext rc = QgsComposerUtils::createRenderContextForMap( mComposition->referenceMap(), nullptr, mComposition->printResolution() );
  mMaxSymbolBleed = ( 25.4 / mComposition->printResolution() ) * QgsSymbolLayerUtils::estimateMaxSymbolBleed( mShapeStyleSymbol, rc );

  updateBoundingRect();

  update();
  emit frameChanged();
}