Finished keyframe support, although not tested too much

Originally committed to SVN as r578.
This commit is contained in:
Rodrigo Braz Monteiro 2006-12-18 18:47:45 +00:00
parent 90d7d02926
commit 2f9a086a22
3 changed files with 11 additions and 1 deletions

View file

@ -33,6 +33,7 @@ Please visit http://aegisub.net to download latest version
- Renaming a style will now ask you if you want to rename all instances of it on the script. (AMZ)
- Style name collisions (when moving from storage, creating or renaming) will now prompt the user before performing the action. (AMZ)
- Added global hotkey for Video Play (default Ctrl+P). (AMZ)
- Added support to save and load keyframe list files. (AMZ)
= 1.10 beta - 2006.08.07 ===========================

View file

@ -772,6 +772,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
subs->GetScriptInfo(_T("Video Zoom")).ToLong(&videoZoom);
wxString curSubsVideo = DecodeRelativePath(subs->GetScriptInfo(_T("Video File")),AssFile::top->filename);
wxString curSubsVFR = DecodeRelativePath(subs->GetScriptInfo(_T("VFR File")),AssFile::top->filename);
wxString curSubsKeyframes = DecodeRelativePath(subs->GetScriptInfo(_T("Keyframes File")),AssFile::top->filename);
wxString curSubsAudio = DecodeRelativePath(subs->GetScriptInfo(_T("Audio File")),AssFile::top->filename);
wxString AutoScriptString = subs->GetScriptInfo(_T("Automation Scripts"));
@ -808,7 +809,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
// Check if there is anything to change
int autoLoadMode = Options.AsInt(_T("Autoload linked files"));
bool hasToLoad = false;
if (curSubsAudio != audioBox->audioName || curSubsVFR != VFR_Output.GetFilename() || curSubsVideo != videoBox->videoDisplay->videoName) {
if (curSubsAudio != audioBox->audioName || curSubsVFR != VFR_Output.GetFilename() || curSubsVideo != videoBox->videoDisplay->videoName || curSubsKeyframes != videoBox->videoDisplay->GetKeyFramesName()) {
hasToLoad = true;
}
@ -838,6 +839,9 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
}
}
// Keyframes
LoadKeyframes(curSubsKeyframes);
// Audio
if (curSubsAudio != audioBox->audioName) {
if (curSubsAudio == _T("?video")) LoadAudio(_T(""),true);
@ -873,6 +877,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
subs->SetScriptInfo(_T("Video Zoom"),zoom);
subs->SetScriptInfo(_T("Video Position"),seekpos);
subs->SetScriptInfo(_T("VFR File"),MakeRelativePath(VFR_Output.GetFilename(),AssFile::top->filename));
subs->SetScriptInfo(_T("Keyframes File"),MakeRelativePath(videoBox->videoDisplay->GetKeyFramesName(),AssFile::top->filename));
// Create list of Automation scripts
wxString scripts;
@ -1031,6 +1036,7 @@ void FrameMain::LoadKeyframes(wxString filename) {
// Set keyframes
videoBox->videoDisplay->SetOverKeyFrames(keyFrames);
videoBox->videoDisplay->SetKeyFramesName(filename);
// Set FPS
if (!videoBox->videoDisplay->loaded) {

View file

@ -75,6 +75,7 @@ private:
bool overKeyFramesLoaded;
wxArrayInt KeyFrames;
wxArrayInt overKeyFrames;
wxString keyFramesFilename;
clock_t PlayTime;
clock_t StartTime;
@ -108,6 +109,8 @@ public:
void CloseOverKeyFrames();
bool OverKeyFramesLoaded();
bool KeyFramesLoaded();
wxString GetKeyFramesName() { return keyFramesFilename; }
void SetKeyFramesName(wxString name) { keyFramesFilename = name; }
VideoProvider *provider;