LineExtraction.h header
#include <ew/app/LineExtraction.h>
Namespace ew::app
Functions
std::vector< ew::core::voice::VoiceLine > ew::app::voice::extractLines(const ew::core::branching::BranchScene &scene)
Pulls the speakable lines out of scene, in reading order.
Only Line and Choice nodes carry text an actor reads. A Condition's text is the author's label for a fork the reader never sees, a Jump's is a note about where it goes, and a Hub's is a place-marker for where threads rejoin – sending any of those to a studio would have someone paid to read stage directions aloud.
Each extracted line carries the scene as its sourceId, so a director looking at a line list can be sent back to where it lives.
Speaker is left null. A branch node does not record who says it, and guessing – from the scene's title, or from a name at the start of the text – would put a wrong name on a recording sheet, which is worse than an empty column somebody fills in.
std::vector< ew::core::voice::VoiceLine > ew::app::voice::mergeExtracted(const std::vector< ew::core::voice::VoiceLine > &existing, const std::vector< ew::core::voice::VoiceLine > &extracted)
Merges extracted into existing, preserving takes already recorded.
Re-extracting must not throw away a recording day. Lines are matched by their text: a line whose wording is unchanged keeps every take against it, a genuinely new line arrives with none, and a line whose text was edited arrives as new – which is correct, because the recording that existed was made against wording that no longer exists.
Lines in existing that no longer appear are dropped, since a line cut from the story is not a line to record. Their takes go with them, and Edit > Undo is what a writer uses if the cut was a mistake – the alternative, keeping every line ever written, makes the list useless by the end of a project.