Esempio n. 1
0
/**
 * @brief Increase current time or stop timer if last frame
 */
void MainWindow::increaseTime()
{

        if( _time>-1 && _time < getTimeline().getMaxTime() )
                ++ _time;
        if( _time == getTimeline().getMaxTime() )
                _time = 0;

        Q_EMIT timeChanged( _time );
}
Esempio n. 2
0
void ofxTLBeatTicker::setup() {
	bpmScreenPoints.clear();
	ofxTLTicker::setup();
	(*(getTimeline()->getPages().begin()))->setTicker(this);
	getTimeline()->setTicker(this);
	setBPM(getTimeline()->getBPM());
	isSetup = true;
	refreshTickMarks();
	bMouseCursorInside = false;
	disabled = false;
}
Esempio n. 3
0
TimelineTable::TimelineTable( QWidget* parent )
: QWidget( parent )
, _ui( new Ui::TimelineTable )
, _defautIcon( QIcon( "img/none.jpg" ) )
{
	_ui->setupUi( this );

	_table = new Table( this );

	_table->setIconSize( QSize( 100, 100 ) );
	_table->horizontalHeader()->setDefaultSectionSize( 100 );
	_table->verticalHeader()->setDefaultSectionSize( _table->iconSize().height() );

        //add the table on the widget
	QVBoxLayout *layout = new QVBoxLayout( _ui->widgetContentTable );
	layout->addWidget( _table );

        //connect timelineUi updater to the timeline signalChanged
	TimeLineUiUpdater upd( *this );

	getTimeline().getSignalChanged().connect( upd );

	updateTable();

	connect( this->_table, SIGNAL( cellClicked( int, int ) ), this, SLOT( getCurrentTime( int, int ) ) );
	connect( this->_table, SIGNAL( currentCellChanged( int, int, int, int ) ), this, SLOT( getCurrentTime( int, int ) ) );
	connect( _ui->spinFps, SIGNAL( valueChanged( int ) ), this, SLOT( changeFps( int ) ) );

}
Esempio n. 4
0
void MainWindow::createWidgetViewer()
{
        _contentViewerDock = new QDockWidget( "Viewer", this );
        _viewerImg = new ViewerTweedy( _contentViewerDock );
        _contentViewerDock->setWidget( _viewerImg );
        addDockWidget( Qt::TopDockWidgetArea, _contentViewerDock );

        _viewMenu->addAction( _contentViewerDock->toggleViewAction() );

	_viewerImg->getCaptureButton()->setDefaultAction( _captureAction );
	_viewerImg->getCaptureButton()->setIconSize( QSize( 60, 60 ) );

	/// @todo ne pas appeler la timeline depuis le viewer !
	/// Mais emettre des signaux dans chacun et repasser par la MainWindow,
	/// pour changer le temps.
        //connect viewer buttons with timeline actions
        _viewerImg->getNextButton()->setDefaultAction( getNextAction() );
        _viewerImg->getNextButton()->setIconSize( QSize( 26, 26 ) );
        _viewerImg->getPlayPauseButton()->setDefaultAction( getPlayPauseAction() );
        _viewerImg->getPlayPauseButton()->setIconSize( QSize( 26, 26 ) );
        _viewerImg->getPreviousButton()->setDefaultAction( getPreviousAction() );
        _viewerImg->getPreviousButton()->setIconSize( QSize( 26, 26 ) );
        _viewerImg->getRetour0Button()->setDefaultAction( getRetour0Action() );
        _viewerImg->getRetour0Button()->setIconSize( QSize( 26, 26 ) );
	//timer
	//connection slider
	_viewerImg->getTempsSlider()->setTickPosition( QSlider::TicksAbove );
        //signal : valueChanged() : Emitted when the slider's value has changed.
        connect( _viewerImg->getTempsSlider(), SIGNAL( valueChanged( int ) ), this, SLOT( changeTimeViewer( int ) ) );
        _viewerImg->getTempsSlider()->setMaximum( getTimeline().getMaxTime() );

        connect(this,SIGNAL(timeChanged(int)), this, SLOT(changeTimeViewer(int)));
        connect( _viewerImg->getComboFPS(), SIGNAL( currentIndexChanged(QString) ), this, SLOT( changeFps( QString ) ));
}
Esempio n. 5
0
void ofxTLNotes::playbackLooped(ofxTLPlaybackEventArgs &args){
    for(int i = 0; i < keyframes.size(); i++){
		ofxTLNote* switchKey = (ofxTLNote*)keyframes[i];
    	if(switchKey->growing){
            switchKey->growing = false;
            switchKey->endSelected = switchKey->startSelected = false;
            switchKey->timeRange.max = getTimeline()->getOutTimeInMillis();
        }
        
    }
}
Esempio n. 6
0
void RemotePollSubscriber::sendUpdate()
{
  if (m_response)
  {
    // if we have a response, we are handling a poll request
    m_response->setStatusCode(qhttp::ESTATUS_OK);
    m_response->write(getTimeline());

    m_response->end();
    m_response = NULL;
  }
}
Esempio n. 7
0
void MainWindow::handle_nextAction_triggered()
{
        Timeline::OMapClip orderedClips = getTimeline().getOrderedClips();
        bool lastClip = true;

        BOOST_FOREACH( const Timeline::OMapClip::value_type& s, orderedClips )
        {
                if( s.first > _time )
                {
                        lastClip = false;
                        _time = s.first;
                        break;
                }
                if( ( *s.second )->timeOut() > _time && ( *s.second )->timeOut() < getTimeline().getMaxTime() )
                {
                        lastClip = false;
                        _time = ( *s.second )->timeOut();
                        break;
                }
        }

        if( !lastClip )
                Q_EMIT timeChanged( _time );
}
Esempio n. 8
0
void RemoteSubscriber::sendUpdate()
{
  QUrl url(m_address);
  url.setPath("/:/timeline");

  QNetworkRequest request(url);
  request.setHeader(QNetworkRequest::ContentTypeHeader, "application/xml");
  request.setAttribute(QNetworkRequest::User, m_clientIdentifier);

  QVariantMap headers = RemoteComponent::HeaderInformation();
  foreach (const QString& key, headers.keys())
  {
    request.setRawHeader(key.toUtf8(), headers[key].toString().toUtf8());
  }

  m_netAccess->post(request, getTimeline());
}
Esempio n. 9
0
void MainWindow::handle_prevAction_triggered()
{
        Timeline::OMapClip orderedClips = getTimeline().getOrderedClips();
        int currentTime = _time;
        bool firstClip = true;

        BOOST_FOREACH( const Timeline::OMapClip::value_type& s, orderedClips )
        {
                if( s.first < currentTime )
                {
                        firstClip = false;
                        _time = s.first;
                        if( ( *s.second )->timeOut() < currentTime )
                                _time = ( *s.second )->timeOut();
                }
                else
                        break;
        }

        if( !firstClip )
                Q_EMIT timeChanged( _time );
}
void ofxTLKeyframes::quantizeKeys(int step){
	for(int i = 0; i < keyframes.size(); i++){
		setKeyframeTime(keyframes[i], getTimeline()->getQuantizedTime(keyframes[i]->time, step));
	}
}
void ofxTLTrackHeader::draw(){
	ofRectangle trackRect = track->getDrawRect();

	float footerStartY = trackRect.y + trackRect.height;
	footerRect = ofRectangle(bounds.x, footerStartY, bounds.width, footerHeight);
	if(footerRect.width != footerStripeWidth){
		recalculateFooterStripes();
	}

	ofPushStyle();

	if(track->hasFocus()){
		ofFill();
		ofSetColor(timeline->getColors().highlightColor, 50);
		ofRect(bounds.x, bounds.y, bounds.width, bounds.height);
	}

	// TODO: set these somewhere else instead of setting it every frame here
    // set name if it's empty and we're not editing
    if(nameField.text != track->getDisplayName() && !nameField.isEnabled()){
    	nameField.text = track->getDisplayName();
    }

	if(timeline->areHeadersEditable() && !nameField.isEnabled()){
		nameField.enable();
	}

	if(!timeline->areHeadersEditable() && nameField.isEnabled()){
		nameField.disable();
	}

    if(nameField.isEditing()){
    	track->getTimeline()->presentedModalContent(this);
    }


    nameField.bounds.x = bounds.x;
    nameField.bounds.y = bounds.y;
	ofNoFill();
	if(bounds.height == 0){
		ofSetColor(getTimeline()->getColors().textColor, 100);
	}
	else{
		ofSetColor(getTimeline()->getColors().textColor);
	}

	if(getTrack()->getDrawRect().height > 0 || bounds.height > 0){
	    nameField.draw();
	}

	ofSetColor(track->getTimeline()->getColors().outlineColor);
	ofRect(bounds);

	//draw grippy lines on the footer draggable element
	if(footerHeight > 0){
		if(draggingSize){
			footerStripes.setStrokeColor(track->getTimeline()->getColors().highlightColor);
			footerStripes.draw(footerRect.x, footerRect.y);
		}
		else if(hoveringFooter){
			footerStripes.setStrokeColor(track->getTimeline()->getColors().outlineColor);
			footerStripes.draw(footerRect.x, footerRect.y);
		}
	}
	ofPopStyle();
}
Esempio n. 12
0
TimeValue
ViewerNode::getTimelineCurrentTime() const
{
    TimeLinePtr timeline = getTimeline();
    return TimeValue(timeline->currentFrame());
}
Esempio n. 13
0
const animation::CTimeline& AnimationStateMachine::getTimeline()
{
    auto node = getNode();
    return node->getTimeline();
}