stories.json now encodes the duration for a transform so that the time code of the event isn't also controlling the time that the transform runs.
This commit is contained in:
parent
088f9e022e
commit
0fefc83c36
4 changed files with 17 additions and 17 deletions
|
|
@ -9,19 +9,18 @@
|
||||||
"[g|h|i]"
|
"[g|h|i]"
|
||||||
],
|
],
|
||||||
"beats": [
|
"beats": [
|
||||||
["00:00", "a","pan"],
|
["00:00", "a","pan", "60"],
|
||||||
["00:01", "a","shake"],
|
["00:01", "a","shake", "30"],
|
||||||
["00:02", "a","pause"],
|
["00:5", "g","pan", "60"],
|
||||||
["00:03", "g","pan"],
|
["00:6", "h","pan", "60"],
|
||||||
["00:04", "h","pan"],
|
["00:7", "h","bounce", "60"],
|
||||||
["00:05", "h","bounce"],
|
["00:8", "c1","pan", "60"],
|
||||||
["00:06", "c1","pan"],
|
["00:9", "c2","pan", "60"],
|
||||||
["00:07", "c2","pan"],
|
["00:10", "d","bounce", "60"],
|
||||||
["00:08", "d","bounce"],
|
["00:11", "e","shake", "60"],
|
||||||
["00:09", "e","shake"],
|
["00:12", "i","pan", "60"],
|
||||||
["00:10", "i","pan"],
|
["00:13", "i","shake", "60"],
|
||||||
["00:11", "i","shake"],
|
["00:14", "i","bounce", "60"]
|
||||||
["00:12", "i","bounce"]
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
namespace cinematic {
|
namespace cinematic {
|
||||||
using animate2::Animate2, std::string, std::min, std::clamp;
|
using animate2::Animate2, std::string, std::min, std::clamp;
|
||||||
|
|
@ -120,8 +121,8 @@ namespace cinematic {
|
||||||
anim.sequences.clear();
|
anim.sequences.clear();
|
||||||
anim.forms.clear();
|
anim.forms.clear();
|
||||||
|
|
||||||
for(auto& [timecode, cell, transform] : story.beats) {
|
for(auto& [timecode, cell, transform, duration] : story.beats) {
|
||||||
animate2::Sequence seq{.frames={0}, .durations={60}};
|
animate2::Sequence seq{.frames={0}, .durations={std::stoi(duration)}};
|
||||||
anim.sequences.try_emplace(timecode, seq);
|
anim.sequences.try_emplace(timecode, seq);
|
||||||
|
|
||||||
animate2::Form form{timecode, transform};
|
animate2::Form form{timecode, transform};
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ namespace components {
|
||||||
std::string image;
|
std::string image;
|
||||||
std::string audio;
|
std::string audio;
|
||||||
std::vector<std::string> layout;
|
std::vector<std::string> layout;
|
||||||
std::vector<std::array<std::string, 3>> beats;
|
std::vector<std::array<std::string, 4>> beats;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Combat {
|
struct Combat {
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ namespace storyboard {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI::track_audio() {
|
void UI::track_audio() {
|
||||||
auto& [timecode, cell_name, form] = $story.beats[cur_beat % $story.beats.size()];
|
auto& [timecode, cell_name, form, _] = $story.beats[cur_beat % $story.beats.size()];
|
||||||
auto track_head = $audio->getPlayingOffset();
|
auto track_head = $audio->getPlayingOffset();
|
||||||
|
|
||||||
auto next_beat = parse_time_code(timecode);
|
auto next_beat = parse_time_code(timecode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue