void JokerWindow::on_actionChange_timestamp_triggered() { hideMediaPanel(); setCurrentRate(0); PhTime time = _synchronizer.videoClock()->time(); #ifdef USE_VIDEO if(_synchronizer.videoClock()->time() < _videoEngine.timeIn()) time = _videoEngine.timeIn(); else if(_synchronizer.videoClock()->time() > _videoEngine.timeIn() + _videoEngine.length()) time = _videoEngine.timeOut(); PhTimeCodeDialog dlg(_doc->videoTimeCodeType(), time); if(dlg.exec() == QDialog::Accepted) { PhTime timeStamp = 0; if(_synchronizer.videoClock()->time() > _videoEngine.timeIn() + _videoEngine.length()) timeStamp = dlg.time() - (_videoEngine.length() - PhTimeCode::timePerFrame(timeCodeType())); else if (_synchronizer.videoClock()->time() < _videoEngine.timeIn()) timeStamp = dlg.time(); else timeStamp = _videoEngine.timeIn() + dlg.time() - _synchronizer.videoClock()->time(); _videoEngine.setTimeIn(timeStamp); setCurrentTime(dlg.time()); _doc->setVideoTimeIn(timeStamp, timeCodeType()); _mediaPanel.setTimeIn(timeStamp); _doc->setModified(true); } #endif fadeInMediaPanel(); }
void PhMediaPanel::onSliderChanged(int position) { PhFrame frame = (PhFrame)position; if(_clock) _clock->setFrame(frame); emit goToFrame(frame, timeCodeType()); }
void JokerWindow::on_actionTimecode_triggered() { hideMediaPanel(); PhTimeCodeDialog dlg(timeCodeType(), currentTime()); if(dlg.exec() == QDialog::Accepted) setCurrentTime(dlg.time()); fadeInMediaPanel(); }
bool JokerWindow::openVideoFile(QString videoFile) { QFileInfo lastFileInfo(_doc->videoFilePath()); QFileInfo fileInfo(videoFile); if (fileInfo.exists() && _videoEngine.open(videoFile)) { PhTime videoTimeIn = _videoEngine.timeIn(); if(videoTimeIn == 0) { /* the video itself has no timestamp, and until now we have not * propagated the doc videoTimeIn to the videoEngine */ videoTimeIn = _doc->videoTimeIn(); _videoEngine.setTimeIn(videoTimeIn); _videoEngine.clock()->setTime(videoTimeIn); /* ask the user if he wants to change the video time in */ if(fileInfo.fileName() != lastFileInfo.fileName()) { on_actionChange_timestamp_triggered(); videoTimeIn = _videoEngine.timeIn(); } } if(videoFile != _doc->videoFilePath()) { _doc->setVideoFilePath(videoFile); _doc->setVideoTimeIn(videoTimeIn, timeCodeType()); _doc->setModified(true); } _videoEngine.clock()->setTime(videoTimeIn); _mediaPanel.setTimeIn(videoTimeIn); _mediaPanel.setLength(_videoEngine.length()); _settings->setLastVideoFolder(fileInfo.absolutePath()); return true; } return false; }
void PhMediaPanel::onTCTypeComboChanged() { emit timeCodeTypeChanged(timeCodeType()); }
void PhMediaPanel::onTCTypeComboChanged() { if(_clock) _clock->setTimeCodeType(timeCodeType()); emit timeCodeTypeChanged(timeCodeType()); }